matth-x / MicroOcpp

OCPP 1.6 / 2.0.1 client for microcontrollers
MIT License
354 stars 149 forks source link

Change WiFi interface for Ethernet #266

Open kevincsouto opened 8 months ago

kevincsouto commented 8 months ago

Let's define the problem: there is a need to change the network interface from wifi to ethernet. To do so, it is necessary to establish a specialized web socket connection with the micro ocpp library, as the way it operates is not interchangeable for another physical network interface. Therefore, I used the MO_CUSTOM_WS macro and adapted the class for this connection to a new web socket library, as shown in the following image:

Captura de tela 2024-03-05 115355

Here I also established other changes:

image

And I called the settings like this in main.h:

image

The changed library was #include by #include . However, web socket configurations are complex and trying to adapt existing code with a new library is not being helpful. What is the way forward?

kevincsouto commented 8 months ago

I'm using Websockets_generic from Arduino framework library, and it's not working. image