A demo project for ESP32-S3 using LVGL to display stock prices with WiFi configuration and persistent storage.
Most other ESP32 stock price tracker projects require registering for an API account to fetch stock prices.
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...
- For learning purposes.
- The implementation is kept simple and straightforward.
- No fancy stuff, just make it work.
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.
If you need a simple and straightforward API, please check get_stock_price_all_yahoo()
in appController.cpp
.
After serveral test, the above simple API is not very stable, so inevitable to find a stabel API which need to register an account.
Finally, FINNHUB is a good choice which have 60 API call per 1min. That is very good for testing purpose.
Others have very little api call per min.
Don't know why github can't show the gif. You can check the demo in below link:https://i.ibb.co/1fD8GXL8/request.gif
- ESP32-S3 + LVGL GUI v9.1
- WiFi configuration (SSID/Password)
- Stock price fetching from Yahoo Finance
- Persistent storage (NVS)
- Software reset and storage reset
- Responsive UI with FreeRTOS tasks
- VS Code with PlatformIO extension
- ESP32-S3 board + 2.8" TFT LCD
- The hardware was purchased from Taobao. Hardware info: ESP32-LVGL开发板
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.
- Using ESP32-S3-N8R8
- LCD Driver: ST7989, 320 x 240 pixels
- Touch Driver: XPT2046
-
Clone this repository:
git clone <your-repo-url>
-
Open the project in PlatformIO.
-
Rename the
API_TOKENS.h.example
toAPI_TOKENS.h
and fill your own FINNHUB api tokens -
Build and upload to your ESP32-S3 board.
- On first boot, configure WiFi via the GUI.
- Press "Update" to fetch stock prices.
- Use the AP Settings tab to change WiFi credentials.
- Use the Reset button to clear storage and reboot.
lib/
appController/ # Main application logic
stockPrice/ # GUI code
storage/ # Persistent storage (NVS)
src/
main.cpp # Entry point
- Edit
s_Symbols
instock_price_gui.cpp
to change the tracked stocks.
- Multi-language support (English/Chinese)
- Add color themes
- Update the Arduino framework (currently using IDF v4.4)
- Create a database and save to SD card; display charts on screen
- Many areas can be further optimized...
MIT License