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
The best way to change anything on the editor is to use it from source. Clone the GitHub repository of the editor and follow the instructions on the README to start a dev build. Once you manage to get everything working you can generate a build with the command “npm run package” on terminal.
Reply 0 0
thiagoralves
For best results, use nvm to set your NodeJS to version v20.12.2. That’s the exact version we use to generate our builds.
Reply 0 0
mrea
@thiagoralves I have now got it working by adding:

"platform": "esp32:esp32:esp32s3:CDCOnBoot=cdc,USBMode=hwcdc",
 
I have noticed the logic is running correctly but the debugger is not displaying it correctly? The start is true and stop is NC and false so the run should be displayed as TRUE, the actual physical logic running in code is correct ( I have Push Buttons and LEDs ) It's just the debugger displaying it incorrect

[203128%2F9649940%2Fmceclip0]
Reply 0 0
thiagoralves
The debugger is failing to get the values of stop and run. You can see that on the debugger panel they have value - instead of true or false. Could be some issue with the serial port still. Perhaps some added latency or buffer issues with the CDC driver. At least you got it talking, which is good!
Reply 0 0
mrea
@thiagoralves getting no errors on console though? I have tried downloading again etc still not change, locks up at same point? Anything else to try?

How can we run code in the normal arduino loop that is not affected by task such as 20ms? I'm calling my library in this 20ms loop which does all web server updates etc every 20ms which is not ideal? Or just create a faster task for these?

 
[3:00:47 PM]: Debug compilation completed successfully.
[3:00:47 PM]: -------------------------------------------------------------------------------------------------------------
[3:00:47 PM]: Extracting MD5 from compiled program...
[3:00:47 PM]: Program MD5: 4becfe093afeb40db59ae68fd99a3691
[3:00:47 PM]: Requesting MD5 from target at /dev/ttyACM0...
[3:00:49 PM]: MD5 verification successful. Starting debugger...
[3:00:49 PM]: Debug tree builder: Built 6 trees (3 complex).
[3:00:49 PM]: FB instance map: Found 3 instances across 3 FB types.
[3:00:49 PM]: Debugger started successfully. Found 37 debug variables.
 
 
Reply 0 0
mrea
I moved my config C++ code to a 1ms task and now the debugging works... must have been causing some issues being called every 20ms
Reply 0 0
mrea
It's better and the contacts change in real time and on debugger when PB pressed but the run does not go false on the debugger... the physical LED tied to run switches off.

[203128%2F9650017%2Fmceclip0]
Reply 0 0
thiagoralves
I would try running this without your extra C code first. This could be affecting the real time performance of the runtime, adding latency, and impacting the debugger behavior
Reply 0 0
Jiaoche
My board is Raspberry Pi 3B, I have the same problem, how to solve it? Thanks!
[203128%2F9655767%2Fmceclip0]
[203128%2F9655769%2Fmceclip0]
Reply 0 0
thiagoralves
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).
Reply 1 0
mrea
Hi @thiagoralves did some more testing with minimal c code, just enough for the i2c and io mapping and still same issue with the debugger not displaying or updating correctly. Is there anything else I can do to test? I have tried to use modbus scan tool to watch the values directly but don't see any registers changing or they start from some other register values, start address is not from 0?

[203128%2F9655717%2Fmceclip0]

[203128%2F9655716%2Fmceclip0]
Reply 0 0
thiagoralves
Hard to tell without knowing what your C code does.
Reply 0 0
mrea
@thiagoralves if I add more variables to the debugger then the contacts for start and stop also stop responding... I can see the analog values changing in the debugger when I add them, so it seems the polling is to fast and missing data or being overloaded?

All the C code does is reads the I2C ADC and DAC and does some scaling and reads and writes the digital pins and maps to variables to be used in OpenPLC, there is no blocking code or delay etc
Reply 0 0
mrea
@thiagoralves if I use WIFI debugging it works correctly, so it's an issue with the serial only, I would assume to much data for the baud rate and polling speed of the serial connection. Is there a way to reduce polling speed in the editor to test and confirm?
Reply 0 0
thiagoralves
As I said, it’s hard to tell without seeing your actual code. Since you said it works when you remove your code, I would suspect the issue is in your code. But it could be something else as well, maybe some conflict with libraries you’re using and the openplc runtime, or hardware configuration changes related to your code, etc.
Reply 0 0
Reply