Unofficial SDK for iRobot Roomba models. This is a re-implementation of a part of the https://github.com/koalazak/dorita980 library. Many Thanks!
- Discover roomba and save the
Blid
field and theIP Address
roomba-cli discover
- Get roomba password
Follow the instructions and save the printed password.
roomba-cli get-password -host [IP Address]
These credentials can be passwd with the -host
, -user
and the -password
flag for each command or can be loaded from the ROOMBA_HOST
, ROOMBA_USER
and the ROOMBA_PASSWORD
environment variables.
Usage information:
roomba-cli --help
cfg := &config.Config{
Address: "[ROOMBA HOST]"
User: "[ROOMBA BLID]"
Password: "[ROOMBA PASSWORD]"
Debug: false
}
client := roomba.New(cfg)
if err = client.Connect(); err != nil {
log.Fatalf("Unable to connect to roomba: %v", err)
}
if err = client.SendCommand("clean"); err != nil {
log.Fatalf("Unable to send command: %v", err)
}
client.Disconnect()
Client configuration can be loaded from environment variables
cfg := config.NewFromEnv("ROOMBA_")
In this case the roomba will load the matching config attributes from environment variables. (e.g.: ROOMBA_ADDRESS
-> Address
)
The configuration accepts a StateWriter
field. If this field is set all state message (coordinates, status messages, signal strength, ...) will written in JSON format.