Description
utils/consoleWiFiDev.h
provides the following function (from the WiFiNINA, SerialFlash – Library and BOOTLOADER SETTINGS – Library, ) to your console application:
s_console_wifi_cmds()
: delivers the following commands- wifi get <url> – http example get request to server www.di-ce.de or optional <url>
- wifi download <url> – downloads a file and writes it into the serial flash, optional save a of the file; <url> is optional
- wifi socket <server> <port> – opens a TCP socket
- wifi post <url> <Element> <Value> – sends a POST request to a server
- wifi SysSync <account> – Starts a remote update process, opt.:<account> for first registration.
s_console_wifi_update_cmds()
:- wifi_update <file> – flashes the NINA module firmware
- wifi_cert <file> – flashes certificates into the NINA module
Use the WiFiDev commands only for tests, evaluation and to update the firmware of the WiFi / BLE module of the dice-WiFi and the libraries above. The source codes (see path below) of consoleWiFiDev might also serve as example. Note that your the library function makes use of the SerialFlash so that the application needs to call SerialFlash.begin(); in its setup() routine.
Parameters
String s_console_string – String that holds the user command. Normally returned by s_console_routine() or a previous console function.
Returns
String : the user command or an empty String “” if the user command was recognised and processed by this function. (see of commands above)
Example Code:
#include "consoleLogin.h"
#include "utils/consoleWiFiConfig.h"
#include "utils/consoleWiFiDev.h"
void setup() {
SerialFlash.begin();
console_init(&Serial);
}
void loop() {
String s_console_string = s_console_routine();
s_console_string = s_console_wifi_config_cmds( s_console_string );
s_console_string = s_console_wifi_cmds( s_console_string );
s_console_wifi_update_cmds( s_console_string );
}
Notes and Warnings
This console-function and its commands are helpful to test and learn to work with the WiFiNINA, SerialFlash – Library and BOOTLOADER SETTINGS – Library. See the source code as example code for your own application:
C:\Users\yourName\AppData\Local\Arduino15\packages\dice\hardware\samc\1.0.0\libraries\Console\src\...
Hint: Also use consoleFileTransfer.h and consoleSerialFlash.h in order to list the downloaded files and to update the module firmware.
In a ‘real world’ application, these commands might not be required but during development it could be helpful to test the libraries.
Please keep in mind that each included file and its used function increase the size of the resulting application. So in order to keep the application binaries as small as possible, include only functions that are really necessary for the final application.
An example can be found in the Arduino IDE menu:
File -> Examples -> Consoles ->
Dev_Console
See also
BOOTLOADER SETTINGS – Library
WiFiNINA
SerialFlash – Library
FileTransfer – Library
consoleFileTransfer.h
consoleSerialFlash.h