MicroOcpp
MicroOcpp copied to clipboard
How to retrieve the JSON string from a function ?
Hello everyone,
I use this library to carry out a project as part of my internship. I have to design a module capable of sending fake OCPP frames to an application in order to test its behavior in front of a large influx of data. However I don’t know how to display the frames I send on the Arduino terminal. For exemple on the function :
**startTransaction("my-id-tag", [] (JsonObject payload) {
//Callback: Central System has answered. Could flash a confirmation light here.
Serial.print(F("[main] Started OCPP transaction\n"));
});**
I can’t retrieve the JSON created by this function in order to print it on the terminal. I have tried to program my own WebSocket to see if I receive the frames, but without success ( I have never done this before , so I'll continue to try this way), my ESP32 don't send any data on my webSocket while I could do it from the plugin "Simple WebSocket Client" of Chrome.
I have also tried to do some function like serializeJson() but it also don't work.
Thanks in advance for your help !