Skip to content

aschuma/esp32_nextion_js_binary_clock

Repository files navigation

ESP32 and Nextion powered Binary Clock

This is a Javascript demo Mongoose OS app. The aim of this project is to demonstrate how to drive a Nextion HMI display from an ESP32 device.

Here is what you get when you deploy the application on your ESP32 board and your Nextion display:

Demo

Onboarding

Required hardware

Get the software

  • For the mos tool, please follow the Mongoose OS instructions.
  • For the nextion editor (optional), check this hint (Windows only).

Clone the repository

git clone https://github.com/aschuma/esp32_nextion_js_binary_clock.git

Prepare the Nextion display

This is an optional step. It might work without any preparation of the Nextion display. If not, change to src/nextion directory and follow the instructions in the README.md file.

Wire the hardware

ESP32 5V      <-> Nextion 5V  (do NOT use 3V, this might kill the Nextion display) 
ESP32 GND     <-> Nextion GND
ESP32 GPIO16  <-> Nextion TX  (optional, might be required in case of further development)
ESP32 GPIO17  <-> Nextion RX 

Prepare the firmware

cd src/mos

Prepare helper script for development

  • cp deploy.sh.template deploy.sh
  • Open deploy.sh and alter the WiFi settings.

Check mos.yml

  • Alter WiFi settings (ESP32 only support 2.4Ghz networks)
  • Adjust the timezone sys.tz_spec. Please consult Google to find the value for your local time zone.

Build

This could take some time. Be patient. mos build --platform esp32 --local

Flash the firmware

  • Power up the ESP32 device.
  • mos flash
  • In case of problems, try to hold down the 'boot' button during the flashing process and/or explicitly set a port value, e.g. mos flash esp32 --port /dev/tty.SLAB_USBtoUART

Play with the sources :-)

  • init.js is the starting point.
  • Redeploy the altered sources by executing the deploy.sh script.
  • In case of problems, start the mos ui by calling mos ui and observe the log.

Finally

Be aware that my primary coding language is not javascript and I'm not an ESP32 or Mongoose OS expert at all. I'm still learning ESP32 development.

Please feel free to issue a bug report or submit a PR. Any helping hand is welcome.

Useful links:

About

A binary clock driven by an ESP32 microcontroller and a Nextion display, utilizing Mongoose OS and JavaScript technology

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published