RalfOGit / libspeedwire

SMA Speedwire(TM) access library written in C++
MIT License
15 stars 6 forks source link

Question: speedwire vs energy meter vs inverter protocol #2

Open mincequi opened 2 years ago

mincequi commented 2 years ago

Hi there, i adapted once your libspeedwire for integration with SBFspot. Just our of curiosity: how do all these protocols relate together? Is speedwire used by both: energy meter AND inverter? Is production data of an inverter also multicasted (like the energy meter does)?

Thanks a lot already! :)

RalfOGit commented 2 years ago

Hi Manuel,

Speedwire is the wrapper for ethernet transport. There are separate protocol ids for emeter packets and inverter packets. There can be as many different protocols as SMA can invent. But, for now only these two protocols are known.

Emeter packets are sent by the SMA device as multicast packets whereas inverter packets are sent by SMA devices as unicast packets. In practice it is not black and white. An inverter will receive and handle emeter packets no matter how they are sent, be them unicast or multicast packets. The inverter protocol is synchronous, i.e. request reply. However the sender and the recipient is indicated by the susyid. I never tried it, but I bet, the IP address is not relevant for the inverter protocol. Thus, you can likely also send or forward them as multicast.

Best regards Ralf

Am 23.12.2021 um 17:01 schrieb Manuel @.*** Diecom>:

 Hi there, i adapted once your libspeedwire for integration with SBFspot. Just our of curiosity: how do all these protocols relate together? Is speedwire used by both: energy meter AND inverter? Is production data of an inverter also multicasted (like the energy meter does)?

Thanks a lot already! :)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.

RalfOGit commented 2 years ago

Hi Manuel,

Two corrections to my previous post.

I said that Speedwire is an ethernet transport. Indeed it is an IP transport layer.

Speedwire addressing is done by susyid and serial number. However, the IP packet still needs to reach its recipient. Within a local subnet the choice between multicast and unicast does not make a difference. However, if devices reside on different subnets, both IP routing and Speedwire addressing must be correct .

Best regards Ralf

Am 23.12.2021 um 22:14 schrieb @.***:

 Hi Manuel,

Speedwire is the wrapper for ethernet transport. There are separate protocol ids for emeter packets and inverter packets. There can be as many different protocols as SMA can invent. But, for now only these two protocols are known.

Emeter packets are sent by the SMA device as multicast packets whereas inverter packets are sent by SMA devices as unicast packets. In practice it is not black and white. An inverter will receive and handle emeter packets no matter how they are sent, be them unicast or multicast packets. The inverter protocol is synchronous, i.e. request reply. However the sender and the recipient is indicated by the susyid. I never tried it, but I bet, the IP address is not relevant for the inverter protocol. Thus, you can likely also send or forward them as multicast.

Best regards Ralf

Am 23.12.2021 um 17:01 schrieb Manuel @.*** Diecom>:

 Hi there, i adapted once your libspeedwire for integration with SBFspot. Just our of curiosity: how do all these protocols relate together? Is speedwire used by both: energy meter AND inverter? Is production data of an inverter also multicasted (like the energy meter does)?

Thanks a lot already! :)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.

mincequi commented 2 years ago

Hi Ralf,

thanks a lot. This helped a lot for general understanding. I probably will integrate your lib once more into my newest project to support SMA emeters. Since i did not like the idea, to implement proprietary protocols for reading out solar inverters, i implemented a modbus/sunspec client to read out inverter data. If you are interested: https://github.com/mincequi/ElsewhereEdge

This also incorporates InfluxDB and MQTT export.