This is an updated version of https://github.com/JamesNewton/BattleBot-Control/tree/patch-2 which started out as https://github.com/jmalins/BattleBot-Control
This new version is updated in a few "interesting" ways:
-
It supports recording and playback of your manual control. Press the red button, move the controls, click the recordin off, then under the gear, use one of the Save buttons and then the Animate buttons to play it back. You can also edit the recording in the text box on Settings panel. The format is [interval, [delay, left:right:weapon]]. The inner ,[] section can repeat as often as you like. They are saved in the file system as /1.JSON, /2.JSON, etc... and can also be edited, downloaded or uploaded in the file editor. If you create a /0.JSON file, it will be played back automatically on startup.
-
All the other advances from the prior repo, the onboard editor, the ping and GPIO sensors, etc... are still in there. https://github.com/JamesNewton/BattleBot-Control/tree/patch-2#development-setup
-
It compiles for both esp-8266 AND ESP32 under PlatformIO. And under Arduino IDE without some effort; see the ArduinoIDEv1 branch. The key is that the ESP32 has far more processing ower and will (eventually) support https web service which may allow access to the sensor (including the camera) on the cell phone. Another method of getting access to phone sensors is in the works.
You can program this with just Chrome! No IDE, no programs, no nothing. Just
- download the release files in the "esptool.zip" archive and extract them locally.
- open the manifest.json file and look at the "parts" section.
- go to: https://espressif.github.io/esptool-js/ and check the ports, then plug in the robot to the PC. It takes a USB A to micro A cable; and that needs to be a "data" type cable, not charge only version. When connected, the servos will spin and that can be a problem, because the USB port won't supply enough power. So disconnect the servos from the board temporarily. When you plug in, you should see a new port show up. Select that port and connect. Don't change the baud rate. Verify it detects the chip, and loads the stub.
- Copy in the offset for the first file (it takes decimal) listed in the manifest, and select the matching file.
- for each following file, press Add file, copy in the offset and select the file.
- Hit program, hold breath.
- When complete Reset or power cycle.
- Smile. (or cry and contact me for help)
You will need to install:
- Platforms: "Espressif 8266" and "Espressif 32"
- Boards: "nodemcuv2" for the NodeMCU (8266) and "node32s" for the DevKitC
Tested with:
"HiLetgo ESP8266 NodeMCU CP2102 ESP-12E"
"HiLetgo ESP-WROOM-32 ESP32 ESP-32S Development Board" - Libraries:
- teckel12/NewPing@^1.9.1
- me-no-dev/ESP Async WebServer @ ^1.2.3
- lorol/LittleFS_esp32 @ ^1.0.6
- madhephaestus/ESP32Servo @ ^0.9.0 (note issue with configuration corruption)
-
The USB connector prints debug data. Connect via e.g. PuTTY or screen to the com port at 115,200 baud, No parity, 8 data bits, 1 stop bit.
-
It will also accept commands to play back animation .JSON files. e.g. /1 will cause /1.JSON to play back.
-
The onboard edior is available by adding
/edit
to the URL.- To create a file, enter the file name (always start with "/") then press Create.
- To upload a file press Upload, select the file locally, and it will be added to the robot.
- To edit a file, select it on the left, then edit on the right, and be sure to click Save
- To rename or copy a file, create the new file, then slect the old file, select it's contents, copy them, and then select the new file and paste the content into it and save.
- To delete a file, right click it and select Delete.
-
Can connect to local WiFi router by adding a file (can create in onboard editor) called wifi.txt with the routers wifi SSID (name) and then a ":" and the password. e.g. mywifi:mypasssword. On restart, it wll connect to local wii and take the DHCP assigned wifi address. You can find that address by monitoring the serial debug data, from the router, or using an app like advanced-ip-scanner (Windows) or fing (iOS, Android)
-
The
loop
function in the /robot.js file can be used to add code which will be called regularly when the robot is being controlled. This is a great place to add code to read sensors, filter input, or other interesting code.
- Connecting servos to the NodeMCU's and connecting external battery power is much easier via this little RC Servo adapter PCB
- Steampunk Presentation on using the bot as an animation platform at Gaslight Gathering 2021
- Edcuational Course using the SDMG Bot
- Class on Arduino (esp), Servos, and the Bot at SDCoLab 2019
- Images / Videos of the "Cardboard Combat" origins with San Diego Makers Guild
- Steampunk version built at Gaslight Gathering 2019 (also 2021)
- https://www.youtube.com/watch?v=SbmjmV-a6yE demo of the ping sensor working
- https://youtu.be/kWHx6a_4-iI?t=1523 Presentation about the bot for the Seattle Robotics Society