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

connection error with default websocket option. #23

Open
suninno opened this issue Jun 19, 2024 · 1 comment
Open

connection error with default websocket option. #23

suninno opened this issue Jun 19, 2024 · 1 comment

Comments

@suninno
Copy link

suninno commented Jun 19, 2024

#1, MicroOcppSimulator/webapp-src dir, $>npm run dev --> successfully
#2, MicroOcppSimulator dir, $> ./build/mo_simulator --> successfully

connection error with default websocket option 'wss://echo.websocket.events/charger-001' as following

the following are browser console logs

mo_simulator_wasm.mjs:9 WebSocket connection to 'ws://echo.websocket.events/charger-01' failed:
mo_simulator_wasm.mjs:9 [MO] info (net_wasm.cpp:142): connection ws://echo.websocket.events/charger-01 -- error
mo_simulator_wasm.mjs:9 [MO] info (net_wasm.cpp:156): connection ws://echo.websocket.events/charger-01 -- closed


I changed the backendurl and chargebox id to suit my environment in the EVSE Dashboard's left menu 'OCPP 1.6 Connection'.
As in the following my ocpp websocker server log, disconnect the client as soon as it connects.

What's the cause?

It is difficult to interpret whether it is a wrong setting problem, a code problem, or a DB value problem.

[2024-06-19T16:53:33.340] [INFO] default - Wed Jun 19 2024 16:53:33 Connection from origin http://192
.168.0.30:4000.::ffff:192.168.0.17
[2024-06-19T16:53:33.340] [INFO] default - **path: /ocpp/10100304
[2024-06-19T16:53:33.340] [INFO] default - Charge point ID: 10100304
[2024-06-19T16:53:33.343] [INFO] default - found charge point ID.
[2024-06-19T16:53:33.344] [DEBUG] default - clients.length: 6
[2024-06-19T16:53:33.344] [INFO] default - Wed Jun 19 2024 16:53:33 GMT+0900 connection acccpted
[2024-06-19T16:53:33.344] [INFO] default - Client has disconnected.
[2024-06-19T16:53:33.344] [DEBUG] default - clients.length: 5

@chheunpheara
Copy link

chheunpheara commented Jun 20, 2024

I am very junior to this platform. I faced a similar issue but my environment is in Docker.
I finally found out that the Simulator address is in Docker and my controller is on Host machine.

At the beginning I got errors like this:
[MO] info (MicroOcppMongooseClient.cpp:573): connection ws://192.168.80.3:3000/walbox -- closed 3c2e3c7 1 mongoose.c:403:mg_error 613 0xb socket error 3c2e3c7 1 MicroOcppMongooseClient.cpp:5 0xb socket error [MO] info (MicroOcppMongooseClient.cpp:573): connection ws://192.168.80.3:3000/walbox -- error [MO] info (MicroOcppMongooseClient.cpp:573): connection ws://192.168.80.3:3000/walbox -- closed

Finally, I changed the backend url with my controller address, which is in docker.

`Simulator Address: 192.168.80.2:8000
Controller Address: 192.168.80.3:3000

So the backend URL should be: ws://192.168.80.3:3000`

Then, the charge point can connect to the controller
[MO] info (MicroOcppMongooseClient.cpp:559): connection ws://192.168.80.3:3000/walbox -- connected!

This is just my successful first step :). I also have other problems to figure out and understand.

Hope this helps your case!

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

2 participants