Raspberry Pi

The bitcoin node worked but is on hold until we can be sure of security. Notes archived below. Meantime here are some notes for playing with it until it’s needed again.

Startup Applications

The folder /usr/share/applications contains shortcuts to all installed programs.
All shortcuts which are copied to the folder /home/pi/.config/autostart will be started automatically after a reboot.

If the autostart folder is not there, just create it.

Disable Wi-fi and bluetooth.

If the gui methods are not working or not easy to find, use

:~ $ rfkill list
0: phy0: Wireless LAN
Soft blocked: yes
Hard blocked: no
1: hci0: Bluetooth
Soft blocked: yes
Hard blocked: no

If either is on, use sudo rfkill block wifi or sudo rfkill block bluetooth. Re-enable with sudo rfkill unblock wifi.

Make auto login

so we can use VNC without having to plug in screen, mouse, keyboard after boot:

  1. Go to Preferences > Raspberry Pi Configuration > System and check the checkbox auto login as current user.
  2. Same panel, switch to Interfaces tab and switch on VNC. May as well switch on SSH too while there. 

Or if SSH is active already, login with SSH then:

sudo raspi-config
Choose option 3: Boot Options
Choose option B1: Desktop / CLI
Choose option B2: Console Autologin
Select Finish, and reboot the pi.

Boot without monitor

It will not boot unless I plug in a monitor, at least until it has finished booting. I found two possible solutions to this:

Booting headless
If you are working headless then please note that per default the RPI4 no longer creates a video output display, as a RPI4 no longer switches to Composite when it doesn’t detect a HDMI device, so a /dev/fbN frame buffer node is not created.

So with default settings and no monitor attached, VNC will NOT work, as the booted RPI4 will not have a video output system that can be used by VNC.

Adding hdmi_force_hotplug=1 to /boot/config.txt solves the problem. The Pi4 running headless, will now be able to be accessed via VNC.

https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=58151&sid=ec118b286843110a1175ec84a250a7dc#p1485558

Force HDMI

Uncomment the below line in the file /boot/config.txt: this will make a display available so VNC will work.

#uncomment if hdmi display is not detected and composite is being output 
hdmi_force_hotplug=1

The latter probably requires a default resolution to be set in raspi-config (at least on the Pi4 – earlier models defaulted to VGA resolution).

Log2RAM

Moved to its own page.

PiKISS

https://github.com/jmcerrejon/PiKISS

There is also pi-apps.

Pi-Safe

and Pi-Safe


Set Up File Sharing

sudo apt-get install samba samba-common-bin

After installation configure the software by opening the file /etc/samba/smb.conf using the command:

sudo nano /etc/samba/smb.conf

Make sure you have the following parameters set:

workgroup = WORKGROUPwins support = yes

You can use anything as your workgroup name as long as it is alphanumerical and matches the workgroup you would like to join.

Setup folder to share

Next create the folder you would like to share. To create a folder called “share” in your home directory do the following:

mkdir ~/share

With the folder created we can now tell the Samba software to share it on the network. Open the file /etc/samba/smb.conf using the command:

sudo nano /etc/samba/smb.conf

Scroll to the bottom and add the following:

[PiShare]
 comment=Raspberry Pi Share
 path=/home/pi/share
 browseable=Yes
 writeable=Yes
 only guest=no
 create mask=0777
 directory mask=0777
 public=no

public access is not allowed via “public=no” – this means that anyone wanting to access the shared folder must login with a valid user.

In this case the valid user is the user called “pi”. To let Samba know that “pi” is a network user run the command:

sudo smbpasswd -a pi

And enter pi’s password twice (default: raspberry).

Change Forgotten Password(s)

On the boot partition of the SD Card, the hashes of the passwords are stored in /etc/shadow, usually towards the end of the file, e.g.

fred:$6$VHuVp9oAbI./.Rc7$FSkBM8Zd3AJoC3w/Mm2hsvuIdufd1rf.Vv2bA3e0kMGACZptC8A5Xt>
nx:*:18853:0:99999:7:::

All we need is the hash itself, which is the string in between the first 2 colons, in this case, $6$VHuVp9oAbI./.Rc7$FSkBM8Zd3AJoC3w/Mm2hsvuIdufd1rf.Vv2bA3e0kMGACZptC8A5Xt> nx

Get the hash from the same location in another system that you know the password for and then copy it and paste it over the existing one, then save the file, and replace the SD card in the pi. Boot up.

Cooling usb firmware update

$ unzip vl805_update_0137a8.zip
$ chmod a+x vl805
$ sudo ./vl805 -w vl805_fw_0137a8.bin
$ sudo reboot

The zip file includes the current shipping firmware (013701) in case you want to revert:

$ sudo ./vl805 -w vl805_fw_013701.bin
$ sudo reboot

sudo ./vl805 with no parameters displays the version of the currently running firmware. Note that this may differ from what’s in the EEPROM if you’ve just reprogrammed it but not rebooted.


Old Stuff

We have a raspberry pi 4 for the bitcoin node. Up and running Jan 16 2021.

Install Bitcoin

https://howchoo.com/bitcoin/run-bitcoin-full-node-raspberry-pi has better (for me at least) instructions than does bitcoin.org – I got Exec format error even though I got the ARM version and 64 bit. The curl link on that page worked fine.