srcfl / srcful-gateway

Srcful energy gateway to connect your solar inverter and mine src-token
https://srcful.io
MIT License
5 stars 2 forks source link

Feature request. MODBUS Proxy #174

Open frahlg opened 4 months ago

frahlg commented 4 months ago

I would like to add some complexity to the GW, I hope this could be added as it's own service and hopefully not interact with too much of the other complexity. It's configured via a .yaml file so instead we need to push settings to the proxy instead of the GW. and then the modbus proxy interacts directly.

OR an alternative could be to build this into our FW directly instead of having as a separate service.

Why this is needed?

I have been running this months and it seems to be very stable. Example below.

$ modbus-proxy -c ./modbus-config.yml

https://github.com/tiagocoutinho/modbus-proxy

h0bb3 commented 4 months ago

Connected to #45

h0bb3 commented 4 months ago

duplicate of #161 (closing that one as this has some more info)

h0bb3 commented 4 months ago

Also note licence information for used lib/code/software and how that would affect the eGW

It seems a modbus proxy is basically 400 lines of code... is it really worth launching this as a service of it's own?

https://github.com/tiagocoutinho/modbus-proxy/blob/master/src/modbus_proxy.py

h0bb3 commented 4 months ago

Proxy will run in its own process for performance reasons and will essentially become a service running inside the container. The blackboard could have a dict of all services, i.e. name: start_script, port

all services will be reachable by http://localhost:port some could also be mapped in the container (e.g. modbus proxy 502) so they can be access from the outside.

erikarenhill commented 4 months ago

It would be nice if the srcful proxy would be able to cache the last response available for a certain register, for example lets say an inverter can only respond every 5th second, if some other service like a Home Assistant addon would request data every second from the srcful proxy it would be better to just respond with the last known value instead of pushing the inverter harder? Just some thoughts

h0bb3 commented 2 months ago

if we want to support multiple inverter connections per gateway this also needs to be sorted.