Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wallbox not completing connection #1414

Closed
jdanders opened this issue Nov 29, 2024 · 7 comments
Closed

Wallbox not completing connection #1414

jdanders opened this issue Nov 29, 2024 · 7 comments

Comments

@jdanders
Copy link

jdanders commented Nov 29, 2024

I am just beginning with OCPP and cannot figure out why my Wallbox Pulsar is not connecting. I cloned the repo from github and put it in my custom_components folder, created the integration, and pointed my charger at the HA instance.

Version of the custom_component

I don't see any version info in const.py, but the git hash is a55913c (commit on 11/27).

Configuration

Integration config:
Host address: 0.0.0.0
Port: 9000
No secure connection

The charger configuration is as recommended:
OCPP Provider: Other
URL: ws://my-ha-instance.local:9000
Charge point identity: garagebox
Password: [blank]

Describe the bug

I can seen in my HA logs that communication is happening, but it looks like the charger gives up before completing things.

I have a lot of notifications from HA that "Charger garagebox rebooted."

Debug log

2024-11-28 22:34:45.541 INFO (MainThread) [ocpp] garagebox: send [2,"59928e94-b6aa-45b5-bc92-cb5ae3fac5b2","GetConfiguration",{"key":["SupportedFeatureProfiles"]}]
2024-11-28 22:34:48.542 INFO (MainThread) [ocpp] garagebox: receive message [2,"2004910888","BootNotification",{"chargePointSerialNumber": "779030","chargePointVendor": "Wall Box Chargers","meterType": "Internal NON compliant","meterSerialNumber": "","chargePointModel": "PUP1-U-1-6","iccid": "","chargeBoxSerialNumber": "779030","firmwareVersion": "6.6.15","imsi": ""}]
2024-11-28 22:34:48.603 INFO (MainThread) [ocpp] garagebox: send [3,"2004910888",{"currentTime":"2024-11-29T05:34:48Z","interval":3600,"status":"Accepted"}]
2024-11-28 22:34:55.543 INFO (MainThread) [ocpp] garagebox: send [2,"e76daddc-d8de-4de7-8280-eff719458a7b","GetConfiguration",{"key":["SupportedFeatureProfiles"]}]
2024-11-28 22:34:55.564 INFO (MainThread) [custom_components.ocpp] Charger garagebox disconnected from 0.0.0.0:9000.
2024-11-28 22:34:55.565 INFO (MainThread) [websockets.server] connection closed

Edit: Adding a little more detail from Wireshark
I can see the WebSocket transactions from the charger to my server in Wireshark. All the packets labeled "Connection Close" come from the server, so it seems like maybe the server is requesting the web socket closure, not due to the charger. There is a 10 second timeout but it looks weird.

Sequence:
Time 0: Server requests "SupportedFeatureProfiles"
Time 0.97s: Charger responds with data shown in log above
Time 1.05s: Server responds with "Accepted" ack
Time 10.003s: Server sends "SupportedFeatureProfiles"
Time 10.006s: Server sends "WebSocket Connection Close"
Time 10.02s: Charger sends "WebSocket Connection Close"

If the server was timing out waiting for the charger, I would have thought it would have sent a command and then waited 10s, not waited 10s then sent the command.

Hopefully that's helpful...

@lbbrhzn
Copy link
Owner

lbbrhzn commented Dec 1, 2024

The version of the ocpp integration should be indicated in manifest.json (but beware, it is not always accurately updated!). When you use HACS to install it, then HACS will still be able to tell you which version you have installed.

It looks like your connection may be closed due to a ping/pong timeout on the websocket connection.

What is the version of websocket that you have installed?
Can you enable debugging of websocket?

It can be done by adding this to your configuration.yaml:

logger:
  default: info
  logs:
    websockets.server: debug

See https://home-assistant-ocpp.readthedocs.io/en/latest/debugging.html

@jdanders
Copy link
Author

jdanders commented Dec 3, 2024

Thanks for the debug tips. The manifest file says version 0.6.1. Here are some more detailed logs.

2024-12-03 09:43:17.508 DEBUG (MainThread) [websockets.server] = connection is CONNECTING
2024-12-03 09:43:17.514 DEBUG (MainThread) [websockets.server] < GET /garagebox HTTP/1.1
2024-12-03 09:43:17.514 DEBUG (MainThread) [websockets.server] < Connection: Upgrade
2024-12-03 09:43:17.515 DEBUG (MainThread) [websockets.server] < Host: my-ha-instance.local:9000
2024-12-03 09:43:17.515 DEBUG (MainThread) [websockets.server] < Sec-WebSocket-Key: b+5Hu+RjxRrbPPYMw1jJBw==
2024-12-03 09:43:17.515 DEBUG (MainThread) [websockets.server] < Sec-WebSocket-Protocol: ocpp1.6
2024-12-03 09:43:17.515 DEBUG (MainThread) [websockets.server] < Sec-WebSocket-Version: 13
2024-12-03 09:43:17.515 DEBUG (MainThread) [websockets.server] < Upgrade: websocket
2024-12-03 09:43:17.516 DEBUG (MainThread) [websockets.server] < User-Agent: WebSocket++/0.8.2
2024-12-03 09:43:17.517 DEBUG (MainThread) [websockets.server] > HTTP/1.1 101 Switching Protocols
2024-12-03 09:43:17.517 DEBUG (MainThread) [websockets.server] > Upgrade: websocket
2024-12-03 09:43:17.517 DEBUG (MainThread) [websockets.server] > Connection: Upgrade
2024-12-03 09:43:17.517 DEBUG (MainThread) [websockets.server] > Sec-WebSocket-Accept: wJw4tTOXUjy7k3aQMsi8ibVgL04=
2024-12-03 09:43:17.517 DEBUG (MainThread) [websockets.server] > Sec-WebSocket-Protocol: ocpp1.6
2024-12-03 09:43:17.518 DEBUG (MainThread) [websockets.server] > Date: Tue, 03 Dec 2024 16:43:17 GMT
2024-12-03 09:43:17.518 DEBUG (MainThread) [websockets.server] > Server: Python/3.12 websockets/13.0
2024-12-03 09:43:17.520 INFO (MainThread) [websockets.server] connection open
2024-12-03 09:43:17.520 DEBUG (MainThread) [websockets.server] = connection is OPEN
2024-12-03 09:43:17.521 INFO (MainThread) [custom_components.ocpp] Websocket Subprotocol matched: ocpp1.6
2024-12-03 09:43:17.521 INFO (MainThread) [custom_components.ocpp] Charger websocket path=/garagebox
2024-12-03 09:43:17.521 INFO (MainThread) [custom_components.ocpp] Charger garagebox reconnected to 0.0.0.0:9000.
2024-12-03 09:43:17.521 DEBUG (MainThread) [custom_components.ocpp] Reconnect websocket to garagebox
2024-12-03 09:43:19.524 INFO (MainThread) [ocpp] garagebox: send [2,"b4357876-bb6b-4332-a433-60218e92e98e","GetConfiguration",{"key":["SupportedFeatureProfiles"]}]
2024-12-03 09:43:19.524 DEBUG (MainThread) [websockets.server] > TEXT '[2,"b4357876-bb6b-4332-a433-60218e92e98e","GetC...rtedFeatureProfiles"]}]' [98 bytes]
2024-12-03 09:43:20.509 DEBUG (MainThread) [websockets.server] < TEXT '[2,"648995973","BootNotification",{"chargePoint...: "6.6.15","imsi": ""}]' [293 bytes]
2024-12-03 09:43:20.510 INFO (MainThread) [ocpp] garagebox: receive message [2,"648995973","BootNotification",{"chargePointSerialNumber": "779030","chargePointVendor": "Wall Box Chargers","meterType": "Internal NON compliant","meterSerialNumber": "","chargePointModel": "PUP1-U-1-6","iccid": "","chargeBoxSerialNumber": "779030","firmwareVersion": "6.6.15","imsi": ""}]
2024-12-03 09:43:20.512 DEBUG (MainThread) [custom_components.ocpp] Received boot notification for garagebox: {'charge_point_serial_number': '779030', 'charge_point_vendor': 'Wall Box Chargers', 'meter_type': 'Internal NON compliant', 'meter_serial_number': '', 'charge_point_model': 'PUP1-U-1-6', 'iccid': '', 'charge_box_serial_number': '779030', 'firmware_version': '6.6.15', 'imsi': ''}
2024-12-03 09:43:20.513 DEBUG (MainThread) [custom_components.ocpp] Updating device info charger: {'charge_point_serial_number': '779030', 'charge_point_vendor': 'Wall Box Chargers', 'meter_type': 'Internal NON compliant', 'meter_serial_number': '', 'charge_point_model': 'PUP1-U-1-6', 'iccid': '', 'charge_box_serial_number': '779030', 'firmware_version': '6.6.15', 'imsi': ''}
2024-12-03 09:43:20.556 INFO (MainThread) [ocpp] garagebox: send [3,"648995973",{"currentTime":"2024-12-03T16:43:20Z","interval":3600,"status":"Accepted"}]
2024-12-03 09:43:20.556 DEBUG (MainThread) [websockets.server] > TEXT '[3,"648995973",{"currentTime":"2024-12-03T16:43...0,"status":"Accepted"}]' [90 bytes]
2024-12-03 09:43:29.528 INFO (MainThread) [ocpp] garagebox: send [2,"fdf1ceca-7fa2-4567-b796-0ab52a485430","GetConfiguration",{"key":["SupportedFeatureProfiles"]}]
2024-12-03 09:43:29.529 DEBUG (MainThread) [websockets.server] > TEXT '[2,"fdf1ceca-7fa2-4567-b796-0ab52a485430","GetC...rtedFeatureProfiles"]}]' [98 bytes]
2024-12-03 09:43:29.531 DEBUG (MainThread) [custom_components.ocpp] Closing websocket to 'garagebox'
2024-12-03 09:43:29.531 DEBUG (MainThread) [websockets.server] = connection is CLOSING
2024-12-03 09:43:29.531 DEBUG (MainThread) [websockets.server] > CLOSE 1000 (OK) [2 bytes]
2024-12-03 09:43:29.539 DEBUG (MainThread) [websockets.server] < CLOSE 1000 (OK) [2 bytes]
2024-12-03 09:43:29.539 DEBUG (MainThread) [websockets.server] x half-closing TCP connection
2024-12-03 09:43:29.546 DEBUG (MainThread) [websockets.server] = connection is CLOSED
2024-12-03 09:43:29.547 INFO (MainThread) [custom_components.ocpp] Charger garagebox disconnected from 0.0.0.0:9000.
2024-12-03 09:43:29.548 INFO (MainThread) [websockets.server] connection closed

As before, it looks like the problem is here:

2024-12-03 09:43:29.528 INFO (MainThread) [ocpp] garagebox: send [2,"fdf1ceca-7fa2-4567-b796-0ab52a485430","GetConfiguration",{"key":["SupportedFeatureProfiles"]}]
2024-12-03 09:43:29.529 DEBUG (MainThread) [websockets.server] > TEXT '[2,"fdf1ceca-7fa2-4567-b796-0ab52a485430","GetC...rtedFeatureProfiles"]}]' [98 bytes]
2024-12-03 09:43:29.531 DEBUG (MainThread) [custom_components.ocpp] Closing websocket to 'garagebox'

After a 10 second delay, data is sent and then immediately closes the websocket.

@jdanders
Copy link
Author

jdanders commented Dec 3, 2024

As an experiment, I rolled my git checkout back to the v0.6.1 tag and it came up just fine. Looking at the commits and your hypothesis of websocket problem, I would guess the problem commit is 1c62f40. My system is showing websocket 13, and that commit bumps to 14.1. Is there something on the user end that is supposed to be done to accommodate that change?

@drc38
Copy link
Collaborator

drc38 commented Dec 3, 2024

The charger does not respond to the request for its SupportedFeatureProfiles. So the websocket connection times out.

You can try installing v0.5.x of the integration as v0.6.x has major changes to the integration but I suspect it's an issue with your charger or local network. Is it on the latest firmware?

@jdanders
Copy link
Author

jdanders commented Dec 3, 2024

I moved to tagged version of 0.6.1 and it works now. Yes, the charger is on the latest firmware.

@drc38 drc38 closed this as completed Dec 3, 2024
@jdanders
Copy link
Author

jdanders commented Dec 3, 2024

I restarted HA and the charger and things didn't work in the exact same way again. I reverted to 0.5.14 and it works again, so I am not sure what the real problem is...

@davemuench
Copy link

I just ran into the same problem with my brand new Wallbox on 0.6.1 of the integration. Reverting to 0.5.14 had it working right away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants