#circuitpython-dev
1 messages · Page 391 of 1
It says "On branch main
Your branch is up to date with origin/main"
A fresh clone shuld be at the tip of main.
I am not working on fork. Just follow your learning guide on building cpy. I clone it yesterday.
that should be ok, I'm puzzled why 7.0.0 is not mentioned in the version. What version of Linux are you running on? It's slightly possible git is too old.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal
The libraries are confused because the version number is wrong, but I have not seen that before.
ok, that's absolutely fine.
Exactly !😩 and I think that is why it confuse circup as well.
Try this:
$ git tag | grep ^7
7.0.0
7.0.0-alpha.0
7.0.0-alpha.1
7.0.0-alpha.2
7.0.0-alpha.3
7.0.0-alpha.4
7.0.0-alpha.5
7.0.0-alpha.6
7.0.0-beta.0
7.0.0-rc.0
7.0.0-rc.1
7.0.0-rc.2
7.0.0-rc.3
Do you see the same tags?
No. Just empty response.
But I found that when I clone, I used
git clone --depth=1 https://github.com/adafruit/circuitpython.git
why did you use --depth=1 ?
Google on the previous GNUtls recv error taught me to use depth =1 to circumvent the problem.
I"ll retry the clone and let you know the result tmr.
yes, but it also doesn't fetch the tags you need, unfortunately. That's the problem.
hopefully they have fixed the certificate problem
by now
What is the certificate problem ? and how does it relate to the experience I had with building cpy ?
the fetching problem is due to an expired certificate that breaks the fetching of some Espressif submodules. Somebody forgot to renew their certificate. a depth=1 clone is not going to work to build CPy
I have to leave now, sorry, there was some discussion up above about alternate ways to get around the expired certificate.
Arh. Excuse me when it comes to certs, that may reflect the quality of management of an organization. Just my humble opinion.
if you're missing the tags would git fetch --tags help ?
sure, could try taht
I won't blame anyone in particular at the moment 🙂 but I hope it was fixed
if the depth is only 1 then the commits for the tags won't be available, I think, so there's nothing to attach the tags to
right, redo a full clone then, or git fetch --unshallow
Follow the learning guide to clone and build again. This time the REPL comes back with
Adafruit CircuitPython 7.0.0-dirty on 2021-10-02;
and the circup reports
circup list
Found device at E:, running CircuitPython 7.0.0-dirty.
A newer version of CircuitPython (7.0.0) is available.
All modules found on the device are up to date.
So it is working !
May I ask why it is called 7.0.0-dirty ? I did do a git checkout 7.0.0 after the clone.
its dirty because its not built in CI
dirty in git means there are things that are not committed in the working directory
😲 excuse me but what is"CI" ?
ok. all clear. Thank you.
CI (Continuous Integration) is the term used for the actions/checks that are run on the github repository
Thanks. All clear now.
Oh... just realized, Neradoc is correct here, -dirty tag only comes when there are uncommitted changes
This adds an optional second I2C singleton, referred to as "SECOND_I2C".
- Define
SECOND_I2C_BUS_SCLandSECOND_I2C_BUS_SDA - Declare it in pins.c like this for example:
{ MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_second_i2c_obj) },
board.STEMMA_I2C is implemented on the QTPY RP2040, the only board that I know of where the STEMMA port does not share the default board.I2C pins.
Other boards that have a STEMMA port don't need the second I2C and can jus...
@crimson ferry I was able to come up with the following api for monitor-mode:
import wifi
wifi.radio.monitor = {wifi.Packet.SSID, wifi.Packet.RSSI, wifi.Packet.RAW}
while True:
print(wifi.radio.monitor_packet)
# Output
{'SSID': '...', 'RSSI': '...', 'RAW': '...'}
@analog bridge the idea is that those get fed in as filters, and one (or more?) (or None) matching packets are returned?
(I'd add channel(s) too, and eventually others)
no filters, only specific things are parsed and returned and no other compute is done on the rest of the data
ah, I see, to take advantage of the faster parsing in C
hadn't thought of that being dynamic
I am yet to test the efficiency of this approach vs just returning the RAW data and parsing it in python
did you implement something to return packets from the monitor task (which has its own queueing from the callback)?
I'm trying to get a really simplified way of doing that now
At the moment I am just returning a couple of pre-stored packets parsed using the algo in idf example
Even parsing in C, and serial output, takes time. I trimmed those down and it keeps up much better (way fewer dropped frames)
an aside... esp-idf task priorities are lower for lower numbers?? the example defaults to 2, and even with that it will overrun and often not stop until seconds or even a minute or two after issuing a stop
I'm pretty lost with C data structures, especially with the added abstractions of core/micropython stuff, but I'm working with two assumptions...
- there's no way CircuitPython can keep up with the firehose, so filter parameters will be important (channel, subtype, min rssi, etc)
- knowing it won't keep up, it would be better to get a smoother random sampling than chunks taken from the stream ...because some events come and go and they are more likely to be missed entirely with a chunky approach
typedef enum {
PACKET_A1,
PACKET_A2,
PACKET_A3,
PACKET_CH,
PACKET_DUR,
PACKET_FC,
PACKET_FLAGS,
PACKET_FRAG,
PACKET_LEN,
PACKET_RAW,
PACKET_RSSI,
PACKET_SEQN,
PACKET_SSID,
PACKET_SUBT,
PACKET_V,
} wifi_packet_t;
I believe this covers everything
okay, I'll drop V and FC then
@crimson ferry
an aside... esp-idf task priorities are lower for lower numbers??
It's usually the other way around. This example checks for a "higher" priority, and uses a<: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/freertos.html#_CPPv417uxTaskPriorityGetK12TaskHandle_t. I haven't found a definitive statement in the doc, thoguh
thanks, Dan, I thought it would be reverse too (and also found nothing definitive), but I increased from 2 to 3 and things got worse, but it wasn't a very controlled test, I'll dig in more
@crimson ferry I'll push the shared-bindings side of things upstream so you can give it a test
wait, am I reading that example wrong... if xH < "Our" then // Our priority (obtained using NULL handle) is higher. ..."Our" would be a higher number?
Thank you! I'll probably keep going for the moment on the common-hal stuff I'm immersed in, then give that a try
Yes, same problem as @ThinkTransit described. My setup: Adafruit ESP32-S2 Metro, UF2 (0.5.2), cpy (7.0.0).
It's impossible to boot into the UF2-Bootloader from user code. Either by using circuit python:
import microcontroller
microcontroller.on_next_reset(microcontroller.RunMode.NORMAL)
microcontroller.reset()
or directly in Arduino CPP:
esp_reset_reason();
esp_reset_reason_set_hint((esp_reset_reason_t) 0x11F2);
esp_restart();
It acts just as a regular reset (single b...
Observed in 7.0.0.
Setting the grid for an OnDiskBitmap TileGrid can cause USB communication to be delayed long enough that a keypress can start repeating. I noticed this while working on the Kitty_Paw_Keypad example. I was converting it to use keypad, and saw repeated keypresses. However, the program was only sending one keypress, and then, noticeably delayed (about half a second), the corresponding key release. The d...
Adafruit CircuitPython 7.0.0 on 2021-09-20; Raspberry Pi Pico with rp2040
This is the message that is printed by CircuitPython on a Raspberry Pi Pico but the code posted above appears to be for an Adafruit Feather RP2040. For example, board.D6 doesn't exist on a Raspberry Pi Pico but does exit on an Adafruit Feather RP2040.
On a Adafruit Feather RP2040 I'd expect the following message to be displayed:
Adafruit CircuitPython 7.0.0 on 2021-09-20; Adafruit F...
It fails on both, Easier to get traceback on pico board since it has easy
to access debug pins. Feather 2040 need SMD headers soldered.
Yes the traceback was from a pico with pico circuitpython flashed to it.
On Sat, Oct 2, 2021 at 5:08 PM Brian Cooke @.***> wrote:
Adafruit CircuitPython 7.0.0 on 2021-09-20; Raspberry Pi Pico with rp2040
This is the message that is printed by CircuitPython on a Raspberry Pi
Pico but the code posted above appears to be for an Adafruit Fea...
Looks good to me. Didn't test it as I don't have the board.
Tested this with the I2C QT Rotary Encoder.
this reads like a RAM error?? but this is flash xtensa-esp32s2-elf/bin/ld: region 'dram0_0_seg' overflowed by 72 bytes --> n/m, remembered this is what it looks like when I have to turn off more modules for DEBUG
There is no board right now where it's called SECOND_I2C, so let's add STEMMA_I2C to the doc instead. I've added some language to the doc to explain that it might not be present.
//| def STEMMA_I2C() -> busio.I2C:
//| """Returns the `busio.I2C` object for the STEMMA or STEMMA QT connector.
//| Present only if the STEMMA connector provides a second, additional I2C bus that is not the same as `board.I2C()`.
//| It is a singleton."""
//| ...
//|
Thanks for doing this. We might discuss it in Monday's meeting.
Looks good to me. Didn't test it as I don't have the board.
I did a little more experimentation on this. Commenting out the actual pixel reading of the OnDiskBitmap in the C code helps. The display redisplay can be slow, as noted below, especially for this case.
Can we do this using the following method:
def I2C(instance: Optional[int] = 0) -> busio.I2C
# for primary bus:
board.I2C() = board.I2C(0)
# for secondary bus:
board.I2C(1)
# and so on...
I like microdev's method because it could apply to other boards with more than one I2C whether stemma or not.
I think we might consider doing both. The board.STEMMA_I2C has affordance.
Trying to follow the checksum computation algorithm for Blue fruit packets. For FF0000 I get E1 while circuit python says 9C. Don't understand how. Can anyone point me to the algorithm?
Anyone familiar with the u2if RP2040 firmware? (https://github.com/execuc/u2if) I have been trying to get it to work with the MacroPad and have been successful, but I can't get it to compile work for the Feather RP2040. The uf2 listed on the Adafruit page works though (https://learn.adafruit.com/circuitpython-libraries-on-any-computer-with-raspberry-pi-pico/other-rp2040-boards). Also, I am curious why the PID's are different than they are for CircuitPython. https://github.com/execuc/u2if/blob/main/firmware/source/usb_descriptors.c
?serverinfo
228 users away from 10,000 x Pi!
Hi there,
I'm receiving an error after importing the CircuitPython 'board' module in a multiprocessing process. I'm on macOS (with a MacBook with an M1 chip, disclosing this because that had caused problems with the board library). Also I'm using the Adafruit FT232H board.
This error does not occur when I'm using the board without the multiprocessing module.
This is the error I'm receiving:
Traceback (most recent call last):
File "", line 1, in
File "/opt/homebrew/Ce...
Transferring this issue to the Blinka repo.
@analog bridge I looked for your changes in your repo, mine, and adafruit's, but couldn't find them. I have a really rough version going with API received = wifi.radio.monitor_recv_into(buf, MAXBUF) https://twitter.com/anecdat/status/1444845429510873092/photo/2 (monitor_min branch)
This builds upon https://github.com/adafruit/circuitpython/pull/5048, to achieve a preliminary-but-functional alarm module for the SAMD port.[^1]
This partially addresses https://github.com/adafruit/circuitpython/issues/4837 via the following features:
alarm.time
- [x] true deep sleep. ✅ Functional
BACKUPsleepmode (lowest power consumption).- Feather M4 Express consumes ~0.6mA during deep sleep while powered via BAT=4V
- [x] fake deep sleep. 🚧 Functional but not comp...
CircuitPython version
Setup: Adafruit ESP32-S2 Metro, UF2 0.5.2, CircuitPython 7.0.0, Windows 10
Code/REPL
import microcontroller
microcontroller.on_next_reset(microcontroller.RunMode.UF2)
microcontroller.reset()
Behavior
Acts just as a regular system reset. Device does not enter UF2-Bootloader.
Description
Even by directly calling:
esp_reset_reason();
esp_reset_reason_set_hint((esp_reset_reason_t) 0x11F2);
esp_restart();
Th...
Unable to reproduce this on:
TinyUF2 Bootloader 0.5.2 - tinyusb (0.10.1-109-g9b3ec69b)
Adafruit CircuitPython 7.0.0 on 2021-09-20; microS2 with ESP32S2
Allow atmel port based usb-less boards to use PA24, PA25 pins.
@FlorianBaumgartner you need to update the boot2 partition as well (which mean reflash the whole bootloader https://learn.adafruit.com/adafruit-metro-esp32-s2/install-uf2-bootloader) . Updating bootloader via uf2 unfortunately does not fix this issue.
Thank you so much @hathach. That solved the problem. I didn't know that it is necessary to completely update all partitions.
Now it works fine. You can close this issue.
CircuitPython version
Adafruit CircuitPython 7.0.0 on 2021-09-20; FeatherS2 with ESP32S2
Code/REPL
>>> from arcti.ntp import NTP
>>>
^ Works fine ([#help-with-circuitpython message](/guild/327254708534116352/channel/537365702651150357/))
>>> from adafruit_gc_iot_core import MQTT_API, Cloud_Core
<>
Running in safe mode! Not running saved code.
You are in safe mode because:
CircuitPython core code crashed hard. Whoops!
Crash into the HardFault_Handle...
# for primary bus:
board.I2C() = board.I2C(0)
# for secondary bus:
board.I2C(1)
# and so on...
Let me be describe further our naming scheme for the board.SOMEBUS() singletons, and on pin or pin-group names in general. board pin names try to correspond to the silkscreen names on the board. They may also refer to specific-function pins that are not broken out to pads, but are attached to some on-board functionality, like board.LED, `board.ACCELEROMETER_I...
@crimson ferry I just pushed the Packet class changes. I am holding back on the api for monitor-mode as I ditched the previous implementation in favour of a separate singleton class and its still a work in progress. https://github.com/microDev1/circuitpython/tree/monitor-mode
Here is an earlier discussion about this on Scott's Deep Dive with Lady Ada - https://youtu.be/5UKr0fT51ro?t=5957
Changes pushed to track the non-movable memory.
@analog bridge should we open a discussion somewhere... on the issue, or a draft PR, or maybe a thread here, to discuss kind of top-to-bottom design? shared-bindings API influences implementation options, and vice versa. There is some discussion in the issue. You and I have been playing with it (and some others I'm sure), and that experience gives some insights. It's a complex feature, and I'm sure people will want to use it in different ways.
@gilded cradle Good morning! (Where you are anyway 🙂 ) I have a question about some guide feedback. I don't remember ever using the Adafruit Voice Bonnet, so I'm not sure where I got the info for this guide (if I even wrote this page, the guide says I did, but I don't remember it at all). But the feedback asks why there is not Python code for the microphones. Do you know the answer to that? Should it be added? Or is there a reason it's not there? https://learn.adafruit.com/adafruit-voice-bonnet/python-bonnet-usage
Sure... sounds like a good idea. Let's start a thread here.
It looks like it might have been copied from https://learn.adafruit.com/adafruit-braincraft-hat-easy-machine-learning-for-raspberry-pi/python-usage, which it looks like I originally did, but the images changed and irrelevant stuff removed. Yeah, we should probably add microphone code to both pages. Most likely I just didn't think of it.
Ah ok. Is that something you can add to your list? I don't have the hardware or the setup to test it.
If so, I'll delete the feedback and you can deal with it whenever is convenient for you.
Sure, but I'm pretty deep in JavaScript stuff at the moment, so no ETA on that.
You're welcome 🙂
@tulip sleet For the Fritzing PR, we're happy with the naming? The file works and is named as they say it is, but you handled the issue so I wanted to make sure it was acceptable.
yes, the naming makes sense, because it now matches the silk. "VBUS" is on the schematic, but "USB" is on the silk
Ok. Right on, thanks.
Hello <@&356864093652516868> -- Looking forward to seeing y'all for our first meeting in October, about 75 minutes from now! It's a great time to add your notes to the notes document at https://docs.google.com/document/d/1_ZwlimMfNiDPSwWszVzGFMKQzGXSjmb5TzzhQ97kiOY/edit -- remember to note if I need to read your notes. If you're just listening in, no need to do anything but open the voice chat at the appointed time.
CircuitPython Weekly for 4 October 2021 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 participate, ...
Just lurking for today's meeting -- nothing to report.
Happy to have you!
i can report i just spilt tea all over my desk sigh
Happy to be here 😀
@solar whale if you want to help out with camera testing yet again, be aware that I'm working on https://www.amazon.com/dp/B07JF7QVL4?psc=1&ref=ppx_yo2_dt_b_product_details OV5640 now and hopefully within the next week it'll be ready for a 2nd person to try.
Oi. Hope it missed the electronics!
Thankfully yes. I'm mostly sad about the lost tea now 😂
I'd pour one out for the loss, but then I'd have to clean up here too.
@blissful pollen now I'm worried, I'm sipping a cup of masala chai right now
Happily lurking 🙂
Normally, I'd love to, but I won't have much time for the next few weeks. By all means let me know but I can't promise much....
I'll keep an eye on it.
I just ordered one -- just in case 😉
lurking
Blues Wireless makes cellular IoT simple with the Notecard and Notehub.
This article documents the build of a simple GPS data logger for an electric bike.
Awww, thanks
It's all libraries! Exciting!
Yay!
Hmmm....
should there be Issues tagged Hactoberfest in the core? i don't see any.
the server doesn't like "/" at the end of URLs
Got it. Thanks!
How do you search all libraries for "good first issue" or "hactoberfest" tags?
The circuitpython.org page is the easist way that I know
The Contributing page on circuitpython.org for sure.
ah -- thanks -- I missed the pulldown menu!
Ah, that makes sense. You're welcome!
FYI you can get to the Chrome dino game by typing chrome://dino into the Chrome URL bar.
I apologise ahead of time for any lost time you may experience trying to beat your own high score.
That apology....I suspect it lacks sincereness 😉
interestingly the HiiBot IoTs2 comes with the dino game preinstalled on it (using displayio)
I have no idea what you're referring to.
Wow! So much for getting back to work....
(sorry, not set up for audio)
There are some useful snippets here: https://github.com/adafruit/circuitpython/tree/main/tests, but I think that's more to test PRs and do regression-testing.
And, of course, there are some Learn Guides.
...some modules have code snippets in readthedocs, but it's far from universal
A core example library makes sense. Then just a few words in the CP learn guide template to direct people there
@lone axle I can create that through Adafruit if you think that makes sense. Or we can do it through the CircuitPython org if that makes more sense.
Either way works for me. We could start it out in the CircuitPython org and if at some point down the line Adafruit wants to take over / support directly additions to it then it could move at that time.
Okay. Sounds good. Please remind me tomorrow or sometime soon if you could.
Oh I didn't know you could get points this year that way through reviews. I don't want to take first issues to just "get" 4
Should a topic be added to adafruit_blinka?
I did mean topic so they know it is participating
Add the 'Hacktoberfest' topic to your repository/project so that folks know you're participating in Hacktoberfest.
Thanks everyone 🙂 Y'all are awesome and keep up the excellent work.
As a newbie from last year after 1/2 easier first issues I was more then willing to jump into harder stuff so tagging repos is a good idea
What do you want the repo called?
CircuitPython_Module_Examples ?
I like that
Thanks all
@turbid radish I'll take a short break before submitting the pull request, but feel free to ping me if it's been more than 1 hour before that is in.
👋 have a good week y'all!
@lone axle https://github.com/circuitpython/CircuitPython_Module_Examples Please take the time to update the README at some point.
Bumping this message about u2if as Carter may be able to answer at least part of it?
I brought this up a while back based on your comments. @tidal kiln certainly may have more to say on it.
I have all the code to make the macropad work for u2if, but when validating it I could get the feather one to compile from the main u2if repo.
Would it be OK (and if so can someone with the right privileges help) to create a thread here to discuss "ESP32-S2 wifi monitor mode design"?
PIDs are different because they are different firmware, not CircuitPython. not sure about other issue but can take a look.
Done!
Make sure you can invite folks, please.
That was what I was leaning toward when I saw it but wasn't sure. Is that assigned internally?
yes
looks good, thank you!
So if I wanted to make a PR to add the macropad to u2if what should I do about the PID?
and would the PR process be u2if -> adafruit_python_platformdetect -> adafruit_blinka
is there more than one issue here? not sure i'm following what's going on between macropad / feather?
yes, I can compile the u2if using my updated code and it works for the macropad, but the compiled one for the feather doesn't. I couldn't get the feather's to work using the latest main either.
The u2if on the adafruit page works though.
I am just about to test the qtpy u2if from my code, but i think it was working correctly.
what about the uf2 from the release page?
https://github.com/execuc/u2if/releases
I think that is where I tried it from, by i will test that real quick
it looks like that one worked.
There's a new branch https://github.com/anecdata/circuitpython/tree/monitor_min with a rough, simple received = wifi.radio.monitor_recv_into(buf, MAXBUF) API. It needs fleshing out and cleaning up.
There's a thread now on the Adafruit Discord, in the #circuitpython-dev channel to discuss some design and implementation issues.
so the issue is your build for feather using latest head from the u2if repo does not compile?
it was compiling and I was getting uf2 but blinka wasn't detecting it
any indication your PC was at least seeing something?
I appreciate you answering the other questions. I will attempt to look over the u2if code again and try it over the next couple of days.
no the VID/PID wasn't being picked up by the platform detect code
but what about just device manager, etc? did PC make a USB connected noise?
I am on a Mac but it wasn't listed under the USB devices
not sure then. could maybe try checking out repo back to same commits when the release targets were made. maybe something with the commits since then has broken something?
but then not sure why macropad would compile and show up fine
I will do that. Again, thanks for answer those question and trouble shoot the problem
do you have one of the other boards? itsy, qtpy? trinkey?
I know I have the qtpy and the feather, but I dont think I have the trinkey. I will go back and try them all.
idea is to see if you get same failure trying to build for one of those
also - how do you plan to use the macropad with u2if?
I have been playing with pyuvc for manually controlling usb camera settings (e.g. brightness, focus, zoom...). I have accomplished this with both the qtpy + the stemma rotary encoder, but having the twelve buttons and no i2c delay is a big plus
there are many other projects I could see being beneficial that having direct input with out having to emulate a usb hid or build a custom serial protocol to communicate with a script running on the computer.
I have to head out, but again thank you and will do some more trouble shooting.
Thanks!
@idle owl hey. trying to remember learn repo layout details for bundlefly. for things like fonts/bmp, they go in same folder as code.py?
Yes, or you can create a subdirectory in the same directory as code.py, and it will bundle the subdirectory as well. So /fonts/fontname will work in your code with Bundlefly.
cool. thanks. how are we fixing older repos? like this one:
https://github.com/adafruit/Adafruit_Learning_System_Guides/tree/main/MagTag_Progress_Displays
That was "fixed", but the problem is Dylan blasted through those in an automated fashion, and moved some things she shouldn't have. No way to know until someone complains or notices which ones weren't done properly. That may have been one of them, if you're saying it's not done right.
If it should be rearranged, then you simply rearrange it and PR the fix.
Otherwise, all of Learn was "fixed".
ok. pretty sure it's not right. someone didn't get fonts and i can recreate it also.
No because code.py isn't in the main directory.
Oh hmm. Then fonts would have to be duplicated and go in both subdirectories.
but not the fonts dir
(i think?)
ok. yah. that's what i was thinking also.
may not need multiple copies. i think (from quick look) each code.py uses one specific font.
so could just move each to where it needs to be
Ok, yeah, that sounds like a better idea.
but in general, you seeing what i'm seeing? layout needs fixed?
Yes. Fonts need to be distributed appropriately to fonts directories in the other two subdirs.
ok. easy peasy. i can pr that real quick. but wanted to double check my understanding first. thanks!
You're welcome. Thanks for looking into it and submitting the fix!
Renamed the "Manufacturer" for 2 boards to match the actual name of the manufacturer.
Both the PCA10059 and PCA10100 had only "Nordic" as manufacturer while the PCA10056 had "Nordic Semiconductor"
This caused the 3 boards to show up as 2 different manufacturers in the list of filters, which obviously is redundant and incorrect.
gc.collect() should have no effect on idf memory, right? I assume they're completely separate.
@crimson ferry yeah as I understand it as well
@idle owl It appears that either we have to label each pull request hacktoberfest-accepted or add the hacktoberfest topic to each repo.
still experimenting ..
it might be that giving an approve review alone does it, I haven't been able to test that.
ah, no, this one is review-approved and merged but is still not credited: https://github.com/adafruit/circuitpython-weekly-newsletter/pull/238
(I don't want/need it to be for my own sake)
It seems most likely that the problem arises when an RGBMatrix has been created, but not its associated FramebufferDisplay. We have to do "strange things" across a soft restart when these displayio-related objects exist. I recommend exploring this possibility, especially if that is the ONLY line where placing the exception-causing code leads to the problem.
The problem would not occur in quite the same way in the repl, because the soft reset would not occur until exiting the repl.
busio_spi_write_obj is defined as follows:
MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_write_obj, 2, busio_spi_write);
I think that the 2 (n_args_min) means that 2 positional (non-keyword) arguments are required, according to mp_arg_check_num_sig. Since all the arguments besides self can be given as kwargs, it should be 1 instead.
Where would be a good place to look to see how to implement clean-up that needs to happen for control-C and saving to CIRCUITPY?
@onyx hinge can you add the approved label to this one
https://github.com/adafruit/cookiecutter-adafruit-circuitpython/pull/153
I can’t add new labels, but I can add existing ones.
Looks right to me! Thank you !
I also added the topic to the repo, so it shouldn't be necessary for any further PRs that come in
I fixed the DAC clock speed comment typos. In addition to SAMD21 and SAMD51 being reversed, the datasheet reference for the SAMD21 table was incorrect.
I verified the clock speeds and datasheet references with the current datasheets:
SAMD21: https://cdn-shop.adafruit.com/product-files/2772/atmel-42181-sam-d21_datasheet.pdf
SAMD51: https://www.microchip.com/content/dam/mchp/documents/MCU32/ProductDocuments/DataSheets/SAM_D5x_E5x_Family_Data_Sheet_DS60001507G.pdf
The ACK part is still not implemented but this provides a good enough base to start with.
@FlorianBaumgartner no problems, not all issue requires boot2 stage update like this one. Since boot2 contain bare minimum code. Though IDF recent changes break (redefine) some of the reset reason constant which we use to detect software reset.
Convert espidf, os, rp2pio, samd and time to use MP_REGISTER_MODULE.
Related to #5183.
Should modules binascii, errno, json and re be converted as well?
Should modules
binascii,errno,jsonandrebe converted as well?
At least some of those modules are still implemented in extmod, not shared-bindings and shared-module, so be careful. See #1899, #1900, #1901.
Convert binascii, errno, json, and re to use MP_REGISTER_MODULE.
Resolves #5183.
This looks fine. I didn't test anything.
The test failure is due to the following modules now appearing in the "unix" build, in addition to their u-prefixed forms: 're', 'json', 'binascii', 'errno'. I think this is fine, and the .exp file for this test should simply be updated.
Here is the notes document for Monday’s CircuitPython Weekly meeting. It is ONE DAY LATER than usual, Tuesday at 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/1gFsjyqQCprD-4CVVsiNf6XFNNv7XcZ7RQcV6IHRssI8/edit?usp=sharing
CircuitPython Weekly for 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 participate, add your notes...
Ok. @lone axle Can you look into what would be needed to add a topic to every library repo? You've already dug into the API some, so I thought maybe you could do this as well. It might need to be an Adabot script, but I don't think topics are currently handled by Adabot either, so I'm not certain how we'd do that with her. Point is, Adabot has permissions, but I believe you might as well.
Yep I can look into that
Thank you very much. We should do it ASAP, so if you could see about it the next time you have some time, I would greatly appreciate it.
Anyone around up for being a second set of eyes on a thing? I'm making this fritzing object and it has a lot of components, and I want to make sure none are missing. Basically, I send you a screenshot of this thing, and you look it over to make sure there are no empty pads. Doesn't take knowing the board, simply takes looking at it.
@lone axle https://docs.github.com/en/graphql/reference/mutations#updatetopics if the docs mean anything to you
I found help!
https://docs.github.com/en/rest/reference/repos#replace-all-repository-topics or this? dunno if we use rest or graphql usually
Thank you. testing a python API wrapper library now. I do notice that it seems replace all topics is currently the only option with the API. I'm not sure if we have existing topics or not. But if so we'll need to GET them, add the new one then save them back.
Any way to check if there are already topics?
I don't think there's anything consistent that we've done, but some might have them.
Yep, there is an API for getting topics as well
I'll make a script get the current ones and add Hacktoberfest to them then replace. So any currently existing ones should get kept. Any without current ones will end up with the one new one Hacktoberfest
Beautiful. Thank you so much!
that was weird, on my esp32 board (kaluga) circuitpython was crashing over and over again, reset button fixed nothing, but power cycling DID fix it. wonder what persists across the use of the reset button.
I've run into that too. I don't know the answer.
Build:Oct 25 2019
rst:0x8 (TG1WDT_SYS_RST),boot:0x9 (SPI_FAST_FLASH_BOOT)
Saved PC:0x4000f4d6
ESP-ROESP-ROM:eESP-ROESESPESP-ROM:esEESP-ROM:esESP-ESPESP-ROM:eESP-ESP-ESP-ROESP-EESP-ESP-ROM:eESP-ROM:esp32s2-rESPESP-RESESP-ROM:esp32s2-rESP-ROM:eESP-ROM:esESP-ESPESP-ESP-ROMESP-ROESP-ESP-ROESPESP-ROESP-ROMEESP-ROESP-ROM:esp3ESP-ESP-ROM:esESP-RESESP-ROESP-RESP-ROMESESP-RESP-RESP-ROMESP-ROM:esp32s2-ESP-ROM:esp3ESP-ROM:esp32ESP-ROMESPESP-ROESP-ROM:espESP-ROM:eESP-ROM:esp32sESP-ROM:esESESP-ESP-ESESPESP-RESP-ROM:esESP-ROMEESPESP-ESP-ROM:esp32s2ESP-ROESP-ESESPESP-ROM:espESP-ROM:esp3ESP-ROM:eESESP-ROM:esESP-EESESPESPESP-RESP-``` weird stuff in the serial monitor too
I reproduced it by flashing a project from esp-dev-tools and then flashing circuitpython
though .. this time, a power-cycle isn't fixing it either.
@idle owl I have a script working as proof of concept to add hacktoberfest topic to a repo but it seems I do not have access to do that on the real library repos. I get back a 404 response when I try on https://github.com/adafruit/Adafruit_CircuitPython_Display_Text but the same code succeeds as is on one of my own repos.
seems like not. I'm not sure what the level required is. Worth noting I don't see the gear icon near "About" on the repo pages, which is where the manual UI way to add topics is at.
I could prepare the scripts and they could be run with adabot or someone else's access token I presume.
So I guess you'll be walking me through it? 😅
Ok
Oh it needs a token!
That makes more sense. Not login credentials.
So far it's doing just a single repo, I'll expand it a bit to work with "foreach" in the bundle.
Well let's make sure it works.
So go to .. I don't remember where tokens are generated.
Found it.
@lone axle Ok so if I generate a personal access token here, I can provide that to you and you can still run the scripts yourself?
I believe so
This repo has the scripts that I have so far: https://github.com/FoamyGuy/CircuitPython_Repo_Topics
Trying to figure out what boxes to check here for this token
Thoughts?
box or box(es) I guess.
I did just the top level "Repo" one and it allowed me to fetch and add topics to my own repo.
Ok
DM'd you the token.
Ok @lone axle if it worked on one, I'm ok with deploying it.
Verified the one you linked.
okay cool. I'll work on expanding that script to run in the bundle with foreach. I'll let you know here when I am ready to run it on the rest of them.
Thanks!
if I have a library module for MicroPython and want to make it into a CP library, how do I do that? i'd assume forking CP, adding the lib, and seeing if it builds. Anything else I'd want to watch for?
@versed lark if it's coded in C then you'd need to work in a fork of circuitpython or micropython, starting at our main branch. If you work with both micropython and circuitpython then when creating your branches locally, and when creating your pull requests on github, you need to be attentive so that you start from an appropriate starting point and create the pull request in the right place. github doesn't let you have a fork of both micropython and circuitpython that are separate, because they are forks of each other already.
right.
on the other hand if your driver will be written in pure python, you want to start by creating a new library skeleton with "cookie cutter" https://github.com/adafruit/cookiecutter-adafruit-circuitpython
yup, sounds like that's what you need to do
if it's a working third party library that already exists in a MP fork, what then?
i.e., i could start with the MP fork i already have it in, or do a new cp fork
from time to time we merge micropython into circuitpython. we last did this with the previous release, we're one behind.
background: lvgl has an existing MP binding, a library module called lv_binding_micropython. in their example, it's a submodule of a MP fork.
i'd like to be able to use it in CP, with a driver that passes things through to displayio
we organize the C code for our modules differently than micropython, though, most things are split into a directory of the bindings to CircuitPython and a directory of "the actual code" (shared-bindings and shared-modules [if it's hardware-independent] or common-hal [if it's hardware-dependent])
@idle owl I think it's ready to run on the bundle. I'm going to start it up shortly. I've added 5 second delay on each library to hopefully avoid running into a rate limit. It'll take a few minutes to complete at that rate if it doesn't get interrupted.
someone did a CP version back in the 6.0rc timeframe, considering starting with that as well.
on the other hand, we do take some things in the micropython style of the "extmod" directories, like ulab
Ok, sounds good. Keep me posted.
we also have a style of documenting the code inline
i've seen that
Do you know what thing(s) stopped the previous 'port' from going into the core? if you can learn that history you might know what things are important to do / to avoid. I don't remember this history.
i don't think it was ever pursued to the end.
there's one forum post on the lvgl forums, and a repository that hasn't been touched in almost a year.
that's all i know so far.
I see.
i just really want to use lvgl under CP 🙂 so I figure I have to poke at it myself.
I'm not sure what would make a lvgl 'binding' something we'd merge into circuitpython, since we also have displayio. I'd recommend pinging @slender iron in public sometime when he's around, or joining us for one of our regular voice meetings, before getting to deep in it.
lvgl is one of those things I've never tried out for myself, it seems interesting though
.. afk ..
the main thing for me is graphing support.
and things like buttons with click handlers
not things that couldn't be done with raw displayio
but just the whole reinventing the wheel thing
okay, it's running. https://github.com/adafruit/Adafruit_CircuitPython_Ads1x15 and https://github.com/adafruit/Adafruit_CircuitPython_74HC595 are the first two that it added the topic to. Looks good to me on the live page. I'll keep an eye on the script output
@idle owl so far the only repos that have had any are a few that had a "circuitpython" topic. Since the API call that updates is technically a replace all, we have the opportunity to add whatever topics we want whenever we go to remove hacktoberfest at the end of the month. If there is any interest in adding "circuitpython" or anything else to all of them it would be easy to do that at the same time.
Yes. I think that would be great idea.
I think let's do circuitpython for now. I can't think of anything else that makes sense for all of them at the moment.
@idle owl script is finished "hacktoberfest" should now be a topic on all library repos. I uploaded the output as a file here: https://github.com/FoamyGuy/CircuitPython_Repo_Topics/blob/main/output_0.txt it shows the existing topics for each repo as well. There were a few with others beyond "circuitpython" most of the ones I saw were display drivers that had a few related topics. I haven't looked at the whole list yet. Later this week i'll prepare a new version that we can run at the end of the month.
Lovely, thank you so much!
you're welcome! I feel like I've gotten a good handle on how to automate scripts to run across all library repos. I've not messed with Adabot specifically too much but maybe it would make sense to add some documentation and a few useful helpers to that repo that detail the process I've been using.
Yeah it might be. We can look into it eventually.
This just occurred to me... in CI can we have things like pre-commit and Test all which show a diff after test fails, upload a patch file to artifacts to allow easier code correction.
@versed lark I know lots of folks like lvgl. I'm not sure how it would interoperate with displayio though.
the stuff i've seen supposedly has a lvgl driver that just passes things through as displayio calls.
i've not found or seen that code yet though
👍
i'm going to continue digging for now. fighting git at the moment. 😉
@slender iron looks like it's a little too invasive for my taste. in particular, adding a call to to supervisor_background_tasks() to give lvgl it's update tick. not something that can be enabled if the lvgl binding isn't there. so probably not workable as an installable library. 😦
we could merge it into main for boards that have the space
@spencer-burke We're happy to guide you on our Discord: https://adafru.it/discord
Please post a zip of all files on your CIRCUITPY drive so we can reproduce it.
Please note that SAMD boards without USB shouldn't be advertised as running CircuitPython (a CircuitPython-compatible is ok) because they won't have BLE or USB workflow support.
I'd assume this is due to the time needed to refresh the 240x240 pixels in the first tile.
@gilded cradle This page desperately needs to be updated. The image should be the Driver board, and there's product copy for the driver board now. https://circuitpython.org/board/adafruit_led_glasses_nrf52840/ As it is, it's confusing, especially since the guide I'm writing is for both the LED Glasses Panel and the Driver board. 🙂
@Gadgetoid Don't forget to mark this as ready when it is.
@idle owl, good catch.
Thanks. I'm already worried about folks trying to install CP on the Glasses panel because it's all one guide, and this might have made that more likely. 😄
I've gotten the process down where updating/adding Adafruit products is pretty easy. It's the 3rd party ones where I need to hunt down info that are difficult.
Ah that's good then.
One request. Thanks for continuing this work.
Please rename this. It isn't clear what it is doing from the name.
Thanks for the PR!
I think you'll want to dig into the hard fault status register (HFSR) which could give you a better clue to the fault. This is a good reference for further hard fault debugging: https://interrupt.memfault.com/blog/cortex-m-fault-debug
Don't delete: ports/espressif/certificates/nina-fw
What is this flag and why do you need it?
@gilded cradle Looks great! Verified the page. Thanks for the update!
@gilded cradle I can't test that libgpiod PR, but I'm happy to approve it if you feel it's good to go. Not sure if you needed someone to test it.
Yeah, I tested, it should be fine.
Got it.
Thanks
@tannewt thank you for that link! Very helpful. I'll dive into this next.
Don't delete: ports/espressif/certificates/nina-fw
This occurred when I cherry-picked Lucian's commit. How do I restore it (submodule directory).
This is how TimeAlarm wakes from fake sleep.
- During setup of the time alarm, I make a call to
port_interrupt_after_ticks()which sets the CMP0 interrupt. - In the event of fake sleep,
main.pyeventually loops thru ['common_hal_alarm_pretending_deep_sleep()'](https://github.com/adafruit/circuitpython/blob/6811c5e88147701553fd1350f5be...
They are not as common as other types, but encoders with a half cycle per detent do exist and I have actually picked up a few recently.
With the current rotaryio they only advance once every 2 clicks.
It would be nice to be able to support them with an option in the constructor.
We support rotary encoders that do Gray code output (the two outputs change alternately). This allows reliable detection of transitions without debouncing. I don't know about yours, but perhaps it does Gray code every other click. A link to the datasheet for yours would help us figure it out.
I've managed to find the original (chinese) documentation, and indeed it is a half-cycle encoder (30 detent, 15 cycles).
https://img.alicdn.com/imgextra/i4/2452639374/O1CN015RoFrP2J7LDRRvmY3_!!2452639374.png
To properly support it, it needs to output on both 00 and 11 states, not just 00.
woohoo...! we have 3000 closed PRs in CPY Core 🥳 
CircuitPython version
master branch
Code/REPL
none
Behavior
none
Description
The latest version pyocd remove pyocd-tool and pyocd-flashtool, after create firmware, I can't flash it on to mcu board using param FLASHER=pyocd.
Additional information
I manage to migrate to latest pyocd's syntax , but I can't translate this sentence
pyocd-tool -t $(MCU_VARIANT) write32 $(BOOT_SETTING_ADDR) 0x00000001
I have done similar migration ...
… in #4520
Changes to be committed:
modified: shared-bindings/supervisor/init.c
I have made a change and created the pr, if you would like me to write some tests of some kind I would be happy to.
Problem has been solved. The UF2 Bootloader must be completely reinstalled to update all partitions.
https://github.com/adafruit/circuitpython/issues/5426
@Gadgetoid Don't forget to mark this as ready when it is.
I had checked in a couple of times and completely failed to notice it was still in draft form, thank you!
Thanks for the PR @spencer-burke.
I don't think this resolves issue #4520. The stack size is set on the next VM run so with the function call there isn't a way to confirm whether the requested stack_limit is used or the default_limit is used.
I think changing the function name to something more appropriate like set_next_stack_limit_maybe should be enough here. This will result in a breaking change and the PR will have to be considered for 8.0.0 rather than merging it now
Is it possible to point board.STEMMA_I2C() to board.I2C(1)? This way we can have board.BUS(instance) at the board module level and board specific names matching silk screen or documentation can be set in the board's config file.
Is it possible to point
board.STEMMA_I2C()toboard.I2C(1)? This way we can haveboard.BUS(instance)at theboardmodule level and board specific names matching silk screen or documentation can be set in the board's config file.
That is certainly be possible. I assume you have some specific use case in mind, probably for your own boards. Could you describe how you want to describe number multiple buses?
nice catch! We're at 2736 merged pull requests, hitting 3k there will be another cause for celebration. https://github.com/adafruit/circuitpython/pulls?q=is%3Apr+is%3Amerged
This allows easier code correction if pre-commit is not setup in contributor's local environment.
Note: Setting up pre-commit locally is still highly recommended and this is only intended for quick fixes.
this is kinda more like a motor encoder than a rotary encoder (rotary encoders are a subset of motor encoders that can stop at any point)
Just received my OV5640... new toys!
@solar whale yay! I've got the basics working over here but it's not ready for prime time
Absolutely no rush 😉
can someone remind me the make argument for low (no) gcc optimization? I can't seem to find it
Found it. You can add to your CFLAGS like this make CLAGS+="-Og" BOARD=
you can also mess with the options in the makefile. That's what I usually do
@onyx hinge I have a question about subclassing, or inheritance or whatever it's called.
go ahead
This PR is failing because of duplicated code. https://github.com/adafruit/Adafruit_CircuitPython_HT16K33/pull/89/files Couldn't they inherit from the Segments class or whatever it is when you have Classname(OtherClassName) and then have it all available, or some such?
Or because everything in segments is already pulling from another file, not so much?
I think you'd have to create a base class with those things, then have Seg14x4 and Multiple14x4 inherit from that base class
so yes, the thing you said
But creating a base class is a breaking change for everything else, right?
I'd also request that this comment be changed, the code works or does not; there is no 'try' """Class to try and drive multiples of Alpha-numeric, 14-segment displays."""
Good call.
nah I don't think it should be a breaking change
Ok fair enough.
sorry for the star wars reference
It's ok. I'll give you that one.
@onyx hinge Are you going to do a full review? With the suggestion of a base class? Because I was going to try, but it would have been pretty bad. I would have fumbled through it.
I wasn't really planning to 😕 but I can if you need me to
I'd really appreciate it 😕
You can blame me for it so I'm tagged on it as well.
@tulip sleet Question. I'm doing the guide for the LED glasses driver board, and I'm trying to figure out what Arduino stuff applies. Do you have some idea of which of these examples make sense for that board? The only pins broken out are SWD and a STEMMA QT connector. So it's kinda specialised. (I'm making assumptions about what you might know because of your BLE work in CP... I realise you may not have an answer for me.)
Pulling from Feather Sense guide: https://learn.adafruit.com/adafruit-feather-sense/arduino-ble-examples
BLEUART is over the air, so lack of pins doesn't matter. and the BLE Pin I/O could work on just the STEMMA connector pins too. So I'd say it's all relevant.
Ok great. Thank you.
The nRF52 lets you pretty much doing anything with any pin, so no need to worry about "this pin is only I2C"< ec.
yah, cpx is a good exmaple
Where's the best place to suggest a variant of a product? (Metro ESP32-S2 with no headers, so it could have user-installed stacking headers or terminal blocks or other, and not obscure the antenna with a shield)
@crimson ferry https://www.adafruit.com/contact_us has "suggest an item for us to stock", not quite what you're suggesting but close
Adafruit Industries, Unique & fun DIY electronics and kits : Contact Us - Tools Gift Certificates Arduino Cables Sensors LEDs Books Breakout Boards Power EL Wire/Tape/Panel Components & Parts LCDs & Displays Wearables Prototyping Raspberry Pi Wireless Young Engineers 3D printing NeoPixels Kits & Projects Robotics & CNC Accessories Cosplay/Costum...
@opaque musk I submitted the PR's needed to add the MacroPad to work with u2if and Adafruit_Blinka. There are a couple of downsides right now. First, the display isn't currently supported in adafruit_blinka_displayio (https://github.com/adafruit/Adafruit_Blinka_Displayio/issues/54) and Adafruit_Blinka doesn't support rotaryio.
that's ok. that's all mostly external to blinka/platform/u2if. expect for maybe rotaryio. but in general, doesn't need to be a concern for adding the new support. those could be follow up efforts.
the firmware will simply provide i2c access. it won't do anything oled specific.
@onyx hinge or @tulip sleet What's the VIM binding to get to the end of a line?
I guess I could have looked that up. I was already typing into Discord.
Wait, it's $? Really?
Wait, seriously?
all the usual keys work
🤦🏻♀️ oi.
I genuinely did not know that.
I know 0 to get to the beginning of the line, and dd to delete the whole line. And i to get back to editing mode.
That's pretty much it.
it's a good start
I also know "gg" to get to the beginning of the file and "G" to get to the end
and :linenumber to get to the specific line
I used to know how to get to the beginning of a file, highlight all, copy, and paste. That was how I used VIM..... I copied things out of it, did something in a different editor, and then pasted it back in. 😄
But I have since forgotten that set of commands.
same, except vi
oh, do you know about v and V?
V is for selecting lines, v is for selecting characters
My bash has VIM bindings. So file manipulation isn't needed for my major use case at the moment.
It's moving around command lines.
then you can either cut them with d (delete), or copy with y (yank)
Huh. Nice.
and p is paste, of course
P is paste before the cursor
so, ggVGy is "copy whole file"
That! yes
but you could also do ggyG to do the same thing without selecting everything first
because y and d take a movement command to select the other end
I often do "dw" to delete a word or "cw" to delete it and enter insert mode to replace it
Carter any idea why the CI is failing on the PlatformDetect. I didn't change any of the lines of code that are failing PyLint. It passes 10/10 when I run pylint locally.
I had an older version of pylint
@gloomy shuttle wrong ping just fyi
looking at ci now...
or...running latest push and will see what happens
whoops
hmmm. guessing new "fun" because new pylint version.
really? open doesn't have a default encoding?
pylint complained about it
yah. but why? why now?
Is Pylint not pinned on Blinka?
Using open without explicitly specifying an encoding It is better to specify an encoding when opening documents. Using the system default implicitly can create problems on other operating systems. See https://www.python.org/dev/peps/pep-0597/
It must not be
Hmm. That's something to consider. We have it pinned on all the libs and such.
I kind of hate pinning it, but ... eh.
oh. it can vary between platforms i guess.
this is on Adafruit_Python_PlatformDetect not Blinka
@idle owl would pinning happen here?
https://github.com/adafruit/Adafruit_Python_PlatformDetect/blob/00db106377a995dccd89c36796c36019ee3a72cd/.github/workflows/build.yml#L38
Chances are Pylint added something then, if it's not pinned. And that's why it would start failing now.
Not pinned.
Would have to be --force-reinstall pylint==2.7.1 or whatever.
So it's definitely running latest on that repo.
yah, so probably like that new consider-using-super-happy-new-fun-other-new-different-print gripe we ran into.
I would bring Melissa in on it, but it's definitely a valid option.
yah. that's what i'd suggest also.
@gilded cradle Are you ok with us pinning Pylint on PlatformDetect?
Same as Blinka, and the libs.
Did you fix the issue?
Is that what you're asking about reverting?
I did fix the issue that pylint was complaining about.
Oh, excellent. Ok. I would not recommend reverting. But we can still consider pinning.
but it was code unrelated to PR
Unless you simply disabled it in which case, it might complain if we pin it.
no, I corrected it but it was unrelated to the PR
I don't mind that it's unrelated. It will future proof the code for when we update Pylint again.
Or pin and revert. I am ok with either.
But let's get Melissa's final opinion on it before doing it.
@gloomy shuttle @tidal kiln Is that alright?
yep
Great.
Sure
There we have it!
Ultimately I'd like to get it on pre-commit, but haven't had time to update it to that.
@gloomy shuttle Up to you whether you want to revert or not. I'm ok either way.
Yes, it is possible that the change could break it depending on system because:
open() instead uses your environment to choose an appropriate encoding:
I'll revert for now thanks!
Thank you for sticking with this!
is the pinning just the one line change in the yaml?
Yes. Adding that ==2.7.1 to pylint on the install line.
so could either PR that real quick, or have jfurcean sneak it in as part of their PR.
yep. think so.
I'm sure they're up for it, with everything else they've already done with this PR 😄
@gloomy shuttle got it? revert changes to open. update yaml to pin pylint. push those changes.
I just prepared a separate small PR to pin pylint because I wasn't sure if the build.yml would apply before it was merged. I hope that is okay.
Sure, no worries. @tidal kiln Handle the pinning PR first, obviously.
@tidal kiln sorry about that and thanks! I am about to head out, but I will get that other PR reverted later and wait on dan for the PID.
Yes, this does seem to be a duplicate of at least part of that earlier issue (though that one seems to be muddled with people reporting unrelated problems.
FWIW, the encoder I'm trying to use is supposedly an exact replacement of the one used in Panasonic car stereo volume knobs, so its definitely being purposed as a regular rotary encoder.
Looking deeper I see that rotaryio is implemented per-architecture which seems to make this a major undertaking.
Alright, I will revert the changes I have made, and change the function name.
The M60 Pin Configuration had missing pins to allow for Battery monitoring.
These match the documentation from makerdairy wiki
@tidal kiln mind looking at https://forums.adafruit.com/viewtopic.php?f=60&t=183614?
circuit_python_feathers2_crashing.zip
Here's the zip that contains a single folder lib. In that folder, I've been able to reliably reproduce the crash by changing the name of the adafruit_binascii lib to adafruits_binascii (something that ensures it's not importable). Once I do that, I can from the REPL run from adafruit_gc_iot_core import MQTT_API, Cloud_Core and it will crash. Once it...
@slender iron responded. i got it from here. doubt it's anything cp related.
thanks!
np
I think it'd be simpler if you just always called timer_callback and then had it check sleep state internally. As-is, the global nature of SAMD_ALARM_FLAG makes it hard to follow.
Don't delete: ports/espressif/certificates/nina-fw
This occurred when I cherry-picked Lucian's commit. How do I restore it (submodule directory)?
I think you'll want to rebase and fix the commit that originally removes it.
Don't delete: ports/espressif/certificates/nina-fw
This occurred when I cherry-picked Lucian's commit. How do I restore it (submodule directory)?
I think you'll want to rebase and fix the commit that originally removes it.
Two more small things. I think it's important to say that you are getting a free I2C num.
i2c_port_t peripherals_i2c_get_free(void) {
Make sure you are using the main branch, not master.
What version of pyocd are you using?
As @microDev1 points out on the PR:
I don't think this resolves issue #4520. The stack size is set on the next VM run so with the function call there isn't a way to confirm whether the requested stack_limit is used or the default_limit is used.
So, I don't think this is possible. Sorry about the confusion @spencer-burke.
@onyx hinge here is a sample typing PR: https://github.com/adafruit/Adafruit_CircuitPython_SSD1306/pull/69
Okay, @microDev1 pointed out that the function name should maybe get a change. Would you still like me to do that, or should I just leave it.
I think we should leave it as-is. Sorry!
I don't think it's helpful to return the passed in value. Thanks for the PR anyway!
Looks good! Checked over the special cases for various modules, and they look faithfully redone.
This looks fine. I didn't test anything.
The test failure is due to the following modules now appearing in the "unix" build, in addition to their u-prefixed forms: 're', 'json', 'binascii', 'errno'. I think this is fine, and the .exp file for this test should simply be updated.
Force pushed to fix a translations issue.
Given the fact that esp now connects in milliseconds and wifi takes 6-7 seconds battery life for deep sleep etc. will be greatly extended. My application is for wands for my grandchildren that control leds.
The "scale" parameter wasn't exposed in the library, and there
were some problems in how it was handled.
This also fixes some types in the pixel-drawing functions.
I think that the
2(n_args_min) means that 2 positional (non-keyword) arguments are required, according to mp_arg_check_num_sig. Since all the arguments besidesselfcan be given as kwargs, it should be1instead.
That makes sense. I think various of us misinterpreted n_args and n_args_min to mean all the args, not just the positional args. The names would be better as n_pos_args_min, but the other naming is pervasive. I'll vet these values everywhere.
I borked the board ID for our new Swan board and noticed today that it's being pushed to S3 as swan_r5. this is all I need to fix in order to account for that, correct?
I think you should change the markdown filename to match as well. It all stems from the folder name in CircuitPython.
Can do, thanks @tannewt
Done @tannewt. Went ahead and updated the image files as well.
- Fix #5407.
- Correct some signatures in
busioandbitbangio. - Allow more args to be specified with keywords in
socketpooland `storage.
#5407 and #5405 discovered that some routines and methods were requiring positional-only args for some required arguments. I think this was mainly a misunderstanding of what n_args_min in MP_DEFINE_CONST_FUN_OBJ_KW(obj_name, n_args_min, fun_name) meant. Thanks to @jepler for pointing this out. n_args_min here means the minimum of _positio...
Thanks! This is extensive, I don't know that I can fairly review it but I'll try.
that actually went faster than I thought. No testing performed, one potential nit raised.
This isn't valid Python but if it's accepted by mypy it's fine. Otherwise, maybe sys.maxsize could be used, and it's closer to accurate.
mypy doesn't like it, so I will fix:
$ mypy circuitpython-stubs/busio/__init__.pyi
circuitpython-stubs/busio/__init__.pyi:260: error: Name 'buffer' is not defined
circuitpython-stubs/busio/__init__.pyi:274: error: Name 'buffer' is not defined
circuitpython-stubs/busio/__init__.pyi:292: error: Name 'buffer_out' is not defined
circuitpython-stubs/busio/__init__.pyi:294: error: Name 'buffer_in' is not defined
@onyx hinge I changed to sys.maxsize. mypy complains on the stubs still:
$ mypy circuitpython-stubs/*/__init__.pyi
circuitpython-stubs/busio/__init__.pyi:104: error: Name 'sys' is not defined
circuitpython-stubs/busio/__init__.pyi:125: error: Name 'sys' is not defined
circuitpython-stubs/busio/__init__.pyi:149: error: Name 'sys' is not defined
circuitpython-stubs/busio/__init__.pyi:151: error: Name 'sys' is not defined
circuitpython-stubs/busio/__init__.pyi:260: error: Name 'sys' is not defined
...
but I'm not sure that's significant
might have to write import sys in the doc-comment?
or change tools/extract_pyi.py to automatically print it in, like it does for things from typing
there is this in circuitpython-stubs/setup.py: STD_PACKAGES = set(('array', 'math', 'os', 'random', 'struct', 'sys', 'ssl', 'time'))
not sure what that is for
that avoids installing our stubs for those modules that are standard in Python
there's magic in extract_pyi to figure out what needs to be imported for the annotations, but not for the default values
yes, I was looking at it, and I don't think it will see the sys, so maybe I always have to add it
you can write import sys just above the def that refers to sys.maxsize, that'd be the shortest thing
I don't think the import sys line would appear in the docs, but I could be wrong
elif isinstance(node, ast.Assign):
collect_annotations(node.value)
I'd think this would pick up the right side of the assignment?
but it doesn't apparently
maybe it's an AnnAssign
>>> print(ast.dump(ast.parse("def foo(a: int = sys.maxsize): pass"))
... )
Module(body=[FunctionDef(name='foo', args=arguments(posonlyargs=[], args=[arg(arg='a', annotation=Name(id='int', ctx=Load()), type_comment=None)], vararg=None, kwonlyargs=[], kw_defaults=[], kwarg=None, defaults=[Attribute(value=Name(id='sys', ctx=Load()), attr='maxsize', ctx=Load())]), body=[Pass()], decorator_list=[], returns=None, type_comment=None)], type_ignores=[])
your solution is easiest; otherwise we'd have to interpret the default value expression
that actually went faster than I thought. No testing performed, one potential nit raised.
Changed to sys.maxsize, and had to add import sys to satisfy mypy. Also changed the wording from Default is len(buffer) to If not specified, use len(buffer), to avoid some confusion about the implied default.
I see a bunch of this typing PRs coming in, is there a good editor to test them on? I just use Mu normally. I can check visually otherwise
@lone axle ^^
They can be seen in PyCharm. I would guess VSCode as well, but no experience with it myself.
Thanks @lone axle . I have VSCode so I'll take a look just to see too or PyCharm
in pycharm hovering on a usage of something will pop up something like this.
ctrl + hover shows a more concise version as well.
I will try that out. Figure you manage to get all those issues filed you shouldn't have to review all the PRs too!
You missed an if None here.
I'm not thrilled about the phrasing. I know exactly what buffer[start:end] does, including if end == sys.maxsize but I do like that the docs are working to explain what happens without assuming advanced knowledge of how slicing works.
Maybe:
The default value causes the buffer to be used all the way to its end
which then suggests the doc could also say about start:
The default value causes the buffer to be used from its start
You could ...
@onyx hinge there are a lot of place where that start/end stuff is documented. Befor I push another commit, how do you feel about this rewrite? This is for the most complicated case:
//| """Write the bytes from ``out_buffer`` to the device, then immediately
//| reads into ``in_buffer`` from the device.
//|
//| If ``out_start`` or ``out_end`` is provided, then the buffer will be sliced
//| as if ``out_buffer[out_start:out_end]`` were passed, but without copying the data.
//| The number of bytes written will be the length of ``out_buffer[start:end]``
//|
//| If ``in_start`` or ``in_end`` is provided, then the input buffer will be sliced
//| as if ``in_buffer[in_start:in_end]`` were passed,
//| The number of bytes read will be the length of ``out_buffer[in_start:in_end]``
//|
//| :param bytearray out_buffer: buffer containing the bytes to write
//| :param bytearray in_buffer: buffer containing the bytes to read into
//| :param int out_start: beginning of ``out_buffer` slice
//| :param int out_end: end of ``out_buffer`` slice; if not specified, use ``len(out_buffer)``
//| :param int in_start: beginning of ``in_buffer`` slice
//| :param int in_end: end of ``in_buffer slice``; if not specified, use ``len(in_buffer)`````
in the simpler read/write case it's one or the other, and I don't bother to backtick the buffer name
//| The number of bytes written will be the length of
out_buffer[start:end]
This one should be[out_start:out_end]
to make it easier to read
starting with a nit..
yes, I've fixed them all several times already 🙂
I don't feel I need to explain slicing omitting the end; that's a python thing
it is in busio I2C and SPI, bitbangio I2C and SPI and I2Device
the memory allocation comment is superfluous when writing to the buffer, so I took that out in those cases
also the mentions of bytearrays should be ReadableBuffer or WriteableBUffer
I think it's fine, I didn't spot any more real technical problems. I wouldn't state it all in exactly that way, but then such is the nature of doc & code
yes that would be nice to fix while you're there
you write with a ReadableBuffer, and readinto a WriteableBuffer (Some of them were backwards)
//| :param bytearray out_buffer: buffer containing the bytes to write you changed it down here too?
now
//| :param ReadableBuffer out_buffer: buffer containing the bytes to write
//| :param WriteableBuffer in_buffer: buffer containing the bytes to read into
👍
I2C uses in_buffer and out_buffer; SPI uses buffer_in and buffer_out 🤦
is it like US english versus UK english ? 😉
oops
not gonna change the arg names now
I don't suppose those were unusable names before this change
because of the wrong argument number
maybe so, I'll check, what an excuse
@onyx hinge, well, for I2C, in_buffer and out_buffer were unusable (3 pos args specified). for SPI, only 2 pos args were specified, so buffer_out had no keyword, but buffer_in did
jepler@bert:~/src/circuitpython$ git grep MP_QSTR_in_buffer
shared-bindings/adafruit_bus_device/I2CDevice.c: { MP_QSTR_in_buffer, MP_ARG_REQUIRED | MP_ARG_OBJ },
shared-bindings/bitbangio/I2C.c: { MP_QSTR_in_buffer, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} },
shared-bindings/busio/I2C.c: { MP_QSTR_in_buffer, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} },
jepler@bert:~/src/circuitpython$ git grep MP_QSTR_buffer_in
ports/raspberrypi/bindings/rp2pio/StateMachine.c: { MP_QSTR_buffer_in, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} },
shared-bindings/bitbangio/SPI.c: { MP_QSTR_buffer_in, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} },
shared-bindings/busio/SPI.c: { MP_QSTR_buffer_in, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} },
``` half-half
There are no examples in the bundle of people specifying either choice as a keyword arg
I like in_buffer better than buffer_in
if you want to wink at the compatibility rules and change it, it's fine by me
you'll get back 15 bytes or something from reduced qstrs
I think no one ever used thes
because the 2 pos args of SPI would have been extremely confusing
I think I will make them all in_buffer and out_buffer
i've found a bunch of other typos as well
@tulip sleet thanks! I'd better wait until tomorrow to review it, my attention to detail is not great. ping me if I let it go long. I'll also wait for scott's reaction to the inconsequential incompatible change.
I am writing up a comment for Scott
This is like the most nit-picking copy-editing I have ever had to do with the doc.
@tannewt Correcting the doc revealed that I2C was using in_buffer and out_buffer for the write_readinto(), and SPI was using buffer_in and buffer_out. However, because of the original bugs this PR fixes, the I2C keywords were not usable at all, and for SPI, only the second buffer arg could be specified with a keyword.
I found no uses of any of these keyword args in the bundle. @jepler and I discussed it briefly, and I made the SPI ones match the I2C ones: in_buffer and `out_buf...
As some wiki I once used said after every edit, your attention to detail is appreciated.
I think it is now time to practice a plucked string instrument
Can someone please help, I have latest CircuitPython 7.0 (downloaded 8-Oct-2021) and MU 1.1.0beta5
I want to make a simple analog data logger on Matrix Portal M4 using a while loop and analogio.AnalogIn
I get the ValueError A1 in use
Here's the code with no while loop but A1 value request twice, the second time causes the issue.
I through in some prints and a sleep in case there needed to be time to reset the pins.. please help
import analogio
import board
import time
from board imp...
Can someone please help, I have latest CircuitPython 7.0 (downloaded 8-Oct-2021) and MU 1.1.0beta5
I want to make a simple analog data logger on Matrix Portal M4 using a while loop and analogio.AnalogIn
I get the ValueError A1 in use
Here's the code with no while loop but A1 value request twice, the second time causes the issue.
I through in some prints and a sleep in case there needed to be time to reset the pins.. please help
import analogio
import board
import time
from board imp...
You do not need to do adc1 = analogio.AnalogIn(A1) each time you want to read A1. Instead, just create adc1 once, and then use adc1.value each time you want to read the value.
Here is a loop that will read from A1 and A2 in succession, over and over.
adc1 = analogio.AnalogIn(A1)
adc2 = analogio.AnalogIn(A2)
while True:
print("Hello 1")
val = adc1.value
print(val)
print("Hello 2")
val = adc2.value
print(val)
time.sleep(1)
More...
@martingosnell Answerd in #5440.
As I was creating a new nRF52833 board, I saw that the nRF52833 DK (PCA10100) MICROPY_HW_BOARD_NAME is incorrectly defined as a Dongle and not a DK.
Both the (CircuitPython Org](https://circuitpython.org/board/pca10100/) and [Nordic Semiconductor]((https://www.nordicsemi.com/Products/Development-hardware/nrf52833-dk) sites indicate DK (for development kit)
LGTM! Thanks @jpconstantineau.
@tannewt is there a doc somewhere to describe how you see the coredump (or whatever the equivalent is for a microcontroller)? I'd be interested to take a gander at what's happening under the covers!
This PR is for a new variant of the Seeed XIAO targeted for users wanting to build keyboards.
Before merging this commit, I would appreciate comments on the modules added and removed. I would like this to be generic enough so that many people can use this variant without the need to revert to the original one or having to create new ones.
Selection of the modules is governed by the following criteria:
- Selected modules must fit on samd21 flash space
- keyboards have "local" i...
I cannot reproduce this problem, using the code above in the REPL. The blue LED stays on when I create the PWMOut, and continues to stay on even when I vary the .duty_cycle.
Do you have something connected to the A0 pin, like a buzzer or a speaker? If it's drawing too much current, it can affect the state of other pins. Are there other cthigns connected to the board?
it's weird that https://github.com/adafruit/circuitpython/pull/5442/checks?check_run_id=3839103958 ran for all boards, even though just files for a single (new) board were modified.
The list of modified files detected by that action seems right,
Invoking listFiles(pull_number: 5442, page: 1, per_page: 100)
Received 4 items
[added] ports/atmel-samd/boards/seeeduino_xiao_kb/board.c
[added] ports/atmel-samd/boards/seeeduino_xiao_kb/mpconfigboard.h
[added] ports/atmel-sa...
Thanks, I didn't spot any problems. Hope this is the last round of doc fixes, thanks so much for taking the time to get it right.
Currently, unless we recompile CircuitPython, we have to use "CircuitPython HID" for things like a game controller.
I'd like to be able to rename that, if at all possible.
I could reproduce it with a NRF52840 Feather Express, from code.py or the REPL. Nothing connected to the board, just female headers soldered to the pins. I also tried with an LED on the PWM pin to check it does its thing, and a few different PWM pins.
Then, I updated the bootloader from - I think it said 0.2.1 - to the latest (0.6.2), and that solved it. Then I downgraded to the earliest version I could find (0.2.5) and the issue came back.
@Neardoc Thanks - I would not have thought of trying that. @tahunus could you update your bootloader?
https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather/update-bootloader
@dhalbert Thanks for fixing the inconsistency. I'm ok with the minor breakage.
@geudrik Your help would be awesome. ESP32-S2 is a bit trickier than the Cortex-Ms. Generally I build CircuitPython with DEBUG=1 on the make line. It'll then output debug serial to UART0. On a crash, this may include a Backtrace: line that can be used to get a call stack.
I don't know of a doc for ESP32-S2 debugging. I'd encourage you to join the Adafruit Discord and get help from us in #circuitpython-d...
@lone axle since you've been driving most of this (it seems) I wanted to ask if there was a discussion about adding Type Hints to the libraries you could refer me to (maybe it was in the weeds the week with the bad audio?).
I have zero objection to it, just wanted to understand the thinking and learn more about the approach.
There was some discussion in the weeds, I'm not certain which week it was. Motivation for it from my end was two-fold. It helps make the IDE experience (I tend to develop mostly in PyCharm) more pleasant because it's able to offer up better suggestions for various things. And secondly it provided lots of "good first issue" type fodder for hacktoberfest when we knew we'd have an influx of folks looking to contribute.
OK, I was thinking there was some CP related feature coming. Got it.
Scott mentioned at one point and I definitely agree it can be very helpful for smartphone based editors as well because suggestions can be easy to press buttons and take away lots of the actual typing which is not so fun on mobile keyboards.
All of the typing information is ignored by circuitpython microcontrollers themselves. Primarily just provides QoL for development in environments that support it.
OK, all good stuff to learn more about. Thank you! 🙏
And I didn't think to search the weekly repo till now.
https://github.com/adafruit/adafruit-circuitpython-weekly-meeting/search?q=type+hints
@tidal kiln So... for this seesaw board. I noticed the built-in LED is backwards. It's lighting up when set to False and turning off when set to True which according to the comments in the code, is backwards.
Does it need a different pin_mode or something? I only see OUTPUT and three versions of INPUT. So that probably isn't it.
looks like that's just how it's wired
ah oki
That's going to be a bit confusing, maybe, but oh well.
Got NeoPixels working, time to find a button and some bare LEDs.
@tidal kiln I hooked up a button, and it's doing weird things.
It's like the pin is floating or something?
yah. could be.
The proof is in the execution here. Is there enough space in the 64kB CIRCUITPY to fit a reasonable keyboard program? Do you have an existence proof? Thanks.
I'm getting this: ```
True
False
True
True
False
True
True
False
True
True
False
True
True
False
True
True
True
When doing nothing with the button
If I press the button, it goes all False.
I'm confused.
Tried it with and without a software PULLUP.
No difference.
you're using CP lib?
yes.
ok, let me change to that. one sec.
digitalio.DigitalIO
Thanks
Current working code: ```py
import time
import board
from adafruit_seesaw import seesaw, neopixel, digitalio
seesaw = seesaw.Seesaw(board.I2C())
seesaw.pin_mode(5, seesaw.OUTPUT)
pixels = neopixel.NeoPixel(seesaw, 19, 12)
pixels.brightness = 0.2
switch = digitalio.DigitalIO(seesaw, 0)
switch.switch_to_input(pull=seesaw.INPUT_PULLUP)
led = digitalio.DigitalIO(seesaw, 12)
led.switch_to_output()
while True:
print(switch.value)
seesaw.digital_write(5, switch.value) # turn the LED on (True is the voltage level)
time.sleep(0.2)```
Haven't done anything with the external LED yet, only did setup code.
And looking at it, I'll probably need help with that. There's no example of how to PWM an LED that I see.
Tried different pins with the button, no change.
In case pin 0 was weird.
This issue persist in v7.0.0 for me. Any ideas what it could be?
hmm, seems like I should be able to PWM it on this pin, but it's saying no.
Says invalid pin, product copy says I am right.
5 x 8-bit PWM outputs - pins 0, 1, 9, 12, 13
I'm on 12.
Good Point... I have everything here already tested and working for a 9 key and rotary encoder macropad...
Had to get a "keyboard" library "precompiled" as a mpy
The cope.py code is similar to the adafruit macropad with the keymap in a py file a subfolder.
I tested this about a month ago (was waiting for the PID for a while). I'll get a fresh uf2 on there and see if anything changed (doubt it).
I think the library needs a pin map for this board.
Yup.
OK, going to try to add this as well.
@idle owl try this:
import time
import board
import digitalio
from adafruit_seesaw.seesaw import Seesaw
from adafruit_seesaw.digitalio import DigitalIO
ss = Seesaw(board.I2C())
button = DigitalIO(ss, 0)
button.direction = digitalio.Direction.INPUT
button.pull = digitalio.Pull.UP
while True:
print(button.value)
time.sleep(0.2)
wth?
It works.
My code should be the same.
Works like that for digitalio in CP as well.
Which I thought this emulated.
now try this:
import time
import board
from adafruit_seesaw import seesaw, digitalio
ss = seesaw.Seesaw(board.I2C())
button = digitalio.DigitalIO(ss, 0)
button.switch_to_input(pull=ss.INPUT_PULLUP)
while True:
print(button.value)
time.sleep(0.2)
I had several of these to test:
0.2.6 - not OK
0.2.9 - OK (two samples)
0.2.13 - OK
So it seems consistent. I did not try other versions of firmware in between.
All over the place again.
wait
now it's .. no it stopped bouncing for a bit there, but I pressed and released, and it's back to bouncing.
Do you think it is usable for a full-array keyboard with features (KMK won't fit, I assume, but some subset of it might). Or are you targeting macropad-style applications?
huh.
it's not actually setting pullup with second approach
seems like that was the intention
Ok
With 11 GPIOs, the largest matrix the Xiao could have would be 5x6 or 30 keys. I haven't tested for that large.
My current test bed is a macropad that looks like the CNCEncoderpad. The encoder sends reports so fast that the QMK tester detects it as chattering...
I could use one of my gherkins and bodge a few wires between the PCB and the Xiao to see if it works fine....
@tidal kiln I tried my hand at making the pinmap file. And there's no "pid" to check for the ATtiny, so I made it check the HW_ID I added earlier, and it worked (I did a test print inside the place where it chooses the right pinmapping, and it did), but it's still saying invalid PWM pin. Any suggestions? Or should I shelve this until next week. Probably shelve it. Bleh.
Anyway, thanks for your help with this. I'm off on Monday so I'll be picking it up Tuesday.
oh. one sec. i missed the PWM discussion...
OK
how were you getting error?
Created a PWM pin, which worked, and then tried to set pwm.frequency or pwm.duty_cycle and that line throws ValueError: Invalid PWM pin
Adafruit CircuitPython 6.3.0 on 2021-06-01; Adafruit QT Py M0 with samd21e18
>>> from adafruit_seesaw import seesaw, pwmout
>>> import board
>>> ss = seesaw.Seesaw(board.I2C())
>>> pwm = pwmout.PWMOut(ss, 12)
>>> pwm.frequency = 4000
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "adafruit_seesaw/pwmout.py", line 32, in frequency
File "seesaw.py", line 372, in set_pwm_freq
ValueError: Invalid PWM pin
>>>
Yeah. You don't have the necessary pinmapping file
That is expected for you for sure
I created a pinmap file, and added a check for it into seesaw.py.
But it's still not working.
The check I added works, it is trying to use the right file
but I guess I did it wrong or something?
but you're getting same error still?
Yes.
upload your pin map file
hmm....zip
Wasn't sure if it would let me upload a .py as long as seesaw anyway without complaining.
hmm.
The one digit numbers matched in the SAMD09 mapping
so I thought two digit numbers were also the same
Ok
the pin is 12 in decimal
_PWM_3_PIN = const(0x0C)
or that
same for the other pins
issue only kicks in for pins above 9
since 9 == 0x09
Yeah I just made them all the direct value
It's at least trying to PWM now.
Now the code isn't right, but that's a different story
OverflowError 😄
Basically no matter what I do when trying to set duty_cycle.
hmph.
Ok, I think I'm done for today. Longer day than I intended. Back Tuesday to pick this up. Thanks for your help, Carter!
cool. np!
I could use one of my gherkins and bodge a few wires between the PCB and the Xiao to see if it works fine. That would give me the 30 keys test. It might take a bit of time to set that up...
No, that is fine. I was just wondering if you were thinking of this for a regular keyboard.
This looks good, and thanks for the testing!
Just gave it a test on my Gherkin (5x6 matrix) and it ran fine without the need for pre-compiled/mpy files.
Having these frozen libraries made it possible to load the code without the need to load additional libraries; which was quite nice but you miss the chance to get a position on that bingo card :)
Thanks for the review and merge.
I am now working on this. I ran into an issue of BIOS's expecting the interface number to be 0 for the keyboard, and not handling non-zero values properly. See https://github.com/hathach/tinyusb/issues/1129. I can push the HID interface to position 0, but right now the Windows drivers package we have assumes the CDC is in position 0. I think I have a way of restructuring the drivers to handle that, though, by imitating [what Windows 10 does](https://docs.microsoft.com/en-us/windows-hardware/d...
Adding a new build variant targeted for keyboard projects. Same hardware, different circuitpython build...
Reusing the same pictures as the original Xiao. I am not sure if this OK or not.
I also kept the same manufacturer and same hardware/buy links. I simply added a description of the differences with the original one.
Can you review and comment if I got everything I needed to do?
Hi Guys,
I love CircuitPython - it is awesome.
I am very new to compiling / building CircuitPython. I have designed a custom PCB with an NRF52840 which has a non-supported SPI flash chip: a Winbond W25N01GV chip. I naively assumed that this would be a drop in replacement or a quick datasheet read with updated addresses as I had seen on the GitHub support, however, I am just a little confused as to where to begin.
It looks as though the flash chip descriptions are no longer part of C...
I did a crude implementation of my proposal and it can be found here.
I assume you have some specific use case...
I am proposing this method for a couple of reasons:
- Reduced code duplication.
- Provides more flexibility in terms of compatibility with boards.
CircuitPython version
Adafruit CircuitPython 7.0.0 on 2021-09-20; Raspberry Pi Pico with rp2040
Board ID:raspberry_pi_pico
Code/REPL
import board
import displayio
displayio.release_displays()
dc = board.GP8
cs = board.GP9
reset = board.GP12
displayio.FourWire(None, command=dc, chip_select=cs, reset=reset)
print("after initialize fourwire bus")
Behavior
Most convenient way to test is save into a file not called code.py and then imp...
resolves #5449
Check spi argument for None and raise a ValueError instead of crashing.
Tested successfully with code from the issue. on:
Adafruit CircuitPython 7.0.0-176-gf13db0d0e-dirty on 2021-10-09; Raspberry Pi Pico with rp2040
Board ID:raspberry_pi_pico
With the build from the PR it does successfully raise the ValueError instead of crashing into the broken state.
@FoamyGuy Thanks for catching & fixing this issue. One suggestion, looks good otherwise.
if (!mp_obj_is_type(spi, &busio_spi_type)) {
mp_raise_ValueError(translate("Expected a SPI"));
}
Thank you. Error message is changed with the latest commit.
Thanks, the condition needs to be updated too. :-)
Thanks, good find!
I wonder if you can't use mp_arg_validate_type with &busio_spi_type instead. as it stands, won't passing in something else, like the number 7 or an empty list (or even, more plausibly, a bitbangio SPI object) still cause problems?
Latest commit changes to use mp_arg_validate_type instead of the if None. This has the benefit of already having it's own error message so we also don't end up needing the string / translations with this method. Thanks for the tip @jepler
I'm getting make errors. I'm using a Mac (Apple Silicon), and followed the guild for getting going on OSX. One of the deps that was missing was Ninja (brew install ninja), but I'm not sure how this build chain works :S
circuitpython/ports/espressif on main via △ v3.21.3 took 3s
❯ make DEBUG=1 BOARD=unexpectedmaker_feathers2 -j8
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
IDF_PATH=/Volumes/CircuitPython_Dev_Playgro...
Disregard, I've had a bad path line (and totally missed the S2 specific instructions!)
Build log attached. I wind up with build errors at the final stage :S Using Python 3.9, Latest OSX (Apple Silicon), and the build chain outlined in the S2 docs.
$ make DEBUG=1 BOARD=unexpectedmaker_feathers2 -j8 |tee ~/feathers2_build.log
I do not see an error in the feathers2_build.log above. Was there an error written to stderr?
What could cause &busio_spi_type to be undeclared on certain builds?
I'm not sure why more boards didn't fail, but it seems you need to include the header that gives the declaration of busio_spi_type:
--- a/shared-bindings/displayio/FourWire.c
+++ b/shared-bindings/displayio/FourWire.c
@@ -32,6 +32,7 @@
#include "py/binary.h"
#include "py/objproperty.h"
#include "py/runtime.h"
+#include "shared-bindings/busio/SPI.h"
#include "shared-bindings/displayio/Group.h"
#include "shared-bindings/microcontroller/Pin.h"
#include "shared-bindings...
Do you mind checking out the I2CDisplay code while you're working on it?
@lone axle it looks boards that enable sharp memory display work, because they already included shared-bindings/busio/SPI.h from SharpMemoryFramebuffer.h -- In C, things indirectly "#include"d can be seen from the current C file
Huh.. apparently the pipe to tee didn't capture the error... I should have checked before I uploaded.
This is the error
/Users/grodik/.espressif/tools/xtensa-esp32s2-elf/esp-2021r1-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: build-unexpectedmaker_feathers2/firmware.elf section `.dram0.bss' will not fit in region `dram0_0_seg'
/Users/grodik/.espressif/tools/xtensa-esp32s2-elf/esp-2021r1-8.4.0/xtensa-esp32s2-elf/bin/../lib...
Do you mind checking out the I2CDisplay code while you're working on it?
Indeed I2CDisplay does exhibit a similar hard crash with this reproducer:
import board
import displayio
import adafruit_displayio_ssd1306
displayio.release_displays()
oled_reset = board.D9
# Use for I2C
i2c = board.I2C()
display_bus = displayio.I2CDisplay(None, device_address=0x3C, reset=oled_reset)
WIDTH = 128
HEIGHT = 32 # Change to 64 if needed
display = adafruit_displayio_ssd1306...
Latest commit fixes the SPI include and implements similar validation in I2CDisplay
Update
- submodule
ports/espressif/certificates/nina-fwrestored to the correct commit - Fake sleep overhauled. Now handles
TimeAlarmandPinAlarmvia port.c'sRTC_Handler
Overall it still has some quirks but it's certainly functioning.
Ah thank you, so analogio.AnalogIn(A2) instantiates the object and adc.value updates ... cheers
CircuitPython version
adafruit-circuitpython-matrixportal_m4-en_US-7.0.0
Code/REPL
# Adapted from ...
# ON AIR sign for YouTube livestreaming
# Runs on Airlift Metro M4 with 64x32 RGB Matrix display & #shield
#https://cdn-learn.adafruit.com/downloads/pdf/rgb-matrix-
#automatic-youtube-on-air-sign.pdf?timestamp=1633673486
import time
import board
import displayio
import adafruit_display_text.label
from adafruit_display_shapes.rect import Rect
fro...
dispayio.Group does not take a max_size argument anymore in CP7.
https://circuitpython.readthedocs.io/en/latest/shared-bindings/displayio/index.html#displayio.Group
You link the pdf in your code, it looks like the pdf has an outdated version of the code compared to the web version, I don't know how that works, but I'll try to get the info to the right people if they miss this.
I advise using the "download project bundle" button here instead:
https://learn.adafruit.com/rgb-matrix-aut...
@Neradoc Thanks for diagnosing this. I've reported it to the Learn Guide folks.
@martingosnell Yes, get the code from the online guide. Sorry for the mismatch.
The DEBUG=1 builds don't fit anymore on ESP32-S2. Your build is probalby fine otherwise. You can turn off several modules and make them fit. See https://github.com/adafruit/circuitpython/issues/4984#issuecomment-915384864 as an example of what to turn off. The code region is not overflowing; it's something else, and we need to figure out the best way to make the DEBUG builds easier.
Here is initial NXP LPC1768 and LPC55S28 support.
So far CPY NXP port has been tested on two boards: up and running on Keil MCB1700 and NXP LPCXpresso55S28 boards.
Serial interface, HAL digitalio and time modules are supported at current moment.
Thanks for doing this!
I have a not-yet submitted PR that uses the other validators, and uses %q where possibe. I started with all the modules in the smallest SAMD21 builds, hoping to save a few hundred bytes. Unfortunately, it is a few steps forward and a few steps back in many cases, and so far it is only saving a couple of dozen bytes. @jepler had a similar experience.
Diff is https://github.com/adafruit/circuitpython/compare/main...dhalbert:arg-validation-updates
Even if it doe...
Oookiedoke, after getting the debug build set up and running, I no longer get hard crashes, but instead a permanent hang. Once I get here and it's hung, if I continue to wait, it eventually .. does something (it removes itself from connected to my laptop, and screen terminates since the device vanishes). I then am unable to reconnect to the device at all (no such file or directory) until I press the reset button. No output is generated when it crashes (logging from screen shows the last line ...
here's the diff of mpconfigport.mk in case I messed something up
diff --git a/ports/espressif/mpconfigport.mk b/ports/espressif/mpconfigport.mk
index 206de09ab..5adbd3163 100644
--- a/ports/espressif/mpconfigport.mk
+++ b/ports/espressif/mpconfigport.mk
@@ -12,25 +12,25 @@ LONGINT_IMPL = MPZ
# These modules are implemented in ports/<port>/common-hal:
CIRCUITPY_FULL_BUILD ?= 1
CIRCUITPY_ALARM ?= 1
-CIRCUITPY_AUDIOCORE ?= 1
+CIRCUITPY_AUDIOCORE ?= 0
CIRCUITPY_AUDIOMP...
Thanks! Could you say more about this chip family? Is it Cortex M0+? It looks like they have limited RAM (like 64kB max)?
There is a regression of submodules in frozen/. Could you pull these forward to match what is in main?
LPC1768 has Cortex-M3 & 64 KiB and LPC55S28 Cortex-M33 and possess 256+ KiB
There is a regression of submodules in frozen/. Could you pull these forward to match what is in main?
Sure, I'll do. How did you discover the regression?
In fact just before creating PR, I had merged the main into nxp-lpc branch of my fork.
The submodules show up as changed in "Files changed". The submodules do not always update automatically on a merge. after merging I do this; I do it so often I made an alias:
alias gitsubupdate='git submodule sync --quiet --recursive && git submodule update --init'
But sometimes if git thinks you made the change deliberately, it will not update automatically, and you'll need to fix it manually
Are these similar in terms of the HAL provided, peripherals, etc.? E.g. similar enough like SAMD21 and SAMD51?
Is the LPC1768 still recommended for new designs, since M3 is getting long in the tooth now?
I had looked at LPC55xx a bit, but availability was poor a while ago.
LPC1768 is indeed a long-runner. But still both LPC1768 and LPC55S28 are quite comparable when it concern to peripheral: RTC, I2C, SPI, CAN and etc.
LPC55S28 is a modern single MCU with fancy FlexCOMM peripheral units just like SERCOM on SAMD5x.
Is the LPC1768 still recommended for new designs, since M3 is getting long in the tooth now?
I believe it's not yet displaced. However there is already pin-compatible replacement for LPC1768 called LPC4088 with Cortex-M4 and 96 KiB of RAM.
I am going to add LPC4088 to CPY NXP port as well later.
Anyway the LPC1768 is not far away to be outdated soon. But still I would like to support it, since it used in multiple existing products our company is building.
thanks for the background on this
I tried it out, but git shows me no changes. I wonder how it could happen. I've never ever changed anything in frozen modules.
I am checking the modules one by one now.
did you do get fetch adafruit; git merge adafruit/main where adafruit is upstream?
Yep, but it did not help. I finished synchronizing the frozen modules. Should create a PR for that?
Thanks! Could you say more about this chip family? Is it Cortex M0+? It looks like they have limited RAM (like 64kB max)?
There is a regression of submodules in
frozen/. Could you pull these forward to match what is inmain?
LPC1768 has Cortex-M3 & 64 KiB and LPC55S28 Cortex-M33 and possess 256+ KiB.
LPC55S28 is a modern single MCU with fancy FlexCOMM peripheral units just like SERCOM on SAMD5x.
There is already pin-compatible replacement for LPC1768 called LPC4088 with Cort...
A couple more things about submodules. I did not review the main part yet.
This is out of date.
url = https://github.com/adafruit/micropython-ulab

This is still out of sync with adafruit/main.
More updates
alarm.wake_alarmcan now tell between waking up from pin or timealarm.exit_and_deep_sleep_until_alarmscan now wake from concurrent pin and/or time alarms.
Question:
I make individual time/pin callbacks from port.c as shown here. This requires a couple extra imports in port.c:
#include "shared-bindings/alarm/tim...
Thanks for paying attention! I've accepted your change.
also did you see that the Display_Text submodule is still at a different commit?
I am cancelling the action runs since it will need to re-run after the next change, and they take a long time
also did you see that the Display_Text submodule is still at a different commit?
Yes, you are right. I've just fixed it.
I noticed there is new file, which I did intend to deliver: https://github.com/adafruit/circuitpython/pull/5453/files#diff-d1220db10403147e832040df7b1c5241972d4a13eeb534aba127e4fa197fba75
It is short bash-script to update submodules.
Should I delete it?
We don't update submodules wholesale except deliberately. There is a make target in the top level Makefile for that, and there's a helper script. So I would say omit yours.
update-frozen-libraries:
@echo "Updating all frozen libraries to latest tagged version."
cd frozen; for library in *; do cd $$library; ../../tools/git-checkout-latest-tag.sh; cd ..; done
it's specialized, because we only want to update a frozen module to the latest tagged release, not the latest commit.
?serverinfo
I took a peek at WDT stuff while implementing deep sleep via https://github.com/adafruit/circuitpython/pull/5425.
My take away is that it's super doable. I don't have time atm, but for anyone wanting to attempt this, here are some tips:
- use
\ports\nrf\common-hal\watchdog\as a rough starting point - you'll likely need to reference
\ports\atmel-samd\asf4\samd51\include\component\wdt.hquite a bit for specific register twiddling - Just checked the D5x/E5x errata (document DS80000...
<@&356864093652516868> Just wanted to drop a reminder here that the meeting is 24 hours later than normal because tomorrow is a US holiday. See you on Tuesday at the normal time!
I2S out support works great, but it would be wonderful to have I2S IN support - similar to PDM. The Adafruit i2s microphone breakout board is I2S and I cannot utilize it with CircuitPython.
is the "how not to show CIRCUITPY drive" info in a guide somewhere?
@jaunty juniper thanks!
That chip is NAND flash. Most of the other flashes are NOR flash and none are NAND. I suspect there will be more work to do with NAND because it is much more unreliable than NOR. Your simplest option is to switch to a NOR chip. NAND will likely require changes in CircuitPython and nvm.toml.
Thanks for the PR! I'm excited for LPC55 support. I think @gsteiert will be excited about this too.
@dhalbert I'll let you review but feel free to mention me if you want me to look too.
I think calling the callbacks directly is fine because port.c is still relatively private piece of code. I don't think there is much difference from the compiler's perspective if you added a wrapper function.
Please get the CI passing before I review again.
Don't define this in two places. It'll make changing it confusing.
Otherwise, a lot of frames were being dropped, leading to a low framerate in the "directio" demo for OV5640 cameras
Before:

After:

Note that as we're not doing anything to overlap the display write with the capture of the next frame, it's expected that 2...
I am now working on this. I ran into an issue of BIOS's expecting the interface number to be 0 for the keyboard, and not handling non-zero values properly. See hathach/tinyusb#1129. I can push the HID interface to position 0, but right now the Windows drivers package we have assumes the CDC is in position 0. I think I have a way of restructuring the drivers to handle that, though, by imitating [what Windows 10 does](https://docs.microsoft.co...
I am going to put this on ice for now. As long as we continue to support Windows 7 and 8.1, we cannot move the Device Interface numbers around so that HID is Interface 0 instead of CDC. In the long run, it could be possible, but boot keyboard support may become less important. I have some BIOS examples that don't need boot keyboards anyway.
I am changing this to Long Term because the problem is Windows 7/8.1 specific. There are restrictions caused by the Windows 7/8.1 drivers about the Interface numbers of the drivers. We also need to update the drivers package to include the Pi Pico. But this is not a problem we can fix in CircuitPython.
When I update the drivers we can try this again.
@onyx hinge @vale spire pointed out we'll get #7680 and #7688 with 1.17. we should make sure they are enabled
ok tested, it def cuts down on capture time, now 400ms instead of 600ms. still - why are we only able to get 4mhz pixclk? i feel like we should be zooming thru the data. and why does hqvga take the same amount of time as qvga??? so many ????!
Is there a reason for forking the NXP repository? This repository could also be used for the RT10xx ports.
Thanks for the PR! I'm excited for LPC55 support. I think @gsteiert will be excited about this too.
@dhalbert I'll let you review but feel free to mention me if you want me to look too.
It is good to see this. It goes great with the LPC55 support added to https://github.com/adafruit/tinyuf2/
Now I need to find my old mbed LPC1768 board to see if I can get it running on that.
@dhalbert I'll let you review but feel free to mention me if you want me to look too.
It sounds like you're quite familiar with the platform(s). Feel free to review! I'll be taking a look more at the internals, but I don't know the peripherals or HAL at all.
CircuitPython version
Adafruit CircuitPython 7.0.0 on 2021-09-20; Adafruit CircuitPlayground Express with samd21g18
Code/REPL
# This is a pruning of https://learn.adafruit.com/perk-up-ears/code
# test.py
import array
import board
import audiobusio
NUM_SAMPLES = 90
mic = audiobusio.PDMIn(board.MICROPHONE_CLOCK, board.MICROPHONE_DATA,
sample_rate=16000, bit_depth=16)
samples = array.array('H', [0] * NUM_SAMPLES)
mic....
Actually this is good point!
The only reason is this commit: https://github.com/EmergReanimator/mcux-sdk/commit/3a5047bb09d88057abc239eb9e579a78a7efb255
There I fixed unsafe float comparison warning which caused build failure. The better approach would be fix it in upstream. But I am still not completely certain whether the mcux-sdk ought to be reused. It requires significant changes to be integrated (e.g. pin allocation).
Please go ahead! But you need to add mbed LPC1768 board definition.
I should be able to control GPIOs via digitalio HAL module. Other than that is currently not supported.
Hi @tannewt,
Thank you so much for looking into this - I figured this out on Sunday (the NAND vs NOR chip) I thought they would be used interchangeably generally - but I guess that I was wrong! It was a last minute chip-change due to shortage of the chip I wanted to put on the board, so I guess that I didn't spend enough time to read the details... I have some W25Q128 arriving... It'll be a bit of fun to un-solder WSON NAND and solder the NOR! I'll let you know how that goes :-)
Thanks ...
Just want to chime in for tinyuf2, currently the lpc55 bootloader size is set to 64KB for developing purpose with initial LOG. The actual size for bootlaoder for release should be 32 KB. I will make update for tinyuf2 shortly and post update here, just in case you guys using it for testing.
Yeah, the OV5640 datasheet says we can do up to 120fps at 320x240, with a pixel clock of "24/48MHz". Clock/mode setting would need to be an issue filed against Adafruit_CircuitPython_OV5460. Adding background capturing would be an issue to add in the core first, then in the driver.
@ladyada ESP32-S3 engineering samples are now available on DigiKey:
https://www.digikey.com/en/products/detail/espressif-systems/ESP32-S3-WROOM-1-N8/15200089
https://www.digikey.com/en/products/detail/espressif-systems/ESP32-S3-DEVKITC-1-N8/15199021
Stock availability fluctuates a lot - I've managed to snag a few DevKitC-1-N8 units for prototyping purposes.
@lone axle I think this is your code, can you take a look? https://github.com/adafruit/Adafruit_Learning_System_Guides/pull/1888/files If you don't have review privs on that repo, let me know and I can approve if you say it's. good to go.
Will take a look
Thanks!
@idle owl @slender iron @onyx hinge I am back from morning errands and can run the meeting today. I'll try the Game Bar recorder and will review the mtg document.
@tulip sleet did you try obs yet? That’s what the rest of us use
no, but i will. I'll be afk 12-12:40 or so eT.
I know the game bar recorder works. I tested it with Kattni
Kk
I am looking at an implementation like that. My original intent was that the new code did not take any more space that the old one when not used, which led me to do an ugly duplication, but that's not good... Also I was not sure how to implement some of that. I'll commit an update soon.
I am not in favor of adding a parameter to the python API of board.I2C(). The idea is to add named dedicated I2C ports, in particular the STEMMA port in the case of the QT PY 2040, for discoverability. It...
Someone should do a back up recording regardless so there's less stress on Dan. @onyx hinge Ideally not me because I lose a monitor when recording. 🙄
I can do it
Thanks
The Game Bar recorder has a nice mini-window showing elapsed time. I see that in OBS in the bottom bar, but I don't see some detachable window for that. Is there something? Do you just shrink the OBS window?
I shrink the window down after making the Discord window the right size. Then I make OBS tiny under my Discord. Because for a while, the video would flicker if they overlapped. I think they fixed that, but it's my process now so shrug.
As long as you don't mind me being distracted.
<@&356864093652516868> Hope to see you at the rescheduled meeting in about 55 minutes here in the text channel and in the CircuitPython voice channel. Please add your notes to the document, and if you won't be reading them yourself please make a note of it. If you're just listening in, no need to do anything. Notes doc: https://docs.google.com/document/d/1gFsjyqQCprD-4CVVsiNf6XFNNv7XcZ7RQcV6IHRssI8/edit?usp=sharing
CircuitPython Weekly for October 12, 2021 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 participate...
I use this command from Jeff to resize discord xwit -resize 1920 1080 -select
you could record at 720p @tulip sleet
what do you usually record at ?
1080p but I have a giant screen
I resized the window just fine. I have two monitors both 1920x1200, so np
ah, ok
Sorry, I won’t be able to make the meeting this week. Nothing to report.
No worries! Hope all is well.
It is. Thanks!
From: https://forums.adafruit.com/viewtopic.php?f=60&t=184048
code.py output:
Traceback (most recent call last):
File "code.py", line 15, in
File "adafruit_ble/__init__.py", line 195, in start_advertising
TypeError: directed_to must be of type Address