#circuitpython-dev

1 messages · Page 406 of 1

viscid pine
#

i dont think update alone gets the submodules of idf

atomic summit
#

Yeah, I'd already done an --init and made sure I had everything, and that the IDF was up to date.

atomic summit
#

have I mentioned I dislike git recently? 😉

viscid pine
#

submodules are painful

manic glacierBOT
jaunty juniper
#

yep

#

with what Scott mentioned in today's stream I lean towards a change he made for debugging that was accidentally left in

viscid pine
#

should those pins get claimed when debug=0 ?

#

i mean is that intended

jaunty juniper
#

I don't think they should get claimed at all, the board just does not have debug serial pins broken out, enabling it in DEBUG builds even would preclude debugging the UART pins, it could be an option

lone axle
jaunty juniper
#

it's pyportal though, that would be with the ESP32SPI lib not the core ?

lone axle
#

Yeah I think that is right

lone axle
#

when I sent that originally I thought the issue existed starting on 7.1.1 or 7.2.0. But that turned out not to be the case, it goes back further so it does appear more likely related to esp32spi

jaunty juniper
#

there are no sockets in the core on pyportal anyway 😉

#

what I don't know is what that line did before recv_into was added to ESP32SPI

#

oh wait it's in the code, the lines just above it 🤦‍♂️

manic glacierBOT
atomic summit
#

i2c.scan() 100% long hangs on esp32s3 😦

#

Anyone else confirm or deny?

viscid pine
#

i'll take a look

atomic summit
#

my code...

>>> import board
>>> import busio
>>> i2c = busio.I2C(board.SCL, board.SDA)
>>> while not i2c.try_lock():
...     pass
... 
>>> [hex(x) for x in i2c.scan()]
#

well, it does come back.... after 30+ seconds ?

#

actually, that time it took 77 seconds to come back... and didn't find any I2C devices plugged in... even though there is one and it's on.

viscid pine
#

@atomic summit what are the i2c pins?

atomic summit
#

mine are 8 & 9

#

same as I use on my FS2 and TinyS2

viscid pine
#

most microscopic silkscreen ever with an LED shining in my eyes

#

yeah it seems to have locked up

atomic summit
#

hmm, same 7.2.0-alpha.1 on TinyS2 also locks up.

#

Not an S3 thing

#

will raise an issue

viscid pine
#

ok it came out after a while

#

oh i think it rebooted, unsure

atomic summit
#

mien didn't reboot... just comes out, but finds nothing

#

what board did you test it on ?

viscid pine
#

esp32s3 devkitc n8r8

#

going to try again and see what the uart says

atomic summit
#

you on github? what's your username?

viscid pine
#

@prplz

atomic summit
#

of course you are !!!

proven garnet
atomic summit
#

hahahas

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.2.0-alpha.1-189-g9a353a4f5-dirty on 2022-01-22; TinyS2 with ESP32S2
But really on any ESP32 board. S2 and S3.

Code/REPL

import board
import busio
i2c = busio.I2C(board.SCL, board.SDA)
while not i2c.try_lock():
    pass
    
[hex(x) for x in i2c.scan()]

Behavior

Scan hangs for 60-90 seconds, and then comes back with nothing found.
Confirmed on my TinyS2, TinyS3, FeatherS3 and corroborated with...

jaunty juniper
#

it's missing the optional length argument

#

(which is present in the core sockets and used by requests)

atomic summit
#

On a positive note though...
TinyS3 and a new re-vamped FeatherS3 production boards validated!!!!

proven garnet
#

Ahhh got it. Thanks! I can patch that.

jaunty juniper
#

(lol clicking on "shrug" when trying to put a thumbs up feels bad)

viscid pine
#

@atomic summit pullups?

atomic summit
jaunty juniper
#

I broke my QTPY ESP, but earlier I did some test and I noticed I didn't get the "no pull ups" error even though I hadn't connected anything yet, and the scan hanged, it came back when I connected a thing, but that might have been a coincidence and the same issue

atomic summit
#

Hmm, ok, right so nothing plugged in could be the "no pullups' thing.

viscid pine
jaunty juniper
#

yeah that's what it should do

atomic summit
#

ESP32-S2 usually does as well.

#

but it's not in 7.2.alpha1

viscid pine
#

added pullups, works now

atomic summit
#

and finds a device?

viscid pine
#

i unplugged it, one min

atomic summit
#

hmm, i just plugged a second device in... that has no pullups and it came back with RuntimeError: No pull up found on SDA or SCL; check your wiring immediately

viscid pine
atomic summit
#

second time I scanned it found 1 device, and no pullup error

viscid pine
#

i had this with other ports too, sometimes it was ok without pullups near the board, sometimes not

atomic summit
#

ok, now it finds 2 devices.... one has pullups and one doesnt

#
['0x10', '0x1e']```
#

if I take out the one with pullups and leave teh one without

#

scan now hangs again

#

but no error

#

so "code running from code.py" shows me a pullup error on this device

#

no, not true. failing with no error in code.py now

#

I've only seen the "no pullup error" once now, out of 20+ scans and connecting and disconnecting devices in various orders.

manic glacierBOT
#

Ok, if the slave has pull-ups.... it seems to work, if multiple slaves connected and one has pull-ups, it works and finds them all, but if the one with pull-ups is removed, the next scan long hangs again.

If a slave with no pull-ups is connected and nothing else, it long hangs.

Only once I've see the "no pull-ups error".... every other time it hangs. I've plugged in and unplugged 4 different I2C modules, some with and some without pull-ups, I can't make sense out of what is happening.

proven garnet
#

Hotfix submitted for the ESP32SPI issue 3fingerguns

viscid pine
manic glacierBOT
viscid pine
#

@atomic summit I solved it, the scan is using too great of a timeout, taking 1 second per address

#

editted the github comment above with the infos

atomic summit
viscid pine
#

i COULD i guess

atomic summit
#

So you know why it's stalling? A recent change?

viscid pine
#

I don't think so

viscid pine
#

trying to understand how other ports handle this case now

#

yep just got samd to stall too :)

#

but for samd i had to manipulate the sda/scl on purpose, the esp32 one is just annoying because it happens when you dont attach pullups

atomic summit
#

but it shouldn't take any longer if there are no pull-ups.

viscid pine
#

clock stretching maybe

#

when i tried it on the rp2040 port is raised an error about stretching too long

manic glacierBOT
#

Yesterday it was mentioned / suggested in "Deep Dive w/Scott: #CircuitPython2022" that DeviceInfoService() could be used for identifying the "partner" in a connection.
Checking this I did not find a way to obtain the DeviceInfo from a connection.
It seems to be only available during the start scan phase in the result of ble.start_scan.
A keyboard advertises its services and "gets connected" by one or more centrals.
Because it absolutely does not make sense for a keyboard to be connec...

manic glacierBOT
crimson ferry
#

The extra 192k of internal RAM on the S3 is really nice for wifi code. We may want to consider increasing pystack and possibly also the max number of sockets.

pallid echo
#

Waveshare sent me a few RP2040 boards for testing. I'm comparing the schematics with the Pi Pico. And so far they are pin compatible, as they claim. They use different Buck-Boost converters in the power circuit, looks fine. But he Pico has powersafe tied to GND (active) and a pin, and these Waveshare boards have them tied to VSYS (inactive) and that same pin... I have 2 questions: 1. Can I in the board definition initialise that pin as output and set it low by default, such that the default behaviour is more like the Pico? 2. Should I?

tulip sleet
# pallid echo Waveshare sent me a few RP2040 boards for testing. I'm comparing the schematics ...

so, the regulator on the original Pi Pico is pulled to ground, so it's "PFM (default, best efficiency)". The WaveShare RP2040-Plus (I'm guessing that's what you're looking at) uses a TPS63000. Yes, I see it's pulled high, which disables powersave. (I was confused by "powersafe"). I don't know why they did that.

You could force that pin to the other state in board.c for the board. But maybe we should just say this board is different. Its default startup is different, and they chose it that way. It really depends on whether the user case wants lower ripple or not.
s

#

And whether it deserves its own board definition

pallid echo
#

Yeah, I tend towards not doing its own definition for the plus. If it had VBAT tied to a voltage divider to an analogue pin, it would make sense. This powermode was the only difference... I'm currently working on the one with an LCD... That one does merit a definition. I'm first trying to get it to work with SPI and then move that to the board definition, like the Pimoroni and the Adafruit Macropad do.

pallid echo
# tulip sleet so, the regulator on the original Pi Pico is pulled to ground, so it's "PFM (def...

Sorry for the confusion. I'm not a native speaker. Safe/save... Coming from Amsterdam those sound exactly the same.

But maybe we should just say this board is different

Should I still write a _board for circuitpython.org where I can point that out? There are differences that don't affect the circuitpython definition, like USB-C and the battery + charger... If so, how do I make the Download links point to the Pico firmare? By using the same board_id in the header of the markdown?

tulip sleet
#

Is this a board you are going to use?

#

It's fine to add more board definitions. Each one just lengthens the build time by a small amount

#

especially if there is going to be another one for the LCD board. Then it's kind of a family of boards.

#

I would be inclined NOT to override the default powersave setting, because that's how the board comes. We don't have to make the board act like the Pi Pico. It acts like itself.

pallid echo
#

The one with the LCD is exactly the same with an LCD attached to an SPI bus

tulip sleet
#

So that may not merit its own definitino.

#

it is like our ESP32-S2 board with or without a BME280

#

I take that back - I assume you want it to have a default display and show the REPL, like most other boards with displays

pallid echo
#

Yes. I think that's the most use friendly thing to do. Make it behave like the other similar boards.

manic glacierBOT
dusk mauve
#

I'm diving into tackling a rather complex "missing typing" issue on a lib and can't for the life of me figure out the mypy arguments required to generate the same list in the ticket. Its not part of pre-commit or the CI actions as far as I can see and its not mentioned in the contributor learn guide(s) I've reviewed so far.

I know I had this in my notes while working on the APDS9960 refactor but somehow in the intervening weeks those notes have disappeared into the ether. 😂

Anyone have an example of a mypy command to make sure that things are properly typed?

jade urchin
#

cc @lone axle, the opener of said issues

lone axle
# dusk mauve I'm diving into tackling a rather complex "missing typing" issue on a lib and ca...

We haven't added the mypy check to CI yet. I think the plan is to get the bulk of the libraries typing knocked out before we add it so that we don't have as much work to do in order to make sure everything is passing CI whenever we do add it.

So it is not necessarily strictly necessary to run mypy and eliminate all of the possible issues it can report. We are mainly focused on just adding the types for functions / arguments / returns at the moment. Other errors can be ignored for now. When the time comes there will likely be some community discussion to figure out what configuration we want to use with mypy which could factor in to which errors that it can raise we are actually interested in resolving.

I can get you the command I used that I made the issues with though.

dusk mauve
# lone axle We haven't added the mypy check to CI yet. I think the plan is to get the bulk o...

That makes sense. I remember having this question a month or two ago but, of course, can't recall how I resolved it.

If you can find the command or argument combination used for the issue generation that'd be helpful, at least.

I'm looking at the adafruit_macropad lib and, well, its huge, so having the ability to check as I go would help a lot since there are some interesting decisions to make while type-safing it.

lone axle
dusk mauve
lone axle
#

For sure! Thanks for helping tackle the typing info 😄

dusk mauve
torn geyser
#

Afternoon, I’m interested in in helping with an issue I submitted last night, and was hoping to get a pointer on the best place to start. Is there a guide or doc on developing/debugging circuitpython libraries?

torn geyser
jade urchin
torn geyser
proven garnet
#

@lone axle and @jaunty juniper thanks for helping figure out the issue with the ESP32SPI socket implementation. I wrote my thoughts there but worth mentioning here. Basically CircuitPython's socket implementations have a default size argument of 0, which translates to trying to fill the buffer. This is different than CPython, a size of 0 should return nothing, and that's how I wrote ESP32SPI's recv_into().

#

I wanted to ask here if it's worth changing the socket implemetations to match CPython. It would technically be a breaking change if anyone ever wrote code that assumes size = 0 operates how CPython's size = None does, but would match convention. Easiest change though is to change ESP32SPI's implementation to match the other libraries.

#

Testing confirms that's the issue too 🙂 got the request's simple test to work

jaunty juniper
#

I wonder, if somebody calls recv_into(some_length) would they not expect it to return nothing if some_length is 0 ? like, it's a computed value from a header or something

#

so, I would assume the current behavior is a bug

#

worth looking around if explicitly calling it with 0 is done anywhere

proven garnet
#

So at least to the best of my sleuthing, Adafruit doesn't seem to have code USING an explicit mention of nbytes=0, but no clue about user's codes.

low sentinel
#

😄 was just going to paste that link

proven garnet
#

My bad 😓

#

I could have sworn I read otherwise, but this is a classic example of late-night code writing haha

#

Or late-night reading I guess haha

low sentinel
#

oh we've all read late 🙂 thanks for insisting on semantics consistency!

jaunty juniper
#

ah well then !

proven garnet
#

Thanks again everyone, hotfix inbound!

torn geyser
#

I have to say…when I submitted that issue at like 9 o’clock last night I didn’t think it would even get a look until later in the weekend. It’s pretty awesome

proven garnet
#

🐛 🔨

manic glacierBOT
manic glacierBOT
manic glacierBOT
viscid pine
#

@tulip sleet some ports don't seem to have any i2c timeout from what i can tell

viscid pine
#

i suspect the timeouts in the espressif port are confusing freertos ticks for cpy ticks too

tulip sleet
#

Quite possible. If we can set a shorter I2C timeout on Espressif that works, then that would solve the problem for scan() and for other cases where I2C might hang for quite a while.

viscid pine
#

the problem i see is that it still needs to do 112 probes

tulip sleet
#

perhaps we need to fix the "I2C needs pullups" logic on the ESP boards; it works well on other ports

viscid pine
#

i dont think it can be fixed in this case. I have them floating so all bets are off

tulip sleet
#

do the pins not have pullups?

#

to test?

viscid pine
#

yeah, no pullups

#

the problem is that if an unsuspecting user leaves off their pullups, scan stalls for 112 seconds, not even responding to ctrl+c

tulip sleet
#

so if we make the timeout more like 1 msec or 10 msecs, it will stall for shorter

#

The current 1 sec timeout is way too long for I2C, would you agree?

#

for bus stretching

viscid pine
#

the probes is currently 1 sec on esp, other writes and reads are 10sec

#

i think they are accidentally 10x higher because of confusion between freertos tick vs cpy tick

tulip sleet
#

Limor has told me one second is an eternity for I2C clock-stretching

viscid pine
#

ok, shall i do another pr just trying to fix the esp problem?

tulip sleet
#

do those pins have pull-downs or no pulls at all

viscid pine
#

nothing, just floating

#

and they somehow pass the pull up test and timeout the probes

#

i know its weird but myself and @atomic summit both experienced it and thought it was a bug at first

tulip sleet
#

if you read them at all, quiescently, would they read high? I'm thinking about how better to do the pullup test.

#

I'm not saying you're wrong to add the timeout code, but it would be good to fix the pullup test as well

viscid pine
#

i tried on a samd21 and rp2040 board, both those fail the pullup test

atomic summit
#

But why is there a pull-up test at all?

viscid pine
#

i2c requires them, it's open-drive

atomic summit
#

I have boards here with no pullups that work perfectly in Arduino, and MP. but in CPY they wont work.

tulip sleet
#

because before we had the pullup test, we had a lot of support issues with unpowered breakouts, and things hanging because of that

#

(because we didn't have good timeouts, also, e.g. the nRF blocking I2c routines don't have any timeouts)

viscid pine
#

the test catches this issue on some boards but not on these esp boards

atomic summit
viscid pine
#

the check isn't blocking, it's the scans timing out

tulip sleet
#

i was giving the motivation for adding the checks in the first place

atomic summit
viscid pine
#

oh right

atomic summit
#

have a message saying "No pullups found, this might make your I2C comms unreliable"...

#

but it should let me do it anyway.

tulip sleet
#

we could add an override boolean. Are you using internal pullups? It's an accident your no-pullout breakouts are working, right?

atomic summit
#

No accident. They are not needed as it's my ESP32 -> a Tiny1606 that's an I2C slave. No pullups are required in that case.

#

that doesn't mean they shouldn't be there. they should, but it's not accident it works like this.

tulip sleet
atomic summit
#

I agree the check should be there.... jut not one that blocks the device out completely. A bool override sounds like a good option

tulip sleet
#

why does your circuit work reliably? I don't understand why no pullups are requied? Is there something special about the circuitry on the Tiny1606?

atomic summit
#

I think the SW I2C Slave handles it internally, maybe with internal IO pullups. Not sure.

#

The problem I have is... I get the 120sec stalll... then no error about pullups and no devices found in CPY.

tulip sleet
#

So there are multiple issues here:

  1. would be nice to override the pullup check in some cases
  2. Some I2C impls have too-long bus-stretch timeouts
  3. Some I2C impls have no timeouts whatsoever
  4. Some ESP pins have no pulls, so the checking doesn't work
viscid pine
#

internal pullups are disable for some reason: CIRCUITPY_I2C_ALLOW_INTERNAL_PULL_UP

atomic summit
#

Seems so! I originally reported the issue, but @viscid pine did the digging to work out what's going on.

viscid pine
#

the option is there but only one board uses it

atomic summit
viscid pine
#

i don't know enough about i2c to know if internal pullups are good or bad

#

ah ok

tulip sleet
#

a good pullup is 10k at least, some sensors require stronger pullups. nRF, for instance has 13-18k internal pulls, those are kinda ok for short runs. RP2040 has 60k-80k pulls, those are inadequate

viscid pine
#

the timeouts in the esp port are just in total freertos ticks, not stretching

tulip sleet
#

so maybe your TIny1606 impl doesn't have the pullups on full time?? If they are internal, it shouldn't matter, it's just an impedance on the bus

#

for the whole transaction?

tulip sleet
viscid pine
#

correct

#

i mean the way it's currently done

atomic summit
#

I didn't write it... I have no idea. I'm sure it's teh same one Limor is using (Tiny Mega Core) for her Tiny SeeSaw stuff.

viscid pine
#

not sure about i2c_set_timeout

#

i know it's in freertos ticks because the parameter uses the freertos tick typedef

tulip sleet
#

i'm not objecting in principle, it just brings up the other issues. I think we'll discuss this internally on Monday (we have an internal mtg before the public one) and can also discuss it in the public Monday meeting. It can make sense to fix this for now, either in scan() or by setting shorter timeouts for ESP in particular, and then think about a more permanent fix

#

I just don't want to merge it before we discuss it a bit more.

atomic summit
#

That's fair!

tulip sleet
#

i am reading about reasonable clock-stretching timeouts now. In the spec, there is no timeout given, but there are well-behaved and badly behaved sensors. You don't want a bad sensor to drag your whole bus to a stop.

#

thanks for your inputs!

atomic summit
#

nps. thanks for looking into this more @tulip sleet 🙂

viscid pine
#

i see why it's not done yet, it's confusing with some ports having total timeouts and some having stretching timeouts

fringe ginkgo
#

Question about using the RST pin on the Feather M0 with LoRa radio module. I would like to have the ability to reset the M0 in software. Can I connect the RST pin to one of the analog pins and then pull that analog pin low in software to reset the M0?

tulip sleet
fringe ginkgo
#

Thank you @tulip sleet. And connecting to the RST pin in this way is reasonable?

tulip sleet
#

i'm looking...

jade urchin
#

but if you are using circuitpython, microcontroller.reset() is a way to do it just from code

tulip sleet
#

oh, I thought you wanted to reset the LoRa module

#

yes, to reset the actual M0, you can use microcontroller.reset()

fringe ginkgo
#

@jade urchin Normally I am using circuitpython, but this particular example is arduino.

tulip sleet
#

you can call NVIC_Reset() from arduino, or something like that

fringe ginkgo
#

Thank you @tulip sleet. I will try the software reset.

tulip sleet
fringe ginkgo
#

Thank you again @tulip sleet. I tried another arduino reset command that just hung the M0. Do you know if NVIC_SystemReset() has been known to work on an M0?

tulip sleet
#

we use it in CIrcuitPython for exactly that purpose. It works on M0; I think it may not work on classic Arduino

fringe ginkgo
hidden oxide
#

It says I have a ping

#

??

#

When I search mentions: g3holliday: it doesn't say anything....

tulip sleet
#

this can happen with a typo ping, which was erased

#

or edited

hidden oxide
#

Hmm

#

OK

#

I was just wondering

tulip sleet
#

or you are on @ circuitpythonistas

#

there are occasional pings to that for the weekly meeting docs

hidden oxide
#

Yeah.... I saw that Kattni pinned the notes doc - I think that's it

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.2.0-alpha.1-199-gbed724fc1 on 2022-01-22; ESP32-S3-DevKitC-1-N8 with ESP32S3

Code/REPL

>>> import dht_simpletest
DHT sensor not found, check wiring
DHT sensor not found, check wiring
DHT sensor not found, check wiring

Behavior

Using the dht_simpletest.py script from library examples; no pulses are ever seen. The script works on an ESP32-S2.

Description

No response

Additional informat...

manic glacierBOT
#

CircuitPython version

Master branch

Code/REPL

>>> make BOARD=itsybitsy_nrf52840_express USER_C_MODULES=../../examples/usercmodule

Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
Including User C Module from ../../examples/usercmodule/cexample
Including User C Module from ../../examples/usercmodule/cppexample
mkdir -p build-itsybitsy_nrf52840_express/genhdr
GEN build-itsybitsy_nrf52840_express/gen...
manic glacierBOT
manic glacierBOT
main furnace
#

Slow I2C on the Pi Zero W. Is this the same clock speed problem as the SPI issue?

tulip sleet
small gull
#

Hi, is possible to use name "circuitpython" inside name of github repository if the readme file contains text about circuipython trademark and licence is MIT?

#

Is it possible to use some sort of - "CircuitPython is a trademark of Adafruit Industries"?

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.2.0-alpha.1-201-g4d0e1d905 on 2022-01-23; Raspberry Pi Zero W with bcm2835

Code/REPL

import os
import random
import time
import board
import displayio
import vectorio
from adafruit_ssd1327 import SSD1327 # Zio 128x128 grayscale
from adafruit_display_text.label import Label
from terminalio import FONT

displayio.release_displays()

i2c = board.I2C()
i2c_bus = displayio.I2CDisplay(i2c, device_address...
tulip sleet
#

so just use it. If you are forking CircuitPython for your own use, we may want you to call it something else. But if you are writing code for use with CircuitPython, don't worry about it

manic glacierBOT
#

I did some testing with a MagTag project using CircuitPython 7.1.1 and did not see this problem. I put an Extech 380942 clamp ammeter on the positive battery wire and saw current draw bounce around 80 - 120 mA while running, and then drop to about 2 mA while in deep sleep. I ran through several sleep/wake cycles and it never varied.

manic glacierBOT
#

CircuitPython version

7.1.1
7.2.0-alpha.1-199-gbed724fc1 (attempted for fix by danh)

Code/REPL

sample_frequency = 16000
sample_size = 1024
mic = audiobusio.PDMIn(board.GP0, board.GP1, sample_rate=sample_frequency, bit_depth=8, mono=True)
print ("sample_size=",sample_size,"sample_frequency=",sample_frequency,"returned mic.sample_rate=",mic.sample_rate)
time_per_sample = None
samples = array.array('B', [1] * sample_size)
check = array.array('B', [1] * ...
small gull
manic glacierBOT
slender iron
manic glacierBOT
#

Hi, thanks for reporting this. I looked into it a bit, and it's more in depth than I initially thought.

It appears the reason it broke between 6.3.0 and now is that upstream added support for C++ code in USER_C_MODULES and we didn't check whether it worked anymore.

I tried a few ports in micropython v1.17, which is what we're currently based off of, and both bare-arm and their (unrelated) nrf port failed with different errors.

Here's a patch which makes it work _for raspberrypi (rp20...

manic glacierBOT
proven garnet
#

@lone axle @jaunty juniper I figured out the bug in the ESP32 socket library - it was the implementation of figuring out how many bytes to read. Pushed the changes that got it to work with the request's test. Thanks for all the help!

#

Also, thanks @torn geyser for bringing it up! Since recv_into() was a new implementation for the library I didn't figure there was already code already waiting to take advantage of that panic

torn geyser
#

Lol…just “lucky” timing on my part…just happened to pull out my pyportal and update jt after letting it be for months

crimson ferry
#

Requests does some unexpected(?) things... some cases use recv_into if it exists, but other cases still use recv.

orchid basinBOT
orchid basinBOT
proven garnet
#

But it seems like it's not causing memory issues so it doesn't seem critical

crimson ferry
#

@proven garnet tannewt mentioned the possibility of incorporating an async-friendly requests, I wonder if that would also work in a non-async case and essentially replace the current requests

idle owl
proven garnet
idle owl
#

@lone axle How does after the CP Weekly today sound for going over running the meeting? We have an internal meeting before, so that won't work, though it seems like that would be better so you could immediately see everything in action. But I think you've seen it enough for that not to be a necessary factor. 🙂

proven garnet
#

But yeah using async if possible is like the perfect use case for it

idle owl
tulip sleet
low sentinel
#

Aiohttp is really good 😄

crimson ferry
#

that would be great, it's been my singular annual wishlist item to have requests not block

orchid basinBOT
lone axle
#

Anyone familiar with the Github CLI know how I change the remote branch that it's pulling PRs from? Generally one of the first times that I run commands on it there will be a prompt asking me to select which remote to use. I must have selected my own branch for this repo I'm working in now, but I want to switch it to adafruit so that gh pr list will show me PRs from the adafruit fork of the repo.

blissful pollen
idle owl
#

I'm not sure that's pulling from the remotes.... 😕

lone axle
# blissful pollen Not an expert but will the `git remote` command work to change/add a remote?

it will and I can use git remote -v to see the different remotes. I could add/remove them. But I think the Github CLI tracks them seperately somehow. It doesn't rely specifically on the currently checked out branch. I.e. I could be on foamyguy/main in a repo and run gh pr list and it will show me the PRs on the Adafruit fork of that repo. (assuming I chose adafruit the first time when I got prompted)

idle owl
#

It must be in a .gitconfig or some such locally is my guess.

#

Because obviously it asks you the first time, and then doesn't ask again. So there has to be a config that it generates somewhere.

tulip sleet
#

you are talking about the gh default, is that right? If you just use git, is it "wrong"?

idle owl
#

@lone axle .git/config

#

I opened it on a repo where I've checked out a PR. There's some extra bits in there from the PR specifically.

#

Probably delete those lines, and it should ask you again when you try to check it out.

tulip sleet
lone axle
#

Perfect. Thank you both. Removing gh-resolved = base inside of .git/config did the trick next command I ran it asked me again.

tulip sleet
#

i just started learning gh. In general I have used hub (and just plain git), but getting the hub authentication set up is a nuisance.

idle owl
#

gh is pretty keen, I'm finding. Yeah you can use git but gh basically does the magic for you in one command.

#

I'm a fan of remembering less.

lone axle
#

I am steadily learning more helpful things gh can do, definitely love how easy it makes things. I started out with just pr checkouts like gh pr checkout 123 and now do pr list and basic reviews / issue responses with it. It's been super helpful for some of the automated sweeps I've done as well.

idle owl
#

You're way ahead of me there. I am still at the checking-out-PRs phase.

blissful pollen
#

I should take a look at gh, I've only ever used it for the PR checkout once or twice. After breaking my own PRs a couple times I think I finally have a vague idea what git is doing

idle owl
#

Interesting. On the TFT Feather, I ran a program that ends with deep sleep. Obviously, it was fake deep sleep because it was connected to USB. I then switched back to a basic data reading program. I noticed that the display is still showing the text from the board going into "deep sleep", and is no longer displaying the data read results. It's like the display was never reinitialised or something.

blissful pollen
#

Wonder if the fake deep sleep doesn't release the display so when it tries to start again it fails to allocate - or something like that

idle owl
#

CTRL+C/D doesn't fix it. Running I2C scan code now, still showing the sleep text.

tulip sleet
#

so no hard reset before running the other code?

idle owl
#

Correct.

#

I'm sure it'll be fixed with a hard reset.

blissful pollen
#

You could try a displayio.release_displays() right before the sleep to see if when it all starts again if it works. Wouldn't need that for the true deep sleep but maybe for the fake it would fix it

idle owl
blissful pollen
#

@idle owl Question since all the IS31 native changes I made are in for review was there any interest to add an example project using it to the guide? The example in the python library is pretty simple but I do have the code I used for my sports glasses that is simple but more useful. I could write something up if there is interest

proven garnet
#

@trim elm just a heads up that adafruit_circuitpython_vs1053 has a weird version of release.yml. I'll skip it for now, but let me know if I should replace/update it because I can complete the patch steps for it as is.

idle owl
#

@blissful pollen Have you done any guide work for us yet? In the actual Learn system.

#

Unrelated - the display is now blank after running my I2C pin script.

#

¯_(ツ)_/¯

proven garnet
blissful pollen
idle owl
manic glacierBOT
#

@wavesailor I noticed your code shows a different method of going into deep sleep than I had seen documented. Is there a reason you are not using the alarm module as suggested here: https://learn.adafruit.com/deep-sleep-with-circuitpython/alarms-and-sleep

Just a suggestion, but maybe try using the alarm module and see if the behavior changes.

lone axle
#

Would there be an interest in a Learn Guide for this: https://www.adafruit.com/product/5146. Right now it links directly to arduino github library repo. We have a CircuitPython driver now, it might be nice to have one of the product guides with pinouts and usage examples like many other products have.

manic glacierBOT
idle owl
lapis hemlock
#

@tulip sleet Dan, do you think you would have 5 minutes for a short discussion either before or after the meeting?

tulip sleet
#

sure, right now we are having an internal meeting, so might be after

lapis hemlock
#

That's OK. Thanks!

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.1.0 on 2021-12-28; Adafruit FunHouse with ESP32S2

Code/REPL

import displayio
with open("/bmp/allblue.bmp","rb") as bits:
    source = displayio.OnDiskBitmap(bits)
    dest = displayio.Bitmap(source.width, source.height, 64)

dest.blit(0,0, source)

Behavior

Hard reset of FunHouse board.

Description

No response

Additional information

May not be possible, but the response should be an...

slender iron
#

brb

idle owl
#

Also brb

tulip sleet
lapis hemlock
#

no problem.

idle owl
#

We do!

manic glacierBOT
#

It looks like Bitmap.blit intends to only accept another Bitmap but has insufficient error checking. We should fix this bug so that a TypeError exception is raised.

Also, while it may have been suggested by a linter, this is not correct usage:

with open("/bmp/allblue.bmp","rb") as bits:
    source = displayio.OnDiskBitmap(bits)

because the OnDiskBitmap object needs to retain an open file for its whole lifetime, this won't work properly. Instead, the source bitmap b...

lone axle
thorny jay
#

Sorry, skipping the meeting. No notes, but no CP activities. Group hug to the community.

lone axle
onyx hinge
#

And thank you to those who comment on PRs who are not specificlly recognized by github as reviewers

#

If you want to move up to official review status, Kattni is your point of contact

idle owl
#

Absolutely!

idle owl
#

If I have to bail suddenly, it will be quick, but please take over for me in that case. Thanks!

manic glacierBOT
trim elm
onyx hinge
#

oops sorry I was out of order ⏬

slender iron
#

np, I'm just following the notes doc

solar whale
#

That will be great -- SDCard access!

errant grail
solar whale
#

When will we get a paper tape reader? 😉

idle owl
#

@onyx hinge Let me know when you get that TFT Feather code going. I'll include it in the guide. 😄

manic glacierBOT
slender iron
#

someone in the forums wanted to do punch cards

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Category Channels

8

Text Channels

61

Voice Channels

6

Members

32827

Roles

36

onyx hinge
#

https://www.ricomputermuseum.org/collections-gallery/small-systems-at-ricm/ibm-magcard-ii-selectric-typewriter haven't found much info on this but someone was telling me about a magnetic card the size of a standard punch card that would reproduce a whole typed page when you put it into a selectric. The person was saying how it was an incredible time saver for a law practice, because they would use it to type out a standard document such as a will, and then go back and fill in the varying data...

errant grail
solar whale
#

I spent a lot of time hand "rewinding" paper tapes in my early programming days....

onyx hinge
#

will do

manic glacierBOT
proven garnet
#

Nevermind, wrong thing.

lapis hemlock
#

See you!

proven garnet
#

Thanks!

errant grail
#

Thanks!

lone axle
#

@idle owl filling up water then brb.

gilded cradle
#

Thanks all

tulip sleet
#

@lapis hemlock ok, free now

lapis hemlock
#

@tulip sleet shall we move to another voice channel?

tulip sleet
#

sure

ember iris
#

Thanks all!

solar whale
#
>>> import board
>>> import digitalio
>>> b = digitalio.Di
DigitalInOut    Direction
>>> b = digitalio.DigitalInOut(board.BUTTON)
>>> b.value
False
>>> b.value
False
>>> 
#
>>> b.value
True
>>> b.value
True
>>> 

idle owl
#

@lone axle LMK when you're back!

lone axle
manic glacierBOT
#

I tried accessing the board.BUTTON, but can't seem to get it to respond

Adafruit CircuitPython 7.2.0-alpha.1-199-gbed724fc1 on 2022-01-22; ESP32-C3-DevKitM-1 with ESP32-C3N4

import board
import digitalio
b = digitalio.DigitalInOut(board.BUTTON)
b.value
False

pressed button here

b.value
False

tried adding Pull UP

b.pull=digitalio.Pull.UP
b.value
True

pressed button here

b.value
True

slender iron
#

is it correct that it's been 6 days since a bundle release? seems fishy

onyx hinge
#

@slender iron let me take a look

solar whale
#

last avaialbe is 0119

onyx hinge
#

I don't know how to debug it so I'll stop there.

slender iron
#

I think it may be right

#

I saw releases in my inbox today

#

so hopefully it'll be bumped in the next 24 hours

manic glacierBOT
slender iron
#

Here is the notes document for 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/1YU2kvEr3cFDF6GpmVm_l500xPcxhSu1ox3iXYrL_ZUo/edit?usp=sharing

manic glacierBOT
solar whale
#

@lone axle I had some time today so I ran some tests on the bluefruitspi PR -- found an issue -- commented in the PR.

idle owl
#

@lone axle You land on two Tuesdays later in the year, but we'll be on a completely different cadence by then, so I wouldn't worry about it. Simply a heads up. As well, I can only add you to the calendar to "See all event details", not edit. So if you need changes made, let one of the Adafruit folks know to handle it.

lone axle
#

Thank you, will do.

idle owl
#

Please let me know whether you can see the calendar.

#

Or whether you need a link or something.

lone axle
idle owl
#

Perfect!

#

@slender iron @tulip sleet @onyx hinge Foamyguy is going to start on 7 February 2021 - I'm hobbled next week and want to be available to help, so we're going to have him start the following week. I've updated the hosting calendar to include him, updated our cadence, and fixed the odd days. Foamyguy can't commit to Tuesdays, so if he ends up falling on one of the odd days, we'll have to swap it up. I didn't bother changing things for the end of the year because we'll be on a completely different cadence by then anyway.

onyx hinge
#

Okay!

tulip sleet
#

ok by me

idle owl
#

Let me know if anything seems wrong in the calendar. I'm fairly sure I got it right.

onyx hinge
#

I plan to put my own disruptions into the calendar as soon as it seems sensible to travel, so worrying about the specifics of the rotation later in the year is silly to me.

idle owl
#

Exactly.

onyx hinge
#

I wonder if there's a site or service to help us set & swap dates better, in the vein of meeting schedulers but nearly the opposite

idle owl
#

Eh, I'm our default scheduler, I guess. 😄

onyx hinge
#

thank you for wearing that hat.

idle owl
#

You're welcome 🙂

manic glacierBOT
#

I can take a stab at it. It may take a while, my build environment has been down since the esp-idf update and I need to dedicate some time to rebuilding it from scratch. (if anyone gets impatient, have at it)

I don't have an intuition for the best new values, but I can test some incremental variations.

I assume this feature use the #if defined(CONFIG_IDF_TARGET_ESP32S3) construct for chip-level as opposed to board- or port-level.

viscid pine
#

@slender iron In the esp i2c code, did you mean to specify those in cpy ticks or freertos ticks?

#

you have there 10 freertos ticks for probe (1 second) and 100 freertos ticks for write (10 seconds)

slender iron
#

probe is what scan uses

#

so I'd set that as short as possible

viscid pine
#

what i mean is, i think you mixed up cpy ticks and freertos ticks when you originally wrote it

#

so for the write timeouts you write 100, meaning 1 second, but freertos is on 100Hz so it ends up being 10 seconds

#

and for probe 10 ticks, meaning 1 second

slender iron
#

ya, that could be a problem too 🙂

viscid pine
#
-    esp_err_t result = i2c_master_cmd_begin(self->i2c_num, cmd, 100 /* wait in ticks */);
+    esp_err_t result = i2c_master_cmd_begin(self->i2c_num, cmd, pdMS_TO_TICKS(1000));

@slender iron this ok? It's more robust in case you change the freertos rate in the future, also reduced that time by 10x

#

i know thats not the probe part, i want to change both

slender iron
#

sure 🙂

manic glacierBOT
slender iron
#

@viscid pine want to mark as ready?

viscid pine
#

negative, having issues

#

something is very wrong, the probes are taking 1 second each

slender iron
#

hrm

#

the idf i2c code looks complicated

manic glacierBOT
slender iron
#

because it's setup to give up control while the i2c transaction goes

viscid pine
#
            wait_time = I2C_CMD_ALIVE_INTERVAL_TICK; // I2C_CMD_ALIVE_INTERVAL_TICK == 1 second
        } else {
            wait_time = ticks_to_wait - (wait_time - ticks_start);
            if (wait_time < I2C_CMD_ALIVE_INTERVAL_TICK) {
                wait_time = I2C_CMD_ALIVE_INTERVAL_TICK;
            }
        }```
#

if i read correctly, it's capped to 1 second

manic glacierBOT
#

That is with latest from S3. It doesn't look like there is any condition other than the pins definitions existing in supervisor/shared/serial.c. There's a few places in the file that test it. Am I missing something ?

https://github.com/adafruit/circuitpython/blob/501017066c615d6a5e501c7a808bc6349a6b3603/supervisor/shared/serial.c#L62-L74

Should the pins definition be conditioned by the DEBUG level, or change it in serial.c with something like that ?

#define CIRCUITPY_DEBUG_UART...
viscid pine
#

i tried using esp's i2c_set_timeout instead, which is stretching timeout in apb cycles, but the timeout interrupt never fires

manic glacierBOT
#

This still seems broken on https://learn.adafruit.com/adafruit-qt-py-esp32-s2 at 7.1.1.
Should I open a new issue for that?

>>> import digitalio
>>> import board
>>> np_power = digitalio.DigitalInOut(board.NEOPIXEL_POWER)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: NEOPIXEL_POWER in use

boot_out.txt:

Adafruit CircuitPython 7.1.1 on 2022-01-14; Adafruit QT Py ESP32S2 with ESP32S2
Board ID:adafruit_qtpy_esp32s2
manic glacierBOT
idle wharf
idle wharf
manic glacierBOT
manic glacierBOT
#

@microDev1 any idea what's going wrong with the espressif builds in some of these PRs? #5920 is failing in a similar way.

Successfully installed distlib-0.3.4 filelock-3.4.2 platformdirs-2.4.1 six-1.16.0 virtualenv-20.13.0
FileExistsError: [Errno 17] File exists: '/opt/hostedtoolcache/Python/3.10.2/x64/bin/python' -> '/home/runner/work/circuitpython/circuitpython/.idf_tools/python_env/idf4.4_py3.10_env/bin/python'
Traceback (most recent call last):
Creating a new Python environment i...
manic glacierBOT
slender iron
#

@idle wharf a couple folks were looking at that earlier. I'm not sure what they found. @trim elm and @proven garnet I think

trim elm
solar whale
#

@slender iron over in #help-with-circuitpython we found that on the microbit_v2 , ampy need’s binascii. I enabled it and it works ok. I was planning to put in a PR but wanted to check if there were other things that should be added as well.

idle wharf
#

@slender iron and @trim elm OK, that's is good to hear from the sense that at least I know I'm not crazy. 😉

The next thing I was going to try is just removing all the docstrings and then adding them back one by one. But that won't be till later in the week probably.

#

But my fix for the actual functionality works which is good news.

slender iron
#

@solar whale I haven't looked at it in a while so I'm not aware of anything. Go ahead and add what you think needs to be added.

trim elm
manic glacierBOT
#

CircuitPython version

Primarily tested on CP 7.1.1, but also tested on CP 7.1.0, CP 20220123-4d0e1d9, and CP 6.3 using the Saola WROVER UF2 file.

Code/REPL

import alarm
import time
import board
from digitalio import DigitalInOut, Direction

# turn off power to the Neopixel
#neo_pwr = DigitalInOut(board.IO38)   # use with CP 6.3 Saola UF2
neo_pwr = DigitalInOut(board.NEOPIXEL_POWER)
neo_pwr.direction = Direction.OUTPUT
neo_pwr.value = False

time_...
slender iron
#

looks like the bundle did release today

manic glacierBOT
idle wharf
#

Is there a specific docstring format standard we're using?

These docstrings in this library seem to be different than the Sphinx ones generated by the Python DocString VScode Extension (in Sphinx format)
https://marketplace.visualstudio.com/items?itemName=njpwerner.autodocstring

Which matches what I see in the Sphinx docs.
https://sphinx-rtd-tutorial.readthedocs.io/en/latest/docstrings.html

Key things...
In this library the docstrings use returns instead of return.
They are putting the type inline with the param and not on its own :type:

Might not be why there is an errors, but if there is some standard we should follow that would be a big help as I try to make changes.

timber mango
#

I am in the process of preparing NXP port to be merged into upstream.
For this purpose I started to develop Hardware-In-the-Loop python test.
So far I have tried the HIL-test with couple of boards.
The test works fine with Grand Central Metro M4 Express - atmel-samd port.
But failed with on different places with stm port.

There are number of issues the stm port suffers from.
Some of them are mere coding mistakes, but other are not so trivial.

The one which disconcerts me is filesystem failure in case SPI flash is used.
The spi_flash_read_data and spi_flash_write_data are re-configuring SPI each time when these functions are called. This causes toggling of SCK every time when SPI is being re-configured. That was the root check_fs failure here:

    bsect = 0;
    fmt = check_fs(fs, bsect);          /* Load sector 0 and check if it is an FAT-VBR as SFD */
    if (fmt == 2 || (fmt < 2 && LD2PT(fs) != 0)) { /* Not an FAT-VBR or forced partition number */
        for (i = 0; i < 4; i++) {       /* Get partition offset */
            pt = fs->win + (MBR_Table + i * SZ_PTE);
            br[i] = pt[PTE_System] ? ld_dword(pt + PTE_StLba) : 0;
        }
        i = LD2PT(fs);                  /* Partition number: 0:auto, 1-4:forced */
        if (i != 0) i--;
        do {                            /* Find an FAT volume */
            bsect = br[i];
            fmt = bsect ? check_fs(fs, bsect) : 3;  /* Check the partition */
        } while (LD2PT(fs) == 0 && fmt >= 2 && ++i < 4);
    }
    if (fmt == 4) return FR_DISK_ERR;       /* An error occured in the disk I/O layer */
    if (fmt >= 2) return FR_NO_FILESYSTEM;  /* No FAT volume is found */```
#

However the filesystem works fine as soon as SPI re-configuring takes place before CS is activated:

bool spi_flash_read_data(uint32_t address, uint8_t *data, uint32_t data_length) {
    uint8_t request[5] = {CMD_READ_DATA, 0x00, 0x00, 0x00};
    uint8_t command_length = 4;
    if (flash_device->supports_fast_read) {
        request[0] = CMD_FAST_READ_DATA;
        command_length = 5;
    }
    common_hal_busio_spi_configure(&supervisor_flash_spi_bus, spi_flash_baudrate, 0, 0, 8);
    // Write the SPI flash read address into the bytes following the command byte.
    address_to_bytes(address, request + 1);
    if (!flash_enable()) {
        return false;
    }
    bool status = common_hal_busio_spi_write(&supervisor_flash_spi_bus, request, command_length);
    if (status) {
        status = common_hal_busio_spi_read(&supervisor_flash_spi_bus, data, data_length, 0xff);
    }
    flash_disable();
    return status;
}
tulip sleet
timber mango
#

Here is the logic analyzer capture of the problematic place. The marker #2 is the place where SPI re-configuring happens.

slender iron
timber mango
#

And here is the snapshot of SPI communication after I made the changes in spi_flash_read_data function:

tulip sleet
timber mango
#

I just wonder how it works with other boards/chips.

tulip sleet
#

It would make sense to call the configure() just once then. I don't know why it's there. You might look at the GItHub "blame" listing to see whether it was added for some reason.

#

we don't usually use plain SPI, but rather QSPI

#

It would be worth looking at the impl on other ports

timber mango
tulip sleet
#

maybe there is a bug in the common-hal configure code for SPI?

timber mango
tulip sleet
#

Oh, yes, I see what you are saying. Yes, it's in a bad place.

#

but the configure is assuming that it's disabled when it happens?

timber mango
tulip sleet
#

It does seem like it's in the wrong order. try moving the configure to before flash_enable(). I am still not sure of the motivation, except that the SPI bus might be shared with other devices.

timber mango
tulip sleet
#

and it works or it doesn't?

timber mango
#

I am going to push this change in a separate PR soon. It will be easier to analyse the code then.

tulip sleet
#

I looked at the history, and it looks like it's always been that wrong (which does seem wrong).

manic glacierBOT
#

ampy and rshell both import ubinascii when reading files from a device.
I modified ampy to import binascii if ubinascii is not avaliable

py$ diff files.py files.py.save 
62,65c62
<             try:
<                 import ubinascii
<             except:
             import ubinascii
110c107
                 try:        

This PR enables binascii in the microbit_v2 build so it is possible to use ampy ( and possible rshell with a similar fix)
I have tested this with a micro...

timber mango
tulip sleet
#

our code is not sacred 🙂 I myself have fixed some longstanding bugs recently and wondered why things ever worked the old way

proven garnet
#

I'm realize my VS Code extension has them downloaded but how exactly does one download the type sheds for CircuitPython?

slender iron
#

it's in the circuitpython-stubs package in pypi

tidal kiln
gilded cradle
#

Thank you

tidal kiln
#

np

orchid basinBOT
manic glacierBOT
idle wharf
manic glacierBOT
lone axle
# idle wharf <@!362023826105827340> and <@!252717193496756235> I was able to get the docs to...

I would defer to Scott or Kattni ultimately but I think we could remove the type hint that is causing trouble instead of reverting to a different version of Sphinx for that library. Longer term I think we'll either need to have adafruit_logging published to PyPi or else use one of those more self contained "Protocol" definitions within AzureIoT library so that it isn't dependent on the logging lib. (unsure if that is the proper term though sorry).

#

It is odd that the previous versions of sphinx build it and the new ones don't, and they may still have some bug to chase related to that. But in this case I think the type was just something it wasn't expecting.

idle wharf
#

I tested it with Sphinx 3.5, 3.4.2 and they both worked ...

#

So I still think its a SPhinx issue, unless they purposefully want it to fail and if that's the case, the error is still not helpful.

lone axle
#

4.4.0 works as well when removing the logging type hint or changing it to Logger and manually "installing" adafruit_logging into the environment.

Totally agree though the error message is not helpful at all, I got kind of lucky guessing at which argument was troublesome.

idle wharf
#

My next worry... how many CP libraries that don't go to PyPi can we hit this with ?

lone axle
#

Well I think the root cause is 2 slightly different things... I think Logger is the correct type rather than logging ordinarily just changing or adding the import and using Logger would fix it. But I think the next issue will be that the actions container doesn't actually have access to adafruit_logging, which is where either publishing it to PyPi or else using one of those self containted definitions would resolve. Though I didn't actually test without adafruit_logging maybe I'm getting ahead of myself with that, possibly it can build with out it? I'll give it a try.

#

Yeah... actually it does complete without having adafruit_logging installed.

#

So just adding from adafruit_logging import Logger and changing the type hints to Logger should make actions pass I think.

idle wharf
#

OK.. I'll test and update my PR.
ty!

#

It will be later...
Have to go Release the Kraken first...
🦑 🏒 🥅

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I would like to implement a file-transfer over serial protocol and to that end I need to calculate the CRC of typically 1kB byte-packets. Unfortunately, the latter is pretty slow in Python and CPython's binascii.crc32() and binascii.crc_hqx() are missing from circuitpython (because they use the implementation from zlib which is not turned on because of size and instability, according to Dan). Would anybody be willing to implement them directly in circuitypython's binascii?? It should only...

manic glacierBOT
#

A pair of classes to allow I2C communication between two CircuitPython devices via a ring buffer.

I2CRingPeripheral runs on the peripheral device. It provides a ring buffer to which the controller can write.
I2CRemoteRing runs on the controller device.

Asyncio:

The controller can await while the peripheral is busy.

The peripheral can await enough bytes to fill a bytearray buffer.

Use Case: Remote NeoPixel Strand

Peripheral: Read five bytes from ring ...

manic glacierBOT
manic glacierBOT
orchid basinBOT
manic glacierBOT
orchid basinBOT
idle owl
# lone axle I would defer to Scott or Kattni ultimately but I think we could remove the type...

@idle wharf We definitely do not want to revert a single library. That leads to problems moving forward. Is logging another one of those CP-subset-of-Python libraries? If it is, that's why it's not published to PyPI, because if someone were to try to use it on their computer with Python, they could simply use the Python version. That said, if we didn't design it as a drop-in replacement (i.e. no changes needed to code for Python version to work), then I'm fine with publishing it to PyPI. The ones we don't publish are drop in replacements that folks should be using the Python version for. Did I see that Patrick submitted a bug report to Sphinx? Or did I imagine that... because it sounds like something changed and if it was intentional, we need to work around it, if not, then we need to let them know a bug exists.

manic glacierBOT
#

Thanks Dan, glad it wasn't a goof on my part, but hope you can fix it...

Alan Mitchell
Analysis North https://analysisnorth.com
Cell: 907-310-9124

On Wed, Jan 26, 2022 at 8:46 AM Dan Halbert @.***>
wrote:

I reproduced this and am working on it.


Reply to this email directly, view it on GitHub
https://github.com/adafruit/circuitpython/issues/5924#issuecomment-1022439225,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAPOIPPCMTWCM7CE3QFCRF3UYAXOF...

idle owl
#

Basically, the decision as to whether or not to publish it should be based around whether the experience will be diminished when they install the CircuitPython version, when they should be using the Python version.

jaunty juniper
#

adafruit_logging has a difference with C python that actually threw me off when I tried to use it (and might deserve a breaking update ?)

addHandler(handler: adafruit_logging.LoggingHandler)
Sets the handler of this logger to the specified handler. NOTE this is slightly different from the CPython equivalent which adds the handler rather than replacing it.

#

not sure if that's relevant

idle owl
#

It is relevant, thank you.

lone axle
idle owl
lone axle
#

I think in the end we don't actually need it published to PyPi. I had assumed it would be, but it seemed like it worked fine without when I tried it.

idle owl
#

Ok, that's excellent. Keeping it as-is makes the most sense, in my opinion.

#

We can revisit it later if it turns out to be an issue.

proven garnet
#

Do I need to update it?

#

Slash looking to see what I got wrong but don't see any recent merged PRs regarding typing

proven garnet
#

Also there other difference between it and CPython logging is that FileHandler is in an extension submodule but CPython has it in the init.py

#

The idea being the the primary use for CircuitPython is PrintLogger, and not to use memory loading FileHandler if not actually needed

lone axle
#

Root cause I think though is a type needs to be Logger (the class within a library module) but was previously logging (the module itself)

manic glacierBOT
#

I rebuilt CircuitPython with an unpatched ESP-IDF (release-v4.4), and changed busio's writeto_then_readfrom() to send stop bits:

// line 328
writeto(self, args[ARG_address].u_int, args[ARG_out_buffer].u_obj, args[ARG_out_start].u_int,
        args[ARG_out_end].u_int, true);    // <- set to true to send stop bits
readfrom(self, args[ARG_address].u_int, args[ARG_in_buffer].u_obj, args[ARG_in_start].u_int,
        args[ARG_in_end].u_int);

[original code here](https://github....

deft jay
#

@tulip sleet https://github.com/adafruit/Adafruit_CircuitPython_CharLCD/issues/67 << I see you're the assignee to this problem. I'm willing and set up to assist you in debugging this if you don't have the equipment to do so.

import time
import board
import adafruit_character_lcd.character_lcd_i2c as character_lcd

i2c = board.I2C()  # uses board.SCL and board.SDA
lcd = character_lcd.Character_LCD_I2C(i2c, 16, 2)

lcd.blink = True
lcd.message = "Blinky cursor!"
time.sleep(5)
lcd.blink = False

yields:


Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
  File "code.py", line 3, in <module>
  File "adafruit_character_lcd/character_lcd_i2c.py", line 31, in <module>
  File "adafruit_mcp230xx/mcp23008.py", line 16, in <module>
  File "adafruit_mcp230xx/mcp230xx.py", line 16, in <module>
  File "adafruit_mcp230xx/mcp23xxx.py", line 14, in <module>
  File "adafruit_bus_device/i2c_device.py", line 14, in <module>
RuntimeError: maximum recursion depth exceeded

GitHub

While using the i2c/SPI LCD Backpack Maximum recursion depth exceeded. Adafruit CircuitPython 7.0.0 on 2021-09-20; Adafruit Metro M0 Express with samd21g18 Traceback (most recent call last): File &...

deft jay
#

@tulip sleet just curious if PCF8574 is going to be supported in circuitpy?

idle owl
#

Finally got to use my STEMMA QT to mini-grabbers cable. Worked like a charm. Soldering? Pfft. Who needs headers! I have grabbycables!

#

"Micro SMT test hooks" is the actual nomenclature.

tidal kiln
#

trying to remember...did something like simpleio.maprange get moved to some core or frozen module?

idle owl
tidal kiln
#
Adafruit CircuitPython 7.1.1 on 2022-01-14; Adafruit Feather M4 Express with samd51j19
>>> from adafruit_simplemath import map_range
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: no module named 'adafruit_simplemath'
>>> 
#

so still need to copy over a lib?

solar whale
#

guess so -- not sure what boards have it frozen in.

tidal kiln
#

yah. that's all i'm trying to avoid.

#

using it once for something simple

#

no biggee. will let bundle fly turn it into necessary goo.

#

thanks!

solar whale
tulip sleet
#

The minimal branch removes a bunch of features but is quite a bit smaller.

manic glacierBOT
#

thanks a lot for your help :)
so I've inserted 3 lines in _circuitpy_mpconfig.h#L238

... #ifndef MICROPY_PY_UBINASCII_CRC32 #define MICROPY_PY_UBINASCII_CRC32 (CIRCUITPY_FULL_BUILD) #endif ...

but when I do a clean build, I get the following error:

bludin:~/circuitpython/ports/atmel-samd$ make BOARD=pybadge -j6
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
mkdir -p build-pybadge/genhdr
`FREEZE ../../f...

orchid basinBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.1.0 on 2021-12-28; Adafruit ItsyBitsy M4 Express with samd51g19
Board ID:itsybitsy_m4_express

Code/REPL

The code that apparently makes things fall down is in a file called twoWheelHelper.py:

#Two-wheel with driver


import board
import time
import pwmio
from adafruit_motor import servo, motor
import digitalio
import countio
import pulseio

bracket = (servo.Servo(pwmio.PWMOut(board.D2, duty_cycle=...
manic glacierBOT
onyx hinge
#

@tulip sleet from what you've learned about usb mass storage ... is "eject" something that applies to mass storage, and not the usb device generally? could we mount CIRCUITPY as writable from Python when an eject occurs? or would that cause some problem I'm not considering...

tulip sleet
#

eject is for mass storage, yes. Windows didn't use to actually unmount the drive when you "ejected" it, but it appears to me they may have just started doing that. I have to experiment more

#

we get callbacks when ejects happen, and we are tracking the eject state

#

Windows used to just write everything out so you could "safely remove" it

crimson ferry
#

the Primary Guide is linked from the QT Py ESP32-S2 non-uFL product page, but not from the uFL version product page

manic glacierBOT
#

I've also tried to move the crc32 code from uzlib directly into binascii (not sure if that's the way to go but I tried anyway)

https://github.com/Life-Imaging-Services/circuitpython/blob/crc32/extmod/modubinascii.c#L208-L279

After prefixing L255 with static, circuitpython builds w/o error. But it doesn't boot and I'm lightyears out of my waters here. Any help is greatly appreciated :)

idle owl
#

@tidal kiln It's come up that Adafruit CircuitPython Nunchuk isn't published to PyPI, which apparently the guide suggests it is, so there's already an issue there. But I'm wondering why we decided not to publish it to begin with? I'm the one who made the library stop publishing, but I did not, evidently, make a note as to the why. It seems like it could be published to PyPI?

tidal kiln
#

hmmm...not sure either.

#

should be usable on pi

#

so would want on pypi

idle owl
#

Yeah. Do you have a way to test it? I actually don't know how to test it without publishing it and then using pip.

tidal kiln
#

there is a way. want to know? useful for troubleshooting libs on blinka setups.

idle owl
#

Yeah for sure.

tidal kiln
#

basically just set PYTHONPATH to lib folder location

#

then any import will look there

idle owl
#

Where is PYTHONPATH?

tidal kiln
#

environment variable

#

export PYTHONPATH=/home/dir/repos/some_foo_lib

#

something like that

idle owl
#

Ahh ok

#

Then run the program from command line like usual?

tidal kiln
#

exactly how will differ for OS's

idle owl
#

Right

tidal kiln
#

but yah, once set, just launch python as usual

idle owl
#

Right on. Thanks!

tidal kiln
#

that way you can just clone the repo and point python at it

idle owl
#

Do you have the hardware to test this?

tidal kiln
#

i do

idle owl
idle owl
tidal kiln
#

i can test real quick if you want. or you can to see how?

idle owl
#

I don't have the hardware 😕

#

If you could, that would be greatly appreciated

tidal kiln
#

sure. np. give me a sec.

idle owl
#

I can get started on the repo update to publish it. Have to run it through cookiecutter again to get an up to date setup.py

tulip sleet
#

@tidal kiln @idle owl if you have cloned the repo, you can do pip3 install -e the_repo_dir, and it will install it from pip's point of view, but still point to the repo dir, where you can edit it and not have to reinstall. -e is for "editable".

idle owl
#

Huh. That's also excellent.

tulip sleet
#

don't have to mess with paths or anything

#

then when it's in pypi, you just pip3 install it like regular, and the editable version will get replaced with the pypi version

idle owl
#

Fancy! Thanks, Dan!

tidal kiln
#
(blinka) pi@raspberrypi:~ $ i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- 52 -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
(blinka) pi@raspberrypi:~ $ python3 nunchuk_simpletest.py 
joystick = 127,128
accceleration ax=540, ay=528, az=769
joystick = 127,128
accceleration ax=144, ay=132, az=192
joystick = 255,128
accceleration ax=548, ay=521, az=768
button C
joystick = 0,255
accceleration ax=524, ay=512, az=769
joystick = 255,128
accceleration ax=552, ay=509, az=769
button Z
joystick = 127,255
accceleration ax=541, ay=541, az=765
joystick = 127,198
accceleration ax=545, ay=468, az=744
joystick = 127,128
accceleration ax=596, ay=596, az=692
idle owl
#

Nice!

tidal kiln
#

@idle owl works fine. i say deploy. if there was a reason no to, we'll discover...

idle owl
#

Oof I just realised we duplicated a heading in all the READMEs. Sigh.

#

And cookiecutter was never updated for a thing in the README.

idle owl
#

OK, opinion time. In library READMEs would you
A. include the info on building documentation under the "Documentation" header which applies to a link to the API documentation? Or..
B. include info on building documentation under the "Contributing" header?

Ostensibly if folks are building docs, they're probably contributing, but that may not always be the case, perhaps?

#

Leaning towards Documentation. Might make the patch more difficult, but eh. Worth it if flows better.

#

Yeah that works.

#

Nevermind, Ladyada ninja'd it.

tidal kiln
#

indeed

idle owl
#

@lone axle Would you be up for a cookiecutter addition? There's something we forgot to add, but it has repo-specific info in it, and that starts to stretch my comfort zone in cookiecutter. I can do it, but I bet it would be easier for you.

lone axle
idle owl
#

I can outline it in an issue so it's clearer what I'm looking for.

#

It involves moving one section up a bit, and adding a repo-specific line to it.

idle owl
#

@proven garnet I have a mission for you, should you choose to accept it. 😄 Ping me when you're around.

manic glacierBOT
#

I've also tried to move the crc32 code from uzlib directly into binascii (not sure if that's the way to go but I tried anyway)

I think that's a good way to go, because then we are not dragging in uzlib and its complications. I would then remove the MICROPY_PY_UBINASCII_CRC32 flag use, and just make it included all the time. It's quite small and we can spare the space on boards that already are including binascii.

manic glacierBOT
solar whale
#

Is there a good place to get font files bdf's ?

#

looking for Helvitica-Bold-24.bdf

manic glacierBOT
#

The VDD_SPI pin was unintentionally pulled high, but should have been left unconnected except for the filter caps on it. Compare the schematics of the QT Py and the Feather ESP32-S2. The Feather uses a module in a can; the QT Py has bare parts. The module has the same chip inside (an ESP32-S2 package that includes PSRAM and flash in a single package.)

Re long boot-up time: we wait five seconds to see if USB has been connected, and allow for enumeration. But we could conceivably not wait ...

tulip sleet
#

I often do find or grep in that repo (or the bundle repo) to find things

manic glacierBOT
#

There seems to be a regression from 5.x to 7.x

Theres a white noise / static coming, when no sound is played.

see the last post in https://forums.adafruit.com/viewtopic.php?f=57&t=177457&p=864847
downgrading to 5.x solves the issue for me as well.
I recreated it with the drum machine demo, which has a 5 and 7 compatible version

not sure if this more an issue for the circuit python community or this one.

manic glacierBOT
#

A number of board-specific libraries aren't released to pypi. This makes sense for use because they require specific hardware. However, it makes it harder to get IDE auto-complete. To make IDE's happier, we could release -stub versions that just provide type info, not implementation.

Michael on Discord did it manually:

i have a workaround, i downloaded https://github.com/adafruit/Adafruit_CircuitPython_MacroPad/blob/main/adafruit_macropad.py, pip installed mypy, then did stubgen adafr...

dusk mauve
#

Is there any provision in displayio core for displays that have a sleep mode, like the one on the MacroPad RP2040?

It looks like the higher level CircuitPython DisplayIO SH1106 driver [1] handles sleep/wake but in the MacroPad RP2040 board.c file [2] it doesn't look like there's any provision there for display sleep state. That's where I get a bit lost though since I'm new to the lower level displayio stuff 🙂

[1] https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SH1106/blob/main/adafruit_displayio_sh1106.py
[2] https://github.com/adafruit/circuitpython/blame/main/ports/raspberrypi/boards/adafruit_macropad_rp2040/board.c

manic glacierBOT
slender iron
#

@dusk mauve I don't think so. I meant to add native brightness control but never did. That code could have managed sleep as well.

dusk mauve
slender iron
#

have you built CP locally already?

dusk mauve
#

yeah, last time I tinkered was with some of the RPi builds a few weeks back

#

Just never dove into the displayio subsystem(s)

slender iron
#

k. I think most of what you want is in shared-module/displayio

dusk mauve
#

Sounds good, thanks!

idle owl
lone axle
#

Does the Learn system "Download Project Bundle" thing automatically take the most recently released version of a Library? Or is it based on the Bundle and therefore new version wouldn't show up until the day after (since bundle gets auto generated at night)?

idle owl
lone axle
#

Thank you. I'll point them toward the release page to get the mpy for now. That project used some new features in the IconWidget. The PR for them was merged but no release made yet, so they would have gotten the older version without those features.

mental nexus
#

I'm trying to get my system back to build CircuitPython. I'm running MacOS 11.5.2.GEN build-pyportal/genhdr/devices.h Traceback (most recent call last): File "../../tools/gen_nvm_devices.py", line 2, in <module> import cascadetoml ModuleNotFoundError: No module named 'cascadetoml' make: *** [build-pyportal/genhdr/devices.h] Error 1

#

I get this "No module named 'cascadetoml'" even though it shows up on my pip3 list as cascadetoml 0.3.3 And click 7.1.2. Any suggestions?

manic glacierBOT
tulip sleet
#

if espressif, then it sets up its own python env

manic glacierBOT
#

Thanks @dhalbert
I came up with a small reproducer in https://github.com/durandom/neotrellis

  • the code in noise/7 produces a static white noise with a Neotrellis M4 whereas the code in noise/5 does not.
  • 5 is using adafruit-circuitpython-trellis_m4_express-en_US-5.1.0.uf2
    • adafruit-circuitpython-bundle-5.x-mpy-20201205
  • 7 is using adafruit-circuitpython-trellis_m4_express-en_US-7.1.1.uf2
    • adafruit-circuitpython-bundle-7.x-mpy-20220127
import time
i...
jaunty juniper
manic glacierBOT
mental nexus
blissful pollen
#

Is there a way to build the docs local so I can ensure it works before pushing? I vaguely recall doing it before but cannot remember how

blissful pollen
#

thanks!

manic glacierBOT
#

I think that's a good way to go

ok, I removed the flag use, but I still have the same problem, i.e. circuitpython builds w/o errors but when I load the firmware.uf2 on a device (e.g. a Pyportal Titano) it no longer boots.

Any idea what I might be doing wrong? (Does the capitalization of STATIC vs static matter in C?)
https://github.com/Life-Imaging-Services/circuitpython/blob/crc32/extmod/modubinascii.c#L208-L289

manic glacierBOT
mental nexus
#

Here's what I get for my python version.

Python 3.9.4```
jaunty juniper
#

and you reinstalled the requirements in it, or in a virtual env ?

mental nexus
#

Just ran requirements but it failed on cryptography. Will try building again.

jaunty juniper
#

oh it fails ?

mental nexus
#

Yep, like this plus a lot of error message after this:

Building wheels for collected packages: cryptography
  Building wheel for cryptography (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/Dad/.pyenv/versions/3.9.4/bin/python3.9 /Users/Dad/.pyenv/versions/3.9.4/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /var/folders/0h/26vb29m50pj4vq1rbg5q8d080000gs/T/tmp3x5whgk5
       cwd: /private/var/folders/0h/26vb29m50pj4vq1rbg5q8d080000gs/T/pip-install-s13rhs_0/cryptography
manic glacierBOT
#

The wait is here:
https://github.com/adafruit/circuitpython/blob/3904421a22a8185a5904a96f433374241ac38f5d/main.c#L530-L540

The problem is that when we start code.py, we have no idea whether we are connected to USB or not, because the enumeration can take a few seconds. So we can't decide whether to do a real or a fake deep sleep. We might get to the exit_and_deep_sleep() call in code.py very quickly, before enumeration has happened. So we don't make the real/fake deep sleep decision unt...

mental nexus
#

Just updated pip3 and now requirements work.

jaunty juniper
#

ah

slender iron
#

it's so nice having access to the whole ble host stack source

mental nexus
tulip sleet
#

@idle owl do you remember where we were talking about circup and/or "Download Project Bundle" overriding the builtin adafruit_bus_device, etc.? I've though about that a bit and how to prevent it. Or maybe it was the MatrixPortal MemoryError discussion.

idle owl
#

Not sure that was with me 🙂

tulip sleet
#

What I am thinking is that we should rename the builtin one to _adafruit_bus_device or something, and then change the library to import the builtin one if it's there, otherwise import the rest of the library. That would make it work in all case. I think naming a builtin module the same as a Python library is kind of a mistake.

#

OK, I'll try to find it.

#

my guess was wrong about who was discussing it, thanks anyway!

idle owl
#

I thought the idea was to be a drop in replacement?

#

Was the reason for the name anyway

#

I'm on board with renaming it though.

tulip sleet
#

yes, but now the project bundles and circup always add it. Hmm, I wonder which one actually gets imported

#

I will experiment

#

gotta make dinner anyway

idle owl
#

Ok!

idle wharf
#

release was 3 hours ago

slender iron
#

the project page will show the builds

idle wharf
#

Thank you !
I can fix that.

slender iron
#

thank you!

idle owl
manic glacierBOT
idle wharf
manic glacierBOT
tulip sleet
# idle owl I thought the idea was to be a drop in replacement?

The answer is that the builtin module is used in preference to the version in CIRCUITPY. E.g. I created a time.py that just printed something, and then did import time, and it imported the builtin module, not the fake one. So my solution is in search of a non-problem. I tested with adafruit_bus_device too: if the native version is present, the lib version is ignored.

mental nexus
#

Ok, I've got CP building again, targeting the standard pyportal. I build the latest and drag over the .UF2 file. It reboots and the screen goes black, with no CIRCUITPY drive, and three yellow flashes, I think safe mode. If I load the latest two "prime" versions from the CircuitPython downloads, it works fine. But the latest build from the website "S3" doesn't work. Am I broken or is everything broken?

#

Also, I tried to fallback and build a previous version, but came into an error. I tried git checkout 7.2.0-alpha.1 and then got an error:

../../extmod/ulab/code/numpy/fft/fft.c:93:23: error: 'MP_QSTR_ifft' undeclared here (not in a function); did you mean 'MP_QSTR_fft'?
#

I rebuilt mpy-cross but still that didn't clear it up. Suggestions welcome.

slender iron
#

make sure you clean

#

MP_QSTR issues are usually fixed by a clean and build

manic glacierBOT
#

With deep sleep, we want to wake and execute as fast as possible. Currently, we stay in fake deep sleep for 5 seconds to let USB enumerate. We should only do this on power up or reset. If we woke from deep sleep, then it should assume we want to go back to deep sleep right away.

To break this cycle, users will need to connect USB AND press reset. The startup after reset will wait the 5 seconds for enumeration and then stay in fake deep sleep.

I could have sworn that it used to work th...

manic glacierBOT
#

Services and characteristics still won't work.

Progress on #5926

Test code (will add to Adafruit_CircuitPython_BLE tomorrow):

# SPDX-FileCopyrightText: 2022 Scott Shawcroft for Adafruit Industries
# SPDX-License-Identifier: MIT

"""
Simple connectable name advertisement. No services.
"""

from adafruit_ble import BLERadio

from adafruit_ble.advertising import Advertisement

ble = BLERadio()
advertisement = Advertisement()
advertisement.short_name = "HELLO"
adve...
crimson ferry
#

Nice. The latest esp-idf used in CP main seems to have improved memory fragmentation, and also seems to allocate smaller blocks. Largest available block no longer cuts in half each time.

mental nexus
proven garnet
#

I'm game!

#

Oh, late on the draw I see, thanks @lone axle!

manic glacierBOT
crimson ferry
#

On the Feather TFT, is it intended for the board.TFT_BACKLIGHT PWM setting be sticky across reloads?

stuck elbow
#

I think so, you want the repl to work

crimson ferry
manic glacierBOT
manic glacierBOT
#

I

If you do a build without your changes (just the tip of main), does it work?

No, it doesn't anymore, not from the tip of 'main'. I've been successfully building until recently, though. 7.1.0 was the last functional build that booted. So I checked out that tag and, low and behold, got a successfully booting firmware.uf2. Then I made a branch from there, modified modubinascii.c as before and started getting build errors related to ulab(?). I checked out 7.1.0 again (which should era...

#

CircuitPython version

Adafruit CircuitPython 7.1.1 on 2022-01-14; Adafruit Feather M4 Express with samd51j19

Code/REPL

Adafruit CircuitPython 7.1.1 on 2022-01-14; Adafruit Feather M4 Express with samd51j19
>>> x = (f"Hello "
... f"world")
Traceback (most recent call last):
  File "", line 2
SyntaxError: invalid syntax
>>> x = (f"Hello " +
... f"world")
>>> x
'Hello world'
>>> x = (f"Hello"
... "world")
>>> x
'Helloworld'
>>> x = ("hello "
......
#

It's worth noting that this limitation also exists in micropython, see

MicroPython v1.18-56-g517e82eb6-dirty on 2022-01-28; linux version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>> f"" f""
Traceback (most recent call last):
  File "<stdin>", line 1
SyntaxError: invalid syntax

Using "+" instead of f-string literal concatenation is the official recommendation. If a future version of Micropython improves in th...

#

Thanks, I had not searched the micropython side.
As I mentioned, the + operator creates an temporary immutable string for the first one, and then creates a second immutable string to store the result, and then frees the temporary string. Just trying not to exercise gc -- especially on an embedded system.

I have been using this feather with Rust (RTIC) and Tinygo as circuitpython was not quite fo there when I first tried it. In the mean time, With async/await now on the scene, I am all...

idle owl
#

Eva said a patch won't work for the further rest of the issue, so she'd have to do it semi-manually, which means it's on hold for now. Because that usually takes her a couple of days to do and she's in the middle of guides.

#

I'm not sure I want you to do that part, Tekktrik, because Eva can push directly to repos, and I don't want you to put in 290 PRs for README issues. 😄

idle owl
idle wharf
idle owl
#

Ok thanks!

manic glacierBOT
proven garnet
#

If there is anything I can help with let me know! This snowstorm means LOTS of time for coding haha

manic glacierBOT
idle owl
# proven garnet If there is anything I can help with let me know! This snowstorm means LOTS of ...

The thing I would like you to look into is that I think there are a few libraries that don't have the API documentation linked in the README, because we forgot to add it to cookiecutter. Basically any library generated between the time we added the Read the Docs link to the READMEs and today does not have that link. If you could find the libraries without API documentation for this library can be found on Read the Docs. in the README, and add the proper info to those READMEs, I'd really appreciate it. Please organise it like the README found here: https://github.com/adafruit/Adafruit_CircuitPython_Nunchuk

proven garnet
#

So you actually want me to PR to the already cookiecut (grammer?) repos?

idle owl
proven garnet
#

Does that include community libraries?

idle owl
#

The other issue is a whole other thing that will have to be fixed across 250 libraries, so... that will wait. It's not damaging.

idle owl
proven garnet
#

Got it, sounds good!

idle owl
#

Thank you!

#

Please see the lib I linked for how the end of the README should be organised.

#

The rest above the "Documentation" header is irrelevant to what you're doing.

proven garnet
#

Roger!

#

I assume I'll need to git clone --recursive-submodules [BUNDLEHERE] right?

#

In order to grep?

idle owl
#

Something like that yes. I don't remember the exact command.

manic glacierBOT
idle owl
#

But you need to get all the repos in there before you can grep, yes. Cloning the bundle doesn't gather the data for each repo without explicit request to do so.

manic glacierBOT
proven garnet
#

Got it, thank you!

manic glacierBOT
#

@tannewt I agree that it's useful to have easily accessible error messages when a program crashes, and that setting up a serial connection to see errors is hard.

The problem is that, when I look at the current implementation:

  • Displaying a flash of the logo and console on startup has nothing to do with showing errors on a program crash; the first is not necessary for the second.
  • Displaying error messages on the matrix does not make them accessible; the console output on the board is...
proven garnet
#

Don't know GREP very well, but I do know glob! Got the list via Python, it's just 7 repos, I can PR those in couple hours when I have time!

manic glacierBOT
idle wharf
idle owl
idle wharf
idle owl
#

I saw it go by, yeah.

#

@proven garnet Feel free to make that change in the lib PRs you submit.

#

So I have this example, and I'm not sure it's the best way to do the setup. Feedback is appreciated.

#

It's four of each type of pin, so I don't want to set each pin up individually.

#

But I can't remember if I'm doing this right.

idle wharf
proven garnet
#

Should I change all the places we now use "3.x", or just in .readthedocs.yaml?

tulip sleet
#

@idle wharf the ubuntu-20.04 thing is a nuisance, but that's the way it is, I guess. The version: 2 stuff says "This functionality is in beta.", but it also says version 1 is deprecated. A little early to do that, but oh well. https://docs.readthedocs.io/en/stable/config-file/v2.html#legacy-build-specification is the version 1 "legacy". Looks like we could use "3" in the legacy spec, but as long as you are changing, may as well look forward. I looked at issues in their repo, but didn't see a lot to worry about at the moment.

tulip sleet
idle wharf
tulip sleet
#

I feel like opening an issue asking them to support "3.x", but we need to fix it now anyway.

#

or perhaps it has to do with docker's arguments 🤷

idle wharf
#

might be common in one of the many other languages RTD supports that I don't use....

tulip sleet
#

3.x might just be GitHub Action's own choice

#

or it's SemVer

slender iron
manic glacierBOT
idle owl
blissful pollen
idle owl
#

Thank you!

#

I couldn't remember if that was right. I had to do a few iterations before it worked, so I wanted to check.

tulip sleet
#

I agree, this looks fine. You could use len(...) instead of 4 in the last loop, but clear now anyway

idle owl
#

Ooh. Good idea. Because you can chain these boards.

proven garnet
#

Just making sure, .readthedocs.yaml should look like this now, correct?

#
# Required
version: 2

build:
  tools:
    python: "3"

python:
  install:
    - requirements: docs/requirements.txt
    - requirements: requirements.txt
viscid pine
#

in cpython i'd write for led, button in zip(leds, buttons):, but i don't know if that's cool in circuitpython

proven garnet
viscid pine
#

cool as in, gives you extra "pythonic" points

#

i guess that's not as important in circuitpython

proven garnet
#

I've found CircuitPython to be pretty Pythonic, that's why I love it.

#

For what it's worth enumerate is also implemented; that link I sent has all the builtins

viscid pine
#

zip might not be so cool for examples though

#

beginners will probably be more used to using indices

proven garnet
#

That's how it was with me, but after reading files enough times, using for line in file I lost the ability to think in indices haha Python

#

Convenience chefskiss

manic glacierBOT
proven garnet
#

Oooooh I realize we're talking about making examples, my bad I thought you were asking

#

Hm, I would still second zip, but that also requires you understand list comprehension

viscid pine
#

what's the performance like with zip, enumerate, etc compared to using a counter?

#

i'd assume worse because it has to create a zip object

manic glacierBOT
proven garnet
#

Not sure what happens behind the scenes in CircuitPython for that one, but I imagine it's implemented in C

#

And my understanding is that CPython makes list comprehension faster than indexing, so idk if that magic juice is in CircuitPython or if it was implemented differently.

manic glacierBOT
idle owl
#

List comprehensions are great when you're trying to make a massive example more concise, less so in simple examples because it means explaining list comprehensions to beginners 🙂

idle owl
viscid pine
#

agree

tulip sleet
#

@onyx hinge re https://github.com/adafruit/circuitpython/pull/5854 is the ESP-IDF patch for the I2C crash. Looking at #5860 and #5928, I am thinking of implementing @slender iron's proposal to push write/read down into common-hal. I would revert #5854. Does the reversion make sense to you.

onyx hinge
#

@tulip sleet yes I don't like the idea of carrying a change relative to esp-idf that we don't need / can avoid. It was a hack fix that I made before I understood the issue better.

#

that said if the restructuring of shared-bindings is a pain as a result, it should also be possible to carry the transaction object from the write phase to the read phase, when stop=false...

tulip sleet
#

I am willing to do the new common-hal across all ports. It is more work but it's cleaner in the long run.

onyx hinge
#

Cleaner is good!

#

then I won't go into what I was proposing; I thought I had it in a branch but if I do it's on some other system.

tulip sleet
#

you were proposing your second paragraph above?

#

i think we can knock off several issues with this, and also maybe make future ports better (and maybe even other existing ones if they support write/read as well).

idle wharf
manic glacierBOT
manic glacierBOT
warm stump
#

It would be great if CircuitPython's Audio System could work something like WebAudio's AudioWorkletProcessors: https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletProcessor
I gave it a test here: https://github.com/TheMindVirus/codeviz
It's very versatile, I've used it to make synths with over 100 custom wavetable oscillators.
I don't think there's much reason for CircuitPython Audio to work any differently,
apart from maybe being trimmed down to work on microcontrollers. What do you think?
(thanks Scott, watching the stream right now)

manic glacierBOT
#

I would like to use an iPhone and a iPad and a Mac and a Windows PC from time to time as the user likes to.
But mainly iPhones and iPads.
And always only connect to one central even if the others are close and running.
The peripheral shall be able to decide to whom he wants to talk to.
(this seems to be hard or almost impossible)
But disconnecting from a connection should be easy (and is working in my code), if I only would know which connection to disconnect.

proven garnet
#

@idle owl one of the repos that needs the repository is read-only, I assume I should just skip?

#

It's the LSM303, for reference

idle owl
proven garnet
#

Got it, thanks!

idle owl
#

Or maybe not. Not sure. Link please?

proven garnet
idle owl
#

Yep, archived.

#

Thanks!

proven garnet
#

Almost at the end, @tulip sleet - asyncio doesn't have documentation yet, correct? The current link is broken, so if one exists for RTD documentation, where could I find it?

tulip sleet
proven garnet
#

Thank you!

tulip sleet
#

ideally that doc should be moved into the the library as docstrings, since it's just Python code.

proven garnet
#

I can file an issue as a reminder for both updating the link and doing that if you want, while I'm poking around

#

Mostly because I'd be interested in tackling it

tulip sleet
#

sure! it's always good to write these things down

manic glacierBOT
proven garnet
#

Alright issue filed, and those PRs have been submitted!

manic glacierBOT
atomic summit
#

Hi folks. I can't remember if there is a build/workflow I am supposed to add my new boards to in the Adafruit CPY repo, to get them building by the CI?

I'm sure there was, but that was before Scott did that big redo of how the build system works. Or is it just tinyuf2 I needed to add my boards to the build workflow?

tulip sleet
atomic summit
#

w00p! thanks @tulip sleet 🙂 Doing my PR now!

tulip sleet
#

i was looking for Scott's PR, but I can't find it now. In any case, it should just work 🙂

manic glacierBOT
manic glacierBOT
manic glacierBOT
orchid basinBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.2.0-alpha.1-224-gac7a80753 on 2022-01-26; Adafruit Feather ESP32-S2 TFT with ESP32S2

Code/REPL

>>> import board
>>> import pwmio
>>> 
>>> pwmio.PWMOut(board.TFT_BACKLIGHT, frequency=5000, duty_cycle=0)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: TFT_BACKLIGHT in use

Behavior

Similar to #5903. I'd expect that independent control of the backlight should be possible in us...

slender iron
manic glacierBOT
lone sandalBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
viscid pine
#

"Why does connect keep returning False??" 🤦‍♂️

manic glacierBOT
#

As per request by @tannewt and it seems by popular demand on-stream for Audio Applications with CircuitPython, I think it would be great if audioio could work something like Mozilla WebAudio API's AudioWorkletProcessor:

Specification (working draft): https://webaudio.github.io/web-audio-api/
Main Docs: https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API
AudioWorkletProcessor: https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletProcessor

Example (codeviz...

manic glacierBOT
#

The pin must be tested instead of pin->number in the same way as in STM
I2C busio layer.

 pytest -s -v test_busio.py --port=/dev/ttyACM2 --html-report=./report/stm32_f4ve.html
============================================================================================================ test session starts =============================================================================================================
platform linux -- Python 3.10.1, pytest-6.2.4, py-1.11.0, pluggy-0.13.1...
manic glacierBOT
#

Indeed they do, by inspection and test. LGTM.

Adafruit CircuitPython 7.2.0-alpha.1-224-gac7a80753 on 2022-01-26; Saola 1 w/Wrover with ESP32S2
>>> import wifi
>>> from secrets import secrets
>>> 
>>> r = wifi.radio.connect(secrets['ssid'], secrets['password'])
>>> r
>>> type(r)

>>> 
>>> while True:
...     print(type(p := wifi.radio.ping(wifi.radio.ipv4_gateway)), end=" ")
...     if not p:
...         print()
...         break
... 
  
>>> 
orchid basinBOT
manic glacierBOT
#

I don't know what the silk on these boards is, but you want to put the preferred name for a pin first in pins.c lists, so that it will print out that way and also will be used as the preferred pin name for the "PrettyPins" diagrams. See https://github.com/adafruit/circuitpython/pull/5652 for an example of where we reordered pin names.

Doing this as a "Request changes" just to flag it for attention.

#

I don't know what the silk on these boards is, but you want to put the preferred name for a pin first in pins.c lists, so that it will print out that way and also will be used as the preferred pin name for the "PrettyPins" diagrams. See #5652 for an example of where we reordered pin names.

Doing this as a "Request changes" just to flag it for attention.

Hey Dan,

This is my preferred order for pins. Silkscreen is IO. I only include Dx and Ax for compatibility, but Dx and Ax sh...

atomic summit
#

Thanks @tulip sleet for checking on my PR pin order!

tulip sleet
#

np, we just had to edit a bunch to get it right, as I mentioned. So only double-checking!

uneven mango
#

I have a Sparkfun Qwiik sensor arriving on Monday that doesn't have CircuitPython support. I was thinking of releasing a community module if I can get it working. I've reviewed the learn guide but have a question about iteration.

When working on a module, do you find it's easier to work on a Pi with Blinka, a random board, or a RP2040 Trinkey with u2if?

tulip sleet
minor plume
#

Are there any Learn guides that talk about the structure of the CPY code base and what’s where? I submitted my first PR (so yay that!) but it took a LOT of use of find and grep to get there, and that seems a little inefficient. Also maybe daunting to newbies? I’m a command line girl from waaaay back, so I’m used to those tools, but not everyone is me. 😉

stuck elbow
#

there are some deep dives

blissful pollen
#

You're talking about a python library too and not a core change correct? Just want to be sure

uneven mango
minor plume
#

I should go back and watch some of the older ones, maybe.

tulip sleet
blissful pollen
tulip sleet
#

whatever you can use to make cross-reference tracking good is worth it. TAGS in emacs, Intellisense, etc. I still do a lot of grepping but I use ag or rg