Skip to content

semichcsc-byte/openchess

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

OpenChess β€” Smart Chess Board (Nano RP2040 fix-fork build)

Firmware release Build doc release Self-tests License

My build of the OpenChess smart chess board by Concept Bytes, with bug-fix patches for the Arduino Nano RP2040 Connect firmware.

🎯 Are you a Kickstarter backer with the Concept-Bytes PCB?

AI mode hangs? Sensors flicker? Stockfish API failed? Pieces appear/disappear when you slide them?

Use my patched firmware β€” it fixes those issues. The original Concept-Bytes repo has been unmaintained since Aug/2025 (0 PRs ever merged, 7 open issues including the AI mode hang).

πŸ”₯ Download v1.2.2-rp2040 firmware (.uf2 drag-and-drop) β€” AI mode finally reliable

v1.2.2 routes the Stockfish API through a Cloudflare Worker proxy so the board talks plain HTTP instead of HTTPS β€” works around a fundamental TLS bug in the NINA-W102 firmware that was causing 100% Stockfish failure rates with Cloudflare-fronted endpoints. Verified: 8 consecutive API calls succeeded on first attempt at ~2s end-to-end.

Also includes: column-mirror coordinate fix, full FIDE chess rules, breathing-pulse-while-thinking, castling visual hint in HvsH, 5-attempt retry with NINA reset and amber retry pulse as belt-and-braces.

Backed the OpenChess Kickstarter? Same hardware β€” these fixes apply to your board too.


Table of contents


What this repo is

This repository has two parts:

  1. Build documentation for my personal OpenChess assembly (this repo, semichcsc-byte/openchess) β€” BOM, photos, lessons learned.
  2. Patched firmware for the Concept-Bytes PCB + Arduino Nano RP2040 Connect (semichcsc-byte/Open-Chess) β€” fixes the broken AI mode, sensor flicker, missing chess rules, and packs everything into a one-file .uf2 drop-in.

If you just want a working board, scroll to Quick start. If you want to understand the build, see BUILD_LOG.md.


Quick start

Goal: get the patched firmware running on your board in under 60 seconds, without installing the Arduino IDE.

1. Download the firmware

Latest release

Grab OpenChess-v1.2.2-rp2040.uf2 (~590 KB).

2. Put the board in bootloader mode

Double-tap the white reset button on the Arduino Nano RP2040 Connect within ~500 ms. The board mounts as a USB drive named RPI-RP2.

3. Drag-and-drop

Drag the .uf2 file onto the RPI-RP2 drive. The board reboots automatically into the new firmware.

4. Open the Serial Monitor (optional but recommended)

At 9600 baud. You should see:

================================================
         OpenChess Starting Up
         Firmware: v1.0.0-rp2040
         Fork:    semichcsc-byte/Open-Chess
================================================
=== ChessEngine self-tests ===
PASS T1..T10
=== Self-tests complete: 10/10 passed ===

If you see fewer than 10 passes, the board flashes red 5 times β€” the firmware is broken, don't use it for a game.

5. Pick a game mode

Four white LEDs light up in the centre of the board. See the user manual for what each one does. TL;DR: AI mode is the second LED (E5 square in chess notation).

6. (Only for AI mode) Configure WiFi

The pre-built .uf2 does not include WiFi credentials. To use AI mode, clone the source, edit arduino_secrets.h, and recompile. Full instructions in the manual.


What's fixed vs upstream Concept-Bytes

Bug / missing feature in upstream Fixed in v1.0.0-rp2040
πŸ”΄ AI mode hangs at "Connecting to WiFi…" βœ… APβ†’STA tear-down before WiFi.begin() (PR #9)
πŸ”΄ "Stockfish API failed" on success βœ… Parser splits HTTP body from headers (PR #10)
πŸ”΄ Easy and Medium AI are identical βœ… medium() now sends depth=10 (PR #10)
πŸ”΄ No check / checkmate / stalemate βœ… Full detection + on-board animation (PR #11)
πŸ”΄ Pinned pieces could move (expose own king) βœ… Legal-move filtering
πŸ”΄ No castling βœ… Kingside + queenside, FIDE legal
πŸ”΄ No en-passant βœ… Pink LED hint, correct capture
πŸ”΄ No 50-move rule / insufficient material βœ… Auto-detected, draw animation
πŸ”΄ Pawn always auto-promoted to Queen βœ… Q/R/B/N choice via 4 LEDs (Human-vs-Human)
🟑 Sensor flicker when sliding pieces βœ… Debounce: 3 consecutive scans required
🟑 OpenChessBoard AP stays up forever (~100 mA) βœ… Shut down when not needed
🟑 No way to know if firmware is broken βœ… 10 self-tests at every boot

Plus assorted code-quality fixes (buffer sizes, off-by-one, MODE_GAME_3 spam loop, etc.).

See docs/COMPARISON.md for an honest comparison with the more advanced joojoooo/OpenChess ESP32 fork.


Hardware & build status

Component Status
OpenChess PCB v1 βœ… Have
Arduino Nano RP2040 Connect βœ… Soldered to PCB
3D printed board (bottom) βœ… Printed
3D printed board (top/tiles) ⬜ TODO
3D printed chess pieces (32) ⬜ TODO
Neodymium magnets 10Γ—2 mm (36+) βœ… Have
Steel discs 10Γ—1 mm (64+) βœ… Have
Soldering (Arduino β†’ PCB) βœ… Done
Software step Status
Sensor_Test firmware βœ… Sensors validated
OpenChess.ino (full game) βœ… Compiled & uploaded
WiFi + Stockfish AI βœ… Working
10 engine self-tests βœ… 10/10 passing
Patched firmware released βœ… v1.2.0-rp2040 (first stable)
3 upstream PRs filed βœ… #9, #10, #11
Column-mirror coordinate bug βœ… Fixed in v1.1 β€” driver layer

Tech specs

  • PCB: 64Γ— Hall effect sensors (A3144) + 64Γ— RGB LEDs (NeoPixel GRBW)
  • MCU: Arduino Nano RP2040 Connect (WiFi + BLE built-in via WiFiNINA)
  • Shift register: 74HC594 (⚠️ NOT 74HC595 β€” different pinout)
  • Pin mapping: NeoPixel = D17, ShiftReg SER = D2 SRCLK = D3 RCLK = D4, Sensor cols = D6–D13
  • Board size: < 250Γ—250 mm
  • Magnets: 10Γ—2 mm neodymium in each chess piece (south pole down for A3144)
  • Steel discs: 10Γ—1 mm ferromagnetic under each square
  • Serial: 9600 baud for debug output
  • Sketch size: 150 799 bytes (β‰ˆ 1 % of 16 MB flash)
  • RAM: 44 640 bytes (16 % of 270 KB)

Game modes

  1. Human vs Human β€” pick up piece (red LED) β†’ valid moves shown (white) β†’ place (green flash). Includes castling, en passant, promotion choice.
  2. Human vs AI β€” Stockfish via WiFi (Easy / Medium / Hard / Expert). Bot move validated locally before applying.
  3. Sensor Test β€” LEDs light up where a magnet is detected; useful for hardware verification.

Mode selection: power on β†’ 4 white LEDs in the centre β†’ place any chess piece on one to select. Full layout in the manual.


Firmware sources

Source Platform Status (May 2026) Notes
Concept-Bytes/Open-Chess (official) Nano RP2040 πŸ”΄ Abandoned β€” last commit Aug 2025, 0 PRs merged Original. Several known bugs unfixed for 9+ months.
semichcsc-byte/Open-Chess (this fork) Nano RP2040 🟒 Active β€” v1.0.0-rp2040 released What you want if you have the Concept-Bytes PCB + Nano RP2040.
joojoooo/OpenChess ESP32 (different MCU!) 🟒 Active β€” 16β˜…, last commit May 2026 More features (Lichess online, Web UI, OTA, calibration), but requires re-soldering with jumper wires.
joojoooo build guide β€” 🟒 Maintained Best schematic + wiring documentation for both platforms.

β†’ Detailed comparison: docs/COMPARISON.md


Repo layout

openchess/
β”œβ”€β”€ README.md                      ← you are here
β”œβ”€β”€ LICENSE                        ← MIT
β”œβ”€β”€ CONTRIBUTING.md                ← how to file issues / PRs
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ MANUAL.md                  ← full user manual
β”‚   β”œβ”€β”€ COMPARISON.md              ← honest gap analysis vs other forks
β”‚   β”œβ”€β”€ BUILD_LOG.md               ← chronological build journal
β”‚   └── BOM.md                     ← bill of materials with prices & links
β”œβ”€β”€ firmware/                      ← README pointing at the fork
β”œβ”€β”€ stl/                           ← 3D-print sources & notes
β”œβ”€β”€ images/                        ← build photos (TODO)
└── upstream-firmware/             ← gitignored local clone, do not commit

Links


License

Build documentation in this repo: MIT.

OpenChess design files (PCB, STLs): CC BY 4.0 by Concept Bytes.

Firmware fork: MIT (inherited from upstream Concept-Bytes/Open-Chess).

About

OpenChess Kickstarter backer fix-fork: bug-fix patches for the Arduino Nano RP2040 Connect firmware. AI mode WiFi fix, Stockfish parser, board correctness.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors