Here is the notes document for next Monday’s CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if you’ll be attending the meeting - it’s super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1k0jC2OVIoslSAK_jhq6ioTEbY5Ep1MChD5UIOSRIHgA/edit?usp=sharing
#circuitpython-dev
1 messages · Page 9 of 1
The bundle zips are created on a Linux VM so I don't know why they would have Mac specific metadata attached.
I think macOS is adding the extended attribute when Python downloads them.
I won't be fit to review or test it but if you think of tagging me in the fix PR I'm curious to find out the answer
Will do! I’m going to take a stab at it this afternoon after work. I think writing a unit test is actually going to be harder than writing the patch in this case. LOL (The circup unit tests are ripe for someone to refactor all of those MagicMocks into some test fixtures, but that’s a bigger project than I am prepared for this week.)
I do know enough to help you make the ci run on a Mac VM if that comes in handy
downloading using curl on 10.15 doesn't seem to set the quarantine attribute. it seems weird but maybe circup is doing something explicit to set the attribute? or using a library that does?
it just writes into a new file
@jaunty juniper and @tame creek since you weren't in our Weekly meeting today, I wanted to let you know you got a massive hug report from me for helping me out this weekend. I was trying to finish up something that's already way past its deadline, and kept running into things I didn't know how to fix. Your help was imperative. Thank you so much!
in order to have a progress bar during download it uses click.progressbar and writes into a file from a requests.get stream
I was listening 😉
Oh! I was busy trying to keep track of if Paul needed any help 😄
I missed you being there.
I try to follow somewhat when i can and I look at the notes 🙂
Fair enough! I basically knew that, but like I said, was entirely focused elsewhere today.
i don't see anywhere obvious in circup that's explicitly setting the quarantine attribute, or running anything to do the download that might set it
well no of course we don't set it, what surprises me is that it's not even downloading directly, but writing an arbitrary file, does that mean that they put that attribute to every file ???
maybe it's a beta thing
More investigation: pwmout_reset() appears to be buggy.
CircuitPython version
Adafruit CircuitPython 7.3.3 on 2022-08-29; S2Mini with ESP32S2-S2FN4R2
Board ID:lolin_s2_mini
And
Adafruit CircuitPython 8.0.0-beta.0 on 2022-08-18; S2Mini with ESP32S2-S2FN4R2
Board ID:lolin_s2_mini
Code/REPL
import wifi
import ipaddress
SSID = "Virus"
print("Connect to {}".format(SSID))
wifi.radio.connect(SSID)
ipv4 = ipaddress.ip_address("8.8.4.4")
print("Ping google.com: %f ms" % (wifi.radio.ping(ipv4)*1000))
...
The reason I chose the RFM95 over the RFM69 is because the packet length is longer. Thought I read somewhere the RFM69 only does 8 characters and the RFM95 does 32. Didn't even think about it until just now that I'm working with 252 characters. I think packet length is worth noting in the product guide. I got far more characters available to me than I purchased it for, allowing something like a messenger to become a viable project.
Please use the "Feedback? Corrections?" link in the guide to provide your suggestion. That attaches it directly to the guide and doesn't leave it simply on Discord.
I feel you there 😄
Wow so the issue that @errant grail discovered actually affected about 30 boards. Looks like lingering code from trying to remove the auto brightness stuff.
That little bug started out as maybe a small little thing then grew up to be a 6 headed hydra.
It's neat to see how this one finally gets resolved after many people were looking into it during help desk session. It was really cool to see others breaking out their displays and running code to help narrow it down within an hour but we obviously missed a ton of other boards it was affecting.
The time slowdown was pretty small at 50KHz on other boards. A look at the code confirms (at least for ATMEL) setting the PWM duty cycle only happens at the end of a cycle. So at 10Hz that is not very often.
Looks like boards only with a built-in display so I would have never detected it on my featherwing tft?
I was going to check if you were getting progress on that. If you need a test later let me know
It affected any setup where you used the backlight_pin/pwm settings when creating the display. So it could affect non-built-in displays too (it did for me)
the logic for pwmout_reset was wrong; it was resetting only the never-rest PWM's 🙂 . It works on all boards now except Feather ESP32-S2 TFT. I reordered display init a bit in main.c. Strangely ESP32-S3 TFT is OK. So there
Hmm I have a modified featherwing tft with backlight pwm and it didn't affect me.
is still something wrong somewhere, but it's a lot better.
We have had weirdness on some samples of these Feather TFT's. It might be a reset timing problem.
The boards where the PWM was set at 50Khz was barely noticeable too. If you set it up at 500Hz you would see it. Don't try 10Hz 🙂
the pwmout_reset bug was general on all ports ?
well maybe this ? https://github.com/adafruit/circuitpython/issues/6223
oof since april, that'll be super cool if it fixes that one too.
could be -- first pass is here https://github.com/adafruit/circuitpython/compare/main...dhalbert:circuitpython:espressif-pwmout-reset but I am making some more cleanup changes before submitting the PR
if i remember correctly cgrover said he's been dealing with it since may? so april/may sounds like prime real estate for it to start rearing its head.
it was stopping the PWMs no matter what
it might also be unrelated, I'll test when it's in
actually I haven't tested since, who knows if it didn't fix itself in the mean time 😛
I’ve been working on various display and palette brightness projects since about April, but didn’t see the performance issue until August.
Duh that’s right and how Foamyguy tracked it to the aug 10th commit.
Another example of how well the community works together and "shows the work." I soak in as much experience and techniques as possible. I hope to grow up to be on-par some day.
I think the "best" part of it too was it was literally one line. For the slowdown at least, the brightness issue is another thing.
I just found out why ESP32-S2 TFT was changing to a dark display, but ESP32-S3 TFT was not. The issue was in the .... ESP32 camera code (!), which was resetting PWM channel 0 willy-nilly without checking it really had to.
this is a second bug on top of the other one i found
oh wow
huh, the PWM peripherals aren't double-buffered on those devices? (or CircuitPython isn't using such when available?)
i dunno, it really shouldn't have been resetting the PWM so much anyway
it is the LEDC peripheral
yeah, it should probably at least have waited for an actual display refresh period
I'm not really sure how the PWM worked, just noticed it was being called every background refresh. It really only needs to be set if it changes
-
Fixes #6896.
-
The logic in
pwmout_reset()was not checking the "never reset" flags for PWMOut correctly. It was partly the inverse of what it should have been. Fix this. The display brightness PWMOut was being reset multiple times due to this. -
esp32-cameracode was resetting LEDC channel 0 clock by mistake, causing dark display on ESP32-S2 TFT. -
Removed some power-pin-reset bug workaround code which may or may not have been necessary due to this bug.
-
Reordered display initia...
Tried this on a funhouse both with the automatic and manually creating the display. Works fine now (manual test I set the frequency back to 500Hz just to ensure that was gone).
Side note: is there a reason the funhouse SPI frequency is so low compared to other boards? Not related to this PR but noticed it while reviewing.
Do some or all bug fixes get back ported to 7.3.3? How would I know if a bug fix that might fix my board was added to 7.3.3, like do I need to track commits or do you wait for a 7.3.4?
This sounds very similar to the behavior I’m getting on my Adafruit feather esp32-s2 except I’m not even using WiFi in my code, I’m using lora. https://github.com/adafruit/Adafruit_CircuitPython_RFM9x/issues/81
Every other save seems to be a common issue. I was getting double outputs to repl on my rp2040 feather too. Things happening in sets of 2 all over the place lately.
I’ve written in some error handling that’s preventing the program from crashing the script but I’m not getting ha...
Adds support for the BananaPi BPI-Bit-S2 Boards.

Based on esp32s2 chip.
with 25 ws2812 LEDs, 1 buzzer, 2 photosensitive sensors, 1 thermosensitive sensor.
2 buttons on the front, 1 reset button and 1 boot button on the back.
Hi @lone axle , at one point in a stream you were checking the speed of triangle(?) of some library on the Titano(?). It could be related to the way lines are drawn. https://github.com/adafruit/Adafruit_CircuitPython_Display_Shapes/blob/main/adafruit_display_shapes/triangle.py 3 out of the 4 call to _line are for lines where the line has the same "y" and are made for filling the triangle. I did not find the implementation of _line but my assumption is that if those are continuous pixel in a memory location, there is a fast way to "memcopy" that or even with Python array slice trick. Either _line check that condition, or you may want a _horizontal_line function? I hope it can be usefull.
connect() is successful when an IPv4 address is obtained, so the AP is expected to be able to assign IPv4 addresses to connecting stations. Is it possible some of the open AP types are not assigning an IP address, or accepting a static address when using set_ipv4_address()?
We selectively backport some fixes to the stable release. You can see whether a related issue is assigned to the 7.3.x or 7.x.x milestone, or if a PR targets the 7.3.x branch. If you need this fix for your product then your best bet is to open a PR targeting the 7.3.x branch to open a concrete discussion
Yes, sorry, fixed.
No worries. I'm just not super familiar with the CircuitPython code base, so it wouldn't completely surprise me if there was an fs_rename() as well.
Ok, code moved. I also re-ran all the checks with Web Workflow again with the same results. I wasn't sure how to test the changes inside fat_vfs_rename().
Ok, it looks like the extmod/vfs_fat_fileio2.py unit test is now failing from this change and this has gone way over my head.
Thanks for working on it. I will add this to my list to work on. Since it's not a show-stopper, I won't do it immediately, but will try to fix before 8.0.0.
UGH. @tulip sleet Keypad isn't available for the NeoKey Trinkey?
I guess I'll sort out doing it manually. All I want is a spacebar press. And it's becoming a lot of code. 😄
no room on non-Express SAMD21
debouncer?
or just do a little delay after detecting the keydown
bigger delay is probably also ok
that is the least code
This is for a remote trigger for my phone camera, because I need two hands in a lot of these guide photos.
50-100ms min is probably fine
So I was hoping to bang this out quick. Which is not happening, heh.
self-timer on camera phone?
just copy paste https://learn.adafruit.com/USB-foot-switch-circuit-python/software ?
There are Reasons this might not work.
how to turn on voice command option to take photos or record videos by speaking to the phone. This feature is found on Samsung mid range and flagship phones.
Samsung Galaxy android 12 and One UI 4.0.
- Disclaimer * this tutorial or video is not intended to fix any broken devices, fix software issues or work for every device the same way.
🟢 Lik...
And yes, but absolutely not, I am never setting up my phone to be listening to me for any reason.
There's a toggle on my phone.
mechanical?
Oh you mean overall.
I get that it's listening. But I refuse to actually set up the software that ensures it will respond.
let's not give in to the paranoia
it's not paranoia when they really are out to get you
It's not paranoia for me, I simply hate having that feature on. Responds to anyone talking to the same software, etc.
yeah I disable that too, my point is that it's not always on, but you can enable it temporarily
so it stays fresh longer
now, a Clue that listens to you and presses space via bluetooth when you say something on the other hand
All of these examples involve more than one button/switch
I cannot figure out the flow control for one.
Either it's sending spacebar all the time
or not at all
OK, I apparently didn't even set up the switch right in the first place.
It reports True all the time, pressed or not.
How did I mess that up?
import time
import board
import digitalio
import neopixel
import usb_hid
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS
from adafruit_hid.keycode import Keycode
keyboard = Keyboard(usb_hid.devices)
keyboard_layout = KeyboardLayoutUS(keyboard)
key_switch = digitalio.DigitalInOut(board.SWITCH)
key_switch.switch_to_input(pull=digitalio.Pull.UP)
pixel = neopixel.NeoPixel(board.NEOPIXEL, 12, brightness=0.2)
while True:
print(key_switch.value)
time.sleep(0.1)```
That's what I have right now.
there's only one button in the USB Foot Switch guide though
then why does it do list or whatever to set it up like there's more
That's what I don't get, I don't want to deal with that.
right, future proofing
Sigh. I'll copy it.
maybe we need a simpler sample code
We do. But I guess I'll deal with this for now since I am pressed for time.
Nope.
It doesn't work.
Adding some more documentation in support of #6326
is the button between the pin and gnd ?
It's not sending spacebar all the time this time, but it's still not sending it on press either.
It's a NeoKey Trinkey
The keyswitch has a pin.
That's it.
Built in.
ah the trinkey
Is that a pulldown or something?
This is a documentation only PR!
Hah!
Pull down at least makes it change state.
I'm rolling with this, even if it's wrong.
yep the trinkey needs a pulldown
OMG it works.
(╯°□°)╯︵ ┻━┻
LED doesn't turn off when you stop pressing the key, but whatever.
Ok now it does.
So the delay, I set it to 0.5, is that too high?
I really don't expect to be spamming the phone to take photos.
And would rather not do exactly that.
Simply means it takes the LED that long to turn off as well.
Do you have this saved somewhere to copy paste? Lol
Oh! .. No you do /tableflip in the input box for Discord, and it resolves to that emoji.
No!
Lol
You can omit these definitions as of #6678.
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here.
Just a minor change, due to a recent PR.
connect()is successful when an IPv4 address is obtained, so the AP is expected to be able to assign IPv4 addresses to connecting stations. Is it possible some of the open AP types are not assigning an IP address, or accepting a static address when usingset_ipv4_address()?
As soon as I submitted this I realized the 7.3.3 bug is going to be harder to test because I'm not sure what the issue with that network is. I can probably run Wireshark at the coffee shop and see exactly what the...
The webpage: https://circuitpython.org/board/espressif_esp32s3_box/ doesn't have a section Install, Repair, or Update UF2 Bootloader like it's 'brother' on page: https://circuitpython.org/board/espressif_esp32s3_devkitc_1_n8r8/ does.
For this reason I tried to build a port for the ESP32-S3-BOX in micropython/ports/espressif however unfortunately did not succeed. The build succeeded without error but did not create the .bin neither .uf2 files.
Not sure if this is still relevant but I believe a password is required, the field cannot be blank. Unsure if that was ever resolved but it was an issue that prevented many people from joining open wifi networks. I haven't tested it recently though and no idea about its status.
I don't think that's correct. I am able to join open Wi-Fi networks with no passwords on 7.3.3 with connect() and no password, except for when it's a captive portal type access point that doesn't have internet access.
Hi, the content of circuitpython.org is managed at https://github.com/adafruit/circuitpython-org
The bootloader section depends of the board having a bootloader_id in its description.
And for that the board must have a board definition in the tinyuf2 repo. Which it doesn't right now.
I don't have the board, but note that adding it to tinyuf2 is pretty much similar to adding it to Circuitpython, copy an existing similar board (say the S3 TFT feather) and make a few changes, using the CP board files to help sometimes.
I just also was thinking about doing something like that.
in the circuitpython repo /ports/expressif/boards there is a board definition for the ESP32-S3-BOX. See the (edited) screenshot combo below. I guess that a board definition could be added to the tinyuf2 repo, isn't it ?

Right, you could extract some or all of the info you need from the CircuitPython definition.
Closing this as it isn't a CircuitPython issue. If you have build issues, there is a Discussions section in the tinuf2 repo:
https://github.com/adafruit/tinyuf2/discussions
@tulip sleet Are you still here? It's totally ok if not.
Trying to figure out how to word an explanation of why the "deep sleep" numbers on the Feather V2 are more "light sleep" numbers. e.g. How much detail to get into or how to say it.
If you want to run wording past someone I am around, though only have a passing knowledge of why that was the case
It's a right-now problem, not a Feather problem. Dan's working on a fix in CircuitPython that will get it down to legit deep sleep numbers. But the fix isn't available yet.
So... I have no idea how much of that to explain.
Or maybe what I said works.
I'm trying to recall was it because a pin was left on in deep sleep mode (if I recall?)
Yeah all pins are pulled up when deep sleep starts.
Which means power pins are also pulled up and turned on.
So turning them off in software does nothing.
You could also just say that "due to a known issue deep sleep current is higher on X boards. We hope to resolve this in the near future" or similar to that?
No problem
I was seriously overthinking it. My brain is kind of mush at this point. Been doing photos all day for this guide, and spent the last hour and a half putting them into the guide and rewording everything to make sense. It should have been dinner time two hours ago, heh.
I completely get that feeling. At a certain point your brain cannot read it/think about it anymore objectively that day
bah
how do I word "We hope to resolve this in the near future" without using "we"
which is counter-indicated in guides
hmmm
This issue is targeted to be resolved...
This issue is planned to be resolved...
Maybe "Track this issue <GH issue link here>"
That's an excellent idea, but I'm not sure if that might confuse folks more. 😕
The issue is being investigated, and a fix is expected in the near future.
?
vague but valid?
I like that too... even The issue is being actively investigated (if that is true makes it sound like it is a priority)
Welcome! Let's not tell me 20 years ago his primary job would be writing documents and away from development 🙂
😄 I feel you
i agree with all this; the current issue with ESP32V2 is turning out to be even weirder, so don't bother with details
Thanks for follow up. Glad we nailed it.
Just checking - is this the best channel for someone with questions about the actual process of building CircuitPython from the source on github? There's someone over in #help-with-circuitpython having build issues, and I wanted to know if this is the correct place for them.
Yep, this is the best channel.
Thank you! 👍
@tulip sleet With the .env file removal being necessary, is that something worth noting on this page? Or might that not be the case once a fix is in and I shouldn't mention it? Or no idea with it getting weirder...
I don't that's related to power consumption. it's related to thonny issues
And ... since I'm here, I have a really weird one from my one attempt to build CircuitPython. I got it all building and running just fine on a Feather RP 2040, everything looked really peachy. I then tried importing an MPY file from the bundle, and it raised a really odd exception - it complained about incorrect byte order.
I have a suspicion I know what's going on, but have no clue whatsoever (a) if I'm right, and (b) if so how to fix it.
Many many many years ago (like the mid 1980s) I worked with the UCSD P system, that was a very early "byte-code" system. P-Code files were composed entirely of 16 bit words, but to deal with the "endianness" issue e.g. Intel vs Motorola CPUs of that era, the first word in the P-Code file was always 1. If you read the first word, and got 256, you knew the whole file was byte-swapped, and could react appropriately,. Does this sound even remotely plausible for what I had happen?
could you show the exact error, and which file were you importing?
I probably can, but it may take a while. I've since flashed it with the uf2 from Adafruit, i I'd have to reflash it with my image. Which means backing up what's on it, for the sake of safety. Give me a few minutes ...
@thorny dove the missing "minify" you are getting would be due to not installing some pythong packages: https://learn.adafruit.com/building-circuitpython/build-circuitpython#install-required-python-packages-3086211
what platform did you build it on?
From the CircuitPython repo I tried to build for a board using make BOARD=espressif_esp32s3_box . The build appeared successful ('Build files have been writtten to: ...') however: a) no .bin neither .uf2 is created; b) one error occurred: ModuleNotFoundError: No module named 'minify_html'. The CPY repo is V8.0.0-beta.0 with esp-idf version 4.4.1. The build took place from within a MS Windows 11 WSL2 (Ubuntu 20.04) session.
Did you see my suggestion above about doing the pip3 installs?
the minify package is installed when you do pip3 install --upgrade -r requirements-dev.txt as described in the link
@tulip sleet. I did all the steps in the 'Install Required Python Packages' (and everything else on that page)
I can try to repeat the pip3 install steps
minify_html was added rather recently, so if you did it a while ago, it would not have been isntalled
$ pip3 list |grep minify
minify_html 0.10.0
is what I have now
@tulip sleet i just dit the requirements_dev one and yes... I see: Collecting minify_html Downloading minify_html-0.10.0-cp38-cp38-manylinux_2_27_x86_64.whl (699 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 699.3/699.3 kB 75.5 MB/s eta 0:00:00
Sounds weird, but it was built in a Docker container based on Ubuntu:2004, hosted on a Windows system.
do a make BOARD=... clean and then try make BOARD=... again
@tulip sleet I have to add that I did a fresh clone of the CircuitPython repo after I had various problems with the previous clone (in which I the the pip3 installs today also)
Lemme get the container spun up first ...
I wonder if it was something being treated as a text file when it should have been binary
@tulip sleet maybe I forgot to repeat the steps in the new clone
the pip3 installs are not specific to the clone
Ok
but you have to do them inside the venv created by esp-idf/export.sh
I just did
OK
@tulip sleet I saw various times during the pip3 install Requirement already satisfied: So, various requirements were already there.
minify_html was added to support the web workflow, which uses HTML and javascript
Thanks for the elaboration
i have to get off for a while, I will circle back in something over an hour
@tulip sleet I wouldn't have thought so. I used git inside the container to do the check out, and I know from past experience that files read and written by a linux container on a Windows host respect linux conventions, not Windows.
@tulip sleet Now the build goes steps further as b4: ```Partition table binary generated. Contents:
ESP-IDF Partition Table
Name, Type, SubType, Offset, Size, Flags
nvs,data,nvs,0x9000,20K,
otadata,data,ota,0xe000,8K,
ota_0,app,ota_0,0x10000,2M,
ota_1,app,ota_1,0x210000,2M,
uf2,app,factory,0x410000,256K,
user_fs,data,fat,0x450000,11968K,
[8/826] Building C object esp-idf/mbedtls/mbedtls/library/CMakeFiles/mbedcrypto.dir/bignum.c.obj```
Wow, in WSL2 the time to build is way much longer as in a real Linux / Ubuntu session.
Oh, you mean #6878 ?
I was a little confused when I checked #6678, but it's ok, I got your point 😄 👌 .
@tulip sleet directly from the repl using my uf2:
>>> import board
>>> import digitalio
>>> import busio
>>> from adafruit_wiznet5k.adafruit_wiznet5k import WIZNET5K
>>> import adafruit_wiznet5k.adafruit_wiznet5k_socket as wiz_socket
>>> spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
>>> cs = digitalio.DigitalInOut(board.D10)
>>> eth = WIZNET5K(spi, cs)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "adafruit_wiznet5k/adafruit_wiznet5k.py", line 202, in __init__
File "adafruit_wiznet5k/adafruit_wiznet5k.py", line 222, in set_dhcp
File "adafruit_wiznet5k/adafruit_wiznet5k_dhcp.py", line 490, in request_dhcp_lease
File "adafruit_wiznet5k/adafruit_wiznet5k_dhcp.py", line 383, in _dhcp_state_machine
File "adafruit_wiznet5k/adafruit_wiznet5k_dhcp.py", line 234, in send_dhcp_message
File "adafruit_wiznet5k/adafruit_wiznet5k_socket.py", line 264, in send
File "adafruit_wiznet5k/adafruit_wiznet5k.py", line 791, in socket_write
File "adafruit_wiznet5k/adafruit_wiznet5k.py", line 872, in _get_tx_free_size
ValueError: Invalid byteorder
Whereas if I switch to the uf2 from Adafruit's web site, everything works perfectly.
@olive turret is this relevant to the byte-order issue? https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k/pull/64 (via https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k/issues/66#issuecomment-1241211958)
@dhalbert I made force-pushed , combine two commits into one , no more changes.
That's probably it. The line that's raising the exception in my case is:
return int.from_bytes(val, "b")
However, I'm actually using the mpy files from the bundle, I just have the bundle source that I can look at for reference. TL;DR somewhere between the downloaded uf2 getting built, and mine getting built, this error crept in. Which also has me puzzled because I'd gone out of my way to make sure I had checked out the same source as was used to build the reference uf2.
Can you make a PR to https://github.com/adafruit/circuitpython-org now? Details in the README. Thanks.
Thanks for the reminder, I'm working on it.
Side note: is there a reason the funhouse SPI frequency is so low compared to other boards? Not related to this PR but noticed it while reviewing.
This is related to #6236 and #6416, though I don't know whether FunHouse needs a change for linearity as well.
@tulip sleet good morning. Today I booted my desktop PC into real Linux/Ubuntu 20.04. In the home folder I cloned the CPY repo. I did all the needed steps as described in the link you sent me yesterday. Then a successful build for BOARD=espressif_esp32_box took less than a minute! After reset the CIRCUITPY drive was mounted. I was able to open and read the code.py file. So, I guess, things are looking OK. I go to reboot my PC into MS Windows 11. Then I go to try to install @lone axle's flipclock repo.
In the past WSL had slow file access. I thought they fixed that mostly in WSL2. Also, are you using make -j<n> ?: https://learn.adafruit.com/building-circuitpython/build-circuitpython#use-all-your-cpus-when-building-3086075
Yes I was using -j6
Anyhow the build did not finish. Somewhere it hang. I have made a screenshot of the last group of lines the build process spit out to the WSL2 terminal window
@tulip sleet My comment about the Funhouse SPI speed was just out of curiosity why it was so slow vs other boards. Then this morning I remember there was a Funhouse display glitch that was solved by slowing SPI down. And I may have been the one to do that and had forgot 🙂
@tulip sleet build result in Linux/Ubuntu session for BOARD=espressif_esp32s3_box.
that is not the screenshot above, which looks successful?
Yes, this image is from this morning (my time) in Linux/Ubuntu session where the build of the BOARD was successful.
Resulting in CIRCUITPY drive
looks like a good build to me, am I missing something?
After the successful BOARD build (shown above), after reset and CIRCUITPY is present the run of code.py results in a immediately reset in safe mode informing me that an 'internal wachtdog timer expired' error occurred. I don't know how to solve this one.
Updated to nightly build hoping it would sort some stuff out after UM pushed a PR for LDO pin and some other bug hunt stuff going on recently. Still getting the same issue. Hasn't given me a hard fault crash yet. After a couple minutes after hard reset Mu doesn't seem to be able to save to the board. It's hanging during the process and waits to reload forever, indefinitely. Ctrl+C or Ctrl+D unresponsive.
Adafruit CircuitPython 8.0.0-beta.0-47-gae64f9fd7 on 2022-09-14; FeatherS3 with ESP32S...
I just read this informative article: https://www.allaboutcircuits.com/technical-articles/watchdog-timers-microcontroller-timers/ I wonder how I can arrange at CPY repo BOARD build time I can disable de internal WDT.
no but it means that it crashes basically, we have currently open issues related to crashes I think
OK
you know what I don't actually know
I tried this. Seems to help in a part in the beginning
usually the internal watchdog is there to detect when some part of the code crashes
Yes, that I read in the article I mentioned
but maybe it's not set correctly 🤷
So, it is a safeguard to get control back if something goes wrong.
I repeat 'wdt.feed()' in the main loop of the program
or maybe it's crashing when the user-set watchdog triggers, causing the internal watchdog to trigger ?
I inserted these WDT lines after the internal WDT errors appeared immediately after a reset in an attempt to solve them
With this simple piece of code, no WDT error. Ergo: must be a problem in the code or in the used libraries. I go to check all of them.
Btw: this new statusline in CPY V8.0.0-beta.0 doesn't end with a linefeed, so the first print statement will be joined at the end of the CPY status line. Odd.
Here you see that the first print command is joined at the end of the CPY status line
yeah there's tweaking to be done to the status line
So, I did a test "by hand" in the REPL of the mu-editor: ```
import wifi as wifi
wifi.radio.connect("<ssid>","<password>")
No, I believe gc.collect impacts the memory allotted to the program space that code.py uses, whereas given the error,
MemoryError: Failed to allocate Wifi memory
it appears to be during the core's startup and initialization and how it allocates memory for the code managing the wifi components so gc.collect shouldn't have access to that block. But just in case I tried it as well (because it was a great suggestion and even if it didn't solve it, it does help confirm that it's as...
@thorny dove esp32-s3 box? possibilities: • difference in config between box and other -S3 devices (particularly that would affect runtime behavior); • differences in network environment
I believe espressif wdt is seperate and distinct from the CircuitPython alarm module watchdog, see: https://github.com/adafruit/circuitpython/commit/d42c811fb9c37ce0eda811f3e47304b75e2ae691
certain wdt errors in the core could trigger safe mode
alarm module is for user-level hangs
@crimson ferry Thank you. Yes that is what is happening. The internal WDT triggers
@crimson ferry the scan for networks, b4 the 'wifi.radio.connect()' worked as you can see in the screenshot
@KeithTheEE yes, the memory error is in wifi init, and arises from an esp-idf call. Using the espidf module, could track usage of espidf memory https://docs.circuitpython.org/en/latest/shared-bindings/espidf/index.html. Could also allocate some PSRAM to esp-idf memory using CIRCUITPY_RESERVED_PSRAM= in the .env file, but I really don't think that should be necessary if things are working right... just for a scan.
Oops, was using 7.3.3 libraries. Added in 8.x libraries and it's working better. It refuses to reconnect to wifi if using Mu to soft-reload. It'll never connect. Hit reset and keep Mu closed and it will connect to wifi every time. Can only use Mu for serial monitoring after a hard reset. As soon as you hit save, auto reload, it'll never connect again.
Haven't hit safe mode & hard fault with new 8.x 9/14 bundle libraries yet.
This is due to some other bug (something is looping or hanging), so you don't want to disable the watchdog timer)
The coproc module adds ability to load, run and halt pre-compiled programs on a co-processor or another cpu core.
Currently, this is implemented on esp32s2 utilizing its built-in risc-v co-processor.
Should FINALLY fix the infrastructure issues page
@skickar Nice, last I checked on that one was 7.3.2
I give up my efforts to use CPY with the ESP32-S3-BOX (for the moment). I flashed CPY 7.3.3 and then the script give a hard crash. I'll wait until I read positive news about CPY for this device.
@jepler @gamblor21 Just need another review. Latest commit is just the merge commit for the fix to the camera library. The code is the same.
Worked on my FunHouse. Looks good to me.
Was there a preliminary guide/instructions on getting CircuitPython installed on a C3?
No guide that I'm aware of. Not sure about other docs.
I guess it would be the same as on an ESP32, except some C3 boards don't have a serial chip so they might need to be put in bootloader mode, I don't remember if that's required on the QT PY
this guide could be extended to the C3 https://learn.adafruit.com/circuitpython-with-esp32-quick-start/installing-circuitpython
Thanks. I just was quickly looking at it as I have a C3 sitting on my desk, but then got distracted
Thanks, this looks neat! I didn't do any detailed review, but I do have some questions after a quick glance.
How, if at all, does this control what pin(s) the coprocessor can access (read/write)? With rp2pio, which is conceptually in a similar vein, scott took care to make sure it could not interact badly with other pin uses like pwm or digitalio. However, it's also pretty easy to tell via introspection what it is possible for the loaded code to do. Saying that this is harder with risc-v c...
Thanks for this PR! we ended up solving it differently, see #6890. Please feel free to open a fresh PR or issue if it didn't address your needs.
CircuitPython version
Adafruit CircuitPython 8.0.0-beta.0-49-g14fc4a079 on 2022-09-14; Seeed XIAO nRF52840 Sense with nRF52840
Code/REPL
>>> import board
>>> u = board.UART()
>>> u.read()
b''
Behavior
The call to read should return None when it times out with 0 bytes read like other ports, instead returns b''.
Description
Similar to #6332
Additional information
No response
@proven garnet Funny you should tag this issue with documentation an hour ago, I just forked the Macropad repo a few hours ago to work on it: https://github.com/adafruit/Adafruit_CircuitPython_MacroPad/issues/40 - can you help me? I can't figure out where the documentation is - it's not in api.rst, instead I see automodule:: adafruit_macropad - I'm not sure where to go next
got it! Thanks!
you test it by pip installing requirements.txt and docs/requirements.txt (preferably in a venv personnally) and running:
cd docs
sphinx-build -E -W -b html . _build/html
and thanks again, been a couple years since I used sphinx
I ran pylint and black without issues after my update, but my commit is failing with an error when pre-commit runs. The full console output is here (I don't know why it lists every file in my venv): https://gist.github.com/prcutler/8a21b6ca3182cda4248ec04930cde4ad
The only thing I see in the summary at the end is: Unfortunately, your project is not compliant with version 3.0 of the REUSE Specification :-( If anyone has an idea, please let me know what I did wrong
ah reuse doesn't know to ignore .venv
you can add .venv after .env in gitignore, it's in the cookie cutter now, I think that will make reuse ignore it
i'm trying to build Circuit python using the excellent instructions at https://learn.adafruit.com/building-circuitpython. Everything builds correctly, the only issue I appear to have are several directories indicating version control issues, even though git status reports up-to-date. Any ideas? Screenshot below from VS code.
submodules are often checked out in "detached head" that might be what it's telling you, ignoring that's is the way it's supposed to be
python-semver on HEAD (2001c62) via 🐍 v3.9.6
❯ git status
HEAD detached at 2001c62
nothing to commit, working tree clean
because fetch-submodules will only fetch the minimum I think, if you git submodule sync --quiet --recursive && git submodule update --init it might stop saying that
Thank you, that worked! submitting my first PR now. 🙂
but then you'll be pulling in Gigabytes of broadcom SDK 😉
@jaunty juniper thank you. For sure the points me in the right direction
or just ignore it, that's what I do with vscode 😁
Doesn't that make it painful to generate pull requests?
in case anyone is interested https://www.cloudbees.com/blog/git-detached-head
as you've seen, it doesn't affect git status
it's just vscode being weird
listing submodules as if they were independent git repos I assume
got it. I typed the question before finding the answer ...
just close that triangle and ignore it
yup
Ha! Nice, I was just going through library issues, sorry for the late response, but looks like you're all sorted!
This is the intended fix, I think I have an adabot patch waiting for this actually.
yeah I was gonna ask about that 👍
Yup, I do: https://github.com/adafruit/adabot/pull/298
Thanks for this PR! we ended up solving it differently, see #6890. Please feel free to open a fresh PR or issue if it didn't address your needs.
Cool! No problem!
When I try git commit now, I encounter the problem that circuitpython.pot is automatically modified. Skipping it can indeed solve the problem, but I'm not sure whether it will have an impact after submitting the PR. I'll do it first.
I know the problem is caused by pre commit:
pre-commit run --all-files
Check Yaml...............................................................Passed
Fix End of Files.........................................................Passed
Trim Trailing Whitespace.................................................Passed
Translations.............................................................Failed
···
sed -e '/"POT-Creation-Date: /d' > locale/circuitpython.pot
···
Based on esp32s3, all available pins are drawn.
2M PSRAM, 8M FLASH.
A JST SH 4-pin Connector can be used for STEMMA QT / Qwiic.
A MX 1.25mm 2-Pin Connector Lithium battery power supply.
A WS2812 LED.
what's the right way to handle version numbers when building Circuit python? After a build from Main it looks like the version number is set to head, causing subsequent library load to fail. You can see the build number and the failure in the screenshot, pulled from boot_out.txt and REPL
Hi folks... I was putting together CP board definitions for my TinyPICO boards (ESP32) and well, my boards don't have any way of controlling IO0 and IO0 is not broken out for the user to use either, as the boards only have an auto reset circuit on them.
There is no UF2 bootloader for the ESP32, so IO0 is not needed for that, but is there anything else that's going to be a problem with not having a "boot" button possible?
ESP32 chip?
the lack of a button would make it impossible to get into safe mode I think, like the original Huzzah32
but it's supported
Ok, No way to do it from the web interface? Though I guess that won't appear if the device is stuck.
TinyPICO uses a PICO-D4
yeah it would be nice if we had a solution, dunno how though
I'm getting this... obviously part of the new web workflow.. but no idea how to fix it.
So I have to install minify_html manually?
File "../../tools/gen_web_workflow_static.py", line 7, in <module>
import minify_html
ModuleNotFoundError: No module named 'minify_html'
make: *** [build-unexpectedmaker_tinypico/autogen_web_workflow_static.c] Error 1
make: *** Waiting for unfinished jobs....```
Surely not? Shouldn't the build system take care of any dependancies etc ?
it's in requirements-dev.txt ?
Are there build docs specific to this?
python requirements are installed manually
hmmmmm
maybe it's missing that you need to install them in the ESP-IDF environement ?
I've never had to install any manual python dependancies before when working with CP. Maybe I've just been lucky?
that could be done automatically
I have my own script that does all the steps, I don't remember what you really need to do
the guide says to install them at the start https://learn.adafruit.com/building-circuitpython/build-circuitpython#install-required-python-packages-3086211
sometimes you need to redo it to update
but do you need to do it after esp-idf/export.sh ?
not sure... trying now
yeah I do it in my script
I installed req and got past that error., but now get new ones ! hahaha
oh yeah it says:
You will need to repeat the pip3 install commands described here so that they take effect inside the Python environment set up by source esp-idf/export.sh. But you will need to do this only once.
Maybe I should go to bed and sleep and try again tomorow!
yeh, this is going badly...
from ../../shared-module/displayio/Bitmap.h:33,
from ../../shared-bindings/displayio/Bitmap.h:30,
from build-unexpectedmaker_tinypico/autogen_display_resources-en_US.c:2:
esp-idf/components/newlib/platform_include/assert.h:20:10: fatal error: sdkconfig.h: No such file or directory
#include <sdkconfig.h>
^~~~~~~~~~~~~
compilation terminated.
make: *** [build-unexpectedmaker_tinypico/autogen_display_resources-en_US.o] Error 1
make: *** Waiting for unfinished jobs....
so I'm going to bed!
How, if at all, does this control what pin(s) the coprocessor can access (read/write)?
The idea with this module is to provide pre-compiled examples on top of which a user can build there code.
For instance, a pin-control example code running on the co-processor can have the ability to keep track of the available/busy status of pin(s) with CircuitPython. On the S2 this is achieved by defining global variables to which both main cpu and co-processor have read/write access.
Is there ...
How, if at all, does this control what pin(s) the coprocessor can access (read/write)?
The idea with this module is to provide pre-compiled examples on top of which a user can build there code.
For instance, a pin-control example code running on the co-processor can have the ability to keep track of the available/busy status of pin(s) with CircuitPython. On the S2 this is achieved by defining global variables to which both main cpu and co-processor have read/write access.
Is there ...
We depend on your clone having the "tags" present (and that the correct tag be findable via the "first parent"). If you used a technique like a shallow clone, these tags might not be present. If your internet bandwidth is not at a premium, doing a fresh full clone is the way I'd recommend proceeding. Otherwise, after creating a shallow clone here's how our CI ensures it has the tags it needs (it's a fragment of the python script tools/ci_fetch_deps.py: ```py
run(
"Fetch back to the start of 2021 to get tag history",
'git fetch --tags --recurse-submodules=no --shallow-since="2021-07-01" https://github.com/adafruit/circuitpython HEAD',
)
run(
"Fetch back to the start of 2021 to get commit history",
f'git fetch --recurse-submodules=no --shallow-since="2021-07-01" origin {ref}',
)
@onyx hinge i used "make fetch-submodules" so would expect to have a shallow clone, per the build instructions. Does ci_fetch_deps.py get involved by make BOARD=.... Or do I need to run it manually first?
@edgy edge hum these instructions https://learn.adafruit.com/building-circuitpython/build-circuitpython should result in the main repo being complete including tags. In the top level of circuitpython, what does git tag --list "8*" print?
@onyx hinge interesting. When I follow the link you just sent the building circuit python the instructions I see do not include the git submodule update step. See Screenshot. I'll give that a try
the top code block hasgit clone https://github.com/adafruit/circuitpython.git cd circuitpython make fetch-submodulesand the following text states that the fetch-submodules step functions a substitute for running git submodule type commands.
The initial problem, in which your CircuitPython build is not marked with a version like "8.0.0-..." is probably not related to submodules, because the version number is associated with the circuitpython repository itself.
Initially making a shallow clone of circuitpython itself with --depth=1 reproduces the problem where the description of the git version is just a commit ref string: ```jepler@bert:/tmp$ git clone https://github.com/adafruit/circuitpython.git --depth=1
Cloning into 'circuitpython'...
…
jepler@bert:/tmp$ cd circuitpython/
jepler@bert:/tmp/circuitpython$ tools/describe
14fc4a0
I agree 100% with your assessment, and so does git tag --list "8*" which returns null. What process change is needed to get the version number correctly included?
If you used git clone https://github.com/adafruit/circuitpython.git (without any --depth argument) as your initial clone command then we need to pursue what element of your git configuration led to you having a shallow clone so that we can update the text for other people who may have a similar configuration.
In any case, the command used during CI appears to fetch the needed tag info: git fetch --tags --recurse-submodules=no --shallow-since="2021-07-01" https://github.com/adafruit/circuitpython HEAD
Does your command history show you what initial git clone command you used?
cut/paste git clone git@github.com:aulitech/circuitpython.git
after creating a fork from main
oh from your fork
… Just following directions
OK, and github recently started changing the default settings for a fork, making it so that it does not copy tags (and calls it "copy the (name) branch only")
OK, this text will need to be revised:
But if you want to make changes, you might want to "fork" that repo on GitHub to make a copy for yourself, and clone from there.
because github has made "fork and clone" not work in the way we require.
@edgy edge Repeating this so you can try it and let me know if it gets you going:
In any case, the command used during CI appears to fetch the needed tag info:
git fetch --tags --recurse-submodules=no --shallow-since="2021-07-01" https://github.com/adafruit/circuitpython HEAD
thank you!!! Tremendously appreciate the quick response. Not sure how I could've missed something so totally obvious
@tulip sleet ^^^ you'll want to read back through this later
@edgy edge Thanks for taking the time to troubleshoot with me, we'll make it better for the next person with this information.
building now ...
looks like a winner: Adafruit CircuitPython 8.0.0-beta.0-50-g505b8f5a6e on 2022-09-15; Aulitech Cato with nRF52840
Board ID:aulitech
UID:E3031BF92BB05686
sorry for the duplicate Post. Discord seems to be devouring them
is there an easy way to change the name circuit python to something else per your branding recommendation
No, we'd rather you upstream your board.
this is just a trivial port of Seeed BLE Sense to optimize for running Neuton ML models with IMU, BLE and battery management. Happy to upstream but I feel like it's an edge case
Only 77 of the 329 supported boards are from Adafruit, we love adding other makers' boards. Well, we love it when other makers add their boards, to be fair.
OK will do. Hope you don't mind putting up with rookie mistakes. 30 years of embedded experience, but brand new to python and contributing to open source projects
You're doing great so far! Happy you joined us.
are there any guides for building libraries, cooperative threading, monitoring memory and performance? My goal isn't to get the last bit of performance - it's just to make sure we don't overload the system causing reliability problems. Our products Will be used by disabled people, they need to be really stable.
for making new modules in C we have https://learn.adafruit.com/extending-circuitpython/overview though I think it's a little stale.
We don't have a multithreading model, though some platforms (espressif) do have freertoos. in python code, we have asyncio.
https://learn.adafruit.com/Memory-saving-tips-for-CircuitPython talks about monitoring and conserving memory from the point of view of python code.
and of course as a last resort you may want to have a watchdog so that your device restarts automatically when it's not running properly https://docs.circuitpython.org/en/latest/shared-bindings/watchdog/index.html
You might want to chat with @tough flax if you're working in the assistive technology realm
The watchdog is number one on my dev list. Thanks for the reference to @tough flax. Our intent is to open source a variety of assistive technology products including hardware and software. We have a roadmap that includes trainable IMU and audio models that can drive BLE input devices ranging from TV remote control to wheelchairs and robotic feeding arms. If you can twitch a body part you can control your environment. We would love to be working with the QT PY RP 2040 but really need integrated IMU and microphone in a wearable form factor so stuck with Seeed
Hi, we create a Type support (typings) python package for CircuitPython built-in binding packages: types-circuitpython
So fixed some typing errors throw by pyright check.
Thanks for finding these missing Optional[] things!
So I/we need to update the initial forking instructions, sounds like
CircuitPython version
Adafruit CircuitPython 7.3.3 on 2022-08-29; Adafruit Feather M4 Express with samd51j19
Code/REPL
import time
import board
import busio
import displayio
from adafruit_display_text import label
from adafruit_display_shapes.rect import Rect
from adafruit_display_shapes.roundrect import RoundRect
from adafruit_bitmap_font import bitmap_font
import adafruit_displayio_ssd1306
from analogio import AnalogIn
from digitalio import Digi...
Here's the wav file in case it helps (zipped because github doesn't support .wav files)
shot.wav.zip
Add providing an optional sequence of DigitalInOuts in alarm.exit_and_deep_sleep_until_alarms(). The pin states are preserved during deep sleep, allowing finer control over power consumption.
Currently implemented only on Espressif boards.
Also fixed up a few typos and improved code readability in a few places.
Running the same sample code, but adding the line, print("ESPIDF Heap caps free: ", espidf.heap_caps_get_free_size()) once per program run, I end up with the output:
ESPIDF Heap caps free: 58808
Code done running.
soft reboot
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
ESPIDF Heap caps free: 56688
Code done running.
soft reboot
Auto-reload is on. Simply save files over USB to run them or enter REPL to dis...
Could you test with 8.0.0-beta.0 from https://circuitpython.org/board/feather_m4_express/ ? Assuming that also crashes, we will then try to prune the example down. Thanks.
It appears (to me) that: (1) there is a small memory leak in the CP core or (more likely) in the esp-idf; (2) supervisor.reload() does not clear esp-idf memory usage since the exception happens in wifi init (from importing). So microcontroller.reset(), hard reset (button), or power cycle is necessary to get back to a clean state. I don't recall this being an issue in older version of esp-idf, perhaps it was introduced with an update.
Will do. I trimmed the example down to:
import time
import board
import digitalio
import adafruit_debouncer
trigger_pin = digitalio.DigitalInOut(board.D12)
trigger_pin.direction = digitalio.Direction.INPUT
trigger_pin.pull = digitalio.Pull.UP
trigger = adafruit_debouncer.Debouncer(trigger_pin)
while True:
trigger.update()
if trigger.fell:
print('shot')
And still getting the hard crash (still on 7.3.3). Debouncer is verbatim from
Still crashing with 8.0.0-beta.0 (with the 8.x.x updated libraries from the 20220914 bundle)
Adafruit CircuitPython 8.0.0-beta.0 on 2022-08-18; Adafruit Feather M4 Express with samd51j19
Board ID:feather_m4_express
UID:D3E65A943546395320202033262C05FF
Occasionally it would crash so hard it would no longer leave FEATHERBOOT until I re-uploaded the .uf2 file
Curiously, on my Adafruit CircuitPython 8.0.0-beta.0 on 2022-08-18; Adafruit QT Py ESP32S2 with ESP32S2, where repeated scans and reloads show a full complement of APs, the esp-idf free memory stays relatively constant at around 50-51kB. Using:
print(f"{gc.mem_free()} {espidf.heap_caps_get_total_size()} {espidf.heap_caps_get_free_size()} {espidf.heap_caps_get_largest_free_block()}")
Which brings up additional complicating factors: • differences in network environment; • possib...
I did not have web workflow enabled either, so that might be a key bit to narrow down the issue
Seems to work fine on 7.3.3 on a Metro M4 Airlift, but sadly I don't have another Feather M4 to test with at the moment...
I tried this obvious change, and confirmed the duty cycle is set to 100 internally. However, the waveform does not become uniform.
This is before the change:

This is after the change (changing divisor to 0xffff):

The RMT documentation does not explain this, and ...
I tried this with 7.3.3 a on Feather M4 Express, and toggled D12 to ground with a jumper. I am not getting any crashes.
I'd suggest reformatting CIRCUITPY, and then reloading the libraries (adafruit_ticks and adafruit_debouncer). Using circup makes loading the libraries very easy. So do this:
>>> import storage
>>> storage.erase_filesystem()
and then restore the test program and the libraries.
If you are still getting a hard crash, I suspect hardware. Is D12 just co...
Refreshed everything and still getting the hard crash, so I'm going to chalk this up to a hardware issue and close it
- Fixes #6903.
- Subsumes draft PR #6349.
nRF port returned b'' instead of None when UART.read()returned nothing. Now it returnsNone`, which is consistent with all the other ports.
Made this clear in the busio.UART.read() documentation, taking a note that was in #6349.
- Fixes #6369. Really finishes the fix, by removing the now unneeded workaround. The actual fix was due to #6898.
Tested on a Feather ESP32-S2 TFT. It no longer blanks the display on restart.
There is a lot in this issue which is now addressed by #6907.
Since other people have tested the base functionality, I am just making some cleanup commits. There are a couple of stray changes in submodules, and there is an stdio_init_all() that I think is left over from debugging.
Doing a bisect I believe I managed to track down the origin of the problem with #6531
Which is an IDF update, quite appropriately.
@tulip sleet the NRF uart issue was found on the forum by someone trying to run this guide: https://learn.adafruit.com/uart-communication-between-two-circuitpython-boards/code
maybe the guide code should be updated to test if byte_read instead of if byte_read is None since the fix is not gonna be in immediately ?
if not byte_read, yeah, if you make a PR to the Learn guide I will approve it right now.
since the fix is only for 8.0.0 anyway
I will edit the pasted in part of the code in the guide
lemme check that I don't forget the not and I'll push
I just changed the pasted page example
@jaunty juniper I am running with about two brain cells, and one of them is about to tap out. But would you be able to explain to me what you did to isolate the IDF update? Specifically the workflow involved to track it down?
I usually do it manually because downloading a file is faster than compiling. A bisect is when you use a binary search algorithm to find the first commit that has an error (or anything)
with git you use the git bisect command
get to a commit that is "bad", git bisect start, then tell it it's bad with git bisect bad
then checkout a "good" commit, and git bisect good
Ok! I always mentally think of it as way more techinally nitty-gritty than that. So hearing that makes it feel more doable to me.
How did you decide how far back to look at the beginning of the bisect?
then bisect will automatically checkout a commit in the middle (hence the binary search)
make sure it's a compilable commit, make fetchsubmodules check that git status is clean
compile it, install it on a board
then git bisect good or git bisect bad depending on the result of your test
and then back to compiling the new checkout
I stopped when there was 2 commits remaining to test because it was pretty obvious by the git log where I was
I then tested the PR artifacts to be sure
I usually use my alias alias gitsubupdate='git submodule sync --quiet --recursive && git submodule update --init' instead of make fetch-submodules, which is kinda slow
doesn't that fetch a Gigaton of broadcom now ?
not all the time, if there's no change
I don't build the broadcom port so I never fetch it
I start with the builds available on S3, so I tested 7.3.3 then I tested 8 alpha
How did you decide how far back to look at the beginning of the bisect?
you find a version that works, and a version that doesn't. sometimes the working version is reported.
then I tested the oldest artifact on S3 that is not a tag
if was bad
so I started with those 2
Ok so finding how far back to look is as simple as that. For some reason I just assumed there was 'magic knowledge ™️' that dictated where to look. That's helpful to know it's that easy
this is a PR old enough that the artifacts are no longer on S3, but when the starting good and bad PR are on S3 I prefer to do it manually by downloading the builds and approximating the middle
much faster than compiling
I try to avoid bisecting whne it straddles a micropython merge update. There are tons of commits in there, and many of them don't build. You can do git bisect skip to skip bad ones
I actually started by searching the PRs that were related to web workflow, tried one and its previous PR but that was bad too, if I had thought of looking for an ESP-IDF update I wouldn't have needed to bisect probably
Ok, now I have another question--given it's tied to an ESP-IDF update, what is the way to proceed to find a bug fix? Where do you begin looking?
And thank you both so much for describing the process!
ah that is whole other can of worms, not my domain. I would probably search current and closed issues in the IDF repo with a choice of keywords
Ok that's helpful to know. I don't even know where to begin so I couldn't tell if it was something I should have familiarity with, or if it was that large of a can of worms
I assume it could be a new bug in the IDF or a change that requires us to do a thing we didn't do before (revealing a bug that was silent on our side) so it could be hard to find
didn't test. removing a no longer needed workaround is grand tho
maybe the fact that it seems to fix it when the web workflow is on indicates that CP doesn't close wifi properly on reload or something
we try to get the minimal CircuitPython example. If we can get a stack trace we can decode the addresses. I have tracked down some things by commenting out chunks of code inside the IDF and then gradually putting things back, also by logging deep inside until I track down the failed line.
Ok, I think I'll come back to this with a fresher mind tomorrow to see if the above still makes sense. Thank you both so much for walking me through how you isolate these kinds of issues, and pointing out where you look next to solve it. I really appreciate it
and if like me you are easily amused by saying to yourself "fire bad, git bisect good", don't worry, that's... normal. I think.
Normal enough in the present company at least.
One of those two brain cells from earlier tapped out and the other one is currently day dreaming of tapping out as well, so I am very amused by saying that to myself
Since it works with web workflow enabled (device is auto-connected to an AP), I tried connecting before the scan w/o web workflow, and it gets results the first time then ConnectionError: No network with that ssid on subsequent reloads. So it's something more involved than the connect() that lets scanning work with web workflow enabled.
Did you end up getting far with porting libs to circuitpython for Wio Terminal WiFi/BLE support? I asked Seeed in their Discord channels and they said they won’t be doing anything for CP or micropython. Seems a wasted opportunity to me for such a great platform.
I will test again on s2 and c3 tonight. This time w/ and wo/ web workflow on both, and plot espidf.heap_caps_get_free_size() over reloads
I still think that naming it code.py and not autoexec.py is a missed opportunity.
I touched up some things. This is all set! Thanks for your patience during the review.
@tulip sleet I was able to get esp-idf v5.0 working:
https://github.com/adafruit/circuitpython/compare/main...microdev1:update-idf
Can we move to it now or still post CP8?
I got one of those odd translation strings again.
%q ``must`` be a bytearray or array of type 'h', 'H', 'b' or 'B'
Not sure about the "must" part? if I translate that literally the quotes makes it sound like it is not a must, more like a recommendation.
https://github.com/adafruit/circuitpython/blob/main/shared-bindings/analogbufio/BufferedIn.c#L101
scare quotes
note those are backticks, I suppose someone tried to emphasize the word by typesetting it with a monospaced font?
In a c file? 🙂
¯_(ツ)_/¯
its from here:
// Bytes Per Sample
if (bufinfo.typecode == 'h' || bufinfo.typecode == 'H') {
bytes_per_sample = 2;
} else if (bufinfo.typecode != 'b' && bufinfo.typecode != 'B' && bufinfo.typecode != BYTEARRAY_TYPECODE) {
mp_raise_ValueError_varg(translate("%q ``must`` be a bytearray or array of type 'h', 'H', 'b' or 'B'"), MP_QSTR_buffer);
}
More of an emphasize, I believe.
trying to emphasize with sphinx docs syntax in an error message
That would be my suspicion yes. Point being - I don't work in the CP repo at all, so I don't fix error messages in code.
maybe we should ask the author
@hidden rain why did you use backticks on the "must" here?
Weblate does not show the author so I wouldn't know who to ask. Thanks for doing it for me. 🙂
Thank you for doing the work! I have been reluctant to move to 5.0 because it may introduce new issues in wifi or I2C, etc. If you submit it as a draft PR we could test the builds. There are many changes and it hasn't been shaken out that much. We could do it for 8.1. We still have a lot of things to fix or look at (or push forward) for 8.0.0.
I am hoping for S3 I2C fixes but I am not optimistic, because I tried to test master independently and I still had problems.
a draft PR sounds good
@tulip sleet would it be possible to consolidate the error message with ?
shared-bindings/audiocore/RawSample.c
91: mp_raise_ValueError(translate("sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or 'B'"));
that's an excellent idea, I will do that
force pushed a change
Thanks guys for being so fast handling this! 😎
We very much appreciate your noticing these things; you move fast too!
@UnexpectedMaker Hopefully you've settled into the new workshop. Please update me if the support for CircuitPython is going well or not, or if it's expected soon. Thanks for all you do!
circuitpython_community_library_list.md in the Community Bundle is still edited manually right ?
mp_raise_ValueError_varg(translate("%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'"), MP_QSTR_buffer);
Oops, the CI caught a typo.
Yes, I think all those lists in all bundles are manual (since they require categorization..
Recently(?) github started making it the default to only copy a single branch (e.g., main) and NO TAGS into new forks.
This makes the step of the build process that determines the CircuitPython version not work, because tags are expected to be present. When tags are not present, the version number is only a git hash. The version number ends up being 0.0.0.
This causes problems with libraries that check for CircuitPython version to determine compatibility, among other things.
We'll do...
@onyx hinge Is it the fork or the clone that is set up wrong? Do existing forks that were not set to just copy the main branch work OK still? I'm confused whether this is a github or a git problem
we should add text to the github-mentioning guides that say to uncheck that box
CircuitPython must be built from a git clone with tags.
If you cloned from a fork, fetch the tags from adafruit/circuitpython as follows:
git fetch --tags --recurse-submodules=no --shallow-since="2021-07-01" https://github.com/adafruit/circuitpython HEAD"""
"If you cloned from a fork that copied only the main branch"??
@tulip sleet yes the most obvious and severe manifestation of this is the new github behavior, where a fork doesn't get tags. It used to get all the tags and branches.
But in thinking about it, there's also a problem when a user's fork has been around for awhile. You can click in the github UI to get your main branch updated with ours, but neither your repo nor your local clone will get tags just by following that procedure. So, once 8.0.0 (or any release) is tagged, we need to make sure the tag is visible during the build process or the build will be identified wrong.
I wouldn't experience this because in my personal workflow, adafruit is always "origin" and my own fork is always "jepler" but that's just one of many ways to do it, and not what the guide suggests (because dealing with multiple remotes is advanced and in many cases can be avoided?)
I always do git fetch adafruit and git merge adafruit/main to update, and I seem to get all the tags.
I am kind of dissatisfied with make fetch-submodules. It's slow, and not necessary all the time. If we could get rid of the broadcom firmware fetching, I feel like we could go back to the old way
I mean that using e.g., the "sync fork" button won't do anything with tags (to the best of my knowledge) and that's what a large number of folks are going to do unless/even if a guide advises them otherwise
git pull --tags
but pull from the upstream repo?
I don't really know how others use git, there are many many ways to do it, but I assume many people use these graphical / webby things
git pull --tags adafruit main
that's what I do, anyways
I think git fetch does --tags by default ... yes, it does
also fetched; the effect is to fetch tags that point at branches that
you are interested in. This default behavior can be changed by using
the --tags or --no-tags options or by configuring remote.<name>.tagOpt.
cool
I try to keep the adafruit/circuitpython repo free of stasle branches, etc., so it's not necessary to ignore that stuff locally
Deleted tag '8.0.0-beta.0' (was 43e18f171)
jepler@bert:/tmp/circuitpython$ git fetch origin
jepler@bert:/tmp/circuitpython$ git fetch --tags origin
From https://github.com/adafruit/circuitpython
* [new tag] 8.0.0-beta.0 -> 8.0.0-beta.0
```Despite whatever the docs say, "git fetch <remote>" on its own doesn't fetch all tags. I don't think my personal global git configuration is affecting that.
I think it fetches them at the time it fetches the commits that are tagged. If it doesn't need to fetch the commits again it will not check for new tags
yes I think the more nuanced explanation is something like that
the broadcom repo is an abuse of git; they could use LFS support, but they don't, I think
we might consider making our own cleaner version somehow, though i'm not sure how without destroying history
For me git fetch <remote> does the job:
mdev@PC:~/code/cpy-update-idf$ git tag -d 8.0.0-beta.0
Deleted tag '8.0.0-beta.0' (was 43e18f171)
mdev@PC:~/code/cpy-update-idf$ git fetch origin
From https://github.com/adafruit/circuitpython
* [new tag] 8.0.0-beta.0 -> 8.0.0-beta.0
maybe you two can compare git versions
Mine is git version 2.25.1 Ubuntu 20.04 WSL
git version 2.30.2 (debian bullseye)
I tried HOME=/ git fetch origin to eliminate my ~/.gitconfig settings as a possible cause/culprit but it didn't change the behavior
and origin is origin https://github.com/adafruit/circuitpython (fetch)
halbert@tuna:~/repos/1circuitpython$ git tag -d 8.0.0-beta.0
Deleted tag '8.0.0-beta.0' (was 43e18f171)
halbert@tuna:~/repos/1circuitpython$ git fetch adafruit
From https://github.com/adafruit/circuitpython
* [new tag] 8.0.0-beta.0 -> 8.0.0-beta.0
halbert@tuna:~/repos/1circuitpython$ git --version
git version 2.34.1
so mine is working like MicroDev's
Deleted tag '8.0.0-beta.0' (was 43e18f171)
jepler@bert:/tmp/circuitpython$ git fetch ssh-origin
From github.com:adafruit/circuitpython
* [new tag] 8.0.0-beta.0 -> 8.0.0-beta.0
``` ssh and http behave differently
I'm getting more confused by this
here, it's repeatable that origin and ssh-origin behave differently 
mine is https as well
origin https://github.com/adafruit/circuitpython (fetch)
weird. 2.34.1 from bullseye-backports behaves the same for me as 2.30.2 did.
url = https://github.com/adafruit/circuitpython
tagOpt = --no-tags
fetch = +refs/heads/*:refs/remotes/origin/*
```OK my local .git/config was sabotaged somehow
my error, please proceed
well, git fetch --tags origin works in both cases
Its better to be explicit about it.
This looks OK to me. Our discord discussion indicates the CLI default is to fetch tags, but since tags might still be missing, the message makes sense.
@cobalt grail I cancelled the https://github.com/adafruit/circuitpython/pull/6910 build with your translation done before https://github.com/adafruit/circuitpython/pull/6911, and we'll await the touched-up translation. Thanks.
just following a couple of minutes this interesting conversation . My git version 2.37.3 in MS Windows 11 WSL2 Ubuntu
@tulip sleet the guide doesn't mention circuitpython_community_library_list.md https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-in-the-community-bundle#updating-the-drivers-dot-rst-library-list-3019623
that's because it describes the Adafruit Bundle in that section. And in fact
I noticed that the community bundle and the Adafruit bundle don't have the same structure (the second one has a docs directory)
I think the guide could mention the difference, and maybe we should change the community bundle to the same structure ?
Adafruit makes some Analog Devices accelerometer breakouts that use mode 3 for SPI. I will get some of these and see if the same problem appears. The AD411x eval boards are about $100 each (!).
@idle owl see above re community bundle? (I know you are afk)
Yeah, the build stuff takes way too long to finish before it ends up in weblate so I moved on the doing the autumn harvest in my kitchen window (hydroponics, ping me in another channel if that interest you!)
Translation done now anyways.
``` I just sent an ICMP PING packet with CircuitPython on a PiCow
ooooh and now I received the response! ```>>> [wifi.radio.ping(addr) for _ in range(20)]
[0.021, 0.004, 0.008, 0.004, 0.003, 0.002, 0.004, 0.002, 0.002, 0.002, 0.003, 0.002, 0.009, 0.003, 0.002, 0.004, 0.002, 0.016, 0.003, 0.004]
min(), max()
(0.002, 0.021)
Sorry I'm not contributing technically to this, but I'm hitting this exact same issue on my Feather ESP32-S3 (4MB Flash with 2MB PSRAM). Running 8.0.0-beta.0, I see connect() successfully get an IP address on first power up or hard reset, but then return ConnectionError: No network with that ssid every subsequent time, even through soft resets. I'm connecting to a 2.4GHz network (ASUS Router XT8).
Happy to try to pull any logs or try other troubleshooting to help with data collection, jus...
@caternuson Think this is good to close since the repo exists?
Update esp-idf to release/v5.0 branch.
Following modules are temporarily disabled as external dependencies need to be updated for these to work.
CIRCUITPY_ESP32_CAMERA = 0
CIRCUITPY_PARALLELDISPLAY = 0
CIRCUITPY_RGBMATRIX = 0
Following esp-idf components that we use are now deprecated and switch to new APIs can be carried out in a phased manner.
CONFIG_ADC_SUPPRESS_DEPRECATE_WARN=y
CONFIG_I2S_SUPPRESS_DEPRECATE_WARN=y
CONFIG_RMT_SUPPRESS_DEPRECATE_WARN=y
CONFIG_PCNT_SUPPRESS_DEPRECATE_WARN=y
CONFIG_GP...
CircuitPython version
Adafruit CircuitPython 7.3.3 on 2022-08-29; Adafruit Grand Central M4 Express with samd51p20
Board ID:grandcentral_m4_express
Code/REPL
import board
import sdioio
import storage
sdcard = sdioio.SDCard(
clock=board.SDIO_CLOCK,
command=board.SDIO_COMMAND,
data=board.SDIO_DATA,
frequency=25000000)
vfs = storage.VfsFat(sdcard)
storage.mount(vfs, "/sd")
Behavior
code.py output:
Trac...
If you send me an address I will send you an EVAL-AD4116ASDZ (https://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/EVAL-AD4116.html)
Christopher Gay
Chris@CTGControls.com
Thank you for the offer. I will test with an ADXL343 (https://www.adafruit.com/product/4097), which is an Analog Devices accelerometer that uses mode 3 SPI first, and see if I can reproduce. I would think I can.
@jaunty juniper @proven garnet I am seeing these errors when installing a particular library with circup:
$ circup install adafruit_ble_heart_rate
[...]
Searching for dependencies for: ['adafruit_ble_heart_rate']
WARNING:
adafruit-blinka-bleio~ is not a known CircuitPython library.
WARNING:
typing-extensions~ is not a known CircuitPython library.
Ready to install: ['adafruit_ble', 'adafruit_ble_heart_rate']
Installed 'adafruit_ble'.
Installed 'adafruit_ble_heart_rate'.
it still works, but I thought the ~ issue was fixed? I can't remember if either of you know about this
funny you should mention it: https://github.com/adafruit/circup/pull/153
okee dokee, I will merge, release, and test!
The fastest fix I've ever seen! 😄
Derived from #6124, with further cleanup:
- Now use
ringbuf_init()in various places instead of reaching inside the ringbuf struct. - ringbuf no longer has the "capacity is one less than size" oddity. It used an extra slot to indicate full and empty. Now it uses a count. Sometimes this technique is used when doing atomic operations, but we already don't expect it to be atomic. Added a comment to that effect. Changed
ringbuf_capacity()toringbuf_size()to simplify naming. - `ringbu...
I made some progress (I was able to get the underlying eRPC to generate messages) but I stalled on getting the comms to the Realtek chip working. The pin documentation is a little unclear. Also, the eRPC library is pretty large, so I'm going to have to cut it down to fit alongside CP.
I plan to get back to it now that summer is over. I'd really like to have WiFi/BLE support in CP on the WIO Terminal.
Got it!
So what do we do about the VID/PID for the board definitions for ESP32 (no native USB) ? They obviously don't do anything, so can we just remove them?
I have CP running on the TinyPICO, though it needs more testing and some tidying up before it's good to do a PR.
I've not looked at the TinyPICO Nano yet as that's going to be much harder to validate a fully compatible build.
Oh, interesting. So how do I apply for a Creator ID? Is there a form or something I need to fill in?
just a PR I think
hmm, ok, but how do I decide what my creator ID would be? They don't seem to be sequential?
dunno, it's still rather new and unused and undocumented, it looks like it's first come first served
somebody already took 1337_1337 but nobody took DEAD_BEEF yet 😬
Ok, I did a PR for 0xB0B0_0000 🙂
Though I'm not sure I understand hoe CREATOR_ID and CREATION_ID correlate....
I can just use any 32 Bit number for my creations now? so long as they are with my 0xB0B0000 creator id?
it's like VID and PID but twice the bytes
yeah
Ok, cool
my understanding is that "community managed" creation IDs are in the repo, other can go anywhere they want, like your own repo
CircuitPython version
Adafruit CircuitPython 7.3.3 on 2022-08-29; Raspberry Pi Pico with rp2040
and a Pimoroni picoaudio board, but that may be irrelevant for this bug sind it works with the mp3 files provided with the examples.
Code/REPL
# SPDX-FileCopyrightText: 2020 Jeff Epler for Adafruit Industries
#
# SPDX-License-Identifier: MIT
#
# straight from the CircuitPython examples and adapted to the picoaudio board
"""CircuitPython Essentials Audio O...
I like how the community managed Espressif list uses 0032_**** for ESP32, 00C3_**** for C3 boards and such :p
Thanks for your help !
hmm, is there no mem_info() in cpy ?
yeah I don't think it's enabled
Related to
https://github.com/adafruit/circuitpython/issues/6850
since we all want to build an Internet Radio based on the Pico W. ;-)
So no way of checking available memory from inside CPY?
There must be as I check that on my test jigs! I'll look at what I'm doing for that when I'm back in the office.
Yeah, that's prob it, ta !
We are using https://github.com/adafruit/Adafruit_MP3 as our MP3 decoder. Can you see whether that project's Arduino or standalone examples have the same behavior, and if so report it there?
I found it tricky to get github to let me download your attachment properly. I eventually did, so here's a zip with the mp3 inside it:
wdr5.zip
Dependabot should now support compatibility release notation properly! (~=)
I can look back into that, before it was a bust and all uprevs created PRs
I do not have any compatible setup ready to try that out. I could however try to setup an Arduino Uno, Nano or Mega to try this. Give me some time to understand how to make that work.
But I played their test.mp3 on my setup and it worked like expected.
Over time I continued to have problems with the TX-Queue on my ESP32S3 board during development. During the first run of every CircuitPython program after power up and a hard reset, all is fine and remains fine while the initial CircuitPython program is running.
However, when breaking with control-c or uploading a next version of the CircuitPython application the TX-queue went “out of sync”. (Note that calling microcontroller.reset() in such a situation does not fix the problem! Only power...
Added support for my TinyPICO boards using the ESP32-PICO-D4
Oh, do we still need to add our new boards to a build script? Been a while since I've added one, and I can't seem to find the file to add them to.
It used to be build.yaml but I believe it automatically adds boards now
Yeah, I couldn't find any yaml files to add my boards in - thanks mate!
Np
These are my boards using the original ESP32-PICO-D4 chip form Espressif that are now supported in CP.
I need to bind a third-party cpp library to CrcuitPython. This doc looks dated https://learn.adafruit.com/extending-circuitpython and getting pybind11 integrated into an nrf build hasn't worked for me yet. Any pointers to current documentation or examples would be appreciated. I prefer a Library implementation, not native. I did find the examples in the repository and assume usercmodule is the right starting point, but need the noob info from the readme that isn't there.
circuitpython doesn't support c libraries that are not compiled in
what hasn't worked exactly? what did you try and what error did you get?
I cannot seem to find the source code for the development of this. Where could I find it? I'm highly interested in the implementation. Would greatly appreciate it if I could view it!
@edgy edge at the moment there is no C++ code (as opposed to C code) in CircuitPython, so depending which language you mean that's going to be an additional hurdle for you to pass.
Besides the guide which admits right up front it's out of date, looking at the whole content of an actual wrapped C lib turned into a Python module might be instructive to see more about the changes involved. https://github.com/adafruit/circuitpython/pull/2337 is one such example, it adds an external mp3 library written in C then creates the necessary wrapping. It'll let you see things like adding the actual library code as a submodule, adding lists of files to the build, etc.
GitHub
Testing performed: On a nRF52840 with I2S DAC on pins 6/9/10, play the "test.mp3" file using this code.py:
import audiocore
import audiobusio
import board
import time
f = open("test...
@onyx hinge - thank you that's exactly what I was looking for. @stuck elbow I tried using pybind11, but could not find instructions for cross compilation and ended up with x86 executables. I also tried following the guide, at the end the instructions to the makefile appear incorrect - it looks like SRC_PATTERNS gets set in circuitpy-defns.mk based on a new #define that would go in either nrf or my board mkconfigport.mk
I have not seen any indication that pybind11 will work with circuitpython or micropython. "Python 3.6+, and PyPy3 7.3 are supported" - https://pybind11.readthedocs.io/en/stable/index.html
circuitpython's C API is unrelated to CPython's C API
I understand that now. Learning by doing. I really appreciate the great help you provide and the great information in the guides. The commit in the example you provided makes things very clear.
Hello all
I have tried to add support for entering DFU mode from software as explained in the following issue: #https://github.com/adafruit/circuitpython/issues/3444
The implementation particularly supports STM32F4 family since I have only one MCU from ST :)
The code follows the recommended steps from the application notes: AN2606 Rev 55. Link here: https://www.st.com/resource/en/application_note/cd00167594-stm32-microcontroller-system-memory-boot-mode-stmicroelectronics.pdf
To t...
Would be really nice to have access to UF2 artifacts ;-)
Would be really nice to have access to UF2 artifacts ;-)
I think they're developing it private, but I agree, I'd love to have some pre-release builds to tinker with
Has anyone attempted to put circuitpython on the SAM4 from microchip?
This looks simple enough. I assume it works -- can you say specifically what device you tested it on?
@jepler I have tested on my NUCLEO-F446RE board: https://www.st.com/en/evaluation-tools/nucleo-f446re.html.
I have added circuitpython support for it on my local branch: https://github.com/adafruit/circuitpython/commit/65c943b807a5591ec7fbb0490bc9de5c7b2ffcc5 , then used software DFU to do firmware upgrades.
CircuitPython version
Adafruit CircuitPython 8.0.0-beta.0-41-g33a100611 on 2022-09-10; Waveshare ESP32-S2-Pico with ESP32S2
Code/REPL
import storage
storage.remount("/", False)
Behavior
It goes through, even though there is no boot.py disabling usb access.
This results to the usb access being read only.
Description
It should raise RuntimeError.
It does not.
Additional information
If sleep till usb inits fully, it RuntimeError's jus...
Made https://github.com/bill88t/CircuitPythonWifiTester to gather more data automatically.
It gathers:
- How many wifi scans were successful
- How many wifi scans had significantly reduced results
- How many scans failed
- Espidf heap mem stuff before-after
And does the test automatically with and without the .env
I only managed to find time to run it on my S2 though. C3 will have to wait.
The result is clear. The .env makes it work somewhat ok, but as soon as it's gone, scannin...
I am adding this issue as a way to track and formalize an effort I plan to take to bring circuitpython support to the Microchip SAM4. The SAM4 is a great candidate for CircuitPython as it has lots of RAM, FLASH, Native USB, and plenty of functionality.
I do imagine that some of the modules from the ATMEL-SAMD port can be used. With this new support, I would suggest a chance to the port/atmel-samd directory to be port/atmel-sam but this can be taken care of later.
Some questions I h...
Hiya!
My work in progress, which is what @ladyada has shown in a couple of videos, is in the open at https://github.com/jepler/circuitpython/tree/:pie::cow:
It really doesn't do anything useful yet, we haven't identified any ways to split the work with other folks, and it's far from ready to use or give feedback on, so publicizing where the code lives or providing UF2s isn't a priority. I'm glad to see the videos...
Thank you! Low chance of negative impact, looks sensible to me, and you tested.
I hope you'll be submitting a PR to add that board soon, too.
CircuitPython version
N/A
Code/REPL
N/A
Behavior
I noticed in https://github.com/adafruit/circuitpython/actions/runs/3077958795/jobs/4973188072 all boards built
Experimentally, I reproduced it locally:
~/src/circuitpython/tools$ PYTHONPATH=../docs:adabot/ CHANGED_FILES='["ports/stm/common-hal/microcontroller/__init__.c", "ports/stm/supervisor/port.c"]' python3 ci_set_matrix.py
I noticed that after reverting a couple of commits i...
Did some changes to better seperate the data:
{
"version": "8.0.0-beta.0-41-g33a100611",
"board": "Waveshare ESP32-S2-Pico",
"cpu": "ESP32S2",
"iterations": 101,
"want_env": false,
"og_networks": 14,
"espmem_total": 148292,
"Pass_env": 44,
"Pass": 1,
"PartialFail_env": 5,
"PartialFail": 16,
"CompleteFail_env": 0,
"CompleteFail": 33,
"espmem_before_env": [51852, 51640, 51684, 51696, 51700, 51700, 51700, 51696, 51700, 5...
And on C3 I see similar results:
{
"version": "8.0.0-beta.0-47-gae64f9fd7",
"board": "DFRobot Beetle ESP32-C3",
"cpu": "ESP32-C3FN4",
"want_env": false,
"iterations": 101,
"og_networks": 13,
"espmem_total": 262736,
"Pass_env": 46,
"Pass": 2,
"PartialFail_env": 3,
"PartialFail": 3,
"CompleteFail_env": 0,
"CompleteFail": 45,
"espmem_before_env": [67556, 67780, 67568, 67572, 67568, 67572, 67568, 67572, 67572, 67572, 6757...
C3 latest:
{
"version": "8.0.0-beta.0-61-g5593d23a0",
"board": "DFRobot Beetle ESP32-C3",
"cpu": "ESP32-C3FN4",
"want_env": false,
"og_networks": 13,
"iterations": 101,
"Pass_env": 48,
"Pass": 1,
"PartialFail_env": 1,
"PartialFail": 0,
"CompleteFail_env": 0,
"CompleteFail": 49,
"espmem_total": 262848,
"espmem_before_env": [67652, 67888, 67672, 67684, 67676, 67684, 67676, 67684, 67676, 67684, 67676, 67684, 67676, 67684...
S2 latest:
{
"version": "8.0.0-beta.0-61-g5593d23a0",
"board": "Waveshare ESP32-S2-Pico",
"cpu": "ESP32S2",
"want_env": false,
"iterations": 101,
"og_networks": 14,
"Pass_env": 47,
"Pass": 1,
"PartialFail_env": 2,
"PartialFail": 17,
"CompleteFail_env": 0,
"CompleteFail": 32,
"espmem_total": 148292,
"espmem_before_env": [51852, 51648, 51708, 51712, 51708, 51712, 51708, 51712, 51504, 51508, 51504, 51508, 51512, 51504, 5...
Can someone with write-access to Adafruit's github page, fork https://github.com/espressif/esp-iot-solution and create a branch named circuitpython.
This is needed for esp-idf v5.0 upgrade. Above espressif repo is a submodule but it needs some customization to work with CP.
Is there a "usb storage disable", or just read-only?
you can disable the msc entirely
storage.disable_usb_drive()
ah I was looking at all the "usb_" modules
does that make the drive writable by code.py too?
no, you still have to remount it
it could be, I thought maybe it could check. I think there was some discussion about this but I don't remember the details.
explicit is better than implicit
@onyx hinge I can do the above
thanks dan
@analog bridge should be done now
One more thing, can you create circuitpython branch on https://github.com/adafruit/esp32-camera
OK this seems to do what I want ... ```py
import storage
import usb_cdc
import usb_midi
import microcontroller
from code import TandyKeyboard
tandy = TandyKeyboard()
tandy.ready()
held = (tandy.read_timeout(.5) or [0])[0]
print("held", held)
if held == 1: # Escape key
print("Safe-ish mode: Leaving USB storage & CDC enabled")
elif held == 87: # Keypad enter key
print("Entering bootloader")
microcontroller.on_next_reset(microcontroller.RunMode.UF2)
microcontroller.reset()
else:
print("Disabling USB storage & CDC")
usb_midi.disable()
usb_cdc.disable()
storage.disable_usb_drive()
I can hold one key at power on to enter bootloader, another key to not disable USB features, otherwise the device shows up as a keyboard only
it adds another ~800ms before I can send a first keypress but that's not super important to me
it already has a branch named pass-bus-to-sccb, which was created by @onyx hinge . Jeff, do you want to rename this to circuitpython? I already did a PR to that branch (and it took me a bit of time to figure out which one to PR against)
esp-iot-solution does?
no, esp32-camera
oh yeah sure rename it to circuitpython if that's helpful.
Since, we are still supporting v4.4... I need v5.0 support in a new branch on adafruit/esp32-camera
let's call the existing branch circuitpython-esp-idf-v4.4 and make a new branch from that called circuitpython-esp-idf-v5.0 ? (or drop the "esp-idf" inside??
does that make sense?
@onyx hinge ?
I am fine with whatever you decide
for adafruit/esp-idf, we are using circuitpython-v5.0 and circuitpython-v4.4
i think that's ok, unless esp32-camera has its own version numbers, which maybe it does
they do have version numbers, 2.0.2 is the last release number
it is 2.0.2, it doesn't say which ESP-IDF it supports 😕
@analog bridge does esp32-camera not yet support esp-idf v5.0?
they are going to have the same problem in their own repo
it does support it but there are still some customizations of our own
that would be different between idf v4.4 and v5.0, you are saying?
can you use the same techniques they are using to support v4.4 and v5.0 instead of two branches?
are they using #if, etc.?
Thanks for looking into it. As we were talking about on Discord, I worked through getting the build environment set up, but I haven't really had time since then :(
they are using #if so a single branch should work...
Hi,
This PR is to add the utime() function to the os library, to solve issue #5978.
Description
This implementation changes the timestamp of a file. The function takes 2 positional arguments:
- A string with the path to the file
- An int for the timestamp expressed in seconds
Example:
import os
os.utime('file.log', 1663573240)
Limitations
The implementation takes advantage of the function f_utime() ...
ok, I renamed the branch @onyx hinge made to circuitpython
I should PR the fix I made to upstream also
Thansk! 🙂 Also, lookout for PRs coming to esp-iot-solution and esp32-camera forks
We haven't considered the SAM4 line strongly because the maximum RAM is 128kB, and we had more capable chips in the pipeline when this might have come up. Which chip are you targeting?
I know 128kB is a bit low on the RAM side, I am targeting this variant: https://www.digikey.com/en/products/detail/ATSAM4S16BA-MUR/3593650
there are some things that probably are not necessarily a priority to have in its core which would probably help make it fit.
There is also this variant that has 160kB of Ram which would probably be easier to squeeze. https://www.digikey.com/en/products/detail/ATSAM4SA16BB-ANR/7645073
Reminder of today's CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if you’ll be attending the meeting - it’s super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1k0jC2OVIoslSAK_jhq6ioTEbY5Ep1MChD5UIOSRIHgA/edit?usp=sharing
Google Docs
CircuitPython Weekly Meeting for September 19th, 2022 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates early. During the meeting, we go through them as a round robin sorted by username. If you can’t make the meeting and would still like to...
I'm not sure I follow what you want to happen here.
CircuitPython version
Adafruit CircuitPython 8.0.0-beta.0-61-g5593d23a0 on 2022-09-19; DFRobot Beetle ESP32-C3 with ESP32-C3FN4
Code/REPL
>>> import board
>>> dir(board)
['__class__', '__name__', 'A0', 'A1', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'D0', 'D1', 'D10', 'D2', 'D3', 'D4', 'D5', 'D6', 'D7', 'D8', 'D9', 'I2C', 'IO0', 'IO1', 'IO10', 'IO2', 'IO20', 'IO21', 'IO3', 'IO4', 'IO5', 'IO6', 'IO7', 'IO8', 'IO9', 'LED', 'MISO', 'MOSI', 'RX', 'SCK', 'SCL', 'SDA...
Re exec(print(dir(board))): print() returns None. Did you mean exec(str(dir(board)))) ?
Do you know about "the CircuitPython Online IDE" by Twitter user River Wang
@River___Wang ? https://urfdvw.github.io/CircuitPython-online-IDE/
A browser-based IDE for CircuitPython supported microcontrollers. No installation needed. Handy and powerful.
I wonder what this "~" is doing here. ```
//| def bind(self, address: Tuple[str, int]) -> None:
//| """Bind a socket to an address
//|
//| :param ~tuple address: tuple of (remote_address, remote_port)"""
@proven garnet I see you typing .. I would love your thoughts about https://github.com/adafruit/Adafruit_CircuitPython_PIOASM/pull/51
It's supposed to tell sphinx to boil down the annotation to the name only, like ~module_a.submodule_b.ClassName gets printed by sphinx as ClassName instead of module_a.submodule_b.ClassName.
But I guess it doesn't work with builtins which makes sense
I saw this a while ago and like the idea. It would also help us start to detect faulty typing as we get closer to the Missing Type Annotations = 0 (!!). My only concern, and I'd have to look into it more, is that something mypy has issues with things that are done very intentionally for memory savings or other reasons, and I have no idea how frequently that is or what the fix would be other than disabling or refactoring.
But on the whole I'm very pro the idea and think it's worth doing.
shared-bindings/socketpool/Socket.c://| :param ~tuple address: tuple of (remote_address, remote_port)"""
shared-bindings/socketpool/Socket.c://| :param ~tuple address: tuple of (remote_address, remote_port)"""
shared-bindings/socketpool/Socket.c://| :param ~int backlog: length of backlog queue for waiting connections"""
shared-bindings/socketpool/Socket.c://| :param ~bytes bytes: some bytes to send"""
shared-bindings/socketpool/Socket.c://| :param ~bytes bytes: some bytes to send
shared-bindings/socketpool/Socket.c://| :param ~tuple address: tuple of (remote_address, remote_port)"""
shared-bindings/socketpool/Socket.c://| :param ~bool flag: False means non-blocking, True means block indefinitely."""
shared-bindings/socketpool/Socket.c://| :param ~int value: timeout in seconds. 0 means non-blocking. None means block indefinitely."""
shared-bindings/socketpool/SocketPool.c://| :param ~int family: AF_INET or AF_INET6
shared-bindings/socketpool/SocketPool.c://| :param ~int type: SOCK_STREAM, SOCK_DGRAM or SOCK_RAW
shared-bindings/ssl/SSLSocket.c://| :param ~tuple address: tuple of (remote_address, remote_port)"""
shared-bindings/ssl/SSLSocket.c://| :param ~tuple address: tuple of (remote_address, remote_port)"""
shared-bindings/ssl/SSLSocket.c://| :param ~int backlog: length of backlog queue for waiting connetions"""
shared-bindings/ssl/SSLSocket.c://| :param ~bytes bytes: some bytes to send"""
shared-bindings/ssl/SSLSocket.c://| :param ~int value: timeout in seconds. 0 means non-blocking. None means block indefinitely."""
shared-bindings/ssl/SSLSocket.c://| :param ~bool flag: False means non-blocking, True means block indefinitely."""
```looks like these might benefit from cleaning up, I think my grep maybe found most of them
I'll make a gist with these and make issues out of them, fantastic Hacktoberfest issues!
two thoughts to that: I could see adding a pyproject.toml setting to SKIP mypy altogether, or for severe cases we can use separate .pyi files to lower the type annotation overhead to zero
the learn guide has instructions on how to modify docs/drivers.rst, but this does not apply to the community bundle where the equivalent file is circuitpython_community_library_list.md. I suggest 2 things:
- for now add the mention of
circuitpython_community_library_list.mdto the guide - in the future change the community bundle to use a
docsdirectory, sphinx, RTD anddocs/drivers.rstso that both bundles work the same, with the same instructions
Neradoc said:
And in fact
I noticed that the community bundle and the Adafruit bundle don't have the same structure (the second one has a docs directory)
I think the guide could mention the difference, and maybe we should change the community bundle to the same structure ?
So the q is whether the bundle repos should have more parallel structure, that's all that i meant
I think these are really good solutions!
ok, I crossed with Neradoc's comments
One other "hmmm" moment I had was wondering if we should switch to having cookie cutter put stuff in src/, src/modulename.py or src/packagename/__init__.py. Because I had to put this new python script in a new folder to not cause trouble
☝️ @proven garnet
@onyx hinge Interesting, you mean the run_mypy.py script?
yeah the tooling at different levels relies on explicitly excluding setup.py and example, etc. directories, or having a single python file (other than setup) in the root (that one is for the bundle, not required for frozen libraries)
right that's exactly what I encountered
there are other things it'd make easier, like the way we exclude pylint examples, tests, and the main code all differently
I'm not sure what that means, "a wrench"
Sorry, I meant that throws a wrench in the simplicity. I'm not very good at idioms haha, I'm not even sure I got that one right.
Does using a mypy pre-commit action give us more granularity?
Oh, that's your comment
I liked pre-commit because (sample of 1) it makes it just happen, and devs should be able to run it locally with ease .. in reality, who knows how it'll work out
I agree, also since it hopefully means it's fixed locally before being pushed, rather than working through multiple CI runs like sphinx sometimes requires.
I think I linked to a blog post by the person who devised the technique I followed, if you take a look at that blog post you can see other possible trade-offs.
I'll definitely take a look tonight, thanks for bringing it up!
I appreciate your thoughtfulness about stuff like this
Happily lurking 🙂
Hummmmm now ONLY the 'no milestone' milestone is listed in the adabot report ```
- 5 active milestones
- 5 issues not assigned a milestone
Also @onyx hinge would it be better for me to create three issues for the tilde issue (one per module) or one big one? More issues means it can be broken up between people, but also understand if that's more cumbersome.
Was that way last week too.
Preemptive oops, possibly. I can dig around if that helps.
Please do!
I added 8.0.0 and 7.3.x manually just now
ty!
I hear both of you, loud and clear.
Apologies, Discord was set to go through headphones.
yay, audio routing.
@lone axle are you getting the newsletter links today?
yep, I'll get them.
ty
Build, program, and run hardware projects in the browser
you can play w/ a very limited demo now
https://t.co/gHDTfJnXUh
(def got some bugs! opted to ship fast, and iterate. only works on desktop rn. )
🚨
Likes
724
synthesizer 🐿️
Learn how LEDs work and how to pick the best ones for your projects. Light Emitting Diodes are electronic components that give off light when electrical current flows through them. They only light up when hooked up one way, so Becky Stern will show how to test the polarity of LEDs with a coin cell battery. Learn about the different types of RGB ...
Becky makes cool youtube videos apart from digikey too. she had a series where she would do a watercolor of a hand tool, that was fun.
i learned how to use resistor values for led's thanks to that episode
Congrats Lee! 🎉
I love how cgrover found a massive bug affecting 30 boards and he was so timid about raising his hand again to have people look into it again.
Yeah, so shy and reserved.
The "C" is silent I guess
I recommend referencing it as Csharp python. Using C#Python kids these days might get that confused with a hashtag. :/
I would like a vote here on naming for "the Feature of a CP board to not have a Display/Screen but be designed with the intent/possibility to connect one" like matrix portal (issue: https://github.com/adafruit/circuitpython-org/issues/1032)
1
Display interface
4
External Display
1
External Display Connector
0
Intended for External Display
0
Optional Display
0
Display Friendly
2
Display Ready
^ final result
@onyx hinge I'll look to post a blog post on it
@idle owl The real friends are the bugs we made along the way 😂
And that's the royal we of course haha
Sorry, a bit out of alphabetical order, its been a while... 😅
No worries, we simply follow the document. So in the end, it's not a big deal. 🙂
can move it after the meeting, no worries
Nah! Don't move it, timestamps are in order.
@proven garnet I love to start things I don't have the time or energy to see through to the end so you're welcome
ah, neat.
honestly contributing to the meeting is more important than being in order if you get it in, in time.
at least i think so, always cool to hear from everyone
@tulip sleet 😂
carpet tools are wicked looking things. leather gloves? nah.. pot holders got this.
Relationship between the tolerance parameter and possible number of matching color shade values.
this post
Cooking with Carpet.
ooh, pretty, I like the switch colors
Such a beautiful PCB.
It was me!
I love typer!
@onyx hinge I’m curious now why/how you learned about emojis in branch names. Sounds like there’s a story in there. 😂
@minor plume https://github.com/jepler/circuitpython/tree/🥧🐮
I love it! I’ll bet typing the emojis at the command line is a pain, though.
@minor plume yeah it takes me minutes if I don't copypaste it from somewhere
same, no worries
mailbox photo is great!
mailbox is adorable!
That mailbox graphic is sooooo cute!
haven't listened to paul cutlers latest podcast. going to do that right after this. synths!
It’s really cute!
still a great image, cute!
in the shop when ? 😁
linode, haven't heard that name in a while
seems to be this amazon item, if you really want one: https://www.amazon.com/-/dp/B004TTGXCM/
Came with little plastic mail, and letter stickers to decorate it.
I didn’t know linode was even still around. I thought the whole world had moved to AWS and Azure.
it comes with a blinka sticker? alright i'm sold. 🙂
I would have bet a 3D printing from Neo and Pedro. 🙂
BYO Blinka sticker 😉
But you can spell her name with the ones that come with it!
yeah i was thinking more of a 3d print from Liz, has that Liz vibe to it.
does the flag have a motor attached to it? needs servo.
We could always fork the repo and revert it backwards to test, worst case
so is that battery the part you couldn't talk about last week?
yes
Last week is a blur, I genuinely don't remember what you're referring to 😄
said there was new hardware for the project that you couldn't mention until the guide came out.
Oh! No, that'll be for a new eventual guide.
We may have a new LoRa board coming out. But it's not out yet, don't ask!
Yeah, but will it work on EU frequency, or a variant for EU frequency?
Well now I’m gonna ask
I don't have any idea. It's not out yet, don't ask 😉
putting the "skerr" in "scourge" today I see
Ah right.
ah ok thought it might have been the battery, nvm then shhh
@onyx hinge @tulip sleet we are using espressif repos as submodules with modifications
because the battery is new and HUGE compared to the previous 6600mah triple 18650. i use that one for most of my projects. getting some of the new 10000 mah ones too.
Last? chance to vote (but I think we have a winner with "External Display").. I would have voted for Display Ready, but I cannot vote because I am the organizer and I had to vote for all of those. 🙂
^ integrity
I believe we don't always use a fork of espressif if we can avoid it ?
I'll try and give this a shot on my fork.
yes, avoiding it is the best way
Mayhaps 🙂
we only have like a couple of files or just a single function that needs changing on espressif side
yep
stack overflow
🥩 overflow
it has QnA with up-votes and answers can be choosen
Hmm.
I also worry about diluting the field with more communication options.
But we can definitely look into it.
I worry that the more communication channels we have, the harder it is for a newbie to know where to go for help.
(Oops. That shouldn’t have been a reply)
Just to muddy the waters, but Discord ALSO added a "forum" feature 🤯 I don't know what it does, exactly
I did not knew #help-with-circuitpython exist... for a long time.
a valid concern is github starting to charge for that stuff eventually and then the entire community gets held for randsom basically
I already find that most of the reddit comments I see end up maybe a quick reply from a couple people and a direction to the Adafruit forums/discord
And you can make vote in Discord... with a lot of imagination. 🙂
screenshot of forum in qmk discord
It's kind of reddit like, they python discord staff wasn't thrilled with it. There's a fairly limited number of tags which reduced it's use there (they were exploring it for a category question's type form on the discord)
Thanks! 🙂
Thanks!
👋
Thanks!
Thanks everyone! 👋
🥩 overflow could be a good thing, depending how much it overflows. 🙂
I made a vote in Discord Chat during the weekly meeting and the final result were "External Display" as a winner:
1 :adabot: Display interface
4 :adafruit: External Display
1 :cappy: External Display Connector
0 :gus: Intended for External Display
0 :mho: Optional Display
0 :blinka: Display Friendly
2 :toebeans: Display Ready
I'm gonna disconnect from the voice chat. have a good week y'all
I need to drop off as well. Have a lovely week!
Oups, my avatar here is a picture of me! And on GitHub it is their default... I already have problem with various names on various places (for historical reason).
Thanks all, have a good one!
@makermelissa If you could review this change, that "ELECFREAKS Pico:ed" has a "Display" but is missing Alligator Clip feature until merged.
I updated issue #1032 to be about the name, so that would be a better place to keep the suggestions together.
So the result of a vote in Discord made "External Display" the winner.
I'll try to add that to the 3 boards identified, but if there are other change needed to make a new feature "real" I will need your help.
I also would have gone for Display Ready. But it wouldn't have won anyway. 🤷🏻♀️
Is there a live meeting going on now?
It finished about 15 minutes ago, started at 2pm EST
ok.. thanks. I'll set my alarm for next week.
@tulip sleet here is the backup recording of today's meeting: https://www.dropbox.com/s/9d5me0407etcz16/circuitpython_weekly_meeting_9_19_22.mkv?dl=0
tyvm!
So thanks again to all that helped with analogbufio (see hug-reposts). @tulip sleet: Thanks for finishing up. (I was away from work for a week), Is there anything remaining that needs my attention? Also will it make a future release?
It's in good shape! I didn't leave anything dangling that I know of. It is merged into main -- it will be in the next 8.0.0-beta release!
thanks again!
Is there any documentation that describes the hardware/peripherals a particular CircuitPython module uses when running, on a per MCU basis? Or do I need to look through the each port's source code to figure that out?
In the future I'd like to contribute to writing CircuitPython modules in C, but I believe I'd need to know what registers/peripherals were currently in use to ovoid conflicts.
you have to look at the source, also, it may be different for each port
usually they will use a function that finds the first suitable peripheral, and raises an error if all are taken
You can also ask here and usually someone is around who may have a vague idea on it.
I know most modules that may share (countio and pwmio in rp2040 I think) share a "in use" array
Yes it's all pretty ad-hoc.
@blissful pollen @stuck elbow Thank you so much! That helps a lot.
I think all the board that need tagging are tagged... but I don't know what else to modify.
I found the build.yml and I see where the call to check-boards.py is but I don't know what check are made and if there is something I can modify to make it pass the test:
- name: Check feature names and other data
run: python3 check-boards.py
@onyx hinge Gotcha, thanks! But it does seem like there are some safety mechanisms built in to prevent modules from actively commendearing peripherals from one another. Otherwise it would be a free for all 😂 .
Here is the notes document for next Monday’s CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if you’ll be attending the meeting - it’s super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1eqMwdLfb53MKA5T1Ck5D1lJQCDSs7naD7hZwnAid0-c/edit?usp=sharing
Yeah, I was for "Display Ready" too, that sound so much like an Intel or Microsoft marketing message. I guess that is democracy? But the PR is not accepted yet and MakerMelissa did not even had a chance to vote.
Well I voted late on your Discord post.
@onyx hinge do repositories need to have a .pytyped (I think that's what it is) file for mypy to work properly?
I realize many libraries are missing those but I can figure out a way to patch them in easily enough if needed
a file "py.typed" goes in a package
to make a single file module type'able by mypy you need a "-stubs" version which is kinda a pain
https://github.com/adafruit/Adafruit_Blinka/pull/610 it ends up being more like this
so maybe you have to go with .pyi for mypy with single-file modules? I'm not sure.
Ahhhhhh thank you for explaining, I've been rereading PEP 561 over and over again because I didn't quite understanding but you're right.
looking at stubgen/stubtest https://mypy.readthedocs.io/en/stable/stubgen.html might be instructive too. I'm still learning all this myself, it is REALLY hard to find some of this info, and once found it's hard to be confident it's really the best practice
I'd be really interested in doing the stubgen process, and it's something could replenish the Good First Issues for typing libraries once those are burned down (or mostly).
Processed 1 modules
Generated colorsys-stubs/colorsys.pyi
jepler@bert:~/src/bundle/libraries/helpers/colorsys$ cat colorsys-stubs/colorsys.pyi
``````py
from typing import Tuple
def hls_to_rgb(hue: float, light: float, sat: float) -> Tuple[float, float, float]: ...
def hsv_to_rgb(hue: float, sat: float, val: float) -> Tuple[float, float, float]: ...
``` if we ever DO need to separate out the existing stubs, stubgen looks good for that
then you have to manually strip them out of the .py file I think 😕
Manually strip the annotations?
yes, and mostly the extra imports & tests needed for the annotations
Oh interesting I didn't realize it wouldn't use the annotations. I wonder if you could get the ast module or libcst to works in a tool to assist in some way.
Oh it does look like it does it for function/method arguments based on this PR though: https://github.com/python/mypy/pull/3169
Seems like it has issues with things member variables though
I haven't run it yet though so I might be misunderstanding
anything I say may be a misunderstanding as well. ttyl, calling it a night here.
Thanks!
I'm trying to add my own custom C module to a circuit python build following instructions from @onyx hinge and an example commit he sent me using an mp3 library. With make V=2 I can see the source modules get built and the .o's linked, but an import of my module fails - not found. Any quick thought on a step I may have missed?
Since this is being integrated into MicroPy and Pycom could their modules be imported in CircuitPy?
It'll certainly make implementation easier. I'm thinking of tackling this for a personal project so I'll check it out over the weekend.
Have you made any progress on this? If not, if you could give me some guidance on how to start, I would be willing to t...
Currently wifi.radio.ping() does not allow to set the ICMP packet payload size. Looking into the code for nina-FW it is hardcoded to 32 bytes:
struct __attribute__((__packed__)) {
struct icmp_echo_hdr header;
uint8_t data[32];
} request;
I'd like...
This is required as the update to idf-v5.0 makes builds overflow by almost 64K in some cases.
I want to get this in pre-CP8 as the changes include shrinking of the user_fs partition which can result in loss of data.
- reorganize 2mb-no-uf2 patition table
- add 4mb-no-ota partition table
- turn off dualbank on esp32-s2/s3 boards with 4mb flash
The problem
ESP32 boards have two partitions OTA0 and OTA1 to allow the use of the dualbank module, to flash a new firmware while running and switch. On 4MB boards for example where CP takes 1.5MB and only ~950kB are left to the drive, the OTA1 partition is actually bigger than the drive itself.
- This doubles the space taken by CP, at the cost of the CIRCUITPY drive.
- The
dualbankmodule is likely almost never used by anyone. - New users can be puzzled (and disapp...
@MicroDev1 This coincides with your #6927, which seems to partly moves in that direction. Do you have some comments on I agree that dualbank seems little used (we get almost not questions about it), though a few people really wanted it. You were the one to PR dualbank, so I would be interested in your opinion as well.
In espressif port, is there anyway to know in Makefile, if a board has psram or not?
looking...
re-posting a question from last night - I'm trying to add my own custom C module to a circuit python build following instructions from @onyx hinge (he/they) and an example commit he sent me using an mp3 library. With make V=2 I can see the source modules get built and the .o's linked, but an import of my module fails - not found. Any quick thought on a step I may have missed?
how about CONFIG_SPIRAM and related stuff from sdkconfig*
how to access it in makefile?
ah yes, sorry, I was thinking about .h files
I was thinking of having a common sdkconfig for psram as we have for flash and then the psram size can be defined in mpconfigboard.mk
I think that is a good idea. The current per-board sdkconfig's are not consistent and should be as minimal as possible.
they are partly made from ports/espressif/tools/generate_all_sdkconfig.py
there is a new component in idf v5.0 (esp_psram) which needs to be conditionally added depending on CONFIG_SPIRAM
also tools/update_sdkconfig.py, not sure when that is used