Resurrect your old Roomba! Add Wifi connectivity and control it from anyway!
Project has been done in Amiqual4Home Equipex Creativity Lab - https://amiqual4home.inria.fr/
-
ESP8266
-
or Spark Core with latest firmware updates :
sudo particle flash --usb cc3000 sudo particle flash --usb deep_update_2014_06
-
OR spark photon with latest firmware https://github.com/spark/firmware/releases
-
Roomba - here model R3MOD24A - Unfortunately, commands can be sent to Roomba trew UART but INPUT commands are not received : no activity on Roomba Tx
- MQTT broker - (do not use mosquitto 1.4.3 - hirotakaster/MQTT#13 )
TODO - Refer code to get pinout
- For this model, no input on external connector can be used to wake up roomba. Clean button is configured in pullup, when pressed it is grounded through 1k resistor. Connecting button input to D0 through 8k resistor gives control on it.
- A support has been done to put photon near DC connector
- After soldering it, roomba can be closed... Modification is now invisible. Photon led and buttons :
Commands can be sent either using MQTT protocol or using Particle API. For details refer : https://github.com/OpHaCo/roomba_wifi/blob/master/doc/iRobot_Roomba_500_Open_Interface_Spec.pdf
-
CMD_NAME =
-
AFTER THESE COMMANDS ROOMBA IS IN PASSIVE MODE
- GOHOME
- CLEAN
-
AFTER THESE COMMANDS ROOMBA IS IN SAFE MODE
- FORWARD
- BACK
- LEFT
- RIGHT
- STOP
- SONG
- VACUUMON
- VACUUMOFF
- VIBGYOR : leds
-
GAINCONTROL
-
FREECONTROL
-
POWERON
-
POWEROFF
Command line syntax :
curl https://api.spark.io/v1/devices/SPARK_CORE_ID/roombaAPI -d access_token='YOUR_TOKEN' -d "params=CMD_NAME"
ex :
curl https://api.spark.io/v1/devices/SPARK_CORE_ID/roombaAPI -d access_token='YOUR_TOKEN' -d "params=SONG"
{
"id": "ID",
"last_app": "",
"connected": true,
"return_value": 0
}
- a valid MQTT broker must be defined in Photon code mqttserver variable
In this topic, payload containing command name must be sent,
e.g :
mosquitto_pub -h BROKER_IP -t roomba/roombaCmds -m SONG
mosquitto_pub -h BROKER_IP -t roomba/roombaCmds -m GETBATT
To enable cloud connection
mosquitto_pub -h BROKER_IP -t roomba/particleCloud -m ENABLE
To disable cloud connection
mosquitto_pub -h BROKER_IP -t roomba/particleCloud -m DISABLE
Return value as integer in "return_value" field
-
CMD_NAME =
- AFTER THESE COMMANDS ROOMBA IS IN PASSIVE MODE
- GETMODE
- return value
- GETBATT
- return value
1 OFF 2 PASSIVE 3 SAFE 4 FULL
- GETMODE
- return value : current roomba charge in mAh
- AFTER THESE COMMANDS ROOMBA IS IN PASSIVE MODE
Subscribe to this topic to get Input commands returns :
mosquittto_sub -h BROKER_IP -t roomba/roombaInput
ex :
curl https://api.spark.io/v1/devices/SPARK_CORE_ID/roombaAPI -d access_token='YOUR_TOKEN' -d "params=GETMODE"
{
"id": "ID",
"last_app": "",
"connected": true,
"return_value": 1
}
export BROKER_IP=your_broker_ip
source ./roomba_control.sh
rc_while
-
roomba credentials & keys lost when battery fully discharded :
-
bug : http://community.particle.io/t/eeprom-persistence-issue/16514 - merged in firmware
-
to solve it (when it blinks red and magenta after restoring wifi credentials) - use key doctor https://community.particle.io/t/photon-flashing-cyan-and-blinking-orange/21530/3
-
impedance issue on Roomba TX - in some cases, input impedance of pin connected to Roomba Rx causes input commands are note received. To solve it we used a nodemcu with a software UART Rx pin. Hadware UART0, Serial Rx has a too high impedance.