Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build is missing Modbus features with Modbus checked. #344

Open
JanX2 opened this issue Mar 6, 2023 · 11 comments
Open

Build is missing Modbus features with Modbus checked. #344

JanX2 opened this issue Mar 6, 2023 · 11 comments
Labels
bug Something isn't working

Comments

@JanX2
Copy link

JanX2 commented Mar 6, 2023

Thank you for this awesome project!

I tried to get a custom build for either ESP32 devkit or a generic ESP8266 including Modbus bridge and Modbus TCP functionality. The default Tasmota release for ESP32 (tasmota32.bin) contains only the Modbus bridge functionality so this seemed the only way.

I’m using gitpod.io.

At first I simply tried to use the web interface to set up my build:
Tasmota source code
WiFi configuration (my Wifi)
Select features (with Modbus checked)
Custom parameters (none)
Select version and compile (latest version)

That didn’t work: ModBr RX and ModBr TX were missing from the “Module parameters” for the pins in the Tasmota web UI.

So I tried the official tasmota32.bin and that got me to at least get Modbus serial working. The Modbus TCP apparently isn’t enabled in the official builds. This means for example the that console command “ModbusTCPStart 502” will fail with “RESULT = {"Command":"Unknown"}”.

Then I tried Tasmota again via gitpod.io. Same settings as above, but this time with Modbus checked and these “Custom parameters”

#ifndef USE_MODBUS_BRIDGE
#define USE_MODBUS_BRIDGE       // Add support for software Modbus Bridge (+3k code)
#define USE_MODBUS_BRIDGE_TCP   // Add support for software Modbus TCP Bridge (Must also enable USE_MODBUS_BRIDGE)
#endif

Still no dice.

And finally:

#ifndef USE_MODBUS_BRIDGE
#define USE_MODBUS_BRIDGE       // Add support for software Modbus Bridge (+3k code)
#endif
#ifndef USE_MODBUS_BRIDGE_TCP
#define USE_MODBUS_BRIDGE_TCP   // Add support for software Modbus TCP Bridge (Must also enable USE_MODBUS_BRIDGE)
#endif

And again so support for either “ModBr RX“ or “ModBr TX” for the pins and “ModbusTCPStart 502” is still failing.

I’m at all out of ideas about what to try next. Any pointers? What am I missing?

Thank you again!

@benzino77
Copy link
Owner

Jan, try to contact Tasmota Dev Team on discord. As stated here: https://tasmota.github.io/docs/Modbus-Bridge this functionality should be enabled by:

#ifndef USE_MODBUS_BRIDGE
#define USE_MODBUS_BRIDGE       // Add support for software Modbus Bridge (+3k code)
#define USE_MODBUS_BRIDGE_TCP   // Add support for software Modbus TCP Bridge (Must also enable USE_MODBUS_BRIDGE)
#endif

and exactly that is enabled by TasmoCompiler when Modbus Bridge is selected as the feature (described here)

For sure you have to assign GPIO pins in your Tasmota configuration for Modbus to work properly (docs mentioned above)

@JanX2
Copy link
Author

JanX2 commented Mar 6, 2023

Thanks @benzino77! I got Modbus working with the official release as stated. But not the TCP bridge.

Edit: asked on discord: https://discord.com/channels/479389167382691863/790187952416358460/1082415371807641650

@JanX2
Copy link
Author

JanX2 commented Mar 7, 2023

I installed the tasmota32-allsensors.bin which, apparently, is build from Tasmota HEAD every time a new commit gets pushed. The allsensors.bin, according to @Jason2866, has the required flags added. Maybe there are some issue in the latest release building everything correctly with the defines above.

These were the Console commands required for my setup:

ModBusBaudrate 9600
ModbusSerialConfig 3
ModbusTCPstart 502

@lyazide
Copy link

lyazide commented Jul 24, 2023

Thank you for this awesome project!

I tried to get a custom build for either ESP32 devkit or a generic ESP8266 including Modbus bridge and Modbus TCP functionality. The default Tasmota release for ESP32 (tasmota32.bin) contains only the Modbus bridge functionality so this seemed the only way.

I’m using gitpod.io.

At first I simply tried to use the web interface to set up my build: Tasmota source code WiFi configuration (my Wifi) Select features (with Modbus checked) Custom parameters (none) Select version and compile (latest version)

That didn’t work: ModBr RX and ModBr TX were missing from the “Module parameters” for the pins in the Tasmota web UI.

So I tried the official tasmota32.bin and that got me to at least get Modbus serial working. The Modbus TCP apparently isn’t enabled in the official builds. This means for example the that console command “ModbusTCPStart 502” will fail with “RESULT = {"Command":"Unknown"}”.

Then I tried Tasmota again via gitpod.io. Same settings as above, but this time with Modbus checked and these “Custom parameters”

#ifndef USE_MODBUS_BRIDGE
#define USE_MODBUS_BRIDGE       // Add support for software Modbus Bridge (+3k code)
#define USE_MODBUS_BRIDGE_TCP   // Add support for software Modbus TCP Bridge (Must also enable USE_MODBUS_BRIDGE)
#endif

Still no dice.

And finally:

#ifndef USE_MODBUS_BRIDGE
#define USE_MODBUS_BRIDGE       // Add support for software Modbus Bridge (+3k code)
#endif
#ifndef USE_MODBUS_BRIDGE_TCP
#define USE_MODBUS_BRIDGE_TCP   // Add support for software Modbus TCP Bridge (Must also enable USE_MODBUS_BRIDGE)
#endif

And again so support for either “ModBr RX“ or “ModBr TX” for the pins and “ModbusTCPStart 502” is still failing.

I’m at all out of ideas about what to try next. Any pointers? What am I missing?

Thank you again!

I have the same issue. I checked the Modbus Bridge but can not get the "MODBr" RX and TX in the web configuration.
Did you get this solved?

@JanX2
Copy link
Author

JanX2 commented Jul 31, 2023

@lyazide
The only fix I found is to roll my own binary locally. This may have changed since then.

@nonix
Copy link

nonix commented Mar 3, 2024

Hi I am sorry to add firewood into this older bug report. However, I have hit the exact same issue today.
Using tasmocompiler with selection of "ModBus Bridge" the Modbus bridge will not get compiled in.
After a short exchange with Sfromis Discord chat

It was clear and confirmed that Tasmocompiler has a typo in the #define USE_MODBUSBRIDGE instead of correct on: #define USE_MODBUS_BRIDGE
Note: the underscore between MODBUS and(_) BRIDGE. Hope this helps a bit.

@nonix
Copy link

nonix commented Mar 3, 2024

Jan, try to contact Tasmota Dev Team on discord. As stated here: https://tasmota.github.io/docs/Modbus-Bridge this functionality should be enabled by:

#ifndef USE_MODBUS_BRIDGE
#define USE_MODBUS_BRIDGE       // Add support for software Modbus Bridge (+3k code)
#define USE_MODBUS_BRIDGE_TCP   // Add support for software Modbus TCP Bridge (Must also enable USE_MODBUS_BRIDGE)
#endif

and exactly that is enabled by TasmoCompiler when Modbus Bridge is selected as the feature (described here)

For sure you have to assign GPIO pins in your Tasmota configuration for Modbus to work properly (docs mentioned above)

Seem like a typo, the underscores are missing (just cut & paste from Tasmocompiled FW 13.3.0)

#ifdef USE_MODBUSBRIDGE
  #undef USE_MODBUSBRIDGE
#endif
#define USE_MODBUSBRIDGE

@benzino77
Copy link
Owner

Thanks for this finding! Great job. I will fix it soon.

@benzino77 benzino77 added the bug Something isn't working label Mar 3, 2024
@benzino77
Copy link
Owner

I've push changes to development branch (link to gitpod) and benzino77/tasmocompiler:development docker image. @nonix could you please check if this is working as expected now?

@nonix
Copy link

nonix commented Mar 11, 2024

I've push changes to development branch (link to gitpod) and benzino77/tasmocompiler:development docker image. @nonix could you please check if this is working as expected now?

Hi @benzino77 I've tested using the devel. branch of Tasmocompiler (TasmoCompiler v11.0.0-dev) and I can confirm, the test was successful

Selection used:
ESP8266/Wemos D1 with options: ModBus br, Rules, SD card/LittleFS, Timers, Web Interf.
Custom params: #define CODE_IMAGE_STR "TasmoCompiler-ModBus4M"
Tasmota version: Development

Thank you for the effort.
N.

@benzino77
Copy link
Owner

I'm glad to hear it. Thanks for your help! I will release new stable version as soon as I have some free time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants