#circuitpython-dev

1 messages ยท Page 339 of 1

manic glacierBOT
slender iron
#

@hollow gazelle โ˜๏ธ

#

@tulip sleet do you have the download count info handy for beta 1?

tulip sleet
#

yes, I can just update it in the adabot fork

#

that's how i do it

slender iron
#

yes please ๐Ÿ™‚

tulip sleet
#

doing oct and nov

tulip sleet
#

@slender iron ok, pushed!

slender iron
#

thanks!

#

now I just need to wait for the CI

manic glacierBOT
ornate breach
#

yay first PR!

#

๐Ÿ™‚

manic glacierBOT
slender iron
#

ok, beta 1 is out!

ornate breach
#

Woo!

slender iron
#

and I'm out as well. See you all monday!

ornate breach
#

Have a great weekend @slender iron

tulip sleet
#

have a nice break!

slender iron
#

thanks!

#

you too

manic glacierBOT
lament sentinel
#

download_url_template = "https://downloads.circuitpython.org/bin/{board}/{locale}/adafruit-circuitpython-{board}-{locale}-{version}.{extension}" -- that should take care of that

lament sentinel
#

INFO:root:Executing ['C:\\Program Files (x86)\\BOSSA\\bossac.exe', '-p', 'COM5', '-e', '-w', '-v', '-R', '--offset=0x2000', 'C:\\Users\\bcr00\\AppData\\Local\\Temp\\tmp7306f3ae\\adafruit-circuitpython-feather_m0_rfm69-en_US-6.0.0.bin'] ๐Ÿ˜ฐ

manic glacierBOT
lament sentinel
#

@lone axle @tulip sleet @slender iron survived! ```PS C:\Users\bcr00\Source\bcr\blinka-cli> python .\blinka.py bossa --port COM5 --board feather_m0_rfm69
INFO:root:Using en_US for the locale
INFO:root:Executing C:\Program Files (x86)\BOSSA\bossac.exe -h
INFO:root:BOSSA version 1.9.1
INFO:root:Executing C:\Program Files (x86)\BOSSA\bossac.exe -p COM5 -i
INFO:root:Address for device ATSAMD21x18 is 0x2000
I will be executing the command line:
C:\Program Files (x86)\BOSSA\bossac.exe -p COM5 -e -w -v -R --offset=0x2000 C:\Users\bcr00\AppData\Local\Temp\tmpnq38_s8f\adafruit-circuitpython-feather_m0_rfm69-en_US-6.0.0.bin
PLEASE REVIEW IT
Ready to do this? [y/N]y
INFO:root:Executing C:\Program Files (x86)\BOSSA\bossac.exe -p COM5 -e -w -v -R --offset=0x2000 C:\Users\bcr00\AppData\Local\Temp\tmpnq38_s8f\adafruit-circuitpython-feather_m0_rfm69-en_US-6.0.0.bin
Erase flash

Done in 0.911 seconds
Write 181416 bytes to flash (2835 pages)
[==============================] 100% (2835/2835 pages)
Done in 2.106 seconds
Verify 181416 bytes of flash
[==============================] 100% (2835/2835 pages)
Verify successful
Done in 5.960 seconds
PS C:\Users\bcr00\Source\bcr\blinka-cli> type E:\boot_out.txt
Adafruit CircuitPython 6.0.0 on 2020-11-16; Adafruit Feather M0 RFM69 with samd21g18
PS C:\Users\bcr00\Source\bcr\blinka-cli> ```

lone axle
#

@lament sentinel Awesome! I see it has a y/N before it flashes which gives the user the chance to bail. Thats even better than the --dryrun flag I was thinking of.

manic glacierBOT
#

I just fired up Adafruit Learn: CLUE Rock, Paper, Scissors Game using Bluetooth in 6.0.0 with a fresh (20201120) set of 6.x libraries and it throws an exception as soon as it starts the relatively complicated bluetooth chatter on a CLUE.

I tried a bit of REPLing to reproduce a small example of it. This seems ok:

Adafruit CircuitPython 6.0.0 on 2020-11-16; Adafruit CLUE nRF52840 Express with nRF52840
>>> from adafruit_...
prime flower
#

I'll PR in a few hours. Pretty good refactor of Adafruit IO CircuitPython in that by removing the requirement for a wifimanager object and using a socket instead, added ESP32S2 compat, CPython compat, 32spi backwards-compat, and I'm going to test with ethernet (should "just work")

#

What is the current naming convention for a CircuitPython device which can import its ssl/socket implementation natively? Native networking?

timber mango
#

niiiiice

#

I literally have all my variables ready to go, this is very cool

prime flower
#

For examples, we'll have adafruit_io_simpletest which uses ESP32SPI socket object, adafruit_io_cpython which uses sockets and adafruit_io_simpletest_wifi which uses native sockets ?

#

Does this make sense? Should we be defaulting the _simpletest to native sockets now?

timber mango
#

I would recommend a new set/folder/names for ESP32S2 compatible

#

I will be writing up a howto on my project and will likely steer newcomers that may trip on that subtlety

#

Maybe a "native sockets" folder or example set?

prime flower
#

I think I'll default to native socket example for simpletest, and then append _esp32spi onto another simpletest since it's another network interface type

#

We're already in 2x folders (HTTP API/MQTT API) for this library so I don't want to make users drill deeper than they need to...I'll bring it up during the mon. meeting, we can always do a PR to reorganize examples ๐Ÿ˜„

tulip sleet
#

@onyx hinge Could I ask you an enum q? I want to initialize a mutable locals dict with an enum value, but I don't see a way to look up an enum value at compile time to get a pointer to it to put in the dict.

onyx hinge
#

hmmmm good question

tulip sleet
#

I want to put ResetReason.INVALID in as the initial value.

#

there are no symbols that correspond to each enum vaslue

onyx hinge
#

right

tulip sleet
#

and then I also can't compare a returned enum value with its object; i have to extract its integer value

onyx hinge
#

The macro MAKE_ENUM_VALUE does create a named singleton object but it is given STATIC linkage

#

we could take the STATIC out of MAKE_ENUM_VALUE (and MAKE_ENUM_MAP)

lament sentinel
#

@lone axle yeah, I understand where you were coming from -- there is the git approach ("interactive" and "dry-run") and then there is the apt approach (Do you want to continue? [Y/n]) and I went that way

onyx hinge
#

or if it's in the same translation unit you can just use the named object, which comes from preprocessor pasting: prefix ## _ ## name ## _obj

tulip sleet
#

i don't know that the map needs to be unstatic, but it might be convenient. So then it would be RESET_REASON_INVALID_obj

#

for the object

#

that works for me

onyx hinge
#

I think that's right

tulip sleet
#

I will try that, thanks

#

it will just be a part of my upcoming PR unless you want to separate it out

onyx hinge
#

probably no need

#

which reminds me I have reviews to do .. but I also really need to finish i2s up

tulip sleet
#

๐Ÿ™‚

prime flower
timber mango
#

will do, busy day with meetings but I will pull and test. Do I need to update to the latest nightly CP 6.x?

manic glacierBOT
prime flower
#

Yep!

idle wharf
#

@prime flower I've seen the chipset used as a prefix to sample file names where they have been updated.

Downloads/adafruit-circuitpython-bundle-6.x-mpy-20201120/examples via ๐Ÿ system
โžœ grep -e "import adafruit_requests" * --recursive
esp32spi_simpletest.py:import adafruit_requests as requests
esp32spi_wpa2ent_simpletest.py:import adafruit_requests as requests
esp_atcontrol_countviewer.py:import adafruit_requests as requests
esp_atcontrol_webclient.py:import adafruit_requests as requests
fona_aio_post.py:import adafruit_requests as requests
fona_cheerlights.py:import adafruit_requests as requests
fona_simpletest.py:import adafruit_requests as requests
requests_advanced.py:import adafruit_requests as requests
requests_advanced_cellular.py:import adafruit_requests as requests
requests_advanced_cpython.py:import adafruit_requests
requests_advanced_ethernet.py:import adafruit_requests as requests
requests_github_cpython.py:import adafruit_requests
requests_https_cpython.py:import adafruit_requests as requests
requests_simpletest.py:import adafruit_requests as requests
requests_simpletest_cellular.py:import adafruit_requests as requests
requests_simpletest_cpython.py:import adafruit_requests
requests_simpletest_ethernet.py:import adafruit_requests as requests
wiznet5k_aio_post.py:import adafruit_requests as requests
wiznet5k_cheerlights.py:import adafruit_requests as requests
wiznet5k_simpletest.py:import adafruit_requests as requests
wiznet5k_simpletest_manual_network.py:import adafruit_requests as requests
#

If you grep the examples Downloads/adafruit-circuitpython-bundle-6.x-mpy-20201120/examples via ๐Ÿ system โžœ grep -e "import adafruit_minimqtt" * --recursive I see some examples with the suffix related to the connectivity. Maybe _wifi_esp32s2 _wifi_esp32spi ?

I kind of like the folder root folder for ALL boards, subfolders for chipset specific examples. But in your case all the examples would be in subfolders I guess.

prime flower
#

@idle wharf Interesting, I checked it out. The thing which is/should be variable between the examples is the network interface (socket), not the chipset

#

Maybe we should go for folders for each interface and put a matching example_interface.py in each folder

#

Main issue I see is that some examples (like requests_github) are specific to one interface so a user would need to adapt the code

idle wharf
#

Hmm, maybe native v. coprocessor would have been a better word choice in my example.
I don't have a suggestion better than your strategy. But I think the scenario is. "I'm new to CP, I have this board in my hand, which example do I use?" So what naming helps best with that ... I'm not sure ๐Ÿ™‚

prime flower
#

same. I think "I have an ethernet wing, I see adafruit_io_ethernet"

#

"_native_wifi" and "_esp32spi_wifi" might be self-explanatory...or confusing. Not sure.

idle wharf
#

Will all the esp32s2 boards have "s2" in them? But I assume any new chipset with native wifi would also use the same examples...

#

Yeah, I think "_native_wifi" and "_esp32spi_wifi" is the best way

#

_native_wifi v. _coprocessor_wifi its a repeatable model for other boards

#

I'm going to test your IO change PR #53 today.

#

between meetings

prime flower
#

esp32s2 boards have "s2" in them?

#

Magtag doesn't explicitly reference "s2"

idle wharf
#

Ah True. More support for your approach perfect !

thorny jay
#

esp32spi is not airlift?

tulip sleet
#

@onyx hinge removing the STATIC worked, but I ended up having to add a "manual" declaration of RESET_REASON_INVALID_obj in ResetReason.h. So a longer-term fix would probably add some kind of macro to handle the initial C enum declaration and provide the declarations for the _obj (and map) objects

thorny jay
#

Same question for BLE. Build-in wifi from a NRF52 and BLE as a ESP32 airlift and maybe some old UART Bluefruit things?

prime flower
#

ESP32SPI is "airlift", maybe _airlift would be a proper prefix

tulip sleet
#

the Adafruit_CircuitPython_Airlift library does some management for both BLE and wifi (wifi part is not used yet)

#

it is meant to support radio coprocessors in general; right now it only supports ESP32 (not ESP32-S2, which is not a co-processor)

#

(I am going afk)

onyx hinge
#

@tulip sleet thanks for the notes -- I am sure there is room for improvements. in any case I'm glad you could get it working for your needs.

idle wharf
tidal kiln
#

what's the minimum esptool version needed for ESP32S2?

timber mango
#

@prime flower I'm getting an error importing socket- what library does that come with?

tidal kiln
#

looks like 3.0?

timber mango
#

I've read from the Feather S2 they ask for the latest

#

yeah 3.0 To install the ESP32-S2 UF2 bootloader on your FeatherS2 you will need to have the latest esptool installed (3.0 as of this time). You can grab esptool tool from the github repo

tidal kiln
#

yep. thanks.

#

also seeing in release notes for 2.8

support for flashing ESP32-S2 will be added in a future version
#

and in 3.0

Support for ESP32-S2 SoC has been added
timber mango
#

this is weird, latest CP 6.x ```code.py output:
Traceback (most recent call last):
File "code.py", line 10, in <module>
ImportError: no module named 'socket'

#

I am literally just doing an "import socket"

thorny jay
#

There is something strange on /download from circuitpython.org. When I want to download CircuitPython 6.1.0-beta.1 it default to French (my browser is maybe configured for advertising I prefer french content) but 6.0.0. is proposed in English.

#

As if the page was smart, but only for one of the version.

crimson ferry
#

@timber mango For an S2? There is no socket module. Here's what I import:```import ipaddress
import wifi
import socketpool
import ssl
import espidf

import adafruit_requests```

timber mango
#

On the S2 do we still need the ESP stuff?

#

Like this? # If you are using a board with pre-defined ESP32 Pins: esp32_cs = DigitalInOut(board.ESP_CS) esp32_ready = DigitalInOut(board.ESP_BUSY) esp32_reset = DigitalInOut(board.ESP_RESET)

crimson ferry
#

nope

idle wharf
#

@timber mango Yes, that's the right one

lapis hemlock
#

@onyx hinge Jeff, I just wanted to thank you for the support that you provided in the past couple of days. I have split the test scripts, and circuitpy checks pass now.

onyx hinge
#

That's excellent news, thanks for the update and you're welcome -- you are doing the heavy lifting, I have offered a little advice and a little tidying

lapis hemlock
#

That might very well be true, but without the icing the cake is, well...

tulip sleet
lapis hemlock
#

I can honestly say that in this case your contribution was instrumental.

ornate breach
#

Need to pick through why my PR isnโ€™t passing precommit.

onyx hinge
#

everyone wins

ornate breach
#

Also, ulab causing issues with CI

#

Probably something I junked on my end

prime flower
#

@timber mango adafruit_io_simpletest.py uses socketpool for esp32s2

lapis hemlock
#

@onyx hinge One one-second question, though: I have this now #ifdef CIRCUITPY #define ULAB_NUMPY_COMPATIBILITY (0) #else #define ULAB_NUMPY_COMPATIBILITY (1) #endif but this is probably not the way. I have tried #define ULAB_NUMPY_COMPATIBILITY (1 & !CIRCUITPY) but that didn't fly. Basically, I wanted to make sure that in circuitpython, you always have sub-modules. The #ifdef clause doesn't prevent that.

onyx hinge
#

One option off the top of my head and untested would be #ifndef ULAB_NUMPY_COMPATIBILITY #define ULAB_NUMPY_COMPATIBILITY (!defined(CIRCUITPY)) #endif

lapis hemlock
#

There might be people, who run micropython, but do not want numpy-compatibility.

#

I would like a construct, where you can set ULAB_NUMPY_COMPATIBILITY, and it is re-set to 0, if you are running circuitpython.

#

I think the sub-modules have their place.

onyx hinge
#

The ifndef guards make it so that you can supply your setting in some other way, such as (I think this is the micropython way?) make CFLAGS_EXTRA=-DULAB_NUMPY_COMPATIBILITY=0

lapis hemlock
#

Yeah, that much is clear, but won't people be unhappy, if they have to supply pre-processor constants on the command line?

onyx hinge
#

You would prefer to see them edit the file with the #define ULAB_NUMPY_COMPATIBILITY line in it?

#

and not seeing (0) or (1) as the current value might confuse?

#

in that case maybe you just needed (1 && !defined(CIRCUITPY)) in lieu of (1 && !CIRCUITPY) ?

#
  • a comment, comments never hurt
timber mango
#

@prime flower I'm using a snippet and getting an error that it wants WiFiManager ```Traceback (most recent call last):
File "code.py", line 47, in <module>
File "adafruit_io/adafruit_io.py", line 480, in init
TypeError: This library requires a WiFiManager object.

#

nm, I needed to pull the latest release

lapis hemlock
#

(1 && !defined(CIRCUITPY)) in lieu of (1 && !CIRCUITPY) I think this is the missing link.

onyx hinge
#

sure, circuitpython can start supplying -DULAB_NUMPY_COMPATIBILITY=0 next time we synch up

lapis hemlock
#

OK.

timber mango
#

thank you @prime flower it's working with one variable uploading to Adafruit IO. If all goes well I can post and share in the next several days. Thanks for making this a priority!

idle wharf
#

@timber mango did that sample work for you with the wifi.connect call and no wifi.radio.start_scanning ? I thought you had to scan, check each network for a match and then connect when its found. Maybe its changed though

timber mango
#

this is what I am doing

#
print("Connecting to %s"%secrets["ssid"])
wifi.radio.connect(secrets["ssid"], secrets["password"])
print(print("Connected to %s!"%secrets["ssid"]))
print("My IP address is", wifi.radio.ipv4_address)```
idle wharf
#

NVM... it does work as written.

#

My feather was just unhappy and then the magtag worked...

#

Thanks @timber mango !

idle wharf
#

Thanks @prime flower for the HTTP updates to IO

prime flower
#

...what is that plate ๐Ÿ˜ฎ

timber mango
#

more surprises

lament sentinel
#
``` now with emojis
crimson ferry
idle wharf
#

@crimson ferry you're a mind reader. I am using that PR!. saw on the deep dive yesterday. Also super easy to try PRs with the new github cli gh pr checkout 3727

I think I do the scan because Scott did it that way months ago and my guess is connect changed since then when he first got it to work. The code keeps changing on me. ๐Ÿ˜‰

crimson ferry
#

Yes, things change fast, I have a hard time keeping up, let alone testing

#

especially on this port

#

We'll have a really nice S2 connect function... connect directly to a BSSID, connect to first available AP on a channel, or connect to best RSSI among multiple APs of same SSID

ornate breach
#

@onyx hinge do you know anything of the CI test process for PRs?

#

wondering if there is anything I can do to fix the failure issues of the CI Test on my end

timber mango
#

Just doing a library include causes frequent hangs on the S2 board

onyx hinge
#

@ornate breach enough to be a menace.

ornate breach
#

oui

#

failing pre-commit and CI test (at build stubs)

#

the build stubs test I'm not entirely sure there is anything I can do about that

onyx hinge
#

well, first thing to deal with is a common snafu when using git

#

it looks like various "interesting" things have happened in your git history, including some changes you don't intend to make

#

these are changes in "submodules". I've never been good at explaining submodules, but one of your commits makes unintentional changes to them: https://github.com/adafruit/circuitpython/pull/3729/commits/06c7e6f22a7c9e6d3834e9a090f9c29c70af3b01

GitHub

Hello!
I've been wrapping up development of my first Circuit Python compatible board, the CP Sapling. I've built and tested the configuration today in making sure everything works a...

#

git has a deceptive way of presenting submodules as though you've changed them, and encourages you to add and commit them. You have to learn that git is tricking you.

ornate breach
#

makes sense

onyx hinge
#

so now that you're in this situation, what to do? Here's what I would do: I would make sure and take a copy of all my intentionally added files and stash them somewhere safe outside of git

#

then I'd get a fresh git situation, where my branch was exactly equal to adafruit's "main" branch, but it has a meaningful name, such as "add-sapling"

#

then I'd copy my new files back in, add and commit them

#

and create a fresh pull request

#

which of those steps do you feel comfortable trying on your own and which do you want coaching with?

#

also do you have reasonably fast/unmetered internet or are access costs a concern?

ornate breach
#

should be able to manage

onyx hinge
#

I could talk you through advanced stuff like using git rebase etc, depends if you want to get the job done, expand your git know-how, or what

onyx hinge
#

also I sometimes give different advice than the guides, so I may teach you something different than what the "official" is; I did a lot of git before ever starting on circuitpython

#

so just be aware of that

ornate breach
#

I learned the really hard way to managing Git team repositories this summer

#

so so many merge conflicts and whatnot

onyx hinge
#

@timber mango we know that in some versions including "6.0.0 stable", i2c is very _un_stable on esp32s2. However, we believed it was fixed in 6.1.0.alpha.1. If you're finding it's not, it may merit a fresh issue on github. At least I think that is an i2c breakout you're working with.

lime trellis
#

What common things should I look into if I'm only seeing memory allocation errors AFTER converting all my files to mpy??๐Ÿ˜ข
mpy-cross compiling issues? Some strange import order thing?
(xpost from help-with-cp)

timber mango
#

@onyx hinge it is the latest build for the S2 and the latest libraries too. Adafruit CircuitPython 6.1.0-beta.1 on 2020-11-20; FeatherS2 with ESP32S2 all is over I2C

onyx hinge
#

@timber mango OK, can you file an issue on github and describe in a little more detail what you're seeing?

timber mango
#

yes, I will do a new script using the demo code and document what I am seeing

manic glacierBOT
onyx hinge
#

Thanks!

#

@ornate breach OK now you have the unwanted changes taken care of, yay! CI will still fail, boo!

orchid basinBOT
ornate breach
#

dang

#

failing on pre-commit again

crimson ferry
ornate breach
#

"trim trailing whitespace" failed

crimson ferry
#

To me, it seems I'd want to enable more (lower-severity messages) at runtime if debugging, and seems that requires extensive changes all over ๐Ÿ˜ฆ

ornate breach
#

huh..

onyx hinge
#

@ornate breach so there are at least two things left to do .. first is set up pre-commit locally and use it to help you resolve the problems. https://pre-commit.com/

#

so you'll install the pre-commit program (e.g., with pip) and then activate it in your particular git clone (pre-commit install).

#

Then you can run pre-commit and commit the result manually, like so: ```$ pre-commit run --all-files
Check Yaml...............................................................Passed
Fix End of Files.........................................................Passed
Trim Trailing Whitespace.................................................Failed

  • hook id: trailing-whitespace
  • exit code: 1
  • files were modified by this hook

Fixing ports/atmel-samd/boards/CP_Sapling_m0/pins.c
Fixing ports/atmel-samd/boards/CP_Sapling_m0/board.c
$ git commit -m"trim trailing whitespace" ports/atmel-samd/boards/CP_Sapling_m0/board.c ports/atmel-samd/boards/CP_Sapling_m0/pins.c
Check Yaml...........................................(no files to check)Skipped
Fix End of Files.........................................................Passed
Trim Trailing Whitespace.................................................Passed
[detached HEAD 84145a8f6] trim trailing whitespace
2 files changed, 3 insertions(+), 3 deletions(-)

#

once you've set this up the good thing is, it actually gets checked locally instead of remotely. BUT we still have one more thing to do if I'm not mistaken

#

there's a file .github/workflows/build.yml -- you may have to "show hidden files" to get to the .github directory/folder, depending on your os and editor

#

on about line 178, add your new board in case sensitive alphabetical order, so between ADM_B_NRF52840_1 and TG-Watch02A if I'm not mistaken.

#

make a new commit and then push your two new commits and we'll see what happens

ornate breach
#

okay

#

passed precommit

#

now waiting on CI test

#

Thank you for the direction @onyx hinge ๐Ÿ™‚

onyx hinge
#

thanks for your contributions!

#

It can feel onerous to get through all the hoops so I appreciate you and your time

ornate breach
#

yeah, it's all worth it in the end ๐Ÿ™‚

#

makes it easier for the next board I add

#

odd, the new commit didn't reflect the change.

timber mango
#

in my app I am using several sensors for i2c using this: i2c = busio.I2C(board.SCL, board.SDA, frequency=100000)

#

I want to use another but the example is this sensor = LC709023F(board.I2C()) what is the correct call here for the sensor?

fathom shell
#

IIRC busio is the older way of doing it

timber mango
#

would the newer way be something like sensor = LC709023F(i2c())?

orchid basinBOT
#

This activate when my browser connect to accounts.adafruit.com and if I browse in an anonymous browser, I don't have that behaviour.
This also explain that I don't have the behaviour in Edge, I never connected to Adafruit.com with Edge (Chromium version).
It might also be linked to 2Factor, because I enabled that recently, and do not remember that behaviour.

Maybe why is it a bug you may ask?
The page should change both language selection (for 6.0.0 and 6.1.0 beta) or none.

There is ...

fathom shell
#

I think it would be the second way you had it: sensor = LC709023F(board.I2C())

onyx hinge
timber mango
#

@fathom shell that's from the example, but I don't think I can use busio and board at the same time

ornate breach
#

okay now it should be fixed

#

๐Ÿคž

fathom shell
#

Oh i see I misunderstood @timber mango If you want to use just busio then I think it would be sensor = LC709023F(i2c) where i2c is the busio object. That's how I did it until I learned that board.I2C() is the "newer" way

onyx hinge
#

@ornate breach looks like the change to build.yml is still absent

#

umm and pre-commit is unhappy again

ornate breach
#

okay, ran pre-commit local and pushed again

#

as for build.yml... do I need to change the locally/manually?

fathom shell
#

@timber mango hope it worked!

timber mango
#

It did, thank you

fathom shell
#

woot!

onyx hinge
#

@ornate breach right, you need to edit and commt that file, adding your new board to the list of all boards in the right spot alphabetically

jaunty juniper
#

I think board.I2C() just creates a busio I2C object on the default I2C, so you can i2c = board.I2C() as a shortcut for using board.SCL, board.SDA

ornate breach
#

where is the build.yml file? i know it's a hidden file, just curious what directory?

onyx hinge
#
.github/workflows/build.yml```
#

it's not just an idle question, when you need to edit it

fathom shell
#

@jaunty juniper I think you're right from when I was last reading about this

ornate breach
#

found it, I think

#

guess we'll see ๐Ÿ™‚

onyx hinge
#

oh I guess there's an espidf module

ornate breach
#

did I break it?

#

lol

#

I'm only seeing 1 test now

timber mango
#

If I connect to wifi, upload to Adafruit IO, then sleep for a minute or more, do I need to do anything to reconnect to wifi, such as put this in my "while" loop? # Connect to WiFi try: print("Connecting to %s"%secrets["ssid"]) wifi.radio.connect(secrets["ssid"], secrets["password"]) print(print("Connected to %s!"%secrets["ssid"])) print("My IP address is", wifi.radio.ipv4_address) except ImportError: print("WiFi issues") raise

ornate breach
#

Do I need to poke the CI again?

onyx hinge
#

github gets tired sometimes, I'd give it an hour to shake loose

ornate breach
#

sounds good

#

I need to look at dinner for my kiddos

crimson ferry
#

@timber mango esp32-s2 automatically reconnects when necessary (once you've done a connect)

ornate breach
#

eh now there's an issue with the check yaml

#

okay so it was because I used a tab instead of spaces.

#

darn those ascii character representation of tabs compared to spaces

#

I can see now why people argue over 2/4 spaces vs tabbing

timber mango
#

@crimson ferry I see this error where my code posts to AIO, sleeps, then fails. ```Traceback (most recent call last):
File "code.py", line 86, in <module>
File "code.py", line 72, in <module>
File "adafruit_io/adafruit_io.py", line 656, in get_feed
File "adafruit_io/adafruit_io.py", line 542, in _get
File "adafruit_requests.py", line 594, in get
File "adafruit_requests.py", line 581, in request
File "adafruit_requests.py", line 119, in init
RuntimeError: Unable to read HTTP response.

ornate breach
#

apparently I need to revisit the alphabet

crimson ferry
#

@timber mango if you try/except and retry, what happens?

blissful badger
#

Hi! I'm very new at using the circuit python libraries. Does anyone know which libraries I can use to output images and text to an e-ink display? I'm using a magtag. Can I just use displayio? and if so which displayio should I use? Sorry if that is a really basic question.

crimson ferry
ornate breach
#

yay it worked! thanks @onyx hinge again

onyx hinge
#

excellent!

ornate breach
#

now just to get through all the other builds

manic glacierBOT
blissful badger
#

ty @crimson ferry I will read through that! also I thought i was in that channel whoops โค๏ธ tyvm

manic glacierBOT
#

Testing performed:

  • used a Kaluga & UDA1334 I2S DAC breakout
  • scoped both logic & audio signals
  • Didn't test wavefiles from flash

The good:

  • Plays a 128-frame, 256-frame, or 512-frame looping RawSample at 8kHz consistently without problem

The bad:

  • If the audio chunk is not a multiple of the I2S dma buffer length, there are glitches even though my code attempts to handle this case.
import array
import audiobusio
import audiocore
import board
import supervisor
...
idle wharf
#

@timber mango I also see that sort of errror and no sleep involved. Just doing a get.

>>> wifi.radio.connect(config.SSID, config.WIFI_PASSWORD)
>>> print(f"ip: {wifi.radio.ipv4_address}")
ip: 192.168.1.246
>>> pool = socketpool.SocketPool(wifi.radio)
>>> requests = adafruit_requests.Session(pool, ssl.create_default_context())
>>> response = requests.get("https://io.adafruit.com/api/v2/time/seconds")
>>> response.text
'1605909658'
>>>
paste mode; Ctrl-C to cancel, Ctrl-D to finish
=== for i in range(0, 10):
===     try:
===         response = requests.get("https://io.adafruit.com/api/v2/time/seconds")
===     except OSError:
===         print(f"Try #{i} failed with OSError: Sleeping for 2 secs before next try.")
===         time.sleep(2)
===         continue
===
Traceback (most recent call last):
  File "<stdin>", line 7, in <module>
  File "<stdin>", line 3, in <module>
  File "/lib/adafruit_requests.py", line 594, in get
  File "/lib/adafruit_requests.py", line 581, in request
  File "/lib/adafruit_requests.py", line 119, in __init__
RuntimeError: Unable to read HTTP response.
>>> print(f"ip: {wifi.radio.ipv4_address}")
ip: 192.168.1.246
crimson ferry
#

@idle wharf I'm seeing this too , every other GET, and takes a full minute to get the RuntimeError: Unable to read HTTP response. exception. (FeatherS2; 6.1.0-beta.1)

lament sentinel
#

@lone axle And I got your bootloader reboot snippet to work on my Titano. ```PS C:\Users\bcr00\Source\bcr\blinka-cli> python .\blinka.py bootloader --port com3
๐Ÿ‘ Rebooting device in bootloader mode

lone axle
#

Nice! it connects and executes via REPL?

lament sentinel
#

Yeah, basically it's "fire and forget" so I send like three Ctrl+C and then the code and then ๐Ÿ™

lone axle
#

I am familiar with this technique ๐Ÿ˜Ž

lament sentinel
lone axle
#

Would you be interested in a command that will read a local .py file and send it into the REPL one line at a time?

lament sentinel
#

Yeah, sweet

lone axle
#

I have something like that in the old Android Circuit Python editor I made, and I always really liked the agility of being able to run a script without changeing code.py

lament sentinel
#

I think collecting the output is the only derp part of that

idle wharf
lament sentinel
manic glacierBOT
lone axle
#

interestingly it also looks like I went a bit lower, only 50ms between commands when re-writing the code file on the device via REPL.

timber mango
#

what's the formatting example for try/retry? I can't find any examples besides try/except

crimson ferry
#

@timber mango Easiest is try/except, and just pass in the except to skip that time (retry would be manually set up somehow... timing, loops, within the except, etc)while True: try: r = requests.get(TEXT_URL) print(r.status_code, r.reason, r.headers, r.text) except Exception as e: # RuntimeError: Unable to read HTTP response. # ConnectionError: Unknown failure sys.print_exception(e) # ...

timber mango
#

OK thank you

#

what's interesting is that I have a bme680 sensor, the battery gauge, and the pm25 air sensor all connected via stemma cables to a Feather S2. Alone on the circuit the battery sensor runs the test sketch fine, but when I fold it in with the rest of the sketch it routinely crashes the board. Without the battery sensor library, the AIO stuff runs pretty reliably

#

It looks like my board hangs before it even connects to wifi

#

This is super common: ```Press any key to enter the REPL. Use CTRL-D to reload.soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Connecting to dha

#

then it disconnects and the board comes back as "not recognized" until I reset it again

idle wharf
#

@timber mango I feel like you are doing the exact same things as I am today.
I also see these wifi.connect hangs after reboots that work fine with a reset.

#

I will unhook my battery

#

( I am using my MetroS2 right now, but I was seeing the same things on a FeatherS2)

timber mango
#

ew gross, it is hanging Putty too ๐Ÿ™‚

#

I just disconnected my battery too @idle wharf

idle wharf
timber mango
#

are you using wifi.connect or wifi.radio.connect?

idle wharf
#

wifi.radio.connect

#

There is no wifi.connect

timber mango
#

here's what I have so far

idle wharf
#

I am running my own build from cp@main

somber epoch
#

Hello everyone, does anyone know of a project that measures decibels? I need references on this topic

idle wharf
manic glacierBOT
manic glacierBOT
idle wharf
# manic glacier

That's not ready to read yet. Accidentally hit submit. Still entering.

manic glacierBOT
#

I'm working on a library and happened to grab a Feather STM32F405 to work on and eventually found that the bug I was experiencing was due to the following code not being executed as a repeated start;

        buffer = bytearray([0x80, command_id])
        with self.i2c_device as i2c:
            i2c.write_then_readinto(buffer, buffer, in_end=1)
        return buffer[0]

Here's the trace of the STM32, flashed to CP6.1.0beta 1
![image](https://user-images.githubusercontent.co...

lament sentinel
#
Model: PyPortal M4 Express
Board-ID: SAMD51J20A-PyPortal-v0
``` rrrr not enough info here to get the right firmware (this is a Titano)
maiden kettle
#

In circuitpython how to send data from adfruit BLE LE module to andoid app.

lament sentinel
#
PS C:\Users\bcr00\Source\bcr\blinka-cli> type E:\boot_out.txt
Adafruit CircuitPython 6.0.0 on 2020-11-16; Adafruit PyPortal Titano with samd51j20
PS C:\Users\bcr00\Source\bcr\blinka-cli> python .\blinka.py update --unstable
๐Ÿ‘ The latest available version is 6.1.0-beta.1 and you have version 6.0.0
๐Ÿ‘ Retrieving firmware from https://downloads.circuitpython.org/bin/pyportal_titano/en_US/adafruit-circuitpython-pyportal_titano-en_US-6.1.0-beta.1.uf2

At this point I would like to:

1. Reboot your device in bootloader mode
2. Copy the firmware to the bootloader drive to update it

ALWAYS BACKUP YOUR CODE BEFORE INSTALLING OR UPDATING CIRCUITPYTHON

You can use the convenient "blinka backup" command to do this!

For more information please see https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython

OK, have you made your backup and are you ready to do this? [y/N]y

๐Ÿ‘ Rebooting device in bootloader mode
๐Ÿ‘ Waiting a bit for things to settle
๐Ÿ‘ Copying adafruit-circuitpython-pyportal_titano-en_US-6.1.0-beta.1.uf2 to E:\
๐Ÿ‘ Waiting a bit for things to settle
๐Ÿ‘ I checked the current version and it looks right! All updated.
PS C:\Users\bcr00\Source\bcr\blinka-cli> type E:\boot_out.txt
Adafruit CircuitPython 6.1.0-beta.1 on 2020-11-20; Adafruit PyPortal Titano with samd51j20```
lone axle
#

these are capable of sending to the bluefruit connect app on Android

stuck elbow
#

but they don't use the module

lone axle
#

ah, missed that part, I don't think I'm familiar with that module

lone axle
#

How does the boot_out.txt file get generated? is the code that creates that relatively accessible?

ornate breach
#

Thought it was an artifact of the CP uf2 initization

#

So with that in mind, it might be specified in a file in the build path for make command.

#

But thatโ€™s just a guess

jaunty juniper
#

all I know is it's where the output of boot.py goes

lone axle
#

looks like some of the relavent info is in mpconfigboard.h in the device folder.

#

that may be enough for what I'm thinking about.

thorny jay
#

I have just made a backup of all my board and upgraded them to 6.0.0. (except MagTag). Some board have corrupted files, I can format the drive from my host... but is there a python command to format the file system and automate a bit the process? Thanks.

jaunty juniper
#

are you looking for storage.erase_filesystem() ?

lone axle
#

is there a place in the repo somewhere I could look to find the [WHATEVER]BOOT that every device uses?

ornate breach
#

Nice hunting!

hollow gazelle
#

#MagTag network issues...
My clock demo would run for an hour till it was time to fetch new localtime
After things got hung up, I got the "feeling" that pressing reset to restart the demo gave me more reliable reconnections

then I switched from using Mu editor serial to putty and learned something
often putty serial would stay connected, and I could just type ctrl-d to restart the app, though often it would not connect
What was interesting was that sometimes putty would disconnect and I would get the network connection again
( is there a watchdog time in the #MagTag? why would it disconnect from USB serial ? did it reboot the #MagTag ? )

Getting time for timezone America/Los_Angeles
Traceback (.....
File "adafruit_magtag/magtag.py", line 288, in get_local_time
File "adafruit_magtag/network.py", line 203, in get_local_time
File "adafruit_magtag/network.py", line 185, in get_local_time
File "adafruit_requests.py", line 594, in get
File "adafruit_requests.py", line 581, in request
File "adafruit_requests.py", line 119, in init
RuntimeError: Unable to read HTTP response.

Code done running. Waiting for reload.
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

Press any key to enter the REPL. Use CTRL-D to reload.soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:

Connecting to AP NETGEAR18
Traceback (.....
File "adafruit_magtag/network.py", line 309, in connect
File "adafruit_magtag/network.py", line 304, in connect
File "adafruit_magtag/wifi_module.py", line 67, in connect
ConnectionError: No network with that ssid

Press any key to enter the REPL. Use CTRL-D to reload**.soft reboot**

### this last time was where the serial disconnect occurred, and I was able to connect

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:

Connecting to AP NETGEAR18

lone axle
#

I have similar failures to connect to network sometimes. You can add some retry logic in the code if you want, it will usualloy succeed on subsequent tries as long as there is not an actual issue with the network.

#

@lament sentinel how do the backup zips work in windows? are all of the files right inside the root of the zip? or are there intermediary folders like CIRCUITPY and/or others?

lament sentinel
# lone axle <@!342503649294942211> how do the backup zips work in windows? are all of the fi...
Archive:  backup-2020-11-21-02-18-49.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  2000-01-01 00:36   .metadata_never_index
        0  2000-01-01 00:36   .Trashes
       85  2000-01-03 01:37   boot_out.txt
   614538  2020-09-05 12:53   pyportal_startup.bmp
   268856  2019-12-09 17:25   quote_background.bmp
    86828  2019-12-09 16:53   pyportal_startup.wav
      378  2020-09-05 16:17   secrets.py
     1803  2020-09-08 01:56   code.py
        0  2000-01-01 00:36   .fseventsd/no_log
    21755  2020-09-06 06:09   lib/adafruit_pyportal.mpy```
lone axle
#

no intermediates. Hmm. On linux I ended up with /media/$USER/CIRCUITPY/ inside my zip

#

not a huge problem but might look for a way to cut out the extras

lament sentinel
#

Trailing slash needed?

#

That is, for me the root looks like E:\

#

Oh, you ended up with the whole path? Hm. Yeah, this is probably a Python-ism. Plus when StackOverflow wrote the code for me they may not have gotten it right ๐Ÿ˜† -- specifically zipdir

lone axle
#

I think its because drives like E:\ are pretty much at the root of the computer. But in my environment the CIRCUITPY drive shows up in /media/$USER/CIRCUITPY.

#

where $USER is my actualy username. Since it's deeper in the filesystem they are ending up in the zip too. is my guess

lament sentinel
#

Yep, good point. So "relative to the root" here needs to be redefined to your prefix

#

Hey, super happy you dropped some PRs, I am sorting through them

lone axle
#

Happy to help out. This is a really nifty utility.

lament sentinel
#

Probably adds 20% to my energy level that someone likes it

#

I'd like to get it to the point where there's a top-level blinka you can run (like pip) but my Python-fu needs work.

#

(holy smokes those bitmaps for the portal are pretty beaucoup i just noticed)

#

Makes me feel spoiled to have 1MB just to blow on pictures

lone axle
#

if you haven't seen it yet check out https://github.com/adafruit/circup it's also a python based CLI and it does have that top level command magic. I'm not sure how that part of it works though.

lament sentinel
#

Update 'adafruit_binascii'? [y/N]: Y these fine folks have great taste

#

I didn't know of this -- I was actually going to mess with the package side of this next (copy over the latest libraries depending on the version.)

#

I think there's a partnership here of some sort, thank you for pointing this out

lone axle
#

yep you're welcome. ๐Ÿ™‚

#

I am thinking of also adding erase command that will run storage.erase_filesystem() in the REPL. After stern warnings and a prompt.

#

something like python blinka.py restore ./backup.zip might be cool as well that will wipe the device and then copy the backup things back into it.

#

extra fancy would be to read boot_out from inside the zip and flash that version before restoring the rest of the files.

lament sentinel
#

Yeah, I think a restore is definitely in the cards

#

And yeah, the meta point here is "how can I get my device in a known good state"

#

Like some days I'm working on this project on my Titano. And other days this one. And I want to keep each environment in sync so I can just swtich without drama

#

Which seems to be complicated a little bit by keeping libraries and CircuitPython versions in sync, and then maybe your two projects need different versions right now

lone axle
#

seems like it could be super helpful for helping troubleshoot if we can pass a full "image" of the device around as well.

lament sentinel
#

(so when you switch to Project B, does it downgrade your CircuitPython to 5.3.1)

#

Yeah absolutely on the troubleshooting through backups

lone axle
#

I think it should be able to downgrade as well

lament sentinel
#

Yeah, so the metadata I have only has the latest version

#

But I can put in the "you're the doctor" force of the version you'd like to stick on it

#

so blinka update --version=5.3.1

#

or whatever

lone axle
#

yep, I would definitely like that

#

perhaps down the line a bit, but even being able to specify a git commit hash from the list builds on S3 would be cool as well.

lament sentinel
#

If we can come up with some way to get to a URL of a UF2 I don't care how we get there. I mean, the easiest is blinka update --firmware=https://downloads.circuitpython.org/bin/matrixportal_m4/en_US/adafruit-circuitpython-matrixportal_m4-en_US-6.0.0.uf2 and OK, pal, you're the doctor

#

(likewise that can be in the local FS too)

#

"but you're on a Titano, sir!" "tut tut i am an expert"

lone axle
#

I think we'll be able to build the URLs as needed based on a bit of input from the user

lament sentinel
#

Well yeah, but at what point do we stop hand-holding. Like if you're doing poweruser partying, hey, go get 'em. Not for beginners

#

I do see your point, and I already have --locale and --board and whatever to help out

#

Oh by the way, if you run --verbose when you do stuff, does the temp directory stuff look right? It should

lone axle
#

I think so

#

if it's an icon to the left thjere

#

doh, it's a quote and a comma.

crimson ferry
#

(spent way too much time grep-ing circuitpython before realizing the bootloader was totally separate)

lone axle
#

Yep I did end up finding it for atmel boards specifically

#

it seems there are a few different bootloader repos though I hadn't come across that one yet. thank you.

lament sentinel
#

I'm glad the emojis work. I kinda like them

#

Hey, can you fix the board list in that other PR, and then I'll commit that

#

(first one is merged, so you can pull that)

lone axle
#

@lament sentinel got it merged now. Thank you.

lapis hemlock
#

@onyx hinge Jeff, is it possible to run a script on github, and then save the output back into the repository? I am thinking of adding benchmarks to ulab, and my idea is that people would have to upload only two lines, the platform information, and the execution time, and github would format these fragments into a nice-looking rst file.

onyx hinge
#

@lapis hemlock yes there are various ways to do this. I can tell you about one I've used...

lapis hemlock
#

OK, I am all ears

onyx hinge
#

Line 30 is where my updating happens, that would be your hypothetical benchmark data

#

then lines 36-40 are where it creates a new commit and pushes it.

lapis hemlock
#

Fantastic, many thanks!

onyx hinge
#

I'm not 1000% this is correct, but it's intended to "push only if the commit actually makes a change" if git commit -m"update iersdata" iersdata.py; then git push origin HEAD:main; fi

#

if the file iersdata.py didn't change, I don't want any commit to be pushed

lapis hemlock
#

These are minor details, and the workflow file that you linked is definitely an excellent starting point.

onyx hinge
#

I know that I took the technique from someone else, but I don't know who to credit.

#

one thing to note is that this will NOT start the normal "on push to your main branch" steps

#

oh and notice that I am explicitly pushing to "main", I think you still use the "master" convention for your primary branch in ulab

lapis hemlock
#

I can still set the trigger, right?

#

I mean, there is nothing preventing me from doing so, is there?

onyx hinge
#

in my case I'll have to tackle it someday if I decide to publish the package -- I would want to publish a new package whenever the data file changed

lapis hemlock
#

I think I should set this as my start page. This is really useful stuff.

lament sentinel
lone axle
#

I am able to review (think anyone can by default) adding me as a contributor I think would give rights to push into the repo, but I am not certain.

#

code looks good to me, will test it out in just a moment.

#

and leave a review on there once I have

#

Ah, maybe in order to "request my review" within the system I might need to be actually. But I can leave a review even without that.

lament sentinel
#

I'm not wound up about the actual formal review, just the notification getting to you that I did something

lone axle
#

ah, yeah I do think that requires the user to have access to the project

#

you can always ping me in the comment on a PR if you want though I should see it that way. I also just turned on did "watch" for PRs so if I understand correctly I'll get a message about the next one

lament sentinel
#

np, happy for the help

supple gale
hearty tapir
#

To me that was the stuff that didn't work properly. I'll look at some i2c tomorrow and probably also stumble upon some issues.

supple gale
#

I could rebuild it with that flag. I was actually almost about to. Almost ๐Ÿ™‚

supple gale
#

the output looks identical up to here

I (120928) wifi:AP's beacon interval = 102400 us, DTIM period = 1
#

then nothing.

lament sentinel
#

@lone axle ```PS C:\Users\bcr00\Source\bcr\blinka-cli> python .\blinka.py update
๐Ÿ‘ The latest available version is 6.0.0 and you have version 6.1.0-beta.1
๐Ÿ‘ No upgrade required, thanks for checking!
PS C:\Users\bcr00\Source\bcr\blinka-cli> type E:\boot_out.txt
Adafruit CircuitPython 6.1.0-beta.1 on 2020-11-20; Adafruit PyPortal Titano with samd51j20
PS C:\Users\bcr00\Source\bcr\blinka-cli> python .\blinka.py update --firmware-version=6.0.0
๐Ÿ‘ Retrieving firmware from https://downloads.circuitpython.org/bin/pyportal_titano/en_US/adafruit-circuitpython-pyportal_titano-en_US-6.0.0.uf2

  1. Reboot your device in bootloader mode
  2. Copy the firmware to the bootloader drive to update it

ALWAYS BACKUP YOUR CODE BEFORE INSTALLING OR UPDATING CIRCUITPYTHON

You can use the convenient "blinka backup" command to do this!

For more information please see https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython

OK, have you made your backup and are you ready to do this? [y/N]y

๐Ÿ‘ Rebooting device in bootloader mode
๐Ÿ‘ Waiting a bit for things to settle
๐Ÿ‘ Copying adafruit-circuitpython-pyportal_titano-en_US-6.0.0.uf2 to E:
๐Ÿ‘ Waiting a bit for things to settle
๐Ÿ‘ I checked the current version and it looks right! All updated.
PS C:\Users\bcr00\Source\bcr\blinka-cli> type E:\boot_out.txt
Adafruit CircuitPython 6.0.0 on 2020-11-16; Adafruit PyPortal Titano with samd51j20
PS C:\Users\bcr00\Source\bcr\blinka-cli>```

lone axle
#

nice!

onyx hinge
#

@lapis hemlock an alternative for you to consider: Write a numpy.py for the circuitpython-ulab, and arrange for it to be in a directory listed in MICROPYPATH. Now, a test which says try: import numpy as np except: import ulab as np will get the compatibility numpy.py when you run the circuitpython tests. bonus, cp users who prefer numpy-compatible naming can get it by adding this file to their CIRCUITPY lib!

#

I assume this numpy.py mostly says from ulab import *; from ulab.<each submodule with a few exceptions> import *

#

the goal being to get back to a single set of test files

lament sentinel
#

shIRtty was probably clever in someone's head, but I have trouble saying it out loud

idle wharf
supple gale
#

At least nothing from the wifi that is different.

idle wharf
#

In my bug, I see two different things going. In one case after the first sleep, the http requests is using vanishes. I put print(http) after line 113 and there is an HTTP then there's not. https://github.com/adafruit/Adafruit_CircuitPython_Requests/blob/master/adafruit_requests.py#L113

In my second case where it works 2 times. (and some my code is inside the While) I think the pool is disappearing but I didn't dig into it too deeply.

If these are all related, what happens during time.sleep() which causes things to go away? Is the underling os, IDF, or MP doing some sort of cleanup ? No idea.. but that's my natural question...

supple gale
#

Well i rebuilt the main branch using the previous esp_idf submodule commit. Now it tends to die after a restart with core 0 panic. I seem to be going backwards fast. I will now watch some comedy on netflix. ๐Ÿ™‚

lone axle
#

will try this in the morning.

supple gale
#

The tiny code snippet sometimes hangs, sometimes panics core 0
When breaking out of loop (CTRL-C) then continuing (CTRL-D)
If I comment out the I2C instantiation it works.

supple gale
#

And if I pull the wifi code out and leave the i2c in it will hang sometimes when interrupting and attempting to restart the program with CTRL-D.

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

This is wrong. It prevents printing an exception twice, which I do in #3696 (once to measure the length of the traceback, once to get the text) and which people may want to do for other reasons, itโ€™s available from Python via sys.print_exception(). (For some reason, it also causes the terminalio screen to be drawn over the stage screen, havenโ€™t investigated that yet.)

The problem observed in #2056 is specific to adafruit_midi in that it raises the same exception instance every time...

crimson ferry
#

This is a new one: AttributeError: 'TextIOWrapper' object has no attribute 'datetime' triggered by if (time.time() < 946684800) or (time.time() > (2**31 - 1)):?

#

Haven't changed that code in ages. 6.0.0 doesn't like it (Feather M4).

#

time.time() itself seems to be the culprit. In REPL, went to safe mode.

#

erase_filesystem() fixed it, then it came back. Must be a deeper flash or hardware issue.

lone axle
#

Is there a way to tell which bootloader is on a device specifically?

crimson ferry
#

besides the INFO_UF2.TXT?

lone axle
#

ah, thank you.

crimson ferry
#

I wish there was a way to see that partition from CircuitPython

lone axle
#

how about checking for esptool or bossa type ones? just try to issue a basic id command or something and see if it succeeds?

crimson ferry
#

no idea there

#

oh, lol, never looked at it before, but the INDEX.HTM on the *BOOT drive is a JS redirect to the Adafruit product page

lament sentinel
lament sentinel
#

@lone axle I looked at the version info that Bossa reports for my board and it's junk. PS C:\Users\bcr00\Source\bcr\blinka-cli> python .\blinka.py bootloader ๐Ÿ‘ Rebooting device in bootloader mode PS C:\Users\bcr00\Source\bcr\blinka-cli> type E:\INFO_UF2.TXT UF2 Bootloader v1.23.1-adafruit.1-89-gcfdd5ba SFHWRO Model: PyPortal M4 Express Board-ID: SAMD51J20A-PyPortal-v0 PS C:\Users\bcr00\Source\bcr\blinka-cli> & 'C:\Program Files (x86)\BOSSA\bossac.exe' -p COM9 -i Device : ATSAMD51x20 Version : v1.1 [Arduino:XYZ] Feb 22 2019 12:20:42 Address : 0x0 Pages : 2048 Page Size : 512 bytes Total Size : 1024KB Planes : 1 Lock Regions : 32 Locked : none Security : false BOD : false BOR : true PS C:\Users\bcr00\Source\bcr\blinka-cli>

lapis hemlock
#

But the circuitpython stuff would have to be tested anyway, so I am not sure, we can get rid of the two-tier solution.

crimson ferry
lament sentinel
crimson ferry
#

@lament sentinel That's very cool. Looks like some of those identifiers need a step to check for completeness and uniqueness when integrating a new board.

lament sentinel
#

Namespaces are super hard -- like what relevant characteristics are we trying to jam into this fun little string. See: User-Agent

#

And do we just party hard and make a JSON file that dumps in all kinds of attributes. And then what happens when someone defines a new attribute. ๐Ÿ˜ข

#

And yeah, maybe a certifying authority of some sort -- not too much of a bureaucracy, but some attempt to peer-validate the choices so we don't make a mess out of this place.

#

If I ran the asylum, presuming our UF2 world sticks around, is mount a volume in bootloader mode with a particular file in it that has a well-known JSON file (maybe just key / value pairs if we don't want to make life too hard) with "enough metadata" and then have a discussion about what constitutes "enough", and then when we make new boards, have a review process to try and keep it clean

tulip sleet
#

Unfortunately, because CircuitPython is a fork of MicroPython, it is not searchable independently. That is a GitHub assumption (and flaw, in this case).

#

I am surprised this works, because I would expect numpy and ulab to complain that the values are out of range for a signed int8:

import ulab as np
print(np.array(range(2**8-5, 2**8), dtype=np.int8))
#

In CPython:

>>> import numpy as np
>>> print(np.array(range(2**8-5, 2**8), dtype=np.int8))
[-5 -4 -3 -2 -1]
>>> print(np.array(range(2**8-5, 2**8), dtype=np.uint8))
[251 252 253 254 255]
#

But for regular arrays:

>>> import array
>>> a = array.array('B', [0]*3)
>>> a[0] = 255
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: signed char is greater than maximum
#

The latter is what I'd expect numpy and ulab to do, but there must be some historical reason why numpy allows you to alias signed and unsigned values. (It may or may not be a good reason.)

lapis hemlock
#

@tulip sleet Even in python, int8(255) returns -1.

tulip sleet
#

The PR you mention https://github.com/adafruit/circuitpython/pull/1879 brought CircuitPython more into line with CPython semantics, and away from MicroPython. Unfortunately it sounds like you are relying on some bytearray, etc. routines that now have stricter semantics.

#

you mean numpy.int8()?

lapis hemlock
#

And the conversion, or the lack of thereof, is caused by the mp_binary_get_val_array/mp_binary_set_val_array functions, which are internal to micropython.

#

Yeah, I meant np.int8().

tulip sleet
#

right, so I'm saying that numpy doesn't rely on internal CPython routines analogous to those, or else it would get errors too. Instead it has its own conversion routines which allow that aliasing.

#

but ulab does rely on the MicroPython routines

#

as a timesaver and shortcut

lapis hemlock
#

A workaround could be that we just implement the conversion function in ulab, and if you compile for circuitpython, then it will be called.

tulip sleet
#

if you did not rely on mp_binary_get_val_array/mp_binary_set_val_array, then you would have your own routines, as numpy does. But that would be expensive in terms of code space.

#

would it make sense to add flags to those routines to allow the signed/unsigned aliasing?

lapis hemlock
#

Do you mean, in micropython?

tulip sleet
#

but then you'd be changing an internal MicroPython API, I guess, which is hard

#

actually, it would be in CircuitPython, because the errors are due to CircuitPython. MicroPython lets the (erroneous) aliasing through.

lapis hemlock
#

As I said, we can implement the function conditionally for circuitpython, and then you would have to decide, whether the flash space is worth it.

#

I think this is really a typical case of two wrongs make one right.

tulip sleet
#

which function do you mean? Do you mean alternate versions of mp_binary_get_val_array/mp_binary_set_val_array ?

Is this true only for 8-bit, or does it happen on 16-bit too? 32-bit is yet another case

lapis hemlock
#

mp_binary_get_val_array/mp_binary_set_val_array.

#

I am not concerned about 32-bit integers, because ulab does not support those.

tulip sleet
#

you just need to suppress the check, right, so that could be a boolean flag to the routine

#

I'll actually go look at the code, instead of just imagining...

lapis hemlock
#

I believe so.

tulip sleet
#

np.int8(512) is 0, so numpy is very casual about this.

#

it always just maps the bits and truncates, it doesn't care.

lapis hemlock
#
MicroPython 6.0.0-dirty on 2020-11-20; linux version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>> import ulab
>>> ulab.array([65534], dtype=ulab.int16)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: value must fit in 2 byte(s)
>>> 
tulip sleet
#

!

#

but how about ulab.array([254], dtype=ulab.int8)

lapis hemlock
#
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: value must fit in 1 byte(s)
>>> 
#

In micropython this works.

tulip sleet
#

oh, I saw MicroPython 6.0.0-dirty , I thought you were testing actual MicroPython

#

I missed the 6.0-.0

lapis hemlock
#

No, that was circuitpython.

tulip sleet
#

from setval_array:

            mp_int_t val = mp_obj_get_int(val_in);
            // Small int checking is separate, to be fast.
            mp_small_int_buffer_overflow_check(val, size, signed_type);
            mp_binary_set_val_array_from_int(typecode, p, index, val);
        }
lapis hemlock
#

mp_small_int_buffer_overflow_check is probably missing in micropython.

tulip sleet
#

so the buffer_overflow_check could be conditionalized, not at compile time, but with an extra argument to the routine. The routine could be renamed, the extra argument added, and you could call the new routine. The existing code would call the old routine name, which would pass the proper bool to the new routine to do checking.

#

I think that's what I added. Interestingly, I have zero memory of actually doing that PR. My brain is getting old.

lapis hemlock
#

OK, then this should settle the problem, I guess.

tulip sleet
#

i think that sounds like a good solution. I am still a little amazed at numpy's casualness, but it could be in the interest of data conversion or speed.

lapis hemlock
#

I have never mused the casualness of numpy, but such glitches certainly come out, when you have to re-implement certain things.

tulip sleet
lapis hemlock
#

OK, then here is another one for you a = np.array(range(5), dtype=np.uint8) a **= 2.0 is fine, but a = np.array(range(5), dtype=np.uint8) a **= 1.0 throws an exception ```---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-9a18d92b25ac> in <module>
1 a = np.array(range(5), dtype=np.uint8)
----> 2 a **= 1.0
3 a

TypeError: ufunc 'power' output (typecode 'd') could not be coerced to provided output parameter (typecode 'B') according to the casting rule ''same_kind''```

#

Go figure!

#

I found this while testing ulab, and it baffles me a bit.

tulip sleet
#

it's something in the depths of the exponentiation operator, i guess :/

lapis hemlock
#

Thanks for the historical reference!

#

But type-coercion seems to be an issue only for 1.0. With 2.0, the output is still an array of dtype uint8. I don't quite get it.

onyx hinge
#

@lapis hemlock It seems that **= of the float 2 is special case to be "squared", other float values (even the other integers) are not.

#

even weirder, the non-inplace version changes the type to float64.. ```>>> (np.uint8((1,)) ** 2.0).dtype
dtype('float64')

#
dtype('float64')
``` `**=` can change the type for scalars, but not for arrays !?
#

I wouldn't obsess over exact compatibility in these cases

manic glacierBOT
manic glacierBOT
#

Update tinyusb stack with PR https://github.com/hathach/tinyusb/pull/557 that fix race condition with host terminal on cdc connection. That cause echoed back message on connection with esp32 as follows.

Adafruit CircuitPython 6.0.0-278-g66fb09506 on 2020-11-16; MagTag with ESP32S2
>>> uto-reload is o
Traceback (most recent call last):
  File "", line 1, in 
NameError: name 'uto' is not defined
>>> 

The issue is also observed with nrf52840 as mentioned by @jepler

lament sentinel
manic glacierBOT
manic glacierBOT
manic glacierBOT
ornate breach
#

Curious... Once my board is merged into main and in a release, it should show up just fine in the MU Editor, right?

thorny jay
#

It use to take a lot of time, to get inside Mu, but recently they approuved a batch and changed the way to add.

manic glacierBOT
ornate breach
#

I'm looking at their github and I don't see where I would even add my board. Anyone familiar with this process?

thorny jay
ornate breach
#

ah thanks!

thorny jay
#

@ornate breach also you want to be on circuitpython.org so that your board firmware can be downloaded (not sure what board you are talking about).

ornate breach
#

just waiting on review and merge

thorny jay
ornate breach
#

Yeah, need to finish the Markdown and get the images ready

hearty tapir
#

Did you see the new ESP32-C3 (prototype) chip? https://esp32.com/download/file.php?id=5437 @slender iron I'm not entirely sure if this USB support is "enough" for CPY as they differentiate between "USB OTG" and "USB Device" in their data sheets. On the pro-side, it has some USB embedded in the chip .. ๐Ÿ™‚

onyx hinge
#

did someone who is experiencing i2c related crashes with esp32s2 open an issue with their reproduction steps? I'm not seeing it.

hearty tapir
#

@onyx hinge my biggest challenge is that my Pi4 is getting major hiccups due to the USB connection with my featherS2. I have a Kernel Exception/Panic on my dmesg very frequently. I believe I should file this issue more at the TinyUSB page though - or not? What would be your guidance?

onyx hinge
#

Many people have experienced that their linux host can crash by hotplugging circuitpython devices. These are bugs in the host computer OS, if the host computer OS can crash.

#

(it's not a BADUSB attack where we put 300V in the power lines, after all; it's just sending data on the D-/D+ lines)

#

that said, danh's efforts to interest linux kernel maintainers have not led to improvements

thorny jay
#

On @atomic summit Discord, you may find more user that experienced that.

turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Region

us-west

Channel Categories

8

Text Channels

56

Voice Channels

6

Members

25894

Roles

34

hearty tapir
#

@thorny jay & @onyx hinge thx. I'm part of UMs discord and I've seen multiple people reporting it. I agree that the issue is with the Host PC/OS, but likely this topic gets probably "political" quickly and emotions boil up. (I see this with myself, I'm not enjoying that red "cut here" on my backtrace either.) I'm just afraid I'll not be of much help, coming with my "single line"-patch experience ๐Ÿ˜„

onyx hinge
#

@hearty tapir I agree it's frustrating. I have a whole "sacrificial" pi zero I use for nothing but running the serial terminals of my circuitpython devices.

#

(the part where esp32s2's usb especially will connect/disconnect IS a circuitpython or tinyusb bug though)

hearty tapir
simple pulsar
#

@onyx hinge Yes from the UK.

onyx hinge
#

OK thanks

blissful pollen
#

@onyx hinge I commented on that I2C issue, on a call I'll look for it shortly

simple pulsar
#

@onyx hinge 525 errors too

idle owl
#

@tidal kiln FYI, working on another Which CP Board is Right for You? page - Beginner Boards. I'll send it your way when it's ready for you.

hearty tapir
analog bridge
#

I also get the 525 error

hearty tapir
analog bridge
#

update... now I am getting 503 with the cpy docs

tidal kiln
#

what's the expected behavior if a CP program is printing to serial in a loop and the host PC goes into sleep mode? so USB still has power, but host is suspended.

blissful pollen
onyx hinge
#

@blissful pollen OK, unfortunately folllowing the instructions in that issue no longer reproduces the problem for me since the merge of #3710 which I believe is in 6.1.0-alpha.1.

blissful pollen
#

If I get a chance later today I'll try to grab the latest and try to break it again

onyx hinge
#

Thanks, it's appreciated

manic glacierBOT
#

Started getting pystack exhausted on 6.x beta buds, was able to make some changes. and got my project working, but now it's every time, and no matter what I do, I can't get my current source to run. and I don't think I made any changes that would effect stack usage.

Unfortunately I can not share the project. but there was a note in early 6.x alphas about "Letting us know" if we get pystack exhausted, and, well, I am getting that in spades now.

Thanks

idle owl
#

@tidal kiln I guess I'm blocked at this point. I'll punt it to you and let you finesse it.

#

@tidal kiln I'll tag you in Basecamp.

tidal kiln
#

okie mcdokie

onyx hinge
#

<@&356864093652516868> Hi all -- I hope to see you at the meeting in a little over an hour from now. If you'll be speaking during the hug reports or status updates, or if you'll want me to read your notes, please add them to the notes doc. If you can't add your full notes, please add your name. Otherwise, we'll assume that you're just listening in. If you're not yet a circuitpythonista, just ask and we'll add you so that you can speak during the meeting. Notes doc link: https://docs.google.com/document/d/1uWRr_OQkfK9TygD2SGU9LpY60mK_euMQNsT0P-J0o2I/edit

lapis hemlock
#

@tulip sleet @onyx hinge I think the int8_t casting feature of numpy has its cause in C itself: ```#include <stdio.h>
#include <stdlib.h>

int main() {
int8_t a = (int8_t)65535;
printf("%d\n", a);
return 0;
}

#

Side comment: is it possible to enforce syntax highlighting in discord?

idle owl
#

@lapis hemlock Yes. python print("Hello world")

analog bridge
#
#include <stdio.h>
#include <stdlib.h>

int main() {
    int8_t a = (int8_t)65535;
    printf("%d\n", a);
    return 0;
}
#

@lapis hemlock

lapis hemlock
#

@analog bridge Thanks! This looks orders of magnitude better.

#

The only problem is, I haven't the foggiest idea as to what you did. That applies to you, too, @idle owl .

idle owl
#

@lapis hemlock After the first three backticks, type the language

#

But it has to be the only thing on that line.

analog bridge
#

After the first three backticks, type the language

#

the same applies for github as well

ornate breach
#

also when adding code blocks to html:

<pre><code>print("hello world")</code/</pre>
#

lol..

lapis hemlock
#

@idle owl Many thanks!

supple gale
idle owl
#

@lapis hemlock You're entirely welcome!

lapis hemlock
#

The trick is that the first line should not contain anything beyond the language. This is what I missed.

idle owl
#

Ah, yes. Indeed.

hearty tapir
lapis hemlock
#

@hearty tapir While we are at it, how do you quote the question in a reply? In the past I could choose this from the drop-down menu, but not anymore.

hearty tapir
#

You mean here?

lapis hemlock
#

Right, here. E.g., in your comment two lines above.

hearty tapir
#

When you hover with your mouse over the message, you can choose "Reply" either directly via the reply-arrow or via the dots

lapis hemlock
#

But none of those lists an option for quoting the question. I believe, this changed a couple of weeks ago, because earlier I used this feature all the time.

lone axle
#

I think "reply" recently began doing the quote part automatically.

lapis hemlock
#

Not for me.

#

Or is it possible that I don't see the quoted part, but you do?

onyx hinge
#

workaround: you can ctrl-c copy the text you want to quote, type "> ", and then paste...

#

Or is it possible that I don't see the quoted part, but you do?

onyx hinge
#

you can also (as the reader) click the small text and go back to the original message

lapis hemlock
#

This works only on the last line, because the very act of insertion introduces a line break.

#

See, this is the problem: my previous comment makes absolutely no sense without the context.

#

Which was "workaround: you can ctrl-c copy the text you want to quote, type "> ", and then paste..."

#

I think I am cursed.

hearty tapir
#

Browser or Discord app? (Me: current Firefox)

lapis hemlock
#

App.

#

I mean, on a PC, under linux

lone axle
#

you might need to upgrade. I use the desktop app on linux as well and mine got an update sometime within the last week or so that changed the reply / quote behavior

lapis hemlock
#

OK, I'll try.

#

Not this time now. The meeting begins in 10 minutes.

onyx hinge
#

Hey all, I'll be taking a few minutes before I get the meeting started. Please feel free to mic check amongst yourselves ๐Ÿ™‚

serene warren
#

Lurking

thorny jay
#

lurking

tidal kiln
#

lurking

idle owl
#

@gilded cradle Yes.

lone axle
#

I had a scheduling conflict come up part way through the meeting. Will have to bail out at some point. I am marked as text only in the notes already.

turbid radish
#

lurking

idle owl
#

@lone axle Thanks!

slender iron
lone axle
#

En este nuevo liveCats Andrรฉs Sabas nos comparte como iniciar con la programaciรณn del ESP32-S2 en Arduino IDE y CircuitPython, como hacer desde un hola mundo hasta una conexiรณn WiFi, no te lo pierdas, todos lo miรฉrcoles 18:00 hrs

LIVE CATS 18/11/20 LIVE!

Visit the Electronic Cats shop online - https://www.electroniccats.com/store

------------...

โ–ถ Play video
turbid radish
#

@anne_engineer on Twitter

onyx hinge
slender iron
#

๐Ÿ’ฏ

idle owl
#

It is!

#

Roy did all the adabot work.

gilded cradle
ionic elk
#

D: ๐Ÿฆƒ D:

serene warren
#

Spatchcock the turkey

ionic elk
#

anger words

tidal kiln
#

Unexpected Turkey = new garage band name

slender iron
#

I feel like that's from unexpected maker

idle owl
#

@tidal kiln Indeed.

serene warren
#

Cooks faster and will fit on rack above or below other things that are cooking

idle owl
#

It's the only option we have, the oven can't handle a whole turkey if we wanted it to.

#

Woes of temporary apartment living.

serene warren
#

Alternative is to cut up the turkey prior to cooking (just like you might a chicken) and cook separately.

idle owl
#

That's what I meant is likely. But evidently it's not a simple process.

thorny jay
#

NOTE: I did add a Hug report in the file for @prime flower for the original PyPortal version of Quarantine clock.

balmy stirrup
#

Do you have examples of the MQTT work that we can look at?

serene warren
#

I wet brine mine in a dark beer, brown sugar, kosher salt, and other spices mix for 24 hrs. Then Spatchcock it (remove backbone -use for gravy stock).

prime flower
balmy stirrup
#

Thanks @prime flower!

prime flower
#

np, I might not get to it today since I'm focused on fixing a bug I introduced on another project, cpython is working on it though.

idle owl
#

@serene warren Sounds good.

balmy stirrup
#

Awesome will check it out!

onyx hinge
serene warren
#

@idle owl thanks. It is moister and quicker and great for smoking if you have the space and time.

prime flower
#

@thorny jay thank you for the hug report, I think the magtag version looks better than the pyportal one ๐Ÿ˜„

balmy stirrup
#

By port might make sense.

crimson ferry
#

advantage of manual is that Github viewing will match the downloads

idle owl
#

@crimson ferry Excellent point, thank you.

analog bridge
#

Thanks!

slender iron
#

looks like I did it january 1st last year. so I'm a little ahead of myself ๐Ÿ™‚

#

@idle owl @onyx hinge I'm gone for the 12/21 meeting

tidal kiln
#

๐Ÿ‘‹ ๐Ÿฆƒ

prime flower
#

๐Ÿฆƒ

gilded cradle
#

Thanks

errant grail
#

Thanks!

prime flower
thorny jay
#

BLE and DisplayIO for Blinka are also a partial reality.

#

BLE on NinaFW also.

prime flower
#

yep!

#

I wanted a new esp32 version apparently, that happened

thorny jay
#

What was not in this list, still wanted but only discussed in the weed is that ZIP of library for learn guide or basic set of library for complex board such as CLUE, CPB, CPE, ...

prime flower
#

has the >6 core new ryzen, is fast

#

sec...

#

kinda

manic glacierBOT
#

Using the current (as of now) main App version: 6.1.0-beta.1-14-g16fe2de70 I can running code to hang after interrupting,
The code only instantiates an I2C object then loops forever printing something.
Interrupted with CTRL-C works 1st time
Interrupted again with CTRL-C hangs.
This was tested with both an Espressif Saola WROVER and Unexpectedmaker FeatherS2

import wifi
import time
import board
from busio import I2C,SPI

# i2c = I2C(board.SCL, board.SDA)
i2c = I2...
prime flower
#

@slender iron I have a 3700x

#

not the new-new

blissful pollen
#

@onyx hinge I just set up my FeatherS2 and a BME280 so I'll try it

onyx hinge
#

mine's 3700x too. me likey

supple gale
#

i have an ancient intel thing from two years ago ๐Ÿ™‚

idle owl
#

@supple gale I have an ancient Intel thing from 2011 ๐Ÿ™„

supple gale
#

lol,

tidal kiln
gilded cradle
tidal kiln
#

yep. that's where i'm at.

#
Adafruit CircuitPython 6.1.0-beta.0-25-g2f1460904 on 2020-11-19; MagTag with ESP32S2
>>> import board
>>> board.DISPLAY.rotation = 270
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'EPaperDisplay' object cannot assign attribute 'rotation'
>>> 
#

@slender iron is there a technical reason why EPaperDisplay doesn't have a rotation property?

slender iron
#

at this point it's that we don't have space for it

idle owl
#

@slender iron Just blasted my MagTag filesystem trying to copy files to it.

#

Wiped everything, returned it to base state.

tidal kiln
#

@slender iron thanks

#

@gilded cradle was firmware with ^^ that PR being used maybe?

idle owl
#

6.1.0-beta.1

slender iron
#

@idle owl yup, I've heard folks have had that issue. please file an issue so we can track it

idle owl
#

Alright.

gilded cradle
#

@tidal kiln I'm not sure. Ladyada opened it.

tidal kiln
#

ok. no worries. looks like this is all sort of work in progress land.

#

i'll work around it for now

manic glacierBOT
idle owl
#

@tulip sleet @slender iron Found what I consider an issue with the MagTag pin def. The NeoPixels are labled on the silk as both "NeoPix" and "D4". We didn't include D4 in the pin def. I realised after checking the pin def I should use board.NEOPIXEL but with it being on the silk, we should include both. If I submit a PR can one of you test it? I don't have that build environment set up.

manic glacierBOT
#

I was able to reproduce on my FeatherS2 (beta 6.1 beta 1).

If I comment out import wifi it continues to run perfectly. If I comment out of the I2C lines it works fine. When I put it all together then on the second Ctrl-C it locks up.

I also saw this:

Looping for fun

soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

I also saw the "soft reboot" and restart come up randomly as well when I hit Ctrl-C.

tulip sleet
#

@idle owl sure

idle owl
#

Keen. I'll get the fix in.

manic glacierBOT
idle owl
#

@tulip sleet ^

lapis hemlock
#

@slender iron Scott, it seems to me that isclose is missing from circuitpython: ```python
MicroPython v1.13-dirty on 2020-11-23; linux version
Use Ctrl-D to exit, Ctrl-E for paste mode

import math
dir(math)
['class', 'name', 'pow', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'ceil', 'copysign', 'cos', 'cosh', 'degrees', 'e', 'erf', 'erfc', 'exp', 'expm1', 'fabs', 'floor', 'fmod', 'frexp', 'gamma', 'isclose', 'isfinite', 'isinf', 'isnan', 'ldexp', 'lgamma', 'log', 'log10', 'log2', 'modf', 'pi', 'radians', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'trunc']

slender iron
#

it's not intentional afaik

lapis hemlock
#

Do you want to have it?

#

I actually wanted to quote this one ```python
MicroPython 6.0.0-dirty on 2020-11-23; linux version
Use Ctrl-D to exit, Ctrl-E for paste mode

import math
dir(math)
['class', 'name', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'ceil', 'copysign', 'cos', 'cosh', 'degrees', 'e', 'erf', 'erfc', 'exp', 'expm1', 'fabs', 'floor', 'fmod', 'frexp', 'gamma', 'isfinite', 'isinf', 'isnan', 'ldexp', 'lgamma', 'log', 'log10', 'log2', 'modf', 'pi', 'pow', 'radians', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'trunc']

slender iron
#

I don't mind if you add it but it won't fit on everything

manic glacierBOT
lapis hemlock
#

Some of the ulab tests fail on circuitpython for this reason. I can re-write the tests, if you don't want isclose.

#

Either way is fine with me, just let me know.

slender iron
#

@lapis hemlock I'm indifferent

lapis hemlock
#

Then ask Dan or Jeff!

#

Or whoever has a say in these matters.

#

I just don't want to interfere here, this is really a circuitpython call.

idle owl
#

@gilded cradle You might know the answer to this - is there a way to disable the display on MagTag when testing code that doesn't involve the display so it's not waiting on refresh or refreshing too often while iterating?

stuck elbow
#

I think you can release the display?

onyx hinge
#

@lapis hemlock not necessarily as a forever-solution, I had copied the straw-implementation from the py3 docs: ```python
try:
from math import isclose
except:
def isclose(a, b, *, rel_tol=1e-9, abs_tol=0):
return abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)

lapis hemlock
#

Yeah, I was thinking the same. We could definitely insert this at the beginning of all tests.

onyx hinge
#

there's a PR but it's far from ready...

gilded cradle
#

@idle owl you could just use the magtag network module

idle owl
#

@gilded cradle Limor and Scott gave me options as well. How would I use the network module to do that?

gilded cradle
#
from magtag.network import Network
network = Network()
#

That wouldn't init the eink

#

Oh wait, it's inited in the firmware, but it just wouldn't use it.

hearty tapir
#

@slender iron & @onyx hinge I moved my setup over to my Win10 system (where I also have my build environment). USB-Hub, CP2102 serial converter, Putty ... back in business ๐Ÿ˜„ and I could finally figure out that the hang of the esp32s2 doesn't happen in the scan-for-ssids-function but during connect. I was on the wrong track all along :/ However, "restart" in Putty is much faster than have to restart the Pi every five minutes ๐Ÿ™‚

lapis hemlock
#

@onyx hinge I have seen it. The snag is that the circuitpython sub-modules mix numpy and scipy functions, and there is no clear separation between modules. I would very soon (two weeks at most) like to implenent true numpy/scipy compatibility for micropython https://github.com/v923z/micropython-ulab/issues/250. Wouldn't it be a better time to fix the testing (module) issues?

#

What is really bad is that certain functions (lgamma, and gammaln, e.g.) have two different names in python. It is a bit of a mess.

onyx hinge
#

@lapis hemlock sure, feel free to close that PR if it's not going to be relevant/mergeable

ornate breach
#

Curious, in the qt py haxpress mpconfigboard.mk file, the line that is EXTERNAL_FLASH_DEVICES = GD25Q16C is the GD25Q16C the SPI flash that is suggested to be used?

slender iron
#

yes

ornate breach
#

Do I need to specify that in my SPI flash builds for CP?

#

I've got a 8Mb SPI flash I was going to use with it, but I don't want to specify something if others would like to use other spi chips

lapis hemlock
#

@onyx hinge What speaks against using sprintf or something similar for printing floating point numbers in circuitpython? In other words, why does one need formatfloat.c?

slender iron
#

@ornate breach circuitpython won't use the spi flash if you don't define it

ornate breach
#

so I need to specify the part # on the devices line?

idle owl
#

@gilded cradle How do I, or can I even, use the MagTag library to display a bitmap on the screen? set_background isn't working like it seems like it should, but I'm basically fumbling around with the MagTag lib. Sorted out the button presses and NeoPixels at least.

gilded cradle
#

Hmm, set_background should work. Maybe something broke it.

idle owl
#

I might not be using it right?

#

I tried magtag.magtag.set_background(image) and magtag.set_background(image) and image.bmp and none of that is working.

#

Wait should it be a string?

gilded cradle
#

image should be a path to the image

#

yes, a string

ornate breach
#

also @slender iron following the qt py haxpress as a template, (changed for my board pin wise and part) I get this: <artificial>:(.text.audioio_audioout_make_new+0x1ac): undefined reference to `pin_PA02' collect2: error: ld returned 1 exit status when attempting to build

gilded cradle
#

I tried to make it easy

idle owl
#

@gilded cradle Ok my code is running now, but nothing is displaying. This is a bmp that I grabbed from the Slideshow lib, that displayed properly earlier using the slideshow example.

ornate breach
#

My question is, do I need these bits for full CP?

CIRCUITPY_BITBANGIO = 0
CIRCUITPY_COUNTIO = 0
CIRCUITPY_FREQUENCYIO = 0
CIRCUITPY_I2CPERIPHERAL = 0```
gilded cradle
#

It should be auto_refreshing, but make sure

idle owl
#

@gilded cradle As in add magtag.refresh()?

slender iron
#

@ornate breach the missing pin is usually do to an IGNORE line

ornate breach
#

I think it is, but maybe I messed that up

gilded cradle
#

Kattni, yeah, try calling that.

idle owl
#

I did and it's still not displaying.

#

Still seeing the serial output.

gilded cradle
#

Hmm, can you share the code?

idle owl
#

Yep. It's got a bunch of extra imports because I haven't pruned them yet from the LED animation stuff.

ornate breach
#

I don't use PA02 on my board so I've got it ignored in the mpconfigboard.h file

gilded cradle
#

ok, I'll take a look and see if I can see why it's not working

idle owl
#

@gilded cradle Thanks. I want to add a feature to this project where it displays a different Winter-/holiday-themed image on each button press. The project is supposed to center around the LEDs but I figured it was silly to leave serial output on the display when it's included in the project.

tulip sleet
#

@onyx hinge ok, I need to do some debugging printing on ESP32-S2 to the UART port. Could you remind me how to write to there with an mp_printf or similar? Thanks.

slender iron
#

I use ESP_LOG but I think printf works

tulip sleet
#

tnx! I was thinking printf but forgot ESP_LOG

gilded cradle
#

@idle owl, I'm not seeing anything obvious. I'll try running it and see if that makes it more obvious.

idle owl
#

@gilded cradle Sounds good.

ornate breach
#

@slender iron is there a way to avoid using audiobusio in the build process? I removed CIRCUITPY_AUDIOIO = 0 from my make file but it's hanging on the build trying to build audiobusio

stuck elbow
#

can you add CIRCUITPY_AUDIOBUSIO = 0?

ornate breach
#

Trying that now

gilded cradle
#

@idle owl, it's updating on my magtag. Maybe add some print statements to verify the button press is happening?

idle owl
#

It's happening, there's an LED animation that runs when it's pressed. I had print statements earlier that were responding. I'll check one more time though

gilded cradle
#

ok

#

Maybe verify the image name

idle owl
#

Yah it's working

gilded cradle
#

oh good

idle owl
#

No I mean the button is

#

not the image

gilded cradle
#

Ah ha

idle owl
#

verifying image name

#

Image name is accurate.

gilded cradle
#

Also, could you send me the image. Maybe it's a format thing

ornate breach
#

@stuck elbow that worked

idle owl
#

Except it worked earlier through the Slideshow lib?

#

Does the MagTag lib process images somehow?

gilded cradle
#

It shouldn't.

idle owl
#

Trying a different one

gilded cradle
#

ok

idle owl
#

Same thing. Do you have one you know works?

gilded cradle
#

yeah

#

I just tested with that

ornate breach
#

yay 1MB of flash

#

sweeeeeet

idle owl
#

@gilded cradle Ok your code works.

#

Hmm.

gilded cradle
#

Perhaps a conflict somewhere

#

Let me try your original code

idle owl
#

@gilded cradle I swapped the LED animation code line with the display image code. It works now.

#

Weird.

gilded cradle
#

Oh, hmm. Cool

idle owl
#

So I need to call refresh() it seems like? You said it should automatically do that.

gilded cradle
#

No, I think I made it so it didn't do that automatically unless you just use the graphics library because I didn't want to slow people down if doing multiple graphics operations.

idle owl
#

Ah fair enough. I'll keep it in then. Thanks for your help!

gilded cradle
#

You're welcome

umbral dagger
onyx hinge
#

@lapis hemlock I imagine that the platform printf is avoided because it has larger code size than micropython's

#

if you're trying to solve the "numbers print wrong" problem, I salute you.

#

also printf will deal in doubles but circuitpython (as we build it for micros) deals in floats

manic glacierBOT
gilded cradle
tidal kiln
#

@gilded cradle yep. just saw that. ๐Ÿ‘

ornate breach
#

So for local testing on the MU Editor, I was able to add my board to the adafruit.py file in the modes folder of the application. Works so far. I have the my terminal open for the board so... temporary success.

manic glacierBOT
ionic elk
#

@slender iron @onyx hinge My previous CI check for the UDP additions was running into issues with make check-stubs -j2. My first thought was that I forgot to add a __init__.c somewhere but for UDP I haven't actually created any files. Is this just actions being janky, or does that suggest I have to fix something?

manic glacierBOT
slender iron
#

@ionic elk I haven't seen that check be janky

#

so I suspect you do need to fix something

#

did you try running it locally?

manic glacierBOT
#

@tannewt I've replaced the resets with gpio_matrix_out(pin_number, 0x100, 0, 0);, which is the mux changing magic function used by FastLED alongside the RMT. Seems to work fine for my Saola, but if you've seen another mux alteration function you think would be more appropriate, we could swap it out. Should solve #3715, but I haven't specifically tested Jeff's failing script yet.

manic glacierBOT
#
>>> from adafruit_circuitplayground import cp
>>> dir(cp)
Traceback (most recent call last):
  File "", line 1, in 
  File "adafruit_circuitplayground/express.py", line 82, in _unsupported
NotImplementedError: This feature is not supported on Circuit Playground Express.
>>> import math # to check that dir() works on something else
>>> dir(math)
['__class__', '__name__', 'acos', 'asin', 'atan', 'atan2', 'ceil', 'copysign', 'cos', 'degrees', 'e', 'exp', 'fabs', 'floor', 'fmod', 'fr...
orchid basinBOT
orchid basinBOT
#

@dglaude, what is returned from this request in your scenarios from above:

https://accounts.adafruit.com/users/locale.json

We're simply using the Accept-Language header sent by the browser. We have to use that accounts.adafruit.com callback, as this is a statically built site and we're not able to get the headers easily otherwise. It's not loading anything from an adafruit account, which should simplify debugging this issue for us.

I'm looking into if there is a javascript issue beyo...

manic glacierBOT
slender iron
#

so mbedtls will lie that it was able to send bytes

ornate breach
#

Ohh

slender iron
#

it says it sent as long as it queued it up

slender iron
#

should be more reliable on the S2

manic glacierBOT
tulip sleet
#

@slender iron I tried ESP_LOGI() and printf(), and neither is printing to UART port (I do see reset startup messages, so the connection is good.). I using mp_printf() in the old way for now. do I need to compile with DEBUG or something to get ESP_LOGx to work? It appears the default log level is INFO, so I think it should work, and I think printf() should also just work, though maybe that is defined by micropython

slender iron
#

ya, you need DEBUG=1

tulip sleet
#

ah ha, ok, thanks. Some time I'll try ocd also, but I think the bugs I have right now are fairly simple

slender iron
#

yup np. I'm doing uart debugging now too

manic glacierBOT
bitter bronze
#

I am not sure what I have done to my working trellis, but when I plugging it in, I get a message that there is a problem (not a very helpful message) and I need to scan the drive and fix it. I searched a number of places and I can;t figure out how to " scan the drive and fix it". Any help would be appreciated. I can bring up Mu and it sees the code. I can change the code to try a scan example I found. It saves the file on the CIRCUITPY drive *write date is changed" but nothing happens. Rest the Trellis did not fix it - see three blue flashes, and then white (I think because I color limited) I unplug the Trellis and plug it in again but it still does not work.

manic glacierBOT
#

UART output:

I (4804459) gpio: GPIO[12]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (4804469) gpio: GPIO[11]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
W (4804539) cp radio: connect()
I (4805269) wifi:new:<6,0>, old:<1,0>, ap:<255,255>, sta:<6,0>, prof:1
I (4805739) wifi:state: init -> auth (b0)
I (4805739) wifi:state: auth -> assoc (0)
I (4806749) wifi:state: assoc -> init (400)
I (4806749) wifi:new:<6,0>, old:<6,0>, ap:...
tulip sleet
#

@bitter bronze The filesystem may have gotten corrupted. Can you copy off the files you need from CIRCUITPY? Then you can erase and reformat the filesystem. CLick the Serial button in mu, and type:

>>> import storage
>>> storage.erase_filesystem()
#

that will erase everything on CIRCUITPY and reformat it cleanly

bitter bronze
#

@tulip sleet Thanks Dan. I saved all my files on another disk. I tried erase_filesystem and it seemed to work - it erased all my files and I put back the code.py but it is not working. Do I need to reinstall the uf2 file?

lone sandalBOT
bitter bronze
#

I downloaded the uf2 for the Trellis, double clicked the reset button, TREML4BOOT came up, copied the uf2 file to TREML4BOOT and it took a few seconds to pop up CIRCUITPY. Serial mode on the Trellis shows Circuit Python 6.0.0. Ctrl-D soft reboot tells me there is no module named adafruit_trellism4 ?

#

Here is the error from Serial and the code where the error occours:

#

Now I am getting:

code.py output:

Traceback (most recent call last):

File "code.py", line 12, in <module>

File "adafruit_trellism4.py", line 48, in <module>

ImportError: no module named 'adafruit_matrixkeypad'

Code is:

Launch Deck Trellis M4

USB HID button box for launching applications, media control, camera

switching and more

Use it with your favorite keyboard controlled launcher, such as Quicksilver

and AutoHotkey

copy of code at C:\Users\chuck\Python\trellism4-2.py

import time
import random

from board import SCL, SDA
import adafruit_trellism4
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
from adafruit_hid.consumer_control import ConsumerControl
from adafruit_hid.consumer_control_code import ConsumerControlCode

line 12 is "import adafruit_trellism4"

#

@tulip sleet I am stumped

crimson ferry
#

@bitter bronze you also need to copy adafruit_matrixkeypad.mpy to your /lib folder

#

the adafruit_trellism4 library depends on it

bitter bronze
#

@crimson ferry Thanks. Where might I find it? I think I use to know that, but I am drawing a blank now. I am also trying to get up to speed with Visual Studio Code and I see the similar missing library.

crimson ferry
#

you probably already have it with the rest of the libraries on your computer

#

but it needs to be on the CircuitPython device, in the /lib folder with the rest of the libraries needed by your code, like adafruit_trellism4.mpy

bitter bronze
#

@crimson ferry. Thanks again. Should I just copy the whole download library over or should I move just what I need?

crimson ferry
#

There's usually not room for the entire bundle, but the Trellis has 8MB I think so it might fit, depends on what other files you might be adding to flash later

#

(takes longer to copy a bunch of stuff you don't need too)

bitter bronze
#

@crimson ferry I think I will only move what I need. I did that and have passed that problem but now I am getting an error about the Keyboard function needing two arguments when it required none previously. It seems something changed under the covers. I have not looked inside .mpy files in the past. Something else to research

#

The code that use to run has

#

from_hid.keyboard import Keyboard

#

...

#

later on it has kbd = Keyboard() which fails with "function takes 2 positional arguments but 1 were given" (actually none in this case so the error is wrong?). It use to run with no error until my problems earlier in the evening and the updating of libraries. Now I am trying to see what the code really says, but I do not know how to see the code that went into the keyboard.mpy file. Any pointers would be appreciated.

#

I deleted the parens after Keyboard and another similar call and it seems to be working. I still have two things to solve, how to get Visual Studio Code to look in the lib folder in the CIRCUITPY drive and where to find the .py code that corresponds to the various .mpy files.

#

@tulip sleet and @crimson ferry thanks for your help. I love this community.

manic glacierBOT
manic glacierBOT
#

I'm sorry to disturb you. I use nanoesp32-s2 / firmware๏ผˆ https://github.com/wuxx/nanoESP32-S2/blob/master/firmware/flash_ image_ cdc_ msc.bin ๏ผ‰, write it to 0x00, connect gpio19 and gpio20 (the schematic diagram is the same as nano, add resistance in the middle), insert USB2.0 interface into the computer, and successfully display the small U disk.

Then we use adafruit circuit Python muselab_ nanoesp32_ s2-zh_ Latn_ Pinyin-6.0.0.bin, write to 0x00

Serial terminal display:

ESP- ROM:esp...

manic glacierBOT
orchid basinBOT
#

At troubleshooting time, I changed my browser Accept-Language to German... but the consequence of that on my internet experience were so hard on me (I don't understand German) that I gave up on that silly idea.

If booth language selection box use the same code, then it must be the javascript that only modify one and not the other. Because there are two language drop box, one for Stable and one for next release.

ornate breach
#

hey @slender iron I added another PID on pidcodes for the CP Sapling w/ SPI Flash so it passes CI Tests for circuitpython. I'll be updating the PR for circuitpython with the new PID

orchid basinBOT
#

Installing Adafruit library is as simple as getting the zip file with all the MPY from https://circuitpython.org/libraries
Copy what you need in your lib folder.
When you have no more import error, this mean you have the library you need.
You can also get matching example (simpletest) from the other example-bundle.

Those setup.py and instruction in all the GitHub repo are for installation with Blinka, that is with the adaptation layer to use CircuitPython library on Raspberry Pi or othe...

onyx hinge
#

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/1ADivzRhU6vQCSee7Yj0RAtvy0B4hE6tAQ8hr_N8h6sw/edit?usp=sharing

manic glacierBOT
cunning verge
manic glacierBOT
#

This looks fine. There is a small chance of changed behavior, namely that if the calling code depends on being able to do something else with the data "after" the json object, up to READ_CHUNK_SIZE-1 bytes of it will have been already consumed and it won't work.

Specifically, with the current implementation and using a file, not a socket, you can have a file with the content {}\n{} and call json.load() twice on it to get an empty object {} each time.

If this proves to be a proble...

onyx hinge
#

@cunning verge Only one specific flash chip is recognized by the "qtpy_m0_haxpress" build, GD25Q16C. You could modify and build your own circuitpython to support other flash chips. I don't think that qtpy is designed for psram at all.

#

psram is most often used in conjunction with boards that have esp32s2, based on my experience.

manic glacierBOT
ionic elk
#

@tulip sleet are you familiar with the __init__.c stubs system? Could I ask for your debugging advice on something?

cunning verge
#

@onyx hinge Hi Many thanks for the info. Will keep looking for the correct GD25Q16 - 2MB SPI Flash chip locally then.

Shame the local QT PY suppliers don't seem to be stocking or even planning to stock this .....

If you or anyone else reading this has any suggestions for a UK based supplier or maybe an equivilent chip I would be grateful for the info.

Just ordered the QT Py - really looking forward to seeing one in the flesh at last!

Take Care

J

tulip sleet
#

@ionic elk do you mean the .pyi generation? No, I am not fmailiar with what it's doing, but I have fixed errors in my doc that it detects. If you mean putting code in __init__.c that is something I do all the time.

ionic elk
#

@tulip sleet I have these errors:

circuitpython-stubs/socketpool/__init__.pyi:53: error: Implicit generic "Any". Use "typing.Tuple" and specify generic parameters
circuitpython-stubs/socketpool/__init__.pyi:60: error: Function is missing a type annotation for one or more arguments
circuitpython-stubs/socketpool/__init__.pyi:60: error: Implicit generic "Any". Use "typing.Tuple" and specify generic parameters
#

since I presume these are generated files I'm not sure exactly what to modify, I think they are issues with a tuple return I use in shared-bindings/Socket?

#

I don't modify Socketpool so I figure the automated process must be combining them

onyx hinge
cunning verge
#

@onyx hinge Hi Jeff - super speedy reply! ยฃ12 shipping is a bit high for my limited funds but really grateful for the link

manic glacierBOT
tulip sleet
#

@cunning verge Farnell would probably have it, if that's easier

onyx hinge
tulip sleet
#

well, no, bleh

cunning verge
#

@tulip sleet @onyx hinge Very grateful - will keep up my search. At least thanks to you i now know what to look for !

tulip sleet
#

@ionic elk did you change documentation in the code you're working on?

#

it does get mashed together in the .pyi file

hazy plover
#

@cunning verge Be sure to order the "T" package which is the 150mil.

ionic elk
#

@tulip sleet I found the actual stub files and figured out what changes to make from another stub file

#

I didn't change any documentation but it was probably something that Scott prototyped and hadn't gotten to bugfixing yet