0x416c6578 / lds-006-firmware

A WIP custom firmware for the LDS-006 LIDAR module.
6 stars 1 forks source link

I think I had found decoded protocol for this lidar #2

Open opravdin opened 2 years ago

opravdin commented 2 years ago

Hello, I have received the same lds-006 unit couple of days ago. Really appreciate all the work you have done, it helped me a lot. Have tried some brute-forcing of uart bus (sending all messages possible from 1 to 3 bytes long) but without success. However, there is an ungoogleable repository on Github and it seems the author has fully decoded receiving protocol of this puppy (still can't enable the motor though). Check it out, maybe it can help you: https://github.com/Aluminum-z/Laser-Radar-LDS-006-Drive-Test

0x416c6578 commented 2 years ago

oh wow, that does seem to be the correct driver! that saves me a lot of time in trying to decode the data. as the author says you can just control the motor with a pwm voltage on the motor pins, although i will try and sort my custom firmware over the christmas break to allow controlling the motor over serial if i have the time. thanks for your find, you probably have saved me many days of work!

opravdin commented 2 years ago

Yeah, that pwm trick is possible but it's a kinda dirty hack, native control will be better. I am currently searching for owners of those deebot models (DE55 or 900 or other compatible) with this lidar. One guy has told me that he tried to listen for UART communications on them and there are a lot of data being transmitted to lidar (maybe the robot is uploading some firmware on it, not quite sure). However, I haven't seen it and confirm it 100%. There are a couple of pieces on sale on our local second-hand trading platform, but in different cities than mine. Btw, those robots have ni-mh batteries and they are dying in 1-1.5 years, so it may be an explanation why those lidars are sold so cheap.

0x416c6578 commented 2 years ago

ahh yeah that is probably why they are so cheap. the data being transmitted could be config parameters or something, I would be surprised if they were uploading a new firmware each time it starts up. I did try piping random data into the serial port for some time but i couldn't randomly get the motor to start. most likely its some esoteric command that is needed.

opravdin commented 2 years ago

Any advanced command is at least 4 bytes of data (header, command type, some data byte(s) and checksum) and it's nearly impossible to bruteforce :( I have some Arduinos laying around, so I will make a little sketch, which is listening same RX pin and will control PWM with my custom command.

opravdin commented 2 years ago

Figure_1 Well... I think I've got it

opravdin commented 2 years ago

Here is the result of my work :) https://github.com/opravdin/lds-006-reverse-engineering