I am using the SparkFun Qwiic WiFi Shield - DA16200 and have tried the 3 example sketches and they all work. The next step will be a sketch to allow remote temperature monitoring via Wifi/LAN. For this the DA16200 would have to act as a server? So how does one begin to do this? apparently the DA16200 manual has the information but it is a bit arcane. Can you give me a clue?
You have a few options.
If you want the shield to act as a server, the easiest solution is to have it open a TCP server socket and drive the server’s behavior from the Arduino side. Using AT commands, the conversation should look something like the following:
AT+TRTS=1234
OK
This opens a TCP socket and listens on port 1234. You can then connect via a client, and send a message (like “get_temperature”, for example). Your Arduino code should poll for AT responses containing data sent by the client, as well as the connection ID, client address and port.
+TRCTS:0,192.168.0.1,56789
+TRDTS:0,192.168.0.1,56789,17,get_temperature
Then, to send data back to the client, the Arduino needs to write an escape sequence and command to the DA16200. For example, to write five bytes for the temperature reading (“72.5\n”), you send the escape code (0x1B), the send command (S), the connection ID from the connection response above (0), the length in bytes of the message (5), the client address and port, and then the message.
<ESC>S05,192.168.0.1,56789,72.5
OK
Finally, when the client disconnects, the Arduino will read a disconnect response from the serial connection.
+TRXTS:0,192.168.0.1,56789
See the [DA16200 AT Command User Manual for more information on these and other related AT commands. You may notice references to commands for making HTTP/HTTPS requests and running an HTTP/HTTPS server, however as near as I can tell, you cannot get these commands to work without re-flashing the DA16200 SoC itself with custom firmware. Dialog Semiconductor does support this kind of thing, and you can read more about it in their [FreeRTOS SDK Programmer Guide.](DA16200 - Ultra-Low Power Wi-Fi SoC for Battery-Powered IoT Devices | Renesas)](https://cdn.sparkfun.com/assets/learn_tutorials/1/9/9/1/UM-WI-003_DA16200_AT-Command_User_Manual_Rev_2v3.pdf)
Thank you for the detailed response. Good information particularly about the HTTP/S servers and re-flashing.