Skip to the content
4 layers45.8 × 46.4 mmTotem, the printed circuit board in 3D

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

10

README

README.md

Totem 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 .py files.
  • 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.

bash
cd docs
npm i -g mint    # or: npx mint@latest
mint dev         # preview at http://localhost:3000

Start 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.

bash
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 + clock

Pick 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.

PackageContents
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.

bash
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 doing

The 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.

PackageContents
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
QtyValueFootprintReferences
67XL-1515RGBC-WS2812Btotem:LED_XL-1515RGBC-WS2812BD100, D101, D102, D103, D104, D105, D106, D107, D108, D109, D110, D111, D112, D113, D114, D115 +51
1010uCapacitor_SMD:C_0805_2012MetricC3, C5, C10, C11, C13, C14, C15, C16, C17, C20
7100kResistor_SMD:R_0603_1608MetricR3, R9, R10, R14, R18, R24, R25
7100nCapacitor_SMD:C_0603_1608MetricC1, C4, C6, C7, C12, C19, C21
510kResistor_SMD:R_0603_1608MetricR13, R17, R19, R22, R26
32N7002Package_TO_SOT_SMD:SOT-23Q2, Q3, Q5
21kResistor_SMD:R_0603_1608MetricR27, R28
21uCapacitor_SMD:C_0603_1608MetricC2, C18
233Resistor_SMD:R_0603_1608MetricR11, R12
24.7kResistor_SMD:R_0603_1608MetricR7, R8
25.1kResistor_SMD:R_0603_1608MetricR20, R21
2AO3401APackage_TO_SOT_SMD:SOT-23Q1, Q4
2redLED_SMD:LED_0603_1608MetricD3, D4
1102kResistor_SMD:R_0603_1608MetricR2
110MResistor_SMD:R_0603_1608MetricR15
1113kResistor_SMD:R_0603_1608MetricR1
1150kResistor_SMD:R_0603_1608MetricR4
11MResistor_SMD:R_0603_1608MetricR16
11N4148WDiode_SMD:D_SOD-123D1
12.2kResistor_SMD:R_0603_1608MetricR23
1220nCapacitor_SMD:C_0603_1608MetricC8
12kResistor_SMD:R_0603_1608MetricR5
1330Resistor_SMD:R_0603_1608MetricR6
13V3TestPoint:TestPoint_Pad_D1.0mmTP2
1AP2112K-3.3Package_TO_SOT_SMD:SOT-23-5U4
1BAT54WPackage_TO_SOT_SMD:SOT-323_SC-70D2
1ENTestPoint:TestPoint_Pad_D1.0mmTP6
1ESP32-WROOM-32ERF_Module:ESP32-WROOM-32EU1
1GNDTestPoint:TestPoint_Pad_D1.0mmTP3
1IO0TestPoint:TestPoint_Pad_D1.0mmTP7
1LIS2MDLPackage_LGA:LGA-12_2x2mm_P0.5mmU6
1LSM6DSV16XPackage_LGA:LGA-14_3x2.5mm_P0.5mm_LayoutBorder3x4yU5
1LiPo 1000mAhConnector_JST:JST_PH_S2B-PH-K_1x02_P2.00mm_HorizontalJ2
1MAX-M10SRF_GPS:ublox_MAXU2
1RXD0TestPoint:TestPoint_Pad_D1.0mmTP5
1SOSButton_Switch_SMD:SW_SPST_PTS645Sx43SMTR92SW2
1TP4056-42-ESOP8Package_SO:SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.29x3mmU3
1TXD0TestPoint:TestPoint_Pad_D1.0mmTP4
1USB4135-GF-AConnector_USB:USB_C_Receptacle_GCT_USB4135-GF-A_6P_TopMnt_HorizontalJ1
1electrettotem:CUI_CMC-4013-SMT_RingGapMK1
1greenLED_SMD:LED_0603_1608MetricD5
1powerButton_Switch_SMD:SW_SPST_PTS645Sx43SMTR92SW1
1touch pogo pinTestPoint:TestPoint_Pad_D2.5mmTP1
1u.FLConnector_Coaxial:U.FL_Hirose_U.FL-R-SMT-1_VerticalJ3

Similar boards

  • 2 layers102.9 × 103.7 mmDrone ESP32, the printed circuit board in 3D

    Drone ESP32

    Asaf66/Drone_ESP32

    Rev 2 fixes the issues found while assembling the first board:

    80 parts
  • 2 layers49.4 × 56.2 mmMic array, the printed circuit board in 3D

    Mic array

    winedarksea/sirith_tetrahedral

    High Performance Microphone Array

    114 partsGPL-3.0
  • 4 layers54 × 120 mmKartonaut, the printed circuit board in 3D

    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 mmTrailmap, the printed circuit board in 3D

    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 mmGPS traacker, the printed circuit board in 3D

    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 mmVacuum Tweezers, the printed circuit board in 3D

    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 mmMicrocharge2, the printed circuit board in 3D

    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 mmOther m68k, the printed circuit board in 3D

    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).