#circuitpython-dev
1 messages ยท Page 381 of 1
I'm still seeing the original issue where the code continues to run but MIDI stops in 15-20 mins. I'm seeing this on a Dell XPS 8930 desktop running win10, but I also see it on a Dell Inspiron 5593 laptop running win10 (haven't tested on one previously). So the problem is a bit more widespread than I thought. I've run the exact same test on a custom built non-Dell system and MIDI continued for 3 days w/o stopping.
while running, did the laptop goes into standby or sleep mode and waked up ?
while running, did the laptop goes into standby or sleep mode and waked up ?
No system was plugged in and all power-save settings were disabled.
@jepler @nikita-kotsehub I think I have found the error. It is fixed in https://github.com/v923z/micropython-ulab/pull/428. New release coming in a couple of minutes.
while running, did the laptop goes into standby or sleep mode and waked up ?
No system was plugged in and all power-save settings were disabled.
Since I couldn't reproduce it, I will try to modify the code to ouput usb log to uart for you to test with. Will upload it here when done.
We can do this now because we won't use a lot of power.
@tulip sleet you around? I'm just about free
yes, and I have more info
kk, will let you know when I'm free
our progress bar is getting so full
well that is weird. ```$ ./micropython-coverage -c 'import sys as errno; print(errno.EINVAL)'
22
print(errno.EINVAL) even prints a number without importing anything ๐ค
looks like some short-circuiting of a lookup??
yeah
I understand why, I wouldn't have discovered it otherwise
but the more exciting news is, I found 1k of flash space in the couch cushion while looking
lol
i would think we need it =1?
what makes you say that? It doesn't seem like referring to errno constants is a performance critical path in the type of code our users create
// Whether to enable lookup of constants in modules; eg module.CONST . Is that an optimization or it just doesn't work if off?
It sounded like the latter
oh I see what you're asking
I think it's just an optimization
.. turning errno.EINVAL into a constant load whereever it appears, rather than actually looking it up in the errno module by string at runtime
I'll make sure though
disabling MICROPY_COMP_MODULE_CONST is +112 bytes free, disabling MICROPY_COMP_CONST_FOLDING is +884 for a total of +996
const folding is pretty important, i wouldn't turn that off
I won't PR it right now but like some other things I'll keep it in my pocket. We might decide it's a trade-off to make for the most constrained boards. constant folding would remain active in mpy-cross so in byte-compiled files it's not giving anything up
while True: print(1+2+3+4+5+6+7+8+9+10) I imagine it can make code like this run a lot faster/slower, for sure
especially floating point calcs on non-fp chips
yeah I see that
ok @tulip sleet
Remove max_size parameter from displayio.Group
Closes #4959
This is potentially a breaking change as the constructor signature is changing.
Status of dependents:
Frozen modules
> grep -r max_size frozen | wc
0 0 0
All frozen modules that use max_size have been updated
Adafruit_CircuitPython_Bundle libraries - after the next release
>> Adafruit_CircuitPython_Bundle ๏ฆ main
> .update-submodules.sh
> grep -r max_size * | gr...
This looks as expected.
I also double-checked that in 6.3, this was already ignored and was not marked MP_ARG_REQUIRED so (as we already satisfied ourselves before) it's possible to write code that's compatible with 6.3 and 7 after this change.
https://github.com/adafruit/Adafruit_Learning_System_Guides/pull/1604 in the learn guide repo as been merged, with that and the items listed above I believe the last outstanding change for this effort is the turtle library. I'm planning to take a closer look into that one this weekend.
This weird because in CPython it is this error: https://docs.python.org/3/library/socket.html#socket.gaierror The value comes from:
Python 3.9.6 (default, Jun 30 2021, 10:22:16)
[GCC 11.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.EAI_NONAME
-2
I've added a short comment about what the value is.
Thank you! Thanks to @v923z as well!
Heads up for @tannewt to take a look at the string stuff in this since I'm not sure I'm qualified to comment on whether it's safe.
I'll do my best. :-)
Also to double check that this doesn't have any negative interactions with the new structure of status LED - we don't have any exception specific colors anymore, right?
Correct. Just double red flash.
Thank you @lesamouraipourpre. Great job!
Looks good to me! Thank you @cwalther and @hierophect
Thanks for addressing my comment!
I'm unavailable next week, but if there's no progress on this, I should be able to get all four boards sorted hopefully the week after. We should be able to test and release the R boards. The M boards could be held for someone with an M board to test (or put out there to see if any issues arise - they should be minor).
Hi! I'm using CircuitPython 7.0.0-alpha.5-8-g779b5c185 on a Raspberry Pi Pico.
Despite the Pico's datasheet labelling GP16-19 as default for SPI, GP4&5 as default for I2C, and GP0&1 as default for UART, there is no board.SPI(), board.I2C(), or board.UART() available.
The pinout diagram on [Getting Started with Raspberry Pi Pico and CircuitPython](https://learn.adafruit.com/getting-started-with-raspberry-pi-pico-circuitp...
We discussed this in #4121 and made a decision not to do this, for the reasons given there.
I have created a pull-request and would be grateful for some feedback, especially since this is my first contribution to CircuitPython: https://github.com/adafruit/circuitpython/pull/5042
Testing: this change was manually tested on a Feather RP2040 and a RPi Pico by using the attached test.
@NathanY3G Thanks for the PR. Changes look good... just one comment.
}
if (instruction == pio_instr_bits_jmp) {
uint16_t condition = (full_instruction & 0x00e0) >> 5;
if (condition == 0x6 && jmp_pin == NULL) {
mp_raise_ValueError_varg(translate("Missing jmp_pin. Instruction %d jumps on pin"), i);
}
}
An error should be raised if no jmp_pin is provided in this case.
CircuitPython version
Adafruit CircuitPython 7.0.0-alpha.4 on 2021-07-08; Adafruit ItsyBitsy nRF52840 Express with nRF52840
Code/REPL
# boot.py
usb_cdc.enable(console=True, data=False)
usb_midi.disable()
#code.py
...
devicename = "123456789A123456789B123457"
# this are 27 characters (no error in advertisement with names which are 26 characters long)
...
_bleio.adapter.name = devicename # I don't know if the device name here or bleow is necc...
CircuitPython version
Adafruit CircuitPython 7.0.0-alpha.4 on 2021-07-08; Adafruit ItsyBitsy nRF52840 Express with nRF52840
Code/REPL
print("first line.")
s = input("first input\n")
Behavior
The code above runs fine as expected!
But when you press CTRL-D at the input several times,
there will be a hard crash of the board with no output to repl. (The serial USB-Device "goes-away")
Similar to the crash reported in #5043
Note that once the bo...
I have some questions regarding submitting a new board if someone has some time to explain.
have you taken a look at https://learn.adafruit.com/how-to-add-a-new-board-to-circuitpython/overview
Yes, the thing is that the board I'm working with is a variant of a board adafruit sells, but wondering what to do about usb pid/vid
This is more a political thing than technical.
You will need new vid/pid... if your board is open source then you can get it from https://pid.codes/
Not an open hardware board, same physical pcb as an adafruit-sold third-party product but a different mcu onboard.
The WeAct blackpill_with_flash board (unlike the non-haxpress version) seems to reserve 16k of flash for nvm usage. It uses the ports/stm/boards/STM32F411_nvm_nofs.ld linker script, but does not seem to actually implement the nvm module in the build. It would be a good idea to reclaim this space for future use given a) the port already omits some built-in modules and b) a tinyuf2 port is in progress for this board and will need to be shoehorned in somewhere.
My suggestion would be, either to quietly slice the name in the setter to the max allowable length or raise an error in the setter and not let the error come up in start_advertizing.
And it seems, that not only ciruitpython and the USB-stack stops working
also, the usual "unknown Device" advertisements of the nRF52840 are not sent anymore.
Good suggestion @microDev1 - thank you :-)
I have made the change, tested it and pushed up a new commit.
Thank you @hierophect!
@tannewt, if the string stuff looks good to you, I guess the TODO comments can be removed? I can make a PR to that effect.
diff --git a/shared-bindings/supervisor/__init__.c b/shared-bindings/supervisor/__init__.c
index 83b473616..055b3a908 100644
--- a/shared-bindings/supervisor/__init__.c
+++ b/shared-bindings/supervisor/__init__.c
@@ -267,14 +267,13 @@ MP_DEFINE_CONST_FUN_OBJ_0(supervisor_ticks_ms_obj, supervisor_ticks_ms);
//| ...
//|
ST...
@idle owl if you have availability today let's talk about keypad/gamepad stuff
I do. By the time I was free yesterday, I believe you were chatting with Scott, so I didn't bother you. I'm free after 11:30 it looks like. (Shipping a guide right now.) Does that work for you?
that's good
Excellent. I'll ping you in a bit.
@ThomasAtBBTF Thanks! I overlooked this element of the issue because I read it too quickly.
It would be great if you enter a fresh feature request for these items (maybe just one, as they do seem closely related/interdependent). I do agree that we have room to refine how the bluetooth "flow" goes and how to control it from code, though I only know the basics and haven't used it much for myself.
I still would like to be able to actively start Bluetooth in code.py when turned off in boo...
You'll need your own vid/pid pair. this FAQ has entry on where you can get a PID from the mcu vendor: https://pid.codes/faq/
We should revisit this. As @shuyuan-liu points out, the Pico datasheet designates defaults now:

Yes, please make a PR @cwalther. Thanks!
@evildave666 I'm ok with using that 16k for something else. Does this make sense @hierophect ?
I like the idea of validating the name when it is set. That is clearest for the setter on how to fix it.
The datasheet, the SDK doc, and MicroPython all use somewhat different "default" pins. Our conclusion before was that since it's not obvious which is the most authoritative for CircuitPython, and there are no silkscreen markings, that this would be a continuing support issue. I'm not sure that situation has changed.
Will do so.
Thank you!
And: My gut feeling tells me, that the "Hit ctrl-d repeatedly bug" is related to communication with the Nordic API when bringing up CircuitPython after a reload or reset.
The advertisement of the "stock-devices" needs somehow be stopped "nicely" and CP needs to take over.
CircuitPython version
6.3, 7.0 alpha, tested on both Feather M4 and Raspberry Pi Pico
Code/REPL
import board
import audiobusio
import audiocore
FILE = 'sweep.wav'
# Feather M4
BIT_CLOCK_PIN = board.TX
LR_CLOCK_PIN = board.D10
DATA_PIN = board.D11
OUTPUT = audiobusio.I2SOut(BIT_CLOCK_PIN, LR_CLOCK_PIN, DATA_PIN)
DATA = open(FILE, 'rb')
AUDIO = audiocore.WaveFile(DATA)
OUTPUT.play(AUDIO, loop=True)
while True:
pass
Behavior
...
@dhalbert is looking into this. What is the sample rate of the wav?
This draft PR outlines the requirements for a SAMD51 implementation of the Alarm module, with instructions for light sleep, deep sleep, fake sleep, PinAlarms and TimeAlarms. I've outlined recommendations for what modules should be used where, along with relevant sections from the datasheet, in this git gist. I haven't added much in the way of actual port-specific implementation, to make it more clear what code is generic/u...
Fine with me, but is 26 characters really the threshold?
Is the length of other parameters in the report not changing the threshold?
I read somewhere that there is a length-limit of 31 bytes for a report.
But I don't understand this in enough detail to make a statement here.
While working on code for HID devices on the nRF52840 ItsyBitsy I am observing that as soon as power is applied to the board, it starts advertising (unknown to Windows) devices.
Only after code.py starts and executes code to present an HID device these "unknown devices" are "going away" and the device prepared in code.py gets advertised.
I think it would be helpful and allow a cleaner customer experience if the behavior of the default Bluetooth (sub-)system can be modified in boot.py as now...
Small cleanup after #5037: remove TODO comments addressed in review.
@idle owl I noticed the PR you linked earlier that removed were_pressed from CircuitPlayground library. The CLUE library contains the same API currently. I'm about to update that library for these changes. Should I remove it from there as well? I found two uses of it in examples / learn guides so if we do remove I'll update those to use the direct button value API but keep the same behavior from users perspective.
One of the examples in Learn isn't relevant, because it's implementing a few things from the CLUE library in a library included with the project bundle (Dan and I were looking into this earlier). Yes, we're trying to slowly deprecate gamepad and the were_pressed functionality isn't really necessary. Folks can use keypad for similar if desired, or poll the buttons etc. So if you're already in there, please remove it, and ensure that any example code is updated. Thanks!
CircuitPython version
adafruit-circuitpython-adafruit_magtag_2.9_grayscale-en_US-20210723-108a9f2.uf2
Code/REPL
n/a
Behavior
n/a
Description
Error blinking (like 2 reds) only blink the rightmost RGB LED where for upgrade, the four LEDs are are in use
Additional information
Very similar than #5039 and good candidate for Deep Dive fixing LIVE. :-)
@tulip sleet do you know if there is a "simpletest" type most basic example of how to use the new keypad module somewhere? I've just written this one to make sure that I understand how it works:
from keypad import Keys
import board
import time
pins = [board.BUTTON_A, board.BUTTON_B]
keys = Keys(pins, value_when_pressed=False, pull=True)
while True:
if keys.events.overflowed:
keys.events.clear()
event = keys.events.get()
if event:
if event.pressed:
print("{} was pressed".format(event.key_number))
if event.released:
print("{} was released".format(event.key_number))
If there isn't one out there yet I'd be happy to share this where is the best place to do so (in the docs perhaps?)
I wrote this guide: https://learn.adafruit.com/key-pad-matrix-scanning-in-circuitpython
which has several simple examples
Ah, thank you. didn't think to check for a guide. ๐คฆ
np! I try to talk it up ๐
@lone axle the "overflow" stuff is discussed on the Advanced Features page
Nice, thank you
@slender iron verrrrry interesting re audio:
- stopping neopixel statemachine on deinit made no difference
- playing a
RawSampleby reading a raw version of my a440.wav file works fine by itself, even with displayio DMA going on. - playing the
RawSampleand theWavFileversion are very different. The WavFile version is crackly or very quiet. After some number of plays the RawSample play also stops working (perhaps due to DMA getting messed up).
This is with a 32k 1-second 16-bit sample. I will continue to look at things.
Use the 10 neopixels on the playgrounds for status.
Fixes #5039
LGTM! ๐ Just one thing... issue #5051 seems like it is related to this.
@slender iron Should I actually move ahead and prep a PR for the changes necessary to reclaim the nvm area for the blackpill_with_flash? My local build without it seems fine after a day in use.
Hi, I tested adafruit-circuitpython-circuitplayground_bluefruit-en_US-20210723-5fbe6d4.uf2 and noticed that boot_out.txt is empty. I tried import storage; storage.erase_filesystem() but still empty.
I can verify this on a build I did yesterday:
Adafruit CircuitPython 7.0.0-alpha.5-22-ge790ff732-dirty on 2021-07-23; stm32f411ce-blackpill-with-flash with STM32F411CE
I tested the same 5fbe6d4 on Metro-M4 and my boot_out.txt is OK: Adafruit CircuitPython 7.0.0-alpha.5-32-g5fbe6d480 on 2021-07-23; Adafruit Metro M4 Airlift Lite with samd51j19 so I would not worry too much, there might be a glitch specific to CPB or nRF or maybe it is just me.
hey, @tulip sleet I don't know if you can help with this, but it relates to pyserial for windows: on win 10 at least it gives me bad information for the manufacturer ("microsoft" for a CPX) and description (it says a generic "USB serial peripheral (COM3)") and doesn't even fill product (which should say "CircuitPlayground Express").
I think I understand that you used a DEVPROPKEY to get the serial channels names, do you know if a similar method would work to retrieve those other fields ? and how would I go about finding the key for those USB properties (if any) ?
tested on both cpx and cpb (LEDs light up as expected)
The addition to support multiple status LEDs, will that end up working if Iโve got a matrix of LED connected for the neopixel status?
For instance the RGB matrix board I showed off on show and tell has an ESP32-s2 and currently it just uses the first neopixel of the matrix for status
Would I be able to use all the neopixel for status?
Seems like?
Thanks! While there are other boards to apply this to (like the mentioned #5051, I thought of pygamer, etc) it becomes as easy as adding one line to a board's mpconfigboard.h so it's also simple to handle as separate PRs.
Does anyone here have an Arduino Nano RP2040 they can test CircuitPython on? In the help-with-CircuitPython channel there seems to be recent issues with this board, where MicroPython and Arduino UF2 uploads work but CP does not. Sounds kinda like flash setting not right in the build?
mine works as expected, demo code runs on latest, wifi, RGB LED, I'm wondering if there are different flash chips or some variability (or something else entirely)
Thatโs what Iโm wondering as well. Whereโs that Arduino sketch that prints out Flash info ๐
I am looking for the docs.microsoft.com webpages I used. Here is one for DEVPKEY_Device_BusReportedDeviceDesc: https://docs.microsoft.com/en-us/windows-hardware/drivers/install/devpkey-device-busreporteddevicedesc. Its siblings may be what you want. I am looking for the GUID values: I can't remember whether I got those from a header file or a webpage.
I think you know about this PR I made: https://github.com/pyserial/pyserial/pull/571/files
Google 540b947e-8b40-45bc-a8a2-6a0b894cbda2 and you can find the docs.microsoft.com webpages, and then look at their siblings.
(I had that GUID in my search history)
i am no expert at this: I just replicated how the existing .py script looked up values, and probably found how it was done in some other examples (maybe C#)
ah thanks a lot, looking up the keys in that format does return resources with lists and stuff, that's my new rabbit hole to dive in !
I don't know whether this is a good idea, but I learned a lot to implement it.
This adds IS25LP128F as an alternate flash chip, in addition to the AT25SF128A.
Several users on the [#help-with-circuitpython channel ](#help-with-circuitpython message)reported CircuitPython not working and the flash being different than Arduino's published schematic. @Neradoc made a UF2 build with the new chip and[ two of the affected users reported success](#help-with-circuitpython message...
Closing because we have reports of IS25LP128F working on Arduino Nano RP2040 boards and current versions of CircuitPython.
It's worth noting that upstream lists only one flash chip at https://docs.arduino.cc/hardware/nano-rp2040-connect

Anybody know how to properly reach out to Arduino about this?
This is the image from discord that someone was able to determine would work with the IS25LP128F flash definition

yeah it's really clear that "S4 114" maps to "IS25LP128F". :-|
I'm finding the (default for device) floating point mode a bit flaky with my setup of a Feather nRF52840 attached to an Pimoroni Enviro+ doing nothing and that's on a breadboard with 15cm wires over to SPS30 and 10k pull-ups and there's some dangling 25cm unconnected wires (from previous probing). It'll give CRC errors after maybe 10-30 reads. The integer mode (current default for library which I'm pondering changing) is more robust but just gave an error at the 386th read.
The data length...
I think the pin assignment for the CAN pins in the Feather STM32F405 Express board are swapped.

Sorry, I did not get to this and won't be able to test it for the next week since I am away from my hardware.
Dunno exactly what I tested, but with @lone axle during the live show we tested the same thing and the problem was only on my side... Like he had the boot_out.txt and mine was empty. So it might be me or I had another build.
CircuitPython version
Adafruit CircuitPython 7.0.0-alpha.5-42-g0a3c75c43 on 2021-07-25; PewPew M4 with samd51g19
Code/REPL
import audioio, board; a = audioio.AudioOut(board.SPEAKER)
Behavior
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 7.0.0-alpha.5-42-g0a3c75c43 on 2021-07-25; PewPew M4 with samd51g19
>>> import audioi...
There's clearly something wrong with some builds though and it spans multiple devices.
git bisect points to 1a076d34c9d197c1e1420117f856a5d9aa2e8581 as the commit that introduced the bug. Probably the change of included modules, let me check if I can narrow it down further.
Itโs the disabling of CIRCUITPY_PWMIO that causes the issue.
It looks like common_hal_audioio_audioout_construct() sets up a timer but audioout_reset() doesnโt reset it and instead relies on [`pwmout_re...
Or is someone supposed to call common_hal_audioio_audioout_deinit() on a soft reset and that is not happening?
The ctrl+d routine calls reset_port() which calls module_reset() functions, module module_deinit() functions are not called.
Depending on the board, there is a native implementation of some of NeoPixel in an internal module called _pixelbuf. On small boards such as Trinket, that code is not native, but is in Python, which makes it slower. So in your post, say what kind of board you're using.
Is there a way to know the boards that it's native on vs in Python?
@onyx hinge I've stolen your example, and I have to report that it works very well! https://hackaday.io/project/174095-dorsch-40k-keyboard/log/195783-shiny-new-code
I fished this keyboard out of the proverbial drawer to try the new CircuitPython on it, with some of the new fancy features that have been added.
First of all, there is now a keypad module for scanning the key matrix in C โ since it does it in the background using interrupts, it frees the Python code to display the LED animations much more smoo...
very nice, hope lots of folks pick up on this stuff!
Is there a way to know the boards that it's native on vs in Python?
Yep! Search forpixelbufin the Module Support Matrix to get a list of boards that use the (newly renamed) built-in C-basedadafruit_pixelbufmodule: https://circuitpython.readthedocs.io/en/latest/shared-bindings/support_matrix.html?filter=adafruit_pixelbuf
@stuck elbow Is the check for "code == 0" an optimization? otherwise, it seems unneeded, since a value of 0 wouldn't pass into either of the other if-clauses. python for code in pressed_keys: if code == 0: continue if code & 0xff00: report_mod_keys[0] |= (code & 0xff00) >> 8 if code & 0x00ff: report_bitmap[code >> 3] |= 1 << (code & 0x7)
@tulip sleet was gamepad removed in 7.0.0 alpha 5 but going to be added back for next alpha / beta? If I understand correctly the PR removing that hasn't been merged yet, but testing out something unrelated I'm getting a Module Not Found on a CLUE with alpha 5:
Adafruit CircuitPython 7.0.0-alpha.5 on 2021-07-21; Adafruit CLUE nRF52840 Express with nRF52840
>>> import gamepad
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: no module named 'gamepad'
We are going to put it back for 7.0.0 or fix the relevant libraries. If will definitely be gone for 8.0.0. Probably we'll just put it back.
It is turned off by default in circuitpy_mpconfig.mk
@lone axle I am now seeing your other PR's. We can remove were_pressed from the CLUE library, for instance, as you did. We just have to make it a major version bump , as Kattni just did for the circuitplayground library.
What were you testing that ran into needing gamepad on the nRF?
I am working on reviewing the PRs in the Learn Guide repo that remove max_size parameter from displayio.Group() specifically this one is the one I noticed it with: https://github.com/adafruit/Adafruit_Learning_System_Guides/pull/1638 it's using the CLUE library
ok, thanks. I see some uses of gamepadshift and gamepad in various learn guides, but not were_pressed(). There is were_pressed() in Pyloton, but that's a special case, and we know about that (it has its own mini version of the CLUE library). gamepadshift is still present in the boards that need it. So in the next alpha, I will put back gamepad.
@lone axle do you want the Learn Guide fixes you approved to be merged, or do they need to be done in conjunction with any guide editing?
i am just wondering why you didn't merge immediately.
I think they can be merged. I have access to merge them actually I can do that as I work through them as well. But didn't know if anyone else needed consulting before doing so
I'll start merging them as I go through. And I will update the guide pages as needed for any that have code outside of github embeds.
@onyx hinge I am seeing this in local make html builds. Is it significant?
checking consistency... /home/halbert/repos/circuitpython/shared-bindings/ulab/numpy/approx/index.rst: WARNING: document isn't included in any toctree
/home/halbert/repos/circuitpython/shared-bindings/ulab/numpy/numerical/index.rst: WARNING: document isn't included in any toctree
/home/halbert/repos/circuitpython/shared-bindings/ulab/numpy/stats/index.rst: WARNING: document isn't included in any toctree
/home/halbert/repos/circuitpython/shared-bindings/ulab/numpy/transform/index.rst: WARNING: document isn't included in any toctree
/home/halbert/repos/circuitpython/shared-bindings/ulab/numpy/vector/index.rst: WARNING: document isn't included in any toctree
build finished with problems, 5 warnings.
make: *** [Makefile:93: html] Error 1
FYI
halbert@tuna:~/repos/circuitpython/extmod/ulab$ git status
HEAD detached at 8d93dde
nothing to commit, working tree clean
@tulip sleet that's interesting, can you do a git clean in shared-bindings and try it again? Is it failing on github too, or just locally for you?
I think numpy.numerical is a module that has been removed/renamed into numpy-compatible naming
but I notice that building the docs leaves .rst files in shared-bindings/ that are maybe being picked up later?
i was just testing in preparation for a PR for gamepad-related stuff. About to go for a walk but I will try again in about an ahour
a thorough git clean did the trick. Thanks!
We have the room now to have both keypad and gamepad on most boards. Restore gamepad so libraries will work on both.
When 7.0.0 final is shipped, we can change library and guide code to use keypad, and remove gamepad and gamepadshift.
- Revert 04b69cde, part of #4891, to restore
gamepadto most builds. - Turn off both
gamepadandkeypadon builds that don't need them. - Add deprecation notice in
gamepadandgamepadshift. - Update frozen libraries: in particular,...
This is a work-in-progress PR for supporting the SparkFun STM32 MicroMod Processor board.
This is my first attempt at adding support for a new board in CircuitPython and there are a couple areas outlined below where I would appreciate some early feedback before this is finalized.
Peripheral numbering question
When I was reviewing the SparkFun MicroMod Tech Specs, I noticed that the MicroMod...
I'm using just nRF52840 2k pull-ups and SPS30 and it's working fine for over an hour reading about once a second at i2c 100kHz.
Sure!
Removed the unused reservation of 16k of flash (sector 1) for the stm32f411ce_blackpill_with_flash board and reenabled modules that were not being built due to flash limitations.
I've had a local build with these changes running for over 24 hours and don't see any differences on my board other than the 5 previously omitted modules being available.
@DynamoBen I have enabled the tinyusb log output to UART @115200 baudrate. It print out all the usb information with level 2 and level 3. Would you mind using this for testing on your device, then post your log as attached filed here for analysis (since it print out quite a lots specially msc communicate very frequent).
pico-debug-level.zip
I could work around this by enabling pwmio and disabling analogio instead.
In my testing, just enabling pwmio without disabling anything worked. But I didnโt test all languages.
@solar whale I'm getting a blank boot_out.txt as well running a S3-latest on Pimoroni Pico Lipo 16MB
I was thinking it was just a glitch on my side... There is no issue created yet, but I am at work, so I prefer not to access GitHub during working hours. Maybe you can create an issue for that empty boot_out.txt?
I am always hesitant to create an issue... I prefer to check here if it is a know behaviour, if I am the only one affected, before creating an issue. You see, I don't track the forum, I might only see a small percentage of the created issue. So I almost never know for sure if it is a known issue, a new issue, just me making mistake or not using new code the expected way.
CircuitPython version
adafruit-circuitpython-pimoroni_picolipo_16mb-en_GB-20210725-a9735fb.uf2
Code/REPL
> ls -l /media/user/CIRCUITPY/boot_out.txt
Behavior
-rw-r--r-- 1 user user 0 Jan 1 2020 /media/purpleankh/CIRCUITPY/boot_out.txt
Description
The latest UF2 from S3 is producing an empty boot_out.txt. This is possibly board specific as my PyPortal is fine.
adafruit-circuitpython-pyportal_pynt-en_GB-20210725-a9735fb.uf2
`Adafruit...
Further Testing.
I've set the contents of boot_out.txt to Hello so that it triggers the rewrite, but it sets it to an empty file again.
Connecting the REPL, I get the correct VERSION string:
Adafruit CircuitPython 7.0.0-alpha.5-44-ga9735fbe7 on 2021-07-25; Pimoroni Pico LiPo (16MB) with rp2040
Testing UF2s from alpha-5 forward
-rw-r--r-- 1 user user 91 Jan 1 2020 /media/user/CIRCUITPY/boot_out.txt
Adafruit CircuitPython 7.0.0-alpha.5 on 2021-07-21; Pimoroni Pico LiPo (16MB) with rp2040
-rw-r--r-- 1 user user 104 Jan 1 2020 /media/user/CIRCUITPY/boot_out.txt
Adafruit CircuitPython 7.0.0-alpha.5-8-g779b5c185 on 2021-07-23; Pimoroni Pico LiPo (16MB) with rp2040
-rw-r--r-- 1 user user 104 Jan 1 2020 /media/user/CIRCUITPY/boot_out.txt
Adafruit CircuitPython 7.0.0-...
CircuitPython version
CircuitPython 7.0.0-alpha.4
Code/REPL
-
Behavior
I plugged the PiCo into my computer to continue my project and all my files on it are gone. It now contains a code.py with hello world in it and an empty lib folder.
- Why did this happen?
- Is there any way to get my files back?
Description
No response
Additional information
No response
This can happen because the filesystem became corrupted, which can occur for a variety of reasons. This is a support question: please ask further in https://adafru.it/discord or https://forums.adafruit.com/viewforum.php?f=60.
Thank you. I managed to recover the code. It was in the mu editors log in local appdata /python/mu
I eventually wanna put this project in production. Is there a good practise to prevent these file system corruption errors in the future?
Thanks
Please ask in one of those other places and we'll be happy to talk about how corruption might happen. We avoid doing support questions here because it causes email to be sent to a lot of people for each comment.
?serverinfo
@hathach Using the level2 build and putty (for serial comms) all I see "None." When MIDI stops so does serial data and and I see nothing except for "None" prior to it stopping. Using the level3 build I get a unknown USB device driver error "Device Descriptor Request Failed" so I can't connect.
@idle owl gamepad + keypad together is not fitting in Feather M0, etc. so I may just remove gamepad altogether from SAMD21, now that the libraries have stopped using it. It does fit on CPX because we turn off displayio, which is big
So it won't fit on the displayio build then.
I'm all for turning it off.
we pull other tricks on the displayio build (like no longints)
Ah
i will fix pyloton not to use it
Sounds good.
<@&356864093652516868> Greetings! The CircuitPython Weekly meeting is in just under 2.5 hours. Remember that if you'd like to participate (or are missing the meeting and wish to provide notes), please add your hug reports and status updates to the notes document. This is what I will pull from as I go through the meeting. If you're planning to simply listen in, you don't need to do anything. Hope to chat with you soon! https://docs.google.com/document/d/1IO_iC2RE9w83MMxA-Gy5T3VeeAy3HbuCkSOehqth15I/edit#
somebody in the help channel had installed the latest libraries from the bundle on a CPB 6.3.0, which is still the stable, and of course it didn't work because of keypad. The issue here is that the problem is not obvious: the bundle is described as "This bundle is built for use with CircuitPython 6.x.x." and it's actually not, because that's about the mpy format used, not the feature compatibility
the solution, to download an older version of the adafruit_circuitplayground library from the github releases of said repository is not super easy to find on your own either
There were some discussion with @lone axle on how to handle the migration. But it seems that now we keep both... so the library can be changed later... after 7 is released.
yeah but the library is already changed, has not backwards compatibility and is in the bundle
Did they post the specific error message? If I understand correctly the usage of keypad was also removed so I would have thought that library would work with 6.3.0
oh it was ?
ah ok, I see
the were_pressed API was removed all together with this PR. So user code can either poll button_a or button_b directly or if desired implement keypad in the usercode space instead of within the library.
so it was in 4.4.0, but is fixed in 5.0.0
We broke it temporarily.
In terms of 6 compatibility.
It has been fixed in the latest version, yes.
ok good, thanks ๐
No one used were_pressed anyway, and shouldn't have been. That's all that ended up changed in the end was its removal.
were_pressed() is also going to get removed from the CLUE library: https://github.com/adafruit/Adafruit_CircuitPython_CLUE/pull/48
well I use it but that's fine ๐
you are "encouraged" to switch to keypad ๐
keypad is better ๐
gamepad and keypad together are not going to fit on several SAMD21 boards. I'll do something about combining parts of #4940 and this before the next alpha.
Obviously you are better informed and I have a partial view. Long LIVE the keypad.
Personal opinion, I suppose.
I work in "operation" (the Ops in DevOps) and I was: "But how are we going to transition from the old to the new and synchronise the library change and the core change."
I will update #5059 or open a new PR to include parts of this. gamepad and keypad together do not fit on some SAMD21 boards. But we'll leave gamepadshift in for 7.0.0 because it's harder to emulate, and not remove it until 8.0.0 after the libraries that use gamepadshift have been updated to use keypad.
Ideally we'd leave gamepad in for one more version, but there are space issues, as you see. So by trimming the libraries a bit, we can force the change. It's not quite as pleasant as an overlapping transition, but it's necessary in this case.
The frozen CPX library is OK for now in 6.3.0
that will not change in 6.x
yeah, that's why their code worked on the CPX but not the CPB
@slender iron I'd like to discuss about the traceback module implementation, can you ping me when you are available.
in the long run we might have different bundles, but we haven't come up with an easy mechanism for that.
there's a long issue discussing that
I like this! Thanks. Saves using browser search.
@analog bridge at my desk now
I have implemented the cpython version of print_exception(), the only thing is that the cpy exceptions doesn't contain the __traceback__ obj...
Should I alter the print_exception() function to only take exception (i.e. print_exception(value), instead of print_exception(etype, value, traceback))?
the changes are here: https://github.com/microDev1/circuitpython/tree/traceback
cpython implementation: https://docs.python.org/3/library/traceback.html
could we add __traceback__?
another option is to make a new module that does it based on the exceptionn
and then we can make a python version for cpython
yes the mechanics are there... its just not exposed
the C python traceback API is not great, I personally would prefer we implemented traceback.format_exc which can only be called for the latest exception, but the result can be kept for later so it's fine, and it doesn't require additional parameters
or, micropython-lib has a traceback module written in python
good idea... one can just print traceback using print(traceback.format_excecption())
the only thing is I guess it allocates memory
there is an emergency exception buffer, could that be used?
seems like it doesn't provide any traceback module features like limit, chain
https://github.com/micropython/micropython-lib/blob/3a6ab0b46d6471bee00ae815444c624709dd4cdd/python-stdlib/traceback/traceback.py
MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF, etc.
yeah no I was thinking backwards: if it's in a new library the compatibility solution is what Scott says, have a python implementation in blinka, not have a traceback.py emulation in Circuitpython
I think there are two options 1) add native traceback that is a subset of CPython's traceback or 2) create a new module name that has the existing print_exception and provide a Python version in Blinka for CPython. Either option is fine with me. My goal was to get it out of sys
following seems to be the place were __traceback__ implementation will go?
https://github.com/adafruit/circuitpython/blob/main/py/objexcept.c#L207-L253
yup, looks right
one more thing... we don't actually need to obtain etype, traceback params from the user... they can be obtained in c from the exception i.e. value parameter.
in-fact python-3.5 just ignores etype, its only there for backwards compatibility with things like sys.exc_info() which returns a tuple (etype, value, traceback), exc_info() is at the moment disabled by default, should I enable it?
my concern is with flash usage... I an not sure if traceback will fit on all boards.
we don't need it everywhere
I am removing etype, traceback params for now and will focus on adding print_excepction(value, limit=None, file=None, chain=True)
and also format_exception() its same as print... just returns a string instead printing or writing to file like object
hmm that is strange, how would you connect with UART on pico, it should be connect to GPIO0 for UART TX with an ftdi/cp201x. Make sure you have a GND for them, and set flow control to off. Maybe posting the picture of your setup here to see if I could spot any issues with it.
Discord question from @maholli (paraphrased)
What is the issue described with callbacks / why is the
_port_interrupt_after_ticksnot sufficient for TimeAlarm?
When the timer alarm goes off when the device is not in deep sleep (so either in light sleep, or fake deep sleep), it needs to call a function that will set the TimeAlarm static variable woke_up to True. In the STM32 HAL, it's possible to either register a specific function that is called when the ISR occurs, or to use a gen...
if the calls won't work in CPython please call it something besides traceback
need help with docs... is it possible to have params without type annotations?
//| def print_exception(etype, value: BaseException, tb, limit: Optional[int] = None, file: Optional[io.FileIO] = None, chain: Optional[bool] = True) -> None:
//| """Prints exception information and stack trace entries.
//|
//| .. note: Setting `chain` will have no effect as chained exceptions are not implemented.
//|
//| :param etype: This is ignored and inferred from the type of value.
//| :param BaseException value: The exception.
//| :param tb: The traceback object.
I am struggling with etype and tb...
There is an Any type: https://docs.python.org/3/library/typing.html#typing.Any
Testing all the boards I have to hand only two are writing data to boot_out.txt
- atmel-samd - PyPortal
- atmel-samd - QT PY
The following all write an empty boot_out.txt
- esp32s2 - FunHouse
- nrf52 - Feather Bluefruit Sense
- rp2040 - Pimoroni Pico Lipo 16MB
- rp2040 - Raspberry Pi Pico RP2040
All tested with 7.0.0-alpha.5-44-ga9735fbe7
@hathach Sorry I was pulling serial data from the pico not GPIO0. I was able to capture the log data when MIDI stops, this appears to be the interesting part:
`USBD Xfer Complete on EP 85 with 4 bytes
MIDI xfer callback
Queue EP 85 with 4 bytes ...
USBD Xfer Complete on EP 85 with 4 bytes
MIDI xfer callback
USBD Unplugged
USBD Bus Reset : Full Speed
USBD Setup Received 80 06 00 01 00 00 40 00
Get Descriptor Device
Queue EP 80 with 18 bytes ...
USBD Xfer Complete on E...
This sounds like it might be sleep-related, as all those boards have sleep implementations and atmel-samd does not yet.
We have a bunch of alternatives for the standard files
@tannewt does this capture what we discussed?
I will be right back.
thanks for the warning ๐
I wish I could join the frey
unplug the second monitor so it doesn't randomly reboot?
I will follow the recording. I wrote my notes (that cover some hug report from last week too).
Meeting calendar for adding to your calendar service: https://raw.githubusercontent.com/adafruit/adafruit-circuitpython-weekly-meeting/master/meeting.ical
For viewing online: https://open-web-calendar.herokuapp.com/calendar.html?url=https%3A%2F%2Fraw.githubusercontent.com%2Fadafruit%2Fadafruit-circuitpython-weekly-meeting%2Fmaster%2Fmeeting.ical&title=CicuitPython Weekly Meeting Schedule&tab=agenda&tabs=month&tabs=agenda
I'm not sure where the limit is being imposed. Figuring that out is part of the task here.
31 bytes is the limit for legacy advertisements IIRC.
Today OSHWA, in collaboration with the Engelberg Center on Innovation Law & Policy at NYU Law, is excited to launch The 2021 State of Open Source Hardware. This graphic report builds on data from OSHWAโs Open Hardware Certification Program, the annual Open Hardware Summit, and the annual Open Hardware Community Survey.
open horse hardware ๐
EuroPython 2021 is approaching quickly and we would like to take a moment to give you some additional tips to make the event as productive and enjoyable as possible. Configure your EuroPython accountFirstly, you should configure your EuroPython account, tickets and profile, so that we get the right information for
Hey it's the jankiest USB-to-MIDI converter! Uses an @adafruit Rotary Trinkey with a USB jack hot glued in place of the encoder. This is a really bad idea. But at least the code's in #CircuitPython! ๐ค https://t.co/NjiOvRPImp
Adafruit CLUEใจAliExpressใงๅฃฒใฃใฆใBlackberry็ฑๆฅใฎใใฉใใฏใใผใซใขใธใฅใผใซใCircuitPythonใงๅถๅพกใใฆใ็ป้ขไธใฎใชใใธใงใฏใใๅใใใฆใฟใพใใใ
ใใฉใใฏใใผใซใฎใใผใซใปใณใตใฎ็ฒพๅบฆใฎใใใใใชใใชใๆใฃใใจใใใซๅใใชใใใฉใๆผใ่พผใใจใใฟใณใซใชใใฎใใๆใใ https://t.co/eAxoat2bwP
I needed to light up my life...
that's a lot of unfamiliar names
๐ต So please carry the lantern high. ๐ก
Add Gravitech Cucumber R board definition (updated) #4131
Haha, glad to see someone was able to successfully do something "wrong" with a Trinkey after my fiasco with the defective Slider Trinkey mod
Good job @devout jolt
very sorry, didn;t notice I wasn;t
np
@idle owl seems like the adafruit_ticks library should have been listed as new ๐คท
maybe the script is checking for (non-pre-) releases?
ahead of the game as always ๐
@slender iron Deep Dive question.... is there a page where we can see all the notes\timestamps across all the previous dives? I wanted to re-watch some sessions where you're doing protocol analysis
@idle wharf I don't have a single place. We could make a repo for it like we do for these meetings
I can probably jam it out
Thanks everyone ๐
๐
Just a small FYI real life has really got in the way of contributing much, but always feel free to message me if there is a question on something I worked on
np @blissful pollen. I hope all is well
Yup, nothing major just work, covid stress, and the like. But things are looking better soon
๐ take care of yourself. let us know if you need help with anything
Thanks! All this is a great distraction and fun to pay attention to
Are the older notes docs available or should I work on a script to scrape YT tonight ?
I'm adding them from the google drive copies
@idle owl I am adding board.LED to those boards that should have it. But I see a bunch of boards with board.L: should I leave that or change it to board.LED?
Leave it. Don't remove anything already present.
Never know where it was used, and don't want to break things.
โ๏ธ will just alias
Perfect.
Yes, this is also my limited understanding.
But with Bluetooth Beacons, the name of the beacon is often much longer.
Maybe there is a way to split the name into multiple chunks.
I would like to attend the meeting. This would be the first time. How can I join this meeting?
Today's meeting has already concluded. It was a short one. But the meetings begin at 2pmET/11amPT, typically on Mondays. If you'd like to join us in the future, you would join the CircuitPython audio channel towards the bottom of the list on the left side of your Discord window (on desktop Discord anyway) during the meeting time.
If you would like to be notified about future meetings, I can add you to the circuitpythonistas Discord role. We ping a couple of times per week about the meeting and once in a great while with other things.
But that is entirely optional and up to you.
cool
@onyx hinge Do I really want the LED animation library to be dependent on another library? I think I'm still a little unclear on what this is solving. https://github.com/adafruit/Adafruit_CircuitPython_LED_Animation/pull/81
Would you like to be added to the CircuitPythonistas?
yes
Done!
thank you kattni
You're quite welcome
@idle owl I'm not sure if it should be accepted or not. The idea is, adafruit_ticks is on all boards and doesn't have accuracy issues on m0 boards after they've been running (float precision limitation) .. and it gets the nasty if/try/import/etc out of the LED animation library. That doesn't mean it's necessarily a good idea.
Hmm. Fair enough.
It was also a good exercise for adapting existing code to adafruit_ticks and putting it through its paces, so a learning experience for me
Also excellent.
Here is the notes document for Mondayโs CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if youโll be attending the meeting - itโs super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and weโll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1fsekWWLvcaMb7w6lfiDHqOjYbM38JgLOOxEjGdwh3A0/edit
CircuitPython Weekly for 2 August 2021 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 robin sorted by username. If you canโt make the meeting and would still like to participate, ad...
@florin-trutiu I don't see this board in https://circuitpython.org/downloads. It appears not to have been added there. Was this board ever produced? If so, could you add it? If not, should we remove it from circuitpython? Thanks.
Random question... How come the meetings are during business hours on a Monday?
- they are only during business hours in your timezone, 2. many circuitpython developers do this as their day job
Fair and fair
time is tricky
I guess "US business hours" would have been more accurate XD
It started as a a sync up between paid CircuitPython developers, and eventually morphed into a community meeting.
would have been easier if we didn't live on a spinning ball
So initially it was a work-related thing.
Ahh...
And was meant to be a sync-up for the week for us.
But folks started asking to listen in, and eventually we got others involved, etc.
shakes fist at job for taking that timeslot
So it stayed at the same time/day, since we still need to sync up, but turned into a community effort as well.
I'm more lucky in the fact my day job normally doesn't have meetings at the same time (knocks on wood)
We're on opposite sides of the US, so it needed to be a reasonable time for each of us involved in the beginning.
Sadly my job is being on the phones, so I don't really get any peace
It's in the evening for me, but I rarely have any energy left to join it.
every time would have its downsides
Energy hard... a precious resource
If any of the CircuitPythonLibrarians have a moment, I'd appreciate a review: https://github.com/adafruit/Adafruit_CircuitPython_Bundle/pull/332 Thanks!
@m-byte Hi - This board doesn't look like it's been added to circuitpython.org yet. If I'm wrong, sorry, otherwise please submit a PR to https://github.com/adafruit/circuitpython-org. If you are not going to produce this board, let us know, thanks.
@onyx hinge This works either way, but we went with the .git address for the .gitmodules file in the Bundle. Please update it at your convenience. Nothing else needs to be fixed along with it. https://github.com/adafruit/Adafruit_CircuitPython_Bundle/blob/094622fbd46b719e264cab2632f60ab97ca12ccf/.gitmodules#L841
@idle wharf I just copied the last one up
Woot! I'll look at it later tonight and see what sort of markdown magic I can work up
Are you referring to BLE HID? The device should only advertise if you have bonded another device already. The bonded device should be able to recognize the advertisement and reconnect.
So, kattni said that the "good first issue" tag isn't really well maintained for finding first issues... What's the best way to do so? Is there a way to see all pending reviews?
Could you put it in a proper html list? That'd make it easier to read I think.
Not sure I follow what you're asking. Well, I followed it up to the pending reviews bit, anyway.
When I'd asked about where to start, you said We're currently really bad about labeling "Good First Issue"s. So don't use that to pick something. We need to be better with that. So I wasn't sure how to best find reviews I could at least spellcheck or smaller issues I can grapple
Oh! You mean reviewing PRs. Those don't have the "Good First Issue" label, that's for issues only. In terms of reviewing, you simply have to go through the open PRs and take a look at them. In terms of issues, unfortunately, until we go through and curate better, the only way to find an issue to take on is go go through the issues and see what you speaks to you. Terrible answer, I know, but it's the state of things at the moment.
PRs aren't really labeled in terms of good first issue etc. If they're labeled at all, it's more to categorise the contribution than it is to assist reviewers.
@stonehippo and @nitz have added the other boards. I'd love to see consistent pin naming across the boards.
Ah, yeah, I meant PRs. Still getting used to terminology XD I've realized that my development skills are on an entirely different plane of existence than the dev work y'all have been doing
We all started somewhere! And I don't say that flippantly. Before July 2017, I had never touched programming or electronics.
So for PRs, you can take a look at the list here: https://circuitpython.org/contributing and basically go through the links one by one and see if there's anything on the level you're looking for, in terms of spellchecking or syntax etc.
Oh, 100%! I mean, there was a time when I couldn't build a computer, and now I'm the one everyone asks for help in life XD
Ok, cool. GitHub's pages were a little confusing XD I ended up on some branch and had no idea where I was
Yeah GitHub isn't the best way to go about it, which is why we aggregated it. We had to. We have 280 some libraries, trying to keep track of them all without our Adabot helper would be impossible.
Those links will take you to GitHub. But that's the best way to get there.
Thanks ^_^
8-6-2021 is the Snakiest day of the year and itโs also this yearโs CircuitPython Day! The day highlights all things CircuitPython and Python on Hardware. Working with CircuitPython? Tag your projects #CircuitPythonDay2021 on social media and Adafruit will look to highlight them.
@river quest posted & pinned in #help-with-circuitpython too
nice video, I never knew circuitpython was so easy to use
Ping for @Edrig:
Don't forget to add your board to circuitpython.org: https://learn.adafruit.com/how-to-add-a-new-board-to-the-circuitpython-org-website
Adds a board.LED to as many boards as possible. Sometimes this pin is also board.L, board.RED_LED, etc., but we're trying to make board.LED be as universal an experience as possible.
Adds a few other LED pins where they were found to be missing. (I looked at many schematics.)
Also adds whitespace on board files to make pin aliases more obvious.
Passing in a PWMOut still works but is deprecated. It will be
removed in CircuitPython 8.0.0
This also switches STM32 timer indices and channel indices to
0-based in our pin data rather than - 1 everywhere. The latter is
more bug prone.
Most of the way for #3264
Tested on Metro M0, Metro M4, Feather S2, Feather nRF52840, Feather
STM32F4 and Arduino RP2040.
You can add stm to the list of architectures this is occurring on. I've had this issue on local builds for 2 stm32f4 based boards (stm32f411ce_blackpill and stm32f411ce_blackpill_with_flash) since the weekend.
Hi hi, thanks for the improvements to autoapi! It looks like 1.8.2 broke our doc build: https://github.com/adafruit/circuitpython/runs/3167416491 The cause looks to be this input stub: class RoleEr...
PID request (not sure if there is a more "official" way to request these from SparkFun):
Remove gamepad for 7.0.0, but keep gamepadshift, marking it as deprecated. Supersedes #4940 and #5059.
Update frozen adafruit_circuitplayground to 5.0.0, which no longer uses `gamepad.
Alphabetize module names in ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk.
gamepadshift is now superseded by keypad.ShiftRegisterKeys, which lets you specify the number of keys.
Once this is added we can cleanup GamePad back into one class.
This part is now moot due to keypad.ShiftRegisterKeys, but the general idea is still interesting.
Update Spresense SDK to version 2.2.0.
Sorry I've been away from this for a while but I finally got around to https://github.com/adafruit/Adafruit_CircuitPython_MCP230xx/pull/41
A new version of sphinx-autoapi broke the documentation build. I pushed the fix that @tannewt did that is already in use in #5066 and #5068.
This looks fishy. @dhalbert is it possible your added commit reverted the spresense-exported-sdk submodule update?
This looks fishy. @dhalbert is it possible your added commit reverted the spresense-exported-sdk submodule update?
Yes, thank you. I forgot to update the submodules when I switched to this branch. Force-pushed a fix.
This looks good (not tested). I have about type annotation.
For now, before 8.0.0, should the type signature therefore be a Union? Otherwise people editing code using stubs from this may have complaints, I think.
It appears that sometimes this runs with micropython as the top level directory and sometimes circuitpython. I saw the duplicate PID/VID checker script fail with micropython, and then succeed on a rerun (!), so that's why I loosened the check. @kamtom480's fork is named micropython.
@tulip sleet an alternative: Find the top directory of circuitpython relative to the script -- https://gist.github.com/c63c05985bc41cd08cfe54e6f11d03a2
Feel free to push that. I'm still wondering why it ever failed at all.
@dhalbert noticed that if a fork was called micropython, theexisting check could fail during CI because it will be cloned into adirectory also called micropython.
Instead of hardcoding a range of strings that are OK as top directories, find the location of the top directory relative to the script.
This will be conflicty after #5069 is merged, but it should be easy to fix.
@tulip sleet sure, I didn't want to interfere further with that PR so I made a fresh one; I'll rebase it after 5069 goes in
remembers it's amazing to have CI at all .. just think how it used to be
i find pushing commits to someone else's PR to be a tricky business if it's not possible to do from github. The hint that git gives is not quite right.
it's true, I'm also gunshy about that.
@kamtom480 Thanks for this quick fix.
@jepler Thanks for spotting the issues in my commits.
This looks fishy. @dhalbert is it possible your added commit reverted the spresense-exported-sdk submodule update?
The recent addition of BusDevice on Proxlight Trinkey M0 (PR#5058) doesn't leave enough room for the traceback module.
It is the only board that is failing, what should I disable on it BusDevice or traceback?
BusDevice is more important on that board
we might find something else to remove later. I already added the tricky flag that turns off SPI
@tulip sleet Am I ok to merge ^^? You tagged Jeff and Scott on it as well.
@tulip sleet Regarding https://github.com/adafruit/Adafruit_Learning_System_Guides/pull/1642 - foamyguy did it this way in the CLUE code that was updated: https://github.com/adafruit/Adafruit_CircuitPython_CLUE/pull/48/files (or rather it was already done that way and he simply updated it to poll the button press), but my point is, is the while button: bit needed in the Pyloton code? Or is the single button press check enough?
I think the single check is good enough. It waits 0.1 seconds, which handles any bounces. Next time around the loop, if it's still pressed, the volume will be adjusted again. https://github.com/adafruit/Adafruit_CircuitPython_CLUE/pull/48/files replaces one while with another while. The Pyloton fix replaces an if with an if.
Right on.
Fine to merge. I would really like to have AND and OR for reviewers
thanks!
Done and done.
#5016 has returned for both variants of the constructor. (#4908 seems OK including with high frequency and 100% duty cycle.)
@lone axle You around for a max_glyphs question?
@lone axle Ok, so I'm using the MacroPad library. Which uses Simple Display Text. I can't find max_glyphs anywhere but I'm getting Please update your code: 'max_glyphs' is not needed anymore. when I run my code. What am I missing?
Is it buried in Simple Display Text or something and I missed it?
that would be my guess. Looks like the removal PR was merged: https://github.com/adafruit/Adafruit_CircuitPython_Simple_Text_Display/pull/4 but there hasn't been a release yet, so if you have the version from the bundle it probably still has max_glyphs in it.
Oh!!
That's why I can't find it.
I was searching on GitHub.
Ok, I'll do a release. Thank you so much! I was so confused.
I just did the same and was confused for a minute also ๐
OK, release made. Whew. Thanks again.
Oi.... downloaded a Project Bundle for the MacroPad library, and it downloads WAY more libraries than I expected. I am confused.
Oh ... wait.
checks a thing.
Ok found two of them. Still not sure where another one is coming from.
Oh nevermind. Wasted time. It downloads all libraries necessary for all examples present in the repo. Which includes the LED Animation example that Tim included 10 days ago. It's not based on a requirement, it's based on an example.
Ah, that is good to know. I didn't realize it included requirements for examples in addition to the library itself.
Only when you're downloading a project bundle that is embedded into Learn out of a library repo. Or potentially if you have multiple files in the same directory in the Learn repo. That's why we've switched to using folders with code.py in them, so it only includes the files you need. But we don't do that in library examples in the library repo. And I don't think we intend to start. So the Project Bundle for those examples will sometimes include things you don't need.
@onyx hinge This may be in your wheelhouse. Or not. https://forums.adafruit.com/viewtopic.php?f=60&t=181598
nope, "OV2640 SPI" is a different thing than what I've been working on @idle owl
Ah fair enough. I'm no help either.
somebody makes this product "arducam" that puts a microcontroller between you and the camera; you can talk to the microcontroller via spi and ask it to talk to the camera. beyond that I don't know much about this product
https://github.com/adafruit/Adafruit_CircuitPython_OV2640/issues/10 they asked a similar question over here, which I responded to & closed
Ah. Huh ok.
I did this deliberately to get folks using the new version. I think it's fair to not have stub support for deprecated types.
What do you mean by Bluetooth Beacon? Do you have an example product that does it?
BLE 5 does have extended advertisements that would support up to ~512 bytes IIRC.
This looks good. Thanks @jepler.
This PR implements CPython compatible traceback module.
I'm fine with your answer about the stubs. Will await possible changes to re-fix #5016, as @dmcomm noted.
- Only
print_exception()is currently implemented. I was considering implementingformat_exception()(only difference is that this returns a string) but ran into trouble with compressed strings%qspecifier. I am thinking of addingmp_sprintf()but haven't made any progress on that front yet. - Following args are ignored for the reasons given and are only implemented to maintain compatibility with
CPython.etype- FromPython-3.5this is ignored and is inferred from type o...
Tested by hand by trying the resolve code in a temporary script in tools/. Ready to rebase. Thanks!
Thanks for the test @dmcomm I think that issue is a race between setting a new duty_cycle and disabling the timer. I switched to using the gpio mux to control PWM output. Please let me know how well it works for you. Thanks!
Tested by hand by trying the resolve code in a temporary script in tools/. Ready to rebase. Thanks!
The pin seems to be an input where it was driving low previously.
@lone axle Good morning! Are you around for a question you may or may not have an answer to?
Nevermind, I fumbled my way through it.
@tulip sleet So.... stumbled upon the fact that you apparently can't import usb_hid without it trying to find some kind of connection. Which means you can't power MacroPad projects using the MacroPad library from a battery or wall plug because it fails with USB busy (I think that's the message, I can only see what's on the display). Is there a way around this? Can I check for whatever CircuitPython is checking for, and not import it if it's not present... or I'm tossing things out here, I have no idea.
i'll look at that, it should be innocuous just to import it
I did a demo that does not use HID. And it fails to run on wall power.
I'm guessing about it being usb_hid. Might be something else.
I need to give you the file, it's not on GitHub yet.
Yeah it could be..... but what?
I don't know how to troubleshoot it even.
Not very much serial console shows up on the display.
Macropad() does self._keyboard = Keyboard(usb_hid.devices). it's probably failing there
so check whether self._keyboard is None, and if it is, import that stuff?
Except if you called keyboard and keyboard_layout you'd call _keyboard twice and it would fail again.
you can do some kind of "is this the first time?" for .keyboard and .keyboard_layout,
you could still import all the keyboard stuff, just don't create the Keyboard() until you need it. You don't have to conditionalize the keyboard imports, though it would save space to import them only on demand.
like def _touch() in the CP library, for instance (it does not do conditional imports, just existence checking)
That's what I thought you meant.
I'm more fuzzy on exactly what it looks like. Committing what I have so I can git stash drop if I screw if all up.
Ok what I did at least lets the demo work.
Now to see if HID still works.
On my calculators, I've made it so the use of USB HID is postponed until the paste function is first used, but the way I did it is not necessarily a good one. Let me find a link to the source..
Seems to work!
need to try keyboard layout
Works!
Now to fix MIDI since it has the same issue.
tb- The__traceback__object is not exposed and is obtained internally;
however, if this is set toNone, traceback will not be printed, similar toCPython.
Is this parameter required in CPython? What will we provide in CircuitPython? Does it do the same thing in CPython? Would you mind providingn an example use?
The pin seems to be an input where it was driving low previously.
Ah! I should have thought of that. Should be fixed now.
Is this parameter required in CPython?
Yes, this is a required parameter.
What will we provide in CircuitPython?
As this is ignored, anything (i.e. Type: Any) can be supplied to the function call.
Does it do the same thing in CPython?
Yes, the current implementation is same as in CPython. The only difference is:
CPython- The traceback is obtained from the supplied traceback object.CircuitPython- There is no traceback object (i.e.Type: TracebackType)...
@tulip sleet Can you review this? It includes the lib change. https://github.com/adafruit/Adafruit_CircuitPython_MacroPad/pull/13
Is this parameter required in CPython?
Yes, this is a required parameter.
What will we provide in CircuitPython?
As this is ignored, anything (i.e. Type: Any) can be supplied to the function call.
Does it do the same thing in CPython?
Yes, the current implementation is same as in CPython. The only difference is:
CPython- The traceback is obtained from the supplied traceback object.CircuitPython- There is no traceback object (i.e.Type: TracebackType)...
Thank you!
I can enable __traceback__ and make it return 0 for now, this will make function calls exactly the same.
Bluetooth beacons are used for indoor navigation for blind and visually impaired persons.
Here are articles describing the functionality:
https://www.lighthouseguild.org/vision-health/a-hybrid-indoor-positioning-system-for-the-blind-and-visually-impaired-using-bluetooth-and-google-tango/
Great, I think everything is working on Pi Pico!
:+1: based on @dmcomm's testing.
@idle owl hey - i think you know this one? sphinx issue when you have single quotes in a docstring for trying to do code markup, just add more quotes or something?
Do you mean backticks?
yep
Yeah double on each side. Sphinx ignores.
so change a to a ?
meh...forget how to escape markdown here...
`a` change to ``a``
^^ that?
ah, yah, nvm, that's it...found an example in another lib
@idle owl got it. thanks.
Ah sorry. Yeah.
cp as a UART bridge:
import board
import busio
print("reading uart")
serial = busio.UART(rx=board.RX, baudrate=115200)
while True:
print(serial.read(serial.in_waiting).decode("ascii"), end="")
I was doing two things at once and didn't realise you were asking more questions. Glad you got it sorted!
@hathach the board we're building has a 32KHz crystal on it (https://www.digikey.com/en/products/detail/abracon-llc/ABS06-107-32-768KHZ-T/4291565) so I would presume we would be ok, but please let me know if that's not the case.
Yeah it's super obtuse. It tries to import or run the thing in single backticks, so you think it's an automock issue or whatever, or why is it failing on a docstring, etc.... Entirely unclear.
On ESP ctrl-c during fake sleep will now stop the sleep. A crash
on real deep sleep is now fixed as well. (Exception string saving
was crashing on reading the deep sleep exception.) Fixes #4010
This also fixes nRF fake sleep after the first time. The internal
variable wasn't being reset early enough. Fixes #4869
@slender iron If you haven't already, are you going to share the multi-status-pixel love with NeoTrinkey as well? I might have a guide or two to update with these changes. Not going to do that until 7 is stable though.
too bad the RGB LEDs are on I2C on the keybow ๐ฆ
@idle owl done
Thanks!
I wanted to add my findings to this. So I am having the same issues, running a circuit python app (specifically https://learn.adafruit.com/using-the-adafruit-funhouse-with-home-assistant ) the bigger issue I have is it seems to crash communications as well (or it is a leak that finally ends it) but usually my funhouse goes offline from a getting updates standpoint. I have tried both python 6 and 7. It seems to run longer when I run it on 7 but ultimately both crater.
<img width="706" alt...
I have tried both python 6 and 7. It seems to run longer when I run it on 7 but ultimately both crater.
@Loopbackconnector Just confirming, have you tried 7.0.0-alpha.5? #4793 was incorporated into alpha.5, but is not in alpha.4.
Does this still happen for folks? I can't replicate it now.
Does this still happen with the latest main?
I Just re-tested with the current main (commit e9369d5) built with
DEBUG=1. I had to reset
a couple of times, but my Feather nRF52840 Express did mount as CIRCUITPY
and get into the REPL.
However; it was in safe mode with the following message:
CircuitPython core code crashed hard. Whoops!
Attempted heap allocation when VM not running.
A subsequent reset then brought the board into normal operation. I will do
some more testing to see
if more info can be gathered.
On Wed, Jul 28, 2021 at ...
@dhalbert The version that I was running in that picture was alpha.4. I will update to alpha.5 to see how it goes.
See my comment in issue #5018.
On Wed, Jul 28, 2021 at 7:19 PM Scott Shawcroft @.***>
wrote:
Does this still happen for folks? I can't replicate it now.
โ
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/adafruit/circuitpython/issues/4768#issuecomment-888704256,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AFNJKEVQQDSPXAEGO2VVBYLT2CNARANCNFSM446MF2FA
.
I dont know for sure if it is due to crystalless or not. But I haven't got tinyusb running on L4 Discovery board, and didn't have time to look further at it.You could give it a try.
I'm working on a prototype customized keyboard using a Raspberry Pi Pico. This is a Japanese keyboard.
When the host is macOS, keycodes above 0x80 are not being sent or received.
Normal keycodes are sent to the host without any problem, and modifier keys such as SHIFT ALT CMD seem to work fine.
Normal keys with keycode 0x80 and above are not reaching the host.
When the same Pico is connected to a Windows host, all keycodes are received.
I noticed this when using KMK_Firmware as key...
The code in the library is not the problem, but there might be a problem in the default keyboard report descriptor, so I have transferred this issue to https://github.com/adafruit/circuitpython/. If there is a problem, it might be that MacOS is more sensitive to this than Windows. It is a signed/unsigned-value problem.
Could you try this UF2 and see if it makes a difference? Unzip it before uploading, of course.
[pico-kbd-report-desc-logical-maximum-fix.uf2.zip](https://github.com/adafr...
@hathach I have just noticed USB disconnects randomly while trying to debug some audio playback on RP2040. I am not doing MIDI. USB becomes disconnected, but when I reconnect, everything is fine (no crash). I will try to narrow this down later. Perhaps the USB interrupt handling is being starved or disabled due to some other operations. I am doing some DMA (audio and display).
@onyx hinge What became of the auto-generated CIRCUITPY-contents screenshots?
@idle owl They exist
How existential.
they are supposed to be updating daily, but I haven't checked lately if it's happening as planned.
Hmm. How do I know what I'm looking for though?
Oh I kind of see the naming scheme.
Can I use them?
Limor said they're "on pause". So I ended up downloading the image and uploading it directly from my computer for now. She wasn't clear on whether I should or should not use them...
where is the place that this should have been documented?
I have no idea.
really? hm
Wait
I do have an idea
in the ALS Academy guide
I mean current authors aren't going to look there intuitively
but we can post to Slack and email the team and let Anne know, and then everyone has a place to look.
If you know something she doesn't, please mention it on Slack.
I'd like to be using them, because if I had been, this py/pixelbuf update wouldn't have been necessary.
Would have been dynamic.
right
@onyx hinge Oh hmm. It's designed to work with Bundlefly specifically then? So to generate the image, it has to be a directory/code.py situation, not a bunch of files in the same directory - that only generates a single image for all of them?
I mean that's what I'm seeing, but I'm verifying with you.
yeah I think that is correct.
Ok I have to update the template code then.
Does it match what the zip contains?
There's no image for some of them at all. But they're a bunch of files in a single directory.
Some of them are near-pseudocode example though that you're supposed to adapt.
So I had them loose in the directory.
But I need images.
I'd have to review what it does, do you want to give me a specific example?
Um.... I think it's a me problem. I don't think we want to change how it works to deal with templates only.
When I should be able to adapt the template examples pretty easily to cause images to generate (in theory)
If not, it's not a huge deal, at least templates are a single point of failure for updates, versus a bunch of separate pages.
OK, if there's a specific .py file you thought it should have made an image for, and yet it didn't -- let me know
or where you think the content of the image is wrong
Seriously itching to update this template code to use rainbowio, but I would also have to put a warning in the template about using CircuitPython 7. I guess I probably shouldn't do that. Or I can put mangley try/except import blocks in. But it has to account for 6x, boards without _pixelbuf, and rainbowio. So.... super mangle. Bleh.
If it's template code, you could put in separate 6 and 7 versions of the code, and then later remove the 6.
since template code is just copy/pasted (if I understand this)
Eh, the templates are designed to be "tailored". And doing that kind of defeats that purpose.
Not exactly.
@tulip sleet what was the buffer issue you found?
The reason I want to update is right now it's a file on the Learning Guides repo where you have to update the PIXELBUF_VERSION in the code to match what the board has. If I used rainbowio I could embed it in the template and be done with it.
As it is now, every guide has its own copy of the code. It's annoying.
I'm ok if you want to get them all consistently named. We can say it's something changing with 7.
Too bad we can't backport rainbowio to 6.
thinking about removing the big red warning boxes from the displayio guide that say to use latest in the example section:
https://learn.adafruit.com/circuitpython-display-support-using-displayio/examples
thoughts?
Do it.
There are probably warnings I should also remove in places. But that's a whole other ordeal to find all of those. I'm in template land at the moment.
thanks. i'm in there now making some other updates from feedback. and noticed those. guessing very few people are using anything before 4.x these days.
One hopes.
https://github.com/dhalbert/circuitpython/compare/main...debug-audio#diff-7f2729ae33d8da45b91ced94cc11b8e78402c08a6bec0b894fb0ad10f2328a5c starting around line 235, The m_realloc() for the first buffer was never called if no conversion was necessary, so it first_buffer was NULL the first time, it reused the buffer from the WavFile reader as first_buffer, due to code at line 141 in that file.
It's not completely clear to me this is definitely causing problems, but it could cause as use-after-free issue, because the file reader would be unaware someone else was hanging on to that buffer.
It was suspicious because the code for first_buffer and second_buffer was not the same.
Also I just fixed a bug that 8-bit audio had half the samples removed, so, e.g. a 1-second sample played only for 0.5 second (buffer size was not doubled when converted)
output is still scratchy at higher sample rates when display is in use. Also the USB connection goes away randomly.
I saw that before. It is not a crash, just USB going away
the new code has some belt-and-suspenders checking in it to make sure we're not writing past the end of some buffers. I may remove that later.
I don't see signs yet that buffer filing is getting behind. I'm checking for both channels being unbusy and that only happens at the end.
๐
sounds like good progress
and a failure in me trying to prematurely optimize
also I did some checking to make sure the data in the buffers is not garbage, and it has the correct values (with my non-dithered square waves)
there's still a lot of "why is it doing that???"
still don't understand the scratchiness. I did Saleae the I2S output, but it's hard to check, and the Saleae parser is seeing what it thinks are errors due to clocking glitches (even if I deglitch the recording).
hrm
i will try Saleaeing the PWM output with clean square waves, which should alternate between two duty cycles
right
How are you getting the name of a BLE beacon? My impression is that they may simply advertise an ID that an app can lookup for a name. NRF Connect will list the contents of advertisements around you.
Why don't we make an empty Traceback object type and every exception can have its own. That way we can verify that the given __traceback__ is from the provided exception. I want to avoid cases where folks can provide values that are invalid in CPython.
Converting this to a feature request for CPython atexit module. We already have an issue open for print_exception() (#4748).
@slender iron where would the implementation of empty traceback object type go? py/objtraceback?
Hmm. I just realised the way I updated the pixelbuf implementation means that the bundler isn't downloading pypixelbuf anymore anyway. Meaning for the M0 non-express boards, there's no colorwheel available to 6.x CircuitPython anymore if folks don't specifically grab pypixelbuf from the bundle. NeoPixel and DotStar still work with pypixelbuf, but the Bundler isn't grabbing it anymore.
hmm, not sure how to fix that without adding some version-specific functionality to something
12 + hours after update and display still looks good!
I don't think it's worth fixing. I will update the four references to it in Learn to use rainbowio and update the templates to use rainbowio as well. I was going to update them to a try/except import block but realised there's no point for the M0 boards. There aren't any templates in M0 non-express guides yet anyway (that don't have _pixelbuf built in anyway....) I guess I could try except rainbowio and pixelbuf, leave off the pypixelbuf part.
@onyx hinge This is one of the instances: CircuitPython_Heart_Sculpture/code.py:3:import adafruit_pypixelbuf CircuitPython_Heart_Sculpture/code.py:16: pixel[0] = adafruit_pypixelbuf.colorwheel(hue)
I'll fix it, simply letting you know.
Yeah that's probably bad.
that's the image that gets generated
To have both.
@onyx hinge There's a guide for it right?
I'll add a 7.x warning to it.
Actually having both doesn't matter, but it never gets to pypixelbuf in neopixel imports. I guess you could still import colorwheel from it separately.
Maybe this is fine.
here's what I get from the bundler
dotstar imports pixelbuf now?
and of course I am using pypixelbuf directly, for colorwheel pixel[0] = adafruit_pypixelbuf.colorwheel(hue)
I think .. it's as good as it can be?
To leave it for now.
Yeah.
What I want to know is will the bundler grab pypixelbuf if the import looks like this: py try: from rainbowio import colorwheel except ImportError: try: from _pixelbuf import colorwheel except ImportError: from adafruit_pypixelbuf import colorwheel
Only one way to find out I guess.
It's ugly but I'm done making the same example over and over for each guide when it could be a single example in the template.
I don't know what it does in that case, and I'm also not sure whether it'll match what the image-maker gets since they are different bits of code
I do know how to run the image-builder locally so we could see..
I know we've done it elsewhere, let me find some place we do it, and check the associated image.
oh
That could also work.
it's better if you can check a zip file though
rainbowio is a built in module, though?
or is there a bundle / pure python version too?
hmm.
no
It's built in.
But I need something that excepts to a library
to see if the bundler grabs it
This is a really dumb way to do this.
I don't think I can test it.
Shrug.
Is this related in any way to Bundlefly, or is it a completely separate mechanism?
frustratingly, it's separate, so we don't know if they behave the same
Hmm ok
I assume that the bundlefly zip-maker is in the learn system somewhere, which is not on public github
Right.
I hope that at some level it's using similar code but we can't know for sure. it would be best if one program made the images and the zips, because then it would at least be consistent
Asking Justin instead of speculating and wasting time searching for an example in the monumental beast that is the Learning Guides repo.
@onyx hinge Turns out bundlefly uses findimports.
Or rather, "that's how we start building the dependency tree, the rest is via the json that is generated that defines the imports for each lib"
CircuitPython_Templates/status_led_one_neopixel_rainbow/code.py: could not find rainbowio.colorwheel
CircuitPython_Templates/status_led_one_neopixel_rainbow/code.py: could not find _pixelbuf.colorwheel
code:
_pixelbuf.colorwheel
adafruit_pypixelbuf
board
neopixel
rainbowio.colorwheel
time```
So, yes, it will work.
Perfect.
findimports is what the image maker uses too
@onyx hinge Excellent. Then there is much reason to believe they will behave the same.
@lone axle Is there a way to dynamically change the content labels to swap from white text on black to black text on white using https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_Layout/blob/main/adafruit_displayio_layout/layouts/grid_layout.py ?
Just flashed CP 7 alpha 5 to MacroPad, it's going to a "raw REPL", can't connect to serial with PuTTY and get "access is denied" -- did I find a bug?
Updating mine, hold on.
Or maybe it was already up to date.
Because I already downloaded alpha 5 previously.
And my code is still running.
Not sure what's going on there.
Hmm... Anything I can try?
So you start up and it automatically goes to the REPL?
After running the inbuilt Hello World demo
Anything on it you need to keep? I would try the nuke.uf2 on the CircuitPython page in the guide first, try flashing it, and then load CircuitPython again and see if it's still doing it. I mean, that's a burn it to the ground and start over plan, but it's not necessarily a bad one.
@storm minnow This: https://learn.adafruit.com/adafruit-macropad-rp2040/circuitpython#flash-resetting-uf2-3091244-20
I think you can access the objects inside the GridLayout using square brackets with index so something like
my_grid_layout[0].text_color = 0x000000
my_grid_layout[0].background_color = 0xFFFFFF
Would do it I think, though I've not tried it specifically.
Oooh. Ok.
index would be the order they were added I believe.
Hmm ok
I had just flashed CP for the first time, so no problem nuking. Just figured I'd share the oddity
a future enhancement might be to provide a function that allows accessing them via their x,y cell location within the grid though. That seems like it'd be more easily usable than index.
Yeah for sure! Thanks. Try nuking it first though and see if it's a corruption issue.
If not, perhaps it's a bug.
Yeah maybe. Otherwise you have to wrap your brain around the order in which you created them, which in my case is done in a for loop, so it's not all listed out individually.
Here's video of exactly what happens:
No problem :D oh, I had gotten into REPL once, but only once. Otherwise the 'raw REPL'
Hmph. I'm stumped, but that doesn't mean others wouldn't know what's going on better.
If there's no like, logs I can obtain from the board, guess I'll just nuke and see if it happens again
Not really yeah.
text_color doesn't seem to be changing. The background is though!
Ahh, I timed connecting to it IMMEDIATELY after resetting [while code was running] and it went to the normal "code done running"
Hmmmm.... reset again and no more raw REPL... very strange
ah whoops, I had the property name wrong. It should be just color instead of text_color
Yep I checked something else and saw that. Got it!
Well, I gotta go, but I'll nuke later and let you know if it happens!
Thanks!
I'll make an enhancement issue on GridLayout for the x/y cell location. That would be great functionality I think.
Brilliant. I used it in the Braille Keycaps code instead of the code PhilB wrote that generates all the shortcut labels and does a bunch of math to spread them out. So I'm trying to adapt it to having the MacroPad rotated 90 degrees. But displaying 4x3 shortcuts grid on the display is difficult in that orientation. So instead, I'm doing 2x6, and highlighting the shortcut when the key is pressed.
Ideally it would change the entire cell background. But it only changes the text label itself.
The way I generate the labels makes this work properly: py if key_event: if key_event.pressed: layout[key_event.key_number].color = 0x000000 layout[key_event.key_number].background_color = 0xFFFFFF
Yeah, I think for that we need a different type of Label object inside display_text. The current ones are sized entirely dynamically based on the text that they contain. We need one that allows itself to be resized to arbitrary sizes rather than basing it off of the contained text. I started working on one like that at one point but didn't end up wrapping it up enough to publish.
Ah fair enough.
That way the grid could control the size of the label to make it fill the cells.
Nice
I mean this still works pretty well.
I'm pretty happy with it. Not sure Limor will want a guide for it because it doesn't match the key layout exactly. But if I can come up with something, I'll use it myself.
@lone axle ^^
Each set of 4 is a row.
Doesn't actually do HID right now because I'm terrible about pressing things randomly if they light up on my desk, so I try to avoid leaving HID running if I'm not explicitly using it ๐
Nice! I had never considered using it at 90 degrees before but I do really like the way it looks now that I've seen it.
Right?! Display is easier to see, knob's there if you need it.
I like 90 best of all the rotations I think.
MacroPad library maps the keys and pixels, and rotates the display.
The pixelmapping was the worst part of that bit. What a beast.
@idle owl I wonder if you can fit dotted lines somehow to emphasize which ones are the groups of 4 .. is it the first 2 display rows are one physical row? (in any case, neat, it's nice that you can rotate the display during a program!)
I was wondering the same thing about delineating the groups.
do two of the groups in reverse video, then choose keycaps that are light/dark themed?
Top line is a label. The rest are grid layout.
you know more about that stuff than me
Not sure what to use to generate a line.
@lone axle Could you also make it so you can add lines between the cells? And the ability to specify only some cells having an outline?
Or is that bonkers ๐
display_shapes library or maybe vectorio can make lines I think. It would require a bit of manual placement to have them seperate the cells atm I think. I can look into providing that as an option within GridLayout to make it easier though.
That would be amazing. I don't mind manually placing things for now. I'll take a look at vectorio. Thanks!
Seems to only offer shapes, not lines. Hmm.
Maybe a rectangle with no height?
I have literally no idea how to use this.
lol.
TypeError: unsupported pixel_shader type```
Bleh, code runs, but nothing happens.
Have to run. Later!
Thanks for all the help getting the SPI version of the MC23XXX chips in! :)
Rectangle with 1 height for a line maybe, or maybe a polygon with just 2 points. I do think it would be great if there were some more example code for vectorio. Perhaps there is some out there that I am unaware of.
Maybe it would be good to add a section that covers it in the main displayio learn guide.
I can't figure out how to use it. There's no show() or anything.
I see the little Blinka, so it's not displaying anything.
IIRC you create your object either Rectangle, Circle, or Polygon. Then you add that object to a VectorShape object: https://circuitpython.readthedocs.io/en/6.3.x/shared-bindings/vectorio/index.html?highlight=vectorio#vectorio.VectorShape and then that VectorShape can be added to a Group in order to be shown.
but it's been a little while. I wrote some sample code at one point that is on one of my devices and I always have to refer back to it because I never managed to get it committed to memory yet.
Oh!
Add to a group.
Ok
I now have a blank spot, lol. So it drew something alright.
I don't get how to make it show up white.
Anyway I need to bail for the evening. Thanks for your help!
that looks a lot like you have some other software running on your computer doing something, are you using Cura for example ?
I do have Cura running in background, but it doesn't connect to anything on serial
it sure does, unless they fixed it
what if you quit it ?
though it usually manifests as M105 being sent to the REPL, not the raw REPL, it also manifests as the serial port not being available
I still have Cura running, but it isn't doing that raw REPL thing now
What is 'raw REPL' anyway?
it's like the REPL but for computers, tools like thonny use it
Ohhhh, so for software to have serial comms with CP devices? noice
it doesn't interpret what you type (like tabs as completion) and doesn't echo/output anything
it's ctrl-A, paste mode for humans is ctrl-E
Wonder what was kicking it into that before... Unless it was Cura, and it's just intermittent
some software hogging the serial port no doubt, did you look at the link above ?
(solution at the bottom is to disable USB printing in cura)
without any input from me it goes into the REPL after approximately 30 seconds. , and I see the following (transcribed, may be some minor typos) "Adafruit CircuitPython 4.0.0-beta.4-1-27-g67440acd3 on 2020-02-03; Adafruit CLUE nRF52840 Express with nRF52840 >>> raw REPL; CTRL-B to exit >
Hadn't gotten to the bottom yet XD I have a feeling it's not Cura, as I've got it sitting in REPL now and nothing is happening... And Cura isn't configured to print to USB at all
I wonder if it might be the pump...
I don't know, same exact issue and you happen to be running cura, I know where I put my 2 cents
Hmm, their pictures show regular REPL...
yeah I suspect on windows the use of the serial port is more exclusive, so once putty is running cura can't access it, on my mac I would see it output M105 while I'm in the REPL, might be a difference in the way screen or tio access the serial
it doesn't need to be configured too, it just hogs the serial ports, out of the box
Hmm
It stopped doing it randomly, even after PuTTY was closed/disconnected... And I haven't seen M105 at all
I love that bug repport: https://github.com/Ultimaker/Cura/issues/5207#issuecomment-741814775
๐คฃ Oh gosh that's beautiful
Thanks! I didn't test but I thing I was able to understand the motivation for the changes.
@jaunty juniper I'm disabling USB printing since I don't use it; should I ping you if it happens again later?
Dan-san
I tried UF2 and got the following error.
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
File "code.py", line 17, in <module>
File "/lib/adafruit_hid/keyboard.py", line 91, in press
OSError: USB busy
The code in code.py is the same as the first.
not me particularly, but whatever it is, I think it's most likely something using the serial port if putty says "access denied" (as opposed to not found or timed out), so look at what is running when it happens
Okie dokie Loki!
Print failure info was removed from Build CI in #4720... was this change intentional? https://github.com/adafruit/circuitpython/commit/446169e07869386cef9658d594bb3fbde56e94c8#diff-5c3fa597431eda03ac3339ae6bf7f05e1a50d6fc7333679ec38e21b337cb6721
This PR implements CPython compatible atexit module.
Not likely? Open an issue?
Hello, thank you very much for the invitation, I have a doubt I want the example that you created in python Adafruit_CircuitPython_RockBlock / examples / rockblock_send_text.py can be displayed in a window, I don't know anything about python, only the most basic thing, I would appreciate it a lot if it can be done
@tulip sleet Do you know who would know how vectorio works or is supposed to work? Because it is not working the way it feels like it should be, and I have no idea where to even begin.
WarrierOfWire started on it, and kmatch98 has also worked on it. I'm assuming you read the guide on it.
There's a guide? Ugh. I missed that.
I checked Learn....
Yeah I did check Learn. I didn't find anything.
sorry, I was mistaken about that -- I thought there was a guide (there should be, or more pages in the displayio guide).
Yeah that might be a good place for it.
But I'm not the one to do it apparently. Since I can't even figure it out.
there are a number of people who've used it in #help-with-circuitpython , and i've seen queries, so i think going there with a use case will help.
Alright, thanks.
i haven't used it at all, sorry
No worries. I didn't think you had, but I thought you might know who had. You did ๐
I use circuitpython.org filters to find boards for projects. I'm guessing others may too. I'm thinking of creating a PR for circuitpython.org to add a filter for a breadboard friendly feature. Defining bread-board friendly as two parallel pin rows with at least one breadboard socket available on both sides of the board. Horizontal pins could include UART/SWD, but not critical pins like power, ground, GPIO, etc. This would allow filtering out boards like the pyportal, magtag, funhouse, etc. Before I start researching all the current boards, is this a worth while idea?
@gilded cradle What do you think? ^^
It's a valid idea, I simply want to make sure we're not bloating the filter list to an unusable point. That's why I asked Melissa to weigh in. Please be patient and await her consideration. Thanks!
No problem. Completely understand the bloat factor.
Arduino-shape (e.g. Metro boards) is not breadboard friendly, but it's kind of its own breadboard. I wonder how you would characterize that. It's sort of purpose built vs general-purpose, but that's not very informative
same for Pi-shaped boards - not breadboard-friendly without an accessory, but "general purpose")
I was thinking boards that can plug into a breadboard for prototyping. I see your point on some boards being like a breadboard.
I'd guess the easiest way is a form factor class?
i saw a mention of "readinto" for ble no longer taking the nbytes parameter for CP 4. All later documentation seems to support nbytes. I am getting a "ValueError: length argument not allowed for this type" in nordic.py line 77 when i try to use "readinto" with ble...with buffer as a memoryview and as a byte array, with and without nbytes set implicity or explicitly. same code works for other streams (busio.uart, stdin).
there are "development" boards, meant for general-purpose use. That is an Adafruit shop category. But it includes CPX and other non-breadboardy boards
You'd also need to factor in distance between rows. There are some ESP8266 boards that are only useful by straddling across 2 breadboards.
so that may not be such a useful distinction
I considered that when defining breadboard-friendly as one socket available on each side, but assumed single breadboard.
@idle owl that sounds useful..
@uneven mango Figure out the best way to categorise things, and go ahead and make a PR.
And there also exist breadboards with a 0.6" center gap. radio shack sold them.
so "breadboard-friendly" or "breadboard-pluggable", also maybe "general-purpose" (for CPX), "Arduino form factor" (not sure about exactly what to call that)
Breadboard-Friendly sounds good
I think people would want to search for breadboard-friendly and arduino form factor. I don't know if "general purpose" for the board not meeting the other criteria would be searched for.
I'm thinking of mapping a project requirement to a board feature.
could you show the bad line with the error?
How about Arduino Shield Compatible?
Cause Arduinos are now all sorts of form factors
sorry i deleted message here beccause i reposted on the CP dev channel. here is the snippet
byte_count = device.readinto(memoryview(in_buf)[start_ptr:])
that is a slice, not sure if it's supported in general in that kind of context (does slice have buffer protocol)
what kind of object is device
is this in CircuitPython or bleio blinka?
Remove duplicate ENDCHAR that made it invalid. Was trying to get ยป on my MacroPad screen, and a BDF viewer says it should be in the font, but the bdf2pcf thing said error on 6450 where that dupe was. (Now it says "Error on line 25220: more characters than specified" but I don't have a fix for that yet.)
Actually you can remove the last character to get it to go through bdf2pcf. Not sure why it needs that though.
Question while people are awake: If I were to want to enable support for a board variant (same PCB, just a uC with a different amount of ram), would it be best approached as a compile-time option or a new board definition?
device in the error case is UARTService()
i also tried with a "bytearray" which i thought was a valid buffer type. same error.
@spiral elk do you actually need a board definition for this? different LD file?
just a different ld file mainly
which chip?
that is a different board, since the CPU is different (and especially since STM differences are quite idiosyncratic). If this is a one-off, then you can keep your own fork for this. If it's a product, then we can consider a board defn.
CP on Nordic Itsybitsy
I am not sure if we want to have board defns for the huge array of cheap-o BlackPill clone variants or not
Well, this board isn't a clone, its from the original manufacturer
the chips are enough different (from a search): _
The STM32F411 is backward compatible with the STM32F401 and should run your code for the STM32F401 without any modification.
The STM32F411 has a few additional features, so if you use them, your code will not work anymore on the STM32F401.some diferences:
new peripheral (SPI5) higher maximum frequency (100MHz instead of 84MHz) and differend voltage scales configuration larger SRAM Additional peripheral pin mapping for flexibility and for new peripherals Additional DMA remap for flexibility and for new peripherals
looking...
@spiral elk so definitely a new board definition
I think most of that is abstracted away in the STM HAL isn't it if MCU_<mumble> is conditionally set?
@tulip sleet yes boards are largely defined on the MCU they hold so the F401 blackpill should get a new def
thx!
@spare prawn I think it is just a bug in Adafruit_CircuitPytyhon_BLE. It should no longer take a length. Could you open an issue? Does plain read() work for you in this case?
The blackpill also has "versions" where you add external flash but we didn't opt to make different profiles for that
@spiral elk just copy the og blackpill profile pretty much wholesale and swap out for the LD file we already have for the F401
and change the MCU flags ofc
Yeah, I have already done that and got it pretty much up and running already.
plain read worked before in other code..i have been refactoring to generaliize and trying memory view to improve performance...what i have works for other serial devices, just ran into this issue. i will now work to refactor for this case or just revert i guess.
@spiral elk nice, if you PR it I'll approve quick
Needs some cleanup, not sure if I can get to it this week.
honestly, I don't remember why it was removed
the issue will make us re-examine that decision
can you point me to where the error message is generated? i tried to find it past nordic.py and could not find it.
I think it might be in _bleio.CharacteristicBuffer, but the complete backtrace should tell you
@spare prawn Please include the complete backtrace in your issue and also more context for the code, thanks. You can edit the original post
what do you mean by "complete" backtrace? is this suffiicient:
File "lib/metre/gAsynco.py", line 394, in _wrapper File "dev.py", line 234, in serial_task File "adafruit_ble/services/nordic.py", line 77, in readinto ValueError: length argument not allowed for this type
I think you'll want to have this in the MP_STATE so that it gets collected on garbage collection so it isn't freed. Doing it as a global risks the gc freeing the memory you need.
Thanks for this! I have a couple questions inline.
I think you'll need to call this in the REPL too. This is only used for executing a file I think...
How does this handle multiple register calls? I think this call will just allocate one callback.
CI failure was due to network issues. Merging anyway.
@spare prawn if that's in, then that's it. I thought it would go deeper, but they way it works is tricky
@tulip sleet ``` def readinto(self, buf, nbytes=None):
"""
Read bytes into the buf. If nbytes is specified then read at most
that many bytes. Otherwise, read at most len(buf) bytes.
:return: number of bytes read and stored into ``buf``
:rtype: int or None (on a non-blocking error)
"""
return self._rx.readinto(buf, nbytes)
// CPython extension: if 2nd arg is provided, that's max len to read,
// instead of full buffer. Similar to
// https://docs.python.org/3/library/socket.html#socket.socket.recv_into
mp_uint_t len = bufinfo.len;
if (n_args > 2) {
if (mp_get_stream(args[0])->pyserial_readinto_compatibility) {
mp_raise_ValueError(MP_ERROR_TEXT("length argument not allowed for this type"));
}
len = mp_obj_get_int(args[2]);
if (len > bufinfo.len) {
len = bufinfo.len;
}
}
It seems that either that `readinto` needs to avoid passing `nbytes=None`, or the core code should treat `nbytes=None` like it was unspecified. I don't know which is more python-compatible. (`if (n_args > 2 && args[1] != mp_const_none` or so)
i think this is due to CharacteristicBuffer or something like that. I don't remember why it was removed.
thanks for that pointer. I poked around and it looks like it might be a bug...i put some clues into the Issue.
oh, i just saw @onyx hinge did the same thing...sorry missed that.
I just tested changing the line 77 in nordic.py to return self._rx.readinto(buf). and it appears to have fixed the issue.
should I just go ahead and add it back?
RP2040 and SAMD51:
- Detect when DMA has finished, and stop DMA audio explicitly.
- Do not accidentally reuse
first_buffersupplied by WaveFile or RawSample. Always reallocfirst_bufferandsecond_buffer
RP2040:
- When audio playing is stopped, write a final zero to the output register. This prevents residual PWM tones.
- Handle buffer size for 8-bit samples properly for 16-bit output.
- Fail on some edge cases (which may not be possible at the moment).
I don't think this fix...
@slender iron unless you had some reason for removing this, I think we should put it back?
Its regarding removal of Print Exception Info from CI. ๐
I was looking for it while trying to debug atexit test failure.
@kattni please try with the macropad demo you made to play audio clips and see if you're getting reasonable playback :)
@tulip sleet Can you get me a build of the audio fix PR? CI is still going to be ages and I don't work that much longer today.
For MacroPad.
@slender iron so the project that I'm worried about leaving dangling here is the whole "system reservation in sleep memory" thing, so that stuff like next_file can store information across deep sleep. I got decently far with it, (implemented deep sleep memory on STM32, created the API, had it compile and some basic tests working) but I've been bogged down in the debugging and haven't been in the right headspace to finish it with everything else going on.
Ah, I might have copied micropython's change for it.
Is it ok if I put it down and come back to it informally later on? Should I post up what I have for someone else to pick it up? I could filter out the STM32 sleepmem stuff into a separate PR
I think it's best to file an issue and then link to your WIP branch
that way it doesn't sit as a pending pr
Ok, that sounds good to me
๐
This does not have the clock fix I gave to foamyguy, but it does have the audio fixes
@tulip sleet Thanks.
Wav files are still super crunchy ๐ฆ
I used play_file from the MacroPad library.
what is the sample rate?
