Watch Tracked-Racer-App ↗ live.
Control your LEGO® Technic 42065 RC Tracked Racer with your Smartphone instead of using the included RC.
- Use a Progressive Web App as controller. Add it without further installation to your homescreen.
- Use Web standard communication with WebSockets
- Use cheap hardware components
- 42065 RC Tracked Racer
- A LEGO® Power Functions extension wire [8886]
- Amica NodeMCU ESP8266 - Important note: Not all ESP8266 development boards are compatible with the offered motor shields. Especially the sizing of the LoLin NodeMCU V3 doesn't fit together.
- ESP8266 NodeMcu V2 Motor Shield Board
- An elastic band to tie up NodeMCU and MotorShield the easy way with LEGO® bricks
- A bunch of wires
Plain LEGO® Technic 42065 chassis:
Assembled ESP8266 + Motorshield + LEGO® parts:
Details of ESP8266 + Motorshield + LEGO® parts:
You find further details of wiring LEGO® Power Functions for example here.
TODO further details
I tried various controller versions with the idea of using motion control abilities of my smartphone to control the vehicle:
Technically motion control works perfectly. - But in practise it was very unhandy for controlling the vehicle.
Finally the winner looks plain simpler:
Build Web-App with Polymer 3.0
Prerequisition: Polymer CLI
- Install all dependencies - Go to folder tracked-racer-app:
$ polymer install
- Test app locally in your browser.
$ polymer serve --open
Note: By design this app runs locally on ESP8266 and depends on a WebSocket served by the WebServer of the ESP. For production adjust the WS endpoint.
- Prepare for production
$ polymer build
- Upload app to ESP8266
Finally upload app from ESP8266/data/www folder to your ESP8266. Go to Arduino IDE Tools > ESP8266 Sketch Data Upload
Note: Close Serial Monitor of Arduino IDE before uploading data. Otherwise upload will interrupt.
Load sketch ESP8266.ino from ESP8266 folder in Arduino IDE.
Verify dependencies:
You can manage your additional includes by Arduino IDE Sketch > Include Library > Manage Libraries or you checkout dependencies yourself by git clone in your library folder of your Arduino sketchbook location.
Using git allows you to easily update all libraries at once:
ls | xargs -I{} git -C {} pull
With all dependencies provided the code should compile and is ready for upload.
- Browse to http://esp8266.local/ to load the app.