Help decoding unique protocol of a toy robot
Posted: Sun Mar 13, 2022 2:13 am
Hello!
My goal:
Write a python library which allows me to control a toy robot that uses a unique IR protocol. I have searched extensively but no one else on the internet seems to have attempted to decode this toy's signals. It's called Botley and it aims to teach kids some programming fundamentals ie: breaking a problem down to a series of basic steps and executing. I am already writing a Python library so that kids can transition to a real programming language and control this robot using the simple commands they are already familiar with.
How the toy works:
The toy is a small, two-wheeled robot (with a rear caster) that comes with an simple IR remote. You arrange an obstacle course for the robot then use the remote to program a basic sequence of direction commands (Options: Left-45deg, Forward, Right-45deg, Left-90deg, Backward, Right-90deg). The commands are stored in a queue (in the remote's internal EEPROM). When you are done entering commands you press the Send button which transmits the queue (up to 150 direction commands) to the robot. The robot beeps to indicate receipt and proceeds with executing the series of commands.
It is important to note that the direction command buttons only add directions to the remote's command queue, they are not transmitted directly to the robot when pressed.
The remote also has buttons which do immediately transmit: Light, Sound, Erase, and Loop buttons.
Light: Changes the color of the lights on the robot as soon as the button is pressed.
Sound: This button cycles through High > Low > Off > High etc to change the volume of the remote's speaker; It seems to control the volume of the robot's speaker too.
Erase: Pressed once, it deletes the last direction command from the remote's command queue - No transmission. Pressed and held, it clears the remote's command queue and transmits something.
Loop: Used when adding direction commands to the remote's command queue. Press Loop > enter direction commands > Press loop again and the sequence between the loop button presses is appended to the command queue a second time. For some reason each press of the loop button includes an IR transmission but there is no response from the robot.
The following button does not transmit anything: EDIT: I wasn't getting any signals when I wrote this but in my next post I did record a signal when pressing the OD button.
Object Detection: Press once to enable OD then enter a sequence of commands which the robot should execute if it encounters an obstacle. Press OD again to complete the object avoidance command sequence.
Note: I have dumped the contents of the remote's EEPROM. The EEPROM, as far as I can tell, only stores the user's command queue. Each memory address starting from 0x01 stores an individual direction command entered by the user. I have generated a mapping of direction buttons to the corresponding values stored in memory. This is how I was able to determine that the loop button just appends the loop sequence to the end of the command queue (so there is no loop command in the queue, just the repeated contents of the loop). I also found that direction commands entered with Object Detection enabled are stored as different values in EEPROM. This difference should be observable in the IR signals.
I have used AnalysIR to record all of the raw IR signals corresponding to the different button presses but none can be decoded by the software (as expected). I've attached the saved session: I've been searching around a lot but I'm only finding information about common protocols. This seems to be a fairly unique protocol, particularly because of the Send button and the fact that it can transmit up to 150 commands in one message.
Prior to buying AnalysIR I used an RPi and pigpio with the IR Record and Playback example code provided here https://abyz.me.uk/rpi/pigpio/examples.html I've been using the Light button for testing and have been able to record a consistent signal but when I attempt to transmit it to the robot from the RPi The robot's lights just blink once and nothing happens (same response for other buttons). So I know that at least something is getting transmitted and some part of that is detected by the robot.
Any way, I am here seeking help/guidance on analyzing and decoding this protocol. Once it is decoded I will test transmission from the RPi. If that works I want to try piping the commands to the headphone jack on my PC with a 3.5mm IR transmitter connected as I think this will be the cheapest/easiest way for people to use my python library with the toy robot.
I'm at a loss for what to do next and appreciate any help.
Thanks!
My goal:
Write a python library which allows me to control a toy robot that uses a unique IR protocol. I have searched extensively but no one else on the internet seems to have attempted to decode this toy's signals. It's called Botley and it aims to teach kids some programming fundamentals ie: breaking a problem down to a series of basic steps and executing. I am already writing a Python library so that kids can transition to a real programming language and control this robot using the simple commands they are already familiar with.
How the toy works:
The toy is a small, two-wheeled robot (with a rear caster) that comes with an simple IR remote. You arrange an obstacle course for the robot then use the remote to program a basic sequence of direction commands (Options: Left-45deg, Forward, Right-45deg, Left-90deg, Backward, Right-90deg). The commands are stored in a queue (in the remote's internal EEPROM). When you are done entering commands you press the Send button which transmits the queue (up to 150 direction commands) to the robot. The robot beeps to indicate receipt and proceeds with executing the series of commands.
It is important to note that the direction command buttons only add directions to the remote's command queue, they are not transmitted directly to the robot when pressed.
The remote also has buttons which do immediately transmit: Light, Sound, Erase, and Loop buttons.
Light: Changes the color of the lights on the robot as soon as the button is pressed.
Sound: This button cycles through High > Low > Off > High etc to change the volume of the remote's speaker; It seems to control the volume of the robot's speaker too.
Erase: Pressed once, it deletes the last direction command from the remote's command queue - No transmission. Pressed and held, it clears the remote's command queue and transmits something.
Loop: Used when adding direction commands to the remote's command queue. Press Loop > enter direction commands > Press loop again and the sequence between the loop button presses is appended to the command queue a second time. For some reason each press of the loop button includes an IR transmission but there is no response from the robot.
The following button does not transmit anything: EDIT: I wasn't getting any signals when I wrote this but in my next post I did record a signal when pressing the OD button.
Object Detection: Press once to enable OD then enter a sequence of commands which the robot should execute if it encounters an obstacle. Press OD again to complete the object avoidance command sequence.
Note: I have dumped the contents of the remote's EEPROM. The EEPROM, as far as I can tell, only stores the user's command queue. Each memory address starting from 0x01 stores an individual direction command entered by the user. I have generated a mapping of direction buttons to the corresponding values stored in memory. This is how I was able to determine that the loop button just appends the loop sequence to the end of the command queue (so there is no loop command in the queue, just the repeated contents of the loop). I also found that direction commands entered with Object Detection enabled are stored as different values in EEPROM. This difference should be observable in the IR signals.
I have used AnalysIR to record all of the raw IR signals corresponding to the different button presses but none can be decoded by the software (as expected). I've attached the saved session: I've been searching around a lot but I'm only finding information about common protocols. This seems to be a fairly unique protocol, particularly because of the Send button and the fact that it can transmit up to 150 commands in one message.
Prior to buying AnalysIR I used an RPi and pigpio with the IR Record and Playback example code provided here https://abyz.me.uk/rpi/pigpio/examples.html I've been using the Light button for testing and have been able to record a consistent signal but when I attempt to transmit it to the robot from the RPi The robot's lights just blink once and nothing happens (same response for other buttons). So I know that at least something is getting transmitted and some part of that is detected by the robot.
Any way, I am here seeking help/guidance on analyzing and decoding this protocol. Once it is decoded I will test transmission from the RPi. If that works I want to try piping the commands to the headphone jack on my PC with a 3.5mm IR transmitter connected as I think this will be the cheapest/easiest way for people to use my python library with the toy robot.
I'm at a loss for what to do next and appreciate any help.
Thanks!