Skip to content

Repository files navigation

StickS3 Stock Monitor

A pocket market board for M5Stack StickS3.

Ten quotes on one screen, motion-assisted controls,
adaptive landscape viewing, and compact stock charts.

Overview · v0.8.12 · Quick start · Controls · Build · Privacy · 简体中文

CI Hardware: M5Stack StickS3 Framework: PlatformIO and Arduino Version: 0.8.12 License: MIT

Current version

Version 0.8.12 is the current development snapshot. It prevents cached HTTP responses and mixed-age partial batches from being presented as current quotes, uses the market provider's update time in stock details, and labels stale, offline, and updating data states directly in the status bar. The home screen is now interactive immediately while Wi-Fi connects in the background. Intraday charts preserve the full trading-day timeline, and each setup session uses a newly generated access-point password shown only on the device.

Released on August 12, 2026. Download the application-only update, full-install image, and checksums from GitHub Release v0.8.12.

Overview

StickS3 Stock Monitor turns the compact StickS3 display into a glanceable market board. Quotes, controls, configuration, and cached data live on the device; no account or market-data API key is required for the default quote source.

Promotional render of the StickS3 Stock Monitor startup screen

Note

The three device images in this README are promotional renders. They illustrate the intended product experience but are not pixel-accurate screenshots or evidence of broad hardware testing.

Capability What it does
01 One-page watchlist Shows up to ten stocks with name, price, and percentage change.
02 Adaptive display Uses a detailed portrait board and a read-only two-column landscape board.
03 Stock detail Provides intraday, five-day, daily, weekly, and monthly views with volume.
04 Device-first controls Supports both buttons plus BMI270 tilt selection with neutral re-arm.
05 Local persistence Remembers Wi-Fi, watchlist, brightness, refresh interval, and cached quotes in NVS.

Supported markets

The officially supported scope is mainland China A-shares with six-digit codes:

Market Prefix Examples
Shanghai Stock Exchange sh sh600519, sh601398
Shenzhen Stock Exchange sz sz000858, sz300750
Beijing Stock Exchange bj bj920185, bj430047

Major mainland indices exposed by the same public provider can also appear in a watchlist. Hong Kong and U.S. stocks are not part of the supported product scope. Legacy hk and us parser paths remain only so an older saved list does not fail abruptly; availability, quote fields, chart behavior, and refresh timing are not guaranteed for those markets.

Device experience

Portrait market board

Promotional render of the portrait market board

  • One fixed page with up to ten rows; no page indicator or hidden second page.
  • Four-character Chinese stock names, current prices, and red-up/green-down percentage changes.
  • Time, trading phase, Wi-Fi state, battery percentage, and battery icon in the status bar.
  • Add, Delete, and Sort actions in the bottom toolbar. The selection outline disappears after ten seconds without confirmation.

Landscape market board

Promotional render of the landscape market board

  • Automatically switches to two columns with five stocks per column.
  • Uses native-size Chinese glyphs with no stretching or synthetic narrowing.
  • Landscape is view-only: buttons, motion selection, voice input, and reset actions are suspended until the device returns to portrait.

Stock detail

  • Short-press the blue button to cycle Intraday → Daily → Weekly → Monthly → Five-day.
  • Intraday and five-day views use a white trend line.
  • The intraday x-axis follows the complete 09:30–11:30 / 13:00–15:00 session; at the lunch break, the morning line stops halfway and the afternoon half remains empty.
  • Daily, weekly, and monthly views use red-up/green-down OHLC candles.
  • Volume bars appear below the price chart.
  • Short-press the side button to open the next stock; hold the blue button to return to the market board.

Requirements

Item Requirement
Hardware M5Stack StickS3 with an ESP32-S3-PICO-1, 8 MB flash, and PSRAM
Network 2.4 GHz Wi-Fi with Internet access
Build system PlatformIO Core with Espressif32 platform 6.12.0
Framework Arduino for ESP32; C++17
Main library M5Unified pinned to commit 4fb4447
Market source Tencent Finance public UTF-8 endpoints; availability and delay are not guaranteed
Official market scope Mainland China A-shares on the Shanghai, Shenzhen, and Beijing exchanges

Quick start

1. Clone and build

git clone https://github.com/oliverxing2025/StickS3-Stock-Monitor.git
cd StickS3-Stock-Monitor
PLATFORMIO_BUILD_DIR=/tmp/sticks3-stock-monitor-build \
  pio run -e sticks3-stock-monitor

Keeping the build directory outside a cloud-synced checkout avoids storing large generated files in the project folder.

2. Install or update firmware

The project uses one factory application partition and does not reserve a second application or OTA slot.

Artifact Offset Purpose
firmware.bin 0x10000 Application-only update for an already matching Stock Monitor layout; preserves NVS when written only at this offset
sticks3-stock-monitor-merged.bin 0x0 Full standalone installation; replaces the existing firmware layout

Warning

Verify the physical device identity, partition table, image, and write offset before flashing. Back up the complete live NVS partition before a full or layout-changing installation. Never use the merged image as a routine update for a device that contains another firmware layout.

For a first standalone installation, PlatformIO can build and upload the matching layout:

PLATFORMIO_BUILD_DIR=/tmp/sticks3-stock-monitor-build \
  pio run -e sticks3-stock-monitor -t upload --upload-port <port>

Wait for Hash of data verified, then monitor the device at 115200 baud and confirm StickS3 Stock Monitor 0.8.12 and app0 @ 0x00010000.

3. Configure Wi-Fi

  1. Power on the device and press the blue button on the startup screen.
  2. With no saved network, the device opens a StickS3-Stock-XXXX 2.4 GHz setup access point. Connect a phone to it using the one-time setup password shown on the StickS3 screen. This password is not your router password.
  3. Open the captive portal. If it does not appear automatically, browse to http://192.168.4.1 while the phone is still connected to the setup access point.
  4. Select or enter a 2.4 GHz Wi-Fi network, enter its password, review the A-share watchlist, and choose Save and restart.
  5. The device restarts and reconnects to the saved network automatically. The market board and motion controls become available immediately; quote refresh begins after Wi-Fi connects in the background.

To change networks, rapidly click the side button four times, reconnect the phone to the setup access point, and save the new credentials. Leaving the password field blank preserves the previously saved router password. The portal also provides Clear Wi-Fi; holding both device buttons for five seconds restores defaults.

Warning

Configure the device in a trusted physical location. The setup password is regenerated each time the portal opens, but this build stores the selected Wi-Fi name and password in local NVS without enabling NVS encryption. Do not publish NVS dumps, serial logs, portal screenshots, or a filled StockVoiceSecrets.h.

Controls

Market board

Input Action
Side button, short press Activate the toolbar, then cycle Add, Delete, and Sort
Blue button, short press Enter the selected toolbar action; when the toolbar is inactive, open the selected stock
Side button, four rapid clicks Open Wi-Fi and watchlist setup
Tilt left/right Select Add, Delete, or Sort using the toolbar motion mode
Tilt forward/back Select the previous or next stock; return to neutral before the next move
Blue button, hold and release Record and submit a stock voice command when the local voice bridge is configured
Both buttons, hold for five seconds Clear saved settings and restore defaults

Add, delete, and reorder

Screen Controls
Add Side button or forward/back tilt changes a digit; blue advances; after six digits the device resolves and displays the stock name
Add confirmation Short-press blue to add; side cancels
Delete Side button or forward/back tilt selects a stock; blue opens confirmation; hold blue to save and leave the screen
Delete confirmation Blue confirms; side cancels
Reorder Forward/back tilt selects; blue moves the stock up; side moves it down; hold blue to save and exit
Stock detail Blue cycles chart periods; side opens the next stock; hold blue to exit

Motion input follows a filtered BMI270 scheme with axis dominance, a dead zone, neutral re-arm, and pickup baseline recovery. A short tone confirms selection.

Quotes, charts, and refresh behavior

The firmware fetches configured symbols in one cache-bypassed request and matches each quote by symbol rather than response order. Every response is parsed into a clean batch, so a missing symbol can never retain an older price while the screen is marked fresh. Missing symbols are immediately requested again on their own; unresolved rows display as unavailable and trigger a later retry. Only complete batches are cached. A cached startup snapshot is explicitly labelled as old data until a complete live update succeeds.

Refresh timing adapts to mainland China trading sessions:

Phase Refresh behavior
Opening/closing auction Every 5 seconds
Continuous trading User-selected 5, 10, 30, or 60 seconds
Lunch break Every 60 seconds
After close Every 5 minutes
Weekend Every 10 minutes

The clock uses CST-8 by default. Before NTP succeeds, firmware build time is used as a temporary clock seed; a successful NTP sync is saved to the device RTC.

Voice commands

Voice input is optional. It requires Wi-Fi plus a compatible local VibeStick-Codex Bridge with an ASR adapter. Repository source and the default build do not contain a real bridge address, token, or ASR key.

Copy the example, enter local-only values, and rebuild:

cp include/StockVoiceSecrets.example.h include/StockVoiceSecrets.h

include/StockVoiceSecrets.h is ignored by Git. Supported results include adding or deleting a stock, sorting by gain or loss, restoring custom order, and refreshing quotes. Recognition depends on the configured ASR provider and is not an offline device feature. The build never imports credentials from a sibling project; voice remains disabled unless this project-local file exists.

Web configuration

The captive portal can scan nearby Wi-Fi networks and edit:

  • network name and password;
  • 5/10/30/60-second trading refresh interval;
  • 20%–100% brightness;
  • time zone;
  • up to ten watchlist entries in symbol,alias format;
  • default watchlist restoration or saved Wi-Fi removal.

The on-device numeric Add screen accepts six-digit mainland A-share codes and infers sh, sz, or bj. The web page accepts the same normalized prefixes. Legacy hk and us entries may still parse for migration compatibility, but they are not officially supported.

Build and firmware

Run all host tests:

PLATFORMIO_BUILD_DIR=/tmp/sticks3-stock-monitor-native-test \
  pio test -e native

Build application and merged images plus SHA-256 checksums:

PLATFORMIO_BUILD_DIR=/tmp/sticks3-stock-monitor-release \
  ./scripts/build_release.sh

Generated binaries are intentionally ignored by Git. Review and publish them only as explicit GitHub Release assets after hardware verification.

Project structure

include/                    Models and compile-time configuration
src/board/                  StickS3 display, IMU, battery, audio adapters
src/config/                 NVS settings and watchlist parsing
src/input/                  Button, motion, and orientation state machines
src/network/                Wi-Fi reconnect logic and captive portal
src/stocks/                 Quotes, history, formatting, and market schedule
src/ui/                     Portrait, landscape, detail, and setup rendering
src/voice/                  Optional local voice-bridge client
test/                       Native parser, schedule, and orientation tests
scripts/                    Build and merged-image helpers
partitions_single_app_8MB.csv  Dedicated one-application partition table

Persistence and privacy

  • Wi-Fi credentials, watchlist, brightness, time zone, and cached quotes are stored in the device's local NVS partition. NVS encryption is not enabled by this build, so physical flash access must be treated as credential access.
  • Real Wi-Fi passwords, bridge tokens, ASR keys, recordings, and raw responses must never be committed.
  • Normal serial output reports only aggregate quote-refresh counts, not the user's individual watchlist symbols or prices.
  • The setup access-point password is generated in memory each time the portal opens, shown only on the device, and is not saved to the repository or NVS.
  • The default quote client contacts Tencent Finance over the Internet.
  • Optional voice recordings are sent to the locally configured bridge, which may then contact the ASR provider selected by the owner.
  • A raw NVS backup is device-specific private data and must remain outside Git.

Limitations

  • Public market endpoints may change, throttle requests, delay data, or omit a symbol without notice. This device is not a trading terminal.
  • Only mainland China A-shares are supported. Legacy Hong Kong and U.S. symbol parsing is not a guarantee of market-data or chart compatibility.
  • Voice commands require a separately configured local bridge and ASR service.
  • The landscape board is intentionally view-only.
  • The current release path has been verified on the development StickS3, but has not completed repeated testing across a broad hardware sample. Please open a GitHub issue with reproducible logs if you encounter a problem.

License

Released under the MIT License. See THIRD_PARTY_NOTICES.md for dependency notices.

About

Portrait stock monitor firmware for M5Stack StickS3

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages