By dave | July 11, 2019

Ethernet2 and UipEthernet remote plug-in for tcMenu library

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.

  • Using an Arduino shield or WIZ5xxx based module: Use the inbuilt Arduino Ethernet library (Ethernet2)
  • Using an ENC28J60 module: Use the UipEthernet library or the version from library manager- see below license warning

Warning about UipEthernet ENC28J60 library license.

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.

Configuring the Ethernet2 or UipEthernet library

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:

Serial remote choice in designer UI

Serial remote choice in designer UI

LISTEN_PORT parameter

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.

Requirements in your sketch

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.

Back to tcMenu main page

Other pages within this category

comments powered by Disqus

We use cookies to analyse traffic and to personalise content. We also embed Twitter, Youtube and Disqus content on some pages, these companies have their own privacy policies.

Please see our privacy policy should you need more information or wish to adjust your settings.

Send a message
X

This message will be securely transmitted to Nutricherry LTD servers.