check in
Completed

[LiClock] Programmable Ink-screen Clock

PRO[LiClock] Programmable Ink-screen Clock

tag

424
0
0
0
Mode:Full

License

Public Domain

Creation time:2024-10-09 01:55:58Update time:2024-10-12 08:59:17

Description

A 2.9-inch programmable ink screen weather clock based on ESP32

 

Project Description

There are many 2.9-inch weather clocks that can be found on the Internet, but some have many functions but are not open source, and some open source have fewer functions.
There are also those who do not use the EDA design of JLC and cannot enjoy the discounts of JLC.
In order to allow everyone to quickly DIY their own ink screen weather clock, and let everyone participate in the development,
In order to complete the Lua interpreter that was left unfinished in the "Campus Life Aide 7" project.
I decided to use my summer vacation to design an ink screen weather clock that is scalable, DIY-friendly, full-featured, and low-cost.

Github warehouse click here

The introductory video has been released, click here

Firmware Burn/Update, click here

The latest information will be posted on Github later, this page was last updated on January 18th, 2024 10:38.
HW3.0 hardware has been updated.
 

Open-source Protocol

The EDA project is licensed under CC-BY-SA 3.0, wherein:
CC: Abbreviation for Creative Commons license
BY: Attribution, you must give appropriate attribution, provide a link to this License, and indicate whether or not changes have been made (to the original work).
SA: ShareAlike, if you remix, transform, or create based on the Work, you must share and distribute your Contribution under the same license as the original license.
The source code is licensed under GPL-3.0, which allows commercial use under open source, but please indicate the original author and the link to the project, and the source code shall not be sold or released as a closed-source project.
In addition, according to the GPL-3.0 license, if the code derived from this project is shared or commercialized, it must be open source in GPL3.0 and declared in a conspicuous place.
Open source here means that anyone can freely and freely obtain and modify the source code and/or hardware engineering source files.
In addition, because the API of Caiyun Weather is used, it is only for learning and research, and if it needs to be commercialized, it must not contain this source code or the binary files generated by it.
 

Project-related Features

The backend of this project was developed using Arduino (C++ PlatformIO) and ported to the Lua interpreter for graphical programming code.
The main design features are as follows:
  1. Get the local weather and display it through the Colorful Cloud Weather API.
  2. The ESP32 internal RTC is used to provide the clock signal, and the linear offset is compensated by two NTP synchronizations, and the daily error can be less than 2 seconds.
  3. The built-in web server is used to configure weather locations, manage internal files, and more.
  4. Built-in GUI framework, including dialogs, menus, etc.
  5. Easy e-book functionality.
  6. Bilibili fan display.
  7. Complete settings menu.
  8. Play transcoded Midi music through the buzzer.
  9. Simple alarm clock.
  10. The built-in Blocky graphical development environment allows you to add functionality to it as long as you have a browser.
The core objectives of this project are ease of use and redevelopment:
  1. The system framework is decoupled from the App, and the source code of each "App" is a single cpp file, which is automatically recognized and compiled and added to the App list after being copied to the App directory without other modifications. Peripherals such as TF cards and sensors are automatically recognized when the machine is turned on for the first time, and are managed by the system in a unified manner, and automatically power off when not in use (the sensor enters the power-saving mode)
  2. The app is event-driven, with a relatively complete GUI framework, which can quickly implement the desired function, and in addition, built-in apps such as e-book apps consume the same power as when the screen is not refreshed and when the screen is turned off (note: the GUI framework does not enter sleep mode while waiting for user input)
  3. There is no need to configure API KEY, no need to manually set clock error correction, no need to manually configure Bilibili UID (mobile phone scan code login), just fill in the weather GPS coordinates (GCJ-02) and WiFi password.
  4. For those who don't know how to configure the environment, full-featured binaries are provided, and all functions can be experienced by direct burning.
  5. Built-in Lua language interpreter and Google Blockly development environment, AP can be written through lua languageP, run directly after uploading on the web side, and at the same time, it can be seamlessly added to the App list, set as the home screen App, etc.
In terms of security and stability
  1. The PCB is designed with an automatic power switching circuit, so there is no need to worry about the danger caused by the battery cycle charging and discharging.
  2. The software will automatically shut down if it is not operated for a certain period of time to avoid battery drain (only limited to the App selection interface and network reconfiguration interface, and other places that need to be confirmed by the user will not automatically sleep)
  3. At the same time, it is also designed with a power detection function.
  4. In case of an infinite restart, you can press and hold the left button first, and then press the reset button on the back, which will immediately turn off the device and avoid frequent flashes burning out the screen.

 

Project Properties

This project is the first public and is my original project. The project has not won an award in another competition.
 

Project Progress

  • 2023/07/24 Functional design, development board purchase.
  • 2023/07/27 The functional feasibility analysis has been completed, and the basic development idea has been determined.
  • 2023/08/06 The functional test of each circuit module has passed.
  • 2023/08/08 Create an EDA project.
  • 2023/08/09 Component selection is completed, PCB design is completed, and production is awaiting review.
  • 2023/10/02 Open source to Github.
  • 2023/10/17 Completion of project introduction.

 

Design Principles

The hardware part is relatively simple. Except that the automatic power switching circuit was found on the Internet, I don't know the principle, but it can be used, and it is very stable.
Overall block diagram:
The AppManager class manages the lifecycle of all apps, including Lua apps.
The HAL class is a hardware-related function, and provides services such as automatic connection to WiFi and NTP synchronization.
The Periphal-like class manages installed peripherals and turns them on and off (or enters and exits power-saving mode) as needed while the app is running.
The Lua interpreter explains how to run the Lua App and dynamically add and remove the App.
FreeRTOS is a real-time operating system for ESP-IDF, which is mainly used here to implement multithreading.
 

Software Description

The system mainly runs the following three tasks: 
AppManager: used to execute app code to determine the next sleep time.
HAL: Automatically updates time and battery voltage, and handles button events.
Lua debugging: This is created when you debug Lua on the web side, so that you can immediately end the program when you need it, and prevent the Lua process from blocking the web server.
The following steps are performed to initialize the system:
 

Physical Display

Back

Main page

(precipitation in the lower shade)

Warning message

(press any key to return)

App selection

(press and hold the middle button in any app other than the e-book app, or select any app as the home screen app in the settings)

Complete settings menu

Scan the QR code to connect to the hotspot for configuration

(you can also manually enter the password or use SmartConfig)

E-book

(long press the left button to the previous page, long press the right button to the next page, continue to press and hold the right button to enter the menu)

Bilibili QR code login

(Got cookies.,The rest of the functions are up to everyone , actually because I don't know how to design UI [doge])

Simple Bilibili follower display interface

(UI is very simple, but the function exceeds 80% of works on the Internet)

The peripherals are automatically detected.

(Can be used to verify that the sensor is correctly welded)

 

--Introduction to Blockly IDE--

This feature was also developed to solve the problem of customizing watch faces.

You can modify the code at any time, share projects with each other, and reduce the compilation and upload time required for debugging.

Web (you can use "building blocks" on the left to program, or directly edit Lua code, but do not support reverse conversion of Lua to Blockly)

Using WebSocket for terminal functionality, lua output and error messages will be redirected here.

Lua runs the results

App creation

The created App, except that it can be uninstalled or installed from the TF card, is completely no different from the built-in App (the built-in App is based on C++)

For more information, please refer to the Github Readme.

File management

Preview the "lbm" image file

(essentially xbm binary, you can save it in xbm format with GIMP, and then use the xbm to lbm tool in the tools directory of GitHub repository)

Lua has implemented relative directories (if you need to access the resource file, please put it in the webtmp folder, it will be copied when you create the App, support . Indicates the current directory and does not support: folder)

The SD card is mounted to /SD/, and the built-in littlefs is mounted to /littlefs.

Buzzer supports playing .buz files (python programs from midi to buz are also placed in the tools directory of GitHub)

More Lua functions are being added, and you are also welcome to contribute your own code or project files.

 

DIY Considerations

This time, the BOM is very complete, and you can buy it directly

After small batch production test, the hardware has no BUG, if the program can not be burned into the problem can only be soldered well.

The HW3.0 hardware has fixed all the previously mentioned problems, and the software only supports version 2.0 and above.

If a connector is selected for the battery interface, it may not fit into the housing.

The entire page of the schematic "Optional Functions" can be left unsoldered, and the system will automatically identify what is soldered.

ESP32 can use the ESP32-WROOM series, and the system will automatically adjust the LittleFS partition size according to the remaining Flash capacity.

Don't buy an ESP32 with PSRAM!!

After soldering, burn the program and follow the OOBE configuration.

A key to burn the latest firmware: https://diylxy.github.io/LiClockWebFlash/

The latest source code and compiled firmware are at the top of this page.

(The attachment contains the source code updated on December 2, 2023 in accordance with the requirements of the open source platform)

The 3D model is also available in the Github repository.

If you think the project is good, don't forget to like and collect, thank you!

Designed by 小李电子实验室 (from OSHWHub)

a:https://oshwhub.com/lxu0423/ESP32-duo-gong-neng-mo-shui-ping

Design Drawing

Download File
The preview image was not generated, please save it again in the editor.

Attachments

OrderFile nameDownload times
1
Introduction_1.mp4
923
2
Source Code.zip
3483
Add to Album
0
0
Share
Report

Comment

All Comments(1)
Sort by time|Sort by popularity
Followers0|Likes0
Related projects
Empty

Bottom Navigation