Search found 15 matches

by MicroRichard
Fri Sep 09, 2022 6:35 am
Forum: Pyboard D-series
Topic: os.statvfs() returns negative numbers in tuple
Replies: 9
Views: 107169

Re: os.statvfs() returns negative numbers in tuple

The script is saved as main.py on the board. Perhaps after the creation of files you should add info = statvfs("/data") # Print the file system free bytes print("Free file system: {:d} bytes".format(info[0]*info[3])) Then, if you create a lot of files, you should see a negative number as system free...
by MicroRichard
Thu Sep 08, 2022 11:50 am
Forum: Pyboard D-series
Topic: os.statvfs() returns negative numbers in tuple
Replies: 9
Views: 107169

Re: os.statvfs() returns negative numbers in tuple

Just tested this problem with MicroPython v1.19.1-2-g8e3f8fb on PYBD-SF2W with STM32F722IEK and the os.statvfs() still reports a negative number which gives me reason to conclude the file system corruption still occurs. The following script might reproduce the problem, perhaps increase the number of...
by MicroRichard
Thu Sep 08, 2022 6:18 am
Forum: Pyboard D-series
Topic: WLAN access point not working micropython 1.19.1
Replies: 3
Views: 28627

Re: WLAN access point not working micropython 1.19.1

The pyboard is the pyboard D type and the firmware is MicroPython v1.19.1-1-g093d292 . When i use the code you mentioned an exception is raised saying ' unknown config param '. It has something to do with the security parameter. import network ap = network.WLAN(network.AP_IF) ap.active(0) ap.config(...
by MicroRichard
Wed Sep 07, 2022 3:53 pm
Forum: Pyboard D-series
Topic: WLAN access point not working micropython 1.19.1
Replies: 3
Views: 28627

WLAN access point not working micropython 1.19.1

With micropython 1.15 the following code worked to create an accesspoint. def enable_wifi(ssid, password): """ Enable device as WiFi access point Parameters ---------- ssid : String Broadcast WiFi SSID password: String WiFi password """ if not NetworkHandler.ap: NetworkHandler.ap = network.WLAN(netw...
by MicroRichard
Thu Sep 01, 2022 9:23 am
Forum: Pyboard D-series
Topic: os.statvfs() returns negative numbers in tuple
Replies: 9
Views: 107169

Re: os.statvfs() returns negative numbers in tuple

The boot.py is used once to format the flash. After that the boot.py is removed from the pyboard and the rest of the files are copied to the pyboard. Otherwise the boot.py would remove all contents.
by MicroRichard
Thu Aug 25, 2022 12:06 pm
Forum: General Discussion and Questions
Topic: How to run unit tests stored on host with mpremote?
Replies: 2
Views: 21503

How to run unit tests stored on host with mpremote?

Hi, i like to run unit tests stored on a Windows 10 host pc with mpremote. So basically the Pyboard D should run the unit_tests from this folder. I am not sure if this is possible. The number of unit tests can quickly increase and until now i have stored them on the Pyboard D device which takes a lo...
by MicroRichard
Tue Aug 23, 2022 2:41 pm
Forum: Pyboard D-series
Topic: os.statvfs() returns negative numbers in tuple
Replies: 9
Views: 107169

Re: os.statvfs() returns negative numbers in tuple

The device is a pyboard d, the micropython version is 1.15. This is the complete boot.py: import os, pyb os.umount('/flash') p1 = pyb.Flash(start=0, len=512*1024) p2 = pyb.Flash(start=512*1024) os.VfsFat.mkfs(p1) os.VfsLfs2.mkfs(p2) os.mount(p1, '/flash') os.mount(p2, '/data') os.chdir('/flash') The...
by MicroRichard
Tue Aug 23, 2022 1:22 pm
Forum: Pyboard D-series
Topic: os.statvfs() returns negative numbers in tuple
Replies: 9
Views: 107169

os.statvfs() returns negative numbers in tuple

In the boot.py i use the following: p2 = pyb.Flash(start=512*1024) os.VfsLfs2.mkfs(p2) os.mount(p2, '/data') This creates a littleFS data partition. Now i have created 135 files and when i run info = os.statvfs("/data") logging.info("Free file system: {:d} bytes".format(info[0]*info[3])) then the re...
by MicroRichard
Fri Aug 12, 2022 1:01 pm
Forum: Pyboard D-series
Topic: CAN bus heartbeat receive using asyncio is slow
Replies: 5
Views: 25469

Re: CAN bus heartbeat receive using asyncio is slow

For every task that is running i am trying to improve speed by removing blocking calls etc. More than one task contains a callback however and i am not sure how to deal with those. For example the LightSensorHandler below has a task that calls a callback function. The class Bootstrapper implements t...
by MicroRichard
Fri Aug 12, 2022 7:51 am
Forum: Programs, Libraries and Tools
Topic: Why do `rshell` and `ampy` run boot.py and main.py for every command?
Replies: 3
Views: 26879

Re: Why do `rshell` and `ampy` run boot.py and main.py for every command?

I am not sure if i understand you correctly but this is what i use to run the main.py on the pyboard. Download the following micropython github repo. https://github.com/micropython/micropython From this github repo there is a folder tools which has pyboard.py. You can use this to start main.py or an...