Import

Simulate ESP32 code from an AI chat, without the hardware

To simulate ESP32 code from an AI chat without hardware, paste the reply here.

The box

Drop it here, or paste it

Mokxi opens it on a simulated ESP32, with the sensors and LEDs the sketch names already on its pins. WiFi, HTTP requests, a web server and Bluetooth are simulated as well, so a weather station or a web-controlled LED from a chat can be tried before a DevKit is on your desk.

A room monitor as a chat would write it: a DHT11 read every two seconds and an LED that comes on above 30 degrees. The link ends in &board=esp32, so it opens on the ESP32 DevKit V1 with the DHT11 on D4 and the LED on D13.

Paste from ChatGPT or ClaudeCopy a prompt, say what to build, paste the answer.
  1. 1Copy the promptIt teaches your AI how to write a Mokxi project.
  2. 2Say what to buildPaste the prompt into ChatGPT, Claude, Gemini or Cursor and add what you want, like "a night light with a light sensor".
  3. 3Paste its answer hereThe whole reply is fine. It opens wired and ready to run.

Only have a photo or a screenshot of the circuit? Give your AI the picture with this prompt instead.

Your AI app supports MCP? Add the Mokxi server and it builds the link for you. How

From Tinkercad? Three stepsBring a circuit across wired, with its code.
  1. 1Export the circuitIn Tinkercad, open the circuit, press Export and download the .brd file. It has every part and wire.
  2. 2Download the codeOpen Code, switch to Text and press the download button for the .ino.
  3. 3Drop both hereChoose or drop the .brd and the .ino together: it opens wired, with the code on the board. No .brd? Paste the Component List with the code under it.
Files and links

What Mokxi reads from an ESP32 chat reply

Arduino-style C++ for the ESP32, pasted bare or inside the reply it arrived in.

A sketch for the ESP32-S3, C3 or C6. A CONFIG_IDF_TARGET check in the code picks that chip, and a code link that ends &board=esp32s3, &board=esp32c3 or &board=esp32c6 says so outright.

ESP8266 code, which lands on a NodeMCU when it includes ESP8266WiFi.h.

Converted

What comes across

An ESP32, chosen from the includes

WiFi.h, WebServer.h, HTTPClient.h, BluetoothSerial.h, Preferences.h or ESP32Servo.h, or a call to ledcWrite, touchRead or dacWrite, tells Mokxi the sketch is for an ESP32, and it opens on the ESP32 DevKit V1.

WiFi that connects

WiFi.begin() joins a simulated network, HTTPClient fetches pages and WebServer serves them, on addresses under .mokxi that answer inside the tab. Signed in, you can switch on real internet and let the sketch call a real API over HTTP or HTTPS.

Bluetooth, on screen

BluetoothSerial and a BLE server talk to a phone in the Bluetooth pane of the editor. There is no radio under either one.

A check for 3.3 V mistakes

Assistants carry Uno habits over to the ESP32. Checkup in the editor reads the wiring and the code together and flags 5 V arriving on a 3.3 V pin.

Left out

What does not, and what happens instead

MQTT brokers

The simulated network carries HTTP only. A sketch with an MQTT client compiles, but the client cannot reach a broker, so an MQTT project gets no further than its connect call.

ESP-IDF and Rust projects

If the assistant wrote app_main() for ESP-IDF, or wrote Rust, Mokxi will not build it. The ESP32 boards here run Arduino-style C++, and MicroPython on the classic ESP32 chip.

A real radio

No 802.11 frame and no Bluetooth signal leaves your computer. Range, antennas and battery life are questions for the real board.

Step by step

From an ESP32 chat reply to Mokxi

  1. Step 1

    Tell the assistant which board you have, "ESP32 DevKit V1" or "ESP32-C3" for instance, so the pin numbers in its answer fit.

  2. Step 2

    Copy the answer and paste it into the box above.

  3. Step 3

    Read the chip in the editor. It says which ESP32 the sketch opened on and what was wired, such as "DHT11 on D4".

  4. Step 4

    Press Run and watch the serial monitor, where the readings print as they would over USB.

FAQ

Questions about importing from an ESP32 chat reply

Can I test ESP32 code without buying an ESP32?

Yes. The sketch is compiled in your browser and runs on a simulated ESP32 with its parts wired, so you see the serial output and the pins before any board arrives.

Does WiFi code from an assistant work in the simulator?

The Arduino WiFi, HTTPClient and WebServer calls do, over a simulated network with no radio behind it. Requests to real hosts need real internet switched on in the editor, which asks you to sign in.

Which ESP32 boards can the code run on?

A pasted sketch opens on the ESP32 DevKit V1, or on an ESP32-S3, C3 or C6 when the code or the link says so. The editor has eleven ESP32 boards in all, and the ESP32 simulator page lists them.

The assistant used pins from an Uno. What happens?

A pin the ESP32 does not have is left unwired, and the report says so with the reason. Ask again with the board named and the pins will match.

Does it cost anything to simulate an ESP32?

No. The ESP32 boards and the simulator are on the free plan, and trying a sketch needs no card and no account.

Simulate your circuit in minutes. Build it for real with Pro.

Start free