Skip to content

Volcano Show

Mark Boszko edited this page Aug 15, 2018 · 39 revisions

This is all very much a WIP. I need to go back and document stuff I've already done.

Parts

Raspberry Pi Setup

System Setup

  • Install Raspbian:
    • Installing with NOOBS
    • Download the NOOBS Installer. I used V1.9.0, released 2016-03-18.
    • Unzip the NOOBS package.
    • Download and use SD Formatter to format the SD card as FAT. I named it TIKINOOK.
    • Copy all files from the NOOBS_v1_9_0 folder into the root of the SD card.
    • Eject the SD card and insert in the Raspberry Pi. Hook up the Pi to Ethernet, an HDMI display, and a USB keyboard and mouse, then connect the Micro USB power.
    • When NOOBS boots, check the box for Raspbian, and click Install. Confirm you want to overwrite the SD card.
      • Note: The full Raspbian install probably contains a lot of unnecessary stuff, but I haven't whittled down to exactly what I need for the Tiki Nook. Still, should be OK.
    • Go get a cup of coffee while Raspbian installs.
    • Click OK when done; the Pi will reboot.
  • Use the Adafruit Raspberry Pi Finder to connect to the headless Pi over the network and set up the bootstrap process.
    • Launch PiFinder.app (I'm on OS X)
    • Click Find My Pi!
    • Once it finds the Pi, change the Hostname (I use tikinook) and enter the Wi-fi SSID and password, and click Bootstrap!
    • As far as I can tell, PiFinder's Bootstrap did not change the hostname (the Pi remains at raspberrypi.local), and I'm not sure about the Wi-fi either. the other bootstrap stuff seemed to work though? its hard to tell, since the bootstrap terminal window disappears as soon as it finishes, so I cant see if there are any error messages.
  • On the Pi itself:
    • Menu > Preferences > Raspberry Pi Configuration
    • Change the password to something other than the default raspberry
    • Change the Hostname here to tikinook, because the PiFinder method didn't stick.
    • Interfaces > SPI > Enabled
    • Localization > Locale > Country > US
    • Timezone > Areas: US, Location: Pacific
    • Click OK and when it asks you to reboot, say Yes
  • Set up reserved LAN IP address
    • Find the Wi-fi MAC address of the RPi by running ifconfig wlan0. The MAC address is reported as HWaddr.
    • In AirPort Utility, click on the AirPort and then click Edit. Click on the Network tab, and under DHCP Reservations, click the .
      • Description: Tiki Nook
      • Reserve Address By: MAC Address
      • MAC Address: ab:cd:ef:01:23:45 (the address from wlan0)
      • IPv4 Address: 192.168.10.14 (or whatever IP address you'd like it to have)
    • This way, every time your RPi connects to the LAN, the AirPort will give it the same IP address.
  • Set up port forwarding for ssh
    • Not necessary, but I like to be able to get to ssh from outside of my home network.
    • In AirPort Utility, click on the AirPort and then click Edit. Click on the Network tab, and under Port Settings, click the .
      • Firewall Entry Type: IPv4 Port Mapping
      • Description: Tiki Nook SSH
      • Public TCP Ports: 8123 (or whatever port you prefer)
      • Private IP Address: 192.168.10.14 (the reserved IP address for your RPi)
      • Private TCP Ports: 22
    • Then you can connect from the outside by using ssh -p 8123 [email protected] (or whatever your WAN-facing IP address is)
  • Install VNC

Other Libraries

Wiring and Hardware

  • 2016-03-06 - Distributing power along one side of the nook shelves, so that we get better voltage and truer colors to more pixels
    • I don't really think this is working. According to Adafruit "Powering NeoPixels", I need 60 / pixel for max brightness on 294 pixels, which is ~18A. My current power supply is only 10A -- fine for most color work, but for bright white, it's not gonna work. (HAHAHA and my mains circuit is only 15A, so obviously this will work perfectly.)

2018 Changes

Upgrading to use python-osc for communication between TouchOSC on an iOS device, a Mac mini, and the Raspberry Pi, which means I have to use Python 3.4 or later.

Boot launch controller script

That also means I need to run the script with python3 at boot, instead of python, so I need to change the service that launches the script on boot.

Only, I forgot how I set it up in the first place! See here for the detective work.

To change it, edit the current crontab (don't forget to use sudo!):

$ sudo crontab -e

# Default crontab file contents, all commented out
# ...
# Then at the end:
@reboot sudo python /home/pi/tikinook/nook_controller.py

That last line should now be:

@reboot sudo python3 /home/pi/tikinook/nook_controller.py &

2018-08-14 pm, I've commented it out for now, so I can develop the new scripts without having to kill the boot-launched one.

Update firmware

Just to make sure everything is updated before we install the new Python, run:

$ sudo rpi-update

Before this update, I had a State: degraded in the systemctl status results. I ran systemctl --failed to see what was failing, and it was hciuart.service, something to do with the Bluetooth radio. After running rpi-update, the degraded status resolved itself.

Python upgrade

$ python3 --version
Python 3.4.2

If I'm going to use Python 3, let's upgrade to the latest 3.7.0 (as of 2018-08-14), so I don't have to do this again soon.

I'm installing with these instructions to build from source, but updating for Python 3.7.

Install the pre-requisites:

$ sudo apt-get update
$ sudo apt-get install build-essential checkinstall
$ sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

Download and extract Python 3.7.0:

$ cd /usr/src
$ sudo wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz
$ sudo sudo tar xzf Python-3.7.0.tgz

Compile Python. configure will take a while. make will take a long while. Go have dinner.

$ cd Python-3.7.0
$ sudo -s
# bash configure
# make altinstall
# exit

Upgrade numpy

TODO:

Install OSC

$ sudo pip3 install python-osc

Upgrade ws2801 code

I updated the paleopixels.py script, and it works, but the colors are all screwed up. I think in set_pixel_color_rgb() the char() stuff I added is not working on python3, and I need to return to the basics. It looks like Adafruit's ws2801 code has been updated for python3, so let's try getting that to work:

TODO: download WS2801.py and test it. Once it's working, update paleopixel.py to match.

Clone this wiki locally