ksheumaker / homeassistant-apsystems_ecur

Home Assistant custom component for local querying of APSystems ECU-R Solar System
Apache License 2.0
166 stars 42 forks source link

netcat ok, but still no connection to ECU #198

Closed backupandforkacc closed 7 months ago

backupandforkacc commented 11 months ago

grafik

/config# nc -v 192.168.103.68 8899
192.168.103.68 (192.168.103.68:8899) open
APS1100160001END
APS110095000121630009028301Y������� 

grafik

I had to make a screenshot as I cannot copy the last line completely.

I measure the power production by an energy plug and it shows > 100 W.

sbemmann commented 8 months ago

I have the same problem here

HAEdwin commented 8 months ago

If it is a new installation (ECU is new), the life-time energy is still zero. Then you have two options: Wait until life-time energy is no longer zero or edit APSystemsSocket.py and place a # in front of lines 116 to 119. In previous versions the issue was here: https://github.com/ksheumaker/homeassistant-apsystems_ecur/issues/113#issuecomment-1263436330 Sorry for the inconvenience.

HAEdwin commented 8 months ago

@backupandforkacc and @sbemmann Please provide feedback on this issue, can it be closed?

giagrand74 commented 8 months ago

Hi, same problem on my setup, Was all ok than ECU disconnected with same error message. May I ask how to perform the change suggested on #113? Can I do it via the web interface or do I login via ssh etc? Thanks in advance for your support.

HAEdwin commented 8 months ago

You can use "File Editor" it's an add-on for Home Assistant. Browse to APSystemsSocket.py and comment out the lines with a # Then save the file and restart HA.

giagrand74 commented 8 months ago

I did as per below but same problem:

def query_ecu(self): self.open_socket() cmd = self.ecu_query self.ecu_raw_data = self.send_read_from_socket(cmd) self.close_socket() try: self.process_ecu_data()

conflicting interests of which 113 is just a temorary issue and less common

        # https://github.com/ksheumaker/homeassistant-apsystems_ecur/issues/126
        # https://github.com/ksheumaker/homeassistant-apsystems_ecur/issues/113
        # if self.lifetime_energy == 0:
        #    error = f"ECU returned 0 for lifetime energy, this is either a glitch from the ECU or a brand new installed ECU. Raw Data={self.ecu_raw_data}"
        #    self.add_error(error)
        #    raise APSystemsInvalidData(error)
    except Exception as err:
        raise APSystemsInvalidData(err)

    # Some ECUs likes the socket to be closed and re-opened between commands
    self.open_socket()
giagrand74 commented 8 months ago

image

giagrand74 commented 8 months ago

Did i make something wrong?

giagrand74 commented 8 months ago

ECU version ECU-B-EU Article No. 211018

Home Assistant 2023.10.5 Supervisor 2023.10.1 Operating System 11.1 Frontend 20231005.0 - latest

APSystems ECU-R v1.2.30

Device seems working correctly on apsystem website: image

Via ssh it replies to ping but no result from the nc query.... :-/ neither a error message.

image

giagrand74 commented 8 months ago

It's strange, i removed the wifi antenna from the ECU, still no correct reply from ssh but now it works... image image I tested changing the config from 300 to 600 sec and change is configured without any problem.

image

giagrand74 commented 8 months ago

For information, now I got the reply image

HAEdwin commented 8 months ago

You removed the WiFi antenna and all is working now? What do you mean with "i removed the WiFi antenna from the ECU"?

giagrand74 commented 8 months ago

image I unscrewed the antenna as per image, I know sound crazy...now I'm running just with the zigbee antenna connected on the box, Maybe I had a faulty antenna or a faulty SMA connector. I'll test putting back the antenna and I let you know.

HAEdwin commented 8 months ago

Indeed, I recall another case where removing the antenna had an effect on the operation of the ECU. I really can't figure out exactly how this works, is it interference from another device nearby? I have no idea, but it's nice that it seems to work now.

HAEdwin commented 7 months ago

I'll close this issue, feel free to create a new issue if you have any questions