|
| 1 | +# ESP32-S3 LVGL Yet Another Stock Price Tracker |
| 2 | + |
| 3 | +A demo project for ESP32-S3 using [LVGL](https://lvgl.io/) to display real-time stock prices with WiFi configuration and persistent storage. |
| 4 | + |
| 5 | +Most other ESP32 stock price tracker projects require registering for an API account to fetch stock prices. |
| 6 | + |
| 7 | +For me, I wanted a simple implementation. So I found a usable API from Yahoo, which may be blocked in the future, but works for now... |
| 8 | + |
| 9 | + |
| 10 | +## Project Core Values |
| 11 | + |
| 12 | +- For learning purposes. |
| 13 | +- The implementation is kept simple and straightforward. |
| 14 | +- No fancy stuff, just make it work. |
| 15 | + |
| 16 | +## How You Can Help |
| 17 | + |
| 18 | +Around 80% of the code is generated by AI. The most time-consuming task was finding a proper and simple API to get the stock price. |
| 19 | + |
| 20 | +If you need a simple and straightforward API, please check `get_stock_price_all_yahoo()` in `appController.cpp`. |
| 21 | + |
| 22 | + |
| 23 | +## Screenshots & Demo |
| 24 | + |
| 25 | +<a href="https://ibb.co/TSN560p"><img src="https://i.ibb.co/TSN560p/ap-Setting.jpg" alt="AP Setting" border="0"></a> |
| 26 | +<a href="https://ibb.co/VWYbDJCz"><img src="https://i.ibb.co/VWYbDJCz/device-Info.jpg" alt="Device Info" border="0"></a> |
| 27 | +<a href="https://ibb.co/Kzx6xyb1"><img src="https://i.ibb.co/Kzx6xyb1/homepage2.jpg" alt="Homepage" border="0"></a> <a href="https://ibb.co/d0dG4prG"> |
| 28 | + |
| 29 | + |
| 30 | +<img src="https://i.ibb.co/1fD8GXL8/request.gif" alt="Request Demo" border="0"></a> |
| 31 | + |
| 32 | +## Features |
| 33 | + |
| 34 | +- ESP32-S3 + LVGL GUI v9.1 |
| 35 | +- WiFi configuration (SSID/Password) |
| 36 | +- Stock price fetching from Yahoo Finance |
| 37 | +- Persistent storage (NVS) |
| 38 | +- Software reset and storage reset |
| 39 | +- Responsive UI with FreeRTOS tasks |
| 40 | + |
| 41 | +## Getting Started |
| 42 | + |
| 43 | +### Prerequisites |
| 44 | + |
| 45 | +- VS Code with [PlatformIO](https://platformio.org/) extension |
| 46 | +- ESP32-S3 board + 2.8" TFT LCD |
| 47 | + - The hardware was purchased from Taobao. Hardware info: [ESP32-LVGL开发板](http://wiki.waaax.cn/boards/ESP32/ESP32-LVGL%E5%BC%80%E5%8F%91%E6%9D%BF.html) |
| 48 | + > **Note:** It is not recommended to buy this dev board. It has some hardware issues and may reset automatically, especially when connected to a PC. |
| 49 | + - Using ESP32-S3-N8R8 |
| 50 | + - LCD Driver: ST7989, 320 x 240 pixels |
| 51 | + - Touch Driver: XPT2046 |
| 52 | + |
| 53 | + |
| 54 | +### Building & Flashing |
| 55 | + |
| 56 | +1. Clone this repository: |
| 57 | + ```sh |
| 58 | + git clone <your-repo-url> |
| 59 | + ``` |
| 60 | + |
| 61 | +2. Open the project in PlatformIO. |
| 62 | + |
| 63 | +3. Build and upload to your ESP32-S3 board. |
| 64 | + |
| 65 | +### Usage |
| 66 | + |
| 67 | +- On first boot, configure WiFi via the GUI. |
| 68 | +- Press "Update" to fetch stock prices. |
| 69 | +- Use the AP Settings tab to change WiFi credentials. |
| 70 | +- Use the Reset button to clear storage and reboot. |
| 71 | + |
| 72 | +## File Structure |
| 73 | + |
| 74 | +``` |
| 75 | +lib/ |
| 76 | + appController/ # Main application logic |
| 77 | + stockPrice/ # GUI and stock price logic |
| 78 | + storage/ # Persistent storage (NVS) |
| 79 | +src/ |
| 80 | + main.cpp # Entry point |
| 81 | +``` |
| 82 | +
|
| 83 | +## Customization |
| 84 | +
|
| 85 | +- Edit `s_Symbols` in `stock_price_gui.cpp` to change the tracked stocks. |
| 86 | +
|
| 87 | +
|
| 88 | +## Future Plans |
| 89 | +
|
| 90 | +- Multi-language support (English/Chinese) |
| 91 | +- Add color themes |
| 92 | +- Update the Arduino framework (currently using IDF v4.4) |
| 93 | +- Create a database and save to SD card; display charts on screen |
| 94 | +- Many areas can be further optimized... |
| 95 | +
|
| 96 | +## License |
| 97 | +
|
| 98 | +MIT License |
| 99 | +
|
0 commit comments