Looks like you nailed this one. I've done many refreshes from both a solid network connection (right next to the router) and a less solid connection and the file listing has showed up every time. I did get a couple net::ERR_CONNECTION_RESET messages in the developer console screen but the file manager seemed to operate fine regardless of that message being displayed.
#circuitpython-dev
1 messages · Page 4 of 1
thanks for the testing @wraith crow
I'm not sure about the frame header error, but I can still disconnect the web workflow serial terminal with the utf-8 decode error even after applying #6742 :(
It turns out that a fisheye camera is NOT good for trying to scan a QR code with, qrio doesn't correct for optical distortion at all. that's part of why it was being so moody when I tried today
I thought qr codes were designed for that?
there are probably better libraries out there? but this one is good for a microcontroller
I dream of one day porting the apriltags code from openmv
Would love to see you do it!
it's way over my head currently, but who knows
whaaaaat? how did Intel manage to create a graphics driver that couldn't show QR codes? https://www.intel.com/content/www/us/en/support/articles/000059259/graphics.html
Images and QR codes viewed with Intel® graphics driver 27.20.100.9466 or earlier are distorted, causing them to be not readable by phone camera.
well, it's Intel, they have decades of experience with making broken things
While playing with the serial terminal I stumbled on a reliable way to reproduce the disconnect. I don't really understand what's going on with the STR variables here, but if you read a single character from the attached file it reads a string of length 4 into that single character. If you then print that character the serial terminal disconnects and you get the following message in the developer console:
WebSocket connection to 'ws://10.0.0.206/cp/serial/' failed: Could not decode a ...
I believe the issue is that the disconnect.txt file doesn't contain utf-8. When you are opening the file, you are asserting that the file is text in utf-8. CP isn't catching it is invalid. Instead it is giving you a four byte character which websocket faithfully writes out. The browser is the first to notice that it is invalid utf8. (bytes 2-4 should be 10xxxxxx).
Here is what CPython gives:
>>> f = open("/home/tannewt/Downloads/disconnect.txt")
>>> c = f.read(1)
Traceback (most ...
I'm building an ESP32-S3 image just to confirm, but I haven't been able to generate the original disconnect from the CODE/REPL listed above on the C3 after #6742 was applied, so that PR does appear to have resolved at least part of this issue.
Yep, the original CODE/REPL program no longer causes a disconnect after #6742. Do you want to let that PR close this and open a new one for the UTF-8 issue or just keep this one going?
We may have set retries to 0 to enforce a timeout but the connect
succeeded. When it succeeds, we want to allow retries later in
case we lose signal briefly. (The callback will do this too but
the connect function will override it after.)
Also, remove extra code from websocket that is leftover from
debugging.
is there a good pin out or other ref somewhere that shows what pins on the RPI pico are PWM channel A vs B?
Adafruit CircuitPython 7.3.2 on 2022-07-20; Raspberry Pi Pico with rp2040
>>> import board
>>> import countio
>>> counter = countio.Counter(board.GP8, edge=countio.Edge.RISE)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: Pin must be on PWM Channel B
>>>
Um.... The datasheet would have it. That's the first place I go with RP2040, tbh. Unless there's PrettyPins or our own Pinouts pages.
Rp2040 datasheet has it (page 523) just happen to have it open.
Basically A vs B alternate even is A odd is B. And pins 0-15 pair with 16-30
thanks. looking for something less low level, to point forum user to.
I'm not sure there is. FWIW, it's one of the clearest datasheets I've ever worked with. But I get it.
no prettypins for pico 😦 its reusing the pi's graphic i think.
Yeah, it's not our board.
It would involve updating PP to support it.
PP for this board would be great
this has it in advanced mode https://pico.pinout.xyz/
An interactive, accessible and beautiful GPIO Pinout guide for the Raspberry Pi Pico
yeah, the graphic in guide is their graphic but I moved the legend around a bit to make it narrower
^^ neat!
Nice find!
or at the very least put a link in
@jaunty juniper thanks. i can just give that url and say "click advanced".
pinout.xyz is a nice reference for the raspberry pi, but it has other boards like the pico, it doesn't show license information though. No mention here it seems https://github.com/gadgetoid/pico.pinout.xyz
the main repo has a Non Comercial Creative Common attached to the repo https://github.com/gadgetoid/Pinout.xyz
CircuitPython version
8.0.0-alpha (various)
Code/REPL
print("Connecting to Adafruit IO")
mqtt_client = MQTT.MQTT(
broker="io.adafruit.com",
username=aio_username,
password=aio_key,
socket_pool=pool,
ssl_context=ssl.create_d...
@blissful pollen also thanks. that's a nice summary table.
I was thinking about received count being zero, sorry! :forehead-slap:
Thanks for the examples. @caternuson look over too; I myself have never written a register-based driver.
Re: #3192, #3069
Reading through the above two reports, I can see that it was decided that the F1 has too little RAM and/or flash storage for circuitpython. I appear to have a variant which may have enough storage and RAM, though - the STM32F103RGT6, on board the M24SR-DISCOVERY. According to the docs for this board, it has 1M of storage, and specs for the STM32F103RGT6 indicate 96k RAM. While these aren't phenomenal specs, ...
While testing this on the ESP32-C3 and ESP32-S3 I noticed a possible issue. When I run the following code:
from supervisor import runtime
i=0
print("Press any key to stop output")
while runtime.serial_bytes_available == 0:
i+=1
print(str(i)+"012345678"*5+"abcdefghijklmpqrstuvwxyz")
in the Web Workflow serial terminal it will run for a short time (how long varies from run to run and depends on the particular ESP chip) and then stop. The code wil...
Preliminary working analogio AnalogFastIn.
User code.py under latkinso42/adcdma.
As you can see from #3192 and #3069, there was still a lot of work to do with the F1's, because there are idiosyncratic differences between F1 and F4. 96kB is marginal for a good CircuitPython experience, and with RP2040 and other chips available with much more RAM, it's not clear it's worth it for someone to spend time on this. Cheaper, more capable, and more readily available chips are available. Certainly don't do it just because you have the dev board; it's far less trouble to just buy a ...
Moving the C3 close to the router and running the test script resulted in the program running much longer than it was with the weaker network connection. This is making me think my original guess that there was a display buffer being filled may have been off and network errors may actually be the triggers causing Web Workflow to yield control.
Hey...question. I just flashed my MagTag with the CircuitPython bin file on Mac OS and it won't show up as a drive afterwards. Even after pressing reset. Does this not work on Mac or something?
hi, what bin did you flash and how ?
I installed the bin located here: https://circuitpython.org/board/adafruit_magtag_2.9_grayscale/
The Adafruit MagTag combines the new ESP32-S2 wireless module and a 2.9” grayscale E-Ink display to make a low-power IoT display that can show data on its screen even when power is removed! The ESP32-S2 is great because it builds on the years of code and support for the ESP32 and also adds native...
I used esptool to install it.
michaelmain@MacBook-Pro Downloads % ~/Library/Python/3.8/bin/esptool.py --port /dev/cu.usbmodem01 --after=no_reset write_flash 0x0 adafruit-circuitpython-adafruit_magtag_2.9_grayscale-en_US-7.3.2.bin
esptool.py v4.2.1
Serial port /dev/cu.usbmodem01
Connecting...
Detecting chip type... Unsupported detection protocol, switching and trying again...
Detecting chip type... ESP32-S2
Chip is ESP32-S2
Features: WiFi, No Embedded Flash, No Embedded PSRAM, ADC and temperature sensor calibration in BLK2 of efuse V1
Crystal is 40MHz
MAC: 7c:df:a1:1a:e3:12
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00167fff...
Compressed 1471216 bytes to 957917...
Wrote 1471216 bytes (957917 compressed) at 0x00000000 in 16.9 seconds (effective 698.4 kbit/s)...
Hash of data verified.
Leaving...
Staying in bootloader.
ok, I'm almost sure it's not supposed to go at address 0, but I use the UF2 (or I flash the UF2 bootloader)
My MagTag sadly doesn't have UF2 on it. How do I go about installing the UF2 bootloader?
Or do we know what address we are supposed to start at?
there's a "factory reset" part in the guide, or you can grab the tinyuf2 from the bottom on the page, and flash the combined.bin from the zip (at address 0 this one)
Okay. Got uf2 bootloader flashed. I think we are in business now.
👍
Thank you very much! I was pulling my hair out XD.
I removed the extra call to port_idle_until_interrupt and added an ESP_LOGE print just before the original call to port_idle_until_interrupt.
The output of the program stops after the second call to port_idle_until_interrupt. The number of lines that print varies from a few hundred to a few thousand but there are always two calls to the idle function and the program appears to stops just after the second call is made.
Question. Is there a way once you have your code the way you like it in circuit Python to make it permanent so to speak? Like basically make it so that it can’t mount the circuit Python storage device anymore. Like essentially could I compile and link my code and Circuit Python into a uf2 or something?
Also, is there a way to store data on the a RP2040 or an ESP32 without it being mounted on a PC’s file system?
It would be very helpful if someone could add a sample HID_DESCRIPTOR for the Telephony Device Page (0x0B)
So we could make a ItsyBitsy Project to answer or decline incoming calls on an IPhone.
(And play with other Usages)
You can disable mounting of mass storage with code in boot.conf, however that's not security, as you can force the device to boot into safe mode.
https://learn.adafruit.com/customizing-usb-devices-in-circuitpython
Cherry-pick this PR: https://github.com/micropython/micropython/pull/8985 when it is done. This is another improvement on floating-point formatting.
Check out @lone axle's excellent helper library for seamlessly working with nvm: https://github.com/FoamyGuy/Foamyguy_CircuitPython_nvm_helper
Cool. I’m not doing it so much for security, just so when I build something for my little sister that she won’t accidentally mess it up. Granted I’m thinking of just leaving it open to make making adjustments easier.
I just tested this and it looks great. Thank you @Neradoc.
I added this to my debug build of #6742 and tested the serial terminal and file manager. Both worked although the issue I'm seeing with the serial terminal yielding control still happens.
When the output has stopped on the serial terminal, any Web Workflow activity on another open browser window (i.e. clicking on a link in the Web Workflow file manager) will restart the output until two more idle calls are made.
Would it be enough for the board C code implement this? Or do you want control from CircuitPython of it?
I imagine there will certainly be a board.c component, but the user still needs to be able to set/clear the flag from their python code. Plus I would think there also needs to be a lower-level hook that appropriately checks and exempts pins from being reset while still allowing the user to claim pins during normal use.
Ya, lets open another for the UTF-8 checking. I think the PR will close this.
@ThomasAtBBTF do you mean over BLE or USB?
When the output has stopped on the serial terminal, any Web Workflow activity on another open browser window (i.e. clicking on a link in the Web Workflow file manager) will restart the output until two more idle calls are made.
Ah, I have an idea. The idle call causes FreeRTOS to yield. The socket select task should wake CP but I don't think I have it set to do that when a socket is writable. I'll look into it.
Is there anything that precludes me from making a C-based library that emits USB- and/or UART- MIDI at regular rates? Something similar in concept to WAV playing, but instead of samples, it's MIDI messages?
Is there a reason to do it in C Vs python?
afaik, no access to reliable timing in Pythonland
(at least in my several years of trying to do it in CircuitPython)
@devout jolt I think you could do it from C
Figured may be that. I don’t see why it wouldn’t work in C but you would have to find a free timer. If it was interrupt driven should be reliable and avoid the GC delaying things
yeah, GC and all, though to be fair the USB poll rate is 8ms, so CP might be able to hold that
Is the inaccuracy so much that it would make an audible difference in the delivery of midi messages?
perhaps my question is: is there a timer subsystem I can hook into that is common_hal
oh yes, it's very noticeable. can be like 30ms on something as slow as 16th notes at 100bpm (150ms)
not being difficult, I just know very little about midi
MIDI is basically robot fingers for playing other synths, so think in terms of how fast your fingers can move. But humans are very sensitive to timing changes
would pio on rp2040 also be a potential option?
I don't think so, unless there's a provision for triggering high-level objects like usb_midi and busio.UART which I think there is not
Pulseio I think has code that basically sets a timer if you wanted one every 1/64bpm or something. Adafruit_bus_device shows calling passed python objects from C
ahh! this could be my ticket in for understanding that. thank you!
(Pulseio may tie to a pin though trying to think of something that doesn’t but just on my phone right now).
maybe I require a "bpm pin" ahaha
thank you all, this is good food for thought
The rockin'est pin of all.
When I’m home I’ll try to glance at the rp2040 data sheet (have it open from something else). It doesn’t sound too hard to build
This looks good. But if sent ==0, then i think the connection has been closed? Should this handle that somehow?
Then this could be done in the BLE library or an additional library. I'll move the issue there.
Current PWMio library can only generate single phase PWM. If multiple PWM output is configured, they all have the same phase.
Phase-Shift PWM is an important feature to drive H bridges, steppers and servos.
All micocontrollers supported by CP can generate precise phase-shift PWM. Some even have complimentary PWM which is required for driving H bridges.
New MAX1704x driver is ready for the bundle if anyone gets a chance to review the PR!
@tulip sleet this should be an easy review: https://github.com/adafruit/circuitpython/pull/6744
A keypress while we waited for autoreload used to enter repl. Now
it won't.
Fixes #6480
Looks like you got it! The output seems to be running indefinitely now.
Doc fixes go live immediately so we don't need this in the 8.0.0 release.
I was waiting for RetiredWizard to do the real testing but if you're satisifed I'll approve, np
@tulip sleet it was something I saw too. I think I caused it when I added the timeout-ability
CircuitPython version
Adafruit CircuitPython 8.0.0-alpha.1-127-gf1053fb96 on 2022-08-11; Adafruit QT Py ESP32C3 with ESP32-C3FN4
Code/REPL
file = open('disconnect.txt')
badchar = file.read(1)
Behavior
The attached disconnect.txt contains a mangled character created through a network error. I haven't been able to figure out how to recreate it programmatically but perhaps someone with a better understanding of character sets and CP string formats ...
@waiweng83 Is this available yet? I think there may be an error in the status LED pin definition. GPIO13 should be MICROPY_HW_LED_STATUS not CIRCUITPY_STATUS_LED_POWER.
So.... I'm trying to copy a UF2 to a BOOT drive, and it's consistently copying the UF2 file to the BOOT drive.
RP2040 seems to have 4 alarms of which only 1 is being used for ticks (supervisor.port.c shows how it is used). Seems pretty simple to get going
It's technically not the right file for this board, but the boards are nearly identical, so it should work. But either way, it's a UF2, so it should load even if it's not going to work, right?
Which board? I think most UF2 bootloaders read the header and ignore the file if it’s the wrong platform. The OS may still think it copied the file tho
S3 TFT Feather. I'm trying to load the S2 TFT Feather factory reset UF2.
Oh hmm ok.
yeah if the file appears "in the drive" that means it refused it
Bugger.
oh S3 and S2 are not considered the same chip
I think I remember being told to recompile it and then load it and pull off the UF2.
That makes sense.
But I don't think I have the code. So.....
I thought I'd try it since the boards are so similar. I know the chips are different.
Ah thanks!
Ooh wait.
the key is that that tinyuf2 checks the chip variant
Ahhhh. Ok.
(Found the code.)
and I don't know all the differences, but I'm pretty sure that there is no way a binary for S2 runs on S3
After doing the pinouts page, I'm inclined to agree.
pinout or not, they might share an Extensa core (although not even the same number), but I'm assuming that even basic setup for ram and clocks, etc. is probably different
There is a section on that page that talks about the chip itself.
And it was definitely different than S2
(brb, need to check on food in the oven)
Add them as MICROPY_HW_LED_STATUS so that we can share reset code
for them. They aren't actually used for the status if another RGB
option is available. (But maybe they should be.)
Fixes #6717
Actually bbiab. Food is ready. :)
enjoy your meal!
Thanks. It was meant to be a quick one.
I managed to create an extension of analogio by adding an interface AnalogFastin. It creates an objects which setup the ADC and DMA with a user supplied pin, buffer and sample_rate. I have been able to get ADC conversions in CPy at 2 microseconds.
It needs some polish and a good review.
[adafruit/circuitpython] Pull request review submitted: #6753 Audit all boards with LED pins defined
lgtm - thanks for this cleanup!
I grabbed the latest bits for the Feather Huzzah32 from the S3 server and got this as output:
Doing work from now=53.316 until target=58.316
Light sleeping from now=53.316 until target=73.316
time_alarm=<TimeAlarm>
<TimeAlarm>
after=73.318, OK
I modified your loop slightly to suppress the printing of the "sum(range(100))" value.
The output you referenced seems to be from a slightly different loop though.
Hmm. No idea how to generate the factory-reset-and-bootloader.bin file.
Thanks for the help with sorting out the UF2!
If you can please check the micropython differences from python document to see if this is a documented difference. I strongly suspect the behavior is the same in mp and if it's not documented there I'd reach out to them.
I took a look at the differences documents but I'm afraid a lot of it's over my head. Regardless, you're correct, I tested the file out on micropython 1.19.1 and it behaved exactly the same. I'm fine with this falling back as a MP issue,
it's probably not even that big an issue, my only interest in it was that the chrome browser disconnects the web workflow serial terminal when it gets one of these characters but I think most of the ways the web workflow was creating them are being shut d...
Tested on Feather Huzzah32, Feather ESP32-S2 and Feather ESP32-S3 4mbf 2mbpsr and the LEDs were all out when not in use. I didn't do an extensive test but did run a few simple scripts, jumped onto the Web Workflow terminal, and file manager and no issues popped up.
@waiweng83 Is this available yet? I think there may be an error in the status LED pin definition. GPIO13 should be
MICROPY_HW_LED_STATUSnotCIRCUITPY_STATUS_LED_POWER.
May I know what's the different between two of them?
I actually copied this from other feather board such as "unexpectedmaker_feathers3" and "adafruit_feather_esp32s2".
FYI, this board is not launched yet as Ai-Thinker discontinues all their ESP32 modules. We have to redesign it using Espressif WROOM module and we...
A sampling of absolute latest from 8/11 and 8/10 don't mount CIRCUITPY after installing (QT Py ESP32-S2). The last one from 8/9 works fine. 7.3.2 works fine. Is this a known thing?
also noticed that if there is a pre-web-workflow mDNS circuitpython.local device on the network, it may answer first and preclude web workflow on the desired device
I just flashed adafruit-circuitpython-adafruit_qtpy_esp32s2-en_US-20220811-f9b9f55.uf2 and it mounted CIRCUITPY for me
@crimson ferry I don't know how mDNS works but I assume the old curictpython.local entry will fall off after some time? Either way you should be able to access the web workflow by IP address. Determining the address can be tricky if you don't have a display and can't connect to the REPL via USB serial. If you can the REPL should display the IP address in terminal header.
I'm not on a mDNS network so I'm stuck using IP address. I've taken to leaving a QT Py C3 online next to my router. I've got it's IP address bookmarked and when I bring it up, it lists any other CP boards I've plugged in.
Thanks, not sure what was happening, but it's happy on UF2 from a few days ago.
Yeah, I guess it would be expected that anything answering to circuitpython.local could grab the browser's attention. Just a note to be aware of, it becomes obvious what happened pretty quickly. This was a case where there were pre-web-workflow and post-web-workflow CP devices on the network simultaneously - the good news is that the web workflow GUI shows all of them. Luckily, in my local set-up, all CP devices have DHCP reservations so the IP addresses are predictable.
I remember that @idle owl wanted the yearly CircuitPython review of what users wanted for the future to be more frequent. So maybe the CircuitPython Day could be an opportunity to ask again to the community for input. Of course that is a late through. But if you don't do it on CircuitPython Day, then the next opportunity will be #CircuitPython2023 in December/January.
That's a good idea. I know for the panel discussion, I reviewed those posts to create questions. You should email circuitpythonday(at)adafruit(dot)com.
Then you missed my contribution to #CircuitPython2022 because I was lazy and forgot to do one, but I have a 2020 and a 2021 one. 🙂 I don't remember if a "decision" was taken, but that idea from Kattni was at least discussed "in the Weed", she would know the status or if a decision was taken. Since I guess she is working on the planning of CircuitPythonDay too, the above message would be sufficient. The problem I see is doing one in August... then that make the #CircuitPython2023 too close. Also how would you name that thing??? The #CircuitPythonDay2022WishList ? And it take a lot of time to read and analyze and compile all the contribution (if there are many).
Good questions, I liked the idea of a mid-year checkin
Good Morning! I have a new interface for the Pico, AnalogFastIn, which allows for a DMA read of the ADC. It might be useful for other platforms too! What is the normal process to request a little feedback. Is a formal Pull Request required first?
Hi, this second issue (printing a string created in an unusual way in the repl causes a disconnect) seems like it's worth considering in its own right.
For background, CircuitPython and micropython assume that any file opened in text mode (the default opening mode) is actually a valid text file in the utf-8 encoding. Of course, it's easy to create a file in byte mode that is not valid utf-8 encoding, and there are lots of examples of this -- .mpy files are one that would exist on a huge fr...
Otherwise, weird stuff can happen down the line when it is print()ed, especially as it can break the webrepl of circuitpython. Closes #6752.
This needs formal tests, not just the manual testing I did.
You can do a PR in draft mode. For something with a bunch of code that can be a good place to get feedback, and at least I find it easier to review code in that format.
An issue can work too but depending on how much you want to show off can be a little more cumbersome.
ok... PR Draft..Thanks
I also want to add that I wish I had not written my first comment in this issue discussion the way I did, because it reads as being dismissive of the issue you reported (excuse: I was a passenger in a car and bored but also armed with just an onscreen keyboard and no circuitpython/micropython)
Instead, I should have taken the time with my comment and have made it clearer that I wanted to discover more about where it would be most valuable to address the problem, as a circuitpython problem,...
HAs anyone tried the current main on a FunHouse -- I am just getting into a boot loop. 7.3.0 is OK
An issue would be welcome so we can track it, thanks. anecdata also has S2 issues, but then tried again and it worked ?!
OK -- I'll open an issue
Please don't worry about your comment, I been reading electronic messaging from the literal beginning of electronic messaging and have long since learned not to place any subtle emotional tone on someone else's message :).
I really do appreciate your detailed explanation here, it has increased my understanding of the situation greatly. These unicode characters get stuck in my head probably because the idea of a character being 8 bits is almost as core an idea for me as that everything on c...
Nothing cleans your computer files better than having a partition resize fail and having to reformat...

Eternal thanks to all the guide authors for the intro to dev guides, I got reinstalled and running in no time at all
Just saw your links to the Micropython issues :).
Maybe there was another way, but hey, I've got twice the space and it's all shiny clean
I run the latest on FunHouse in my tests of the web workflow, though i don't necessarily pull every day, let me build the tip of main and see
CircuitPython version
using https://adafruit-circuit-python.s3.amazonaws.com/bin/adafruit_funhouse/en_US/adafruit-circuitpython-adafruit_funhouse-en_US-20220811-f9b9f55.uf2
Cannot get to boot_out.txt
Code/REPL
Cannot get to REPL
Behavior
After loafing the .uf2, the board continually boots and reboots -- I can read the screen fast enough to get any information. Not CIRCUITPY drive and the USP bot keeps resetting.
Description
No response...
(or like download from S3, but I'm too lazy for that when I have the terminal opened to build)
I have used a local build and latest from S3 -- I can't get to a REPL to load a .env file for web workflow
f9b9f55 also works for me on a funhouse. I'm using the UF2
Can confirm it worked for me.
hmm -- I even tried erasing the flash ...
is anything connected to the funhouse?
PIR
take that off and see what happens; there was some pin initialization stuff that changed
same without it
which combined.bin or factory reset did you use, the guide one?
none -- I used the UF2 or flashed from the build
but you said you erased the flash
yes, then just did a make BOARD=adafruit_funhouse flash /dev/tty.usbmode01
do I need to do something else?
ok, now I'm getting a boot loop, after erasing the flash
ah? sorry about that
Reproduced this by:
esptool.py -p /dev/ttyACM0 -b 460800 erase_flash
esptool.py -p /dev/ttyACM0 -b 460800 --before=default_reset --after=no_reset write_flash 0x0000 adafruit-funhouse-factory-reset-and-bootloader.bin
cp adafruit-circuitpython-adafruit_funhouse-en_US-20220811-f9b9f55.uf2 /media/halbert/HOUSEBOOT/
the "factory reset" file is the one from the guide
np, reproducible is the best!
I installed the uf2 boot loader by loading an arduino sketch (blink)
Note that in the issue, to show it's multiple ways to get the bootloader
OK
it's weird that @crimson ferry had this problem, and then it mysteriously went away
I installed the bootloader (after erasing flash ) by loading an arduino sketch (blink)
That is odd -- Thanks for reproducing it -- I originally thought it was because I had WipperSnapper installed on it -- that is why I erased the flash. Just to get a clean start. You "should "be able to load the .bin directly to the board if it is booted with the boot button, no?
That does not work for me either -- still loops.
I'll see If I can find the culprit...may not be until later today...
Dog needs a walk now...
you can leave it for us 🙂
Thanks -- you know better what you are looking for. It's not a crisis for me -- I was just doing some board updating and thought I 'd try web workflow to a FunHouse. I have several other things to keep me busy...
[adafruit/circuitpython] New comment on pull request #6600: esp32: don't fully reset the wifi device
Hey @jepler should this actually apply to the esp32-c3 as well?
I'm experiencing something similar on my Wemos C3 Mini. First run after reset - this script works:
print(dir())
print(f"connected with address {wifi.radio.ipv4_address=}?")
print("networks:")
for n in wifi.radio.start_scanning_networks():
print(f"{n.ssid:24} {n.rssi: 3}")
wifi.radio.stop_scanning_networks()
print("connecting...")
wifi.radio.tx_power=8.5
wifi.radio.connect('ssid_here', 'pass...
this is on purpose right now - ESP32 is still just started working and many bugs are being fixed and workflow is being documented :)
I think if Paul is up for it, we can work it into the panel discussion to put it out there that folks can do up a post/whatever-form-of-thing. I think it won't be as big of a deal as the one at the beginning of the year, but it would give us some more info to work with, and also we can aggregate everything on the blog like we did this year.
This is really odd, there are other MCU/boards that are very beta, far from totally supported, and have their page present since day 1.
If you want people not to be deceived and have a bad user experience while using alpha/beta version or early support, you could work reversely on CircuitPython.org. Rather than to display everything by default, only show the 250 or 300 solid build, but have a filter that say "Show every board including very alpha".
By the number you will be able to claim ...
@tulip sleet When you're around, let me know please. I noticed weirdness with the S3 AREF, and asked Limor about it, and she said they're all weird, but that you can help me with the S3. It's for the Analog In template. I think mostly what I need is if you could do an analog read and tell me the max value on an S3 on your end, that would be greatly appreciated. I need to find the average maximum for the S3 to fill in this template. I'm doing the guide for the S3 TFT, if you have one of those, checking would be appreciated.
No rush on this, I have plenty of other guide to do.
OK, redirect. Anyone with a potentiometer and an Adafruit ESP32-S3 board, ideally the TFT Feather, please let me know if you can test some analog read code for me. Thanks!
Really, you can do it with a wire, I'm mostly concerned about max raw analog value. Not so much with the rest of the values.
Ping or reply if you can help, thank you!
Woops. This is why you test your code kids.... Turns out CPU temp is not implemented on this board. Don't need to do the template in the guide then. But, already did the bulk of it. 🙄
ESP32-S3 theoretical max appears to be 3.1V https://docs.espressif.com/projects/esp-idf/en/v4.4.2/esp32s3/api-reference/peripherals/adc.html as opposed to the ESP32-S2 of 2.5V
Ooooooh nice find.
Thanks for digging into that! That's about what I found with mine.
nice when the real world matches the specs 😉
Right?!
CircuitPython version
Issue occurring using absolute build Adafruit CircuitPython 8.0.0-alpha1 using:
adafruit-circuitpython-adafruit_feather_esp32s2_tft-en_US-20220811-f9b9f55.uf2
to build:
adafruit-circuitpython-adafruit_feather_esp32s2_tft-en_US-20220810-a1d48e9.uf2
This build works:
adafruit-circuitpython-adafruit_feather_esp32s2_tft-en_US-20220810-08e3133.uf2
Code/REPL
There was no code added to the code.py. Also, unable to check REPL because ...
it will be some day 😉
Guide'll have to be updated. Can't go around added not implemented things to guides, now, can we. 😉
Unfortunately that isn't really an option, the design was already fairly complete by the time this issue was discovered.
https://github.com/ithinuel/wilskeeb
Introduces analogFastIn, an extension of analoio. The user supplies buffer which is filled by the capture method. The object created performs the setup and the capture can be called multiple times against the object. The user should call deinit to clear resources.
The current version converts at the sampling_rate; tested against a 3000 H sized (16bit) array. The resulting buffer has values between 0 and 4095 (12 bit ADC).
Other enhancements or generaliztino for other platforms are possi...
hey look, its something that could close https://github.com/adafruit/circuitpython/issues/487 !
🤓 Hope it can be used across many platforms. Really need some feedback from Scott and Dan, Cheers!
FYI, they're both out until Monday, so please be patient with them. Thank you!
NP. If there is anything I can or should do while waiting, please instruct. I figured it may take a while; good thigs do!
things
Nope, you're all good! Nothing to do until you receive some feedback. 🙂
you can probably just try re-initing after a while, or adding a stiffer pullup on RESET, but... this isnt an issue with circuitpython, its a 'creative and unsupported use of hardware' issue :)
I'll try to take a look at it this weekend to see if anything jumps out at me. I took a quick glance and the general format looks good. Maybe cause its draft but I noticed all the docstrings aren't there yet and (I miss this all the time) making sure errors are checking if calls like claim_dma fail. I'll do a proper review later though! Nice work
Thank You! I appreciate the review1
Fair enough for the circuit python. I figured that as an adafruit product, the display and rp2040 combo would still be supported in some way.
Although I'm using a Sparkfun promicro, the KB2040 seems to have an even lower limitation on the power supply (500mA).
it is possible to make it work "you may need a delay while the display powers up. also reset may need to be connected" - but its not going to be as simple and ya dont wanna redesign the board
This does now print an error when I attempt to read in the file containing an invalid utf character.
But this also does enforce a new higher level of code compliance when dealing with files. For better or worse I have sometimes simply used a standard open(filename) statement to open files that contain binary data and this update will break that code.
I am not overly concerned with enforcing a stricter code compliance, the fix to the code is obvious and simple. While there's no doubt ...
[adafruit/circuitpython] New comment on pull request #6600: esp32: don't fully reset the wifi device
Can confirm, I went ahead and make a custom bin with this on 223:
--- #ifndef CONFIG_IDF_TARGET_ESP32
+++ #if !defined(CONFIG_IDF_TARGET_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C3)
And now wifi works between repl resets. How do y'all want to proceed? I can do some leg work on getting a PR up but dunno exactly what approach we want to take here (is this worth a re-think?).
The current main seems to work OK on the Funhouse now -- including web workflow
Board:
Adafruit FunHouse
Version:
8.0.0-alpha.1-135-gfa3e265bf
Hostname:
cpy-09c70c
IP:
10.0.0.47
...might have to save this one for a future revision of circuitpython...and maybe a future revision of desktop and mobile python...all I wanted to do was (-12345.678)[-8:8]...
what is that supposed to do ?
"get me bits 1 to 4 inclusive" from e.g. 255
but for more cases where the range is negative and decimal
bits of what ? the mantissa ?
there is not bit array in CP, I think python has libraries to read ints as bit arrays
in general, both at the same time or something that can be used on both parts separately
then there was the version for pico-dvi which does [0:7] but on an int
so, a float is a mantissa and an exponent, what it means to read a "bit" might not be what you think it is
it's not a part before the coma and after the coma
that's in 32 bit float right? this is something slightly different where bit1 is bit0, bit0 is the sign bit and bit-1 is the first decimal place
as far as I know, bits don't match decimal places unless it's BCD
which this does by unfortunately having to convert it to a string and then reversing it with non-builtin rev, treating it as a normal int and reversing it back again
on hardware this is all done ideally in one step, my thing is preliminary and might have some shifting errors somewhere while trying to stay on the same line
like 10.0 and 100.0 should have the same mantissa, but 10 and 100 don't have the same bits
Ah I see, from the python side I mean the bits from the perspective from a mathematical binary representation of the number,
there is a different one for getting a raw memory view of the bits stored in IEEE format. maybe the mathematical one will also help decode the IEEE one
the other slightly confusing thing is that the number line goes backwards. the furthest left is positive and the furthest right is negative...on arm this is the right way round maybe 😄
I'm not aware of the formula to convert a number after the comma into binary
is there even a single way to do that or multiple representations ?
0b1.1, or in french 0b1,1 - removing the 0b has complicated things slightly
no but how to convert
idk that's why I wrote that
something like this:
def get_bits(num, pos):
x = s - int(s)
bits = []
for i in range(pos):
# while x > 0:
x = x * 2
bits.append(int(x))
print(x, int(x))
x = x - int(x)
return bits
for example 0.2 converts to the infinite development: 0b0.0011001100110011...
and the limit of floating point numbers shows up in C python with the debug print:
0.4 0
0.8 0
1.6 1
1.2000000000000002 1
0.40000000000000036 0
0.8000000000000007 0
1.6000000000000014 1
there's a hexadecimal format for binary floating point numbers. it might be supported in newer versions of Python (and is (mostly?) compatible with the one in C99)
I saw the hex property while subclassing it just now to add subscript, could also add the def get_bits(num, pos): to it along with getting/setting a bit and masking a binary decimal
used all the time in assembly using very weird convoluted methods for e.g. setting GPIO pin direction and drive strength, or idk, pretty much anything that uses the class
some hardware acceleration for this would also be good
@warm stump rev might be more easily implemented as string[::-1]
reversed() is a thing
@warm stump you might also want to look at math.frexp if you want to portably and directly inspect the mantissa and exponent as stored by the machine
note that negative steps are not implemented in CP:
>>> "123456"[::-1]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NotImplementedError: only slices with step=1 (aka None) are supported
that seems unfortunate. what's the rationale for not implementing it? too much code?
don't ask me
but usually yeah limits are caused by things taking space and having alternatives
for the language aspects of CP, you gotta go back to MP issues and: https://github.com/micropython/micropython/wiki/Differences
it is implemented for lists, I don't see a reference to string slices steps in the issues, but it's just a quick search
[adafruit/circuitpython] New comment on pull request #6600: esp32: don't fully reset the wifi device
I am able to run @Bruno-DaSilva 's test script multiple times on my QT Py ESP32-C3 without a problem.
I have found that the my C3 doesn't have the network range as some of the other ESP chips and when I'm near it's range limit my network ssid will switch in and out of being listed in a wifi scan.
The reason the builds are failing is this functionality only exists on one port. You will have to include #ifdefs to turn it off on boards that it is not implemented on (or may not be due to space concerns). You will see many places with #ifdef CIRCUITPY_FEATURE. For example CIRCUITPY_ZLIB (something I did). If you search you will see the places you may need a #ifdef CIRCUITPY_ANALOGFASTIN
Then you will have to define it as off by default and in ports/raspberrypi/mpconfigport.mk have...
Good start! I think having AnalogFastIn in the same module as all the AnalogIO makes sense but I will leave a final decision on that up to the others.
I noticed a couple submodule changes that do not look related to this change that may have snuck their way in. Other then that the big one is to turn off the feature on ports where it is not implemented.
I did not test it on h/w yet but wanted to give some feedback to start.
All the docstring still has to create created for the class. If you look at AnalogIn you can probably copy most of it (as I'm sure you know).
A question, but would the user need to get the reference voltage like you find in AnalogIn?
ok now I get a hard crash when I ctrl-C/ctrl-D on the FunHouse
control-c/d works in web workflow serial terminal
also OK for me via screen on my MAC
running Adafruit CircuitPython 8.0.0-alpha.1-135-gfa3e265bf
hmmm I'l look into that another time, might be linked to code.py, see if older versions do it and try a flash erase...
Good luck! Try standing on one foot 😉
I just have the default "hello world" as code.py
[adafruit/circuitpython] New comment on pull request #6600: esp32: don't fully reset the wifi device
@RetiredWizard well that's no bueno as far as compatibility 😆
Different behaviour between different boards of the same chip, that's fun. Open to guidance on next steps for sure...
https://github.com/FoamyGuy/Adafruit_CircuitPython_SI1145/runs/7820800078?check_suite_focus=true#step:5:9
It's a baby step, but exciting as a proof of concept 🎉
This actions task was executed on a "self hosted" runner that lives on my Raspberry Pi. The printed output is the size of RAM consumed by importing the library that was built in the existing build.yml tasks, measured by subtracting the values returned by gc.mem_alloc()
So we were able to run a test against a physical hardware device automatically as part of an actions workflow. Right now it's just measuring memory size, but eventually maybe it could execute other test cases and pass / fail based on assertions on the device itself.
nice, these also work. I did mine a certain way to be sure it would deep copy instead of using it like a pointer, but these solutions are also good for their contexts
Mark,
Thanks for looking over the code, etc.
I have made some changes on my local repo and branch.
There may be more, like the get_reference_voltage...
Would it be OK to promote to my remote while having a draft pull request?
I'm still rather a GIt Noobie and new to the whole PR and extending CP
process.
Thanks for your help!
-Lee
On Sat, Aug 13, 2022 at 10:33 AM Mark @.***> wrote:
@.**** commented on this pull request.
Good start! I think having AnalogFastIn in th...
Would it be OK to promote to my remote while having a draft pull request? I'm still rather a GIt Noobie and new to the whole PR and extending CP process. Thanks for your help!
Yup for sure promote changes while you are working on the draft pull request. It does trigger the automatic build so I try to wait until I have a bit of substance to promote, but that isn't even a big deal. If need be people can stop the automatic runs.
I update my changes all the time if I'm fixing things.
@jepler hiya just to check - because of https://github.com/espressif/esp32-camera/issues/433#issuecomment-1204547256 we can't switch between viewfinder and jpeg mode 'dynamically'?
@ladyada we work around it for ourselves, I tested my workaround for the limitation but none of the examples I committed use this facility.
Basically you call reconfigure on the camera object https://github.com/jepler/circuitpython/blob/98202c85688384f702802ad263c30afa8c74da9e/ports/espressif/bindings/esp32_camera/Camera.c#L227
For #4536 adding support for I2C Target for the RP2040 based on work by @kstillson and @im-redactd.
Test code from my KB2040
import board
from i2ctarget import I2CTarget
target = I2Ctarget(board.D7, board.D6, [0x41])
while True:
request = target.request()
if request is not None:
if request.is_read:
print("Write request ")
request.write(b'B')
else:
r = request.read()
if r == "T":
...
jus' a few pin swaps for pcb rev b testing
(anyone can review, only affects an unreleased board)
I think you forgot to use claim_pin and reset_pin_number nothing else uses the pin
Seeed Studio
If SEEED was their old name and Seeed Studio the new name, so yes that make sense.
But I don't know how to do that (it is used in the filter) and it also affect the Wio Terminal, so 5 boards in total.
PS:
I am not working for SEEED/Seeed Studio. Maybe those that contribued those board in the first place can propose a fix. :-)
This can be a separate PR, I only noticed the XIAO naming issue and that is what I tried to fix here.
CircuitPython version
Adafruit CircuitPython 8.0.0-alpha.1-31-gc1b00442a on 2022-07-02; stm32f411ce-blackpill with STM32F411CE
Code/REPL
CIRCUITPY_BLEIO = 0
Behavior
When I add CIRCUITPY_BLEIO = 0 to mkconfigboard.mk (and similar lines for other libraries, in order to save space) and run make, I get:
GEN build-myboard/genhdr/moduledefs.h
QSTR updated
../../main.c: In function 'reset_devices':
../../main.c:127:5: error: implicit dec...
CircuitPython version
Adafruit CircuitPython 7.3.2-dirty on 2022-07-30; Waveshare ESP32-S2-Pico with ESP32S2
Code/REPL
import wifi
from ipaddress import ip_address
wifi.radio.connect(...) # insert your newclear launch codes here
while True:
wifi.radio.ping(ip_address("1.1.1.1"))
Behavior

Description
I was implementing th...
It's true, some of the ways of reading a file in 'default mode' where the content is actually binary won't work now. The fix is of course to specify the open mode as "rb", which is also required for standard python compatibility.
uh oh that sucks, any solution ?
❯ pip install -e .
ERROR: File "setup.py" or "setup.cfg" not found. Directory cannot be installed in editable mode: /Users/*****/Desktop/temp/Adafruit_CircuitPython_NeoPixel
(A "pyproject.toml" file was found, but editable mode currently requires a setuptools-based build.)
the answer is: update pip, but...
ValueError: invalid pyproject.toml config: `project.version`.
configuration error: `project.version` must be pep440
[end of output]
just symlink it to the site-packages?
we could switch from using 0.0.0-auto.0 to something pep440 ? Like 0.0.0+auto.0 as it turns out
(it's the placeholder for updating the version by the bundle tools)
or maybe we don't need the version in the file ? some libraries seem not to have it, this is the neopixel library
ah wait, they do, I wasn't looking at the right version
Hi, @rgbpcb. Run make BOARD=stm32f411ce-blackpill clean before the next build.
(anyone can review, only affects an unreleased board)
LGTM!
Adding ifdef to py/circuitpy_defns.mk failed on line 394.
I understand the intent, but do not see other examples of this, so I guess this was not the way to exclude per port. Please advise.
Adding ifdef to py/circuitpy_defns.mk failed on line 394. I understand the intent, but do not see other examples of this, so I guess this was not the way to exclude per port. Please advise.
If you look around line 475 where there is an #ifdef about BLE I would try to follow what it does. If it still fails I can try to pull the PR and take a look.
Based on looking near the lines in question...
static void reset_devices(void) {
#if CIRCUITPY_BLEIO_HCI
bleio_reset();
#endif
}
It looks like it is an error to disable BLEIO without also disabling BLEIO_HCI. Many invalid configurations are possible and in general no effort is made to detect them.
@ladyada I committed a demo that shows live view on lcd, then uploads to adafruit io when the BOOT button is clicked. https://github.com/jepler/Adafruit_Learning_System_Guides/blob/456ab88f211dfbf4533c8aed9586f3db4176b03d/circuitpython-esp32-camera/esp32-s3-eye-adafruitio-and-lcd/code.py it'll go in the eventual code for learn
I have new files in shared-bindings/analogio ... AnalogFastIn[.h and .c]. However, its only implemented for the RaspberryPi Pico. It fails on SAMD21, etc. How do I exclude in shared-baindings?
Hello there,
are there any updates or is there a approximate timeframe for the change?
Thank you!
Hello there,
are there any updates or is there a approximate timeframe for the change?
Thank you!
Just a quick thought at the moment, but have you tried setting CIRCUITPYTHON_ANALOGFASTIN = 0 in py/circuitpython_mpconfig. If you look at something like CIRCUITPY_CAMERA in that file, you will want something simliar
@blissful pollen It seems the shared-bindings portion is failing because there is no filter for just Raspberry Pi Pico. Perhaps I don't understand the model here. Shared-Binding seems to imply across platforms while the module defined in shared-bindings appear to define the CPy interface and ports/<platform>/common-hal/<feature> the implementation algorithm. Is that NOT the model?
I'll take a look at it to see I'm probably missing pointing you to some item as well.
Generally if a module exists in shared-bindngs, you are correct the port implementation is in ports/<platform>/common-hal/. But if there is no implemenation for a port both bindings and module have to be excluded from the build
You will have to have the #ifdef around this line as well as the AnalogFastIn line below.
I added a comment to what I spotted right now that is causing the build to fail. The init.c file in shared-bindings is referring to AnalogFastIn so you will need #ifdefs around the lines there.
I've been running this build through some paces this weekend and haven't seen anything unexpected.
Thank you, CIRCUITPY_BLEIO_HCI = 0 solved the problem.
Many invalid configurations are possible and in general no effort is made to detect them.
Do I understand correctly that no effort should be made is some cases? For example, if a user explicitly says
CIRCUITPY_BLEIO = 0
CIRCUITPY_BLEIO_HCI = 1
then it isn't clear whether they want
CIRCUITPY_BLEIO = 1
CIRCUITPY_BLEIO_HCI = 1
or
CIRCUITPY_BLEIO = 0
CIRCUITPY_BLEIO_HCI = 0
On the other ...
+1 vote for switching to use a format that will follow pep440 if that will allow us to use pip install . Thats definitely a very helpful utility for testing changes to libraries, especially for use with Blinka on Linux.
I opened an issue in the build tools since it's relevant, and a good place to reach the people concerned (I think ?) https://github.com/adafruit/circuitpython-build-tools/issues/91
It would need to be a warning. CIRCUITPY_BLEIO_HCI denotes the HCI co-processor implementation of CIRCUITPY_BLEIO. The default "on chip" implementation (e.g., nRF52840) is meant when CIRCUITPY_BLEIO = 1 and CIRCUITPY_BLEIO_HCI = 0.
Noticed this while dropping by - I spent a bit of work on this because F1s are so highly valued by some dev circles (especially in China), but ultimately abandoned it because the ecosystem of F1 boards at the specs Circuitpython needs is very meagre. I was in a situation where the only dev boards I could find were not real F1s at all but rather unauthorized clones - and when I had problems setting them up, it felt like there was no certainty whether it was my code or some knockoff quirk.
T...
Can I use nested #ifdef to exclude code, even another #include?
Nomenclature: I would not call this "fast" necessarily, but would instead call it "bulk" or some synonym of that. The point is that it's collecting multiple values at a certain sampling rate. It might be doing that slowly or quickly. Also, DMA is an implementation detail. On some other port, it might not be DMA, so I don't think you need to mention that.
Is this a debugging leftover?
Suggest that you use the marker TODO for code yet to be written. It makes these places easy to find.
Thanks for working on this! I did not review that actual DMA transfer setup. Instead I discussed some structural and nomenclature stuff.
Yeah I believe so. Like:
#inclue "a.h"
#ifdef B
#include "b.h"
#endif
#endif
Please look at the latest shared-bindings/AnalogFastIn.h. I have the nested ifdefs, but it still failed
Will do. I'll try to pull it to my machine too and see if I can get it going. Just haven't had a chance. I think it must be close!
Thanks Dan. I guess I was rather self-centered on the purpose (for me). You are correct, that 'Bulk' makes more sense than 'Fast'. I am connected to some that may want to help continue the interface for other platforms, so yes the DMA is merely an implementation detail as is the sampling rate. The user should only be aware that it is 'bulk' at some rate. I will change the name and omit reference in example to DMA.
Thanks Dan. I guess I was rather self-centered on the purpose (for me). You
are correct, that 'Bulk' makes more sense than 'Fast'. I am connected to
some that may want to help continue the interface for other platforms, so
yes the DMA is merely an implementation detail as is the sampling rate. The
user should only be aware that it is 'bulk' at some rate. I will change the
name and omit references to DMA in the example code. I will make the other
changes too! What we really need to decide on ...
@proven garnet do you know if changing py-modules to packages inside of pyproject.toml is the only thing needed when a library would be changing from a single file to a folder? I'm familiar with that step in the setup.py way, and think I found the same thing in pyproject.toml but wanted to deck if there is anything else needed.
Missing the meeting today, no notes.
Is there a way to listen to the meeting live?
i think it's usually on one of the voice channels in this Discord?
at 2:00pm ET right?
Yup, join the CircuitPython voice channel at 2pm ET
Yup! It's equivalent to the setup.py step (setuptools is still the backend so it's actually doing exactly the same thing behind the scenes)
Thank you
Hi, no worries. I wasn't assuming you worked for them.
To change the name, just find the boards: https://circuitpython.org/downloads?manufacturers=SEEED (and it looks like you already located them), then in the board file, change manufacturer to "Seeed Studio". As long as you update all of the boards and they have the exact same spelling, the filter will update automatically (otherwise there will be a filter for every variation).
<@&356864093652516868> CircuitPython Weekly is under an hour away! Please add your notes to the notes doc if you plan to participate. Looking forward to seeing everyone there! https://docs.google.com/document/d/1AQqEMgemmn7GiPWfkrGbyr3ViaGPSAtYIwdclGa3XPE/edit?usp=sharing
Lurking today 👋
@idle owl if you have time after the meeting (or honestly whenever, not critical), I want to check/set the secrets in the adabot repo which might help my PR pass CI.
If today, it'll have to be later. I have another meeting after this one.
Sounds good!
Oops thanks, had my mic unmuted from earlier this week and normally never have it like that
Same. It's usually the first thing I check.
😺 👋
Hi kitty!
😺
change manufacturer to "Seeed Studio"
Hi @makermelissa I changed the 5 boards.
If that company want to improve those descriptions further or submit more board (I am pretty sure they have some more), I suggest to let them do it. I don't want me nor you to do that work for them. ;-)
Awhile ago, I made a headband with a ✨surprise✨ LED matrix hidden inside!
Made with @adafruit neopixel strips, a QTpy and a Lipo BFF! The diffusion layer is some black tulle wrapped in scrunched-up layers, and I was really pleased with how it turned out.
Tiny build thread ⬇️
Likes
502
My little picostepseq MIDI sequencer is getting better. Now you can save/load sequences, while running and w/o missing a beat.
Likes
540
I'll definitely reach out, thank you!
There is a library to read sd cards but there is no library to "become" sd card to other hardware
(via small pcb adapter inserted into sd card slot of other hardware and connected to circuitpython device).
The goal would be to for, example, expose fs of hardware running circuitpython as sd card in a way so both,
circuitpython and other hardware could access it.
Some other projects for reference:
https://github.com/ZipCPU/sdspi/blob/master/bench/cpp/sdspisim.cpp
https://github....
hee - mel, I've said it wrong for a long time
@mental nexus -- Do you have a link to the FreeRTOS video?
Actually went to check a video but he never said his name!
😄
thanks for doing that @tulip sleet
does the web workflow / code.circuitpython.org stuff live inside of the main circuitpython.org repo? Or is there a separate one for that?
Thank you
There are two board by "microDev" but one is spelled "MicroDev", so I decided on a single case:
- manufacturer: "microDev"
Otherwise you have two entry in the Filter part.
3 board but two spelling:
- Two board use
manufacturer: "Switch Science, Inc" - One board use
manufacturer: "Switch Science, Inc."
So I moved to the majority without that "."
Can we have those workflows be by approval only? Saves sending jobs that don't affect memory size (e.g., documentation fixes)
Adafruit IO does that, I saw
One other question is if you want member of the community to offer a runner by "dedicating" a "Pi" to this, or have only Adafruit to host such an infrastructure? If you want "contribution", they you have to deal with onboarding, saying what is connected to the runner, ...
(My idea was also to do that on container, on Pi4. While foamyboy was testing "native" on a Pi3.)
And yeah, it will work on arm, riscv, whatever...
What about a different approach. Pull request workflow works as is right now, but then once a week a job runs over everything and raises an issue if a recent pull request expands the memory beyond a threshold. This would alleviate the need to have a job always ready to run hosted on a third party machine. But it's an entirely different idea so maybe this is more a detraction of an idea than it is helpful
But you'd have to wait a week to merge the pr's.
It might be "too late" to stop a pull request, but at least it gets detected at one point.
I think it's important to at least keep in mind, future use beyond just memory usage. In a dream world a full regression, on hardware, test would be ideal on a PR run.
(but that's a big "dream" state)
The on device size vs mpy size difference is not very clear...
You think that "Static" analysis on the MPY file is possible and sufficient?
Also interesting is that you want to know and remember the previous size and the new size... so you have to compare the new artifact to "existing" file. Not sure how to do that.
worst case the actions could clone / checkout the main branch and build the mpy file from it. Or possibly it could grab them from the bundle without needing to do the build "manually" inside the action.
I personally am on board with looking into it, the notion of receiving a score that you work to improve rather than a pass/fail label seems like a good way to slowly, gently way to be mindful and build good practices
This two bossac tools for linux are binary artifacts.
https://github.com/adafruit/circuitpython/tree/main/ports/atmel-samd/tools
Thanks!
Thanks all!
Thanks everyone
Thanks all!
I wish I had seen this before I bought 5 of the UM FeatherS3 boards; I need deep sleep for an IoT project, to conserve battery power. I know my code works on an Adafruit QtPy ESP32-S2, which suffers from another issue that brought me to the FeatherS3.
The issue with the QtPy system is that it hangs up in what seems to be the SAFE_MODE, which I think is caused by voltage spikes in the supply when they are run off of a battery. I can't filter the spikes adequately, and a QtPy will run for h...
My vote is a new module. It'll be much clearer what ports support it then. Maybe bulkanalog?
MICROPY_HW_LED_STATUS is meant to be a single color LED that will flash to show status (1 ok, 2 error, 3 safe mode.) CIRCUITPY_STATUS_LED_POWER is meant to enable power to the status LED. Newer Adafruit boards use this to power the NeoPixel when needed. It isn't meant to be an LED that shows power is connected.
@dhalbert You were gonna look into this right?
[adafruit/circuitpython] New comment on pull request #6600: esp32: don't fully reset the wifi device
@Bruno-DaSilva Please open a new issue. They are easier to track than follow up on than a merged PR. Thanks for helping test on the C3!
[adafruit/circuitpython] New comment on pull request #6600: esp32: don't fully reset the wifi device
@tannewt you go it, will do.
@gilded cradle I'm getting hterm errors with http://code.circuitpython.org/#backend=web&host=cpy-951032.local
I don't see any network traffic to the cp device
Ok thanks. I hadn't tested it once it went live. I'll take a look and see if I can reproduce the errors and create a fix.
Closing this issue as support has been merged with the core now. If there are issues with it please open up a new issue and tag me on it.
why?
Maybe it's just web bluetooth that wasn't supported. I can add firefox support to the phase 3 part of the project.
I mostly hadn't been tested
I've done the local html and js from ff
Ok, it's likely something simple. For now can you test with chrome and I'll try and see if I can get FF working before oyu're out?
yup, totally
the websocket fails on chrome so I'm taking a look from the device side now
will also add a link to code.cp.org to the welcome html
Thanks
np, to make it easy for myself 🙂
It looks like it's forwarding from http to https and failing
Can we disable that? I don't think it's the Javascript doing the forwarding.
If I click on the http link you have above, it forwards it to https://code.circuitpython.org/#backend=web&host=cpy-951032.local. You told me it had to be http because the device didn't have any SSL certificates.
I was able to open it in http in chrome
and in firefox
try copy and pasting the link
Hmm, that isn't working for me. Then it fails an error due to the mixed content.
in what browser?
chrome
do you have an extension that forces https?
I have it open and chrome is warning it isn't secure
Let me check
I turned off all extensions, restarted, and it's still doing it.
I'm on linux
I'm on mac and running chrome 104.0.5112.79.
ah, it just did it for me
Here' the redirect.
Could be a browser thing
Looks like it's seeing "strict-origin-when-cross-origin" and that prompts it to redirect.
ok, I cleared my cache and it didn't redirect
CircuitPython version
Adafruit CircuitPython 7.2.0 on 2022-02-24; Adafruit Macropad RP2040 with rp2040
Code/REPL
REPORT_ID = 2
def process_output_reports():
report = hid_device.get_last_received_report(REPORT_ID)
if report is None:
return
# process report bytes
Behavior
Documentation states that in th...
Ok, I'll try the same.
may be because we used to set it for https
Ok, that worked for me too.
Probably adding a popup with some fix ideas might be worth it.
Automatic redirects could result in an annoying loop
or disable web under https
Ah, if we could do that just for code.circuitpython.org, that would be ideal.
And then leave regular circuitpython.org as https
ya, I think that's what we're going
I'm not sure cp.org applies to code.circuitpython.org
Probably not, but possibly.
We may need to do that and then disable https on code
Or I'm thinking maybe there was some issue and we turned it off for a reason
ah, my websocket is failing because I don't have the auth credentials
I turned https off for code.
Oh, ok. I may need to attempt to listDir first
Yeah. it's strange because I'm pretty sure I got the websocket going before I even tried to tackle the auth stuff.
its possible your browser cached it
Yeah
I'll give it a work through using code tomorrow morning and see if I can get it functioning.
No, I was in the middle of preparing for my livestream and lately I tend to work better in the morning.
Ok, we can focus on this more tomorrow.
@tulip sleet This I2C terminology change... so much so that we should update the I2C template, and send out a new blog post (this is the old one: https://blog.adafruit.com/2021/06/24/controller-and-peripheral/) ? I was about to start updating the template, but realised I should ask first.
Yes and yes
but you can point out it's CircuitPython 8
Well, this isn't about using it in code, this is about terminology in text and Learn guides.
So, this would simply be info, not so much tied to CP specifically.
if guides don't mention I2CPeripheral, then yes,
My template certainly doesn't. I'm not sure I was even aware of it.
https://www.nxp.com/docs/en/user-guide/UM10204.pdf is the revised spec
Ok. Wanted to make sure it extended to general terminology and wasn't specific to CircuitPython code
Perfect thank you.
second page of that pdf describes the change
For this we need SPI secondary (device) support, which is not implemented on any port right now.
@tulip sleet, @slender iron, @jaunty juniper I used sed to fix the version strings, I can push all of those to main if you think 0.0.0+auto.0 is good (and PEP 440 compliant, just double checking)
Yeah, I had sed change the workflow files too. The workflow files themselves use sed to do this at release time, so it should have gotten everything
and build tools and cookiecutter ?
Ah right, it was already 0.0.0-auto.0 when I did the pyproject.toml stuff, so I forgot I'd need to touch up a few other places
I can PR those
CircuitPython version
Adafruit CircuitPython 8.0.0-alpha.1-139-g3fbddfde5 on 2022-08-15; Adafruit Feather ESP32-S3 TFT with ESP32S3
Code/REPL
>>> import microcontroller
>>> microcontroller.on_next_reset(microcontroller.RunMode.BOOTLOADER)
>>> microcontroller.reset()
Behavior
The board reset due to the microcontroller.reset() but does not go into UF2 mode.
Description
Expectation is for the board to go in UF2 mode where you can drag and ...
I think there's a bug in dotenv. When you have a # in a quoted value (KEY='a#bc') it stops working after that line.
Documentation states that get_last_received_report() function should
return None if there was no report received previously, otherwise it
should return report. Moreover, same report should be returned only
once. That makes it possible to reliably process incoming OUT/Feature
reports.
This patch adds a bitfield that stores flag if report with particular
ID was received and updates get_last_received_report() to match its
documentation.
Fixes #6764
Alright, submitted the fix for the build-tools, and wrapped the changes for the cookiecutter into the existing PR I had out for it.
I had stepped away from the meeting today, thanks for the hug report on the ghost user. It was a fun little "Easter Egg" (ish) to find: https://github.com/ghost
Documentation states that get_last_received_report() function should
return None if there was no report received previously, otherwise it
should return report. Moreover, same report should be returned only
once. That makes it possible to reliably process incoming OUT/Feature
reports.
This patch adds a bitfield that stores flag if report with particular
ID was received and updates get_last_received_report() to match its
documentation.
Fixes #676
Thanks for the quick fix for this! Rather than use a bitset, I'd suggest just using an array of bool bytes. The default value of CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR is 6, so that's only six bytes. We are short on code space on the smallest ports, so a simpler access mechanism of just indexing into a byte array will be less code.
Hi, thank you for the PR. However I don't know if that is only a bug fix.
Moreover, same report should be returned only once.
I don't think that's the intention. The documentation implies that it always returns the last received report, not just once. Like a buffer that keeps the last value in it. It's supposed to return None only "if nothing received".
This implementation suits the current use in the default HID devices (caps-lock and num-lock LED's state can be read at any time a...
I have done some research and some HID descriptors do actually use reports as events (with different values), so it is definitely a thing. Looks like indeed the get_last_received_report() method was introduced to replace last_received_report field which definitely had this non-consumable "just a buffer" functionality.
However, that approach severely limits flexibility of the whole API. How about introducing a new method like "get_next_report()" that would act as is implemented in this PR (th...
Does anyone know if there is a way to make the Magtag stay connected to Wifi? I am using my phone’s hot spot for Wifi and it disconnects from the Wifi between fetch calls.
You may have better luck getting an answer in #help-with-circuitpython - this channel is related to development. Your question reminded me of this answer though, try using compatiblity mode: #help-with-wippersnapper-and-adafruitio message
Adds support for the Waveshare ESP32-S2-Pico Board with LCD ST7735R


USB PID from Espressif: [Espressif USB customer-allocated PID repository](https://github.com/espressif/usb-pids/blob/b39d288d4821bedfb589b7ec3cc8a3e2779e6237/alloca...
People, is there a special design pattern here? I'm looking at usb_hid module. It consists of two parts: shared-module/usb_hid and shared-bindings/usb_hid. shared-module/usb_hid/Device.c defines some functions with names starting with "common_hal_usb_hid_device_" which are used in shared-bindings/usb_hid/Device.c. However, shared-module/usb_hid/Device.h does not contain those functions. Instead, they are declared in shared-bindings/usb_hid/Device.h. Huh?
There are potentially multiple implementations of the common_hal_ routines. They are declared in shared-bindings/usb_hid/Device.h because the API is the same across all implementations (all impls must provide the same API).
In most cases they would be in port/<portname>/common-hal. However, when the API can implemented in a non-port-specific way, which is true for USB stuff (because we use TinyUSB), then the common_hal_ implementations are in shared_module.
Ok, I see. Still a bit confusing, because usually headers define functions that are declared in accompanying .c file. Would it make sense to add "extern" modifier to those declarations? It does not change its functionality, but will hint that those functions are "external" to that module
it doesn't hurt to add extern, I believe. We had to add extern for non-function declarations at some point. The idea is that there is a single place where the declarations are written, so that the identical list of declarations does not need to be duplicated in multiple places.
yes, it's unusual, and I was confused the first term I saw it, but now I see the reasoning.
extern for functions vs non-functions is a bit different, I think.
Yes, forward declarations for functions have extern implied by default
right, and for non-functions that used to work (I think), but at some point it didn't
there are a few shared-bindings .h file where they are declared extern
we haven't gone back to make them all consistent in that way
oh, right. I see functions declared extern in some header files in shared-bindings/
objects (not functions) declared at file scope without initializers or extern can end up in a "common block", which has some annoying implementation-defined behaviors
Right.. which is not the case here
Please note that on esp32-s2 and esp32-s3, RunMode.BOOTLOADER should enter the kind of bootloader that works with esptool and arduino, while RunMode.UF2 is for accessing the UF2 bootloader. On many other boards that have just a single bootloader, the two behave identically.
I only have an ESP32-S3-EYE on hand so I tested with it. For me, RunMode.UF2 worked. RunMode.BOOTLOADER seems to just crash the device until it's re-plugged or the reset button is pressed.
Ok, I have changed my fix to implement functionality I'm proposing in a new method - get_next_received_report(): it matches get_last_received_report() but IMO caries this "consume" semantics for reports.
@Neradoc thanks for pointing out the intended semantics. Originally .last_received_report was used only for keyboard LED status, so it didn't need to be very fancy. When I added user-created HID report descriptors, I did add the capability for "feature" reports, which are bidirectional, as you (@maximkulkin) mention, but I didn't make a full-fledged report queue mechanism for OUT reports (reports coming from the host).
i think using extern as a convention to flag function declarations that might be in a differently-named .c file isn't necessarily obvious, and the practice should be documented if you choose to use it as such
What is the best place for such documentation?
i think it depends on the project. repeating the documentation of the convention in each header file is one option, but in a large project, there might be a style guide to centralize such conventions
it could be an (Identical) comment in each shared-binding .h, or it could be in https://docs.circuitpython.org/en/latest/docs/common_hal.html
@maximkulkin Shall we close this, since it's a API semantics change? Are you will to proceed in main (8.0.0) only?
Let's close it for now.
Since plans have changed, I want to settle the design on 8.x branch first, then backport it to 7.3
Thank you! My bad for posting in the wrong place.
@slender iron when you're online, where did you get the hterm_all.js file? This is a file I've not touched at all since you had made the original code editor. It doesn't seem to be in the Code Mirror docs and I'm wondering if there's an updated way of loading the terminal that doesn't require such a huge file.
@gilded cradle this is the original source: https://chromium.googlesource.com/apps/libapps/+/master/hterm/
if you want to switch to a different terminal that's fine
there is also https://github.com/xtermjs/xterm.js
Thanks
I'll see if I can get hterm working first since I have the colors already customized, but if not I may look at switching.
👍
@gilded cradle ok, I'm at my desk. are you working on getting code.cp.org triggering the basic auth before doing the websocket?
I worked on that a bit (just on my system), but the hterm errors were getting in the way, so I turned back to that.
kk
On Discord, a community member noted that KEY='a#bc' works differently too. There appears to be no way to include a literal "#" in a value...
@slender iron I think switching over to xterm would be a good move so we can use firefox too. However, since that may take some time, I'm going to just use chrome for the moment and concentrate on the web socket issue. I need to head over to my office though, so I'll probably be offline for like 20 minutes or so.
ok, sounds good
chrome-only is fine
better to ensure it works with the device for now
yeah
@slender iron I think I understood your review, resubmitted
👍 just approved
Thanks!
good to decouple changes like that
What HID uses require the consume semantics? I'm interested in examples.
Agree, good idea!
@idle owl I want to run sed on the bundle libraries to change 0.0.0-auto.0 to 0.0.0+auto.0 and push everything to main
Just wanted to run that by you
It's probably more reliable than an adabot patch
circuitpython and other hardware could access it.
Note that SD cards operate at the block level and you'll have the same issue that we do with CP and a host computer. What device are you trying to share the FS with?
Sure. Cookiecutter as well?
Yup!
I'll run it tonight when I get back to my dev laptop
The cookiecutter update got wrapped into my outstanding pr
Ok, perfect.
@proven garnet Will this require a new release on everything?
Or is it internal only
I think internal only. Editable installs only make sense if you clone the repo, so a release isn't needed to enact it.
3d printer. It's a bit easier with 3d printer since most of them support remote command to release sd card (usually to remove it and also command to init it for usage). Parallel usage would be of much better but no idea if that can be done.
How CP is doing it?
Alright, think on that. So I know whether to tell Eva to do another sweep.
So it is not a bug... it just that I am used to RunMode.BOOTLOADER on other board and did not notice the difference.
With RunMode.UF2 it works perfectly on my Feather S3+TFT. => Problem solved, we can close this ticket.
Very long in the weed side note...
It still fail on my ESP32-S3-USB-OTG-N8 but I am not even sure that board accept UF2 or how to get it into that mode "manually" by double clicking. All my upgrade on that board have been done with esptool (AFAIR).
If I compare a f...
Can your 3D printer do USB host? It might be simpler to plug the circuitpython device into it.
Printer only exposes serial console over USB and the only storage medium is sd card. Currently using sdwire hardware (mentioned in first post) but that is just dumb switch without any programming capability.
@candid sun Hey, do you happen to have a RPi Pico (original), a MAX98357A amp, and a little speaker? And a few minutes to test something for me?
@idle owl let me do some part digging. i allegedly have the amp
Ooh ok. Thank you!
okay yes
Sweet. Can you wire it up as shown on this page, and then test the different examples? All files needed should be in the bundle downloads.
I had to update the template to use a non-discontinued part, and I need to make sure it actually works. :/
gotcha! yeah i will get that tested, just got to solder some headers
Frankly, as long as one example works, they all should. But the bundle makes it easy to test multiple things at least.
Thank you so much!
@slender iron I think the auth issue is fixed. I just pushed the change, so it should be updated now.
Though it's back to its behavior of forwarding me to https again
ok, lemme try it
Access to fetch at 'http://cpy-f57ce8.local/fs/' from origin 'http://code.circuitpython.org' has been blocked by CORS policy: The request client is not a secure context and the resource is in more-private address space
private.
so...i'm not getting anything out of my amp/speaker combo. tried cp 7and 8 with an original pico and then an rp2040 feather. not sure where the issue is
Hmmmmm
sounds like an https trying to retrieve http error
it might be the speaker i wired up. i only have the oval one
the tool bar says it isn't secure
Oh hmm. Maybe? Ok. I don't want you to spend all day on this. I'll test it on Feather RP2040 (good call! I hadn't thought of that) and see what I get.
Thank you for trying! I really appreciate it.
I'm going to do some research on this.
no problem! i can see if i have another speaker around too if you also experience issues
@slender iron can you check the flag chrome://flags/#block-insecure-private-network-requests
I'll keep you posted!
set to default
Ok, I think that's blocking it. It's one way to get around the problem, but I'll see if I can find a better way.
oof
I think reverse embedding is the way to go
One possible solution recommended there is WebTransport which I hadn't heard of before.
webtransport still does a bunch of security stuff I think
ugh that's why we can't have nice things !
which will take lots of code on the device side
MP just had to do the reverse embedding technique
Ok, basically the way we're trying to do it now is a dead end, so we have to figure out the next best thing
ya, I think so
I have been testing running my web UI (and a USB workflow) in an electron app
So does the reverse embedding technique pull in code externally?
unless a cors preflight can get us around it
ya, it does
but that code is pulled over https
Hmm
I'll have to look into that as well. I think doing a little research at this point is in order to explore potential options.
I think the preflight thing requires an https fetch
Hmm, ok
MP just did the host in reverse thing
Yeah, it's an option, but would still require quite a rewrite.
yup
Assuming we can get a self signed SSL cert somehow for the device, how much would need to be added to support https on the device?
I have no idea
Ok, no worries.
espruino loads the https site in an iframe and then calls out somehow
Hmm, ok.
I'll think about that. Even a hidden iframe to mask the calls might work.
Perhaps some kind of proxy might be another idea, but also might be a big security hole.
postmessage
was how they talk from iframe out
GitHub
This is an attempt to solve the issue where the publicly-hosted webrepl on https://micropython.org/webrepl is currently non-functional due to the page being served via https, but attempting to conn...
I'm not sure how it will work with websockets, but it may be enough to get around the issue.
ya, that's a bummer
Well, I'll try a bit of experimentation. As a base I'll set localhost to https and load the local circuitpython web server in a hidden iframe. That should be close enough to live to simulate the issues.
I'll think about that too, but that approach would likely have other issues we aren't seeing.
ya, definitely aren't great options
I think I might at least be able to get the file ops working with the iframe. I'm not as sure with the web sockets.
Unless maybe I can proxy through the device's serial terminal app.
post message looks pretty straight forward
@candid sun Uff. I'm not getting anything either...........
Speaker clicks as though it's getting a signal.
But no tone or wav.
yeah and looking over the mp code, it may not be that hard to set up secure websockets in CP. That's something I may look at doing while you're gone if I can't find a quick solution.
@tannewt I'm pretty sure there are tons of them, but the one I have in mind is similar to LampMultiUpdateReport (see Section 25.11.1 at https://usb.org/sites/default/files/hut1_3_0.pdf). I am developing a custom HID for Adafruit RP2040 MacroPad that would allow me to control colors of keys RGB LEDs: each report is a command to set color of particular LED.
secure websockets requires ssl afaik
Yeah, I'm not sure at this point.
oh noooo. how about with an m4?
NEvermind, rewired it on the Feather.
Audio playing.
So maybe those pins on the Pico aren't supported anymore?
I did A0, A1, A2 on the Feather and it immediately worked (once I sorted out what needed to go where). I need to find a Pico is what needs to happen here.
Time to dig!
I like the second option better as it's closer to what we were going for.
kk
ah yeah i did use D5-D9 so that explains it that it needs to be analog
I didn't think it did though...
@candid sun Pico works for me. As shown in the guide. So it must be your speaker situation. 🙂
Super crunchy sound, but I guess to be expected with small speakers.
lol I think this is the Pico I tested this with last time. Because it asked to replace the WAV and the MP3 files. 😄
ah okay, glad it worked!
For sure! I was about to be baffled. Still baffled why the same pins didn't work on Feather, but you know what? Not my problem right now. This is a future-me problem.
Alright, let's not do a release, after thinking about it
Sounds good! Let me know when you've done your thing.
Internally this is done with a MOVE HTTP verb. It is modeled after
WebDAV MOVE but not exact to keep the Destination header shorter
and have more consistent response codes.
Fixes #6647
This only works for one top level directory at a time.
@idle owl @jaunty juniper Alright, everything is changed over to 0.0.0+auto.0
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 tried this with no luck. It still triggers a watchdog. My code is here: https://github.com/tannewt/circuitpython/tree/ipc_deep_sleep
@proven garnet Please send me an email to deal with the release tomorrow. Thank you!
Oh, I said I don't think we need one, but let me know if you still want to do one anyway, I might have missed that.
If we do I can email you
If you clear the "rename to" field and then press cancel the file is renamed to null.
oops
I'm a little disappointed that the edit option has gone away for unknown file types. I know editing a .mpy file didn't make much sense but it didn't crash anything and it was useful to be able to edit files like "menu.bat" or ".env"
Probably can just add to the known file types as we go though. .env is really the only file type I can think of right know that needs to be added.
Was the lack of any error reporting (target file exists, move to nonexistent folder) intentional? The rename seems to do the right thing in these cases which is nothing :)
I like that subfolders being uploaded briefly show up in the Create Directory field, gives you a progress indication of sorts :).
I manually merged this PR so perhaps I missed something but it looks like both the file selection and direction selection are both labeled "Choose Files".
If you clear the "rename to" field and then press cancel the file is renamed to null.
Haha, oops. Thanks for the testing!
I'm a little disappointed that the edit option has gone away for unknown file types. I know editing a .mpy file didn't make much sense but it didn't crash anything and it was useful to be able to edit files like "menu.bat" or ".env"
This is just the link. You can create the link yourself and the edit page won't be wiser. I did add .env support now.
Was th...
I like that subfolders being uploaded briefly show up in the Create Directory field, gives you a progress indication of sorts :).
I added a progress bar now for the number of files that are done out of the total.
I manually merged this PR so perhaps I missed something but it looks like both the file selection and directory selection are both labeled "Choose Files".
Ya, Firefox labels them differently. I added emoji labels to distinguish them.
Thanks again for testing!
Fixes #6606.
- Use ESP32 touch API properly. Note that the values returned by
touch_pad_read()are lower rather than higher when the pin is touched. - Use
TOUCH_FSM_MODE_SWinstead ofTOUCH_FSM_MODE_TIMERfor all Espressif. It seems to work fine. - Refactor some code into
espressif/peripherals/touch.c.
Tested on Feather Huzzah32 (ESP32), Feather ESP32 V2, Feather ESP32-S2, Feather ESP32-S3. (C3 does not have native touch.). I'd welcome other hands-on testing.
Rebuilding your latest updates now, I didn't see any issue with recursive deletes in this version, I guess I was lucky.
I'll confirm once my poor little raspberry finishes the new build but on this version I just noticed that the directory "Choose Files" button is still active even when the !editable state is active (CIRCUITPY mounted). The interface goes through the motions but doesn't actually perform the upload.
This looks ok by me. _decode_percents looks like it will give you garbage if the input string is truncated and doesn't have a second character after a %, but that doesn't really matter, I think.
I will leave use testing to @RetiredWizard.
If anyone is up for a quick PR review, this is for the version strings, but also for fixing the neopixel library (and anything that depends on it) that should have gotten the followup patch during the pyproject.toml migration: https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel/pull/135
It's keeping a handful of libraries from passing CI (and from downloading correctly, in general)
Might be keeping itself from installing correctly, hence the concern 😅
Ah, I saw the issue you responded to @jaunty juniper
hey I looked at a few other libraries recently modified and they don't have the release.yml change from - to +
Can you tag me in them?
ticks looks like it has it, unless you mean changes like those
huh, I'll double check
I think I missed some on the sed command, thanks for catch! I'll push the workflow file changes.
I think I forgot to add *.yml
that would do it !
Pushing now, thank you so much for catching!
The Folders "Choose Files" button is active even when CIRCUITPY is mounted. The upload doesn't work but the interface runs through the upload process just the same.
The progress bar doesn't do anything on a folder with a single file in it. That's not a problem, just an observation.
In the Developer Console I'm getting a number of timeout errors

It appears that if a folde...
I think the confirmation button on the pop-up window should be something other than "Upload". I tend to click it and think I'm launching the upload when there's actually another Upload button to click.
I managed to cause the ERR_CONNECTION_RESET error again by attempting to upload a single file while a larger folder upload was in progress, but it's not entirely repeatable.
Hey, does anyone know what the status of possible ULP support for the ESP32-Sx chips is? I've been able to find some messages from a couple of years ago about it, but nothing more recent.
Clicking on a folder and changing your current directory while an upload is occurring causes the upload to get confused and stop.
Maybe it's obvious that while the upload is happening you shouldn't be clicking on anything else in the UI but it's clearly a bad idea :)
I thought it was used for deep sleep
I thought the purpose of ULP was to actually let you run code during deep sleep?
I guess maybe CP uses ULP to do its deep sleep, though Espressif has sample code showing how you can have it read an external sensor while in it, which obviously would be very useful, especially if it could do I2C: https://github.com/espressif/esp-idf/tree/5b11895700/examples/system/ulp_riscv/ds18b20_onewire
Just taking a quick look at it and while I can see some great uses for it, I'm not sure how you could have python libraries to read sensors via i2c without the sensor driver being written in C
I turned off auto-reload and performed a folder upload. While the upload was underway I ran some python scripts via the USB serial REPL and the upload failed with an ERR_CONNECTION_RESET.

I deleted all the files from my microcontroller and made sure no code.py was running. The large folder upload then ran through without any of the timeout errors.
So I've been working this pretty hard for several hours and overall I think it's really solid. The things I've found this evening could easily be dealt with as issues after a merge.
The only troubling issue I've found so far is the occasional ERR_CONNECTION_RESET messages that usually correspond with the web workflow crashing. I haven't been able to reliable reproduce it yet but it really doesn't happen that often and I've been exercising the upload far harder than I think it will see in n...
The null file rename issue is fixed, I've tried to break it everyway I can think of but I think I'm stumped :)
Yeah, though I guess I'm wondering if you could have most of your project be in CP, and just this little bit in C
The problem I think is the C code for ULP has to be linked to the main code. Which is possible with a custom build, or maybe there is a way to not have to link it. and then CP would need a new or maybe addition to the sleep module to set this on/access the RTC memory.
Indeed, I wasn't imagining it'd be super easy to implement, especially as I'd imagine it'd require changes in terms of the usual CP workflow to compile + put the code on there, though it really would be super useful/cool, even if you couldn't pass sensor data etc. between the ULP and CP world.
Well, I built an image for the Ai-Thinker ESP32-CAM but have to wait until I get home to actually flash it to hardware
Have a working image on the ESP32-CAM, lot of pin issues to work out though but serial REPL and web workflow is up and running
Awesome work all...
I am about a week or two away from finishing 3d printing and wiring up eight RP2040's to a single Pi4 over the i2c bus.
Look forward to testing this code.
Cheers.
If you need UF2 support on a non-Adafruit board (including ones that happen to be sold through the adafruit store), contact the original hardware maker and let them know your needs. Contributing a bootloader to tinyuf2 would be fine too.
is there a current Learn page that shows installing CP on ESP32? like with esptool etc?
@slender iron @onyx hinge fyi ja is now the largest build by a lot (not ru), in case you are testing whether something fits
not yet, we are not even listing the builds yet on circuitpython.org, to avoid excessive support load (but really mainly because we haven't done an alpha.2 or beta.0 yet)
but lack of instructions adds a load to you in other ways
the instructions are really the same for loading a .bin on ESP32-S2
etc
is there page for that? this is for a new guide. would rather link to something than re-write. looking around....
only the .bin is different
thanks. yah, that's the best one i could find too.
@tulip sleet what changed to make it more?
It isn't used afaik. We do use the power domain for some sleep things.
it didn't become more, ru became less
@gilded cradle I'm at my desk. How's it going?
Good. I was just going through github notifications and then going to test the iframe thing some more.
or more exactly, ru was the largest on SAMD21 builds, due to font. I turned off terminalio on ru builds on SAMD21, which made that no longer be largest build. On non-SAMD21 builds, I think ja has been the largest build for a while
@tulip sleet yah, wipper just says follow webpage instructions
which webpage?!
AIO
you select board, then "follow instrucitons"
could login and run thru it i guess. see what it says.
oh, wippersnapper is a UF2, ok, never mind
I looked at the io.adafruit.com pages
somehow I thought it was .bin
what r you using, firefox?
yah
why did you turn it off? don't we have decent font coverage for it?
the cyrillic font is too big; this is only on SAMD21. Same reason we turned the font off for ja, ko, etc., on SAMD21
I just mentioned this now because I was looking at flash consumption on matrxiportal and wanted to test with the largest build
I did that a month ago
yes, it is, I feel it was necessary
or maybe I didn't turn it off, lemme check, maybe I just reported it. I was trying to figure out why the ru builds were so big
can we turn it back on with the -Os change?
@slender iron what's your suggestion for getting/loading the esp32 firmware (for web workflow)? i just grabbed from s3 and used esptool.
I don't have a good answer. I think the future is a chrome browser and web serial but I don't know the current state
I use make to do it
thanks. i'll point to the web serial info. but i guess also quickly show s3/esptool.
@slender iron https://github.com/adafruit/circuitpython/pull/6562#pullrequestreview-1044205087 Really, I don't think this is a big deal. It's only an omission for SAMD21 display support. I do see we might try turning onewireio back on, on SAMD21. Right now it is off for all non-Express builds
@gilded cradle is this the best page to point people to for general coverage of using webserial for firmware loading?
https://learn.adafruit.com/adafruit-magtag/web-serial-esptool
we have had other regressions before. the ru font is very large
I would turn onewireio or even pulseio back on first if we had the space
Yeah, that's fine.
ya I agree with this
SAMD21 display support is a niche, like gizmo
or even turn longint on, if possible, since that would fix some library longint blocks
and hallowing?
text russian vs images
hallowing is fine, just russian won't have terminal on it
same is already true for ja
ah, I see what you mean
if we had space on samd21, what would you add back for your boards?
this is all theoretical, I'm not sure there's enough new space to add anything back
longint??
well, for my boards I always have my own custom list anyways, depending on what the board is using
but you do omit things that are just too big. onewireio is not important to you, but other things might be nice if you could have them
I usually remove everything that is not strictly necessary on a given board
limor i think is keen on pulseio or onewireio being back
if you do that, it will be invisibly eaten away
i have to go afk for a while, but interesting convo
I didn't realize pulseio was disabled
yeah, it's been a while, she would like to have it back
onewireio you can substitute i2c sensors, but pulseio has no substitute
pulseio is off for non-full builds and some other select samd21 builds
It still fail on my ESP32-S3-USB-OTG-N8 but I am not even sure that board accept UF2 or how to get it into that mode "manually" by double clicking. All my upgrade on that board have been done with esptool (AFAIR).
Double clicking reset requires the board to have a capacitor to hold one bit of state because reset actually wipes all mcu memory. The espressif boards probably don't have it. Instead, clicking reset and then boot is usually done to avoid actually resetting the device.
It ...
Awesome work all... I am about a week or two away from finishing 3d printing and wiring up eight RP2040's to a single Pi4 over the i2c bus. Look forward to testing this code. Cheers.
Beware that (I think) this CP API uses I2C clock stretching and that Pi's are notorious for not supporting clock stretching. Clock stretching is used while waiting for python to respond.
@slender iron looks like thonny does not handle the additional escape sequences in the banner text
Next beta will
ok. yah. i've managed to get it connected a few times. but only with multiple tries. and not sure how/why it finally was ok.
@tannewt I'm pretty sure there are tons of them, but the one I have in mind is similar to LampMultiUpdateReport (see Section 25.11.1 at https://usb.org/sites/default/files/hut1_3_0.pdf). I am developing a custom HID for Adafruit RP2040 MacroPad that would allow me to control colors of keys RGB LEDs: each report is a command to set color of particular LED.
Very cool! Thanks for the link!
I have seen feature reports used in an eye tracker that is an HID device. It has many reports, and is how I picked six as the max number of reports.
Thanks again for all of the testing!
It is definitely a bug that mkdir fails when the parent is missing. I'll also tweak the disabled status of things to make it harder to have two uploads going at once. I'm not exactly sure how to deal with the timed out or connection reset errors. I'll keep an eye out for them.
@tulip sleet is https://github.com/adafruit/circuitpython/issues/6756 on your todo list?
not specifically; I'll assign myself. I do want to do a bisect on the failing builds.
k, I'm running out of time to pick anything else up
would you mind doing a beta.0 release tomorrow too?
sure, for CPy day
so, the S3 sleep problems are ESP-IDF related?
@slender iron also did you see the report of a bug with a # inside a .env value? I don't see an issue for it.
it was in discord
also 6609 looks like it might be simple
ya, I think we need to bug espressif about it
jeff mentioned it here: https://github.com/adafruit/circuitpython/issues/6661#issuecomment-1216868316
I'm not sure what to do about 6609
because we'd need to implement insert by deleting characters and re-sending them
if there were a better terminal impl in the browser, would it help?
maybe arrow keys should just do nothing (but it would be frustrating)
I'm not sure we can fully prevent moving the cursor
suppose you didn't send the line until you got an EOL
so the type-in box would be browser-local only. kind of like Arduino serial window
then the arrows would work, as handled by the browser
ya, that could work too
we might as well do that, unless it handles tab completion
I don't feel like the best person to refine that html/js
i can comment in the issue
CircuitPython version
Adafruit CircuitPython 8.0.0-alpha.1 on 2022-06-09; Adafruit Feather ESP32-S3 TFT with ESP32S3
Code/REPL
import microcontroller
while True:
print(microcontroller.cpu.temperature)
Behavior
This code throws the following error:
code.py output:
Traceback (most recent call last):
File "code.py", line 4, in
NotImplementedError:
Code done running.
Description
No response
Additional informat...
Yeah, it's that I found some stuff from 2020 on here and Github but I'm not sure what, if anything, came of it:
GitHub
Added alarm.sleep_memory, which is a bytearray-like object (similar to microcontroller.nvm) that can store state between deep sleeps. Implemented only on ESP32-S2, in the RTC slow memory.
Added set...
the ULP is also tricky because it isn't xtensa
I was hoping to treat it more like PIO
Temperature is not implemented in ESP-IDF yet for ESP32-S3. It's part of the ULP. See: https://github.com/espressif/esp-idf/issues/8672
Run CircuitPython ON the keyboard :smiley:
This is no longer an issue. You can easily convert Unix epoch timestamps and timezone offset manually with something like this:
` def _format_datetime(datetime):
return "{:02}/{:02}/{} {:02}:{:02}:{:02}".format(
datetime.tm_mon,
datetime.tm_mday,
datetime.tm_year,
datetime.tm_hour,
datetime.tm_min,
datetime.tm_sec,
)
unix_time = 1660761378
tz_offset_seconds = -14400 # NY Timezone
get_timestamp = int(unix_time + tz...
what's that one pin quirk about using pico uf2 on picow?
board.LED is actually connected to the wifi module
it's one of the communication lines with the module, the real LED being controlled by the module it can't be used in Circuitpython
thanks. so basically. just ignore that pin?
yeah, don't use it, treat the board as having no LED
We could probably freeze adafruit_portalbase if we turned off ulab. This may be a reasonable tradeoff. I found one use of ulab in an RGB Matrix project (which was done on the Feather M4, not the MatrixPortal): https://learn.adafruit.com/ocean-epoxy-resin-lightbox-with-rgb-led-matrix-image-scroller/code-explanation, but that could be recoded.
@makermelissa Do you have an opinion about what to refreeze, or other ways to save space?
I have some changes to adafruit_esp32spi that wil...
@jaunty juniper thanks!
adafruit_portalbase/wifi_esp32s2.py is small but we could remove it using the same trick as with the Circuit Playground library. Would it make a difference ?
How do I redo this using with? ```py
import audiocore
import board
import audiobusio
audio = audiobusio.I2SOut(board.A0, board.A1, board.A2)
wave_file = open("StreetChicken.wav", "rb")
wav = audiocore.WaveFile(wave_file)
print("Playing wav file!")
audio.play(wav)
while audio.playing:
pass
print("Done!")```
I've not done it myself without something to work from before. I thought there was usually more code involved than is here. Pylint is complaining.
About 6 files, but I think if I get one, I'll be able to do the others.
for the open ? We want to keep the file open forever, so that means putting the whole rest of the code in the with clause
Pylint says, "Consider using 'with' for resource-allocating operation".
we've been meaning to have WaveFile take in the filename
yeah like OnDiskBitmap
The RAM saved would be roughly the size of the .mpy file, which is only 788 bytes. adafruit_esp32spi_wsgiserver is about 2.4k, and I was planning to delete that. But adafruit_portalbase is much bigger.
I do see that BLEIO HCI support for the ESP32 is enabled. We could turn that off and that frees a lot of space, more than enough to freeze adafruit_portalbase again. I will ask about this.
# pylint: disable=consider-using-with
tell pylint you considered, and thank you very much 🙂
I really dislike adding that to short code in templates. 😕
But yeah, agreed.
Short code means I should explain why I'm disabling.
Long code? There's so much going on, I can gloss.
I find myself writing more pylint directives in my code than the actual code
Um.... Ok this one has me baffled. ```py
decoder = audiomp3.MP3Decoder(open("slow.mp3", "rb"))
audio.play(decoder)
while audio.playing:
pass
print("Done playing!")```
Not sure how to do with here.
with open("slow.mp3", "rb") as f:
decoder = audiomp3.MP3Decoder(f)
audio.play(decoder)
while audio.playing:
pass
print("Done playing!")
Looks good, the folder with just folders uploads now, "Choose files" is not active either when CIRCUITPY is mounted or an upload is in progress and clicking the Upload button on the pop-up now starts the upload :)
The folder I've been uploading contains about 40 sub-folders and 70 data files and the microcontroller has about 70 files and 2 folders already in the root directory and another 40 files and a few more subfolders in the two root folders. During my test folder upload I typically ...
Is that what you call "linterate programming"?
@tulip sleet looking at 6756 already? otherwise I'll take a quick peek. I could also start beta.0 release notes
i need your specialized skills now 🙂
As in, it's a different kind of chip than the main chip so it's harder to program/compile to? From a bit of cursory Googling it just seemed to be C though no idea if the overall toolchain (?) is a horrifying pain.
CircuitPython version
Adafruit CircuitPython 8.0.0-alpha.1-143-g2f0e209ec on 2022-08-17; FeatherS2 with ESP32S2
Code/REPL
import board
import displayio
from adafruit_featherwing.tft_featherwing_35 import TFTFeatherWing35
if "feathers2" in board.board_id:
wing = TFTFeatherWing35(cs=board.D5, dc=board.D6, ts_cs=board.D21, sd_cs=board.D20)
display = wing.display
display.rotation=180
ts = wing.touchscreen
else:
raise NotImplemente...
ya, you can't just run code for the main cores on it. It has two modes, one custom isa and riscv iirc.
Yeah, the custom one looked like a horrifying pain to deal with, but I was figuring the newer ULP might not be as awful
Guess that assumption was a bit puts on shades RISCy on my part (I am so sorry)
Fixes #6748: incorporate addition floating-point format fixes from MicroPython. Cherry-picked two commits from upstream. One required some merge fixes, maybe due to an upstream rebase. Verified that latest version now matches upstream except for a comment change.
ya, I'd target the risc-v part if anything
would that make it easier on the C3 ?
@jaunty juniper does the C3 have a ULP?
I figured they meant that the C3 is RISC-V itself?
I checked, it doesn't have one: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/hw-reference/chip-series-comparison.html
Hmm, on the one hand, it would be nice to keep it consistent, but on the other hand, it doesn't feel very clear to name the I2C that lets you use the keyboard as a peripheral "Target I2C". Or is it just me? :sweat_smile:
though there is MicroPython for the C3 itself