Closed RobBuijs closed 1 year ago
Looks like Envoy is not available on this iP address. Can you login to Envoy using web browser? For detailed log please enable debug mode in plugin Config advanced section and restart HB. After this get the log please.
The envoy is there initially, but disappears after a couple of minutes, just reporting the 502 error. I’ll collect logs
still the issue exist?
I just had that the same log messages as well. Worked fine for weeks before that though
[1/15/2023, 1:52:17 PM] [enphaseEnvoy] Device: 192.168.1.70 Envoy, validate jwt token error: Error: connect ETIMEDOUT 192.168.1.70:443, reconnect in 15s.
[1/15/2023, 1:52:17 PM] [enphaseEnvoy] Device: 192.168.1.70 Envoy, validate jwt token error: Error: connect ETIMEDOUT 192.168.1.70:443, reconnect in 15s.
[1/15/2023, 1:52:17 PM] [enphaseEnvoy] Device: 192.168.1.70 Envoy, validate jwt token error: Error: read ECONNRESET, reconnect in 15s.
[1/15/2023, 1:52:17 PM] [enphaseEnvoy] Device: 192.168.1.70 Envoy, validate jwt token error: Error: read ECONNRESET, reconnect in 15s.
[1/15/2023, 1:52:17 PM] [enphaseEnvoy] Device: 192.168.1.70 Envoy, validate jwt token error: Error: read ECONNRESET, reconnect in 15s.
[1/15/2023, 1:52:17 PM] [enphaseEnvoy] Device: 192.168.1.70 Envoy, validate jwt token error: Error: read ECONNRESET, reconnect in 15s.
[1/15/2023, 1:52:17 PM] [enphaseEnvoy] Device: 192.168.1.70 Envoy, validate jwt token error: Error: read ECONNRESET, reconnect in 15s.
[1/15/2023, 1:52:17 PM] [enphaseEnvoy] Device: 192.168.1.70 Envoy, validate jwt token error: Error: read ECONNRESET, reconnect in 15s.
[1/15/2023, 1:52:17 PM] [enphaseEnvoy] Device: 192.168.1.70 Envoy, validate jwt token error: Error: read ECONNRESET, reconnect in 15s.
Restart solved it for me, so it didn't seem to be a problem with the IP/endpoint.
I didn't debug it further, but I think an actionable item here could be a backoff so it doesn't do a tight loop and prints millions of log lines :)
p.s. this was not on v6.4.0 yet. I just noticed the logs before upgrading.
It’s not a plugin problem, you need investigate on your environment, your device just lose connection from network.
Oddly for me it did instantly recover the second I restarted homebridge. I wonder if the code path for trying to reconnect has some unexpected outcomes.
The log you provided took only the envoy is not available on network. Just is not available for homebridge.
What a envoy model you have and installed firmware?
Software Version D7.3.120 (ac5b3c) Part Number: 800-00695-r01
I wonder if there's just a memory leak somewhere (maybe even based on system setup) and the frequent requests are overflowing things. I think "refreshInterval " is a way to reduce the polling frequency. Let me try that.
edit: seems like refreshInterval is just mentioned in the readme, but doesn't appear in code anywhere and so I'm stuck at 5 second updates from the look of it
The plugin is used by many users and no one have such a problem. Reduce to 1min the polling time make the plugin useable for automations.
So the 'refreshInterval' over here: https://github.com/grzegorz914/homebridge-enphase-envoy/blob/main/README.md?plain=1#L90 doesn't do anything, right?
Ah its old properties not used long time, just removed from readme. For best practice always use GUI Config.
On which device you have installed Homebridge?
On which device you have installed Homebridge?
Running in docker on an Unraid based NAS (tons of CPU/RAM)
Is your Envoy connected with LAN or WIFi
Wifi
Check how strange is the connection, may be is weak. For test You can stopped all other installed plugins and run only this one.
I can see it in my Unifi dashboard as 'excellent'. Ping is < 7 ms and no dropped packages after running for 10+ minutes. I did NOT see a disconnect from wifi in days in the unifi event view. Before I switched the breaker off this morning to restart the envoy, it was still associated to the wifi network.
I think what happens here is probably envoy running out of memory because of a memory leak and the frequent polling. Maybe it runs out before it has time to restart the http worker/process. Assuming it's some little embedded linux device, it will then OOM kill the web-process and/or take the whole system down. That also explains the multiple issues here (5xx responses, ECONNRESET, ETIMEDOUT)
This morning I had to flip the breaker on the envoy to get it to restart. That being said, I ran this plugin fine for a month or so. I assume it's some solar configuration depended state or it was a firmware update.
Could you point me to the line that defines the hardcoded refresh frequency? I can try to manually edit it to once a minute and see if that solves my stability problems.
Here is the meters refresh data: https://github.com/grzegorz914/homebridge-enphase-envoy/blob/5851cc21155eec7489ab373425acd85855c65c9c/index.js#L2568 but this poll every 2 seconds other poll for live data is 3 seconds but this can be completely disable in plugin settings. I don’t think increase pool time solve your problem. I use this 2 years long and no any Probleme like you have, others users with big installations with encharges and enpower also not reported any Probleme with envoy freeze.
I don't think it depends on the size of the install or anything like that. Probably just some dumb thing where the enphase folks lose a few bytes every time they read something on certain installations/configurations. Usually it wouldn't matter because they probably restart the process every 12 hours, but if you ask twice a second, it adds up :)
In general, I'd appreciate a way to make this user configurable just because I don't want home assistant to keep all that data around. Once a minute is plenty for me, I just want to get a feel for how much it's producing / consuming
in 6.5.0 added possibility to set refresh time for live data, meters data and production data, available in advanced section, may be this help you
i started to get this error "Device: 192.168.0.204 Envoy-S, Update ensemble status data error: AxiosError: Request failed with status code 401, reconnect in 15s." since the third update this past month. was working fine before the update, the ip address allows me to connect to envoy still but just doesnt work for homebridge
Try to recreate token, if not help please disable Ensemble Status in plugin config advanced section.
thanks for the the quick response! i have tried multiple times with creating a new token and still got this issue. i just tried again creating a new token as well as disabling the ensmble status and still getting the same error.
If you disabled ensemble status is not possible you get same error, try again please.
this is copy paste of the json file
" "powerConsumptionNetMaxAutoReset": 0, "powerConsumptionNetMaxDetected": 10000, "energyConsumptionNetLifetimeOffset": 0, "supportEnsembleStatus": false, "supportLiveData": true, "liveDataRefreshTime": 1000, "metersDataRefreshTime": 2500,"
copy paste of homebridge logs [03/02/2023, 00:53:12] [Homebridge UI] Terminal session ended. [03/02/2023, 00:53:26] [homebridge-enphase-envoy] Device: 192.168.0.204 Envoy-S, Update power mode error: AxiosError: Request failed with status code 401, reconnect in 15s. [03/02/2023, 00:53:55] [homebridge-enphase-envoy] Device: 192.168.0.204 Envoy-S, Update power mode error: AxiosError: Request failed with status code 401, reconnect in 15s. [03/02/2023, 00:54:18] [homebridge-enphase-envoy] Device: 192.168.0.204 Envoy-S, Update power mode error: AxiosError: Request failed with status code 401, reconnect in 15s. [03/02/2023, 00:54:18] [Homebridge UI] Starting terminal session [03/02/2023, 00:54:40] [homebridge-enphase-envoy] Device: 192.168.0.204 Envoy-S, Update power mode error: AxiosError: Request failed with status code 401, reconnect in 15s. [03/02/2023, 00:55:05] [homebridge-enphase-envoy] Device: 192.168.0.204 Envoy-S, Updat
here is about power mode data, please disable support to check/control power mode
hi made the changes, "devices": [ { "name": "Envoy-S", "host": "removed", "envoyFirmware7xx": true, "envoyFirmware7xxToken": removed "disableLogInfo": false, "disableLogDeviceInfo": false, "enableDebugMode": false, "powerProductionMax": false, "powerProductionMaxAutoReset": 0, "powerProductionMaxDetected": 5400, "energyProductionLifetimeOffset": 0, "powerConsumptionTotalMax": false, "powerConsumptionTotalMaxAutoReset": 0, "powerConsumptionTotalMaxDetected": 10000, "energyConsumptionTotalLifetimeOffset": 0, "powerConsumptionNetMax": false, "powerConsumptionNetMaxAutoReset": 0, "powerConsumptionNetMaxDetected": 10000, "energyConsumptionNetLifetimeOffset": 0, "supportProductionPowerMode": false, "supportPlcLevel": true, "supportEnsembleStatus": false, "supportLiveData": true, "liveDataRefreshTime": 1000, "metersDataRefreshTime": 2500, "productionDataRefreshTime": 5000, "enableMqtt": false, "mqttAuth": false, "mqttDebug": false } ], "_bridge": { "username": "0E:AD:C4:16:DC:D0", "port": 40860 }, "platform": "enphaseEnvoy" } still same error
[03/02/2023, 09:26:01] [homebridge-enphase-envoy] Device: 192.168.0.204 Envoy-S, Validate jwt token data error: Error: connect EHOSTUNREACH 192.168.0.204:443, reconnect in 15s. [03/02/2023, 09:26:19] [homebridge-enphase-envoy] Device: 192.168.0.204 Envoy-S, Validate jwt token data error: Error: connect EHOSTUNREACH 192.168.0.204:443, reconnect in 15s. [03/02/2023, 09:26:37] [homebridge-enphase-envoy] Device: 192.168.0.204 Envoy-S, Validate jwt token data error: Error: connect EHOSTUNREACH 192.168.0.204:443, reconnect in 15s. [03/02/2023, 09:26:44] [Homebridge UI] Terminal session ended. [03/02/2023, 09:26:55] [homebridge-enphase-envoy] Device: 192.168.0.204 Envoy-S, Validate jwt token data error: Error: connect EHOSTUNREACH 192.168.0.204:443, reconnect in 15s. [03/02/2023, 09:27:14] [homebridge-enphase-envoy] Device: 192.168.0.204 Envoy-S, Validate jwt token data error: Error: connect EHOSTUNREACH 192.168.0.204:443, reconnect in 15s. [03/02/2023, 09:27:32] [homebridge-enphase-envoy] Device: 192.168.
It’s not same error, now your envoy is not available in Netz. Check it please again or restart envoy .
have restarted
[03/02/2023, 09:45:45] [homebridge-enphase-envoy] Restarting child bridge... [03/02/2023, 09:45:45] Got SIGTERM, shutting down child bridge process... [03/02/2023, 09:45:50] [homebridge-enphase-envoy] Child bridge process ended [03/02/2023, 09:45:50] [homebridge-enphase-envoy] Process Ended. Code: 143, Signal: null [03/02/2023, 09:45:57] [homebridge-enphase-envoy] Restarting Process... [03/02/2023, 09:45:58] [homebridge-enphase-envoy] Launched child bridge with PID 233021 [03/02/2023, 09:45:58] Registering platform 'homebridge-enphase-envoy.enphaseEnvoy' [03/02/2023, 09:45:58] [homebridge-enphase-envoy] Loaded homebridge-enphase-envoy v6.5.4 child bridge successfully [03/02/2023, 09:45:58] Loaded 0 cached accessories from cachedAccessories.0EADC416DCD0. [03/02/2023, 09:45:58] Homebridge v1.6.0 (HAP v0.11.0) (homebridge-enphase-envoy) is running on port 40860. [03/02/2023, 09:46:01] [homebridge-enphase-envoy] Device: 192.168.0.204 Envoy-S, Validate jwt token data error: Error: connect EHOSTUNREACH 192.168.0.204:443, reconnect in 15s.
Envoy restart not the plugin, or ping your envoy
getting this now
[03/02/2023, 09:48:56] [homebridge-enphase-envoy] Device: 192.168.0.204 Envoy-S, Update home data error: TypeError: Cannot convert undefined or null to object, reconnect in 15s.
also this
[03/02/2023, 09:50:02] [homebridge-enphase-envoy] Device: 192.168.0.204 Envoy-S, Update plc level data error: AxiosError: Request failed with status code 401, reconnect in 15s.
Can you enable debug mode in plugin config and post the complete log?
Disable plc level check
here you go [03/02/2023, 09:58:06] [homebridge-enphase-envoy] Device: 192.168.0.204 Envoy-S, debug live data: { "connection": { "mqtt_state": "connected", "prov_state": "configured", "auth_state": "ok", "sc_stream": "disabled", "sc_debug": "disabled" }, "meters": { "last_update": 1675275639, "soc": 100, "main_relay_state": 1, "gen_relay_state": 5, "backup_bat_mode": 0, "backup_soc": 100, "is_split_phase": 1, "phase_count": 0, "enc_agg_soc": 100, "enc_agg_energy": 10080, "acb_agg_soc": 0, "acb_agg_energy": 0, "pv": { "agg_p_mw": 586234, "agg_s_mva": 827987, "agg_p_ph_a_mw": 586234, "agg_p_ph_b_mw": 0, "agg_p_ph_c_mw": 0, "agg_s_ph_a_mva": 827987, "agg_s_ph_b_mva": 0, "agg_s_ph_c_mva": 0 }, "storage": { "agg_p_mw": -4000, "agg_s_mva": -4000, "agg_p_ph_a_mw": -4000, "agg_p_ph_b_mw": 0, "agg_p_ph_c_mw": 0, "agg_s_ph_a_mva": -4000, "agg_s_ph_b_mva": 0, "agg_s_ph_c_mva": 0 }, "grid": { "agg_p_mw": 959438, "agg_s_mva": 1572615, "agg_p_ph_a_mw": 959438, "agg_p_ph_b_mw": 0, "agg_p_ph_c_mw": 0, "agg_s_ph_a_mva": 1572615, "agg_s_ph_b_mva": 0, "agg_s_ph_c_mva": 0 }, "load": { "agg_p_mw": 1541672, "agg_s_mva": 2396602, "agg_p_ph_a_mw": 1541672, "agg_p_ph_b_mw": 0, "agg_p_ph_c_mw": 0, "agg_s_ph_a_mva": 2396602, "agg_s_ph_b_mva": 0, "agg_s_ph_c_mva": 0 }, "generator": { "agg_p_mw": 0, "agg_s_mva": 0, "agg_p_ph_a_mw": 0, "agg_p_ph_b_mw": 0, "agg_p_ph_c_mw": 0, "agg_s_ph_a_mva": 0, "agg_s_ph_b_mva": 0, "agg_s_ph_c_mva": 0 } }, "tasks": { "task_id": 1353142665, "timestamp": 1675439734 }, "counters": { "main_CfgLoad": 2, "main_CfgChanged": 2, "main_CfgNotFound": 29, "main_taskUpdate": 42, "main_sigHUP": 13, "MqttClient_publish": 6401, "MqttClient_respond": 108, "MqttClient_msgarrvd": 54, "MqttClient_reconnect": 13, "MqttClient_create": 47, "MqttClient_setCallbacks": 47, "MqttClient_connect": 47, "MqttClient_connect_err": 7, "MqttClient_connect_Err": 7, "MqttClient_subscribe": 40, "SSL_Keys_Create": 47, "sc_hdlDataPub": 6363, "sc_SendStreamCtrl": 19, "sc_SendDemandRspCtrl": 1, "rest_Status": 8569 }
All is correct here in this log
looks like disabling plc resolved the errors, thanks for all your help!
hi again
getting a new error today, no changes have been made
[04/02/2023, 09:45:02] [homebridge-enphase-envoy] Device: 192.168.0.204 Envoy-S, Update home data error: TypeError: Cannot convert undefined or null to object, reconnect in 15s.
Debug log pleas
],
"version": [
"07.03.120"
],
"build": [
"ac5b3c"
]
},
{
"$": {
"name": "devimg"
},
"pn": [
"500-00004-r01"
],
"version": [
"01.02.413"
],
"build": [
"9c64cd"
]
},
{
"$": {
"name": "geo"
},
"pn": [
"500-00008-r01"
],
"version": [
"02.01.24"
],
"build": [
"a74d96"
]
},
{
"$": {
"name": "backbone"
},
"pn": [
"500-00010-r01"
],
"version": [
"07.00.20"
],
"build": [
"176d57"
]
},
{
"$": {
"name": "meter"
},
"pn": [
"500-00013-r01"
],
"version": [
"03.02.08"
],
"build": [
"f9ead3"
]
},
{
"$": {
"name": "agf"
},
"pn": [
"500-00012-r01"
],
"version": [
"02.02.00"
],
"build": [
"887e04"
]
},
{
"$": {
"name": "essimg"
},
"pn": [
"500-00020-r01"
],
"version": [
"22.10.09"
],
"build": [
"983d9b"
]
},
{
"$": {
"name": "security"
},
"pn": [
"500-00016-r01"
],
"version": [
"02.00.00"
],
"build": [
"54a6dc"
]
},
{
"$": {
"name": "pkgsec"
},
"pn": [
"500-00021-r01"
],
"version": [
"01.00.00"
],
"build": [
"19ae14"
]
}
],
"build_info": [
{
"build_id": [
"ec2-user-envoy_uber-pkg_master:pkg-Oct-13-22-17:54:08"
],
"build_time_gmt": [
"1665683795"
],
"release_ver": [
"02.00.3244"
],
"release_stage": [
"700-GA"
]
}
]
} }
[04/02/2023, 09:58:50] [homebridge-enphase-envoy] Device: 192.168.0.204 Envoy-S, debug home: " <!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\">\n <html lang=\"en-US\">\n \n
\ntranslation missing: en-US.envoy.global.page_not_found_msg2\n translation missing: en-US.envoy.global.page_not_found_msg3
\n
Hi,
My enphase has problems when I'm using this plugin. After restarting the enphase, within a couple of minutes of running the plugin it crashes with these errors.
I feel it's querying the endpoint to fast untill it just crashes. Not 100% sure about this though, as I haven't been able to change timeouts.
You probably need more information about this issue, please let me know what's needed!