Robot Vacuum Mapping

Last Updated on : 2024-05-11 07:51:18download

This topic describes the streaming service for robot vacuums, a quick channel to transmit map data between the mobile app and the robot vacuum.

Only specific modules with the required service activated support map streaming services for robot vacuums.

Process

Robot Vacuum Mapping

Description:

  • The map data is identified by the map ID. Data of the same map ID is processed as one cleaning task by the mobile app.
  • The robot vacuum goes around the whole house during cleaning. However, if the wireless signals in some areas are weak, data upload might fail. In this case, with sufficient memory, the module can store 24 pieces of the data cache.

Commands

The commands used in the map streaming service.

Command Description
0x28 Map streaming
0x30 Multimap streaming
0x34 + 0x06 Get the map session ID

Map streaming

  • For streaming data of a complete map, the map data offset indicates the total length of data that has been sent.

  • The maximum serial buffer of the module is 1,024 bytes. A packet of map data cannot exceed 1,024 bytes. The recommended size of a packet is 512 bytes.

  • The map ID indicates a cleaning map. The robot builds a map of the cleaning area each time it starts a new cleaning task, with a new map ID assigned to it. When the map ID is changed, the map data displayed on the mobile app will be changed accordingly.

  • After data transmission starts, the module will stop sending heartbeats to ensure the map data traffic is prioritized. The heartbeat will not resume unless the module is restarted following a shutdown.

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x28
Data length 2 0x0006 + N
Data 2 Data[0] to Data[1]: The map ID, an identifier for a map created for a cleaning task.
4 Data[2] to Data[5]: The map data offset, which is 0 for the first packet.
N Data[6] to Data[N]: The payload, in big-endian format.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

Example: The map ID is 123 and the packet offset is 0.

55 aa 03 28 xx xx 00 7b 00 00 00 00 xx xx xx xx xx

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x28
Data length 2 0x0001
Data 1
  • 0x00: Success.
  • 0x01: The streaming service is not enabled.
  • 0x02: Failed to connect to the streaming server.
  • 0x03: Data push timeout.
  • 0x04: Data length error.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

Example: 55 aa 00 28 00 01 00 28

Multimap streaming

This command is used to upload the map that combines multiple maps.

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x30
Data length 2 0x0009 + N
Data 1 The map service protocol: 0x00
2 Map service session ID: An identifier of a map displayed on the mobile app.
6
  • BUF[0]: The ID of the sub-map. A map session can consist of multiple maps, such as route maps.
  • BUF[1]: How the map ID data is processed. 0x00: Increment the data. 0x01: Clear the data uploaded by the sub-map ID.
  • BUF[2] to BUF[5]: The sub-map data offset, which is 0 for the first packet.
N The payload, in big-endian format.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

Example: 55 aa 03 30 00 xx 00 00 00 01 00 00 00 00 xx xx xx xx xx xx

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x30
Data length 2 0x0001
Data 1
  • 0x00: Success.
  • 0x01: Failure.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

Example: 55 aa 03 30 00 01 00 33

Get the map session ID

  • This command is a supplement to the map streaming service for single and multiple maps.

  • The module manages the map session ID. Before the MCU transmits a new map, it will request a map session ID from the module and include the allocated session ID in each session data transmission. The sub-map ID is incremented by 1 as a new sub-map is added, such as 0x01, 0x02, 0x03, and more.

  • If you prefer to manage the map session ID yourself, this command is not required.

The MCU sends the following data.

Field Length Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x34
Data length 2 0x0001
Data 1 0x06 (subcommand)
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

Example: 55 aa 03 30 00 01 00 33

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x34
Data length 2 0x0004
Data 1 0x06 (subcommand)
1 The transmission result:
  • 0x00: Success.
  • 0x01: The streaming service is not enabled.
  • 0x02: Failed to get the ID.
2 The map session ID. If the transmission fails, this data is invalid.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

Example: 55 aa 00 34 00 04 06 00 00 00 3d