Skip to content

Add RF analyzer tools, ProtoPirate model DB, WiFi sniffer fix, and a new feature: BLE/smart/meta glasses detector - #3086

Closed
TurbulentGoat wants to merge 7 commits into
BruceDevices:devfrom
TurbulentGoat:dev
Closed

TurbulentGoat wants to merge 7 commits into
BruceDevices:devfrom
TurbulentGoat:dev

Conversation

@TurbulentGoat

Copy link
Copy Markdown

Proposed Changes

Adds sub-GHz analysis tools, a BLE smart-glasses detector, a car-model database
for ProtoPirate, and fixes the WiFi sniffer on PSRAM-less boards.

  • RF -> Analyze: auto-classifier that detects ASK/OOK vs 2-FSK from a captured
    pulse train and estimates TE / baud / bit count with a confidence score
    (auto-flips the CC1101 between OOK and 2-FSK when idle).
  • RF -> Rolling Code: captures KeeLoq/rolling frames and shows manufacturer /
    serial / button / counter, tracking the counter across presses to report
    "rolling" vs "fixed code".
  • RF -> Remote Analyzer: frequency peak-finder with AM-vs-FM classification
    (coarse sweep + +/-300 kHz fine sweep).
  • ProtoPirate -> Car model: an 11-entry model database (frequency + preset,
    including the Honda raw CC1101 register preset) selectable from Receiver
    settings.
  • BLE -> Glasses Detect: flags camera-equipped glasses (Meta Ray-Ban/Oakley,
    Snap Spectacles, etc.) by BLE company ID, the META_RB_GLASS manufacturer-data
    tag, product names, and service UUIDs.
  • WiFi sniffer: adds a radioHasMemForWifi() guard, a static packet queue,
    switches from AP to STA+promiscuous mode, and reduces RX/TX buffer counts -
    fixing OOM/reboot on no-PSRAM boards.

Types of Changes

New Feature & Bugfix

Verification

  • Builds clean for m5stack-cardputer
  • RF features require a CC1101 module and were exercised
    with a HackRF as the transmitter.
  • Glasses detector: BLE scan matching against real device fingerprints.
  • WiFi sniffer: verified to start, capture APs, and run the deauth attack on a
    Cardputer ADV (previously rebooted with ESP_ERR_NO_MEM / LoadProhibited).

Testing

Changes were validated by building and manually testing on
hardware (M5Stack Cardputer ADV). The new RF/BLE modules are self-contained and
guarded by #if !defined(LITE_VERSION) where appropriate.

Linked Issues

NONE

User-Facing Change

Added sub-GHz auto-classifier (Analyze), rolling-code analyzer, and remote analyzer to the RF menu.
Added a BLE smart-glasses detector (BLE -> Glasses Detect).
Added a car-model database + custom radio profiles to ProtoPirate.
Fixed the WiFi sniffer rebooting/OOM on no-PSRAM boards (Cardputer ADV).

Further Comments

This is currently a single commit spanning several feature areas. I'm happy to
split it into focused PRs (RF tools / BLE detector / ProtoPirate models /
sniffer fix) if the maintainers prefer smaller review units.

…d WiFi sniffer fix

- RF: sub-GHz auto-classifier (Analyze), rolling-code analyzer, remote
  analyzer (peak find + AM/FM), car-model database + custom radio profiles
- BLE: smart/Meta glasses detector (Glasses Detect)
- ProtoPirate: car-model selector + custom CC1101 register profiles
- WiFi sniffer: RAM guard, static queue, STA+promiscuous mode, reduced buffers
  (fixes OOM/reboot on no-PSRAM boards)
@TurbulentGoat

Copy link
Copy Markdown
Author
InShot_20261113_193500639.mp4
VID_20261113_133230536.mp4
VID_20261113_133249454.mp4.2.mp4

The content-clear fillRect() spanned the full screen width, erasing the
left/right (and bottom, for Analyze) border. Restrict clearing to the
content area inside the border.
AP mode (hostapd) OOM'd against the ~31 KB of contiguous DMA left while
Bruce's 64 KB SDR bank is fenced off. Release the SDR bank before starting
the AP, free any prior WiFi stack, guard on radioHasMemForWifi(), and use
max_connection=1 to shrink the station table.
Ninja-jr pushed a commit to Ninja-jr/Bruce_firmware that referenced this pull request Nov 15, 2026
@TurbulentGoat

Copy link
Copy Markdown
Author

Firstly if this is not useful, let me know and I'll remove the comment!

Since v1.17 BETA's release, and re-flashing launcher, a number of fixes are no longer relevant in this.
These are some things I've noticed (fixed/not fixed/now broken) :

  1. WiFi sniffer no longer reboots after use - Fixed
  2. Other tools can be used straight after Evil Portal and no "low RAM" error - Partially fixed
  3. LED changes colour & UI Colour changes - Fixed
  4. Clock updates correctly - Not fixed (See below for debugging)
  5. "install app store" in config finally works but can't use anything I've tried Not Fixed
  6. HAven't found any installable apps yet from the app store/JS interp.
  7. "Keyboard Language: QWERTY" overflows the sides and cuts off "keyb" and "RTY".
  8. Brucegotchi no longer force-reboots
    After doing all that testing, I tried BLE spam but it showed low ram.

==============================================================================

LOW RAM CRASH

Selected: BLE
Selected: iBeacon
Advertising started...
Advertising stop
[iBeacon] BLE stack deinitialized
Selected: BLE
Selected: BLE Spam
[RAM] Low contiguous DMA memory for BLE, attempting to free WiFi...
[RAM] Still only 32756 bytes DMA block, minimum 49152 needed
ERR: Low RAM: free WiFi/SD first
[RAM] Low contiguous DMA memory for BLE, attempting to free WiFi...
[RAM] Still only 32756 bytes DMA block, minimum 49152 needed
ERR: Low RAM: free WiFi/SD first

After that ^, rebooted cardputer adv and I could use ble spam. However if I exited the tool and went back to it, I could no longer spam:

}DEBUG: Cardputer ADV - Initializing TCA8418 keyboard
DEBUG: Initializing I2C with SDA=8, SCL=9
DEBUG: Scanning I2C bus...
DEBUG: Found I2C device at address 0x18
DEBUG: Found I2C device at address 0x34
DEBUG: Found I2C device at address 0x69
DEBUG: Found 3 I2C devices
DEBUG: Attempting to initialize TCA8418 at address 0x34
Selected: BLE
Selected: BLE Spam
[RAM] Low contiguous DMA memory for BLE, attempting to free WiFi...
[RAM] Still only 32756 bytes DMA block, minimum 49152 needed
ERR: Low RAM: free WiFi/SD first
[RAM] Low contiguous DMA memory for BLE, attempting to free WiFi...
[RAM] Still only 32756 bytes DMA block, minimum 49152 needed
ERR: Low RAM: free WiFi/SD first

===============================================================================

JS APP STORE CRASH

deinit interpreter:
PSRAM: [Free: 0, max alloc: 0],
RAM: [Free: 57460, max alloc: 31732]

Exiting interpreter...
Selected: JS Interpreter
Selected: AppStore
Running script: /BruceJS/AppStore.js
init interpreter:
PSRAM: [Free: 0, max alloc: 0],
RAM: [Free: 46032, max alloc: 22516]

Entering interpreter...
context created:
PSRAM: [Free: 0, max alloc: 0],
RAM: [Free: 31212, max alloc: 8692]

    at <eval> (gifs.js:59:5)SyntaxError: not enough memory
SyntaxError: not enough memory
    at AppStore.js:1:1388

==============================================================================

Clock not persisting after reboot

"startupApp": "",
 "startupAppJSInterpreterFile": "",
 "wigleBasicToken": "",
 "wdgwarsApiKey": "your 64-char hex key from wdgwars.pl/profile",
 "devMode": 0,
 "colorInverted": 1,
 "mainMenuStyle": 1,
 "badUSBBLEKeyboardLayout": 0,
 "badUSBBLEKeyDelay": 10,
 "badUSBBLEShowOutput": true,
 "disabledMenus": [
   "FM",
   "Ethernet",
   "RFID",
   "Clock" - **The previous set**
 ],
 "qrCodes": [
   {
     "menuName": "Bruce AP",
     "content": "WIFI:T:WPA;S:BruceNet;P:brucenet;;"
   },
   {
     "menuName": "Bruce Wiki",
     "content": "https://github.com/pr3y/Bruce/wiki"
   },
   {
     "menuName": "Bruce Site",
     "content": "https://bruce.computer"
   },
   {
     "menuName": "Rickroll",
     "content": "https://youtu.be/dQw4w9WgXcQ"
   }
 ]
}Selected: UTC+8 (Beijing, Singapore, Perth)
{
 "priColor": "ffff",
 "secColor": "ce79",
 "bgColor": "0",
 "themeFile": "",
 "themeOnSd": 0,
 "dimmerSet": 30,
 "bright": 100,
 "automaticTimeUpdateViaNTP": true,
 "tmz": 8,
 "dst": false,
 "clock24hr": true,
 "soundEnabled": 1,
 "soundVolume": 100,
 "wifiAtStartup": 0,
 "instantBoot": 0,
 "keyboardLang": "QWERTY",
 "ledBright": 50,
 "ledColor": "7cfc00",
 "ledBlinkEnabled": 1,
 "ledEffect": 0,
 "ledEffectSpeed": 5,
 "ledEffectDirection": 1,
 "webUI": {
   "user": "admin",
   "pwd": "bruce"
 },
 "webUISessions": {},
 "wifiAp": {
   "ssid": "BruceNet",
   "pwd": "brucenet"
 },
 "wifiMAC": "",
 "TerminalLog": true,
 "evilWifiNames": [],
 "evilWifiEndpoints": {
   "getCredsEndpoint": "/creds",
   "setSsidEndpoint": "/ssid",
   "showEndpoints": true,
   "allowSetSsid": true,
   "allowGetCreds": true,
   "gatewayIp": "172.0.0.1"
 },
 "evilWifiPasswordMode": 0,
 "wifi": {
   "iiNet806C92": "REDACTED"
 },
 "startupApp": "",
 "startupAppJSInterpreterFile": "",
 "wigleBasicToken": "",
 "wdgwarsApiKey": "your 64-char hex key from wdgwars.pl/profile",
 "devMode": 0,
 "colorInverted": 1,
 "mainMenuStyle": 1,
 "badUSBBLEKeyboardLayout": 0,
 "badUSBBLEKeyDelay": 10,
 "badUSBBLEShowOutput": true,
 "disabledMenus": [
   "FM",
   "Ethernet",
   "RFID",
   "Clock"
 ],
 "qrCodes": [
   {
     "menuName": "Bruce AP",
     "content": "WIFI:T:WPA;S:BruceNet;P:brucenet;;"
   },
   {
     "menuName": "Bruce Wiki",
     "content": "https://github.com/pr3y/Bruce/wiki"
   },
   {
     "menuName": "Bruce Site",
     "content": "https://bruce.computer"
   },
   {
     "menuName": "Rickroll",
     "content": "https://youtu.be/dQw4w9WgXcQ"
   }
 ]
}ERR: Fail Copying File

================================================================

Can't use anything in JS Int

Selected: AppStore
Running script: /BruceJS/AppStore.js
Could not allocate memory for file: /BruceJS/AppStore.js
Selected: JS Interpreter
Selected: browser_bruce
Running script: /BruceJS/browser_bruce.js
Could not allocate memory for file: /BruceJS/browser_bruce.js
Selected: JS Interpreter
Selected: highway_racer
Running script: /BruceJS/highway_racer.js
Could not allocate memory for file: /BruceJS/highway_racer.js
App menu item: label=bruce1 name=Bruce-1.17-beta
DEBUG: Cardputer ADV - Initializing TCA8418 keyboard
DEBUG: Initializing I2C with SDA=8, SCL=9
DEBUG: Scanning I2C bus...
DEBUG: Found I2C device at address 0x18
DEBUG: Found I2C device at address 0x34
DEBUG: Found I2C device at address 0x69
DEBUG: Found 3 I2C devices
DEBUG: Attempting to initialize TCA8418 at address 0x34
SDCARD mounted successfully
NVS: Finding keys in NVS...
SSID: myNetSSID
Settings stored in NVS successfully
App menu item: label=bruce1 name=Bruce-1.17-beta
Press the button to enter the Launcher!
Press the button to enter the Launcher!
Press the button to enter the Launcher!
Press the button to enter the Launcher!
Press the button to enter the Launcher!
Press the button to enter the Launcher!
Press the button to enter the Launcher!
Press the button to enter the Launcher!
Press the button to enter the Launcher!
Press the button to enter the Launcher!
Press the button to enter the Launcher!
App menu item: label=bruce1 name=Bruce-1.17-beta

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x2b (SPI_FAST_FLASH_BOOT)
Saved PC:0x4037a506
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce2890,len:0x1210
load:0x403c8700,len:0x18ec
load:0x403cb700,len:0x2fb4
entry 0x403c8958
[boot] Turned on because (1= POWERON_RESET or 5==ESP_RST_DEEPSLEEP) --> 12
[PSRAM] init=0 found=0 total=0 free=0 | internal free=107216 largest=61428
SDCard in a different Bus, using sdcardSPI instance
SDCARD mounted successfully
Failed to read config file, using default configuration **Loses config here**
{
  "D8:85:AC:A5:A0:A8": {
    "rot": 1,
    "irTx": 44,
    "irTxRepeats": 5,
    "irRx": 1,
    "rfTx": 3,
    "rfRx": 1,
    "rfModule": 1,
    "rfFreq": 433.92,
    "rfFxdFreq": 1,
    "rfScanRange": 1,
    "bleName": "Bruce Almighty",
    "rfidModule": 0,
    "gpsBaudrate": 115200,
    "iButton": 0,
    "CC1101_Pins": {
      "sck": 40,
      "miso": 39,
      "mosi": 14,
      "cs": 13,
      "io0": 5,
      "io2": -1
    },
    "NRF24_Pins": {
      "sck": 40,
      "miso": 39,
      "mosi": 14,
      "cs": 6,
      "io0": 4,
      "io2": -1
    },
    "PN532_Pins": {
      "sck": 40,
      "miso": 39,
      "mosi": 14,
      "cs": 1,
      "io0": -1,
      "io2": -1
    },
    "SDCard_Pins": {
      "sck": 40,
      "miso": 39,
      "mosi": 14,
      "cs": 12,
      "io0": -1,
      "io2": -1
    },
    "W5500_Pins": {
      "sck": 40,
      "miso": 39,
      "mosi": 14,
      "cs": 1,
      "io0": 2,
      "io2": -1
    },
    "LoRa_Pins": {
      "sck": 40,
      "miso": 39,
      "mosi": 14,
      "cs": 5,
      "io0": 4,
      "io2": 3
    },
    "ST25R_Pins": {
      "sck": -1,
      "miso": -1,
      "mosi": -1,
      "cs": -1,
      "io0": -1,
      "io2": -1
    },
    "i2c_bus": {
      "sda": 2,
      "scl": 1
    },
    "uart_bus": {
      "rx": 1,
      "tx": 2
    },
    "GPS_bus": {
      "rx": 15,
      "tx": 13
    },
    "badusb_bus": {
      "rx": 1,
      "tx": 2
    },
    "speaker_bus": {
      "bclk": 41,
      "ws": 43,
      "dout": 42,
      "mclk": -1
    },
    "mic_bus": {
      "clk": 41,
      "ws": 43,
      "data": 46,
      "type": 1
    },
    "buzzer": -1
  }
}DEBUG: Cardputer ADV - Initializing TCA8418 keyboard
DEBUG: Initializing I2C with SDA=8, SCL=9
DEBUG: Scanning I2C bus...
DEBUG: Found I2C device at address 0x18
DEBUG: Found I2C device at address 0x34
DEBUG: Found I2C device at address 0x69
DEBUG: Found 3 I2C devices
DEBUG: Attempting to initialize TCA8418 at address 0x34

Even after rebooting, cant use JS interp tools

Selected: JS Interpreter
Selected: dino_game
Running script: /BruceJS/dino_game.js
init interpreter:
PSRAM: [Free: 0, max alloc: 0],
RAM: [Free: 32960, max alloc: 14324]

Entering interpreter...
context created:
PSRAM: [Free: 0, max alloc: 0],
RAM: [Free: 26264, max alloc: 8180]

SyntaxError: not enough memory
SyntaxError: not enough memory
    at dino_game.js:20:43

======================================================================

@TurbulentGoat

TurbulentGoat commented Nov 16, 2026 •

Copy link
Copy Markdown
Author

Going to close this as a significant amount was fixed and no longer needed, and will just be simpler to start fresh. will submit a few smaller ones again soon

Ninja-jr pushed a commit to Ninja-jr/Bruce_firmware that referenced this pull request Nov 17, 2026
Ninja-jr pushed a commit to Ninja-jr/Bruce_firmware that referenced this pull request Nov 17, 2026
Ninja-jr pushed a commit to Ninja-jr/Bruce_firmware that referenced this pull request Nov 17, 2026
Ninja-jr pushed a commit to Ninja-jr/Bruce_firmware that referenced this pull request Nov 17, 2026
Ninja-jr pushed a commit to Ninja-jr/Bruce_firmware that referenced this pull request Nov 17, 2026
Ninja-jr pushed a commit to Ninja-jr/Bruce_firmware that referenced this pull request Nov 17, 2026
Ninja-jr pushed a commit to Ninja-jr/Bruce_firmware that referenced this pull request Nov 17, 2026
Ninja-jr pushed a commit to Ninja-jr/Bruce_firmware that referenced this pull request Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant