Open mmzeynalli opened 5 months ago
Update:
I found out that the error was happening as mo_store
folder was missing in docker, as it is given in .dockerignore
file. I added RUN mkdir mo_store/
in Dockerfile, now it creates files without a problem, however, hangs when it does requests:
[MO] info (MicroOcpp.cpp:344): initialized MicroOcpp v1.1.0
[MO] debug (OperationRegistry.cpp:40): registered operation MeterValues
[MO] debug (OperationRegistry.cpp:40): registered operation ClearChargingProfile
[MO] debug (OperationRegistry.cpp:40): registered operation GetCompositeSchedule
[MO] debug (OperationRegistry.cpp:40): registered operation SetChargingProfile
[MO] debug (Model.cpp:296): supported feature profiles: Core,LocalAuthListManagement,Reservation,SmartCharging,RemoteTrigger
[MO] warning (MicroOcppMongooseClient.cpp:474): Insecure connection (WS)
[MO] info (MicroOcppMongooseClient.cpp:478): connection ws://echo.websocket.events/charger-01 -- connected!
[MO] Send: [2,"1000000","BootNotification",{"chargePointModel":"MicroOcpp Simulator","chargePointVendor":"MicroOcpp"}]
[MO] Recv: echo.websocket.events sponsored by Lob.com
[MO] warning (RequestQueue.cpp:182): Invalid input! Not a JSON
[MO] warning (MicroOcppMongooseClient.cpp:484): processing input message failed
[MO] Recv: [2,"1000000","BootNotification",{"chargePointModel":"MicroOcpp Simulator","chargePointVendor":"MicroOcpp"}]
[MO] Send: [3,"1000000",{"currentTime":"2022-01-28T11:59:55.000Z","interval":86400,"status":"Accepted"}]
[MO] Recv: [3,"1000000",{"currentTime":"2022-01-28T11:59:55.000Z","interval":86400,"status":"Accepted"}]
[MO] info (BootNotification.cpp:91): request has been Accepted
[MO] debug (Connector.cpp:429): Status changed -> Available
[MO] info (StatusNotification.cpp:53): New status: Available (connectorId 0)
[MO] debug (Connector.cpp:429): Status changed -> Available
[MO] info (StatusNotification.cpp:53): New status: Available (connectorId 1)
[MO] debug (Connector.cpp:429): Status changed -> Available
[MO] info (StatusNotification.cpp:53): New status: Available (connectorId 2)
[MO] info (SmartChargingService.cpp:506): New limit for connector 1, scheduled at = 2022-01-28T11:59:55.000Z, nextChange = 2037-01-01T00:00:00.000Z, limit = {-1.000000,-1.000000,-1}
[MO] Send: [2,"1000001","StatusNotification",{"connectorId":0,"errorCode":"NoError","status":"Available","timestamp":"2022-01-28T11:59:55.000Z"}]
[MO] Recv: [2,"1000001","StatusNotification",{"connectorId":0,"errorCode":"NoError","status":"Available","timestamp":"2022-01-28T11:59:55.000Z"}]
[MO] Send: [3,"1000001",{}]
[MO] Recv: [3,
Now, I cannot even open the page.
have you solved this problem now? cause i have the same issue. Thanks
As I had main application in port 8000, I tried to run this docker image in port 8001. However, it failed as I have shown above. When I try to run it in 8000, it works as it should. I have no idea why.
@mmzeynalli Thanks for the report, the missing mo_store folder is definitely a problem. Does the change in #18 solve the issue?
The dashboard constantly sends HTTP requests to the main Simulator app. For that it uses URLs based on the API root which is hardcoded in the dashboard sources: https://github.com/agruenb/micro-ocpp-dashboard/blob/015a0e816ca4fc617e67acdbe7d067688d6b3939/.env.development
To change the port number, you need to build the dashboard with a custom .env manifest. Here is the relevant description:
Edit:
Also, the Simulator main app opens a listening socket for these HTTP requests on port 8000 by default. It's also necessary to change the port number here:
It solves not being able to docker up, but, still I cannot connect to my websocket through this docker:
[MO] debug (MicroOcppMongooseClient.cpp:160): (re-)connect to ws://83c8-46-162-93-142.ngrok-free.app/socar-cp003
[MO] warning (MicroOcppMongooseClient.cpp:474): Insecure connection (WS)
6be66a0 1 mongoose.c:403:mg_error 194 0x8 handshake error
6be66a0 1 MicroOcppMongooseClient.cpp:4 0x8 handshake error
[MO] info (MicroOcppMongooseClient.cpp:492): connection ws://83c8-46-162-93-142.ngrok-free.app/socar-cp003 -- error
[MO] info (MicroOcppMongooseClient.cpp:492): connection ws://83c8-46-162-93-142.ngrok-free.app/socar-cp003 -- closed
[MO] debug (MicroOcppMongooseClient.cpp:123): WS unconnected
[MO] debug (MicroOcppMongooseClient.cpp:123): WS unconnected
Can you connect to wss://echo.websocket.events/
(leave ChargeBoxId blank)?
Yes, the default settings work just fine.
@mmzeynalli Thanks for the report, the missing mo_store folder is definitely a problem. Does the change in #18 solve the issue?
The dashboard constantly sends HTTP requests to the main Simulator app. For that it uses URLs based on the API root which is hardcoded in the dashboard sources: https://github.com/agruenb/micro-ocpp-dashboard/blob/015a0e816ca4fc617e67acdbe7d067688d6b3939/.env.development
To change the port number, you need to build the dashboard with a custom .env manifest. Here is the relevant description:
- https://github.com/agruenb/micro-ocpp-dashboard/tree/master?tab=readme-ov-file#starting-development
- https://github.com/matth-x/MicroOcppSimulator?tab=readme-ov-file#building-the-webapp-developers
Edit:
Also, the Simulator main app opens a listening socket for these HTTP requests on port 8000 by default. It's also necessary to change the port number here:
And, I believe making port number flexible, without users changing code would be better experience. I had to move my main application port in order to be able to use this tool.
I just tried to move MicroOcppSimulator to the same environment as my main code, creating "locality" with other containers. However, I get the same error, shown in previous comments. This is my websocket code:
server = await websockets.serve(
on_connect,
'0.0.0.0',
rabbitmq_settings.WS_SERVER_PORT,
)
task = asyncio.create_task(
consume(
rabbitmq_settings.TASK_EXCHANGE_NAME,
on_message=lambda task: process_tasks(server, task),
),
)
background_tasks.add(task)
await server.wait_closed()```
Good day, I recently wrote an OCPP application and wanted to test it with this nice simulator tool. However, when I run it in docker, I get error messages and empty web pages:
And there is no station/connectors in web page:
I am using MacOS 13.6