Jump to content

Segway S/S-Plus/Loomo on wire bus/protocol


Recommended Posts

Hi,

 

I am trying to figure out the on wire bus/protocol for either Segway S/S-Plus/Loomo. I did open up the base and saw three open ports as shown in the picture below.

 

2tgPs8o.pngI could manage to sniff some data from Port 1 (GND, Tx, Rx) and the messages looked something like this

0x5A 0xA5 0x02 0x04 0x06 0x02 0x00 0x00 0x02 0xEF 0XFF

which seems consistent with what others have found. Port 3 seems like a SWD since one of the pin looked like a clk signal (not exactly though). Port 2 seemed more like UART port since one of the pin was held at 3.3V (which I assume would be the Rx pin for my terminal) and the other one was held low. I connected at UART-USB terminal and used pyserial to send exactly the same message that I found earlier but I don't seem to be getting any reply back. I did try using a different source address according to this protocol but again no reply. What I really want to achieve is find a programmatic way of moving the self balancing bot forward. Also attaching my script that I am using for sending the commands below

 

import serial
import time
import struct


def checksum(buf):
    s = 0
    for c in buf:
        s += c
    return struct.pack("<H", (s & 0xFFFF) ^ 0xFFFF)


def main():
    s = serial.Serial(port='/dev/tty.usbserial-AB0KT24G', baudrate=115200)

    buf = get_first_variable()


    for i in range(256):
        header = b'\x5A\xA5'
        packet = b'\x01' + struct.pack("<B", i) + b'\x07\x01\x40\x1C'
        c = checksum(packet)
        buf = bytearray(header + packet + c)
        print(s.write(buf))
        time.sleep(1)

    s.close()


if __name__ == '__main__':
    main()

 

Link to comment
Share on other sites

  • 2 years later...

Hey boss, did you ever end up figuring this out?? I am currently also trying to do the exact same thing as you described. I can not find any information about how to do this… so if you did manage to do it, I would really appreciate if you could pass on the information. 

 

Thank You. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...