#circuitpython-dev

1 messages Β· Page 380 of 1

solar whale
#

Yes

slender iron
#

hrm, any led flashing?

solar whale
#

Yes , when I type it flashes but nothing on terminal session

slender iron
#

cp controls the one behind the mic icon

#

the two by the usb aren't controlled by cp

solar whale
#

yello LED by the reset button blinks when I type in screen , but nothing displays. it is 115200 baud, correct?

slender iron
#

ya

#

any blinks of the mic led after you click reset?

solar whale
#

yes -- it flashes

slender iron
#

k, that is cp starting up

#

and it should do the periodic blink after that

solar whale
#

alos flashes if I disconnect screen.

slender iron
#

but there is at least one bug I probably need to squash

#

hrm

solar whale
#

On a few occasions I saw the CP banner in the webusb display after connecting to the USB device

idle owl
slender iron
solar whale
#

but I can't always get there.

#

no

slender iron
#

the serial doesn't do connection detection like the native usb one does

tulip sleet
slender iron
#

but it persists over reset

idle owl
tulip sleet
#

You can generate the documentation locally by going to the top level of the circuitpython and doing make html.

tulip sleet
idle owl
solar whale
#

@slender iron just tried screen from linux as well -- same -- no reponse

idle owl
#

We do double backticks in libraries to get Sphinx to back off. Does that work here?

idle owl
#

Trying again after installing sphinxsearch.

#

That did not help.

solar whale
#
[1724605.094634] cdc_acm 3-3.3:1.1: ttyACM0: USB ACM device
[1724605.096983] hid-generic 0003:0D28:0204.013E: hiddev0,hidraw1: USB HID v1.00 Device [ARM "BBC micro:bit CMSIS-DAP"] on usb-0000:00:14.0-3.3/input3
[1724606.114643] scsi 8:0:0:0: Direct-Access     MBED     VFS              0.1  PQ: 0 ANSI: 2
[1724606.115072] sd 8:0:0:0: Attached scsi generic sg3 type 0
[1724606.115556] sd 8:0:0:0: [sdd] 131200 512-byte logical blocks: (67.2 MB/64.1 MiB)
[1724606.115818] sd 8:0:0:0: [sdd] Write Protect is off
[1724606.115820] sd 8:0:0:0: [sdd] Mode Sense: 03 00 00 00
[1724606.116072] sd 8:0:0:0: [sdd] No Caching mode page found
[1724606.116075] sd 8:0:0:0: [sdd] Assuming drive cache: write through
[1724606.160220]  sdd:
[1724606.162065] sd 8:0:0:0: [sdd] Attached SCSI removable disk
```  @slender iron thsi is what Linux sees
tulip sleet
#

yeah ,there are a bunch of things to install to do that

idle owl
#

ModuleNotFoundError: No module named 'sphinx_search' I can't figure out what it wants.

slender iron
#

@solar whale that's correct because the host is talking to the interface chip

idle owl
#

Like the only module I could find was sphinxsearch to install. Other iterations of it don't exist.

manic glacierBOT
idle owl
#

Trying readthedocs-sphinx-search.

slender iron
#

@solar whale I'd suggest trying the ble side again. (I'll be in a meeting in two minutes.)

solar whale
#

OK -- thanks

#

No BLE on Linux yet, correct?

slender iron
#

correct

#

and only mac and android support secure characteristics like we use

idle owl
#

It's doing more than it did before.

solar whale
#

Thanks -- I'll keep poking at it

idle owl
#

Alright! got the same as the remote failure.

#

@tulip sleet Double backticks seems to have gotten rid of the failure. I got this though. Which I think might be unrelated? WARNING: RSVG converter command 'rsvg-convert' cannot be run. Check the rsvg_converter_bin setting

manic glacierBOT
tulip sleet
idle owl
#

The docs built though and it worked. So good enough. Looking into the changes you asked for now.

#

@tulip sleet Is it all references to common_hal__adafruit_pixelbuf that should be single _ ? I have 48 references found.

tulip sleet
#

yes, change all of 'em

idle owl
#

On it.

tulip sleet
#

I started to mark them, and then realized there were MANY

idle owl
#

Yeah I wanted to make sure that I was right in changing all of them since you didn't mention them all. Before I hit go on 48 things. πŸ˜„

#

Also released Pixelbuf as 1.1.0. Good thing version numbers don't cost anything.

manic glacierBOT
idle owl
#

@tulip sleet Everything is failing. Seems unrelated to my PR.

manic glacierBOT
#

I would be happy to help with testing this build, but I am completely baffled about how to use the board.
I have occasionally managed to get the serial device to spit out the CP version info (see screenshot), but nothing else. I can see the CIRCPY BLE device but have made no progress connecting to it.
Should I be able to get to the REPL via something like screen? I can connect, but get no responses....
Clearly, I am missing something. Are there any instructions for using code.circu...

tulip sleet
#

i'll take a look in a bit

idle owl
#

Ok, thank you.

tulip sleet
#

@slender iron maybe it's worth writing a straw Guide for how to try the BLE workflow?

manic glacierBOT
#

Build failures are due to xtensa build caching. Nothing to do with your changes. To fix, we need to change the cache key:
Change
.github/workflows/build.yml, line 534:
OLD

        key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/esp32s2/esp-idf/HEAD') }}-20210506

NEW

        key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/esp32s2/esp-idf/HEAD') }}-20210716

In general, we update the key to today's date.

It is not clear to me at...

idle owl
# manic glacier

@tulip sleet I assume this is related to ^^ "AttributeError: 'Keys' object has no attribute 'overflowed'

tulip sleet
#

happy to have you approve it if you'd like

idle owl
#

I need a build for CPB.

tulip sleet
#

I can make one quicker, hold on

idle owl
#

Right on.

#

Trying to make this code work in the CPlayground library.

tulip sleet
idle owl
# tulip sleet for CPB, with .overflowed

Ok, without changing the way the library works, I don't know how to implement this into it. The code runs at least, so your build works. But just like the key event requires you to get() in the loop, this code requires you to call update() in the loop.

tulip sleet
#

just call update() in were_pressed()

#

or in .button_a

#

just call it once

idle owl
#

I did call it in were_pressed()........

#

Hmm

#

Getting (False, False) no matter what.

tulip sleet
#

value_when_pressed=True for the CPB buttons, I think

#

they are connected to +v, not ground, is that right?

idle owl
#

That did it!

#

Also I keep crashing due to heap something or other.

#

Into safe mode.

tulip sleet
#

that is bad, only on CPB?

#

it may be from the new BLE workflow code, maybe??

idle owl
#

That's all I've been using.

tulip sleet
#

no BLE on CPX, so maybe try that

idle owl
#

Testing on CPB first because CPX requires building.

thorny jay
#

I am the guy that tested the BLE workflow on the MagTag... I can now confirm that the MagTag is not using an nRF chip. 🀣

tulip sleet
#

but it still has antennas πŸ™‚

idle owl
#

@tulip sleet How would I make it return what it used to return with I think was a tuple with the button name versus True or False.?

tulip sleet
#

i will look

idle owl
#
        return tuple(self._states.was_pressed(i) for i in range(2))``` works for `True` `False`.
#

I'd have to hook up something running 6.x and verify.

#

@tulip sleet >>> print(cp.were_pressed) {'A'}

#

I wish I knew who or what was even using this feature.

#

But I'd rather not break anything in this library.

tulip sleet
#
        self._states.update()
        ret = set()
        for button, key_number in (("A", 0), ("B", 1)):
            if self._states.was_pressed(key_number):
                ret.add(button)
        return ret
#

did you do the same thing?

idle owl
#

No, that was from an old thing.

#

To show you what it did.

#

@tulip sleet Attempted heap allocation when VM not running. is how the CPB is crashing.

tulip sleet
#

that is either the new BLE code or the new HID code

#

but maybe more likely the former

idle owl
#

LOL I had the board upside down. Trying to test the buttons.

tulip sleet
#

two more ways to do it:

        self._states.update()
        ret = set()
        if self._states.was_pressed(0):
            ret.add("A")
        if self._states.was_pressed(1):
            ret.add("B")
# OR
        self._states.update()
        return { ("A", "B")[i] for i in range(2) if self._states.was_pressed(i) }
idle owl
#

"Why isn't button B working?!" "Oh, button A works....... wait did I make the pins backwards?" No. No I did not.

tulip sleet
#

there you have a set comprehension

idle owl
#

Ooooh.

#

I like it.

#

Also this crash is getting beyond frustrating.

#

I made it work.

#

I'm done testing on CPB.

manic glacierBOT
#

I have replicated this issue, with the same code, on a Circuit Playground Bluefruit writing to a Pyportal Titano
(CircuitPython 6.3.0).
The code hangs on the CPB when trying to verify if UARTService in connection, and if I turn off the Pyportal, the code on CPB crashes with this traceback:
File "adafruit_ble/__init__.py", line 75, in __contains__
File "adafruit_ble/__init__.py", line 52, in _discover_remote

Same code works correctly when connecting 2 Circuit Playground Bluefr...

tulip sleet
#

I think I would make key_states.py be a tiny library, because it's generally useful. Not sure what the name would be: "adafruit_keypad_helperoradafruit_keypad_states` or something like that

idle owl
#

@tulip sleet I straight up included the Keystates class in the CPlayground library

#

But yeah.

tulip sleet
#

are you using pressed() for button_a and button_b? That's why I included both.

idle owl
#

Yes.

tulip sleet
#

great, that was the idea

idle owl
#
        return self._states.pressed(1)```
#

I figured πŸ˜„

#

That's button B.

#

Which I added first, which is why I was so confused by it not working initially because the board was upside down. πŸ™„

tulip sleet
#

I'm worried about library size for this, hope it doesn't blow out the builds when frozen

idle owl
#

Oh crap, right.

#

Bet it does. Bleh. Let's create the helper lib.

tulip sleet
#

that won't make it smaller though, the same code will need to be frozen.

idle owl
#

Oh hmm right.

#

Because the helper would have to be added.

#

pbblltthhh.

#

Testing builds.

tulip sleet
#

yah, the helper could be made less general, maybe, if it doesn't fit. Main thing is to run over the events. I do wonder if were_pressed() is used by anybody.

#

then you wouldn't need keypad or the helper at all

#

used in Pyloton, but nothing else, in Learn repo

idle owl
#

Hmm.

#

I don't even know who added it, Radomir maybe. But the refactor makes the history lead to me.

idle owl
#

I was right, apparently.

#

Testing the build with your PR.

#

@tulip sleet I picked German. It's fine. What other ones are close?

tulip sleet
#

Japanese

idle owl
#

@tulip sleet Also fine.

#

I'll PR it to the lib so we can get it released, and then get the frozen mod updated.

tulip sleet
#

groan, I think it's because it doesn't know the type of scanner, but then it should just give up

#

I don't know why it thinks the type is key_count

idle owl
#

I don't either.

torn solar
#

Hello,
I am using a Raspberry Pi 4 with a DHT11 module and used the code given in the example "simple dht test" while changing it to the pin I am using. it says "Unable to set line 18 to input".

tulip sleet
idle owl
#

@tulip sleet Ugh, I can't even do int() because it whinges about it can't be key_count.

tulip sleet
#

i am cloning your repo to try some thigns

idle owl
#

Ok.

tulip sleet
#

! halbert@salmon:~/repos/kattni/Adafruit_CircuitPython_CircuitPlayground$ pre-commit run --all
black....................................................................Passed
reuse....................................................................Passed
Check Yaml...............................................................Passed
Fix End of Files.........................................................Passed
Trim Trailing Whitespace.................................................Passed
pylint (library code)....................................................Passed
pylint (examples code)...................................................Passed

idle owl
#

That doesn't build Sphinx.

tulip sleet
#

oh, sphinx, ok, hold on

idle owl
#

You have to do sphinx-build -E -W -b html ./docs/ _build/html from /

#

And then begin the good fight.

manic glacierBOT
tulip sleet
#

@idle owl I think this might be due to the error I fixed in the circuitpython PR you just approved. The error there was that both EventQueue and Keys were accidentally named Keys. So maybe it's confused due to that?? We can merge that and see what happens after its stubs are built. I don't even know where sphinx gets info about keypad

idle owl
#

@tulip sleet Oi. Ok.

#

Worth trying.

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0-alpha.4 on 2021-07-08; Raspberry Pi Pico with rp2040

Code/REPL

import board
import pulseio
import time

#GP0..N chained together
numPulseIns = 6

print("start")
time.sleep(1)

print("creating PulseIns")
pulseIns = []

for i in range(numPulseIns):
	pin = getattr(board, "GP%d" % (i+1))
	print(pin)
	pulseIn = pulseio.PulseIn(pin, maxlen=52)
	pulseIns.append(pulseIn)
time.sleep(1)

print("hi...
tulip sleet
idle owl
#

My pixelbuf PR passed! πŸŽ‰

tulip sleet
#

i will merge it

manic glacierBOT
#

There were issues with conflicting values in global variables when more than one PulseIn object was active at the same time. Those variables were moved to the pulseio pulsein object to keep them separate. This also corrects the problem noted in issue #4945 where the script would hang if more than 4 pulseins were active at once. The limit is now enforced at 8 (2 PIOs with 4 State Machines each). Note that if some other module is already using state machine(s) the limit will be less than 8.

idle owl
#

@tulip sleet Ok this was way more than time than I planned to put in today. I'll take it elsewhere later, but my point is, I'm done for today. Googling dealing with Sphinx warnings is failing to come up with anything useful. I don't know how to tell it to bugger off about that. Try rerunning it once things are merged, but I kind of doubt that will fix it. But I also have no idea where it's getting its information. I included keypad in the autodoc_mock_imports so it should be ignoring it. Anyway, have a nice weekend. I'll pick this up on Monday with you if it doesn't get sorted today.

tulip sleet
#

you too, have a nice weekend!

idle owl
#

@lone axle NeoPixel received the same treatment if you want to test it. And to test Trinket/QT Py, you'll need the Python version of adafruit_pixelbuf which I just added to the bundle today, so you'll need to get it from the repo directory until tomorrow.

#

I'm out!

lone axle
tulip sleet
slender iron
#

not at all!

slender iron
manic glacierBOT
#

Per https://github.com/adafruit/circuitpython/pull/4891#issuecomment-881718203, in reference to https://github.com/adafruit/circuitpython/pull/4891#issuecomment-881716673 about the NeoKey 1x4 QT I2C Breakout, and other hardware like the NeoKey Trinkey (cap touch, where touchio library is currently used), here's an enhancement request issue for the new keypad library to handle more hardware types by adding mo...

#

@dhalbert https://github.com/adafruit/circuitpython/pull/4891#issuecomment-881718203 Just today I came across a use case with the NeoKey Trinkey where it would be nice to have a single lib handle events & debounce, etc. for both the switch and the cap touch, so created the issue https://github.com/adafruit/circuitpython/issues/5014#issue-946683683. I hope the issue meets guidelines - I'm happy to rework it if not.

manic glacierBOT
#

I'm driving the SAMD21 DAC to generate a pulse going into an audio recorder AUX channel for video/multicam/audio syncing. Yes, this is Yet another linear time code (YaLTC for short). The pulse is triggered by a GPS PPS. For now I'm using an ISR within the Arduino IDE with trinket, QT-Py and Feather M0 proto boards for my prototypes (with your Quectel L80 breakout/wing boards). I know I could have used the PPS signal itself, fed into the audio recorder input but I want to keep the IC count ...

tulip sleet
storm minnow
#

Is there a better place than here for a general git question?

tulip sleet
storm minnow
#

Ah, I didn't spot that one. I'm just a little confused with some of the concepts around branches and updates

#

I'll pop my question in there and come back here if I get crickets XD

ornate breach
#

If there a way to disable the "USE_FAT" param in the uf2_samdx1 so a board doesn't show up as a USB Mass Storage device?

#

i tried defining it a 0 but that didn't work

jaunty juniper
#

I think it is CIRCUITPY_USB_MSC you want

ornate breach
#

well it built so i'm guessing it will work. Thanks for the help πŸ™‚

solar whale
#

@onyx hinge Thanks for the jpeg capture demo it is working well. Have you noticed that the stored images appear to be very dark compared to what is on the scrren when they are captured?

onyx hinge
#

@solar whale I agree, and I'm looking for a solution. In general terms, I think that switching between the RGB and JPEG modes is resetting a bunch of stuff including automatic gain / exposure compensation; and I think the solution is to figure out how to freeze those settings when switching, instead...

solar whale
#

OK -- thanks for confirming. I just wanted to make sure it was not something on my end. I'll look at it as well.

ornate breach
#

I was trying to disable it in the base bootloader

#

this board uses the SAMD21G17A which can't run circuitpython due to RAM and storage restraints

onyx hinge
#

oh! my mistake

ornate breach
#

but that is good to know in the future though πŸ™‚

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Hi @kevinjwalters From my reading of your linked comments above, what I'd getting is the data limitations of the I2C implementation were due to the ESP's memory constraints, rather than from the SPS. If that's true, are you able to query the full data from the SPS over I2C? If so, than I have no real need for an UART implementation, and I can use your I2C directly.
Thanks much for your efforts!

devout jolt
#

Hi! Why do MagTag & FunHouse (ESP32-S2) CP builds have audiobusio, audiocore and audiomixer when neither have the pins to allow an I2S board? (I realize that DAC & I2S are currently waiting on IDF updates but was surprised to see the other needed libraries there)

onyx hinge
#

todbot: I think i2s works on esp32-s2 in circuitpython (though the necessary pins may not be exposed on either of those boards you mentioned)

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Yes, it all comes back and looks plausible over i2c. Here's a run I did last week, I think it's documented as taking a while for numbers to stabilise on first start.

>>> import sps30_simpletest
Found SPS30 sensor, reading data...

Concentration Units (standard)
---------------------------------------
PM 1.0: 3       PM2.5: 11       PM10: 21
Concentration Units (number count)
---------------------------------------
Particles 0.3-0.5um / cm3: 0
Particles 0.3-1.0um / cm3: 14
Pa...
manic glacierBOT
#

Hi! I'm a hobbyist who enjoys making stuff. I have an EE degree, but have never really programmed consistently to make progress past the basics (i.e. I have to look things up from scratch every time). That said, I have some basic understanding of what I'm trying to accomplish, but often struggle to find an efficient way to accomplish it.

I usually find myself thinking in state machines. It helps me logically decide what to do and to stay organized. I think a good interrupt use case is...

lone sandalBOT
spiral elk
#

Is it looking like ESP32-C3 boards without UMS are going to be permissable ports?

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0-alpha.4-115-g3c25d8e2a on 2021-07-18; Raspberry Pi Pico with rp2040

Code/REPL

import board
import pulseio
import pwmio
import time

while(True):
	pwm = pwmio.PWMOut(board.GP0, frequency=38000, duty_cycle=2**15)
	pulseOut = pulseio.PulseOut(pwm)
	time.sleep(5)
	pulseOut.deinit()
	pwm.deinit()
	time.sleep(1)

Behavior

Sometimes the line is high after creating the PulseOut object. I guess ...

manic glacierBOT
manic glacierBOT
#

@ITACAInnovation please review this for your board. I wasn't sure why you had some pins set to not reset.

Hi @tannewt
thanks for the help, the pins should never reset because they control some hardware which should keep pre-defined values in order not to cause specific situations issues. I will check the compiled source on a board and be back to you with eventual changes to the source.

turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Region

us-west

Channel Categories

8

Text Channels

58

Voice Channels

6

Members

30002

Roles

35

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0-alpha.3-437-g394087869 on 2021-07-19; Adafruit CLUE nRF52840 Express with nRF52840

Code/REPL

print("hello")

Behavior

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

[tio 10:31:37] Disconnected
[tio 10:31:41] Connected
Auto-reload is off.
Running in safe mode! Not running saved code.

You are in safe mode because:
CircuitPyt...
manic glacierBOT
#

Re-tested this on 7.0.0-alpha.4 and got a different stack:

#0  reset_into_safe_mode (reason=reason@entry=GC_ALLOC_OUTSIDE_VM) at ../../supervisor/shared/safe_mode.c:123
#1  0x000287ce in gc_alloc (n_bytes=n_bytes@entry=16, alloc_flags=alloc_flags@entry=0, long_lived=<optimized out>)
    at ../../py/gc.c:508
#2  0x00027dc8 in m_malloc_maybe (num_bytes=num_bytes@entry=16, long_lived=long_lived@entry=false)
    at ../../py/malloc.c:103
#3  0x00037636 in mp_obj_new_exception_msg_vlis...
manic glacierBOT
#

@DavePutz noticed:

Re-tested this on 7.0.0-alpha.4 and got a different stack:

#0  reset_into_safe_mode (reason=reason@entry=GC_ALLOC_OUTSIDE_VM) at ../../supervisor/shared/safe_mode.c:123
#1  0x000287ce in gc_alloc (n_bytes=n_bytes@entry=16, alloc_flags=alloc_flags@entry=0, long_lived=<optimized out>)
    at ../../py/gc.c:508
#2  0x00027dc8 in m_malloc_maybe (num_bytes=num_bytes@entry=16, long_lived=long_lived@entry=false)
    at ../../py/malloc.c:103
#3  0x0...
onyx hinge
#

<@&356864093652516868> Our weekly voice meeting is later today, in about 95 minutes from now. If you have notes for us or plan to speak, please update https://docs.google.com/document/d/1fV_bv403ON4s5V7kyC9SQQU09w5qNU4zhW7QKJ92fHw/edit?usp=sharing -- if you plan to listen in, no need to do anything. Listeners should also feel free to come and go during the meeting, if you can't stay for the whole time. Scott is hosting today, I believe.

idle owl
slender iron
tulip sleet
idle owl
tulip sleet
#

oh yeah, I forgot that again. if there is some way to ignore the warning...

idle owl
modern wing
#

Happily lurking, while debating what's good for lunch....

thorny jay
#

Sorry skipping the meeting again, nothing from me in the doc. Nothing is more or less what I have done in CP this week. 😦

solar whale
#

Hope you are safe from flooding.

modern wing
#

@thorny jay "Nothing" is perfectly fine too. No reason to be sad -- take care of yourself, take care of each other.

thorny jay
sterile bronze
#

Just lurking today

idle owl
#

Hey, folks. We're finishing up an internal meeting. We'll be here soon.

solar whale
blissful pollen
#

Lurking today

errant grail
#

Just listening today.

manic glacierBOT
onyx hinge
#

We're finishing up our internal meeting, be with you soon <@&356864093652516868> !

solar whale
#

If the teacher does not show up by 10 after -- class dismissed...

modern wing
#

It's your tuition πŸ˜‰

#

(whatever you do, don't -- or do -- calculate how much each class "costs". It's....terrifying.)

old smelt
#

Lurking

turbid radish
#

lurking

onyx hinge
#

@solar whale any interest in adapting the jpeg camera example to rp2040 and seeing if it works?

solar whale
#

@onyx hinge Be happy to give it a try -- probably not until tomorrow or Wednesday though.

onyx hinge
#

@solar whale I'll let you know if I beat you to it

solar whale
#

I just "tore down"my RP2040 setup -- lots of wires to reconnect 😦

idle owl
#

It is.

onyx hinge
#

indeed

lone axle
#
Adafruit Industries - Makers, hackers, artists, designers and engineers!

Last week, we added two boards to Adafruit.io WipperSnapper – our no-code IoT project interface for adafruit.io. WipperSnapper now supports the Adafruit MagTag 2.9β€³ and the Metro ESP32-…

manic glacierBOT
modern wing
#

Thanks @turbid radish !

#

And @lone axle for posting the links here πŸ™‚

#

[I sincerely thought that was outside my window....]

solar whale
#

My dog just went running to the window

modern wing
#

haha, no worries. stay cool. 🧊

solar whale
#

No problem -- She thought it was the chewey.com order

onyx hinge
#

@lone axle you had success printing the keycaps? I was intensely worried it wouldn't work for anyone but me

turbid radish
#

Thank you Hierophect for all your work and dedication!

idle owl
#

😊 Thank you!

lone axle
onyx hinge
#

@lone axle keep me up to date with the results

storm minnow
#

Keycaps? Am interest

lone axle
storm minnow
#

Mmm, nice

#

I'll try

idle owl
#

@onyx hinge "Also known as the Clackulator, if you pick Blue keyswitches" πŸ˜†

modern wing
#

That has nothing compared to an IBM Model M buckling spring keyboard. ⌨️

#

clack-CLING.

#

-draws the ire of everyone within earshot-

onyx hinge
#

I think my Model M is why the people at my old job thought I was so competent. I wasn't, I was just assertively loud.

modern wing
#

"jeff, we like the cut of your jib! You're being promoted!"

storm minnow
#

I'm using a far quieter keyboard with Blue and White switches as my primary, but the Model M is my favorite

#

Can't be THAT noisy typing while on the phone for work, lol

manic glacierBOT
lone axle
#

Thanks all. Hope everyone has a good week! πŸŽ‰

turbid radish
#

Thanks all for supporting CircuitPython

onyx hinge
#

thanks!

gilded cradle
#

Thanks

analog bridge
#

Thanks blinka

ember iris
#

Thanks all!

modern wing
#

Thanks all!

blissful pollen
#

I barely heard about it either (just a random item I saw on reddit late last night)

manic glacierBOT
austere acorn
#

He was probably trying to be funny and troll the angry trolls ... that's how I saw it

#

People on Twitter like to jump on any angry bandwagon

#

There are huge farms dedicated specifically to farming bitcoin

#

that are basically just wasting energy

onyx hinge
#

https://en.wikipedia.org/wiki/Bitcoin#Energy_consumption_and_carbon_footprint probably covers the basics of the energy footprint argument for these distributed ledger systems, but I can't verify how accurate/bent it is.

Bitcoin (β‚Ώ) is a decentralized digital currency, without a central bank or single administrator, that can be sent from user to user on the peer-to-peer bitcoin network without the need for intermediaries. Transactions are verified by network nodes through cryptography and recorded in a public distributed ledger called a blockchain. The cryptocur...

ember iris
#

There's solid merit to both sides, which makes it trickier

onyx hinge
#

I'm signing off for now. πŸ‘‹

modern wing
#

I appreciate you taking the time now for this, thank you.

blissful pollen
#

Good explanation of it all thanks

ember iris
#

Thanks for all of this and for the explanation

modern wing
#

[I really do need to read up more on blockchain & NFTs -- coming from just a basic understanding of bitcoin, NFTs are new for me -- and I didn't immediately grasp the strong negative response from folks.]

analog bridge
#

@tulip sleet I just tested a bunch of esp32s2 uf2 reset issue and they all seem to be fixed with TinyUF2 0.5.0.

austere acorn
#

Which is why they were taken as just some random trolls who like to get angry about random buzz words (my opinion)

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0-alpha.4-109-g29aab69fb on 2021-07-17; microS2 with ESP32S2

Code/REPL

# Following is a forced way to enter safe mode.
# This also happens when safe mode is triggered automatically
# (i.e. due to crash, unhandeled exception etc.). 
import microcontroller
microcontroller.on_next_reset(microcontroller.RunMode.SAFE_MODE)
microcontroller.reset()

Behavior

  • The onboard led goes quick blue pulse -...
thorny jay
#

Hi, @solar whale I wanted to check if your MagTag was now running fine the COVID percentage app: https://github.com/adafruit/Adafruit_CircuitPython_MagTag/issues/62#issue-909578497 because in my case, despite updating the magtag library it fail. Then updating the firmware to adafruit-circuitpython-adafruit_magtag_2.9_grayscale-en_US-20210718-3c25d8e.uf2 it keep failing. It reboot without error message in magtag.network.connect()

solar whale
#

@thorny jay I do not have it running now. I will give it a try later today (or maybe tomorrow)

thorny jay
ionic elk
storm minnow
ionic elk
#

The whole situation is a bit complicated and I hope it comes to a neutral conclusion

#

I don't think it's fair to rag on anti-NFT people the way you might for more obvious social causes

storm minnow
#

Yeah, not fair to rag on anyone. PT said he'll be issuing an apology this week. I couldn't understand what exactly was considered mocking, but that doesn't make their feelings less valid

austere acorn
manic glacierBOT
idle owl
#

@tulip sleet Disconnected you from audio.

tulip sleet
manic glacierBOT
tulip sleet
#

Maybe we should rewrite the page to point to there and have unzip instructions, so we don't need to keep updating.

idle owl
tulip sleet
#

yes probably, that's a mirrored or template page, I guess

#

yah mirror

#

I will do a bit of a rewrite. Do you have any example of "download this and unzip and get this file?" There is not a link to "fresh bootloader" in circuitpython.org for the ESP32-S2 boards. Maybe I should add that...

idle owl
tulip sleet
#

"Please download this .zip file and then extract combined.bin" from it, is what I want to say. Not sure I need to elaborate further or not.

idle owl
#

Also, I just figured out where it's getting information about scanner. This doesn't clear up much for me in terms of fixing it, but it's getting it from the base class __init__: File "/Users/kattni/repos/Adafruit_CircuitPython_CircuitPlayground/adafruit_circuitplayground/circuit_playground_base.py", line 109, in __init__ self._states = KeyStates(self._keys) is the line in the traceback immediately before what Sphinx fails on.

idle owl
#

There are ways to suppress warnings, but I can't figure out how to configure it. So I'm fighting with that right now.

tulip sleet
#

if there were any type annotations there, I would think that was causing the problem. It may be doing type inference to figure out the type of the argument. :/

tulip sleet
#

I will take a look more in a bit after I rework that page and then close a bunch of issues related to TinyUF2.

onyx hinge
#

To me that traceback has the smell of when sphinx is using a "mock" for something, and the result doesn't work out. In particular, the thing that should be an int must be coming from a mocked module instead.

#

I don't know how that helps deal with this specific case though

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0-alpha.4 on 2021-07-08; Adafruit MagTag with ESP32S2

Code/REPL

Demo code can be fetched from here:
https://learn.adafruit.com/adafruit-magtag-covid-vaccination-percent-tracker/code-the-vaccination-tracker

Behavior

MagTag Vaccination tracker crash in magtag.network.connect() between 7alpha3 and 7alpha4

I tested MagTag Covid percentage tracker with 7.0.0-alpha.3 and 7.0.0-alpha.4.

Somewhere...

idle owl
#

Wait I just got it to pass.

#

It also doesn't document the majority of the library if I mock it. sigh.

onyx hinge
#

@idle owl I'll have a patch to offer you in a bit, I think

idle owl
#
autodoc: failed to import module 'bluefruit' from module 'adafruit_circuitplayground'; the following exception was raised:
Traceback (most recent call last):
  File "/Users/kattni/.virtualenvs/pylint/lib/python3.6/site-packages/sphinx/ext/autodoc/importer.py", line 70, in import_module
    return importlib.import_module(modname)
  File "/Users/kattni/.pyenv/versions/3.6.8/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/kattni/repos/Adafruit_CircuitPython_CircuitPlayground/adafruit_circuitplayground/bluefruit.py", line 173, in <module>
    cpb = Bluefruit()  # pylint: disable=invalid-name
  File "/Users/kattni/repos/Adafruit_CircuitPython_CircuitPlayground/adafruit_circuitplayground/bluefruit.py", line 49, in __init__
    super().__init__()
  File "/Users/kattni/repos/Adafruit_CircuitPython_CircuitPlayground/adafruit_circuitplayground/circuit_playground_base.py", line 107, in __init__
    self._states = KeyStates(self._keys)
  File "/Users/kattni/repos/Adafruit_CircuitPython_CircuitPlayground/adafruit_circuitplayground/circuit_playground_base.py", line 50, in __init__
    self._pressed = [False] * self._scanner.key_count
TypeError: can't multiply sequence by non-int of type 'key_count'```
#

Is the entire thing for context.

#

I can't figure out how to use nitpick_ignore properly apparently, or it doesn't apply here, and suppress_warnings I think doesn't apply either. We have to do something with the code, I guess?

manic glacierBOT
onyx hinge
#

@idle owl do you want me to push it direct to the pull request branch if I can, or do you want me to share it here so we can talk about it and you can apply it?

idle owl
manic glacierBOT
idle owl
#

Pushing will force me to do the git needed over here to update my local copy.

onyx hinge
#

The idea is, instead of relying on the way that sphinx tries to automatically create a version of some module that is not available ("mock" it, as in a "mock-up"), we just provide our own mock. Unlike theirs, key_count turns out to be a number.

idle owl
#

Hey it builds.

onyx hinge
#

the main downside of this is .. I don't think we have done it this way before, so it risks being an oddball that nobody else will understand

idle owl
#

This library is already an oddball.

#

I'm ok with it.

onyx hinge
#

or if we've done it similarly I haven't found where we did, and so I did it a slightly different way

idle owl
#

I don't think we ever have.

onyx hinge
#

the problem may come up with your next gamepad conversion and if so you have a potential solution in hand

idle owl
#

Indeed. Thanks!

onyx hinge
#

I'm headed out for the day, cheers

idle owl
#

Cheers!

onyx hinge
#

I never even opened my emails today

#

oh well

idle owl
#

Tomorrow!

manic glacierBOT
idle owl
#

@tulip sleet The CircuitPlayground library is updated and released, and therefore ready to be updated in the next CP build.

#

Er, CP release.

tulip sleet
#

I can update all the frozen libs; anything else pending of interest there?

idle owl
#

Hopefully the test builds I did with the KeyStates code in the CP library were accurate. There seemed to be plenty of space left, but... yeah.

tulip sleet
#

right, right

#

we will find out about space when I submit the PR πŸ™‚

idle owl
#

Exactly

tulip sleet
#

@idle owl I forgot I had automated updating the frozen libs:

$ cd circuitpython
$ git checkout -b new-branch-to-update-frozen-libs
$ make update-frozen-libraries   # does all the work!
$ git commit -a -m "update frozen libraries"
$ git push ...
#

i keep rediscovering this each time

manic glacierBOT
manic glacierBOT
#

I tested with adafruit-circuitpython-adafruit_magtag_2.9_grayscale-en_US-20210719-1b17b08.uf2 an artefact of #5017 and it reset loop in the same call as alpha-4.

Please notice that it crash very early in the program... before doing the background part.
Actually there might be no need to reduce the code to a minimum since I know where it crash:

from adafruit_magtag.magtag import MagTag
from adafruit_progressbar.progressbar import ProgressBar

# Set up where we'll be fetching dat...
#

Maybe I shoud rename the title to:

"from adafruit_progressbar import ProgressBar" make "magtag.network.connect()" crash.

Now I have a very small piece of code and adding one like make it crash...

from adafruit_magtag.magtag import MagTag

# If I put the following line, it make "magtag.network.connect()" crash.
#from adafruit_progressbar import ProgressBar

DATA_SOURCE = "https://raw.githubusercontent.com/owid/covid-19-data/master/public/data/vaccinations/country_data/Unit...
slender iron
#

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

spiral elk
slender iron
spiral elk
#

Yeah, assuming that. I was just noticing that most/all of the early boards coming out of china didn't implement the native USB.

slender iron
#

The C3 doesn't have built in USB so BLE will be the only option for it

#

It has a built-in usb to serial converter, not a generic USB peripheral.

spiral elk
#

Every board I've seen thus far uses an external UART, not even the built-in. Probably recycled old designs.

slender iron
#

ah interesting! maybe early issues of the chip had issues with the built in one

spiral elk
#

My understanding is that the main module-maker is trying to maintain some level of pin-compatibility at the module level, so maybe it was just chosen not to break them out. That would make some amount of sense.

slender iron
#

πŸ‘

#

compatibility is a good reason

vale spire
#

hello! Someone on the mpy forums is asking about the {i2c,spi}.{try_lock,unlock} methods and whether we have plans to add them to upstream. I have some guesses, but I'm curious as to what the contention scenario they're protecting against is -- https://forum.micropython.org/viewtopic.php?f=2&t=10862

slender iron
#

@vale spire its a bit of a nice to have for a parallel future. it does also allow us to use the busses "internally" which we do for displays

vale spire
#

thanks @slender iron ok awesome 2/2 on my guesses then πŸ™‚

slender iron
#

yup πŸ™‚

#

its usually managed by our bus device library

#

which uses context managers to try_lock and unlock

#

it should be fine to omit the locking stuff from a ported driver too

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0-alpha.4 on 2021-07-08; Adafruit Feather nRF52840 Express with nRF52840

Code/REPL

import sys
sys.print_exception

Behavior

Traceback (most recent call last):
File "", line 1, in
AttributeError: 'module' object has no attribute 'print_exception'

Description

We were using the sys.print_exception function to add tracebacks to our log entries, similar to what CPython allows. Unfortunatel...

#

I'm driving the SAMD21 DAC to generate a pulse going into an audio recorder AUX channel for video/multicam/audio syncing. Yes, this is Yet another linear time code (YaLTC for short). The pulse is triggered by a GPS PPS. For now I'm using an ISR within the Arduino IDE with trinket, QT-Py and Feather M0 proto boards for my prototypes (with your Quectel L80 breakout/wing boards). I know I could have used the PPS signal itself, fed into the audio recorder input but I want to keep the IC count...

vale spire
#

great, ok, thanks @slender iron !

manic glacierBOT
slender iron
#

wow, down to 3 open PRs

#

gets busy opening more PRs

manic glacierBOT
manic glacierBOT
vale spire
manic glacierBOT
#

@tannewt I think I was reading things wrong in terms of how much was removed from the sys module. As a minimum, print_exception and atexit seem to no longer be there, but are still present in MicroPython. Additionally (and I'm not overly clear on this one), exc_info is used by some MicroPython modules, but not documented under usys. So I'm not sure if it actually exists or not.

I removed print_exception during the merge because it was not CPython compatible.

I assume `ate...

noble mango
#

Can anyone find out what the lcd or I assume oled the https://www.ableton.com/en/push/ midi controller by ableton is using? I want to us it is a project.

Push is the music making instrument that perfectly integrates with Ableton Live. Make a song from scratch with hands on control of melody, beats and structure.

stuck elbow
#

possibly a custom thing

#

though there is a whole bunch of TFTs in that form factor

manic glacierBOT
noble mango
stuck elbow
manic glacierBOT
onyx hinge
#

Are these messages (seen in the learn system when running pylint) important? internal error with sending report for module ['Piano_In_The_Key_Of_Lime/NeoPixelAll.py'] module 'isort' has no attribute 'SortImports'

stuck elbow
#

this looks familiar

#

I think it's too old version of isort

solar whale
#

1222333weqewqewqesdadsadsazcxzcxzcxzsadasewqe212ewdsad

onyx hinge
#

That looks good to me

#

Thank you

solar whale
#

Glad to help -- working on cables to test JPEG on RP2040 -- may take some time..

#

Especially with my assistant!

manic glacierBOT
#

I removed print_exception during the merge because it was not CPython compatible.

I assume atexit was removed for the same reason, because in CPython the same functionality is fulfilled by the dedicated atexit module? I understand the desire for compatibility, but it seems problematic to remove working functionality with no replacement.

Correct. It should be relatively easy to move to a dedicated and compatible atexit native module. I don't think it's problematic because a...

slender iron
#

@tulip sleet do we need our own branch of pico-sdk still?

tulip sleet
#

I am getting CPy to compile with 1.2.0 right now: several new or renamed #if flags, etc.

#

hence my q re tinyusb

slender iron
#

kk, CP just uses our tinyusb submodule

#

the sdk version doesn't matter

tulip sleet
#

that's good. If I can get it to compile with straight raspberry_pi/pico-sdk, then that is best. I'll do a diff to check whether there are any significant remaining differences

#

if you could still check the board defs for any errors that would mess us up that would be great

#

i am not sure about flash size and timing divisors, etc

#

you can review and I will merge if ok but then not use

#

... I see you answered my questions in your comment

slender iron
#

we don't use the sdk board defines either

#

sorry in advance for having to update the files and flags since we're not using cmake

storm minnow
tidal kiln
#

@solar whale nice assistant. pretty sure they regularly attend the CP weekly meeting. so you should be in good hands...or.. toebeans

solar whale
#

@onyx hinge got ,y pico /ov2640 /st7789 wired up and I'm running the ov2640_displayio_pico_st789_2in.py -- it works, but my image is only showing as 160x120 -- did you get that on the pico?

onyx hinge
#

I don't remember

#

if that's what the source code says .. it may just be a mistake?

solar whale
#

it is set for 320x2440, but it gets scaled down ...

#

BTW -- the example is set to use the test pattern

#

I recall a similar issue with ov7670 and I don't recall how I got around it.. I'll keep trying...

#

FYI -- the ov7670 works OK ..

manic glacierBOT
#

I think the issue here is that anytime a PWMOut is created with a duty
cycle it starts outputting immediately. I don't think
that can be changed - there are library examples that depend on that
behavior. So, the best we can do is turn off the
PWM when a PulseOut is constructed, meaning there will likely be some
(unwanted) output on the pin. I'll make
that change and submit a new PR.

On Tue, Jul 20, 2021 at 10:21 AM Dan Halbert @.***>
wrote:

@DavePutz https://github.com/DavePutz Sh...

ionic elk
#

I have a style question - is there a reason why few of the functions in the supervisor/shared/memory.c module use a supervisor_ prefix? I feel like it would make them much less ambiguous when used in main.c

#

right now we have calls to free_memory and allocate_memory, which to the inexperienced might even look like standard library calls. Wouldn't supervisor_free_memory be better?

#

@tulip sleet you probably used this for the USB descriptor stuff so maybe you have comment

#

Even the parameter to these functions is supervisor_allocation *

tulip sleet
#

I agree with you. They could be supervisor_allocation_whatever or just supervisor_whatever. Feel free to clean up. They are not used that many places so longer is fine. As Scott says, that's what editors are for.

ionic elk
#

I think just supervisor_ should be fine, to match the struct. Functions would be:

  • supervisor_free_memory
  • supervisor_allocation_from_ptr
  • supervisor_allocate_remaining_memory
  • supervisor_find_hole
  • supervisor_allocate_memory_node
  • supervisor_allocate_memory
  • supervisor_get_allocation_length
#

supervisor_move_memory has the prefix already, for some reason

idle owl
#

@tulip sleet I wired this thing up. And it worked on the first try but the key events being returned were the wrong keys. Realised I had column and row pins swapped. Fixed that, and now no events are being returned. You did not include a wiring diagram in your guide to show how the pins should be laid out in the row_pins and column_pins arguments to match the matrix. I assume that's where the issue is as it "worked" initially.

tulip sleet
#

the diodes on this board are "backwards" from usual. Try setting columns_to_anodes=False in the KeyMatrix() constructor.

idle owl
#

Ooh getting events. Getting multiple keys per single key press though.

#

sigh.

#

Only on the first column.

#

Pressing and releasing 0 gives me <Event: key_number 0 pressed> <Event: key_number 6 pressed> <Event: key_number 0 released> <Event: key_number 6 released>

tulip sleet
#

When I wrote the guide I think the NeoKey was not in the store yet. I can add more info. I deliberately did not label the schematic because it was only a discussion item.

idle owl
#

6 gives 6 and 12, 12 gives 12 and 18, 18 gives 18 and 24, and 24 gives only 24.

tulip sleet
#

I can try wiring up mine and see what happens. I am about to be afk for a bit.

idle owl
#

Ok.

#

The columns_to_anodes=False, worked though.

tulip sleet
#

maybe doublecheck the list of pins in the rows and columns args. Maybe a one row is a column or vice versa

idle owl
#

Ok.

#

It's not.

#

They're on opposite sides of the Feather, so it's difficult to mix them up.

#

Tried wiring the row to a different pin, but same results.

ionic elk
#

@tulip sleet I feel like I asked you this before but the #ifdef EXTERNAL_FLASH_DEVICES and #if CIRCUITPY_USB_MIDI supervisor allocations were removed for a reason, right?

#

They're in the old PR of my rebase and I wanted to make a note of why they aren't in the current main

idle owl
#

@tulip sleet Probably worth mentioning, if I remove the first pin from column_pins and row_pins, then press a key in the second row and column (now the first), it does the same thing. Which means it's not my wiring I guess?

tulip sleet
#

i am going to eat and then will wire the board up

manic glacierBOT
idle owl
idle owl
#

Here's my code: ```py
import board
import neopixel
import keypad

pixels = neopixel.NeoPixel(board.D4, 30, brightness=0.3)
key_matrix = keypad.KeyMatrix(
row_pins=(board.D12, board.D11, board.D10, board.D9, board.D6),
column_pins=(board.A0, board.A1, board.A2, board.A3, board.D24, board.D25),
columns_to_anodes=False,
)
while True:
key_event = key_matrix.events.get()
if key_event:
print(key_event)

#

Also, right after a soft reload, it returns this with press and release of 0: code.py output: <Event: key_number 0 pressed> <Event: key_number 6 pressed> <Event: key_number 6 released> <Event: key_number 6 pressed> <Event: key_number 0 released> <Event: key_number 6 released>

#

Then it returns this on subsequent presses: <Event: key_number 0 pressed> <Event: key_number 6 pressed> <Event: key_number 0 released> <Event: key_number 6 released>

tulip sleet
#

i just finished wiring up one too. will try

idle owl
#

Fingers crossed it fails for you as well because otherwise I'm super confused.

#

Always on the first key press of the reload doesn't apparently matter what key I press: <Event: key_number 6 pressed> <Event: key_number 12 pressed> <Event: key_number 12 released> <Event: key_number 12 pressed> <Event: key_number 6 released> <Event: key_number 12 released>

#

afk.

tulip sleet
#

i am seeing similar weirdness, once I fixed my wiring errors

onyx hinge
#

The matrix class worked fine for me on the clackulator, which is a 4x5 matrix. I have a sheet of snap-apart but haven't wired it yet.

tulip sleet
#

is yours columns_to_anodes=True? I may have some logic wrong

onyx hinge
#

it's whatever the default was, I think

tulip sleet
#

worked fine for me on a non-diode matrix as well. Yes, the default is True

onyx hinge
#
    row_pins=(board.A2, board.A1, board.A3, board.A0, board.D0),
    column_pins=(board.D25, board.D11, board.D12, board.D24))
``` is my constructor
#

oh is the ghostly key always the one "below" in the scan order?

#

that's gotta be a clue

tulip sleet
#

yes, so my loop may be wrong, though I think Limor tested it

onyx hinge
#

The Kaluga devkit has a set of 6 buttons that act as a kind of analog keypad (each one causes a characteristic voltage to be seen on an analog input, due to some resistors). Is it unreasonable to think that there could be an analogkeys class to work with this?

#

adafruit doesn't seem to design or stock boards with these kinds of keypads so it's probably not a priority

manic glacierBOT
#

After the script stops with the exception thrown the final gc_sweep
will call any finalizers and they usually call deinit. deinit on
invalid objects can wreak havoc by changing random memory or
(hopefully) crashing. This fixes ensures the object is deinited
until initialization succeeds and the object is valid.

Do the same fix for I2C and SPI too.

Fixes #4700 and fixes #5005

#

This ends up being complicated, because of the way that ulab and circuitpython are interdependent -- to move ulab.ndarray to ulab.numpy.ndarray in the documentation requires a tandem change in both projects, or there are build errors. This is one of the reasons that ulab's PR https://github.com/v923z/micropython-ulab/pull/423 encountered build errors.

I believe that if this PR comes up green, and the ulab branch in adafruit/ulab-circuitpython comes up green, that it should be safe to ...

sharp fulcrum
#

Hey all, I am building a weather station and I want to make the Anemometer Wind Speed Sensor wireless. Either ble or wifi. Does this idea sound plausible or am I wasting my time?

blissful pollen
tulip sleet
#

@idle owl the matrix scanning problem is a timing problem. I'm switching a pin from output back to input, and it takes a little time to do that. This causes false reads. Need to think about the best way to fix this, but that's the problem. I thought it was some very odd problem with pullups and pulldowns, but it was just timing. Will work on it more tomorrow.

manic glacierBOT
manic glacierBOT
tulip sleet
#

@idle owl here is a test uf2 for your feather f2040. Works on my NeoKey matrix without false results.

manic glacierBOT
#

Switch ports/raspberrypi/sdk to be the 1.2.0 release of raspberrypi/pico-sdk.

Tested in various ways, including with a couple of I2C sensors and with the MacroPad display.

Note that changing a submodule's URL (which this does) can cause your repo clone to get out of sync and cause confusing build errors. Do a git submodule sync --recursive; git submodule update --init at the least.

manic glacierBOT
#

KeyMatrix was giving false readings with the NeoKey Ortho matrix, with the first column's key in most rows.

This was extremely confusing for a while, because it seemed to be related to pulls not being set properly. But the problem was really that when the row is changed from an output back to an input, it took a little too long to switch levels, due to the relatively weak internal pull resistor. Adding a delay of even 1us fixed the problem. But the best fix is to flip the output value ba...

onyx hinge
#

@tulip sleet if you swap rows and columns, isn't that the same as changing the diode direction? did the 5x6 ortho misbehave the same way if you did this (before #5031) ? I was about the perform the experiment but maybe you know already

tulip sleet
#

it is the same, but I added the argument to make that not necessary, since the keyboard has literal rows and columns, and it would just cause confusion.

onyx hinge
#

either way it's the rows that are driven and the columns that are read?

tulip sleet
#

I did not have a diode keyboard to test before I got the NeoKey, and was testing with a phone-style keypad with no diodes. I think Limor tested with a proto NeoKey and it worked, but the margin of error is so small that it could be sample-related

tulip sleet
#

I could have written two sets of nested loops and chosen one based on diode direction, but the current code is smaller - it chooses whether to pull up or down based on the diode direction

onyx hinge
#

yeah the code is more compact than what I imagined

tulip sleet
#

i used some existing code from somewhere as a model

#

this was extremely confusing because I added some resetting of the pulls at one place, and then it worked, and it looked for a while as if you could only change the pulls when the pin was set to output. But that was a complete red herring: the extra setting was adding enough extra time to fix the problem.

#

the pull resetting in DigitalInOut is somewhat torturous

onyx hinge
#

I don't quite see why it makes a difference, but that's probably down to me not having enough electronics experience.

#

Whether the row output is pulled or driven to its "not scanning this row right now" value, it can't cause current to flow through the diode any more or less, since it's in the reverse direction. It is the pull on the column input that would be draining away whatever voltage there was from earlier driving the row output in the way that lets current flow.

#

I wonder if what you added is a complicated but short delay

tulip sleet
#

if the pin is changed when it's an output and is using the push/pull active drivers, then plenty of current is used to change the level: the inherent capacitance charges quickly. But if I switch from output to input and just change the level by setting the appropriate pull up or down, then the inherent capacitance is charged only by the current through the pull resistor, which is something like 60k-80k. That's a much lower drive current than the active output drivers. So the capacitance takes longer to charge. It's still only a tiny amount of time, but it was enough to make a difference.

#

in other terms, the drive impedance of an output is much less than an input with pulls

#

yes, it's true adding the setting is also adding delay, but it is also driving the pin quickly to the other state. So they both help.

#

the latter is "more correct". The pins can change state at multi-MHz rates when actively driven, so I take advantage of that fact, rather than relying on the passive-pull RC time constant, which can vary.

#

I originally had an mp_hal_delay_us(1) in there, but it bothered me, and decided that slamming the output the other way was the right thing to do

onyx hinge
#

but how can driving the ROW output drain away charge stored in the capacitance on the COL input? Isn't that current flowing against the diode direction?

#

if that question is still nonsense, we can just cap the discussion and move on

tulip sleet
#

the diodes are reversed, so conventional current flows from the row to the col. The row was high, and the code was forcing it low with a pulldown after reading. But when it switched to the next row, the row was still charged from the previous high. The pull-down was going to pull it down eventually, but not quite soon enough. We only saw the false events on the first key in the row

#

i think that is true; i didn't actually analyze the current flow last night, but looking at a schematic now confirms it to me, I believe

#

i thought at first it might be a neokey error, though I couldn't imagine what it would be. I made an interior 2x2 matrix and tested with that, and confirmed the layout was fine

onyx hinge
tulip sleet
#

same idea

onyx hinge
#

in any case this seems like a "the proof of the pudding is in the eating" sort of change, it's only testing that'll show if it's an adequate fix. Some keypad might have a lot more capacitance, or some microcontroller a weaker internal pull resistor.

tulip sleet
#

i corrected what I think is a typo in the explanation above. The row charge is the one that needs to drain

#

the pulls are quite variable, spec'd 60k-80k, no more accurate than that. and it depends on the wiring too

#

it could have to do with cache line boundaries even, too, delaying code execution, etc.

onyx hinge
#

OK, I think that makes a bit more sense. The residual row charge can still pass through the diode and be driving the column to its "pressed" value, so draining it away by driving the row in the opposite direction makes that stop happening sooner.

tulip sleet
#

yes, that's my hypothesis

onyx hinge
#

Thank you for talking that through with me until I could get a handle on it.

tulip sleet
#

np, i need to verify my thinking too. the weird thing is that the setting the pulls when it was an input seemed not to work, but what was really happening is that it was working slowly. if the pulls got set when it was an output, then it seemed to work, but that was because the output was slamming it fast to the correct direction.

#

for instance, I tried setting the pulls twice, and that didn't help, but that's because that extra work took a lot less than a microsecond

onyx hinge
#

and the reason you wouldn't drive the row the opposite way whenever it's not the active row is because of diodeless matrices

tulip sleet
#

i think I may have deduced that at one time but forgot it, eys

#

there are actually very few "textbook" explanations of how to write this code, sort of like rotary encoders are also poorly explained. There is little canonical theory.

manic glacierBOT
tulip sleet
#

whew, glad! that was painful for us both

manic glacierBOT
slender iron
#

thanks for the merges @analog bridge

idle owl
#

@gilded cradle The keypad module won't work on Blinka yet, right? Has it been added that I missed?

idle owl
#

@gilded cradle Yes.

gilded cradle
idle owl
#

Working on the guide for the NeoKey Snap and wanted to make sure I shouldn't be making the page "Python & CircuitPython" versus making it "CircuitPython" only.

gilded cradle
idle owl
#

I think anyway.

gilded cradle
#

Oh, gotcha. I think we're out of stock on the orthos, so I can't add it at this time. If you'd like to give it a go, you can.

idle owl
#

Ooooh no. That's way outside my wheelhouse. rainbowio already Python-compatible code, heh. keypad is a whole other beast. In this case, it's supporting a key matrix, e.g. you give it columns and rows, and it knows what to do to find the keys.

#

I'll name the page "CircuitPython" for now, and we can always update it if/when we add keypad to Blinka. Thanks!

gilded cradle
#

@idle owl wasn't there already a circuitpython matrix library or something? Would that work?

#

Oh, looks like it has neopixels, so nevermind.

tulip sleet
idle owl
#

I don't need it to work on Python. I only need to make sure I document things properly πŸ™‚

tulip sleet
#

the keypad module does background scanning; we'd need a thread or a process to do it properly

idle owl
#

Yeah I figured it would be something complicated.

gilded cradle
#

Fair enough

tulip sleet
#

i don't think the implementation will be that complicated, but I'm not sure of the use cases.

gilded cradle
#

Threads aren't really hard to implement (I did it with displayio), it just needs some initial setup

idle owl
#

Ah fair enough.

idle owl
#

NeoKey Ortho Snap on a Pi? Seems like a reasonable use case.

#

But I guess we can wait until someone wants it.

gilded cradle
#

I put in a request to be notified when more orthos are in stock, so I can add it after that.

manic glacierBOT
gloomy shuttle
idle owl
#

@gloomy shuttle What's the use case?

#

It's someone else who put together the U2IF support. Dan didn't handle that.

gloomy shuttle
#

I have been playing with a the u2if, neokeys, and i2c rotary encoder on my mac but the MacroPad would provide faster input than reading i2c

idle owl
#

Hmm fair enough. Presumably that would work. I'll mention it.

gloomy shuttle
#

it is not important but thought it was a nice usecase for keypad and Blinka.

idle owl
onyx hinge
#

@solar whale that's awesome, thank you!

manic glacierBOT
#

CircuitPython version

CircuitPython 7.0.0 Alpha 4 (not sure, but I cloned it from https://github.com/adafruit/circuitpython.git)

Code/REPL

git clone https://github.com/adafruit/circuitpython.git
cd circuitpython
git submodule sync --quiet --recursive
git submodule update --init

# Install pip if it is not already installed (Linux only)
sudo apt install python3-pip

# Install needed Python packages from pypi.org.
pip3 install -r requirements-dev.txt...
#

CircuitPython version

Adafruit CircuitPython 7.0.0-alpha.4 on 2021-07-08; FeatherS2 with ESP32S2

Code/REPL

import keypad
import microcontroller.pin as pin
import time

row_pins = [pin.GPIO43, pin.GPIO44, pin.GPIO37, pin.GPIO35, pin.GPIO36, pin.GPIO5, pin.GPIO6]
column_pins = [pin.GPIO17, pin.GPIO18, pin.GPIO13, pin.GPIO12, pin.GPIO6, pin.GPIO5]
neo_pin = pin.GPIO11

keypad = keypad.KeyMatrix(row_pins=row_pins, column_pins=column_pins, columns_to_ano...
onyx hinge
#

@tulip sleet do you have any testing/reports about KeyMatrix on esp32s2? because it floated to the top of my box of feathers, I put a Feather S2 together with the ortho keypad, but even after (I think!) getting the matrix pins named correctly it's not working. It never registers any keypresses. I'll hook up a scope and see if it's scanning..

#

OK it was something with my anodes but also I still have some pins wrong / some rows & cols aren't working

tulip sleet
tulip sleet
onyx hinge
#

one key was not quite inserted, and one column isn't reading back at all

#

argh okay

tulip sleet
#

are we not checking for those special pins in DigitalInOut? We should throw some errors

onyx hinge
#

I don't know

#
row_pins = [pin.GPIO43, pin.GPIO44, pin.GPIO37, pin.GPIO35, pin.GPIO36] 
column_pins = [pin.GPIO17, pin.GPIO18, pin.GPIO13, pin.GPIO12, pin.GPIO6, pin.GPIO5]
neo_pin = pin.GPIO11

keypad = keypad.KeyMatrix(row_pins=row_pins, column_pins=column_pins, columns_to_anodes=False)
``` This is what "works" except that no key on the GPIO13 column registers.
tulip sleet
#

i looked - no, there is no special consideration for those pins in DigitalInOut

onyx hinge
tulip sleet
#

do you have a Metro - that would be easier

onyx hinge
#

I do but it's all hard-wired now πŸ˜•

tulip sleet
#

sorry - i have about three of them

onyx hinge
#

and I just had the one key sheet

lime trellis
blissful pollen
onyx hinge
#

@lime trellis that matches the printed card I have

#

after a bit of manual checking, I jumped to the conclusion that the silk numbers were the microcontroller.pin.GPIOab numbers

#

the schematic PDF I found has IO numbers that don't match much of anything

#

oh wait, I copied a number wrong maybe?

#

yay, okay, now all keys work πŸ™‚

manic glacierBOT
onyx hinge
#

@slender iron is the hack chat in about 1h from now?

tulip sleet
#

@slender iron @onyx hinge @idle owl I wrote 7.0.0 alpha.5 draft release notes. It did not take that long. I think we may as well do an alpha.5: there are fixes that we are recommending Absolute Newest for, and there are no imminent PR's I know of (still plenty to fix). The last release was 13 days ago. I can start a release build now if you agree.

slender iron
#

er, drive size

#

@onyx hinge I just pushed cascadetoml 0.3.1 to remove the print that bugs you

onyx hinge
#

@tulip sleet I think you have the pulse of 7.0.0 better than I do.

#

so if you say it's good to go I say go for it

tulip sleet
#

@slender iron I can wait for that if you'd like

slender iron
#

it'd be nice to be in. will make the PR now

#

it's small

onyx hinge
#

will this be the first one with the reduced type object stuff? that'll probably cause a bug πŸͺ³

tulip sleet
#

yes, it's in there, we can rely on our intrepid testers πŸ™‚

onyx hinge
#

πŸ› huh the "bug" emoj is a cute little inchworm looking fella

tulip sleet
#

i think split types is pretty solid, actually, considering it's been in use through lots of recent bug fix testing for various native modules

solar whale
manic glacierBOT
onyx hinge
#

@solar whale done! I don't think I need to make a release just for examples changes .. (I did a release today for jpeg so it would get in the bundle)

solar whale
#

No problem, just wanted β€œoff my plate”. Thanks

onyx hinge
#

🍜 sitting down to lunch so I don't act hangry during the hack chat

tulip sleet
#

@slender iron were you going to update cascadetoml in the new PR?

#

i don't see that

slender iron
#

I don't think I need to from cp

#

is it pinned somewhere?

#

the change is just cosmetic for jeff

#

its not required

tulip sleet
#

np, yes, strictly cosmetic

#

i cloned your repo and will do some test builds while it's buildling

slender iron
#

kk

manic glacierBOT
#

I think I'm missing a memo here. Between the information at the top of this pull request and @todbot's Gist from 5/17/21, I got to https://github.com/Billfred/Serpente-iPad-HID/commit/affb16ef655ac5fc5fdbf9196b0c88baee582c0d for boot.py on my Serpente R2. Reset the board, and boot_out.txt reads:

Adafruit CircuitPython 7.0.0-alpha.4 on 2021-07-08; Serpente with samd21e18
boot.py output:
Traceback (most recent call last):
  File "boot.py", line 19, in <module>
AttributeError: 'modul...
tulip sleet
#

@slender iron I tried 7.0.0-alpha.4 and your new build on the Arduino Nano, and both times it is about 1MB. Is that right?

#

maybe i need to reformat

#

that was it, needed storage.erase_filesystem()

lime trellis
#

we need a space to chat about implementing the SAMD51/E51 deep sleep, should we chat in this channel or make a group chat?

manic glacierBOT
idle owl
pearl hare
#

ok, question about the alarm. if the cpu is in light sleep, any interrupt will wake it. normally, the RTC is set before issuing the sleep command. the rtc can operated as 32 bit counter, or in calendar mode. what is the maximum time to set for sleep?

lime trellis
#

In an effort to implement D51/E51 deep sleep, @pearl hare has offered some of his low-level SAMD51/E51 experience.

@ionic elk (or <@&681912791711350805>) is it safe to assume deep sleep register twiddling is mostly contained in these directories?

lime trellis
pearl hare
#

what is the resolution of this time? clock cycles? seconds?

lime trellis
analog bridge
pearl hare
#

stm32_peripherals_rtc_assign_alarm_callback(PERIPHERALS_ALARM_B,timer_callback);
stm32_peripherals_rtc_set_alarm(PERIPHERALS_ALARM_B,deep_sleep_ticks);

these are the functions where it gets interesting! looks like this is a simple RTC in counter mode. don't know how to drill down to it in github.

analog bridge
lime trellis
slender iron
pearl hare
#

so the RTC must be set to 1kHz mode. the SAMD5x has a 32-bit counter.

slender iron
#

I think we run it in 32khz and then have 32 "subticks"

pearl hare
#

let me calculate.. if it is set to 1kHz, it wraps around after 50 days

#

with 32 khz, it's 1.5 days

slender iron
#

on overflow it'll interrupt and we'll store the overflow in ram

pearl hare
lime trellis
pearl hare
#

it has to be modified a bit, but this should be easy

analog bridge
#

This will also help in understanding the alarm logic.

pearl hare
#

pretending to sleep doesn't need hardware specific code, is that working?

lime trellis
slender iron
#

time.sleep() will use wfi on samd I think

pearl hare
#

looking at /ports/atmel-samd/peripherals
there is no RTC module in there. in fact, the directory is empty.

pearl hare
#

you're right

lime trellis
#

gets linked up based on the makefile

slender iron
#

the peripherals folder is for samd abstractions that aren't in asf and aren't cp specific

pearl hare
#

so we add an rtc.c and use the same function prototypes as in the STM port?

slender iron
#

have you looked in common-hal/rtc?

#

that's where the common function prototype stuff should be

#

(I'm also in a hackchat atm)

lime trellis
#

so it seems like everything in stm/peripherals/rtc.c should've been in common-hal/rtc/?

tulip sleet
#

it is factored out for coding convenience. It is meant to be non-CircuitPython specific hal-related code

lime trellis
#

gotcha

tulip sleet
#

the samd-peripherals separate repo is like that

analog bridge
#

peripherals contains the code that is shared between more than one common-hal module

pearl hare
#

two things: that functions to implement and where to put it. only low-level stuff.

#

sorry: what functions

tulip sleet
#

we are all in another video/text chat right now that is happening simultaneously, so bear with us

slender iron
jaunty juniper
#

so I am exploring the idea of having a bundle of keyboard layouts that would be compatible with circup, so you can install the one you want, without stuffing the hid library, right now it's mostly a test for making a bundle that works with circup, it only has an example layout and an exemple keycodes module, https://github.com/Neradoc/Circuitpython_Keyboard_Layouts

pearl hare
#

@lime trellis and I are still unsure where to put the RTC low level stuff. I could use some empty functions and a place where to put the implementation for SAMD. I saw that ASF is used?

#

here for example: samd-peripherals/samd/sam_d5x_e5x/adc.c

tulip sleet
#

if you can avoid using ASF easily, that would be nice, because ASF4 is kind of terrible to use: you have to use the app builder and updating the generated stuff is painful. We have a long-term goal (probably not ever going to happen) of not using ASF. ASF3 was a lot easier.

#

the README explains the point of it

slender iron
#

more of the work is setting the alarms

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

Really wish I had thought of some fancy solution to soldering up this NeoKey Snap. Instead it's a mess of wires. 😦

#

@onyx hinge What did you do with yours to make it one piece?

orchid basinBOT
onyx hinge
#

@idle owl 3d printing πŸ˜‰

idle owl
#

@onyx hinge Fair enough.

onyx hinge
#

I'll share the stl file, it's designed for heat-set inserts but you could probably use a long screw & a nut on the back side instead

idle owl
#

No idea where but I'm pretty sure we do.

onyx hinge
#

M2.5 though

#

@slender iron is tempting me to buy one of those ploopy trackballs. I used to love my trackball (it was the 90s) but never upgraded to one with a scrolly.

idle owl
#

Oh Adafruit only ever sold the M3 I guess.

onyx hinge
#

I could re-do the file for M3s if you want, it would just be a few minutes

idle owl
#

If you want to, I won't turn it down.

onyx hinge
#

though .. I don't think you can put M3 screws in a Feather

#

so I'm unsure

idle owl
#

Ah right. Hmm.

#

Nah you're probably right. I can do it with the 2.5 plastic standoffs and screws I bet though.

lime trellis
#

@pearl hare So i think the take away with deep-sleep is that there's enough difference between ports that you should start with implementing pieces of ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c and begin determining what low-level ASF esque functions you'll need. Then search in the various ASF, ASF4, and ports/atmel-samd/supervisor/port.c (among others) to see if they exist

onyx hinge
#

I bet you want to put the nylon screw in from the bottom and a hex nut on top, so it's less scratchy

idle owl
#

I have a baseplate on it that Noe designed earlier today. But it doesn't hold a Feather.

#

Nylon screws holding that on.

onyx hinge
#

yeah I saw Noe's design as well, but I'd already done this and I like how it also holds the microcontroller

onyx hinge
#

I made a 3d printed plate too, but I used a 0.76in spacing instead of 0.75 so I need to re-print it. should be quick, I just need to change a parameter

idle owl
#

I have only one more Feather RP2040 that isn't header soldered (only ever had 2 total I think) so I'd have to sacrifice that to the NeoKey Snap to have this same setup. Could probably use an M4 instead, should have a ton of those.

#

They're all out of stock ATM.

onyx hinge
#

should work with basically any feather

#

as I mentioned, I used a Feather S2 and lucked out on the pins I chose

idle owl
#

Right, I know. And this code is specifically using pins that are on all of the Adafruit Feathers.

#

I stayed away from D24 and D25.

onyx hinge
#

I don't know if it's obvious from my photo, but I only put 4 screws for the keypad (1 in from each corner) + 3 for the feather (feather s2 doesn't have the 4th hole)

idle owl
#

It was sort of clear?

onyx hinge
#

snaking the wires under the bars was a bit of a pain, use tweezers or something to guide the wires

idle owl
#

wiresnek.

onyx hinge
#

the bars aren't as tall as the cylinders, I put the bars against the table but maybe it would have been better to put the bars against the board. I was making it up as I went.

#

doing it my way ends up trapping the wires which seems preferable, less chance of pulling on them

idle owl
#

Yeah that's fair.

#

Totally unrelated: one thing I will say about this Corsair keyboard I use is the volume controller on it is SO smooth. If it wasn't tied to something that increases volume in my ears, I'd probably fidget with it regularly.

#

Sideways rotary encoder probably.

#

File under things I would have laughed at the idea of me even having a clue about 4 years ago.

ionic elk
#

@pearl hare @lime trellis woof I missed a lot of conversation here so I'm still getting caught up. I use STM32 peripherals/ to factor out chip peripherals that are used in multiple common-hal modules. The RTC is manipulated by Port.c, the RTC module, and Deep Sleep, so it was a good candidate for that stuff to be moved out.

I haven't totally figured out how the SAMD would need to be organized yet, but I think it is pretty similar to STM, where sleep modes are managed by the PWR module but the RTC is also part of that "domain", as is the low power SRAM

storm minnow
ionic elk
#

I didn't realize we had an ASF avoidance goal - in this particular case, it would make things very easy since it has one-line calls for setting up light/deep sleep, but if the API is prone to changes that's obviously a no-go.

pearl hare
#

@ionic elk all the hri_* functions in ASF basically are "bare metal" functions. if you plan to avoid ASF, move the implementations from there into the project.

storm minnow
ionic elk
#

@pearl hare yes I've sometimes done the same thing with STM32 when the API doesn't fit well, though with STM32 the HAL is much more desirable since it covers the hundreds of minute differences between ST's sprawling chip lines

#

Also, pretending to sleep is not necessarily non-hardware-specific. You still need the alarms to go off, and prevent essential stuff from being turned off by the "reset" that occurs at the end of the VM run

#

Regarding TimeAlarm: you must be conscious of what timekeeping you are using, and how it triggers an interrupt. Circuitpython is not amazing about sorting timekeeping right now and there are often multiple sources of "ticks", some of which will shut off during deep sleep, some of which won't. Obviously, any form of timekeeping that shuts off during deep sleep is unnacceptable

#

In the ST case, ticks are measured with the RTC module, and an alarm can be set with the same system. However, this is not true for the ESP32S2, for instance. Start from the port implementation of "get_time_monotonic" and extrapolate from there

#

STM32 uses a calendar interrupt. So it does not compare to an absolute ticks time, and can support much larger intervals

#

But that calendar interrupt is calculated using a ticks basis

pearl hare
ionic elk
#

So, question, does the SAMD RTC have calendar registers that it increments based on a tick value?

pearl hare
ionic elk
#

I'd have to look at what "calendar mode" is

pearl hare
#

the RTC clock has to be set to 1kHz to work correctly

ionic elk
#

ST just has a calendar and ticks

#

far as I can recall

#

I would imagine we want to use a calendar for interrupts, if possible. Deep sleep should be able to go for long periods of time

pearl hare
#

the question is, how long is necessary? with an rtc counter in 32 bit mode, you reach the overflow in 50 days with an 1khz clock source.

ionic elk
#

I don't know, we've never had a port where we had to ask that before. They all use calendars

pearl hare
#

and still the resolution is 1ms

ionic elk
#

For consistency, it would be ideal if SAMD did the same

pearl hare
#

well the purpose is to save power. if you wake up once a day and count the days you woke up, you won't lose an incredible amount of power.

ionic elk
#

Sure, this is more about style/maintainability than nitpicking performance

#

I'm maybe not understanding correctly. Since a calendar interrupt is available on SAMD, why don't we use it?

pearl hare
#

in calendar mode, the resolution seems to be down to 1 second, is that also consistent?

ionic elk
#

Yes, we don't go lower than seconds for deep sleep

#

Several ports don't support sleeping for intervals lower than 5s at all

#

(deep sleeping. Light sleeping is more flexible)

#

I mean in general if you're sleeping for very short periods, time.sleep() is usually equivalent to light sleep performance anyway

pearl hare
#

in ports/atmel-samd/supervisor/port.c, I see that the RTC is set to 32 bit counter mode

ionic elk
#

Let me check out the datasheet here so I understand this counter vs calendar mode business

pearl hare
#

you can switch the modes. but calendar mode needs a 1khz clock to work correctly. and I don't know the implications if the supervisor initialization is changed.

#

the RTC_handler() in port.c seems to assume a specific clock frequency.

#

void RTC_Handler(void) {
uint32_t intflag = RTC->MODE0.INTFLAG.reg;
if (intflag & RTC_MODE0_INTFLAG_OVF) {
RTC->MODE0.INTFLAG.reg = RTC_MODE0_INTFLAG_OVF;
// Our RTC is 32 bits and we're clocking it at 16.384khz which is 16 (2 ** 4) subticks per
// tick.
overflowed_ticks += (1L << (32 - 4));
}

ionic elk
#

Hmm. While I'd rather not mess with that, if it's being clocked at 16kHz, that's a 3 day maximum sleep time. Which probably isn't terrible, since most projects will be in the 1h to 24h range, I would imagine, but still kind of restrictive

#

Since the program will assume that every wake happens at the datetime it was requested, and we don't have a mechanism for indicating that a wake isn't "real", we'll want a ValueError for any time over 3 days

tulip sleet
storm minnow
#

What's ASF?

ionic elk
#

the firmware HAL layer provided for SAMD

storm minnow
#

Ah

ionic elk
#

@tulip sleet I'm not desperate to use it, since the chip variety seems lower within the SAMD port

tulip sleet
slender iron
#

counter modes are much simpler

ionic elk
#

I shouldn't have generalized - RP2040 has a calendar mode, but ESP32-S2 actually doesn't use an RTC peripheral at all, and NRF is polling. I guess I should check out what the maximum intervals for NRF and ESP32S2 are, come to think of it

#

RP2040 was fresh on my mind but you're right

tulip sleet
stuck elbow
#

uh, I need to port ugame.py on pygamer and pybadge to keypad

slender iron
#

@tulip sleet want to chat about the audio problems tomorrow? may help to generate more ideas to try

tulip sleet
#

sure; i'll ping you in the morning when I see you on

slender iron
#

kk, I've got a doctor appt at 11 my time and meeting with trevor at 1. free otherwise

tulip sleet
#

if you want to do email before 11, that's ok, we could do it after. Or that first and then email for you. THere is not as much of a PR backlog at the moment.

slender iron
#

kk

#

we can coordinate tomorrow

tulip sleet
#

@idle owl we can talk about were_pressed() tomw

#

when you have time

idle owl
manic glacierBOT
manic glacierBOT
#

It seems like the value passed to mp_raise_OSError is generally a positive errno value.

py/mperrno.h:#define MP_ENOENT             (2) // No such file or directory
...
ports/unix/modffi.c:        mp_raise_OSError(MP_ENOENT);

but sometimes they're raised as negative values

extmod/vfs_lfsx.c:            mp_raise_OSError(-MP_ENOENT);

Does the positive/negative distinction mean something? Should a named constant such as MP_NOENT be used here instead of the number 2?

hollow token
#

@slender iron Wouldn't removing socket break regular py compat?

crimson ferry
#

CircuitPython's socket module isn't in any builds. With Blinka, import socket will use the platform's own Python module

manic glacierBOT
manic glacierBOT
main furnace
#

I would like to help with CircuitPython Audio. I have Metro M4 and FeatherS2 boards, and the MAX98375 amplifier breakout, with a mostly working drum sample player on each board.

calm aspen
#

is there a way to drop a circuitpython uf2 on a board and not have it expose the code.py as a disk drive?

#

sorry, rephrase. not expose code.py ON the disk drive

solar whale
calm aspen
#

Thank you Jerryn, that was what I was wondering and didn't explain the ask very well. I was curious if there was a way to hide the drive entirely. thanks!

onyx hinge
#

@tulip sleet I just noticed that there's no alpha.5, at least on this board page: https://circuitpython.org/board/qtpy_m0/

Note: If you soldered the optional SOIC-8 SPI Flash chip on to your QT Py, see the β€œQT Py Haxpress” page to make use of the extra space!What a cutie pie! Or is it… a QT Py? This diminutive dev board comes with our favorite lil chip, the SAMD21 (as made famous in our GEMMA M0 and Trinket M0 boar...

solar whale
#

@calm aspen Be careful and make sure you know how to delete boot.py from the REPL or get into safe mode so you can load new files if you need to.

onyx hinge
tulip sleet
#

my fault - I was waiting for the builds to finish and forgot to merge this

onyx hinge
#

I hope it was OK to merge now, since I just did

tulip sleet
#

yes, definitely

#

thanku

onyx hinge
#

you're welcome

#

OK, the download page refreshed to show alpha.5 as available

ornate breach
#

Is there plans for 6.3.1 or 6.4 before 7.0.0 releases?

onyx hinge
#

@idle owl adafruit_ticks is a new timekeeping library that uses the new supervisor.ticks_ms but is also back compatible to time.monotonic_ns or time.monotonic for compat with 6.x. It is 556 bytes mpy-compiled for 7.0. Is it reasonable to contemplate moving the LED animation library to use it?

tulip sleet
ornate breach
#

Okay cool

onyx hinge
#

In fact, the 6.3.x milestone was down to 0 issues and we removed it; there are no changes in the 6.3 branch since 6.3.0 was released.

#

new information could change our plans, of course, but the circuitpython issue tracker tells us no 6.3.1 or 6.4 is needed.

ornate breach
#

That’s good to hear πŸ™‚

#

7 seems like it will be really good

#

Do we know the point when CP gets too much for samd21 to run?

#

It seems like we’re getting really close to that point

solar whale
#

@slender iron will other nrf52832 boards be supported by CP once the micro-bit is working? I was going to to respond to this forum post and tell them the nrf52 Bluefruit LE not supported but wanted to check if it was a possibility https://forums.adafruit.com/viewtopic.php?f=57&t=181466

#

Ah -- nevermind -- I see microbit is an nrf52833..my mistake.

tulip sleet
#

so I doubt whether we would try that.

solar whale
jaunty juniper
#

yep

ionic elk
#

Wow I guess I missed it but when did the Circuitpython PR list drop down to five?

#

I visited the page and got confused, I thought I was looking at someone's fork

analog bridge
ionic elk
#

good stuff

manic glacierBOT
manic glacierBOT
#

New PR to avoid force pushing rebase over the old one. In retrospect, I don't think this needs any special interaction with deep sleep, since it's really for passing tracebacks and deep sleep exceptions don't have those. If code needs to detect if the last exception was deepsleep vs startup, it should just use the alarm module as per usual. Tested on a Feather M4 Express, works as expected. Useful for #1084.

Heads up for @tannewt to take a look at the string stuff in this since I'm not sur...

slender iron
manic glacierBOT