Micropython Display To Pc Screen

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Zcannon78
Posts: 7
Joined: Sun May 01, 2022 2:57 pm

Micropython Display To Pc Screen

Post by Zcannon78 » Sun May 01, 2022 5:25 pm

Hi All,

I am a intermediate python programmer who wants to start using micropython. I was wondering if their is a module or method that would allow me to display a gui (on my computer screen) that interacts with the pyboard or a similar microcontroller via the usb port. Something similar to Tkinter and Pyside.

RSC Games
Posts: 4
Joined: Wed May 04, 2022 2:18 pm

Re: Micropython Display To Pc Screen

Post by RSC Games » Wed May 04, 2022 9:42 pm

I do not believe a method or module exists for this in the MicroPython codebase. There could be other 3rd party modules for this, but if I were you I would just set up a python serial port listener, dump a framebuffer over UART to the PC, and use pygame to render it onscreen. I don't have any code for this, but I'm planning on writing a module (using WebREPL or equivalent) to project the graphics from a tiny OLED onto a PC screen, but not in the foreseeable future.

Zcannon78
Posts: 7
Joined: Sun May 01, 2022 2:57 pm

Re: Micropython Display To Pc Screen

Post by Zcannon78 » Fri May 06, 2022 7:14 pm

Would I use a cable like this to set up a serial communication between pyboard and the Pc?

https://www.amazon.com/Serial-Adapter-S ... 150&sr=8-4

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

Re: Micropython Display To Pc Screen

Post by Roberthh » Fri May 06, 2022 7:28 pm

Which Micropython board do you use? Many of these have a USB interface for serial communication. Then you would not need this cable. This cable is only required, if the board has 3.3 level UART only.

Zcannon78
Posts: 7
Joined: Sun May 01, 2022 2:57 pm

Re: Micropython Display To Pc Screen

Post by Zcannon78 » Fri May 06, 2022 7:35 pm

I am using the pyboard v1.1. It has multiple tx and rx pins for uart communication so I thought I would have to use them

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

Re: Micropython Display To Pc Screen

Post by Roberthh » Fri May 06, 2022 8:26 pm

You can use them, but the Python REPL prompt is at the USB port.

User avatar
wintifrosch
Posts: 12
Joined: Sun Mar 20, 2022 9:37 am
Location: Winterthur, Switzerland
Contact:

Re: Micropython Display To Pc Screen

Post by wintifrosch » Sat May 07, 2022 7:54 am

@Zcannon78: Try Thonny IDE. Good for starters.

Your idea of using USB is interesting, though.
Not an easy task, it could be a community project, since components using different technologies are required: Based on the USB/REPL interface and Browsers experimental USB-Interface (Chrome + Edge + Opera), a WebPage in your browser could talk to your microcontroller.
In addition, the project could provide libraries to reroute the communication over Ethernet instead of USB/REPL, i.e. for ESP devices.

cgglzpy
Posts: 47
Joined: Thu Jul 18, 2019 4:20 pm

Re: Micropython Display To Pc Screen

Post by cgglzpy » Sat May 07, 2022 2:53 pm

@Zcannon78 You may want to have a look at upydevice and the examples with pyboard v1.1 and pyqt at https://github.com/Carglglz/upydevice/t ... s/pyqt-gui

Zcannon78
Posts: 7
Joined: Sun May 01, 2022 2:57 pm

Re: Micropython Display To Pc Screen

Post by Zcannon78 » Sun May 08, 2022 2:41 am

@cgglzpy I tried out the upydevice library but my experience was inconsistent. I have been able to turn on and off the built-in leds and read the directories once. After I had uploaded different programs to the pyboard, the upydevice program stopped communicating with the pyboard and I had to reset. When I factory reset the pyboard, I tried to read the directory files again and it gave me the error NameError: name 'os' isn't defined. Although I could still turn on and off the leds.

RSC Games
Posts: 4
Joined: Wed May 04, 2022 2:18 pm

Re: Micropython Display To Pc Screen

Post by RSC Games » Mon May 09, 2022 1:45 pm

Did you by chance upload a file called "boot.py" or "main.py" and put a while loop in it?

Post Reply