MrD
After receiving the response that the compilation error had been fixed, I ran an update for OpenPLC. The update was installed successfully. I proceeded to check that the compilation error was corrected with the update. I built a simple Test LD consisting of a pushbutton switch (PB1) and an LED. The program was successfully transferred to the ESP32 Test circuit without a Compilation Error message.
 
Pressing PB1 did not turn on the LED. I measured at GPIO17 3.314V when PB1 was pressed. The LED circuit was tested by applying the onboard 3.3V to the series 330 ohm resistor. The LED turned on with the applied 3.3V source. I ran the Debug Remote to verify the Test LD program was running on the ESP32 WROVER dev kit board. Unfortunately, an error message was flagged, thereby stopping the debug process. I have attached pictures of the breadboard circuit, the Test LD with the Tag Listing, and Debug Remote messages to assist in the resolution phase of this concern.
 
Breadboard.pngDebug_Remote_Error.pngDebug_Remote_Settings.pngTest_LD.png
Reply 0 0
thiagoralves
Oh dang! I'm sorry for the trouble. I'm trying to blindly fix this while my ESP32 boards haven't arrived yet. Have you tried enabling Modbus RTU as reported here to see if it works?
Reply 0 0
MrD
Well enabling the ModBus RTU allowed GPIO2 to blink per the Blink LD. I plan to check all the GPIOs mapped for the ESP32 to find any inoperable pins. I will post my results to the forum when the testing has been completed.
Reply 0 0
thiagoralves
Hmmm… so it seems that the problem is related to the serial port. Perhaps the ESP32 won’t work if serial is not initialized
Reply 0 0
MrD
After testing the ESP32 GPIOs using the Blink and Test LDs, the only two pins/location addresses that were inoperable are listed below.
  • GPIO17 (%IX0.0)
  • GPIO16(%QX0.7)
Here is a a screenshot of the Test LD.
Test_LD.png
 
To clarify which Modbus RTU to use, it is the serial version. A screenshot of the enabling this function is shown below.
 
Enabling_Modbus_RTU_Serial.png
 
I was able to compile and transfer this Programmable Logic Function LD programmed to perform an AND gate operation onto the ESP32. The LD worked as built.
 
Functional_Programmable_Logic_Gate_LD.png
Reply 0 0
thiagoralves
Awesome! Thank you so much for the tests. It seems that the issue is related to the serial port then, it must be enabled for the ESP32. Once I get my boards I will test it more thoroughly, but for now, everyone using ESP32 please keep Modbus RTU enabled for the board to work. You can also enable Modbus TCP if you want, that can work alongside Modbus RTU without issues.
Reply 0 0
thiagoralves
Just one more question... for the pins that weren't working, if you add them to the list on the I/O Config screen, does the board crashes, or just the pins that don't respond?
Reply 0 0
MrD
All of the default GPIO pins have not been removed from the I/O Configuration window. See below.
 
I_O_Configuration_Pins_window.png
Reply 0 0
Joluxer
I start to dive into this issue this weekend. I can reproduce the crash, seen in the console log from @MrD and I can also reproduce the change in behavior when enabling or disabling Modbus RTU on an ESP32-WROOM module. ESP32-WROVER will be a different story, I'll try to sort later, because of the PSRAM involvement.
 
It might take couple of days, as my improvised JTAG adapter died this morning, but a better version is on the way, so I can go on by the first half of next week. Until then I go deeper into the issue on a different path, by reviewing the generated source code, that is fed into the Arduino compiler.
 
So, please, stay patient for a couple of days, I'm sure, I'll find something. When I find somehting, then I'm confident that a solution comes in sight.
 
Regards,
J'Lo
Reply 0 0
Joluxer
I could solve the ESP32 issue, that disappeared by enabling Modbus options. Some pull-request on github follows soon.
 
Technical it was as follows:
The issue was a null-pointer dereference during updating the inputs and outputs. All ESP32 boards were affected, because all those boards reference the esp32.cpp HAL file.
 
That was not as hard as I thought in the beginning. So from now, we can go on to the next type of issue. Perhaps we can discuss, how to re-enable the temporarily disabled features.
 
Wish you all a nice Friday.
Regards,
J'Lo
 
PS: Github pull-request is called.
 
PPS: Big thanks to all, who reported here and gave detailed problem descriptions.
The following details helped a lot to track down the issue:
  • exact board type (i.e. ESP32-WROOM and ESP32-WROVER)
  • GPIO pins that work and especially which ones do not work, on a ESP32-WROVER board GPIO16/17 are not available, they are used for the PSRAM (which is by the way not (yet) in use for OpenPLC)
  • the detail, that enabling any MODBUS funtionality hides the issue
  • last but not least: the console log of the crash.
Reply 0 0
Write a reply...
Reply