Skip to content

Commit e9218fd

Browse files
author
MOK
committed
init
1 parent cc59f1a commit e9218fd

File tree

21 files changed

+1854
-0
lines changed

21 files changed

+1854
-0
lines changed

.github/_stale.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Number of days of inactivity before an issue becomes stale
2+
daysUntilStale: 21
3+
# Number of days of inactivity before a stale issue is closed
4+
daysUntilClose: 7
5+
# Issues with these labels will never be considered stale
6+
exemptLabels:
7+
- architecture
8+
- pinned
9+
# Label to use when marking an issue as stale
10+
staleLabel: stale
11+
# Comment to post when marking an issue as stale. Set to `false` to disable
12+
markComment: >
13+
This issue or pull request has been automatically marked as stale because it has not had
14+
recent activity. It will be closed if no further activity occurs. Thank you
15+
for your contributions.
16+
# Comment to post when closing a stale issue. Set to `false` to disable
17+
closeComment: false

.github/auto-comment.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Comment to a new issue.
2+
pullRequestOpened: |
3+
Thank you for raising your pull request.
4+
5+
To ensure that all licensing criteria is met all repositories of the LVGL project apply a process called DCO (Developer's Certificate of Origin).
6+
7+
The text of DCO can be read here: https://developercertificate.org/
8+
For a more detailed description see the [Documentation](https://docs.lvgl.io/latest/en/html/contributing/index.html#developer-certification-of-origin-dco) site.
9+
10+
By contributing to any repositories of the LVGL project you state that your contribution corresponds with the DCO.
11+
12+
No further action is required if your contribution fulfills the DCO. If you are not sure about it feel free to ask us in a comment.

.github/workflows/ci.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
schedule:
8+
- cron: '0 0 * * 3'
9+
10+
jobs:
11+
Linux:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Install Linux dependencies
15+
run: |
16+
sudo apt-get update
17+
sudo apt-get install libsdl2-dev
18+
19+
- uses: actions/checkout@v2
20+
- uses: actions/setup-python@v1
21+
22+
- name: Install PlatformIO
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install -U platformio
26+
platformio update
27+
28+
- name: Build bare metal (stm32f429_disco)
29+
run: platformio run -e stm32f429_disco
30+
31+
- name: Build emulator (sdl2, 64bits)
32+
run: platformio run -e emulator_64bits
33+
34+
35+
#Linux_i386:
36+
# runs-on: ubuntu-latest
37+
# steps:
38+
# - name: Install Linux dependencies
39+
# run: |
40+
# sudo dpkg --add-architecture i386
41+
# sudo apt-get update
42+
# sudo apt-get install libsdl2-dev:i386 gcc-multilib g++-multilib
43+
#
44+
# - uses: actions/checkout@v2
45+
# - uses: actions/setup-python@v1
46+
#
47+
# - name: Install PlatformIO
48+
# run: |
49+
# python -m pip install --upgrade pip
50+
# pip install -U platformio
51+
# platformio update
52+
#
53+
# - name: Build emulator (sdl2, 32bits)
54+
# run: platformio run -e emulator_32bits
55+
56+
57+
macOS:
58+
runs-on: macos-latest
59+
steps:
60+
- name: Install macOS dependencies
61+
run: |
62+
HOMEBREW_NO_AUTO_UPDATE=1 brew install sdl2
63+
64+
- uses: actions/checkout@v2
65+
- uses: actions/setup-python@v5
66+
67+
- name: Install PlatformIO
68+
run: |
69+
python -m pip install --upgrade pip
70+
pip install -U platformio
71+
platformio update
72+
73+
- name: Build bare metal (stm32f429_disco)
74+
run: platformio run -e stm32f429_disco
75+
76+
- name: Build emulator (sdl2, 64bits)
77+
run: platformio run -e emulator_64bits
78+
79+
80+
Windows:
81+
runs-on: windows-2019
82+
steps:
83+
- name: Activate msys2 & mingw64
84+
run: |
85+
echo "C:\msys64\usr\bin" >> $env:GITHUB_PATH
86+
echo "C:\msys64\mingw64\bin" >> $env:GITHUB_PATH
87+
88+
- name: Install deps
89+
run: |
90+
pacman --noconfirm -S --needed mingw-w64-x86_64-SDL2
91+
gcc --version
92+
93+
- uses: actions/checkout@v2
94+
#- uses: actions/setup-python@v1
95+
96+
- name: Install PlatformIO
97+
run: |
98+
python -m pip install --upgrade pip
99+
pip install -U platformio
100+
platformio update
101+
102+
- name: Build bare metal (stm32f429_disco)
103+
run: platformio run -e stm32f429_disco
104+
105+
- name: Build emulator (sdl2, 64bits)
106+
run: platformio run -e emulator_64bits

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.pio
2+
.pioenvs
3+
.piolibdeps
4+
.clang_complete
5+
.gcc-flags.json
6+
7+
.vscode/.browse.c_cpp.db*
8+
.vscode/c_cpp_properties.json
9+
.vscode/launch.json
10+
.vscode/settings.json
11+
.vscode/ipch

.vscode/extensions.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
// See http://go.microsoft.com/fwlink/?LinkId=827846
3+
// for the documentation about the extensions.json format
4+
"recommendations": [
5+
"platformio.platformio-ide"
6+
],
7+
"unwantedRecommendations": [
8+
"ms-vscode.cpptools-extension-pack"
9+
]
10+
}

README.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
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+

boards/esp32-s3-devkitc1-n8r8.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"build": {
3+
"arduino": {
4+
"partitions": "default_8MB.csv",
5+
"memory_type": "qio_opi"
6+
},
7+
"core": "esp32",
8+
"extra_flags": [
9+
"-DARDUINO_ESP32S3_DEV",
10+
"-DARDUINO_RUNNING_CORE=1",
11+
"-DARDUINO_EVENT_RUNNING_CORE=1",
12+
"-DBOARD_HAS_PSRAM"
13+
],
14+
"f_cpu": "240000000L",
15+
"f_flash": "80000000L",
16+
"flash_mode": "qio",
17+
"psram_type": "opi",
18+
"hwids": [
19+
[
20+
"0x303A",
21+
"0x1001"
22+
]
23+
],
24+
"mcu": "esp32s3",
25+
"variant": "esp32s3"
26+
},
27+
"connectivity": [
28+
"wifi",
29+
"bluetooth"
30+
],
31+
"debug": {
32+
"default_tool": "esp-builtin",
33+
"onboard_tools": [
34+
"esp-builtin"
35+
],
36+
"openocd_target": "esp32s3.cfg"
37+
},
38+
"frameworks": [
39+
"arduino",
40+
"espidf"
41+
],
42+
"platforms": [
43+
"espressif32"
44+
],
45+
"name": "Espressif ESP32-S3-DevKitC-1-N8R8 (8 MB Flash Quad, 8 MB PSRAM Octal)",
46+
"upload": {
47+
"flash_size": "8MB",
48+
"maximum_ram_size": 327680,
49+
"maximum_size": 8388608,
50+
"require_upload_port": true,
51+
"speed": 921600
52+
},
53+
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/user-guide-devkitc-1.html",
54+
"vendor": "Espressif"
55+
}

lib/README

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2+
This directory is intended for project specific (private) libraries.
3+
PlatformIO will compile them to static libraries and link into executable file.
4+
5+
The source code of each library should be placed in a an own separate directory
6+
("lib/your_library_name/[here are source files]").
7+
8+
For example, see a structure of the following two libraries `Foo` and `Bar`:
9+
10+
|--lib
11+
| |
12+
| |--Bar
13+
| | |--docs
14+
| | |--examples
15+
| | |--src
16+
| | |- Bar.c
17+
| | |- Bar.h
18+
| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html
19+
| |
20+
| |--Foo
21+
| | |- Foo.c
22+
| | |- Foo.h
23+
| |
24+
| |- README --> THIS FILE
25+
|
26+
|- platformio.ini
27+
|--src
28+
|- main.c
29+
30+
and a contents of `src/main.c`:
31+
```
32+
#include <Foo.h>
33+
#include <Bar.h>
34+
35+
int main (void)
36+
{
37+
...
38+
}
39+
40+
```
41+
42+
PlatformIO Library Dependency Finder will find automatically dependent
43+
libraries scanning project source files.
44+
45+
More information about PlatformIO Library Dependency Finder
46+
- https://docs.platformio.org/page/librarymanager/ldf.html

0 commit comments

Comments
 (0)