In this guide we show how to setup and use the ethernet plugin for Ethernet2, UipEthernet, Stm32Ethernet libraries. This plug-in works with Ethernet shields and many ethernet modules available for Arduino. For a general overview on remotely controlling and monitoring see controlling embedded apps with embedCONTROL.
IMPORTANT: It is your responsibility to configure and initialise the Ethernet adapter before calling setupMenu
in the general application setup. See the section further down on sketch requirements.
Once the plugin is selected, you can choose the library that supports your ethernet device, these are the choices along with any libraries that are needed alongside that option.
As I suggest tcMenu for commercial projects, I have to include this warning.
This only applies to the UipEthernet library for ENC28J60 modules (NOT the Arduino provided Ethernet2 library which is LGPL and has more flexible licensing).
UipEthernet library is GPL code and tcMenu purposely does not link with it directly. If you choose to cause the menu designer to generate code that links with UipEthernet instead of Ethernet2 you are essentially making your code GPL. If your project is for personal or completely private use it’s probably not a problem, however think carefully before using in a public commercial product.
Ensure your menu structure is saved and then choose Code -> Generate Code from the menu. Once the code generation dialog appears, to the right of the current remote type will be a button named “Change”. Select the ethernet control option:
You can define the number of connections that can be allowed at once, each connection uses a small amount of RAM and one of the 6 remote connection slots.
This defines the port on which to listen for connections, by default it is set to 3333 for the first connection, 3334 and 3335 for the second and third.
It is your responsibility to fully initialise the network stack before calling setupMenu
. You must either choose DHCP configuration where an IP address will be automatically assigned, or you must configure one manually.
There are several Ethernet examples packaged with tcMenu. Take a look at either the Nokia5110 or TakeOverDisplay example.