- Clone the repository
- Set up a Google Cloud project
- Deploy the terraform in
/infra
to the project - Get the service account key json for the Pi service account
Your Pi needs to have Node and npm installed.
- Clone the repository to your Pi.
- Copy the Service Account key to the Pi
- Edit the
src/pi-controller/start.sh
file so the key location matches for your Pi. - To run on the Pi, use
sudo sh start.sh
. Pi requires that you have sudo access to the board in order for the code to access Bluetooth - Turn on the train, it should connect automatically!
- Open Google Cloud console and navigate to BigQuery.
- To test a set of functions after the train is completed, run
CALL train_telemetry.run_the_train(trainX);
wheretrainX
is the train you have (typically train1 unless you have multiple connected to the same controller). - Open the
telemetry_data
table to see real time state changes from the train.
Thanks to Nathan Kellenicki(@nathankellenicki) and his fleet of supporters building the PoweredUp package. (https://github.com/nathankellenicki/node-poweredup)