Input on emulating Pioreactor on Windows

I have been thinking about emulating a Raspberry Pi on my Windows computers to test out new code while my Pi is running experiments or when I don’t have access to the Pi. I found this article discussing various methods to accomplish this. Before I attempted this, I wanted to ask for any opinions on the matter.

  • Is it possible to emulate a Pioreactor OS on a virtual machine on Windows.
  • Has the Pioreactor team tried running the Pioreactor OS off a Windows OS, and if so, is there a recommended method?
  • Are there any benefits/downsides/complications to this that I might not be aware of?

I’m not sure if this is entirely possible given that emulation won’t have access to the physical hardware connected to a pioreactor (e.g., motors, leds, heaters, etc…).

The reason I ask is because I want to write and test Python scripts without having access to a Raspberry Pi. Right now, I want to test out how to send commands from RP to an Arduino via Serial and using Python. I haven’t tried anything like this before, so am I overlooking something? Is there another way I should approach this? Thanks.

Good question. Short answer: some things are easier to emulate than others.

Since Pioreactor core is written in Python, you can set up a local development environment on your Windows to run Pioreactor locally. We have some docs on getting an environment set up locally: Local development of Pioreactor | Pioreactor Docs. This set-up mocks out the GPIO pins, so it looks like GPIO pins activate, but nothing is actually happening. A local dev environment is how I test scripts / code locally, including testing the code you have provided.

As the link above notes, there are some file system additions that need to be done, and MQTT needs to be installed.

I work on OSX, but an intern in the summer successfully worked on Pioreactor from a Windows machine. The only weird thing in her setup was that she couldn’t crtl-c to exit running jobs… I’m happy to jump on a call / live chat to help you out setting up your environment, too.

Going a step further, with Docker Desktop, you can use a stack called QEMU to emulate a Raspberry Pi. More specifically, following the instructions for this CustoPizer software, you can enter the Raspberry Pi (but I don’t know how this would behave if you tried to use GPIO pins - maybe an error is thrown?). We use this to edit .imgs provided by the RPi Foundation with our software. Following CustoPizer’s instructions, the input.img you use could be our provided image. I don’t think you could do productive development work in this environment though, so I don’t advise this.

To interact with an Arudino requires a Raspberry Pi I think.