- 1 Subsystems
- 2 Power
- 3 Audio
- 4 Electrical
- 5 Control Model
- 6 OBS automation
- 7 Arduino
- 8 Software
- 9 Webcam Adjustment
- 10 Config Files
- 11 Controllers
- 12 notes
- 13 Networking
- 14 Neuro
BIOS setting for Auto-on with power-on (e.g. from switch)
- Ground everything and very well, especially anything the human touches.
The streaming PC uses OBS to stream, and there is a python websockets library which can control it. This library and a serial command interface known as CmdMEssenger is used to communicate with an Arduino Mega so the Mega can indicate signals to control OBS through a small python script. CmdMEssenger implements a messaging protocol to trigger functions via commands sent over Serial.
The Arduino Mega is effectively a slave to a python server on the streaming PC. The Arduino will set and clear bits in an array which is communicated to the streaming server via the server polling the Mega. The server is continuously polling the Mega and performs actions based on it's state and the information in the status array.
A user pushed a green button on the cabinet front panel to start (or stop) streaming. The Mega debounces and latches the button press and sets status bit 11. The stream server reads this bit which determines is a button press occurred. If the machine is streaming, the steam will be stopped (and the scene in OBS changed to "Not Live"). If the machine is not streaming, the stream will be started and the scene in OBS switched to "Live".
A script that controlls the lights, makes sure that the stream is off and goes into attract mode by showing a screen saver on the rasperry pie. Script is as follows: // TODO fill out how this works
A PIR sensor is attached to the cabinet under the player controls. The sensor feeds data back to the Arduino Mega which monitors the signal for movement. As movement occurs, a timer is reset and status bit 12 is set to 1. If the timer is not reset within 15ms, the Mega sets status bit 12 to 0, which tells the stream server to stop the stream
Emulation Station Customizations
//TODO fill out how this works
A script that automatically exits the game correctly. Then goes back into attact mode. Script is as follows: //TODO add script here
A timer that counts down when no one is active to not be stuck in a game but go back to attract mode. //TODO fill in more technical details
Guardian Process - Windows OBS restart automatically on fail strategy
Windows Task Scheduler starts the stream server automatically on the stream pc.
Windows-r to bring up run dialog
look for Launch NGALAC server task
Task should run automatically but if not, can run manually with right-click run or the green play button on bottom right panel. If it asks you to close all instances, say yes
|OBS Web Socket Plugin||Sets up a websocket API for OBS|
|obs-wc-rc||Python library to interface with OBS websocket API|
|PyCmdMesssenger||Python library for CmdMessenger using serial port|
|CmdMessenger for Arduino||Arduino CmdMessenger library to communicate with PyCmdMessenger on server via serial port|
OBS websocket plugin
Query and send commands to OBS from python (can theoretically control everything)
credentials for the stream websocket interface are required.
rtmp server setup
The arduino code is located in c:/Users/NGALAC-LIVE/projects/ngalac/prod
The main file is arduino_controller.ino, and lights.cpp controls the lights only.
- Debounce buttons
- better debounce - digital filter based
- Pressure switch for "player in front of machine"
- Note: arduino.ArduinoBoard(enable_dtr=False) See: ##Known Issues in PyCmdMessenger
Arduino code using CmdMessenger library for talking through serial port to python orchestrator
Python code to pair with CmdMessenger
First 3 states are switches set high or low
Last 3 are LED states (or anything else)
Can trigger LED strips or whatever else as we wish, run pre-defined patterns, etc.
Arduino IDE 1.8.1+ * CmdMessenger Python 3.5.4+ * vitualenv, virtualenvwrapper-win, PyCmdMessenger, obs-ws-rc Git
Please see https://github.com/noisebridge/NGALAC for all relevent code
Using a servo hooked up to the Leonardo to move adjust the webcam height via some kind of potentiometer.
right now servo is a radio [s]hack 08A14.
- evtest to check inputs from the IPAC-2 on rpi
- add player 2 keys to retropi retroarch config
maybe physically generate a plug/unplug signal via detection to arduino and trigger this: https://zedt.eu/tech/linux/restarting-usb-subsystem-centos/
arduino triggering done by detecting various grounding or other (is there a power? must be.) for each controller, then sending that to arduino, then to pi.
usb stuff - polling on rpi
keep alives for obs, obs restart on power on, rpi watchdog, faulover OBS instance, switched by obswsrc cannot connect. how will this work with auto start, and how to select which instance is stealing?
static electricity on case
Arduino COM port detection on streaming PC in python
Do we want to record and stream?
Hwinfo for monitoring streaming PC? whyzit shuttin dwn.
4/7/18 added obs to restart on crash and moved lauch_obspy to restart_obs.bat
add rpi input detection and set timer to tell stream PC to stop streaming (probably through Arduino or API call)
ACTION=="add", SUBSYSTEMS=="usb", KERNELS=="6-5:1.0", SYMLINK+="input/joy"
udevadm test -a /sys/path or /dev/path
udevadm test /dev/thing i think
udevadm info --name /dev/thing --query=property
udevadm info --a --name= /dev/thing
udevadm trigger --verbose -dry-run --type=devices --subsystem-match=usb
udevadm monitor --kernel, --udev, or --subsystem-match=usb
- Raspberry Pie not auto-connecting to net by default. Should it?
- nginx w/ rtmp to restream