In this guide we show how to setup and use the Ethernet2 and UipEthernet remote plugin for use in the menu library. This plug-in works with Ethernet shields and modules available for Arduino.
This plug-in will work with most Arduino provided ethernet shields and modules that use the Ethernet2 library, it will also work with most ENC28J60 based modules using the UipEthernet library.
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.
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:
The only parameter for ethernet connections is the listen port parameter, this is the port on which the server socket should listen for connections. The default is 3333.
It is your responsibility to fully initialise the network stack before calling
setupMenu either in Access Point or Station mode. 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.