#circuitpython-dev
1 messages ยท Page 11 of 1
I2CSlave was renamed to I2CPeripheral by us, and now in 8.0.0 we are using the official I2C renaming, which is "target"
This is our link: https://docs.circuitpython.org/en/latest/README.html
I googled for circuitpython readthedocs and got that 'jake' one .
we can't control google's use of unofficial rtd sites
Thank you Dan!
@tulip sleet thank you for the thoughtful review! I appreciate all the things you found. PR is updated now.
if you searched for "slave", that's probably why you find the "jake" one, since we haven't used that name for a long while
yw!
not sure what to do about hostname validation. I checked, and re1.5 (the implementation of regular expressions we use for the re module) doesn't support the x{min,max} format
and POSIX regexec isn't available everywhere
man 7 hostname gives a simplified definition:
Each element of the hostname must be from 1 to 63 characters long and the entire hostname, including the dots, can be at
most 253 characters long. Valid characters for hostnames are ASCII(7) letters from a to z, the digits from 0 to 9, and
the hyphen (-). A hostname may not start with a hyphen.
frankly we could just check for a-z, 0-9, -, ., and be done with it
are you suggesting "just implement a check for it by hand"? Sure I can do that.
yes, and i"m not sure how strict you really need to be
if you don't drag in regex, maybe that will save a noticeable amount of space on some builds anyway
Dan I readthedocs of the link you gave me, doesn't show up i2cperipheral. Only i2ctarget, but i2cperipheral is in the flashed CPY V8 code
the name was changed very recently, I guess since the version you flashed
the docs link is "absolute latest", later than 8.0.0-beta.0
also, both names are available right now
i2cperipheral will be removed in 9.0.0
Yes, I have i2cperipheral in the device. It is not in the latest of the docs
so, it's documented as i2ctarget, but is available as both i2ctarget and i2cperipheral right now, for backward compatibilty in 8.0.0. The compatibility will go away in 9.0.0
thank you
tnx
@tulip sleet added to the PR https://github.com/adafruit/circuitpython/pull/6933/commits/d59774d7508e40f5ef73e6515b1ea9df0c7e8354
hostname_valid looks elegant!
@onyx hinge
ports/raspberrypi/boards/raspberry_pi_pico_w/board.c is now an empty file; for other boards I include the comment I put in the suggestion (copy another semi-empty one)
done!
okee dokee, I'll approve; did you do a wifi smoke test of some kind (e.g. to test the hostname stuff)?
after the first rebase, yes. after all these changes just now, no
let me do that again
----------------------------------------
Text Response: it works
```incidentally before I reset it, it had completed >64000 http gets
and the http test still works, consider it smoketested
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: invalid hostname
>>> wifi.radio.hostname = "blue.fish"
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'Radio' object has no attribute 'hostname'
```oh that's right, setting hostname is not supported on rp2040 yet (but I can sorta test validity which is weird)
excellent - the http support should satisfy some people for a while
Great! One of us can merge after the builds finish.
yay! now I'm headed out on my walk, ttyl and thanks again
Although the connection to the wifi AP is maintained, there is usually a disruption of the network after several minutes. Trying a socket operation in a loop with 5-minute delay gives an exception, whereas I have CircuitPython code that's been running since yesterday that pings every minute to keep the network alive but does HTTP only once an hour.
code:
cp_test.py.txt
output:
[cp_out.txt](https://github.com/a...
@anecdata I also reproduced something similar on circuitpython. In my case, I got to 300 but failed on the next run.
>>> import do_anecdata
0 200 OK b'it works\n'
60 200 OK b'it works\n'
120 200 OK b'it works\n'
180 200 OK b'it works\n'
240 200 OK b'it works\n'
300 200 OK b'it works\n'
[Errno 2] No such file/directory
Since you first encountered this and now reproduced it micropython and circuitpython, can you open an issue with both us and them, and mention ...
@jepler I goofed with my math in the earlier comment... MicroPython ran for 9 minutes (not 90!) between intervals, but got OSError: -2 after 10 minutes with no network activity, and Thonny doesn't recover the connection to the device after it's reset, so more uP testing is needed. I'll open a CP issue, and if / when I have enough data, I'll open a uP issue.
It's possible, though not intuitive, that it's by design in uP and there's some command needed to "wake" the network from the local si...
CircuitPython version
Adafruit CircuitPython 8.0.0-beta.0-65-g5781bd318 on 2022-09-22; Raspberry Pi Pico W with rp2040
Code/REPL
import time
import supervisor
import microcontroller
import wifi
import socketpool
import adafruit_requests
from secrets import secrets
TEXT_URL = "http://wifitest.adafruit.com/testwifi/index.html"
pool = socketpool.SocketPool(wifi.radio)
requests = adafruit_requests.Session(pool)
while not wifi.radio.ipv4_address ...
Thank you @crimson ferry
Pinging the device periodically from an external source also seems to extend accessibility of the network.
@onyx hinge probably not worth an issue, but same as esp32-s2 originally: reading board.LED output is always False, i.e, led.value = not led.value doesn't toggle the output
Ooh please do else I'll forget it
ok
CircuitPython version
Adafruit CircuitPython 8.0.0-beta.0-65-g5781bd318 on 2022-09-22; Raspberry Pi Pico W with rp2040
Code/REPL
Adafruit CircuitPython 8.0.0-beta.0-65-g5781bd318 on 2022-09-22; Raspberry Pi Pico W with rp2040
>>>
>>> import board
>>> import digitalio
>>>
>>> led = digitalio.DigitalInOut(board.LED)
>>> led.switch_to_output(False)
>>>
>>> led.value
False
>>> led.value = True
>>> led.value
False
>>> led.value = not led.value
>...
Ran into something similar on my S3 feather tonight with OSError -2 pointing at response = requests.get(DATA_SOURCE).json() but more specifically line 509 in adafruit_requests.py (8.0.0-beta.0-67) for _get_socket. This happened as I lost power during hurricane ian.
No clue if this is helpful, first time i've seen an actual error instead of the hard fault handler crash so wanted to document it somewhere, this seems appropriate.
I'm interested in taking this on
Glad to hear that! I can test the code. Is there any extra information required?
@bill88t Thanks for starting to test this, it is still very much a work in progress, I'll make PR soon with a more stable version.
After some more tinkering with this, I'd like to propose that instead of only using ota_1 to extend the storage, we should use the next update partition which could be either ota_0 or ota_1 depending on the current running partition.
This would allow storage extension to work with dualbank. When updating the firmware, an error can be raised if the `o...
- In socketl, implement
bind,listenandaccept. - In socket, most long running operations can be interrupted by ctrl-c now
- In wifi.radio, implement
tx_powerand settinghostname - In cyw43, implement set_power_management. One documented value, 0xa111440, can be used to disable aggressive power saving. Other values are not documented by Raspberry Pi, and document CywPin
I don't see anything in adabot about assigning the Hacktoberfest accepted label, does that need to be done manually?
>>> import board
>>> import digitalio
>>> smps = digitalio.DigitalInOut(board.SMPS_MODE)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: SMPS_MODE in use
```but it's only defined in `pins.c`
@proven garnet as far as I know yes
@crimson ferry ```c
#if CIRCUITPY_CYW43
never_reset_pin_number(23);
never_reset_pin_number(24);
never_reset_pin_number(25);
never_reset_pin_number(29);
I may have gotten it wrong, but these pins are taken away from their original use and are for interfacing to the cyw43
Looks like it's now WL_GPIO1
I was just poking to see if that pin had something to do with power management
ah, no, probably nothing to do with cyw43 power management but still a good catch
the state of that pin selects "high efficiency (default)" or "low ripple" at the 3.3v regulator
ah, thanks. VOLTAGE_MONITOR (29) and VBUS_SENSE (24) in use too with CYW43 ๐ฆ
Yeah I'm not sure the deal with VOLTAGE_MONITOR, it's supposed to be possible to use it but ๐คท I couldn't get it to work
I should probably study the micropython implementation more closely
it would be nice if the Raspberry Pi docs were more complete
Thanks!
I wrote a script that can swap the "//!" comment markers that embed Python interface code in C comments with "# C#" comments that embed C code in Python interface code ... by using my editor's "pipe buffer through external program" feature, then overriding the language type manually, I can conveniently edit the docs as Python code before piping it again to switch back. Since the source gets uncrustified and blacked by pre-commit, it doesn't seem to introduce any spurious changes. Not sure "# C#" is the best comment marker, it's just what I implemented... https://gist.github.com/jepler/94825738dff594dff53df169dde98de4
is installing libraries to non-native USB boards covered generically somewhere? like more generically than here:
https://learn.adafruit.com/circuitpython-with-esp32-quick-start
that's the only guide about non USB boards currently, isn't it ?
maybe it should be a bigger item so people find it easier ? I only see it mentioned in a paragraph. https://learn.adafruit.com/circuitpython-with-esp32-quick-start/using-web-workflow#step-3124558
ah nice I missed that one
Hello,
I found a couple of issues with my first implementation of the STM DFU mode https://github.com/adafruit/circuitpython/pull/6919
- the size of the interrupt clear array was not computed correctly
- the recommendation to disable interrupts using NVIC from ARM (nested vector interrupt controller) was not followed
I retested with my STM32 Nucleo-F446RE board, attached picture bellow:
 (in py/misc.h) to compute the size of the array. Note that if the expression arr is actually a pointer instead, it will NOT be detected as an error. (the implementation is just sizeof(arr) / sizeof(arr[0]), more or less)
Um..... I thought it was automatic.
Maybe Tim was running it manually so I assumed it was Adabot doing it?
@lone axle I merged a new library example in to the HT16K33 library a day and a half ago, and the dynamic screenshot isn't showing up in this list. https://adafruit.github.io/Adafruit_CircuitPython_Bundle/ I'm not sure why. Usually it's quick. I asked Justin first, forgetting you had written this (at least I'm 80% sure you did, I remember Jeff being involved as well somehow, but I'm not sure to what extent). Justin looked, but couldn't quickly figure out what might be going on. Any idea why my new example isn't showing up in the list?
Nothing really comes to mind sorry. I think the portion I made initially was making those screenshots for learn guide projects. It was later re-purposed to also do examples in the libraries, but I don't think I did that part, or at least don't recall it ๐ .
No ideas about what could be the cause, but I would guess the best way to troubleshoot is start looking into the actions to find when/where these get generated from and try to find some output from it. I could look into it tomorrow afternoon if you'd like.
I do think it may be picky about the example names following the format of having the library name at the beginning of them. But looking into latest commits in that repo it seems all of them do follow that formatting. Not sure of any other gotcha's though.
Ok, that would be great. I don't know where to start looking into that, so any help would be appreciated.
The guide page was already live, so there's not really a rush on it. I'll keep the note in my todo list to add it until we figure it out so it won't get forgotten.
@lone axle Tomorrow afternoon would be excellent. Thank you for offering.
Yep, for sure will take a look. Had just a moment now and took a quick peek. I think this is the action run for it and it shows itself as cancelled (although also has green checks that look like success/completion, so kind of ambiguous). https://github.com/adafruit/Adafruit_CircuitPython_Bundle/actions/runs/3150402665 and this is the workflow file for it: https://github.com/adafruit/Adafruit_CircuitPython_Bundle/blob/main/.github/workflows/images.yml
Thanks! One note, if you want to change it before I merge this PR, you could consider use of MP_ARRAY_SIZE. If not, can merge as-is too.
@lone axle Ooh nice, ok. I'll rerun it to see if that resolves it. I'll keep you posted.
looks like it's been failing for a little while and you are the lucky one who noticed: https://github.com/adafruit/Adafruit_CircuitPython_Bundle/actions?query=workflow%3A"Generate+folder+images"++
Yep. This is the most detailed error I've found so far:
Canceling since a higher priority waiting request for 'folder-images' exists
My guess is maybe there is some old run instance of it that has gotten "stuck" and for some reason has higher priority so it's causing these to fail. Okay, off to prep for Javascript class tonight. Will dig further tomorrow.
Thank you!
If nothing exists I'd love to get something up for next year in adabot or something.
I seriously thought it was already. But apparently I'm wrong.
Wheeeeeeee I am not wrong! My memory is not exceedingly terrible after all. It was in there at some point. https://github.com/adafruit/adabot/pulls?q=is%3Apr+is%3Aclosed+hacktoberfest The 2019 PRs from sommersoft added it. (This was bugging me, I swore I remembered it being in there. I was very confused.)
Code's already written. Might need tweaking to update it, but at least it's mostly there already.
Oh, turns out I completely misunderstood what Tekktrik was saying. ๐
That was already known. It's a different label he was referring to.
Ignore me, nothing to see here, please move along.
@idle owl I don't know what's up with the folder images. I agree the web-ui says that the update-images task was canceled.. but it also is the case that the latest commit of update-images is very recent and matches what the log of the last run says it pushed.
commit 9fd3cae77f79f3244372a7ed0e8936ec3dc811ff (origin/folder-images)
Author: jepler (github actions cron) <jepler@users.noreply.github.com>
Date: Thu Sep 29 20:12:15 2022 +0000
update images
diff --git a/24lc32_24lc32_simpletest.py.png b/24lc32_24lc32_simpletest.py.png
Log
To https://github.com/adafruit/Adafruit_CircuitPython_Bundle
+ 760d265...9fd3cae HEAD -> folder-images (forced update)```
Since I wasn't in on this whole discussion, what else are you seeing that led you to be looking at this?
That my HT16K33 example isn't showing up on the list.
I added it 1.5+ days ago.
So.... it's not running. Or something.
OK
has the library been released since your changes? It was released September 24, apparently.
Oh. No I doubt it.
Uff.
Is that why it's not there?
Yes, I think so? Since bundle is all about having the latest tagged release. so your image would be missing from and adafruit-circuitpython-bundle-examples-20220929.zip wouldn't have it either. not that many folks get their examples that way.
Ok. Released it. I'll check again tomorrow.
No worries. I should have remembered that.
I submitted a support ticket with github about the workflows showing as cancelled. As it's associated with my github account I don't think anyone else can use the URL so I won't share it.
Ok, that works. Thank you.
@onyx hinge had you seen this https://forums.raspberrypi.com/viewtopic.php?p=2037055#p2037055 (it's in the linked georgerobotics code too)
I'll test uP (and CP when there are artifacts) to see if I can turn it on and off and keep the bits flowing after some large-ish interval. OSError: -2 is a bummer, needs reset to recover afaict.
On ESP32, merely enabling the pin-setting holding mechanism during deep sleep consumed at least 250 uA of extra current, even if no pins were being hold. This compared with about 75 uA total on Feather ESP32 V2 when the mechanism was not being used. Rework the pin-holding logic so that the hardware mechanism is not invoked unless needed. Added a caveat in the documentation.
Also did a minor cleanup in Feather ESP32-S2 TFT.
@ladyada This turns out to be the reason for the confusing behav...
On ESP32, and a lesser extent on ESP32-S2 and other chips, pin state after reset is not consistent. In general pins are to set an input state, but some have a pull-up enabled, some have a pull-down enabled, and some have neither. As an example, ESP32 GPIO2 has a pull-down enabled after reset.
The pin states are listed in the "Pin List" tables in the respective datasheets. Here is a clip from the ESP32 Pin List:
 can double check the power result.
This all looks OK by me! Did not test the network code.
This all looks OK by me! Did not test the network code.
@tulip sleet I backed out the black changes from that PR just as you were reviewing it, argh! mind re-reviewing?
np!
What channel is it connecting to? Please try it again having it connect on a channel 9 or above.
Implement analogbufio on all applicable ports. Followup to #487.
- [ ]
atmel-samd no onboard DACbroadcom- [ ]
cxd56 - [ ]
espressif - [ ]
mimxrt10xx - [ ]
nrf - [x]
raspberrypi - [ ]
stm
thanks for the detailed response, I hope I'm not missing something, but I'm not sure what you wrote will work for me. My goal is to encapsulate a third-party library so that I can call it from circuit python. The goal is to take that library, unmodified, and put it in lib as a sub module (lib/neuton). My wrapper code is in shared-modules/neutonml and must include lib/neuton/neuton.h. The failure occurs when compiling the shared module because there is no way I can find to set CFLAGS only for shared-modules/neutonml/Neuton.c. I don't understand how the example you provided could work for my code in shared-modules. I don't want to modify the vendor files because that would be a support nightmare - the sub module get rewritten every time Machine learning model is trained. I guess I could come up with my own .h file and just keep that updated as needed with each training.
@charlien What channel is the ProS3 connecting to? Please try it again having it connect on a channel 9 or above.
I figured it out. At first I did attempt channel 9, but that didn't work so I had it iterate through all channels until it could find an address but that failed as well.
The problem comes back to the same reason why I have to remote my logitech 2.4GHz mouse. USB interference (ref: https://www.usb.org/sites/default/files/327216.pdf). I should've known since the W...
Tested most of the new features briefly:
โข adafruit_httpserver runs:
% curl -iL http://192.168.6.199
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 492
Connection: close
โข Didn't fully test control-C across features, but generally seemed more responsive to control-C (except during connect, which I think is expected). Added handling ETIMEOUT to test code, I think this may be related.
โข Confirm get and set tx_power and hostname (couldn't verify actual `t...
@charlien What channel is the ProS3 connecting to? Please try it again having it connect on a channel 9 or above.
I figured it out. At first I did attempt channel 9, but that didn't work so I had it iterate through all channels until it could find an address but that failed as well.
The problem comes back to the same reason why I have to remote my logitech 2.4GHz mouse receiver. USB interference (ref: https://www.usb.org/sites/default/files/327216.pdf). I should've known sin...
Correct. Windows 10. Starting to get the feeling I have some kind of rogue/conflicting USB device. I need to conduct some unplugging tests, have about 10 USB devices. Mouse/KB/Printer/Webcam/Boards/etc.. Also my PC is wireless so maybe that's conflicting somehow. Too many times reporting issues with others saying their devices are working fine, points to my PC as the common denominator at least for some of it I think. Others are experiencing hard faults specifically with the S3 but I'm als...
I'm not sure what to do with this:
>>> import cyw43
>>>
>>> cyw43.set_power_management
'set_power_management'
>>>
>>> cyw43.set_power_management = 0xa11140
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'set_power_management'
>>>
>>> cyw43.set_power_management(0xa11140)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'str' object is not callable
Huge thanks jepler! This is the most appreciated feature! โค๏ธ
I might be interested in trying to tackle this issue: https://github.com/adafruit/circuitpython/issues/3364 since I've already laid some groundwork for exploring it. Where can I find the time.localtime class/method in github?
nvm think i found it in shared-bindings/time
yeah that's definitely it. because i've worked with time in some of my projects i think this will be a good entry point for me.
Support has been added - but no builds yet until the next version of 8 kicks off: https://circuitpython.org/downloads?q=tinypico
I think we can close this now @dhalbert, cheers :)
Thank you so much for this.
@dhalbert how to do I find out as soon as the CP v8 is released?
You can subscribe to release notifications on github. Click the arrow next to "watch" at the top of the page, then select "custom", then turn on the "releases" checkbox, and finally click apply. Note that the update to circuitpython.org can still lag behind this, as it's a separate manual step of our release process
Even for boards that have not yet been in a tagged release, you can find the uf2 or other binary build on our s3: https://adafruit-circuit-python.s3.amazonaws.com/index.html?pr...
where's the code now? I'll take a look.
I found https://github.com/aulitech/circuitpython/ but as https://github.com/aulitech/Neuton is not a public git repository I can't help you with it.
This needs to be changed, as the storage for self->hostname will be freed when the VM exits. The storage needs to be statically allocated or otherwise allocated in a way that will survive a VM reset.
Consider using the "USB Device Cleanup Tool" discussed here, which may or may not help:
https://learn.adafruit.com/welcome-to-circuitpython/troubleshooting#device-errors-or-problems-on-windows-3094694
In Espressif, the underlying ESP-IDF code keeps the hostname. Does the CYW43 allow it to be set and retrieved?
No, lwip just takes a copy of the pointer value.
#define netif_set_hostname(netif, name) do { if((netif) != NULL) { (netif)->hostname = name; }}while(0)
static hostname storage looks good
I'm confused about why we would want a (custom) hostname to survive a VM reset. Don't we want a clean slate?
Prepping for 8.0.0-beta.1 release.
We could set #define CYW43_NO_POWERSAVE_MODE (0) ///< No Powersave mode as default, then the network is much more robust (and compatible with espressif). My trusty PPK, er, Charge Doctor indicates ~20 mA idling in power-save modes 1 and 2, ~30mA or so idling in no-power-save mode 0, and ~10mA or less idling when de-inited.
Does powersave mode "fix" something (vs just postponing it to longer polling intervals)?
Does powersave mode "fix" something (vs just postponing it to longer polling intervals)?
Putting it in no power-save mode (0) makes it conform more to the expectations from espressif, i.e., the network won't usually become unavailable unless something bad external happens. If the network goes away, user code (and many examples) will need to be re-written to be more defensive - not a bad thing, but harder I think for beginners to get going.
Let's discuss options around powersave mode on the issue: https://github.com/adafruit/circuitpython/issues/6958
But short story, if your testing shows that changing that compile time flag means we can resolve #6958 let's do it.
Sounds good. I don't want to hold anything up, this should get out into the world :-)
I'll test CircuitPython with artifacts after https://github.com/adafruit/circuitpython/pull/6960/commits/84c7ac4a812a394f7196f1af5ffa954f0b457f98, with power-save on and off, and try to confirm the hypothesis that power-save mode 0 (no power save) fixes this issue.
Originally, black_bindings found each contiguous "//|" block and sent it to black independently. This was slower than it needed to be.
Instead, swap the comment prefix: when running black, take off "//|" prefixes and put "##|" prefixes on all un-prefixed lines. Then, after black is run, do the opposite operation.
Also, detect if a file has no "//!" markings and skip running black at all in that case.
This more than doubles the overall speed of "pre-commit run --all", from 3m20s to 55...
Several categories of compiler diagnostic are disabled in rp2040. Fix and deal with several of them. The diagnostic disables ARE still applied to SDK source files and header files, which we don't edit when we can avoid it.
None of the code changes are intended to introduce different behaviors.
@onyx hinge I finished draft release notes for 8.0.0-beta.1. I have tenatively included your 6972 and 6973, and my 6971 (update frozen libs). Happy to wait for a PR for the power-save stuff, since that will reduce support issues considerably.
(testing now on parallel pico w's)
@gilded cradle is there a use case for the generic x86 version of Blinka? A contributor wants to wrap a board import in a try/except but I know this isn't typically done. They're referencing this file: https://github.com/adafruit/Adafruit_Blinka/blob/main/src/board.py which errors if its a generic x86, but is it even possible to define a display in that implementation?
For reference, it's related to this PR: https://github.com/adafruit/Adafruit_CircuitPython_turtle/pull/31
I don't really know how the generic x86 version of Blinka gets used, and where it's worth accommodating, or where we should just say "if there's no board import, we should actually raise an exception because it doesn't make sense to import this module then".
Should you need me to test something just go ahead and @ me
I am more than willing to let my picow afk the network connection overnight
@proven garnet perhaps 32-bit windows which runs on stuff like the beagle bone, intel compute stick.. That would be a really long way around to running Linux vm on 32bit windows on a beaglebone. Crazier things have been done though.
I guess it's possible, but what use case is there for Blinka without defining board pins? I figure if you're on Blinka you probably want/need pins defined for use, but maybe I'm missing something.
And then if you can't use pins, can you even instance a display object?
CircuitPython version
Adafruit CircuitPython 8.0.0-beta.0-56-g3969580319-dirty on 2022-09-29; Aulitech Cato with nRF52840
Reproduced on 7.3.3 with Seeed XIAO nrf52840 BLE SENSE
Code/REPL
import microcontroller
microcontroller.on_next_reset(microcontroller.RunMode.UF2)
Behavior
The board resets immediately instead of at the next result. It enters safe mode instead of launching bootloader. This is similar to open issue number #5353.
Thoughts on moving the following to supervisor.runtime:
- [ ] set_next_stack_limit
- [ ] set_rgb_status_brightness
- [ ] disable_ble_workflow
- [x] autoreload
@tulip sleet I'm back now! working on better documentation for the cyw43 power save mode, and considering whether to set a different value when circuitpython starts
the good news is I did find the documentation of the power saving mode numbers as well!
what interval have you reached with 0?
and have you had failure?
with 0 it will generally keep going like the Energizer bunny
with 2 (CP default, right?) it's inconsistent... on uP it was usually between 5-10 minutes. In latest CP, it sometimes goes 1/2 hour before OSError: 2
(various similarities and differences in the implementations, and of course there's always the unknown of network activity affecting something although I can't quite think of the mechanism)
testing CP... code doesn't know if it's connected, so I just always try connect() after failure, counting on its NOP if already connected. That keeps things going, but it's more complicated and different from espressif
wifi.radio.connect, you mean?
yes
I guess it's slightly incompatible with esp32 that wifi doesn't disconnect on soft reset
that too
and the IP address thing, I think that's a uP bug. uP does recognize in it's status codes that 3 means connected and got IP
but then the IP sticks around after disconnection
Closes: #6958 (pending testing from @anecdata)
We have very little room on the smallest builds for these things. But ble workflow is not present on SAMD21 builds, so that could be done without worry. Having a "get" on the stack limit is useful to make some calculation about increasing it.
We will want to leave the old functions in place, and remove them in 9.0.0.
I think emphasize it provides the best connectivity reliability.
Does it make sense to pass multiple arguments for the pieces of this multi-value field, or a tuple? That could be a future enhancement; not needed now.
//| """Aggressive power management mode for optimal power usage at the cost of performance"""
@crimson ferry ^^^ #6976 will set the 0xa11140 mode at startup. your review is appreciated.
or hmmm .. did I break it?
weird it didn't reset after uploading the new uf2
where did the 4th mode come from? I thought uP had 0xa11140, 0xa11141, and 0xa11142
(I may have glazed over the driver code too fast)
oohhhhh, fancy
those 3 plus 0xa11140
I thought about it, but I don't think most users are going to care about this and they're better off not trying to mix and match. Honestly, I don't even really want to expose this, except while we're testing, if there's only one value that is reliable.
We will want to leave the old functions in place, and remove them in 9.0.0.
Note that it's not what was done for enable_auto_reload and disable_autoreload.
Was there space saved from that ?
Based on a couple of days of uP testing, and today with CP, I think this is the way to go, at least for now. Connections will be more reliable, and users will have less grief.
I've been running side-by-side power modes 0 and 2 for a couple of hours based on the prior merge (automatically re-connecting to the AP after an OSError: 2), and the 0 (power-save OFF) has been successively doing requests every 10 minutes without any disconnections or failures. The 2 (prior, and uP, defaul...
Note that it's not what was done for
enable_auto_reloadanddisable_autoreload.
I didn't realize that. Maybe it was because it wouldn't fit otherwise.
It's true these are not used all that much, so we don't necessarily need to provide a transition.
We'll have other tools at our disposal as this port gets fleshed out:
โข wifi.radio.stop_station() & wifi.radio.stop_ap()
โข wifi.radio.enabled = False
(I finally bit the bullet and ordered a PPK2, hopefully can measure some of the differences)
Did you mean to remove build*/ and sdkconfig.old?
I think maybe this doesn't do its intended purpose, because cyw43_arch_enable_sta_mode calls cyw43_wifi_set_up which calls cyw43_wifi_pm. So you can't set the PM mode before putting the wifi up!
Seems good; the comment-marker swapping is clever!
Good cleanup; the warnings are enabled for good reason.
Is that wlan.activate(True) in uP? Maybe default it or an extra keyword arg added to wifi.radio.start_station() or wifi.radio.connect() (and wifi.radio.start_ap()), or some such.
My plan is to keep the value given to set_power_management and re-enforce it when bringing up the interface.
Is there a broad timescale for the inclusion of the ussl module in the Unix port?
upip, etc are non-functional without it.
It would be very useful to prototype apps within a Unix port and then transfer them to the devices, and it would really reduce debugging time, etc
Thank you, Brian :)
PS: I am very happy to help test any Unix port!

@dhalbert Sure enough one of my USB Host Controllers got corrupted. Port 12 wasn't enumerating correctly. I don't have a Port 12. Removed the controller which took out my mouse and keyboard. Hard shut down, restarted, and voila.
Still have an issue with the S3 not getting a new SSID on soft reboot... requires hard reboot.. but so far no safe mode or hard fault. Fingers crossed.
I bet my lora boards will work fine now. :/ Everything I've been going through lately just ugh. I thought Circuit Python was falling apart and riddled with bugs. Nope, just my USB controller going insane.
Unplugged every single USB device and it was still there. Delete/uninstall it and it would show right back up with a refresh.
Is that
wlan.activate(True)in uP? Maybe default it or an extra keyword arg added towifi.radio.start_station()orwifi.radio.connect()(andwifi.radio.start_ap()), or some such.
In uP, the pm config is a method on the network.WLAN which had already been activated. In my CP testing above (and continuing consistent with that report), results may be depending on the fact that they both started with a reload not a reset.
Had to uninstall the main 3 USB controllers in the right order so my mouse was last, then install that one, hard restart and voila. Apparently it made about 100 USB devices in hidden devices.
did you use the USB cleanup tool?
The crappy part is that now all the bug reports I've submitted have to be wiped out as erroneous.
Wasted a lot of my time and others, sorry about that to anyone who had to deal with one of my confusing bug reports... because I was more confused than anyone.
there was a tool? thought it was just a viewer?
no, it removes all the unconnected devices
oh yeah i tried that. it refused to remove the device
had to remove all the controllers instead, that's what ended up doing the trick.
apparently there's some kind of enumeration bug that will get stuck at that specific registry key
https://www.uwe-sieber.de/misc_tools_e.html scroll down to "Device Cleanup Tool". It removes the usb-attached devices, not the native drivers
lol welp that could have saved me a lot of time fighting with it
i got the tree viewer and thought that was the tool you were pointing me towards :/
this is why i can't have nice things
ok, I made that clearer on the Learn Guide page
thank you for your help danh, i've been fighting against that one for a while, weeks.
try that tool anyway. It will remove all the stale CIRCUITPY's, COMnn, etc.
you may have done that in a more forceful way
The DigitalInOut sets pins to the strong drive mode, but the PWMOut doesn't. It would be nice to have it consistent, especially since PWM might be driving small LEDs and similar things.
I was hoping to make a pull request for this myself, but I'm not recently able to contribute much, so I thought I will report this, because it may potentially be a good first issue. One has only to look at the DigitalInOut code and copy the relevant lines to the PWMOut code.
i think the reason i missed it is because in device manager it doesn't have a yellow exclamation mark, it's a failure but grayed out one, sneaky unless you're looking for it.
Updated version maybe sets power management off by default as intended.
@idle owl if you're around. No worries if not... Was your new HT16K33 example this one? ht16k33_segments_14x4_demo.py
That one does appear in the list now.
We don't use the Unix port, except for testing. It still uses MicroPython conventions, such as u* names, unlike CircuitPython. What are you using it for?
Based on your testing this afternoon, should we close this?
Based on your testing this afternoon, should we close this?
just wanted to add that I was bitten by this recently. I bought a ESP32-S3-DevKitC-1-N8 to build a BLE HID keypad, thinking it would work since I saw "_bleio" in the available modules, but I'm getting a NotImplementedError when trying to initialize a Service.
of course I'm sure it will be supported eventually, and I can always try micropython, but it was a bit of a let-down ๐
This explains a lot of weird WIFI stuff on my workbench where I have a USB3.0 hub that I plug my boards into... ๐คฆโโ๏ธ
https://github.com/aulitech/circuitpython/tree/neuton is public now. I double checked from an incognito browser. The other repository you were looking at is the unadulterated vendor code pulled in as a sub module under lib/neuton
@crimson ferry 1800 second delay successful with the automatic power saving here
from 300 to 1800 by 100 second intervals in a single test over the last couple hours
I expect it to fail overnight when my wifi router resets, no surprise there
@edgy edge This is the problem I am encountering while trying to check into your situation. In my experience this indicates either https://github.com/aulitech/Neuton.git does not exist or it is not public. ```jepler@bert:~/src/circuitpython$ git checkout aulitech/main
HEAD is now at ecaccd0dbc Merge pull request #1 from aulitech/neuton
jepler@bert:~/src/circuitpython$ tail -3 .gitmodules
[submodule "lib/neuton"]
path = lib/neuton
url = https://github.com/aulitech/Neuton.git
jepler@bert:~/src/circuitpython$ git submodule update --init lib/neuton
Submodule 'lib/neuton' (https://github.com/aulitech/Neuton.git) registered for path 'lib/neuton'
Cloning into '/home/jepler/src/circuitpython/lib/neuton'...
Username for 'https://github.com':
I'll merge this now anyway, to get some more eyes on it. I Did test it, so at least for me it works.
Just fixed that
thanks, I'm now able to build your code
with mode 2? what changed? I can test the PR when there are artifacts
@crimson ferry no with the 0x...0 mode
ah, good... yeah that one is rock-solid ๐
@edgy edge I think you were really close! ../../lib/neuton/neuton/neuton.c:340:10: error: no previous prototype for 'neuton_model_get_inputs_ptr' [-Werror=missing-prototypes] 340 | input_t* neuton_model_get_inputs_ptr() | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ note how the kind of diagnostic is shown in the brackets in the error. You had -Wno-strict-prototypes but not -Wno-missing-prototypes.
I think that with this change I just PR'd to you the compiler diagnostics problem should be solved in a way that is palatable
@crimson ferry yeah I'll return to that PR in the morning and fix whatever's stopping it building. It's getting late here, so I'm gonna call it quits
of course, have a good one
haha what a coincidence, the diagnostic is ... ./bindings/cyw43/__init__.h:53:1: error: function declaration isn't a prototype [-Werror=strict-prototypes]
well I guess there are more flags that you changed but .. I don't think the situation is hopeless, I think they just need to be dealt with one at a time
Actually I had it compiling and building. Not sure why your results are different. To get rid of that error it took a change to the makefile where -Werror=missing-prototypes is specified
so I don't have a problem getting it to work, it's just that the CFLAGS are applied to all shared modules
https://github.com/aulitech/circuitpython/pull/3 updated to, I think, fix the rest of the global CFLAGS changes so that they're local to your new code
now for real this time, goodnight ๐
I haven't noticed those appearing with build commands mentioned in Makefile.
I have build-* directories:
~/repos/circuitpython/ports/espressif$ ls -d build*
build-adafruit_feather_esp32s2 build-adafruit_feather_esp32s2_tft build-adafruit_feather_esp32_v2 build-adafruit_qtpy_esp32_pico
sdkconfig.old files get created by running idf.py menuconfig
I'm hesitant to close this just yet, only did about 5 mins worth of tests which isn't enough time for this bug especially knowing others are having very similar hard faults. It'll be great if all the hard faults end up being USB hub or controller issues. I'd like to spend at least a couple days with it just in case. Also have some more tests to do on the rp2040, m4 express, and S2 as well.
Following are excluded in the CP root .gitignore.
build/
build-*/
This pr out of date, I will create a new one that is for all of the boards with invalid Python identifiers.
And let's discuss the yes/no there.
CPY V8.0.0-beta.0-49, a call to I2CTarget.request() results in: 'TypeError: extra positional arguments given' (see the compiled image)
This PR is a followup to #6856.
Basically I replaced all "-" and "." with "_".
As for the 8086_commander, I opted to just swap the words around.
Additional requirements for this change to go well:
- The same changes will have to be done on the -org repo.
I will do that pr if you decide to go ahead with this. - This and the -org PRs will have to be merged EXACTLY when
8.0.0releases.
Because the board names will remain unchanged on7.x. - When new boards are being ported, a...
@thorny dove that sounds like a bug, but I'm not sure if it's a documentation bug or not. Please submit a github issue.
Thank you for your reply. Will submit.
I viewed the sources. There also define one param as float. So, at least the doc should give as example and description ... (-1.0) or so.
Please provide a full script to reproduce the issue
OK
Please feel free to contribute improvements to the documentation as well
Yep
I am very confused as to why the usb id check failed.. I did mv it correctly, checked my history..
It's a doc bug. The signature should read: def request(self, *, timeout: float = -1) -> I2CTargetRequest:, i.e., timeout is a keyword-only argument.
That means that a call should look like this: 'target.request(timeout=-1.0) ?
Looks like the PR needs to changed tools/ci_check_duplicate_usb_vid_pid.py as well.
PS this script might be one place to add enforcement of the policy for board names to only be valid Python identifiers.
also it looks like at least one "-" is left after this, boards/espressif_kaluga_1-3/board.c
@thorny dove yes
>>> device.request(timeout=5)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 116] ETIMEDOUT
An issue, or better yet a PR to fix it, would be appreciated from you once you've verified it as well ๐
OK
target.request(timeout=-1) is accepted.
I will try to create a tools/ci_check_board_identifiers.py, that checks all the board names.
I was thinking the ci_check_duplicate script could just have it added, but a separate step/script is fine too.
Looking good after 50 minutes. Hard-reset, then requests at 10-minute intervals. The board running the new CircuitPython default (no power-save; no calls to cyw43.set_power_management()) has had no disconnections.
Looks like most of my issues started happening when I installed WSL. Getting Hyper-V errors the same day the enumeration driver got corrupted. Could also explain why I've been getting duplicate USB IO warnings because I'm literally running 2 OS's even if Linux is always in the background it's still there. I'm setup with VSCode & Windows GIT desktop now so I really don't need WSL unless I'm going to try to build a custom board (much easier in Linux than Windows python). Going to uninstall WSL and revert the Virtualization setting in BIOS to off.
If WSL is to blame I'm going to take back all the nice things I've been saying about WSL the past month.
Strange, I've had zero issues with WSL
There is an board alias mechanism which could be used to ease the transition, though I'm not sure if it would produce multiple picture entries in circuitpython.org.
It's also true that the old names are used in the directory tree structure in S3: https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin. If we rename the directories there, we need to track down any links besides the ones in circuitpython-org. There may be many in the Learn Guides.
If we are going to do a bi...
Interesting issue regard GitHub Actions @lone axle. I love peaking at repositories' CI, so I'll have to watch one of your previous streams about it.
@jepler Could you fix the two typos I noted above, and possibly address the other comment above?
I cannot understand why the last actions build of https://github.com/adafruit/circuitpython/pull/6976 did espressif boards!
Ready for merge after this? I can stop the unnecessary rebuilds, since this is only a doc change.
Thanks, didn't know build* was in the root .gitignore. It's the only entry in a bunch of ports/*/.gitignore files.
I will add some commits to this PR to remove the redundant port/ .gitignore's, unless you are already on it.
I don't think you need to turn off the Virtualization setting in the BIOS. That's pretty harmless.
I've found WSL, even WSL2 to be slower than a conventional VM running Linux. But I just use a native Linux machine for development. A conventional VM might also work better. I like VMWare Workstation (free for personal use) better than VirtualBox.
I will add some commits to this PR to remove the redundant
port/.gitignore's...
Sure๐
I pushed a new commit that removed a bunch of redundant port/*/.gitignore files, and removed some stale entries from others. Also ports/unix/.gitignore was ignoring *.py files, but now there are some in variants/. I did a unix build to check that no build-time *.py were created
@onyx hinge @crimson ferry worth adding a note to https://github.com/micropython/micropython/issues/9455 to point to our solution
I'll add a comment
or actually @onyx hinge, if you'd prefer, you'll be able to explain it better
sure! (already did, though it was just a quick answer)
I think we crossed ๐
@onyx hinge I think I will release 8.0.0-beta.1 today after the currently building PR's finish. Anything else you can think of?
I think picow is at a great spot to release and get more feedback. Let me take a quick glance and see if anything else pops up to me
I don't see anything else in PRs that it would make sense to merge right now.
@tulip sleet ^
sounds good, and there will always be more ๐
Got a hard fault this morning putting the S3 through its paces. Issue persists. Connected an S2, opened Mu, manually loaded S2 code.py, opened REPL, hard fault error disallows use of REPL. Unplug the hard faulting S3 and Mu immediately loads REPL. Again unsure if this is a Mu problem for hard fault causing a USB issue. No errors in windows device manager.
You might try a different terminal program, like Tera Term or putty. (I like Tera Term better.) This will connect to a specified COM port. You can open multiple instances at once.
I don't think that Mu is necessarily causing the hard fault, but the errors might be confusing Mu.
Thanks for noticing these!
Issue persists. Still crashing to safe mode and hard faulting. Windows continually reports an error with the drive, there's some kind of issue with the way windows is handling this particular drive vs all of my other boards. It's also the only board that's crashing with hard faults.
Do you have another S3 board to test?
You might just try reformatting the filesystem too, with storage.erase_filesystem().
I have a lot of different boards I can test. RP2040, M0 Wifi, M4 Express, Bluefruit Sense, Pi Pico, ESP32-S2, QT Py S3.
It does NOT exhibit these symptoms while used with a QT PY S3 and stemma BME380 sensor. Running a small ampule server in an attempt to do my own datalogging to a locally hosted webpage. Written by danh apparently. :P
# SPDX-FileCopyrightText: 2022 Dan Halbert for Adafruit Industries
#
# SPDX-License-Identifier: Unlicense
import board
import wifi
import socketpool
import ampule
import adafruit_bmp3xx
import os
i2c = board.STEMMA_I2C() # uses board.SCL and board.SDA
bmp ...
I do actually have another S3 but it's the same exact UM Feather S3. Bought 2. Oh I've run it through the nuking process twice to no avail.
QT Py S3 works flawlessly but I don't have any error correction setup in my code. Looking into it.
s thanks again for all your help. The changes you made appeared to work. After a bit of testing I decided to merge my branch with main on my fork, then pull in all commits since the fork. Boy did that screw things up. Time to watch football and come back later
Upon plugging in the 2nd UM FeatherS3 Windows immediately popped up the same message about there being a problem with the drive. Windows does not like this board. No errors in device manager.
Running the default code that comes with the UM FeatherS3 code.py
import time, gc, os
import neopixel
import board, digitalio
import feathers3
# Create a NeoPixel instance
# Brightness of 0.3 is ample for the 1515 sized LED
pixel = neopixel.NeoPixel(board.NEOPIXEL, 1, brightness=0.3, a...
You might check with @UnexpectedMaker at their site about this.
Implements the following as supervisor.runtime properties:
- disable_ble_workflow
- set_next_stack_limit
- set_rgb_status_brightness
Left a message in their discord with a link to the github issue though he's tagged in github too now. Thanks for all your help with this one Dan. It's greatly appreciated.
This code does not crash. Unused imports compared to crashing script are:
import terminalio
import adafruit_imageload
import ssl
import adafruit_requests
from adafruit_display_text import label
from adafruit_bitmap_font import bitmap_font
pretty sure I can remove all the display related stuff and it'll be fine.
# SPDX-FileCopyrightText: 2022 DJDevon3 for Adafruit Industries
# SPDX-License-Identifier: MIT
"""DJDevon3 UM ESP32 Feather S3 Online Weatherstation"""
import g...
Tried narrowing it down more by removing all display related stuff.
Unused imports compared to original are:
import board
import displayio
import digitalio
import terminalio
import storage
# SPDX-FileCopyrightText: 2022 DJDevon3 for Adafruit Industries
# SPDX-License-Identifier: MIT
"""DJDevon3 UM ESP32 Feather S3 Online Weatherstation"""
import gc
import supervisor
import time
import feathers3
import ssl
import wifi
import socketpool
import adafruit_requests
# ...
Narrowed down the 205 as much as possible
# SPDX-FileCopyrightText: 2022 DJDevon3 for Adafruit Industries
# SPDX-License-Identifier: MIT
# UM ESP32 FeatherS3
import wifi
import socketpool
# Initialize WiFi Pool
pool = socketpool.SocketPool(wifi.radio)
try:
from secrets import secrets
timezone = secrets['timezone']
tz_offset_seconds = int(secrets['timezone_offset'])
except ImportError:
print("Secrets File Import Error")
raise
# Connect to Wi-F...
how do you find Errors caught by the formatter on commit?It barfs on Neuton.c, but that file compiles and there is nothing obvious to the naked eye.```
sperok@Speros-Mac-mini nrf % git commit -m "Neuton parameter fix up"
Check Yaml...........................................(no files to check)Skipped
Fix End of Files.........................................................Passed
Trim Trailing Whitespace.................................................Passed
Translations.............................................................Passed
Formatting...............................................................Failed
- hook id: formatting
- files were modified by this hook
/Volumes/CPDev/circuitpython/tools/uncrustify.cfg:408: option 'sp_type_question' is deprecated; did you want to use 'sp_before_ptr_star' instead?
/Volumes/CPDev/circuitpython/tools/uncrustify.cfg:902: option 'sp_before_tr_emb_cmt' is deprecated; did you want to use 'sp_before_tr_cmt' instead?
/Volumes/CPDev/circuitpython/tools/uncrustify.cfg:905: option 'sp_num_before_tr_emb_cmt' is deprecated; did you want to use 'sp_num_before_tr_cmt' instead?
Option<NUM>: at /Volumes/CPDev/circuitpython/tools/uncrustify.cfg:1055: Expected number , for 'indent_shift'; got 'false'
/Volumes/CPDev/circuitpython/tools/uncrustify.cfg:1121: option 'indent_sing_line_comments' is deprecated; did you want to use 'indent_single_line_comments_before' instead?
Option<NUM>: at /Volumes/CPDev/circuitpython/tools/uncrustify.cfg:1202: Expected number , for 'indent_comma_paren'; got 'false'
Option<NUM>: at /Volumes/CPDev/circuitpython/tools/uncrustify.cfg:1206: Expected number , for 'indent_bool_paren'; got 'false'
Option<UNUM>: at /Volumes/CPDev/circuitpython/tools/uncrustify.cfg:2724: Expected unsigned number , for 'mod_full_brace_if_chain'; got 'false'
Option<NUM>: at /Volumes/CPDev/circuitpython/tools/uncrustify.cfg:2944: Expected number , for 'pp_indent_brace'; got 'true'
Automated website update for release 8.0.0-beta.1 by Blinka.
New boards:
- lolin_s3
- bpi_leaf_s3
- unexpectedmaker_tinypico
- unexpectedmaker_tinypico_nano
- bpi_bit_s2
- raspberry_pi_pico_w
- challenger_rp2040_wifi_ble
- challenger_rp2040_subghz
- nucleo_f446re
Those are errors in the uncrustify.cfg, seems like you might be using a version different than what we are using.
we are using uncrustify 0.71.0_f or 0.72.0
what does uncrustify --version say?
Uncrustify-0.75.1_f
roll back to an earlier version, then
I'm kinda confused by this issue - is this about hard faults or wifi issues?
Re the hard faults - cant see that having anything to do with my boards. Sounds like a combo of Mu and Windows.
Does it hard fault when you don't use Mu? shut it down, use Notepad?
Re the Wifi - your last code example - does that work on the QTPy S3?
Can you take a photo of your board and wiring and everything for me?
205 is a quite unhelpful error code that arises from time to time:
CONNECTION_FAIL "Espressif-specific Wi-Fi reason code: the connection to the AP has failed."
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/wifi.html
don't you think the function signature for request() should read: 'def request(self, *, timeout: int = -1) -> I2CTargetRequest:' ? See the annotated screenshot of the part of the file I2CTarget.c
I think the only missing boards this will create are:
- raspberry_pi_pico_w
- challenger_rp2040_wifi_ble
- challenger_rp2040_subghz
- nucleo_f446re
I will merge this after I update the download counts and the builds are complete.
Circuitpython always has floats enabled
OK, so the signature stays with 'float'
thank you Danh!
I wrote a GitHub Acttion script to compile MPY files and create a ZIP file as part of a release process. It's similar to what the libraries do, but it's geared more for projects than libraries (I write CircuitPython code but want to get MPY files to actually put on the board). I'm happy to add it to under adafruit, but there's also the option to add it to the circuitpython org.
The major difference at that point is how they're called in a CI, whether it's adafruit/build-mpy@v1 or circuitpython/build-mpy@v1. Does one seem more intuitive or convey the purpose better? I guess circuitpython/build-mpy@v1 sounds less like an Adafruit internal tool?
For reference, here's that action: https://github.com/tekktrik/build-mpy
We could also add it to the GitHub Marketplace (free of course, I really think it just makes it searchable in that system in that case, but didn't know if there was any strong opinion either way or if anyone knows more)
And I guess I'm looking for feedback on the name - build-mpy? release-mpy?
@proven garnet I am assuming it could potentially build the mpy files even if it was not related to a tagged release, so I'd say it's build-mpy
I think it just needs to be added to https://github.com/adafruit/circuitpython-org/blob/main/_config.yml#L45. I believe the original purpose was transitional when we were starting to optimize, though it is nice to have the originals available. We now have scripts to ensure the small and large images are there, so I think it's reasonable to exclude it, though I think a couple places that try to load it as a backup may need to be updated too.
The _asyncio module doesn't appear in matrix either, nor in the modules list (unlike _bleio for example).
Thanks! I think that makes sense.
Yes the small sketch works on the Qt Py S3.
Adafruit CircuitPython 8.0.0-alpha.1 on 2022-06-09; Adafruit QT Py ESP32-S3 no psram with ESP32S3
Board ID:adafruit_qtpy_esp32s3_nopsram
# secrets.py
secrets = {
"ssid": "Your SSID",
"password": "Your Wifi Password",
"timezone": "America/New_York", # Check http://worldtimeapi.org/timezones
"aio_username": "AdafruitIO_Username",
"aio_key": "AdafruitIO_Key",
"timezone_offset": "-14400", # New York timezon...
Interesting that worked for months for you - I know not your choice, but you have the hi speed signal wires of the screen sitting at the antenna - that's going to cause grief. Plus it's inside a case, reducing the antenna gain even more, and you have an I2C device hanging off the back next to the antenna - it's a worst case setup there - I'm surprised that ever worked for you at all ;)
That said, if it was working - and now it's not... I'm still perplexed as to what the reported problem...
It looks like your AP is just failing to assign the FS3 an IP address.
Have you tried rebooting the router?
Have you tried assigning a static IP in the DHCP list for the FS3?
Oh I said it was in that configuration since the day I got it. Didn't say it ever worked like the rest of my boards. I used to have an Adafruit S2 in there and that worked. Put your featherS3 in there and it's been non-stop reaching in there to hit the reset button. Can plug it in, run it once, and that works if I don't ever touch it again. That's how I have a pretty picture of it actually working. Try to work with the code in Mu or touch the USB drive to open a file on it and it crashes to t...
You wrote "First FeatherS3. Had it in this configuration for months. I love my little weatherstation. Just went through a hurricane with it btw."
Now you say it never worked properly?
I'm so confused and really have no idea where to go to from here.
Hope I didn't mess anything up.
For the text I used part of the original pico's & from adafruit shop
It works ONCE. If I touch the code or any file in USB it hard faults forcing a board reset. So it works... and it doesn't.
Now with the minimal sketch I've been able to connect reliably, waiting 5 minutes reloading, no errant behavior like I would normally get while it's connected to wifi in the main weatherstation sketch. Seems ok. Does this prove the culprit doesn't exist in minimal sketch? Now going to add adafruit_requests and try some basic GET requests to OpenWeather.
Remove Mu from all of this. Close it and keep it closed, and just use notepad.
Others have reported inconsistent issues using Mu on Windows. 1 person cant get the code.,py to reload when editing via Mu, and one cant always get the code.py to update on the device using Mu.
So please just use notepad and file explorer to test with.
Also, with WiFi, please ensure the channel you are using is 9 or greater for your testing.
Set channel=11. Wifi only works after hard reset. If I change the file the wifi doesn't work, will search for wifi forever no ssid.
Because I have it connected to a TFT I can usually see when it reloads, the screen will flash black, I'll see blinka in the top left corner, etc.. After sitting idle for a couple minutes, if I hit save in notepad++ nothing happens, no reload.
Hit reset, TFT reloads, searches and finds wifi, it will continue functioning normally in this state forever pulli...
Can you please work on a board that is not in the case or connected to anything... Too many variables, I want to focus on the wifi issues and the no reloading on a bare FS3.
I've had no reports of anything like this in any other dev platform other than CP - and only 3 instances of "code no reloading" as I mentioned above, and only in the last 2-3 weeks... and the FS3 has been out for > 8 months with no HW revisions.
So we need to track down what has changed from a CP point of view (IDF changes under the hood etc) and get some 100% reproducible steps under Windows and then see if they are reproducible on macOS and Linux.
If I work on a board not connected to a TFT and use notepad++ there's no way to know if it's connecting to wifi, successful GET request, or crashing. Without REPL I'm working blind so I don't see what that's going to accomplish. I can use VScode with serial monitor but I have to reload serial monitor with every reset doing ctrl+d which reloads the code which in turn refuses to connect to wifi because it's not monitoring the first run after a hard reset.
So many optionsโฆ.
- use the rgb led to show connection status
- Use the blue led on IO13 to show status
- Use โtioโ to monitor serial output as it does auto reconnect
- Use mqtt or adafruitio and publish results online
running this code now, let's call it minimal board only.
import wifi
import socketpool
import board
from digitalio import DigitalInOut, Direction, Pull
# Initialize WiFi Pool
pool = socketpool.SocketPool(wifi.radio)
# Init Blink LED
led13 = DigitalInOut(board.LED)
led13.direction = Direction.OUTPUT
try:
from secrets import secrets
except ImportError:
print("Secrets File Import Error")
raise
# Connect to Wi-Fi
print("\n==============================="...
Installed the new 8.0.0.beta1 released last night. Getting a bunch of different results now.
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
]0;๐Wi-Fi: off | code.py | 8.0.0-beta.1\]0;๐Wi-Fi: No IP | code.py | 8.0.0-beta.1\
===============================
Connecting to WiFi...
Connection Error: Unknown failure 4
Connection Error: Unknown failure 204
Connection Error: Unknown failure 204
Connection Error: Unknown failure 4
Co...
It's gotta be something wrong with my code. Just ran the adafruit QT Py S3 internet test code and it works once only after hard reset. https://learn.adafruit.com/adafruit-qt-py-esp32-s3/circuitpython-internet-test
]0;๐Wi-Fi: No IP | code.py | 8.0.0-beta.1\]0;๐Wi-Fi: No IP | code.py | 8.0.0-beta.1\Connected to SSID!
My IP address is 192.168.1.2
Ping google.com: 0.000000 ms
Fetching text from http://wifitest.adafruit.com/testwifi/index.html
----------------------------------------...
Sounds like CP is not handling the cleanup of wifi (or lower level) nicely on a soft reboot... could be related to this...
https://github.com/micropython/micropython/issues/8994
Might also be something else at the firmware level.
Have you tried rolling back to 7.3.0 or 7.2.x (cant remember what version initial S3 support arrived) and seeing if the same thing happens?
There is no wifi code cleanup at the end of that internet get code - I know the hole "should not need to" - but that assumes a device continuing to run... not a soft reset or even hard reset is reseting the PHY state properly.
What happens if you add wifi.wifi_radio_set_enabled(False) at the end of that code?
The autoreload issue is likely #6866 (which I tracked dosn to an ESP-IDF update - see my comment in the thread).
The autoreload issue is likely #6866 (which I tracked down to an ESP-IDF update - see my comment in the thread).
Yeah, these issues have all become intertwined and hard to track/ cross reference - well at least for me ;)
CircuitPython version
Adafruit CircuitPython 7.3.3 on 2022-08-29; Adafruit Feather RP2040 with rp2040
Code/REPL
import board
import pwmio
import pulseio
import time
# create a PWMOut object on Pin D6.
# duty_cycle (cycle/65535)
print("setting up pwm")
pwm = pwmio.PWMOut(board.D5, frequency=910 )
pwm.duty_cycle = 2**14
# create a PWMin object on Pin D5.
print("setting up pulses")
pulses = pulseio.PulseIn(board.D6,maxlen=100)
pulses.pause()
PUL...
While building a tool that syncs code to my board via web workflow, I noticed that even after syncing, some files had mtimes 32 minutes older than the file being copied.
I found that _reply_directory_json was using a 5-bit mask for the minutes field when decoding the file time, but the minutes field is 6 bits wide. This PR corrects the mask.
I have generalized the title of this bug.
@jepler @kattni @tlyu @caternuson I wrote a draft page for the "Welcome to CircuitPython" guide (it does not have to stay there) that documents port and board-specific limitations, mostly of built-in modules. I found all these by looking for placeswhere NotImplementedError was called, and then added a few more things. The page is not published, but you can view it at this temporary link: https://learn.adafruit.com/welcome-to-circuitpython/board-a...
CircuitPython version
Adafruit CircuitPython 8.0.0-beta.1 on 2022-10-01; Raspberry Pi Pico W with rp2040
# also seen on Pico w/ 7.3.3 & Xiao 2040 w/ 7.3.3
Code/REPL
# unknown; anecdotally associated with _some_ USB / serial activity
Behavior
*** PANIC ***
ep 0 out was already available
Description
A couple of Discord users reported this:
#help-with-circuitpython message
(...
@hathach May be of interest to you.
This page is really good. A couple of questions:
DHCP client not yet available.
Something beyond this?
>>> wifi.radio.ipv4_address
192.168.6.201
>>> wifi.radio.ipv4_gateway
192.168.4.1
>>> wifi.radio.ipv4_subnet
255.255.252.0
IPV4 DNS not yet available.
DNS lookups are available, but not setting custom DNS server(s).
Some of these errors, namely the ConnectionError unknown errors 2, 4, 15, and 204 seem to me to indicate partial connectivity issues with the AP. What is the RSSI for the AP (same BSSID if multiple APs share an SSID) shown from the device point of view (either wifi.radio.ap_info.rssi if connected, or via a wifi scan)? What is the RSSI for the device that's hopefully shown in the GUI of the AP / router?
@DJDevon3 This discussion has gotten quite complex. It may help to summarize at this ...
@anecdata The ESP32-S3 has a silicon bug when USB is being used with the radio on - there is a 2-3dB loss on lower channels... I Think 6 and below, so I just recommend folks go to 9 or higher if they can.
https://github.com/espressif/arduino-esp32/issues/2501 found some evidence this is an esp32 interference & module init problem. I have about 3-4 esp32 running at any given time next to each other. The handshake issue has existed for a while even affecting some magtags which I also have nearby. Also possible my router is having an issue with them. Hard to prove but can't rule out.
I am (still) busy trying to get I2CTarget working in a testscript. While studying the contents of the I2CTarget class inside the file CPY/shared_bindings/i2ctarget/I2CTarget.c, there is the function 'request'. In the docs text (also available in CPY readthedocs) the function definition defines parameter timeout and defaults it to -1. However in the function timeout is checked for a value of 0, while - looking at the function definition - timeout should be checked for a value of <= 0. The else if part checks for >0. Or do I misinterpret this code chunk?
In relation to the I2CTarget class. Where is taken care of the locking/unlocking of the I2C bus? Like in busio.I2C there are try_lock() and unlock(). Also bitbangio does have both lock() and unlock().
I can also refactor the notes on that page into the appropriate //| documentation in the source code. I think it may be good to have it in two places, sorted by port in one place and by built-in module in another.
I would have to look at it closer but at first glance the timeout does look like an error.
Again off the top of my head but the bus locking is in shared-bindings/busio/I2C.c as you said with try_lock() and unlock().
@onyx hinge (he/they)๏ปฟ perhaps you could reopen https://github.com/espressif/esp-idf/issues/6333 for visibility?
it doesn't look like they are going to reply otherwise
I mean it's 20 months...
@stuck elbow no there's no reopen button for me
we basically threw up our hands and moved on from doing audio on espressif family chips, and haven't returned to it either
@onyx hinge do you still have the code?
@stuck elbow not that I can find right away
oh well, thanks
I retested this with beta.1 and as far as I can tell it seems to be resolved. I've restarted several times with ctrl-c / ctrl-d as well as reset button and unplug / replug and never had beta.1 end up with the hard fault. It has always gotten the proper error:
ImportError: no module named 'adafruit_bme280'
I did also go back to beta.0 on the same device and verify I get the same behavior there, but beta.1 on same device has not had the same issue occur.
Closing for now as this ...
Intro
First a remark to the choice of the name of my branch 'i2ctarget_doc_text_mod'. This title was chosen because, initially, the (first) modification suggested in this PR was limited to the doc text of the function 'request' of the class 'I2CTarget' and the function signature inside that text.
As I will explain below, in this moment, the title of this PR is broader. This PR also contains a suggestion for a small change into the code of the function 'request'.
**Subject 1: Initi...
@onyx hinge PR created. See: https://github.com/adafruit/circuitpython/pull/6985
I just created a PR that also takes into account the range checking of the 'timeout' parameter of function 'request'
Great, and thanks! I'll take a look at the PR in more depth later but a quick glance it looks good (though I'm not sure on the .gitignore part)
Early hug report to @lone axle for the PR reviews today, I got behind on those type annotation ones ๐ตโ๐ซ
Happy to get some reviews in. I've been focused more on single issues last few weeks and hadn't made a pass thu the open PRs list in a minute. It's good to get thru some today. We need more hours in the day!
Testing out your fix in logger next.
I'll try to look at more of these too, they're usually not too hard. Quick question though (as I just saw this) for an init call would you have -> None as the return annotation? I just saw it in one PR but haven't in others.
Yeah, __init__() is called after actually creating the new object and only initializes it, so it doesn't actually return anything specific (hence None)
made clearer when you call super().__init__()
Cool just wanted to make sure it makes sense to use it there and it wasn't a special case because it was __init__
Yep, that was (and still is) one of the weirdest things to me, but is correct that __init__() will return None.
speaking as a python language lawayer, __init__ doesn't have to return None. It just does so by convention. This very contrived example prints "7" by returning something other than None: ```class Base:
def init(self):
return 7
class Derived(Base):
def init(self):
self.attr = super().init()
print(Derived().attr)
I can't think of an actual GOOD use for this though
This is the kind of rules lawyering I live for. That's interesting, I never thought to actually store the results of super().__init__().
But to your point, why would you haha
Yep, found it now. I had to release the library. I either forgot or was unaware.
There is something odd going on where github is reporting the workflows as successfully but also cancelled. I made a guess at the root cause and put in a PR in the Bundle repo for it. But after some further research I'm thinking it's possible that it's something more complex than what I tried to address.
@tulip sleet I was wondering if there was some way we could potentially combine blocks of doc from ports/.../common-hal next to the shared-bindings documentation, as part of the pyi extraction steps. I just don't know quite what it'd look like. Would you repeat the def ... exactly, and have the docstring be the added caveat? I might prototype this.
I don't think detecting that the implementation is going to throw NotImplemented is likely to work out super well
there were cases where NotImplementedError was not callled directly, and there were also a few false-flag cases
I was just going to put something in shared-bindings. We have to update that anyway when we add new arguments, etc., so I think it's the same kind of maintenance
so if someone added a new capability or fixed the "not implemented", it's part of the job to check the doc
@tulip sleet do you want to do the core section or shall I?
i can do it this week, I've skipped a couple of weeks
thanks!
i can talk about beta.1
yes please
you are much better informed than me on any given week
<@&356864093652516868> Hey! we're looking forward to chatting in about 25 minutes in the circuitpython voice channel! Please add your notes to the shared document: https://docs.google.com/document/d/1p3AthJvTLLbLhqsiL6_ZHBQkj7CUSQ_IOJdc9Dnu4Hw/edit?usp=sharing -- and if you just want to listen in, that's great too. See you in a bit
CircuitPython Weekly Meeting for October 3, 2022 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates early. During the meeting, we go through them as a round robin sorted by username. If you canโt make the meeting and would still like to part...
The easiest way to manage Hacktoberfest for the libraries is to add the Hacktoberfest topic to the repositories. I can easily add (and later remove) that using the gh CLI. This way reviewers don't need to worry about adding the hacktoberfest-accepted label. @idle owl does that sound good?
Yes please. And please update Adabot to do that automatically for the future.
You got it!
@proven garnet also how much work would it be to apply the hacktoberfest labels on the core just like in the libraries?
from what dan said it sounded like maybe that doesn't happen
thank you
Does hacktoberfest also include the Community Bundle? Iโve been spending a lot of time in there lately. ๐
If it doesn't, we can make it happen.
I think it's tied to issues / PRs so as long as those are created / labeled I think it should count. At minimum the PRs to add to the Community Bundle itself if labeled.
If you're PRing to the repos included in the bundle you probably need those authors to tag it (though the merge upstream to the bundle itself could count too)
Oh right, good call. We can't make it happen.
I like how even documentation is included, encourages participation where ever you can.
Ahhhhh I tried that Tandy keyboard for a few days but I'm so happy to be back on my usual tenkeyless.
the alt/ctrl key placement was just too weird
I think the repo maintainers could tag it though... maybe
Yes, if the authors/hosts of the repos do the labeling/topic adding, it would count.
But that's up to the person whose account hosts the actual library code.
stuff under https://github.com/circuitpython/ should be fair game too
@lone axle Can you do a backup recording today?
Yep, am all set up for it.
It's a good moment to mention that next week's meeting is on a Tuesday, due to a US holiday on Monday (Indigenous Peoples' Day)
Fytรณ is a cute IoT flowerpot that transforms your plants into pets. Making it easier for plant-owners to look after their greenery, the "device" is loaded with a series of sensors that let it trigger different emotions by measuring everything from the soilโs moisture, temperature, and light exposure.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ...
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
the blog is amazing, my favorite thing to read everyday
Expect those to be assigned before tomorrow!
@gilded cradle blinka is fair game for hacktoberfest pull requests right?
Yes, either the PR or the repo needs to be tagged "hacktoberfest" as I understand it
@turbid radish should we tag the circuitpython-weekly-newsletter as hacktoberfest, so that people who pull request news get credit for their contributions towards their hacktoberfest work?
No, I'd rather they be more substantive if that's ok
that's fine too, I wanted to ask!
[from djdevon3's updates]
glad to hear you made it through fine too Anne, and SLS too. ๐
thank you for that jepler, i always forget to do that stuff, multitasking not my forte
Continue turning our own CI process into composite actions so adabot isnโt needed to update them all anymore
โค๏ธ
oh my creating a gist from circuitpython creates a lot of possibilities
Yeah that sounds good, it'll work the same either way!
CircuitPython version Adafruit CircuitPython 7.3.1 on 2022-06-22; Adafruit ItsyBitsy nRF52840 Express with nRF52840 Board ID:itsybitsy_nrf52840_express Code/REPL ################## main.py ########...
Multiple instances for sample mixing is useful for music, too.
Just add in big red letters then, in all guides
that only one instance should be created ๐
@austere acorn thank you for the question though!
there are boards for music, that do have that much amount of flash and ram
but for "regular" use it should be made clear
that multiple instances kill a project
also, that issue can probably be closed then
cos there is no solution
(sorry, @idle owl, i'm done :D)
this space and time, and especially in the weeds, is for anyone in the community ๐
you bring up a good point for trying to streamline but audio mixer guys it's a touchy subject of possibly taking away a future hope/dream/tool ๐
@midnight ember this is the board for music ๐ https://www.electro-smith.com/daisy/daisy
Supply Chain: Stable Daisy is an embedded platform for music. It features everything you need for creating high fidelity audio hardware devices. Just plug in a USB cable and start making sound! Programming the Daisy is a breeze with support for a number of languages including C++, Arduino, and M
@austere acorn I'll write a few words on that PR and close it. Thanks for putting it In The Weeds because I was not concentrating on it; this made me think it through, which just having the issue hanging there might not have done.
๐
64MB of SDRAM for up to 10 minute long audio buffers, 8MB external flash + sd card
Thanks!
Thanks everyone, have a good day ๐
Thank you!
nope. wrong button ๐
thanks!
Also I think I need expanded permission to edit topics in the libraries
Either that can happen or if anyone has that and wants to run the script, that would work too
thanks kattni!
does it run circuit python though?
You are all quite welcome!
not YET ๐
Um.... I'll think on that.
ohh it's an M7 ๐คค
@lone axle Checking recording now to see if I need yours.
While the object should almost always be used "like a singleton", there are some uses for multiple MP3 decoders, used in conjunction with AudioMixer, and this is actually even possible on the samd51 if you're careful about doing it. (you create two MP3Decoder objects, both near the top of the script)
So, even though it would be helpful for simple programs if the MP3Decoder was actually a singleton, we don't want to foreclose on more complicated usage especially as microcontrollers get more...
Sounds good, if you can selectively choose permissions it should only be the topics permission or something like that. I'm not sure how it's split up.
@lone axle good "catch" that the actions happen in forks, and thinking about the consequences.
Does anyone know how to trim a few seconds off the beginning of a mkv file?
Sure, no problem, I was investigating it since I started with the Mp3Decoder issues, I wanted to check if I could help further
It's not necessary but would be nice ๐
Is anyone else having problems building the current main for Pico-W? I am getting an error in the pioasm module where cmake fails trying to build the C test (undefined reference to `_exit')
@idle owl I know it's possible with ffmpeg but I have to spend 10 minutes with the documentation to do even simple things
I've used an application called OpenShot video editor to make simialr small changes to videos. Not sure if it's available outside of linux though.
i have used vlc to do that
@uncut nexus that's odd. we're not seeing it when we build the core. what system are you on (mac/win/linux)? or ci builds on linux of course
It is!
Wait, really?
If it's quick / easy enough for you to upload it and share a link I can try to trim it and send back.
i think so, i don't remember how
https://www.vlchelp.com/cut-trim-videos-with-vlc-media-player/ ugh, it's playing and recording, never mind
does the output format have to remain mkv?
ugh, that's a bad way, let me find another
yeah vlc is not good for editing
@onyx hinge - using Linux (ubuntu 20.04) I've even tried spinning up a fresh VM and a fresh CP clone.
@idle owl - I think Audacity can handle mkv files (as imports)
@uncut nexus OK .. can you go ahead and do a "make BOARD=raspberry_pi_pico_w clean" and then a "make -j1 BOARD=raspberry_pi_pico_w" and then show the full output?
Oh fair enough.
our actions also uses ubuntu 20.04 as its linux flavor
Nice, I'll see if the file uploads. Thanks Dan!
Unsupported media
I'll try this OpenShot editor.
@onyx hinge - had to put is as a file; too long for chat
i just used clideo.com editor today, just searching for a free online editor. worked fine, adds a watermark though and unsure if it'll export to mkv.
If I edit build-raspberry_pi_pico_w/pioasm/CMakeCache.txt and add "CMAKE_C_FLAGS:STRING=--specs=nosys.specs" then it works
@uncut nexus that's odd! It's trying to use the embedded C copiler arm-non-eabi-gcc to build this program, which needs to run on the host computer. This could happen if your environment has the CC variable set to /nvme/circuitpython/gcc-arm/bin/arm-none-eabi-gcc, or at least that's the first possible cause I thought of.
The succeeding build says: -- Check for working C compiler: /usr/bin/cc - skipped while yours got a different value. Once you figure out WHY it got that different value, you'll be on track to resolve the problem.
I do have that set... building has always worked OK that way. Let me unset and see what happens
I think the recomendation is to ensure that the location with the embedded C compiler is on your PATH, not to specify it in the CC environment variable.
@onyx hinge - unsetting CC worked - thanks!!
OK! I'm glad it was something simple, even if not evident
I was setting CC in a setup script for building CP - will remove it.
With do_ntp I keep getting the error from tm = ntp.datetime
File "adafruit_ntp.py", line 80, in datetime
OSError: [Errno 116] ETIMEDOUT
after varying numbers of calls every 30 seconds.
Bruce
ntp uses udp which is an unreliable protocol. packets can get lost. if you wrap this in a try/except, can your program continue and have success on the next request?
- Fix #6839 by assigning corrected unique creation ids to two AI Thinker boards.
- Fix two
IGNORE_PAxxtypos toIGNORE_PIN_PAxx. - Fix a
NotImplementedErrorthat should be aRuntimeError. Discovered when inventorying unimplemented features.
@onyx hinge the PR is ready to be reviewed
Thanks! I fixed tests/pyboard.py which was incorrectly modified as part of this PR.
I reported a similar issue here: adafruit/Adafruit_CircuitPython_asyncio#29
The root cause appears to be the change from yield to await core.sleep(0) in acquire(). Using yield takes the lock acquiring task out of the task queue and it only gets put back into the task queue by the lock releasing task. Using sleep causes the acquiring task to put itself back into the queue after the sleep finishes and then acquire the lock even though it wasn't yet released because there isn't a check ...
Everything works fine on Micropython.
Just listened to the weekly meeting on YouTube and my mic sounded horrible. Audio was coming from my new webcam 5 feet away I used for the first time this morning instead of the headset. ๐คฆโโ๏ธ sorry about that
hacktoberfest topic added to all CircuitPython libs!
Is there a simple example/set of instructions for connecting to WiFi via Pico W in the 8.0.0 beta release?
@sgbaird
wifi works basically the same as espressif (esp32-s2), though not all features or properties are present at present
import wifi
import socketpool
import adafruit_requests
from secrets import secrets
TEXT_URL = "http://wifitest.adafruit.com/testwifi/index.html"
pool = socketpool.SocketPool(wifi.radio)
requests = adafruit_requests.Session(pool, None)
wifi.radio.connect(secrets["ssid"], secrets["password"])
with requests.get(TEXT_URL) as r:
print(f"{r.stat...
@onyx hinge .env syntax is kinda ridiculous.
k1=#
k2=##
k3= #
k4=# #
oh no are you looking at that issue now?
I can't even guess at the content of those variables
k1 is #; k2 is ##; k3 is the empty string, and k4 is #
that's what bash does
so they are attempting to copy that. It's kind of execrable
it's a comment only if it has preceding whitespace
oh yes when I put on my shell glasses it makes "perfect sense"
right, breaking up into words or something
$ k5=x#y; echo $k5
x#y
oof
at first I was worried it was counting to the last '#' or something
i half-fixed the issue, including the # inside single quotes
unichar_isspace() is true for \n; maybe Scott didn't realize that. That was one fix, and then I did a better check for # inside quotes
but I haven't yet fixed abc=#
if abc='#' works I think it's sufficient
or at least a good improvement over what's there
I think so too. it's a morass of loops and flags
there might still not be a way to include a literal ' ?
i didn't try that yet
@onyx hinge Is there any PiCow docs on using the port? I know there's no guide or anything, but did you doc it within the core?
@idle owl I didn't write any specific documentation to it yet. The response from Anecdata on https://github.com/adafruit/circuitpython/issues/6558#issuecomment-1266078988 is spot on though. The process of connecting & using requests or socketpool SHOULD exactly match esp32-s2 except where functionality isn't implemented yet
While the pico is listed on the Downloads page, it is not entirely clear how to use the newly added wifi connectivity with circuitpython. According to adafruit: https://www.adafruit.com/product/552...
Keen, thank you.
@onyx hinge one final haha:
in bash abc='def'#hi means abc is def#hi, but in python dotenv, it is def
:throws up hands:
yeah abc=d'e'f"g"h is "perfectly good" shell ๐ฌ
@tulip sleet Hey so... for the deep sleep thing. You said it only drops to 75uA if you do not "hold" any pins. Does that apply to shutting off the red LED, NeoPixel and/or I2C power pin? I guess I don't understand what "hold" means.
https://github.com/theskumar/python-dotenv#file-format "The format is not formally specified and still improves over time."
@anecdata thanks for the rapid reply! Figured out that the Pico W firmware isn't installable via Thonny yet (4.0.1), but installing directly from CircuitPython works: https://circuitpython.org/board/raspberry_pi_pico_w/
like a fine wine
I mean if you don't use preserve_dios in exit_and_deep_sleep_until_alarms()
Ok, so changing pins in your code.py is not even close to what you mean. Got it!
Thanks @anecdata -- that's spot on!
The new work on pico w implements these modules: wifi and socketpool, which are intended to be compatible with our Espressif port except for the NotImplemented items. This, in turn, allows modules like adafruit_requests to work unaltered. So, basically, try adapting examples for esp32-s2 and the rest of the Espressif family.
We're waiting on the outcome of trying to add ssl before writing any guides about this on adafruit.com.
on the ESP32 V2, If I don't fiddle with any pins, the "right thing" happens and it's 75uA
that is not true on the TFT boards
Ok, thanks. Wanted to make sure before testing it.
Hmm.
Weird.
Or maybe it's not weird. I wouldn't know.
I mean, you can set the pins to anything you want, and when you go into deep sleep, they get reset to a reasonable value, kind of by accident, on the ESP32 V2
assuming you don't use preserve_dios
Ok got it
(It does implement a new module, cyw43, but in most cases it's not necessary to import or use this module)
So, in CircuitPython, how do I get the unique ID? I'm used to from machine import unique_id from MicroPython.
xref: https://github.com/adafruit/circuitpython/pull/4141#issuecomment-1266237208 (how to get the unique ID in CircuitPython)
Fixes #6661.
This improves dotenv parsing, though there are probably still mistakes.
#in values immediately following=are included, instead of starting a comment. This is how such values are parsed in Unix shells.#s inside single quote values now work properly.key=with a blank value are now the empty string instead ofNone.- Character reading in
dotenvwas refactored a bit, and it's now 176 bytes smaller. - A manual test was included.
The syntax used for do...
So, in CircuitPython, how do I get the unique ID? I'm used to
from machine import unique_idfrom MicroPython.
Good places to ask questions like this are in https://adafru.it/discord or https://forums.adafruit.com.
@dhalbert thanks for clarifying!
Good places to ask questions like this are in adafru.it/discord or forums.adafruit.com.
Ah, right ๐ I keep forgetting that
You can use the return value from mp_arg_validate_int_range(). Or if you think it's clearer, you can assign the return value to a uint8_t, and then pass that. I'm not sure if doing the below makes the code smaller or the compiler is clever enough so it doesn't make a difference.
set_status_brightness((uint8_t)mp_arg_validate_int_range(mp_obj_get_int(lvl), 0, 255, MP_QSTR_brightness));
One very minor idea. You may demur.
I am going to make this a draft while we cogitate on this.
I approve very much of writing a test.
Thank you! I also ran the test and it seems OK. For backslashes inside single quotes it matches dotenv, but is different from (ba)sh, but that's OK. There's a way to enter a string containing literal ' and '#' characters now and that's great.
are these lines intended to be here?
oops, will force push a fix to that -- bad editing
Thank you! I also ran the test and it seems OK. For backslashes inside single quotes it matches dotenv, but is different from (ba)sh, but that's OK. There's a way to enter a string containing literal ' and '#' characters now and that's great.
CircuitPython version
Adafruit CircuitPython 0.8.0-beta1; Raspberry Pi Pico W
Code/REPL
"""
Based on https://gist.github.com/sammachin/b67cc4f395265bccd9b2da5972663e6d
http://www.steves-internet-guide.com/into-mqtt-python-client/
"""
import json
from secrets import secrets
import board
import digitalio
import busio
import socketpool
import wifi
import microcontroller
from binascii import hexlify
from adafruit_minimqtt.adafruit_minimqtt import...
I've just been trying to get time.localtime() to set the rtc on a macropad with unexpectedly mixed results,
most importantly setting the rtc with a tuple of 9 zeros can result in the board failing its next boot.
workaround: switch to the minimal rp2040 image on the macropad with the uf2 bootloader that still works
which will be enough to back up your code.py and remove it so you can switch back to the usual image.
That whole process and more about the USB Cable Time Protocol, I have documented here:
https://github.com/TheMindVirus/macropad/blob/archive/sketches/CableTimeProtocol/README.md
have you tried safe mode ?
I saw what safe mode looked like, it didn't seem to enter it, it just locked up instead, on circuitpython 7 and 8 but I had cp6 for the rp2040 with no peripherals so that was safe mode in this case
depending on where this happens, it either will or won't be able to action the switch to safe mode at the yellow LED blink, I think mine reached printing "code.py output" and everything before it
but also any C which is dependent on the RTC at that stage may get confused by an invalid value, mostly related to the rtc and time circuitpython modules
Same issue with a slightly modified version of https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT/blob/main/examples/minimqtt_simpletest.py:
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
import socketpool
import wifi
import adafruit_minimqtt.adafruit_minimqtt as MQTT
# Add a secrets.py to your filesystem that has a dictionary called secrets with "ssid" and
# "password" keys with your WiFi credentials. DO NOT share ...
Having some trouble with MQTT and Pico W https://github.com/adafruit/circuitpython/issues/6988. Used while True: try: ... except: ... retries also.
Hi! long time, first time, etc. I'm working on a PR for a variant of the esp32-s2-devkitc-1 that hasn't been added yet, and I just wanna make sure I'm editing the ci_check_duplicate_usb_vid_pid.py file correctly. I'm on Windows, so I plugged the board into the UART micro usb on the board (and into my computer), and this is what shows up - do I need to add a new entry for this VID/PID, because this combination isn't in that file yet
I don't know why the exception is blank, but it's possible it's an ETIMEOUT from losing the wifi connection, you could try to add explicit wifi reconnects before polling.
Would that be something similar to a MicroPython implementation:
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect(SSID, PASSWORD)
# Wait for connect or fail
max_wait = 30
while max_wait > 0: # type: ignore
if wlan.status() < 0 or wlan.status() >= 3: # type: ignore
break
max_wait -= 1
print("waiting for connection...")
sleep(1)
# Handle connection error
if wlan.status() != 3: # type: ignore
raise RuntimeError("networ...
Well, the paradigm is a little different, and the implementation is early. There is no equivalent to MicroPython's wlan.status. At the moment, you would try wifi.radio.connect(SSID, PASSWORD) blindly, there is no harm trying to connect if already connected, it becomes a NOP internally.
In the Espressif port, the presence of an IP address signifies connection to the AP, but I believe the uP/CYW43 driver has issues with that <https://github.com/micropython/micropython/issues/9455#issueco...
Oof, I made a mistake. It's erroring out during client.subscribe(...) not during client.connect(...).
There is no equivalent to MicroPython's
wlan.status.
Would this be helpful in writing network libraries or user code? If it's possible, maybe we should consider adding it.
@dhalbert I would be helpful for testing for now at least. Also some equivalent of uP is_connected perhaps. My vote would be to mirror espresif and manage the existence of IP address to signify valid connection, but the cyw43 driver may not make that easy.
This is a relatively new board, purchased from here, apparently first released August 10th 2022. The official pinout is available here. It is very similar to the N4R2 version that is available for CircuitPython.
I got the majority of my code from #5998, so thanks to anecdata for that!
I would appreciate if somebody could review my changes to c...
I redefined _wait_for_msg in adafruit_minimqtt.py as:
def _wait_for_msg(self, timeout=0.1):
"""Reads and processes network events."""
# CPython socket module contains a timeout attribute
if hasattr(self._socket_pool, "timeout"):
print("self._socket_pool.timeout exists")
try:
res = self._sock_exact_recv(1)
except self._socket_pool.timeout:
return None
else: # socket...
Turns out it was an issue with the timeout during _wait_for_msg. I increased the default timeout in _wait_for_msg from 0.1 to 1.0, reverted the other changes I made (print statements, etc.) and got the following:
Connecting to <SSID>
Connected to <SSID>!
Attempting to connect to test.mosquitto.org
Connected to MQTT Broker!
Flags: 0
RC: 0
Subscribing to test/topic
Subscribed to test/topic with QOS level 0
Publishing to test/topic
Published to test/topic with PID...
Looking less like the wifi connection is dropping. Since Pico W is alpha, do you have an ESP32-S2 to try this code on for comparison?
@anecdata unfortunately I don't have one on hand
What you are showing is the VID/PID of the CP2104 chip on the UART port. The VID and PID set in Circuitpython is for the native USB port of the board, and must be unique (mostly...) and properly allocated by a VID owner.
In this case, it seems that you should use the common espressif_esp32s2_devkitc_1 PID allocated by Espressif, and therefore add it to the existing list for that VID/PID in the duplicate check.
I made the changes in the suggestions.
I didn't look at the other files.
USB_VID = 0x303A
USB_PID = 0x7009
"0x303A:0x7009": ["espressif_esp32s2_devkitc_1_n4", "espressif_esp32s2_devkitc_1_n4r2", "espressif_esp32s2_devkitc_1_n8r2"],
_wait_for_msg() can take a timeout, but it looks like none of the code that calls it uses that kwarg, I think tyoically there would be a calll to .loop() in user code, and that takes a timeout, but I don't see it getting passed down. Just from a cursory look. Maybe this issue should be moved to the library?
Thanks, this is exactly the feedback I was looking for!
When I use the native USB port on the board instead, I show a VID of 303A as expected, but a PID of 0002, should I create a new entry for that PID?
no, Circuitpython defines the pid and vid, what you see in windows has nothing to do with that. Use the changes I indicated.
_wait_for_msg()can take a timeout, but it looks like none of the code that calls it uses that kwarg
At first glance, timeout is present but looks inaccessible to me:
https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT/blob/f2cb3bbe830f05cb75cd397fe83803ee1e59946b/adafruit_minimqtt/adafruit_minimqtt.py#L879
Maybe the call to _wait_for_msg during connect uses the timeout value? I recognize I might be way off here.
Changing timeout to a low value like 0.01 (or ...
That last part is in the context of these lines:
if error.errno in (errno.ETIMEDOUT, errno.EAGAIN):
# raised by a socket timeout if 0 bytes were present
return None
raise MMQTTException from error
I'm hitting my limit here for now. I'm having trouble tracking down why it's giving OSError: -1 and what that means. If you think this should get transferred to minimqtt repo, I'm fine with that.
I've gotten as far as:
if not self._backwards_compatible_sock:
# CPython/Socketpool Impl.
rc = bytearray(bufsize)
self._sock.recv_into(rc, bufsize) # OSError originating from here (probably)
Hi, is there the possibility of a port of CircuitPython 8 for SQFMI Watchy?
https://github.com/sqfmi/Watchy
It is equipped with ESP32 PICO-D4, like Unexpected Maker's TinyPICO, but without PSRAM.
https://watchy.sqfmi.com/docs/hardware
https://circuitpython.org/downloads?q=TinyPICO
Thanks!
Hi, is there the possibility of a port of CircuitPython 8 for SQFMI Watchy?
https://github.com/sqfmi/Watchy
It is equipped with ESP32 PICO-D4, like Unexpected Maker's TinyPICO, but without PSRAM.
https://watchy.sqfmi.com/docs/hardware
https://circuitpython.org/downloads?q=TinyPICO
Thanks!
@saraceni-andrea but it's nothing like a TP Nano - in term of IO used and functionality, so please create a new issue and post your request there as it's not on topic for here, sorry.
yeah, this seems related to #101
Sounds like you are seeing this consistently every time on the Pico-W(?)
I don't typically get OSError at the same point you are seeing it (during subscribe)
I do get OSError occasionally at other times, though I think in my case that is due to a connectivity error generally, not MQTT specific.
I'm also running a watchdog timer to reset the system if it hangs. Which happens too often for my liking.
Particularly in _wait_for_msg and _sock_exact_recv. ...
Not sure if this is related to the implementation, but whenever I use adafruit_httpserver and run a basic example, like reading a i2c sensor on demand (via http request) all my browser receives is a "ERR_CONNECTION_RESET"
Now the same setup but using ampule as server works just fine, is there something I'm missing?
On a side note, I also sometimes encounter ConnectionError: Unknown failure 205 during radio connect, but I cant rule out my network setup being the cause.
Question: After a successful merge of a PR yesterday, I downloaded and flashed the 'latest' for an Adafruit PyPortal Titano and an UM PROS3 with the intention to try the changes. The boot_out.txt of the PROS3 shows ยซAdafruit CircuitPython 8.0.0-beta.1-4-g1fd09cb6d on 2022-10-04; ProS3 with ESP32S3' while boot_out.txt on the Titano seems not to be 'latest': Adafruit CircuitPython 8.0.0-beta.0-49-g14fc4a079 on 2022-09-14; Adafruit PyPortal Titano with samd51j20'. How come?
Try looking at https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/pyportal_titano/en_US/ again. The build you are listing is way down the list (20220914). What is the name of the UF2 you loaded on the Titano?
maybe try loading again
Thank you for contacting GitHub Support and sorry for the time taken to get back to you, we have had quite a backlog.
I got a reply on the github support ticket I filed about the cancelled jobs. No actual update.
Excuse me I made an error! Flashed a wrong one. Thank you for your advice!
np ๐
Running S2 internet test found here: https://learn.adafruit.com/adafruit-esp32-s2-feather/circuitpython-internet-test
]0;๐Wi-Fi: No IP | code.py | 8.0.0-beta.0-72-ga7b10d41b\]0;๐Wi-Fi: No IP | code.py | 8.0.0-beta.0-72-ga7b10d41b\Connected to UAC 2.4!
My IP address is 192.168.1.215
Ping google.com: 139.000000 ms
Fetching text from http://wifitest.adafruit.com/testwifi/index.html
----------------------------------------
This is a test of Adafruit WiFi!
If you can read this, its...
When code exits, wifi deinits and the connection is dropped.
Hadn't seen this before beta-1, but I didn't think anything related had changed for espressif:
On reload of Adafruit CircuitPython 8.0.0-beta.1 on 2022-10-01; Adafruit QT Py ESP32S2 with ESP32S2 (also replicated on Feather ESP32-S2 TFT):
import time
import traceback
import microcontroller
import wifi
from secrets import secrets
time.sleep(5) #wait for serial
print(f"{"*"*40}")
errs = 0
while not wifi.radio.ipv4_address:
try:
wifi.radio.connect(secrets['ssid'], secrets['password'])
time.sleep(5)
except ConnectionError as e:
# ConnectionError: No network with that ssid
# ConnectionError: Unknown failure 2
traceback.print_exception(e, e, e.__traceback__)
errs += 1
if errs > 8:
microcontroller.reset()
while True:
print(f".", end="")
Result:
ConnectionError: No network with that ssid (usually)
or
ConnectionError: Unknown failure 2 (once)
Fixed by microcontroller.reset() but not by reload.
Web Workflow is not enabled.
.. it needs to operate on a FILE* rather than FIL depending on the build.
Note that this is comparing output to expected, not to cpython dotenv package at runtime. Because run-tests.py starts the CPython interpreter with the '-S' (skip site initialization) flag, pip-installed packages are not available for import inside a test file. Instead, the exp file is generated manually:
circuitpython/tests$ python3 circuitpython/dotenv_test.py > circuitpython/dotenv_test.py.exp
Unfortu...
@tulip sleet if you can take a look at ^^^ if you don't mind, I'll just drop test case "e15" as unsupported in our version and mark it ready for review.
that looks like https://github.com/adafruit/circuitpython/issues/6866
I think that is fine. I think I can fix that, but can do that in another PR.
we've been having that reload instability for wifi for a little while now, mitigated by enabling auto connect as I assume it keeps the connection during reloads so there's no reconnect to fail
I don't mind if we just declare the e15 format (trailing space on variable name) unsupported and remove the test case.
OK by me, I thought I had this working but I went through my test results and it was not. I think it's fixable -- I will work on that.
yes, I had seen it with scanning, but not connection. Now it's consistent with connection, on several boards, but again only when web workflow is Off. With web workflow on, like scanning, connection behaves fine.
Append to same issue, or separate issue?
even doing py wifi.radio.stop_station() wifi.radio.enabled = False wifi.radio.enabled = True wifi.radio.start_station() which is the closest thing we have to deinit, allows connection to work on reload with web workflow on, so I think it's a little deeper than the autoconnect
CircuitPython version
Adafruit CircuitPython 8.0.0-beta.1 on 2022-10-01; Raspberry Pi Pico W with rp2040
Code/REPL
from gc import mem_free, collect
from sys import exit
targ_mem = None
mem_offs = 69420 # offset to add, value set to allocate the needed ram
# tests
# for loop test
for_t = False
# int test
int_t = False
mem_offs = 0 # revert the value to 0, so we can actually use it
# script begin
def memstep(fail=True):
global ta...
yeah, this seems related to #101 Sounds like you are seeing this consistently every time on the Pico-W(?)
I've been seeing it consistently on the Pico-W when I'm using MQTT with a _wait_for_msg timeout of 0.1 or less for a single subscribe+publish test example. However, regardless of whatever timeout I set, when I try to use while True: loop() or some variant of try-except or sleep(...), I get the OSError (which seems to be detrimental to MQTT properly receiving messages when I i...
I think at this point we need somebody to dive in the code, look at the changes made in the IDF in PR 6531, run a debug build and such ๐คท
disabling the radio before connection also makes it work without web workflow
wifi.radio.enabled = False
wifi.radio.enabled = True
```fixes scanning too when web workflow is not enabled
something is not de-initing or initing right in the non-web-workflow path
I'll add this to the issue
Testing on:
Adafruit CircuitPython 8.0.0-beta.1 on 2022-10-01; Adafruit QT Py ESP32S2 with ESP32S2
Adafruit CircuitPython 8.0.0-beta.1 on 2022-10-01; Adafruit QT Py ESP32S2 with ESP32S2
Turning web workflow on makes the scanning (and connection) more reliable. The following code, executed before a wifi scan or wifi connect, also fixes the exceptions for me:
wifi.radio.enabled = False
wifi.radio.enabled = True
It seems that something in the non-web-workflow path in CP 8...
Late hug report to @idle owl for helping add the hacktoberfest topic to the libraries!
Also I don't have topic access, so I know I said I'd add it to the core repo but I actually can't
Found possible old bug correlation https://github.com/adafruit/circuitpython/issues/3712 Todbot reported exact symptoms I have. Maybe the bug came back?
Hug to you for the script!
I'll do it.
Oh someone else did.
def print_string_foolishly(s):
for c in s:
# status display update could occur between writing any two characters
# wrecking the escape code we're trying to write in a foolish way
print(end=c)
print_string_foolishly("\033[H\033[2H") # clear screen code
```am I wrong about this being a potential problem?
I guess anything sending escape codes itself should just disable the status line
My APs don't have DHCP either. Depending which AP a device connects to, it's path is: device --> one of several APs --> [some paths via one or more of several managed switches] --> router.
@proven garnet There's a step for setting up library repos that you're missing or maybe can't do anyway. We need to find out if you can, and if not, add it to the things you ask me to do in the end before closing the setup issue.
yes, it could be a problem. These in-band status things are ... not great. Yet another reason to be able to disable status bars, which is now available.
I don't know if it's a bug, but Hacktoberfest is listed twice in the sort issues drop down on circuitpython.org, not sure it's related
Well, there's that at least. Um.... file an issue on the circuitpython-org repo about it.
Not sure if it's an Adabot or -org issue.
In dotenv, a key with a space before the = is not handled correctly, as noted in #6991.
Wait.... isn't time.monotonic() in ms?
This "fractional seconds" crap is useless to me, in the first doc that popped up.
no, seconds
Ok. Got it.
TBH I am not confortable with the status bar being sent outside of the REPL (or "Code done running." state) by default, even if it can be disabled. (Not to mention that you can't easily enable the Data CDC on ESP)
there is ticks_ms somewhere too
in microcontroller or in supervisor or something like that
The disabling is sticky across VM restarts. The primary reason for doing it outside is I think to show status when the web workflow is starting up, since there can be a significant delay when that is happening. But feel free to open an issue about this.
@tulip sleet I'm testing this. https://github.com/adafruit/circuitpython/issues/6676 They ran into the same thing I did with the value parameter on PinAlarm. It cannot be set to True apparently. Nearly everything was not working properly - the TimeAlarm did not execute, the Pretending to deep sleep until alarm message did not show up, there was no way to interact with the board through the serial console (ctrl+C/D did nothing), and if I made changes to the code and saved, I had to press the reset button on the board to make the changes happen. THEN.... I changed the PinAlarm parameter to value=False, and suddenly everything worked right again. So this is not a bug with running Time and Pin alarms in conjunction, it's a bug with being able to set a PinAlarm to trigger when high. I ran into this with my original LoRa Mailbox project, and was told I must use a NC reed switch and if not switch.value because that wasn't "how PinAlarm worked."
So at this point, we either need to document that it can't be used that way, or figure out the reason and fix it.
Unless I'm missing something.
I can put all of the facts in the issue, but I don't want to issue the "solution" if I'm wrong and completely missing something.
different pins have different requirements about when they trigger. Triggering when brought low is typical; which pin on which board is what to know.
Ok....... it's D12 on a Feather ESP32-S2. How the heck is anyone supposed to know which pin can do what?
well, we need to document it, if that's the case, and maybe it's a bug that we thought it would work rising, not falling. Is that the only pin specified? Sometimes it's "one pin can be either" if only one pin, but for two pins, it might be "falling only"
it could be our misinterpretation of the doc, or it could be a coding bug
What do you mean the "only pin specified"?
Anyway, a really simple example with D12 in an issue would be great, and I will test it.
You can specify more than one pin alarm at once
No, it's only one.
One pin, one time.
Let me simplify this further, and I'll send it to you.
@tulip sleet Do you want the time alarm stuff in it at all? It does all the same weird stuff without it.
nope, simplest possible
Do you mean the transferring?
No, I mean giving the CircuitPythonLibrarians team write access.
Ohhhh gotchya
I typically don't have access to the Settings tab in a repo, if that's where you do that
@tulip sleet
That is where you do that, and it requires further authentication inside that. So, when you ask me to add the webhook, please remind me to update the settings, and add the CPLibians with write access. Thank you!
๐ and just specify the board in an issue, can be a very short issue. There are no external pullups/pulldowns on the pin, is that right?
No, I literally used a jumper wire to tie it to GND or 3V
There's nothing else.
Create a new issue?
No, it starts off nothing and then I try to connect it to the opposite pin
try starting off low and then bring it high
because it was already kinda high, maybe
you got it!
Right now, it's showing the "pretending to deep sleep" message even
Which it doesn't do on save otherwise.
set pull=True when creating the alarm, that will set a pull opposite from what value= is
That is so confusing.
also edge defaults to false,
I've never set edge
I would set edge to True, since you are looking for a transition from low to high. But i am not sure if edge is available on ESP32-S2
File "code.py", line 7, in <module>
ValueError: Cannot wake on pin edge. Only level.```
ok, then just set pull
sorry, sudden dishwasher repair diagnosis needed. Yes, value and pull to true, and then move jumper to +3v to trigger. If that doesn't work try value=False, pull=True, and move jumper to ground.
CircuitPython version
Adafruit CircuitPython 8.0.0-beta.1-6-gb62f8b35e on 2022-10-04; Adafruit Feather ESP32S2 with ESP32S2
Code/REPL
import board
import alarm
print("Alarm:", alarm.wake_alarm)
pin_alarm = alarm.pin.PinAlarm(pin=board.D12, value=True, pull=True)
print("Entering deep sleep.")
alarm.exit_and_deep_sleep_until_alarms(pin_alarm)
Behavior
While connected to the serial console, it prints Entering deep sleep. and then nothing....
TimeAlarm and PinAlarm work fine together if the code is updated so the value=True parameter for PinAlarm is changed to value=False and you connect pin D12 to GND instead of 3V. The issue is with the way PinAlarm works, not with using the two types of pins together. This issue is resolved.
I have created a new issue for the PinAlarm-specific issue: #6994.
Sorry I didn't expect this to be more instruction, so I filed the issue.
I closed the other issue as well.
Assigned the PinAlarm one to you, @tulip sleet - you can unassign it if that wasn't the plan.
i'll try it and see what's going on, might be a doc issue if there are restrictions on what the pin can do.
Right, that's what I was saying earlier.... maybe we need to document it better, or maybe it needs a fix.
@lone axle https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_FlipClock was going to get a release after a PR merge, but doesn't have one yet. Want me to release it at 1.0.0?
Yes please, and thank you!
Until 6866 is resolved, I'd suggest running CP8 as follows:
- run web workflow if possible, even if not needed functionally (I know you said there are issues there)
- avoid wifi scanning if possible, particularly after a reload (reset seems to be OK)
- insert the following before calls to
wifi.radio.connect():
wifi.radio.enabled = False
wifi.radio.enabled = True
oh thank god, that issue is driving me insane. finally someone was able to confirm it's not just me.
happens on my UM featherS3 too
but not on my QT Py S3
I had never seen it and I've been trying to figure out why... probably because I only do a scan at startup in some code, but it's rote and I don't usually watch that, and; I almost alwatys disconnect wifi after I use it, then reconnect when I need it again
maybe worth looking into the qt py to see what the difference is? qt py works great for me.
I've focused on S2 for now, since we know that to be more stable... once the S2 quirks are well understood, then why S3 may behave differently becomes an easier question hopefully?
it is weird for different boards with the same basic chip to behave differently in fundamental ways
generally, when I get something working on one S2, I have high confidence it will work on all S2s
well it happens on both my S2/S3 so the qt py s3 is the only espressif board i have that works right. figured maybe it could be relevant. i'm totally fine if you can fix the S2 first... i just need one of those boards to work right don't care which.
yes I do hope someone can narrow down and fix 6866
sounds good. i'm just relieved someone else was able to see it exists. everything was pointing at my PC and not the boards and i was coming up completely empty and frustrated. this is a HUGE weight off my chest just to know it's a real bug.
I think you raise several distinct issues in 6791, the CP8 quirks with non-web-workflow only explains a couple of them
yeah the hard fault is a separate leftfield issue. the more pressing issue for CP in general is that hard reset bug.
but combine both the hard reset bug and hard fault bug for my UM FeatherS3 and it's practically unusable. ๐ฆ just the way it goes sometimes.
I'll try some S3s for grins
I think all I have is Espressif DevKits and UM boards
oh, and Adafruit Feather S3 TFT ๐
(I need my PSRAM, so I didn't jump on the S3 QT Py yet)
well, got unexpected results on S3 so went back to S2 and now I can't even fully reproduce what I did an hour ago. So. Many. Variables. Web Workflow is a cure for many ills. Not so much for disabling wifi.
we need a diff for simulating executing one code path in the core vs another
It might be a capitalization issue as I see two different tags in the list, with and without a capital H
<img width="752" alt="Screen Shot 2022-10-04 at 4 49 30 PM" src="https://user-images.githubusercontent.com/67276/193937020-5ae43aea-988c-4890-be42-b2d8b40466b2.png">
-
Fixes #6935.
-
Adds
_asyncio,array,builtins,collections,io,select, andsysto the RTD Module Support Matrix. -
Adds
CIRCUITPY_xxxcontrols for the modules above, needed to have the support matrix constructed properly. This adds more regularity to feature selection, and also anticipates some of the work needed when some modules are moved fromextmod/toshared-module/, -
Undo some ambiguous cross references, now that
builtinsis included.builtinsincludes...
I didn't spot any problems. Thanks for the grammar & other doc fixes too!
Well you're not alone. Using a metro Esp 32s2 I was on the nightly from sept11, tested the wifi radio enable toggle and it worked. I reliably got the same number of wifi access points as I did from a hard reset. There were some ap's that varied but they were the ones with a weak signal and they were inconsistently in the hard reset scan so it just seemed like it was consistently difficult to see signal.
But then I wanted to make sure the 8.1 beta behaved the same, so I upgraded to that, and couldn't get the scan working off of soft resets even with wifi.radio.enable toggled between false and true. So then I erased flash and tried the beta, and toggling the wifi and it didn't work. So now I've erased flash and went back to the sept11 nightly and have the toggle in and it's not working any more.
So I can't duplicate what I was doing before with the same code on the same version of circuit python.
I think I'm going to try the 7.3 release, not erase flash, 8.1 release, and the toggle and see if that works, but it's really me grasping at straws trying to figure out how to get back to the wifi.radio.enable toggle working
Well now that didn't work either. I have no idea how to get it back into a state where the wifi.radio.enable being set to false then true gets the scan working again.
@crimson ferry @ember iris I took a brief look at the wifi init code in 7.3.3 vs 8.0.0-beta.1, and I nothing missing stands out immediately. A couple of things are done only once, ever (even between soft restarts), but that is true in both versions. I'll look at this more in the near future.
thanks @tulip sleet, this one is having me question the nature of my reality ๐
I did a bisect that landed on an update to IDF
yeah, and there were a half dozen CP changes along with it, but none that seemd relevant
I missed that you did a bisect. That says a lot.
same
CircuitPython version
Adafruit CircuitPython 8.0.0-beta.1 on 2022-10-01; Raspberry Pi Pico W with rp2040
Code/REPL
try:
with requests.get(TEXT_URL) as r:
print_timestamped(f"{REQUEST_INTERVAL_SEC} {r.status_code} {r.reason.decode()} {r.content}")
except OSError as e:
# Pico W becomes disconnected:
# OSError: [Errno 2] No such file/directory
print_timestamped(f"{e} IPv4={wifi.radio...
Thank you, the other bit I think we've confirmed is that in the circuit python 8 builds, each soft reset uses up a bit of the ram set aside for initializaiton and after a number of loops there's a memory error as a result. @crimson ferry On that note, while I can't make this happen again, when the wifi.radio.enable toggle was working, the code still ran out of memory eventually. That was the initial reason I moved from the sept11 nightly to the 8.1 beta--I didn't want to say it was still an issue if it had been resolved.
@ember iris gotcha, I didn't run it long enough to see the memory issues... CP heap (gc) and not esp-idf?
It was the esp-idf heap that ran out, the CP gc.mem_free() showed the same amount the whole way through
ok, leak in the idf, that's interesting
Yup, at around 32 bytes each soft reset, but it does vary to 30 and 34 and more/less some times
I'm trying to add a library to the CircuitPython bundle. In the Learn Guide (https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-in-the-community-bundle) it says And then we'll verify it worked by looking at the build log and versions file. - where / how do I do that? I'm not understanding the included screenshot. Do I have to build something? (This is the library /issue: https://github.com/adafruit/Adafruit_CircuitPython_BLE_File_Transfer/issues/15)
Are you trying to add to the Adafruit CP bundle (which I'm assuming as that library is an Adafruit one). That guide is to add to the community bundle I belive
you can skip that, it's possible to build the bundle locally to test, but the Adafruit bundle is not setup like the community bundle is
the CI will do the test
Yes - Tekktrik linked to the Community Bundle learn guide in that issue, so I was guessing the process was the same
the guide mixes things, it references docs/drivers.rst which is for the Adafruit bundle
so I did the git submodule add, now I'm looking at the drivers.rst file
Oh wow that's oversight on my part
I should have specified the Adafruit CircuitPython Bundle
I didn't see that the guide referenced the Community Bundle
Sorry!
is there a guide for the Adafruit Bundle ?
Just my first time, wanted to make sure I get it right. :). CI is building it now, we'll find out
I don't believe so, that's the general guide for add to bundles in general, or just general library creation really
I don't think there is ? It was mentioned that the guide should be updated, or the bundles should change structure to match with each other
It passed CI if you want to take a look to see if I got it right: https://github.com/adafruit/Adafruit_CircuitPython_Bundle/pull/406
@jaunty juniper you look at them often but I'm free if you want me to take a look
maybe have the BLE libraries in alphabetical order ?
didn't even think of that, good idea!
I think I'll leave Bluefruit at the top though, probably one of the more popular?
~~You're welcome ~~ sorry ๐
This was fixed on the 8.0.0 development line in #6450 and perhaps should have been backported to 7.3.x. Try with the 8.0.0-beta.1 release, and I think it will work for you. There are a number of other PulseIn improvements in #6450.
I only see that we use timers in a similar way in frequencyio.FrequencyIn. So I'll test whether it's accurate or off by a factor of two.
Maybe I'll give
timeout=0a try. When you do this, you still usesleepin the while loop, correct?
Sleep should be fine. Although I actually use the pattern
if time.monotonic() -timestamp > interval:
timestamp = time.monotonic()
loop()
(so it doesn't block other code from running)
Iโll have to add some exceptions to my firewall which is a pain to get at and in disarray after moving into a new place. Intend on running Ethernet this winter when my attic isnโt 120F death trap. Might take me a while to get at the firewall stuff.
I canโt run web workflow wired and especially not wirelessly because port 80 is taken. Melissaโs guide says it doesnโt like running on anything but port 80 right now. Thatโs a problem for me and most lan admins even if itโs only on a loopback....
From my experience I agree with your findings. Scan only detected strong signals and only ones that were on the same channel. I had my AP's set on autoscan and the time they both showed up they were both on channel 6. All the other 10 or so weak SSID's that normally populate from my neighbors were absent.
I infer from the guide that it's just the online Code Editor that hasn't been tested on other ports. The local file browser and code editor should be fine.
But you don't ewven need to use any of those tools to get the connection and scanning benefit. Simply having web workflow enabled seems to improve scanning and connection behavior. Web workflow could be enabled on an alternate port, like 8080, in the /.env file, then just forget web workflow exists and do things over USB or standalone...
Tested on builds slightly past 8.0.0-beta.1. Tested on Feather ESP32-S2 and ESP-S3, and also Metro ESP32-S2 (using IO11 and IO12).
import board
import pwmio
import frequencyio
import time
pwm = pwmio.PWMOut(board.D11, frequency=150000, duty_cycle=32768)
freq = frequencyio.FrequencyIn(board.D12, capture_period=5)
while True:
print(freq.value)
time.sleep(1)
Running the above on Feather ESP32-S2 or ESP32-S3 causes safe mode into HardFault Handler or Int...
Pushed to 8.x.x because of #6998.
You may want to start working on this post #6913 as the current PCNT and GPTIMER drivers used by FrequencyIn have been deprecated in idf-v5.0 and replaced with a new api.
Huge caveats:
- This PR actually resizes the area for CIRCUITPY. This means that upgrading to this firmware, or subsequently downgrading to an older firmware, will erase CIRCUITPY. This means that switching between pico and pico_w firmware will erase CIRCUITPY. BACK UP YOUR CIRCUITPY BEFORE TESTING THIS PR
- This PR does not yet validate server certificates. This means that https URLs do not actually provide higher security than http URLs, because a "server in the middle" need n...
Btw this bug is still alive and kicking in daily builds

Same caveat as my comment on issue 6791: the wifi.radio.enabled sequence isn't repeatable. I tested it somewhat extensively yesterday afternoon, but wasn't able to replicate it later. @KeithTheEE reported a similar [inconsistency](#circuitpython-dev message). Some odd fluke that made it work for a while, but not again, so quite puzzling.
@bill88t what are you using as a terminal program?
If you are wondering, yes it does support ansi escape.
I can vouch for it, as I developed all of jcurses with it.
Jcurses uses most ansi escape sequences and I would have noticed if something was broken.
Also might I suggest a potential workaround?
Wouldn't it be possible to test if a terminal was present with a cursor query?
Like I mean asking (with ansi escape) the cursor position..
If it responds, it's connected. If it doesn't, it's not.
Only when it answers to size queries should...
A query could also appear as junk, since it's in-band just like the title sequence. Right now I am testing whether the USB connection is up. I don't send the title bar sequence at all if, at the beginning, the serial connection is not yet up.
I am not sending the title sequence to stdin; I am just sending it to the serial connection as output. At the lower code level I am sending at, there is no stdin or stdout: it is below that. It should not be appearing as input at all, so some od...
Kde Konsole.
That's the terminal program you're using, but what are you using to connect to /dev/ttyACM0, or whatever? E.g., are you using tio, or picocom, or something else? What is the exact command line, and what settings (including an initialization file, if any) are you using?
E.g., I am using gnome-terminal and tio.
I am using GNU/screen for that screen /dev/ttyACM0 115200
I want to quickly test RAM benefits of freezing some python code in firmware on a custom board. I see there is not much in the way of suggestions including my own code (shows suggestions for using existing Circuitpython libraries)
Should I just use the suggestions methods from Micropython, or is there a recommended method for this. Ideally I keep these with my board folder that holds my custom board information.
For example using the manifest file
https://docs.micropython.org/en/latest/reference/manifest.html
Adds ability to extend CIRCUITPY storage by utilizing the next update partition on boards with dualbank support.
The ota_x and user_fs partitions are presented as a continuous flash storage block with user_fs always forming the first part and the second part is one of the ota_x next update partition. These partition may not be contiguous in the partition-table.
Couple limitations as re-sizing filesystem without erasing isn't supported currently:
- Filesystem needs to be ...
๐ฅณ #7000 is here ๐
Not tested but looks fine by me.
Is anybody else seeing GitHub Actions not running when it otherwise should be?
@onyx hinge @analog bridge Something is up with GitHub Actions. The two most recent PR's have not run anything.
githubstatus.com reports problems that are being fixed
GitHub Actions is down
do you have info other than githubstatus.com ? (I should look at twitter or something)
checked it on githubstatus.com only... earlier webhooks was also down
I believe they will eventually catch up, on my cp fork... workflows from an hour ago have just now started showing up and are queued to run.
Similar observations here with an ESP32-S3 (4MB Flash, 2MB PSRAM) on 8.0.0 beta 1. I switched my WiFi to channel 1 for the time being, and that has helped -- it was on 11 and I couldn't even always get a connection after a hard-reset (only 70% success rate, give or take), and even if it did connect, it never reconnected after a soft-reset. With the lower channel, it seems consistently able to get a connection after a hard-reset.
With web workflow disabled, initial connection is consiste...
https://github.com/adafruit/circuitpython/pull/6999 is green to merge, but there were no runs. That is weird. Maybe the Actions are supposed to intervene and unset the "ok to merge" status
Not tested but looks fine by me.
i removed my review so it wouldn't be merged yet
it may require git commit --amend --no-edit and a force push
i will try that
Already built it.
Ljinux had to be severly trimmed to fit on this tiney tiny storage.

I will now try outside of my driver and ljinux.
wifi.radio.enabled is not a viable workaround even with sleep involved.
Feels like a good luck charm at best.
how do I set VSCode to stop fighting uncrustify with formatting? Please tell me answer is not" read uncrustify.CFG" and have VS code Match settings ...
how much difference is there? You can always let uncrustify clean things up. If it's something big like 2 vs 4-space indentation, yeah, you should try to match that.
I am using emacs with a particular formatting scheme, with only a few tweaks, and uncrustify complains very little.
;;; Indent curly braces on their own lines to line up under "if", etc.
;;; https://www.emacswiki.org/emacs/IndentingC
(setq c-default-style "k&r")
;;; Indent case inside switch.
;;; https://www.gnu.org/software/emacs/manual/html_node/efaq/Indenting-switch-statements.html
;;; //, not /* */ comments.
(add-hook 'c-mode-hook
(lambda ()
(c-set-offset 'case-label '+)
(c-set-offset 'arglist-cont-nonempty 4)
(setq comment-start "//"
comment-end "")))
;;; Indent case inside switch.
;;; https://www.gnu.org/software/emacs/manual/html_node/efaq/Indenting-switch-statements.html
(add-hook 'c++-mode-hook
(lambda ()
(c-set-offset 'case-label '+)))
;;; Indent preprocessor directives to match MicroPython style
(c-set-offset (quote cpp-macro) 0 nil)
;;; spaces instead of tabs
(setq-default indent-tabs-mode nil)
every commit fails formatting. It's easy enough to let uncrustify do its thing, then restage the changes. But it would be nicer if VS Code didn't mess everything up. At a minimum brace handling is incorrect. both formatters have a ton of options, I was hoping somebody here Will already have done the work for code like you have for emacs.
With adafruit_requests as a .py, not an .mpy

https://stackoverflow.com/questions/45823734/visual-studio-code-formatting-for for example, but you can probably find more. I was websearching for << vscode k&r >>
basically k&r style with tweaks
hmm, you can even use uncrustify inside vscode: https://www.sfdcnotes.com/2019/12/18/vs-code-extension-uncrustify-code-formatter/<>
@tulip sleet are there any special consequences when renaming a submodule? I want to use nina-fw for certificates with picow
but the current location is under ports/espressif
thanks , i'll give them a try. No no need to keep things in sync if I only use uncrustify
you mean you want to move it from espressif/certificates?
right, to .. lib/certificates maybe?
that sounds fine, though is there some circumstance where we might want version skew for that between the two ports (I can't think of one).
hopefully there wouldn't be
I think moving to lib/certificates is fine. I -have- found that moving or renaming submodules can confuse my local git something bad, and I end up having to re-clone. There are various webpages about how to do it safely, seems more complicated than I want, and they might be outdated.



