Hi
I'm quite new to the world of Arduino, I'm working on a project that has a Access point, then a web server (once the SSID and Pass is set in the AP)
I'm using a JSON file on SPIFFS to store the data. I want to try and refine my code using WebSockets. One of the most frustrating things I have found with Arduino libraries is the lack of documentation / where to find it.
So first question, what's the difference between WebSocketsServer and WebSocketsClient and which one should I be using?
Second (main) question. I may end up regretting this, my plan was to load and save data to the HTML pages via WebSockets.
I can get the HTML to call for the data via JS which then sends a JSON over which the JS populates the form.
Now I want to save the data, in my first version I did an HTML post that Arduino handled and saved the data to the JSON file, then reloaded the HTML page which read it.
I've come to realise than I think I will need to have 2 WebSockets open (TX and RX) so I can handle the requests as needed, so should I be using WebSocketsServer for TX and WebSocketsClient for RX?
Am I going to cause myself more issues than it worth doing it this way? Is there a better way to look at this as I'm starting to realise its going to be a lot of coding to handle each request back and forth.
I could go back to getting the JS to read and load the JSON off the SPIFFS as per my first version, POST for saving and just have the WebSockets for just telling the Arduino to run functions, such as a test which was why I starting down this road in the first place.
Any advice from your experience would be great.
Brian