Skip to main content

Serialroomba is a package that aims to simplify the control of a Roomba over its serial port.

Project description

Serialroomba

Serialroomba is a package that aims to simplify the control of a Roomba over its serial port.

It was tested on a Roomba 570.

Similar packages already exist, some relatively old, some too "low-level".
Part of the goal of this package was also to practice Python OOP.

Usage

To install this package, you simply need to pip install serialroomba

Here is an example script:

from serialroomba.serialroomba import SerialRoomba
from serialroomba.controllers import CleaningMode, Mode

roomba = SerialRoomba("/dev/ttyS0")
roomba.mode_controller.current_mode = Mode.SAFE
roomba.cleaning_controller.side_brush_pwm = 10
roomba.mode_controller.current_mode = Mode.PASSIVE
roomba.cleaning_controller.current_cleaning_mode = CleaningMode.SPOT

Not implemented

Motors (Opcode: 138)

"This command lets you control the forward and backward motion of Roomba’s main brush, side brush, and vacuum independently."
Since the state and direction of all cleaning motors need to be sent in a single byte, managing the last state of them becomes complicated.
The same functionality can be achieved using:

  • main_brush_pwm
  • side_brush_pwm
  • vacuum_pwm

LEDs (Opcode: 139)

"This command controls the LEDs common to all models of Roomba 500."

Scheduling LEDs (Opcode: 162)

"This command controls the state of the scheduling LEDs present on the Roomba 560 and 570."

Digital LEDs Raw (Opcode: 163)

"This command controls the four 7 segment displays on the Roomba 560 and 570."

Digit LEDs ASCII (Opcode: 164)

"This command controls the four 7 segment displays on the Roomba 560 and 570 using ASCII character codes."

Buttons (Opcode: 165)

"This command lets you push Roomba’s buttons. The buttons will automatically release after 1/6th of a second."

Song (Opcode: 140)

"This command lets you specify up to four songs to the OI that you can play at a later time. Each song is associated with a song number."

Play (Opcode: 141)

"This command lets you select a song to play from the songs added to Roomba using the Song command."

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

serialroomba-0.1.2.tar.gz (9.0 kB view hashes)

Uploaded Source

Built Distribution

serialroomba-0.1.2-py3-none-any.whl (24.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page