Can the Wokwi (Python) editor be integrated into the Jumperless board?

My understanding of the build/coding process is that I program the Nano (i’ve installed myself in the Jumperless board headers) using the Arduino editor while the Nano is connected to the computer through the USB cable and then I can copy the code to WokWi so it can simulte the code and perform the wiring in WokWi after moving the USB cable to the Jumperless USB port.
Isn’t there a way to do anything in WokWi without having to change editor and cables? Or am I doing something wrong?

1 Like

To answer my own question (as a hardware and software guy) - I know there are no pins available for communicating - except the USB connection… I.e., the transfer of code has to go through that connection - and I can see a whole bunch of problems, as any compatible board can be put in the socket - with any type of USB connection!

1 Like

So I actually designed the hardware with that in mind. And there will be a way to do it once I get the firmware for it figured out.

Here’s the deal with that and how it will work:
So when you normally flash firmware to (most) Arduinos, the USB port is connected to some FTDI USB-UART chip, and those Tx and Rx lines that communicate between that chip and the ATmega are also connected to pins D0 and D1 on the Arduino. Which is relatively standard and should work with like 80% of boards in the Nano footprint.

What the Arduino bootloader does is as soon as the chip wakes from a Reset, it checks the UART lines (D0 and D1) for a short time and if it sees data on them, it loads that as firmware. (Try grounding those pins and flashing firmware, it doesn’t work.)

So, you can connect the RP2040’s UART lines to the Arduino’s D0 and D1 pins via the crosspoint switches, then briefly connect the Nano’s Reset line to ground (this part is actually already implemented) via Chip I, then send the firmware to the Arduino that way.

The format it wants to see is a compiled .bin (getting that from a .hex is trivial), so you need the Arduino-CLI to grab all the libraries and put it all together. This is the real pain in the ass part (for me at least), luckily, Wokwi has an option for “download compiled firmware”. I’ll ask Uri (the guy who made Wokwi) if there’s a way to pull that .hex file with an HTTP request or something. If there is a way, or he makes one in the future, this is totally doable.

It’s also weird because if I connect the lines and initialize UART, flashing from USB won’t work. So I’ll need to have the user choose. Or I’ll find some workaround in code for that.

Until that support happens, I could just make users manually download the .hex file and drag it to the terminal window. To me it seems like more trouble than just having 2 cables and Arduino IDE open, so I kinda shelved this until I can pull the .hex automatically. But I’d like to know what you think about doing this manually until I can convince Uri to add this feature to Wokwi.

About the unplugging cables thing, I set the hardware ID of the USB device read as “Jumperless”, so you can leave 2 cables plugged into the board and neither Arduino IDE or the bridge app will get confused or have issues with power. If you need more USB Mini cables I can send you some.

Let me know your thoughts on this because this is a pretty common request and I think this will be the next feature I’ll work on. And having some input for how you’d like this to work is really helpful.

1 Like

Well you already answered my next question - about having both the Arduino and Jumperless powered at the same time - and thanks - I have many cables already :smiley:
I would be great if I only need to work using Wokwi.

One last - unrelated question: Which part of the the Jumperless receive the selected voltage (3.3, 5 or 8V)? Only the board or also the plugged in “Nano”?

Here’s me asking the Wokwi guy about it, it seems like I’m going to need to do this myself with the Arduino-CLI.

But yeah, I was just messing around with writing code in Wokwi and the code completion and stuff is way nicer than in Arduino IDE. So I agree, getting everything working from just Wokwi is a priority now.
The intermediary step is to just allow you to drag that downloaded .hex file and have the Jumperless flash it to the Arduino, then I’ll get the compilation stuff working.

For the supply rail selector switch, that only powers the positive rails on the breadboard. Aside from that, those voltages are completely isolated and do nothing to the rest of the Jumperless.

The older revisions had those connected to a crosspoint switch, but if you had any capacitance plugged in between the rails and you switched voltages, it would act like a charge pump and you’d get a huge voltage spike that would fry stuff on the board.

1 Like

Make totally sense - after you fried from chips! :smiley:

Yeah luckily I was kinda sketched out about it when I was designing that so I added a cuttable solder jumper. So I just cut them for the Rev 2 boards before I sent them out.