{"id":18538970,"url":"https://github.com/simonthorell/esp32-lvgl-hid","last_synced_at":"2026-04-24T16:03:18.360Z","repository":{"id":222638804,"uuid":"749787724","full_name":"simonthorell/esp32-lvgl-hid","owner":"simonthorell","description":"ESP32 firmware with GUI for LCD display, HID support, Wi-Fi, and MQTT. It incorporates AES encryption and supports Firmware Over-The-Air (OTA) updates.","archived":false,"fork":false,"pushed_at":"2024-02-10T08:43:14.000Z","size":3917,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-15T02:13:20.802Z","etag":null,"topics":["c","embedded-gui","esp32","firmware-over-the-air","mqtt-client","wifi-security"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simonthorell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-01-29T11:56:59.000Z","updated_at":"2025-01-04T22:34:00.000Z","dependencies_parsed_at":"2024-02-15T12:24:47.958Z","dependency_job_id":"d55a604c-ae21-452a-8812-eff17629b092","html_url":"https://github.com/simonthorell/esp32-lvgl-hid","commit_stats":null,"previous_names":["simonthorell/esp32-lvgl-hid"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/simonthorell/esp32-lvgl-hid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonthorell%2Fesp32-lvgl-hid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonthorell%2Fesp32-lvgl-hid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonthorell%2Fesp32-lvgl-hid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonthorell%2Fesp32-lvgl-hid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonthorell","download_url":"https://codeload.github.com/simonthorell/esp32-lvgl-hid/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonthorell%2Fesp32-lvgl-hid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32230421,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","embedded-gui","esp32","firmware-over-the-air","mqtt-client","wifi-security"],"created_at":"2024-11-06T19:45:41.579Z","updated_at":"2026-04-24T16:03:18.345Z","avatar_url":"https://github.com/simonthorell.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# _ESP32 LVGL HDI_\n\n## Overview\nThis repository provides a robust starting point for developing GUI applications on the LilyGo T-Display-S3 ESP32 MCU. Leveraging the capabilities of the ESP32-S3 microcontroller and the powerful LittlevGL (LVGL) graphics library within the ESP-IDF framework, this template is designed for high performance and reliability.\n\n### Features\n- **Display Interface:** Configuration for a 1.9\" ST7789 LCD Screen, demonstrating the integration and usage of LVGL with the ESP32.\n- **Keyboard Connectivity:** Support for connecting a keyboard using USB HID, enhancing user interaction capabilities.\n- **Secure Wi-Fi Connection:** Implements secure Wi-Fi communication, ensuring data protection and network integrity.\n- **TLS MQTT Connection:** Utilizes TLS for MQTT connections, safeguarding message confidentiality and integrity. This includes CA certificate verification for trusted communication.\n- **AES256 End-to-End Encryption:** Employs AES256 encryption for end-to-end data security, ensuring that sensitive information remains confidential and tamper-proof during transmission.\n- **Firmware Updates Over the Air (FOTA):** Supports FOTA, enabling seamless and secure firmware updates, ensuring that the device can receive the latest features, improvements, and security patches remotely and with minimal downtime.\n\nWith these features, the repository offers a comprehensive suite for developing advanced GUI applications, focusing on security, user experience, and ease of maintenance.\n\n## Pre-requisites\n- Install [ESP-IDF](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html)\n- Install [VSCode](https://code.visualstudio.com/)\n- Install [ESP-IDF Extension for VSCode](https://marketplace.visualstudio.com/items?itemName=espressif.esp-idf-extension)\n- Install [SquareLine-Studio](https://squareline.io/downloads)\n\n## Microcontroller\n- ESP32-S3 with 1.9\" ST7789 LCD Screen (Example pre-built version: LILYGO T-Display-S3)\n\n## Template Setup\nThis template was created using the following steps:\n\n### 1. Setup IDF command line\n- This is only tested and working on Apple Silicon macOS using `.zsh` shell.\n    ```bash\n    # Edit your shell profile\n    nano ~/.zshrc\n\n    # Add the following lines\n    alias get_idf='. $HOME/esp/esp-idf/export.sh'\n    export IDF_PATH=\"$HOME/esp/esp-idf:$PATH\"\n    export PATH=\"$HOME/esp/esp-idf/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin:$PATH\"\n    export PATH=\"$HOME/esp/esp-idf/tools:$PATH\"\n    ```\n\n### 2. Create a New Project from Template:\n  - Read the following [link](https://components.espressif.com/components/espressif/esp_lvgl_port?language=en).\n  - Use a shell to `cd` to the folder were you want to create your project folder.\n      ```bash\n      # Get the idf-tools\n      get_idf\n\n      # Create the project using the template\n      idf.py create-project-from-example \"espressif/esp_lvgl_port^1.4.0:touchscreen\"\n      idf.py add-dependency \"espressif/usb_host_hid^1.0.2\"\n      ```\n\n### 3. Setup VSCode Configuration: [optional]\n- Create the file `c_cpp_properties.json` in .vscode folder and add necessary configurations.\n\n### 4. Version Control:\n  - Create a new repository on GitHub for your project.\n  - Initialize git in your project folder:\n    ```bash\n    git init\n    git add .\n    git commit -m \"Inital commit and build\"\n    ```\n  - Create a development branch [Recommended]\n    ```bash\n    git checkout -b dev\n    ```\n  - Once you are ready for next build you make a Pull Request from dev branch on Github and merge it into the main branch.\n\n## Build GUI using SquareLine Studio\n### 1. Add Board\n- Compress the `main` folder inside the project directory. \n  - On macOS you can just: **right click -\u003e Compress Folder**\n  - Rename the folder to `t_display_s3.zip`\n- Locate the `boards` folder and copy the `t_display_s3` folder.\n- In your applications folder (if using macOS), find your SquareLine Studio installation, right click `Show Package Contents` then find the `boards` folder and create a new folder called `LilyGo`.\n- Paste the folder from your clipboard into this folder as well as the .zip folder you created.\n\n### 2. Create GUI\n- When you open SquarLine Studio you should now se a tab called **LilyGO** under **Create**.\n- Once the project is opened, click on **Export -\u003e Create Template Project** and first create a folder called `squareline` in the project folder (included in .gitignore), and when prompted for **Export To** choose the `main/ui` folder in the project folder.\n\n### 3. Export GUI\n- Export the `.ui` files by clicking **Export -\u003e Export UI Files**.\n- Save  \n\n## Build Project \u0026 Flash to ESP32\n- *TODO: Replace this with .devcontainer and GitHub Actions for auto-build and firmware update release!*\n- Move into project folder, build \u0026 flash using the idf.py tool.\n  ```bash\n  get_idf                                      # Get ESP-IDF tools\n  idf.py build                                 # Build to project with GUI\n  idf.py -p /dev/cu.usbmodem1101 flash monitor  # Flash and monitor (replace with your USB-port)\n  ```\n- If you do not like to monitor the output just use:\n  ```bash\n  idf.py -p /dev/cu.usbmodem1101 flash  # Flash and monitor (replace with your USB-port)\n  ```\n- If you need to clean the project you can use the following commands:\n  ```bash\n  idf.py clean\n  idf.py fullclean\n  ```\n\n## Build Your Project *(using VSCode extension)* [optional]\n- Press `CMD + Shift + P` and type `ESP-IDF: Build your Project`\n- [Optional] to clean build folder press `CMD + Shift + P` and type `ESP-IDF: Full Clean Project`\n- [Optional] setup a .devcontainer and use GitHub actions to build automatically when merging to main branch. \n\n## Flashing and Monitoring *(using VSCode extension)* [optional]\nAfter building the project, flash it to your ESP32-S3 and monitor the output:\n- Press `CMD + Shift + P` and type `ESP-IDF: Flash (UART) your Project`\n\n- [alternatively] flash it from the command line using idf.py\n```bash\nidf.py -p (YOUR_PORT) flash monitor\n# Press Ctrl+Å to close (Nordic keyboard)\n```\n\n## Setup Firmware Over The Air (FOTA)\n- See file `partition_table.csv` and main folder as well as `firmware.bin` and `firmware.json`in the bin-folder.\n- In `ESP-IDF menuconfig` search for *\"Partition table\"*. In this project option 2 is used as the firmware is larger than the standard size of 1 MB.\n  - Option 1. Use *\"Factory app, two OTA definitions\"* to use standard partition size (1MB per partition). \n  - Option 2. Use *\"Custom partition table CSV\"* and add the `partition_table.csv` file. You can edit the size of the partitions directly in this file depending on your specific ESP32 microcontroller.\n- The firmware check is done in the FreeRTOS task: *\"fota_task\"* defined in `main.c`. For details of implementation, see the file `esp_firmware.c`.\n- In the src `CMakeLists.txt`, the following has to be added to the **REQUIRES**: `esp_http_client esp_https_ota json` under **idf_component_register**.\n- When building the project, `check_and_copy.cmake` and src `CMakeLists.txt` will find and copy the built .bin-file to the firmware folder automatically.\n- Update the paths in `main.cpp` and `firmware.json` to your own firmware update path. In this project we use GitHub only.\n- When you are ready to release and push the firmware update, change the version numbers in `main.cpp` and `firmware.json` - then commit to main branch. Monitor the MCU over UART to check that the device is correctly requesting and getting the latest update. \n- Once the MCU has downloaded and installed the new firmware, it will reboot to the opposite ota partition and display firmware version on the LCD.\n\n## Known Issues\n### 1. Crash on Simultaneous Button Presses\n- **Issue Description:** ESP32 may crash occasionally when multiple buttons are pressed simultaneously. Potential causes include inadequate debounce handling in the `espressif/button` library or task-related conflicts.\n- **Impact:** This issue affects applications relying on multi-button interactions.\n- **Status:** Currently under investigation. Future updates or fixes will be documented.\n\n## Contributing\nContributions are welcome! \nIf you have improvements or bug fixes, feel free to fork the repository and submit a pull request.\n\n## License\nDistributed under the MIT License. See [LICENSE.md] for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonthorell%2Fesp32-lvgl-hid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonthorell%2Fesp32-lvgl-hid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonthorell%2Fesp32-lvgl-hid/lists"}