Good morning,
I am modifying the ocpp node for personal use.
I have added a function that makes it reconnect if it loses the connection (this only did it if you did a deploy).
The author of the module that makes the reconnection.
Indicates that a ws.reconnect () call can be made for the module to reconnect.
What I would like to know is how can I add the option that if it receives by the msg.payload the word "car", execute the ws.reconnect ().
I have tried adding this to the module js.
if (msg.payload == 'car'){
ws.reconnect();
}
but it does not work...
Could someone guide me?
Based on only one function of your code it is not easy to see what you are doing.
Is that the same function as this original function?
I don't think you can access there your input message, at least like the code is structured like it is now.
Not sure what you mean. How do you want it to work then?
Please show a complete code snippet with the msg handling code included. And explain what you expect, and which result you currently get instead...