scooter1556 / hass-addons

A collection of Home Assistant OS addons
Apache License 2.0
1 stars 2 forks source link

OSError: [Errno 99] Address not available #2

Closed snigehere closed 2 years ago

snigehere commented 2 years ago

I am new to home assistant so this may be my issue rather than the add on. When I start the addon I see the following in the log ... I am unsure why I would get an OS error on the address

[s6-init] making user provided files available at /var/run/s6/etc...exited 0. [s6-init] ensuring user provided files have correct perms...exited 0. [fix-attrs.d] applying ownership & permissions fixes... [fix-attrs.d] done. [cont-init.d] executing container initialization scripts... [cont-init.d] done. [services.d] starting services [services.d] done. MQTT found in this Home Assistant instance. Starting ginlong-wifi-mqtt.py... Configuring Home Assistant... Traceback (most recent call last): File "/ginlong-wifi-mqtt.py", line 108, in <module> sock.bind((listen_address, listen_port)) OSError: [Errno 99] Address not available [cmd] /run.sh exited 1 [cont-finish.d] executing container finish scripts... [cont-finish.d] done. [s6-finish] waiting for services. [s6-finish] sending all processes the TERM signal.

I have the Listen address set to 192.168.0.249 and the port 9999 .. I have set up server b in the data stick and added the ha server ip - both are fixed IP addresses (the data stick configured as fixed, the ha server as reserved). I am able to logon to the data logger with the browser.

I am running HA in a virtual box under windows

scooter1556 commented 2 years ago

Hi @snigehere ,

It sounds like you have setup your data stick correctly so it will broadcast data over UDP to your HA instance however try setting the listen address in the plugin to 0.0.0.0

snigehere commented 2 years ago

Hi - thanks for the update .. I changed the listener to 0.0.0.0 and no longer get the OSError message (still no data but no error now).

scooter1556 commented 2 years ago

The stick should send data to the registered servers every 6 minutes by default. Make sure it has been rebooted since adding your HA IP and port!

scooter1556 commented 2 years ago

A couple more things to check:

Failing that it might be that you are using a version of the stick or firmware not supported. I only have my setup for testing but I know there are many variants which all send a different identifier code and data payload.

For reference the firmware version of my stick is: H4.01.44Y4.0.01W1.0.19(2014-11-101)

snigehere commented 2 years ago

Thanks - I will set some time aside to investigate some more ... I don't have an advanced option nor a test button The stick is a wifi version (I know there are 3 types of stick - lan, wifi and gsm) and the firmware version is shown as MW_08_0501_1.58. I found another post on the web that gave a hidden config pages (http:///config_hide.html where I can find "working mode" and it is set to "data collection" solis stick 1 solis stick 2 solis stick 3

scooter1556 commented 2 years ago

It looks like you are using a new Solis 4G inverter judging by the FW. Things started to get tricky with these because the data payload changed with every firmware release so each one needed reverse engineering.

There is a script here which claims to be written for your particular firmware so might be worth trying: https://github.com/codeworkx/ginlong-mqtt

If this works I can try to integrate additional support into the plugin but it will be trial and error given I have nothing here to test unless I can get a binary dump of the TCP messages being sent by the inverter and data logger (the newer data loggers send various types of message I believe, not just inverter updates).

snigehere commented 2 years ago

Thanks for the link - I will have a look and see if I can get it working. So far I have just used the GUI part of home assistant and not gone any deeper so I have a steep learning curve ahead - my last coding role was 20 years ago and with lotus script! I maybe some time before I get back.

scooter1556 commented 2 years ago

@snigehere , no problem, have fun! :+1:

snigehere commented 2 years ago

So just to update ... I found another post that suggested looking at /status.html .. looking at the page source I can see all the data I need to get out .... Leaving off the style definitions at the top of the page this is the content ... I don't know if its of interest or not .... so far I have not seen any data coming showing up in the mqtt broker.
One person commented that the server b does not work on the latest microcode so suggested altering the alternate one for the ginlong cloud in the config_hide.html page but not sure if that will work or will only kick in if the primary cloud fails ... some more testing once the sun comes up again.

I guess one option would be to keep refreshing the status page and scaping the content from the page. I would need to check if I can send the login in the page request.

``

scooter1556 commented 2 years ago

@snigehere thanks for the update.

Scraping the status.html page is definitely one way of getting the data although plagued by the same inconsistencies between firmware as the TCP data with the added complication that the wifi stick isn't publishing the data to a TCP server lying in wait, instead we have a piece of code polling the web page including during night time hours when it won't be available leading to lots of timeouts. It will always be preferable to process the TCP packet sent from the wifi stick but that does involve some reverse engineering of the data packet to understand it.