By dave | July 11, 2019

ESP8266 / ESP32 WiFi remote plug-in for tcMenu library

In this guide we show how to setup and use the ESP8266 / ESP32 Wifi remote plugin for use in the menu library. This plug-in works with most ESP boards.

ESP WiFi is quite easy to set up as it’s built into the device. However, when using any ESP board and ESP8266 especially you must make sure that you frequently yield control to the runtime. If you are using task manager exclusively this should not be an issue.

It is your responsibility to configure and initialise the WiFi adapter before calling setupMenu in the general application setup. See the section further down on sketch requirements.

Configuring ESP8266 or ESP32 WiFi

First, ensure that you’ve chosen the right “Embedded Platform” type which should be either ESP32 or ESP8266 to match your board, then ensure your menu structure is saved and lastly 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”. Click this button choose the appropriate ESP plugin for your board. For example:

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.

The absolute minimum that you’ll need to do to start the WiFi is call the following before setup:

    WiFi.begin(ssid, password);

Take a look at the example esp8266WifiOled packaged with tcMenu, which works for both ESP32 and ESP8266.

Back to tcMenu main page

Other pages within this category

comments powered by Disqus

This site uses cookies to analyse traffic, serve ads by Google AdSense (non-personalized in EEA/UK), and to record consent. We also embed Twitter, Youtube and Disqus content on some pages, these companies have their own privacy policies.

Our privacy policy applies to all pages on our site

Should you need further guidance on how to proceed: External link for information about cookie management.