Closed bilbolodz closed 6 months ago
The modbus library was last updated 5 months ago. Can you identify the exact release that has brought this issue? There is nothing else I could suggest for diagnosis. i/o timeout is exactly that...
OK I will try to check which version is broken
It looks that problem stars in version 0.123.9. It requires new config format and NOT connecting to my modbus TCP adapter. Reversing to version 0.123.7 (and old config) heals problem.
.8 works too? Could you share modbus trace logs for both when running
evcc meter
/cc @premultiply
@bilbolodz could you forward your grid meter port for info@evcc.io?
Tentatively marking as bug
.8 generate other errors but it read meter. What do you mean "forward your grid meter port"?
Port forwarding for testing.
evcc meter
[main ] INFO 2024/02/20 22:22:22 evcc 0.123.7
[main ] INFO 2024/02/20 22:22:22 using config file: /root/evcc.yaml
[db ] INFO 2024/02/20 22:22:22 using sqlite database: /root/.evcc/evcc.db
[mqtt ] INFO 2024/02/20 22:22:22 connecting evcc-193857410 at tcp://192.168.105.22:1883
[mqtt ] DEBUG 2024/02/20 22:22:22 tcp://192.168.105.22:1883 connected
[eebus ] INFO 2024/02/20 22:22:22 Local SKI: bfe624a1d5c92cd51fa43ea0414ccd6a945d1df8
[eebus ] DEBUG 2024/02/20 22:22:22 mdns: announce
[eebus ] DEBUG 2024/02/20 22:22:22 mdns: using zeroconf
[eebus ] DEBUG 2024/02/20 22:22:22 starting websocket server on :4712
[eebus ] DEBUG 2024/02/20 22:22:22 error during websocket server starting: listen tcp :4712: bind: address already in use
Fronius
-------
Power: 0W
PGE
---
Power: 8713W
Dom
---
Power: 1503W
Klimatyzacja
------------
Power: 22W
Ladowarka
---------
Power: 7129W
[eebus ] DEBUG 2024/02/20 22:22:22 mdns: stop announcement
evcc meter
[main ] INFO 2024/02/20 22:24:56 evcc 0.123.8
[main ] INFO 2024/02/20 22:24:56 using config file: /root/evcc.yaml
[db ] INFO 2024/02/20 22:24:56 using sqlite database: /root/.evcc/evcc.db
[mqtt ] INFO 2024/02/20 22:24:56 connecting evcc-1203291675 at tcp://192.168.105.22:1883
[mqtt ] DEBUG 2024/02/20 22:24:56 tcp://192.168.105.22:1883 connected
[eebus ] INFO 2024/02/20 22:24:56 Local SKI: bfe624a1d5c92cd51fa43ea0414ccd6a945d1df8
[eebus ] DEBUG 2024/02/20 22:24:56 mdns: announce
[eebus ] DEBUG 2024/02/20 22:24:56 mdns: using zeroconf
[eebus ] DEBUG 2024/02/20 22:24:56 starting websocket server on :4712
[eebus ] DEBUG 2024/02/20 22:24:56 error during websocket server starting: listen tcp :4712: bind: address already in use
Fronius
-------
Power: 0W
PGE
---
Power: 8711W
Dom
---
Power: 1499W
Klimatyzacja
------------
Power: 24W
Ladowarka
---------
Power: 7130W
[eebus ] DEBUG 2024/02/20 22:24:56 mdns: stop announcement
Feb 20 22:27:35 evcc evcc[3724]: [main ] INFO 2024/02/20 22:27:35 evcc 0.123.9
Feb 20 22:27:35 evcc evcc[3724]: [main ] INFO 2024/02/20 22:27:35 using config file: /etc/evcc.yaml
Feb 20 22:27:35 evcc evcc[3724]: [main ] INFO 2024/02/20 22:27:35 starting ui and api at :7070
Feb 20 22:27:35 evcc evcc[3724]: [db ] INFO 2024/02/20 22:27:35 using sqlite database: /var/lib/evcc/evcc.db
Feb 20 22:27:35 evcc evcc[3724]: [mqtt ] INFO 2024/02/20 22:27:35 connecting evcc-1517020724 at tcp://192.168.105.22:1883
Feb 20 22:27:35 evcc evcc[3724]: [eebus ] INFO 2024/02/20 22:27:35 Local SKI: bfe624a1d5c92cd51fa43ea0414ccd6a945d1df8
Feb 20 22:27:39 evcc evcc[3724]: [lp-1 ] WARN 2024/02/20 22:27:39 phases not configured, assuming 3p
Feb 20 22:27:49 evcc evcc[3724]: [lp-1 ] ERROR 2024/02/20 22:27:49 charge total import: read failed: read tcp 192.168.105.100:42848->192.168.105.4:502: i/o timeout
Feb 20 22:27:49 evcc evcc[3724]: [site ] INFO 2024/02/20 22:27:49 site config:
Feb 20 22:27:49 evcc evcc[3724]: [site ] INFO 2024/02/20 22:27:49 meters: grid ✓ pv ✓ battery ✗
Feb 20 22:27:49 evcc evcc[3724]: [site ] INFO 2024/02/20 22:27:49 grid: power ✓ energy ✓ currents ✓
Feb 20 22:27:49 evcc evcc[3724]: [site ] INFO 2024/02/20 22:27:49 pv 1: power ✓ energy ✗ currents ✗
Feb 20 22:27:49 evcc evcc[3724]: [site ] INFO 2024/02/20 22:27:49 vehicles:
Feb 20 22:27:49 evcc evcc[3724]: [site ] INFO 2024/02/20 22:27:49 vehicle 1: range ✓ finish ✓ status ✓ climate ✓ wakeup ✓
Feb 20 22:27:49 evcc evcc[3724]: [lp-1 ] INFO 2024/02/20 22:27:49 loadpoint 1:
Feb 20 22:27:49 evcc evcc[3724]: [lp-1 ] INFO 2024/02/20 22:27:49 mode: pv
Feb 20 22:27:49 evcc evcc[3724]: [lp-1 ] INFO 2024/02/20 22:27:49 charger: power ✗ energy ✗ currents ✗ phases ✗ wakeup ✗
Feb 20 22:27:49 evcc evcc[3724]: [lp-1 ] INFO 2024/02/20 22:27:49 meters: charge ✓
Feb 20 22:27:49 evcc evcc[3724]: [lp-1 ] INFO 2024/02/20 22:27:49 charge: power ✓ energy ✓ currents ✓
Feb 20 22:27:49 evcc evcc[3724]: [main ] INFO 2024/02/20 22:27:49 new version available: 0.124.4
Feb 20 22:28:20 evcc evcc[3724]: [lp-1 ] ERROR 2024/02/20 22:28:20 charge meter: read failed: read tcp 192.168.105.100:60862->192.168.105.4:502: i/o timeout
Feb 20 22:28:50 evcc evcc[3724]: [site ] ERROR 2024/02/20 22:28:50 grid meter: read failed: read tcp 192.168.105.100:43778->192.168.105.4:502: i/o timeout
I can offer you ssh access to machine running evcc. Please share your public ssh key and preferred user name.
MBMD version 0.13 is working fine with my meters
@bilbolodz my pubkey is ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGi8rUJarKZuWnZNOnhtcXZCrPskbF7HOcig6nkjWlU2
@bilbolodz we'd need trace logs, not debug:
evcc meter --log trace,db:error
for last good and first bad version.
Working:
evcc meter --log trace,db:error
[main ] INFO 2024/02/21 09:05:25 evcc 0.123.8
[main ] INFO 2024/02/21 09:05:25 using config file: /root/evcc.yaml
[mqtt ] INFO 2024/02/21 09:05:25 connecting evcc-1087818029 at tcp://192.168.105.22:1883
[mqtt ] DEBUG 2024/02/21 09:05:25 tcp://192.168.105.22:1883 connected
[eebus ] INFO 2024/02/21 09:05:25 Local SKI: bfe624a1d5c92cd51fa43ea0414ccd6a945d1df8
[eebus ] DEBUG 2024/02/21 09:05:25 mdns: announce
[eebus ] DEBUG 2024/02/21 09:05:25 mdns: using zeroconf
[eebus ] DEBUG 2024/02/21 09:05:25 starting websocket server on :4712
[eebus ] DEBUG 2024/02/21 09:05:25 error during websocket server starting: listen tcp :4712: bind: address already in use
Fronius
-------
[http ] TRACE 2024/02/21 09:05:25 GET http://192.168.105.252/solar_api/v1/GetPowerFlowRealtimeData.fcgi
[http ] TRACE 2024/02/21 09:05:25 {
"Body" : {
"Data" : {
"Inverters" : {
"1" : {
"DT" : 105,
"E_Day" : 490.30001831054688,
"E_Total" : 27541200,
"E_Year" : 224626.109375,
"P" : 427
}
},
"Site" : {
"E_Day" : 490.30001831054688,
"E_Total" : 27541200,
"E_Year" : 224626.109375,
"Meter_Location" : "load",
"Mode" : "vague-meter",
"P_Akku" : null,
"P_Grid" : 236.71679945535072,
"P_Load" : -663.71679945535072,
"P_PV" : 427,
"rel_Autonomy" : 64.33466809193294,
"rel_SelfConsumption" : 100
},
"Version" : "12"
}
},
"Head" : {
"RequestArguments" : {},
"Status" : {
"Code" : 0,
"Reason" : "",
"UserMessage" : ""
},
"Timestamp" : "2024-02-21T09:06:49+01:00"
}
}
Power: 427W
PGE
---
[modbus] TRACE 2024/02/21 09:05:25 modbus: send 00 01 00 00 00 06 01 04 00 34 00 02
[modbus] TRACE 2024/02/21 09:05:26 modbus: recv 00 01 00 00 00 07 01 04 04 43 8a 2b 16
Power: 276W
Dom
---
[modbus] TRACE 2024/02/21 09:05:26 modbus: send 00 02 00 00 00 06 02 04 00 34 00 02
[modbus] TRACE 2024/02/21 09:05:26 modbus: recv 00 02 00 00 00 07 02 04 04 44 24 7e b5
Power: 658W
Klimatyzacja
------------
[modbus] TRACE 2024/02/21 09:05:26 modbus: send 00 03 00 00 00 06 04 04 00 0c 00 02
[modbus] TRACE 2024/02/21 09:05:26 modbus: recv 00 03 00 00 00 07 04 04 04 41 b1 d5 e0
Power: 22W
Ladowarka
---------
[modbus] TRACE 2024/02/21 09:05:26 modbus: send 00 04 00 00 00 06 03 04 00 34 00 02
[modbus] TRACE 2024/02/21 09:05:26 modbus: recv 00 04 00 00 00 07 03 04 04 00 00 00 00
Power: 0W
[eebus ] DEBUG 2024/02/21 09:05:26 mdns: stop announcement
Not working:
evcc meter --log trace,db:error
[main ] INFO 2024/02/21 09:10:11 evcc 0.123.9
[main ] INFO 2024/02/21 09:10:11 using config file: /root/evcc.yaml
[mqtt ] INFO 2024/02/21 09:10:11 connecting evcc-696670209 at tcp://192.168.105.22:1883
[mqtt ] DEBUG 2024/02/21 09:10:11 tcp://192.168.105.22:1883 connected
[eebus ] INFO 2024/02/21 09:10:11 Local SKI: bfe624a1d5c92cd51fa43ea0414ccd6a945d1df8
[eebus ] DEBUG 2024/02/21 09:10:11 mdns: announce
[eebus ] DEBUG 2024/02/21 09:10:11 mdns: using zeroconf
[main ] FATAL 2024/02/21 09:10:11 cannot create meter 'PGE': invalid meter type: modbus
evcc meter --log trace,db:error
[main ] INFO 2024/02/21 09:11:42 evcc 0.124.4
[main ] INFO 2024/02/21 09:11:42 using config file: /root/evcc.yaml
[mqtt ] INFO 2024/02/21 09:11:42 connecting evcc-1575318572 at tcp://192.168.105.22:1883
[mqtt ] DEBUG 2024/02/21 09:11:42 tcp://192.168.105.22:1883 connected
[eebus ] INFO 2024/02/21 09:11:42 Local SKI: bfe624a1d5c92cd51fa43ea0414ccd6a945d1df8
[eebus ] DEBUG 2024/02/21 09:11:42 mdns: announce
[eebus ] DEBUG 2024/02/21 09:11:42 mdns: using zeroconf
[eebus ] DEBUG 2024/02/21 09:11:42 starting websocket server on :4712
[eebus ] DEBUG 2024/02/21 09:11:42 error during websocket server starting: listen tcp :4712: bind: address already in use
[main ] FATAL 2024/02/21 09:11:42 cannot create meter 'PGE': invalid meter type: modbus
PGE config:
meters:
[..]
- name: PGE
type: template
template: eastron
modbus: rs485tcpip
host: 192.168.105.4 # Hostname
port: 502 # Port
#rtu: false # rs485 device connected using ethernet adapter
id: 1
[main ] FATAL 2024/02/21 09:11:42 cannot create meter 'PGE': invalid meter type: modbus
could it be that evvc 0.124.4 continues to use your old config?
BINGO!
using config file: /root/evcc.yaml
But I've modified: /etc/evcc.yaml
After removing /root/evcc.yaml
It's working a little better but still I've minor problems:
evcc meter --log trace,db:error
[main ] INFO 2024/02/21 09:33:15 evcc 0.124.4
[main ] INFO 2024/02/21 09:33:15 using config file: /etc/evcc.yaml
[mqtt ] INFO 2024/02/21 09:33:15 connecting evcc-897135371 at tcp://192.168.105.22:1883
[mqtt ] DEBUG 2024/02/21 09:33:15 tcp://192.168.105.22:1883 connected
[eebus ] INFO 2024/02/21 09:33:15 Local SKI: bfe624a1d5c92cd51fa43ea0414ccd6a945d1df8
Fronius
-------
[http ] TRACE 2024/02/21 09:33:15 GET http://192.168.105.252/solar_api/v1/GetPowerFlowRealtimeData.fcgi
[http ] TRACE 2024/02/21 09:33:15 {
"Body" : {
"Data" : {
"Inverters" : {
"1" : {
"DT" : 105,
"E_Day" : 638.60003662109375,
"E_Total" : 27541300,
"E_Year" : 224774.40625,
"P" : 607
}
},
"Site" : {
"E_Day" : 638.60003662109375,
"E_Total" : 27541300,
"E_Year" : 224774.40625,
"Meter_Location" : "load",
"Mode" : "vague-meter",
"P_Akku" : null,
"P_Grid" : 31.388382508398763,
"P_Load" : -638.38838250839876,
"P_PV" : 607,
"rel_Autonomy" : 95.083183941245082,
"rel_SelfConsumption" : 100
},
"Version" : "12"
}
},
"Head" : {
"RequestArguments" : {},
"Status" : {
"Code" : 0,
"Reason" : "",
"UserMessage" : ""
},
"Timestamp" : "2024-02-21T09:34:39+01:00"
}
}
Power: 607W
PGE
---
[modbus] TRACE 2024/02/21 09:33:15 modbus: send 01 04 00 34 00 02 30 05
[modbus] TRACE 2024/02/21 09:33:25 modbus: send 01 04 00 48 00 02 f1 dd
[modbus] TRACE 2024/02/21 09:33:35 modbus: send 01 04 00 06 00 02 91 ca
Power: read failed: read tcp 192.168.105.100:33172->192.168.105.4:502: i/o timeout
Energy: read failed: read tcp 192.168.105.100:60796->192.168.105.4:502: i/o timeout
Current L1..L3: read failed: read tcp 192.168.105.100:54542->192.168.105.4:502: i/o timeout
Dom
---
[modbus] TRACE 2024/02/21 09:33:45 modbus: send 02 04 00 34 00 02 30 36
[modbus] TRACE 2024/02/21 09:33:55 modbus: send 02 04 00 48 00 02 f1 ee
[modbus] TRACE 2024/02/21 09:34:05 modbus: send 02 04 00 06 00 02 91 f9
Power: read failed: read tcp 192.168.105.100:35738->192.168.105.4:502: i/o timeout
Energy: read failed: read tcp 192.168.105.100:50044->192.168.105.4:502: i/o timeout
Current L1..L3: read failed: read tcp 192.168.105.100:33016->192.168.105.4:502: i/o timeout
Klimatyzacja
------------
[modbus] TRACE 2024/02/21 09:34:15 modbus: send 04 04 00 34 00 02 30 50
[modbus] TRACE 2024/02/21 09:34:25 modbus: send 04 04 00 48 00 02 f1 88
[modbus] TRACE 2024/02/21 09:34:35 modbus: send 04 04 00 06 00 02 91 9f
Power: read failed: read tcp 192.168.105.100:58514->192.168.105.4:502: i/o timeout
Energy: read failed: read tcp 192.168.105.100:47390->192.168.105.4:502: i/o timeout
Current L1..L3: read failed: read tcp 192.168.105.100:43664->192.168.105.4:502: i/o timeout
Ladowarka
---------
[modbus] TRACE 2024/02/21 09:34:45 modbus: send 03 04 00 34 00 02 31 e7
[modbus] TRACE 2024/02/21 09:34:55 modbus: send 03 04 00 48 00 02 f0 3f
[modbus] TRACE 2024/02/21 09:35:05 modbus: send 03 04 00 06 00 02 90 28
Power: read failed: read tcp 192.168.105.100:58450->192.168.105.4:502: i/o timeout
Energy: read failed: read tcp 192.168.105.100:43656->192.168.105.4:502: i/o timeout
Current L1..L3: read failed: read tcp 192.168.105.100:41286->192.168.105.4:502: i/o timeout
you can try to change your old meter-config:
look at #11747
change: type : modbus
to type: mbmd
Sounds like this has been resolved :)
I think it NOT resolved because new version generates errors:
PGE
---
[modbus] TRACE 2024/02/21 09:33:15 modbus: send 01 04 00 34 00 02 30 05
[modbus] TRACE 2024/02/21 09:33:25 modbus: send 01 04 00 48 00 02 f1 dd
[modbus] TRACE 2024/02/21 09:33:35 modbus: send 01 04 00 06 00 02 91 ca
Power: read failed: read tcp 192.168.105.100:33172->192.168.105.4:502: i/o timeout
Energy: read failed: read tcp 192.168.105.100:60796->192.168.105.4:502: i/o timeout
Current L1..L3: read failed: read tcp 192.168.105.100:54542->192.168.105.4:502: i/o timeout
old version is working fine
you can try to change your old meter-config:
look at #11747
change:
type : modbus
totype: mbmd
I don't quite get it. How to change these
- name: PGE
type: template
template: eastron
modbus: rs485tcpip
host: 192.168.105.4 # Hostname
port: 502 # Port
#rtu: false # rs485 device connected using ethernet adapter
id: 1
to "old-meter config"?
Ok, I see:
PGE
---
[modbus] TRACE 2024/02/21 09:05:25 modbus: send 00 01 00 00 00 06 01 04 00 34 00 02
[modbus] TRACE 2024/02/21 09:05:26 modbus: recv 00 01 00 00 00 07 01 04 04 43 8a 2b 16
Power: 276W
vs
PGE
---
[modbus] TRACE 2024/02/21 09:33:15 modbus: send 01 04 00 34 00 02 30 05
[modbus] TRACE 2024/02/21 09:33:25 modbus: send 01 04 00 48 00 02 f1 dd
[modbus] TRACE 2024/02/21 09:33:35 modbus: send 01 04 00 06 00 02 91 ca
Power: read failed: read tcp 192.168.105.100:33172->192.168.105.4:502: i/o timeout
Looks like TCP vs RTU, not sure. Still waiting for remote access ;)
e.g.
old:
- name: PGE
type: modbus
model: SDM # SDM630
uri: 192.168.105.4:502
rtu: false # rs485 device connected using ethernet adapter
id: 1
new:
- name: PGE
type: mbmd
model: SDM # SDM630
uri: 192.168.105.4:502
rtu: false # rs485 device connected using ethernet adapter
id: 1
According to config, he's using templates:
template: eastron
These are already mapped to mbmd.
According to config, he's using templates:
template: eastron
These are already mapped to mbmd.
yes, but in his working old config (v0.123.7) he used the type: modbus
Looks like TCP vs RTU, not sure. Still waiting for remote access ;)
Email sent
HF5111B modbus TCP converter
@bilbolodz I guess you are talking Modbus TCP to the converter? The you'll need
modbus: tcpip
to make that clear for an- otherwise- Modbus RTU device. Pretty sure that this has never worked before ;)
Yep it's working. Thank you very much
well, I don't know if this is completly resolved. I haven't noticed that before but I'm gettings this multiple times a day now. v0.125.0 So, it's not happening all the time but at least 10 to 15 times each day. Otherwise it's working fine. This is my config:
- name: Stromnetz # grid bzw. I/O-Stromnetz (kW)
type: template
template: eastron
usage: grid
modbus: tcpip
id: 1
host: 192.168.1.47 # Hostname
port: 502 # Port
Describe the bug
I'm using some SDM630 meters and connected via HF5111B modbus TCP converter. In version 0.123.7 all was working fine. After upgrade to 0.124.4 I'd to change configuration file (old format not supported any more) and now evcc can't connect to any of my meters with error: "charge meter: read failed: read tcp 192.168.105.100:49550->192.168.105.4:502: i/o timeout" Old working config file was:
New (not working) config file is:
How to fix it?
Steps to reproduce
Install evcc version 0.124.4
Configuration details
Log details
What type of operating system are you running?
Linux
Version
evcc version 0.124.4