Description

utils/consoleETH.h provides the following function (from the DICE_Ethernet Library) to your console application:

  • s_console_eth_config_cmds() : which delivers the following commands
    • eth mac – prints or sets the MAC address
    • eth ip – prints or sets the own static IP address
    • eth dns – prints or sets the static IP of the DNS server
    • eth gateway – prints or sets the static IP of the gateway
    • eth subnet – prints or sets the static subnet

The s_console_eth_config_cmds() function and the commands that it provides can be used to allow the user of your application configure the dice-ETH device.

  • s_console_eth_cmds() : provides the following evaluation and testing commands
    • eth info – lists information about the ethernet interface like IP, MAC address etc.
    • eth init <static> – initialize the ethernet controller via DHCP (or static values)
    • eth get <URL> – http example get request to server www.di-ce.de
    • eth download <URL> <version> – downloads a file and writes it into the serial flash, optional save a of the file
    • eth socket <server> <port> – opens a TCP socket
    • eth post <URL> <Element> <Value> – sends a POST request to a server
    • eth SysSync <account> – Starts a remote update process, optional <account> for first registration.

The s_console_eth_cmds() function is mainly for testing, learning and evaluation purposes.

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/consoleETH.h"

void setup() {
  SerialFlash.begin();
  console_init(&Serial);
}

void loop() {
  String s_console_string = s_console_routine();
  s_console_string = s_console_eth_config_cmds( s_console_string );
  s_console_eth_cmds( s_console_string );  
}

Notes and Warnings

This console-function and its commands are helpful to test and learn to work with the DICE_Ethernet 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\...

In a ‘real world’ application, the s_console_eth_cmds() should not be required but during development it could be helpful to test the DICE_Ethernet library.

Hint: Also use consoleSerialFlash.h in order to list the downloaded files.

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

DICE_Ethernet Library
SerialFlash – Library
HTTP_Client Class