#circuitpython-dev

1 messages ยท Page 411 of 1

jaunty juniper
#

I was mildly confused by the mix of #ifdef DEBUG and #if DEBUG in the code but the second one doesn't compile so that's easy. (And poor CIRCUITPY_DEBUG only used once)

slender iron
#

thank you!

tulip sleet
#

it's the old LISP programmer in me

slender iron
#

๐Ÿ˜„

#

(()((())((())))) (or is that scheme)

#

@tulip sleet is your magtag handy? I've got a fix for the speaker enable

tulip sleet
#

sure, let's try it

slender iron
#

I'm lazy and only tested that it compiles

tulip sleet
slender iron
#

๐Ÿ‘

tulip sleet
#

I am just running a sleep every few second program

slender iron
#

it's a simple change so it should be fine

#

I changed the ESP32S2 TFT stuff too

#

this simplifies it

tulip sleet
#

excellent

manic glacierBOT
tulip sleet
#

@slender iron I am going to restart the build. CI is not doing very well.

slender iron
#

which build?

#

6054 is almost done

tulip sleet
#

your pin-reset PR 6057 had two CI failures

slender iron
#

kk

manic glacierBOT
tulip sleet
#

7.2.0 milestone 100% complete, after triage on Monday and fixes since then

manic glacierBOT
tulip sleet
#

@proven garnet if you leave out the Python>=3.7.0, what kind of error do you get when adafruit-blinka>7.0.0 can't be satisfied? I wonder if it's worth bothering with the Python prereq or not

#

if it's clearer specifying the python version, that's probably better

manic glacierBOT
#

Ok I played with the new SAMD alarm features implemented in this PR.

  • [x] power consumption is on-par with what I was measuring with my initial samd Alarm implementation. Tested deep_sleep_until_alarms with TimeAlarm, PinAlarm and both at once.
  • [x] alarm.wake_alarm still properly distinguishes between time and pin alarms.
  • [x] max deep sleep timealarm is still ~1500 days since prescalar is still 1024. That's good, thanks for not changing this.
  • [x] fake deep sleep still wor...
proven garnet
tulip sleet
#

I tried to install an old version of python to check, but I'm using ubuntu 22.04 and the deadsnakes ppa doesn't have builds ... it was late, so I gave up

#

not a really big deal

proven garnet
#

Hmmm, I'll check and post. My guess one fails just slightly earlier than the other haha

tulip sleet
#

i am mostly interested whether one is more obvious to the novice user, that's all

#

ok, good night! thanks for all the work!!

manic glacierBOT
manic glacierBOT
#

[2] It is an empty function by default. In Wio Terminal, the hook function is used to turn off RTL8720 coprocessor. (RTL8720 is enabled on board reset, and draws considerable amount of power.)

Did you try using board_deinit for this? I think it's meant to be used in the same way.

You are right. I'll try to move the hook stuff into board_deinit.

The board_deep_sleep_hook was intended to be called only before true deep sleep, because the touched pin is left dirty on wake up ...

#

@tannewt Sure I'll kick the tires on this PR tonight.

@t-ikegami your comment adding edge support for PinAlarm reminded me of this SAMD5x errata. Did you run into this? <img alt="" width="400" src="https://user-images.githubusercontent.com/29153441/154559182-16533ef8-e47f-46fd-a426-d34bdd3edab6.png">

I have tried to check the errata condition, by using a Wio Terminal in hand and PA02 pin. As far as wake up from BACKUP sleep is concerned, the tamper pin interrupt is triggered only...

#

@tannewt Sure I'll kick the tires on this PR tonight.

@t-ikegami your comment adding edge support for PinAlarm reminded me of this SAMD5x errata. Did you run into this? <img alt="" width="400" src="https://user-images.githubusercontent.com/29153441/154559182-16533ef8-e47f-46fd-a426-d34bdd3edab6.png">

I have tried to check the errata condition, by using a Wio Terminal in hand and PA02 pin. As far as wake up from BACKUP sleep is concerned, the tamper pin interrupt is triggered only...

#
  1. It seems to me that your board_deep_sleep_hook() should really be done by the user in software (i.e. CP). If you want things turned off during deep sleep, that should be performed in software before calling exit_and_deep_sleep_until_alarms right??

Unfortunately, cleanup_after_vm is called befre deep sleep, where pin states are reset. Actually, I first tried the scheme, and got surprized that the power consumption bumps up in deep sleep.

main furnace
#

What would replace secrets.py? A .json file perhaps? Would it be something 'encrypted at rest'? A first estimate at the work involved includes:

  • Write code to retrieve keys etc. from the new secret store (medium)
  • Update the learning guides (large)
  • Update libraries that currently use secrets.py (medium)
  • Update applications that directly use secrets.py (??)
    (stretch goal) Add tools to manage secret store.
proven garnet
#

(Using Python 3.6.0) Currently it will download BusDevice v5.1.5 and Blinka v6.15.0, so it won't fully update BusDevice to v5.1.6. That means, it doesn't pick up circuitpython_typing because that requirement is only in BusDevice v5.1.6 so it gets that cryptic I2C error. But I can't tell if it would be any clearer, because I can somehow run setup.py with 3.6 and it doesn't throw a fit.

manic glacierBOT
#

I'm now a bit confused. There are signs of LOAD_ATTR_FAST_PATH in main, which is enabled by default, but no supporting code for it. So this has become enabled during this merge of v1.18 -- see 53c5bde9246853f8968ca299afebcbbc11d1f370. I can go ahead and enable the cache on FULL_BUILD targets; it costs another ~264 bytes of code and 128 bytes of RAM.

onyx hinge
#

@blissful pollen hey two questions .. which microcontroller were you using with your natmod shennanigans, and did you have a gist or something with the code in it?

blissful pollen
onyx hinge
#

It looks like micropython / "the core" don't have support for the M0+ of the RP2040, which is where I was excited about the idea of loading native code. bummer!

blissful pollen
#

It has support for the M0 though right? I hadn't tried but if the arch setting is different but compatible may be able to just add a new arch string to match the M0+

#

But that was just a guess I never tried

onyx hinge
#

Thanks, I'll take a look. it's set up so you just have to "make" and get the .mpy file?

blissful pollen
#

Should be, worked for me. The code.py has some AHRS code in python (from my community bundle) but you can remove that. Was just to compare

manic glacierBOT
#

I noticed that the size of uzlib is 3232 bytes when built as an extmod for armv7m. This made me curious, as a ballpark figure would we be better off in terms of code size zlib-compressing the messages.

zlib-compressing messages individually is not going to work as well, but compressing the concatenation of all messages + offsets to find each message in the decompressed string could work.

Currently we have (numbers for adafruit_rotary_trinkey_m0, russian translation):

  • total mes...
proven garnet
#

A colleague of mine pointed out that there's not a displayio graphing library, is that true? I'm tossing around doing something like that but wanted to check before diving in.

manic glacierBOT
main furnace
#

Can you expand on 'graphing library' -- you want charts and graphs?

lone axle
# main furnace What would replace `secrets.py`? A .json file perhaps? Would it be something 'en...

a secrets.json file does seem like the easiest thing to replace it with to me. Perhaps more difficult would be figuring out a way that Environment variables could be used or mocked on CircuitPython devices. My understanding is those are the best practice for secure credentials and things in CPython projects. That would mean code could ultimately be shared between CircuitPython and CPython in a more standardized way.

I don't think it should be encrypted at rest by default. It would more secure, but also more complex for new users. Maybe it could be added as optional?

Your list of steps look correct to me. The one thing I would add is that it will probably be good for libraries to continue supporting secrets.py in addition to the new way for a while so that everything does not break immediately and people have time to update their projects.

I think starting in the libraries and adding the new way as an option is probably a good first step so that the other things be updated more gradually.

lone axle
manic glacierBOT
solar whale
tidal kiln
#

@solar whale thanks!

solar whale
#

I downloaded it and updated all the libs and it seems to work OK with a few changes as noted in the forum.

proven garnet
tidal kiln
#

@solar whale double thanks for checking. so luckily nothing has changed since 5.x to break the old code.

lone axle
# proven garnet Oh sweet thanks! I'll take a look and figure out whether what I'm think should ...

New features to that widgets really should get submitted over in the CircuitPython org repo: https://github.com/circuitpython/CircuitPython_Org_DisplayIO_Cartesian

We originally added a few widgets to that Layout library, but decided that they should live in their own repos and can go in the CircuitPython Org. So if you end up making a different typing of graphic widget it could get it's own new repo in the CircuitPython org as well.

lone axle
#

Eventually the widgets that aren't layouts can get removed from DisplayIO_Layout library.

proven garnet
#

thumbs_up_parrot Sounds good to me!

blissful pollen
#

@lone axle just a FYI that I haven't forgot about the decompression stuff and hope to start on it later today, this week has been busy

lone axle
#

Sounds good, happy to have you take a look whenever you have time.

idle owl
proven garnet
#

So this?

#

Thanks again kattni!

idle owl
#

You're quite welcome! Thank you for joining the review team!

proven garnet
#

@lone axle I see that the first repo and the second one aren't the same for Cartesian, should I cherry-pick the commits into the one under CircuitPython?

#

In particular it looks like the first one has functions for plotting actual lines

#

Didn't know if the difference was intentional or not

lone axle
mental nexus
manic glacierBOT
#

What I'm suggesting is, there'd be a single zlib stream which simply concatenates all the messages: c becomes "%q in useDivision by zeroNot Implemented". And lengths gets content like [9, 16, 15].

Now, say you need to print message 2. You start decompression of the single stream. Discard 9 bytes from the stream, then discard 16 bytes, then output 15 bytes, since you need to skip over the initial messages.

It's gloriously inefficient but I think it could work.

proven garnet
#

@lone axle @mental nexus I'm happy to merge main from DisplayIO_Layout into main CircuitPythonOrg if that should be done, then the changes you're working on @mental nexus shouldn't need to get altered at all other than perhaps then the upstream repo I don't think

winter mortar
proven garnet
#

And thanks for letting me know about those features, those look like awesome ones! Looks like you've got auto-scaling on the list, the other one was filling area under graphs (integral). I can add it and see if I can potential submit a PR for it if I can crack it ๐Ÿ™‚

#

Oh, it seems the files are not as 1:1 as I thought they might be ๐Ÿ˜…

lone axle
# winter mortar What problem is replacing secrets.py meant to solve? (Sorry that I'm missing the...

The way that you get data from the secrets.py file in circuitpython is by using imports like from secrets import secrets But "normal" CPython has a build-in module that is called secrets (https://docs.python.org/3/library/secrets.html) so in CPython you import that built in module with import secrets The names collide so if we ever wanted to have a subset of the CPython module secrets in CircuitPython we would either have to choose a different name for it (thus making code less shareable between the two), or have already migrated away from using secrets.py for storing credentials so that the name would be free to be assigned to the built-in module.

lone axle
proven garnet
#

I don't know if I can do it through git, or at least easily, it does look like it should merge clean via PR though upon looking at everything. I can merge them in one big commit and run the example tests to confirm

mental nexus
lone axle
#

Yep I think we can migrate the issue.

lone axle
proven garnet
#

โœ‚๏ธ FlexTape

#

Should have something shortly!

idle owl
#

@proven garnet Hey! Are you up for doing a few more releases? I have three other repos that could use one.

proven garnet
proven garnet
lone axle
slender iron
#

@tulip sleet are we ready to branch 7.2 and do the 1.18 merge?

proven garnet
proven garnet
manic glacierBOT
tulip sleet
slender iron
#

kk

idle owl
lone axle
manic glacierBOT
lone axle
slender iron
#

yup!

manic glacierBOT
slender iron
#

@lone axle how does march 4th sound as my last stream where we can chat if you have time

idle owl
#

Done! ๐Ÿ™‚

ornate breach
#

I love it

lone axle
idle owl
#

There's a bunch more, but I wanted to pass that one on since you came up with it.

ornate breach
#

It captures what I was thinking so much more than I could describe

idle owl
#

He does that every time!

ornate breach
#

Hats off to Bruce

idle owl
#

I always try to describe what I'm looking for and he always comes back with something better.

ornate breach
#

Yeah, all his blinka work has been amazing and all the other graphics too

#

I think those stickers should go out with CPX kits sold to schools. Imagine a student opening and the first thing is blinka greeting them in their first step

idle owl
#

Blinka is pretty great ๐Ÿ™‚

manic glacierBOT
proven garnet
#

Ran into a similar "typing causing import issues" on the PR, basically it looks like adafruit-display-text can't import fontio which I don't think (?) has a Blinka equivalent, so the import fails in the typing block. Is this something that should go into a library like circuitpython-typing?

tulip sleet
proven garnet
#

Oh, good call!

tulip sleet
#

but I'd think we need fontio for adafruit-blinka-displayio ?

proven garnet
#

Ahhhh so it does exist, just needs to install it

tulip sleet
#

it is in adafruit-blinka-displayio.

#

yes, so sounds like a forgotten dependency

manic glacierBOT
#

2. @tannewt can you confirm that CP doesn't need/use that address space? BKUPRAM starts at 0x47000000 per samd51j19a.h

I don't believe we do. Sleep memory is the best use of this space anyway.

Unfortunately, cleanup_after_vm is called befre deep sleep, where pin states are reset. Actually, I first tried the scheme, and got surprized that the power consumption bumps up in deep sleep.

My intention was that board_deinit would be used to put things in a low power state.

You can...

jaunty juniper
#

ugh I'm encountering PWM issues with a NRF52 board, confirmed on other boards, except the feather I updated to latest bootloader a few months ago (I believe it's a matter of the version of softdevice)

tulip sleet
#

"confirmed on other boards" you mean other nrf52 boards?

jaunty juniper
#

I'm trying to add the status LED (which is PWM) on the Xiao NRF52, and I noticed that the PWM are not properly released on reload, making it run out of timers after a few reloads

#

I confirmed the same issue on the Clue

#

but not on the feather I updated

tulip sleet
#

there was a bootloader bug that didn't load large UF2's, I think, but that usually just caused crashes

jaunty juniper
tulip sleet
#

the softdevice version is in INFO_UF2.TXT

#

what is the version of the bootloader on the Xiao

jaunty juniper
#

hmmm the Clue says UF2 Bootloader 0.3.0 lib/nrfx (v2.0.0) lib/tinyusb (legacy-1500-g23df777b) s140 6.1.1 but the latest bootloader is 0.6.3 not 0.3.0

#

oh the Xiao is

UF2 Bootloader 0.6.2 lib/nrfx (v2.0.0) lib/tinyusb (0.10.1-293-gaf8e5a90) lib/uf2 (remotes/origin/configupdate-9-gadbb8c7)
Model: Adafruit Feather nRF52840 Express
Board-ID: nRF52840-Feather-revD
SoftDevice: S140 version 6.1.1
Date: Sep 10 2021
tulip sleet
#

0.3.0 is past 0.2.9, which I say I tested and fixed the #5397 problem (not that i remember very well)

jaunty juniper
#

ok, maybe the bootloader version is a red herring

slender iron
#

@runic crest it looks like the usb on the zync is the same as the imx rt. so it should be easier to get tinyusb going on it

tulip sleet
#

does the xiao use a neopixel?

jaunty juniper
#

I hadn't checked the version on the Xiao, I was first on the track of updating the Clue for comparison

tulip sleet
#

I could believe the rgb status code is not freeing something properly

jaunty juniper
#

it's a PWM LED

tulip sleet
#

so certainly not as well tested

jaunty juniper
#

but it works on the Tiny2040, with which I can't repro the issue

tulip sleet
#

is there some extra code in board.c for the Tiny2040?

#

is that also a PWM LED?

jaunty juniper
#

no, all seems the same

#

oh wait, but it's not related to the LED, this code:

pins = [board.D0, board.D1, board.D2, board.D3, board.D4, board.D5, board.D6, board.D7, board.D8, board.D9, board.D10,]
pwms = []
for pin in pins:
    print(pin)
    pwm = pwmio.PWMOut(pin)
    pwms.append(pwm)

gives me:

Adafruit CircuitPython 7.2.0-alpha.2 on 2022-02-11; Adafruit CLUE nRF52840 Express with nRF52840

board.P0
board.P1
board.P2
board.P3
board.P4
board.P5
board.P6
board.P7
board.P8
board.P9
board.P10

Code stopped by auto-reload.
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Hello World!
[board.P0, board.P1, board.P2, board.P3, board.P4, board.P5, board.P6, board.P7, board.P8, board.P9, board.P10]
board.P0
board.P1
board.P2
board.P3
board.P4
Traceback (most recent call last):
  File "code.py", line 16, in <module>
RuntimeError: All timers in use
#

I noticed the effect when testing the status LED, I had a rainbow code.py to test that the pins were not reserved, after a few reloads I had all timers in use

#

but the code above is on the clue

tulip sleet
#

I think that is "just" a CircuitPython bug.

#

we are not doing resetting some internal bookkeeping on VM restart we should be resetting

jaunty juniper
#

I'll open an issue

crimson ferry
#

I saw similar crash on finding UART pins on an Espressif (a not very useful exercise anyway since it should yield TONS of combinations)

#

oh, I misread your output, thought it was a crash

stuck elbow
#

there is a similar problem on the stm32 port

jaunty juniper
#

I was having a crash too on the xiao, but I think that one was related to the status LED

proven garnet
#

Are dictionary keys normally ordered in CircuitPython?

manic glacierBOT
#

Running on a Clue, I get "All timers in use" error when using PWMOut after a few reloads.
I originally noticed that on the Xiao NRF52 using adafruit_rgbled, and reproduced it on a Feather NRF52.
Couldn't reproduce on other ports.

This code takes 4 reloads to error. Less if more pins are used.

import board
import time
import pwmio
pins = [board.D0, board.D1, board.D2, board.D3, board.D4,]
pwms = []
for pin in pins:
    print(pin)
    pwm = pwmio.PWMOut(pin)
    pwms.append...
tulip sleet
#

maybe not -- it's like other existing bugs

slender iron
#

Just got up for lunch and a quick walk. Will get to it once Iโ€™m back to my desk

lone axle
# proven garnet Are dictionary keys normally ordered in CircuitPython?

AFAIK dictionary keys are not guaranteed to be in any particular order in either CPython or CircuitPython. In CPython I think there is a seperate OrderedDict class which can be used if you need the keeps to keep a specific order, unsure if we have something similar in CircuitPython.

tulip sleet
#

that is NOT true in MicroPython/CircuitPython. There was some angst about this in MicroPython when the decree came down'

lone axle
#

Oooo neat, for a few years now even. I am behind the times.

tulip sleet
proven garnet
#

Thanks!

tulip sleet
#

@slender iron i will start working on release notes

slender iron
#

thank you!

blissful pollen
#

Just a quick check generally shared-bindings will do the argument checks and anything else? and then pass it to a common-hal function (even if it is shared in shared-module). Am I missing anything?

slender iron
#

argument checking and conversion

blissful pollen
#

Thanks, looking at the uzlib stuff and just want to make sure I separate it correctly

manic glacierBOT
#

With both performance knobs turned to "go fast", a little loop on rp2040 became nearly 20% faster:

import adafruit_ticks

class K:
    def __init__(self, v):
        self.v = v
        
def main():
    k = K(7)
 
    t0 = adafruit_ticks.ticks_ms()
    for i in range(1000*100):
        k.v
    t1 = adafruit_ticks.ticks_ms()
 
    dt = adafruit_ticks.ticks_diff(t1, t0)
    us_per_loop = dt / 100
    print(f"{dt} ms for 100,000 loop = {us_per_loop} us/loop")
    
main()
...
uneven mango
winter mortar
uneven mango
# winter mortar Yes. You can set the timeout to 0 so it's non-blocking.

I thought about that, but timeout=0 throws an Exception: ```
6912.975: DEBUG - Sending CONNECT to broker...
6912.976: DEBUG - Fixed Header: bytearray(b'\x10.\x00')
Variable Header: bytearray(b'\x04MQTT\x04\xc2\x00<')
6912.984: DEBUG - Receiving CONNACK packet from broker
6913.006: DEBUG - SUBSCRIBING to topic office/rgb_lighting with QoS 0
Traceback (most recent call last):
File "code.py", line 161, in <module>
File "adafruit_minimqtt/adafruit_minimqtt.py", line 805, in loop
File "adafruit_minimqtt/adafruit_minimqtt.py", line 823, in _wait_for_msg
MMQTTException:

Code done running.```

manic glacierBOT
#
[adafruit/circuitpython] New branch created: 7\.2\.x
winter mortar
manic glacierBOT
#
[adafruit/circuitpython] New tag created: 7\.2\.0\-rc\.0
tulip sleet
#

Note that 7.2.0-rc.0 is on the 7.2.x branch, so PR fixes for the 7.2.0 release should be against that branch.

#

Release announcement and circuitpython.org push will be later tonight, after several hours of builds finish.

uneven mango
orchid basinBOT
blissful pollen
#

Looking for suggestions on this. Modified from extmod/moduzlib.c. I am getting a "error: cast increases required alignment of target type [-Werror=cast-align]" error. The original MP code is using the pointer math to find the MP object. The compiler is (rightfully) worried that this may then miss the alignment.

    mp_obj_base_t base;
    mp_obj_t src_stream;
    TINF_DATA decomp;
    bool eof;
} mp_obj_decompio_t;

STATIC int read_src_stream(TINF_DATA *data) {
    byte *p = (void *)data;
    p -= offsetof(mp_obj_decompio_t, decomp);
    mp_obj_decompio_t *self = (mp_obj_decompio_t *)p;```

Outside of changing the uzlib library to include a reference to the MP object not sure how else to handle this.
#

The TINF_DATA object passed to read_src_stream is the same one that is stored in the mp_obj_decompio_t. Hence the sorta hacky way to find the original MP object

manic glacierBOT
manic glacierBOT
manic glacierBOT
#
[adafruit/circuitpython] New tag created: 7\.3\.0\-alpha\.0
#

The fix in #6033 to use git describe --first-parent ... does not quite work when there is a tag.
https://github.com/adafruit/circuitpython/runs/5254687864?check_suite_focus=true#step:7:151

tools/describe does

~/repos/adafruit/circuitpython$ git describe --first-parent --dirty --tags --always --match "[1-9].*"
7.2.0-rc.0

The default describe used by setup() is
https://github.com/pypa/setuptools_scm/blob/bdcbe2ee9da8f422c80b0090bfd95162401a7c5d/src/setuptools_scm/git.p...

manic glacierBOT
manic glacierBOT
viscid pine
#

these ai thinker boards aren't so good

#

missing transistors so i cant use the usb port on board

#

weird LEDs

tulip sleet
viscid pine
#

the LEDs are all populated, but the white one is connected to a pin used by the USB JTAG

#

so its usually dimly on, my commit fixes it

tulip sleet
#

I meant to reply to the "missing transistors"

viscid pine
#

the missing transistors are for the DTR and RTS stuff, whenever i try to connect to it using any serial program, the board is forced into reset

#

i dont know why they are unpopulated

tulip sleet
#

eck

viscid pine
#

red boxes are not populated

#

not sure why they couldnt just use the jtab/serial usb and leave out the usb to serial chip

#

compare to espressif dev board:

tulip sleet
#

i am not sure they know what they are doing, or they recycled a previous design, or something

viscid pine
#

ยฏ_(ใƒ„)_/ยฏ

#

working without the circuitpy drive and repl isnt much fun either

jaunty juniper
#

speaking of workflow, anyone know how mpremote works ? does it require support in the core ? and if yes did we pick it up from the upstream merges (even if disabled) ?

meager fog
#

@viscid pine ive noticed the esp32 c3 is still 'wobbly' when it comes to hardware design

#

like i did my design and didnt realize a resistor was required, and cuased flakey behavior - but the resistor wasn't documented where i thought. its just a new 'exciting' chip. will take a bit to get a good boilerplate

viscid pine
#

maybe the c4 will be better :)

tulip sleet
manic glacierBOT
#

I went ahead and implemented this, but contrary to my above calculations it ended up bigger. You can check out the code: https://github.com/adafruit/circuitpython/compare/main...jepler:compress-errors-zlib?expand=1

adafruit_rotary_trinkey_m0 (english translation) had 5388 bytes free in flash before the change, but only 4918 bytes free after.

I didn't test on HW but I did make sure that messages seemed to be printed properly from within the unix port.

I'm also concerned about the amo...

manic glacierBOT
#

When I use the latest build for the feather_m0_rfm9x it fails when importing the bus_ddevce module


Adafruit CircuitPython 7.3.0-alpha.0 on 2022-02-19; Adafruit Feather M0 RFM9x with samd21g18
>>> import adafruit_rfm9x
Traceback (most recent call last):
  File "", line 1, in 
  File "adafruit_rfm9x.py", line 17, in 
ImportError: no module named 'adafruit_bus_device.spi_device'
>>> 

If I upload the python version of the library from the 7.x bundle, it works .

je...
manic glacierBOT
manic glacierBOT
solar whale
#

@tulip sleet should I create a separate issue for the freezing problem -- from the core bus-device problem?

tulip sleet
manic glacierBOT
#

If the SPI CLK polarity is set to 1, then a pull up resistor is required to keep the CLK signal high when the CLK goes to tri-state during idle periods. The pull up resistor could be external, but if your board is hard to modify, then setting the internal pull up resistor on the SPI CLK pin is useful. As the SPI CLK pin gets set up as a busio it becomes marked as "in use" and you can't manually set it to a pull up/down using digitalio, so the pull up/down should be set on spi configure.

#

I'll try that -- but do you have any idea why I can import bme680 but not rfm9x?

bme680 does from adafruit_bus_device import spi_device conditionally, in the constructor. rfm9x does import adafruit_bus_device.spi_device as spidev at the top level, and it does the rename as well. I have no idea why this would make a difference, but it is a difference to be investigated.

Also is the core bus device module supposed to be useable any more?

Sure, it's supposed to be.

solar whale
tulip sleet
#

we'll figure it out - this is an example of why I wanted to leave the 1.18 merge out of 7.2.0 ๐Ÿ™‚

solar whale
#

No doubt, I was just very confused this morning....

tulip sleet
#

we appreciate your early testing very much!

solar whale
#

This was just bad timing ๐Ÿ˜‰

tulip sleet
#

it may or may not have to do with frozen modules; I was mistakenly thinking the native module was frozen, of course it isn't

solar whale
#

At this point, I can't import both gps and bme680 on the rfm9x so sdcard is not the main problem -- I'll try cutting out some code from the libs.

solar whale
tulip sleet
#

there is some new optimization having to do with name lookups, and that may be broken

solar whale
#

life on the cutting edge is always eventful!

onyx hinge
#

@tulip sleet @solar whale I recall that there was a micropython vs circuitpython difference for importing submodules of built-in modules. we changed the behavior for ulab and also took advantage of it for the built-in adafruit_bus_device. I must not have preserved that behavior, and we didn't add a test for it. I assigned myself that issue.

#

scott (rightly) wanted import ulab.numpy as np to work but it doesn't in micropython because they (rightly) simplified import of built-in modules as much as possible

#
Use Ctrl-D to exit, Ctrl-E for paste mode
>>> import ulab
>>> import ulab.numpy as np
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: no module named 'ulab.numpy'
>>> from ulab import numpy as np
>>> 

Yeah we're back to micropython behavior on this detail

tulip sleet
#

micropython shouldn't fail silently on this, it should at least complain, or maybe the point is that in MicroPython native modules shouldn't have submodules

#

i guess the latter

proven garnet
#

Good morning! I realized last night that I thought I merged upstream in my fork of a repo, embarrassingly I actually did it on the Adafruit version that had an upstream. I went to revert the commit and roll back the changes but it looks like no files were actually changed. Could someone double check? I am infinitely sorry for the hassle in advance, just wanna do due diligence. ๐Ÿ˜“

manic glacierBOT
#

Blue: Chip select
Yellow: SCK

Before change, you can see SCK is not driven until after chip select is driven active low, and then SCK is set back to tri-state before chip select is driven high again:
PXL_20220214_230935256

After change, SCK is idle high before chip select is driven active low and remains idle high after the transaction too:
![PXL_20220215_160445850](https://user-i...

proven garnet
#

Thanks so much for checking, my bad

tulip sleet
#

these things are always reversible, don't worry

manic glacierBOT
onyx hinge
#

well I didn't plan to work on CP today but there ya go ๐Ÿ™‚

blissful pollen
#

these things happen ๐Ÿ™‚

manic glacierBOT
solar whale
onyx hinge
#

@solar whale I'll see to the CI's emotional needs later

#

as always I appreciate the bug reports & the testing

solar whale
#

Happy to help. I appreciate your leaving little tests for me to find ๐Ÿ˜‰

tulip sleet
#

I am going out but will approve and merge when I get back.

#

after the builds finish

manic glacierBOT
#

Thanks for doing this! I have not looked at the rest of it yet, but we want to call this zlib, not uzlib. If there are incompatible differences with the CPython API (that is, if it's not just a subset), then we would want to change them to match the CPython API.

So call everything zlib instead of uzlib. An example of this renaming without the shared-bindings/shared-module changes is re, which is ure in MicroPython.

manic glacierBOT
#

At ~day 6 unit 1 didn't show the problem, but unit 2 did

monotonic_ns JUMPED MORE THAN A DAY! 524287999023437 786431999877941 : 14147094 loop_count: 4617955 state_clock: 4617954
monotonic_ns MOVED BACKWARD! 786431999877941 524288015747072 : 14147095 loop_count: 4617956 state_clock: 4617955

During the day unit 1 doesn't call monotonic_ns a often, so it might just be that it didn't call monotonic_ns during the window (but not sure where the period is v. ET day/night....)

manic glacierBOT
#

Thanks for working on this @gamblor21!

I tested the functionality of this successfully with this:

import uzlib
data = b'\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x03EPAn\xc2@\x0c\xbc\xe7\x15\xd6\x9e\tJ\x02\xa2Jn\xfd\x00\x87\xaa\\ZU\xc8\r.\xac\xbaI\xc0\xeb\xd0\xa2(\x7f\xafw\x13\xca\x9e<c\xcf\xd8\xb3C\x02`Zl\xc8T`\x98\xd0\x89\xd5z\x11X\x8f\xcd\xd9\xd9\xf6\xa8\x9da\x8c\xcc\xa5\'\xbe\x05\xa8@aC\xc2\xb6\xf6J\xbcGB)\x96\nk\xb1W\xdaybo"\xfd\xb1\x98\xc7\xf17e\xf2\xbd\x93 \xc93}\xda\x98\x9c\xd5\n...
orchid basinBOT
solar whale
#

@tulip sleet I was able to get sdcardio into an rfm9x build and then get the rfm9x, bme680 and SDCard to play together. I did have to use the del() function in places. That seems to help a lot although not always.

tulip sleet
#

I saw! Impressive.

solar whale
#

I'll try it again on the 7.3 branch now that the merge is done.

#

It's OK with 7.3.0 as well

#

I will be very interested to see I I can get an OLED (ssd1306) display to actually function with the m0_rfm9x using the del() tricks. That has always be a big problem.

stuck elbow
#

what are the del() tricks?

solar whale
#
    import adafruit_rfm9x
    #with digitalio.DigitalInOut(board.RFM9X_CS) as cs:
    rfm9x = adafruit_rfm9x.RFM9x(spi, radio_cs, radio_reset, 433.0)
    # putem ajusta putere de transmisie (in dB).  standard e de 13 dB
    #  RFM95 poate ajunge la o putere de peste 23 dB:
    rfm9x.tx_power = 20
    rfm9x.send(packet_date)
    del(adafruit_rfm9x)
    del(sys.modules["adafruit_rfm9x"])```
#

this can be called repeately

#

Doing the same for another large module -- like gps -- allowed them to co-exist without running out of memory.

#

It did not always work. I could not add in the SDCard module as well, but it clearly seemed to help.

#

I had never seen this until the user asked for some help with it.

#

And I won't claim to fully understand it. I'll still trying to understand more about waht is really happening. Any insights would be welcome!

viscid pine
#

i'm also curious about the mentioned del tricks

solar whale
#

The idea seems to be that doing the del(module) and del(sys.modules["module"]) frees up much of RAM used when the module was imported. At least it seems to...sometimes....

leaden wadi
jaunty juniper
#

have you tried unmounting the sdcard first ?

solar whale
#

FYI -- I was experimenting with what happens if you remove an SDCard when it is being written to and the resits were very strange. The system did not seem to know for a long time - It still seemed to write and read to "something" for "awhile". Eventually it crashed, but there is some significant buffering going on....

stuck elbow
solar whale
stuck elbow
#

nobody knows everything

#

but this is why I didn't understand what you mean, the parens confused me

#

it's like that with sizeof in C as well

viscid pine
#

i can't bring myself to use sizeof without parens

solar whale
#

ah -- sorry about that -- I was just blindly following an example.

#

There is something comforting about the parens

stuck elbow
solar whale
#

That makes sense -- thanks

#

Does the general scheme I described make sense to you - to free RAM?

viscid pine
#

the trouble with the oled display on the m0 is that i can't even import the module

solar whale
#

It may still be too much to even get started.

stuck elbow
#

unless you del everything that came from that module too

solar whale
jaunty juniper
#

yeah I would think you need to del every variable using the module

solar whale
#

I think that was the hope

jaunty juniper
#

but I don't know, I gave up trying to fit things on the M0 a while ago

stuck elbow
#

I would rather try to trim down the libraries, and remove anything you don't use from them

#

I have good luck with m0 by using my own code to access peripherals

#

instead of libraries

#

but that's a life choice

solar whale
#

This was really meant see if there was a way to get more use out of the m0_rfm9x board with the existing libraries. I was encouraged by some limited success. Now I need to better understand what I did and why it worked...

#

I am pretty exited to see it working with a gps,sdcard and temp/humidity sensor. I did not think it was possible.

#

I doubt sdcardio will fit in all the translations though... EN_US only has about 700 bytes to spare.

jaunty juniper
#

I kind of want a minimal translation where every message is a number, displayed as a URL to a page in cp.org describing the error when you click, doubling as a reference to usual solutions (or auto loaded from an internal database in Mu)

viscid pine
solar whale
#

Yes -- that has been my experience as well --try standing on your left foot ๐Ÿ˜‰

viscid pine
#

one easy trick to get more ram on those boards is to disable usb midi and usb hid

#

they statically allocate some memory up front

solar whale
#

there is nothing left in the feather_m0_rfm9x to remove....

viscid pine
#

i mean build wihtout support not disable

solar whale
#

maybe "math" or analogio but they are often used.

#

math by the sensor libraries and analogio for the battery monitor.

#

almost everything else is gone

#
>>> help('modules')
__main__          board             microcontroller   sdcardio
adafruit_bus_device                 builtins          micropython       storage
adafruit_bus_device.i2c_device      busio             neopixel_write    struct
adafruit_bus_device.spi_device      collections       os                supervisor
adafruit_rfm9x    digitalio         pwmio             sys
analogio          gc                rainbowio         time
array             math              random            usb_cdc
Plus any modules on the filesystem
manic glacierBOT
#

CircuitPython version

7.1.1

Code/REPL

# SPDX-FileCopyrightText: Copyright (c) 2020 ladyada for Adafruit Industries
#
# SPDX-License-Identifier: MIT

import time
import board
import adafruit_sht4x

print("test")
i2c = board.I2C()  # uses board.SCL and board.SDA
sht = adafruit_sht4x.SHT4x(i2c)
print("Found SHT4x with serial number", hex(sht.serial_number))

sht.mode = adafruit_sht4x.Mode.NOHEAT_HIGHPRECISION
# Can also set the mode to enable hea...
manic glacierBOT
#

Similar problems with similar code. Tried on two RP2040 boards - Ardino Nana RP2040 Connect and QT Py RP2040 with same problematic results. Tried code on a CPB and it worked without these probs.
Have been using RP2040s in lots of situations but this is the first Iโ€™ve had these consistent problems. Also the first time Iโ€™ve used audiocore and audiomixer. Earlier work with PWMAudioOut didnโ€™t seem to run into these problems (about 50 students, two semesters, but didnโ€™t hear regular complaints)
...

solar whale
solar whale
# stuck elbow deleting the sys.modules is pointless, because the class will keep a reference t...

FYI- I found that I could remove the del(module_name) as long as I did the del(sys.modules["module_name"]).... If i removed the del(sys.modules["module_name"]) and only did the del(module_name) I still ran out of memory. I also found that without the parentheses, it failed with memory allocation errors but with the parentheses it works. I won't claim to understand, just reporting what I find...

solar whale
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.2.0-rc.0 on 2022-02-19; Adafruit FunHouse with ESP32S2

Code/REPL

# trigger a syntax error
import None

Behavior

After code.py exits the FunHouse display is empty except the Blinka image in the top left corner. After a soft restart (Ctrl-D) the only text on the display is:

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

Description

Expected: The text after running should appear...

manic glacierBOT
winter mortar
solar whale
#

Do you have any idea why del(sys.modules["module_name]) behaves differently that del sys.modules["module_name"] in terms of the amount of RAM freed?

winter mortar
#

'fraid not; that's a puzzle

solar whale
#

Good -- not only to me ๐Ÿ˜‰

winter mortar
#

I looked in the builtins module to see it's defined as a function as well as a statement, but no dice

tulip sleet
solar whale
tulip sleet
#

hmm, it shouldn't, because del is an operator, not a function call

#

like return (3) vs return 3

solar whale
#

I found tat if I use del(sys.modules["module_name]) I don't need del(module_name) but without parentheses, I run out of memory.

solar whale
#

I'll do some more experimentation and monitor the impact with gc later today.

tulip sleet
#

I looked for MP_QSTR_del to make sure, but it does not exist.

solar whale
#

I would really like to be able to come up with some guidelines for using del.

manic glacierBOT
#

So call everything zlib instead of uzlib. An example of this renaming without the shared-bindings/shared-module changes is re, which is ure in MicroPython.

Will do. Just a FYI for you (and others) the underlying library itself is called uzlib (it is separate from MP) so I won't change the naming within that but the CP visible calls I'll rename.

blissful pollen
#

Someone have a quick explanation or link on * and / in python type hinting function definitions? Trying to google * and / are rather difficult

jaunty juniper
#

in function definitions ?

blissful pollen
#

Yeah like : function:: decompress(data, wbits=0, bufsize=0, /)

#

in the documentation sorry

winter mortar
#

"Parameters after * or *identifier are keyword-only parameters and may only be passed by keyword arguments. Parameters before โ€œ/โ€ are positional-only parameters and may only be passed by positional arguments."

blissful pollen
jaunty juniper
#

yeah that, it's not about type hints

blissful pollen
#

I think creating the correct documentation gives me more pain then actually making all the C code ๐Ÿ˜‚

winter mortar
#

Documentation is hard but vital

manic glacierBOT
#

Correction.

  • Now I'm experiencing the same problem with CircuitPlayground Bluefruit. I can enter Safe Mode, but can't re-enter standard mode & run my code on the CPB, just like the RP2040 models.
  • I had been using audiocore previously on both boards without any problems (just importing WaveFile. The only thing that's new is audiomixer, so perhaps that's the problem.
manic glacierBOT
#

@dhalbert Is there something special with the funhouse display where the upper left corner is not (0,0)? Whenever display.show(None) is executed the terminal is moved back to (0,0). If for some reason the display setting donโ€™t match that, then it could pace the REPL terminal out of view.

I think the best way to debug is to test on the hardware and boot straight to REPL and check the root_group display element (x,y) locations on the screen and then trigger the bug and see the difference...

manic glacierBOT
#

@FoamyGuy noticed this in his stream yesterday (2/19) -- he was using a PyPortal.
I also see it on a featherS2+FeatherWing TFT 3.5" combo. After the script sets up the display, any error messages are lost.

import board
import displayio
from adafruit_featherwing.tft_featherwing_35 import TFTFeatherWing35

if "feathers2" in board.board_id:
    featherwing = TFTFeatherWing35(
        cs=board.D5, dc=board.D6, 
        ts_cs=board.D21, 
        sd_cs=bo...
manic glacierBOT
#

The amount of runtime memory is even bigger than that, about 2.5kB. the uzlib structure is 1.5kB and the "dict" is 1kB.

I threw a few more tricks at it, and even then ja was bigger in total flash size. (tricks that mean the auxiliary idea that maybe the translation can just be appended to the bin wouldn't work, either)

before - 3776 (ru) 5388 (en) 4072 (ja)
after -  4229 (ru) 5429 (en) 3970 (ja)

before = 918145f76
after = c6b68a93a

I think this isn't going to end up wor...

#

I think maybe the terminal is in the right position but gets the text from it cleared out. If you start using the REPL you do see it begin to show things on the display.

Do the start/stop terminal here result in clearing the text that was previously in the terminal away? https://github.com/adafruit/circuitpython/pull/5954/files#diff-edac12d728f2a3db7c325f4b3d9865f5fe9feb69e34302d626dc2cd11b2bd695R172-R173

manic glacierBOT
#

@kmatch98 I did a brief test with split screen REPL / displayio on a build that removes those supervisor_stop_terminal() and supervisor_start_terminal() statements. I was still able to reset_terminal to half the display size, add a Label to the displayio group and move it around on it's half of the display. Everything seemed to behave normally, but I was not super thorough.

Do you think there is potential harm in removing these?

tulip sleet
manic glacierBOT
#

Having only one or the other doesn't lead to a better outcome in either case than removing both of them.

With only supervisor_start_terminal() the error message is still not shown. But I don't see other adverse effects at first glance.

With only supervisor_stop_terminal() the error message is also not shown, but the REPL is no longer shown on the display either only the blinka icon and no other text..

manic glacierBOT
#

As for including supervisor_start_terminal() and supervisor_stop_terminal(), I think I just blindly copied what was already in there.

If we want to keep the old error message around: One thing I noted in the PR was whether we wanted to keep the text data in the terminal when we resized it. The challenge with that is that if the terminal is resized, first you have to allocate a new Terminal, then copy the...

#

Having only one or the other doesn't lead to a better outcome in either case than removing both of them.

With only supervisor_start_terminal() the error message is still not shown. But I don't see other adverse effects at first glance.

With only supervisor_stop_terminal() the error message is also not shown, but the REPL is no longer shown on the display either only the blinka icon and no other text..

Now Iโ€™m remembering stop_terminal deallocates the memory for the t...

#

I thinks okay not to retain the data in the terminal when it gets resized. The user presumably would have intentional resized it so they would understand why it's gone I think.

In the case originally reported here though there terminal isn't getting resized, at least not intentionally I don't think. The user has a code.py happens to raise an exception which stops it executing and breaks out to "press any key to enter REPL". So have not done anything with resizing the terminal.

I do th...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Other objects which work for buffer are of type busio.UART and usb_cdc.Serial. (So the msgpack format would a good basis for a binary serial protocol.)
I don't know of any type annotation in standard Python or CircuitPython that encompasses all these types. Perhaps the best approach would be to annotate with a pseudo-type like "bytestream" and explain what that means in the class or method documentation (in shared-bindings/msgpack/__init__.c) I'm willing to wordsmith a PR if this seems ...

proven garnet
#

When adding a library using cookiecutter, in this case to CircuitPython Org, should I use my username or "circuitpython" for the user? I figured I would make the library and then if it was any good it might be forked, but I don't know how it works on that front for that bundle.

#

I assume mine?

manic glacierBOT
onyx hinge
#

@proven garnet I think it's the github user name but I'm not 100% sure

manic glacierBOT
manic glacierBOT
mental nexus
#

I'm trying to push a commit to my CircuitPython fork, but I'm all the sudden getting an error:

#
 ! [remote rejected]     repl_fixes -> repl_fixes (refusing to allow a Personal Access Token to create or update workflow `.github/workflows/build.yml` without `workflow` scope)
error: failed to push some refs to 'https://github.com/kmatch98/circuitpython.git'
#

Not sure what changed since a few days ago, but I did merge in all the recent CircuitPython updates. Any suggestions on how to clear this git hurdle?

proven garnet
#

I was just seeing something like that, but with my new repo I created. I'm not the greatest at this stuff, but it looks like that perhaps whatever token you're using to push changes doesn't have the permissions needed to alter workflows

#

@mental nexus do you have this checked off for the Personal Access Token you're using?

mental nexus
#

Hmm. I had to add a token last week when I got back to building CP, maybe I missed this checkbox. Will check and report back.

manic glacierBOT
#

The flash is optional on this board (its basically a haxpress) and the pins are meant to be usable when the flash is not populated (the non-"with_flash" board). I still think that having board pins defined which probably don't work would cause more support issues than people wondering why they're not there if they're removed. The board does have multiple additional SPI ports available in any case.

manic glacierBOT
solar whale
#

For those interested, a brief update on the use of del -- after more testing, I have found that the difference between using it with or without parentheses is minimal. The test case I was using was so tight on memory, that almost any change broke it. It does appear that the best results of freed memory are obtained with del sys.modules["module_name"] followed by del module them doing a gc.collect(). executing gc.collect() at the start of each function that is going to import a module also seems to help. I am working on some examples, but this is encouraging so far. What I am doing in each function is ```gc.collect()
import module
use the module (create spi if needed)
spi.deinit() (if spi used)
del sys.modules["module"]
del module
gc.collect()

manic glacierBOT
mental nexus
#

I'm trying to make a PR vs 7.2.x, but in my local branch I just merged the latest version with my changes. When I committed, I thought I only added the files that I changed, but the PR template says there are 118 changed files. How can I make a PR only on the files that I changed?

jaunty juniper
#

did you merge ? did you rebase ?

mental nexus
#

I merged the latest upstream, then made my changes.

#

Here's my git reflog:

220564f08 (HEAD -> repl_fixes, origin/repl_fixes) HEAD@{0}: commit: retains REPL terminal data after display.show(None) when terminal size is not changed
8a5123827 (repl_wrangler) HEAD@{1}: checkout: moving from repl_wrangler to repl_fixes
8a5123827 (repl_wrangler) HEAD@{2}: commit: updated code so the REPL will retain its text if not resized when code stops
b5b04fb9d HEAD@{3}: pull git@github.com:adafruit/circuitpython.git main: Fast-forward
#

I merged from the latest adafruit/circuitpython, then made my changes. Now I want to make a PR of just my changes against version 7.2.x

jaunty juniper
#

not sure, can you git rebase 7.2.x ?

mental nexus
#

Ok, let me try

mental nexus
#

I tried rebase and there's a bunch of merge conflicts. I wonder if cherry-picking may be easier. I'll try that and see what happens.

proven garnet
lone axle
proven garnet
#

Ahhh got it, thanks!

#

I guess at this point, should I just fork my repo into CircuitPython Org or just create a new one from scratch and copy/paste?

lone axle
#

@proven garnet (am catching up on chat now) I have not checkout the dial PR yet, but it's on my list for today.

proven garnet
#

No worries! Just wanted to give the link for the PR

lone axle
lone axle
# proven garnet <@!382939733107408897> I don't know if you managed to checkout my PR for the Dia...

Interesting If I understand you're new library correctly it reminds me of a concept from Android: https://developer.android.com/reference/android/animation/ObjectAnimator They have "ValueAnimators" that can change the value of a property on some object based on a set of rules. A basic use-case being linear interpolation for moving the location of a view element, but can do much more complex things as well.

proven garnet
#

It could have other effects as well

#

But I guess let me know if you think effects should be a new library or each widget should have it individually

proven garnet
onyx hinge
#

<@&356864093652516868> Just a reminder that there is no meeting today, as it's a US holiday. We'll meet 24 hours later than usual, 11am Pacific / 2pm Eastern Tuesday.

lone axle
onyx hinge
#

did anyone try adding a touchscreen onscreen keyboard to the circuitpython wordle? it would be great in portrait mode on a pyportal, i'm tempted to think..

lone axle
#

Maybe I am mis-remembering though. There was one that used the BBQ10 keyboard, and another that hosted JS to play the game in the browser. I thought one more, but not certain.

thorny jay
#

That was maybe the guy with a Blackberry keyboard attached to screen? I think it was also Wordle realated.

onyx hinge
#

yeah I recall a version for keyboard featherwing(maybe it's called?) and one with clue using the two buttons to select letters

lone axle
#

Yep, I had a look back through a few shows and tried some keyword searches in that channel and came up empty. I think I must've had wires crossed from the BB keyboard one.

blissful pollen
#

When your editor is being "helpful" removing extra spaces at the end of lines that cause tests to fail because the text compare is looking for those spaces...

stuck elbow
#

I have set up mine to merely highlight those spaces as spellchecking errors, I have to remove them manually

manic glacierBOT
proven garnet
#

Alright, in the correct channel this time: Okay @lone axle, I forked my repo into CircuitPython Org, I did want to keep the git history. Happy to change it to a standalone repo if that ends up making more sense.

manic glacierBOT
mental nexus
onyx hinge
brazen hatch
#

Hello I was wondering, can I like, freeze a boot.py & code.py in a circuitpython build?
It would be nice if I could keep the usb storage nice and clean of project files

#

I'm not sure if it's the right channel, but oh well

lone axle
#

Would you still use the storage for anything? It's possible to disable the USB storage from appearing at all, maybe that would fit your use-case?

brazen hatch
#

the final product is gonna be fully opensource, but in order to keep it clean I would like to embed as much as possible onto the uf2, and only keep user-changable stuff on usb

lone axle
#

I see. I would guess that it is possible, but I'm not really sure how to do it. This is probably the best place to ask though someone here may be able to point you in the right direction.

timber mango
#

Hello everyone, I hope you all had a good day. I would like to ask about the ST25DV16K. I am working with it in circuitpython and with the QTPYRP2040. Do you know how many Bytes can be transferred via NFC to the mobile. I only manage to send 230 Bytes. Is it possible to send more bytes and how?

jaunty juniper
brazen hatch
jaunty juniper
#

I don't know if pyexec_file can run a frozen module or if there's an alternative function that could

brazen hatch
#

pyexec_file seems to have the backbone for it

#

I think I can do this

manic glacierBOT
#

I am testing this out on a PyPortal and I think I'm seeing some odd behavior
My code.py contains this:

for i in range(3):
    print("Hello World!")

code.py Runs automatically first time upon power up but all of the "Hello World!"s get scrolled off the top of the display leaving none of them showing:
image
They were visible briefly but scrolled off the top edge.

Fro...

lone axle
#

@tulip sleet I think there may still be some issues around https://github.com/adafruit/circuitpython/pull/6076 I am trying it out right now and getting some weird results with extra things being printed on the display. But I was a tad too slow in leaving my comment on the PR.

#

I could open a new issue to document what I am seeing? perhaps it's a different root cause or not related specifically to the changes from that PR, but it does seem to be different behavior from 7.1.1.

manic glacierBOT
tulip sleet
lone axle
#

I'm going to try the split screen REPL to ensure that still works but if so I could submit a new PR with that change as long as both "normal" and split screen mode still behave well.

tulip sleet
lone axle
#
 supervisor_start_terminal(self->width, self->height);

in the display_core show function.

#

I'll make one shortly.

tulip sleet
#

@mental nexus see ^^

mental nexus
lone axle
#

@mental nexus Ah Yeah, in the process of testing that I noticed the adverse effects when code.py finishes or when I am trying to reset back to full size.

As a short term fix (and in the interest of getting 7.2.x stable and ready for mass usage ASAP) I think it's worthwhile though. In 99% of use cases the user isn't using the split screen, and most likely has a code.py with a while loop that makes it not end.

For almost everyone the behavior will return to normal, only folks playing with the new feature will have any weirdness if I am understanding.

mental nexus
#

It looks to me like way scrolling is performed gets messed up when supervisor_start_terminal gets run. I'm still hunting to understand what is causing the insertion pointer to go weird and for the data not to get cleared on a newline.

#

If there's a rush to a stable revision, I'd just revert for now and we can revisit for the next round.

lone axle
#

I'll leave the call to Dan, I was going to PR removing the start_terminal but then keep digging on trying to get the scrolling to behave normally in the post split screen use-case afterward.

mental nexus
#

I've got a little time now, I'll look for a bit to see if it's obvious...

mental nexus
#

Ok, I think I've got it. Let me clean up a few things and push a PR for review.

manic glacierBOT
digital shoreBOT
#
adafruit
Owner

adafruit#3230

Category Channels

8

Text Channels

61

Voice Channels

6

Members

33295

Roles

35

manic glacierBOT
#

This PR is to resolve the garbled characters observed in:
https://github.com/adafruit/circuitpython/pull/6076#issuecomment-1047174101

Test code for standard use of the REPL:

for i in range(3):
    print("hello world!")

Test code for resizing the REPL. I just see one minor weirdness when using the resized REPL and then code.py finishes running. If there is no serial connection, whenever the code is done running and it resets back to the REPL, the "Code is done...

mental nexus
#

Thanks @tulip sleet and @lone axle. I hope this revision resolves the issues that were observed. If this needs to wait for another version, no problem with me.

There's just one minor weirdness with the "resize-REPL" usage. The "Code done running." is printed before display.show(None) is called. So if your REPL-resizing code finishes the code.py, and without a serial terminal connected, you just get a Blinka and a black screen. I'll add an issue.

tulip sleet
lone axle
#

Yep will try it out in just a moment.

manic glacierBOT
#

Looks good to me. Tested successfully on PyPortal. The following scenarios all appear to be working as intended:

code.py without while True and doesn't raise an exception

code.py that does raise an exception (it remains visible)

code.py that contains screen splitting and doesn't have a loop. (screen split works normally and terminal returns to normal full size after code.py completes)

REPL executing code that raises an error. (error is visible but scrolls off the top as expected i...

onyx hinge
#

Finally used the little tft on my clock

#

Whoops that's not for this channel, it's an Arduino project๐Ÿ˜ฉ

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.2.0-rc.0-3-g6b2266b24-dirty on 2022-02-21; Adafruit PyPortal with samd51j20

Code/REPL

import board
import displayio
import supervisor
import time


display=board.DISPLAY


# Create a Group
mygroup = displayio.Group()

print()
print()
print()
print("REPL control test: Taking control of REPL group")
time.sleep(3)


# clear the display to the REPL 
display.show(None)
splash = board.DISPLAY.roo...
manic glacierBOT
winter mortar
#

I'm working on a modification to Adafruit_CircuitPython_Typing (to add a ByteStream protocol), and running pre-commit locally is happy with everything except this:

pylint (examples code)...................................................Failed
- hook id: pylint_examples
- exit code: 127

with no other diagnostic output. I haven't touched examples. What should I do?

lone axle
#

maybe try running pylint on the example script directly to see if it outputs any more than pre-commit.

tough flax
winter mortar
onyx hinge
#

we have some Reasons that we don't install pylint via pre-commit, even though letting pre-commit do it in a virtual environment is the "right" way... glad you figured it out

mental nexus
# manic glacier

No worries. Just wanted to leave a few bread crumbs for when someone sees it again.

manic glacierBOT
#

The __await__ method is added to Task class, which is just a wrapper of getiter. The name of the module is not modified for now, because the renaming should be in sync with adafruit/asyncio. With this PR, Task object becomes awaitable, and the following code works.

import asyncio

async def coro(s) :
    print("coro start", s)
    await asyncio.sleep(s)
    print("coro done", s)
    return f"coro result({s})"

async def main() :
    print("main start")
    res = await asyn...
manic glacierBOT
manic glacierBOT
#

Instead of defining it here, use MICROPY_PORT_BUILTIN_MODULES (as mentioned below for other modules), which is in py/circuitpy_mpconfig.h.

Go ahead and rename it to _asyncio instead of _uasyncio. I'll change the library now to reflect that, since a change in the library now makes no difference. That will also ensure that it will only work with the fixed version . Don't rename MICROPY_PY_UASYNCIO; we'll leave that name alone.

proven garnet
#

@tulip sleet I'm happy to release that library for asyncio, but I assume it's probably a major rev change?

onyx hinge
#

@tulip sleet what's the quick summary of the advantage of enabling _asyncio? Is it faster / less memory / ???

winter mortar
#

I'm trying to submit a PR, and getting this error from Build docs:

Warning, treated as error:
29
/home/runner/work/Adafruit_CircuitPython_Typing/Adafruit_CircuitPython_Typing/circuitpython_typing/__init__.py:docstring of circuitpython_typing.ByteStream.read:1:'any' reference target not found: count
30
Error: Process completed with exit code 2.
#

I imagine it's complaining about the lack of a :param statement, but the message is kinda cryptic. Where would I find documentation of the expected comment format?

onyx hinge
#

@winter mortar can you link to the PR directly? I'll take a look.

winter mortar
#

and thanks

onyx hinge
#

"""Read `count` bytes from the stream. If `count` bytes are not immediately available,
Try using double backticks, ``count`` instead of `count`. The markup for docs uses single backticks for cross references and double backticks to set something in typewriter font. A bit different than markdown.

proven garnet
#

It also looks like you'll run into the same problem for buf in the docstring of write below

#

This is the the error I hit most ๐Ÿ˜ญ

tulip sleet
tulip sleet
proven garnet
tulip sleet
#

it doesn't really matter one way or the other, since _uasyncio is not turned on in builds anyway

#

and the release is separate from the merge

proven garnet
#

Awesome, thanks for explaining!

idle owl
#

<@&356864093652516868> CP Weekly meeting is in ~50 minutes. Please add your hug reports and status updates to the notes doc if you're planning to participate or want them read off during the meeting. See you all soon! https://docs.google.com/document/d/18qlzNr5o2KUEwxZWGmxTlj0CBFyns3sBlGcCfc1j1D0/edit?usp=sharing

tulip sleet
onyx hinge
#

@lone axle ports/espressif/certificates/nina-fw I think

#

re: "Try to figure out where / how to update the certficate(s) that circuitpython uses for making HTTPS requests."

lone axle
onyx hinge
#

@lone axle yes the idea was to share between them

#

1๏ธโƒฃ 0๏ธโƒฃ 0๏ธโƒฃ 0๏ธโƒฃ 0๏ธโƒฃ 1๏ธโƒฃ 0๏ธโƒฃ 1๏ธโƒฃ 1๏ธโƒฃ

slender iron
#

โค๏ธ

tulip sleet
#

@onyx hinge is it 8-bit or 8-inch Atari floppies? (maybe both ๐Ÿ™‚ )

onyx hinge
#

oh 8 bit. they're 5.25s.

#

did I say 8 inch? my mistake. I've dodged having to get an 8 inch floppy drive thus far

tulip sleet
#

no, you said 8-bit. I was not familiar with the Atari nomenclature

onyx hinge
#

I don't know much about Atari either, from that era

solar whale
#

You are not live-streaming the birth? ๐Ÿ˜‰

slender iron
#

not my call ๐Ÿ™‚

#

there is plenty of birth vlogs on youtube

solar whale
#

We'll wait for a deep-dive on diaper changing...

slender iron
#

๐Ÿ™‚

onyx hinge
#

๐Ÿ‘‹

crimson ferry
lone axle
#

Neopixels turn red when needs change

idle owl
#

TFW your audio was sending to the wrong output so for a hot minute there you thought there was no audio at all on the recording. ๐Ÿ˜…

manic glacierBOT
#

CircuitPython version

If I understand the pinout of the `ESP32-S2 TFT` correctly I should be able to access to `boot` button through the `board`'s `BUTTON` attribute, but this throws an exception.

Link to pinout PDF: https://github.com/adafruit/Adafruit-ESP32-S2-TFT-Feather-PCB/blob/main/Adafruit%20ESP32-S2%20TFT%20Feather%20Pinout.pdf

I can't find another way to access GPIO0.

Code/REPL

# Adafruit CircuitPython 7.1.1 on 2022-01-14; Adafruit Feather ES...
slender iron
#

ok, host calendar is updated

idle owl
#

Keen, thanks!

manic glacierBOT
#

Thanks for the PR @gamblor21!

It looks like the uzlib API isn't grounded in the real zlib API. The CPython API doesn't have an IO wrapper class at all. The decompress object doesn't really have the stream API.

However, gzip has a GzipFile class and a gzip.decompress() function. I think that's the best approach for making this CPython compatible. Rename to gzip and rework the API to match. https://docs.python.org/3/library/gzip.html

manic glacierBOT
manic glacierBOT
#

I'll take a look a bit more in depth at the gzip API but I did not see anything that allows a stream just the file functionality. I think the stream functionality was required in the example @FoamyGuy had decompressing the web service request. Or can the file functionality be used for a data stream from HTTP?

zlib does have a decompressobj(...) function that states it is used to decompress streams of data (and returns a zlib.Decompress object). But may also take some work to change...

manic glacierBOT
manic glacierBOT
#

Just as FYI did this as a quick change to hope the extmod could work so depending on the extent of rework this may take a while as it is low on my priority list at the moment.

Ya, totally get that. We do have a third option of picking a non-CPython name for the existing API. I'd avoid uzlib because it's not like zlib.

Can't the file API be used for streams? I wonder how the real requests library handles gzip.

winter mortar
#

I'm trying to set up a CircPy build environment, following the instructions at https://learn.adafruit.com/building-circuitpython/macos. I downloaded gcc-arm-none-eabi-10-2020-q4-major-mac.pkg from the Arm developer site, installed it apparently successfully, but can't find any of the content. (In particular, gcc-arm-none-eabi isn't in my path.) What am I missing?

slender iron
#

I might have used brew instead though

winter mortar
#

I'm in a different shell, and looked in yet different shells. (The build is actually complaining about arm-none-eabi-gcc). Yeah, I just used the installer on the .pkg.

#

There's a way to install the compiler with brew?

#

What does which arm-none-eabi-gcc show you?

slender iron
#

I'm on my linux computer now

winter mortar
#

Well that looks easier! I'm trying the brew-install now.

idle owl
#

That's how I did it.

winter mortar
#

Woo hoo!

~ % which arm-none-eabi-gcc
/usr/local/bin/arm-none-eabi-gcc

Thanks!

slender iron
#

๐ŸŽ‰

idle owl
#

@onyx hinge Does grep ignore .files by default or something?

onyx hinge
#

ummm "sort of"?

idle owl
#

Or wait, it's not checking for file names... I want it to check for files with a word in the name

#

But include .files.

#

It's in a git repo folder

#

What magic am I looking for?

onyx hinge
#

you want to find files that match a grep-style pattern?

idle owl
#

I think?

onyx hinge
#

in the current directory, or in all subdirectories too?

idle owl
#

All subdirectories

onyx hinge
#

"find -print" will print one filename per line. You can 'pipe' it to grep, which will print matching lines: "find . -print | grep example"

idle owl
#

Looking for filenames that include the word skip in them. But they're likely dotfiles.

#

ok

onyx hinge
#

you'll find sites that offer you more complicated ways to do it if you're dealing with insane filenames (like, say, someone names a file to contain a \n newline character) but I assume you're dealing with something sane for the sake of simplicity

idle owl
#

I think so yes

#

That found nothing. Hmm.

#

wait

#

I didn't need the wildcards.

#

That worked

jaunty juniper
#

I believe find always prints line by line when piping, I use find . | grep something

onyx hinge
#

if you're also looking just for files 'known to git', you can git ls-files "**/*.skip". The pattern "**/*.skip" is an "extended glob" which is different than a "grep". ๐Ÿคฏ why can't computer science people keep it simple

stuck elbow
#

ugh, guys, find . -name '*skip*', no grep please

jaunty juniper
#

or you can use -name with a full name or wildcards find . -name '*.py'

onyx hinge
#

@jaunty juniper I think you're right! but I have memories of some obsolete version of find that chided me for not saying "-print" so I usually include it. go figure

idle owl
#

Oof.

onyx hinge
#

yeah there must be 50 ways to grep your files

#

but some of them aren't grepping

idle owl
#

Didn't find what I was hoping to find anyway. ๐Ÿ˜ฆ

stuck elbow
#

or -iname if case insensitive

jaunty juniper
#

I usually prefer using grep, more options for the name pattern

onyx hinge
stuck elbow
#

also, I'm so annoyed by people piping the output of find into xargs and then rm, when there is -delete...

stuck elbow
idle owl
#

It's designed for a .boardname.test.only file to be included with all .ino files, and it only builds for that board.

#

I want it to not build for anything.

onyx hinge
#

@idle owl you can also use github to find files .. click the "go to file" button near the top of the files list and then type the substring you're looking for

idle owl
#

It's a weird use case.

onyx hinge
#

I don't know the answer about arduino though ...

idle owl
#

There!

#

Thank you!

stuck elbow
#

looks like if you create a file named the same, but with '.skip' at the end, it will skip the original file

idle owl
#

So I still need to include a .boardname.test.skip file if I'm reading that correctly...

idle owl
#

Wait... is that right? It still needs a platform in the .test.skip file for it to work, right?

stuck elbow
#

it has to be a full file name

idle owl
#

Yeah it must. The rest of the line looks the same as the test.only file.

#

Perfect.

stuck elbow
#

oh, and a dot in front

#

so the file is hidden

idle owl
#

Right.

idle owl
#

Oh hmm. Now I'm wondering if it skips only that platform, or all platforms....

onyx hinge
#

it skips just that platform, I think

stuck elbow
#

yup

#

the .only on the other hand skips everything except that platform

idle owl
#

Bugger. There are groupings, I think I can use, to cover a lot of them. Hmm.

#

But I don't think they cover all.

onyx hinge
#

I think you just get to create each one separately

idle owl
#

So I'd end up with an endless set of .skip files that will have to be updated every time we add a new board.

onyx hinge
#

you're thinking "wow I need to skip all the boards with 'y' in the name" and noticing you can't do that?

#

I think you're right to have a sinking feeling about that.

stuck elbow
#

would specifying the files not to be skipped be easier?

idle owl
#

It won't build for anything. It's template starter-code, so there's random things in it that need to be replaced with actual values before the code will compile for anything.

#

Normally, yes.

#

But this is a weird use case.

onyx hinge
#

do you have to put it in a folder called "examples"? or can you put it in a folder called something else?

#

or maybe that's not how it works

idle owl
#

It's going in Arduino_Templates/example_name

onyx hinge
#

can you call it .ino.txt instead of .ino?

idle owl
#

But that can be anything, I guess.

#

Oh hmm.

#

Yeah, I could do that, I think

#

It has to get copied into Arduino, updated, tested, and submitted to Learn separately anyway.

onyx hinge
#

on windows it can be tough to revise the file extension within the Windows Explorer but from commandline it's all fine

manic glacierBOT
#

If a new name were selected would it be for the stream API only and decompress() would stay under zlib since zlib.decompress() does seem to match the CPython API as-is. Or would decompress() move as well?

I tried poking around in https://github.com/psf/requests to figure out how it's handled in there, but I'm coming up empty. I tried some git greps for terms like gzip, zlib, and zip and the majority of the results I found seem to be in the documentation or the test files. T...

idle owl
#

And GitHub renders .txt files... I have no idea if it would manage to render a .ino.txt file, but viewing "raw" would probably show the code.

#

MacOS is easy with that. It verifies you mean to change it, but it updates it pretty simply.

#

Also I don't want to hardcode the Arduino_Templates directory to be skipped, because some of the template code will probably compile properly as-is, so I'd want CI to run on it. Though, I'd only be testing it against one board in Learn CI, because I'm not including a .test.only file for every board guide the template goes into. So maybe that's not out of the question. Or maybe it's worth adding an actual .all.skip type functionality. That's outside my wheelhouse though, I think.

onyx hinge
#

"The filename argument can be an actual filename (a str or bytes object), or an existing file object to read from or write to."

idle owl
#

I don't understand what that means practically speaking.

onyx hinge
#

@jaunty juniper thanks, I was just finding that as well!

lone axle
#

Oooh, no I didn't catch that. I wonder if "existing file object" means anything with the expected read() function would work. In our case there is no local file that contains the data it would all be coming from the response to the HTTP request. If it were a stream though it would behave similar enough to an opened file maybe?

idle owl
#

Yeah, I don't understand how the skipping vs platform-specific bits even work in here. Much less how to add something that skips all.

onyx hinge
#

@lone axle pretty much I think? ```py
import gzip, io

zipped = gzip.compress(b"I'm a little teapot")
with io.BytesIO(zipped) as open_gzip_file:
with gzip.open(open_gzip_file) as unzipped:
print(unzipped.read()) # Prints b"I'm a little teapot"

... afk!
lone axle
#

And thank you @jaunty juniper! looks like they are using zlib.decompressobj() which appears to be one of the differences between CPython zlib and micropythons uzlib (now called zlib in that PR). The micropython module doesn't have the decompressobj() functions.

idle owl
#

I guess the .txt option is the best way to go.

lone axle
#

Is there an example anywhere of our requests library reading the data as a stream? I had originally though that is what response.content was but now thinking I was mistaken in that.

slender iron
#

json decoding happens as a stream

#

(by calling read() iirc)

lone axle
idle owl
#

Oof, looped Carter into the conversation in the #help-with-arduino channel....... .none.test.only skips CI entirely for .ino files. ๐ŸŽ‰ Good thing I mentioned it to him... I would have done a bunch of nonsense to get around it otherwise.

tulip sleet
#

@slender iron @onyx hinge I'm doing 7.2.0-rc.1 unless you know of some reason not to.

slender iron
#

all good to me

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 7\.2\.0\-rc\.1
idle owl
orchid basinBOT
idle owl
#

It's a sneaky little if platformname != "none" that I think does it.

tulip sleet
#

groan, I tagged 7.2.0-rc.1 against main, not 7.2.x

slender iron
#

oops ๐Ÿ™‚

#

time for rc.2!

idle owl
#

Oof.

tulip sleet
#

in process ๐Ÿ™‚

slender iron
#

๐Ÿ™‚

idle owl
#

Nice ๐Ÿ™‚

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 7\.2\.0\-rc\.2
manic glacierBOT
#
[adafruit/circuitpython] New tag created: v1\.18
onyx hinge
#

Thanks @tulip sleet !

manic glacierBOT
tulip sleet
fiery fossil
#

Pin PC13 on my STM32F412CG has the alternate function of an anti-tamper pin, but I planned on using for a SPI chip select. When I go to assign it as a digitalio it says that the pin is already in use with no other code running. I'm guessing it has to do with

never_reset_pin_number(2,13); // PC13 anti tamp```
in my `peripherals/stm32f4/stm32f412cx/gpio.c` file.  Is that `never_reset_pin_number` necessary? I put it there because I saw other microcontrollers in there had it.
viscid pine
#

the f401 doesn't seem to have it, maybe it's not needed

tulip sleet
#

are you making up your own board definition?

#

or is this an existing board?

fiery fossil
#

Yeah

#

My own

tulip sleet
#

then you don't need it

fiery fossil
#

That did it

old marsh
#

Has anyone setup circuitpython on the Digispark Attiny85? If so could you link a project? Thanks. Searching and I haven't found anything yet. Maybe there is a physical limitation I'm not aware of.

fiery fossil
#

@old marsh not enough flash

winter mortar
old marsh
#

Understood. Figured there was a reason why I didn't find anything. Just didn't want to do ducky scripts in C++.

#

I found a project where someone used a Pi Pico with circuitpython. Changed a few pins in the code and have it working on my feather 2040 I already had circuitpython installed on.

manic glacierBOT
manic glacierBOT
tulip sleet
winter mortar
manic glacierBOT
slender iron
#

@tulip sleet do you have time to chat usb host API?

tulip sleet
#

sure, one minute

slender iron
#

๐Ÿ‘

manic glacierBOT
idle owl
#

Here is the notes document for next 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/1CtfTbhzjGUZczy9LULKjNmz8eXSboHFM93cvudDZc0g/edit?usp=sharing

slender iron
idle owl
manic glacierBOT
analog valve
#

Hi. A while ago i was here seeing if circuitpy supported MAC address changing in the nrf52840 ble libraries. The answer was it didnโ€™t. Does anyone know if itโ€™s now possible?! Or i just stick with our c code.. ( https://github.com/AceCentre/morAce/blob/572e972336961dcf111b94a6fbabcda6ba3ca1be/morAce/morAce.ino#L852 if anyones interested..!)

GitHub

Turns switch presses to Morse - and then sends this as Text / Mouse movements to a BLE compatible device - morAce/morAce.ino at 572e972336961dcf111b94a6fbabcda6ba3ca1be ยท AceCentre/morAce

manic glacierBOT
slender iron
#

@analog valve why do you need to change it?

slender iron
#

@tulip sleet so bill's main feedback was to move away from press/release events to passing the current pressed state

#

if you do events and overflow your buffer then you risk missing a release

#

which is something I heard from obra as well

tulip sleet
#

do you think this applies to keypad too?

slender iron
#

ya, that's what I'm thinking

#

HID library as well potentially

#

bill doesn't know that its how usb works too

#

it's also not obvious to me what the descriptor for the intellikeys actually is

#

and whether tinyusb would recognize it as HID

tulip sleet
#

bill could send it; I don't seem to have it in email

slender iron
#

it's not obvious from the arduino code

#

si

#

so I guess I'm walking back my idea a bit. I still think we could do the class level stuff but also make the generic API available

tulip sleet
#

let's find out about the intellikeys, i'd say don't change yet

slender iron
#

@tough flax we'd love to know more about intellikeys when you are around

manic glacierBOT
tulip sleet
#

@slender iron lotsa intellikeys on eBay, not expensive

slender iron
#

ok, ordered

onyx hinge
#
// From OpenIKeys on github
const INTEL_HEX_RECORD loader[] = {
    16,
    0x146c,
    0,
    {0xc2,0x00,0x90,0x7f,0xa5,0xe0,0x54,0x18,0xff,0x13,0x13,0x13,0x54,0x1f,0x44,0x50},``` ๐Ÿ˜ฑ  first upload the firmware to the embedded 8051..
slender iron
#

@onyx hinge ya, I saw that but couldn't tell what the device actually does

winter mortar
#

Where (or how) are MP_QSTR_* symbols defined? I want to change the name of a parameter in a shared-bindings file.

jaunty juniper
#

they are not, they are found in the code by a script prior to compiling

winter mortar
#

(There's a MP_QSTR_stream used in another .c file, so maybe I don't have to do anything except use it?)

jaunty juniper
#

you can just make them up and they will be added to the strings automagically

winter mortar
#

thanks!

onyx hinge
#

there are very occasional problems with adding QSTRs in this way, due to a source file not being listed in a place it needs to be. If you run into one (where, say, you add QSTR_abcdefg and then get an error about it not being defined) filing a github issue about it may lead to it being resolved. But as a workaround, you can make BOARD=whatever clean and then make again and that'll almost always fix it.

analog valve
# slender iron <@!400614154324672512> why do you need to change it?

Becauseโ€ฆ. If you use switch access on iOS. - if you want a device to change from a system switch interface to say a switch interface for a app then changing the MAC address is the only way to do it. If you donโ€™t (& just change name, manufacturer name etc) iOS just refuses to see it as a different device. Another use case. We have some code that interprets morse code to hid. But then we want a user to use the same interface to use switch scanning. Doing it this way allows this.

manic glacierBOT
manic glacierBOT
warm stump
#

To address a slight elephant in the room: SONY Spresense, the CircuitPython board with the headphone jack does not currently have audioio or audiomixer.
Currently working on Spresense with the initial aim of porting Mozilla WebAudio Biquad Filter (Equaliser) to CircuitPython audiomixer
(which is half and half completely unrealistic due to the way it's been architected with NuttX)
This Arduino Sketch sums up what I found and plays a TV Beep through the headphone jack,
with hope that it could be used to trace doing the same thing in CircuitPython with some of its extra DSP features for accelerating audio on other boards.
Tested while wearing SONY's old but pristine headphones of course. The same beep example can be done on a Raspberry Pi (with GPIO 14/15 muxed I think it was?) without any OS

slender iron
#

@warm stump sony actually added support for that. I'm sure they'd be happy to see you add more to it

warm stump
slender iron
#

we do have an issue for analog recording in cp

warm stump
manic glacierBOT
#

We would love to be able to change MAC address of a ble device in circuitpy. Right now itโ€™s the last thing holding us back to rewriting alll our code in py

use case. You can see some code here of how we are doing it in c https://github.com/AceCentre/morAce/blob/572e972336961dcf111b94a6fbabcda6ba3ca1be/morAce/morAce.ino#L852

imagine you use switch access on iOS. - if you want a device to change from a system switch interface to say a switch interface for a app then changing the MAC addr...

slender iron
#

thanks @analog valve

slender iron
slender iron
#

I ordered an intellikeys today

#

(and thanks for the video! I watched it)

tough flax
#

Just got home from the Lightning game (we won)

#

Good lord I hope you bought one on ebay

#

I have lots and would be happy to send you one

#

Sometimes they are like $300!

slender iron
#

oh, ya. like $40

#

is the interface custom or HID?

tough flax
#

Well, that's a question and a half

#

It's requires custom drivers

#

But I believe it uses an HID model

slender iron
#

do you have a copy of the descriptor?

tough flax
#

@scanlime did a teardown and we have the actual source of the drivers here:

#

Let me see if I can find it

slender iron
#

๐Ÿ‘

#

I'm just thinking about whether we'll do low level endpoint access in addition to higher level HID access

#

the lower level will work for more devices

tough flax
#

This is the USB Host library the "gdsports" wrote that interfaces with the IKeys

#

It's what we use today

#

GDSports (no idea their pronouns - and I asked and got no response)

slender iron
#

ya, I was looking at it but couldn't tell what the usb interface actually was

tough flax
#

But they reverse engineered that host from the source code we had released

slender iron
#

k, let me look at that

tough flax
#

It is based on an EZUSB which you are probably too young to remember

#

Basically, every time the device is connected, the full firmware is downloaded

#

It's a bizarre thing they did when non-volatile memory was rare

#

But you'll also see an original comment saying "these structs are wrong/not used"

#

So... you know

#

good stuff

slender iron
#

ya, it does seem like it is custom hid

tough flax
slender iron
#

yup, looks like vendor HID

tough flax
#

It's vendor HID... BUT, because it needs to load the firmware, it also needs to send the firmware. So it's not "driverless vendor HID"

slender iron
#

right, and the firmware is sent over hid too?

#

I saw the arduino driver does check pid to know the device state

tough flax
#

I'm not sure how GDSports was loading the firmware... I was delighted that it just worked ๐Ÿ™‚

slender iron
#

๐Ÿ™‚

tough flax
#

When Ablenet open sourced the drivers, they literally shipped me the hard drives from their servers

#

no docs, no help

#

"Here, it's all yours"

slender iron
#

having source is nice though

tough flax
#

Yes, rare for a device so old

#

and still used!

slender iron
#

ok, I'm off but I found the teardown video and will watch it

tough flax
#

Great - thanks for looking at this stuff... did my thoughts about how we buffer make sense to you?

manic glacierBOT
#

Mozilla WebAudio API covers a large portion of what you would like to see working in CircuitPython audioio, audiomixer and synthio: https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API
It is currently in Working-Draft for Javascript in Modern Web Browsers such as Firefox and Chrome and is very well documented, so much so that I have written several demo apps: https://github.com/adafruit/circuitpython/issues/5944

A CircuitPython port of this API would be able to bridge...

rigid mirage
#

I receive error when building STM32 ports,

#

./st_driver/stm32f4xx_hal_driver/Inc/stm32f4xx_hal_def.h:30:10: fatal error: stm32f4xx.h: No such file or directory

#

30 | #include "stm32f4xx.h"

#

Where "stm32f4xx.h"?

lone sandalBOT
orchid basinBOT
tulip sleet
#

@tough flax I also ordered an eBay intellikeys (same vendor as Scott, I think)

onyx hinge
orchid basinBOT
manic glacierBOT
#
[adafruit/circuitpython] New tag created: 7\.2\.0
orchid basinBOT
orchid basinBOT
slender iron
manic glacierBOT
manic glacierBOT
idle owl
#

@solar whale Greetings. Are you around? I have an Adafruit IO question you might be able to answer.

manic glacierBOT
#

Further to some investigation into audioio and audiomixer being missing from the Spresense build of CircuitPython
and providing some basic support for setBeep() coming from Arduino, there are a whole lot more Audio DSP features
of the Spresense SDK and Carrier Board with built-in Headphone Jack that both this board and other boards could find
useful: https://github.com/adafruit/circuitpython/issues/2676#issuecomment-1050119528

The Spresense has its own abstraction layer that may req...

idle owl
#

OK, figured out step 1. But now I think I'm running into a bug unless I'm missing something obvious.

manic glacierBOT