grzegorz914 / homebridge-enphase-envoy

Homebridge plugin for Photovoltaic Energy System manufactured by Enphase. Supported Envoy-IQ, Envoy-S and all peripheral devices.
MIT License
52 stars 9 forks source link

Firmware 7 #65

Closed BenouGui closed 1 year ago

BenouGui commented 1 year ago

I have a problem witch firmware 7 [11/12/2022, 19:31:34] [homebridge-enphase-envoy] Device: 192.168.1.6 Envoy-S, inventory error: AxiosError: Request failed with status code 401, reconnect in 15s.

grzegorz914 commented 1 year ago

Please generate new Token here https://enlighten.enphaseenergy.com/entrez-auth-token?serial_num=12345 and ad it to the plugin Config and let me know. Replace 12345 with your envoy serial number

BenouGui commented 1 year ago

I generated a token 3 times and updated the plugin configuration and rebooted. Always the same mistake

grzegorz914 commented 1 year ago

Are you sure you have paste only the data after Token: without apostrophe

grzegorz914 commented 1 year ago

Here https://github.com/grzegorz914/homebridge-enphase-envoy/issues/63#issuecomment-1345527583 by test was same problem but was fixed after generate new token.

grzegorz914 commented 1 year ago

can you try 6.0.1-beta.0 and let me know

grzegorz914 commented 1 year ago

Strange, can you for test power ON/OFF your Envoy. Looks like it won't accept connection to inventory data all other are accepted correct. This was tested yesterday with @NoSnow3 and inventory data was also responding correct. Can someone confirm this behavior too?

BenouGui commented 1 year ago

The on/off of the gateway did not change anything, on the internet I see a lot of people using session cookies. When I try to curl curl -f -k -H 'Authorization: Bearer TOKENTOKENTOEKN' -X GET https://192.168.1.6/api/v1/production/inverters curl: (22) The requested URL returned error: 401 Unauthorized But curl -f -k -H 'Authorization: Bearer TOKENTOKENTOEKN' -X GET https://192.168.1.6/api/v1/production/ -- > { "wattHoursToday": 0, "wattHoursSevenDays": 21534, "wattHoursLifetime": 21529, "wattsNow": 8 } But in the web Gui after login witch token.

image
grzegorz914 commented 1 year ago

can you try with CURL this: curl -f -k -H 'Authorization: Bearer TOKENTOKENTOEKN' -X GET https://inventory.json

and let me know the output

grzegorz914 commented 1 year ago

beta.2 enabled cookies, try again please

BenouGui commented 1 year ago

pi@homebridge:~ $ curl -f -k -H 'Authorization: Bearer TOKENTOKEN' -X GET https://192.168.1.6/inventory.json curl: (22) The requested URL returned error: 401 Unauthorized.

grzegorz914 commented 1 year ago

try this in browser http://envoy.local/inventory.json

BenouGui commented 1 year ago

After login witch token in the web Gui

image

For the beta 2 the same error

BenouGui commented 1 year ago

look here https://github.com/edasque/enphaseLocalToInfluxDB#authorization-flow

grzegorz914 commented 1 year ago

looks like some bug in envoy firmware, I pushed beta.3 to test, here skipped the inventory data, try it and post the log please

grzegorz914 commented 1 year ago

ups try beta.4

grzegorz914 commented 1 year ago

arę you try beta.4

BenouGui commented 1 year ago

yes at the bottom of the log it's beta 4

grzegorz914 commented 1 year ago

OK, now try beta.5

grzegorz914 commented 1 year ago

beta.6 ready to test

grzegorz914 commented 1 year ago

ok, try beta.8 and get me the log, I have added some debug to the response

grzegorz914 commented 1 year ago

beta.9 ready

grzegorz914 commented 1 year ago

try beta.10

grzegorz914 commented 1 year ago

beta.11 ready

grzegorz914 commented 1 year ago

try beta.12

grzegorz914 commented 1 year ago

beta.13

grzegorz914 commented 1 year ago

beta.21

grzegorz914 commented 1 year ago

try 22

grzegorz914 commented 1 year ago

try 23

grzegorz914 commented 1 year ago

24

grzegorz914 commented 1 year ago

25

grzegorz914 commented 1 year ago

26

grzegorz914 commented 1 year ago

it working 28

grzegorz914 commented 1 year ago

try 29 too, need to pass cookies after check jwt and set new instance

grzegorz914 commented 1 year ago

nice, thanks for test

NoSnow3 commented 1 year ago

Sorry been AFK.

We all good now?

grzegorz914 commented 1 year ago

im pushed lates beta 30, can you both check and post the logs

NoSnow3 commented 1 year ago

Homebridge 6.0.1 Beta 30.txt

As Requested

grzegorz914 commented 1 year ago

please again 31

NoSnow3 commented 1 year ago

homebridge 6.0.1 Beta 31.txt

"Envoy-S, power mode error: AxiosError: Request failed with status code 401, reconnect in 15s."

grzegorz914 commented 1 year ago

again 32

NoSnow3 commented 1 year ago

homebridge 6.0.1 Beta 32.txt

Nothing spotted

grzegorz914 commented 1 year ago

OK ready for release

Thanks

grzegorz914 commented 1 year ago

v6.0.1 released