GIAN2025
Hello, I installed the new version 4.1.0
on Arduino Uno, I compile and then go into debug mode.
It returns the error: MD5 verification failed: Failed to get MD5 hash after retries.
I tried reducing the serial speed.
I'm stuck, can someone help me?
thanks.
Reply 0 0
thiagoralves
Just to clarify, by “your code” I mean your C code, not your PLC code. The debugger should work with whatever PLC code (IEC languages) you write. But C code is different since it gives you full access to the platform, and runs alongside the runtime
Reply 0 0
Jiaoche
What runtime version are you running on your Pi? The device is rejecting the connection, so I’m wondering if there is anything running in there. Also, make sure you’ve picked the correct runtime from the device configuration screen on the editor (v3 or v4).
OpenPLC Editor version: v4.1.1(Windows).
Pi OpenPLC runtime version: v4.0.3
 
I found that debugging works normally using OpenPLC runtime v4.
[203128%2F9655765%2Fmceclip0]
Reply 0 0
mrea
@thiagoralves since WIFI debugging is working fine with the same C code and the Serial fails would indicate it's an issue getting all the data over the serial for the debugging. I noticed some of the values in the debugger don't get values at all. If I change the baud from 115200 to 19200 it's even worse. Where does the Modbus address start for the debug values? Can I get all the debug values via Modbus to confirm I can read them all? The polling rate maybe overloading the connection? Is there any logs that may indicate dropped data etc
Reply 0 0
mrea
@thiagoralves it seems to maybe be an update or refresh issue in the editor display, if I switch to a different program or tab and then back to the the program it displays correct. I have added a link to screen recording. If you prefer I can add an issue on Github.

https://imgur.com/a/aOeu8Ml
Reply 0 0
thiagoralves
The serial buffer is smaller, which means the editor needs to make more requests to get all data on serial. My original question is about serial debugger with and without your C code. It makes no sense to me why it would simply work fine when you comment your C code if the problem is on the serial debugger. I’m not saying there isn’t a bug on the serial debugger (I bet there are many) but maybe this is just a crazy correlation of bugs where the symptoms don’t really reflect the issue. Perhaps your C code is affecting the timing of things so that the second batch read fails, and then some variables start missing data. On WiFi it might be able to get everything on a single batch and so you don’t see that happening. Just speculation but worth investigating…
Reply 0 0
mrea
@thiagoralves even if the serial is slower which is expected and requires multiple batches to get all the data and buffer it the debugger should wait or update as it goes? As you can see in the recording we do clearly get all the values but requires switching views for the debugger to update and display correctly?
Reply 0 0
thiagoralves
We might need to revisit the serial algorithm to ensure it is correctly handling the batches. It is possible that the extra latency added by your C code (just guessing since I didn’t see the actual code) could be affecting the batches cadence. Possibly we need to ensure it works even on high latency scenarios.
 
Right now our focus has been on the runtime v4 and the web architecture. If you have any web development skills (because the editor was written in Electron + React + Typescript) try to explore the editor source code, particularly the debugger functions, to check how it can be improved.
Reply 0 0
mrea
@thiagoralves have fixed the debugging... was logic issue in the batch processing here is my PR, also added the native USB support for the ESP32 S2 and S3

https://github.com/Autonomy-Logic/openplc-editor/pull/569
Reply 0 0
thiagoralves
Wonderful!! Thank you for the PR. One less thing for us to worry about 🙂
Reply 0 0
hpon
I got the same issue when using Arduino Uno. pyModBus worked. I could upload and run sketch from Arduino IDE. Everything seemed to work fine. But OpenPLC threw me that MD5 verification error.

I then pressed the compile/upload button (that looks like a folder with a down arrow on it), and that worked. And then I could magically run the Debugger again with out the described issue. Relief!
 
A side note. I'm a beginner. Initially (a couple of weeks ago) I used the compiler button (no tool tip, so I don't know what to call it) all the time. Then I tried the Debugger, and it was saying that the firmware on my device didn't match what I had in the ladder logic, and I had to approve an update of the firmware - this gave me the impression the the compiler button didn't upload properly, and so I stopped using the compiler button entirely and instead used the Debugger always. And then yesterday it suddenly stopped working.
 
I exhaused every posibility I could imagine until I tried the compiler button again - which now seems to have kicked things back into gear.
 
Love OpenPLC, btw.
Reply 0 0
thiagoralves
The debugger will only work if you have a program running on your device with Modbus enabled. It won’t be able to communicate with your device if there is nothing running on it. You should ALWAYS upload your project first before running the debugger instead of relying on the debugger md5 check to know if the code is up to date
Reply 0 0
hpon
Many thanks @ThiagoAlves. That makes sense.
Reply 0 0
Reply