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

ECU-R not able to add integrationi #105

Closed clardima closed 1 year ago

clardima commented 1 year ago

Hey Guys,

Finally had some time to play with this integration. I setup my ECU-R over my WIFI and the IP address is available. Now I want to add the integration but I get an error message after filling in the IP address [%key:common::config_flow::error::unknown%]

Must I setup something else first?

Thanks.

regards Maarten

HAEdwin commented 1 year ago

Did you follow the instructions https://github.com/ksheumaker/homeassistant-apsystems_ecur#setup ? You might have to restart HA also. No leading zero's in IP-address and don't use the temporary AP of the ECU which is being used during setup.

clardima commented 1 year ago

I followed the instructions. Yes, I did restart HA, I also restarted ECU-R, I see data coming in on the webportal of APSystems, so everything is connected. IP-address is filled in correctly.

HAEdwin commented 1 year ago

What version of the integration are you currently running? Does the home-assistant.log provide more info? The ultimate test to see if you've got the IP-address right is to use Packet Sender. Enter the data marked red and see if you get a response after selecting [Send] image If the IP-address is correct then you'll have to check if HA can reach the ECU or check the network segment.

clardima commented 1 year ago

Packet Sender gives an error. So I changed the IP adres from DHCP to fixed IP, just to try. Now it still did not work.

I installed Advanced Portscanner and after a while port 6668 seems to be open, connecting with Packet Sebder is possible, but I am not sure if this is the correct way. I do not see port 8899 open.

clardima commented 1 year ago

Question: Is APS1100160001END a default value, or should I change it, depending on my own ECU-R?

HAEdwin commented 1 year ago

Leave it as it is, it's the first command to retreive ECU info (like firmware version etc.) do not use random commands. You'll have to use 8899 others are just temporary open to push data to EMA and cannot be used. When you got Packet Sender working, the integration will also work. Make absolutely sure you've got the correct node (the ECU) and bind the IP to the MAC address of the ECU (the wireless). If you have an ECU-ID starting with 2162xxxxx and a SunSpec logo on the back, it's an ECU-R with pro firmware and you might as well connect it by ethernet cable. Btw port 6668 is by my knowledge not related to the APSystems ECU node, could be some other node.

clardima commented 1 year ago

But I can connect to Packet Sender, but not on the correct port, so connectivity is okay to the ECU-R. Only hte port is somehow blocked. Is it possible that this port is disabled on the ECU-R?

HAEdwin commented 1 year ago

If connectivity from Packet sender with the ECU-R is ok, then can you post the traffic log here (the hex data part)? It should contain firmware version. Respose should be something like: image

HAEdwin commented 1 year ago

Make absolutely shure you have the ip-address from the ECU. You are not the first to find out that the wrong IP address was used because the ESP interface in the router resembled it. In your router, find the ECU-R which can be seen as ESP-xxxxxx. MAC starts with D8:BF:C0: (Espressif Inc.). But beware that there can excist more nodes with this interface.

clardima commented 1 year ago

I am definitely sure I have the correct IP address. After setting up the fixed IP address in my Fritz.box and restarting the ECU-R, the fixed IP address became active on my WiFi network. But.... my MAC start with A4:E5;7C, so it's different from yours. But... the manufacturer states: Espressif Inc., so that should be right.

Are there different ECU-R versions available?

If I look in the EMA Manager app on my mobile, I see version 1.2.22, ID starts with 2160*.

HAEdwin commented 1 year ago

We both have the same ECU-R with the same firmware. The ECU is still only WiFi connected to your LAN right? For this specific ECU (and ECU-B) the integration only works on Wifi connected ECU. If I use Packet Sender as specified above, (my ECU is at 172.16.0.4) I get immediate responses after pressing the Send button. That's the top line in the log: from ECU (8899) to PC (21607). This tool is the ultimate test to see if the integration would work for you (assuming only one network segment exists).

If you are absolutely sure you've got the correct ip-address and the firmware is the same with both of us, the only thing I can think of is that some firewall software on the PC running Packet Sender or router blocks the port and we are using a flaw in the older type of ESP interfaces that is revised in a later version you own. Maybe silly because it's not using 8899 but do a ping [ECU ip-address] -t on the PC to the WiFi connected ECU. You get a response right? Now pull the power plug from the ECU, responses are timed out right?

There is also a newer ECU-R with SunSpec logo on the back. Unit ID starts with 2162xxxxx and is supposed to be modbus compliant. It holds ECU-R-Pro firmware although there officially is no ECU-R pro model released. The integration works on this model when it is attached to the LAN by ethernet cable. Unfortunately this model stops responding after a while (days). Hopefully there will be a solution in issuing a curl command URL (because opposed to our ECU-R model, the ECU-R-pro has a webinterface).

HAEdwin commented 1 year ago

Check: You have choosen your WiFi SSID in the ECU and provided the WiFi password from that SSID. I've also had someone that was connecting to the temporary hotspot from the ECU. But in your case you wrote that data is being received on the EMA site so this should be allright then.

HAEdwin commented 1 year ago

@clardima Did you solve your connection issue? Because we use the same firmware/hardware the only issue here might be your network.