New to Raspberry Pi Pico Maker, it won't run my py file.

Please feedback the issue encountered while using Cytron official website (http://www.cytron.com.my), Cytron Technical Forum and Cytron Tutorial site (http://tutorial.cytron.com.my) here. We greatly appreciate any comments and suggestions too.

New to Raspberry Pi Pico Maker, it won't run my py file.

Postby jacksonloh0 » Sat Feb 27, 2021 3:45 pm

Hi, I am new to Raspberry Pi and got myself a Raspberry Pi Pico Maker and using Windows 10 and Thonny 3.3.5.

So, I just went through the tutorial by Cytron 'Read and Display Environment Sensor Data Using Raspberry Pi Pico and CircuitPython'. After finished the tutorial, I wanted to go back to my original demo version that came with the Maker Pi Pico. When I tried to copy back main.py from https://github.com/CytronTechnologies/M ... icroPython into my Maker Pi Pico, it won't run anymore. The shell in Thonny says
"Unable to connect to COM4: port not found
Backend terminated or disconnected. Use 'Stop/Restart' to restart."

I did just that, still the same. Then, I unplug and plug it back. Still same.

Do I need to do anything? First time playing with Pi.
jacksonloh0
Greenhorn
 
Posts: 3
Joined: Sat Feb 27, 2021 12:53 pm

Re: New to Raspberry Pi Pico Maker, it won't run my py file.

Postby Idris » Sat Feb 27, 2021 8:59 pm

Hi jacksonloh0,

MicroPython and CircuitPython have different firmware (bootloader). If you want to use MicroPython sample code, then you need to flash with MicroPython firmware first (1 time only). You can refer to this video - Getting Started with Raspberry Pi Pico with MicroPython.

Else, if you want to use with CircuitPython, you need to flash with CircuitPython firmware first (1 time only). You can refer to this video - Write & Read Data to the SD Card Using Maker Pi Pico and CircuitPython

In your case, you have program with CircuitPython, then you want to use back the original demo code which is in MicroPython. So, Thonny IDE can't detect the board, because the Maker Pi Pico doesn't have MicroPython firmware (*I consider you don't flash back to MicroPython, correct me if I'm wrong.). Suggestion: Try to flash the Maker Pi Pico with MicroPython firmware, then program the demo code.

What is the differences between MicroPython and CircuitPython in Raspberry Pi Pico?
You can read here - Getting Started with Raspberry Pi Pico and CircuitPython: MicroPython or CircuitPython?
Cytron Technologies invest time and resources providing tutorial, training and support for STEM education and maker movement. We need your support by purchasing products from Cytron Technologies. Thanks.
http://www.cytron.com.my
User avatar
Idris
Moderator
 
Posts: 409
Joined: Thu Mar 22, 2012 5:28 pm
Location: Pulau Pinang

Re: New to Raspberry Pi Pico Maker, it won't run my py file.

Postby jacksonloh0 » Sun Feb 28, 2021 9:49 am

Ah, thank you so much. I thought I bricked my Pico on my first try hahaha. So, every time I used the different firmware, I need to know which firmware I used before. BTW, is there any limit to number of flash and will I ruined my board faster? I meant changing back and forth the firmware.
Also, this message came up in my Thonny IDE. Is it normal?
WARNING: Could not sync device's clock: can't import name RTC
WARNING: Could not validate time: can't import name RTC
MicroPython v1.14 on 2021-02-05; Raspberry Pi Pico with RP2040
Type "help()" for more information.

Again, thanks Idris from Cytron for your help.
jacksonloh0
Greenhorn
 
Posts: 3
Joined: Sat Feb 27, 2021 12:53 pm

Re: New to Raspberry Pi Pico Maker, it won't run my py file.

Postby Idris » Mon Mar 01, 2021 9:09 am

Hi jacksonloh0, glad to hear that it solve the problem. :)

Yes, every microcontroller have limit number of flash and that number is too big. Normally, we (as a normal user) never hit that. Maybe the chip will obsolete first. :lol:

About the warning message on Thonny IDE, did the program runs on Pico?
Cytron Technologies invest time and resources providing tutorial, training and support for STEM education and maker movement. We need your support by purchasing products from Cytron Technologies. Thanks.
http://www.cytron.com.my
User avatar
Idris
Moderator
 
Posts: 409
Joined: Thu Mar 22, 2012 5:28 pm
Location: Pulau Pinang

Re: New to Raspberry Pi Pico Maker, it won't run my py file.

Postby jacksonloh0 » Fri Mar 05, 2021 4:32 am

Sorry for late reply. Yes, it can run all the code in MicroPython. Thanks.
jacksonloh0
Greenhorn
 
Posts: 3
Joined: Sat Feb 27, 2021 12:53 pm


Return to Cytron Website, Forum & Tutorial Site Feedback

Who is online

Users browsing this forum: No registered users and 6 guests

cron