The latest version of RooWifi API (1.1) is based on the gateway mode and it’s programmed using Qt Creator cross-platform IDE, which allows developers to use Windows, MAC, GNU/Linux,… Next revisions will have support and the required modifications to be able to develop with Visual Studio, gcc,g++ and Python. You can clone our latest API version from a Github Repository or download directly compressed in a ZIP file.
Please take a look to Developer notes and the reference before using the API.
Downloads and links to Github Repo
RooWifi API Github Repo: https://github.com/roowifi/API-Qt
Qt Creator download website: http://qt-project.org/downloads
RooWifi API 1.1b source and header files direct download: RooWifi_11b.zip
RooWifi API 1.1b Example application: RooWifi_11b_Example.zip
RooWifi API 1.1b documentation: API11b.pdf
In roowifi.h comment #define ROOWIFI_DEBUG to disable debug output messages, this define is enabled by default.
If AutoCapture mode is used, when the RooWifi::Sensors is updated, the class generates an AutoCaptureUpdated() SIGNAL. If not the generated SIGNAL is DataReady() when a data byte is received from the RooWifi (eg, manual sensor reading using ExecuteCommand functions).
The RooWifi API 1.1b Example App is made under Qt Creator 5 in a MacOS system, if you compile this project with Qt Creator under Linux or Windows the buttons or some elements of the GUI could appear with different aspect.
TCP Socket Connection / Disconnection functions
void SetIP( QString NewIP )
Sets the IP address of RooWifi. You need to call this function to select the IP address of your device. By default the IP address of RooWifi is 10.0.0.1 (the default IP address of RooWifi in Ad-Hoc mode).
In Windows Systems you could use the NBNSBios name to connect to your RooWifi.
- Windows: SetIP ( “roomba”);
- Others: SetIP (“10.0.0.1”);
Returns a QString with the NBNSBios name of your RooWifi or you RooWifi’s IP address.
- QString AddressOfMyRooWifi = GetIP();
Try to connect to RooWifi using a standard TCP/IP socket getting the IP address set in SetIP(QString NewIP) function. If it causes an exception or any error occurs while connecting process it will generate a trigger signal.
Disconnects from RooWifi and close the TCP/IP socket connection.
Returns true if the connection is established or false if not.
Sensors / Roomba Telemetry
Requests all sensor values.
Working modes of Roomba
Puts Roomba in Safe Mode. You can drive your Roomba but when it detects an obstacle or something that could damage the robot it will stop automatically and will set itself to Passive Mode (default).
Puts Roomba in Full Mode. Enables unrestricted control of Roomba and turns off the safety features. Be careful using this mode while driving or controlling Roomba.
Actions / Emulation of buttons
Starts a normal cleaning cycle, the same as a normal “clean” button press. This command puts in Safe Mode.
Starts a spot cleaning cycle, the same as a normal “spot” button press. This command puts in Safe Mode.
Turns on force-seeking-dock mode, which causes the robot to immediately attempt to dock during its cleaning cycle if it encounters the docking beams from the Home Base. (Note, however, that if the robot was not active in a clean, spot or max cycle it will not attempt to execute the docking.) Normally the robot attempts to dock only if the cleaning cycle has completed or the battery is nearing depletion. This command can be sent anytime, but the mode will be cancelled if the robot turns off, begins charging, or is commanded into safe or full modes.
Moving Roomba as you would
Play with Roomba like a RC Car
void Drive( int Velocity, int Radius )
- Velocity: specify the average velocity of the drive wheels in millimeters per second (mm/s). Max forward = 500mm/s. Max backward = -500mm/s
- Radius: The radius, in millimeters, at which Roomba should turn. The longer radii make Roomba drive straighter; shorter radii make it turn more. Max turn = 1 or -1. Margins= -2000mm , 2000mm
A Drive command with a positive velocity and a positive radius will make Roomba drive forward while turning toward the left. A negative radius will make it turn toward the right. Special cases for the radius make Roomba turn in place or drive straight, as specified below. The robot must be in safe or full mode to accept this command.
Turns on Roomba’s Main Brush
Turns off Roomba’s Main Brush
Turns on Roomba’s Vacuum
Turns off Roomba’s Vacuum
Turns on Roomba’s Side Brush
Turns off Roomba’s Side Brush
Turns on all Roomba Cleanning buttons
Turns off all Roomba Cleaning buttons
Turns on Spot Led
Turns off Spot Led
Turns on Max Led
Turns off Max Led
Turns on Clean Led
Turns off Clean Led
Turns on Dirt Led
Turns off Dirt Led
Status Led – Deprecated if using >= Roomba 500 series.
void Led_Power_Color( int NewColor )
Sets new color for Power Led (battery led in Roomba 700)
- NewColor: New Color of Power Led ( 0 – 255 )
void Led_Power_Intensity( int NewIntensity )
Sets new intensity of Power Led (battery led in Roomba 700)
- NewIntensity: New Intensity of Power Led ( 0 – 255 )
Turns off Power Led (battery led in Roomba 700)
With these functions you could send and receive sensor data directly through RooWifi with or without use of Auto Capture mode of this “API”
void ExecuteCommand( int CommandToSend )
- CommandToSend: Command you want to transmit to Roomba
void ExecuteCommandWithParameter( int CommandToSend, int Data )
- CommandToSend: Command you want to transmit to Roomba.
- Data: Value to transmit alter the command header.
void ExecuteCommandWithParameters ( int CommandToSend, int* Parameters, int NumParameters )
- CommandToSend: Command you want to transmit to Roomba.
- Parameters: Array with parameters.
- NumParameters: Number of parameters apart of Command. Lenght of Parameters array.
Returns the number of bytes received from Roomba and available in the reception buffer.
int Read(char *Data, int DataLen)
- Data: Array where you want to sore received data
- DataLen: Length of received data to read
Auto Capture Mode
Once connected to RooWifi you could use this mode to refresh sensor data with the specified period of time in ms with SetAutoCaptureTime() automatically refreshing RoombaSensors structure.
Enables/starts auto capture mode
Disables/stops auto capture mode
void SetAutoCaptureTime( int NewPeriod )
Sets new period time between sensor packet 0 requests
- NewPeriod: Time in ms between requests
Returns perdiod time between sensor packet 0 requests
Returns a float with calculated value of battery level