#circuitpython-dev
1 messages · Page 348 of 1
are you testing a board with 16 or 64?
16
(the first config there is for some random chip that I put in there for debugging, not the 64)
are you shipping boards with 64?
yup
does that make possible_devices[] not match at all?
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)
i thought it would complain, it SHOULD
supervisor_flash_init() should return a boolean or go into safe mode or something
I may be remembering a different thing, https://github.com/adafruit/circuitpython/issues/2338
it'd be easy to test, just load an unmodified qtpy with the haxpress version
yeah i think it behaved correctly in that case
okay it's setting the right flash device
so it's still messing up on the 16/64 case, right?
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
I could try this on some other random board with a 64 to the list and see what happens.
doesn't seem to matter if it's the 64 or the 16
if there's more than one possible device it acts weird
we have lots of these builds, though, like pyportal
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
but when you try to copy it spins?
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??
it is big honking button, right? It is using SPI_FLASH_FILESYSTEM, unlike our two-device boards with QSPI
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.
hallowing m0 express is similar
Oh hrm
there are definitely boards that have SPI_FLASH_FILESYSTEM and two possible flash devices
it's just a switch between SPI/QSPI
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?
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.
i'm just going to try GD25Q64C and 16C on a metro m0
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
and messes up on both windows and Mac?
yup
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
are you using the finder or the command line?
Like I was able to one by one copy a few files around ~10k then it barfs
both
hrm hrm hrm
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
okay
I think it's the autoreloader
interrupt the code and sit in the repl and copy files
still will autoreload if you aren't at the repl prompt, right?
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.
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
@tulip sleet I just have the hello world script. When copying it saw it execute over and over
It copied the first time fine, then I erased the filesystem and it reset, and then I copied again and it hung.
Since supervisor probes for each device, the number of devices could cause just enough delay when reloading to make matters worse.
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
cool, I have a similar set
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?
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
you could make a custom build; i'm just thinking about how you are getting stuck
it's obviously a significant issue, and it's reproducible, but not always. I can open an issue with a Metro M0 example.
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
that is a great clue
It might be possible that we changed something and made autoreload's delay lower unintentionally
yes, there are so many timing-related changes in 6.
I investigated disabling modules on these boards but this is fine too.
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 ...
The usual display problems on github, CI problems are unrelated.
Closing in favor of #3985 for now.
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...
you're welcome; i'm sorry about this
oh friendo you've got nothing to apologize for
CircuitPython has my code in it too, it's equally my fault.
we all work together to make it better, thanks
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...
Related:
import microcontroller
microcontroller.on_next_reset(microcontroller.RunMode.NORMAL)
microcontroller.reset()
resets into safe mode instead of normal mode 😦 why?
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...
Could you file an issue, stating which board and which version of CircuitPython? Thanks!
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/...
This is a know issue #3884
https://github.com/adafruit/circuitpython/issues/3884
@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
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 ...
@tulip sleet created the issue
ya... the reason for both of them to not work properly is the same... I'll update your issue (#3988) with more info...
When I get time this weekend I’m going to be testing out some changes to the init for the library.
The touch sensor has a restart time default of 125ms so I’m going to change the sleep time to 125ms and see if this goes away.
I’ll also try your solution @dheera
And on the flipside, we all work together to break it too 😉
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...
I was also seeing Errno 5 in the course of testing AnalogOut for https://github.com/adafruit/circuitpython/pull/3966. It was a second error that occurred while trying to reference the AnalogOut, after it had been smashed by an incorrect memory write. So this may be an I2C object smash.
@dheera Using profanity in our github issues isn't appropriate. Please edit your comment, and check out our Code of Conduct if you need to know more.
@kevinjwalters thanks for posting that! I've included it in my ticket to Espressif.
Thanks! Failed jobs are overflowed firmware fixed by #3983,
The usual display problems on github, CI problems are unrelated.
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
that's good 🙂
oh. hmph.
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
Thanks! The suggestion should fix the build.
//| :param ~int type: SOCK_STREAM, SOCK_DGRAM or SOCK_RAW"""
@dhalbert any way of knowing for certain of that’s what’s happening here? I’ll build a new uf2 off the current beta with debugging if need be. I still need to test with the bleeding edge to see if has the same issues.
@skerr92 Sure, test the latest, but the fix I had wouldn't fix this. I was just noting I got a similar error due to smashed *ioobjects.
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.
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.
@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
@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.
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
well "open" is more like calling the Finder
i vaguely remember some Mu issue(s) relating to multiple boards
I use BBEdit, and opening with bbedit /Volumes/CIRCUITBLUE/code.py works as expected
I haven't used Mu in ages until the last few days or so, and it happens to me regularly.
but Sublime Text does the same if I switch the default or use open -a
and so does TextEdit with the boot_out.txt
I use PyCharm, and haven't tried opening directly into PyCharm from command line. But anything through Finder seems dubious at best.
I don't remember seeing that before... I don't know super recently
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.
I'm free after 11am pacific
@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.
same
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?
The REPL is not available over UART pins.
CircuitPython creates a serial port along with CIRCUITPY drive. Try looking for this serial port...
@kevinjwalters Could you open a new issue for this discussion? Thanks.
@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.
hmmm I don't think I have problems with flushing
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)
...
There are two different issues here :-
microcontroller.on_next_reset():- OnlyRunMode.SAFE_MODEis currently implemented.- The watchdog reset gets caught here :-
https://github.com/adafruit/circuitpython/blob/main/ports/esp32s2/supervisor/port.c#L141-L151
There are two different issues here :-
microcontroller.on_next_reset():- OnlyRunMode.SAFE_MODEis currently implemented.- The watchdog reset gets caught here :-
https://github.com/adafruit/circuitpython/blob/92a439899624145f3597dcaaabb84880c30e5185/ports/esp32s2/supervisor/port.c#L142-L151
sorry about that, don't know how I missed that, and then forgot to come back and check the build (local didn't care)
maybe BBEdit does flush, haven't tried using it directly for a long time, it had other problems like you identified too, so I just moved on for direct editing on CIRCUITPY. It's still my go-to for offline editing.
there are basically no flushing problems on Mac; MacOS flushes immediately, if that's what you're using
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)
@dglaude I tried your code but still can't replicate the issue.
I made a few tweaks in TouchAlarm recently. Can you do a test with current main.
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
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...
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.
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.
Many thanks to @tannewt and @FoamyGuy to make it happen!
Either 0 or 100% duty cycle would work temporarily. deinit will also stop it
It would be nice if we could add an original ESP32 to this graph for comparison
@slender iron Hi Scott, you work on a macintosh, don't you?
I have in the past but I've moved to linux
You might still know how to shut up the compiler here: https://github.com/v923z/micropython-ulab/issues/284
I have seen in the past that the compiler on the mac is a bit particular about such things.
@slender iron deinit makes it not work later when I need it.
right
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.
I think duty cycle is the best way to go
@lapis hemlock the fixes in the issue seem right to me
@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.
@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?
@lapis hemlock isn't the issue that the unix port is using double instead of float
@idle owl yup!
@slender iron I think so. But the unix port uses doubles on linux, too, so I don't see, why the mac is special.
it could be the compiler version
@slender iron I have another non-work mtg in 6 mins, will contact you later
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.
@lapis hemlock It appears it is a clang-specific diagnostic. macs use clang by default, linux uses gcc. https://godbolt.org/z/8153vY
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.
@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
@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.
Good to know! Thanks.
This might be problematic, if you try to compile for a port that supports floats only. I believe, the ESP8266, and the pyboard are such.
What bugs me is the fact that MICROPY_FLOAT_CONST(...) does not shut up the compiler
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
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.
Sadly I don't have an ESP32 but code is easy to run and is over at https://github.com/kevinjwalters/circuitpython-examples/tree/master/adc/adc-comparison. There's a collection program in there too which does the time stamping. I ran that on a desktop but shut down all other applications to minimise load to try and keep the timestamping accurate.
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?
correct. ya polling is the best word
Ok thanks
aka "repeatedly reading a value until it changes"
Excellent, thank you
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 ...
Did we ever fix the logging data directly to the flash issue? Nevermind, apparently we did.
@jlopez Could you try this test UF2, which I hope will fix your issue? It's for a Feather nRF52840. If you need it for another board, just ask. You will need to unzip it, because GitHub won't allow uploads of .uf2's directly.
I heard back from them, and this is all they said:
Hello, sorry we don’t have USB ID and device ID yet
Considering that this board itself isn't open-source, I'd prefer not to ask for a PID from https://pid.codes or adafruit.
I'll close this issue for now. If the ever inform me of a valid PID for this board, I'll rebase this branch, and open a new pull-request.
Cheers
ok please keep asking them, they are required to have one
@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...
I’d leave it so folks can change the pitch
Thanks
This is the same as I added to mpy-cross at e666e86035d5, see #3074
I made this pull into 6.0.x because I ran into it while working on mircopython-ulab's ci process which currently uses the 6.0.x branch. We'll want this fix in 6.1 which I think we can get by merging 6.0.x up into main.
Sure thing. I have an ItsyBitsy nRF52840, though. Once I get it I'll give it a shot. Thanks!
weeeeeeird, brew (the package installer) is available on github ubuntu ci runners
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.
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
That's a global variable, that you modify from a function? Yes it is a change of state, also not really recommended (but very useful) and require the use of global.
Yeah I use global, I was questioning the nomenclature of the word "state" to explain what it was doing.
Thanks!
@crimson ferry ya, that seems like what it's doing
@slender iron do you see an obvious solution, or should I file an issue?
but if the AP doesn't come back for a longer while, the code just goes into a weird socket exceptions state
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...
it takes practice @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.
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.
@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
@thorny jay +1 vote for A1 since I often look at the board's silk while wiring, not the schematic.
Note to self: be careful what screw head size you use. Crushed the lens off my poor D13 led. Rest In Peace.
we usually try to make the silk the "ground truth" for pin names, since that's what people have in hand
My eyes are not what they use to be... but I try to read the silk too.
Managed to get prototype code for latching relay working. Cannot wait for Ethernet wing tomorrow!!!
@hoary moat nice, congrats!
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
My preference is for us to reset monotonic every time the VM resets. That will mitigate a lot of the problems with it.
@tulip sleet want to chat now?
sure
Pull in corrections and additions to the TG-Watch board definition based on practical testing of software and hardware revisions.
This includes:
- increasing the pystack to 256 frames
- revised pin definitions
- Changing the name to TG-Watch (dropping the 02A/02B suffix)
drop the 02a/02b suffix.
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...
Partially addresses the logging aspect of https://github.com/adafruit/circuitpython/issues/3837.
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.```
@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
if you look here you see a similar but more comprehensive script
https://github.com/adafruit/circuitpython/blob/main/tests/run-tests-exp.sh
so in short maybe its not finding any .exp files... i see above they have them in folders for tests
https://github.com/adafruit/circuitpython/blob/main/tests/import/import_override.py.exp
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.
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?
@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!
K
@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 😦
@tulip sleet thanks, that is something we've had to do in the past..
the issue to clear the cache is 15 months old.
not sure why it's not on their high priority radar
@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.
@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.
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.
@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.
assuming we're talking about https://github.com/adafruit/circuitpython/runs/1700117418?check_suite_focus=true
Checking locale/circuitpython.pot
Missing message id. Please runmake 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)
@tannewt this would be implemented all the way through shared-bindings, correct? So we'd have a new Socket.c file under ssl recreating the functions that can use TLS?
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.
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...
had a weird reload thing with github
Thanks! This should probably wait until the next release of CP to be merged or it will appear as an unknown board.
Breaking this out from #3993 so other PR's will succeed.
Can you support the SparkFun RV-8803?
Product Page: https://www.sparkfun.com/products/16281
Thank you
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, ...
@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.
@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...
Does the CI failure have to do with my code?
subprocess.CalledProcessError: Command '['/opt/hostedtoolcache/Python/3.8.7/x64/bin/python', '-m', 'virtualenv', '/home/runner/work/circuitpython/circuitpython/.idf_tools/python_env/idf4.2_py3.8_env']' returned non-zero exit status 1.
My changes don't affect anything related to this, as far as I can tell?
Agreed -- this looks like a neat chip and it would be awesome to be able to add it to the Community bundle! Check out https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/overview to see how that process goes.
Is there a rule of thumb for raising exceptions in shared-bindings vs. common-hal?
Question: Would this be a library or must it be implemented in the ESP32-S2 port?
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...
If the common-hal might be called in a non-Python context because it's useful in other ways, then it should return an error code. But we do raise exceptions in common-hal. If you grep for uses in common-hal, a lot of it is port-specific argument validation. We have had bugs in the past where exceptions were raised in an interrupt routine or a critical section: those definitely don't work.
quickly updates copyright year on his blog
@askpatrickw it will need to be implemented on the port level, it doesn't make use of existing wifi calls, if that's what you mean. But we might want a library on top of it.
@tulip sleet what non-Python contexts would use common-hal? I thought it was only to abstract port-specific stuff from the shared APIs
some common-hal timing routines, and sometimes we call pin operations, etc.
ah, ok, thanks that helps
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...
This usually happens when something earlier fails
@onyx hinge or @slender iron this will fix recent broken builds: https://github.com/adafruit/circuitpython/pull/3997
something changed out from under the cached version
Thanks, it is what we need to do until it's possible to manually clear a cache...
A1 is on the silk and is in the Guides.
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.
@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.
would it break the unix build?
no, it would mostly just be disabling modules
that's fine with me
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 ..
would we have to turn off some tests? I am just thinking about merging from upstream later
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
axtls is mentioned explicitly in the Unix makefile, for instance
a pile of unneeded changes compared to upstream is a good reason for me not to touch it
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
thanks!
Do you want to do the merge to main after this?
@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?
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
looks like main got "BLE fixes" and "Round BLE timing values; fix timeout check" while 6.0.x only got "BLE fixes"
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
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
because they are not the same commits there's all this noise in the diff?? it's confusing
git gonna conflict
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.
@fossil gorge congratulations on being the one to file Issue #4000 on circuitpython! It's a milestone.
i don't think circuitpython.pot needs a merge at all; could you just cherry pick the unix/Makefile one?
"4000th issue filed" doesn't feel like something to celebrate, but since it's PRs + Issues I'm still kinda happy about it
Then here is another one for you: https://github.com/v923z/micropython-ulab/releases/tag/1.7.0
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
@onyx hinge quashed a bug, added a function.
np, I think it's now equivalent
oh you merged my pr, thanks @lapis hemlock
@onyx hinge I basically backported a fix.
Errr, thanks? I think? Had I known, I would've made 4000 "Mark milestone of 4000th issue filed" and been meta, and report the year in 4001. Oh well, maybe for 5000, or 0x4000?
i'm not sure whether the list of commits is confusing or not it seems weird
Oh, sorry, I forgot to acknowledge that. Thanks a lot!
Yeah, maybe just a cherry pick, it will be less confusing for the future
This is the same as I added to mpy-cross at e666e86035d5, see #3074
This version is cherry-picked from 6.0.x for main, as an alternative to merging 6.0.x into main. That alternative is at #4003, and at most one should be taken.
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.
sometimes I click on a commit that isn't there
so we'll close #4003 and I'll kill those jobs?
sure, if you prefer the cherry pick
yes, I think so, the merges are confusing, and I know they were all better on the main side except for the unix fix
https://github.com/v923z/micropython-ulab/releases/tag/1.7.0 "adds frombuffer and fixes diff code"
@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).
is #3940 in?
yes, a week ago, np
#4005 is the only user-facing one out of those three, the others can wait
4001 also
oh sorry, yes
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
we'll appoint him our git philosopher then
he'll need to grow a beard and move to the top of Mt. Rainier though
or we could switch to clearcase 🙂
I've never had the pleasure. Couldn't be worse than RCS + a pile of elisp
in clearcase you can pull arbitrary things from different trees. I worked for a place that did that. It was a nightmare.
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.
We should call our internal close when the internal APIs indicate that the socket has been closed (by the other end or the lower layers.)
Yes. It should be SSLSocket to match CPython: https://docs.python.org/3/library/ssl.html?highlight=ssl#ssl.SSLSocket
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.
You have all my support, as long as A1 is available as A1. 🙂
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
@onyx hinge ulab stubs generation is failing in build
so we won't bother with this now
@tulip sleet that's fine, I'll look into it soon
@tulip sleet still on for joining the stream tomorrow? I'm going to post my regular blog post about it
yup, sounds good!
great!
I don't think so. Dan and Jeff would have a better idea of the CI state atm.
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?
We shouldn't do any of them that allocate memory. (I think recv does.) It's a better practice to hand memory in.
@BiatuAutMiahn Make sure and let SparkFun know you'd like a CircuitPython library for it too.
@hugodahl Want to make a PR to update it?
Looks like a stub needs type annotations.
This looks good to me! We can wait a little to merge though since I think we'll be doing a 6.1.0 RC from main shortly. @dhalbert please merge after 6.1.x is branched again. Thanks!
Oh ya, you'll need to update translations to fix the build.
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")
ya, you need to run make translate in the top level directory
it'll add the new strings to locale/circuitpython.pot
locally? then commit that additional file?
@crimson ferry yup!
got it, thanks!
This looks good to me! We can wait a little to merge though since I think we'll be doing a 6.1.0 RC from main shortly. @dhalbert please merge after 6.1.x is branched again. Thanks!
This pull-request resolves issue #4000. It will also set the copyright's "to" date to the current year when the documentation is generated.
Configuring the SPI baudrate seems to fail entirely.
Case in point,
spi = board.SPI()
spi.try_lock()
spi.configure(baudrate=-1)
spi.unlock()
This doesn't throw an error. In fact, my ST7789 display's code keeps working as if I never ran the .configure function. I suspect the reason the monitor is refreshing so slowly is because we can't configure the SPI baudrate....
Is this something that might be worth doing as part of the pre-commit hook? Make it easier to catch before it trips up the CI system.
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
we actually just tried that in a PR, but had trouble getting it working, and reverted it
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
i don't know of anyone who's done that, but it's a good idea.
sheepishly raises hand
One sec, I'll pull up the reference
(I was always wondering why it was called "pre-commit"!)
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
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?
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
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
Shhh, that's my day-job technique!
OK!
Success?
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
we should add this to the appropriate guide
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
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
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)
Correct @blissful pollen. And it will use the .pre-commit-config.yaml file that's currently in the CP repo
could be added to this guide: https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github
Also, it's called "pre-commit", but their docs mention that other git hooks are supported, like "commit", "post-commit", "push", etc.
i was not really aware of these hooks; I thought it was strictly a github actions job thing
awesome, installed just gotta have something to commit now
ok, thank you so much, we'll bring it up with the team!
touch foo && git commit -am "Test?"
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
True I'm a novice at git and then have to figure out how to roll a commit back
the one part I'm not certain about is using it or configuring it in virtual environments.
Thanks, should have thought of that
@fossil gorge Worked great for me, that's really awesome
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 🤷
@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 ^^
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
@tulip sleet yup! Sorry! One of those things you setup once and forget about doing it
np, i'm happy
getting our library writers onto this would be a big help, given the extra commits for black, etc.
agreed
Automated website update for release 6.1.0-rc.1 by Blinka.
New boards:
- neopixel_trinkey_m0
- adafruit_feather_esp32s2_tftback_nopsram
- adafruit_feather_esp32s2_nopsram
- TG-Watch
New languages:
- ko
- ja
- pl
- en_x_pirate
- zh_Latn_pinyin
- cs
- pt_BR
- de_DE
- ID
- nl
- el
- sv
- fr
- hi
- it_IT
- en_US
- fil
- es
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
(https://github.com/adafruit/adabot )?
feel free to add this to closed pr, we can follow up on this, thanks!
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!
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
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.
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...
@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?
@tannewt, Done. I sent them an email
@tulip sleet thank you for the release!
yw, lotta waiting around 🙂
This can be updated after https://github.com/v923z/micropython-ulab/pull/288 is merged.
We have a guide for this wing, entirely in CircuitPython, here https://learn.adafruit.com/ethernet-for-circuitpython
Do you mean linking to this within the ethernet featherwing product guide? https://learn.adafruit.com/adafruit-wiz5500-wiznet-ethernet-featherwing/
@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.)
Tag and release 1.7.1?
Right.
sounds good to me!
(I don't think it's customary to remove a release, though there may be good reasons for it sometimes)
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.
OK!
So, here is the tag: https://github.com/v923z/micropython-ulab/releases/tag/1.7.1. If you run into a bug, you should probably work from https://github.com/v923z/micropython-ulab/tree/legacy.
excellent, thanks -- I'll upgrade that PR and hopefully that was the only speed bump. thanks as always for ulab and for quick responsiveness!
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...
@hierophect Useful clarification. but what a bummer! They'd cause less confusion with this if they corrected their #define enumerations too, ADC_ATTEN_DB_11 for -11db to 2.6V is 0.733V which doesn't make sense.
@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
@ionic elk I think it's a problem that would be fixed if you merged in or rebased onto adafruit's main branch
yes ^
actually just a job re-run might fix it, because it's doing a tentative merge
i will start a re-run
@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.
``` 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
@kevinjwalters I was mistaken in my earlier comment about the original ESP32. As Espressif indicated, the ESP32 can measure higher calibrated voltages than the ESP32-S2, but the maximum seems to be about 3.1V ± any smaller chip-to-chip variations.
Yes. I was referring to the product guide 🙂
@tannewt Makes sense. Do you think it would be worthwhile to actually throw not-implemented exceptions for them? Or a message that very briefly explains why Circuitpython avoids those calls compared to normal CPython?
@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
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.
@gilded cradle If you look at the code for the "MagTag Project Selector" in the learn guide (https://learn.adafruit.com/adafruit-magtag-project-selector/), it's how Dylan's running the selected project. Pretty slick stuff!
I am currently working with the Zigbee protocol on nrf52840 in Zephyr and was actually thinking about switching to CircuitPython however I have not seen any Zigbee related API. Is anyone working on this as we speak?
what version of black is pre-commit using?
@hierophect No, let's just omit them. Throwing errors for everything we omit would be too much. (We leave lots of os and time out already.)
@idle owl is it ok if i merge this? https://github.com/adafruit/Adafruit_CircuitPython_ATECC/pull/17
I don't know of anyone! Let us know how we can help you add it.
I don't know of anyone! Let us know how we can help you add it.
Where do we begin? :-) As I understand its an entire new protocol that has to be added to the framework the same way as wifi?
@onyx hinge did you ever ask weblate about the weird merge thing?
@slender iron yeah https://github.com/WeblateOrg/weblate/issues/5051 which was closed recently (today)
there was also the support ticket I opened with github in which they concluded it was normal, pasted into https://github.com/adafruit/circuitpython/pull/3792#issuecomment-753234685
ya, I know that
something's weird but nobody's offering a solution
and compare looks ok
besides rebase
weblate is doing weird things I think
usually before a PR you merge upstream into your feature branch
If you can explain it better than I did maybe you can give better info to the weblate folks
I'll reply. thanks for the link!
weird, if I "compare" the branches, I don't see the other commits that appear in #4008. https://github.com/adafruit/circuitpython/compare/main...weblate:weblate-circuitpython-main
right, so a PR must behave differently
I'm baffled because everything except the github pull request reflects sensible information
and only for weblate
thanks for following up
I was hitting this 100% when trying to connect to an octoprint server on my network. Turned out that replacing "octopi.local" with the IP address of the server fixed it completely! Hopefully this is at least a clue for the transient case @dcarmean is hitting.
@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.
that's reasonable, I only mention it because I've seen recv used so much in example tutorials for Socket online - but if we have our own tutorials for getting servers set up and such, it could be mentioned there as a footnote.
@anecdata The graphs here look like 3.1V for -11db on ESP32 but the 11bit sampling seems to get near 3.2V: https://esp32.com/viewtopic.php?f=19&t=2881&start=10#p13739
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.
Here is my current pull request - https://github.com/adafruit/Adafruit_CircuitPython_Nunchuk/pull/17
I heard there was some interest in a community STM32WB55 port. My WB55 Nucleo came in yesterday, so I'm available to help out.
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
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.
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.
That was one of the things I wanted feedback on. For example, on the classic controller one provides output from (0,64) and the other provides (0,32). My thought was that these libraries should provide the raw sensor data, but a separate interface library could created to do what you suggest.
The nunchuck joystick provides output from (0,256). Should all the joysticks be mapped to the same range?
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.
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-bindingsdirectory).
@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
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...
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.
I'll give that a try. And you included the mouse example correction in your own PR...
Closing this because the values are expected. We can work on lowering sleep currents, but the regression is fixed for now.
Did the Adafruit pIRKey ever make it into the store? https://learn.adafruit.com/adafruit-pirkey-python-programmable-infrared-usb-adapter
there were software problems with the IR-reading code in CIrcuitPython
Typing ctrl-C when a program is running in simulated deep-sleep does not interrupt the program. When the alarm goes off, any ctrl-C's that were typed do happen: they got buffered
I know the team is busy with a release, but when you get back to this bug, try out this simulated interrupt handler script for Rapid prototyping of several handler algorithms at once
@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.
@iron bloom There is this Arduino library, though it's quite old: https://github.com/adafruit/Arduino-IRremote and this Learn Guide: https://learn.adafruit.com/ir-sensor
@tulip sleet thanks I’ll take a look at that next. There is also this tutorial, that maybe I could work from. https://learn.adafruit.com/remote-control-tree-ornament-with-circuit-playground-express
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
Response received from Xinyuan-LilyGO, seems like a no-go

they need to be a USB organization, they are selling hardware with native USB. please continue to push them to get a vendor ID. other companies selling electronics with USB have one.
The whole situation is not ideal. Many companies do not have USB Vendor IDs with native usb products. Not being a lawyer or even pretending to be one I'm not commenting :)
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)
@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.
The fixes to remove busdevice weren't in my branch and to re-enable it I needed those PRs. Specifically the frozen library ones
please continue to push them to get a vendor ID, it is required and is a one time fee that other companies have paid. if enough customers tell them to do it, they will.
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.
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
Thanks, so it sounds like my best bet is to merge into my local branch from adafruit/main (which should put the missing changes in) and then edit those as I need and push.
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)
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
Will do, thanks for taking the time here.
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
Flirc learns any remote control, not caring about different vendor protocols. Just walk through our super simple setup pairing individual remote buttons with "Media Center Buttons" and you're done.
Resolves bug I reported here: https://github.com/adafruit/circuitpython/issues/3988
Prevents device from going into safe mode for watchdog resets. (Watchdog resets are normally used to re-run code and not drop into a REPL.)
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...
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 ...
Reverts adafruit/circuitpython#3930
Apparently causing unexpected issues with control of LDO2
ESP32-S2 TouchIn.raw_value is always returning 65535.
This broke between 6.1.0-beta.1 and 6.1.0-beta.2. I am seeing TouchIn working in beta.1
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.
@hearty tapir Do you see any issue if https://github.com/adafruit/circuitpython/blob/6a76b60027aa163756aace389a5c9203594759ce/ports/esp32s2/common-hal/wifi/Radio.c#L75 calls start_station() instead, in (future) case of AP+STA?
@tulip sleet Can you provide your test code. I am unable to reproduce this.
>>> 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
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
>>>
i don't see that on Metro ESP32-S2 or MagTag or FeatherS2
o dpm
i don't have your board, sorry
well... I am not providing shipping to US atm... also I am kinda out of stock on them.
trying a bisect between beta.1 and beta.2, but running into compilation issues
i am starting with a fresh clone now
can you also do a adc test...
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
this doesn't seem to be a board specific though...
TouchAlarm was working for David.G... although he had the following issue which I am unable to replicate as well
https://github.com/adafruit/circuitpython/issues/3926
I think he used MagTag
i was originally testing TouchAlarm and MagTag and couldn't get it to trigger, so I tried simple touchio, and was surprised
this is strange...
after some git bisect skips, I am getting something that builds, so I'll continue bisecting
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
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
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
yes, I tested before and after the RGB revert, just in case it was that
but it was not
whew!
since it had to do with power mgmt
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.
i had tried on D10
It is totally possible that I did not use the same release for FeatherS2 and MagTag test as it was different days.
i am getting close, 2 revisions left to test with bisect
@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.
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.
@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
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
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.
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...
this guards touch_pad_fsm_start() from being called twice as calling it de-initializes previously set touch configuration
maybe touch_inited gets smashed and the initialization never gets called? only a theory
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.
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?
 and the .raw_value call. The delay there just causes the constructor to return slower
maybe it needs few seconds to reset... it all adds up
i can call .raw_value many seconds later and it is still 65535.
I am confused
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
we went in the wrong direction with 10ms delay thing... that is for threshold setting and should not effect raw_value results
That is VSCode not finding the module, but it doesn't mean it's not working on the board. Did you pip3 install adafruit-circuitpython-requests in Windows?
This kind of support issue is better handled in https://adafru.it/discord or https://forums.adafruit.com. Thanks.
I just removed the init code... and got 65535
@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
the difference between boards is bugging me here
i know... did you try GPIO5?
yes... basically all of them
are you using wrover?
no module
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?
yes 16MB flash and 8MB PSRAM
I ran the test with uf2
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
sure... I will do the test with .bin when I get a chance... its fun bug fixing specially the strange ones 🙂
bye - thanks!
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...
loaded in today's build of Circuit Python for Feather S2 and with the same code running before ("""CircuitPython Essentials I2C Scan example"""). I'm now getting this error:
code.py output:
Traceback (most recent call last):
File "code.py", line 18, in <module>
RuntimeError: SDA or SCL needs a pull up
Code done running.
If you have no I2C breakouts (with pullups) connected, you will get that error. Do you have some I2C device connected?
good eyes! could you submit a PR with the fix? :)
Yes, the same board that led me to make the bug report - the sparkfun temp board.
@tannewt this is ready for re-review
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)
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
@rapid vine thanks, I should have been more specific... I'm looking at the C code in the core
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)
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.
@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.
@crimson ferry Oh, excellent. So esptool flashes your boards ok? No errors or permission issues? I'm hearing mixed messages about it.
I haven't encountered any esptool flashing issues. there is at least one other person here using Big Sur... maybe jerryn?
Fixes https://github.com/adafruit/circuitpython/issues/3735 by checking to see if the station is already connected before trying to connect. If it is already connected, returns immediately.
I still need to do a lot of regression and other testing.
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.
Adds RTS/CTS flow control if these pins are specified in the constructor of the UART.
Also adds an error if more than bytes than the rxbuffer can hold are requested in read (the current implementation times out in this case, leading to a perhaps confusing error message).
The merge fails because of changes to locale/circuitpython.pot by make translate. What's the proper way to deal with this?
Sure thing! It'll be my first!
Fixed a comment that had QSPI SCK and CS reversed, compared to the line of code below it.
Also added further clarity on the DotStar pins in the comment.
@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)
@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).
I just tried the Web Version https://learn.adafruit.com/adafruit-magtag/web-serial-esptool for the first time -- worked great on Big Sur (using Chrome).
The merge fails because of changes to
locale/circuitpython.potbymake translate. What's the proper way to deal with this?
You can merge from upstream (adafruit) and then run make translate and push a new commit.
How about a new MESH module for this... the top-level stuff can also be shared with Zigbee (#4007).
@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
@dhalbert i think it may come down to busio objects not being properly guarded and getting smashed in the middle of execution. I’m not exactly sure how to approach fixing that issue, but BusIO seems to be the common flaw for the few people encountering this.
I’ll be testing changes today and report back.
@analog bridge hi - did you get any further with the touch problems, or do you not have any boards that exhibit the issue? tnx
I did a test with .bin after a complete flash erase and still unable to replicate the issue...
@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).
@tulip sleet only microS2's here...
this is very peculiar 😦 I will take a look at your schematic vs the other boards
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).
i don't see your schematic
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:
I haven't yet uploaded it...
its based on the reference esp32s2 schematic... very similar to a wrover with different ram and flash chips
tnx, i will look at the ref. same power supply arrangemetns?
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
can you try some different pins that aren't broken out... just touch the module itself
right, the pin traces on your board are very short, like the module
yes that is what I am thinking
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
hmm, I will try up to IO14 on the FeatherS2: it has the shortest traces compared with the Metro or MagTag
no luck
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
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
can you do a test with touch_pad_config() called just after touch_pad_init() as it was before the commit
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
same here
this is the same sequence of calls as in idf touch example
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
I get smaller raw_values in 3000 range
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
Yeah, this was one thing I was going to test for (see an above comment about the reset duration I mention). I imagine that it should solve the issue. Once i test that, I’ll update the issue or close as needed.
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.
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
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!
There's also ESP-MESH which is a more typical wi-fi mesh protocol. Naming may get confusing.
Okay, I'm fairly confident now that it's just a timing issue on reseting the touch device so I'm going to go ahead and close this issue.
?serverinfo
Yup! We'll need new graphics for that milestone
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.
...
@analog bridge I don't know if it is related, but in my test with using the MagTag button as touch pin, I had very different sensibility!
@thorny jay I forgot that! I will try again on the MagTag with beta.1, and see what is different with my fix
Provides the following enhancements:
- pack
memoryviewandbytearrayin addition tobytesto msgpackbintype. - chunk long reads to accommodate UARTs with "small" rx buffers
Apparently I didn't do this right. What I did:
git checkout main
git pull adafruit main
git checkout cp-flow
make translate
git add locale/circuitpython.pot
git commit / push
(Messed this up last time, so I prefer to be careful ...)
My usual flow
git checkout cp-flow
git fetch adafruit
git merge adafruit/main
# Use git mergetool if conflicts
make translate
git add locale/circuitpython.pot
git commit ...
git push ...
@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
The single build failure is a GitHub Action glitch.
@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
I tested on the button pin... D15, D14, D12 and D11. One of them cannot be used because it is not touch capable. The sensiblilty on the 3 left was variable, some will react on touch, other will react just because your are close to the button. The fun part was for a button to react even before you click it. Those might be the only pin where touch is possible on the MagTag. 🙂
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
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.
in the sleep guide I am using an example on the Metro ESP32-S2 instead of the MagTag for touch sleep
The MagTag is a "PreCog" and know you want to press the button...
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:
I think it's missing. Double check and add if necessary.
@gilded cradle To be clear on this PR, the entire import section you removed is not used? https://github.com/adafruit/Adafruit_CircuitPython_PyPortal/pull/102/files
@idle owl correct. The relevant code is already inside https://github.com/adafruit/Adafruit_CircuitPython_PyPortal/blob/master/adafruit_pyportal/peripherals.py
Ah ok, excellent. I'll approve it then.
thanks
HI!
I'd like if possible the audio compression encoder in circuitpython.
FLAC encoder would be ideal, but MP3 is ok too.
I'd like to store audio from microphone to SD card, compressed
One example code in C is here
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.
random.randint is a function
Excellent, thank you
personally I favor judicious use of "global" in simple examples. It's not appropriate for "big programs", but that's a subjective judgement.
Is random.randint(5, 10) considered an "object"?
OTOH we do have that pylint diagnostic enabled in Learn, and most of those are intended to be simple beginner-appropriate programs
Right
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
hmm ok
(a "function call" I think people say more than "a call to a function")
That's how I worded it.
Ok, I'll disable Pylint in this case.
Thank you for all of that!
it's only opinions
Still useful.
What, what? A year before your reminded me of that game of yours, I made a PR for the game. This is so long ago that I did not remember! https://github.com/deshipu/jumper-wire-displayio-pygamer/pull/1
@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 :(
@stuck elbow Do you use Gmail or some variation thereof?
@idle owl no, I use mutt
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.
@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.
@idle owl no, I have my own domain
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.
I do filter all github mails to a separate mail folder, but that doesn't help with missing pull requests
Thanks @dhalbert for that fix!
Looks like some devices are really out of space. Presumably something else (other than the UART) should go ...
thanks
hmm, I can actually use different addresses, I wonder if I can set which one to use for which org
Ooh. That might be handy.
i passed that on!
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...
@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
@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.
It's a start!
BTW, I've tested this on 2 different ESP32-S2
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?
Update usage with PyPortal after 5.0.0 refactoring,
Ref: https://github.com/adafruit/Adafruit_CircuitPython_PyPortal/releases/tag/5.0.0
Hi @carmine girder, I just usually put something in the release notes about which libraries to be sure are updated.
So the release notes would be part of the https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT repo?
oh, maybe you are referring to what is listed under https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT/releases
Right, the releases section
You don't need to post in the forum too. This is definitely a possible issue.
Thanks for the explanation. I posted first in the forum, then the more I thought about it,, the more I thought it was an issue that was out of my program's control. That's when I posted here.
Hello.
I am creating a derivative board for the Grand Central. I will be using the ATSAMD51P20A
Requesting a VID/PID for the new board.
Thanks so much.
Hey there! If you’re needing a VID/PID checkout pidcodes. I believe @tannewt has been pushing this direction. He has access to the review process and can get it sorted there.
So i am following this guide on adafruit. https://learn.adafruit.com/how-to-add-a-new-board-to-circuitpython/overview
which let me to this pull request. Pidcodes requires the open source software and hardware. I can't get my board added to circuitpython without the VID/PID so it's a catch 22.
Submit your pull for pidcodes and let Scott know what you’re doing. As long as the PID is available, you should have no issues pushing to CP for a PR. (I’ve done this twice already)
I am happy to help if need be.
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...
@askpatrickw Would you mind taking a look at the PR, testing if you can. Artifacts are building now.
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.
Based on this page, for compiling 6.1x, this should be the right ARM toolchain:
https://learn.adafruit.com/building-circuitpython/linux
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.
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...
Did you import storage in boot.py? boot_out.txt will show output from running boot.py, including errors.
Another possibility is that the filesystem is corrupted, which would make it read-only even from CircuitPython.
I just tried this on a Metro M0 Express running the latest build from main, and it works for me.
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.
@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
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.
@askpatrickw Would you mind taking a look at the PR, testing if you can. Artifacts are building now.
@anecdata I can look at this 20 Jan prolly later in the day. Thanks for the diligence you took in looking into the fix!
I don't see any issue with that. I'm currently caught up with work and some other issues, thus the late response.
Similar to the QT PY the Black Pill / STM32F411CE board has pads for an external flash. This pull request adds a board version that supports an external flash soldered onto those pads.
[There is also a version of the board available with the external flash already present]
It looks like the automated build fails with a duplicate PID - I copied over the config files from the base board - is there something I should update?
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.
Yes, there are two versions available to buy: one with the flash and one without the flash present.
(there's currently only a board definition for the version without the flash present - this pull request adds a board definition for the version with the flash present - either as bought or added later)
Is there a name or different model number for the commercial version with flash?
Not that I can tell - on the WeAct/Aliexpress store - its just a case of selecting either with or without ... no obvious name difference.
We don't yet support sdioio on the mimxrt10xx series. We'd be happy to see someone contribute an implementation to the core.
@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...
Is there some way to bypass the duplicate PID checker? I think that's what would make the most sense here, and it might come up again for other future boards with "variant" builds.
Hello ESP32-S2 crowd. I'd be interesting if any of you have feedback on that new Nordic power meter. I was thinking of getting one but there's a discussion in Nordic forums querying how it behaves wrt prior version: https://forums.adafruit.com/viewtopic.php?f=58&t=174161 (I meant to put that in CircuitPython forum as that seems to be where the low power stuff is going on at the moment).
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.
...with_flashis fine with me, and I think covers both the home-added and commercial versions.
I agree, simplest answer is the best.
The commercial version has a Winbond W25Q64JV ... my pull request references a W25Q64FV as I originally built this for a hand soldered version. The JV and FV are compatible so the build works for both.
Would you like me to resubmit the pull request with '_haxpress' replaced with '_with_flash'?
Thanks for the addition! Besides the inline comments, could you change the board directory name to stm32f411ce_blackpill_with_flash?
#define MICROPY_HW_BOARD_NAME "stm32f411ce-blackpill-with-flash"
Don't put the comment on the same line: it can cause weird issues. Thanks.
If you know the chip type on the commercial version, change the _COUNT to 2, and add the other device, like
= "W25Q64FV,blahblah"
Here's a new PID we assigned for this:
USB_PID = 0x006A
Change name from _haxpress to _with_flash
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...
Thanks for the help! Hopefully all good now!
@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...
@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.
Sure @idle owl. Thanks for reminding me. I almost forgot about the meeting.
@gilded cradle So did Jeff and he's running it 😄 Thank you so much!
yw
<@&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.
CircuitPython Weekly for January 19th, 2021 THIS MEETING is on TUESDAY. 24 hours later than usual due to a US holiday on Monday. Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates early. During the meeting, we go through them as a round ro...
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...
Thanks!! I am going to instrument the calls to tud_task() and the ticks by toggling some pins to see what is going on.
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?
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.
@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 🙂
@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?
I would say that it helps you react only to the "rising edge" of the signal from the PIR sensor.
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 _____|‾‾‾‾‾‾‾|______
Right
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
debounce is different than this, so I wouldn't use that term here
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.
debounce helps get just one "action" when the value changes rapidly, like ____|‾|_|‾‾‾‾‾‾‾‾|_____
Ahhhhhh
the small period of being False gets filtered out when you "debounce". "Bounce" happens especially in mechanical switches.
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
I had to add it to all the Busio functions a while back, probably worth reviewing everything that uses pins to make sure they're claiming properly.
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
making this an into-the-weeds topic... though I won't be able to stay till the end
Good afternoon -- happily lurking, notes doc updated.
@tidal kiln did you do the tides project? https://forums.adafruit.com/viewtopic.php?f=60&t=174180