An application for live-coding some LEDs in the Recurse Center space.
The application has three components:
- Javascript client: for sending websocket data for lights
- A server on a teensy board for handling websocket connection and powering lights
- A MongoDB server for persisting code
There is an additional branch called simulator
which has a 3D simulator written in THREE.js that you can access online at thundertube.now.sh
.
(Maintained by @strickinato)
It's all run on a raspberry pi on the Recurse LAN. ([email protected])
npm install
node server/index.js
Now go to http://localhost:5000
The client uses code mirror for the editor. For the client dependencies, we don't use a build script and instead they're directly referenced from the the source code in client/lib directory. See the index.html
for how they're included.
The hardware is a prototype of Max D's (F2'18) LEDRiver project - which is based around a Teensy3.2 board.
(Done on Mac v10.13.16)
Install the arduino editor. Then install the teensy extension
Go to Tools → Manage Libraries, then search for and install SSD1306Ascii Then, in /Applications/Arduino.app/Contents/Java/libraries/, delete Ethernet/ and SD/
Install the following in ~/Documents/Arduino/libraries/:
- https://github.com/chrisstaite/TeensyDmx
- https://github.com/brandenhall/Arduino-Websocket
- https://github.com/bblanchon/ArduinoJson
- https://github.com/sstaub/TeensyID
Now open the Arduino IDE, and select Tools → Board → "Teensy 3.2"
- There are many modes. A button on the side controls what mode we're in. Thundertube expects "websocket control mode"!
- Try unplugging and plugging back in!
This is hosted on mongo.
The raspberry pi by default has LXDE, a linux distro that is heavily built around the Desktop Manager Open Box. In order to set it up to launch our page right away, we took some of the following common raspberry pi steps.
alt+f4
- close windowalt+ctrl+f1
- jump out of Desktop Manager to TTY- Right click on things - the context menus are great
You should be able to find this Raspberry Pi on the Recurse Network. It's called thundertube
This is done by simply editing /etc/hostname
.
This means you can SSH into the pi if you're on the Recurse Center network. Use ssh [email protected]
The password for the pi user is the same as the password for the Recurse Center network.
Enabling SSH on raspberry pi's can be done by adding a file named ssh
to the root directory.
As soon as the raspberry pi boots, it should launch our page. This is accomplished by running our startup script
sudo raspi-config
> Boot Options > Desktop / CLI > Desktop AutoLogin- Edit
~/.config/lxsession/LXDE/autostart
# These prevent screen from turning off
@xset s off
@xset -dpms
@xset s noblank
/home/pi/thundertube/startup.sh