steve-community / steve

SteVe - OCPP server implementation in Java
GNU General Public License v3.0
798 stars 391 forks source link

Readme.md with AWS lightsail for Nginx #797

Closed rahulbhat13 closed 2 years ago

rahulbhat13 commented 2 years ago

Describe the problem you are trying to solve

The proxy setup with Nginx server for websocket getting the issue ERRconnection set issue .

Would suggest some to guide and help on the documentation part .

Describe the solution you'd like

Have configured the Nginx in the lightsail instance And the configuration in /etc/nginx/Nginx.conf

server {

location /steve/ { proxy_pass http://static IP of the light sail instance /steve/; }

location /steve/websocket/CentralSystemService { proxy_pass http://static IP of the light sail instance /steve/websocket/CentralSystemService; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_connect_timeout 1d; proxy_send_timeout 1d; proxy_read_timeout 1d; } } ...

Describe alternative solutions or features you've considered

Would need some solution so I can configure the right proxy and test the websocket issue with postman since I am getting connection issue , I feel I am doing something wrong in the configuration and have to setup the port 8080 somewhere

Additional context

...

rahulbhat13 commented 2 years ago

Can someone help with the issue with the web sockets since I have setup in the main.properties and could see the ws:// connection been setup in the aws Lightsail too , but when I try to use the postman or ws client I am getting it as connection closed. In the webapp also I have setup the charger accordingly using Steve

image

But not able to ping them using the ws

goekay commented 2 years ago

https://github.com/RWTH-i5-IDSG/steve/issues/776#issuecomment-1065045988

you cannot just connect via websocket to steve. there are some ocpp specific requirements.

you should be able to see the particular problem why websocket handshake did not happen in the logs.

rahulbhat13 commented 2 years ago

org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1038) ~[jetty-util-10.0.7.jar:10.0.7] at java.lang.Thread.run(Thread.java:829) ~[?:?] [ERROR] 2022-04-10 08:27:53,431 de.rwth.idsg.steve.ocpp.ws.OcppWebSocketHandshakeHandler - No protocol (OCPP version) is specified. [ERROR] 2022-04-10 08:28:09,527 de.rwth.idsg.steve.ocpp.ws.OcppWebSocketHandshakeHandler - No protocol (OCPP version) is specified. [ERROR] 2022-04-10 08:28:16,706 de.rwth.idsg.steve.ocpp.ws.OcppWebSocketHandshakeHandler - No protocol (OCPP version) is specified. [ERROR] 2022-04-10 08:29:09,128 de.rwth.idsg.steve.ocpp.ws.OcppWebSocketHandshakeHandler - No protocol (OCPP version) is specified.

goekay commented 2 years ago

yeah. ocpp version is missing in header. see my comment and ocpp spec for further inspection.

rahulbhat13 commented 2 years ago

@goekay https://github.com/RWTH-i5-IDSG/steve/blob/master/src/main/java/de/rwth/idsg/steve/ocpp/ws/ocpp16/Ocpp16WebSocketEndpoint.java will this work ? I am not good in Java

goekay commented 2 years ago

there is no need to change something in steve. steve implements ocpp spec as specified.

you are not understanding the problem.

the http request for ws upgrade/handshake should contain a specific header with the value of ocpp version the station implements.

please look at the spec for the details of ws specific requirements.

rahulbhat13 commented 2 years ago

async def main(): server = await websockets.serve( on_connect, '0.0.0.0', 9000, subprotocols=['ocpp2.0.1'] ) logging.info("WebSocket Server Started") await server.wait_closed()

if name == 'main': asyncio.run(main()) you need to pass the subprotocols =['version'] ? from the charger ?

goekay commented 2 years ago

you know steve does not support ocpp2.0.1, right?

the supported versions are pretty much "in your face" in the readme.

goekay commented 2 years ago

i will stop commenting in this issue.

and i am closing it. github issues are not a customer support channel. i am pretty sure yours is not about a fault/bug in steve.

rahulbhat13 commented 2 years ago

I got the version : OCPP1.2S OCPP1.2J OCPP1.5S OCPP1.5J OCPP1.6S OCPP1.6J which are supported I know , I had already mentioned the reference . This is not a business requirement to test with simulator the ws is not working