A quick one-day hack to remote-control my son's Bluetooth RC car from a gamepad in the browser, instead of its original remote.
Archived — a one-day hack from January 2018, not maintained or generalized beyond this specific car.
index.js: a small Express server that opens a serial connection to the car's HC-06 Bluetooth-serial module and writes wheel-power bytes on a 50ms loop. ExposesGET /move/:left,:rightto set left/right wheel power.client/: a static page that reads the browser Gamepad API, converts joystick input into differential-drive wheel values, shows a live SVG direction/power indicator, and posts moves to the server.bt-*-poc.js,serial-poc.js,bt-car-notes.md: throwaway proof-of-concept scripts and notes from exploring different Bluetooth/serial Node libraries before settling onserialport.
Node.js + Express + serialport on the server; plain JS/HTML/SVG + jQuery (webpack-bundled) on
the client, using gamepad-api-mappings for Gamepad API support.
npm install
node index.jsTwo values in this repo are specific to the physical car this was built for, and need to be changed for any other one:
- The serial device path is hardcoded in
index.jsas/dev/tty.HC-06-DevB(a macOS path — adjust for your platform/device). bt-car-notes.mdrecords this particular HC-06 module's own Bluetooth address (71-a9-01-12-c4-a5) from pairing — it's the toy's module address, not a secret, but it won't match a different car.
MIT (per package.json; no separate LICENSE file is included).