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

Websocket cloud server connection issue #36

Closed
akashdk191 opened this issue Dec 8, 2021 · 2 comments
Closed

Websocket cloud server connection issue #36

akashdk191 opened this issue Dec 8, 2021 · 2 comments

Comments

@akashdk191
Copy link

I am unable to connect NodeMCU to the OCPP server hosted in cloud while able to connect in localhost with IP : 192.168.1.11:9055/v1.6/alpha
The same OCPP cloud server can be connected from chrome extension Websocket King Client.
There is no SSL enabled on cloud

Sample URL :
ws://splendidwasp21.loca.lt/v1.6/alpha.

Node MCU main.cpp macro definitions for server

#define OCPP_HOST "splendidwasp21.loca.lt"
#define OCPP_PORT '\0'
#define OCPP_URL "v1.6/alpha"

Is the above assignment correct to connect to cloud server.
if not what is the right way to connect to cloud server. Is something needs to be added during initialisation?

@akashdk191 akashdk191 changed the title Websocket Server connection issue Websocket cloud server connection issue Dec 8, 2021
@matth-x
Copy link
Owner

matth-x commented Dec 9, 2021

Hi,

You could try

#define OCPP_HOST "splendidwasp21.loca.lt"
#define OCPP_PORT 9055
#define OCPP_URL "ws://splendidwasp21.loca.lt/v1.6/alpha"

Otherwise, you can play a little bit around by exchanging the canonical names with the IP address or adding the port number to the OCPP_URL field. In many cases, the problem lies anywhere between the microcontroller and the server though.

The best way to debug it, is to start a test sketch with the WebSockets library only. Markus's example sketches get you started very quickly. To mimic an OCPP connection, you have to change the protocol parameter from "arduino" into "ocpp1.6" and that's it, then you can figure out what is necessary to change for my library.

If the WebSocket connection works but you observe that the library fails to upgrade the connection to OCPP, please open a new issue.

@akashdk191
Copy link
Author

this issue is fixed as per above url suggestion

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