-
Notifications
You must be signed in to change notification settings - Fork 339
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
Issues with README Examples and WebSocket Compatibility #709
Comments
As of the issues you are having I can only identify the first issue as due to incompatibility with websockets v14. You can find a solution for that here #708. The second issue you have is actually due to the example in README not being compatible with v2 of this library. The "Payload"-suffix is deprecated and you should just delete that. BootNotificationPayload is now just called BootNotification. The third issue I can't really identify the problems from the added logs, could you maybe show the code? |
Also I think the websocket compatibility is maybe an interesting topic to discuss. It could be to enable different websocket interfaces. Some of the webframeworks that support websockets use .recieve() instead of .recv() and maybe I saw somewhere .call() instead of .send(). I don't have good suggestion on how to make this library compatible with all different websocket implementations, but might be interesting to look in to. |
Hello Ali, Thank you for your reply, On point 3 I have not written any code, the only thing I did was:
The reason I checkout that commit was simply because it was the last one involving the scripts in /examples/v201 . On the websocket, I was actually trying to see if I could run OCPP with some websockets with specific SSL contexts which have their special requirements (which we are starting to develop) and use the provided examples as starting point, but unfortunately they were not working out of the box with the latest release. I'll checkout if issue #708 can help. |
### Changes included in this PR Updates to the example usage of the library (doc update). ### Current behavior #708 and #709 describe how the current examples in the documentation fail due to 1) they still use the "Payload" suffix on payload data classes, this is not part of the latest version of this library 2) breaking changes from the WebSockets library, primarily regarding the path parameter passed to the connection handler and where to find the request headers. ### New behavior This PR updates the example code both for v16 and v201, so that the payload dataclass is correct and is compatible with the latest websockets library. ### Impact Only changes to documentation. However the documentation currently wouldn't support older versions of websockets library. ### Checklist 1. [x] Does your submission pass the existing tests? 2. [ ] Are there new tests that cover these additions/changes? 3. [x] Have you linted your code locally before submission?
I created the updates to the examples code that makes it compatible with websockets v14 and ocpp v2 in this PR #710. I think you can safely work with websockets version 14. |
Works like a charm! Thank you for your assistance |
- feat: specify exact package versions in requirements.txt per AWS MWAA best practices - fix: restrict websockets to <14.0 due to OCPP v2.0.0 compatibility - refactor: rename RegistrationStatusType to RegistrationStatusEnumType - refactor: replace deprecated BootNotificationPayload with BootNotification - refactor: replace deprecated HeartbeatPayload with Heartbeat() Ref: https://aws.amazon.com/blogs/big-data/amazon-mwaa-best-practices-for-managing-python-dependencies/ mobilityhouse/ocpp#709
Hello everyone,
I encountered several issues while trying to install and reproduce the examples provided in the README and the scripts in the example folder. Here are the details:
Variable Naming Inconsistency:
RegistrationStatusType
should be renamed toRegistrationStatusEnumType
for bothcsms
andcp
.WebSocket Compatibility Issues:
The README recommends installing a generic version of
websockets
, which is at the moment version 14. However, this version introduces breaking changes compared to version 13, resulting in the following errors:cp
:csms
:Downgrading to version 13.1 of
websockets
resolves some issues, but I still encounter the following errors:/examples/v201/central_system.py
:/examples/v201/charge_point
:Similarly, for
csms
:cp
:Working Commit:
d25580c9a66c68843d49ebe8dbec24056654e27c
.Questions:
websockets
version 14?The text was updated successfully, but these errors were encountered: