Riden icon indicating copy to clipboard operation
Riden copied to clipboard

Communication problem with newer firmwares

Open mdjurfeldt opened this issue 3 years ago • 11 comments

I am experiencing the problem that you refer to in the README where you recommend Unisofts firmware due to some change in newer stock firmware. This is on an RD6012P running fw 1.46.

For me, trying to create the Riden object hangs. (This doesn't happen on my RD6018 running some pre 1.40 fw.)

Do you have any idea of what they changed? Are you aware of anyone having succeeded to talk to these newer fw:s using custom software?

mdjurfeldt avatar Jan 15 '23 18:01 mdjurfeldt

I'm not sure if it's the same problem, but with stock FW 1.42 I had to increase the modbus timeout before the library starts working for me:

diff --git a/riden/riden.py b/riden/riden.py
index 24a7fde..7af6f4b 100644
--- a/riden/riden.py
+++ b/riden/riden.py
@@ -32,7 +32,7 @@ class Riden:
 
         # Fixes "Response length is invalid 0" error
         # If you experience this error, try changing your baudrate
-        self.master.set_timeout(0.05)
+        self.master.set_timeout(0.5)
 
         # Windows requires opening/closing the com port after each call
         # This is a workaround that will drasticly reduce performance

(following the instructions in the comment)

I did this to get it working, but didn't investigate any further.

bluecube avatar Jan 15 '23 20:01 bluecube

I tested this, and communication now works.

mdjurfeldt avatar Jan 15 '23 23:01 mdjurfeldt

If this is the case the timeout value can be exposed optionally in the constructor and a default minimal value that still works with this firmware version

ShayBox avatar Jan 15 '23 23:01 ShayBox

@ShayBox Sounds like a good idea. I'll find out (binary search) what that value is tomorrow and report.

mdjurfeldt avatar Jan 16 '23 00:01 mdjurfeldt

@ShayBox @bluecube Hi again, It seems like a timeout of 0.15 does not work while a timeout of 0.16 works. I tested this both over USB and over Wifi (socat + telnet to a reprogrammed and physically patched Wifi module connected in TTL mode). This was on an RD6012P running firmware V1.46. So, to have some margin, perhaps 0.2 is a good value?

mdjurfeldt avatar Jan 16 '23 10:01 mdjurfeldt

Seems good to me :+1:

ShayBox avatar Jan 16 '23 16:01 ShayBox

For me it's about 0.3s, which feels ridiculously long. I might look at the reason and try to figure out some non-parametric way of handling the timeouts later when I have a bit more time. (but don't wait for that, it will be at least a few weeks from now)

bluecube avatar Jan 17 '23 08:01 bluecube

Try it out with stock V1.46. They state that they did optimizations of communication.

mdjurfeldt avatar Jan 17 '23 10:01 mdjurfeldt

@mdjurfeldt I wasn't able to find the firmware anywhere. The website seems to be just a static image.... Do you have a link to the firmware please?

Sorry for spamming the issue :)

bluecube avatar Feb 03 '23 10:02 bluecube

@bluecube Hi! Here are directories with firmware for different models:

http://www.ruidengkeji.com/rdupdate/firmware/

mdjurfeldt avatar Feb 03 '23 10:02 mdjurfeldt

Try it out with stock V1.46. They state that they did optimizations of communication.

Can confirm, 0.2s worked with the newer firmware.

bluecube avatar Feb 05 '23 12:02 bluecube