Skip to content

Play a chess game over Meshtastic using a Web Serial or Bluetooth connection

License

Notifications You must be signed in to change notification settings

compuvin/chess-meshtastic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Meshtastic Web Chess

Play a chess game over Meshtastic using Web Serial or Web Bluetooth. The UI runs in the browser and exchanges moves directly between radios.

This project is mostly vibe coded.

Play now

Meshtastic Web Serial Status

Why it is fun

  • Zero server. Pure radio-to-radio chess.
  • Random handshake picks colors and a shared game ID.
  • Move-count sync to detect stalls and recover missing moves.

Features

  • Web Serial and Web Bluetooth connections
  • Lobby channel with matchmaking and direct connect fallback
  • Random handshake to pick colors and a shared game ID
  • Move-count sync and reconnect checks
  • Simple, single-page UI

Requirements

  • A browser with Web Serial or Web Bluetooth support (Chromium-based)
  • Two Meshtastic radios on the same mesh
  • Recommended: add the GameLobby channel before playing

Quick start

  1. Serve the folder with any static file server.
  2. Open index.html in your browser, or play it at https://kb1jdx.com/chess-meshtastic/.
  3. Click Connect Serial or Connect Bluetooth to pair with your radio.
  4. Use the lobby to invite or direct connect to an opponent.
  5. Wait for the handshake to assign colors, then play.

Usage

  • After connecting, the app performs a handshake to pick colors and start a game.
  • Moves are transmitted over the mesh.
  • If a move is missing, the app uses move counts to retry and resync.

Files

  • index.html: UI and game logic
  • meshtastic-chess.js: Serial framing + Meshtastic protobuf handling
  • meshtastic_bundle.json: Protobuf schema bundle
  • vendor/protobuf.min.js: Protobuf runtime
  • js/meshtastic.bundle.js: @meshtastic/js bundle (BLE)
  • js/meshtastic.js: bundle loader
  • img/GameLobby.png: QR code for the lobby channel

Notes

Troubleshooting

  • If the handshake never completes, confirm both radios are on the same channel and the opponent node ID is correct.
  • If moves do not transmit, reconnect and try again to re-run the handshake.
  • If you see "Connection lost. Retrying...", the app is re-syncing move counts.

Acknowledgements

  • Meshtastic team and community
  • Chessboard.js and Chess.js
  • @meshtastic/js (GPLv3)

CodeFactor

About

Play a chess game over Meshtastic using a Web Serial or Bluetooth connection

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published