adidshaft/grok-gadgets-esp32-sdk

C++ SDK for Grok Bot gadgets over USB and Wi-Fi. One ESP32-S3 OLED kit has physical test evidence; build your own device commands. Experimental alpha.

C++

0

110 commits

updated Oct 12, 2026

See the code

See what people are saying

SourceMessageScoreDate

Grok Gadgets: open-source ESP32, Linux, gateway, and Home Assistant tools for Grok Bot (r/coolgithubprojects)

Project disclosure: I built Grok Gadgets. Grok Gadgets is an experimental open-source project for connecting devices to Grok Bot, with a gateway, Linux SDK, ESP32 SDK, Home Assistant integration, website, and simulator. Current hardware evidence: an ESP32-S3 + SH1106 OLED received “Hi from Grok Bot…

0

Oct 12, 2026

README

Grok Gadgets ESP32 SDK

Build USB and Wi-Fi gadgets for your Grok Bot with an Arduino sketch. Declare commands and events with grok::Gadget. The gateway connects your gadget to Grok Bot. The owner tested one ESP32-S3 OLED kit over USB and Wi-Fi. Experimental alpha: see the project status. Independent project, not affiliated with SpaceXSI.

First physical experiment

The delivered kit uses a YD-ESP32-23 v1.3, ESP32-S3 N16R8 board and a 1.3-inch SH1106 OLED. It includes the ApTechDeals breadboard and jumper wires. The delivered display differs from the ordered 0.96-inch module. Start with simulation, then follow the first experiment. The SDK supports custom gadgets. This kit is the tested example; AtomS3 Lite is an optional example with build evidence only.

Writing style: ASD-STE100-inspired English. Use short sentences, active verbs and one instruction per step. This is not certified compliance.

Quickstart

You need Python 3.11+, CMake 3.16+, Git and a C++14 compiler. No board or account.

git clone https://github.com/adidshaft/grok-gadgets-esp32-sdk.git
cd grok-gadgets-esp32-sdk
python3 -m venv .venv
.venv/bin/pip install -r requirements.lock
.venv/bin/pio pkg install
sh tools/check.sh
.venv/bin/python tools/check_contract.py
.venv/bin/pio run -e atoms3-lite-usb

Expected: eight host test suites pass, four sketch transcripts pass the contract check, and the optional C124 firmware compiles: build verified, hardware pending. Next, create your own gadget.

What a gadget looks like

#include <GrokSession.h>

bool on = false;
grok::Gadget gadget("Desk LED", "0.1.0", "esp32s3");

void report(JsonObject state, void *) { state["led"]["on"] = on; }
grok::Error setLed(JsonObjectConst args, void *) {
  on = args["on"];
  digitalWrite(4, on ? HIGH : LOW);  // your hardware
  return {};
}
void setup() {
  pinMode(4, OUTPUT);
  gadget.state(report);
  gadget.command("led.set", setLed, nullptr,
                 R"({"description":"Turn the desk LED on or off","type":"object",)"
                 R"("properties":{"on":{"type":"boolean"}},"required":["on"]})");
  gadget.button(0);
  gadget.begin();
}
void loop() { gadget.loop(); }

The schema's description tells the model what the command does. Declare the gadget as a global (it uses about 40 KB). The full version is examples/led-button; names, events and limits are in the library guide.

Flash a board

The gadget talks over USB to a bridge on your computer, and the bridge talks to the gateway. The first experiment describes the tested kit. Optional C124 build, flash and recovery covers flash offsets, the device ID, grok-gadgets-gateway enroll, usb-bridge and unplug recovery for C124. Use the OLED example for the tested ESP32-S3 kit. We welcome independent test results.

Grok Bot today

The owner used Grok Bot to run grok-gadgets-gateway rehearse on the Mac. The gateway log and the owner's display observation confirmed the Wi-Fi command (record). This is a local shell-command route. Native Grok Bot MCP calls remain unverified. The Mac must run the gateway. A USB charger powers the wireless board. A button press does not wake Grok Bot.

Learn more

TopicGuide
Commands, events and limitsLibrary
Retries, loss reports and reconnectsProtocol and recovery
Optional C124 pins, and the GPIO48 RGB_BUILTIN trapBoard sources
What was checked, and what is still openVerification and build-checksums.json
Dependency licenses before you share firmwareDependencies and NOTICE

Host tests compile the sketches against a simulated board; they never open a serial port.

Community

Show your build, ask for help and share ideas on r/GrokGadgets. Report bugs through the issue chooser. New here? Pick a good first issue and read CONTRIBUTING. Build errors: SUPPORT. Vulnerabilities: SECURITY. Contribute on the dev branch; main holds tagged stable releases (branches).

License and affiliation

Apache-2.0; see LICENSE and NOTICE. Grok Gadgets is an independent open-source project. It is not affiliated with, endorsed by or sponsored by SpaceXSI or xAI, which make Grok and Grok Bot, nor with M5Stack. We reconstructed the pre-publication commit dates; see the history record.

arduino
esp32
esp32-s3
grok
m5stack
sdk

adidshaft/grok-gadgets-esp32-sdk

C++ SDK for Grok Bot gadgets over USB and Wi-Fi. One ESP32-S3 OLED kit has physical test evidence; build your own device commands. Experimental alpha.

C++

0

110 commits

updated Oct 12, 2026

See the code

See what people are saying

SourceMessageScoreDate

Grok Gadgets: open-source ESP32, Linux, gateway, and Home Assistant tools for Grok Bot (r/coolgithubprojects)

Project disclosure: I built Grok Gadgets. Grok Gadgets is an experimental open-source project for connecting devices to Grok Bot, with a gateway, Linux SDK, ESP32 SDK, Home Assistant integration, website, and simulator. Current hardware evidence: an ESP32-S3 + SH1106 OLED received “Hi from Grok Bot…

0

Oct 12, 2026

README

Grok Gadgets ESP32 SDK

Build USB and Wi-Fi gadgets for your Grok Bot with an Arduino sketch. Declare commands and events with grok::Gadget. The gateway connects your gadget to Grok Bot. The owner tested one ESP32-S3 OLED kit over USB and Wi-Fi. Experimental alpha: see the project status. Independent project, not affiliated with SpaceXSI.

First physical experiment

The delivered kit uses a YD-ESP32-23 v1.3, ESP32-S3 N16R8 board and a 1.3-inch SH1106 OLED. It includes the ApTechDeals breadboard and jumper wires. The delivered display differs from the ordered 0.96-inch module. Start with simulation, then follow the first experiment. The SDK supports custom gadgets. This kit is the tested example; AtomS3 Lite is an optional example with build evidence only.

Writing style: ASD-STE100-inspired English. Use short sentences, active verbs and one instruction per step. This is not certified compliance.

Quickstart

You need Python 3.11+, CMake 3.16+, Git and a C++14 compiler. No board or account.

git clone https://github.com/adidshaft/grok-gadgets-esp32-sdk.git
cd grok-gadgets-esp32-sdk
python3 -m venv .venv
.venv/bin/pip install -r requirements.lock
.venv/bin/pio pkg install
sh tools/check.sh
.venv/bin/python tools/check_contract.py
.venv/bin/pio run -e atoms3-lite-usb

Expected: eight host test suites pass, four sketch transcripts pass the contract check, and the optional C124 firmware compiles: build verified, hardware pending. Next, create your own gadget.

What a gadget looks like

#include <GrokSession.h>

bool on = false;
grok::Gadget gadget("Desk LED", "0.1.0", "esp32s3");

void report(JsonObject state, void *) { state["led"]["on"] = on; }
grok::Error setLed(JsonObjectConst args, void *) {
  on = args["on"];
  digitalWrite(4, on ? HIGH : LOW);  // your hardware
  return {};
}
void setup() {
  pinMode(4, OUTPUT);
  gadget.state(report);
  gadget.command("led.set", setLed, nullptr,
                 R"({"description":"Turn the desk LED on or off","type":"object",)"
                 R"("properties":{"on":{"type":"boolean"}},"required":["on"]})");
  gadget.button(0);
  gadget.begin();
}
void loop() { gadget.loop(); }

The schema's description tells the model what the command does. Declare the gadget as a global (it uses about 40 KB). The full version is examples/led-button; names, events and limits are in the library guide.

Flash a board

The gadget talks over USB to a bridge on your computer, and the bridge talks to the gateway. The first experiment describes the tested kit. Optional C124 build, flash and recovery covers flash offsets, the device ID, grok-gadgets-gateway enroll, usb-bridge and unplug recovery for C124. Use the OLED example for the tested ESP32-S3 kit. We welcome independent test results.

Grok Bot today

The owner used Grok Bot to run grok-gadgets-gateway rehearse on the Mac. The gateway log and the owner's display observation confirmed the Wi-Fi command (record). This is a local shell-command route. Native Grok Bot MCP calls remain unverified. The Mac must run the gateway. A USB charger powers the wireless board. A button press does not wake Grok Bot.

Learn more

TopicGuide
Commands, events and limitsLibrary
Retries, loss reports and reconnectsProtocol and recovery
Optional C124 pins, and the GPIO48 RGB_BUILTIN trapBoard sources
What was checked, and what is still openVerification and build-checksums.json
Dependency licenses before you share firmwareDependencies and NOTICE

Host tests compile the sketches against a simulated board; they never open a serial port.

Community

Show your build, ask for help and share ideas on r/GrokGadgets. Report bugs through the issue chooser. New here? Pick a good first issue and read CONTRIBUTING. Build errors: SUPPORT. Vulnerabilities: SECURITY. Contribute on the dev branch; main holds tagged stable releases (branches).

License and affiliation

Apache-2.0; see LICENSE and NOTICE. Grok Gadgets is an independent open-source project. It is not affiliated with, endorsed by or sponsored by SpaceXSI or xAI, which make Grok and Grok Bot, nor with M5Stack. We reconstructed the pre-publication commit dates; see the history record.

arduino
esp32
esp32-s3
grok
m5stack
sdk