Page 1 of 3

ESP32 MODBUS ASCII

Posted: Thu Apr 15, 2021 8:56 am
by pedrazzi
Hi, I am trying to make an ascii MODBUS with ESP32 wroom 32, but the compiler returns this error:
../main/esp-project.c: In function 'FCD_04c01_ModbusSlave1__SendAndCalcCRC16':
../main/esp-project.c:3226:9: error: 'FCR_RETVAL' may be used uninitialized in this function [-Werror = maybe-uninitialized]
Use: Reads the state of a single digital input.
Thanks in advance

Re: ESP32 MODBUS ASCII

Posted: Thu Apr 15, 2021 9:47 am
by BenR
Hello,

Many thanks for letting us know. I have now pushed out an update to the update system that should solve the problem for you.

Re: ESP32 MODBUS ASCII

Posted: Thu Apr 15, 2021 11:10 am
by pedrazzi
perfect! Thanks for the help..
I tested the serial (OK) then I put the ascii modbus program back, but this doesn't work ..

Re: ESP32 MODBUS ASCII

Posted: Thu Apr 15, 2021 11:42 am
by LeighM
If you need 19200 baud, could you try setting this in the UART properties and remove the ChangeBaud(4)
Could you try that please?

Re: ESP32 MODBUS ASCII

Posted: Thu Apr 15, 2021 2:41 pm
by pedrazzi
the request is 9600 N 8 1, I put the setting at the beginning to be sure ..

Re: ESP32 MODBUS ASCII

Posted: Thu Apr 15, 2021 2:56 pm
by pedrazzi
I tried to remove the setting, but the result is always the same. the strange thing is that it doesn't even respond error ...
(this is the message: :010200010010ED.. 3a 30 31 30 32 30 30 30 31 30 30 31 30 45 44 0d 0a )

Re: ESP32 MODBUS ASCII

Posted: Thu Apr 15, 2021 3:18 pm
by LeighM
Could you check "Library Updates" "Full database"

Re: ESP32 MODBUS ASCII

Posted: Thu Apr 15, 2021 4:29 pm
by pedrazzi
actually it was not fully updated, I did the full update and restarted, but the problem is not solved :(

Re: ESP32 MODBUS ASCII

Posted: Fri Apr 16, 2021 10:54 am
by pedrazzi
Hello, I also tried with another microprocessor (32U4 / Arduino Leonardo), but the result is the same, I'm afraid I'm making something trivial wrong ..

Thanks in advance

Re: ESP32 MODBUS ASCII

Posted: Mon Apr 19, 2021 10:06 am
by LeighM
Can you explain a bit more about your setup, what you have connected and what you are trying to do?
The Flowcode Modbus Slave component is to be used for creating Modbus Slave devices.
If you are creating hardware to connect to an existing Modbus (slave) device, then you need to use the Flowcode Modbus Master component.

There are examples on the Flowcode Wiki, such as this one
https://www.flowcode.co.uk/wiki/index.p ... s:_System)