Vietnam 1
Hi, I was performing a Transfer program to PLC operation to an ESP32 microcontroller in the MQTT_Example example when I received the following error. Can someone help me debug this?bug_report.jpg
Reply 0 0
thiagoralves
Can I see the full bug report instead of just a screenshot?
Reply 0 0
Vietnam 1
Tôi có thể xem báo cáo lỗi đầy đủ thay vì chỉ ảnh chụp màn hình không?
Okay, here is the bug report, you can have a look and thank you will respond soon
Reply 0 0
thiagoralves
  1. Update your editor (file -> check for updates)
  2. Avoid using non English characters in your program. From the bug report it seems that you’re using Chinese characters in the MQTT string message you’re trying to send
Reply 1 0
Vietnam 1
And here is another error when I try to upload the program to the PLC. Please take a look and help me fix it. Hope to hear from you soon, thank you very much.
 
In file included from C:\Users\nvkha\OpenPLC_Editor\editor\arduino\examples\Baremetal\arduino_libs.h:21,
from C:\Users\nvkha\OpenPLC_Editor\editor\arduino\examples\Baremetal\Baremetal.ino:22:
C:\Users\nvkha\OpenPLC_Editor\editor\arduino\examples\Baremetal\modules\mqtt.c: In function 'uint8_t mqtt_send(char*, char*)':
C:\Users\nvkha\OpenPLC_Editor\editor\arduino\examples\Baremetal\modules\mqtt.c:179:16: error: 'class PubSubClient' has no member named 'beginMessage'
mqttClient.beginMessage(topic);
^~~~~~~~~~~~
C:\Users\nvkha\OpenPLC_Editor\editor\arduino\examples\Baremetal\modules\mqtt.c:181:16: error: 'class PubSubClient' has no member named 'endMessage'
mqttClient.endMessage();
^~~~~~~~~~
Error during build: exit status 1
COMPILATION FAILED!
Reply 0 0
thiagoralves
What hardware platform are you trying to upload this to?
Reply 0 0
Vietnam 1
I am trying to upload it to ESP32 hardware
Reply 0 0
thiagoralves
Compilation of MQTT_Send_Receive example works just fine on the latest version of OpenPLC Editor for ESP32:
 
Screen Shot 2024-07-29 at 1.00.25 PM.png
 
Make sure you have Modbus TCP enabled on the Communications settings.
Reply 0 0
thiagoralves
Also, on your Arduino IDE under Library Manager, make sure you have the latest version of the PubSubClient library installed:
Screen Shot 2024-07-29 at 1.26.27 PM.png
Reply 0 0
Reply