Grafito CANStepper

The monorepo includes an optional Wi‑Fi SoftAP + web UI sketch for bench checks when you do not want a PC running Python. It is not the production GCSP firmware — it replaces GrafitoCANStepper_C3 while installed.

Source: can_stepper/firmware/CANStepper_WiFiPortal/

What you get

ItemDetail
HotspotESP32-C3 SoftAP, SSID Grafito-XXXX (chip id)
Passwordgrafito123
Web UIhttp://192.168.4.1/
StatusEncoder position, step position, enable, e‑stop, endstop, GPIO8 raw
CommandsEnable / disable / stop / e‑stop / set zero / relative moves
Endstop polarityActive-low (SN04-N NPN NO) or active-high (NC optical)

Serial (115200) prints SSID, password, and URL after boot.

Flash

cd can_stepper
arduino-cli compile --fqbn esp32:esp32:esp32c3:CDCOnBoot=cdc \
  firmware/CANStepper_WiFiPortal
arduino-cli upload -p /dev/ttyACM0 --fqbn esp32:esp32:esp32c3:CDCOnBoot=cdc \
  firmware/CANStepper_WiFiPortal

Requirements: ESP32C3 Dev Module, USB CDC On Boot: Enabled. Libraries: FastAccelStepper, TMC2209 (janelia-arduino). Apply main Vin (5–24 V, typically 24 V) during flash — USB does not power the ESP32 for programming.

Healthy serial banner:

# CANStepper WiFi Portal 1.0
# FastAccelStepper on STEP=10 DIR=1
# MT6701 frame=0x…… angle=… enc_ok=1
# WiFi SoftAP:  Grafito-XXXX
# Password:     grafito123
# Open browser: http://192.168.4.1/

Use

  1. On phone or laptop, join Wi‑Fi Grafito-XXXX / grafito123.
  2. Open http://192.168.4.1/ (hard-refresh if the page was cached).
  3. Tap Enable, then a move button (e.g. +90°).
  4. Confirm Encoder: ok and position updates when the shaft turns.

Motor not moving?

Production enable needs both TMC UART enable() and the EN pin. Current portal firmware does that. Also check:

  • 24 V motor supply on
  • Motor connected
  • Not e‑stopped (Clear e‑stop then Enable)
  • Serial shows # driver ON and # move_rel … running=1

Encoder shows “no lock”?

The portal must use SPI MODE3 SSI (same as production), not bit-banged GPIO. Portal ≥1.1 matches production. Also: magnet over the MT6701, CS on IO2 high when idle.

Endstop polarity on the portal

SensorIdleHitPortal button
SN04-N NPN NOGPIO8 HIGHLOWEndstop active-LOW
NC optical (idle low)GPIO8 LOWHIGHEndstop active-HIGH

Restore production firmware (no Wi‑Fi)

Python library, GCSP CAN, multi-node, and G-code need GrafitoCANStepper_C3:

cd can_stepper
arduino-cli compile --fqbn esp32:esp32:esp32c3:CDCOnBoot=cdc \
  firmware/GrafitoCANStepper_C3
arduino-cli upload -p /dev/ttyACM0 --fqbn esp32:esp32:esp32c3:CDCOnBoot=cdc \
  firmware/GrafitoCANStepper_C3

Serial should show # GrafitoCANStepper fw 1.7 proto 1 (or newer). Then:

PYTHONPATH=. python3 examples/endstop_monitor.py /dev/ttyACM0 1 0 high
# or SN04-N:
PYTHONPATH=. python3 examples/endstop_monitor.py /dev/ttyACM0 1 0 low

On this page