Giter Site home page Giter Site logo

aschuma / esp32_nextion_js_binary_clock Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 12.22 MB

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

License: MIT License

JavaScript 97.46% Shell 2.54%
javascript esp32 esp8266 mongoose-os iot uart mjs nextion-display nextion clock

esp32_nextion_js_binary_clock's Introduction

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:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.