Controlling micropython board from desktop computer

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Marius
Posts: 21
Joined: Fri Nov 30, 2018 2:08 pm

Controlling micropython board from desktop computer

Post by Marius » Sun Apr 10, 2022 1:55 pm

I want to control a micropython rp2040 board from my desktop computer. Are there any good write ups for how to do this with pyserial or anything else?

tepalia02
Posts: 99
Joined: Mon Mar 21, 2022 5:13 am

Re: Controlling micropython board from desktop computer

Post by tepalia02 » Sun Apr 10, 2022 4:18 pm

Not sure. But this one may help if you're using a windows PC: https://picockpit.com/raspberry-pi/rasp ... n-windows/

BetterAutomations
Posts: 83
Joined: Mon Mar 20, 2017 10:22 pm

Re: Controlling micropython board from desktop computer

Post by BetterAutomations » Sun Apr 10, 2022 7:40 pm

What kind of control specifically are you looking to do? What's the goal?

User avatar
andypiper
Posts: 25
Joined: Wed Feb 02, 2022 12:17 pm
Location: Kingston upon Thames, UK
Contact:

Re: Controlling micropython board from desktop computer

Post by andypiper » Mon Apr 11, 2022 12:53 pm

I'm also curious what you mean by "control" here - are you looking to send serial commands, turn attached devices on/off?

Also, what kind of desktop computer are you using?

Nicolett
Posts: 7
Joined: Mon Apr 11, 2022 1:16 pm

Re: Controlling micropython board from desktop computer

Post by Nicolett » Wed Apr 13, 2022 7:20 am

maybe he was talking about a built in compilator? like arduino has one

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Controlling micropython board from desktop computer

Post by Roberthh » Wed Apr 13, 2022 7:42 am

AFAIK, there is no built-in compiler in the Arduino IDE itself. Arduino packages for a certain architecture install the respective compiler when the package is installed. The Arduino IDE then calls this compiler/linker.

Marius
Posts: 21
Joined: Fri Nov 30, 2018 2:08 pm

Re: Controlling micropython board from desktop computer

Post by Marius » Thu Jul 07, 2022 4:10 pm

IMG_20220707_180529(2).jpg
IMG_20220707_180529(2).jpg (161.89 KiB) Viewed 3651 times
Let me explain. This is my BOB BOB BOBS MOTHER BOARD. Its a RP2040 board for holding a Trinamic TMC5160 BOB(break out board).

I can control the TMC5160 board via the micropython repl. But i want to control it from some python3 code i run on my desktop. With pyserial or whatever. My desktop can be apple, win, ubuntu.

BetterAutomations
Posts: 83
Joined: Mon Mar 20, 2017 10:22 pm

Re: Controlling micropython board from desktop computer

Post by BetterAutomations » Thu Jul 07, 2022 6:25 pm

Rather open-ended question without knowing what it is you would do when controlling it (such as turning on a lamp) but one way to do it is send serial commands from the desktop. The uPy script listens with input() as though it were typed directly into the script, and outputs lines that are parsed on the desktop. Use new lines to delineate output.

https://pyserial.readthedocs.io/en/late ... intro.html

User avatar
scruss
Posts: 360
Joined: Sat Aug 12, 2017 2:27 pm
Location: Toronto, Canada
Contact:

Re: Controlling micropython board from desktop computer

Post by scruss » Thu Jul 07, 2022 8:02 pm

Maybe the OP's looking for something equivalent to Firmata, the serial remote protocol much used in interaction design? I don't know of any written-in-MicroPython implementations of Firmata, or any that could talk to a Trinamic board (stepper driver?)

BetterAutomations
Posts: 83
Joined: Mon Mar 20, 2017 10:22 pm

Re: Controlling micropython board from desktop computer

Post by BetterAutomations » Thu Jul 07, 2022 8:11 pm

scruss wrote:
Thu Jul 07, 2022 8:02 pm
Maybe the OP's looking for something equivalent to Firmata, the serial remote protocol much used in interaction design? I don't know of any written-in-MicroPython implementations of Firmata, or any that could talk to a Trinamic board (stepper driver?)
Firmata would be a great choice. I don’t think the Pi board needs to run uPy, they probably have an image just for that.

Post Reply