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.
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 » Mon May 09, 2022 2:01 pm

@Zcannon78 It seems that they pyboard requires a firmware update. In older firmware version, the module was called uos. In newer versions, you can both use os and uos.

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

Re: Micropython Display To Pc Screen

Post by Zcannon78 » Mon May 09, 2022 8:53 pm

What I ended up doing was using a TTL USB/UART module and connected the UART pins on the pyboard to the module. I then used the Pyserial library on my Pc to send encoded messages to UART(1) (COM4/TTL module), which were decoded by the Pyboard and vice versa. In the end I was able to have my tkinter program send and recieve data and change the state of the pyboard. I’m not sure if it was the best way to do it, but it works.
Last edited by Zcannon78 on Mon May 09, 2022 9:02 pm, edited 2 times in total.

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

Re: Micropython Display To Pc Screen

Post by Zcannon78 » Mon May 09, 2022 8:57 pm

RSC Games wrote:
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?
I don’t think so. The command didn’t work in REPL either.

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

Re: Micropython Display To Pc Screen

Post by Zcannon78 » Mon May 09, 2022 9:00 pm

Roberthh wrote:
Mon May 09, 2022 2:01 pm
@Zcannon78 It seems that they pyboard requires a firmware update. In older firmware version, the module was called uos. In newer versions, you can both use os and uos.
I don’t think that would be the case. I updated my pyboard a few days ago and the os command worked previously.

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

Re: Micropython Display To Pc Screen

Post by cgglzpy » Tue May 10, 2022 2:52 pm

@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.
@Zcannon78 if you reset the pyboard you need to import os module before calling

Code: Select all

os.listdir()
otherwise it will throw that error.
So you need to add

Code: Select all

import os
in boot.py or main.py or do

Code: Select all

import os; os.listdir()
for this to work every time.
I had uploaded different programs to the pyboard, the upydevice program stopped communicating with the pyboard and I had to reset
as @RSC Games said a while loop will block the REPL which is necessary for upydevice to work. You can break the while loop sending a keyboard interrupt/ CTRL-C character with e.g.

Code: Select all

device.kbi()

wangshujun@tom.com
Posts: 61
Joined: Fri Feb 15, 2019 9:22 am

Re: Micropython Display To Pc Screen

Post by wangshujun@tom.com » Mon May 23, 2022 2:18 am

You can take a look at the implementation of openmv, which contains the code to display the internal cache to the IDE. Openmv is an extended implementation of micro python, which should be more promising for transplantation

Post Reply