-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDTEST.Py - no module named pyb error #1
Comments
How are you running this example? Are you using |
Confirmed that I can connect to a brand new StackyPi (it runs MicroPython 1.17 as delivered). It contains a single file ( I don't see a file called |
sdtest.py file and main.py file are the same. we change the name so you can run as main file |
So to the point of this issue @dsssssssss9 how are you running the code? I haven’t seen a reference to |
Hi I connect my StackyPi to My PC Start up Thonny thonny reports i am running MicroPython v1.15-13-g530c76f6c-dirty on 2021-04-25 Files list shows sdcard.py & sdest.py i insert a blank, formatted sdcard into the StackyPi i double click on `import pyb, sdcard, os when i click on run i get the error message shown below...
|
We comment this part of the code, if you use pyboard then you need to uncomment this part of code. in stackypi we don,t need this part that's why we comment these lines |
I have not commented/uncommented anything ! this is the full sdtest.py as supplied on my StackyPi no other files or changes have been made to it in anyway - i just took it out of the box, plugged it in & ran the sdtest.py I have no pyboard from #2 it appears others have MicroPython 1.17 installed from the factory? However according to Thonny mine shipped with MicroPython v1.15-13-g530c76f6c-dirty on 2021-04-25 Could this be part of my problem? |
Still you get the same problem? can you send me the screen shot of the that part of code to our mail id |
I guess the most basic test that should have been provided for accessing the SD card would be the following one (successfully tested on a StackyPi with MicroPython v1.15-13-g530c76f6c-dirty): from machine import Pin, SPI spi=SPI(1,sck=Pin(10),mosi=Pin(11),miso=Pin(12)) |
Super strange, I just followed the same steps as you on my Mac (with a StackyPi that arrived yesterday) and it reports Per #2 it would be helpful to have a board definition so those of us interested could build our own firmware with an up-to-date MicroPython. I agree that @whab has provided a nice basic test example there. It might be a good idea for us to set up a community project for StackyPi examples to complement the stuff that SBC has provided. FWIW, it looks like the code in this repo is basically just (unattributed) adjusted copies of the Pyboard samples from the main MicroPython repository. |
Actually, that example only works if you already have a filesystem on the card, so it probably needs something more in case you have an uninitialised card or something not in vfat format. |
Started a repo to collect known information and examples. Discussions are available if you want to learn along with me! |
I get the following error for the marked line: from machine import Pin, SPI print("StackyPi SD Card Test") spi=SPI(1,sck=Pin(10),mosi=Pin(11),miso=Pin(12))
Any idea? |
I’ll check mine in the morning, but what version of MicroPython do you have on the board @ckuehnel ? |
delete all the files inside stackypi, and newly save sdcard.py from the sd_card folder, then run main.py from sd_card folder which is inside the stackypi directory. may be in some stackypi mistakenly the "sdtest.py" file save, we apologize for this |
This program will show some information about the StackyPi board
and the usage of some on-board resources of Raspberry Pi Pico Board
The external led blinks ones per second
This is a Raspberry Pi Pico with RP2040
Installed firmware version is v1.18 on 2022-01-17 (GNU 11.2.0 MinSizeRel)
Platform is rp2
Micropython version is 3.4.0
CPU frequency is 125 MHz
On-Chip temperature is 4.6 °C
Another problem is the chip temperature as you can see.
The used program is
# StackyPi_Internals.py
#
# This sample program shows some information
# and uses some on-board resources to illustrate their query
# (c) 2021-02-04 Claus Kuehnel ***@***.***)
import machine, time, sys, uos
from machine import Timer, Pin, ADC
led = Pin(25, Pin.OUT) # external LED on Pi Pico
t = Timer()
temp = ADC(4) # use channel 4 for measuring temperature
conversion_factor = 3.3 / (65536)
def blink(Timer):
led(1)
time.sleep_ms(20) # LED on for 20 milliseconds
led(0)
t.init(period=1000, mode=Timer.PERIODIC, callback = blink)
print('\nThis program will show some information about the StackyPi board')
print('and the usage of some on-board ressources of Raspberry Pi Pico Board\n')
print('The external led blinks ones per second\n')
print('This is a {}'.format(uos.uname().machine))
print('Installed firmware version is {}\n'.format(uos.uname().version))
print('Platform is {}'.format(sys.platform))
print('Micropython version is {}'.format(sys.version))
print('CPU frequency is {:3.0f} MHz'.format(machine.freq()/1e6))
# read value, 0-65535 across voltage range 0.0v - 3.3v
reading = temp.read_u16() * conversion_factor
# The temperature sensor measures the Vbe voltage of a biased bipolar diode, connected to the fifth ADC channel
# Typically, Vbe = 0.706V at 27 degrees C, with a slope of -1.721mV (0.001721) per degree.
intTemp = 27 - (reading - 0.706)/0.001721
print('On-Chip temperature is {:3.1f} °C'.format(intTemp))
Dr. Claus Kühnel - Talstr. 13b - CH-8852 Altendorf
Mobile +41-76-3960801
-- Aus dem Rheinwerk-Verlag: Arduino - das umfassende Handbuch ISBN 978-3-8362-7345-9 [https://www.rheinwerk-verlag.de/arduino-das-umfassende-handbuch/] --
Am 03.05.2022 04:10:34 schrieb Andy Piper ***@***.***>:
I’ll check mine in the morning, but what version of MicroPython do you have on the board @ckuehnel [https://github.com/ckuehnel] ?
—
Reply to this email directly, view it on GitHub [#1 (comment)], or unsubscribe [https://github.com/notifications/unsubscribe-auth/AABPZTGOWJ5HJFG44MSCGELVICDJLANCNFSM5S2J273Q].
You are receiving this because you were mentioned.Message ID: ***@***.***>
[24d478b1-430a-4452-b4d9-5a0b43eccf51]
|
Kindly format the SD card with the sd card formatter, and make sure the sd card format is fat32 format |
It would probably be better to have the sample check if the SD card is already initialised (or, have documentation that explains that this is necessary before it is run, since I also discovered this for myself and not from the information from SBC). The internals test code runs OK here but the temperature measurement seems to be off. I'll take a look. If you're interested, you're welcome to contribute that program to my StackyPi community project rather than having it as a comment inside an issue on this repo 😄 |
I will do that. But, I have no access for upload. What can I do?
Dr. Claus Kühnel - Talstr. 13b - CH-8852 Altendorf
Mobile +41-76-3960801
-- Aus dem Rheinwerk-Verlag: Arduino - das umfassende Handbuch ISBN 978-3-8362-7345-9 [https://www.rheinwerk-verlag.de/arduino-das-umfassende-handbuch/] --
Am 03.05.2022 13:29:06 schrieb Andy Piper ***@***.***>:
It would probably be better to have the sample check if the SD card is already initialised (or, have documentation that explains that this is necessary before it is run, since I also discovered this for myself and not from the information from SBC).
The internals test code runs OK here but the temperature measurement seems to be off. I'll take a look. If you're interested, you're welcome to contribute that program to my StackyPi community project [https://github.com/andypiper/stackypi-style] rather than having it as a comment inside an issue on this repo 😄
—
Reply to this email directly, view it on GitHub [#1 (comment)], or unsubscribe [https://github.com/notifications/unsubscribe-auth/AABPZTEAXNSQ2THUYCGVGPLVIEEX5ANCNFSM5S2J273Q].
You are receiving this because you were mentioned.Message ID: ***@***.***>
[9114fdce-60ac-4162-b458-b79a345bb644]
|
You can just send a pull request on GitHub. |
Hi
When i run the sdtest.py example that was supplied on my unit i get the following error...
Please help
The text was updated successfully, but these errors were encountered: