Import

Run a PlatformIO project online, converted to an Arduino sketch

Drop a PlatformIO project folder or its zip, or paste its GitHub link, and Mokxi runs it online in the simulator.

Import your own projectEvery tool Mokxi imports from
The box

Drop it here, or paste it

The board is read from platformio.ini, src/main.cpp is converted to sketch.ino with the rest of src/ and include/ beside it, lib_deps and the lib/ folder are compared with what the browser compiler carries, and the firmware runs on the board in the tab.

An Uno reading a DHT22 (MIT licensed), with platformio.ini, src/main.cpp and lib_deps = DHT sensor library. A Wokwi diagram.json sits beside it, so the circuit arrives wired and the code arrives the PlatformIO way.

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 PlatformIO

A folder or zip with platformio.ini at its top; a project nested deeper is found too, the shallowest platformio.ini winning.

A GitHub link to the repository, to a folder in it, to platformio.ini itself or to a file inside src/: Mokxi fetches the project around that file.

A project from Wokwi for VS Code, where diagram.json sits beside platformio.ini; the circuit comes from the diagram and the code comes the PlatformIO way.

A project with several environments. The report names them all and says which one it used.

Converted

What comes across

The board, from platformio.ini

The environment that builds by default, named by default_envs or else the first [env:...], gives its board id, read through the inverse of the table Mokxi’s own PlatformIO export writes plus the common aliases: uno, nanoatmega328, megaatmega2560, leonardo, esp32dev, nodemcuv2, d1_mini, rpipico, rpipicow, uno_r4_minima, nucleo_f411re, attiny85 and more. The report notes "platformio.ini builds for <board>", and the board can be changed.

src/main.cpp becomes sketch.ino

main.cpp is renamed sketch.ino and made the board’s main file; its #include <Arduino.h> and forward declarations work unchanged, as the report says. The other .cpp, .c, .h and .hpp files at the top of src/ and include/ come beside it as tabs, and a .pde is renamed .ino.

build_src_filter

When the environment sets build_src_filter, only the src/ files it allows are imported; the others are listed as left out by the filter, as PlatformIO leaves them out of the build.

lib_deps and lib/

Each lib_deps entry is read as a library line, as a Wokwi libraries.txt line is, and checked against what the compiler ships: stock, substitute, custom or missing. The project’s own libraries in lib/<Name>/ come in as custom libraries, less those lib_ignore names.

Left out

What does not, and what happens instead

Folders inside src/

A file in a subfolder of src/ or include/ is skipped with the note that a Mokxi project has no folders. Flatten them, or move the headers to the top level, before importing.

Libraries from a URL or a path

A lib_deps entry that points at a Git URL or a local path is marked missing, with the advice to download it and add it as a custom library; Mokxi fetches nothing named in lib_deps.

Frameworks other than Arduino

When the environment’s framework is not arduino (espidf, for example), the report says the code will not build as it is, because Mokxi builds Arduino sketches. The files still open for reading and editing.

Boards Mokxi does not have

If the board id matches no Mokxi board, the report says platformio.ini names a board Mokxi does not have, and the board is guessed from the code. Files outside src/, include/, lib/ and test/ are listed as not used.

Step by step

From PlatformIO to Mokxi

  1. Step 1

    Zip the project folder, with platformio.ini, src/ and lib/ in it, or have its GitHub link ready.

  2. Step 2

    Drop the zip or folder into the box above, or paste the GitHub link; typing mokxi.com/ in front of github.com/<owner>/<repo> in the address bar does the same. Mokxi answers "Looks like a PlatformIO project".

  3. Step 3

    Check the board the report proposes, and change it if the environment’s board is not one Mokxi has.

  4. Step 4

    The sketch compiles in the tab and runs on the board. A library marked missing can be added from the Library Manager search beneath the code.

FAQ

Questions about importing from PlatformIO

Can I run a PlatformIO project online without installing PlatformIO?

Yes. Drop the project or paste its GitHub link, and Mokxi reads platformio.ini for the board, turns src/main.cpp into the sketch and compiles it in the browser. The code then runs on a simulated board in the tab.

How is main.cpp turned into an .ino?

It is renamed sketch.ino and made the main file; nothing inside it is rewritten. Its explicit #include <Arduino.h> and its forward declarations are valid in a sketch, so it compiles as it stands.

Do my lib_deps libraries work?

A Library Manager name is checked against the libraries Mokxi ships, and most are there under their usual name. One Mokxi lacks is marked missing and can be installed from the Library Manager search; one fetched from a Git URL has to be downloaded and added as a custom library.

What about a project with multiple environments?

The environment named by default_envs is used, or the first [env:...] when there is none, and the report lists every environment with the one chosen. The others are not built.

Will an ESP-IDF project run?

No. Mokxi builds Arduino sketches, and the report says a project whose framework is not arduino will not build as it is. The files open, so you can read them and port the code.

Can I export back to PlatformIO afterwards?

Yes. The editor exports a PlatformIO project with a platformio.ini written for the board, so a project can come in, be tested in the simulator, and go back out.

Keep going

Where to next

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

Start free