Modbus newbie questions

That pretty much happens anyway :wink: every device is different, every situation presents new pitfalls and misunderstandings.

On the WiFi / port 502 thing, if I understand you correctly your device has both WiFi and wired ethernet ports. That is of itself unusual.
Your device responds to Modbus queries over WiFi with a Modbus “go away” message. That’s fine.
That’s the time you turn to your maker’s docs to find out what is going on. Maybe it can never work, maybe it needs enabling or setting up, etc.

There’s nothing the binding can do about it, except report the error. Which I understand it did? We covered that in post #8 I think.
There’s no sensible course of action except to consult the maker’s docs, if any. (which are often pants and we do end up in the guessing game :crazy_face:)
What was unusual here was the device responding at all. That is legitimate, but because we don’t know why it rejected us we went off on a goose chase of suspecting we were asking it to do bad things.

I’m not sure what you want to say about all this, in the binding docs?

The most useful info for new Modbus users are posts in this forum “tutorial - how I connected my Smartypants model XYZ to openHAB”

The length is one of the parts I find very difficult to find… I simply can get it to make sense. So I look forward to see your new addition to the doc.

All I said was “max 123” for a reminder. But I’m having second thoughts about that now - you can poll 255 discrete inputs. This is where understanding Modbus comes in, and isn’t about “how to use the binding”.

just add my 2 statements from above
“There exist Modbus devices to exhibit this behavior so if you’re hit by that, check out this:”
Note these aren’t problems that only arise with my device. While not frequent, they’re generic in nature.

Reality is that quirks like these are never in a vendor’s docs (if you even get hold of it …), and quite often end users even cannot contact the vendor because of the indirect sales/support model in many countries.
What users have access to and will have read is the binding docs. If they search the forum for “Smartypants model XYZ” they will not find these hints as it’s unlikely that someone has solved AND posted about in this combination.
So for sake of UX, the favorite place to put that potentially helpful information is the binding docs.

Well the doc is right there, and you have editing privileges. It doesn’t belong to me.

done

Agree… This is mainly regarding how the manufacture of the device has designe the modbus, right?

Note: A device may have more than one interface with a port 502 it responds on, but may have no connection to the real bus hardware. Use the Ethernet IP.

This really, really specific to your particular device. While I still resist having it there at all (because of a thousand other more likely wrinkles), please consider making the comment more generic. Port 502 is not set in stone, and which one or more of a choice of physical interfaces might or might not work is not set in stone.

You might also consider the case of slave or gateway device with both serial and LAN interface(s).

If the advice becomes generic enough, you might consider moving it to “troubleshooting” section, as this is not need-to-know info for setting binding parameters.

changed, let’s see what @ssalonen thinks of it

Unfortunately my inverter has restarted and now no longer offers the Ethernet IP. So far I’ve been failing to get it to offer it again :frowning:

In some AU forum I read about Sungrow encrypting access. Googling for that, I’ve found this spec on Modbus encryption:

@ssalonen is Modbus via TLS supported or do you have any plans for it ?

Not supported out of the box at least, and not planned

If it is pure TLS, you might have success by introducing a local proxy between decrypting the traffic and acting as a normal modbus server.

Haven’t done this though in practice, and don’t have concrete software to offer at this stage.

Edit: I was thinkimg something like socat, https://stackoverflow.com/questions/46050238/socat-how-to-listen-on-non-ssl-tcp-and-forward-to-ssl-tcp-endpoint

As we have nginx as part of openHABian, I’ve used that.
Mapping is quite simple and all by itself works fine. But access does not :frowning:
So my inverter does something else than “just” TLS.
Just FYI when this topic happens to raise again.

Hi @mstormi / all, I know this thread is a few years old but I was wondering if you are able to provide any advice. I’ve just installed a sungrow inverter and I’d like to retrieve the power data in openhab. I’ve created a modbus tcp bridge, and the inverter was automatically discovered as a single phase inverter device. There are many values in there and I can access all of them.

The only thing I can’t seem to access is named “Total Load Active Power” in the inverter web interface. This is the power actually being used in the house. There is a channel - “AC Power Value”, however this is a total of all power regardless of where it is going (for instance house load + power going to battery + power going to grid = “AC Power Value”). Any assistance would be greatly appreciated!

That sounds like something you / your other app would be calculating.

Any idea how? The only other value I have access to is the total DC power. If I had access to sendtogrid, or sendtobattery, I could easily do the calculation, but those values aren’t (readily) available