Add WiFi to your Neato BotVac for 3$

News and information about the Neato XV-11 Robotic Vacuum. All discussion and troubleshooting questions go here.
User avatar
Medtech
Robot Addict
Posts: 151
Joined: October 17th, 2014, 3:12 pm
Location: Moscow Russia
Contact:

Re: Add WiFi to your Neato BotVac for 3$

Post by Medtech »

Thank you GOOGLE translator for the freedom of communication.
User avatar
Tris
Robot Groupie
Posts: 73
Joined: February 28th, 2016, 5:58 pm

Re: Add WiFi to your Neato BotVac for 3$

Post by Tris »

You could also use a ribbon cable connector for a 5.25" floppy drive...
Oleost
Posts: 1
Joined: December 8th, 2016, 1:18 pm

Re: Add WiFi to your Neato BotVac for 3$

Post by Oleost »

Hi, any chance this can be modified to work with neato xv models?

Here is someone that hooked up to an Xv11 through tx/Rx.

http://forums.trossenrobotics.com/showt ... mm-(XV-11)

http://i52.tinypic.com/pvwoi.jpg
glnc222
Robot Master
Posts: 5484
Joined: January 23rd, 2012, 8:19 pm
Location: The Villages, Florida
Contact:

Re: Add WiFi to your Neato BotVac for 3$

Post by glnc222 »

The very old Rev113 Cruz system boards in XV's (when the side power jack was included) have an unpopulated serial port header, previously used for BlueTooth additions (links in Mods & Repairs list main forum page, a Vic7767 project). Eliminated in the newer Rev64 Binky boards, requiring a USB host device (several experiments reported using mini router devices). Not my specialty, but I just noticed these OTG cables for smartphones which include a host interface in the plug (so PC peripherals can be connected to the phone). These might allow a larger variety of WiFi devices to be used, up to the engineers.

The problem with Botvac was the USB jack under the dust bin, now relieved with this other connection found. Some fancy work had been done to connect to that buried jack though.

Note trick: when the system demands the cable be unplugged to run, it can be re-enabled after it starts. Still not clear what can be done when cleaning. This does complicate the hardware or firmware in the interface device, which may require custom flashing and programming (some open source stuff mentioned). Most recent vacuum firmware may have eliminated this stumbling block, you would have to check.
kslmgd
Posts: 11
Joined: January 1st, 2016, 2:53 am

Re: Add WiFi to your Neato BotVac for 3$

Post by kslmgd »

I add esp8266 to botvac I can use ip to connect but no response
Neato Console

[connected]

[response] connected to Neato

[sent] Clean

botvac does not start clean

botvac works has before

Help Please
yadur
Posts: 7
Joined: October 8th, 2016, 10:51 am

Re: Add WiFi to your Neato BotVac for 3$

Post by yadur »

I always need to send the clean command twice to start the actual cleaning. First to wake up the bot and the second time to start. This works the same way as the physical button.

Did you try some other commands, like "PlaySound 1" or "help"? Do you get any output or does the bot play the "Cleaning Completed" sound?
kslmgd
Posts: 11
Joined: January 1st, 2016, 2:53 am

Re: Add WiFi to your Neato BotVac for 3$

Post by kslmgd »

No response on output no sound
yadur
Posts: 7
Joined: October 8th, 2016, 10:51 am

Re: Add WiFi to your Neato BotVac for 3$

Post by yadur »

The "connected to Neato" message means that you successfully connected to the Websocket port of the ESP8266. If you get no response and no sound is playing you might want to check if the RX and TX lines are properly connected (or maybe switched).
kslmgd
Posts: 11
Joined: January 1st, 2016, 2:53 am

Re: Add WiFi to your Neato BotVac for 3$

Post by kslmgd »

Ur right took it apart and moved those wires just a little and bingo response now it was tx or rx
thank u so much for ur help
Keith
fly
Posts: 24
Joined: August 12th, 2007, 10:46 am

Re: Add WiFi to your Neato BotVac for 3$

Post by fly »

Safe to assume this will not work for an XV? I saw that someone asked this already, but I didn't exactly understand the reply.
Redalike
Posts: 9
Joined: December 10th, 2024, 3:25 pm

Re: Add WiFi to your Neato BotVac for 3$

Post by Redalike »

Hey there!
even if many years have passed since the last message, I just wanted to share my experience about the project.
After replacing the nimh battery with a nastima lithium 12v battery, my botvacd85 is again on track.
In order to get wifi funcionality, I followed the guide step by step and now I can start and stop the robot using a browser on port 80 or a websocket android tester app on port 81.
Using the command "help" returns all possible commands.
The next step is connect it to alexa using AWS amazon web services.
The problem is that Aws uses https on port 443 and not the port 80 or 81.
I ve seen some attempts to include an https in the code on the esp, including the certificates.
Honestly I m still not able to modify it myself, and I don't even know if there enough memory on the chip in order to include an https webserver.
Any help to make it Alexa compatible without using another server with home assistant on a raspberry?
Atm I can only think to this solution
Ty
ILife v7 plus
Neato Botvac D85
Xiaomi X20+
User avatar
CodaCM
Robot Master
Posts: 108
Joined: November 5th, 2022, 11:58 am
Location: Minnesota, USA
Contact:

Re: Add WiFi to your Neato BotVac for 3$

Post by CodaCM »

Redalike wrote: December 10th, 2024, 3:34 pm Hey there!
even if many years have passed since the last message, I just wanted to share my experience about the project.
After replacing the nimh battery with a nastima lithium 12v battery, my botvacd85 is again on track.
In order to get wifi funcionality, I followed the guide step by step and now I can start and stop the robot using a browser on port 80 or a websocket android tester app on port 81.
Using the command "help" returns all possible commands.
The next step is connect it to alexa using AWS amazon web services.
The problem is that Aws uses https on port 443 and not the port 80 or 81.
I ve seen some attempts to include an https in the code on the esp, including the certificates.
Honestly I m still not able to modify it myself, and I don't even know if there enough memory on the chip in order to include an https webserver.
Any help to make it Alexa compatible without using another server with home assistant on a raspberry?
Atm I can only think to this solution
Ty
I was just reading through this forum and found your message. It might be possible to do it using an external webserver but like you said you don't want to do that. I'm sorry I really can't help beyond this as I have never done this to my D85 plus its dead so best of luck to you. Hopefully, someone else comment on it.
CodaCM
_____________________________________________________________________________
Most "Active" Forum Mod :dance:
Roomba Discovery 2x - 2010
Roomba 410 - 2022
Roomba 880 - 2022
Roomba 536 - 2015 (Left wheel broke)
Scooba 330 - 2023 (totally fine just bad battery)
Neato Botvac D85 - 2021 (Dead Mobo)
Neato XV Signature - 2023 (Dead Mobo ) I totally did not cause it :D
Redalike
Posts: 9
Joined: December 10th, 2024, 3:25 pm

Re: Add WiFi to your Neato BotVac for 3$

Post by Redalike »

Thanks for the interest. It is really funny to turn it on from my smartphone. You send "help" and it tells you all the possible commands. Fantastic! But to turn it on from Alexa would be the top for an almost 10 years old bot! What I don't understand is if websocket is what makes it communicate with the serial port or is something that can be removed from the arduino and replaced by the secure web server. If Amazon Web Services can accept a self generated certificate is another issue. In the code, what is that sends messages to the serial port and get answers? the websocket? mmm....
ILife v7 plus
Neato Botvac D85
Xiaomi X20+
Redalike
Posts: 9
Joined: December 10th, 2024, 3:25 pm

Re: Add WiFi to your Neato BotVac for 3$

Post by Redalike »

Hey there. I modified the code to make it work with Alexa. The problem was that Alexa only uses https. So I used sinric pro as a proxy to handle the certificates. Then Sinric pro and the esp can communicate in http. I created two virtual switches in sinric pro, one for clean house and another for clean spot commands. Both of them can be turned off by the clean stop command without the need to setup a third switch as a clean stop switch in sinric.
The code in the esp makes it connect to sinric. When the state of the sinric switch changes from off to on, both activated by the sinric interface or the skill of alexa voice commands, the sketch sends the string clean house or clean spot to the robot interface. Then is the robot interface that convert those strings in serial commands. The sketch has an ota library and a password field to be able to update the firmware without disassembling the robot. Once setup the switches on sinric and the alexa skill, all you have to do is putting your wifi network credentials and the app keys and id that you find in your sinric interface and you can flash it to your Esp8266. This program was written with AI help because I'm still not that good at programming. Can contain redundant or useless data that you can help me to remove. In the neato programming manual I still haven't found a return to base command. I tried to integrate the websocket so I could also use the browser interface or an app from mobile but in that case the esp fails to connecting to the sinric servers. Probably is close to the ram and memory resources limits with both functions packed together. I wished I could because the websocket interface of the original botvac.ino files allows to send many more commands to the robot and receive an answer. With the code setup like this now the robot only performs the basic commands that one would have done by phisically pressing the buttons on the robot, that are clean the house, clean a spot area and stop cleaning but in the sinric free plan there is a limit on the number of the switch you can have so is not feasible.
The commands are sent twice both for clean house and clean spot, with a delay I set to 2 seconds. This in order to send the first command just for waking up the robot, and then the second to be processed normally.
Last edited by Redalike on January 13th, 2025, 3:59 pm, edited 6 times in total.
ILife v7 plus
Neato Botvac D85
Xiaomi X20+
Redalike
Posts: 9
Joined: December 10th, 2024, 3:25 pm

Re: Add WiFi to your Neato BotVac for 3$

Post by Redalike »

#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <SinricPro.h>
#include <SinricProSwitch.h>
#include <ArduinoOTA.h>

#define WIFI_SSID "Insert your WiFi SSID here"
#define WIFI_PASSWORD "Insert your WiFi password here"
#define APP_KEY "Insert your SinricPro App Key here"
#define APP_SECRET "Insert your SinricPro App Secret here"

// Device IDs
#define SWITCH_1_ID "Insert your Switch 1 ID here"
#define SWITCH_2_ID "Insert your Switch 2 ID here"

// Serial configuration
#define BAUD_RATE 115200

// Function to control the power state of the first switch
bool onPowerStateSwitch1(const String &deviceId, bool &state) {
Serial.printf("Robot power state (Switch 1): %s\r\n", state ? "ON" : "OFF");
if (state) {
// First cleaning command to wake up the robot
Serial.write("clean house\n");
delay(2000); // Wait for the command to be processed
// Second cleaning command to start the robot
Serial.write("clean house\n");
} else {
// Stop the robot
Serial.write("clean stop\n");
}
return true; // Command handled successfully
}

// Function to control the power state of the second switch
bool onPowerStateSwitch2(const String &deviceId, bool &state) {
Serial.printf("Robot power state (Switch 2): %s\r\n", state ? "ON" : "OFF");
if (state) {
// Spot cleaning (as an example)
Serial.write("clean spot\n");
delay(2000); // Wait for the command to be processed
// Second spot cleaning command to start
Serial.write("clean spot\n");
} else {
// Stop the robot
Serial.write("clean stop\n");
}
return true; // Command handled successfully
}

void setupWiFi() {
Serial.println("Connecting to WiFi...");
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);

while (WiFi.status() != WL_CONNECTED) {
delay(250);
Serial.print(".");
}

Serial.println("Connected to WiFi");
}

void setupOTA() {
ArduinoOTA.setPassword("Insert your OTA password here"); // Set the OTA password
ArduinoOTA.begin();
}

void setup() {
Serial.begin(BAUD_RATE);
setupWiFi();
setupOTA();

// Initialize SinricPro and add the Switch devices
SinricProSwitch& mySwitch1 = SinricPro[SWITCH_1_ID];
mySwitch1.onPowerState(onPowerStateSwitch1);

SinricProSwitch& mySwitch2 = SinricPro[SWITCH_2_ID];
mySwitch2.onPowerState(onPowerStateSwitch2);

SinricPro.onConnected([]() {
Serial.println("Connected to SinricPro");
});

SinricPro.onDisconnected([]() {
Serial.println("Disconnected from SinricPro");
});

SinricPro.begin(APP_KEY, APP_SECRET);
}

void loop() {
SinricPro.handle(); // Handle requests from SinricPro
ArduinoOTA.handle(); // Handle OTA updates
}
ILife v7 plus
Neato Botvac D85
Xiaomi X20+
Redalike
Posts: 9
Joined: December 10th, 2024, 3:25 pm

Re: Add WiFi to your Neato BotVac for 3$

Post by Redalike »

https://youtu.be/OCwVCYQzT6I?feature=shared here you can watch it working
ILife v7 plus
Neato Botvac D85
Xiaomi X20+
Redalike
Posts: 9
Joined: December 10th, 2024, 3:25 pm

Re: Add WiFi to your Neato BotVac for 3$

Post by Redalike »

#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <SinricPro.h>
#include <SinricProSwitch.h>
#include <ArduinoOTA.h>

// Credenziali Wi-Fi
#define WIFI_SSID "....."
#define WIFI_PASSWORD "......"

// Credenziali SinricPro
#define APP_KEY " ....."
#define APP_SECRET "....."

// ID dei dispositivi
#define SWITCH_1_ID "....."
#define SWITCH_2_ID "......."

// Configurazione seriale
#define BAUD_RATE 115200

// Variabili per lo stato locale degli switch
bool currentStateSwitch1 = false; // Stato del primo switch
bool currentStateSwitch2 = false; // Stato del secondo switch

// Funzione per la gestione del primo switch
bool onPowerStateSwitch1(const String &deviceId, bool &state) {
Serial.printf("Robot power state (Switch 1): %s\r\n", state ? "ON" : "OFF");
if (state != currentStateSwitch1) {
if (state) {
Serial.write("clean\n");
delay(2000);
Serial.write("clean house\n");
} else {
Serial.write("clean stop\n");
}
currentStateSwitch1 = state; // Aggiorna lo stato locale
}
return true;
}

// Funzione per la gestione del secondo switch
bool onPowerStateSwitch2(const String &deviceId, bool &state) {
Serial.printf("Robot power state (Switch 2): %s\r\n", state ? "ON" : "OFF");
if (state != currentStateSwitch2) {
if (state) {
Serial.write("clean\n");
delay(2000);
Serial.write("clean spot\n");
} else {
Serial.write("clean stop\n");
}
currentStateSwitch2 = state; // Aggiorna lo stato locale
}
return true;
}

// Configurazione della connessione Wi-Fi
void setupWiFi() {
Serial.println("Connecting to WiFi...");
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);

while (WiFi.status() != WL_CONNECTED) {
delay(250);
Serial.print(".");
}

Serial.println("Connected to WiFi");
}

// Configurazione dell'OTA
void setupOTA() {
ArduinoOTA.setPassword("......."); // Imposta la password OTA
ArduinoOTA.begin();
}

// Setup iniziale
void setup() {
Serial.begin(BAUD_RATE);
setupWiFi();
setupOTA();

// Configurazione di SinricPro e dei dispositivi
SinricProSwitch &mySwitch1 = SinricPro[SWITCH_1_ID];
mySwitch1.onPowerState(onPowerStateSwitch1);

SinricProSwitch &mySwitch2 = SinricPro[SWITCH_2_ID];
mySwitch2.onPowerState(onPowerStateSwitch2);

// Callback per la connessione a SinricPro
SinricPro.onConnected([]() {
Serial.println("Connected to SinricPro");
});

// Callback per la disconnessione da SinricPro
SinricPro.onDisconnected([]() {
Serial.println("Disconnected from SinricPro");
});

SinricPro.begin(APP_KEY, APP_SECRET);
}

// Ciclo principale
void loop() {
SinricPro.handle(); // Gestisce le richieste da SinricPro
ArduinoOTA.handle(); // Gestisce l'OTA
}
Last edited by Redalike on January 15th, 2025, 2:11 pm, edited 1 time in total.
ILife v7 plus
Neato Botvac D85
Xiaomi X20+
Redalike
Posts: 9
Joined: December 10th, 2024, 3:25 pm

Re: Add WiFi to your Neato BotVac for 3$

Post by Redalike »

This is a variant that makes the robot start only if it detects a change in the status on/off of the virtual switch in sinric interface. This in order to prevent uncontrolled activation of the robot due to disconnection and reconnection to internet. Problem is, you have to configure an itching time long enough to make him perform the house cleaning before giving the command clean stop. This depends on battery status and if he has to recharge once more to complete the cleaning so it's up to you. If you don't set it up, next day it won't run, because the switch state in sinric will still be ON. If you think it can finish its duties in 2 hours, set 7200s itching in sinric.
Last edited by Redalike on January 15th, 2025, 2:46 pm, edited 2 times in total.
ILife v7 plus
Neato Botvac D85
Xiaomi X20+
Redalike
Posts: 9
Joined: December 10th, 2024, 3:25 pm

Re: Add WiFi to your Neato BotVac for 3$

Post by Redalike »

or alternatively the solution with the 3 switches, one for the clean stop function. This requires to implement an itching on each of the virtual switches in the sinric interface. I put like 10 seconds. It doesn't matter. To stop the robot you say something like turn on end cleaning, to your liking.
ILife v7 plus
Neato Botvac D85
Xiaomi X20+
Redalike
Posts: 9
Joined: December 10th, 2024, 3:25 pm

Re: Add WiFi to your Neato BotVac for 3$

Post by Redalike »

#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <SinricPro.h>
#include <SinricProSwitch.h>
#include <ArduinoOTA.h>

#define WIFI_SSID "......"
#define WIFI_PASSWORD "...."
#define APP_KEY "....."
#define APP_SECRET "....."

// ID dei dispositivi
#define SWITCH_1_ID "......"
#define SWITCH_2_ID "......"
#define SWITCH_3_ID "......" // ID del terzo switch

// Configurazione seriale
#define BAUD_RATE 115200

// Stato attuale degli interruttori
bool currentStateSwitch1 = false;
bool currentStateSwitch2 = false;
bool currentStateSwitch3 = false; // Stato del terzo switch
unsigned long lastSwitchChangeTime = 0; // Tempo dell'ultimo cambiamento di stato

// Funzione per l'accensione del dispositivo (per il primo switch)
bool onPowerStateSwitch1(const String &deviceId, bool &state) {
Serial.printf("Received power state for Switch 1: %s (current state: %s)\r\n",
state ? "ON" : "OFF", currentStateSwitch1 ? "ON" : "OFF");
if (state != currentStateSwitch1) {
Serial.println("State change detected. Executing command...");
if (state) {
Serial.write("clean\n");
delay(2000);
Serial.write("clean house\n");
}
currentStateSwitch1 = state;
lastSwitchChangeTime = millis(); // Aggiorna il tempo dell'ultimo cambiamento di stato
} else {
Serial.println("No state change detected. Skipping command.");
}
return true; // Comando gestito correttamente
}

// Funzione per l'accensione del dispositivo (per il secondo switch)
bool onPowerStateSwitch2(const String &deviceId, bool &state) {
Serial.printf("Received power state for Switch 2: %s (current state: %s)\r\n",
state ? "ON" : "OFF", currentStateSwitch2 ? "ON" : "OFF");
if (state != currentStateSwitch2) {
Serial.println("State change detected. Executing command...");
if (state) {
Serial.write("clean\n");
delay(2000);
Serial.write("clean spot\n");
}
currentStateSwitch2 = state;
lastSwitchChangeTime = millis(); // Aggiorna il tempo dell'ultimo cambiamento di stato
} else {
Serial.println("No state change detected. Skipping command.");
}
return true; // Comando gestito correttamente
}

// Funzione per il comando di fermare il robot (per il terzo switch)
bool onPowerStateSwitch3(const String &deviceId, bool &state) {
Serial.printf("Stop command received (Switch 3): %s\r\n", state ? "ON" : "OFF");

if (state && (millis() - lastSwitchChangeTime > 5000)) { // Se l'ultimo cambiamento è avvenuto più di 5 secondi fa
Serial.write("clean stop\n");
delay(1000); // Attendi per sicurezza
SinricProSwitch& mySwitch3 = SinricPro[SWITCH_3_ID];
mySwitch3.sendPowerStateEvent(false); // Imposta lo stato a OFF
currentStateSwitch3 = false;
} else if (!state) {
// Se lo switch è spento e non c'è stato un recente cambiamento, esegui clean stop
Serial.write("clean stop\n");
currentStateSwitch3 = false;
}

return true; // Comando gestito correttamente
}

void setupWiFi() {
Serial.println("Connecting to WiFi...");
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);

while (WiFi.status() != WL_CONNECTED) {
delay(250);
Serial.print(".");
}

Serial.println("Connected to WiFi");
}

void setupOTA() {
ArduinoOTA.setPassword("....."); // Imposta la password OTA
ArduinoOTA.begin();
}

void setup() {
Serial.begin(BAUD_RATE);
setupWiFi();
setupOTA();

// Configurazione dei tre switch
SinricProSwitch& mySwitch1 = SinricPro[SWITCH_1_ID];
mySwitch1.onPowerState(onPowerStateSwitch1);

SinricProSwitch& mySwitch2 = SinricPro[SWITCH_2_ID];
mySwitch2.onPowerState(onPowerStateSwitch2);

SinricProSwitch& mySwitch3 = SinricPro[SWITCH_3_ID];
mySwitch3.onPowerState(onPowerStateSwitch3);

SinricPro.onConnected([]() {
Serial.println("Connected to SinricPro");
});

SinricPro.onDisconnected([]() {
Serial.println("Disconnected from SinricPro");
});

SinricPro.begin(APP_KEY, APP_SECRET);
}

void loop() {
SinricPro.handle(); // Gestisci le richieste da SinricPro
ArduinoOTA.handle(); // Gestisci l'OTA
}
ILife v7 plus
Neato Botvac D85
Xiaomi X20+
Post Reply