#circuitpython-dev

1 messages · Page 348 of 1

ivory yew
#

it's a null ptr

#

hrmhrm hrm

tulip sleet
#

are you testing a board with 16 or 64?

ivory yew
#

16

#

(the first config there is for some random chip that I put in there for debugging, not the 64)

tulip sleet
#

are you shipping boards with 64?

ivory yew
#

yup

onyx hinge
#

does that make possible_devices[] not match at all?

ivory yew
#

oh hold on I did something dumb. This board as a 64 not a 16, one sec.

#

ugh

onyx hinge
#

if so it would be expected to pass that loop with a NULL flash_device (which has not been a well-detected problem in the past)

tulip sleet
#

i thought it would complain, it SHOULD

#

supervisor_flash_init() should return a boolean or go into safe mode or something

onyx hinge
#

it'd be easy to test, just load an unmodified qtpy with the haxpress version

ivory yew
#

yeah i think it behaved correctly in that case

#

okay it's setting the right flash device

tulip sleet
#

so it's still messing up on the 16/64 case, right?

ivory yew
#

yeah

#

It's messing up whenever there is more than one device in the mk file

#

it detects it correctly

#

so I'm unsure why it's hanging when writing

tulip sleet
#

I could try this on some other random board with a 64 to the list and see what happens.

ivory yew
#

doesn't seem to matter if it's the 64 or the 16

#

if there's more than one possible device it acts weird

tulip sleet
#

we have lots of these builds, though, like pyportal

ivory yew
#

like the build I'm running now has two possible flash devices configured: one that can't possible be there that's from a different manufacturer and the 64 which is definitely there. It checks for the 1st one, doesn't see it, checks for the second one, sees it, sets it correctly.

#

yeah which is why this is bananas to me

tulip sleet
#

but when you try to copy it spins?

ivory yew
#

I gotta go eat but I guess I'll try to peek into the writing routines when I get back.

#

yup

#

reading seems fine I guess??

tulip sleet
#

you've seen this on multiple boards?

#

e.g. , not just this sample?

ivory yew
#

Yeah

#

On the previous revision and the newest revision

tulip sleet
#

it is big honking button, right? It is using SPI_FLASH_FILESYSTEM, unlike our two-device boards with QSPI

ivory yew
#

So the situation is:

v1 board: works with just the config for 16, will hang on write if any other possible flash devices are configured
v2 board: works with just the config for 64, will hang if any other possible flash devices are configured.

tulip sleet
#

hallowing m0 express is similar

ivory yew
#

Oh hrm

tulip sleet
#

metro m0 also has two

#

that is really straightforward to check

ivory yew
#

there are definitely boards that have SPI_FLASH_FILESYSTEM and two possible flash devices

#

it's just a switch between SPI/QSPI

tulip sleet
#

yeah, and they have not been acting up for me, at least. If you have a metro m0, you could try plugging it in, but it should be fine

#

when does it spin? Are you copying a big file?

ivory yew
#

i think my only m0 boards are feather expresses

#

any file, any size

#

like try copying over a few libs

#

I don't have a metro m0, just some feathers. I can try with those in a bit.

tulip sleet
#

i'm just going to try GD25Q64C and 16C on a metro m0

ivory yew
#

cool

#

(thanks for your help)

#

hard to debug the write stuff because the usb disconnects looool

#

looks like it let me get away with copying some files <1kB, but try with a handful that's more than 5kB or so

tulip sleet
#

and messes up on both windows and Mac?

ivory yew
#

yup

tulip sleet
#

I have a Mac with Big Sur. I have lotsa windows and linux

#

@ivory yew i am unable to reproduce write problems with a 61k file on Mac or Linux. I tried the GD25Q16C and 64C in both orders in mpconfigboard.mk

ivory yew
#

hrm

#

Just one file? Try coping a couple?

tulip sleet
#

are you using the finder or the command line?

ivory yew
#

Like I was able to one by one copy a few files around ~10k then it barfs

#

both

#

hrm hrm hrm

tulip sleet
#

i think maybe the 1 vs 2 devices is a red herring. I am getting copying problems when copying a bunch of .wav files. Let me try one device. and I will storage.erase_filesystem() each time

ivory yew
#

okay

#

I think it's the autoreloader

#

interrupt the code and sit in the repl and copy files

tulip sleet
strange pike
#

still will autoreload if you aren't at the repl prompt, right?

fossil gorge
#

I believe that this may be part of the reason the build has been failing. I know the "make translate" had a bad merge, because of.... my cats?

But there's also this in the build issues, with the German (de_DE) translations

#

Negative value for bytes free.

tulip sleet
#

I am fixing the overflowed builds; there's a PR to be merged soon

#

@ivory yew ok I am getting copying hangs with one device, so I think you may be on to something.

#

it is not the number of devices

ivory yew
#

@tulip sleet I just have the hello world script. When copying it saw it execute over and over

tulip sleet
#

It copied the first time fine, then I erased the filesystem and it reset, and then I copied again and it hung.

ivory yew
#

Since supervisor probes for each device, the number of devices could cause just enough delay when reloading to make matters worse.

tulip sleet
#

copying all these wav files:

rw-r----- 1 halbert halbert 32278 Aug 29  2018 hit.wav
-rw------- 1 halbert halbert 89134 Aug 29  2018 idle.wav
-rw-r----- 1 halbert halbert 61164 Aug 29  2018 off.wav
-rw------- 1 halbert halbert 75820 Aug 29  2018 on.wav
-rw-r----- 1 halbert halbert 43438 Aug 29  2018 swing.wav
ivory yew
#

cool, I have a similar set

tulip sleet
#

they are from some learn guide project

#

do you not see this on 5.3.1? could you ship with 5.3.1?

#

i don't know that it probes on reload; it may just probe on reset?

ivory yew
#

hrm yeah I"m not sure on that

#

Yeah I have no issues when programming boards with 5.3.1

#

I can't ship with 5.3.1 because it doesn't have the flash devices configured for v2

tulip sleet
#

you could make a custom build; i'm just thinking about how you are getting stuck

ivory yew
#

yeah

#

6.0 also has a custom module for BHB's ADC which I'd like to use

tulip sleet
#

it's obviously a significant issue, and it's reproducible, but not always. I can open an issue with a Metro M0 example.

ivory yew
#

okay, thank you. 🙂

#

I think I have a workaround for now

tulip sleet
#

do you see it on SAMD51?

#

didya ever?

#

even a hint?

ivory yew
#

Not that I can recall but I have to program some Sols soon so I'll let you know.

#

Workaround for now is to either put the device into the repl or disable autoreload while copying multiple files

#

with the repl open I can copy copy copy

tulip sleet
#

that is a great clue

ivory yew
#

It might be possible that we changed something and made autoreload's delay lower unintentionally

tulip sleet
#

yes, there are so many timing-related changes in 6.

manic glacierBOT
#

First reported by @theacodes. Considerable discord discussion starting about 7pm ET 2021-1-12 in #circuitpython

Seems to happen fairly often (though not always) on SAMD21. Not sure if it happens on SAMD51. Not tried on other boards.

Example, copying to a Metro M0 Express running near the tip of main. First erase the filesystem. Then, do not enter the REPL, but copy multiple larger files, e.g. like this set:

32278 Aug 29  2018 hit.wav
89134 Aug 29  2018 idle.wav
61164 Aug 29 ...
#

Instead of storing an index of each word start, end, or length:

  • sort words by length
  • have a table of 8 entries (for word lengths 2 to 9 inclusive)
  • Each table entry gives the number of words of that length

Now you can calculate the start and end of a word by looking just at entries in this table. It also allows the number of words to be extended slightly in at least de_DE, because the problem of storing "word ends" as 8-bits values goes away.

It looks like ~200 bytes of flas...

ivory yew
#

Thank you so much, @tulip sleet

tulip sleet
#

you're welcome; i'm sorry about this

ivory yew
#

oh friendo you've got nothing to apologize for

#

CircuitPython has my code in it too, it's equally my fault.

tulip sleet
#

we all work together to make it better, thanks

manic glacierBOT
#

Confirming workaround: suspending autoreload through supervisor.disable_autoreload() or entering the REPL allows files to be copied without issue.

This was discovered while programming Big Honking Buttons. The factory setup script copies a set of files to the device - one set is the following WAV files:

drwxr-xr-x  9 stargirl  staff   288B Jul 24 13:37 ./
drwxr-xr-x  9 stargirl  s...
dull cobalt
#

Related:

import microcontroller
microcontroller.on_next_reset(microcontroller.RunMode.NORMAL)
microcontroller.reset()

resets into safe mode instead of normal mode 😦 why?

manic glacierBOT
#

I found the copying is much slower if the serial connection is not open.

This test is with code.py just being print("Hello, world").

Not connected:

halbert@salmonx:~/Downloads/sounds$ /bin/rm /media/halbert/CIRCUITPY/*.wav;sync
halbert@salmonx:~/Downloads/sounds$ cp -v *.wav /media/halbert/CIRCUITPY/
'hit.wav' -> '/media/halbert/CIRCUITPY/hit.wav'
'idle.wav' -> '/media/halbert/CIRCUITPY/idle.wav'
    [big delay; NeoPixel pulses green]
'off.wav' -> '/media/halbert/CIRCUIT...
tulip sleet
manic glacierBOT
#

Should I try with just opening a serial connection and not sending
anything?

On Tue, Jan 12, 2021, 11:08 PM Dan Halbert notifications@github.com wrote:

I found the copying is much slower if the serial connection is not open.

This test is with code.py just being print("Hello, world").

Not connected:

halbert@salmonx:~/Downloads/sounds$ /bin/rm /media/halbert/CIRCUITPY/*.wav;sync
halbert@salmonx:~/Downloads/sounds$ cp -v *.wav /media/halbert/CIRCUITPY/
'hit.wav' -> '/media/...

dull cobalt
#

@analog bridge thanks for the reference! this seems slightly different from my issue

#

they are requesting BOOTLOADER mode but getting NORMAL Mode

#

i'm requesting NORMAL Mode but getting SAFE mode

#

i'll post there as well

#

will do thanks @tulip sleet

manic glacierBOT
#

Running this:

import microcontroller
microcontroller.on_next_reset(microcontroller.RunMode.NORMAL)
microcontroller.reset()

causes the board to reset and go into safe mode instead of normal mode.

Similarly, setting up a watchdog with the following code.py:

from microcontroller import watchdog as w
from watchdog import WatchDogMode
w.timeout = 10.0
w.mode = WatchDogMode.RESET
w.feed()
while True:
    pass

causes the microcontroller to reset after 10.0 seconds ...

dull cobalt
#

@tulip sleet created the issue

manic glacierBOT
analog bridge
manic glacierBOT
idle owl
manic glacierBOT
#

Should I try with just opening a serial connection and not sending anything?

I thought you were doing that initially, and you added the "getting into the REPL" part. But if were not opening the connection before, yes, you could try that.

I think this may have to do with not calling the tinyusb "do tasks" call often enough. It probably gets called more often when a serial connection is open, because there's traffic that generates interrupts. The fix may be to enable tick interrupts all...

onyx hinge
#

Thanks Dan

#

btw looking at that new errata doc you sent me for atmel sam .. none of the can stuff jumps right out at me, it all seems pretty advanced

tulip sleet
#

that's good 🙂

onyx hinge
tulip sleet
#

i did get it to work, sort of; that erratum has evolved from "do this tricky thing" to "it doesn't work"

#

same "doesn't work" was in previous rev of errata

manic glacierBOT
slender iron
#

Generally either approach is fine. The pull just needs to be opposite what the button connects the pin to. ESP32-S2 has the pin alarm caveat where pull down is prefered so the pin goes high when pressed.

jaunty juniper
#

has anyone encountered a situation on macOS (Catalina) where you double click "code.py" on one circuit python drive but it opens the code.py from another ?
I often have multiple devices connected, usually with different drive names (CLUE, QTPY, etc). It happens with different apps, or using the open command line, but it does not happen when using the "open" dialog from within the apps.

tulip sleet
#

@slender iron Would you have time for a short talk re tick on/off mgmt and the problem Thea encountered yesterday (#3986)? I have a 12pm non-work mtg if 15 mins is too short. Could ping you after mtg

idle owl
#

@jaunty juniper Yes. Lately in Finder, only one CIRCUITPY drive out of many shows up.

#

And so it only opens the files from that drive if I'm opening through finder.

#

I've had to go through command line to find them, or go into /Volumes in Finder.

#

It was not always like that. Something changed.

jaunty juniper
#

let's say I have "BLUEREMOTE" (a feather nrf52) and "CIRCUITBLUE" (a CPB), typing open /Volumes/CIRCUITBLUE/code.py actually opens /Volumes/BLUEREMOTE/code.py

#

hmmmmm

idle owl
#

Oh hmm. Doing it through commandline still borks?

#

What are you opening them into?

jaunty juniper
#

well "open" is more like calling the Finder

tulip sleet
#

i vaguely remember some Mu issue(s) relating to multiple boards

idle owl
#

It's irrelevant to Mu, Dan.

#

I think it's a Finder issue.

jaunty juniper
#

I use BBEdit, and opening with bbedit /Volumes/CIRCUITBLUE/code.py works as expected

idle owl
#

I haven't used Mu in ages until the last few days or so, and it happens to me regularly.

jaunty juniper
#

but Sublime Text does the same if I switch the default or use open -a

#

and so does TextEdit with the boot_out.txt

idle owl
#

I use PyCharm, and haven't tried opening directly into PyCharm from command line. But anything through Finder seems dubious at best.

jaunty juniper
#

I don't remember seeing that before... I don't know super recently

idle owl
#

Unless I happened to have opened the first CIRCUITPY and had it open already, and then it mounts the second one, and that's the one that shows up as mounted, but I can still access the first one.

idle owl
#

@jaunty juniper I don't know if it's a CircuitPython change or a MacOS change. I don't remember when it started with reference to which thing was updated.

jaunty juniper
#

same

manic glacierBOT
#

Is the monotonic_time argument for TimeAlarm going to suffer from the same (30bit) fp resolution issues as time.monotonic() does?

Would something like relative_time (or a better name) be a better solution for most users (i.e. pause = alarm.time.TimeAlarm(relative_time=20) and leave the library to deal with maintaining decent precision?

crimson ferry
#

@jaunty juniper I almost always have multiple CIRCUITPY drives (each renamed to something unique). macOS double-click in Finder will try to open it with the default editor for that file type, but most editors don't play well with multiple CIRCUITPY volumes, not sure why it would be any different than other kinds of mounted volumes.

#

I love BBEdit, but since it doesn't flush writes, I don't use it for direct editing on a CP device. Mu does handle multiple CIRCUITPY devices, but there is no UI indicator of which device the code applies to (I submitted an issue on this long ago). Mu doesn't keep up with macOS, so I've largely abandoned it in favor of Atom and more recently VSCode (which has its own quirks).

#

(both with CP add-ons)

#

Mu also gets confused with serial/plotter when there is not just one CIRCUITPY.

jaunty juniper
#

hmmm I don't think I have problems with flushing

manic glacierBOT
#

The new alarm.time.TimeAlarm() function from #3767 takes two forms of absolute time as an argument. The 30bit fp number representation of time from time.monotonic() loses precision over time and this will impact users who use monotonic_time(). For most users a relative time will be easier to use and avoids this problem as the library can deal with maintaining best precision under the covers.

The example code:

pause = alarm.time.TimeAlarm(monotonic_time=time.monotonic() + 20)
...
crimson ferry
tulip sleet
#

there are basically no flushing problems on Mac; MacOS flushes immediately, if that's what you're using

jaunty juniper
#

I don't know how anyone can use those other editors. I could rant for hours on how important it is to respect the platform's idioms, or to have an actual interface to change the syntax highlight colors (big part of accessibility)

manic glacierBOT
jaunty juniper
#

i can't find USB keys lying around to see if the problem could show up with them too, I'm pretty sure it doesn't happen with my usual external drives

manic glacierBOT
#

Reposting image here for reference:

Here's a graphical comparison of the ADCs on four Feather boards including the FeatherS2 which uses the ESP32-S2 which appears to have an unfortunate limitation with its ADC voltage. The Feather M0 Bluefruit DAC is providing the voltage into a 0.1uF capacitor. The boards are:

FeatherS2 from unexpected maker - red
Feather nRF52840 Express - purple
Feather M0 Bluefruit - light brown
Feather M4 Express - sky blue

![adc-analaysis-run1-202101...

idle owl
#

Using pwmio to generate a tone. There does not appear to be a way to "stop" the tone. I set the frequency to 1, and it's inaudible, but that seems like an uberkludgy way to do it. Am I missing something, or is that the answer?

#

As soon as I initialise it, the tone starts and continues regardless of what other code is running if there's a loop present.

manic glacierBOT
#

I want to smack myself in the face now. Since this is the first board that I worked with that didn't come preinstalled with Circuitpy I got so used to compiling and flashing on ttyUSB1 while wiring up the native usb to work as a storage device i didn't even notice that another serial device ttyACM0 was created at the same time the native USB was plugged in. Thank you so much.

slender iron
manic glacierBOT
lapis hemlock
#

@slender iron Hi Scott, you work on a macintosh, don't you?

slender iron
#

I have in the past but I've moved to linux

lapis hemlock
#

I have seen in the past that the compiler on the mac is a bit particular about such things.

idle owl
#

@slender iron deinit makes it not work later when I need it.

slender iron
#

right

idle owl
#

I need it to beep repeatedly at one point in this code. I feel like changing the duty_cycle is less clear than changing frequency.

#

I guess I'll stick with my workaround.

slender iron
#

I think duty cycle is the best way to go

idle owl
#

hmm.

#

ok.

slender iron
#

@lapis hemlock the fixes in the issue seem right to me

lapis hemlock
#

@slender iron But it would be great, if we didn't have to override the makefile. One can, perhaps, add the line to the make fragment, but then that would be applied to all ports. At the moment, it is not clear to me, whether the issue is unix-related, or a generic one.

idle owl
#

@slender iron So I'm setting duty_cycle=0 in init, and then buzzer.duty_cycle = 2 ** 15, and then 0 in the loop with the pauses between to make it beep?

slender iron
#

@lapis hemlock isn't the issue that the unix port is using double instead of float

#

@idle owl yup!

lapis hemlock
#

@slender iron I think so. But the unix port uses doubles on linux, too, so I don't see, why the mac is special.

slender iron
#

it could be the compiler version

tulip sleet
#

@slender iron I have another non-work mtg in 6 mins, will contact you later

manic glacierBOT
#

The logging is reasonably thorough, but requires a DEBUG build. Maybe until ESP32-S2 is considered Stable, we could enable logging by default, at least for Warnings and more severe?

This sounds good to me!

Addendum: it's useful to note in the docs which Reasons arise solely from the AP sending a frame with that reason, vs. Reasons that may arise from internally detecting a condition within the station.

Would you mind adding them? I don't know the difference myself.

onyx hinge
#

you could specify -Wno-double-promotion globally, you could add an explicit cast double x = (double)INFINITY; etc

#

I did not know that the floating point constants INFINITY and NAN were defined to have float type. interesting.

cobalt kestrel
#

@idle owl If possible / an option for you, disabling the device speaker will also stop the tone. Then re-enable when you want to continue the tone. This is my code for MagTag with CircuitPython

import time
import pulseio
import board
from digitalio import DigitalInOut, Direction, Pull

Enable the speaker

speaker_enable = DigitalInOut(board.SPEAKER_ENABLE)
speaker_enable.direction = Direction.OUTPUT
speaker_enable.value = False
pin = board.SPEAKER
pwm = pulseio.PWMOut(pin, duty_cycle=0x8000, frequency=131, variable_frequency=True)

Play the frequencies

for i, freq in enumerate([131, 147, 165, 175, 196, 220, 247]):
if i == 0:
speaker_enable.value = True
pwm.frequency = freq
time.sleep(0.25)

speaker_enable.value = False

idle owl
#

@cobalt kestrel That only works with built-in speakers where the board has SPEAKER_ENABLE as a pin. This is a piezo buzzer wired to a microcontroller, so it's not an option. Thanks though! I'll remember that for when it is an option.

cobalt kestrel
#

Good to know! Thanks.

lapis hemlock
#

What bugs me is the fact that MICROPY_FLOAT_CONST(...) does not shut up the compiler

onyx hinge
#

in micro/circuitpython context you'd explicitly cast to mp_float_t or whatever it's called, I wrote double for making a short example

lapis hemlock
#

Oh, sorry, so you meant this: mp_obj_float_t numpy_const_float_inf_obj = {{&mp_type_float}, (mp_float_t)INFINITY};

#

And the godbolt thingy is nifty.

manic glacierBOT
idle owl
#

In CircuitPython, we don't have threading. But we can still use things like time.monotonic() to have non-blocking input monitoring. What is that called? "Polling"? Does it even have a name?

slender iron
#

correct. ya polling is the best word

idle owl
#

Ok thanks

slender iron
#

aka "repeatedly reading a value until it changes"

idle owl
#

Excellent, thank you

manic glacierBOT
#

re: logging ...the build process is mostly a black box to me, but maybe there's a way to do it there in the automated builds. I can start to look into that, any guidance would be helpful.

Espressif does provide APIs to set a lower severity threshold at runtime than the one set at compile time (I think that would involve a new circuitpython API).

re: Reason causes ...I'm not sure where ...

idle owl
#

Did we ever fix the logging data directly to the flash issue? Nevermind, apparently we did.

manic glacierBOT
idle owl
#

@slender iron If I’m using duty_cycle to control the piezo, is there any point in setting variable_frequency=True on object creation? The implication in the docs is that it is kind of necessary for tone generation. I don't change the frequency in this example, but folks might want to in other examples or to do a more advanced version of this example...

slender iron
#

I’d leave it so folks can change the pitch

idle owl
#

Thanks

manic glacierBOT
onyx hinge
#

weeeeeeird, brew (the package installer) is available on github ubuntu ci runners

idle owl
#

If you create a variable and set it foo = False and then create a function that waits for a button press, and changes it to foo = True, is that considered changing the "state"? Or is there another word for that.

crimson ferry
#

Can another ESP32-S2 maker please check my thinking here, I'm seeing something I hadn't encountered before in the wifi module...

#

basic structure is an event handler in init, and connect in the radio module

#

connection retries are done in the event handler, but exception scenarios are handled in common-hal connect()

#

Retries in the event handler call the low-level IDF connect function. So I'm seeing something arise where an AP goes away after a connectionW (1564880) wifi: disconnected W (1564880) wifi: reason 200 0xc8 # BEACON_TIMEOUT I (1564880) wifi: Retrying connect. 4 retries remaining W (1566950) wifi: disconnected W (1566950) wifi: reason 201 0xc9 # NO_AP_FOUND the event handler stops retrying because it's essentially considered a fatal error if there's no AP, but we don't actually call common-hal connect() again, so the connection stays dead even if the AP comes back

thorny jay
idle owl
#

Yeah I use global, I was questioning the nomenclature of the word "state" to explain what it was doing.

#

Thanks!

slender iron
#

@crimson ferry ya, that seems like what it's doing

crimson ferry
#

@slender iron do you see an obvious solution, or should I file an issue?

slender iron
#

it should probably delay and retry

#

instead of retrying immediately

crimson ferry
#

but if the AP doesn't come back for a longer while, the code just goes into a weird socket exceptions state

thorny jay
#

I should really learn serious Python, pattern, setter/getter, lambda function, class, ... I feel like my level in Python is equivalent to when I was programming Basic or when I started to learn computer science. I know it is out there, I can see it from super well written and not simple learn guide, but I am not able to write code like that. This is disturbing and annoying. Not that this blocking me for doing anything I want to do in CP, but I feel I am missing a big part of Python. 😦

#

Not that I ever was a great programmer...

slender iron
#

it takes practice @thorny jay 🙂

thorny jay
#

I was in trouble with my MagTag... my feeling is that it started when I deleted code.py (and there was no other main.py). Tested various UF2, two latest and beta1. The CircuitPython would not appear, or only once every few power off/on. Windows was "Périphérique USB non reconnu" (that would mean "unrecognised USB device"). Maybe the file system was also a bit full (or almost full). Now that I made some space and manadged to rename a file to code.py, it seems to work. But it was very bizarre. Not sure I want to try to reproduce that.

thorny jay
#

On the MagTag, the pin in the STEMMA connector is A1 (as printed), A1 in the learn guide, AD1 on the schematic in the learn guide and board.AD1 in the firmware. So I have two A1 and two AD1. I need someone to vote for a tiebreak on this topic.

tulip sleet
#

@thorny jay I'll ask if there are any plans to change the board, but I think the CPy choice came from the schematic before the board art was done. We can add board.A1 as a synonym for board.AD1

prime flower
#

@thorny jay +1 vote for A1 since I often look at the board's silk while wiring, not the schematic.

hoary moat
#

Note to self: be careful what screw head size you use. Crushed the lens off my poor D13 led. Rest In Peace.

tulip sleet
#

we usually try to make the silk the "ground truth" for pin names, since that's what people have in hand

thorny jay
#

My eyes are not what they use to be... but I try to read the silk too.

hoary moat
#

Managed to get prototype code for latching relay working. Cannot wait for Ethernet wing tomorrow!!!

prime flower
#

@hoary moat nice, congrats!

hoary moat
#

It really is a joy to see the leds change state and hear the click. Simple pleasures. A lifetime of doing this for a living and still: happy dance

manic glacierBOT
slender iron
#

@tulip sleet want to chat now?

tulip sleet
#

sure

manic glacierBOT
orchid basinBOT
manic glacierBOT
#

Changes

Based on goals and discussion in https://github.com/adafruit/circuitpython/issues/3837:

  • expand retries to all reasons for disconnection except for: the two current fatal reasons that raise an exception (NO_AP_FOUND==201 and AUTH_FAIL==202); and the one reason that arises when user code manually triggers a wi-fi disconnect or stop (ASSOC_LEAVE==8)

  • return the error code for exceptions that don't currently have s...

crimson ferry
#

Anyone have a clue what this is referring to in the test Action?```Build mpy-cross
Build unix port
Test all
Print failure info

1 Run for exp in *.exp;
2 for exp in *.exp;
3 do testbase=$(basename $exp .exp);
4 echo -e "\nFAILURE $testbase";
5 diff -u $testbase.exp $testbase.out;
6 done
7 shell: /usr/bin/bash -e {0}
8 env:
9 CP_VERSION: 6.1.0-rc.0-176-gfcec243ec
10 pythonLocation: /opt/hostedtoolcache/Python/3.8.6/x64
11
12 FAILURE *
13 diff: *.exp: No such file or directory
14 diff: *.out: No such file or directory
15 Error: Process completed with exit code 2.```

last flame
#

@crimson ferry I know very little python but looking at the script appears to be some form of snapshot testing? diffing/comparing pre/post (file.exp > file.out)? strangely it looks to be treating the wildcard as a literal rather than a list of files? maybe 😬

probs no help but maybe it triggers an 'ah ha!' or a 🤦‍♂️ heh

manic glacierBOT
#

Fixes #3975. Fix tested by @jlopez, who file the original issue.

_bleio: When doing a remote a remote characteristic or descriptor write, the size of the remote attribute is not known. The code was mistakenly checking against the default values in the characteristic or descriptor proxy object. This was a actually a regression: the original code had the check in the right place. Moved the checks so they only happens when writing a local value.

lunar crown
#

Thoughts about CircuitPython in 2021.

#

I would like to see a high end processor, such as a larger M7, with larger
on-board memory that would be a step above the introduction level processors,
to provide a growth path out of the LED blinkie world. I would like to to have
an Adafruit CircuitPython processor for some long term projects such as
monitoring many things, or logging multiple things, for weeks or months without restarting. I would rather spend my time fighting the problem at hand, rather
than the limitations of small memories on small processors.

Finish and deliver on one (or more) of the M7 processors that have been started.

Dual precision float: time_monotonic() is a time bomb waiting to go off.
The suggested time_monotonic_ns() replacement, is too fine, and using
the unlimited length integers to work with it, is too slow. Maybe this can only
be fixed on high power processors like the M7. A double precision float sounds
like a possible solution, but might be restricted to the higher end processors.

Threading, or at a minimum, a foreground/real-time-background processing
environment. Any of the multiple proposals would be an improvement.

I would challenge Adafruit with a business question: You are doing a great job
with your current mission of introducing and training beginners in electronic
and digital technologies. Then what? Do you want to be part of the next upward
step after that?

tulip sleet
#

@slender iron ^^
@lunar crown if you haven't done so could you also email the above to circuitpython2021@adafruit.com? That will make sure it gets listed. Thanks!

lunar crown
#

K

tulip sleet
#

@onyx hinge @slender iron I just did a PR, and the cached extensa builds are failing, maybe due to a corrupted or now-out-of-date cache. There is no UI way to clear the cache: https://github.com/actions/cache/issues/2. I am doing a re-run and if it fails too, I'll change the cache key 😦

onyx hinge
#

@tulip sleet thanks, that is something we've had to do in the past..

tulip sleet
#

the issue to clear the cache is 15 months old.

#

not sure why it's not on their high priority radar

onyx hinge
#

🤷

#

Must be difficult

manic glacierBOT
#

@tannewt I wanted to follow up with you on this issue to talk more about the socket close behavior. Under what conditions do you want sockets to close automatically (ie, what's the scenario where they could leak when using recv, as you mentioned)? The Cpython docs don't say anything about automatic closes, and I couldn't find reference to them in the code, but the source is pretty complex so I could have missed the condition.

crimson ferry
#

@last flame Thanks, I poked around in the tests directory, nothing jumped out. I'm baffled how it relates to my change, but will dig deeper where you pointed.

manic glacierBOT
#

Currently, the Socketpool/Socket API somewhat awkwardly crams two different libraries into the same implementation, using LWIP for non-encrypted TCP and datagrams, and the IDF/mbed TLS library for encrypted communication. Since TLS isn't really a transport layer library, it would be better to separate it into a different implementation of Socket, so the current Socket code doesn't need to infer what kind of socket it's dealing with for each call.

This is a follow up issue to PR #3854.

onyx hinge
#

@crimson ferry the real problem is the translations error. The "print failure info" step is intended to run when the immediate previous step fails, to show extended information about failures during "test all". but because of how the github actions are actually set up, it runs for any previous failure instead.

#

Checking locale/circuitpython.pot
Missing message id. Please run make translate
{'Unknown failure %d'}
make: *** [Makefile:251: check-translate] Error 255
Error: Process completed with exit code 2.

#

(if "test all" fails then the info under "print failure info" is potentially useful; if it's some other failing step then it's NOT useful and also ends up appearing to be a failure itself)

manic glacierBOT
crimson ferry
#

Thanks @onyx hinge, when I clicked into the errors, that was scrolled out of sight so I was focused on the red herring. I'll look into the translation issue when I get back.

manic glacierBOT
#

This issue is for tracking or suggesting new methods and features for Socket. There are a number of methods not yet implemented for the Socket module, such as:

getsockopt()
setsockopt()
recv()
sendall()
getblocking()
setblocking()
getpeername()
getsockname()

Some methods may not be appropriate for Circuitpython, and others may be low priority but also trivial to implement. If you have a specific feature you require from Socket to support a library or project, please men...

#

This issue is for tracking or suggesting new methods and features for Socket. There are a number of methods not yet implemented for the Socket module, such as:

getsockopt()
setsockopt()
recv()
sendall()
getblocking()
setblocking()
getpeername()
getsockname()

Some methods may not be appropriate for Circuitpython, and others may be low priority but also trivial to implement. If you have a specific feature you require from Socket to support a library or project, please men...

orchid basinBOT
manic glacierBOT
manic glacierBOT
#

ESP32-NOW is a custom connectionless protocol developed by Espressif, which allows ESP32 and ESP32S2 boards to communicate directly with each other without using WiFi. It's supposedly similar to the 2.4GHz connectivity used in wireless mouses. This would enable ESP32S2 projects to connect multiple devices without the need for a router or any kind of internet connection, such as gathering data from a network of remote sensors, ...

ionic elk
#

@lunar crown have you tried the STM32 H7 series? That's a very powerful M7 board, with up to a megabyte of SRAM. People have ported the original DOOM to it. We have basic support for both it and the F7 series.

manic glacierBOT
#

@tannewt Thanks for the additional detail. I'm still trying to make it up the learning curve on setting up these IO pins, so thank you for point me in the right direction.

I still am trying to figure out how to setup these registers to connect everything for the ParallelBus. If possible, I'd appreciate a few minutes of description at your famous Deep Dive Live Stream.

I'm fumbling through the documentation, so I wanted to capture what I found and request your feedback on which is th...

crimson ferry
#

Is there a rule of thumb for raising exceptions in shared-bindings vs. common-hal?

manic glacierBOT
#

I noticed that the copyright date on the CircuitPython ReadTheDocs site is still displaying 2020. I realize that it doesn't (yet) show 2021 since there haven't been any updates for the site in 2021 yet, however, when the site is updated to support the next release of CP, it should display 2021.

Looking over the docs section of the code, and this history of the configuration line ([/conf.py](https://github.com/adafruit/circuitpython/blob/47015d7789...

tulip sleet
onyx hinge
#

quickly updates copyright year on his blog

manic glacierBOT
crimson ferry
#

@tulip sleet what non-Python contexts would use common-hal? I thought it was only to abstract port-specific stuff from the shared APIs

tulip sleet
#

some common-hal timing routines, and sometimes we call pin operations, etc.

crimson ferry
#

ah, ok, thanks that helps

manic glacierBOT
#

How fast do we expect this to propagate? Checking it today, it still shows out of date documentation as the first result.

Results from today (incognito). First link is to the 2.x version, second is to latest.
<img width="653" alt="Screen Shot 2021-01-14 at 2 11 09 PM" src="https://user-images.githubusercontent.com/5904176/104637120-5b1fc000-5672-11eb-860e-f7cd69f406da.png">

If it's too early, hopefully this image is a helpful baseline to test again - ideally we should only see the seco...

slender iron
tulip sleet
#

something changed out from under the cached version

manic glacierBOT
#

uzlib isn't actually used in any firmwares, but is built into the "unix" port used for testing.

The main benefit of the update is to fix problems encountered on Windows, as the old ref of uzlib had filenames with embedded colons; this has been fixed upstream.

uzlib seems to have been reabsed since the version that we took; this doesn't really matter to us.

onyx hinge
#

@slender iron what do you think of removing from our ports/unix the stuff that we never build into any of our firmwares, like uzlib, axtls, etc? it would get rid of some submodules, otherwise no big benefit.

tulip sleet
#

would it break the unix build?

onyx hinge
#

no, it would mostly just be disabling modules

slender iron
#

that's fine with me

onyx hinge
#

for instance, axtls can maybe be used for tls but is also used for hash library functions we never enable in circuitpython firmwares (to the best of my knowledge)

#

.. we use mbedtls from esp-idf for tls if we use anything ..

tulip sleet
#

would we have to turn off some tests? I am just thinking about merging from upstream later

onyx hinge
#

it's true, it becomes a bigger delta from upstream. I think that for the most part tests say "try: import ... ; except: skip the whole test" so that works

tulip sleet
#

axtls is mentioned explicitly in the Unix makefile, for instance

onyx hinge
#

a pile of unneeded changes compared to upstream is a good reason for me not to touch it

tulip sleet
#

yeah, i think pulling those submodules is small potatoes compared to some other susbmodules. I agree it's noise.

#

uzlib: i will review and merge as soon as it builds fine

onyx hinge
#

thanks!

onyx hinge
#

@tulip sleet sure, but it looks like there are some conflicts in ble to resolve. Should I take the side that adds +0.5f to the timeouts for "rounding"? + uint32_t nrf_timeout = SEC_TO_UNITS(timeout, UNIT_10_MS) + 0.5f;

#

in fact I'm kinda finding the 6.0.x version of this change weird .. ```+

  • if (nrf_timeout) {
    nrf_timeout = BLE_GAP_SCAN_TIMEOUT_UNLIMITED;
    }``` isn't this condition wrong?
tulip sleet
#

those changes should already be in main; I'm confused why they're in the diff, and that bug was fixed already

#

maybe just cherry-pick your one change; that would be easier; there shouldn't be anything in 6.0.x that's not already in main; I did the cross-ports of the fixes, I think all of them

onyx hinge
#

looks like main got "BLE fixes" and "Round BLE timing values; fix timeout check" while 6.0.x only got "BLE fixes"

tulip sleet
#

right; the newer fixes are going in 6.1.0, I'm not bothering to make a 6.0.2, because 6.1.0 is imminent

#

BLE fixes needed fixes

onyx hinge
#

OK, then it makes sense why there was a conflict, and it made sense for me to resolve it by taking the "main" more-bugs-fixed version

tulip sleet
#

because they are not the same commits there's all this noise in the diff?? it's confusing

onyx hinge
#

git gonna conflict

manic glacierBOT
#

There were conflicts in ports/nrf/common-hal/_bleio/Adapter.c and shared-bindings/_bleio/Adapter.c that I resolved by taking the "main" branch side. "BLE fixes" was applied via cherry pick to both branches, but "Round BLE timing values; fix timeout check" was applied only on the main, which git couldn't resolve on its own.

There were conflicts in circuitpython.pot that I resolved by regenerating the file with make translate.

onyx hinge
#

@fossil gorge congratulations on being the one to file Issue #4000 on circuitpython! It's a milestone.

tulip sleet
#

i don't think circuitpython.pot needs a merge at all; could you just cherry pick the unix/Makefile one?

onyx hinge
#

"4000th issue filed" doesn't feel like something to celebrate, but since it's PRs + Issues I'm still kinda happy about it

tulip sleet
#

or are those genuine ulab message updates?

#

i thought we already did 1.6.1 in main

onyx hinge
#

Yeah that was my mistake, I did not have submodules up to date when I regenerated circuitpython.pot.

#

@lapis hemlock what's new?

#

@tulip sleet check the PR again, it now has only the change you'd expect. I can do this as a cherry pick instead if we don't plan on more 6.0.x -> main merges though

lapis hemlock
#

@onyx hinge quashed a bug, added a function.

tulip sleet
#

np, I think it's now equivalent

onyx hinge
#

oh you merged my pr, thanks @lapis hemlock

lapis hemlock
#

@onyx hinge I basically backported a fix.

fossil gorge
tulip sleet
#

i'm not sure whether the list of commits is confusing or not it seems weird

lapis hemlock
tulip sleet
#

Yeah, maybe just a cherry pick, it will be less confusing for the future

manic glacierBOT
onyx hinge
#

it's been happening to me repeatedly that when I complete filing a PR it takes me to an "issues/####" URL which is 404'd, but reloading the page gets me to the pull request. weird.

tulip sleet
#

sometimes I click on a commit that isn't there

#

so we'll close #4003 and I'll kill those jobs?

onyx hinge
#

sure, if you prefer the cherry pick

tulip sleet
#

yes, I think so, the merges are confusing, and I know they were all better on the main side except for the unix fix

tulip sleet
#

@onyx hinge let's discuss what to put in 6.1.0-rc.1. Do you want #4005, #4004, #4002? I am willing to defer #3993. #4001 seems cheap and easy, and solves some support problems immediately.

#

it was ok with scott to defer 3993.

#

i would expect a 6.1.1 soon. I want to get 3993 in, and I want to fix the stalled CIRCUITPY write problem (no known fix for that yet).

tidal kiln
#

is #3940 in?

tulip sleet
#

yes, a week ago, np

onyx hinge
#

#4005 is the only user-facing one out of those three, the others can wait

tulip sleet
#

4001 also

onyx hinge
#

oh sorry, yes

tulip sleet
#

ok, great, if you approve that one, then I will move the 6.1.x branch commit to that merge, and then make another release. Scott thought it was easier to move the branch than do all kinds of backporting

onyx hinge
#

we'll appoint him our git philosopher then

#

he'll need to grow a beard and move to the top of Mt. Rainier though

tulip sleet
#

or we could switch to clearcase 🙂

onyx hinge
#

I've never had the pleasure. Couldn't be worse than RCS + a pile of elisp

tulip sleet
#

in clearcase you can pull arbitrary things from different trees. I worked for a place that did that. It was a nightmare.

onyx hinge
#

I'm sure you have better things to do than listen to IT horror stories from the before times, so I'll try not to start.

thorny jay
#

I was super afraid that @tulip sleet and @onyx hinge were trying a coup/putsch and making a release in the absence of @slender iron. I am reassure you are watching this.

slender iron
#

I asked them to

#

and they shouldn't need my approval anyway

thorny jay
#

You have all my support, as long as A1 is available as A1. 🙂

tulip sleet
#

that is the most important fix, obviously 🙂 (seriously, we should have spotted that a while ago)

#

@onyx hinge as long as I am waiting for builds... do you think I should avoid including the ulab 1.7.0 update? or it woudln't hurt

tulip sleet
#

@onyx hinge ulab stubs generation is failing in build

#

so we won't bother with this now

onyx hinge
#

@tulip sleet that's fine, I'll look into it soon

slender iron
#

@tulip sleet still on for joining the stream tomorrow? I'm going to post my regular blog post about it

tulip sleet
#

yup, sounds good!

slender iron
#

great!

manic glacierBOT
#

re: logging ...the build process is mostly a black box to me, but maybe there's a way to do it there in the automated builds. I can start to look into that, any guidance would be helpful.

I think it's a setting you can set with menuconfig. However, I just realized we actually disable the debug UART in non-debug builds so that it can be used by user code. I think that's still best. Maybe we just need better error messages in circuitpython?

crimson ferry
#

Is there a manual step when adding or changing strings? I have a PR failing in test, I think the key bit is "Missing message id. Please run make translate". (no results from a learn guide search for "translate")

slender iron
#

ya, you need to run make translate in the top level directory

#

it'll add the new strings to locale/circuitpython.pot

crimson ferry
#

locally? then commit that additional file?

slender iron
#

@crimson ferry yup!

crimson ferry
#

got it, thanks!

manic glacierBOT
manic glacierBOT
manic glacierBOT
fossil gorge
#

I'm also thinking it's worth mentioning in a contribution guide. I'm looking for which would be best to add that in, since it's quite core/C specific of a step

tulip sleet
#

we actually just tried that in a PR, but had trouble getting it working, and reverted it

fossil gorge
#

I see. I was thinking in a developer's local pre-commit hook

#

So that it doesn't need to happen during the CI process. Then again, it's probably safe to assume not everyone has the pre-commit hooks installed or running locally

tulip sleet
#

i don't know of anyone who's done that, but it's a good idea.

fossil gorge
#

sheepishly raises hand

tulip sleet
#

somehow we missed that possibility

#

how do you set it up?

fossil gorge
#

One sec, I'll pull up the reference

tulip sleet
#

(I was always wondering why it was called "pre-commit"!)

fossil gorge
#

This is what I followed. I thought I remembered it being fairly simple, but at this time of day/night, I'm fairly simple myself, so...
https://pre-commit.com/#install

#

So now, whenever I run a "git commit", the hook/script runs

tulip sleet
#

we already have a .pre-commit-config.yaml in the code base, but for me it only runs when I push a commit to a PR. so I need pip3 pre-commit and also then pre-commit install, is that right?

fossil gorge
#

That sounds correct from what I remember

#

It takes that config that's in .pre-commit-config.yaml, which is what the Github Action uses as well

tulip sleet
#

as long as they don't have to be different

#

ah ha

#
halbert@salmonx:~/repos/circuitpython$ pre-commit install
pre-commit installed at .git/hooks/pre-commit
#

ok, i'll do something fake here

fossil gorge
tulip sleet
#

OK!

fossil gorge
#

Success?

tulip sleet
#
halbert@salmonx:~/repos/circuitpython$ touch foo
halbert@salmonx:~/repos/circuitpython$ git add foo
halbert@salmonx:~/repos/circuitpython$ git commit -a -m "testing pre-commit"
Check Yaml...........................................(no files to check)Skipped
Fix End of Files.........................................................Passed
Trim Trailing Whitespace.................................................Passed
[throwaway 926a01d90] testing pre-commit
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 foo
#

yes! thank you! I never really read the pre-commit doc. someone else offered it to us, and we just added to the actions

fossil gorge
#

My pleasure! 🙂

#

It's pretty slick, and I'd never heard of it before

tulip sleet
#

we should add this to the appropriate guide

fossil gorge
#

That's what I was thinking, and trying to figure which guide that would be.

#

At the same time, also mentioning that errors/text/strings should be wrapped in translate() for localization

tulip sleet
#

so the next q is what went wrong with our trying to move the translate check to pre-commit. (We also happened to end up with bad action cache at near the same time, and had to change the cache key.) may or may not be related

blissful pollen
#

So just pip install pre-comment and "pre-commit install" and it works? as someone new to the core that would be so nice (as evidenced by my 5 following commits fixing small problems)

fossil gorge
#

Correct @blissful pollen. And it will use the .pre-commit-config.yaml file that's currently in the CP repo

tulip sleet
fossil gorge
#

Also, it's called "pre-commit", but their docs mention that other git hooks are supported, like "commit", "post-commit", "push", etc.

tulip sleet
#

i was not really aware of these hooks; I thought it was strictly a github actions job thing

blissful pollen
#

awesome, installed just gotta have something to commit now

tulip sleet
#

ok, thank you so much, we'll bring it up with the team!

fossil gorge
#

touch foo && git commit -am "Test?"

blissful pollen
#

oh one thought for the guide, when I realized I should run the pre-commits manually to make sure I could push I had to install the tools the pre-commit ran I think, may want to make sure that doesn't trip others up

blissful pollen
tulip sleet
#

i did it in a throaway branch

#

git checkout -b throwaway

fossil gorge
#

the one part I'm not certain about is using it or configuring it in virtual environments.

blissful pollen
#

@fossil gorge Worked great for me, that's really awesome

fossil gorge
#

Awesome! Hopefully it can help more long-term for local checks. Some like that idea someone had at some point to try compiling locally first 🤷

tulip sleet
#

@idle owl @onyx hinge @slender iron did you know you could run the pre-commit test locally? I was totally unaware, but maybe I'm out of it. See ^^

blissful pollen
#

Part of the reason I love following all this, I've been out of day to day dev for a while and nice to see what's out there to at least keep my knowledge up

slender iron
#

@tulip sleet yup! Sorry! One of those things you setup once and forget about doing it

tulip sleet
#

np, i'm happy

#

getting our library writers onto this would be a big help, given the extra commits for black, etc.

onyx hinge
#

agreed

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 6\.1\.0\-rc\.1
orchid basinBOT
fossil gorge
#

Because I'm stubborn and had some no spare time, I was digging into why the pre-commit hook was failing in the manner described in #3985, and I have a theory...

I suspect that what was happening is that the shell command that created the locale/circuitpython.pot.tmp file didn't finish writing the file to disk, hadn't yet started, or started but the file was not flushed before the tools/check_translations.py got to problematic line.

HOWEVER, even if we did wait for the locale/circuitpython.pot.tmpfile to be fully written to disk, the call to pre-commit would still result in an error, since part of its checks, along with running the hooks, is to ensure that no files were changed (as determined through a call to git diff). And if there were any changed files, the pre-commit action fails, and we're back to where we started.

#

As an alternative to that method, however, my thinking is that perhaps there could be a separate workflow or similar process, which performs the operations which the pre-commit hook was intended to perform, and then adds a commit to the PR (or gently declines it) with the corrective measures. Perhaps something which could be performed by adabot (https://github.com/adafruit/adabot )?

tulip sleet
#

feel free to add this to closed pr, we can follow up on this, thanks!

fossil gorge
#

Ok, will do. I wasn't certain how acceptable commenting or adding to closed PRs was, so didn't want to raise anyone's ire. Thanks @tulip sleet!

tulip sleet
#

np, a comment germaine to the PR is always helpful. Sometimes it gets off track, and then we ask for a new issue, but if it has to do with the PR, great

hoary moat
#

It really helps if you pass WIZNET5K the actual MAC of your Ethernet Feather. 😉

#

Maybe we can expand the Feather Ethernet doc to include CircuitPython and not just Arduino.

manic glacierBOT
#

Adding my comments here which I'd posted in #CircuitPython on Discord ([here](#circuitpython-dev message))

I have been digging into why the pre-commit hook was failing in the manner described in this PR (#3985) as well as observed in #3984, and I have a theory...

I suspect that what was happening is that the shell command that created the locale/circuitpython.pot.tmp file either didn't finish writing the file to disk, hadn't...

marble hornet
#

@gilded cradle could you please go into a little more detail regarding'Dynamic Importing'? Reading your 2021 post I think I might know what you mean. I've done dynamic importing and "deimporting" of modules in cp before, what are you looking for?

manic glacierBOT
onyx hinge
#

@tulip sleet thank you for the release!

tulip sleet
#

yw, lotta waiting around 🙂

prime flower
lapis hemlock
#

@onyx hinge Jeff, thanks for catching the glitch in the stubs! Is it OK, if I remove release v.1.7.0, and create a new tag? (There was a small bug in frombuffer that I found, when writing the documentation, and backported the fix for the circuitpython version.)

onyx hinge
#

Tag and release 1.7.1?

lapis hemlock
#

Right.

onyx hinge
#

sounds good to me!

#

(I don't think it's customary to remove a release, though there may be good reasons for it sometimes)

lapis hemlock
#

OK, I can leave it. I have also released 2.1.2, that is master now. I commented out the compilation instructions for circuitpython. We can put them back later, once circuitpython decides to adopt the numpy-compatible interface.

onyx hinge
#

OK!

lapis hemlock
onyx hinge
#

excellent, thanks -- I'll upgrade that PR and hopefully that was the only speed bump. thanks as always for ulab and for quick responsiveness!

manic glacierBOT
#

Here's my reply from Espressif:

Thank you for your feedback and for bringing this again to our attention. The respective header file (components/driver/include/driver/adc_common.h) is still in review and the update should be released soon.

  • The maximum voltage measurable with ADC of ESP32-S2 for attenuation at 11dB is 2.6 V.
  • According to our design engineers this value is limited by hardware and cannot be "unlocked" with software.
  • We are planning to remove description o...
ionic elk
#

@onyx hinge @tulip sleet when either of you have a sec, do you think you could check out the CI error on my TCPServer PR? I'm not sure it's related to my code

onyx hinge
#

@ionic elk I think it's a problem that would be fixed if you merged in or rebased onto adafruit's main branch

tulip sleet
#

yes ^

#

actually just a job re-run might fix it, because it's doing a tentative merge

#

i will start a re-run

gilded cradle
#

@marble hornet I meant like if you wanted to automatically search for specific files in a folder and then import those files one by one like how Python does it with the __import__ function.

#

Or using importlib

#

I think implementing __import__ would be more applicable to CP though.

onyx hinge
#
``` isn't it there already?
#

however, there's a comment that "import" (statement) doesn't invoke __import__, it invokes built-in logic; so you can't replace the behavior by replacing __import__ like you can in standard python3

manic glacierBOT
hoary moat
manic glacierBOT
marble hornet
#

@gilded cradle I've been working on a way to import "apps" for the watch at runtime. If I can be of any help I'd be more than glad to work on module for importing at runtime/etc. Though if you know what you're looking for, some more fleshed out features/functionality would be great.

In the past i've used sys.modules in combination with __import__ or exec(f"import {module_name} as imported_module") to import modules in circuitpython. With some finagling, the modules can be freed and the memory can be re-used.

#

😅 and eventually some help with the release process

gilded cradle
#

Oh, so the __import__ function does already exist? Interesting. I'll have to look into that. I think I ended up taking a completely different approach anyways, but good to know for the next time I need something like that.

fossil gorge
tidal kiln
#

what version of black is pre-commit using?

manic glacierBOT
tidal kiln
manic glacierBOT
slender iron
#

@onyx hinge did you ever ask weblate about the weird merge thing?

onyx hinge
slender iron
#

ya, I know that

onyx hinge
#

something's weird but nobody's offering a solution

slender iron
#

and compare looks ok

onyx hinge
#

besides rebase

slender iron
#

weblate is doing weird things I think

#

usually before a PR you merge upstream into your feature branch

onyx hinge
#

If you can explain it better than I did maybe you can give better info to the weblate folks

slender iron
#

I'll reply. thanks for the link!

onyx hinge
slender iron
#

right, so a PR must behave differently

onyx hinge
#

I'm baffled because everything except the github pull request reflects sensible information

#

and only for weblate

slender iron
#

k, I replied

#

lunchtime now

onyx hinge
#

thanks for following up

manic glacierBOT
lone axle
#

@tidal kiln I think Kattni may have mentioned being out for a few days. I've been helping with those pre-commit and license reviews though. I had a quick look over that one and it does seem fine to merge to me. I'll be getting back to reviewing and merging them later on tonight.

tidal kiln
#

cool. thanks.

#

i'll go ahead and merge it. it seems pretty boiler plate.

manic glacierBOT
manic glacierBOT
gloomy shuttle
#

Last weekend I started work on a library for the wii classic controller. After thinking about it further, I came to the conclusion that it may be better to incorporate it into the existing adafruit_nunchuk library. This approach will allow for a better experience for the end user and the ability to easily add support for other extension controllers, such as the Guitar Hero device (https://wiibrew.org/wiki/Wiimote/Extension_Controllers).

Any feedback would be greatly appreciated.

kind river
#

I heard there was some interest in a community STM32WB55 port. My WB55 Nucleo came in yesterday, so I'm available to help out.

thorny jay
# gloomy shuttle Last weekend I started work on a library for the wii classic controller. After t...

I am very much interested by opinion and decision on this topic. Based on Nunchuk library and your library, I made a working library for the uDraw GameTablet (I may need to rename the button to be C an Z like for Nunchuck, and the pen pressure also act as a button whose name I need to decide). And I don't know the best way to publish that... I was planning to do exactly as you (separate library and try to get into the community bundle). I am not sure there is much to reuse between those library as it is pretty simple and very small. But sure, on Arduino side all the WiiMote attachement are together in the same library. Here is my proof of work: https://twitter.com/DavidGlaude/status/1350250736525959169?s=20

Working on @CircuitPython support for the uDraw Wii Game Tablet. (uDraw for the Wii is I2C, for PS3 and XBox it's USB).

Ideal wiring: PC -USB- QT-Py -StemmaQT- uDraw connector.

No soldering required with https://t.co/SbHtdVlZj5

My software emulate mouse movement and click. https://t.co/DuFpodz0Yc

▶ Play video
gloomy shuttle
# thorny jay I am very much interested by opinion and decision on this topic. Based on Nunchu...

I saw your fork and subsequent pull requests on my original community library attempt as well as your tweet about your uDraw work which was what made me rethink my approach. If you look at the new pull request, I pulled out the initialization, read_data, and read_register into a superclass (NunchukBase) and then have a subclass for each device (Nunchuk, ClassicController). I think your uDraw work could be incorporated by just creating another UDraw class.

thorny jay
#

Ok, I'll have a look. I believe it is possible to auto detect the accessory, but code should be minimal so ad-hoc import might be best... a separate detection could be done.

#

The other question is how to abstract the Joystick concept to have it to make CP game that work with various joystic (Wii, Button on the PCB, Wireless, ...) but this is another topic.

gloomy shuttle
#

The nunchuck joystick provides output from (0,256). Should all the joysticks be mapped to the same range?

lone axle
#

I will be streaming for a bit this morning reviewing, and working on a few library PRs if anyone around is interested in watching along or hanging out for a bit. Very impromptu, partially just testing how everything is set up. I'll put links to Twitch and Youtube in the #livebroadcast channel in a moment.

manic glacierBOT
#

Documenting some ways to optimize Build-CI runs :-

  • Deleting previously running CI tasks on a PR when a new CI task starts on the same PR.
  • If the changes are only in port specific sub-directory. Don't run test for other ports.
  • Running documentation build when changes are in the places that we know contain docs (e.g. shared-bindings directory).
tulip sleet
#

@analog bridge1 I'm trying to get TouchAlarm or TouchIn to actually detect touches. TouchIn.raw_value is always 65535 on the MagTag, Metro ESP32-S2, and FeatherS2. For TouchAlarm, it never triggers a wakeup, and when plugged into USB, I can't control-C the simulated sleep.

#

i'll file an issue unless you have an idea of what I might be doing wrong

thorny jay
#

Ok, now I am GitHub / git confused... I want to add another accessory for the WiiMote. The change would go in https://github.com/adafruit/Adafruit_CircuitPython_Nunchuk but it is an add-on to the PR of @gloomy shuttle . I can either wait for that one to be accepted... or propose a PR to that branch: https://github.com/jfurcean/Adafruit_CircuitPython_Nunchuk/tree/change-to-module . The final goal is Adafruit Library + @gloomy shuttle PR + my piece of code for uDraw GameTablet...

gloomy shuttle
#

I am not sure what the best approach is as I am new to using GitHub for collaborating on projects, but I am happy to merge it into the branch of my pull request if you do a PR on that.

thorny jay
#

I'll give that a try. And you included the mouse example correction in your own PR...

manic glacierBOT
iron bloom
tulip sleet
#

there were software problems with the IR-reading code in CIrcuitPython

manic glacierBOT
iron bloom
#

@tulip sleet Thanks. IR communication was suggested by some assistive technology teachers as an easy way to connect adaptive switches to devices. I’ve been interested in that product since it came out. I know it’s not ideal, but I’d be content with just Arduino support. But then you could use a trinket M0 and a separate IR. Just hoping for a simple Adafruit solution that teachers could use. No disrespect to teachers.

tulip sleet
iron bloom
tulip sleet
#

yes, try that. I think the main issue was how reliable the IR reading was

#

I pointed to the older Learn Guide above because it also has an Arduino example

manic glacierBOT
manic glacierBOT
blissful pollen
#

Git question that I hope makes sense. I have a draft PR with 4 commits. But my branch is behind the adafruit/main branch. If I rebase my local branch to adafruit/main I get a message that my local branch is now 270~ commits ahead and 4 behind.

Are those 4 the original 4 commits I made, that my rebase reapplied after all the latest adafruit ones? Would this be the proper time to use the git push with fast forward to bring my github branch all up to date?

I was able to do this with git pull then git push, but then I have an extra commit with a (seemingly?) useless git pull merge commit

#

(Which looking at my PR #3936 now is what I appeared to have done now that is has 221 commit ugh)

tulip sleet
#

@blissful pollen you don't need to catch up with main unless there's a merge conflict between your PR and main. Is that true?

Usually if I need to resolve a conflict I merge, not rebase, from upstream.

blissful pollen
#

The fixes to remove busdevice weren't in my branch and to re-enable it I needed those PRs. Specifically the frozen library ones

manic glacierBOT
tulip sleet
#

I think you are 270 commits ahead of your github repo, not of adafruit/main. IS that the question? There have been many commits in the past few weeks.

I'm not sure if your rebase is easier or doing a merge and then undoing some of the things is easier. You could cherry-pick commits from the past.

In general I have seen much more damage done by rebase than by merge.

blissful pollen
#

I think that is what I ended up doing. I somehow did get all the previous commits into my PR so I think I can back out of that last push . Failing all this may be easiest if I just close that PR note what happened and I can easily create a new branch/PR

blissful pollen
tulip sleet
#

yes. I'm not sure whether the merge is going to give you a lot of conflicts to resolve or not. Have you use git mergetool before? I use it with kdiff3 or meld. (meld more recently because kdiff3 is broken for me in a few ways: most notably it doesn't display underscores)

blissful pollen
#

I haven't used it a lot. Somehow in reverting my last change I seem to have got the changes into my github branch too... so not 100% sure what I did. But I seem to have what I need now

manic glacierBOT
thorny jay
# iron bloom <@329766224093249548> thanks I’ll take a look at that next. There is also this t...

I used IR a lot for my work with CircuitPython for sending on Trinked M0 with just an LED and a resistor and it worked fine to control LG TVs (that was more than a year ago, so much older CP version). Some success too with Circuit Playground Express too, both sending and receiving. On the receiving side, I acquired a Flirc that was working great to emulate keyboard and is customisable: https://flirc.tv/flirc-usb

manic glacierBOT
manic glacierBOT
#

There's a comment at the top of common-hal connect(): "// check enabled"

If I'm understanding right, wifi start-stop is exclusively managed by radio_set_enabled() (called once per reload by wifi-Init, then can be called again by circuitpython user code to start/stop wifi). So implementing "check enabled" would not let us connect if wifi isn't started up. I suspect this is where the issue currently lies.

The other factor potentially is whether there is already a station connection to...

manic glacierBOT
#

We need to revert the work done in this please:
https://github.com/adafruit/circuitpython/pull/3930

It completely prevents the user from shutting down LDO2 and any expected behaviour a user would expect after that happens.

CP is driving the APA all the time, so parasitic current is leaking form the APA and causing 1.4-1.6V to come out of the 3V3O pin when LDO2 is shutdown.

It's also confusing folks as the APA is now "doing it's own thing" all of the time now, not just when the user ...

manic glacierBOT
#
[adafruit/circuitpython] New branch created: revert\-3930\-jerryn\_feathers2\_led
manic glacierBOT
lone axle
#

Does anyone whose around happen to know if this is the correct way to handle multiple copyright authors when the list of names would be long enough that pylint complains the line is too long?

#
# SPDX-FileCopyrightText: 2020 Tony DiCola, James DeVito, for Adafruit Industries
# SPDX-FileCopyrightText: 2020 Melissa LeBlanc-Williams, for Adafruit Industries

basically just adding a second # SPDX-FileCopyrightText line. I wasn't sure if something automated would get broken if there are two of those.

crimson ferry
analog bridge
tulip sleet
#
>>> import touchio,board
>>> t = touchio.TouchIn(board.IO5)
>>> t.raw_value
#

pin choice is arbitrary

#

I'm seeing t.raw_value == 65535 all the time

analog bridge
#
Adafruit CircuitPython 6.1.0-rc.0-173-g90a6581ac on 2021-01-14; microS2 with ESP32S2
>>> import touchio,board
>>> t = touchio.TouchIn(board.IO5)
>>> t.raw_value
6135
>>> 
tulip sleet
#

i don't see that on Metro ESP32-S2 or MagTag or FeatherS2

#

o dpm

#

i don't have your board, sorry

analog bridge
tulip sleet
#

trying a bisect between beta.1 and beta.2, but running into compilation issues

#

i am starting with a fresh clone now

analog bridge
#

can you also do a adc test...

tulip sleet
#
Adafruit CircuitPython 6.1.0-rc.1 on 2021-01-15; Adafruit Metro ESP32S2 with ESP32S2
>>> import board,touchio,analogio
>>> t = touchio.TouchIn(board.IO5)
>>> t.raw_value
65535
>>> a = analogio.AnalogIn(board.A0)
>>> a.value  # A0 grounded
317
>>> a.value  # A0 to 3.3V
52090
analog bridge
#

I think he used MagTag

tulip sleet
#

i was originally testing TouchAlarm and MagTag and couldn't get it to trigger, so I tried simple touchio, and was surprised

analog bridge
#

this is strange...

tulip sleet
#

after some git bisect skips, I am getting something that builds, so I'll continue bisecting

analog bridge
#

reading issue #4014...
it worked for you in 6.1-beta.1...
can you grab the latest uf2 from s3 and test with it... just for similarity

tulip sleet
#

rc.1 above is very close to the latest, but it broke in beta.2, so I am bisecting between beta.1 and beta.2

#

just to save time

solar whale
#

FYI -- just tried on latest main ```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.

Adafruit CircuitPython 6.1.0-rc.1-15-g6a76b6002 on 2021-01-17; FeatherS2 with ESP32S2

import touchio,board
t = touchio.TouchIn(board.IO5)
t.raw_value
65535

tulip sleet
#

yes, I tested before and after the RGB revert, just in case it was that

#

but it was not

solar whale
#

whew!

tulip sleet
#

since it had to do with power mgmt

thorny jay
# analog bridge I think he used MagTag

Sorry, it was on FeatherS2. I made some attempt at TouchAlarm (or TouchIO) (when PinAlarm was not supported yet) on the MagTag and discovered that 3 out of the 4 button are on a touch capable pin. The button was sensing that I wanted to touch even before touching the button. The MagTag lack pin for testing, but one of the two JST3 connector is capable, but I failed to use it.

tulip sleet
#

i had tried on D10

thorny jay
#

It is totally possible that I did not use the same release for FeatherS2 and MagTag test as it was different days.

tulip sleet
#

i am getting close, 2 revisions left to test with bisect

iron bloom
#

@thorny jay thanks for the info. I look into that product as well. I got a CPExpress to work as an HID keyboard using IR. Simple one keyboard(space,enter) using code from different Adafruit tutorials. My next step is feedback from the teachers.

thorny jay
#

I am always hesitant to introduce issue, because I don't know if I made a mistake or if there is a bug. It is possible that I detected some of those touch issue and should have reported.

tulip sleet
#

@analog bridge this is the commit that goes from good to bad:

commit 048ca2a57003d6f122db57dfc93513222380cff0
Author: microDev <70126934+microDev1@users.noreply.github.com>
Date:   Sun Nov 22 18:54:18 2020 +0530

    get multiple touchpad working

 ports/esp32s2/common-hal/touchio/TouchIn.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
#

could you test on your board with GPIO5? Maybe the pin choice is not so arbitrary

solar whale
#

I tried several pins on the FeatherS2 ```Adafruit CircuitPython 6.1.0-rc.1-15-g6a76b6002 on 2021-01-17; FeatherS2 with ESP32S2

import touchio,board
t = touchio.TouchIn(board.IO5)
t.raw_value
65535
t3 = touchio.TouchIn(board.IO3)
t3.raw_value
65535
t11 = touchio.TouchIn(board.IO11)
t11.raw_value
65535

thorny jay
# iron bloom <@681528999520108564> thanks for the info. I look into that product as well. I g...

Not sure exactly what is your project, but is is very capable to receive signal from any old TV remote control. And Adafruit has those tiny smaller than credit card remote to play with. I you avoid bang&olufsen remote and some Sony that are "different" (38 vs 36) you should be good to go. I had no problem with LG that use RC5 protocol but more recent set top box we use at work are RC6 protocol and I gave up to write support for that.

manic glacierBOT
#

The early calls in connect() seem to be robust to getting called twice:
esp_wifi_set_mode() // in start_station() & esp_wifi_set_config()

But calling esp_wifi_connect() twice in a row in radio.c does trigger:

ESP_ERR_WIFI_CONN: WiFi internal error, station or soft-AP control block wrong

Oddly, in CircuitPython this seems to be fine:

wifi.radio.connect(secrets["ssid"], secrets["password"])
wifi.radio.connect(secrets["ssid"], secrets["password"])

But inte...

analog bridge
tulip sleet
#

maybe touch_inited gets smashed and the initialization never gets called? only a theory

lone axle
#

I will be streaming again for a bit this morning if anyone is interested. Working on some different PRs will post links in #livebroadcast in a moment.

manic glacierBOT
#

Hi AdaFruit/CircuitPython,

I'm new and I was trying to follow this instruction:
https://learn.adafruit.com/magtag-covid-tracking-project-iot-display/circuitpython-internet-test

I've got a silly obstacle on VS Code related to the module not found as per the attached screenshot.
I think I've got all the files right as per the attached images.

Would you please help?

![2021-01-17_23-26-26](https://user-images.githubusercontent.com/36352296/104849315-8f69d980-591b-11eb-9a19-6cdd0a98...

tulip sleet
analog bridge
#

oh ok

#

It is due to clock difference

tulip sleet
#

one interesting thing is that in the old code before the commit the _config is done beofre _set_fsm_mode and _fsm_start; in the new code the order is different

analog bridge
#

between boards

tulip sleet
#

aha

analog bridge
#

I have a 10ms delay

#

for this

#

it needs to be increased i think

#

that is a very subtle difference though

tulip sleet
#

but that is just after the construction. I am testing from the repl, so there are several seconds between TouchIn(board.x) and the .raw_value call. The delay there just causes the constructor to return slower

analog bridge
#

maybe it needs few seconds to reset... it all adds up

tulip sleet
#

i can call .raw_value many seconds later and it is still 65535.

analog bridge
#

I am confused

tulip sleet
#

like, I just did it with a 15 minutes delay

#
>>> import board,touchio,analogio
>>> t = touchio.TouchIn(board.IO5)
>>> t.raw_value
65535
>>> t.raw_value
65535
>>> t.raw_value   # 15 minutes later
65535
#

because i was reading code

#

i am going to add some logging to make sure the init code is called

analog bridge
#

we went in the wrong direction with 10ms delay thing... that is for threshold setting and should not effect raw_value results

manic glacierBOT
analog bridge
tulip sleet
#

@analog bridge

I (32674) touch.c: touch_inited: 0

but .raw_value is still 65535 in repl

#

i'm printing touch_inited at the beginning of peripherals_touch_init()

#

as expected, on second call to TouchIn, touch_inited is true

analog bridge
#

the difference between boards is bugging me here

tulip sleet
#

i know... did you try GPIO5?

analog bridge
#

yes... basically all of them

tulip sleet
#

are you using wrover?

analog bridge
#

no module

tulip sleet
#

could you just try erase_flash and then reload? I have occasionally had weirdnesses when part of flash was not erased

#

do you have psram?

analog bridge
#

yes 16MB flash and 8MB PSRAM

tulip sleet
#

are you using different clocking circuitry than the other boards

#

i am using all .bin

#

maybe the bootloader is setting something up

#

@analog bridge I have to stop for several hours, so you may go to sleep. I will try with .uf2 later. I haven't tried a kaluga or similar. If you have any other board that would be interesting to test

analog bridge
#

sure... I will do the test with .bin when I get a chance... its fun bug fixing specially the strange ones 🙂

tulip sleet
#

bye - thanks!

manic glacierBOT
#

Ready for review. This was done to fix the root cause for these issues:
#3856 - With duck typing this should no longer be an issue. I tested it using busio, bitbangio and a test class that just implemented the basic functions expected from the duck typing (and otherwise did nothing)
#3821 - I do not have a SHTC3 sensor to test this with. But the new code exactly copies the python code

I only have a couple I2C devices I can test with. So far most of my testing was with the BME280. I will ...

#

I just noticed a comment that could be improved for clarity, as I referenced it and it led me to think I had my QSPI SCK and CS pins reversed.

circuitpython/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.h

15 // DotStar pins, QSPI CS, and QSPI SCK
16 #define MICROPY_PORT_B (PORT_PB02 | PORT_PB03 | PORT_PB10 | PORT_PB11)

As it stands, PORT_PB02 and PORT_PB03 are understood to be the DotStar Pins, PORT_PB10 the QSPI CS, and PORT_PB11 the QSPI SCK. While it is correct...

manic glacierBOT
manic glacierBOT
manic glacierBOT
crimson ferry
#

do we have a preference for bool for using true/false vs. 0/1, or don't care?

#

(sometimes it's both in the same file)

rapid vine
#

I would say lean towards true and false as that it makes reading statements like the_dog_is_sleeping = true more human readable, though I couldn't find anything specific at the PEP8 style guide

crimson ferry
#

@rapid vine thanks, I should have been more specific... I'm looking at the C code in the core

lone axle
#

I lean toward same thing they said for the same reason. But don't have any real claim to have an opinion on it.

#

(even though it's C code and not python)

atomic summit
#

Kinda off-topic, but kinda not... Anyone here using BigSur? Have you got esptool issues? I'm looking at finally installing BigSur on my Intel iMac and think esptool might be the last thing holding me back, and I cant lose the ability to be able to build and flash CP firmware.

crimson ferry
#

@atomic summit I've been building esp32s2 on Big Sur. I had a challenging learning curve, but then I'd never built circuitpython (or anything much really) before at all. I think my issues were mainly toolchain dependencies probably not done right at first. But YMMV.

#

@lone axle thanks, I tend to agree true/false is clearer, but the follow-up question is a tougher call I think... whether to change that (if we have a standard other than "don't care") when making nearby changes in the core... some risk.

atomic summit
#

@crimson ferry Oh, excellent. So esptool flashes your boards ok? No errors or permission issues? I'm hearing mixed messages about it.

crimson ferry
#

I haven't encountered any esptool flashing issues. there is at least one other person here using Big Sur... maybe jerryn?

manic glacierBOT
crimson ferry
#

Is there a more-recent-than-6.1.0-rc.1 reason that would cause IO40 in use on Saola wrover? I don't see any pin changes.

manic glacierBOT
manic glacierBOT
solar whale
#

@atomic summit Just updated to current main and built/uploaded to feathers2 on My Mac with Big Sur using the latest version of esptool.py. I was having issues with esptool.py on Big Sur (some conflict with pyserial) , but it is working now that I upgraded to v3.0 (pip3 install --upgrade esptool)

thorny jay
#

@atomic summit as an alternative, the Web version of esptool worked great for me on Windows+Chrome. But I did not test on my Mac Mini, and for whatever reason I am not proposed to migrate to Big Sur (I don't know if I should be happy from that or if it mean I will not get any update anymore because my mini is too old).

solar whale
manic glacierBOT
manic glacierBOT
ornate breach
#

@tulip sleet I’m wondering if the OS Errno 5 is due to busio

#

Someone in #help-with-circuitpython is using dotstar which is raising OS errno 5 and the common thread between mine and some others getting it seems to be busio

manic glacierBOT
tulip sleet
#

@analog bridge hi - did you get any further with the touch problems, or do you not have any boards that exhibit the issue? tnx

analog bridge
#

I did a test with .bin after a complete flash erase and still unable to replicate the issue...

tulip sleet
#

@analog bridge do you have any other ESP32-S2 dev boards (not necessarily ours)?

#

If I have the same as you, I will try to duplicate, and then you can

#

i have one each of the ESP32-S2-SAOLA boards, one WROOM and one WROVER, and a couple of UnexpectedMaker FeatherS2's (the latter do show the problem, i have not tried the SAOLA yet).

analog bridge
#

@tulip sleet only microS2's here...

tulip sleet
#

this is very peculiar 😦 I will take a look at your schematic vs the other boards

manic glacierBOT
#

I didn't see that this was SAMD21, sorry. I think it is unlikely to be a memory smash on that board. If you look at ports/atmel-samd/common-hal/busio/I2C.c, error 5 (MP_EIO) can be generated if the underlying HAL drivers return an error due to some problem in communicating with the chip. This could be due to a peculiarity of some kind of the particular I2C peripheral you are using. I don't see which one it is above (though I may have missed it).

tulip sleet
#

i don't see your schematic

manic glacierBOT
#

On the Teensy 4.1 Version 6 circuitpython, the wrong SD card interface is built in:

https://circuitpython.org/board/teensy41/

The builtin interface is for SDcardio. However, the SDcard is actually handled by SDIOIO interface, not SPI for the onboard SDcard slot. i'd suspect given the teensy 4.0's pinout it'd work the same if the pins referenced there are tied to the same ones on the chip.

defined in the port pin map of github/circuitpython for verification of sdioio:

https://githu...

analog bridge
tulip sleet
#

tnx, i will look at the ref. same power supply arrangemetns?

analog bridge
#

yes...

#

using a different ldo

#

but that shouldn't make any difference

tulip sleet
#

ok, i'll take a look! not sure I'm going to find anything. I wonder if the larger ram or flash are making a difference (rearrangement in linker map, etc.), but that would be some other underlying bug

#

actually maybe first thing to do is to try the SAOLA's and see what they do

analog bridge
#

can you try some different pins that aren't broken out... just touch the module itself

tulip sleet
#

right, the pin traces on your board are very short, like the module

analog bridge
#

yes that is what I am thinking

tulip sleet
#

the only pins not broken out for some purpose are IO45 or IO46, depending on the board. are those usable for touch? They seem to be special-purpose

analog bridge
#

no they aren't touch pins

#

till IO14 are touch

tulip sleet
#

hmm, I will try up to IO14 on the FeatherS2: it has the shortest traces compared with the Metro or MagTag

#

no luck

analog bridge
#

even stranger thing here is that it worked for you before the touch_init commit which has nothing to do with how the touch sensors are read

tulip sleet
#

the code order was slightly different there: the pin was inited before the touch_pad initialization routines were called

#

ok, it's not the trace length, because in 6.1.0-beta.1, IO5 on the Metro ESP32-S2 works fine as touch:

>>> t = touchio.TouchIn(board.IO5)
>>> t.raw_value
12155
>>> t.raw_value
65535
#

untouched and touched above

analog bridge
#

can you do a test with touch_pad_config() called just after touch_pad_init() as it was before the commit

tulip sleet
#

Trying:

void peripherals_touch_init(const touch_pad_t touchpad) {
    ESP_LOGI("touch.c", "touch_inited: %d", touch_inited);
    if (!touch_inited) {
        touch_pad_init();
    }
    touch_pad_config(touchpad);
    if (!touch_inited) {
        touch_pad_set_fsm_mode(TOUCH_FSM_MODE_TIMER);
        touch_pad_fsm_start();
        touch_inited = true;
    }
}
#

the above would mess up on the second pin, maybe

#

Ha!

>>> import touchio,board
>>> ta = touchio.TouchIn(board.IO5)
>>> ta.raw_value
14382
>>> tb = touchio.TouchIn(board.IO6)
>>> tb.raw_value
11915
>>> ta.raw_value
14794
#

i am baffled about why it would be different FOR YOUR BOARD, though

analog bridge
tulip sleet
#

maybe it does a calibration really early, but does it differently in the other order, and your short trace lengths make a difference. You could adding a "trace" to one of your pins with a longer wire

#

also maybe nearby ground plane makes a diff

analog bridge
#

I get smaller raw_values in 3000 range

tulip sleet
#

that makes sense, without a trace

#

have you mounted any of your boards on a carrier board (with a ground plane)

#

or if no ground plane, at least that's a test

#

i just mean a ground plane past the outside pins. E.g. attach a 4cm wire to to one pin, see the readings with the code in the newest order, and then add a ground plane under the wire (like a coin, etc.)

#

i have no idea if the ground plane makes a diff, just thinking about parastic capacitances

#

ideally i would like you to be able to reproduce the issue

manic glacierBOT
analog bridge
#

yep, with a wire attached, I get 65535

#

@tulip sleet thanks for looking into this one strange bug... I think you can PR it since you already have the changes.

tulip sleet
#

i am going to look into the lower-level stuff to try to understand this in a little more detail. Thanks for the testing - it now all makes sense

#

i don't understand why the second pin should not be wrong, since it's set up after the other calls

onyx hinge
#

Good morning <@&356864093652516868> -- this is a friendly reminder that there is NOT a meeting today, as the US is observing Martin Luther King Jr. day. The meeting will be tomorrow, 24 hours after the usual time. We hope you'll join us!

manic glacierBOT
manic glacierBOT
turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Region

us-west

Channel Categories

8

Text Channels

56

Voice Channels

6

Members

26703

Roles

34

ornate breach
#

😮

#

almost 27K

turbid radish
#

Yup! We'll need new graphics for that milestone

manic glacierBOT
#

Rework order of touch peripheral initialization code. 048ca2a5 changed it around slightly. This apparently made the calibration be wrong on pins with any length of trace or wire connected to them, causing the TouchIn.raw_value to be its max 65535, all the time.. Thanks to @microdev for help in debugging: the microS2 did not show this problem, which was a clue, because it's a very small board with short traces. When @microdev connected a wire to one pin, the problem did appear on that pin.
...

thorny jay
tulip sleet
#

@thorny jay I forgot that! I will try again on the MagTag with beta.1, and see what is different with my fix

manic glacierBOT
tulip sleet
#

@thorny jay I just tried 6.1.0-beta.1 on the MagTag again. That is the original version of TouchIn(). On D10, the only pin that would work, even with nothing plugged in, I get 65535 for the raw_value.

There is a zener (and resistor) connected to the pin. That would add a lot of capacitance, I think.

So I am not sure why you saw touchio working on the magtag. The buttons work, for sure.

Adafruit CircuitPython 6.1.0-beta.1 on 2020-11-20; MagTag with ESP32S2
>>> import board,touchio
>>> t = touchio.TouchIn(board.D10)
>>> t.raw_value
65535
manic glacierBOT
tulip sleet
#

@thorny jay if you could test with beta.1 on your board, that would be great. I tried it with nothing plugged in and with a JST three-jumper assemblyu plug about 6" long

thorny jay
tulip sleet
#

ah, ok! I would not have expected you to try that. We were just talking about this with Limor and she hadn't planned anyone to use touch on the board. If you can hack it with the buttons, sure!

#
>>> t = touchio.TouchIn(board.BUTTON_B)
>>> t.raw_value
12698
thorny jay
#

I wanted to do wake on touch with button because wake on pin was not working for me. Wake on Pin was not working because I was not using the right syntax.

tulip sleet
#

in the sleep guide I am using an example on the Metro ESP32-S2 instead of the MagTag for touch sleep

thorny jay
#

The MagTag is a "PreCog" and know you want to press the button...

thorny jay
# tulip sleet ah, ok! I would not have expected you to try that. We were just talking about th...

If a new version of a MagTag (or anything similar that could be plug on the Fridge) I would suggest to Limor to include a sensing mechanisme to know if this is attach to the fridge. That could be by having one of the feet to be a pin and assume that magnetic feet conductivity and assume the touchio will detect the difference (it will also detect when you touch the feet). Or maybe there is condictivity from one feet to the other across the metal of the fridge (but not all fridge are equal). I have the attached that I need to test on my fridge:

manic glacierBOT
idle owl
gilded cradle
idle owl
#

Ah ok, excellent. I'll approve it then.

gilded cradle
#

thanks

manic glacierBOT
idle owl
#

Pylint is complaining about my use of global. Google searching seems to indicate the solution is to write a class with init and so on, and objects in it to avoid using the global keyword. That seems..... like way too much for beginner code. Should I try to do the acrobatics needed to not use global or simply pylint: disable= ?

#

Also, the "things" available in a module, e.g. randint in random, are called functions? Or is there another word for that.

onyx hinge
#

random.randint is a function

idle owl
#

Excellent, thank you

onyx hinge
#

personally I favor judicious use of "global" in simple examples. It's not appropriate for "big programs", but that's a subjective judgement.

idle owl
#

Is random.randint(5, 10) considered an "object"?

onyx hinge
#

OTOH we do have that pylint diagnostic enabled in Learn, and most of those are intended to be simple beginner-appropriate programs

idle owl
#

Right

onyx hinge
#

The part of the program that says random.randint(5, 10) is a call to a function. The result of calling the function would just be a number or an int

idle owl
#

hmm ok

onyx hinge
#

(a "function call" I think people say more than "a call to a function")

idle owl
#

That's how I worded it.

#

Ok, I'll disable Pylint in this case.

#

Thank you for all of that!

onyx hinge
#

it's only opinions

idle owl
#

Still useful.

thorny jay
stuck elbow
#

@thorny jay ah, sorry, I didn't see it, I get so much spam from github because of circuitpython libraries, that I often miss things :(

idle owl
#

@stuck elbow Do you use Gmail or some variation thereof?

stuck elbow
#

@idle owl no, I use mutt

thorny jay
#

I cannot confirm nor deny that this patch was working... and I am totally not offended that you did not react. 🙂

#

It is fire and forget. I guess I tested the game found a bug, fixed, had fun with the game, forgot. It is fire and forget.

idle owl
#

@stuck elbow I mean is your email address a Gmail address, or a Gsuite address. I ask because filtering GitHub is a HUGE pain, but I managed to do it pretty thoroughly, and I can share my filters with you, but you have to import them into Gmail on the web. Then they propagate to whatever client you use, or at least they did for me, but I'm using Apple Mail.

stuck elbow
#

@idle owl no, I have my own domain

idle owl
#

Ah ok. Figured if I could help, I would. The filters are ridiculous because of everything coming from the same address and so on. Took a lot of work, so I offer them up to anyone who could benefit from them.

stuck elbow
#

I do filter all github mails to a separate mail folder, but that doesn't help with missing pull requests

manic glacierBOT
stuck elbow
#

thanks

idle owl
#

No, it doesn't.

#

You're welcome.

stuck elbow
#

hmm, I can actually use different addresses, I wonder if I can set which one to use for which org

idle owl
#

Ooh. That might be handy.

manic glacierBOT
#

Now that I'm using a Debug Build of CP 6.1.0 RC I'm collecting a lot of data. My program is collecting temp and humidity data on a once per minute basis, and deep sleeps the reset of the time. I found that I get as many as 36 exits from deep sleep with the DSLEEP status, but too many are POWERON status. I first noticed this when my alarm.memory counter was getting reset to zero.

I have 2 logs: one is the Debug UART and the other is the normal UART on pins 5/6. My program log shows the code...

tulip sleet
#

@idle owl are you (or y'all, whoever) going to do a massive release party for the libraries due to all the Actions changes, or just wait until actual code needs to get changed to make a new release? I ask because I made a docs change in a library and could do a release to update the docs

idle owl
#

@tulip sleet That's on Dylan's plate to do. We have to do it for any of the library infrastructure checks to be valid, otherwise it shows literally all the libraries as having updates, so we'd miss ones that had critical updates. Release party is planned, yes. If the Actions updates have been merged on the lib you updated, please do a release on it. That would be greatly appreciated.

tulip sleet
#

wilil do!

#

0.5% of the work is done

idle owl
#

It's a start!

manic glacierBOT
carmine girder
#

hi @gilded cradle ! About https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT/pull/56 , I am curious to know if there is a way to "version" a repo like Adafruit_CircuitPython_MiniMQTT, so things like the examples line up with API changes of other repos like Adafruit_CircuitPython_PyPortal/releases/tag/5.0.0. Any thoughts on that?

gilded cradle
#

Hi @carmine girder, I just usually put something in the release notes about which libraries to be sure are updated.

carmine girder
gilded cradle
#

Right, the releases section

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Sample test code:

import sys
import os
import time
import ipaddress
import wifi
import socketpool
import ssl

import adafruit_requests

from secrets import secrets


ITERATIONS = 5
DELAY = 0


print("""-"""*49)
print(os.uname().machine)
print(os.uname().version)

# Nice scenario: connect only when enabled
print("""-"""*49)
for _ in range(ITERATIONS):
    wifi.radio.enabled = True
    print("Enabled?  ", wifi.radio.enabled)
    print("Connect...", wifi.radio.con...
mental nexus
#

I'm trying to build CircuitPython on MacOS Big Sur and am running into trouble. This may be the same thing that @fiery silo and @marble hornet have fought, but not sure how to resolve it.

margaret@iMac atmel-samd % make V=1 BOARD=circuitplayground_express
GEN build-circuitplayground_express/genhdr/mpversion.h
Creating build-circuitplayground_express/frozen_mpy.c
CC build-circuitplayground_express/frozen_mpy.c
CC ../../supervisor/shared/workflow.c
../../supervisor/shared/workflow.c: In function 'supervisor_workflow_connecting':
../../supervisor/shared/workflow.c:39:12: error: implicit declaration of function 'tud_connected'; did you mean 'tud_connect'? [-Werror=implicit-function-declaration]
   39 |     return tud_connected() && !tud_suspended();
      |            ^~~~~~~~~~~~~
      |            tud_connect
../../supervisor/shared/workflow.c:39:12: error: nested extern declaration of 'tud_connected' [-Werror=nested-externs]
cc1: all warnings being treated as errors
make: *** [build-circuitplayground_express/supervisor/shared/workflow.o] Error 1
#

I get the same error when trying to build on the ATMEL-SAMD or the ESP32-S2. I am on the 6.1.x version of CP.

#

Here's my info on gcc:

margaret@iMac atmel-samd % brew info gcc                          
gcc: stable 10.2.0 (bottled), HEAD
GNU compiler collection
https://gcc.gnu.org/
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/gcc.rb
License: GPL-3.0-or-later with GCC-exception-3.1
==> Dependencies
Required: gmp ✘, isl ✘, libmpc ✘, mpfr ✘
==> Options
--HEAD
    Install HEAD version
==> Analytics
install: 129,947 (30 days), 297,882 (90 days), 1,220,682 (365 days)
install-on-request: 62,789 (30 days), 140,465 (90 days), 576,080 (365 days)
build-error: 0 (30 days)
#

And here is my arm version:

margaret@iMac atmel-samd % arm-none-eabi-gcc --version
arm-none-eabi-gcc (GNU Arm Embedded Toolchain 10-2020-q4-major) 10.2.1 20201103 (release)
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
mental nexus
dry axle
#

Hello, has anyone successfully done quaternion multiplication in CircuitPython? If so, how?

I ask because I’m looking to translate orientation data from a BNO085 to gimbal Euler angles for a robot arm.

manic glacierBOT
#

How can I boot the device such that the filesystem is available for writing from CircuitPython?
E.g. to log sensor readings.

Setup: device is connected by usb (and repl, for commands only). Macos.

boot.py:

storage.remount("/", False)

From repl:

with open('x.txt', 'w') as f:
    f.write(b'abcdefg')

Error:

Traceback (most recent call last):
  File "", line 1, in 
OSError: [Errno 30] Read-only filesystem

Notes:

  • This used to w...
manic glacierBOT
marble hornet
#

@mental nexus did that solve your issue?

#

And if not try gcc9 q4

mental nexus
#

I haven’t figure out how to downgrade my compiler. I thought the latest tool chain was the right one for building CircuitPython 6.1. And I thought I saw in your conversation from last week that someone was using the same gcc version as I’m running. Did I miss some important detail from that conversation?

#

I think it was @glossy pecan that said he got it to compile.

tulip sleet
#

@mental nexus did you update the submodules? The gcc version should be fine.

#

it looks like you don't have the latest tinyusb, for example

#

git submodule sync --quiet --recursive && git submodule update --init

#

i have that as an alias

mental nexus
#

Thanks Dan, that did the trick. Looking back at the the instructions I see that I overlooked this step. Thanks for the quick help! Sorry for not following the instructions close enough.

manic glacierBOT
hearty tapir
manic glacierBOT
manic glacierBOT
#

I'm a little confused. When you say

[There is also a version of the board available with the external flash already present]

do you mean you can buy such a version, or we already have a board definition? If you can buy the version, should we use that designation? It sounds identical to the haxpress version, except maybe for choice of flash chip.

manic glacierBOT
#

@dhalbert I knew about the pads when adding the board, but I didn't realize they had a version that actually shipped with it - I assumed the user would be adding their own custom flash board, so I left the flash pin definitions commented out so they could easily compile a custom build for whatever flash they were using.

My first thought is to handle this with a build flag, but that won't make it available in the build artifacts or on the website. It's the exact same product, but with a si...

simple pulsar
manic glacierBOT
#

We can provide another USB PID no problem, since we provided the original, just like Py QT with/without flash. I was more concerned with what we would call, since the commercial version is not a "haxpress". And also, what flash chip is provided on the commercial version, so we can add it to the list of possible chips for a version with flash.

carmine girder
# simple pulsar Hello ESP32-S2 crowd. I'd be interesting if any of you have feedback on that new...

hi @simple pulsar I'm not sure if this helps, but @slender iron did an awesome talk on Nordic Power Profiler II on his Dec/17/20 Deep Dive: https://youtu.be/aOWp1GwT7Fs?t=3249

I’m sponsored by Adafruit to work on CircuitPython. Support them, and by extension me, by purchasing hardware from https://adafruit.com

Chat with me and lot of others on the Adafruit Discord at https://adafru.it/discord.
Deep Dive happens every week. Normally Fridays at 2pm Pacific but occasionally shifted to Thursday at 2pm. Typically goes for...

▶ Play video
manic glacierBOT
#

@jepler The pins are already defined. You'll find that in the board link I posted above for the pin definitions, already in the port for it. You have the framework already done.

Sadly, the build instructions for python and adding a new board don't tell me how to include the sdioio library in the build process to have it compile with it, and since the library is in the shared-bindings list and only in cpython, there's no instructions for just building that library to test. If you'd be so ki...

#

An implementation of the feature is needed down in ports/mimxrt10xx/common-hal/sdioio. It would be similar in scope to this PR which added support for stm32f405: https://github.com/adafruit/circuitpython/pull/3191 with the bulk of the code being https://github.com/adafruit/circuitpython/blob/main/ports/stm/common-hal/sdioio/SDCard.c

The underlying APIs and/or hardware registers for mimxrt10xx are different than those for stm32, so while that code is a good reference for what functions nee...

idle owl
#

@gilded cradle Hey! Any chance you can take notes for today's meeting? I might have a conflict pop up in the middle of it.

gilded cradle
#

Sure @idle owl. Thanks for reminding me. I almost forgot about the meeting.

idle owl
#

@gilded cradle So did Jeff and he's running it 😄 Thank you so much!

gilded cradle
#

yw

onyx hinge
#

<@&356864093652516868> We're looking forward to seeing you in the weekly meeting which is moved to TODAY about 75 minutes from now. If you have notes for me to read, please add them to the shared document at https://docs.google.com/document/d/1ot6JhwSdWspo-Do-nZko8hasQn_gIGYaRAQNkfpLQdo/edit?usp=sharing. If you plan to speak, please add your name as a placeholder (and ask to be added to <@&356864093652516868> if you haven't been already) OR let me or @gilded cradle know and we can add you to the document. Otherwise, if you're not in the document I'll assume you're just listening in. See you in the CircuitPython voice channel a bit before 2PM ET for mic checks -- remember to check that your mic is muted after joining, and keep it muted except when you're actively speaking.

manic glacierBOT
#

I am able to reproduce the issue with tip of main by copying all sample files here https://github.com/theacodes/Winterbloom-Big-Honking-Button/tree/master/samples . Bus analyzer show that firmware didn't response to the SCSI status phase, either the stack failed to manage the state and/or could be another buffer overflow, or maybe the tud_task() isn't called e.g cpy doesn't think it needs to call the usb task. Eventually the host have to issue a bus reset -> re-enumerate -> host tries again w...

analog bridge
#

I am trying to figure out how a MESH module would with be implemented...
since there are several different ways to setup a mesh network ble-mesh, wifi-mesh, zigbee-mesh...
all of these have similar functionality but defer when it comes to setup parameters... any ideas?

idle owl
#

I wrote code, but I'm struggling to explain it. And also, wondering why another iteration of it works. Actually, as I'm typing this out, I think it's starting to gel. I think it's a form of debounce in essence.

onyx hinge
#

@idle owl I'll be prepared to do the state of the libraries if you are otherwise occupied. The main thing is, the 226 pull requests were mostly .. what exactly? CI improvements?

#

I don't know your spiel about contributing, though, so that part will be lackluster 🙂

idle owl
#

@onyx hinge Appreciate it. We updated Black to the latest, and updated the licensing format. The Black update was the most important part of that. Folks should update their local Black if they were running an earlier version.

#
import board
import digitalio

pir = digitalio.DigitalInOut(board.D10)
pir.direction = digitalio.Direction.INPUT

initial_value = pir.value
while True:
    pir_value = pir.value
    if pir_value:
        if not initial_value:
            print('Motion detected!')
    initial_value = pir_value
``` The bit I'm struggling to explain is the need for `initial_value` and checking the comparison. Why is it needed? But am I right in thinking it's basically debounce? To keep the serial console from spamming the message for the entire time the signal line is triggered?
onyx hinge
#

I would say that it helps you react only to the "rising edge" of the signal from the PIR sensor.

idle owl
#

That fits with some other things.

#

That's much better than I would have come up with.

onyx hinge
#

when the value goes from False to True or True to False is an 'edge', which makes sense when you draw the signal over time as a graph like _____|‾‾‾‾‾‾‾|______

idle owl
#

Right

onyx hinge
#

if you printed just when pir_value, then you would print the whole time the signal is high, but this way it prints just once

idle owl
#

Indeed it does that

#

I tried

onyx hinge
#

debounce is different than this, so I wouldn't use that term here

idle owl
#

I don't think I would have used it, but I was trying to grasp it. I think I use "debounce" to mean keep things from spamming responses. Which probably isn't right.

onyx hinge
#

debounce helps get just one "action" when the value changes rapidly, like ____|‾|_|‾‾‾‾‾‾‾‾|_____

idle owl
#

Ahhhhhh

onyx hinge
#

the small period of being False gets filtered out when you "debounce". "Bounce" happens especially in mechanical switches.

idle owl
#

Ah ok

#

Thanks @onyx hinge!

onyx hinge
#

happy to help! I hope someone else would interject if I was not using the terms accurately

#

Feel free to join the voice channel for mic checks, I'm hanging out and finishing up the notes doc

manic glacierBOT
simple pulsar
#

Some guides cover debounce: https://learn.adafruit.com/make-it-switch/debouncing and https://learn.adafruit.com/debouncer-library-python-circuitpython-buttons-sensors - it's becoming more relevant as boards get faster and code which seemed ok on CP on SAMD21 now misbehaves a bit when users press buttons

Adafruit Learning System

When your microcontroller needs to accurately read if a switch is flipped

Adafruit Learning System

Debounce All the Things!

analog bridge
modern wing
#

Good afternoon -- happily lurking, notes doc updated.