#circuitpython-dev
1 messages · Page 406 of 1
The reboot fixed it. I guess 7x VSCode, 11x terminal windows/tabs open and MP, CP & IDF open in multiple wasn't ideal
Yeah, I'd already done an --init and made sure I had everything, and that the IDF was up to date.
have I mentioned I dislike git recently? 😉
submodules are painful
Trying to use board.TX or board.RX, or board.UART raises a pin in use error. For example like this:
import board
uart = board.UART()
ValueError: TX in use
I assume that comes from #5894
debug uart is taking them i think: https://github.com/adafruit/circuitpython/blob/main/ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h#L53-L54
yep
with what Scott mentioned in today's stream I lean towards a change he made for debugging that was accidentally left in
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
Has anything recently changed with socket.recv_into() in the core? This issue has cropped up from requests with the latest builds. https://github.com/adafruit/Adafruit_CircuitPython_Requests/issues/98
it's pyportal though, that would be with the ESP32SPI lib not the core ?
Yeah I think that is right
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
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 🤦♂️
The TX/RX pins were erroneously named TXD0/TXD1. I renamed them to TX/RX, also added board.UART.
Tested on n8r8 hardware
i'll take a look
Thanks Michael
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.
@atomic summit what are the i2c pins?
most microscopic silkscreen ever with an LED shining in my eyes
yeah it seems to have locked up
hmm, same 7.2.0-alpha.1 on TinyS2 also locks up.
Not an S3 thing
will raise an issue
mien didn't reboot... just comes out, but finds nothing
what board did you test it on ?
you on github? what's your username?
@prplz
of course you are !!!
Catching up, is there something wrong with the implementation of recv_into I wrote for the ESP32SPI library?
hahahas
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...
foamyguy summed it up in the issue:
https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI/issues/154#issuecomment-1019039154
it's missing the optional length argument
(which is present in the core sockets and used by requests)
On a positive note though...
TinyS3 and a new re-vamped FeatherS3 production boards validated!!!!
Ahhh got it. Thanks! I can patch that.
(lol clicking on "shrug" when trying to put a thumbs up feels bad)
@atomic summit pullups?
On the I2C slave, yes. Doesn't matter though... 70+ seconds to come back from a scan? somethink ain't right 😉
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
Hmm, ok, right so nothing plugged in could be the "no pullups' thing.
other ports throw errors when theres no pulls
yeah that's what it should do
added pullups, works now
and finds a device?
i unplugged it, one min
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
yeah it finds now
second time I scanned it found 1 device, and no pullup error
i had this with other ports too, sometimes it was ok without pullups near the board, sometimes not
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.
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.
Hotfix submitted for the ESP32SPI issue 
I guess because the pins are floating and these ones tend to float up
I did a little printf debugging and found that this for loop is taking about one second per iteration https://github.com/adafruit/circuitpython/blob/main/shared-bindings/busio/I2C.c#L143-L148
@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
Did you solve it AND fix it? 😉
i COULD i guess
So you know why it's stalling? A recent change?
I don't think so
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
but it shouldn't take any longer if there are no pull-ups.
clock stretching maybe
when i tried it on the rp2040 port is raised an error about stretching too long
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...
@jepler Are you still waiting for a review? I thought you might be still churning this on a daily basis.
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.
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?
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
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.
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?
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.
The one with the LCD is exactly the same with an LCD attached to an SPI bus
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
Yes. I think that's the most use friendly thing to do. Make it behave like the other similar boards.
I think there'll still be churn before this is really ready to go in, so we can close it or switch it to draft.
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?
cc @lone axle, the opener of said issues
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.
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.
This is the code that looked up the errors at the time the issues were created: https://github.com/FoamyGuy/missing_type_issue_maker/blob/main/find_missing_type_annotations.py essentially it runs:
mypy --disallow-untyped-defs
and then looks specifically for any lines that report "Function is missing a type annotation"
That should take care of it! 😄 Thanks the quick answer on a weekend.
For sure! Thanks for helping tackle the typing info 😄
For sure! Happy to help. Good typing hints make life easier for everyone.
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?
Yeah, I read through that earlier, but I’m still little fuzzy on the best way to test/debug outside of running GH actions…is it basically limited to running on-board using print statements and the REPL? Are there any additional tools to run/emulate using cPython, or maybe on an rpi or something?
you can use blinka to run on a raspi https://learn.adafruit.com/circuitpython-on-raspberrypi-linux
Interesting…I came across a vscode docker devcontainer config for using https://marketplace.visualstudio.com/items?itemName=ms-python.devicesimulatorexpress , but seems like that extension has been discontinued
@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
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
Couldn't find anything in the Adafruit GitHub account. The Wiznet5k does have recv_into(self, buf, nbytes=0, flags=0) as the definition though, and that's how I helped determine the issue 😅
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.
Oops, I'm wrong! CPython does say nbytes = 0 should fill the buffer:
https://docs.python.org/3/library/socket.html#socket.socket.recv_into
😄 was just going to paste that link
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
oh we've all read late 🙂 thanks for insisting on semantics consistency!
ah well then !
Thanks again everyone, hotfix inbound!
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
🐛 🔨
@UnexpectedMaker recently discovered an annoyance where i2c scan can hang for over a minute on esp32 (#5906).
It goes something like this:
- Construct an i2c with floating pins
- The i2c pullup check in
common_hal_busio_i2c_constructpasses most of the time despite floating pins - Start an i2c scan
busio_i2c_scantries to probe 110 addresses, each probe times out after one second (see this comment), ...
Force pushed: changed timeout to 5s.
We can also reduce the actual I2C timeouts to something much shorter.
also this will help: https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github/
@tulip sleet some ports don't seem to have any i2c timeout from what i can tell
https://github.com/adafruit/circuitpython/issues/3910 for Espressif. In other ports it's missing: https://github.com/adafruit/circuitpython/issues/2253
i suspect the timeouts in the espressif port are confusing freertos ticks for cpy ticks too
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.
the problem i see is that it still needs to do 112 probes
perhaps we need to fix the "I2C needs pullups" logic on the ESP boards; it works well on other ports
i dont think it can be fixed in this case. I have them floating so all bets are off
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
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
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
Limor has told me one second is an eternity for I2C clock-stretching
ok, shall i do another pr just trying to fix the esp problem?
do those pins have pull-downs or no pulls at all
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
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
i tried on a samd21 and rp2040 board, both those fail the pullup test
But why is there a pull-up test at all?
i2c requires them, it's open-drive
I have boards here with no pullups that work perfectly in Arduino, and MP. but in CPY they wont work.
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)
the test catches this issue on some boards but not on these esp boards
I understand the spec... I'm talking about the "check and block" in CPY.
the check isn't blocking, it's the scans timing out
i was giving the motivation for adding the checks in the first place
No, the block saying, you cant use this boards because you have no pullups.
oh right
Yup, that makes sense. But not allowing me to use the I2C bus anyway is my issue.
have a message saying "No pullups found, this might make your I2C comms unreliable"...
but it should let me do it anyway.
we could add an override boolean. Are you using internal pullups? It's an accident your no-pullout breakouts are working, right?
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.
Original motivation is here: https://github.com/adafruit/circuitpython/pull/719 We had stuck sensors that were pulling the buses low.
I agree the check should be there.... jut not one that blocks the device out completely. A bool override sounds like a good option
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?
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.
So there are multiple issues here:
- would be nice to override the pullup check in some cases
- Some I2C impls have too-long bus-stretch timeouts
- Some I2C impls have no timeouts whatsoever
- Some ESP pins have no pulls, so the checking doesn't work
internal pullups are disable for some reason: CIRCUITPY_I2C_ALLOW_INTERNAL_PULL_UP
Seems so! I originally reported the issue, but @viscid pine did the digging to work out what's going on.
the option is there but only one board uses it
Maybe they are too weak? not all IO are equal on the ESP32 - Some can be driven higher than others.
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
the timeouts in the esp port are just in total freertos ticks, not stretching
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?
for the whole transaction?
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.
not sure about i2c_set_timeout
https://github.com/adafruit/circuitpython/blob/main/ports/espressif/common-hal/busio/I2C.c#L175 and other usages of i2c_master_cmd_begin
i know it's in freertos ticks because the parameter uses the freertos tick typedef
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.
That's fair!
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!
nps. thanks for looking into this more @tulip sleet 🙂
i see why it's not done yet, it's confusing with some ports having total timeouts and some having stretching timeouts
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?
sure, you can use an analog pin as a digital pin
Thank you @tulip sleet. And connecting to the RST pin in this way is reasonable?
i'm looking...
but if you are using circuitpython, microcontroller.reset() is a way to do it just from code
oh, I thought you wanted to reset the LoRa module
yes, to reset the actual M0, you can use microcontroller.reset()
@jade urchin Normally I am using circuitpython, but this particular example is arduino.
you can call NVIC_Reset() from arduino, or something like that
Thank you @tulip sleet. I will try the software reset.
NVIC_SystemReset()
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?
we use it in CIrcuitPython for exactly that purpose. It works on M0; I think it may not work on classic Arduino
ok. My sketch compiles with it, so worth giving it a try. Thanks!
It says I have a ping
??
When I search mentions: g3holliday: it doesn't say anything....
or you are on @ circuitpythonistas
there are occasional pings to that for the weekly meeting docs
Yeah.... I saw that Kattni pinned the notes doc - I think that's it
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...
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...
Issue #5909. Corrected which RMT channels are used for receiving pulses on Espressif boards with separate transmit and receive channels. Tested that pulseout and neopixels on ESP32-S3 still worked properly, and that ESP32-S2 boards still worked properly.
Slow I2C on the Pi Zero W. Is this the same clock speed problem as the SPI issue?
dunno, but please file an issue
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?
The funny part of this - the page about trademark is empty - https://circuitpython.org/trademarks
Is it possible to use some sort of - "CircuitPython is a trademark of Adafruit Industries"?
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...
CircuitPython is indeed a registered trademark of Adafruit's. But "Python" is a registered trademark of the Python Software Foundation, and you don't have to always say it's a trademark
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
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.
I am going to close this for now. @wavesailor If you can reproduce, please let us know and reopen.
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] * ...
@tulip sleet thank you for the information
my first two libraries - https://github.com/peterbay/pb-circuitpython-libraries
Looks great! We have a community bundle, if you want to contribute: https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library, and re bundle: https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-in-the-community-bundle
@ThomasAtBBTF What centrals are you using? I want to replicate it here and provide a DeviceInfo example for you.
Good idea! Can you file an issue to do this? Thanks!
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...
The ESP32-S3 has 192KB more ram (512KB total) compared to the ESP32-S2 (320KB total). We may want to consider increasing pystack and possibly also the max number of sockets.
I think there is one case where this is done for a specific board, and I think it's possible to do for a port in the pot config files, but this would be for the ESP32-S3 chip only.
@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 
Lol…just “lucky” timing on my part…just happened to pull out my pyportal and update jt after letting it be for months
Requests does some unexpected(?) things... some cases use recv_into if it exists, but other cases still use recv.
Updated that rp2040 based feather can use an Arduino core. Welcome feedback on how to phrase it better.
A similar line should be included in all rp2040 based boards.
Thanks.
Thanks, this would be a good update to make.
Because we like the text for Adafruit products to match what's in the shop, I've raised this issue internally. I'll get back to you about this, and if I don't you should feel free to ping me about it in a few days.
It might be cool to maybe switch them over to using recv_into first if possible, but I think one of the socket classes does not have it yet, but need to check
But it seems like it's not causing memory issues so it doesn't seem critical
@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
Thanks for pointing this out! We have a couple of PDFs that explain using Blinka, and it covers CircuitPython usage as well on some level. I'll see to it that we get this page updated.
That would be awesome actually. I have a project that would benefit directly from it too haha
@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. 🙂
But yeah using async if possible is like the perfect use case for it
Sounds good to me.
Excellent. Plan on a few minutes between, and then we can go over everything.
I think the standard thing is aiohttp, perhaps we could make a subset-compatible library
Aiohttp is really good 😄
that would be great, it's been my singular annual wishlist item to have requests not block
It looks like you have some duplicate text in there. Want to fix it?
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.
Not an expert but will the git remote command work to change/add a remote?
I'm not sure that's pulling from the remotes.... 😕
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)
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.
you are talking about the gh default, is that right? If you just use git, is it "wrong"?
@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.
Perfect. Thank you both. Removing gh-resolved = base inside of .git/config did the trick next command I ran it asked me again.
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.
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.
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.
You're way ahead of me there. I am still at the checking-out-PRs phase.
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
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.
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
CTRL+C/D doesn't fix it. Running I2C scan code now, still showing the sleep text.
so no hard reset before running the other code?
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
I'll try to remember to give this a try in a bit. In the middle of other things too.
@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
@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.
The guide for the matrix? Or the glasses guide? Maybe in the matrix guide. Glasses guide is already a bit odd because it's a combo guide for the driver board and the glasses panel. But if it's more glasses oriented, I'm sure we can find a spot for it in that guide. Short answer: yes. Long answer: see previous.
@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.
¯_(ツ)_/¯
Same thing with the Monster Mask library
The project was aimed for the glasses (as it uses both the matrix and the rings) so not sure where it would be best. I could also start writing something and see what it looks like.
And second I have not done any guide work for Adafruit, just my own on hackster
OK, yeah, we can add something to the glasses guide. There's a spot for "CircuitPython EyeLights Starter Projects" which is a list of CP programs for them. We can add it there.
@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.
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.
magtag.exit_and_deep_sleep() is a convenience routine that ultimately calls the alarm module exit_and_deep_sleep(). I just reviewed the library code and it looks OK.
Email PT and Limor. It's not on my list, so if they are interested, it's up for grabs.
@tulip sleet Dan, do you think you would have 5 minutes for a short discussion either before or after the meeting?
sure, right now we are having an internal meeting, so might be after
That's OK. Thanks!
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...
allblue.zip
Here is the bitmap used in the script.
brb
Also brb
ok, obviously, after
no problem.
We do!
I think bitmaptools.blit() is expecting to operate on a "normal" Bitmap object rather than an OnDiskBitmap.
If you are using it with a bmp file I think the file needs to be loaded with adafruit_imageload
We should definitely have a better error mitigation and avoid the hard crash though.
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...
Sorry, skipping the meeting. No notes, but no CP activities. Group hug to the community.
Adafruit and Pimoroni are behind the two largest ecosystems of Pi products, which include HATs, kits, robots and more. Adafruit Founder Limor "Ladyada" Fried and Pimoroni Founder Paul Beech join us.
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
Absolutely!
If I have to bail suddenly, it will be quick, but please take over for me in that case. Thanks!
I still think this would be a good idea but I don't have the time to get back to it right now. Anyone else should feel free to pick it up for me.
Oh thanks for letting me know! Gonna check that out in a sec
oops sorry I was out of order ⏬
np, I'm just following the notes doc
You can set up auto-cancellation of CI builds that are obsolete due to superseding pushes:
https://github.blog/changelog/2021-04-19-github-actions-limit-workflow-run-or-job-concurrency/
Thanks to https://twitter.com/AdamChainz/status/1485572084617121796, who points to:
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow
That will be great -- SDCard access!
When will we get a paper tape reader? 😉
@onyx hinge Let me know when you get that TFT Feather code going. I'll include it in the guide. 😄
Ok, I have fixed the two boards that failed and have committed my changes.
someone in the forums wanted to do punch cards
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...
I'm holding out for audio cassettes.
I spent a lot of time hand "rewinding" paper tapes in my early programming days....
will do
Another possibility is to check for KeyboardInterrupt at each trip through the loop, so that a scan can be ctrl-c'd
Nevermind, wrong thing.
See you!
Thanks!
Thanks!
@idle owl filling up water then brb.
Thanks all
@lapis hemlock ok, free now
@tulip sleet shall we move to another voice channel?
sure
Thanks all!
>>> 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
>>>
@lone axle LMK when you're back!
Back now and ready.
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
is it correct that it's been 6 days since a bundle release? seems fishy
@slender iron let me take a look
last avaialbe is 0119
https://github.com/adafruit/adabot/runs/4917311586?check_suite_focus=true "everything is already released" says adabot
Adabot is our robot friend who helps Adafruit online - Merge pull request #256 from adafruit/new-patch · adafruit/adabot@e0933a7
I don't know how to debug it so I'll stop there.
I think it may be right
I saw releases in my inbox today
so hopefully it'll be bumped in the next 24 hours
I should have put the .blit() inside the with form. For normal usage you are correct, but if I can copy the bits to a second bitmap the original file is no longer needed.
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
CircuitPython Weekly for January 31st, 2022 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates early. During the meeting, we go through them as a round robin sorted by username. If you can’t make the meeting and would still like to participa...
The current bitmaptools.dither() requires:
Source bitmap that contains the graphical region to be dithered. It must have a value_count of 65536.
adafruit_imageload complains if you try to load an image with too many colors.
How can I load a truecolor image and dither it for display on epaper?
@lone axle I had some time today so I ran some tests on the bluefruitspi PR -- found an issue -- commented in the PR.
Thank you!
@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.
Thank you, will do.
Please let me know whether you can see the calendar.
Or whether you need a link or something.
I've followed the link in the invite and I see it in my Google Calendar now.
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.
Okay!
ok by me
Let me know if anything seems wrong in the calendar. I'm fairly sure I got it right.
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.
Exactly.
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
Eh, I'm our default scheduler, I guess. 😄
thank you for wearing that hat.
You're welcome 🙂
@anecdata Would you be willing to do this? I think you are better positioned to determine the best new values.
What board/port are you using? It sounds like a port-specific bug.
Yup, I'd guess this is the same issue as #5887
This should only be the case on DEBUG=1 builds. Did you try a DEBUG=0 build?
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.
Could we make the probe fast instead? https://github.com/adafruit/circuitpython/blob/main/ports/espressif/common-hal/busio/I2C.c#L144
We shouldn't need to wait at all to determine it.
Thank you for the reorg. I like the separation you have between the IS31FL3741 and FrameBuffer classes! I just requested some doc updates to match. Thanks!
Update this too please.
Document these please.
@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)
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
ya, that could be a problem too 🙂
- 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
sure 🙂
- Remove
busio_i2c_scanchanges - Change espressif i2c probe timeout from 1s to 10ms (1 freertos tick, unsure what behaviour zero would have)
- Change espressif i2c probe timeout from 10s to 1s and use freertos macro to avoid confusion
@viscid pine want to mark as ready?
negative, having issues
something is very wrong, the probes are taking 1 second each
It's in the additional info:
Pi Pico
CLK on GP0
DATA on GP1
I have also tried on GP3/GP4, and GP0/GP4 with no change.
GP0 and GP1 were both listed as valid using the code listed here
Running that code t looks like nearly every pin is a clock /data combo.
because it's setup to give up control while the i2c transaction goes
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
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 ?
Should the pins definition be conditioned by the DEBUG level, or change it in serial.c with something like that ?
#define CIRCUITPY_DEBUG_UART...
This is not working, it looks like i2c_master_cmd_begin caps the delay at 1 second minimum: https://github.com/adafruit/esp-idf/blob/circuitpython/components/driver/i2c.c#L1172
i tried using esp's i2c_set_timeout instead, which is stretching timeout in apb cycles, but the timeout interrupt never fires
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
Seems to have been fixed on the main branch:
Adafruit CircuitPython 7.2.0-alpha.1 on 2021-12-29; Adafruit QT Py ESP32S2 with ESP32S2
>>> import digitalio
>>> import board
>>> np_power = digitalio.DigitalInOut(board.NEOPIXEL_POWER)
>>>
Any Sphinx gurus around? A library I'm working to update has a Sphinx build error (in main) and I'm stumped.
error while formatting arguments for adafruit_azureiot.IoTCentralDevice: can only concatenate str (not "__qualname__") to str
It has something to do with the __all__, bug opened:
https://github.com/adafruit/Adafruit_CircuitPython_AzureIoT/issues/38
GitHub Actions concurrency feature adds ability to cancel superseded CI builds.
With the current configuration, builds triggered on push to a branch aren't cancelled.
@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...
@microDev1 any idea what's going wrong with the espressif builds in some of these PRs?
I don't know what's wrong but it seems to fixed in #5923.
@idle wharf a couple folks were looking at that earlier. I'm not sure what they found. @trim elm and @proven garnet I think
Yeah that one stumped us. There were similar-ish issues on the sphinx github repo but none that seemed applicable
@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.
Btw . Code.CIrcuitPython.org worked well with the microbit!
@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.
@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.
Cool. Yeah thanks for taking that on. Was uncovered by a recent patch and it really stumped me
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_...
looks like the bundle did release today
Please try a 7.2.0 build via Absolute Newest on the site as well. It's possible we've tweaked the board's behavior in main already.
Changes look good. I suspect you may need to bump the ESP32 cache key for the build.
Ah, you are right. Yes, I expect it to be conditioned on whether it is a debug build. I'm not sure where the best place is to do that.
I just re-checked the S3 site for the Absolute Newest, and it appears to be the one I already tested, as mentioned in the Circuit Python version section above (CP 20220123-4d0e1d9):

Ya, CONFIG_IDF_TARGET is how I'd do it in header files.
Yes, the main thing I want to leave some RAM for is BLE. I'm not sure how much it'll use.
I've updated the code for the two boards mentioned. I have also brought my repo into parity with the main repository. Builds for expressif fail but this looks to be an issue with the pipeline and not directly related to my code.
Looks good! Thank you for the update. I agree that the ESP builds being broken isn't your fault. Will merge anyway and we'll fix ESP separately.
Here is the screenshot from the Power Profiler Kit II, the deep sleep period visible at the right side of the trace:

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.
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;
}
Do you mean SPI vs QSPI? As you've found, it's definitely possible there are bugs. But on an existing STM board, does it work? e.g. Feather STM32F405, or PyBoard?
It is SPI flash: spi_flash.c
I tested it with STM32F407VET6: https://stm32-base.org/boards/STM32F407VET6-STM32-F4VE-V2.0.html
The STM32-base project is meant for students and hobbyists. The goal of the STM32-base project is to provide a simple and easy to use base project for working with STM32 microcontrollers.
Here is the logic analyzer capture of the problematic place. The marker #2 is the place where SPI re-configuring happens.
I think we're generally moving towards using type annotations for type info rather than a specific format in the comment itself.
And here is the snapshot of SPI communication after I made the changes in spi_flash_read_data function:
Feel free to write this up as an issue. I don't know why common_hal_busio_spi_configure() would be called so often. Is this SPI bus shared with busio.SPI in general, or is it exclusive to the flash chip?
In my case it is flash dedicated SPI.
I just wonder how it works with other boards/chips.
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
spi_flash_read_data and spi_flash_write_data are part of common code base which is shared across all the ports. It might be of cause STM-specific behaviour.
maybe there is a bug in the common-hal configure code for SPI?
Perhaps, but it's still a good idea to configure SPI before CS has been activated, right?
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?
Not sure. I need to check it.
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.
Well. This is exactly what I have done to fix.
and it works or it doesn't?
With this change it works perfectly fine.
I am going to push this change in a separate PR soon. It will be easier to analyse the code then.
I looked at the history, and it looks like it's always been that wrong (which does seem wrong).
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...
Right. That is why I was so perplexed about this.
our code is not sacred 🙂 I myself have fixed some longstanding bugs recently and wondered why things ever worked the old way
Fair enough! 👍
Thanks! One style change, and we'll need to see if it fits.
The default is that it is on, because of CIRCUITPY_FULL_BUILD, so we don't need to mark it on explicitly.
Ah -- change made and tested
I'm realize my VS Code extension has them downloaded but how exactly does one download the type sheds for CircuitPython?
it's in the circuitpython-stubs package in pypi
@gilded cradle hey, this got merged, ok to make a new release?
https://github.com/adafruit/Adafruit_Python_PlatformDetect/pull/213
Yes, please do.
Thank you
np
@jepler @makermelissa will sync this description up with the product page rp2040 feather tomorrow. Still getting my head around git/hub/branches/pr's etc.
thanks for your patience. Have allowed edits by maintainers on patch-2.
ESP32, ESP32-S3 and ESP32-C3 can all do BLE.
Let's add _bleio support on top of NimBLE that the IDF uses for BLE.
Once it's added, we can then support the BLE workflow on these ESP chips.
@trim elm and @slender iron I was able to get the docs to build by rolling back Sphinx to 4.3.2 in my PR branch and I opened a bug in Sphinx to track this issue in their latest release 4.4.0.
Everything else should raise NotImplementedError.
First step in #5926
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.
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.
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.
My next worry... how many CP libraries that don't go to PyPi can we hit this with ?
Its skill, not luck ! 😉
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.
OK.. I'll test and update my PR.
ty!
It will be later...
Have to go Release the Kraken first...
🦑 🏒 🥅
Ah, sorry I missed that. Thanks for trying it.
Tested on ESP32-S3. Advertisement worked fine, connect did throw a NotImplementedError. So, patch looks good to me.
This looks like it is coming along nicely! TI did not test yet.
I think it would be good to add // TODO on every routine that needs implementation, or needs more implementation. That will help us spot what remains to redo.
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...
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 ...
Thanks for this idea. I think we might separate the ring buffer from I2C so it could be used elsewhere.
collections.deque is available, but is not turned on by default. I'm not sure whether it implements maxlen.
esp-idf was updated recently, a merge from main should fix the CI.
esp-idf was updated recently, a merge from main should fix the CI.
Adafruit CircuitPython 7.2.0-alpha.1-220-g80611954f on 2022-01-26; ESP32-S3-DevKitC-1-N8R2 with ESP32S3`
Seeing hangs (can still control-C; watchdog doesn't notice it) when executing this line on the onboard NeoPixel:
pix[0] = (0, 0, 0)
Looks good. Thanks for making the changes. Also we prefer to assist others in learning how to use GitHub instead of just doing it for them.
Would that mean a new I2CPeripheral class that could be adapted to a variety of shared structures?
Changes in text to reflect that there is an (unofficial) arduino core for rp2040 based boards, and to point to the adafruit post on it.
This is the same wording on the product page. There are 34 boards in total on the cPython page based around rp2040, 32 text to go.
Thanks for following up so quickly on the issue! It will get exercised at some point.
I reproduced this and am working on it.
@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.
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...
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.
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
It is relevant, thank you.
There was an issue created with Sphinx and they may still have a bug related to it that they may want to chase. (since it has different behavior on different versions of Sphix).
But in our case it turned out that the type hint was also wrong. Changing to a different one allows the current version of Sphinx to build it successfully.
Brilliant! Thank you for digging into that.
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.
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.
Oops
Do I need to update it?
Slash looking to see what I got wrong but don't see any recent merged PRs regarding typing
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
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)
Couldn't this be done using the existing I2CPeripheral? https://circuitpython.readthedocs.io/en/latest/shared-bindings/i2cperipheral/index.html
Ah got it
Thanks!
@anecdata Please open a new issue. Follow up messages on PRs can be hard to track. Thanks!
It looks like there is code to hook crc32 into binascii: https://github.com/adafruit/circuitpython/blob/main/extmod/modubinascii.c#L207-L219 The setting is MICROPY_PY_UBINASCII_CRC32.
We have it turned off. It could be enabled on full builds like the other settings here: https://github.com/adafruit/circuitpython/blob/main/py/circuitpy_mpconfig.h#L209-L236
This looks like it is coming along nicely! I did not test yet.
I think it would be good to add
// TODOon every routine that needs implementation, or needs more implementation. That will help us spot what remains to redo.
My plan was to search for NotImplementedError. Is that enough?
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....
@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
@tulip sleet just curious if PCF8574 is going to be supported in circuitpy?
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.
trying to remember...did something like simpleio.maprange get moved to some core or frozen module?
simple_math has it. But it should still be in simpleio. Or maybe it got moved.
it is in simplemath -- but not core https://github.com/adafruit/Adafruit_CircuitPython_SimpleMath/blob/755784b6acc8ba419a085bee2d2dc4374f0d0030/adafruit_simplemath.py#L27
which is in the frozen module list
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?
guess so -- not sure what boards have it frozen in.
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!
FYI -- it is also in simpelio...https://github.com/adafruit/Adafruit_CircuitPython_SimpleIO/blob/main/simpleio.py#L232
If you are using a PCF8574, you can use my library: https://github.com/dhalbert/CircuitPython_LCD
The minimal branch removes a bunch of features but is quite a bit smaller.
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...
@ladyada these are the product pages I have found that still have the old descriptions for lack of arduino support
[Trinkey](https://www.adafruit.com/product/5056 Trinkey QT2040)
[QT Py](https://www.adafruit.com/product/4900 QT Py RP2040)
Pico
Ah, I didn't do a bunch of functions because I just did the construct method. Will add a bunch of TODOs for those spots.
I think I'm missing something for this (and the last) comment. The new description is what the class does or were you looking for something else? (the FrameBuffer wording was awkward so I updated it)
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=...
There are MicroPython SSL implementations, could they be used as a starting point?
@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...
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
the Primary Guide is linked from the QT Py ESP32-S2 non-uFL product page, but not from the uFL version product page
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 :)
@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?
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.
there is a way. want to know? useful for troubleshooting libs on blinka setups.
Yeah for sure.
Where is PYTHONPATH?
environment variable
export PYTHONPATH=/home/dir/repos/some_foo_lib
something like that
exactly how will differ for OS's
Right
but yah, once set, just launch python as usual
Right on. Thanks!
that way you can just clone the repo and point python at it
Do you have the hardware to test this?
i do
Right.. ok that makes sense
Perfect.
i can test real quick if you want. or you can to see how?
sure. np. give me a sec.
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
@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".
Huh. That's also excellent.
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
Fancy! Thanks, Dan!
(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
Nice!
@idle owl works fine. i say deploy. if there was a reason no to, we'll discover...
For sure. Thanks!
Oof I just realised we duplicated a heading in all the READMEs. Sigh.
And cookiecutter was never updated for a thing in the README.
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.
indeed
@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.
Yeah, I'm up to give it a try at least. What is it?
We added the API documentation link to the library READMEs. But not to cookiecutter.
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.
https://github.com/adafruit/cookiecutter-adafruit-circuitpython/issues/166 Ping me if anything is unclear when you get to it.
@proven garnet I have a mission for you, should you choose to accept it. 😄 Ping me when you're around.
Ok @dhalbert, this is ready for a re-review and passes CI.
I don't think there is supposed to be a stop bit before the repeated start. I suspect we'll need to have a common-hal API for writeto_then_readfrom so we can do one call to the IDF for it. What is the right call to the IDF for this?
This function signature needs all of the arguments it takes below and documentation for each one.
@timonsku No plans for Adafruit-funded folks.
@askpatrickw Yup! Definitely. Their code is usually well done and a good reference.
You are making progress! The undefined reference error is coming from the linker when it's looking for the implementation. This happens when the source file hasn't been listed for CircuitPython to build. Try listing the source file in this list: https://github.com/adafruit/circuitpython/blob/main/py/circuitpy_defns.mk#L686
CircuitPython version
Adafruit CircuitPython 7.2.0-alpha.1-229-gfff68c9f8 on 2022-01-27; MicroDev microS2 with ESP32-S2
Code/REPL
N/A
Behavior
I noticed that the on-board led was dimly lit and on further investigation, I found that the GPIOs were at ~3.2V.
Description
No response
Additional information
No response
Yes, I did this deliberately in #5892 to keep the pins from floating (specifically neopixel pins.) Perhaps we need to special case on-board LED pins.
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.
It turns out this is a hardware problem specific to the QT Py ESP32-S2. We know how to fix it, but it's not an easy trace-cutting or something like that. For now, you may want to switch to a different board. We could get somewhat less sleep current by using ESP-IDF "light sleep" (which is not the same as CircuitPython's light sleep), but it would still be several mA.
OK, thanks for running this down. For the current application, I can live with 5 mA, but uA sleep would be good in the future. But, the long boot up time for CircuitPython limits the number of low-power applications where it can be used.
FWIW, can you share a quick explanation of the hardware issue (I'm an EE by degree)?
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 ...
./PyPortal_Quarantine_Clock/fonts/Helvetica-Bold-24.bdf
./PyPortal_EventCountup/fonts/Helvetica-Bold-24.bdf
in the Learning_System_Guides repo.
I often do find or grep in that repo (or the bundle repo) to find things
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.
Thanks for the explanation of both issues. Taking 5 seconds off the boot up time would be huge for low-power stuff; hope you can eventually come up with a solution for getting back to CIRCUITPY after that. I'll Close this issue.
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...
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
The boot up time should only be 5 seconds on power up or reset press, not wake from deep sleep. Can we not tell the difference on the S2? I'm pretty sure it used to work on the MagTag.
@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.
Thanks for the info 🙂 Any background info/code I should look at before I spend a few hours diving in to learn enough to tinker in my own builds? I think I can grok it with enough time either way tho
have you built CP locally already?
yeah, last time I tinkered was with some of the RPi builds a few weeks back
Just never dove into the displayio subsystem(s)
k. I think most of what you want is in shared-module/displayio
Sounds good, thanks!
@lone axle https://forums.adafruit.com/viewtopic.php?f=60&t=187755 If no one else gets to it before you have a chance.
Ah with a quick glance I think I know the issue. Will reply on the forum.
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)?
Bundle.
Thanks!
And actually, further, I think it might take another 24 hours to refresh. I'm uncertain about that.
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.
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?
I put in the five second wait because otherwise it can be very hard to ctrl-C a program that wakes up, checks something, and immediately goes back to sleep. When I didn't have this wait, my deep-sleep test programs were almost impossible to interrupt.
Ah yeah. Good catch. Thanks!
which board are you building?
if espressif, then it sets up its own python env
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.uf2adafruit-circuitpython-bundle-5.x-mpy-20201205
- 7 is using
adafruit-circuitpython-trellis_m4_express-en_US-7.1.1.uf2adafruit-circuitpython-bundle-7.x-mpy-20220127
import time
i...
I think you might want to check which python is run by the make command, I use pyenv to control what python is run from the command line, but I actually also create a venv to run my circuitpython builds from anyway, (and pip install -r requirements-dev.txt in it)
IMHO this is a serious issue, since it really spoils the fun. It's a loud white noise static. And it's definitely related to the software stack
I don't know the IDF's I2C API that well, but I couldn't find a writeto_then_readfrom equivalent that queues commands to an I2C command list like i2c_master_write does. However, since v4.4, there are wrapper methods for write, [read](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-referenc...
Building for the pyportal. Let me check my Python version, per @jaunty juniper comment.
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
This page has the commands to build them locally: https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-2615853-1
thanks!
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
The capitalization doesn't matter. If you do a build without your changes (just the tip of main), does it work? If that doesn't work, then there's a general build issue. Is there any error printed by the build.
So the wait is in code.py? I don't see one in the first post here.
My assumption was that folks would hit reset to get back it to slow down. When waking up from deep sleep it should be fast. For debugging, folks should connect usb and then use fake deep sleep.
Ok, I was running an older python, now I have 3.9.4, but the same error about ModuleNotFoundError: No module named 'cascadetoml' .
Here's what I get for my python version.
Python 3.9.4```
and you reinstalled the requirements in it, or in a virtual env ?
Just ran requirements but it failed on cryptography. Will try building again.
oh it fails ?
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
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...
Just updated pip3 and now requirements work.
ah
it's so nice having access to the whole ble host stack source
Yay! Building........... Built! Thanks, @jaunty juniper
@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.
I don't remember, no.
Not sure that was with me 🙂
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!
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.
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
Ok!
Is there a lag between when a library is released and when RTD docs does its build?
specifically for https://github.com/adafruit/Adafruit_CircuitPython_AzureIoT/
release was 3 hours ago
the project page will show the builds
@idle wharf looks like it's failing: https://readthedocs.org/projects/adafruit-circuitpython-azureiot/builds/
Thank you !
I can fix that.
thank you!
The lag is very short. 5-10 minutes max. For your future information.
Ah, we should only do that if we woke due to reset or power on. We should skip it if waking from deep sleep. If we woke for deep sleep, then we should assume we want to continue deep sleeping. That'll save the most power.
Want me to reopen this issue or make a new one?
I didn't think we could see the RTD admin... that was "the more you know moment".
Fix for this for the library and to cookiecutter waiting for review.
Yes, let's make a new issue. So on the first sleep, we don't know, so that will be at least 5 seconds. After that, if the user connects USB and presses reset, then it will go into fake deep sleep, and be interruptible. That is a bit of change, since right now just connecting USB is enough (I think).
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.
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.
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...
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...
Sorry and thanks. Totally was blanking out on what was missing last night.
Thank you all for pursuing this; it will really improve low-power performance. 5 seconds at 55 mA every time you wake up to read a sensor is a serious hit on the battery.
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.
I did a clean and also redid pulling the submodules. Perhaps it needed an older submodule version. Now I can build 7.2.0-alpha.1! Thanks for yours, danh and neradoc's help.

I'm game!
Oh, late on the draw I see, thanks @lone axle!
Looks fine but not tested! Great progress!
If we did need something like this, simply aliasing bitbangio as busio via some switches might make more sense, and take less space.
Thanks for trying this out.
Woot! Looks like this worked: https://github.com/adafruit/circuitpython/actions/runs/1759724741
I merged one PR, a translations PR started up, and then I merged another PR, which triggered the translations PR again, and the first one got canceled.
On the Feather TFT, is it intended for the board.TFT_BACKLIGHT PWM setting be sticky across reloads?
I think so, you want the repl to work
but if I set duty cycle to 0, that sticks, that wasn't intuitive to me
Closing this without prejudice for now, but if you would like to revisit this in the future, please reopen.
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...
If you forked circuitpython, make sure your own main branch does not have spurious commits on it. It should be the same as the upstream repo's main. Assuming that is the case, bring your main up to date, do a make fetch-submodules, and then try building it. Then do checkout -b the_pr_branch_name, make your changes, and try the build again.
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...
Great!
You're not late to anything. The issue I wanted you to handle is related but different.
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. 😄
We just moved to "3.x" deliberately. I'm confused about your cookiecutter PR?
It fails to build in RTD with that configuration.
There is a lengthier discussion from Dan on a preferred fix in the AzureIoT PR.
I'll come back to that when I have a gap in day-job stuff later today.
Ok thanks!
I have been using this feather with Rust (RTIC) and Tinygo as circuitpython was not quite there when I first tried it. In the mean time, With async/await now on the scene, I am all in and look forward to helping where I can.
Awesome! You may want to join #circuitpython-dev on the Discord chat as well: https://adafru.it/discord That's where we discuss CP dev work.
I could see that being a hassle haha 
If there is anything I can help with let me know! This snowstorm means LOTS of time for coding haha
@bludin we're happy to help on Discord too in #circuitpython-dev: https://adafru.it/discord
I suggest using git status to double check that your git state is what you expect.
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
So you actually want me to PR to the already cookiecut (grammer?) repos?
There should only be a few. You'd need to maybe initialise the entire bundle and grep for that line. If it's not found, add it. Otherwise, no action is needed.
Does that include community libraries?
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.
No, because those folks are hosting their own documentation, and the link won't apply.
Got it, sounds good!
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.

Roger!
I assume I'll need to git clone --recursive-submodules [BUNDLEHERE] right?
In order to grep?
Something like that yes. I don't remember the exact command.
Very close! Just a typo and a question about kw_only required arguments.
//| def __init__(self, *, is31: is31fl3741.IS31FL3741, width: int, height: int, mapping: Tuple[int, ...],
Are these actually required to be keywords? They are documented like position arguments and used in the library as such. Probably best to just remove the MP_ARG_KW_ONLY here.
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.
@atctwo Great find! We'll need to "push down" the writeto() and readfrom() calls into a common_hal function in CP. That way the ESP version can call i2c_master_write_read_device directly in the IDF instead of doing two calls.
Got it, thank you!
@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...
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!
I am debugging #5934. I don't know if this is related at all or not.
OK, I updated the PRs
You might want to include the .readthedocs.yaml change if you're touching the library repos. Any docs with the "3.x" are failing to build currently.
Oof. Ok. I guess it's patch time. Will have to wait until next week though because Eva has a task for today.
this one has all the details about the why of it all
https://github.com/adafruit/Adafruit_CircuitPython_AzureIoT/pull/40
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.
It might be worth creating a new RTD Build Failure channel and sending RTD failures to that channel via the RTD webhook.
https://docs.readthedocs.io/en/stable/build-notifications.html#build-status-webhooks
I wish it was easy to to just have RTD open an issue in GH, but you'd need to run something between RTD and GH. Zapier, Azure Functions, AWS Lambdas etc...
Should I change all the places we now use "3.x", or just in .readthedocs.yaml?
@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.
"3.x" is correct in all the other places. RTD is just being idiosyncratic.
"This functionality is in beta.", but it also says version 1 is deprecated. <-- I also found that very funny\strange.
Thank for your help in pushing this towards the best long-term fix!
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 🤷
I thought the .x was very odd when I saw it. I don't know where that comes from. I'm only used to the version specifiers
https://www.python.org/dev/peps/pep-0440/#version-specifiers
might be common in one of the many other languages RTD supports that I don't use....
this might be a problem for nimble: https://github.com/apache/mynewt-nimble/issues/556
I removed it from the mapping as well (also required) and reorged everything so it was in the right order.
Anyone have a minute to tell me whether I'm doing this example the most sensible way?
It looks good to me. Understandable for sure
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.
I agree, this looks fine. You could use len(...) instead of 4 in the last loop, but clear now anyway
Ooh. Good idea. Because you can chain these boards.
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
in cpython i'd write for led, button in zip(leds, buttons):, but i don't know if that's cool in circuitpython
zip is implemented! https://circuitpython.readthedocs.io/en/latest/docs/library/builtins.html
cool as in, gives you extra "pythonic" points
i guess that's not as important in circuitpython
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
zip might not be so cool for examples though
beginners will probably be more used to using indices
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 
Convenience 
I am now seeing crashes sometimes reminiscent of #5680 (but not going into safe mode). This is with a build that already incorporates #5854.
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
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
sorry for being unclear - I freshly forked from adafruit/circuitpython today, i.e. from scratch. To exclude the possibility that I the problem was because I got out of sync. So the problem must lie elsewhere, but I can't imagine where, right now.
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.
Not sure why there was one cancelled check, but with the rest passing I don't think it is worth re-running the whole thing.
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 🙂
This would absolutely work, but is less clear what's going on.
agree
@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.
@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...
I am willing to do the new common-hal across all ports. It is more work but it's cleaner in the long run.
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.
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).
I suggested to Sphinx that they add an ubuntu latest value for build.os.
https://github.com/readthedocs/readthedocs.org/issues/8861
thank you!
Hi, pretty new to Circuit python and wanted to try it on the Waveshare RP2040-Zero.
Is there any reason why there isn't a 7.1.1 release for it? Is it just to new, and should I just use latest build for now? And wait until 7.1.2 drops.
https://circuitpython.org/board/waveshare_rp2040_zero/
@IsaacDynamo The board was added after we already moved towards 7.2.0. You can use the latest build for now, it's pretty stable for the most part. Please let us know if you run into any issues. It's best to file a new issue if there isn't already a related one. Comments on closed PRs and issues are often missed!
@tannewt Any insight into why this isn't working? Do we know that the rtc module is even configured to read from the RTC chip in this case?
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)
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.
@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
Yeah, that was archived because we turned it into multiple libraries, I think.
Got it, thanks!
Or maybe not. Not sure. Link please?
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?
it is here, and has the wrong name: https://circuitpython.readthedocs.io/en/latest/docs/library/asyncio.html. The MicroPython-supplied documentation needs to be reorganized to fit in more nicely with the other shared-bindings modules. Same for re, json, etc.
Thank you!
ideally that doc should be moved into the the library as docstrings, since it's just Python code.
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
sure! it's always good to write these things down
Redundant import of analogio in example.
Confused MagTag user. MagTag does not come with analogio in uf2 and cannot play native WAV with buzzer hardware.
Alright issue filed, and those PRs have been submitted!
It looks like the very useful "core language" page from micropython is not in the circuitpython docs: https://docs.micropython.org/en/latest/genrst/core_language.html
most of these items apply to circuitpython as well.
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?
It figures out the boards dynamically now, which is great. There are no longer lists of board directories.
w00p! thanks @tulip sleet 🙂 Doing my PR now!
i was looking for Scott's PR, but I can't find it now. In any case, it should just work 🙂
Added definitions for my new ESP32-S3 boards.
PIDs are from Espressif.
USB, flash and RAM never_resets don't need to be specified since: d99847b4106bfb767029e81eda810168ab5a5d03
I am implementing what @tannewt suggested, pushing write/read down to common_hal. This simplifies a bunch of things, but will take a bit of time to do for all the ports.
@atctwo Those wrapper routines are great -- thank you very much for pointing them out!
Hmm, ok, I'll go clean that up and also fix my pre-commit issues. Cheers!
Also fixed some incorrect text in my unexpectedmaker_tinys2 description
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...
Please file an issue with this idea and the links. That way we won't lose them
Same issue on the non-TFT Feather:
Adafruit CircuitPython 7.2.0-alpha.1-224-gac7a80753 on 2022-01-26; Adafruit Feather ESP32S2 with ESP32S2
>>> import board
>>> import digitalio
>>>
>>> i2c_power_control = digitalio.DigitalInOut(board.I2C_POWER_INVERTED)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: I2C_POWER_INVERTED in use
The de facto naming convention for these typing stub packages on pypi is f"types-{name_of_full_packages}"
Fixes a couple of return type annotations in wifi.Radio
connectreturnsNone, notboolpingreturnsNonewhen it times out
"Why does connect keep returning False??" 🤦♂️
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...
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...
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
...
>>>
trustin anecdata on this one, seems right to me too :)
Remove the part that was copied from the product description from the website mentioned below.
Previously, the calling neopixel.show() after calling neopixel.deinit() would not raise an exception. Now it does.
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.
oops, finger slipped, but there's a "Linked issues" setting in the right on the GitHub web page
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.clists, 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...
For reference, this is what my pinout diagrams look like...

And is how all of my boards have been ordered in the past.
@anecdata I see the Linked Issues panel on the right, but it doesn't appear to be editable by me. Quite possibly I'm doing something wrong, however. :-)
Thanks @tulip sleet for checking on my PR pin order!
np, we just had to edit a bunch to get it right, as I mentioned. So only double-checking!
I edited your OP slightly to make it link. Here is the magic: https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
Thanks so much! I'm much more familiar with Microsoft's Azure Repos UI, and - well, I'm learning. :-)
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?
I would pick a well-working board like a Feather M4 or RP2040 board. Not u2if, just plain CircuitPython. That way you don't have I2C idiosyncrasies, etc.
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. 😉
there are some deep dives
You're talking about a python library too and not a core change correct? Just want to be sure
The Friday YouTube streams with Scott Shawcroft (Tannewt) are where I've learned the most about core CircuitPython.
I should go back and watch some of the older ones, maybe.
https://circuitpython.readthedocs.io/en/latest/README.html see the "DESIGN and PORTING REFERENCE" sections in the left sidebar
I was actually thinking about this while working on my day job (which has me document large systems too often).
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