This file describes how to set up the Scalextric game.
This system operates by having the RFID reader send tag reads to the laptop (server). The server runs a Docker image written in Dart, which acts as the central hub. It includes a database to store overall lap times and individual fastest laps. All communication is routed through this server, meaning the front-end app and RFID reader do not communicate directly.
The front-end app, developed in Flutter, allows for basic configuration. To update configuration settings while the app is running, long-press the settings button on the leaderboards page.
Connect RFID reader, android kiosk and laptop to the TP Link router using the orange LAN ports. Once connected, they should be assigned IP addresses as shown in the table above.
This is a git repo. I may have made more changes since this was last updated. To check this, run git pull in the terminal (you will need internet connection). If there are changes:
- Run
docker compose downand thendocker compose up --build -d. This will rebuild the backend and restart the server. - Rebuild the app. Hopefully, the apk in the top level directory will be the latest build, but if you need to rebuild it:
cd packages/frontend
flutter build apk --target-platform android-arm64
cp build/app/outputs/flutter-apk/app-release.apk ../../app.apk
cd ../..To install this, run adb install app.apk.
If you want to copy files, such as images to the KC50, use the following command:
adb push /FILENAME /COPIEDNAME
For instance, to copy the devcon logo, I used the command:
adb push packages/frontend/assets/devcondark.png /sdcard/Download.
The app supports custom images for cars 1 and 2, the track and a branding image. This branding image must be a black background and be in landscape.
- Navigate to the RFID Reader web portal
- Login with password
- Turn on connection to server: Communication -> Zebra IoT connector -> Connection -> Disable
Autoconnectand the click 'Connect'. You may have to enter your password again.It is not recommended to turn on Auto Connect
The following notes should only be needed in a catastrophe. Hopefully the staging will always be set up in advance.
- If device is brand new, follow the on screen set up guide. Device can be set up offline.
- Ensure device is running Android 13 (flutter datawedge not currently working on Android 14).
- Connect Ethernet: Settings -> Network and Internet -> Ethernet -> Turn on
- Set display scaling: Settings -> Display -> Display size and text -> Set display size to smallest value.
- Set display brightness: Settings -> Display -> Turn off "Adaptive Brightness" and set the brightness level slider to the desired value.
- Turn off vibration: Settings -> Sound and Vibration -> Vibration and haptics -> Use Vibration and haptics - Off. I would also recommend musting all of the volume sliders at the top apart from media volume.
Optional If you need to debug the application, follow these steps
- Enable developer mode: About Phone -> Tap build number 7 times.
- Enable USB Debugging: System -> Developer Options -> USB Debugging -> Allow
- Now you should be able to run the flutter app. See Frontend for more information.
Create IOT configuration:
-
Navigate to the RFID Reader web portal
-
Login with password
-
Navigate to: Communication -> Zebra IoT Connector -> Configuration
-
Select 'Add Endpoint'
-
Select Endpoint type: MQTT. Endpoint name and description can be set to any values
-
Apply the following settings: Server: 192.168.0.101 Port: 1883 Protocol: TLS Client Id: rfid Username: zebra Password:
-
Navigate to Topics section. Apply the following topics: Tag Data events:
- Topic: /rfidManagement:
- Command: Topic: /rfid/control - Response: Topic: /rfid/control-resp -
Leave all other options blank.
-
Save / apply settings
-
In the interface Configuration, set
Tag Data Interface 1andManagement Events Interfaceto be the name of the configuration you just created. -
Navigate to Communication -> Zebra IoT Connector -> Connection. Disable Autoconnect, and then click connect. You may have to enter the password again.
The camera should be using IP address 192.168.0.106. This will save images into an FTP server which is hosted within docker. This FTP server saves files onto the linux laptop directory /home/scalextric/Desktop/dmo-scalextric/docker/ftp. The app will show whatever jpg image is placed into that directory.
If images are not appearing: first ensure the camera is visible on the network - using the linux laptop navigate to its IP address in the browser. If the camera is connected, check if it is alerting to FTP failing. If that is the case, most often the issue is due to permissions on the folder. Ensure the user has read and write access to the folder where images are saved.
docker compose up
If you get error
external volume "db" not found, run:docker volume create db
If you need to rebuild the image:
docker compose up --buildYou should only need to build the image on the first run on a new machine, or when changes have been made to the backend.
On the first run, you will need to send a GET request to the /setup endpoint. This will initialize the database. If you think you already have a database, this will delete it.
GET http://localhost:13000/setup