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.

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 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

Number of connections

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.

Listen Port parameters

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.

Connection buffering parameter

You can enable or disable connection buffering on ESP connection. This uses a bit more RAM but may be slightly faster depending on your use case.

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, 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.

Send a message

Please use the forum for help with UI & libraries.

This message will be securely transmitted to our servers.