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

Error received in the gateway container whilst trying to connect. #114

Closed
tim0git opened this issue Apr 26, 2024 · 5 comments
Closed

Error received in the gateway container whilst trying to connect. #114

tim0git opened this issue Apr 26, 2024 · 5 comments

Comments

@tim0git
Copy link

tim0git commented Apr 26, 2024

Simulator returns the following error whilst trying to connect.

ERROR:root:CP1: received 1011 (internal error); then sent 1011 (internal error)

Gateway Container is showing the following Log output.

| Successfully set IOT certificates |
| Starting the gateway server |
| We renamed asyncio-mqtt to aiomqtt and released a version 1.0.0 in the process. This is the last release under the asyncio-mqtt name. You can find the new repository at https://github.com/sbtinstruments/aiomqtt |
| Exception ignored in: <function Client.del at 0xffff92890040> |
| Traceback (most recent call last): |
| File "/opt/ocpp-gateway/lib64/python3.10/site-packages/paho/mqtt/client.py", line 874, in del |
| self._reset_sockets() |
| File "/opt/ocpp-gateway/lib64/python3.10/site-packages/paho/mqtt/client.py", line 1133, in _reset_sockets |
| self._sock_close() |
| File "/opt/ocpp-gateway/lib64/python3.10/site-packages/paho/mqtt/client.py", line 1119, in _sock_close |
| if not self._sock: |
| AttributeError: 'Client' object has no attribute '_sock' |
| ERROR:websockets.server:connection handler failed |
| Traceback (most recent call last): |
| File "/opt/ocpp-gateway/lib64/python3.10/site-packages/websockets/legacy/server.py", line 236, in handler |
| await self.ws_handler(self) |
| File "/opt/ocpp-gateway/lib64/python3.10/site-packages/websockets/legacy/server.py", line 1175, in _ws_handler |
| return await cast( |
| File "/opt/ocpp-gateway/server.py", line 33, in handler |
| async with gateway.Gateway(charge_point_id, websocket) as iot_connection: |
| File "/opt/ocpp-gateway/gateway.py", line 37, in init |
| super().init( |
| File "/opt/ocpp-gateway/lib64/python3.10/site-packages/asyncio_mqtt/client.py", line 298, in init |
| self._client: mqtt.Client = mqtt.Client( |
| TypeError: Client.init() missing 1 required positional argument: 'callback_api_version' |

@louis-monier
Copy link

Exact same issue encountered.

@galinsky
Copy link
Collaborator

galinsky commented May 5, 2024

Please try updating src/ocpp-gateway-container/requirements.txt to fix the version of the mqtt package to one that pre-dates the version increase of path-mqtt to v2.0.0; e.g.:

asyncio-mqtt==0.16.1

If that solves the problem we’ll update the same in the repo. Thx!

@louis-monier
Copy link

louis-monier commented May 9, 2024

I've updated the src/ocpp-gateway-container/requirements.txt file:

boto3
websockets
asyncio-mqtt==0.16.1

And now get the following error in the Gateway Container logs:

Successfully set IOT certificates
Starting the gateway server
ERROR:websockets.server:connection handler failed
Traceback (most recent call last):
  File "/opt/ocpp-gateway/lib64/python3.10/site-packages/websockets/legacy/server.py", line 236, in handler
    await self.ws_handler(self)
  File "/opt/ocpp-gateway/lib64/python3.10/site-packages/websockets/legacy/server.py", line 1175, in _ws_handler
    return await cast(
  File "/opt/ocpp-gateway/server.py", line 33, in handler
    async with gateway.Gateway(charge_point_id, websocket) as iot_connection:
  File "/opt/ocpp-gateway/gateway.py", line 37, in __init__
    super().__init__(
  File "/opt/ocpp-gateway/lib64/python3.10/site-packages/asyncio_mqtt/client.py", line 343, in __init__
    self._client.message_retry_set(message_retry_set)
AttributeError: 'Client' object has no attribute 'message_retry_set'

@sparkgene
Copy link

It looks like asyncio-mqtt use paho-mqtt for mqtt client. paho-mqtt client latest version is 2.1.0 but they removed message_retry_set at version 2.0.0.
https://github.com/eclipse/paho.mqtt.python/releases/tag/v2.0.0

So specify paho-mqtt version in src/ocpp-gateway-container/requirements.txt fixed this problem.

boto3
websockets
paho-mqtt==1.6.1
asyncio-mqtt

@Igor-SBx
Copy link

I'm having the same issue #153.

It was not resolved.

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

5 participants