Some code to control a jumperless breadboard through stream chat commands
clone the repo, configure a virtual environment with python -m venv ./venv and activate it with source ./venv/bin/activate
install the requirements with pip install -r requirements.txt
run jumperlesschat which should be on the venv PATH or run python chat.py with at least one following service options AND the -D flag with the path to the REPL serial device from your jumperless (typically the third serial device)
usage: JumperlessV5 chat handler [-h] [-D DEVICE] [-l] [-b] [-yt YOUTUBEID] [-t]
Connect JumperlessV5 to your stream chat!
options:
-h, --help show this help message and exit
-D, --device DEVICE specify the serial device to use (normally /dev/ttyACM2)
-l, --local run a local prompt for testing and control
-b, --bypass bypass the ACL in the local session
-yt, --youtubeid YOUTUBEID
connect to a YouTube stream, provide the ID portion of the URL
-t, --twitchchannel connect to the twitch API with token in environment
The Jumperless Streamchat application can be used with a local terminal prompt input, connected to a youtube livestream chat, or connected to Twitch chat. All three can be done simultaneously simply ensure you have the correct environment variables set and then pass the required parameters at runtime.
Follow the directions here to register a twitch app, ensure the OAuth Redirect URLs is set to http://localhost:17563
export your twitch AppID, API key and Channel name to the following environment variables prior to launching the application
TTV_APPID={client_id}
TTV_AUTH={client_secret}
TTV_CHANNEL={channel_name}
Launch the application with the -t flag
Considerably easier, simply pass the ID of a youtube livestream to the -yt flag like so:
jumperlesschat -yt '5ZSY4MIg0Iw' -D /dev/ttyACM2
chat commands start with an exclamation point ! and are followed by the function and parameters as specified in the jumperless documentation.
actions can be mostly any function from the jumperless micropython API
refer to the available_commands.txt file to see a complete list of allowed functions, constants, and rows.
!connect(GND, 1)
!disconnect(T_RAIL, 5)
!connect(6, B_RAIL)
!connect(7,TOP_RAIL)
!connect(T_RAIL, -1)
there is a dictionary in the acl.py which will allow any item within to be handled by the jumperless via chat commands. If you wish to prevent a certain function, constant, or row from being used then be sure to remove it from the acl definition