#circuitpython-dev
1 messages · Page 337 of 1
just a github glitch.... I don't like the red crosses though, are these glitches avoidable ?
no, it's their unreliability issue. If the glitch is nothing, we just approve/merge anyway
I have run the install.sh and export.sh scripts but when I try make BOARD=adafruit_metro_esp32s2 I am still ending up with this error:
CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
are there some other requirements for making esp32s2 builds? Or possibly my environment has some kind of issue?
ah, need to install ninja-build have gotten further now 🤞
Yep that was it. Getting successful builds now. 🥷
I did one more test this morning with Metro ESP32-S2 and a SSD1306 I2C screen. It's working well with those also. No bus_device in lib folder, still able to use the display.
@tulip sleet @onyx hinge my vote is to merge the arg checking for matrixportal and release 6.0.0 with it
@slender iron there are now sort of 3 late-breaking things: #3668 (esp32s2 repl crash), #3666 (rgbmatrix jumbled display), and the arg-checking PR you mentioned.
k, I haven't looked at 3666
anything esp32s2 doesn't need to go in 6.0.x
esp32s2 folks should stay on the latest
This is one I'm glad I tested before submitting. The quote in the 2.9" was a curve ball.
This is one I'm glad I tested before submitting
"ed for truth
what is the best way to enclose port specific code in shared-bindings ?
there shouldn't be port specific code in shared-bindings. what are you trying to do?
I'm working on watchdog implementation for the esp32s2. On the esp32s2 we can deinit watchdog in RESET mode but the current implementation throws an error.
//| def deinit(self) -> None:
//| """Stop the watchdog timer. This may raise an error if the watchdog
//| timer cannot be disabled on this platform."""
//| ...
//|
STATIC mp_obj_t watchdog_watchdogtimer_deinit(mp_obj_t self_in) {
watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in);
watchdog_watchdogmode_t current_mode = common_hal_watchdog_get_mode(self);
if (current_mode == WATCHDOGMODE_RESET) {
mp_raise_NotImplementedError(translate("WatchDogTimer cannot be deinitialized once mode is set to RESET"));
}
common_hal_watchdog_deinit(self);
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_deinit_obj, watchdog_watchdogtimer_deinit);
I guess this error needs to be moved to common-hal ?
Suggested changes implemented except for moving the extern declare to ports/esp32s2/supervisor/port.h. That file does not exist; is it worth creating it to hold this one line?
Suggested changes implemented except for moving the extern declare to ports/esp32s2/supervisor/port.h. That file does not exist; is it worth creating it to hold this one line?
Up to you. I suspect we'll need access to it to fix the auto-reload while sleeping too but that fix might live in these files too.
@slender iron also, this error seems to be a RuntimeError instead of a NotImplementedError
@BradChan You don't need to compile a new board to get an external display working. You can initialize it with the Python library. Here is an example: https://github.com/adafruit/Adafruit_CircuitPython_ST7789/blob/master/examples/st7789_320x240_simpletest.py
@analog bridge agreed
Looks great! To fix the translation issue run make translate at the top level and commit the result. It'll add entries to locale/circuitpython.pot. Then, the CI should build every board.
I built this locally and checked served pages. Both changes look good to me. I see MagTag in the list of downloads now. and the Metro ESP32 S2 has a new image and no longer says coming soon.
@astrobokonon I think it's simpler. We simply need to return early if current_scan is NULL.
Or better yet, raise an error to point out the code is stopping out of order.
@kattni check in a few mins!
I suggest installing pre-commit locally to test more rapidly: https://pre-commit.com/#installation
From the Build CI failure:
Duplicate VID/PID usage found!
- VID/PID: 0x239A:0x8086
Boards: teensy40, hiibot_iots2If you are open source maker, then you can request a PID from http://pid.codes
Otherwise, companies should pay the USB-IF for a vendor ID: https://www.usb.org/getting-vendor-id
Note, most chip vendors also sell individual PIDs.
Thank you! I'm ok releasing this in a 6.0.0. Worse case we have to do a 6.0.1.
@slender iron the nrf port takes ms as timeout but s2 can only take seconds. What to do in this case?
Should I limit the resolution of the api to seconds only or round off ms in the s2 port.
@analog bridge good question! How about rounding up? That way it won't be shorter than expected
ok! 👍
@expandme-tech We're more than happy to have board definitions for these in CircuitPython. The biggest hurdle for most boards is having a unique USB PID for each. Open source hardware can get one for free from https://pid.codes. Companies are expected to purchase a USB VID from the USB-IF (https://www.usb.org/getting-vendor-id).
@Xinyuan-LilyGo Do you have USB PIDs for each of these boards?
from microcontroller import watchdog as w
from watchdog import WatchDogMode
import time
# Set a timeout of 10 seconds
w.timeout=10
w.mode = WatchDogMode.RESET
# Removing w.feed causes a watchdog reset
while True:
w.feed()
time.sleep(5)
Since you think it may be useful in the future I have split out the extern declare. I did name it ports/esp32s2/supervisor/esp_port.h, however, to avoid naming conflicts with the global supervisor/port.h
@slender iron Scott, if you are not too busy listening to spotify, what is the canonical way of building cp locally? I wanted to test ulab before commiting to github, but I always end up with a linker error /usr/bin/ld: build/py/objmodule.o:(.data.rel.ro.mp_builtin_module_table+0x108): undefined reference to `ulab_user_cmodule'. I took Jeff's script from github https://github.com/v923z/micropython-ulab/blob/master/build-cp.sh, where it is part of the workflow, and it works without glitches.
Oh, this is really diabolical: circuitpython is cloned recursively: /home/v923z/sandbox/cp/circuitpython/extmod/ulab/circuitpython/extmod/ulab/circuitpython/extmod/ulab/circuitpython/extmod/ulab, and it goes on ad infinitum. I guess, I had better figure this out first.
😬
What is the difference between a pin level alarm and a pin edge alarm? Won't a low level alarm fire at the same time as falling edge would?
My biggest concern is having each alarm enabled independently of each other and independent of use. This prevents validating that 1) the alarms can all be set at the same time and 2) they can all work at the desired sleep level.
1 is important because pin alarming might not actually be independent. On the ESP32-S2 ([reference](https://docs.espressif...
Using the guide from Adafruit here:
https://learn.adafruit.com/adafruit-eink-display-breakouts/grayscale-29-overview
The code returns the following error:
code.py output: Traceback (most recent call last): File "code.py", line 26, in File "adafruit_il0373.py", line 184, in __init__ TypeError: extra keyword arguments given
The offending code is this section, with line 26 the first line here:
`display = adafruit_il0373.IL0373(
display_bus,
width=296,
height=12...
fyi some chips have irq-on-level and some have irq-on-edge - i suppose it only really matters if the irq pin is LOW on entry-to-sleep, if its falling-edge it would not wake immediately. If its level it would exit sleep immediately.
#579 seems to solve this for me: https://circuitpython.org/board/adafruit_magtag_2.9_grayscale/
Now we just need a 6.0.0 release with MagTag in so that we can have one firmware ready to download without going to S3: https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/adafruit_magtag_2.9_grayscale/
@slender iron Thanks! I think I have forgotten to update the submodules 😊. You should, however, note somewhere that for the unix port, one has to make axtls before running make.
@slender iron could we talk about UDP sometime today?
I have lost track of the changes in sleepio and it seems like the api has become quite complex.
@tannewt Can you link your alarm compatibility table for different ports here.
@ionic elk sure! what time works for you?
now works
ok I'm in amelia
import wifi
import socketpool
# connect to wifi
wifi.radio.connect(essid, password)
pool = socketpool.SocketPool(wifi.radio)
ntp = adafruit_ntp.NTP(pool)
So this board will be best fit for sample code with right free USB ID: https://github.com/eggsampler/ESP32-S2-Breakout (It's even has USB to MicroUSB now)
It has right license (MIT) license 👍
Rudolf
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 ...
Tested successfully with 2.4" TFT Feather wing SPI display, and LSM6DS33 accelerometer sensor on I2C both set up using
i2c = board.I2C()
spi = board.SPI()
W (12677) mbedtls: ssl_tls.c:5808 x509_verify_cert() returned -9984 (-0x2700)
I digged around and found this https://forums.mbed.com/t/x509-verify-cert-returned-9984-0x2700/4434/12
As you can see in their example, in https://github.com/RadialDevGroup/esp32-ota-https-example/blob/master/main/ota_example_main.c EXAMPLE_SERVER_DNS is used both for setting the hostname and for the tcp connect. Also in this example, you will see the comment before setting t...
I think the mbedtls code would expect a call to mbedtls_ssl_set_hostname()
huh, I'd expect the esp_tls wrapper library to call it
api.github.com https is OK, even though it is using a wildcard certificate. I fail to see any difference why io.adafruit.com fails out
what do we set skip_common_name to?
maybe we need to change: https://github.com/adafruit/circuitpython/blob/main/ports/esp32s2/common-hal/ssl/SSLContext.c#L35
I think our esp_tls_cfg_t is all zeroes
Possible, I'll need to put some print statements to understand what is inside those variables
sure, here or a gist
Once it fails, it also hangs - the wifi disconnect is not expected and doesn't happen without the debug logging enabled
I read in the documentation to set to "debug" - but I choose verbose. I'll build another image with "debug" and have a look at that log
in tools there is a python program that can make sense of the Backtrace lines
Good hint, will have a look. Today I can't stay awake beyond midnight though. So 20 more minutes and I'll need to call it day.
kk, feels like you are getting close
I'm doing some eink tweaking and then I can look too
For this image I haven't built in the latest set of certificates from mozilla. Depending on the log output I may give that one more try. Thanks to the win10 the compilation goes fast, thus 2-3 builds are no issue 🙂
🙂
I don't know who will take the timestamp of next weekly meeting. So here is my code for CLUE to send to keyboard by clicking the B button. To reset the timer, use the A button: https://gist.github.com/dglaude/75b90856b7fbab4632788a63f2694f82
@thorny jay I have now a Clue Timestamp application. @slender iron maybe you want to test that for Friday. And it could be used on Monday's meeting. (somehow I went to 3 iterations to find the right way to scan the button without loosing some).
@thorny jay sure! I've added it to my streaming checklist so I set it up on friday
before the stream
https://benny.servebeer.com/nextcloud/index.php/s/Ap7wY7TJZnN9eC7 the log doesn't go beyond what I expected (and guess who's Pi got hung up on the USB stuff again ;))
👍
@gilded cradle when you were working with display init sequences did you realize the docs don't match the implementation for delay?
I'll try one more thing, where I revert mbedtls back to info and bring the console to debug .. I'm missing the ESP output
huh
@slender iron which display are you referring to?
hx8357
I think I got the init code from the arduino library
the displayio docs say the delay time is immediately after the param count
And adapted it to the way CircuitPython does it
the implementation gets the delay time from after the parameters
Oh, are the codes wrong?
ok
since code has been tested with the implementation
I did it like a year and a half ago and don't really remember exactly what I did too well
No problem 🙂
at least the implementation is consistent
👍
I may have written them before I implemented it
putting the delay time after the params makes it easier to add or remove a delay when you have parameters
yeah
since they stay in the same position
@slender iron are you available for another conversation? 1. short term rc.2 or not ; 2. more sleep API discussion.
yup
I'm not sure what the remaining actions failures mean.
Hi @cwalther
Thanks for the new functionality. I tested "set_next_code_file()" this afternoon and it is just what I needed.
Do you have a time line on when you intend to merge the functionality into the main branch?
Thanks for your time!
Cheers,
Lee
I looked over the drivers that use the API and very few actually hit this case. The ones that do, I assume are already correct because of testing.
From the Build CI failure:
Duplicate VID/PID usage found!
- VID/PID: 0x239A:0x8086
Boards: teensy40, hiibot_iots2If you are open source maker, then you can request a PID from http://pid.codes
Otherwise, companies should pay the USB-IF for a vendor ID: https://www.usb.org/getting-vendor-idNote, most chip vendors also sell individual PIDs.
I am using CPython 6.0 RC2
I am trying to use a DS18B20 on a Pynt on D3 (yes, the resistor is installed) along with D4 as a digital input. However when I use the scan command on D3 it returns no devices (Max device found) if I scan D4 (the DS18B20 is still attached to D3) it finds the DS18B20 and it works just fine. However, now I can't use D4 for my input as the pin is in-use.
Swapping the devices between D pins does not help.
This is an error in the onewire scan someplace or deep...
I can’t find an answer. Seems like nobody in makecode room. But is there a way to make makecode work with the adafruit 16 servo pwm driver
@tannewt and I talked again today, and revised the example in @tannewt's comment above.
A few more notes:
Re rising/falling edge detection: Both level and transition can often be detected. I have seen both, and I even see "transition either direction".
Waking from deep sleep on pin change: On a number of chips, this is implemented as "tamper detection". On nRF, it is just called "DETECT") Some chips just ...
These failures seems to be AWS S3 upload failures that are network glitches or S3 glitches. Nothing to worry about.
Is it worth adding the default UART too?
Got my MagTag today. Is the CircuitPython support for it done yet?
Ah thank you. Yes I do think it will be good to add UART so this can match other devices (and re-use any existing code making use of it).
I can add that today and push a new commit with it.
@cobalt grail there hasn't been a release since it came out yet. But there are some "absolute newest" builds for it in the S3 linked on the download page.
ESP32-S2 as a device family is still being actively worked on. I don't think it's supporting 100% of everything that other devices families support with Circuit Python. But many of the basics are in place already.
I have an implementation on a more robust base than this prototype almost done. I hope to have pull requests ready for review this week. A few more days to weeks of review and discussion will then probably be required before the final merge.
Thanks for testing! Would you mind telling which of the optional keyword arguments to set_next_code_file you are using and with what values? Because we will probably not keep all of them for the final version, to keep things simple. Getting feedback ...
Got my MagTag today. Is the CircuitPython support for it done yet?
@cobalt grail Here is the first demo from LadyAda: https://gist.github.com/ladyada/2f117c1c83ed78e02c0f324724474698 and the firmware is linked from the last message of this issue: https://github.com/adafruit/circuitpython-org/issues/575
CircuitPython Countdown for MagTag Demo. GitHub Gist: instantly share code, notes, and snippets.
The MagTag is not visible yet on CircuitPython.org Waiting for this pull request to be merged: adafruit/circuitpython#3653 I think that right now, the firmware should be here: https://adafruit-circ...
I did a quick test between UM Feather S2 and a Feather Sense with RX/TX connected running this "chirp" script:
import board
import time
uart = board.UART()
b = bytearray()
text = "HELLO"
b.extend(text.encode())
while True:
#read = uart.read()
#if read:
# print("we got: {}".format(read))
written = uart.write(b)
print("wrote {} bytes".format(written))
time.sleep(3)
It is working correctly for sending and receiving on both sides.
So I'm trying to port the esp32spi_wsgiserver to the Wiznet5K. I feel like I'm making progress, but I could be fooling myself haha. Anyone able to point me in the right direction on things?
@prime cove sure!
I havent spent much time in the WSGIServer repo
BUT
W5k is based off https://github.com/arduino-libraries/Ethernet
There's some Webserver examples in that repo https://github.com/arduino-libraries/Ethernet/tree/master/examples
I've actually been referencing that!
I've only ported Ethernetclient
I'm definitely unfamiliar with working with sockets and this sort of thing. Right now, I can load up the IP in the browser, and the W5k grabs the data and appears to respond from the WSGI finish_response function. However the browser is saying the response was empty.
Another thing to note, I can only get the code to react to the browser connection if I hit refresh while it's still trying to connect.
Reasons why CIRCUITPY won't mount while BOOT & CP load is fine and REPL is fine?
I'm seeing more odd crashy-crashy on esp32s2 at the repl. ```Thread 1 received signal SIGTRAP, Trace/breakpoint trap.
[Switching to Thread 1073346540]
mp_load_method_maybe (obj=0x3fd8bbd0, attr=17, dest=0x3ffde690) at ../../py/runtime.c:1074
1074 } else if (type->attr != NULL) {
(gdb) p type
$1 = (mp_obj_type_t *) 0xffffffff
(gdb) where
#0 mp_load_method_maybe (obj=0x3fd8bbd0, attr=17, dest=0x3ffde690) at ../../py/runtime.c:1074
#1 0x4008403d in gc_sweep () at ../../py/gc.c:298
#2 0x40084221 in gc_collect_end () at ../../py/gc.c:397
#3 0x4009feec in gc_collect () at ../../main.c:549
#4 0x400844db in gc_alloc (n_bytes=<optimized out>, has_finaliser=false, long_lived=false) at ../../py/gc.c:570
#5 0x40083d8f in m_malloc (num_bytes=116, long_lived=false) at ../../py/malloc.c:81
#6 0x40087aa7 in mp_lexer_new (src_name=96, reader=...) at ../../py/lexer.c:828
I've just pasted in the text `import board, audiobusio` and hit enter (audiobusio is WIP in my branch). Maybe it's a problem in audiobusio.
it seems odd that I could already be in a "no free heap, need to GC" state
@cobalt grail https://learn.adafruit.com/adafruit-magtag Apologies if this was already linked to you.
@lone axle Did you order a MagTag?
@lone axle I did, just got the order shipped notification a little bit ago actually.
Excellent, I may have a mission for you. I'll let you know.
@lone axle I do. Your mission, should you choose to accept it, is to make the Adafruit CircuitPython Slideshow library work the same on the MagTag as other displays. MagTag requires display.refresh() to update to the next image, other displays to not. And you can't use slideshow.update() because of timing issues, you have to use slideshow.advance() which means auto_advance and dwell do nothing. I'll send you working code here in a minute, and you'll see how it doesn't quite match the simpletest.
I imagine it will involve something checking whether the display argument has a refresh option, and using it if so, otherwise ignoring it. But I'm tossing things out here, I don't know for sure. I trust you to figure something out.
I am definitely up for that. I have been tinkering in the SlideShow anyway. I am interested in extending it to allow text slides that can be configured with JSON files stored alongside of the images. So I am getting familiar with it's internals anyway.
@lone axle Perfect. That's excellent. I really appreciate it. Please keep @split ocean posted on your progress. I think the best way to go about it is to file an issue on the library, tag jedgarpark and keep him posted there. When you put in a PR, please request a review from him either using the request review mechanism, or by tagging him in the comment.
@lone axle
Will do.
Thanks @lone axle thanks @idle owl !
@lone axle one thing to note is that in the il0373 display setup you'll need to call seconds_per_frame to override the built in value of 180, which is a very conservative value meant to prevent people from refreshing too much and borking the display.
@slender iron my CircuitPython seems to have reset itself and erased all of my files. Do you know if there's a way to get them back?
Never mind, I just realized I made a backup of the libraries right before it happened
@analog bridge I think that similar code will cover both audiobusio and audioio but I'm not sure -- so far I haven't gotten anything working.
I'm starting with i2sout
what I understand from the idf is that the built-in DAC can also be controlled with i2s
The DAC channels can also be driven with DMA-style written sample data, via the I2S driver when using the “built-in DAC mode”.
from idf docs 👆
@gamblor21 just a reminder... it also should be removed from the feather_m0_rfm69 and feather_m0_rfm9x builds.
Thanks!
@onyx hinge I took a look at your audioout-esp32 branch. I like how you are handling the built-in idf errors.
Can you make a separate PR for the error handling change... I would like to use it on the modules I am working on at the moment.
@makermelissa Do you still see this with the same or different test conditions as @tannewt? This does not seem to be a showstopper for 6.0.0 any more unless you are doing something different.
Oh right. I'll check again.
@jepler could you make translate and try another push? I can put this in 6.0.0.
I just tried again and it's working.
@gamblor21 just a reminder... the frozen module should be removed from the feather_m0_rfm69 and feather_m0_rfm9x builds.
Thanks!
Ah thanks, I knew I missed something else. I'll do a search for all the frozen modules to make sure I get them all the next time.
@analog bridge good idea, and maybe it will allow me to feel like I made progress today
I have weird problems while trying to use the REPL. I found and fixed one thing but I'm still seeing problems.
I am building your audio branch now. Can you let me know at what point it fails.
so what I have locally is different than in the pushed branch. what I pushed had lots of compile errors.
and I've gone on to a tangent, which is this REPL problem
ooh.... yeah my build failed too...
@gilded cradle There's two boards here that probably shouldn't be - NeoTrellis M4 and Circuit Playground Express (even with displayio, it doesn't imply a built-in display?)
The CPX has a version with displayio built in for the Gizmo. I'm not sure about the neotrellis.
Fair enough.
Yeah, neotrellis should probably have it corrected
I think I had display because you could technically display stuff with the neopixels, but I suppose that's a bit misleading.
I get where you were going with it at least
but yeah. I would take it to mean the board has a display on it.
I'll submit a PR to remove that
Thanks!
Thanks for submitting this. Could you update the dimensions of your images so they blend in with the other images better. See https://learn.adafruit.com/how-to-add-a-new-board-to-the-circuitpython-org-website/preparing-the-images for more details. Thanks.
I'm really puzzled as to what's going on. It seems like sometimes, something splatters a bunch of memory with the pattern 07 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff and then everything goes wrong
I did switch my build config to "improve" debugging: ```+CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG=y
+CONFIG_COMPILER_OPTIMIZATION_DEFAULT=y
+CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y
I wrote this code for audioio but that's not ready for inclusion, and @microdev1 says it would be useful in their work.
@onyx hinge those settings would be good to have in the debug sdkconfig
assuming they're not what's making things flaky for me I agreee 🙂
@slender iron Ok, I'm going to pause a current task. and open up notes
kk
Thanks! @jepler. One question, what parameters are you using to categorize an error of type ESP_ERR_ to be eligible for inclusion.
ncie! i was just thinking about a project that would use NVM to track state between deep-sleep :)
Tweaked it slightly and seems to run fast now and will check if the first test fails
@ladyada Dan and I briefly discussed adding sleepio.memory that would act like nvm but be memory that is preserved. That could be an alternative.
One benefit of using RTC mem which is kept on during deep sleep is that it will prevent wear on flash.
@idle owl regarding flashing a metro_esp32s2 -- on my Linux system I have always been able to flash it at /dev/ttyACM0 not /dev/ttySx
^ same for me on linux
@solar whale Hmm. Alright. Thanks Jerry, and @lone axle. Tim - do you mind updating the guide to include both?
Nope I can do that.
Beautiful, thank you.
Hi @cwalther,
I have a pretty simple use case, my supervisor calls are as follows:
supervisor.set_next_code_file(scriptName, reload_on_success=True)
supervisor.reload()
For me, I prefer the VM not running my menu system (code.py) when the secondary script raises an unhandled exception. I am developing a factory test fixture, so leaving error information on the screen is preferential. That said, for commercial products it may be preferential to reload the original code....
Trying to setup Sparkfun's MicroMod has resulted in a "Invalid Pins" error when setting up the SPI Flash. It appears that the MicroMod uses a different pinout for the second SPI bus?
I've checked against the Samd51 Thing Plus, and the schematic released by Sparkfun. It seems all for pins are different for the MicroMod from the Thing Plus? Not sure where to proceed from here...
Additional details from the Sparkfun Repo to show the pins used:
@microDev1 I think that any error that would plausibly arise from user code we would want to include. I just did the ones in the "main" error header, esp_err.h.
Bump from me too!
MicroPython 1.13 was released in September, and the walrus assignment operator is very handy for tidy code.
- Initialize the EPaper display on the MagTag at start.
- Tweak the display send to take a const buffer.
- Correct Luma math
- Multiply the blue component, not add.
- Add all of the components together before dividing. This
reduces the impact of truncated division.
- Add
.busyproperty for when the EPaper display is refreshing.
Looks good to me! Is there more you want to add?
@wifijt This sounds like the pin mapping is wrong. Does it work if you treat D3 as D4 and vice versa?
@slender iron At this point I think I will do rc.2 and defer 6.0.0 final until Sunday or Monday, because doing it tonight is like releasing it tomorrow, and that only gives us a day or two before the weekend if issues crop up when a lot of people upgrade.
kk, works for me
roger
Please PR to main for the new board. ESP32-S2 boards should continue to use pre-releases that are done from main. You don't need to re-open PRs when updating it either. The PR will update with your branch. See here for a tutorial that goes over our GitHub workflow: https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github
@MaxMcKinney Yup! It should be fixed in 6.0.0-rc2 or 6.0.0 when we release it.
Thanks! I pushed a "make translate" to finish this off.
Thanks for this! Would you mind using a subclass of OSError instead of OSError itself? That way we can differentiate a bit more. There is an example with the espidf.MemoryError already.
We have a special subclass of MemoryError for this already: https://github.com/adafruit/circuitpython/blob/main/ports/esp32s2/bindings/espidf/__init__.c#L68
Are you thinking just one additional class for any esp error? if not, can you let me know what classes you're looking for?
#define CIRCUITPY_INTERNAL_NVM_SIZE (20 * 1024)
What is the "CPY" here?
Should we make this dynamic based on the partition table? Then we can just make this an enable.
Looks like additional functions in the other ports need to be constified. Other than that, looks good -- good catch on the luma error.
Thanks for working on the release Dan!
Still fails for some architectures.
More significantly, the current version does not convert output to big endian. I have a fix in a few days.
It appears that this is ONLY related to OneWire. If I treat the D3 and D4 as inputs and outputs they are mapped correctly. When I scan with onewire it is always opposite of what I am attached to: Connected on D4 - scan D3 and it finds the DS18B20 - Connect on D3 scan D4 and it finds the DS18B20 - scan the pin you are on: connected D4 scan D4 you get too many results (I've increased the max results and I get a return of a bunch of results but no DS18B20)
Automated website update for release 6.0.0-rc.2 by Blinka.
all: I'll finish the 6.0.0-rc.2 release first thing in the morning: there was a backlog of GitHub actions.
Is there any way to create a web server on the esp32s2?
@rigid birch not yet. socket needs bind and accept (?) I think
And the FX29 documentation certainly leaves room for improvement. Here is the documentation for the I2C controller that is in it.
I think the actual controller inside is ZSC31014.
The diagrams in the FX29 appear to be a slightly photoshopped ones from the ZSC31014 datasheet.
ZSC3101...
@tulip sleet Should the main branch now be at 6.0.0-rc.2? I just did a pull/build and it reports rc.1 and there are significant diffs from 6.0.0-rc.2 ```
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 6.0.0-rc.1-247-ga47dea492 on 2020-11-12; FeatherS2 with ESP32S2
Prior to this PR the pcnt unit would not reset on reload of user code.
I've also added a few more aliases for them.
Another change is that DynOSSAT-EDU-EPS now comes with the I2C Peripheral module enabled, because it's important for an use case (reading voltage/current data from the on-board computer).
What's the distinction of an exception like this (PyPortal, rc.1, ESP32SPI 3.5.3, Requests 1.7.5): File "adafruit_requests.py", line 476, in _send _SendFailed:Do I handle it like any other?
@solar whale There's a 6.0.x branch we made a while ago, which has the most recent ``6.0.0-*tags. This branch is not on main, and we've merged changes from6.0.xback to main a couple of times. This was to keep the6.0.0` releases mroe stable.
@tulip sleet ah -- thanks -- so 6.0.x is now at rc.2
right, exactly, but I haven't updated circuitpython.org yet because last night the build links would have been broken becuase of the delays in building.
i just started working and will be doing that now.
no problem -- and whenever the next merge to main occurs, then main will move to rc.2 as well --Not a request from me, just want to make sure I follow the process.
the tags are on particular commits, so main will be caught up with the the rc.2 changes, but the tag itself will not show up on the main branch, since it will be a merge commit, and that exact commit will not also be on the main branch.
When i first learned git, I found this book to be very helpful, in particular chapters 2 and 3, which explain branches, commits, etc. clearly (I thought): https://git-scm.com/book/en/v2
Thanks!
My confusion was that main now shows a rc.1 in the output of the boot_out.txt file Adafruit CircuitPython 6.0.0-rc.1-247-ga47dea492 on 2020-11-12; FeatherS2 with ESP32S2 -- I assume that will change to rc.2 if/when 6.0.x is merged to main, correct?
I think so, the version tag goes back along the tree and finds the nearest tag, but that may be back along another branch that wsa merged in. The gitk tool's graph can be helpful.
Thanks. This is not important -- I should stop distracting you ...
I am just reading mail, etc.
np
In particular, if you think the book is really helpful, we could add a reference to it in the git guide.
there are probably videos that are equally helpful for those who like learning from videos
OK -- I'll let you know what I think after reading it.
@solar whale I'm curious because I'm about to try it - have you tried POST'ing to the IO HTTP API using the ESP32S2 yet?
also @crimson ferry
@prime flower I have not. Good luck!
ok! thanks
I have not either
@slender iron Might be good for your deep dive tomorrow!
We're ready to rock.
Added a Tindie link to purchase the kit and set the hardware repos to public.
@tulip sleet are you around?
yep
I'm trying to get a circuitpython program to run on Cpython, and it says I'm missing the RTC module
do you know how to get around that, perchance?
i guess we don't have a blinka impl of it yet. It's not very complicated, so you could just add an rtc.py that does what it needs to do (or maybe nothing, if the idea is to set the time, but of course a blinka host usually already knows what time it is)
Actually no wait I'm dumb, I think it probably only works with Scott's version, not one I install with pip
This is an even dumber question, but if I want to use a python module that's in a parent directory, say an project/examples/script.py accessing a project/module.py, is there a quick way to do that?
Hi all ! I've made some modifications in Adafruit_CircuitPython_WSGI (status 404 and 500, OPTIONS handling for CORS requests) and adafruit_esp32spi_wsgiserver.py (parse_headers implementation), so that wsgi server is usable on a MatrixPortal. This allows me to push images to the MatrixPortal from a web app. Who should I coordinate with to discuss them and try to put them in those libraries ?
you can use a leading dot in an import, I think, import ..foo goes up two levels. I found it a bit cantankerous
hmm, it didn't like that
@sacred blade Sounds neat! Open an issue on the appropriate library(ies), or just submit a PR.
@ionic elk it has to be part of the same package, and I don't think the examples are in the same package. If you've installed the library, then you can copy the example to a top level
@tulip sleet ok, thanks !
I'll poke Scott about it when I see him
not hard to just copy the module into the examples folder
the idea is the the examples would not be in the examples directory, you wouldn't be running them from there. They would get copied into your current directory, and the library would be installed via pip. It's really that sys.path is set up properly to find everything. You could set PYTHONPATH
It's not a big deal I was just wondering if there was some super easy way
I'm still at the stage of learning python where I keep finding things save tons of time and feel embarrassed for not having known about them.
Thanks for adding these. I was having trouble finding images/info. Would you mind shrinking down the large dynossat_edu_eps.jpg image? It's currently at 2948x2268. The rest of the images sizes are perfect.
@tulip sleet 🔥
@tulip sleet 🎈 hurray, I just got it from S3 and tossed it onto my esp32s2
Hey! I have a supernoob question. I am running the beginner tutorial with Matrix Portal. When I leave the code as it is, the led is turned off, and the NeoPixel goes green-yellow-blinkingBlue, and code changes do not affect this behavior. I checked pinouts, and I found out that it should be called board.NEOPIXEL in line 5th, but then it just lights steady on green. Code does what it should only on the tiny led, when I will call it board.L in line 5th. What I do wrong that I cannot access neopixel even if I call it as it should be?
Of course, it seems I misplaced the "original" size in the "large" folder. Should be fixed now.
Thanks!
@timber mango NeoPixels are different than basic LEDs, like the one on board.L, so would need different code
Aaa, ok, thanks. I need to go deeper into it then.
check this out for the neopixel case:
https://learn.adafruit.com/circuitpython-essentials/circuitpython-neopixel
for the on board neopixel, use board.NEOPIXEL and set the length to 1
Ok, cool, thank you!
There are SO many CircuitPython boards now, we're going to need more filters on circuitpython.org, like maybe chip family or key features ...oh, never noticed that slider before
also, as you read stuff, if you find references to "dotstars", those are like neopixels but require a different library
Thank you for helping me 🙂
np
It works, haha.
@timber mango the gist with Neopixels is you're actually sending them instructions, rather than just turning them on and off, so you have to use libraries that handle that for you
makes them super useful when you have big arrays of them, because you don't need so many wires, but you wouldn't be able to use one in a handmade circuit, you gotta have a microcontroller
Yeah, I am reading now about it. I found even some libraries which do all kinds of stuff. I installed CP like hour ago, and I am just having enormous amount of joy staring in the blinking diode I can talk to directly 😄
it's a fun time!
@solar whale I expect main to build as 6.1.0-alpha.0 but the merges from 6.0.x may override that
@ionic elk env PYTHONPATH=. python examples/requests_https_cpython.py The env is a fish thing. I think in bash you omit it.
@slender iron Now that you mention it, I think it was building as 6.1.0 at one point, but now is back to 6.0.0-rc.1 due to merges from 6.0.x
@slender iron @analog bridge should IO0/1/2 pins be good general choices while testing I2SOut on this Kaluga or might they interfere with other functions? I see what is mostly a good I2S waveform, but sometimes it is glitched
glitchy (including nonsense data out)
@slender iron can you comment on what this stuff is? Did you write it? I don't see anything like it in the UDP examples ESP provides.
const struct addrinfo hints = {
.ai_family = AF_INET,
.ai_socktype = SOCK_STREAM,
};
struct addrinfo *res;
int err = getaddrinfo(host, NULL, &hints, &res);
if (err != 0 || res == NULL) {
return mp_const_none;
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-align"
struct in_addr *addr = &((struct sockaddr_in *)res->ai_addr)->sin_addr;
#pragma GCC diagnostic pop
char ip_str[IP4ADDR_STRLEN_MAX];
inet_ntoa_r(*addr, ip_str, IP4ADDR_STRLEN_MAX);
mp_obj_t ip_obj = mp_obj_new_str(ip_str, strlen(ip_str));
freeaddrinfo(res);
@slender iron Only if you or others need it -- Now that I understand, it does not matter to me....
Does it actually do anything? The only other difference seems to be that because the socket is made beforehand, we don't run the socket allocation functions. Does inet_ntoa_r or any of the other stuff impact something behind the scenes that would affect the socket?
@onyx hinge 🤔 ....will have to take a look at the datasheet/technical reference manual for that.
@analog bridge if you know some that are going to be safe I can just switch
Does it actually do anything? The only other difference seems to be that because the socket is made beforehand, we don't run the socket allocation functions. Does inet_ntoa_r or any of the other stuff impact something behind the scenes that would affect the socket?
@ionic elk It's converting an ip address byte array to a string
I think it originates in micropython's socket
What should I do with the string?
make sure and look in ipaddress for helpers too
@onyx hinge I saw 13, 15 & 21 being used in the idf's i2s example.
right now it doesn't seem like it does anything with it
@analog bridge good clue, maybe I can just do that
if it's code I added, it's likely incomplete
I'm just trying to figure out whether I need to keep it - the sendto and recievefrom functions don't need a string like that, but do I need to do some post-processing after that maybe?
where did you run across that code @ionic elk -- I see it in common_hal_socketpool_socketpool_gethostbyname
I suspect the python version of sendto takes in a string ip and receivefrom returns one
@onyx hinge I'm working on the functions that UDP needs, sendto and recievefrom, based on one of Tannewt's branches
ah yeah it is returned from recvfrom
@slender iron so why doesn't the sendto function need it as a parameter 🤔
sendto: needs to convert an address string into an address
oh no wait probably I need to replace HOST_IP_ADDR with it
recvfrom: needs to convert an address into an address string
that's what it is
someone want to review https://github.com/adafruit/circuitpython/pull/3681 for me?
that's just some macro from the example code that made it over
I'll tag another 6.1 alpha after
urp there's a conflict tho
yeh pot conflict
ya, stupid translation file
hehe the conflicts and the "make translates" are aggrivating but it's such a great feature to have
ya, agreed
(also, you said it -- not me)
I think I fixed this last time by changing the last updated time back
I mean all it conflicts on is the created date of the danged translation
which is kind of silly
I'd still lean towards just scrapping that line altogether
I think that's easier said than done
Oh is it not one of our scripts? too bad
CPY (short for CircuitPython) is the namespace.
From esp-idf:
To mitigate potential conflicts in key names between different components, NVS assigns each key-value pair to one of namespaces, a handle is associated with a namespace, and key names will not collide with same names in other namespaces.
maybe it is actually. weblate only updates .po files
we could blank it in make translate
☝️
ya, new PR to 6.0.x to change the translation creation time
yay did figure out one more thing about the i2s failing after awhile
I had a range of bytes start..end of audio data .. I sent bytes starting at "start", then incremented end by the number of bytes sent
@tannewt Yes... I have to figure out a way to differentiate between RAISE & RESET modes in esp_task_wdt_isr_user_handler(void) which is called on watchdog interrupt.
@slender iron want to entertain a change to remove the POT-Creation-Date from circuitpython.pot?
just looking at it now
ah ok
- find $(TRANSLATE_SOURCES) -type d \( $(TRANSLATE_SOURCES_EXC) \) -prune -o -type f \( -iname "*.c" -o -iname "*.h" \) -print | (LC_ALL=C sort) | xgettext -f- -L C -s --add-location=file --keyword=translate -o circuitpython.pot -p locale
+ find $(TRANSLATE_SOURCES) -type d \( $(TRANSLATE_SOURCES_EXC) \) -prune -o -type f \( -iname "*.c" -o -iname "*.h" \) -print | (LC_ALL=C sort) | xgettext -f- -L C -s --add-location=file --keyword=translate -o - -p locale | grep -v 'POT-Creation-Date' > $@
we can change xgettext to omit the header
find $(TRANSLATE_SOURCES) -type d ( $(TRANSLATE_SOURCES_EXC) ) -prune -o -type f ( -iname ".c" -o -iname ".h" ) -print | (LC_ALL=C sort) | xgettext -f- -L C -s --add-location=file --keyword=translate -o [-circuitpython.pot-]{+-+} -p locale {+| grep -v 'POT-Creation-Date' > $@+}
I don't think we can omit the whole header
--omit-header
if only because > Note that using this option will lead to an error if the resulting file would not entirely be in ASCII.
well I guess maybe circuitpython.pot is completely ASCII, but the other po files are not
where is that from?
GNU gettext utilities: xgettext Invocation
the header's content type is currently CHARSET
if the manual timestamp edit is the easiest way to resolve this problem right now I can go ahead and approve that other PR .. want me to?
ya, you cand just remove that specific header
yes please
we can fix the larger issue later
Fine to do if it's the shortest path to a clean merge up to main, but let's find a better way
sounds fine to me
I agree omit header is too big of a stick
so you can add the strip to the command if you like 🙂
I'm too deep in other stuff to push this right now, but maybe if you're lucky i'll push it by accident with my i2sout changes ☹️
The glitches followed the pins, hm
@onyx hinge may be worth posting to the esp forum
the very short high pulses should not be there, in my understanding of i2s. but it may just be induced by the other edges or something
usually I don't see these when scoping logic with the saleae
is it just noise? does it work?
`import board
import displayio
import framebufferio
import rgbmatrix
import terminalio
import pulseio
displayio.release_displays()
matrix = rgbmatrix.RGBMatrix(
width=64, bit_depth=4,
rgb_pins=[
board.MTX_R1,
board.MTX_G1,
board.MTX_B1,
board.MTX_R2,
board.MTX_G2,
board.MTX_B2
],
addr_pins=[
board.MTX_ADDRA,
board.MTX_ADDRB,
board.MTX_ADDRC,
board.MTX_ADDRD
],
clock...
I haven't hooked up a real i2s decoder/audio amplifier yet, but saleae's decoder seems to think it's okay mostly
but not always
I'd suggest doing so before you worry too much about it
sure, but that sounds like work
it'll save you from chasing a bug that doesn't matter in the end
true
I'm just glad I have anything coming out at all, it felt like a long ride to get here
I had some stuff like that on the Neopixel issues
but I'm getting the hang of esp-idf a little bit
@analog bridge If you're interested, this is pushed to my github (branch audioout-esp32) and here's my sample program which doesn't generate a very good audio signal anyway: https://gist.github.com/3a3a2c2b482205014bb2dcd15ab8e298
@jepler Ya, one to start with in addition to the existing MemoryError. We can subclass the IDFError exception in the future if need be.
@onyx hinge great! I was about to ask you the same... will give it a try tomorrow.... its sleep time for me 💤
I forget if i2s is signed or unsigned
logic seems to be acting like it's unsigned
yeah it's not exactly sleep time but it is time for a good long break
I was running code to fetch bitcoin and came across this mysterious error.
Traceback (most recent call last):
File "code.py", line 82, in
File "code.py", line 74, in
File "/lib/adafruit_requests.py", line 585, in get
File "/lib/adafruit_requests.py", line 563, in request
File "/lib/adafruit_requests.py", line 423, in _get_socket
OSError: 0
Ah! I see. For each byte this code stores "CPY" and the index as a string. How about only using one key for a whole range of bytes instead? That will reduce the overhead dramatically.
nice thought but I don't think that we will be changing the partition table that often
Ok cool, will do next time.
@jepler Does this make you think of anything suspicious?
What version of CircuitPython are you using? Are you adding the MicroMod as a board to CircuitPython? Please link me to the code you are using to test with. Thanks!
This is very weird because OneWire is bitbanged using DigitalInOut under the hood: https://github.com/adafruit/circuitpython/blob/main/shared-module/bitbangio/OneWire.c
@hearty tapir any more TLS progress? I'm going to look this afternoon
Updated to correctly output binary in big endian format.
Verified with round-trips c-python -> circuitpython -> c-python: https://github.com/iot49/iot-notebooks/blob/main/tests/msgpack.ipynb.
Tests are fairly comprehensive, except big data structures (due to memory limitations).
- Namespace identifiers (strings) are stored as keys of key-value pairs in namespace with index 0.
- Each key-value pair belongs to one of the namespaces. Values corresponding to these keys are indexes of these namespaces.
+-------------------------------------------+
| NS=0 Type=uint8_t Key="wifi" Value=1 | Entry describing namespace "wifi"
+-------------------------------------------+
| NS=1 Type=uint32_t Key="channel" Value=6 | Key "channel" in namespace "wifi"
+---...
Guido van Rossum, the creator of the Python programming language, today announced that he has unretired and joined Microsoft's Developer Division. From a report: Van Rossum, who was last employed by Dropbox, retired last October after six and a half years at the company. Clearly, that retirement wasn't meant to last. At Microsoft, van Rossum says, he'll work to "make using Python better for sure (and not just on Windows)." A Microsoft spokesperson told us that the company also doesn't have any additional details to share but confirmed that van Rossum has indeed joined Microsoft. "We're excited to have him as part of the Developer Division. Microsoft is committed to contributing to and growing with the Python community, and Guido's on-boarding is a reflection of that commitment," the spokesperson said. https://techcrunch.com/2020/11/12/python-creator-guido-van-rossum-joins-microsoft/
I think scott hanselman is in the developer division too
Microsoft is eating everything again
The Circuitpython page for NeoTrellis M4 says: "The native USB port can turn it into a MIDI USB device if you like - currently that’s only supported in Arduino." But the built-in modules include usb_midi. Can I expect MIDI to work on the NeoTrellis with 6.0.0-rc.2?
ya, I believe so
that text may predate when I added midi support
you can also look for learn guides that use it
you can also look for learn guides that use it
@slender iron Not sure I saw any... the sequencers were Arduino based I think. But I'll look again and then just go ahead and try it.
We can have a single NS , KEY and store the data in an array addressed by the index. Basically having our own mapping inside NVS.
BUT than we won't have wear levelling.
From esp-idf:
NVS works best for storing many small values, rather than a few large values of the type ‘string’ and ‘blob’. If you need to store large blobs or strings, consider using the fa...
The esp32s2 circuitpython wifi stuff is really good! thanks to those who worked on it 🙂
I'm not sure if it was a fluke or not. But I also saw this error several times on the UM Feather S2 pulling from Hackster news API. Running the same code on Metro ESP32S2 I never ran into this error at all.
Even on the Feather S2 it was not consistently this error though, many of the requests still succeeded. So it's possible I just got "luckier" on the Metro.
Right, the code ran for a while before I noticed it was stopped on this error.
Ok, I've gotten the connection to work but I'm not sure what the best fix is currently. It looks like the issue is that the root certificate is signed with SHA-1 which mbedtls doesn't support by default. I'm digging into why the nina-firmware doesn't have the same issue.
io.adafruit.com and api.thingspeak.com both use DigiCert root CA's that are fingerprinted with SHA-1.
probably it's been noted before, but the certs for io.adafruit.com and api.thingspeak.com are both wildcards
In a debug build
ESP_ERROR_CHECK failed: esp_err_t 0x106 (ESP_ERR_NOT_SUPPORTED) at 0x4002f190
file: "common-hal/wifi/__init__.c" line 147
func: wifi_reset
expression: esp_netif_deinit()
abort() was called at PC 0x4002f193 on core 0
Setting breakpoint at 0x400304fa and returning...
It appears esp_netif_deinit() never succeeds:
esp_err_t esp_netif_deinit(void)
{
if (tcpip_initialized == true) {
/* deinit of LwIP not supported:
* do not deinit...
Should I be scared that this is marked as a Long term milestone...?
Having removed this call, the second call to esp_event_loop_create_default fails
ESP_ERROR_CHECK failed: esp_err_t 0x103 (ESP_ERR_INVALID_STATE) at 0x4002f190
file: "common-hal/wifi/__init__.c" line 98
func: common_hal_wifi_init
expression: esp_event_loop_create_default()
Closes #3688
With this change, I don't get the ESP_ERROR_CHECK failed repeatedly running code that imports wifi. (I'm not getting a successful connection but that's probably my own fault, such as a secrets problem)
Testing performed: In a debug build on kaluga, repeatedly ran a test program which does import wifi:
import ipaddress
import ssl
import wifi
import socketpool
#import adafruit_requests
# URLs to fetch from
TEXT_URL = "http://wifitest.adafruit.com/testwifi/index.html"
JSON_QUOTES_URL = "https://www.adafruit.com/api/quotes.php"
JSON_STARS_URL = "https://api.github.com/repos/adafruit/circuitpython"
# Get wifi details and more from a secrets.py file
try:
from secrets im...
With this something else is still wrong with my debug builds -- adding DEBUG=1 to the Make environment AND making the following changes in sdkconfig-debug.defaults:
+CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG=y
+CONFIG_COMPILER_OPTIMIZATION_DEFAULT=y
+CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y
but www.adafruit.com is also a wildcard and it works, which casts doubt on the wildcard theory.
Both io.adafruit.com (test result) and api.thingspeak.com (test result) get a warning on ssllabs: "Chain issues: Contains anchor". [www.adafruit.com (test result)](https://www.ssllabs.com/ssltest/analyze.html?d=www.adafruit...
Fast performer is this:
adafruit-circuitpython-espressif_saola_1_wrover-en_US-20201027-563a893.bin
import ecp5f;ecp5f.flash("sdbridge25f.bit",0x200000)
102400 bytes uploaded in 1701 ms (60 kB/s)
4K blocks: 25 total, 0 erased, 0 written.
True
import ecp5f;ecp5f.flash("sdbridge25f.bit",0x201000)
102400 bytes uploaded in 8098 ms (12 kB/s)
4K blocks: 25 total, 24 erased, 24 written.
True
This one is 2-3x slower:
adafruit-circuitpython-espressif_saola_1_wrover-en_US-20201113-8...
Has anyone implemented e1.31 aka sACN aka artnet aka DMX over IP? Got a few matrixportals and would love to set these up as display panels for that. (Non CP solution would work too, haven't found that either)
I'm working on porting the ESP WSGI to the Wiznet W5k. So far I'm able to communicate and load pages, but I'm having issue with loading larger pages. I'm seeing issues with pages 2047 bytes and longer where I either lose large portions of data or get erroneous data prepended. It smells a lot like an allocation/reuse problem with that 2047 number, but I'm this might ring a bell for someone here about what the root of the problem is.
@tannewt the SHA-1 "theory" is something that I reviewed, but made a mistake by not looking at the same detail for the Root CA. Thank you for pointing this out. I'd like to suggest to make a parameter available that hands the option to the user to not verify the certificate. I say that not because I don't want to fix the original issue, but often in "homelab" you'll have self-signed certificates that otherwise will create an almost "impossible to fix" entry-level-barrier to new users - unless...
Ah nevermind, just figured it out. For anyone curious it was that the chunk size in the "SimpleWSGIApplication" class was too large (8kB). I forgot the W5K sockets are defined as 2kB.
@prime cove did you end up needing to add a server class to the W5k module?
I've mostly just re-used the esp32spi WSGIServer class. I haven't had to do too much new with the W5K, just set a socket to listen.
There's definitely changes in the wsgiserver file I've made, though it might have more with me still learning about using sockets. Might be a case of it works in this situation, but isn't the smart or reliable way of doing it.
Can you please be more specific? Were these examples run one after another? Please provide a test case that uses busio.SPI directly.
Running a python library will have a lot of variation in timing. We make no promises that the timing of python is consistent.
It is not a high priority for us. If it's something obvious to someone who sees the issue, then we'll fix it. Otherwise, it'll have to wait until someone can look deeper into it.
Let us know if you'd like to help debug it.
Those examples are run in succession one after another.
My concern is that this project works fast enough
https://github.com/emard/esp32ecp5/tree/master/circuitpython
it turns on and off SPI to make it a JTAG, this is performance
that I need fast. Not just SPI alone, this runs great.
Above mentioned run is done one after another,
and it is considered fast 60KB/s when reading/verifying,
19KB/s when writing flash.
Latest circuitpython perform slow, about 20KB/s reading/verifying
and 6KB/s wr...
diff --git a/include/mbedtls/config.h b/include/mbedtls/config.h
index f7e55aef5..aa8a28aeb 100644
--- a/include/mbedtls/config.h
+++ b/include/mbedtls/config.h
@@ -3319,7 +3319,7 @@
* on it, and considering stronger message digests instead.
*
*/
-// #define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES
+#define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES
/**
* Allow SHA-1 in the default TLS configuration for TLS 1.2 handshake
Indeed, this ch...
@lone axle updated and added some info to displayio guide, want to take a look?
https://learn.adafruit.com/circuitpython-display-support-using-displayio/display-and-display-bus#boards-without-built-in-displays-3077571-21
@slender iron would like to chat with you at some point about displayio stuff if possible. totally not urgent. just related to updating the guide.
k, I can now. just need to close the door
k, and I need to like get a mic and stuff....
kk
looks like mic only right now - i'm using browser
np
want to jump into a voice channel?
@timber mango i saw this project on github that looked interesting https://github.com/forkineye/ESPixelStick
It supports e1.31 using an esp8266.
@onyx hinge the outstanding question I have is why nina-fw is ok with io
it doesn't have SHA1 enabled as far as I can tell
does nina-fw also use mbedtls?
yup
wildly different esp-idf version?
3.3.1
it uses mbedtls directly while we use it in cp via esp-tls
mbedtls_x509_crt_init(&_caCrt);```
this is the "right" way to do certificates
it's not what esp-idf does, at least in the one in circuitpython
what is wrong about esp-tls?
@tidal kiln I'll be tied up still for a while today. But I'll take a look later on tonight, thanks for working on that!
@lone axle no worries. whenever you get a chance is fine. thanks!
It calls mbedtls_x509_crt_init(&s_dummy_crt); instead (components/mbedtls/esp_crt_bundle/esp_crt_bundle.c)
* cacert_ptr passes non-NULL check during handshake */
static mbedtls_x509_crt s_dummy_crt;
and then certificates are "verified" in esp_crt_verify_callback which ends up having slightly different semantics
there are 5 calls to mbedtls_x509_crt_init in ports/esp32s2/esp-idf/components/esp-tls/esp_tls_mbedtls.c
I assume those are the ones we're actually hitting
specifically, if the website sends a chain A->B->C, B is in the CA Cert, and C uses SHA1 then mbedtls will stop at B and doesn't care about C. But if B is NOT in the CA Cert then it continues on to C.
right
I think I have it configured to use the same roots certs as nina but still have the same issue
I also don't see the intermediate certs (B) from io in https://hg.mozilla.org/releases/mozilla-beta/file/tip/security/nss/lib/ckfw/builtins/certdata.txt
Content of security/nss/lib/ckfw/builtins/certdata.txt at revision 571d92717751e6e31f030f4bc8b9e62f0a6a72f7 in mozilla-beta
the firefox certs I think
I meant mbedtls_ssl_conf_ca_chain
Looks like it needs another make translate.
I'm confused why you are looking in esp-x509-crt-bundle. My understanding is that code is for generating the cert bundle. The esp-tls component is doing the connection management with mbedtls.
@slender iron I'm looking at esp-x509-crt-bundle because on desktop systems mbedtls gets the "B" cert in the chain as being trusted and on esp32 no cert in any chain gets "trusted" within x509_crt_verify_chain
can we voice or video about this?
I'm not seeing the connection between x509_crt_verify_chain and crt-bundle
Please take another stab at it. As-is, it won't work like a continuous memory array.
We don't have wear leveling for other things and haven't had a problem. I'm ok with you doing separate keys internally. However, doing the key based on start index isn't correct because the value stored can be multiple bytes long. This could lead to different keys with overlapping values.
@slender iron sure jas
@slender iron Should I ditch NVS for the NVM support on s2 ?
or should I modify it to not use start_index for key values ?
@onyx hinge I pulled your audioout-esp32 branch today....
I wanted to test built-in dac control using i2s but it doesn't seem to be supported on the s2.
will be doing further testing tomorrow...
@analog bridge yeah I started with "proper" i2s
@slender iron when you get a chance:
https://learn.adafruit.com/circuitpython-display-support-using-displayio/display-and-display-bus#releasing-displays-3077572-24
seem ok?
@slender iron the esp-idf internal format for certificates is different than both DER and PEM, too
more compact (substantially, I think)
$1 = 312``` plus the actual content like subject name and so forth
I am now working on this and revising the API toward the revised example above. I am making some changes, and I have some suggested changes that I would welcome comments on:
- I renamed
sleepioto justsleep, because an alarm is not necessarily pin-based. We have a lot of*iomodules, but not all are (e.g.rtc). sleep.reset_reasonandsleep.last_wakerequire that the module dictionary be in RAM rather than flash, since their values change. We don't do that much: I think t...
This allows CircuitPython on ESP32S2 to successfully connect to io.adafruit.com, like standard browsers and desktop https clients like openssl s_client, curl, and mbedtls ssl_client2. This problem...
Converts PEM and DER certificates to a custom bundle format which stores just the
subject name and public key to reduce space
The bundle will have the format: number of certificates; crt 1 subject name length; crt 1 public key length;
crt 1 subject name; crt 1 public key; crt 2...
This is from the python script that generates that x509 bundle while you compile/build.
yeah
I don't know if that can be turned back into the form needed to do "proper" certificate validation how mbedtls would like
so changing the esp-idf "validate, but late" code to paper over the problem seemed more tractible
Did you exchange your cacert.pem with the latest one from https://curl.haxx.se/docs/caextract.html before building?
not sure what fix or workaround we should employ for now, it may need to be discussed in the weeds on monday
I don't think that would make a difference.
It is 135 vs. 138 certificates. That is all
DigiCert Global Root CA is in the ./components/mbedtls/esp_crt_bundle/cacrt_all.pem
the certificates being used by esp32s2 builds
incidentally it appears that esp32s2's ssl implementation can't notice that a root certificate is expired. maybe for the best in a hard to update iot product.
my brain is full, see y'all this weekend or monday 🙂
It is not compiled in
I think that would be the setting, but that would require your clock to be correct. 😉
I mean, the "custom bundle format" doesn't include the validity times of the certificate
"The bundle needs to be sorted by subject name since binary search is used to find certificates" is from esp_crt_bundle.h
@jepler Want to switch circuitpython to your IDF branch until it is integrated upstream? I think this is the right fix.
Is there a (relatively easy) way to dedicate some space as writeable by code insdead of USB? Unexpected Maker Feather S2 storage is so roomy, I'd love to dedicate a few mb of space that I can download stuff to for caching.
Other than making a big NVM chunk (which I don't think is optimized for that kind of storage), and I don't know about easy but the IDF does have facilities for FAT or SPIFFS filesystems (I did a dropbox-like thing in Arduino on ESP32 that updated files in SPIFFS from SD).
I'd love to have that, a second volume that would be writable from CP, and mounted as read only on the computer, so you have the code on the regular volume, and save logs and status and whatnots to the other one
especially when running a server on the board for exemple (once that's a thing)
Looks good to me! Is there more you want to add?
This re-points the submodule to my personal fork of esp-idf. Users may need to git submodule sync in their existing trees when
this change occurs.
Adds just the following commit in esp-idf:
esp_crt_bundle: Allow verify_callback to correct BADCERT_BAD_MD
This change has also been submitted upstream at esp-idf: https://github.com/espressif/esp-idf/pull/6117
tested, - board comes up with display existing and color images look good 👍

@lone axle hihi i fixedup the slideshow for epd if you'd like to review
Nice! I will a look. Mine is scheduled to arrive today so I can test it out once the UPS fairy visits.
thank u! im around some of today so if you have q's i can help
i wrote a bunch o examples
@meager fog if hasattr(self._display, "refresh"): will return true on non-epd screens also I think? do we want to avoid refreshing on ones that don't need it?
if so maybe it can check auto_refresh instead
@lone axle dunno i dont think so? and if so, thats fine
we should probably force a refresh after updating the image
I've been playing with a MAgTag and metro_esp32s2 - Both work fine when I flash CircuitPython to them but neither seem to be able to run an Arduino Sketch. I can build/load the Arduino sketch with no problems, but when I press reset... nothing happens. Is it possible that loading CP does something to be Bootloader that prevents the Arduino sketch from executing?
@solar whale try disabling PSRAM in arduino dropdown
hmm -- disabling PSRAM did not help
what ar eyou uploading, simple blink?
can you look at the output of the TX pin on the magtag
u'll need a usb-serial converter
ok yay yeah, it broke a day ago...i will warn arduino is very very difficult
a lot of things broke
i really dont recommend arduino
especially w/o debug output watching
No problem -- just wanted to make sure it was not something I did --now that blinky works -- I'm happy -- back to CP...
yeah
Any tips to make adafruit_esp32spi sockets more robust ? I've upgraded the firmware to the latests version, using CPY 6.0.0-rc.2 with latest lib bundle. I'm listening on an UDP socket (to receive DMX packets), on can't get more than 30 seconds of continuous updates before "RuntimeError: Timed out waiting for SPI char". Or any way to recover from this (I'm doing a reset + reconnect but it's very slow ;-)) ?
I really liked the "countdown" demo for the MAGTAG!
I had the same kind of errors when using the wsgi server...
@sacred blade we hvaen't done a ton of UDP with esp32spi - TCP is nice and solid
we also did a lot of refactoring. if you have a good repeatable example, you can submit an issue - we tend to focus on TCP/SSL client work
if you have PR's we're always looking for help
@meager fog Ok, i'll check if the wsgi errors have been fixed with the latests upgrade, and submit an issue if not... Regarding PR's, there is https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI/pull/115 waiting...
thank u 🙂 what example is best to test it?
I've used it on a wsgi server for an app allowing to send pictures to the matrix portal, but it should make the exemple ( wsgi_simpletest.py ) on Adafruit_CircuitPython_WSGI usable again. I'll check this after lunch.
I had loads of problem with disconnects and hangs when working with the MagTag. Especially file copying seems problematic. Not sure how to proceed to gather info for a bug report though.
Totally unrelated to that; I am also unable to get the e-Ink Gizmo Tricolor to display anything in CircuitPython (it works just fine in Arduino). Not sure how to proceed.
@cobalt grail try the very very latest version of the magtag build
Can connect no problem to thingspeak and adafruit.io and get data from em!
this build, in particular, has latest certificate fixes
hmmm -- with that build I am getting an error ```ress any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 6.0.0-rc.2-261-gc3645f19f on 2020-11-14; MagTag with ESP32S2
import cheer
Set background to 16777215
Displaying color
Connecting to AP Needell Airport
Retrieving data...Reply is OK!
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "cheer.py", line 47, in <module>
File "cheer.py", line 39, in <module>
File "adafruit_magtag/magtag.py", line 333, in fetch
File "adafruit_magtag/network.py", line 510, in fetch_data
File "adafruit_magtag/network.py", line 502, in fetch_data
File "adafruit_requests.py", line 351, in json
File "adafruit_requests.py", line 347, in json
File "adafruit_requests.py", line 75, in readinto
File "adafruit_requests.py", line 223, in _readinto
AttributeError: 'bytearray' object has no attribute 'split'
has there been a very recent change to requests? I have todays bundle version.
looks like it is something recent
looks like you can try https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/tag/20201107
@solar whale you will need the build i posted to connect to thingspeak
Yes -- that is the one I am using.
@meager fog Ok, now running Adafruit CircuitPython 6.0.0-rc.2-264-gf2e911ad9 on 2020-11-14; MagTag with ESP32S2 and the file copy hangs seems to have disappeared. However, if I press Ctrl-C after my code has run for a couple of seconds and then press Enter, it takes maybe 0,5 seconds, the cursor moves down and then tha MagTag is hung. No response from serial and the UF2 disk is dead.
This is the code I am running.
OK -- I have to go out for a bit -- will try older requests later - Thanks!
@cobalt grail huh nifty yeah it is making it upset, i wonder why
its something with the size of code.py
oh wait no my disk was just full lol
ill check later - please see ifyou can try out any of the examples here https://github.com/adafruit/Adafruit_CircuitPython_MagTag/tree/main/examples and here under "MagTag_" https://github.com/adafruit/Adafruit_Learning_System_Guides
@narrow dirge E. Did you see the CLA to sign?
This allows CircuitPython on ESP32S2 to successfully connect to io.adafruit.com, like standard browsers and desktop https clients like openssl s_client, curl, and mbedtls ssl_client2. This problem...
@meager fog Yay! CheerLights works with the older Request library!!
I tested this PR on a MAGTAG and now now also able to access "CheerLights: via the thingspeak https URL.
I did have to revert to an older version of the Requests Library to avoid the new issue with "split" https://github.com/adafruit/Adafruit_CircuitPython_Requests/issues/52
It works with the requests library from the 11/07/2020 bundle,
ill check later - please see ifyou can try out any of the examples here https://github.com/adafruit/Adafruit_CircuitPython_MagTag/tree/main/examples
I cannot. First example connects to Wifi without SSID/Password and the other gives an import error.
Fil "code.py", rad 5, i <module>
Fil "/lib/adafruit_magtag/magtag.py", rad 32, i <module>
Fil "/lib/adafruit_magtag/network.py", rad 35, i <module>
Fil "/lib/adafruit_magtag/wifi_module.py", rad 30, i <module>
ImportError: ingen modul med namnet 'neopixel'```
@cobalt grail it looks like you need to add neopixel library into your lib folder.
@cobalt grail you need to add any libraries - see this guide https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries
this demo displays the BME680 on a magtag
import time
import board
from adafruit_magtag.magtag import MagTag
import adafruit_bme680
from adafruit_display_shapes.rect import Rect
magtag = MagTag()
magtag.add_text(
text_font="Arial-Bold-12.bdf",
text_position=(20, 64),
line_spacing=0.85,
text_anchor_point=(0, 0.5),
)
bme680_sensor = adafruit_bme680.Adafruit_BME680_I2C(board.I2C())
while True:
displaytext = f'Temperature: {bme680_sensor.temperature:.1f} °C'
displaytext += "\n"
displaytext += f'Gas: {bme680_sensor.gas/1000:.1f} Kohms'
displaytext += "\n"
displaytext += f'Humidity: {bme680_sensor.humidity:.1f} %'
displaytext += "\n"
displaytext += f'Pressure: {bme680_sensor.pressure} hPa'
print(displaytext)
magtag.set_text(displaytext)
time.sleep(5)
it is a little flaky and needed a hardware reset, i wonder if its the i2c peripheral, we havent done a lot with it
@tulip sleet thanks, signed it
anybody feel like testing https://github.com/adafruit/Adafruit_CircuitPython_Requests/pull/53 and leaving a review?
(sigh I didn't push that when I created the fix and a release of requests went out with the bug in)
@onyx hinge I can look at it, not 100% sure how quickly I can test it haven't followed this one
@meager fog I tried your demo on the BME280 seems to be going fine by I2C . I was having some flakiness having to reboot to save, and losing my serial connection
As soon as I call the line:
bme280_sensor = adafruit_bme280.Adafruit_BME280_I2C(board.I2C())
The flakiness begins, locking up Mu and my MagTag until I reset. I then have a small window to save a change / Ctrl-C before that line is ran.
If I comment out the I2C sensor nothing acts strangely
That is consistent with the problems @timber mango and I had, we both used BME's in our code.
yep
I have a bmp280 and a magtag and can help test new builds etc. as needed, the stemma connector makes it oh so easy 🙂
The same code is more stable on the Feather S2, but I haven't pushed the S2 very hard
@blissful pollen yah probably some DMA weirdness with I2C. we will look next week
SPI had a 'similar' issue - but was fixed to get eink working nicely
not sure what to suggest except either live with hard-resetting (and keep lotsa backups!) or wait a bit
Yup no problem, I was just testing it to see if I could replicate what others were seeing. Feel free to ping me to do a retest later. Sadly not set up with enough h/w debugging stuff to really dig into this
for hw debugging on the esp32s2 I've had best luck with the Kaluga -- after I set the dip switches to allow debugging 🙂
(no additional HW required, it builds the debugger onto the PCB)
gdb is temperamental and/or there are some tricks I haven't learned yet
Oh nice. I haven't had to touch gdb since university so... yeah a while ago 🙂 but that sounds how I remember it
i want to piggy back on this because i think i2c in general is causing issues. ive had no problems with USB until i started trying accessing the I2C peripheral. then getting hangs, disconnects, erased drive etc :(
once code runs, i2c is working fine...it just struggles to get there
on a magtag (built in i2c accel)
import time
import board
import digitalio
import busio
import adafruit_lis3dh
i2c = busio.I2C(board.SCL, board.SDA)
lis3dh = adafruit_lis3dh.LIS3DH_I2C(i2c, ad...
@meager fog "single minute" times get formatted without a leading 0 currenting in the simple clock. I can take a look into it and PR a fix.
What are the things that could cause the docs badge in the readme to show "docs failed" but the sphinx build runs fine locally and the actions have passed?
@lone axle find the related readthedocs page https://readthedocs.org/projects/adafruit-circuitpython-requests/builds/ e.g., for requests and then look at the actual build results
if that doesn't help we can look at it together (but maybe not tonight, I'm about to call it quits)
what repo is it?
Thank you 🙂 I'll take a look at that for the library I found.
I wonder if adabot could add a check for this...
mostly adabot looks at github info, there is a readthedocs api https://docs.readthedocs.io/en/stable/api/v3.html#builds
https://github.com/adafruit/adabot/issues/195 @lone axle I went ahead and filed it as a possible adabot improvement
Looks like possibly just a failure of something at the time that it tried to build: https://readthedocs.org/projects/adafruit-circuitpython-display-text/builds/12338687/
Wanted to report back that I now have an unbootable microcontroller. Even flashing fresh (official) circuitpython to the device seems to not get to a REPL. I assume that this may be related to this bug as it's only been used on Circuitpython
I have reproduced bad filesystem writes by writing large files (~180k). They take a very long time, sometimes, to write. I am investigating a couple of hypothesese about what's wrong.
@kdb424 You could try erasing everything re-flashing the bootloader. See the instructions in https://github.com/adafruit/Adafruit_nRF52_Bootloader/blob/master/README.md
So I am trying to run MagTag examples in the Adafruit_Learning_System_Guides-master repo. from adafruit_magtag.magtag import MagTag just gives me an error about a missing module 'neopixel'. Where is that module supposed to come from? I am on Adafruit CircuitPython 6.0.0-rc.2-264-gf2e911ad9 on 2020-11-14; MagTag with ESP32S2.
@cobalt grail it's in the library bundle
Named what?
neopixel.mpy
if your systems sorts alphabetically by default then it will be near the very bottom because it doesn't have adafruit in front.
Argh.
Thanks @lone axle! Somehow my brain thought that the bundle only contained libraries named Adafruit_*.... 🙂
No worries. Ive definitely lost myself looking for that one and simpleio in the wrong section before.
I was playing more with the I2C / MagTag issue. Found that I can run the code from the REPL with no issues. Stop it, restart it, it is fine.
It only seems to occur after dropping to the REPL after the program ends (or I Ctrl-C) - but not 100% consistently but usually
OK, made a pull request for the MagTag_CountdownCelebration example. This is my first pull request so I hope I didn't screw up. 🙂
I discovered the issue seems to occur once my program ends or aborts with Ctrl-C. The program will execute fine as long as it does not reach the REPL.
I was testing with:
import time
import board
import adafruit_bme280
time.sleep(5)
bme280_sensor = adafruit_bme280.Adafruit_BME280_I2C(board.I2C())
while True:
print(bme280_sensor.temperature)
print(bme280_sensor.humidity)
time.sleep(5)
I also tested removing the while and letting it drop to the REPL....
Using this script:
import time
import board
from digitalio import DigitalInOut, Direction, Pull
from gamepad import GamePad
print("wait before anything")
time.sleep(5)
btn_a = DigitalInOut(board.BUTTON_A)
btn_b = DigitalInOut(board.BUTTON_B)
# um feather s2 with OLED featherwing
# btn_a = DigitalInOut(board.IO33)
# btn_b = DigitalInOut(board.IO38)
_buttons = GamePad(
btn_a,
btn_b,
)
while True:
print("{} - {}".format(btn_a.value, btn_b.value))
...
Disable certain classes of diagnostic when building ulab. We should submit patches upstream to (A) fix these errors and (B) upgrade their CI so that the problems are caught before we want to integrate with CircuitPython, but not right now.
This allows calls to allocate_memory() while the VM is running, it will then allocate from the GC heap (unless there is a suitable hole among the supervisor allocations), and when the VM exits and the GC heap is freed, the allocation will be moved to the bottom of the former GC heap and transformed into a proper supervisor allocation. Existing movable allocations will also be moved to defragment the supervisor heap and ensure that the next VM run gets as much memory as possible for the GC h...
This is now implemented on top of the movable allocation system. Functionality should be unchanged from the previous revisions. Only the last commit is relevant, the rest are from #3695.
As discussed in #1084, when a VM run ends with an exception, this uses the movable allocation system to preserve the traceback across a soft reload and lets the next VM run retrieve it using supervisor.get_previous_traceback().
Only the last commit is relevant, the next to last is #3454 (which it is not dependent on and could be rebased off if desired) and the rest is #3695 (which is required).
Open questions from my point of view:
- Should this be optional, or is the added weight ...
@onyx hinge I can confirm that https://io.adafruit.com can give status_code 200, but I have an unhandled exception a few seconds later with a backtrace. Do you see the same? I've (hopefully - I'm more struggling through git than handling it) fetched your two pull requests into a fork that has a branch "esptlstest" in which I "git merge" the two pull requests for 3691 and 3689
Adafruit IO is the easiest way to get your projects onto the Internet of Things!
I'll copy over the backtrace to my build environment now to review where is is failing.
the module for adafruit_io needs work before it'll work with esp32s2.
This was just the page that I did a req.get() for. I didn't use adafruit_io
(to validate that the certificate issue is gone)
https://benny.servebeer.com/nextcloud/index.php/s/Tbiqo3CxEDAD58W I'm not sure about the backtrace though, it looks weird with the question marks
ok, if you are talking about C crashes then obviously that's not supposed to happen.
Do you have a featherS2?
yes but I'm not going to look into anything in detail today.
No issue, Jeff. I wish you a wonderful and hopefully relaxing day 🙂
thanks
I've moved my firmware file to the above mentioned folder, if you want to give it a try in the coming days. The folder is shared for some days before the share expires.
not sure what to suggest except either live with hard-resetting (and keep lotsa backups!) or wait a bit
@meager fog yep- I just want to make sure you and the team is getting helpful info, it looks like it can be reproduced by just importing the library. Tons of good stuff on the magtag, I am happy to have one to tinker with
Will fix the mimxrt10xx and xtensa failures soon, I missed something there.
That it would overflow the flash on some of the smaller boards I kinda feared. Pruning back the optional arguments will reduce the size a little, but probably not enough for all of them. Open for discussion on what to do about that.
Using firmware version 1.7.1 and CircuitPython 6.0.0 rc2 I'm not able to soft reboot via esp.reset(). Example code is shown below. It's as if esp.reset() simply acts as a no-op.
I am occasionally getting an 'ESP not responding' error which I'm trying to consistently reproduce. But in the meantime I'm not able to recover from the error by forcing a reset.
from adafruit_esp32spi import adafruit_esp32spi
import digitalio
import busio
import board
esp32_ready = digitalio.Digit...
The behaviour that an Access Point is seen early during bring-up is also mentioned in #3321 by @anecdata
@tannewt would be happy if you could review.
The below was the output before this (with DEBUG=1)
I (3996) wifi_init: WiFi RX IRAM OP enabled
I (4116) phy: phy_version: 603, 72dfd77, Jul 7 2020, 19:57:05, 0, 2
I (4116) wifi:enable tsf
I (4116) wifi:mode : softAP (7c:df:a1:03:b7:a5)
I (4116) wifi:Total power save buffer number: 8
I (4126) wifi:Init max length of beacon: 752/...
In this code the OnDiskBitmap gets added to the group after a Bitmap, so it should get drawn on top.
import time
import board
import displayio
import adafruit_imageload
display = board.DISPLAY
time.sleep(5)
splash = displayio.Group(max_size=20)
# background
rect = displayio.Bitmap(20,20, 2)
rect_palette = displayio.Palette(3)
rect_palette[0] = 0xFFFFFF
# Create a TileGrid using the Bitmap and Palette
rect_tile_grid = displayio.TileGrid(rect, pixel_shader=rect_pal...
Title says it all, I don't want the boot.py/main.py on the internal flash, rather in the SD card. How may I accomplish this?
Hey folks -- I just wanted to share that the CFP for PyCascades 2021 closes in a few hours. Scott gave an awesome talk about CircuitPython last year, and we'd love to see more submissions around hardware & CircuitPython. https://twitter.com/pycascades/status/1328183206428991490
Oh hey, time flies! Our CFP closes very soon but there's still time to submit!
Get yours in by the end of today, November 15th, anywhere on earth: https://t.co/qQYQd1WpFw
Submit here: https://t.co/0aPwwwCfPS
For the sake of completeness, this is how it would show up in WIDS/WIPS applications:

The "lastest" packages here are two years old:
https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/feather_nrf52840_express/
I need 6.1.0.alpha for grayscale eInk support; building it myself unfortunately didn't work (stayed in FTHR840BOOT after flashing) and I have no idea how to figure out what went wrong / didn't yet buy a JTAG adapter.
I think you need to click into one of the languages near the top. Here is the link for en_US: https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/feather_nrf52840_express/en_US/
Those contains the newer builds because they are now translated into many languages.
Sigh I should have noticed. Thx.
Confirming that this happens on various ESP32-S2 boards, usually after running for some hours or days. Other RuntimeErrors, like RuntimeError: Unable to read HTTP response., are recoverable if caught. But this one does not seem to be, once it happens, no more internet.
A minor bug fix for issue #2056. Clear the exception traceback after printing in REPL.
@tulip sleet Have you pushed your work on deep sleep api yet? I would like to take look at the new api.
I have a github issue that's starting to get really frustrating - how do you associate a commit with a release number? I'm trying to figure out what IDF release we're currently using in Circuitpython and it's baffling to me that it's this hard
@ionic elk Can you clarify what you mean by associate a commit with a release number?
So, in Circuitpython, we have a version of the ESP-IDF checked out at 8bc19ba. I need to know the lowest semantic version number of the IDF that this is associated with
ie, is it 3.2, 3.4, 4.2, etc
Oh hmm. Short of scanning the Releases page on GitHub, I'm not certain how to do that.
Right, and that seems so crazy to me, what is even the point of semantic versioning if you can't figure out where you are
It's not directly associated with a release if my searching says anything.
sorry for being grumpy lol I've just been trying to line up where the Arduino ESP-API is to the Circuitpython one for like half an hour and I'm getting really frustrated
There must be a way in git.
Because when you pull, it gets version numbers? So maybe it associates things?
Seems like we grabbed a commit between releases, so you're ending up having to dig.
If I grabbed a commit that was literally a release, would it even show that though?
without me having to look it up?
@analog bridge I pushed something but just for backup purposes: it's WIP: https://github.com/dhalbert/circuitpython/tree/sleep. It's basically what's in https://github.com/adafruit/circuitpython/issues/2796#issuecomment-694456615, which Scott and I rewrote during a conversation. But I have renamed sleepio to sleep, and I have some thoughts about more API changes in https://github.com/adafruit/circuitpython/issues/2796#issuecomment-727047121. Also I'm changing sleep.set_alarms() to sleep.restart_on_alarm() to make it clearer that those are deep-sleep alarms.
That's true. Is there a way to condense the release page so that I only see the release dates and not all the other stuff?
Not that I'm aware of and they have a LOT of release notes.
Though I think at the heart that's still an approach that could be prone to errors if the commit is on a branch that wasn't merged into the next release
Right.
I at least got here: https://github.com/espressif/esp-idf/commit/8bc19ba893e5544d571a753d82b44a84799b94b1
This feels like something I should build a script for. Which again kind of makes me mad because it's like why are we even bothering to semantically version things
For the user experience, I suppose.
That link says it was merged into master so if the following release came from master, it's in there.
If that was your concern.
@ionic elk This one? https://github.com/espressif/esp-idf/releases/tag/v3.3.4
Documentation for release v3.3.4 is available at https://docs.espressif.com/projects/esp-idf/en/v3.3.4/
ESP-IDF v3.3.4 is a bugfix update for ESP-IDF v3.3. IDF v4.1 is the latest stable release of ...
@analog bridge I started with https://github.com/tannewt/circuitpython/tree/sleepio
@ionic elk Came after the commit.
I have only been making shared-binding changes so far, no impl changes
@ionic elk "git describe --tags" from a command line should give you the sematic version of whatever you have in the folder
@prime cove That's what I was wondering!
Since they show up when you pull, I imagined git must have access.
@idle owl yeah maybe, I have it in my notes that it was 3.4, but I was confused because the 4.2 release is where they describe having "added the esp32s2"
the tags on a commit are noted in git log, but I think you know that
how did you find it so fast?
@tulip sleet 👍 ..... I will be working on ulp and touch based alarms this week, also I feel like the existing esp32s2 alarms need to be changed to get inline with new api.
@ionic elk I'm a ninja at searching, I guess?
@tulip sleet no I don't know, how do you git log a specific commit for that information?
@analog bridge Yes, I am going to rewrite the alarm modules and put them in a single module, either standalone as alarm, with alarm.pin and alarm.time, or under sleep.
git show does not show tags
nice! will be looking out for these changes 🙂
and neither does git log 8bc19ba
v4.3-dev-1198-gd06744f5e
This says that the tag v4.3-dev is in the past of the HEAD commit by 1198 commits
^ EYY there it is, thanks @onyx hinge I've been trying to google that command for like 40m
If you use the gitk ui for browsing commit history, it shows a line that says "Follows: v4.3-dev" but it doesn't give the other info that describe can give
I just mean looking backwards in git log to find a commit with a tag
but since we are working on the bleeding edge, there's no recent tag, so we can't document which release we're on, we're just on a branch at a particular commits
"git describe" uses heuristics to decide which tag to use. One thing that can foil the heuristics is when a "merge up" style of development is followed, because (say) both 6.0.1 and 6.1.0-alpha.0 can be in the DAG of history, with neither definitively "in front of" the other.
If multiple tags were found during the walk then the tag which has the fewest commits different from the input commit-ish will be selected and output. Here fewest commits different is defined as the number of commits which would be shown by git log tag..input will be the smallest number of commits possible.
In those cases, specifying first-parent probably better reflects intent: git describe --tags --first-parent HEAD
(because if good git practice is followed the 6.0.1 tag should be behind the second parent of some merge commit but the 6.1-alpha tag should be behind first-parents)
@onyx hinge and @tulip sleet are git gurus. Top of a mountain and all.
Also, to search in the other direction (“Which releases contain this commit?”), use git tag --contains a049e02.
So now git requires "good parenting skills" 😉
@onyx hinge knows more details than me 🙂
All good tips here thanks!
I sure feel like Github should do more of this for you, but I guess it's specific enough that I shouldn't have those kinds of expectations.
raw git is fairly "policy-free", so assumptions about how you manage your branches, tags, etc. are not necessarily built in.
I recommend chapters 2 and 3 of https://git-scm.com/book/en/v2
@gilded cradle Not sure this was meant to be added to "Features" on the cp.org/downloads page:
It should be 3 different lines. Computer has to boot up first. Accidentally shut it down instead of the Raspberry Pi.
@gilded cradle Hah! Fair enough.
@gilded cradle typed shutdown in the wrong terminal? i've down that too 🙂
Right terminal, but I had already rebooted the Pi and it logged me out 🙂
Problem was I was juggling a bunch of things and forgot where I was.
yep. same. and realized it as soon as hitting enter.
🙂
?serverinfo
@idle owl I have been using the Neopixel library and everything works great. However, I'd like to put the comet animation in a loop an change the color each time through. How to do that is not obvious. Can you offer some guidance?
@hazy plover It might be possible, but I'm not certain how to off the top of my head. This question is better suited to #help-with-circuitpython, I think. There are many folks that can possibly provide assistance with it. I don't have an opportunity to look into it right now, unfortunately.
@hazy plover Specify that you're using the LED Animation library. It works with NeoPixel, but it's a separate library. Simply a suggestion to be clearer and get some better assistance.
Does anyone know how to get google docs to not autoreplace names following a @ with contact links?
I just click on the line below -- don't hit return
so type in @jerryn then click on the page somewhere else
ooh -- go to know
yeah but they only just added it in, right? I don't remember having to do it before just a couple weeks ago
@ionic elk Correct.
bah
yeah I wish they'd put a category in tools->preferences for it, like the other substitutions
it is annoying
I hit escape to cancel it.
@idle owl i have been using ctrl-Z, and then retyping, and it doesn't do it the second time, but that's easier
Good afternoon all you wonderful folks -- happily lurking, notes doc updated to reflect as such.
<@&356864093652516868> if you're planning to speak in the meeting, please remember to at least add your name in the notes doc (two places) so we don't skip over you. If you can also add your notes, that's helpful too. https://docs.google.com/document/d/1NB-7IQR3F-1zPFHavBUUrmbg8uErFVLULn5Z59d6tPo/edit?usp=sharing
If you're not in the doc we'll assume you're lurking
Lurking
lurking
@tulip sleet @ionic elk If you keep typing after it, it doesn't automatically link it apparently. I accidentally just did that and it doesn't appear to have linked it.
lurking
example for magtag of reading 'large' json files and parsing them
code.py output:
Connecting to AP adafruit
Reading data
Took 1.380859 seconds to get response
Took 40.878906 seconds to parse
Thoughts 5
import time
import random
from adafruit_magtag.magtag import MagTag
# Set up where we'll be fetching data from
DATA_SOURCE = "https://www.reddit.com/r/Showerthoughts/top.json?limit=5"
magtag = MagTag()
magtag.network.connect()
# thought in bold text, wit...
Likewise 🙂
@idle owl unfortunately it holds on for one space after, so when you want to put in your name for your section it'll still trigger
lurking
Lurking
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 ...
Greyscale party parrots 🦜
Shout out to @makermelissa for her guide on this display: https://t.co/gvxwazxKyE https://t.co/daKurHIPET
❤️ me some LCARS
How to control a DC Motor in CircuitPython using the L289N Motor Driver board and an Adafruit Metro M4 Express CircuitPython board. In this video you will learn: How NOT to control a DC motor and how to easily control a DC Motor with CircuitPython, an L289N driver board and th...
superpower: lives in the pacific timezone
👍
The microbit python is based on micropython @balmy stirrup ?
yup, it's a fork of micropython
@balmy stirrup can you post links?
Thanks @slender iron
yeah i am
I think that's right
@narrow dirge yes. I am working with Carlos who has their own port right now and will be getting the port into the main MicroPython repo at some time in the future.
@lapis hemlock
https://github.com/mytechnotalent/MicroPython-micro-bit_Create_C_Library
https://github.com/mytechnotalent/MicroPython-micro-bit_Create_Python_Module
This is an advanced tutorial for the official BBC micro:bit V2 where we create a custom C musictheory.c library and add custom C functions frozen into the firmware where users interact with this fu...
This is an advanced tutorial for the official BBC micro:bit V2 where we create a custom interactive talking statecapitol.py module and freeze this custom Python educational chatbot into the firmwar...
@balmy stirrup Thanks!
Welcome
@balmy stirrup if you didn't, consider sending anne the link for the micropython one
@onyx hinge yep I tagged her on the Twitter posts.
@slender iron stream Thursday right?
yup!
@lapis hemlock did you benchmark function pointers yet?
@onyx hinge No, but it is high on my list.
Function pointers are configurable (if you don't want them, you can switch them off, and revert to macros).
@lapis hemlock my suspicion is if it's anything that would be a function call anyway (sin, pow) you wouldn't see a speed difference, but I could always be wrong.
Belated hug to Dan, I was one of those Win7 users looking for drivers for new boards 😅 .
@onyx hinge you still have an extra function call, albeit, a simple one.
I have finally made the leap to Linux now.
@onyx hinge Something like this: mp_float_t ndarray_get_float_int16(void *data) { // Returns a float value from an int16_t type return (mp_float_t)(*(int16_t *)data); }
@lapis hemlock my suspicion is if it's anything that would be a function call anyway (sin, pow) you wouldn't see a speed difference, but I could always be wrong.
@onyx hinge It could also be the case that your implementation is cleverer than mine, and you can circumvent the function dispatch. Here is an example: https://github.com/v923z/micropython-ulab/blob/26173a46f0420d4e129d2cc7d37df4f6c63af78f/code/vector/vectorise.c#L47-L88
yay thank you dan!
🎉
The first thing to do is put it under FULL_BUILD only. but when it comes to making things in a module optional (rather than making a whole module optional) it becomes more complicated.
Thanks for another excellent meeting
Thanks!
thanks kattni, and everyone! see you next week.
Cheers!
thanks
Thanks all!
🤞
huh debian's still back at version8 for gcc-arm-none-eabi, even in sid
I expect to see a 14-16tb external HDD in the $150usd range this black friday.
ooo, nice
Have a great week, all! Dog is pacing...👋
@solar whale Later, Jerry!
I'm going to drop off, the video is taking forever to transcode. 😄
I am 100% in support of the inclusion of the time ticks methods. I actually just hit a small wall yesterday with https://github.com/micropython-IMU/micropython-fusion/blob/master/deltat.py#L53 because it relies on utime.ticks_diff
It also uses time.ticks_us() but it's trivial to convert from time.ticks_ms() to microseconds.
Following, and hopeful this could be included.
@tulip sleet For sure 6.0.0 will be stable today? Updating v numbers in the newsletter, and want it to be accurate tomorrow.
I am writing up the release notes! Yup!
that is more up to @slender iron, about whether there's anything pending he still wants to merge in.
Alright. I'll say we don't have an unstable version at the moment for now.
@slender iron is this a correct description of the current state of the native network modules: - Revamped network API, adding wifi, socketpool, ssl, and other modules. Disabled socket, wiznet5k and network modules. They will be removed in 7.x in favor of networking libraries.
@tulip sleet yup!
thanks!
let's plan on a pre-release this week but not today
I'm still not caught up
@idle owl ☝️
sounds fine; there will be a lot to write up
@slender iron Perfect, that's how I went with it.
Removed that bit entirely, like we did when Python didn't have a pre-release out.
Here is the notes document for Monday’s CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if you’ll be attending the meeting - it’s super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1uWRr_OQkfK9TygD2SGU9LpY60mK_euMQNsT0P-J0o2I/edit
Automated website update for release 6.0.0 by Blinka.
Is this likely to be merged into main or will you wait for the esp-idf to accept it upstream? Just curious.
@lone axle Are you around?
@idle owl yep whats up?
In lazy mode - do you happen to have the /lib list for using PyBadger with MagTag?
adafruit_imageload, adafruit_display_text, neopixel, that may be it for now.
Excellent, thank you so much
@lone axle Thanks so much for adding support for MagTag to PyBadger! Once we get lower power working, we'll make sure to update the example to use it.
I'll circle back around and work on the audio functions as well once it's implemented in the core.
Excellent!
@onyx hinge @slender iron Note in circuitpyhon builds from GitHub actions: _Ubuntu-latest workflows will use Ubuntu-20.04 soon. For more details, see https://github.com/actions/virtual-environments/issues/1816 _
@tulip sleet that's good news, except for whatever it breaks 🙂
python is bumped to 3.8, but we usually specify anway. I think the only thing that might affect us is
I guess a PR won't test the aws bits
No Python2 by default
Want to add a Python script to check this in the CI? It should be easy to do and prevent extraneous features from getting checked in.
I am now working on this and revising the API toward the revised example above. I am making some changes, and I have some suggested changes that I would welcome comments on:
Thanks for picking this work up! I'm excited to try it.
1. I renamed `sleepio` to just `sleep`, because an alarm is not necessarily pin-based. We have a lot of `*io` modules, but not all are (e.g. `rtc`).
I worry that just sleep will conflict with time.sleep. lowpower is an option too. I don't mind ha...
meowbit and thunderpack builds ran out of space.
So... do you want to merge it or not?
I think you need this in a loop because len may be more than 1.
Thank you! I don't see any issues. Please un-draft as you'd like.
@tidal kiln Oh, I forgot to ping you earlier. Let me know if you're around. If you're not in the next half hour or so, tomorrow will work better.
yo!
Hey!
@tidal kiln So I'm writing this Which CP Board is Right for You? guide. Limor wants you to take a look at it and fill it out better because you deal with support and know what questions might be better answered by the guide. I can try to add you to it in Basecamp or whatever works for you. Three of the pages are already done, there are... checks... three more pages incoming including the one I'm on now. So you would be able to get started whenever works for you.
okie doke. try adding me over in BC. lets see if that'll work.
We don't support it because the SD card may not exist. You can use import to load code off the SD card from main.py. https://github.com/adafruit/circuitpython/pull/3454 also provides a new way to reload the VM and run a different file.
Alright, already checked, looks like it's possible. I'll assign you to the same entry I'm assigned to, and then I'll make a comment on it with the currently completed pages.
got it.

