

Independent reverse-engineering documentation of the Totem Compass ESP32 + MicroPython firmware (v5.0.2): image/memory map, the 96 frozen modules, the 2.4 GHz protocols (BLE, ESP-NOW mesh, WiFi OTA), and a custom-client reference.
- Size
- 45.8 × 46.4 mm
- Copper layers
- 4
- Thickness
- 1.6 mm
- Parts
- 144
- Nets
- 143
- Pads
- 531
- Tracks, vias
- 3,729, 413
- Pours
- 5
- Routed
- Yes
- KiCad
- KiCad 10.0 (file 20260206)
- Created
- 12 Sep 2026
- Updated
- 6 Nov 2026
Overview
Totem is an open-source printed circuit board by ljagiello, from the ljagiello/totem-compass repository on GitHub, published under the Apache-2.0 licence. It is a 4-layer board of 45.8 × 46.4 mm with 144 parts on 143 nets, routed with 3,729 tracks and 413 vias.
It is built around the ESP32-WROOM-32E, LIS2MDL and AP2112K-3.3, with the LSM6DSV16X, MAX-M10S and TP4056-42-ESOP8 among its other parts. Its parts include 72 diodes, 28 resistors, 20 capacitors, 6 ICs and 5 transistors. It belongs with the radio and wireless and home automation and IoT boards and the ESP32 boards of this library.
Main components
10ESP32-WROOM-32E
SMD,18x25.5mmSMD,18x25.5mm WiFi Modules ROHSEspressif SystemsWiFi ModulesLIS2MDL
LGA-12(2x2)-40℃~+85℃ 1.71V~3.6V 16bit 200uA I2C、SPI ±5mT ±5mT LGA-12(2x2) 3D Magnetic Sensors ROHSSTMicroelectronics3D Magnetic SensorsAP2112K-3.3
SOT253.3V 600mA CMOS Low Dropout Linear Regulator with EnableDiodes IncorporatedUncategorisedLSM6DSV16X
LGA-14_2.5x3mmUncategorisedSTMicroelectronicsMAX-M10S
LCC-18_10.1X9.7LCC-18_10.1X9.7 New Arrivals ROHSu-bloxUncategorisedTP4056-42-ESOP8
ESOP-8-40℃~+85℃ 1 1A 2uA 4.2V 4V~8V Charging IC Lithium Battery Support ESOP-8 Battery Management ROHSTOPPOWERBattery ManagementAO3401A
SOT-231 P-Channel 14nC@10V 30V 47mΩ@10V、60mΩ@4.5V、85mΩ@2.5V 4A 55pF 645pF 80pF 900mV SOT-23 MOSFETs ROHSAlpha & Omega SemiconductorMOSFETs1N4148W
SOD-123150mA 1A 1V@50mA 1uA@75V 400mW 4ns 75V Independent SOD-123 Switching Diodes ROHSSTMicroelectronicsSwitching DiodesBAT54W
SOD-123Schottky DiodeshongjiachengUSB4135-GF-A
SMD-30℃~+85℃ 1 3A 48V 6P Black Female Surface Mount, Right Angle Type-C SMD USB Connectors ROHSGlobal Connector Technology (GCT)USB Connectors
README
README.mdTotem Compass firmware — reverse engineering
Independent, unofficial reverse-engineering notes for the Totem Compass ESP32 firmware (v5.0.3; v5.0.2 was analyzed first, see What changed in 5.0.3), produced by static analysis of the publicly downloadable firmware images and the companion mobile app, plus a BLE client tested against the author's own device. Not affiliated with or endorsed by Totem Labs.
Key findings
- The device is an ESP32 (Xtensa LX6) running MicroPython v1.25.0 on ESP-IDF v5.4.
- Totem's application is Python, frozen into the image as bytecode across 94 frozen modules in v5.0.3 (96 in v5.0.2), plus 2 non-frozen on-flash
.pyfiles. - Three radios share the 2.4 GHz band: BLE (phone app), ESP-NOW ("Unity Mesh", Totem-to-Totem), and WiFi (station-mode OTA; the hotspot path is sunset).
- Application messages use a shared
(cat_id, cmd_id)model with a common chunking layer.
Documentation
Full docs live in docs/ as a Mintlify site.
cd docs
npm i -g mint # or: npx mint@latest
mint dev # preview at http://localhost:3000Start at docs/index.mdx. The 2.4 GHz protocol capture — with a
completeness matrix — is under docs/protocols/.
Go client: totemctl
A Bluetooth LE client that speaks the same protocol as the official app: the ConnStatus-Ready handshake, Live/Static/Peer records, and the half-duplex TX handoff. No pairing or keys are needed.
go install github.com/ljagiello/totem-compass/cmd/totemctl@latest
totemctl scan # find Totems (double-press the power button first)
totemctl info # name, firmware, battery, position, settings
totemctl watch # stream live data and peer updates
totemctl peers # bonded Totems and points of interest
totemctl name "Base Camp" # rename
totemctl compass --lock on --north off --blink on
totemctl power eco --blink on # or: normal
totemctl wifi scan # networks the Totem can see
totemctl wifi set <ssid> # network used for firmware updates; asks for the password
totemctl peer color <mac> hot_pink
totemctl poi add --name "Main Stage" --lat 50.0671 --lon 19.9124 --sticky
totemctl location --lat 50.0671 --lon 19.9124 # feed a phone-style GNSS fix + clockPick a device with -d <address substring>, using an address totemctl scan
prints: every Totem advertises as "totem", so the name set with totemctl name
cannot select one. Get machine-readable output with --json, and log every
frame with --trace. totemctl help <command> lists each command's flags.
Every global flag can also be set as a TOTEM_<FLAG> environment variable
(TOTEM_DEVICE, TOTEM_HALF_DUPLEX, …) or in a config file with the long flag
names as keys (device: <address from totemctl scan>). The default location is
totemctl/config.yaml under the user config directory (~/Library/Application Support on macOS, ~/.config on Linux), or pass --config.
compass and power send a frame that always sets peer blink, which the Totem
does not report, so they need --blink on|off; set it once with blink: on in
the config file or TOTEM_BLINK.
The Ready frame's schema id selects one of two device transmit loops. The
client defaults to the legacy full-duplex loop (schema 0: notifications plus
app-level acks), which works on every platform. The newer half-duplex loop
(--half-duplex) sends indications and drops a record unless it is confirmed
within 500 ms; CoreBluetooth subscribes these characteristics for
notifications only, so that mode stalls on macOS.
Verified on hardware from macOS: scan and info on firmware 4.1.3 and 5.0.3; watch and
compass --lock on|off round-trips on 4.1.3. The other commands are built from the
v5.0.2/v5.0.3 bytecode (their handlers are identical in both) and covered by unit tests
only.
| Package | Contents |
|---|---|
protocol/ | frame builders and decoders, no BLE dependency; tested against vectors built with the firmware's own struct formats |
client/ | scanning, connecting, subscriptions, acks and TX-window handling on tinygo.org/x/bluetooth (tested on macOS; the library also supports Linux/BlueZ and Windows) |
cmd/totemctl/ | the CLI |
ESP32 emulator: totememu
An ESP32 running TinyGo that joins the ESP-NOW mesh as another Totem: it pairs with a real
Totem through the normal Touch Crystal pairing and then exchanges peer status with it every
radio window. It models the rest of the device too — the halo and the crystal, the Touch
Crystal and the two buttons, the power state and its battery curve, an update over WiFi —
and keeps its name, colour and bonds in flash across a power cut. Hardware-tested against
firmware 5.0.3. See docs/reference/esp32-emulator.mdx.
tinygo flash -target esp32-generic -ldflags "-X main.owned=<your Totem's MAC>" ./cmd/totememu
totemctl mesh pair # hold the Totem's Touch Crystal next to the board
totemctl mesh watch # decode every frame the Totem sends it (--raw, --tx, --json)
totemctl mesh status # the emulator and its peers
totemctl mesh clock # give the board this computer's time
totemctl mesh send pos 50.0671 19.9124 3 # where it is
totemctl mesh send sim walk 90 # and where it goes: walk, drive or still
totemctl mesh send batt 40 # also: sos, heading, flat, unbond, selftest
totemctl mesh send touch crystal hold 1500 # a gesture, as a finger would make it
totemctl mesh send leds # what the ring and the crystal are doingThe mesh commands find the board's USB serial port by itself (or take --port,
TOTEM_PORT, port: in the config file). They open it without toggling DTR/RTS, so the
board does not reboot, and they decode the raw frames on the host with the mesh package.
| Package | Contents |
|---|---|
mesh/ | ESP-NOW frame codec (peer, locate, Smart Group), tested against frames packed with the firmware's own struct formats |
emulator/ | the Totem logic: pairing, radio windows, clock sync, locate reply and relay, Smart Group member, the halo and crystal, the touch and button gestures, the power state and the WiFi update, and a model of the GNSS receiver, compass, motion sensor and battery; host-tested |
store/ | the settings and bonds a reboot keeps, as an append-only journal in one flash sector |
cmd/totememu/ | the ESP32 firmware and its serial console |
Scope & ethics
The firmware analysis is static and no service was attacked; the releases API and firmware
objects are served publicly. The only code run against hardware is totemctl, over BLE, and
totememu, over ESP-NOW, both on the author's own Totem. See
docs/reference/methodology.mdx. Use them only with devices
you own. The mesh and demi-god paths can affect other people's Totems nearby, so totemctl
does not send those commands, and totememu talks only to the Totems it is built for, never
hosts a Smart Group and never sends demi-god commands.
License
Licensed under the Apache License 2.0.
Created by Lukasz Jagiello. Write-up: lukasz.jagiello.org/projects/totem-compass.
Parts
144| Qty | Value | Footprint | References |
|---|---|---|---|
| 67 | XL-1515RGBC-WS2812B | totem:LED_XL-1515RGBC-WS2812B | D100, D101, D102, D103, D104, D105, D106, D107, D108, D109, D110, D111, D112, D113, D114, D115 +51 |
| 10 | 10u | Capacitor_SMD:C_0805_2012Metric | C3, C5, C10, C11, C13, C14, C15, C16, C17, C20 |
| 7 | 100k | Resistor_SMD:R_0603_1608Metric | R3, R9, R10, R14, R18, R24, R25 |
| 7 | 100n | Capacitor_SMD:C_0603_1608Metric | C1, C4, C6, C7, C12, C19, C21 |
| 5 | 10k | Resistor_SMD:R_0603_1608Metric | R13, R17, R19, R22, R26 |
| 3 | 2N7002 | Package_TO_SOT_SMD:SOT-23 | Q2, Q3, Q5 |
| 2 | 1k | Resistor_SMD:R_0603_1608Metric | R27, R28 |
| 2 | 1u | Capacitor_SMD:C_0603_1608Metric | C2, C18 |
| 2 | 33 | Resistor_SMD:R_0603_1608Metric | R11, R12 |
| 2 | 4.7k | Resistor_SMD:R_0603_1608Metric | R7, R8 |
| 2 | 5.1k | Resistor_SMD:R_0603_1608Metric | R20, R21 |
| 2 | AO3401A | Package_TO_SOT_SMD:SOT-23 | Q1, Q4 |
| 2 | red | LED_SMD:LED_0603_1608Metric | D3, D4 |
| 1 | 102k | Resistor_SMD:R_0603_1608Metric | R2 |
| 1 | 10M | Resistor_SMD:R_0603_1608Metric | R15 |
| 1 | 113k | Resistor_SMD:R_0603_1608Metric | R1 |
| 1 | 150k | Resistor_SMD:R_0603_1608Metric | R4 |
| 1 | 1M | Resistor_SMD:R_0603_1608Metric | R16 |
| 1 | 1N4148W | Diode_SMD:D_SOD-123 | D1 |
| 1 | 2.2k | Resistor_SMD:R_0603_1608Metric | R23 |
| 1 | 220n | Capacitor_SMD:C_0603_1608Metric | C8 |
| 1 | 2k | Resistor_SMD:R_0603_1608Metric | R5 |
| 1 | 330 | Resistor_SMD:R_0603_1608Metric | R6 |
| 1 | 3V3 | TestPoint:TestPoint_Pad_D1.0mm | TP2 |
| 1 | AP2112K-3.3 | Package_TO_SOT_SMD:SOT-23-5 | U4 |
| 1 | BAT54W | Package_TO_SOT_SMD:SOT-323_SC-70 | D2 |
| 1 | EN | TestPoint:TestPoint_Pad_D1.0mm | TP6 |
| 1 | ESP32-WROOM-32E | RF_Module:ESP32-WROOM-32E | U1 |
| 1 | GND | TestPoint:TestPoint_Pad_D1.0mm | TP3 |
| 1 | IO0 | TestPoint:TestPoint_Pad_D1.0mm | TP7 |
| 1 | LIS2MDL | Package_LGA:LGA-12_2x2mm_P0.5mm | U6 |
| 1 | LSM6DSV16X | Package_LGA:LGA-14_3x2.5mm_P0.5mm_LayoutBorder3x4y | U5 |
| 1 | LiPo 1000mAh | Connector_JST:JST_PH_S2B-PH-K_1x02_P2.00mm_Horizontal | J2 |
| 1 | MAX-M10S | RF_GPS:ublox_MAX | U2 |
| 1 | RXD0 | TestPoint:TestPoint_Pad_D1.0mm | TP5 |
| 1 | SOS | Button_Switch_SMD:SW_SPST_PTS645Sx43SMTR92 | SW2 |
| 1 | TP4056-42-ESOP8 | Package_SO:SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.29x3mm | U3 |
| 1 | TXD0 | TestPoint:TestPoint_Pad_D1.0mm | TP4 |
| 1 | USB4135-GF-A | Connector_USB:USB_C_Receptacle_GCT_USB4135-GF-A_6P_TopMnt_Horizontal | J1 |
| 1 | electret | totem:CUI_CMC-4013-SMT_RingGap | MK1 |
| 1 | green | LED_SMD:LED_0603_1608Metric | D5 |
| 1 | power | Button_Switch_SMD:SW_SPST_PTS645Sx43SMTR92 | SW1 |
| 1 | touch pogo pin | TestPoint:TestPoint_Pad_D2.5mm | TP1 |
| 1 | u.FL | Connector_Coaxial:U.FL_Hirose_U.FL-R-SMT-1_Vertical | J3 |
Similar boards
- 2 layers102.9 × 103.7 mm

- 2 layers49.4 × 56.2 mm

- 4 layers54 × 120 mm

Kartonaut
Jan-Philipp-Munsch/kartonaut
TVC model rocket (after BPS.space Scout F): Teensy 4.1 flight firmware, mainboard spec, project log
174 partsMIT - 2 layers91.5 × 100 mm

Trailmap
katetriestocode/trailmap
this is the working version! (disclaimer: no antenna as it has not delivered yet, so manual gps coords insertion for now!)
57 parts2 - 2 layers55 × 42 mm

GPS traacker
Dhruv2212-star/GPS-tracker
Ai ussage- debugging firmware Project description- a small pocket sized instrument that uses GPS module paired with Xiao RP2040 module as the MCU to track your coordinates every min that you can put on websites like…
33 parts - 2 layers86 × 36 mm

Vacuum Tweezers
ARENARobotics/MiniPic
Open-source benchtop vacuum tweezer engineered for SMD soldering, rework, and precision part handling
31 parts3CERN-OHL-S-2.0 - 2 layers25.5 × 25 mm

Microcharge2
4f48/microcharge
Small Li-Ion battery management development board with charging and protection, 3.3V output.
30 parts1CERN-OHL-S-2.0 - 4 layers180 × 125 mm

Other m68k
bradgrantham/other-m68k
Generated by make -C kicad board route fab release from the commit that last touched this directory.
171 parts
Questions
How big is the Totem PCB?
It measures 45.8 × 46.4 mm and has 4 copper layers, 1.6 mm thick.
What parts does the Totem use?
144 parts, built around the ESP32-WROOM-32E, LIS2MDL, AP2112K-3.3 and LSM6DSV16X. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
Where can I download the Totem KiCad files?
From the ljagiello/totem-compass repository on GitHub, at the commit this page was made from: the board is hardware/totem-v3.5-reference/schematic/totem.kicad_pcb and its schematic hardware/totem-v3.5-reference/schematic/totem.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the Totem design in my own project?
Its repository publishes it under the Apache-2.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).