Feel free to open a fresh bug if this issue is still happening.
#circuitpython-dev
1 messages Β· Page 427 of 1
Could you all retest again with 7.3.1 or later? We did fix a MatrixPortal-related bug that might have caused this.
This may be fixed by https://github.com/adafruit/Adafruit_CircuitPython_Requests/pull/110 and https://github.com/adafruit/Adafruit_CircuitPython_Requests/pull/111. I will close this for now. Please reopen or make a new issue if necessary.
@NathanY3G Is the 407 family correct? Are you interesting in updating the Makefile to fix this?
Feel free to open a separate issue about tweaking the pystack.
@rp10007 did you get a chance to check this with a newer CircuitPython version? we've made several fixes that might make the HardFault go away.
This is also affecting ESP32-C3 devices, making it painful to bootstrap them into web workflow.
We know. It'll be fixed before 8 is stable. For now, please do the /.env write through the serial yourself.
Maybe there's a way to use IPC to make the sleep execute on the PRO CPU, but we'd really rather have the bug fixed upstream.
I'll upgrade ulab and verify that it's fixed.
Closed based on the above merged PR. Feel free to open a new issue or re-open this issue if there are still problems.
scott says merge this into 8 and get people testing it
check for unnecessary imports (used for type-checking only) in adafruit_requests and other related libraries
I saw this too. Usually it happens if I accidentally type into the REPL while code is running, and then write out my code.py.
In https://github.com/adafruit/circuitpython/pull/6543 we release displays for all boards. Please re-test.
While we're in the autoreload waiting period, we'll want to throw away serial input. Except maybe ctrl-c.
The title bar is only used for web workflow status. We should add USB status, BLE status and code status as well.
Check buffer size required by ESP-IDF for this.
Yup, the issue is fixed with the boards I tested.
The way we make the board.DISPLAY object "be None" is not quite correct, because it doesn't make it obey an "is" test. We need to define a proper way to check for the display being deinitialized that doesn't have this problem. For now, it is possible to use type(board.DISPLAY) is type(None), but we recognize it's not ideal.
How about if not board.DISPLAY?
Lost my internet @onyx hinge
@slender iron we can surely finish without you π
I've got a custom CP build running on the ESP32-S3 devkit N8R8, and I can't seem to access my IO41/42 for I2C SCL/SDA. Whenever I do busio.I2C(board.IO41, board.IO42), I get an error: ValueError: IO41 in use.
I have pullups on both pins, so that can't be the issue. Also, the same happens with a hard reset or with the push button reset.
Assuming this is only fake sleep, we may need to do more wifi cleanup and resetting on restart.
It's an older build. Here's boot.out:
Adafruit CircuitPython 5.3.0-1808-gfcde108d0-dirty on 2022-04-20; ESP32-S3-DevKitC-1-N8R8 with ESP32S3
Board ID:espressif_esp32s3_devkitc_1_n8r8
do you have anything in board.c?
Confirmed on QT PY ESP32-S3. Updating the firmware to 8.0.0 alpha allow sleep to work when powered by USB-C, but not when powered by a LiPo battery.
If connected via USB-C and the data lines are active, CircuitPython fakes deep sleep.
void board_init(void) {
Β Β // Debug UART
Β Β #ifdef DEBUG
Β Β common_hal_never_reset_pin(&pin_GPIO43);
Β Β common_hal_never_reset_pin(&pin_GPIO44);
Β Β #endif
}
My SCL and SDA are on GPIO41 and 42.
are those somehow related to the debug uart? like, say, DTR or something?
(just making wild guesses here)
No idea, I didn't mess with this file.
Will re-test after pending S3 I2C fixes are added to ESP-IDF v4.4.x.
you have debug enabled?
Hmm.. Not sure. Unfortunately I'm just getting back to this after setting it aside a couple months ago. Let me review the latest version of the board.c file for this board and see if I there are hints. Thanks for the suggestion on where to look.
@CTGControls Did you get this to work without adafruit_bus_device?
Rebuilt without the DEBUG flag and works. π€·
Thanks @stuck elbow !
Ok. I think this means that CPy is working on my board without fault? Bear in mind that the 6 flashes are repeating over and over - that never stops.
Thanks Dan! I will take your advice on the initialization.
It seems now the build is too big for the Metro MO Express and the Nano 33 IoT. Please let me know if there is any recommendation on this regard. Probably I went too far with the idea of adding the signed parameter and the byteorder validation!
Thank you!
My next question is whether or not I can include the code I've written in a .hex image and push it over to the board.
in a steady state it should blink every 5 seconds
continuous isn't working
it'd be much easier to debug with a debug uart at minimum
Ok. Can I use any unused GPIOs for UART, or do they need to lead to specific pins on the chip?
any will work
Ok, so I'd just declare them as UART in pins.c?
CIRCUITPY_DEBUG_UART_TX in mpconfigboard.h
something like #define CIRCUITPY_DEBUG_UART_TX (&pin_Px_y) ?
Fair enough. Just to reiterate, I need this to work over Jlink - I don't have another interface here.
and it needs to be SWD
that's not going to work
Can I do it over BLE?
no. you need a UART for debugging at minimum. right now you are flying blind
Ok. I think my last option is to create a .hex image of my project with CPy and try to push it over to the board. I realize that's incredibly problematic, but it seems like the only path forward.
That's not exactly true - I'm able to step through the code line by line over GBD, and x-reference it with the code in the clone of the git repo.
That won't be possible with the current revision of the board - there's a design error that we're correcting for the next revision, but I'm trying to save these prints for testing. :/
trying to do it early is costing both of us extra time
I understand - I don't want to take all of your time here, and I'm grateful for the support you've given me so far.
@tulip sleet or @onyx hinge did you pick up an s3 box lite?
I guess the best question I can ask at this point is (again) for guidance on how to create a .hex image with my code included. Is there a set of instructions I can follow posted somewhere?
no, there isn't. you are well off the beaten path
Fair enough. Thanks again.
circuitpython isn't designed to work as an appliance
not Lite; I got https://www.adafruit.com/product/5290 soem time ago.
ya, I have that too. the lite is different enough to have a different board def
should I get one? I though it was just without the dock
nah. I can get one
I have a board def WIP that I was hoping one of you could finish
I have a programmable power supply using I2C and a custom PMbus protocol (similar to SMBus). A Diligent Analog Discovery unit can produce the "repeated start" on the protocol analyzer, and the PSU responds as expected.
Below is a protocol capture of a GOOD read:
Start, 20 [ 10 | WR ], 00,
Restart, 21 [ 10 | RD ], F5 NAK, Stop
The circuitpython busio device can perform one of two options::
- write with stop=False, then readfrom_into
Looks like this on the protocol anaylzer:
Start...
Same here I only got the original
Is it possible to prevent attempts to enable USB in CP? I think this is what's causing my board to continually reset.
set CIRCUITPY_USB to 0
@slender iron you're a champ.
That works! I now get one blink ever 5 seconds or so!
@hathach I tried this on Linux, macOS 12.4 (the latest), and Windows 10. I wrote a code.py that mounted the SD card file system, and then just looped to stay in code.py.
On Linux and macOS it worked OK. On macOS the SD card drive appeared quickly; on Linux it took a few seconds longer. Occasionally it would get hung up, but a reset fixed things.
On Windows, I had more trouble. Windows took a long time to show drives D, E, F, G, as long as 15 or 30 seconds. Drive D was CIRCUITPY. Trying ...
@hathach I tried this on Linux, macOS 12.4 (the latest), and Windows 10. I wrote a code.py that mounted the SD card file system, and then just looped to stay in code.py.
On Linux and macOS it worked OK. On macOS the SD card drive appeared quickly; on Linux it took a few seconds longer. Occasionally it would get hung up, but a reset fixed things.
On Windows, I had more trouble. Windows took a long time to show drives D, E, F, G, as long as 15 or 30 seconds. Drive D was CIRCUITP...
Hi everybody, I wonder if someone is interested in developped a library to play ogg vorbis or flac files on circuit python ?
The bug is not in the adafruit_bus_device. The bug is some where in busio.SPI. I updated my code in the:
Not working esp32-2 repo
https://github.com/CTGControls/CTG_DPS_Python_Ad4116_Adafruit_MetroExpressEsp32S2
###OLD code
# _CTG_AD4116Class = CTG_AD4116Class
# _CTG_AD4116_ = CTG_AD4116_
# _CTG_AD4116_.startup(spiClk= 50000, CTG_AD4116= _CTG_AD4116Class)
###New code
_CTG_AD4116Class = CTG_AD4116ClassNoAdafruitBusDevice
_CTG_AD4116_ = CTG_AD4116_NoAdafrui...
Hi @tannewt. I don't believe the use of the F407 family ID is correct. Looking at the STM32F4 portfolio on ST's web-site, the F405s and F407s are two different product lines within the STM32F4 series.
As always, I am more than happy to try and ...
How about
if not board.DISPLAY?
Unfortunately this fake-None is also treated as a true value in truthy contexts :-(
Well, maybe that's what we should fix then.
We don't even need to call it None, as long as it's false-y.
Maybe we could make it an int zero instead of a pointer?
@gilded cradle I'm around for two hours if you have time to debug the web workflow issue you are having
(I'm around off and on in the afternoon)
Sure, we can meet up now. I was just about to get started on fixing esp-web-flasher, so I'd rather debug now instead of in the middle of that.
can get you building ESP too
I can't currently. I was going to work on spinning that up tomorrow
I can walk you through it too
ok, that'd be awesome
2. writeto_then_readfrom
Start,20 [ 10 | WR ], 00, 21, FF, Stop
How are you calling this? What microcontroller are you using? It should do a repeated start when switching from write to read.
How about
if not board.DISPLAY?Unfortunately this fake-None is also treated as a true value in truthy contexts :-(
We could change this by having a custom unary op for NoneType.
Maybe we could make it an int zero instead of a pointer?
Make what an int zero? We can't modify the pointer because it is in a ROM table. That's why it changes the object type now.
We could change this by having a custom unary op for NoneType.
Wouldn't it be just as simple as having aNoDisplaytype with a__nonzero__()method that returnsFalse?
Not thinking well. But we could make it an empty list or tuple or bytearray, all of which are False-y?
None should be False-y too? Not sure why this doesn't work?
Because None is a singleton, and it does an address comparison only.
Ideally, it should be board.DISPLAYS[0] β perhaps we could change to that eventually? Have both board.DISPLAY and board.DISPLAYS for a time...
@stuck elbow @tulip sleet want to chat here
yah sure, so could we point to an empty sequence of some kind?
but if not board.DISPLAY would do a truth-value test
so the idiom for testing would change
using "is" correctly is really tricky
mp_obj_is_true checks against == mp_const_none
if not board.DISPLAY is more flexible
so instead of saying we set to None, we set to something else ... yes
because we could add deinit to displays and then use that for true
setting it to something else means it prints that way
so implement __bool__ for displays, then? I think
that or for none
either __bool__ or __nonzero__
I think the latter is the more pythonic one in this case
not sure if MP has it
but it's not such hot code
there is still a fast path for the None object
that's a good point, it would fall through and still eventually be false
right. it falls through now but the generic unary doesn't implement it
so copy the generic one and return false on bool
it's still weird is None wouldn't work but it would print as None
ya, I agree that's weird
can we somehow raise an error if someone uses is with that fake None?
if we added a deinit state, we'd need to check it in all the display calls at the beginning, as we do for busio objects, ec.
@onyx hinge ^
another option is to have a NoDisplay object that is falsy
I don't think so because it doesn't call out to the object
I think NoDisplay or deinited are the cleanest
I think it'd be interesting to have a 'generic deinitialized object', it might actually allow removal of a lot of deinitialized checks. but I once prototyped it and didn't save any code size, which was my goal then.
If we do something for displayio it would be nice if we tried to make it generic enough that we could use it for other cases too, like when you deinitialize a DigitalIO it turns into this type...
PumpkinType
we could make it a generic NoDevice, then use it for other things too
a generic deinit object would change the type out from under you
for Displays yes
you would then get errors like "A Display expected, but NoDevice found"
NoDevice would respond to any method or attribute wit some exception, maybe RuntimeError, maybe OSError
maybe a NoDevice object has a single attribute that is the expected class
raise OSError(418, "I am a teapot")
Yeah I think you could make it say it's a <Deinitialized %q>. I should see if I still have that branch
can't find it
but then it can't be a singleton
No, when you deinitialize any object that works this way, its memory gets overwritten so that it's a <Deinitialized %q>
so you don't reclaim the memory?
you can just copy the old type into the first field, maybe you did that
you could zero out the rest of the object, and then copy the type
or could alloc a new one
you can't alloc a new one because you don't control pointers/references to the object
so it has to be smaller than the smallest device object
I think it is safe to assume an object is the type pointer plus at least two bytes
and each object type would have to deinit itself
so it would be opt-in so to speak
that's why we don't save on code size?
deinited_unary_op should be changed so that use in a truthy context returns False
lunchtime for me. the deinited object is interesting to me
maybe I'll play with it for a bit while waiting on this other CI
if someone could just summarize into the issue, that would be great; this is not an urgent fix, but is an interesting puzzle
This is a PC (Fedora) with Blinka FT232H break out board via USB running python busio commands.
`
import board
import busio
i2c = busio.I2C(board.SCL, board.SDA, 500)
while not i2c.try_lock():
pass
device = 0x10
result1 = bytearray(1)
for itemcount, item in enumerate(commands):
if item[0]=='RD':
#i2c.writeto(device,bytes([item[1]]), stop=False)
#i2c.readfrom_into(device, result1)
i2c.writeto_then_readfrom(device,bytes([item[1]]),result1)
...
Using a list (or function) board.DISPLAYS does help with the problem, because the list would reside in RAM and thus the object pointer could actually be updated. It would also help with the rare boards that have more than one display.
There's still the problem of what if you write d = board.DISPLAYS[0]; displayio.release_displays() and later refer to d. It needs a way to be turned into a deinitialized display object.
I have an incomplete and non-working branch that introduces the De...
>>> i, bool(i)
(<I2C>, True)
>>> i.unlock()
>>> i.deinit()
>>> i, bool(i)
(<DeinitedType>, False)
>>> i.unlock()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: Object has been deinitialized and can no longer be used. Create a new object.
@onyx hinge Hello. I am ready for the magic fix to resolve the destruction I unleashed on my CircuitPython fork. You mentioned it in passing, but not in a way that registered enough with me to recall it.
Ok I'm out at the moment so maybe in 30 minutes from now?
I have a thing in 35 minutes. I'll ping you tomorrow if you're around.
Following on the previous discussion regarding interrupts, I am considering how to for improve display response to capacitive touchscreen events.
I am considering whether it is [useful, possible] to create an event queue for I2C interrupt events.
I don't know anything about interrupt handling in CircuitPython, or CircuitPython does event scheduling, so this is just a first attempt at proposing a behavior and stru...
Can I disable the status line on CP8? RP2040 feather so I don't have WiFI.
you can hide the title group (though I think blinka and the status bar are not grouped together), and move the REPL group and reset the size of the console, but I think it's a little buggy right now, does something like that work ?
for pos in range(len(display.root_group) - 1):
display.root_group[pos].hidden = True
tile_height = display.root_group[-1].tile_height
delta = display.height % tile_height
supervisor.reset_terminal(display.width, display.height)
display.root_group[-1].x = 0
display.root_group[-1].y = - delta
Not yet. My intent is to add other status to it as well
so code running vs done vs error and USB status
I'm using a 128x64 oled, I only have 4.5 lines of text.
speaking of which, can we put blinka and the status in a single displayio.Group ? that way it's always root_group[0] and the REPL is 1
@jaunty juniper fine with me
@main furnace its meant to be useful π
but I understand it isn't now
Seeed Studio is making a naming change on the XIAO serie of board, so I adapted 3 boards (skipping "Seeeduino XIAO - Keyboard Optimized")
https://www.seeedstudio.com/blog/2022/07/06/notice-on-product-name-change/
0.2 of the screen is a bit much, but for now I can keep that node on CP7.
it may not be too much code to underlay the serial portion under the title
but then the title would be hard to read
@main furnace you can actually set the title from your code
so you could use that space yourself
(in theory, I haven't tried it yet)
How does that work?
it uses the OSC escape code
so try print("\x1b]0;my new title\x1b\\")
the \x1b is the escape key code
Okay I'll give it a try. Thanks.
awwww no microcontroller.cpu.temperature on ESP32S3 ! So much example code dies in agony !
idf support it yet?
I assume not ? I think we have updated the IDF since the first S3 support was added ?
@jaunty juniper @slender iron it is in ESP-IDF master but not 4.4.x
I checked on this recently and re-checked. master has many changes from 4.4. I wouldn't try to go there now.
π
@onyx hinge I made little progress today on the ESP32 Thonny debugging. I think there may be some memory or heap error, but it's hard to tell. Adding logging creates Heisenbugs :/ . Tomorrow do you have time to get a brain dump about this, in case you want to work on it next week?
@tulip sleet yes, before noon my time would be good
got it, I'll ping you tomw morning, thanks
OK!
ah I see, thanks
Makes sense to me, maybe add something like "(Formerly Seeeduino Xiao)" for search purposes ?
Thanks. Should be OK to merge when CI is green.
Would you like to updated the Manufacturer to "Seeed Studio" as well?
I downloaded 7.3.1 from circuitpython.org and this still seems to occur on both the Devkit and FeatherS3 boards.
I built an 8.0.0 FeatherS3 CP from the master Github bits and the issue still occurs, however when I build 8.0.0 from the master for the Devkit the problem seems to have gone away.
On a hunch, I threw a .env file on the FeatherS3 running 8.0.0 and the crash no longer occurs when pressing ctrl-D. So apparently adding the wifi SSID and password via the .env prevents this crash from occurring.
@todbot any chance you want to look at this one?
The output of the debug console from the crash:
I (30610) pp: pp rom version: e7ae62f
I (30610) net80211: net80211 rom version: e7ae62f
I (30620) wifi:wifi driver task: 3fce5928, prio:23, stack:3584, core=0
I (45289) system_api: Base MAC address is not set
I (45289) system_api: read default base MAC address from EFUSE
I (45299) wifi:wifi firmware version: 84ed08c
I (45299) wifi:wifi certification version: v7.0
I (45309) wifi:config NVS flash: ...
LoadProhibited,
These CPU exceptions happen when an application attempts to read from an invalid memory location. The address which has been read is found in the EXCVADDR register in the register dump. If this address is close to zero, it usually means that the application has attempted to access a member of a structure, but the pointer to the structure is NULL.
This was by design. The underlying API is int so I figured this attribute should be that way too. Is that a bad assumption?
Like, what do they mean exactly "set to 8.5dB" when this is the API : https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/api-reference/network/esp_wifi.html#_CPPv425esp_wifi_set_max_tx_power6int8_t
The units are 0.25dBm, but the actual power setting is coarser than that, not even in 1dBm units:
https://docs.espressif.com/projects/esp-idf/en/v4.4.1/esp32s2/api-reference/network/esp_wifi.html?highlight=esp_wifi_set_max_tx_power#_CPPv425esp_wifi_set_max_tx_power6int8_t
esp_err_tesp_wifi_set_max_tx_power(int8_t power)
Set maximum transmitting power after WiFi start.
...
So what I copied from MicroPython is incorrect and that tx_power argument is a nearest-neighbor table lookup?
I don't know what's going on internally - that code is in a binary blob. It could be something about how the radio hardware works. But in any case there's significant quantization. I too am puzzled about the Wemos instructions.
Have either of you tried wifi at various power settings to see if some don't work at all?
They worked at all the 6 or so settings I tested, showing corresponding changes in TX power using a WiFi sniffer.
This is not a big change, it's just frustrating because Patrick is right this should be a float. :)
I agree, a float would be good. No issue changing it.
okay, PR incoming shortly
Okay, so after looping back and looking at the https._free_sockets() module I realized that the proper way for the function to be called would be to use the response.close() method and adding that statement does prevent the crash which is at least a better option than calling the private _free_sockets() method.
I have a theory of the various keyboard descriptors discussed and the problem where the left Ctrl key seems to be pressed:
If the device sends reports prefixed with a 1-byte report ID of 0x01, the host is not expecting the prefixed report ID byte, and it interprets it as the modifiers field, and a modifiers field of 0x01 corresponds to the left Ctrl key. By calling usb_hid.enable((reference_keyboard,)...) with reference_keyboard having a report ID of 0, that causes ...
@isacben I will not be able to work on this for about a week or so, but will get back to you about shrinking those builds. Thanks for working on this.
this is a bit ambiguous. according to https://github.com/microsoft/uf2/blob/master/utils/uf2families.json There is defined for stm32f407 and stm32f4 (also f407vg but I guess we could ignore this)
My guess is the f407 was added first, then the family F4 was added lat...
I agree. It also looks like there used to be a lot more family IDs for the ST processors before a refactoring to a single source of truth: https://github.com/microsoft/uf2/pull/47.
I was considering raising an issue to clarify/improve the situation unless you would like to do this?
@dhalbert confirmed the slow enumerating on windows 10, is troubleshooting, have no idea I miss this in the first place. Will post more update when I have one.
@onyx hinge I am around for esp32 debrief pretty much any time today
@tulip sleet OK, we're finishing entertaining guests soon and I'll ping you. maybe 30-45 minutes
@tulip sleet OK guests are squared away until lunch time π
ok, I am trying something; avail in a few minutes
OK, I'll be around until 12 CT / 13 ET
@idle owl if/when you're around we can talk about undoing the changes in your fork of cirucitpython
@onyx hinge ok, my experiment did not improve things, ready to talk. You can get latest from dhalbert/circuitpython, branch esp32
OK I'm in one of the voice channels now
Hi @dhalbert,
No worries! Thanks for the heads up. I will be around.
Thank you.
@onyx hinge Are you still available to fix my fork?
It's ok if not. Like I said, it's not crucial yet.
@idle owl not really, we are leaving as soon as Ingrid finishes up her call which was supposed to be 28 minutes ago π
Ok, no worries.
the general idea is locally you get the adafruit main branch and then force-push that to your fork's main branch though
Hmm ok.
I'll try to figure that out. π Worst case, I guess I burn it to the ground and begin again.
that's true!
[adafruit/circuitpython] New comment on pull request #6570: bump gcc version, let's see what happens
Many builds fail with internal compiler errors:
../../py/parsenum.c: In function 'mp_parse_num_decimal':
../../py/parsenum.c:256:21: internal compiler error: Illegal instruction
256 | if (dec_val < DEC_VAL_MAX) {
| ^~
0x1521b50 diagnostic_impl(rich_location*, diagnostic_metadata const*, int, char const*, __va_list_tag (*) [1], diagnostic_t)
???:0
0x15227d6 internal_error(char const*, ...)
???:0
0xb7838f crash_signal(int)
???:...
[adafruit/circuitpython] New comment on pull request #6570: bump gcc version, let's see what happens
This appears to be due to https://bugs.linaro.org/show_bug.cgi?id=5840 which is [incorrectly?] marked as a duplicate of https://bugs.linaro.org/show_bug.cgi?id=5825 -- this build of gcc is not compatible with all x86 CPUs, including the one emulated/virtualized in github actions.
@Thraxxos This sounds like a Blink FT232 bug. Please file a new issue here: https://github.com/adafruit/Adafruit_Blinka/issues
I'd expect correct behavior on any of the boards here: https://circuitpython.org/downloads
Unfortunately, neither of the two you have are supported.
This will be tough because the user code could also be accessing I2C at the same time.
Thanks for the update! Just a couple questions.
Is this only gif writing? Seems like folks would want to read it on the matrix portal.
Is this on by default? Do we expect it to work on most boards? Maybe it should be off by default.
I found a disturbing behaviour of the web workflow. If you set the .env, you get an IP but things are not working yet (except ping), but if you restart the board, then things start to work.
I noticed something similar. If you can specify the recipe for that, please file an issue. Scott is interested in all kind of behaviors, and expects bugs to be found
Boot a board, create a .env file, see the IP, try, fail, reset, try, it works!!!
or would we want the web workflow to only be started on reset ?
Might be an option, don't know what is more/less confusing, but if instruction to reset are present, that's fine. I think having the IP but not the rest could be useful as it will be visible on the "console" and you are likely to have the same IP at next restart, so it help potentially. Anyway at one time you will have to set that .env file one way or another... or is there a trick for that too??? Like a configuration access point for initial setup?
About trick, plugging your board in a charger to have the file system Read/Write from wifi is a great one.
My workflow will include that, first plug in a power-supply, do your change, then plug it in the host when it will be used.
that could take the same form as the BLE workflow, press reset at a certain point during boot to get the board in access point mode, though maybe that ends up being a lot of boot modes
I must admit I skipped the BLE workflow, mostly because I don't have an iPhone handy, and if felt required.
NRF board are BLE only, S2 board are Wifi only... but then with S3 board you can have both and then the boot mode will become a bit complex. π¦
yup
@idle owl lol, thanks, was scratching my head big time
@thorny jay Can you try, boot board, create .env, see the IP, try, while waiting... create file and write to file ie t = open('test.txt','w'), t.write('test')
I need to give a bit of context... I have a piece of code take an "image" and encode it as mouse movement for a Nintendo Switch. Today I need to plug my CP board on a PC, copy the "image", then plug in the Switch, and I need a "button" to activate mouse movement (to avoid mouse movement while connected to the PC). My goal is to be able to only connect to the CP board with WIFI, add the "image" then restart (maybe auto-restart) and do everything without having to plug/unplug the CP board. So right now I plan to use and abuse from the Wifi Workflow so that I don't even need to implement a web server or anything like that.
Okay, I was just suggesting the file I/O because I wanted to see if an issue I ran into was causing your issue. When I recreate your steps on my board it does seem to apply. Basically any flash file I/O was unblocking the stalled web workflow. To confirm that with your board if you have host write access to the CIRCUITPY drive, all you need to do is rename a file on the CIRCUITPY drive. I don't mean this as a solution to your requirements, as the issue would eventually be resolved, just curious if it's the cause of your current observation.
Wait, in my problem I don't even have the Web interface working before doing the first reset after creating the .env file. π
Do you think writing to a file would wake it up???
Initial support for plain ESP32, using Adafruit Feather ESP32 V2 as a starting point. Significant known problems. @tannewt suggested we go ahead and merge this, since there are many changes we'd like to incorporate even before ESP32 is debugged.
*DEBUG_UART*is now*CONSOLE_UART*, many places.CIRCUITPY_CONSOLE_UARTadded to specify when the REPL console is done over UART.- Commented-out support in
boards/adafruit_feather_esp32_v2/sdkconfigfor separate ESP logging UART cha...
But only for one operation at a time, so you may need to do multiple file i/o depending on what you're trying to do over web workflow
OSError: [Errno 30] Read-only filesystem
I think my problem is not what I initially described...
The file i/o can occur from either REPL or the Host PC via the CIRCUITPY drive
The Web Workflow fail for me on my QT Py S2 but is a success on the Feather TFT S3.
I haven't gotten around to seeing if my S2 boards see the same issue, but I first saw it on an S3 board
For me: S3 = no problem ... S2 = sometime ping, never the web interface.
I you're getting the Read-only error from a board that's plugged into a host and has a CIRCUITPY drive mounted, you could try creating a file or renaming a file from the host computer and see if that releases the web workflow
While I would live to have a minimal hardware for my usecase, I can develop everything on my S3 and figure out later what is going on with that S2.
This is all still very alpha, I'm sure it will end up working on both the S2 and S3
Nope, creating a new file, writing to an existing file. It does not like me.
You did the file access after initiating the webflow request?
I have a browser on one side and using touch or creating file with Mu. But I don't think the browser was requesting anything at that time.
I am trying to clean completely the board... but now the FS is read-only and I cannot delete a leftover secrets.json or edit the .env ... now I need a way to "format" my CIRCUITPY.
safe mode should always work
to be able to write from the web workflow, you only need to eject the drive, though I don't know if that works on windows
fsck to the rescue!
I was read only because of error on the filesystem. I tried the reset to factory default image, but it did not help. I failed at using esptool and the web serial also. Now I should be back to a clean QT Py S2. What a fight.
oh ok a corrupted drive
ya, sorry for the bugs. I plan on going into bug hunt mode once I have websockets PRed
So the QT Py S2 is now clean, back with the latest version of CP. As soon as I set the .env it get an IP, but then whatever I do, I cannot get to the web interface. Only Ping is working for me. The good news is that I can play with the Web Workflow on my S3+TFT. So I know I can do it and I can try to experiment with the thing I had plan. Thank you for the help.
I think you are right that you need to reset after writing .env
I'm not sure it checks after every auto-reload. I'll need to look at that
Doesn't the working ping mean that workflow has loaded?
it means that its connected to the network but not that the webserver code is going
ah ok
The other good news is that with the bits and pieces of documentation I found and a few PR exchange, I was able to figure out what to do to use the Web Workflow, without having to watch a YouTube video.
Yeah it need to be retested from scratch once the other bug are solved. That will be the first contact for a lot of user.
yup yup
I am assuming that most folks will set the .env when they load CP
especially for C3 and ESP32
I would have been great if the .env file and the secret.py would have more or less the same syntax and key-value. Maybe secret.py will not be needed anymore and everybody will use getenv, and a compatibilty secret.py can be created for having the credential in only one place. (not sure my idea are clear here but there is a way to get rid of secret.py I believe).
ya, I'd like to replace secrets.py with .env
Unrelated: mdns or bonjour did not work for me, but it could be my OS despite installing avahi-daemon. It could also be my new wifi filtering multicast... too many variable for any serious troubleshooting... maybe I should start my Mac Mini. π
you can test from the command line using dig
if you have two CP devices and can get the web workflow of one, the home page will try to do the mdns discovery for you too
New default secrets.py?
import os
secrets = {
'ssid' : os.getenv('CIRCUITPY_WIFI_SSID'),
'password' : os.getenv('CIRCUITPY_WIFI_PASSWORD'),
'aio_username' : "your-aio-username-here",
'aio_key' : 'your-aio-key-here',
'location' : 'New York, US'
}
we should stop using secrets.py all together because it conflicts with a native CPython secrets module
π
This API should be float instead of int.
[adafruit/circuitpython] Issue opened: #6573 ItsyBitsy M0 Express crash with Hardfault Handler error
CircuitPython version
Adafruit CircuitPython 8.0.0-alpha.1 on 2022-06-09; Adafruit ItsyBitsy M0 Express with samd21g18
Board ID:itsybitsy_m0_express
Same behaviour with
Adafruit CircuitPython 7.3.1 on 2022-06-22; Adafruit ItsyBitsy M0 Express with samd21g18
Board ID:itsybitsy_m0_express
Both are the German versions
Code/REPL
file code.py:
import test
file lib/test.py:
import time
import board
import digitalio
from audiocore import RawSamp...
Built locally and tested and it worked for me.
Thanks @todbot !!
both dig and nslookup fail to see circuitpython.local and I have now two board on the same wifi... that don't see each other. So I have to troubleshoot my wifi I am afraid.
can you get the welcome page of one with the ip?
Yes I have both welcome page, but they show no other device.
k, that must be the router then
Must be my super wifi blocking something. It is unify but brand new to me, and it is too simple for me (I was a cisco expert, that sexy web interface is disturbing to me). π
I have a ubiquiti dream machine and its working ok
Some progress $ ping cpy-59d204.local PING cpy-59d204.local (192.168.192.72) 56(84) bytes of data. 64Β octets de 192.168.192.72 (192.168.192.72)Β : icmp_seq=1 ttl=255 temps=248Β ms
In Network Setting there is Multicast DNS and I had to enable that.
I may have changed the default value thinking that I was smarter than Ubiquiti. π
The Espressif ESP32-S3 Box Lite has a different non-touch enabled display compared to the ESP32-S3 Box. Using the ESP Box firmware on the ESP Box Lite produces an inverted backlight and for the brief flashes the display does show, the text is black on a white background and the display is rotated 90 degrees counter clockwise from what it should be. This PR adds a new board definition and fixes the ESP32-S3 Box Lite.
I looks like it's failing duplicate VID/PID check. I now recall when I spoke with @tannewt him mentioning that he had submitted for new IDs, so this can just wait until we get those.
any particular reason there is no adafruit_bus_device for UART?
usually uart is just one device
yeah, I was thinking that it would be useful for an enter/exit to open/close the port, but maybe that's a bit trivial
I think you can use the UART object itself to auto-deinit
it looks like the UART exit will deinit, but that's not really what I was looking for
what do you mean by close port?
hmm, good question, I could have sworn there was an open() and close() function but it appears I'm completely wrong
must be confusing it with the Serial class on the PC side of things
Serial on iOS
I'm at the same state on ESP32-C3 (Lolin C3 Mini board). Have an IP that's pingable, mdns is working, but no one's home on port 80.
@spiral elk Are you compiling the Lolin C3 Mini build yourself or downloading a binary UF2 file?
If I put a build with a tweak on github would you be interested in testing it out?
My build env is outdated so it'd take me a bit to update it
I'll do the compile, if you're intereseted, let me know if a .bin will work and I'll post the URL
void common_hal_wifi_radio_set_tx_power(wifi_radio_obj_t *self, const mp_float_t tx_power) {
esp_wifi_set_max_tx_power(tx_power * 4.0f);
Thanks! Minor changes here: use mp_float_t to pass floating-point values around between shared-bindings and common-hal. mp_float_t is defined to be float or double, depending on other implementation choices. This is the same idea as themp_int_t type.
extern mp_float_t common_hal_wifi_radio_get_tx_power(wifi_radio_obj_t *self);
extern void common_hal_wifi_radio_set_tx_power(wifi_radio_obj_t *self, const mp_float_t power);
Somehow the frozen libraries and samd-peripherals were way out of date, not sure how. Updated these.
Heading to lunch now but I'll take a look at it once I'm done
C3 is bin only at the moment
And will probably always be so
No USB peripheral onboard
@spiral elk heh, I figured as much π
I'll probably have called it for the night so I'll check to see how you made out in the morning
That version worked first time
oh nice
@jepler you can undraft and merge this whenever you feel it's good enough. As @tannewt suggested merging even with the bugs will help move other things forward.
@spiral elk The main difference in that version is that the code blocked mention in issue #6552 has been commented out.
https://github.com/adafruit/circuitpython/issues/6552
I really don't know if there are other impacts to Flash performance of running that version, but it's good to confirm the behavior. If you're interested you could update the issue with your results and I believe that will trigger notifications when progress is made.
A brief status summary:
The ESP32-S3 LCD peripheral is now proved to be working with CircuitPython. I've got it working with displayio and responding to touch inputs.
I pushed my first commit of CircuitPython incorporating the ESP32-S3 dotclockdisplay using the framebufferio.
I pushed my version of the ESP-IDF that has some updates to 1) prevent overwhelming the PSRAM DMA a...
What is the touch display used in the 6049 PR movie?
This might have already been discussed, but if the intention is to use dotenv with .env files for storing secrets, is the plan for repo READMEs to keep suggestion making virtual environments with python -m venv .env or is the name of the environment going to change to something else? If I understand correctly, .env and .env/ wouldn't conflict, but didn't know if asking users to the "edit .env" would cause any confusion.
oh yeah they would conflict
you can do python -m venv .venv
I can't figure out what the bot doesn't like π€
I personally find .env a problem for beginners, the Finder won't let you create a dot file, it's impossible to save a file as ".env" with TextEdit (.env.txt at best)
ah lol
there's a trick to see it from the Finder (cmd-shift-G + ".env" in the directory) but otherwise it's command line (with the "open" command allowing to edit with TexEdit for example). I have not tested if Mu is ok with any of that
I'll bring it up during In The Weeds then
@prplz
Line 509 is a closing bracket, so I think the code has changed since then. has the issue been resolved? if not, which line are you referring to? I'm curious, because there is a uart line close nearby, and I wouldn't be surprised if that is part of the problem.
I don't have permissions for setting up webhooks via RTD, so could someone who does manage setting up the RTD project for this library: https://github.com/adafruit/Adafruit_CircuitPython_PCF8574
MICROPY_FLOAT_CONST(4.0) is even more technically correct, even though we don't correctly follow that style everywhere (yet).
Similar to how mp_float_t is either float or double, MICROPY_FLOAT_CONST appends the f to the literal constant (or not) depending on the actual type of mp_float_t.
Yes, gifio only writes GIFs.
It is on for all "FULL_BUILD" samd M4 boards (as well as for rp2040).
It should work on any SAM D/E5x board with enough I/Os.
@moefear85 I think the line was esp_ipc_isr_stall_other_cpu();
Is the workflow file browser supposed to show the SD card rather than the internal flash if an SD card is mounted?
If you mean, you wouldn't be able to modify the code.py file once an SD card was mounted, I'd have to agree. I would think there should at least be a way to toggle back to the internal, maybe there is and I'm just not seeing it yet.....
oh it should definitely not be showing the SD card
Built locally and tested and it worked for me.
Thanks @todbot !!
Please file a bug. I suspect this has to do with which VFS we pick
we could do like os.listdir and such and pick the vfs based on the path
so we could list mounted sd cards
Thanks! It wasn't clear to me where that dividing line was between mp_ types and native types (I've seen other headers in shared-bindings that use float, uint16_t, and uint8_t*), so I was assuming the related .c was where the official mapping occurred.
Are these other functions I've seen using an older philosophy or, in ...
ya, let me think about it. handling read-only could be tricky
true
@RetiredWizard built an image for the Lolin C3 Mini, which was exhibiting the same issues with the commented out bits in flash.c and it started working immediately as well.
@ prplz
oh then idk... it's just that there's currently this issue, and I double checked, it doesn't call esp_ipc_is_stall_other_cpu, so whatever is triggering the wdt there, probably isn't the same thing causing this.
CircuitPython version
Adafruit CircuitPython 8.0.0-alpha.1-39-g4c20b3cb6-dirty on 2022-07-09; FeatherS2 with ESP32S2
Code/REPL
import adafruit_sdcard,storage,board,busio,digitalio
spi = busio.SPI(board.IO36, board.IO35, board.IO37)
sd = adafruit_sdcard.SDCard(spi, digitalio.DigitalInOut(board.IO33))
vfs = storage.VfsFat(sd)
storage.mount(vfs, '/sd')
http://xxx.xxx.xxx.xxx/fs/
storage.umount('/sd')
http://xxx.xxx.xxx.xxx/fs/
Behavior...
CircuitPython version
Adafruit CircuitPython 8.0.0-alpha.1-39-g4c20b3cb6-dirty on 2022-07-10; FeatherS2 with ESP32S2
Code/REPL
import board,busio
spi = busio.SPI(board.IO36, board.IO35, board.IO37)
from adafruit_bus_device import spi_device
t = spi_device.SPIDevice(spi,board.IO33,baudrate=250000, extra_clocks=8)
Behavior
Board crashes into same mode.
Description
No response
Additional information
It looks to me like this it t...
What do you think about the wifi banner that "print" on the REPL. In Mu it is a bit disturbing ]0;π Wi-Fi: 192.168.192.72\? What is the plan for this? Should Mu be updated to understand those and display them as a banner, or it should be disabled on the serial interface?
there's a discussion here you can contribute to https://github.com/adafruit/circuitpython/issues/6548
since the title thing is a tty escape sequence I think it's not unthinkable to have Mu swallow it and possibly use it as status, but it might be good to disable it until that is settled
maybe have it be just normal text without the escape sequence in the mean time
or ctrl-something shortcut to toggle it ? would that make sense ?
Could be the "Prompt".
But if you have access and plan to use the REPL, either you don't need to know the IP or you have another way to get that info (I don't know witch, but there should be an API to know the IP currently in use, not sure to do what, but just in case).
That web workflow is still very confusing to me. π
yeah wifi.radio.ipv4_address does give the IP
This should allow UF2 images for STM32F405 boards to be flashed by TinyUF2.
I have a create a PR to make the UF2 family IDs consistent with TinyUF2 for STM32F405 boards. However, this is currently marked as draft as I wish to test my changes further.
@dhalbert I have updated tinyusb that has recent fix for samd lock-up with high traffic https://github.com/hathach/tinyusb/pull/1535 . Also update the msc to fix issue with null vfs as well. These should fix current issue with windows. Would you mind testing it again.
In 8.0.0-alpha.1 the test in the OP gives straight 100s. As I thought, there was a bug in popleft. Thanks for finding that @mwisslead !
https://github.com/adafruit/circuitpython/pull/6450/files#diff-d6faa070ed5811465cef0d6b1f9426a22b6a9571b7871ed898f01314564eba15L213
I did have a real use case where I had to rewrite my program to avoid calling popleft while measurements were being taken.
As of the excellent pull request above, RP2040 PulseIn has perfect 1us accuracy. Can my team safely rely on short pulses being detected in the future? Hoping it's not a matter of "the short pulse filter is coming back (non-optionally) when we figure out how to do it correctly". Noting that such a filter doesn't need to be in the PulseIn core and could be done in Python.
Update for the elecfreaks_picoed board. thanks!
CircuitPython version
Adafruit CircuitPython 8.0.0-alpha.1 on 2022-06-09; Raspberry Pi Pico with rp2040
Code/REPL
import board
import busio
import time
import usb_cdc
#serial = usb_cdc.console
serial = busio.UART(board.GP0, board.GP1, receiver_buffer_size=128)
serial.timeout = 1
while True:
n = serial.in_waiting
if n > 0:
data = serial.read(n)
serial.write((str(n) + " ").encode("ascii"))
serial.write(data)
...
@tannewt this is probably related the issue I noticed with the Web Workflow not working on the ESP Box and ESP Box Lite.
Currently it overwrites the oldest pulse lengths when full. In many cases, this means the result is invalid and needs to be discarded. For some uses, we could instead get something useful by decoding the beginning of the transmission. So I'm suggesting an option to make it pause when full instead of overwriting.
A few more to check off the list in #6326
It looks like updating the PID removed the approval and I don't appear to have permissions to merge without it.
oh @idle owl I kind of need a sanity check here, I was trying to use the Sparkle animation and it doesn't work properly, the "sparkle" doesn't stay up for the length of a frame (as per the speed parameter), it's erased as fast as the code can, and certainly doesn't match the gif in the guide. When I look at the code I see the problem, but it looks like it's been like that for 2 years.
Huh. Weird. I guess the guide might have been written before the bug was introduced? Do you think you can fix the issue in the lib?
I can grab something and run it to check too before you dive in.
After meetings today though π
Because I've never had issues with it, but I also never updated the LED wall from my last office, so it was running older code the whole time. So I wouldn't have found bugs that way.
thanks, there's no emergency of course
No worries! Good catch on your part if it's broken. I'd rather verify it and move forward with a fix sooner rather than later, if it's been identified.
<@&356864093652516868> The weekly meeting is in about 1 hour. We love hearing what's up with y'all so it's a great time to update the notes document: https://docs.google.com/document/d/1tiCKK3V9-X9_jgHTmTlEjDPfB_z7bjZTNu2kYtM7KBw/edit?usp=sharing -- see/hear you soon
Google Docs
CircuitPython Weekly Meeting for July 11, 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 parti...
Not making it to the meeting, maybe pre-read if my text is not too long or complex there are parts that can be easily skipped or summarised further.
I wouldn't be too concerned about it - we've all read off super long status updates from folks before. π
Thank you for the offer!
I'll make sure to listen to the recording. π
In #6581 I've added links for:
- keypad
- sharpdisplay
- msgpack
- touchio
Lurking. Trying to get back into the swing of things.
Lurking too, my new job found out I exist (which is good) but harder to book lunch for the same time as the meeting
It should be a Friday... looking now.
It is definitely a Friday.
If you want to contribute, please let me know, email circuitpythonday@adafruit.com !
It is a Friday for sure
It was super cool. I could see a possibility in the future where the web editor / console could prompt you with an easy button to install missing libraries when it detects the import errors
that's a feature I was thinking of for Mu too. I've been wanting to integrate circup and a UI for circup in it, but making webapps in js is more of my strength than UIs in python
I'd like to see use move code.circuitpython.org forward too
I'm hoping melissa is going to unlock it for us by making it work with more than ble
Pycharm and VSCode will detect .env and .venv
I'll get back to you on that π
π good idea!
I think restream.io has tools to help with streaming out a video that has been cut together as well
Some people are introverts (yes me) and not comfortable with live stuff but might be ok with a short reording
It could be a demo or just a "Happy CircuitPython Day" message might be cool, too
Exactly!
Thanks
Thanks for another great meeting!
[joined literally at the last minute due to other obligations -- but at least I kinda made it!]
Thank you all for sharing your time
You got a nice hug report.
Thanks everyone!
Aww, that's nice to hear π
Yeah, you're first on the shortlist to "host". π
Here's towards a healthier tomorrow!
Thanks for driving the ship today @onyx hinge. Great to have you back around and into the swing of things.
Thanks!
Iβm intrigued by the βsprintsβ idea for CircuitPython Day and would love to know more.
I'll keep you posted as it gets more clear what it might be π
Thanks! 8/19 is a Friday, and my company works half days on Fridays, so Iβm working on clearing my calendar for that day so I can be available after 1pm EST.
Great!
I'll have to listen to the end of the meeting but if some stuff is coming for CP day and requires help or such I can see how work is / book time off. Not hard to convince me not to work a Friday π
I confirmed this is resolved now in the 7.3.x branch. I made a build from that branch for Matrix Portal and tested with the reproducer code from above. It does now successfully complete the import and print the message.
Adafruit CircuitPython 7.3.1-2-g5098d0d10-dirty on 2022-07-11; Adafruit Matrix Portal M4 with samd51j19
code.py output:
Hello from asyncio on the MatrixPortal!
Here is the notes document for next Mondayβs CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if youβll be attending the meeting - itβs super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and weβll read them off during the meeting. Hope to see you there! <@&356864093652516868>
https://docs.google.com/document/d/1r0xVV98pjnzGh3ODbX7HxM_5_Tz8UaIbgFDG-5JZrAw/edit?usp=sharing
Google Docs
CircuitPython Weekly Meeting for July 18, 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 partic...
I confirmed this does now raise the ConnectionError on 7.3.x branch.
I tested with a Feather Bluefruit Sense and CLUE devices both using builds made from 7.3.x branch.
Output on the device running the _client.py code is now:
Traceback (most recent call last):
File "code.py", line 28, in <module>
File "adafruit_ble/characteristics/float.py", line 46, in __get__
File "adafruit_ble/characteristics/__init__.py", line 246, in __get__
File "adafruit_ble/characteristics/...
I wonder if it is fixed by: https://github.com/adafruit/circuitpython/pull/6533 That PR will check that we're only doing CP locks/unlocks on the expected CPU. (Its a race condition otherwise.)
np. board reviews are easy
@slender iron I can walk Tekktrik through our RTD process if you want.
- When the code finishes and drops into the REPL command, the display goes weird. Is this a
dotclockdisplayissue or aframebufferioissue?
This could be an issue with keeping the framebuffer memory untouched when the MicroPython heap disappears. You'll want to "move" it to the supervisor managed memory.
@idle owl thanks. I'm sure you know a more updated version than me
At this point, almost certainly. π
Ok, this is fine for now. If "enough I/Os" are only available on a few boards then we should consider making it opt-in.
Are these other functions I've seen using an older philosophy or, in a perfect world, should those be changed too?
I'm lazy sometimes and don't use the mp_ versions even when they are generally better to use.
Thanks! Minor changes here: use mp_float_t to pass floating-point values around between shared-bindings and common-hal. mp_float_t is defined to be float or double, depending on other implementation choices. This is the same idea as themp_int_t type.
I suspect this is an issue with the main CP task not being woken or the background ticks not being run even when there is socket stuff pending. I'll take a look at this shortly. We may need a separate task to run select() on the sockets and then queue up the background task.
Ah, the native adafruit_bus_device may not check that the CS object is a digitalinout when it should.
Looks good to me! Why do you have it as a draft?
When I init the display, I allocate the FrameBuffer using m_malloc:
esp_lcd_rgb_panel_config_t panel_config = {
.fb = m_malloc(fb_size, true), // preallocate framebuffer in CircuitPython
when the code.py finishes, what happens to display objects and FrameBufferIO objects? What do I need to do to ensure that they βliveβ through after code.py finishes? Also, is m_malloc the right thing to use? What do you mean to βmoveβ the FrameBuffer to supervis...
FYI, Dan is out on vacation this week and should get back to you next week on this.
I'm ok with the API contract being 1us accuracy. We don't have automated tests that ensure it isn't broken. If it is, then we'd accept a PR to fix it.
Question re: Custom Board based on the Feather Sense:
The board I've printed isn't supplying the right amount of power to the VBUS (it's giving 3.3V when it should be giving 5V).
I have a variable external power supply that I've used to compensate (bring the board's voltage up to the right level).
CPy boots at that point with no issue, but it still doesn't show up as a drive that I can access (i.e. can't see it as a drive, can't push my code over to it).
I'm sure I'm missing something. Does anyone have any ideas or guidance on how I could save this board?
Generally a USB sniffer is useful when determining if anything is happening over USB.
Thanks for sorting this!
Only thing that might still need to be done is the ble examples need updating to catch the ConnectionError condition.
It couldn't receive more than 32 bytes in while checking in_waiting
because in_waiting didn't turn interrupts back on correctly.
Fixes #6579
I think I found the issue. The UART has a 32 entry RX FIFO. We usually use an interrupt to pull from that FIFO into the receiver buffer of receiver_buffer_size. However, the common_hal function that in_waiting calls didn't correctly re-enable interrupts! Hence the 32 byte limit.
Please test that https://github.com/adafruit/circuitpython/pull/6583 fixes the issue.
I noticed a difference in the way that these attributes render when built locally with sphinx vs. what is showing on the live RTD page: https://docs.circuitpython.org/projects/logging/en/latest/api.html
As far as I can tell I am using the same version of sphinx 5.0.2 as what RTD built with. Anyone know of what else could account for the differences? Ultimately I was hoping to make the name and type have a space (or something else) between them. But was puzzled when I found that my local build doesn't look the same.
maybe theme version?
Uffffffff. I've run into this as well. And it always turns out to be something obtuse that takes ages to find.
checking on sphinx-rtd-theme now. I do think I had a different version
Like I had indented lines not working right, and they only worked right with 1 space indent. 2 or more made them show up completely wrong. Took ages to figure that out, because Sphinx explicitly states, any number of spaces works fine.
yep, sphinx-rtd-theme was the culprit. 0.4.3 is the version that I found an RTD build used. I was on 1.0 I'm at least matching the live one now so I can figure out how to tweak it.
And a whitespace tweak (remove a space) is also the fix to make it not get smashed together as well in this case. Thanks for point in the right direction to both of you.
RTOS is all black magic to me at this point.... In case it's of any use I've been using the web workflow without this block of code and occasionally the workflow still goes away until there is some flash I/O. I've noticed it usually after coming back from an extended period of inactivity.
@wraith crow what board are you seeing this issue on?
I'm pretty sure it happened on an UM Feather S3, but I've been running through my S3 and S2 boards so it might have been an S2. I've noticed it at least twice but it's not very repeatable.
kk. I suspect it is worse on C3 since it doesn't have USB to keep things moving
I'll try and test out a C3 later tonight then π
just made the websocket PR βοΈ
The times it has happened I renamed or deleted a file from the flash and the workflow recovered, it was definitely hung for more than 5 seconds though
No, the workflow isn't responding when it happens, either from the CIRCUITPY drive or from the serial REPL
hrm, ok. so you change it over USB
yep
It looks like my FeatherS2 is in the hung state now, is there anything you want me to try?
are you running a debug build?
are you using a web browser to access it?
viewing the network tab of the developer tools in the browser can help see what request is in flight
No, I don't think it's a debug build, yes I'm trying to access it from a browser
did anything load or are you waiting for the html?
it'd be helpful if you could get debug output as it happens
the debug info prints out what requests its gotten
do you have it open in other tabs?
I wonder if it is chrome
tries chrome
I did have issues where an old socket would block new ones but I thought I fixed that
I hooked up rx/tx and it looks like I am on a debug build, but the output gets mucked up after the cpu starts....
hrm. maybe different speed?
I'm on S3 mostly
just saw weirdness chrome so I'm pulling that thread
Looks like a baud rate issue, but I've never seen it change in the middle like that
I'm going to delete a file from flash and see if it kicks the device loose
Yep, from the REPL I deleted a file from flash (boot_out.txt) and now the web workflow is responding
huh! weird
The symptoms are exactly the same as what was happening when the code block I commented out was still in play, except that when the code block was there, performing flash I/O only allowed a single webflow transaction and you had to keep performing I/O to get anything done. Now when it locks up, one or two I/O unlock it and then it runs without issue.
ah, the hook that runs the workflow is tick dependent
I didn't realize that from the function name
I haven't been doing USB transactions so I haven't really hit this
I wonder why ticks are on at the start
aka, why does it work for me
I was thinking it had something to do with the filesystem_dirty flag. I'm running on an old Windows 8 machine and I'm not always dismounting the CIRCUITPY drive cleanly
But that was a very uninformed guess π
I think by commenting out the tick disable, you are leaving it on
and it calls the "background" task that does the http serving
but I'm not sure why it is on for me at all
I wasn't sure how it was working for anyone either, something else must turn the ticks on that wasn't in play in my setup
I have an idea how to set it up to be driven by the sockets
but it isn't super simple unfortunately
ah! I'm on a board with a display
and displayio turns on ticks
Ah ha π
turns off the display
Foamyguy likes display boardss as well, I was scratching my head watching his streams....
I tried that excuse with my boss once, it didn't go well
Sleep is good!
Hopefully I'll have a chance to play with your new PR tonight π
do you want a patch so you don't need to do USB stuff?
I can throw my patch in after I get your PR
somewhere in init you need an extra supervisor_enable_tick
It's working well enough for me to play tonight, it can wait π
kk np
The HTTP code is currently driven by a tick callback. On boards with displays this is works because ticks are on for display refresh. On boards without it, the code can't respond because we're asleep.
I think the fix is to add a select() based task that can wake CircuitPython when sockets are ready. We'll also need an eventfd to let the select task know to update the sockets it is waiting for.
Oh I got a mention for my bitmapsaver example in the meeting today. My first ever PR. Thanks for the mention. β€οΈ Sorry for using the SD card @lone axle didn't mean for you dig out an SD card just to confirm it. I could have written it using SPI flash instead. It's cooler with the SD card example though, can log endless screenshots with SD. π
No worries. It was in a v1 of a 3D printed case with no slot for the SDCard access. I need to print a newer one before I get it closed back up.
oh no, well, made you want to print a new case. one of those circumstances where's it fine until it's not fine. i'm working on a 3D printed version with someone for a tft featherwing case. secret project. no SD card access though, just thought of that. :/
just seeing the PR comments now, yeah i completely assumed the 2.4" was drop in compatible. good call on the different driver. :/
@dmcomm You are welcome. Thank you for the acknowledgement.
keeping in mind that we'd want to move this out when other mcu families work with the wifi workflow...
it occurs to me that someday we might want to let Python code use the same web socket server implementation, but that can wait for another day.
The parts I understand seem OK, but I can't really comment on the websocket implementation. Probably fine to merge when green :)
Not sure how to move forward with this, so I'll pose the question here. I've continued to tinker with the HTTPServer by @tulip sleet. In my fork I have two branches (Refactor & WSGI). The first one refactors the module in to a folder with class files, the second builds on that by adding support for the CGI and WSGI spec.
sounds good so far
My goals. 1. allow the example code file to run unchanged 2. Keep HTTPServer simple so beginners can use it to quickly standup a web server on their boards. 3. Allow adventurous developers to use the WSGI pieces to create more advanced web apps.
Still a ways to go, in getting it cleaned up (docs, comments, etc.) but I've got it working fairly well so far. I've tested it on an ESP32S2 and examples work unchanged for both branches.
so besides the Docs, and comments. What else should I be looking at to make sure that these changes are acceptable? Is updating HTTPServer the best way to do this or should it be a separate module for the community bundle?
thanks @tannewt for the info
Hmm.. does this mean that the I2C code would have to be rewritten to schedule the communications?
Two thoughts. One if you are free Monday's 2pm EST attend the weekly CP meeting held on discord and bring it up in the "in the weeds" section, where longer discussions on items just like that take place.
Two, you could create a draft PR or an issue (tagged with enhancement) and explain what you are trying to do and create discussion there.
Three (yes I know I said two) I think Dan is away right now but a lot of times here on Discord as a good place for discussion as well.
I had to comment out the ESP_LOGE error messages in websocket.c (maybe missing esp-idf include?) but then the PR compiled and I was able to reach the serial WebSocket. The Ctrl-D, Ctrl-C and return worked but I wasn't able to send normal text/commands. If I connected via USB I could enter normally and the WebSocket screen correctly mirrored what was going on in the USB console.
@RetiredWizard Was this with Chrome? I've been mostly testing with Firefox.
Yes, with chrome. I didn't get as much time to play with it as I had hoped, got bogged down with other board issues :/
I think I was missing some error messages by commenting out the ESP_LOGE statements but it also seemed I was able to break the socket connection by spewing a lot of output to the REPL
@slender iron Heading to bed but wanted to say it was really cool seeing the REPL come over the Websocket. This is really exciting stuff, Thanks!!!
Two (3) great ideas. :-) I think I'll start with the issue/enhancement that'll give me a place to organize the thoughts. Mondays are tough because of work. I'll add it to my calendar though and try to make some of them.
Need to dig into this web socket stuff too, similar, I believe, just used for different purposes but maybe useful. Sigh!... So much to learn so little time.
I rebuilt the PR with today's main branch and replaced the ESP_LOGE statements in websocket.c with mp_printf statements. When I throw a lot of output at the serial port the websocket disconnects (stops mirroring and the SEND and CTRL buttons go grey). Nothing shows up on the DEBUG console but on the USB console the following message shows up at the point the socket disconnects:
short send on 57 err 31 len 62
This is one of the ESP_LOGE messages I replaced in order to get the PR to ...
Yes, if it uses mbedtls. I think it's nice to have port specific because the ESP-IDF's version may use hardware accelerators.
Ya, I was considering doing a second one just like we can for USB. We can do that in the future though.
I think given the test code actually producing the result it should, and the inability to reproduce the issue that was intended to be described, I think this is good to close.
I changed the input.onbeforeinput to input.oninput in supervisor/shared/web_workflow/static/serial.js and the serial WebSocket started working. Really Really cool!!!!
The parts I understand seem OK, but I can't really comment on the websocket implementation. Probably fine to merge when green :)
Thank you @wtuemura and @bergdahl.
You can probably do it using a lock where the background code will wait until user code isn't using I2C.
m_malloc is the correct thing to do but it only applies when the VM is running.
Display objects get copied into static memory here: https://github.com/adafruit/circuitpython/blob/main/shared-module/displayio/__init__.c#L162
Framebuffer memory gets moved here: https://github.com/adafruit/circuitpython/blob/4c20b3cb63abee964c34bd24000a41bad0f53579/supervisor/shared/display.c#L158=
Looks good.
Also, I tested the links and they all worked.
I seem to be able to reproduce this by running a uPyBasic program, the wifi connection crashes whether I'm using the serial WebSocket or not. uPyBasic does a LOT of flash i/o so maybe that has something to do with it.
W (60218) wifi:<ba-del>idx
W (60218) wifi:<ba-add>idx:0 (ifx:0, 48:5d:36:d1:30:e0), tid:0, ssn:235, winSize:64
I (67598) wifi:bcn_timout,ap_probe_send_start
W (67598) CP wifi: event 21 0x15
W (67618) wifi:<ba-del>idx
W (68618) wifi:<ba-a...
Hmm, after hanging the wifi several times from uPyBasic, I just ran the program sucessfully without losing the WebSocket, not quite repeatable.... I am getting a few Warning messages on the DEBUG console but everything seems to be running fine this time.
I (156658) wifi:bcn_timout,ap_probe_send_start
W (156658) CP wifi: event 21 0x15
W (159028) wifi:<ba-del>idx
W (159028) wifi:<ba-add>idx:0 (ifx:0, 48:5d:36:d1:30:e0), tid:0, ssn:174, winSize:64
W (209958) wifi:...
Reason 200 is WIFI_REASON_BEACON_TIMEOUT so I'm not sure it is a websocket issue.
@slender iron not really! I had one idea but I looked and it was already done π π
there may be optional parts but we don't like turning off optional parts
afaik we configure for 2D which is the common case, but you might make sure of that
higher dimensions bring in more code
my websocket build failed because the ulab update added 2k+. I'll look at what my options are
yes it certainly got bigger
only two boards are too small though
dan and I looked a bit when you were out and saw ulab is pretty big
should I make GIFIO depend on camera?
Thanks @tannewt :smiley:
I marked this PR as a draft whilst I performed additional testing. This is now complete and this MR should be good to merge!
In addition to being able to flash my STM32F405 board I checked the family IDs for several other STM32F4 builds. For reference these were:
stm32f4_discovery - STM32F407: 0x6d0922fa
feather_stm32f405_express: 0x57755a57
pyboard_v11: 0x57755a57
sparkfun_stm32f405_micromod: 0x57755a57
sparkfun_stm32_thing_plus: 0x57755a57
Looks like you might be right, I moved the microcontroller in the direction of my router and the program is running clean now
@wraith crow you may want to use a more sophisticated terminal emulator too. mine is very basic
what terminal emulator is that?
it is my custom code. basically a <pre> tag π
only filters out the terminal title, backspace and clear line codes
I'm not sure I'm seeing exactly the performance you meant since I swapped the javascript method but it seems to work pretty well. Command recall (up arrow) would be nice but I can't really think of too much else. I'm seeing an occasional "Null" inserted, I think it's when I overwhelm the buffer or something, but it hasn't bothered me too much yet.
I think up arrow requires me to track keypresses
you can do beforeinput on chrome. I just had to change how to connect it
(testing it now)
So on an older PC I'm picking up the network name of the device from my router (umfeathers2), I can ping that name and bring up the web workflow welcome page. When I go to one of the pages that needs authentication (umfeathers2/fs/ or umfeathers2/cp/serial/), the page isn't displayed and the DEBUG console comes up with a CP webserver: bad origin http://umfeathers2 message
ah, that is because you used the DHCP hostname rather than the MDNS one
I don't think I have MDNS on Windows 8 :/
Yep, the IP works fine
there is an origin_ok function in web_workflow that does the check
What happens if you have multiple of the same type boards, does MDNS/DHCP enumerate them showhow?
trying to prevent rogue http sites on the web from accessing it
MDNS should
I'm not sure about dhcp because the hostnames may be identical
the mdns ones use the mac address to be unique
I've seen DHCP devices with MAC addresses stuck on them, so maybe if it detects a collision it adds it
Β―_(γ)_/Β―
(inlined by) mp_obj_print_helper at /home/jepler/src/circuitpython/ports/espressif/../../py/obj.c:133
(inlined by) mp_obj_print_helper at /home/jepler/src/circuitpython/ports/espressif/../../py/obj.c:114
fun_builtin_1_call at /home/jepler/src/circuitpython/ports/espressif/../../py/objfun.c:75
mp_call_function_n_kw at /home/jepler/src/circuitpython/ports/espressif/../../py/runtime.c:665
mp_execute_bytecode at /home/jepler/src/circuitpython/ports/espressif/../../py/vm.c:936
fun_bc_call at /home/jepler/src/circuitpython/ports/espressif/../../py/objfun.c:297 (discriminator 4)
mp_call_function_n_kw at /home/jepler/src/circuitpython/ports/espressif/../../py/runtime.c:665
mp_call_function_0 at /home/jepler/src/circuitpython/ports/espressif/../../py/runtime.c:638
parse_compile_execute at /home/jepler/src/circuitpython/ports/espressif/../../shared/runtime/pyexec.c:146
pyexec_friendly_repl at /home/jepler/src/circuitpython/ports/espressif/../../shared/runtime/pyexec.c:734
run_repl at /home/jepler/src/circuitpython/ports/espressif/../../main.c:823
(inlined by) main at /home/jepler/src/circuitpython/ports/espressif/../../main.c:922
app_main at /home/jepler/src/circuitpython/ports/espressif/supervisor/port.c:410
main_task at /home/jepler/src/circuitpython/ports/espressif/build-adafruit_feather_esp32_v2/esp-idf/../../esp-idf/components/freertos/port/port_common.c:141
``` ooh you can get even more information of addr2line if you ask fori t
@slender iron do you think anyone is depending directly on the output format of ./tools/decode_backtrace.py ?
sadly, gdb disassembles mp_obj_get_type incorrectly. The faulting instruction is at +35. ``` 0x400dec50 <+28>: j 0x400dec5a <mp_obj_print_helper+38>
0x400dec53 <+31>: movltz a3, a0, a0
0x400dec56 <+34>: lsi f2, a5, 0x39c
0x400dec59 <+37>: .byte 0xff
0x400dec5a <+38>: l32i a8, a10, 16
Another scenario that causes misbehavior:
>>> s = "x" * 999
>>> import gc
>>> gc.collect()
>>> s
'\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
did you try and print out the pointer passed into get_type?
And it doesn't affect just the repl, I a similar snippet in code.py via the repl and it misbehaves in yet a slightly different way:
>>> with open("/code.py", "wt") as c: c.write("print(dir())\ns='x'*999\nimport gc\ngc.collect();print(s)\n")
...
55
>>>
soft reboot
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
['__name__', '__file__']
Traceback (most recent call last):
File "code.py", line 4, in <module>
NameError: name...
Is there an standard way to do case insensitive string compares when writing CircuitPy C code?
not that I know of
kk π
CircuitPython version
Adafruit CircuitPython 7.3.1 on 1-12-2022; Matrix Portal M4
Code/REPL
# SPDX-FileCopyrightText: 2020 John Park for Adafruit Industries
#
# SPDX-License-Identifier: MIT
# Metro Matrix Clock
# Runs on Airlift Metro M4 with 64x32 RGB Matrix display & shield
import gc
import json
import time
import board
import displayio
from adafruit_display_text.bitmap_label import Label as BitmapLabel
from adafruit_display_text.label impo...
hmm those calls create a new ondiskbitmap, which takes up memory, and you probably aren't seeing it freed later, possibly because of :
group[0] = displayio.TileGrid(CURRENT_BITMAP1 if BLINK else CURRENT_BITMAP2, pixel_shader=CURRENT_BITMAP1.pixel_shader)
you could load all 4 ondiskbitmaps at the beginning and then you can swap them in and out by hiding them. alternatively you may want to try popping them off the group so you can make sure they are gc'd - see the slideshow libr...
I threw a hack into _origin_ok to compare against the DHCP host name in addition to the mDNS host name. It's not real pretty but it seems to get the job done.
That being said, I'm not sure this test is actually doing what we're hoping it is. I don't think it's filtering out requests from rogue or outside sources. The origin variable isn't actually the origin of the request, it's the host name used in the request query, the destination maybe.
If an IP scanner was probing a LAN with these...
I'm trying to create the code.py on the fly but got error OSError: [Errno 30] Read-only filesystem
with open("my_feature.py", "w+") as f:
f.write("""print("my_feature")""")
is this possible with circuitpython?
The short answer is yes, using a boot.py file and the storage.remount method. You just need to understand that once you change the setting you will no longer have Write access via the CIRCUITPY drive and all changes will have to be done from the microcontroller either through REPL commands or CircuitPython code.
Please take a look at the following learning guide that covers the subject:
https://learn.adafruit.com/circuitpython-essentials/circuitpython-storage
Hi. There is a build failure for a single board on the main branch. Although it appears unrelated to my change, is it possible for me to re-run this GitHub action?
import adabot.github_requests as github
ModuleNotFoundError: No module named 'adabot.github_requests'
Error: Process completed with exit code 1.
I thought array assignment like that did affective clear the memory usage? Regardless, I don't think that's the issue. Similar permutations of this code can go for a long time:
5: Memory : 20624
6: Memory : 20320
6.1: Memory : 20240
7: Memory : 24528
8: Memory : 20880
9: Memory : 20784
10: Memory : 20704
5: Memory : 20624
6: Memory : 20320
6.1: Memory : 20240
7: Memory : 24528
8: Memory : 20880
9: Memory : 20784
10: Memory : 20704
5: Memory : 20624
6: Memory : 20320
...
Merge the updates of the main branch for elecfreaks_picoed to 7.3.x.
You're loading displayio.TileGrid(DEFAULT_BITMAP, pixel_shader=DEFAULT_BITMAP.pixel_shader) twice as 2 different variables, it'll work but seem seems unnecessary and redundant.
I think the issue might be stemming from not loading the pixel shader for CURRENT_BITMAP2. It might be trying to use bitmap1 pixel shader on bitmap2 or vice versa. Think of pixel shader as an alpha mask. It shouldn't crash if it's using the wrong pixel shader as long as the other image is loaded. A pixel shader is a...
In some Magtag learn guides, like this one:
https://learn.adafruit.com/magtag-weather/project-code
β adafruit_minimqtt is missing from the project bundle
β it is required for the adafruit_io library
β the requirement is not spelled using the pypi formatting
β that should not be an issue for pypi (it converts _ to - and ignores case)
Maybe that makes the project bundler miss that requirement ?
Actually that seems to affect every guide using adafruit_io (so any using portalbase)
Like that:
https://learn.adafruit.com/pyportal-weather-station/code-pyportal-with-circuitpython
I've built the PR with @tannewt's chrome tweak and it works great.
I tried disabling PSRAM completely to see if it was being misused, but that caused a boot loop. I did not have time to figure out what was wrong.
Note that there is a workaround flag for an issue with PSRAM with earlier chip versions. Also I did not check whether there are cache settings that might be wrong.
This sequence doesn't involve gc.collect (nor is garbage implicitly collected) and still gives a nonsense result.
Adafruit CircuitPython 8.0.0-alpha.1-39-gafbaa2eb6-dirty on 2022-07-13; Adafruit Feather ESP32 V2 with ESP32
>>> import ulab
>>> u = ulab.numpy.ones((6400,))
>>> sum(u)
6.326e+22
It crashes at this point instead of returning to the repl:
? Backtrace:0x400d4198:0x3ffbf0400x400de76e:0x3ffbf060 0x400e0eed:0x3ffbf090 0x400e3495:0x3ffbf0b0 0x400e9d8a:0x3ffbf0d0 ...
You're loading displayio.TileGrid(DEFAULT_BITMAP, pixel_shader=DEFAULT_BITMAP.pixel_shader) twice as 2 different variables, it'll work but seems redundant and doesn't have anything to do with the main issue in my opinion.
The reason I have two copies of the TIleGrid is I want the grid to populate IMMEDIATELY for a loading screen. To do that, I need it to load before all my labels and BEFORE that method that calculates the time. For this reason, I create the grid and populate the loading ...
I think I found the problem with psram. Now, thonny works with the adafruit feather esp32 v2!

Generally we just comment it is unrelated and merge anyway
will look shortly
Thanks!
@tannewt do you want to review this before I merge it? I scanned Dan's work before taking over and it all looked good, but it'd be best if someone looked at my work.
@onyx hinge I'll look shortly
Does spiram_size_usable_for_malloc require you to let the IDF manage the spiram? Generally we have it ignore it.
Want to use 176 like the S3? Not 48 like the S2.
Two minor things we may want to change before merge. Nice work @dhalbert and @jepler!
Looks good! Not sure when we'll do another 7.3.x release.
The only thing that changes are the POSITIONS of the pixels, not the pixels themselves.
Why not just use one TileGrid and bitmap and move it? It is OK for a TileGrid to be out of bounds.
@jepler Please re-review. The two build failures are unrelated to the PR.
See image. The position of the pixels change independent of each other. I was saying the count and color of pixels was the same between the images (more or less), I was NOT saying the bmps were identical or could be equal given some vertical or horizontal shift. All in all, using the same shader works, but is not necessary, as I showed in my adapted code
Wifi scanning/connecting only works once, then you have to use the reset button.
allocating 176kB fails, which is why I changed it.
Now it automatically allocates the largest block possible, except never more than half of all internal sram. This is the algorithm used by micropython for all esp32-family ports.
I renamed the function to avoid confusion. It has nothing to do with malloc, it's just the name of the function I copied in from esp-idf, where it was defined statically.
The main problem i'm aware of at this point is that wifi can only scan or associate once before a hard-reset.
@slender iron a re-review would be awesome
@idle owl Did you ever write the guide about mpy files? It'd be really helpful for my understanding while reviewing a PR, but I can't seem to find it.
I thought so. Hold on.
FWIW, it took me a minute to remember that.
Ok, sounds good. We should be aware that the heap on non-PSRAM boards may actually shrink if we were previously giving them more than half of internal ram.
@idle owl I noticed adafruit minimqtt missing from the project bundles on learn for the portalbase libraries
I believe this PR will fix it https://github.com/adafruit/Adafruit_CircuitPython_AdafruitIO/pull/93
but I don't have access to the bundler, so I don't know
@jaunty juniper That PR will fix it, if that's the issue you were seeing.
@proven garnet Any reason not to merge that PR?
You're welcome to π
ok that's good then
I'll merge this with green; if I have additional fixes (I'm chasing the wifi 'only once' problem next) I'll start fresh PRs. Re-starting the full CI on this PR is getting a little old.
ADD, best reason I got. I'll merge it now π
@onyx hinge I'm waiting for a re-review from you too
@slender iron oops, will do that now!
thanks!
Thanks! I didn't see anything in the later updates that was concerning, and now it's tested by someone else too.
That's certainly an odd failure. python3: can't open file '/home/runner/work/circuitpython/circuitpython/ports/atmel-samd/../../tools/uf2/utils/uf2conv.py': [Errno 2] No such file or directory
Hah! Fair enough.
seems the "get CP deps" step failed but didn't report the error in a way that GA understood as a failure
Also, @idle owl whenever you get a chance, could you take a look at this cookiecutter fix? It's for building MPY files for community libraries, which is currently broken (sometimes, PR should explain) https://github.com/adafruit/cookiecutter-adafruit-circuitpython/pull/186
Oh cool it has merge conflicts, I'll fix those
Merge when ready.
You got it!
A recent build failed. The original error seemed to be during ci_fetch_deps where a build message said
fatal: reference is not a tree: 346c936e14c6ea3a8d3d65cb1fa46202dc92999d
fatal: Unable to checkout '346c936e14c6ea3a8d3d65cb1fa46202dc92999d' in submodule path 'extmod/ulab'
(along with other problems), but this step didn't signal failure to github actions.
By adding the check= parameter, a failure of the subprocess will cause a CalledProcessError to be raised, which will...
CircuitPython version
Adafruit CircuitPython 8.0.0-alpha.1-30-g8814ee03f-dirty on 2022-07-03; Teensy 4.1 with IMXRT1062DVJ6A
Code/REPL
from pwmio import PWMOut
import board, time
p = PWMOut(board.D2,duty_cycle=32000,frequency=5000,variable_frequency=True)
time.sleep(20)
p.frequency = 500
time.sleep(20)
p.duty_cycle = 0
p.deinit()
p = PWMOut(board.D2,duty_cycle=32000,frequency=1000,variable_frequency=True)
Behavior
During the first and s...
@idle owl, @tulip sleet, @jaunty juniper - I was thinking about how to add __version__ info to the libraries, and it fits really well with pyproject.toml. I have an example in my CircuitPython_CSV library that I just converted to pyproject.toml. It uses the same sed command to populate the version as a hardcoded string instead of using setuptools-scm. That way, any changes to the library don't make it deviate from the tag name upon release (PyPI absolutely hates tag names like 1.2.4+dev.1234556 and won't do it) but this side steps the problem. Then in a future update, we could add __version__ to all the libraries that don't already have them and you could do this across the board:
>>> import libname
>>> libname.__version__
1.2.3
PR with the changes for reference: https://github.com/tekktrik/CircuitPython_CSV/pull/13
And it works, the release I just did for v1.1.0 worked: https://pypi.org/project/circuitpython-csv/
@strong violet please ping me when you are around. I want to modify thonny to work with the set title stuff in CP 8 and would love some pointers
I've filed an issue on Thonny for guidance: https://github.com/thonny/thonny/issues/2349
@lone axle do you have simple editor html/js?
do you want to integrate it into the web workflow or want me to?
fine with me. you'll likely hit build size issue unfortunately
we'll have to decide how to make it fit
Ok, sounds good. We should be aware that the heap on non-PSRAM boards may actually shrink if we were previously giving them more than half of internal ram.
@onyx hinge I did the resolve
The branch is here https://github.com/FoamyGuy/circuitpython/tree/webworkflow_edit_page I'm heading out for a walk, but can work on a PR for it tonight afterward.
kk, I'll do other things π
thank you!
Adds a handler for pages like /edit/#code.py
loads a basic code editing page:

I'm not sure where the changes to ulab and pew-pew-lcd submodules came from. Nor a bunch of the differences in the translations file.
I created this branch a little while back and just merged main to it to catch up today, but I may have done something wrong
@slender iron maybe we can look at it together tomorrow, I enabled web workflow on esp32 v2 and it does get an IP address (I can see it in the repl), I can ping circuitpython.local but but I can't browse or curl http://circuitpython.local
do you have a display?
otherwise you'll need 6591
(which I'm cleaning up now)
don't know how I missed all that debug stuff
like displayio? no
as-is in main you'll need ticks enabled
I see, I think
right now the call to the http server code is done from a ticks callback
which works with displays because displays enable ticks
that branch will have a minor merge conflict with esp32 PR as well
ok, I've got fixes for it now anyway
maybe I'll wait until the ESP32 PR is green and then merge
57 checks left
Still hanging trying to load page. Control-D in REPL helps a little but sometimes results in the board freezing with this message on the USB port:
Assertion 'num_triggered >= 0' failed, at file Socket.c:95
and the following on the DEBUG console:
I (49499) gpio: GPIO[46]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
Backtrace:0x400A0FD9:0x3FFDAFD00x400A1C03:0x3FFDAFF0 0x400A0D59:0x3FFDB010 0x400A0E6B:0x3FFDB030
0x400B5056:0x3FFDB050
...
nice!
This allows the web workflow to work on an Adafruit Feather ESP32 V2, where it didn't before (note it also has to be enabled by editing the board definition in the draft PR).
I didn't follow the code in detail so there might be little problems, but this changed it from not working at all to seemingly working pretty well. huzzah!
However, based on the report from @RetiredWizard that crossed with my testing & review maybe hold off on merging this.
Decoded backtrace:
0x400B5056:0x3FFDB050got ['0x400B5056', '0x400A0D59', '0x400A0E6B']
/home/pi/circuitpython/ports/espressif/common-hal/socketpool/Socket.c:95 (discriminator 1)
/home/pi/circuitpython/ports/espressif/../../main.c:997
/home/pi/circuitpython/ports/espressif/../../main.c:1004
I don't see any files once I get /fs to load. when there's no password configured, /fs and /serial both just give blank pages, not guidance. /serial does work in ff now that I configured the http password
>>> os.listdir('/')
['.fseventsd', '.metadata_never_index', '.Trashes', 'lib', 'boot_out.txt', 'adafruit_ahtx20.py', '.env', 'wifitest.py']
```files are seen in the repl
this is really slick @slender iron well done!
I was able to get some very helpful debug output, narrowing down on the issue:
code.py output:
Metro Minimal Clock
Time will be set for America/Chicago
0: Memory : 62752
1: Memory : 41376
#0 | 4642.45
Updating time...
--------------------------------------------------------------------------Even
2: Memory : 37888
2.2: Memory : 34464
2.3: Memory : 31040
3: Memory : 35680
3.1: Memory : 35712
Connecting to AP jgage_netgear
Getting time for timezone America/Chicago
Chec...
@onyx hinge my intent was that fs/ wouldn't load at all without a password
Don't know where to leave this. I'm a 40 veteren and have shipped two commercial dev platforms (Symantec C++, Visual Cafe (also originally Symantec). More relevant, I'm polyglot programmer of libraries going back to C/C++ standard libraries. I've also worked on OSes (3). I am a busy CTO but have been looking for something important to do for CP. Check out https://www.linkedin.com/in/richsadowsky/
and write to me at rich@waverleysoftware.com. That reaches me fastest
1 more esp32 check...
oh @idle owl a note about learn guides: while responding to support questions, I noticed that there are a few featherwing guides that have list of pins like this:
https://learn.adafruit.com/adafruit-adalogger-featherwing/pinouts
The SDCS pin is the chip select line.
On ESP8266, the SD CS pin is on GPIO 15
On ESP32 it's GPIO 33
On WICED it's GPIO PB5
On the nRF52832 it's GPIO 11
On Atmel M0, M4, 328p or 32u4 it's on GPIO 10
On Teensy 3.x it's on GPIO 10
They should probably be updated for new boards like RP2040, ESP32Sx feathers, TFT and such (most of which use the same pinout as the M4, so maybe put that upfront) and mention the CP pin name (like board.D10 in this example) or something
Can you please email me with this info? I'm out until Monday and this will get lost on Discord.
will do
@RetiredWizard Any idea what caused the disconnect? I thought I was handling the case where a socket file descriptor becomes invalid but I must have missed one.
Will have an updated version of this shortly based on the ESP32 merge.
This allows the web workflow to work on an Adafruit Feather ESP32 V2, where it didn't before (note it also has to be enabled by editing the board definition in the draft PR).
I didn't follow the code in detail so there might be little problems, but this changed it from not working at all to seemingly working pretty well. huzzah!
yes I agree, the password is a great idea .. but I'm suggesting that when there is no password configured that it needs to do something besides return a blank page, like give a hint to configure the access password in .env
Ya, we can tweak it all. Just takes more firmware space. π
yep
Nothing is jumping out at me, the board crash happens after several ctrl-D presses in the repl. I was having some success getting the board to service the background workflow a bit at a time by pressing the ctrl-D.
I took a look at the line referenced by the Assertion 'num_triggered >= 0' but I couldn't make anything of that section of code.
I wrote a long detailed history of why I am qualified to do this. I will send it, but you can probably see it yourself. Also you probably know me as RichSad on Adafruit Discord.
reach me at rich@waverleysoftware.com is more efficient than the email this github is connected to.
My demographics:
Rich Sadowsky
Sturbridge, MA
https://www.linkedin.com/in/richsadowsky/
Full time job: Chief Technology Officer at WaverleySoftware.com. Waverley was the company that build many things for me at ...
I do not currently do my own builds of CP but and create core modules but will begin doing that. Won't take long. I eat technology for breakfast ;-)
cb@speedy:~/circuitpython/ports/espressif$ make BOARD=adafruit_feather_esp32s2_tft
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
Traceback (most recent call last):
File "../../tools/gen_web_workflow_static.py", line 7, in <module>
import minify_html
ModuleNotFoundError: No module named 'minify_html'
Trying to build the latest
@richsad Discord is the place to be ... checkout the circuitpython-dev channel.
have you pip install -r requirements-dev.txt ? It's a new requirement
@jepler tested this on an ESP32 board that doesn't have the USB interface? If so I'm guessing that's the difference between his results and mine. That seems somewhat consistent with my observation that I could shake some background ticks loose by doing things over the serial USB connection.
Thanks, builds now!
Looks good! Not sure when we'll do another 7.3.x release.
It's ok. Thank you.
cool repl in one tab file browser in anotherπ
I rebuilt after @tannewt 's last force-push and getting the same results. I'm not sure it's of any value but I grabbed the debug output as I was testing and commented along the way. It turns out slowing the process down in order to record it apparently avoided the board crash. Once I decided I had enough, I went ahead and started pressing Ctrl-D in the Repl without waiting as long between reboots and before long hit the same num_triggered >= 0 from line 91 of socket.c crash again.
In any c...
- Similar code has been tested in ESP-IDF on another project of mine with great success https://github.com/litui/esp32_bbq10kbd/blob/a3804a3436f964e52af432ee632b72a2b3149ff2/src/BBQ10Keyboard.cpp#L97
- The reason this code is important is that A. the default timeouts on I2C on ESP32 are too short for most applications, resulting in frustration trying to use CircuitPython with ESP32 chips, and B. different numbers of bits are used to store the timeout value in the I2C register depending on wh...
I should also note, this appears to fix the "random" inability of CircuitPython to detect pullup resistors. It seems it was mainly a timeout issue.
Looks like my "fix" is another approach to the solutions discussed here https://github.com/espressif/esp-idf/issues/8770
https://github.com/TheMindVirus/whistles
TODO(The): Rename Whistles.eval(const char* src); to Whistles.interpret(char* repl);
Bells and...undefined references
Was told by tannewt to post here for help in adding a flash chip definition for the nrf52840 feather bluefruit sense. https://github.com/adafruit/circuitpython/tree/9d5b04ebc49193afab8efba4fb31c33ac1c81f5d/ports/nrf/boards/feather_bluefruit_sense I'm going to attempt to drop in a bigger QSPI flash chip (16MB). https://www.digikey.com/en/products/detail/cypress-semiconductor-corp/S25FL128LAGMFM010/7322845 I checked the datasheet and far as I can tell it appears to be drop in compatible. It hasn't arrived from digikey yet and I'm pretty excited to get started before it arrives. I can do a PR but unsure where to start. Should I fork the main Adafruit/circuitpython or something deeper like /ports/nrf/boards? Where should my fork start? My experience with contributing on GIT is almost non-existent.
@midnight ember have you been through the building CP learn guide?
I donβt consider myself a developer and with the excellent docs from the CP team Iβve been able to make contributions, like adding new boards.
I am sure you can do it. Ask questions as you go. Community here is great!
first time i'm seeing that, probably because i don't do much with ESP... yet (I have 2 S3's on the way). thank you. π
Thereβs another learn guide on adding boards as well. Youβre instinct is correct, copy a similar board and start with that.
documentation looks good, i've never worked with toml before. i forsee pip installs in my future.
should i name the exact model in the filename? https://github.com/adafruit/nvm.toml/tree/main/flash/cypress
current ones are much shorter S25FL216K.toml vs the one i'm getting S25FL128LAGMFM010
EXTERNAL_FLASH_DEVICES = "S25FL116K, S25FL216K, S25FL128LAGMFM010, GD25Q16C" no way, is it really going to be as easy as putting a comma and chip id? that's too easy, there's gotta be some catch.
created a fork of adafruit/circuitpython and it's showing me this message
Your main branch isn't protected
Protect this branch from force pushing, deletion, or require status checks before merging.
should i click on protect now or just ignore it?
i have no other contributors in my personal repo so don't think i have to worry about it, just double checking.
Adding chip to a board is indeed that easy if its in nvm.toml
it's not there, i added that part to the line
Then you need to stare at datasheets and make new entries most likely
yep, prepared for that.. tomorrow. it's late.
or early, i haven't been to sleep yet. lots of research to do π
Often similar parts are fine, GD25Q16C also worked for me for GD25Q32 parts
i.e. the chinese pico clones with 4MB of flash.
You can do something like that now for example:
from adafruit_matrixportal.matrix import Matrix
matrix = Matrix(bit_depth=6)
matrix.display.root_group.hidden = True
Did I do that right ? Is there a better way to do it by reusing the existing one in Display.c instead ?
Define the default BLE name of a board, for BLE workflow in particular (for example in a classroom setting).
This is only the default name, user code can later redefine the BLE name too.
Use CIRCUITPY_BLE_NAME in .env.
CIRCUITPY_BLE_NAME=Bill's Circuit Playground

@slender iron I was just watching Show and Tell. I've been looking for a way to get more involved in CircuitPython but I'm not much of a Python developer. That said I do have a lot of experience with CSS. Scott, would you at all be interested in letting me collaborate on the web workflow stuff you're doing by providing some super minimal CSS that you could include to jazz up the interface a little?
(btw by "Jazz it up" I mean, make it more readable and usable than the browser defaults) π
The pins C14 and C15 work both in the input and output direction with digitalio (on boards where there's no crystal at those pins).
But as described above, using those pins in keypad causes the entire keypad to not detect any events, even for all other pins.
What might be causing keypad to fail even if digitalio works? Does CircuitPython associate some additional properites/variables to pins, causing pins C14 and C15 to behave differently from other pins in the context of keypad?
CircuitPython version
7.3.1 / 8.0
Code/REPL
python -m esptool --chip esp32c3 --port COM30 --baud 115200 --before default_reset --after hard_reset --no-stub write_flash 0x0 c:\temp\adafruit-circuitpython-adafruit_qtpy_esp32c3-en_US-7.3.1.bin
Behavior
After install and reboot, I get a welcome message in Thonny in the Shell output window exactly one time, but no interactive >> prompt in the shell. Also, no USB drive is mounted. (May also be a Thon...
The QTPY ESP32-C3 has built-in USB-to-Serial, but not native USB - it cannot act as a keyboard or disk drive. Microcontroller's without native USB have not gotten much attention from CircuitPython up until now because they couldn't mount the CIRCUITPY drive. However, now that the BLE and Web workflow is starting to be available these chips may get more development attention.
Your issue is probably the same as #6220
CircuitPython version
Adafruit CircuitPython 8.0.0-alpha.1 on 2022-06-09; Raspberry Pi Pico with rp2040
Code/REPL
import array
import board
import rp2pio
program = array.array("H", [0x4001]) #in pins 1
sm = rp2pio.StateMachine(
program,
frequency=1_000_000,
first_in_pin=board.GP1,
auto_push=True,
)
Behavior
Traceback (most recent call last):
File "code.py", line 10, in
ValueError: init length must be 2-64
Desc...
I'd love help! The challenge is doing it without increasing the file sizes much. They are here: https://github.com/adafruit/circuitpython/tree/main/supervisor/shared/web_workflow/static Most should be workable from your desktop and communicating with a local device
Yeah i imagine space is pretty limited. Iβm pretty sure I can make it a little nicer without too much overhead. Especially once the css is all minified.
So I guess I can just do a pull request or something with my changes?
Donβt suppose it would be acceptable to assume the user has internet and pull the css from a cdn?
my goal is to not assume internet however if it works ok without I think we could have a supplement css for online
ya, PR is great and I can help you get testing
right now the files are gzipped. html and js is minified using some python libraries
I'll be back in 20 or so. gotta change a diaper
The weird characters are due to the new title bar updates. We've already got a bug to track fixing Thonny and other tools here: https://github.com/adafruit/circuitpython/issues/6548
This looks good to me! I don't think there is a good way to share.
Keypad.KeyMatrix uses the digitalio code internally so I'd expect it to work: https://github.com/adafruit/circuitpython/blob/main/shared-module/keypad/KeyMatrix.c#L56= Must be some quirk with those pins.
Thanks for this! Code looks good. Please add documentation of this to docs/environment.rst.
@dhalbert has the most context so I asked him to review. He's on vacation this week though so he'll get back next week. Thanks for the PR!
Thanks for the offer! Closing in favor of #6558
What is line 380 and causing the memory error? It'd be much easier to debug a simpler example.
I'm not sure where the changes to ulab and pew-pew-lcd submodules came from. Nor a bunch of the differences in the translations file.
It looks like it may have been mismerged. git merge won't update submodules so if you git add them your commit, they'll change back. You can probably git checkout these files and checkout the correct commit in the submodules and then git commit --amend to correct the merge commit. Happy to help more on Discord.
Looks like there are already errors that this catches. :-/
@RetiredWizard Please have the Developer Tools section open to the console in Chrome as well. It will likely have messages about while file loads are stopped. The network tab can be useful too.
The -104 is connection reset so chrome may be assuming the response is done.
@richsad You don't need to convince us to let you help. We'd welcome it. I don't know of anyone currently working on it so you are welcome to start.
As @askpatrickw said on the other issue, the #circuitpython-dev channel on Discord is the best place to discuss where to start. Here are instructions on how to build CircuitPython.
@wraith crow you around?
Sort of, taking a break by the pool at the moment
kk, what board are you testing on? I can make you a build with more debug prints
and you can try it when you have time
I've been using the unexpected maker feather us too but I also have an adafuit ESP 32s2 and an S3 dev kit
kk
Um feather s2, π voice transcription didn't get that very.well
Ah I knew I forgot something. Added CIRCUITPY_WEB_API_PASSWORD too. (In alphabetical order).
aha thonny can "show hidden files", I just didn't look in the correct place at first. There's a hamburger menu in the "open from circuitpython device" dialog, and that's where you can do it... and it seems to be remembered, at least in the session. yay, now I can edit .env easily.
how would I debug print an int ? I've been using serial_write like a savage
mp_printf(&mp_plat_print, βformat stringβ, input, variables);
What is a 'station'? that is, what does start/stop station method on wifi.radio do? Is there a way to undo wifi.radio.connect without soft-resetting?
I wonder what they do too, I believe a station is the term for the "client" side that connects to an access point, Micropython has network.STA_IF and network.AP_IF
sta_if = network.WLAN(network.STA_IF)
if not sta_if.isconnected():
sta_if.connect('<your SSID>', '<your key>')
I know of switching wifi.radio.enabled to force a disconnect I think ?
@slender iron So the behavior starts out the same, no DEBUG messages, nothing on Dev Tools Console, Network tab shows pending connection to 10.0.0.187
If I connect via the USB serial port, the Auto-reload message is waiting for me with a message to press any key to enter the REPL.
Pressing enter causes the following on the DEBUG console:
I (186319) CP socket: opened 57
I (186319) CP webserver: Request GET /
I (186319) CP webserver: Header Host 10.0.0.187
I (186319) CP webserver: Header Connection keep-alive
I (186319) CP webserver: Header DNT 1
I (186329) CP webserver: Header Upgrade-Insecure-Requests 1
I (186339) CP webserver: Header User-Agent Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KH
I (186349) CP webserver: Header Accept text/html,application/xhtml+xml,application/xml;q=0.9,image/avi
I (186359) CP webserver: Header Accept-Encoding gzip, deflate
I (186359) CP webserver: Header Accept-Language en-US,en;q=0.9
The browser displays the welcome screen with no fields filled in, Still nothing on the dev tools console, the network tab shows:
The two pending are sockets waiting to be accepted
What kind of quirk for example? How can this be fixed? Note that using pins C14 and C15 in keypad.KeyMatrix() stops keypad from working for other pins as well. So maybe keypad uses some variables/constants that are associated with pins C14 and C15 while setting up some global settings. What variables/constants are associated with pins?
What apart from never_reset_pin_number() (which I commented out [here](https://github.com/adafruit/circuitpython/blob/main/ports/stm/peripherals/stm...
Pressing Ctrl-D on the repl at that point kicks out the following DEBUG messages:
I (544469) CP socket: opened 58
I (544469) CP socket: closed 57
I (544469) CP webserver: Request GET /favicon.ico
I (544469) CP webserver: Header Host 10.0.0.187
I (544469) CP webserver: Header Connection keep-alive
I (544479) CP webserver: Header User-Agent Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KH
I (544489) CP webserver: Header DNT 1
I (544499) CP webserver: Header Accept image/avif,image/webp,image/apng,image/svg+xml,image/,/*;q=0.
I (544499) CP webserver: Header Referer http://10.0.0.187/
I (544509) CP webserver: Header Accept-Encoding gzip, deflate
I (544519) CP webserver: Header Accept-Language en-US,en;q=0.9
Still nothing on the dev tools console, the network tab shows the favicon.ico download complete, still pending on welcome.js
using a similar part won't work in my case because there's no 16MB chips listed for cypress in the nrf52/bluefruit sense. i don't think there are any boards for nrf52 with that sized chip. i know it exists for the teensy and some espressif boards. i can use another cypress chip as an example and resize the flash parameter hopefully.
Pressing Enter at the new REPL press any key prompt results in:
I (718779) CP socket: opened 57
I (718779) CP socket: closed 58
I (718779) CP webserver: Request GET /welcome.js
I (718779) CP webserver: Header Host 10.0.0.187
I (718779) CP webserver: Header Connection keep-alive
I (718789) CP webserver: Header User-Agent Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KH
I (718799) CP webserver: Header DNT 1
I (718799) CP webserver: Header Accept /
I (718809) CP webserver: Header Referer http://10.0.0.187/
I (718819) CP webserver: Header Accept-Encoding gzip, deflate
I (718819) CP webserver: Header Accept-Language en-US,en;q=0.9
and:
I removed other pins from row_pins of keypad.KeyMatrix() and now pins C14 and C15 work. It seems that keypad doesn't work when row_pins are more than 9 pins. Is this upper limit of 9 hardwired in keypad somewhere and can be increased? Or should the timing be adjusted manually somehow?
Possibly a red herring but out of ESP32, -S2 and -S3 isn't S2 the one with just one core?
CircuitPython version
main branch
Code/REPL
No code was run
Behavior
Did not run any code.
Description
I get an error when trying to install the requirements-dev.txt
Encountered error while trying to install package.
β°β> RPi.GPIO
ERROR: Couldn't install package: adafruit-circuitpython-typing
Logs below:
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting adafruit-circuitpython-typin...
.. this makes reconnecting without a full reset not work. The user initiated wifi flag is now used to track whether import wifi needs to re-enable the wifi interface.
Because this works on other generations of the esp32 (c2, c3, etc), apply this behavior only to esp32.
After this change, it's possible to connect multiple times to wifi in different runs of code.py or the repl after soft rebooting.
Testing procedure: Connect with Thonny. Put wifi deets in .env on device (to open t...
@tannewt please consider enabling workflow for esp32 with this PR!
The summary so far:
- For pins C14 and C15 to be usable by
digitalioandkeypad,never_reset_pin_number()should be commented out at https://github.com/adafruit/circuitpython/blob/main/ports/stm/peripherals/stm32f4/stm32f411xe/gpio.c#L43-L44 - You might want to actually comment it out there in your main codebase. (Should the ticket remain open until then?) I haven't tested how the low-speed crystal on the stm32f411ce-blackpill board connected to those pins interferes with their GPIO...
Should I comment out both never_reset_pin_number(0, 10); and claim_pin(0, 10); at https://github.com/adafruit/circuitpython/blob/main/ports/stm/supervisor/usb.c#L125-L126 ?
What is meant by "reset pin number" (reset from what value to what value and why?) and "claim pin" (claim in the sense that the user can't use that pin?) in those function names?
@onyx hinge c3 is single too iirc. I was going that route too. S2 failed quickly in mdns code for me. So Iβll try and take a look at that once Iβm back to my desk
ah ok
Ari has an eye doc appointment now so itβs a busy day
What is line 380 and causing the memory error? It'd be much easier to debug a simpler example.
Its the method call, update clock
Again, you can see the full file here: https://codefile.io/f/xj94CjuuCy9k1V0FjQee
CircuitPython version
Adafruit CircuitPython 8.0.0-alpha.1-31-gc1b00442a on 2022-07-02; stm32f411ce-blackpill with STM32F411CE
Code/REPL
import board, keypad
key_matrix = keypad.KeyMatrix(
row_pins=(board.A0, board.A1, board.A2, board.A5, board.A7, board.A8, board.B8, board.B9, board.C13, board.C14, board.C15, ),
column_pins=(board.B14, board.B12, board.B10, board.B1, board.B0, board.A4, board.A3, ),
)
while True:
event = key_matrix.ev...
@onyx hinge fwiw. decent cheat sheet.
Commenting out never_reset_pin_number(0, 10); claim_pin(0, 10); or only never_reset_pin_number(0, 10); at https://github.com/adafruit/circuitpython/blob/main/ports/stm/supervisor/usb.c#L125-L126 causes the device to appear as "Unknown USB Device (Device Descriptor Request Failed)" in Device Manager in Windows 10, without REPL connection, without CIRCUITPY drive.
Why is that? How does never_reset_pin_number(0, 10); affect things that happen at that pin before my code gets executed? ...
is back
love it when debug prints fix an issue
huh I just noticed the IP address shows as blank ..
version.json has ip: ""
this probably happens if the terminal title is disabled
Just another observation of the behavior on the S2 chips, If I'm patient, I am sometimes able to coax the serial terminal into working. Once it connects and starts mirroring the REPL it seems to keep working and doesn't suffer the any disconnects or web loading delays. Oddly, just using the serial terminal seems to allow the other web workflow pages to work on the lilygo ESP32-S2, but not on the UM Feathers2. I am using slightly different CP builds on those two devices, The UM is running Sco...
i don't see a way to easily append a bigger chip to mpconfigboard.h #define CIRCUITPY_INTERNAL_NVM_SIZE (4096) if i change that value then i'd have to create a new board, was hoping to avoid that and just get a bigger flash chip supported. am i going to have to make my own board to add a bigger flash chip and if so what should i name it?
this is for the bluefruit sense https://github.com/adafruit/circuitpython/tree/main/ports/nrf/boards/feather_bluefruit_sense
hmm found an example from samd that uses if statements for different variants. https://github.com/adafruit/circuitpython/blob/main/ports/atmel-samd/mpconfigport.h says it's set within include/sam.h could i do something like that?
hmmm the nvm size would be the size of the nvm, not the external flash (microcontroller.nvm)
oh oops. ok then this one #define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE)? trying to change the size of the spi flash. didn't realize nvm was different than external flash.
i'm guessing nvm is internal to the nrf52840 chip?
# Settings for the Cypress (was Spansion) S25FL128L 16MB SPI flash.
# Datasheet: https://www.infineon.com/dgdl/Infineon-S25FL256L_S25FL128L_256-MB_(32-MB)_128-MB_(16-MB)_3.0_V_FL-L_FLASH_MEMORY-DataSheet-v09_00-EN.pdf?fileId=8ac78c8c7d0d8da4017d0ed40e335224
total_size = 0x200000 # 2 MiB
start_up_time_us = 10000
memory_type = 0x40
capacity = 0x15
max_clock_speed_mhz = 133
6b_quad_read = true
32_qspi_write = true``` I've found and changed the max clock speed but the rest is a mystery to me. I don't understand the MiB conversion. Can't find anything mentioning startup time, no clue what the memory or capacity should be in hex.
CircuitPython version
Adafruit CircuitPython 7.3.1 on 2022-06-22; Seeed XIAO nRF52840 Sense with nRF52840
Code/REPL
import time
import array
import math
import board
import audiobusio
# Remove DC bias before computing RMS.
def mean(values):
return sum(values) / len(values)
def normalized_rms(values):
minbuf = int(mean(values))
samples_sum = sum(
float(sample - minbuf) * (sample - minbuf)
for sample in values
...
I haven't run an espressif port build in a few months on my dev box... Is there anything I need to do other than a git pull? Like does the esp-idf in the ports dir need to be updated or anything?
you make need a make fetch-submodule (or similar I may have that wrong) as I think the IDF was updated at somepoint. And then to run the install.sh script again. I think that's what I had to do
Thanks, that's exactly what I needed to hear π


Thank
