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/
-
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
-
OR ESP8266-XX (I ran it on 1M version of ESP-01)
-
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 )
- 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
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
1 OFF 2 PASSIVE 3 SAFE 4 FULL
- GETMODE
- return value : current roomba charge in mAh
- AFTER THESE COMMANDS ROOMBA IS IN PASSIVE MODE
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
- https://community.particle.io/t/sparkbot-spark-core-roomba/625
- https://community.particle.io/t/getting-mac-address-of-unconnected-core/8473/5
- http://blog.particle.io/2014/08/06/control-the-connection/
- get another Roomba to handle input commands!