#circuitpython-dev

1 messages · Page 9 of 1

random junco
#

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

onyx hinge
#

The bundle zips are created on a Linux VM so I don't know why they would have Mac specific metadata attached.

minor plume
onyx hinge
minor plume
onyx hinge
#

I do know enough to help you make the ci run on a Mac VM if that comes in handy

tame creek
#

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?

jaunty juniper
#

it just writes into a new file

idle owl
#

@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!

jaunty juniper
#

in order to have a progress bar during download it uses click.progressbar and writes into a file from a requests.get stream

idle owl
#

Oh! I was busy trying to keep track of if Paul needed any help 😄

#

I missed you being there.

jaunty juniper
#

I try to follow somewhat when i can and I look at the notes 🙂

idle owl
#

Fair enough! I basically knew that, but like I said, was entirely focused elsewhere today.

tame creek
#

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

jaunty juniper
#

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

manic glacierBOT
manic glacierBOT
#

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))

...
midnight ember
#

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.

idle owl
midnight ember
#

granted i purchased the modules i'm using... 2 years ago.

#

procrastinationnnnnn

idle owl
#

I feel you there 😄

midnight ember
#

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.

tulip sleet
#

I am fixing this

midnight ember
#

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.

blissful pollen
#

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.

midnight ember
#

Looks like boards only with a built-in display so I would have never detected it on my featherwing tft?

blissful pollen
blissful pollen
tulip sleet
#

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

midnight ember
#

Hmm I have a modified featherwing tft with backlight pwm and it didn't affect me.

tulip sleet
#

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.

blissful pollen
jaunty juniper
#

the pwmout_reset bug was general on all ports ?

tulip sleet
#

yes

#

it usually didn't make any difference

jaunty juniper
midnight ember
#

oof since april, that'll be super cool if it fixes that one too.

tulip sleet
midnight ember
#

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.

tulip sleet
#

it was stopping the PWMs no matter what

jaunty juniper
#

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 😛

errant grail
midnight ember
#

Duh that’s right and how Foamyguy tracked it to the aug 10th commit.

errant grail
#

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.

blissful pollen
#

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.

tulip sleet
#

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

blissful pollen
#

oh wow

tame creek
tulip sleet
#

i dunno, it really shouldn't have been resetting the PWM so much anyway

#

it is the LEDC peripheral

tame creek
blissful pollen
#

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

manic glacierBOT
#
  • 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-camera code 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...

manic glacierBOT
midnight ember
#

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?

manic glacierBOT
#

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...

manic glacierBOT
thorny jay
#

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.

GitHub

various shapes! Contribute to adafruit/Adafruit_CircuitPython_Display_Shapes development by creating an account on GitHub.

manic glacierBOT
onyx hinge
manic glacierBOT
manic glacierBOT
idle owl
#

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. 😄

tulip sleet
#

debouncer?

idle owl
#

Bummer.

#

I guess.

#

Bleh.

tulip sleet
#

or just do a little delay after detecting the keydown

idle owl
#

bigger delay is probably also ok

tulip sleet
#

that is the least code

idle owl
#

This is for a remote trigger for my phone camera, because I need two hands in a lot of these guide photos.

tulip sleet
#

50-100ms min is probably fine

idle owl
#

So I was hoping to bang this out quick. Which is not happening, heh.

tulip sleet
#

self-timer on camera phone?

jaunty juniper
idle owl
tulip sleet
#

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...

▶ Play video
idle owl
#

And yes, but absolutely not, I am never setting up my phone to be listening to me for any reason.

stuck elbow
#

it's the default

#

and you can't switch it off

idle owl
#

There's a toggle on my phone.

stuck elbow
#

mechanical?

idle owl
#

Oh you mean overall.

#

I get that it's listening. But I refuse to actually set up the software that ensures it will respond.

jaunty juniper
#

let's not give in to the paranoia

stuck elbow
#

it's not paranoia when they really are out to get you

jaunty juniper
#

well they aren't

#

(and when they are you put your phone in the fridge)

idle owl
#

It's not paranoia for me, I simply hate having that feature on. Responds to anyone talking to the same software, etc.

jaunty juniper
#

yeah I disable that too, my point is that it's not always on, but you can enable it temporarily

stuck elbow
#

so it stays fresh longer

jaunty juniper
#

now, a Clue that listens to you and presses space via bluetooth when you say something on the other hand

idle owl
#

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.

jaunty juniper
#

there's only one button in the USB Foot Switch guide though

idle owl
#

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.

jaunty juniper
#

right, future proofing

idle owl
#

Sigh. I'll copy it.

jaunty juniper
#

maybe we need a simpler sample code

idle owl
#

We do. But I guess I'll deal with this for now since I am pressed for time.

#

Nope.

#

It doesn't work.

manic glacierBOT
jaunty juniper
#

is the button between the pin and gnd ?

idle owl
#

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.

jaunty juniper
#

ah the trinkey

idle owl
#

Is that a pulldown or something?

proven garnet
idle owl
#

Hah!

#

Pull down at least makes it change state.

#

I'm rolling with this, even if it's wrong.

jaunty juniper
#

yep the trinkey needs a pulldown

idle owl
#

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.

ornate breach
idle owl
#

Oh! .. No you do /tableflip in the input box for Discord, and it resolves to that emoji.

ornate breach
#

YLSNED

#

(You learn something new every day)

#

(╯°□°)╯︵ ┻━┻

#

Hehe..

proven garnet
#

Be nice to the tables y'all

idle owl
#

No!

ornate breach
#

Lol

manic glacierBOT
#

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()?

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...

manic glacierBOT
#

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.

manic glacierBOT
idle owl
#

@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.

blissful pollen
#

If you want to run wording past someone I am around, though only have a passing knowledge of why that was the case

idle owl
#

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.

blissful pollen
#

I'm trying to recall was it because a pin was left on in deep sleep mode (if I recall?)

idle owl
#

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.

blissful pollen
#

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?

idle owl
#

oooh

#

That's way better.

#

Thank you!

blissful pollen
#

No problem

idle owl
#

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.

blissful pollen
#

I completely get that feeling. At a certain point your brain cannot read it/think about it anymore objectively that day

idle owl
#

bah

#

how do I word "We hope to resolve this in the near future" without using "we"

#

which is counter-indicated in guides

blissful pollen
#

hmmm

#

This issue is targeted to be resolved...
This issue is planned to be resolved...

idle owl
#

Close

#

Not quite though

#

hmm

blissful pollen
#

Maybe "Track this issue <GH issue link here>"

idle owl
#

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?

blissful pollen
#

I like that too... even The issue is being actively investigated (if that is true makes it sound like it is a priority)

idle owl
#

I like it

#

Thanks!

blissful pollen
#

Welcome! Let's not tell me 20 years ago his primary job would be writing documents and away from development 🙂

idle owl
#

😄 I feel you

tulip sleet
#

i agree with all this; the current issue with ESP32V2 is turning out to be even weirder, so don't bother with details

idle owl
#

Thanks for follow up. Glad we nailed it.

olive turret
#

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.

olive turret
idle owl
#

@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...

tulip sleet
#

I don't that's related to power consumption. it's related to thonny issues

idle owl
#

Ah.

#

Ok

#

I think this is good then.

olive turret
#

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?

tulip sleet
olive turret
#

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 ...

tulip sleet
tulip sleet
thorny dove
#

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.

tulip sleet
#

the minify package is installed when you do pip3 install --upgrade -r requirements-dev.txt as described in the link

thorny dove
#

@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

tulip sleet
#

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

thorny dove
#

@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

olive turret
tulip sleet
#

do a make BOARD=... clean and then try make BOARD=... again

thorny dove
#

@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)

olive turret
#

Lemme get the container spun up first ...

tulip sleet
thorny dove
#

@tulip sleet maybe I forgot to repeat the steps in the new clone

tulip sleet
#

the pip3 installs are not specific to the clone

thorny dove
#

Ok

tulip sleet
#

but you have to do them inside the venv created by esp-idf/export.sh

thorny dove
#

I just did

tulip sleet
#

because the export.sh sets up a private python environemtn

thorny dove
#

OK

#

@tulip sleet I saw various times during the pip3 install Requirement already satisfied: So, various requirements were already there.

tulip sleet
#

minify_html was added to support the web workflow, which uses HTML and javascript

thorny dove
#

Thanks for the elaboration

tulip sleet
#

i have to get off for a while, I will circle back in something over an hour

olive turret
#

@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.

thorny dove
#

@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.

manic glacierBOT
olive turret
#

@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.

manic glacierBOT
olive turret
#

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.

manic glacierBOT
thorny dove
#

@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.

tulip sleet
thorny dove
#

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

blissful pollen
#

@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 🙂

thorny dove
#

@tulip sleet build result in Linux/Ubuntu session for BOARD=espressif_esp32s3_box.

tulip sleet
thorny dove
#

Resulting in CIRCUITPY drive

midnight ember
#

looks like a good build to me, am I missing something?

thorny dove
#

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.

manic glacierBOT
#

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...

thorny dove
jaunty juniper
#

no but it means that it crashes basically, we have currently open issues related to crashes I think

thorny dove
#

OK

jaunty juniper
#

you know what I don't actually know

thorny dove
#

I tried this. Seems to help in a part in the beginning

jaunty juniper
#

usually the internal watchdog is there to detect when some part of the code crashes

thorny dove
#

Yes, that I read in the article I mentioned

jaunty juniper
#

but maybe it's not set correctly 🤷

thorny dove
#

So, it is a safeguard to get control back if something goes wrong.

#

I repeat 'wdt.feed()' in the main loop of the program

jaunty juniper
#

or maybe it's crashing when the user-set watchdog triggers, causing the internal watchdog to trigger ?

thorny dove
#

I inserted these WDT lines after the internal WDT errors appeared immediately after a reset in an attempt to solve them

jaunty juniper
thorny dove
#

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

jaunty juniper
#

yeah there's tweaking to be done to the status line

thorny dove
#

So, I did a test "by hand" in the REPL of the mu-editor: ```
import wifi as wifi
wifi.radio.connect("<ssid>","<password>")

manic glacierBOT
#

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...

crimson ferry
#

@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

#

certain wdt errors in the core could trigger safe mode

#

alarm module is for user-level hangs

thorny dove
#

@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

manic glacierBOT
#

@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.

tulip sleet
manic glacierBOT
orchid basinBOT
manic glacierBOT
thorny dove
blissful pollen
#

Was there a preliminary guide/instructions on getting CircuitPython installed on a C3?

idle owl
jaunty juniper
#

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

blissful pollen
#

Thanks. I just was quickly looking at it as I have a C3 sitting on my desk, but then got distracted

manic glacierBOT
#

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...

manic glacierBOT
random junco
#

@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

jaunty juniper
#

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
random junco
#

and thanks again, been a couple years since I used sphinx

random junco
#

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

jaunty juniper
#

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

edgy edge
#

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.

jaunty juniper
#

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

edgy edge
jaunty juniper
#
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

random junco
jaunty juniper
#

but then you'll be pulling in Gigabytes of broadcom SDK 😉

edgy edge
#

@jaunty juniper thank you. For sure the points me in the right direction

jaunty juniper
#

or just ignore it, that's what I do with vscode 😁

edgy edge
#

Doesn't that make it painful to generate pull requests?

jaunty juniper
#

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

edgy edge
#

got it. I typed the question before finding the answer ...

jaunty juniper
#

just close that triangle and ignore it

edgy edge
#

yup

proven garnet
proven garnet
jaunty juniper
#

yeah I was gonna ask about that 👍

proven garnet
manic glacierBOT
spiral dune
#

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
···
manic glacierBOT
edgy edge
#

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

atomic summit
#

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?

jaunty juniper
#

but it's supported

atomic summit
atomic summit
jaunty juniper
#

yeah it would be nice if we had a solution, dunno how though

atomic summit
#

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 ?

jaunty juniper
#

it's in requirements-dev.txt ?

atomic summit
#

Are there build docs specific to this?

jaunty juniper
#

python requirements are installed manually

#

hmmmmm

#

maybe it's missing that you need to install them in the ESP-IDF environement ?

atomic summit
#

I've never had to install any manual python dependancies before when working with CP. Maybe I've just been lucky?

jaunty juniper
#

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

#

sometimes you need to redo it to update

#

but do you need to do it after esp-idf/export.sh ?

atomic summit
#

not sure... trying now

jaunty juniper
#

yeah I do it in my script

atomic summit
#

I installed req and got past that error., but now get new ones ! hahaha

jaunty juniper
#

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.

atomic summit
#

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!

manic glacierBOT
#

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 ...

onyx hinge
# edgy edge what's the right way to handle version numbers when building Circuit python? Aft...

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}',
)

edgy edge
#

@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?

onyx hinge
edgy edge
#

@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

onyx hinge
#

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

edgy edge
#

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?

onyx hinge
#

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?

edgy edge
#

after creating a fork from main

jaunty juniper
#

oh from your fork

edgy edge
#

… Just following directionsadafruit

onyx hinge
#

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")

onyx hinge
#

@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

edgy edge
#

thank you!!! Tremendously appreciate the quick response. Not sure how I could've missed something so totally obvious

onyx hinge
#

@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.

edgy edge
#

building now ...

edgy edge
#

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

edgy edge
#

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

onyx hinge
#

No, we'd rather you upstream your board.

edgy edge
#

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

onyx hinge
#

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.

edgy edge
#

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

onyx hinge
#

You're doing great so far! Happy you joined us.

edgy edge
#

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.

onyx hinge
#

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.

Adafruit Learning System

Turn the dials to 11 by writing CircuitPython modules in C.

Adafruit Learning System

Use these memory-conserving techniques to get your CircuitPython projects snaking along.

#

You might want to chat with @tough flax if you're working in the assistive technology realm

edgy edge
#

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

manic glacierBOT
tulip sleet
lone sandalBOT
lone sandalBOT
manic glacierBOT
#

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...
manic glacierBOT
#

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...
manic glacierBOT
#

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.

manic glacierBOT
#

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

#

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 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...

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
jaunty juniper
tulip sleet
#

since the fix is only for 8.0.0 anyway

#

I will edit the pasted in part of the code in the guide

jaunty juniper
#

lemme check that I don't forget the not and I'll push

tulip sleet
#

I just changed the pasted page example

ember iris
# manic glacier

@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?

jaunty juniper
#

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

ember iris
jaunty juniper
#

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

tulip sleet
#

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

jaunty juniper
#

doesn't that fetch a Gigaton of broadcom now ?

tulip sleet
#

not all the time, if there's no change

jaunty juniper
#

I don't build the broadcom port so I never fetch it

jaunty juniper
tulip sleet
#

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.

jaunty juniper
#

then I tested the oldest artifact on S3 that is not a tag

#

if was bad

#

so I started with those 2

ember iris
#

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

jaunty juniper
#

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

tulip sleet
#

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

jaunty juniper
#

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

ember iris
#

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?

ember iris
#

And thank you both so much for describing the process!

jaunty juniper
#

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

ember iris
#

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

jaunty juniper
#

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

manic glacierBOT
jaunty juniper
#

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

tulip sleet
#

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.

ember iris
#

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

jaunty juniper
#

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.

ember iris
#

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

manic glacierBOT
halcyon path
#

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.

manic glacierBOT
stuck elbow
#

I still think that naming it code.py and not autoexec.py is a missed opportunity.

analog bridge
#

Can we move to it now or still post CP8?

cobalt grail
#

I got one of those odd translation strings again.
%q ``must`` be a bytearray or array of type 'h', 'H', 'b' or 'B'

stuck elbow
#

scare quotes

#

note those are backticks, I suppose someone tried to emphasize the word by typesetting it with a monospaced font?

cobalt grail
#

In a c file? 🙂

stuck elbow
#

¯_(ツ)_/¯

analog bridge
#

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.

jaunty juniper
#

trying to emphasize with sphinx docs syntax in an error message

cobalt grail
#

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.

stuck elbow
#

maybe we should ask the author

stuck elbow
cobalt grail
#

Weblate does not show the author so I wouldn't know who to ask. Thanks for doing it for me. 🙂

tulip sleet
#

it is a mistake, I should have caught it in the review.

#

I will submit a PR fix

stuck elbow
#

you can add a serial comma while you are at it

#

before the or

tulip sleet
# analog bridge <@329766224093249548> I was able to get esp-idf v5.0 working: https://github.com...

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.

analog bridge
#

a draft PR sounds good

jaunty juniper
#

@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'"));
tulip sleet
cobalt grail
#

Thanks guys for being so fast handling this! 😎

tulip sleet
manic glacierBOT
jaunty juniper
#

circuitpython_community_library_list.md in the Community Bundle is still edited manually right ?

manic glacierBOT
tulip sleet
manic glacierBOT
#

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...

tulip sleet
#

@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"??

onyx hinge
#

@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?)

tulip sleet
#

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

onyx hinge
#

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

stuck elbow
#

git pull --tags

tulip sleet
onyx hinge
#

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

stuck elbow
#

that's what I do, anyways

tulip sleet
#

I think git fetch does --tags by default ... yes, it does

onyx hinge
#
       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.
stuck elbow
#

cool

tulip sleet
#

I try to keep the adafruit/circuitpython repo free of stasle branches, etc., so it's not necessary to ignore that stuff locally

onyx hinge
#
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.
tulip sleet
#

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

onyx hinge
#

yes I think the more nuanced explanation is something like that

tulip sleet
#

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

analog bridge
tulip sleet
#

maybe you two can compare git versions

analog bridge
#

Mine is git version 2.25.1 Ubuntu 20.04 WSL

onyx hinge
#

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

tulip sleet
#

i see that it's really rpi, not broadcom, that made the repo

onyx hinge
#

and origin is origin https://github.com/adafruit/circuitpython (fetch)

tulip sleet
#
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

onyx hinge
#
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
tulip sleet
#

i am using https

#

adafruit https://github.com/adafruit/circuitpython (fetch)

onyx hinge
#

I'm getting more confused by this

#

here, it's repeatable that origin and ssh-origin behave differently headdesk

analog bridge
#

mine is https as well
origin https://github.com/adafruit/circuitpython (fetch)

onyx hinge
#

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

analog bridge
#

well, git fetch --tags origin works in both cases

#

Its better to be explicit about it.

manic glacierBOT
tulip sleet
thorny dove
#

just following a couple of minutes this interesting conversation . My git version 2.37.3 in MS Windows 11 WSL2 Ubuntu

jaunty juniper
#

I think the guide could mention the difference, and maybe we should change the community bundle to the same structure ?

manic glacierBOT
tulip sleet
cobalt grail
#

Translation done now anyways.

onyx hinge
#
``` I just sent an ICMP PING packet with CircuitPython on a PiCow
digital shoreBOT
onyx hinge
#

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)

manic glacierBOT
#

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...

manic glacierBOT
#

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...
manic glacierBOT
#

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...
manic glacierBOT
tulip sleet
#

@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

jaunty juniper
tulip sleet
#

okee dokee, I will merge, release, and test!

proven garnet
#

The fastest fix I've ever seen! 😄

manic glacierBOT
#

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() to ringbuf_size() to simplify naming.
  • `ringbu...
stoic rain
# halcyon path Did you end up getting far with porting libs to circuitpython for Wio Terminal W...

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.

atomic summit
#

Got it!

atomic summit
#

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?

jaunty juniper
#

yep, instead we use creator ID and creation ID

manic glacierBOT
atomic summit
jaunty juniper
#

just a PR I think

atomic summit
#

hmm, ok, but how do I decide what my creator ID would be? They don't seem to be sequential?

jaunty juniper
#

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 😬

atomic summit
#

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?

jaunty juniper
#

it's like VID and PID but twice the bytes

atomic summit
#

Like this?

CIRCUITPY_CREATION_ID = 0x00000001```
#

for my TinyPICO ?

jaunty juniper
#

yeah

atomic summit
#

Ok, cool

jaunty juniper
#

my understanding is that "community managed" creation IDs are in the repo, other can go anywhere they want, like your own repo

manic glacierBOT
#

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...
jaunty juniper
#

I like how the community managed Espressif list uses 0032_**** for ESP32, 00C3_**** for C3 boards and such :p

atomic summit
#

hmm, is there no mem_info() in cpy ?

jaunty juniper
#

yeah I don't think it's enabled

atomic summit
#

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.

jaunty juniper
#
print(gc.mem_alloc() + gc.mem_free())
#

I think ?

atomic summit
#

Yeah, that's prob it, ta !

manic glacierBOT
proven garnet
#

Dependabot should now support compatibility release notation properly! (~=)

#

I can look back into that, before it was a bust and all uprevs created PRs

manic glacierBOT
lone sandalBOT
manic glacierBOT
#

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...

manic glacierBOT
atomic summit
#

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.

ornate breach
atomic summit
#

Yeah, I couldn't find any yaml files to add my boards in - thanks mate!

ornate breach
#

Np

orchid basinBOT
lone sandalBOT
edgy edge
#

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.

Adafruit Learning System

Turn the dials to 11 by writing CircuitPython modules in C.

stuck elbow
#

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?

manic glacierBOT
onyx hinge
#

@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...

edgy edge
#

@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

onyx hinge
#

circuitpython's C API is unrelated to CPython's C API

edgy edge
#

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.

manic glacierBOT
#

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...

manic glacierBOT
manic glacierBOT
ornate breach
#

Has anyone attempted to put circuitpython on the SAM4 from microchip?

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

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...

manic glacierBOT
#

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...

manic glacierBOT
#

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...

jaunty juniper
#

🥧🐮 !!!

#

I didn't even know you could do that

manic glacierBOT
manic glacierBOT
#

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...

manic glacierBOT
#

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...
manic glacierBOT
#

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...
manic glacierBOT
#

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...
manic glacierBOT
#

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...
analog bridge
#

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.

onyx hinge
#

Is there a "usb storage disable", or just read-only?

stuck elbow
tulip sleet
stuck elbow
onyx hinge
#

ah I was looking at all the "usb_" modules

#

does that make the drive writable by code.py too?

stuck elbow
#

no, you still have to remount it

tulip sleet
stuck elbow
#

explicit is better than implicit

onyx hinge
#

thanks dan

tulip sleet
#

@analog bridge should be done now

analog bridge
onyx hinge
#

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

stuck elbow
#

this is mine

#

I have midi disabled at the firmware level

tulip sleet
onyx hinge
#

esp-iot-solution does?

tulip sleet
#

no, esp32-camera

onyx hinge
#

oh yeah sure rename it to circuitpython if that's helpful.

analog bridge
tulip sleet
#

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 ?

onyx hinge
#

I am fine with whatever you decide

analog bridge
#

for adafruit/esp-idf, we are using circuitpython-v5.0 and circuitpython-v4.4

tulip sleet
#

i think that's ok, unless esp32-camera has its own version numbers, which maybe it does

onyx hinge
#

they do have version numbers, 2.0.2 is the last release number

tulip sleet
#

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

analog bridge
#

it does support it but there are still some customizations of our own

tulip sleet
#

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.?

manic glacierBOT
analog bridge
manic glacierBOT
tulip sleet
#

I should PR the fix I made to upstream also

analog bridge
#

Thansk! 🙂 Also, lookout for PRs coming to esp-iot-solution and esp32-camera forks

manic glacierBOT
manic glacierBOT
tulip sleet
#

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

idle owl
manic glacierBOT
#

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...
thorny jay
onyx hinge
#

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
#

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

proven garnet
# onyx hinge <@135415127879974912> I see you typing .. I would love your thoughts about https...

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.

onyx hinge
#
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
proven garnet
onyx hinge
jaunty juniper
# idle owl I'm not sure I follow what you want to happen here.

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.md to the guide
  • in the future change the community bundle to use a docs directory, sphinx, RTD and docs/drivers.rst so that both bundles work the same, with the same instructions
tulip sleet
# idle owl I'm not sure I follow what you want to happen here.

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

proven garnet
tulip sleet
#

ok, I crossed with Neradoc's comments

idle owl
#

Fair enough.

#

@jaunty juniper Hmm, ok. I'll think about that.

onyx hinge
#

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

proven garnet
#

@onyx hinge Interesting, you mean the run_mypy.py script?

jaunty juniper
#

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)

onyx hinge
#

there are other things it'd make easier, like the way we exclude pylint examples, tests, and the main code all differently

proven garnet
#

That is a wrench

#

But definitely worth looking at workarounds still in my opinion

onyx hinge
#

I'm not sure what that means, "a wrench"

proven garnet
#

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

onyx hinge
#

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

proven garnet
#

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.

onyx hinge
#

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.

proven garnet
#

I'll definitely take a look tonight, thanks for bringing it up!

onyx hinge
#

I appreciate your thoughtfulness about stuff like this

modern wing
#

Happily lurking 🙂

onyx hinge
#

Hummmmm now ONLY the 'no milestone' milestone is listed in the adabot report ```

  • 5 active milestones
    • 5 issues not assigned a milestone
proven garnet
#

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.

proven garnet
onyx hinge
#

I added 8.0.0 and 7.3.x manually just now

tulip sleet
#

ty!

idle owl
#

@tulip sleet I don't hear you if you're talking.

#

Oh that's on me.

modern wing
#

I hear both of you, loud and clear.

idle owl
modern wing
#

yay, audio routing.

onyx hinge
#

@lone axle are you getting the newsletter links today?

lone axle
#

yep, I'll get them.

onyx hinge
#

ty

lone axle
#
midnight ember
#

synthesizer 🐿️

lone axle
#

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 ...

▶ Play video
onyx hinge
#

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.

midnight ember
#

i learned how to use resistor values for led's thanks to that episode

lone axle
midnight ember
#

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.

onyx hinge
#

The "C" is silent I guess

midnight ember
#

I recommend referencing it as Csharp python. Using C#Python kids these days might get that confused with a hashtag. :/

thorny jay
#

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 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
^ final result

turbid radish
#

@onyx hinge I'll look to post a blog post on it

proven garnet
#

@idle owl The real friends are the bugs we made along the way 😂

midnight ember
#

walk m person

#

walkmp3rson, leet syntax

proven garnet
analog bridge
#

Sorry, a bit out of alphabetical order, its been a while... 😅

idle owl
midnight ember
#

can move it after the meeting, no worries

idle owl
#

Nah! Don't move it, timestamps are in order.

onyx hinge
#

@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

midnight ember
#

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

idle owl
#

@tulip sleet 😂

midnight ember
#

carpet tools are wicked looking things. leather gloves? nah.. pot holders got this.

errant grail
#

Relationship between the tolerance parameter and possible number of matching color shade values.

midnight ember
tulip sleet
#

ooh, pretty, I like the switch colors

errant grail
#

Such a beautiful PCB.

minor plume
#

@onyx hinge I’m curious now why/how you learned about emojis in branch names. Sounds like there’s a story in there. 😂

onyx hinge
midnight ember
minor plume
onyx hinge
#

@minor plume yeah it takes me minutes if I don't copypaste it from somewhere

midnight ember
#

same, no worries

tulip sleet
#

mailbox photo is great!

midnight ember
#

mailbox is adorable!

idle owl
minor plume
#

That mailbox graphic is sooooo cute!

idle owl
#

That's a photo 😄

#

Kids' toy.

midnight ember
#

haven't listened to paul cutlers latest podcast. going to do that right after this. synths!

minor plume
midnight ember
#

still a great image, cute!

jaunty juniper
midnight ember
#

linode, haven't heard that name in a while

onyx hinge
idle owl
#

Came with little plastic mail, and letter stickers to decorate it.

minor plume
midnight ember
#

it comes with a blinka sticker? alright i'm sold. 🙂

thorny jay
idle owl
#

But you can spell her name with the ones that come with it!

midnight ember
#

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.

proven garnet
#

We could always fork the repo and revert it backwards to test, worst case

midnight ember
#

so is that battery the part you couldn't talk about last week?

midnight ember
#

yes

idle owl
#

Last week is a blur, I genuinely don't remember what you're referring to 😄

midnight ember
#

said there was new hardware for the project that you couldn't mention until the guide came out.

idle owl
#

We may have a new LoRa board coming out. But it's not out yet, don't ask!

thorny jay
#

Yeah, but will it work on EU frequency, or a variant for EU frequency?

ornate breach
#

Well now I’m gonna ask

idle owl
onyx hinge
#

putting the "skerr" in "scourge" today I see

proven garnet
#

Oh right, I forgot about that

#

Good point

midnight ember
idle owl
#

Ah right.

midnight ember
#

ah ok thought it might have been the battery, nvm then shhh

analog bridge
#

@onyx hinge @tulip sleet we are using espressif repos as submodules with modifications

midnight ember
#

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.

thorny jay
midnight ember
#

^ integrity

jaunty juniper
#

I believe we don't always use a fork of espressif if we can avoid it ?

analog bridge
#

I'll try and give this a shot on my fork.

analog bridge
ornate breach
analog bridge
#

we only have like a couple of files or just a single function that needs changing on espressif side

#

yep

#

stack overflow

midnight ember
#

🥩 overflow

analog bridge
#

it has QnA with up-votes and answers can be choosen

idle owl
#

Hmm.

onyx hinge
idle owl
#

I also worry about diluting the field with more communication options.

#

But we can definitely look into it.

minor plume
#

(Oops. That shouldn’t have been a reply)

onyx hinge
#

Just to muddy the waters, but Discord ALSO added a "forum" feature 🤯 I don't know what it does, exactly

thorny jay
midnight ember
#

a valid concern is github starting to charge for that stuff eventually and then the entire community gets held for randsom basically

blissful pollen
#

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

thorny jay
#

And you can make vote in Discord... with a lot of imagination. 🙂

onyx hinge
#

screenshot of forum in qmk discord

ember iris
analog bridge
#

Thanks! 🙂

proven garnet
#

Thanks!

midnight ember
#

👋

errant grail
#

Thanks!

minor plume
#

Thanks everyone! 👋

minor plume
orchid basinBOT
onyx hinge
#

I'm gonna disconnect from the voice chat. have a good week y'all

idle owl
#

I need to drop off as well. Have a lovely week!

thorny jay
#

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).

ember iris
#

Thanks all, have a good one!

orchid basinBOT
idle owl
#

I also would have gone for Display Ready. But it wouldn't have won anyway. 🤷🏻‍♀️

hidden rain
#

Is there a live meeting going on now?

blissful pollen
hidden rain
#

ok.. thanks. I'll set my alarm for next week.

lone axle
hidden rain
#

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?

tulip sleet
#

thanks again!

spark summit
#

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.

stuck elbow
#

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

blissful pollen
#

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

onyx hinge
#

Yes it's all pretty ad-hoc.

spark summit
#

@blissful pollen @stuck elbow Thank you so much! That helps a lot.

orchid basinBOT
spark summit
#

@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 😂 .

tulip sleet
#

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

thorny jay
idle owl
manic glacierBOT
proven garnet
#

@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

onyx hinge
#

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

#

so maybe you have to go with .pyi for mypy with single-file modules? I'm not sure.

proven garnet
#

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.

onyx hinge
#

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

proven garnet
#

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).

onyx hinge
#
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 😕

proven garnet
onyx hinge
#

yes, and mostly the extra imports & tests needed for the annotations

proven garnet
#

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.

#

Seems like it has issues with things member variables though

#

I haven't run it yet though so I might be misunderstanding

onyx hinge
#

anything I say may be a misunderstanding as well. ttyl, calling it a night here.

proven garnet
#

Thanks!

edgy edge
#

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?

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

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 dualbank module is likely almost never used by anyone.
  • New users can be puzzled (and disapp...
manic glacierBOT
analog bridge
#

In espressif port, is there anyway to know in Makefile, if a board has psram or not?

tulip sleet
#

looking...

edgy edge
#

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?

tulip sleet
analog bridge
tulip sleet
#

ah yes, sorry, I was thinking about .h files

analog bridge
#

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

tulip sleet
#

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

analog bridge
#

there is a new component in idf v5.0 (esp_psram) which needs to be conditionally added depending on CONFIG_SPIRAM

tulip sleet
#

also tools/update_sdkconfig.py, not sure when that is used