Help a noob out with Pi3?

Posted by cirrus 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Now, this forum is in read-only mode. You find details Details hereContinue on /r/PirateBox
Help a noob out with Pi3?
September 20, 2017 06:36AM
Hello,

Just purchased a brand new Raspberry Pi3 with integrated wireless. Successfully flashed the most recent image to an SD card (piratebox_rpi2_1.1.3-1-19-03-2017.img), connected to my home router ethernet port, plus a screen / keyboard, and booted it up.

For some reason the IP address assigned to it was completely different than the 192.168.77.1 address in the documentation... not sure why. It assigned something like 10.0.1.37 I think? I was only able to find the PI's IP by logging in as alarm and typing
ip address

Anyway, I opened a terminal on my Mac and did
ssh 10.0.1.37
which seemed to work. It let me log in and I got the normal piratebox first time instructions. However using Chrome browser and trying to navigate to piratebox.lan/content I got a DNS error. I was only able to get to the home page by typing in the IP address [10.0.1.37]. Also, the file sharing upload didn't seem to work because there was no upload selector.

The last thing that was weird was that I had plugged in a brand new USB drive (Sandisk 64GB Cruzer Mini) to use as a hard drive for files and such. After bootup and during initial config, I typed
sudo /opt/piratebox/rpi/bin/usb_share.sh
and it gave me some message about UUID, like it thought there was 2 USB drives plugged in or something. How do you tell it which one to use?

Did I do something wrong in setup? Is it my home router? Any ideas how to fix so it matches what's supposed to happen in the documentation on [piratebox.cc]?

Many thanks from a noob!!



Edited 3 time(s). Last edit at 09/20/2017 08:11PM by cirrus.
Re: Help a noob out with Pi3?
September 23, 2017 07:17AM
Quote

For some reason the IP address assigned to it was completely different than the 192.168.77.1 address in the documentation... not sure why. It assigned something like 10.0.1.37 I think? I was only able to find the PI's IP by logging in as alarm and typing
No, everything is ok. Your home network is in the 10.0.1.x range. You will get a 192.168.77.1 address when you connect your computer to the PirateBox wifi network. The howto starts from the point, where you start working based on your home network, where you need to find the RPi's IP.

Quote

and it gave me some message about UUID, like it thought there was 2 USB drives plugged in or something. How do you tell it which one to use?

Was it this message:
Quote

You seem to have more than one valid ${FS} partition for a USB share:
"${UUIDS}\n"
Please make sure you have a USB thumb drive attached with a single ${FS} partition.
?

Do you see one partition on Windows/Mac? Unfortunately you can not tell the script which partition to be used. So if you see only one partition on the other computer, the new USB stick is configured in GPT mode, which might be reconfigured as old MBR mode... But before writing any instruction, I wait for your feedback.

best regards Matthias
Re: Help a noob out with Pi3?
September 28, 2017 05:24AM
Thanks for your reply Mathias.

After doing a bit of reading, I decided to skip the extra USB drive and just use the SD card's extra storage. So I reformatted / reimaged the SD card to start over. Still seems like I'm getting error messages, specifically with the setup. Here's a copy/paste of my terminal session:


user@debian:~$ ssh alarm@alarmpi
ssh: Could not resolve hostname alarmpi: No address associated with hostname

user@debian:~$ ssh alarm@192.168.77.1

*System seemed to hang, so I hit ctrl-C*

user@debian:~$ ssh alarm@10.0.1.37
The authenticity of host '10.0.1.37 (10.0.1.37)' can't be established.
ECDSA key fingerprint is ec:14:a5:29:07:75:fa:15:bd:b6:58:e8:81:a0:4d:c5.

Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added '10.0.1.37' (ECDSA) to the list of known hosts.
alarm@10.0.1.37's password:

____________________.__ __ __________
\______ \______ \__|___________ _/ |_ ____\______ \ _______ ___
| _/| ___/ \_ __ \__ \\ __\/ __ \| | _// _ \ \/ /
| | \| | | || | \// __ \| | \ ___/| | ( <_> > <
|____|_ /|____| |__||__| (____ /__| \___ >______ /\____/__/\_ \
\/ \/ \/ \/ \/

Website: [piratebox.cc] PirateBox Version: 1.1.3
Forum: [forum.piratebox.cc] RPi Image Version: 1.1.3-1
IRC: #piratebox irc.freenode.net Be open -- Share freely!

First Steps After Flashing
1. Change password of alarm user
> passwd
2. Enable Fake-Timeservice
2.1 Set date and time
# Disable network time sync
> sudo timedatectl set-ntp false
# Set time to "Mon May 23 17:42:00" (Format: CCYYMMDD hhmm)
> sudo date -s "20170523 1742"
> cd /opt/piratebox && sudo ./bin/timesave.sh ./conf/piratebox.conf install
2.2 Enable on startup
> sudo systemctl enable timesave
3. Enable the Kareha Image and Discussion Board
> sudo /opt/piratebox/bin/board-autoconf.sh
4. Enable USB thumb drive share OR extend SDCard
USB: > sudo /opt/piratebox/rpi/bin/usb_share.sh
SDCard: > sudo /opt/piratebox/rpi/bin/sdcard_share.sh
5. Enable UPnP Media Server
> sudo cp /etc/minidlna.conf /etc/minidlna.conf.bkp
> sudo cp /opt/piratebox/src/linux.example.minidlna.conf /etc/minidlna.conf
> sudo systemctl start minidlna
> sudo systemctl enable minidlna
6. Enable RealTimeClock timekeeping (needs DS3231 or 1307 RTC module!)
> sudo systemctl enable rpi_hwclock

[alarm@alarmpi ~]$ sudo timedatectl set-ntp false

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

[alarm@alarmpi ~]$ sudo date -s "20170927 0000"
Thu Sep 27 00:00:00 UTC 2017

[alarm@alarmpi ~]$ cd /opt/piratebox && sudo ./bin/timesave.sh ./conf/piratebox.conf install
[sudo] password for alarm:
initialize timesave file
Remember MAY have to cron active...
on OpenWrt run: /etc/init.d/piratebox enable

[alarm@alarmpi piratebox]$ sudo systemctl enable timesave
Created symlink /etc/systemd/system/multi-user.target.wants/timesave.service -> /etc/systemd/system/timesave.service.

[alarm@alarmpi piratebox]$ sudo /opt/piratebox/rpi/bin/sdcard_share.sh
Creating partitions..

Welcome to fdisk (util-linux 2.29.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): Partition type
p primary (2 primary, 0 extended, 2 free)
e extended (container for logical partitions)
Select (default p): Partition number (3,4, default 3): First sector (4194304-125042687, default 4194304): Last sector, +sectors or +size{K,M,G,T,P} (4194304-125042687, default 125042687):
Created a new partition 3 of type 'Linux' and of size 256 MiB.
Partition #3 contains a swap signature.

Command (m for help): Partition type
p primary (3 primary, 0 extended, 1 free)
e extended (container for logical partitions)
Select (default e):
Selected partition 4
First sector (4718592-125042687, default 4718592): Value out of range.
First sector (4718592-125042687, default 4718592): Last sector, +sectors or +size{K,M,G,T,P} (4718592-125042687, default 125042687):
Created a new partition 4 of type 'Linux' and of size 57.4 GiB.
Partition #4 contains a ext4 signature.

Command (m for help):
The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy

The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).

Reloading partition table
Ok, all partitions available
mkswap: /dev/mmcblk0p3: warning: wiping old swap signature.
Setting up swapspace version 1, size = 256 MiB (268431360 bytes)
no label, UUID=300e9bed-c20a-44a7-a122-8ec2f571a72d
Adding swap to fstab
Creating data partition
mke2fs 1.43.4 (31-Jan-2017)
/dev/mmcblk0p4 contains a ext4 file system
last mounted on /mnt/sdshare on Wed Feb 1 01:10:48 2017
Discarding device blocks: done
Creating filesystem with 15040512 4k blocks and 3760128 inodes
Filesystem UUID: 6fbc4155-e500-4238-a81a-9454fcc50418
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424

Allocating group tables: done
Writing inode tables: done
Creating journal (65536 blocks): done
Writing superblocks and filesystem accounting information: done

## Moving files...

OK. File last modified 1419 minutes ago. Updating now...
<html><body>ok</body></html>

[alarm@alarmpi piratebox]$ sudo /opt/piratebox/rpi/bin/sdcard_share.sh
ERROR: SWAP already exists

[alarm@alarmpi piratebox]$ sudo cp /etc/minidlna.conf /etc/minidlna.conf.bkp
[alarm@alarmpi piratebox]$ sudo cp /opt/piratebox/src/linux.example.minidlna.conf /etc/minidlna.conf
[alarm@alarmpi piratebox]$ sudo systemctl start minidlna
[alarm@alarmpi piratebox]$ sudo systemctl enable minidlna
Created symlink /etc/systemd/system/multi-user.target.wants/minidlna.service -> /usr/lib/systemd/system/minidlna.service.

[alarm@alarmpi piratebox]$ sudo systemctl enable rpi_hwclock
Created symlink /etc/systemd/system/multi-user.target.wants/rpi_hwclock.service -> /etc/systemd/system/rpi_hwclock.service.

---

So a few questions if you don't mind...

The setup script seemed to give me some partition errors, because in the terminal several lines were highlighted in red.

Is my box set up correctly and ready to use? I assume if I unplug it from my ethernet port, then just plug it in somewhere else, it will make it's own wifi hospot which you can connect to at piratebox.lan, correct?

Also, why cannot I connect via ssh to alarm@alarmpi, but I must use the IP?

Many thanks!
Re: Help a noob out with Pi3?
September 28, 2017 02:40PM
One other question Mathias... is it possible to show a popup / alert window when someone connects to my Piratebox's wifi hotspot?

I'd like to display a message that says something like, "Thanks for joining us, please visit [piratebox.lan] in your browser now."
Re: Help a noob out with Pi3?
October 01, 2017 09:59AM
Quote

The setup script seemed to give me some partition errors, because in the terminal several lines were highlighted in red.

Is my box set up correctly and ready to use?
1. yes, it seems ok.
2. A reason for the error on partitioning is running sd_share.bin twice. But it is written to fail without damaging any configuration.

Quote

I assume if I unplug it from my ethernet port, then just plug it in somewhere else, it will make it's own wifi hospot which you can connect to at piratebox.lan, correct?
PirateBox hotspot is independent from using the ethernet port, you should already see "PirateBox: share freely" on your open wifi list.

Quote

Also, why cannot I connect via ssh to alarm@alarmpi, but I must use the IP?
this depends on your infrastructure. Some router do automatically translate new hostnames to IP, some do not. It can also be helpful to have a mdns resolver installed on your client computer, but not necessarily needed.

Quote

One other question Mathias... is it possible to show a popup / alert window [at the new client] when someone connects to my Piratebox's wifi hotspot?
nope. This is bound to the OS dependent captive portal feature and PirateBox is circumventing this (for several reasons). On a plain os (without a captive portal function) you can not open a browser or something based on establishing a wifi connection.

best regards Matthias
TheExpertNoob (mobile)
Re: Help a noob out with Pi3?
October 04, 2017 12:10AM
Oddly enough, when I connect my Windows 10 computer to a PirateBox wifi hotspot, it will bring up the browser asking me to finish connecting to the internet (pulls up the piratebox.lan page). Probably a windows 10 thing/setting.
Re: Help a noob out with Pi3?
October 11, 2017 01:38PM
We are not faking the answer to Win10 right now, this is the reason why.