#circuitpython-dev

1 messages Β· Page 378 of 1

onyx hinge
#

@idle owl I should step away from the computer and eat breakfast instead but for now you can have me

idle owl
#

It should be quick!

#

I want to integrate this feature: https://github.com/adafruit/Adafruit_CircuitPython_Simple_Text_Display/blob/main/adafruit_simple_text_display.py like I did here: https://github.com/adafruit/Adafruit_CircuitPython_CLUE/blob/3fb9fefbccd5cf36fb378e2c819b2e81c98ff14d/adafruit_clue.py#L63 (which is where the Simple Text Display library came from, it started in CLUE). I don't need colors, which I can easily update Simple Text Display to have a "monochrome" option. My question is, should I put it directly into the MacroPad library? Or should I super init the separate Simple Text Display library since I already wrote it separately?

onyx hinge
#

Basically, you're thinking about how the color argument isn't useful? Does the macropad have a reverse video option, in which case passing BLACK and WHITE at least would be useful?

idle owl
#

Oh I don't know. I'd have to check.

#

Let's say it does, and they are.

#

Would you add a separate class to the MacroPad lib, or would you integrate the external library?

#

Like I said, color is easy to deal with by adding a monochrome kwarg to Simple Text Display.

onyx hinge
#

I guess MagTag didn't use adafruit_simple_text_display so I can't check what was done there

idle owl
#

No, nothing used it, it's too new

#

It was a feature in CLUE

#

That I wrote.

#

But someone wanted it for FunHouse, so I made it a separate thing.

onyx hinge
#

I think I'd make a __init__ of the class in the MacroPad library call the super().__init__ of SimpleTextDisplay with either colors=WHITE or colors=BLACK depending on a reverse video flag; or, just always pass WHITE if reverse video is not implemented.

idle owl
#

Ok thanks.

onyx hinge
#

Ask me again tomorrow, I'll give you a different answer. But does that seem to you like it's going to work?

idle owl
#

Hah!

#

Yeah I assume so. It was simply a matter of that or including all the same code.

#

I'll let you know if it doesn't work, heh.

onyx hinge
#

I'll have to remember this is available and use it when I start my calculator, it looks like a useful class!

idle owl
#

I'm pretty proud of it.

#

Made displaying sensor data on CLUE super simple.

onyx hinge
#

I'm going to go have some πŸ₯ž now

idle owl
#

Ok!

#

Thanks!

onyx hinge
#

ttyl

idle owl
#

later!

#

@tidal kiln @stuck elbow I got NoneType object has no attribute 'show' again. The display was working, but showing garbage, I should have taken a pic, I didn't. And then I went back to Carter's simple example, and got the None failure again. I hard reset the board, and it's working again. So something is getting into a weird state apparently?

tidal kiln
#

do you have any calls to displayio.release_displays()?

idle owl
#

I added one to see if that would fix it, and it didn't work, so I removed it.

#

The display was showing some really odd garbage with non-display-related code running. Simply showing the REPL.

#

Then tried your code, and it pretended to work but still garbage.

#

Then failed with None.

#

Reset fixed it, have your Hello World! now.

tidal kiln
#

hmmm. i guess just proceed as normal. and if it starts happening again, see if you can correlate it to something.

idle owl
#

Ok.

#

Sounds good.

tidal kiln
#

calling release displays will get you a none type

idle owl
#

@tidal kiln Another question. Jeff referred to a "reverse video" option or something with a monochrome OLED. Any idea what he's talking about? Or where one passes that flag?

#

I mean I get what he's referring to

#

Black on white vs white on black.

#

But I have no idea where that flag is.

#

Or where it should go.

tidal kiln
#

not sure. could be a hardware feature of the oled? would be something to look for in datasheet.

idle owl
#

Ok.

#

I thought maybe it was something we had in our display code.

tidal kiln
#

like a single bit in some register that would invert the display

idle owl
#

Ahhh. Ok.

#

Explains why I couldn't find it.

onyx hinge
idle owl
#

I can't find a datasheet even close to what I'm looking at.

#

Uses PortalBase, which I've also been looking at.

#

MagTag I mean.

onyx hinge
#

then maybe for now you want to have your constructor NOT take in any color value and just always pass WHITE down?

idle owl
#

That's why I wanted to add a monochrome kwarg.

#

Or should I just give it white for the color and be done with it?

onyx hinge
#

yeah if your code just calls super().__init__ with colors=WHITE or maybe colors=(WHITE,) won't that do what you need without having to update the simple text display lib?

idle owl
#

Yes.

#

I assume.

onyx hinge
#

(there's a note that says single colors work without an enclosing tuple but ... looking at the code I was not confident that actually would work but THAT has got to also be a side-track)

idle owl
#

Hmm fair enough. I may not have known what I was talking about, or the CLUE version might have required a tuple, and I never tested it without.

idle owl
#

I apparently don't know how to super things.

onyx hinge
#

maybe I don't either

#

what code do you have, and what's going wrong?

idle owl
#

Trying one more thing.

#

Then I'll get help when it doesn't work.

#

It's sort of working.

#

And the display goes wonky when trying to print key events.

#

I'm getting garbage again.

#

Reset fixed it temporarily, and then fail again.

#

Ok it seems like what the key event is returning doesn't play nice with string formatting. Even key_number isn't working, which returns an integer. Also apparently this doesn't display anything if you simply include a string with no data to .format. Which is weird, but I never tested it without sensor data, so I guess it's a bug.

#

Event is not a string and therefore cannot be parsed as one.

#

I don't know how to work with this data.

onyx hinge
#

that does seem weird

#

wonders why the "Submit new issue" button is greyed out on github

idle owl
#

omg.

#

It's a bug in something.

#

That won't print anything on that line.

#

I moved it to the next line which I had temp data on to see if I had screwed something up, and it worked.

#

That line on the display works, there's text on it when the REPL is loaded. so it's not as though there's a dead spot on the display.

onyx hinge
#

that was just the question i was coming to ask

#

What colors are you passing? Could you be passing one that gets treated as black?

idle owl
#

Wait. Maybe?

#

Checking.

#

πŸŽ‰

#

Yes.

#

Apparently that was it.

#

Also, colors has to be a tuple.

#

Thank you, Jeff.

onyx hinge
#

OK, now you know .. file an issue to update the doc (or fix the code, but I bet that's tougher than it sounds, given that colors can be tuples too)

manic glacierBOT
#

I am using the uf2 bootloader (0.4.0) installed with Adafruit ESPTool.

Firmware downloaded from s3 and installed via uf2/KALUGA1BOOT:
adafruit-circuitpython-espressif_kaluga_1.3-en_US-20210625-5a4a803.uf2

Behavior

With the above named firmware version, the CIRCUITPY drive does not appear. The LEDs do blink, so CircuitPython appears to start.

Linux dmesg shows errors like device descriptor read/64, error -110

Reverting to adafruit-circuitpython-espressif_kaluga_1.3-en_...

mental nexus
#

@still zephyr thanks for poking me on that PR. Sorry for the delay in closing it. I’ve had some new work cross my desk that is filling my time. Feel free to ping me on anything else I’m overlooking.

manic glacierBOT
austere acorn
#

ohai πŸ™‚ does anyone have time to help a GitHub noob like me with why my first PR check is failing... on a comment? πŸ€¦β€β™€οΈ πŸ˜†

jaunty juniper
#

what does the check's transcript say ?

austere acorn
#

W0105: String statement has no effect (pointless-string-statement) πŸ€·β€β™€οΈ

idle owl
#

@gilded cradle Good morning! I am at a point where I would appreciate some help with the MacroPad library. I would like to include some graphics features, but I'm not sure where to start. I've looked at GraphicsBase, and its usage elsewhere like FunHouse, but I don't know how to apply it to a monochrome OLED. I mean, I assume you can display images, but they have to be black and white?

manic glacierBOT
idle owl
#

Redo it using # for each line and see if that makes it happier.

jaunty juniper
#

it is a multiline string that is not the docstring, maybe pylint doesn't like that and prefers you use # for comments

#

remember Python does not support multiline comments, """ is a string literal

austere acorn
#

ohhh, needs to be at the beginning of the function only?

idle owl
#

At least in the """ format.

#

But you can write a novel using the # formatting for comments and it's fine. πŸ˜„

austere acorn
#

oh, okay

idle owl
#

Put # at the beginning of each line instead of wrapping it in """ """.

austere acorn
#

thank you... that was confusing πŸ˜†

idle owl
#

Well, no promises, but that's my inclination.

#

As to why it's failing.

onyx hinge
#

If you'd like to know more about the difference between a # comment and a """ docstring """ we can get into the details too. But if not that's fine as well!

austere acorn
#

sure πŸ˜„

#

i'd like to NOT fail on comments in the future πŸ˜†

idle owl
#

@gilded cradle Nevermind for now. I need to get the guide going before working on the lib, so I'm switching gears.

half gale
#

Hi, I am a CircuitPython beginner who is looking to understand the C code that is used to implement CircuitPython (or rather, MicroPython). I want to approach the problem of implementing deep sleep on the SAMD51, but I'm confused about the code structure (shared-modules, shared-bindings etc) and was wondering if anyone has any tips on how I should begin.

(I have seen the PR for alarm and sleep implementation on the STM32, and was wondering if I should just mimic that)

onyx hinge
#

so it is good for giving an overview of what someone who calls the function needs to know

#

A "comment" can go anywhere, and gives an overview of what someone who wants to understand or update the library itself needs to know

jaunty juniper
#

the docstring is also actually a property retrievable in code, not actually ignored by the runtime like a comment, with module.__doc__ or my_function.__doc__ , myclass.__doc__ (not in Circuitpython because that would waste RAM, but in desktop python it is)

austere acorn
#

ah, gotcha

#

i'm used to multi line comments from C

onyx hinge
#

(a docstring can also go a few more places: at the top of a file, at the top of a class, and a few other places; but the start of a function is the super common one)

austere acorn
#

didn't think it was different πŸ€¦β€β™€οΈ

onyx hinge
#

There is not a multi-line comment in Python, only the single-line # comment. """ docstring""" is also just a string, you can write print("""hello there""") and it's the same as print("hello there").

jaunty juniper
#

the docstring can also be a regular single line "string"

onyx hinge
jaunty juniper
#

though pylint rejects it and demands a """ oh wait no

gilded cradle
#

@idle owl, just saw this. Sounds good. I'm trying to wrap up the WipperSnapper/Web Serial ESPTool project so that works. Just let me know when you're ready.

idle owl
#

@slender iron Have a moment for a question about 7.x safe mode?

#

I realised we can't only document 6.x because some boards don't have 6.x builds - so I'm adding to that section I previously wrote to include 7.x behavior.

#

But I want to make sure what I add is accurate.

#

Here is what I have: To enter safe mode when using CircuitPython 7.x, plug in your board or hit reset (highlighted in red above). Immediately after the board starts up or resets, it waits 1000ms. On some boards, the onboard status LED (highlighted in green above) will blink yellow three times. If you press reset during that 1000ms, the board will start up in safe mode. It can be difficult to react to the yellow LED, so you may want to think of it simply as a slow double click of the reset button. (Remember, a fast double click of reset enters the bootloader.)

slender iron
#

it'll just blink yellow. I removed the three

idle owl
#

Ok.

#

Fixed. Thanks!

#

@slender iron And once in safe mode, intermittent three blinks is still valid?

slender iron
#

yes

idle owl
#

(It's doing that on this board right now, but wanted to make sure you didn't change it)

#

Thanks

#

I'll remove the 6.x documentation when we release 7. But for now, it has both.

half gale
# jaunty juniper have you seen <https://github.com/adafruit/circuitpython/issues/4837> ?

Yep, I was going through that, but I am finding the code a little overwhelming to go through. I'm unable to understand some of the specifics (or rather basics) of how the code is structured, and why a lot of it is the way it is.
For example: There seems to be init files in both shared-bindings and shared-module.
Also, there are a lot of macros that are performing functions that I don't really understand, so I was wondering if there was some kind of documentation that I could take a look at? (For example MP_DEFINE_CONST_FUN_OBJ_0, MP_DEFINE_CONST_FUN_OBJ_1 etc)

jaunty juniper
#

for the structure, look at the rp2040 implementation, you want to create ports/atmel-samd/common-hal/alarm/ which is the port specific implementation of the interface defined in shared-bindings (shared-modules holds port-independant implementations if any)

half gale
#

@jaunty juniper Thanks! Is there any documentation I could reference for conventions? Or would I just have to use other modules as reference for this?

tulip sleet
#

When I make a new module, I copy/paste and adapt from existing modules. There are simply too many details to keep in my head to generate it from scratch.

half gale
#

That makes sense, thank you so much 😁

slender iron
#

a lot of the MP_DEFINE macros are doing struct definition or declaration to make static objects to represent something

still zephyr
#

Let me know if you need any hep regarding your PR in the TCS34725 πŸ™‚

austere acorn
#

yes pls πŸ˜„

still zephyr
#

do you have some questions?

#

or in general the process with Pylint and black?

austere acorn
#

more like complete confusion, since i have no idea why it fails this time lol

#

so yea, i guess general about the process

still zephyr
#

ok no problem, I understand. Do you know how to run pre-commit locally?

austere acorn
#

trying to figure it out now... i ran it on the repo locally, and i got like 50 fails, not just one, so i'm doing some configs wrong?

still zephyr
#

interesting, if you are not in a hurry, I could try to see why it is failing now, and if you could share in the PR the information I could take a look also, is that ok?

austere acorn
#

sure

still zephyr
#

ok good, So I will answer in the PR, and we can go from there,

thorny jay
idle owl
thorny jay
#

Ok

idle owl
#

@thorny jay Did you see I closed your PR on Pypixelbuf? Do you understand why I did that?

thorny jay
#

Yeah no problem.

idle owl
#

OK, simply making sure. Didn't want you to think it wasn't appreciated πŸ™‚

thorny jay
#

I was checking where the code was and based on my assync listening of the meeting, I said to myself, this must be the code you want to remove. I did not see the full plan.

idle owl
#

The full plan wasn't even entirely sorted during the meeting. So that's understandable.

manic glacierBOT
manic glacierBOT
#

I will double check this, not sure if I understand you totally.

Specifically, if reload_requested == false and next_code_options == SUPERVISOR_NEXT_CODE_OPT_RELOAD_ON_ERROR and (hypothetically) result.return_code == PYEXEC_FORCED_EXIT, then the result is skip_repl = false. Correct (and achieved in the goto solution) would be skip_repl = true.

Currently the system masks out deep sleep exceptions and will never skip when they are present.

That much is fine. That is the ...

manic glacierBOT
#

@UnexpectedMaker, ESP-IDF4.3 was merged so you should be clear to look at this again.

I need to wait fore the next S3 silicon to get into my hands... the latest stuff Espressif are working on for S3 is in IDF4.4 and they have not back ported everything to 4.3 and there was a breaking firmware change that makes my S3 dev kit board incompatible :(

I have the initial beta silicon, they are on beta 3 internally but not releasing that and so whatever the next one is, is what I am waiting f...

#

@cwalther if you are entering a deep sleep exception for true deep sleep, the code stickiness situation is irrelevant - all of that information will be lost when the RAM shuts down. The program will never reach a decision point where it would use it. This is slightly different for a fake deep sleep, but we try to make fake sleep as similar to true deep sleep as possible, so the stickyness should not be retained in that case either.

ionic elk
#

@opal crystal if you still frequent this discord, had a minor question - did you envision a use for people having a file length of zero for set_next_code_file?

#

since the assignment of the filename is bounded by if (options != 0 || len != 0) {, which implies you could set options without actually providing a filename

#

@tulip sleet are you around? Could I get your advice on some C shenanigans?

tulip sleet
#

in the 6pm mtg

#

go ahead and type it up

ionic elk
#

Ah, right. No problem

#

I'm not sure how much I need to modify it to make it safe for internal use

sterile bronze
#

@idle owl @tulip sleet I was just having a look at the new learn guide for the Macropad and on the page for using the keys example as a short block of code that looks good but when you download the file you don't get a zip file and you only get the code.py block of code. I put feedback in on the page of the learn guide.

idle owl
sterile bronze
#

@idle owl That's fine but the library file/folder is missing so there is no keypad file or folder available. It's not in the bundle either.

idle owl
#

keypad is built into CircuitPython!

#

But you have to use the absolute newest off of S3.

#

I assumed we'd have a new release by the time we published the guide

#

but that did not happen

#

I will make a note in the guide!

sterile bronze
#

I'll test again as it gave me an error message earlier. Thanks

manic glacierBOT
tulip sleet
#

@slender iron @onyx hinge I finished a draft of 7.0.0-alpha.4 release notes, incorporating all PR's already merged since alpha.3. I'll take a look at what else can be merged quickly tomorrow morning. If you have anything to get in, let me know.

slender iron
#

thanks!

onyx hinge
#

@tulip sleet did you see that I could not get the post-idf-merge working on my kaluga with uf2 bootloader? https://github.com/adafruit/circuitpython/issues/4951 it got labeled long-term by @slender iron but it seems pretty serious if it affects esp32 generally, or even just esp32-with-uf2 specifically. OTOH I only tested one board so it could just be as well.

GitHub

I am using the uf2 bootloader (0.4.0) installed with Adafruit ESPTool. Firmware downloaded from s3 and installed via uf2/KALUGA1BOOT: adafruit-circuitpython-espressif_kaluga_1.3-en_US-20210625-5a4a...

sterile bronze
#

@idle owl I tested the macropad with the latest S3 build, ...20210630-54cadb9, and it all works well. Thanks

manic glacierBOT
#

Thanks, tested with bytes(1,2,3), bytearray(1,2,3), and with the example from https://forums.adafruit.com/viewtopic.php?f=60&t=150071 that provoked the original PR, #4224.

>>> class onetwo():
...     def __init__(self):
...         self.data = [1,2]
...     def __bytes__(self):
...         return bytes(self.data)
...         
...         
... 
>>> 
>>> o = onetwo()
>>> bytes(o)
b'\x01\x02'
>>> o.__bytes__()
b'\x01\x02'
>>> 
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 6.3.0 on 2021-06-01; Teensy 4.0 with IMXRT1062DVJ6A

Code/REPL

import digitalio, analogio

pot = digitalio.DigitalInOut(board.D23)
pot.direction = digitalio.Direction.OUTPUT
pot.deinit()
pot = analogio.AnalogIn(board.A9)

print((pot.value,))

Behavior

If I use a digital / analog combo pin first as a digital output pin, then later use deinit() to release the pin, and then finally try to use the sam...

lone sandalBOT
main furnace
#

Where would I find the audiomixer module for ESP32S2?

manic glacierBOT
manic glacierBOT
#

I think that I'd rather leave monotonic as is, and add this new functionality only. I studied the LED animation library and I think it's pretty easy to adapt it to wrapping ticks (made harder by the need for compatibility with 6.x). If that's typical of libraries that like to count intervals, then this is the way to go and the other complication is not needed.

We still need to address the problem with this not fitting on a couple of boards, though, and decide whether to offer this as 1 fun...

tidal kiln
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0-alpha.2-734-g6ee9acc90-dirty on 2021-07-01; Adafruit Feather RP2040 with rp2040

Code/REPL

import time
import board
import displayio
import adafruit_displayio_sh1107

displayio.release_displays()
# oled_reset = board.D9

# Use for I2C
i2c = board.I2C()
display_bus = displayio.I2CDisplay(i2c, device_address=0x3C)

# SH1107 is vertically oriented 64x128
WIDTH = 128
HEIGHT = 64
BORDER = 2

disp...
slender iron
manic glacierBOT
manic glacierBOT
#

Using the .bin , mine boots but goes in to safe mode

uto-reload is off.
Running in safe mode! Not running saved code.

You are in safe mode because:
CircuitPython core code crashed hard. Whoops!
Crash into the HardFault_Handler.
Please file an issue with the contents of your CIRCUITPY drive at 
https://github.com/adafruit/circuitpython/issues

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

Adafruit CircuitPython 7.0.0-alpha.3-474-g37c52110c on 2021-07-01; Kaluga 1 wi...
tulip sleet
#

@solar whale if you have the time and could try the latest builds on one or two other ESP32-S2, I would be grateful. I wonder if it is specific to the Kaluga or whether, say, the Metro ESP32-S2 (or MagTag or other more conventional board) has the same issues. Also whether it is dependent on .uf2 vs .bin for those boards.

#

I am deep into RP2040 audio debugging at the moment.

solar whale
#

I won't have time today, but I'll test some tomorrow morning. As noted, I have no issue on the Kaluga at this point.

onyx hinge
#

It may not be coincidental that @solar whale and I both had camera programs in code.py when we saw the problem.

solar whale
#

I have not tried running any code.

tulip sleet
#

hmmm... I just wondering whether to hold up alpha.4 or not about this.

#

yes, if you run something not-camera, does it fail?

onyx hinge
#

something that is i2c?

#

though I assume i2c was tested, it was a known potential problem

tulip sleet
#

could be, or really anything, and also whether kaluga-specific

solar whale
#

standard wifi test runs OK on my Kaluga

tulip sleet
#

i don't want to break all the ESP32-S2 boards, but if only Kaluga is broken that would not be a show-stopper for alpha.4

solar whale
#

Sorry -- I have to go now. Will be happy to run more tests tomorrow if it is not too late.

tulip sleet
#

np, thanks for your testing so far!

onyx hinge
#

I have a magtag right here that I can try real quick, but I'm also trying to wrap up for the day

#

For me, magtag loaded with adafruit-circuitpython-adafruit_magtag_2.9_grayscale-en_US-20210701-37c5211.uf2 blinks purple neopixels forever, doesn't appear on USB

#

@tulip sleet but 6.3.0 does

tulip sleet
#

suppose you loaded the .bin

#

I think you may have to erase_flash before loading the bin

onyx hinge
#

what does purple neopixel mean in 7?

#

@tulip sleet so you want me to wipe the uf2 bootloader and see what happens?

#

the blinking purple is with or without a code.py file

tulip sleet
#

if you are willing

#

purple doesn't seem to mean anything PURPLE is defined but not used

jaunty juniper
#

the only purple I know is the bootloader waiting to press boot

tulip sleet
#

aha

jaunty juniper
#

(so it's like a reset cycle if it blinks)

onyx hinge
#

so what I think I see happening is actually: all LEDs blink purple once, then 4 quick flashes of yellow, then all LEDs blink purple forever.

tulip sleet
#

I think the yellow is the get-into-safe-mode delay, but then something bad happens

onyx hinge
tulip sleet
#

thanks, is that with .bin?

onyx hinge
#

no that's with uf2

#

I can't get esptool to work; I'm on my laptop (also linux), not my usual machine.

tulip sleet
#

pip3 install --upgrade esptool ?

#

also make sure you're in the dialout group?

onyx hinge
#
esptool.py v3.1-dev
Serial port /dev/ttyACM0
Connecting...
Traceback (most recent call last):
...  File "/home/jepler/.espressif/python_env/idf4.3_py3.9_env/lib/python3.9/site-packages/serial/serialposix.py", line 715, in _update_dtr_state
    fcntl.ioctl(self.fd, TIOCMBIC, TIOCM_DTR_str)
OSError: [Errno 71] Protocol error
#

esptool is from esp-idf

#

same with make flash which runs esptool.py --chip esp32s2 -p /dev/ttyACM0 -b 460800 --before=default_reset --after=no_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 4MB 0x0000 build-adafruit_magtag_2.9_grayscale/firmware.bin

#

(it's not a permissions problem on the serial device)

tulip sleet
#

that is 3.0

onyx hinge
#

$ python3 -mpip install esptool==3.0

#

.. same error

#

I am going to set this aside for now, sorry I couldn't be more useful in my testing today.

tulip sleet
#

thanks anyway!

turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Region

us-west

Channel Categories

8

Text Channels

58

Voice Channels

6

Members

29776

Roles

35

manic glacierBOT
#

I also have a magtag with uf2. 6.3.0 works, but adafruit-circuitpython-adafruit_magtag_2.9_grayscale-en_US-20210701-37c5211.uf2 apparently goes into a bootloader loop, blinking purple on all LEDs once, then yellow/orange on the first led 4 times, then blinking purple on all LEDs forever.

https://user-images.githubusercontent.com/1517291/124188732-464eb180-da85-11eb-9f5b-dae6d26a244e.mp4

At Dan's suggestion I was going to try wiping the uf2 bootloader and try with a bare "bin" file, but...

manic glacierBOT
#

Fix RP2040 PWMAudioOut, which stop playing after playing six samples.

The essential problem was that the 12 DMA channels were being used up because the two that were being used were not freed after use, due to a missing

        audio_dma_stop(&self->dma);

in PWMAudioOut.c.

In the course of this I made some other more minor changes:

  • Rename single_channel to single_channel_output to clarify its meaning. This changed a lot of files.
  • Do pin claiming in PWMOut, n...
#

Now that max_size has been disabled in shared-bindings/displayio/Group.c ready for removal in CircuitPython 7, it needs to be removed from all the libraries that make use of it before this can happen.
https://github.com/adafruit/circuitpython/blob/37c52110c5fdcc4b47567e85cba628470f658f84/shared-bindings/displayio/Group.c#L45
I propose to work through the libraries and make the necessary PRs. This Issue is intended as a central tracking point which will eventually allow the removal of th...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I tried the latest builds on a Metro ESP32 and a Feather S2. Without a code.py, they come up and I can use the REPL.

I had a random test program on the Feather S2, and found that this simple program causes a crash:

import busio
import board
import displayio
import adafruit_il0373

displayio.release_displays()

spi = busio.SPI(board.SCK, board.MOSI)
epd_cs = board.D9
epd_dc = board.D10

display_bus = displayio.FourWire(spi, command=epd_dc, chip_select=epd_cs, baudrate=100...
manic glacierBOT
manic glacierBOT
#

I was able to duplicate the crash on the Feather S2 with the latest from s3.

import busio
import board
import displayio
import adafruit_displayio_ssd1306

displayio.release_displays()

i2c = busio.I2C(board.SCL, board.SDA)

display_bus = displayio.I2CDisplay(i2c, device_address=0x3C)
display = adafruit_displayio_ssd1306.SSD1306(display_bus, width=128, height=32)

The last line is what causes the crash as well.

I confirmed that it doesn't crass with `adafruit-circui...

stiff pelican
#

Does anyone recognize the following directory of examples from the Bundle and what library is it from?

examples/client_examples:
battery_daughter.py
door_daughter.py
neopixel_daughter.py
neopixel_setter_daughter.py
neopixel_setter.py
relay_daughter.py
relay_hi_daughter.py
temp_humid_daughter.py
lone sandalBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I put a somewhat arbitrary 10us minimum pulse check into the RP2040 pulsein
code.
This was necessary because while testing the irremote device (which uses
pulsein) I
was consistently seeing stray pulses from IR being picked up from the
surrounding environment.
10 us seemed to give me the most consistent readings for the irremote
device. If you
really need to make a 10us measurement I could drop that down to 7 or 8
us, which would have a
marginal impact on the infrared readings.

On Tue, Jun ...

onyx hinge
#

@stiff pelican I think they're from "dash_display". Here's how I found one of the files using the "find" command which is on linux and probably in git bash on windows. jepler@babs:~/src/Adafruit_CircuitPython_Bundle$ find -name battery_daughter.py ./libraries/helpers/dash_display/examples/client_examples/battery_daughter.py

stiff pelican
manic glacierBOT
#

LGTM

Adafruit CircuitPython 7.0.0-alpha.3-493-gb830eccbf on 2021-07-02; Adafruit MagTag with ESP32S2
>>> import time
>>> 
>>> s = time.mktime((2021, 06, 16, 20, 0, 0, -1, -1, -1))
>>> s
1623873600
>>> time.time()
1625220470
>>> time.localtime(s)
struct_time(tm_year=2021, tm_mon=6, tm_mday=16, tm_hour=20, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=167, tm_isdst=-1)
>>> time.localtime(time.mktime((2021, 06, 16, 20, 0, 0, -1, -1, -1)))
struct_time(tm_year=2021, tm_mon=6, tm_mday=1...
turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Region

us-west

Channel Categories

8

Text Channels

58

Voice Channels

6

Members

29779

Roles

35

manic glacierBOT
orchid basinBOT
midnight current
#

Hi,I just took a quick look at the pypi page.

#

But not very clear where to start with.

slender iron
#

inside the file there are pyi files

#

that you should be able to find a parser for

midnight current
#

Thanks. I see the pyi for the modules. It will be nice if there is a one for the CPy core.

slender iron
#

you mean the built-in keywords? they are mostly the same as cpython

midnight current
#

Is there any buildin functions that are specific to CircuitPython? Maybe inherited from MicroPy?

slender iron
#

there shouldn't be

#

everything custom should be in modules

midnight current
#

I see

#

OK I will first try to implement these. And get back to you soon.

manic glacierBOT
#

@DavePutz thanks for your reply. Looks like the real signal which raised this issue is even a bit less than 10us. I understand if that's asking too much of such a system which needs to be optimized for more common use cases.

However, there's still a bug. Suppose the real incoming signal is 100,95,5,100,100. If you want to suppress the "5" as noise, the correct output is 100,200,100. The bugged output is 100,95,100,100 which shortens the total time and flips the polarity.

Picture of real...

tawdry bobcat
#

hello. I would like to ask what are the main benefits of microPython and circuitPython instead of Arduino core? I'm working on Arduino core from few recent years now I would like to explore these also

tulip sleet
tawdry bobcat
#

oops. okay

manic glacierBOT
midnight current
slender iron
#

it's using codemirror 6 and I think you are using 5

#

it is working well on android

midnight current
#

I guess the problem of android is not CM. It does not have the Serial API and the File API.

slender iron
#

ah, I implemented it with web bluetooth

#

it'd be nice if both worked

midnight current
#

Yep. It will be nice. Currently, I do not have Bluetooth enabled devices. For some reasons I focused on cheap boards only. So maybe I need to get a new board to at least play with what is already there.

slender iron
#

I'll be demoing it on my stream in just over an hour

stuck elbow
#

@slender iron is there some way to get notified about those streams?

#

(sorry to interject)

slender iron
#

I do have a role for it

#

I haven't gotten into the habit of pinging it though

stuck elbow
#

awesome, can you please add me

slender iron
#

yup, just did (its deep divers)

stuck elbow
#

much appreciated

slender iron
#

np πŸ™‚

midnight current
#

Sorry, I am new to the 21th century. What is a 'stream'?

stuck elbow
#

livestream

#

@slender iron showing on YouTube how he works on CircuitPython

midnight current
#

Just found it out.

gloomy shuttle
#

How do I find a CircuitPython Build that is for a specific PR merge?

solar whale
#

There are artifacts "somewhere" I'm trying to recall how to find them....

gloomy shuttle
#

Thanks! I found it on the Github page. The artifacts are listed under the Checks tab.

solar whale
#

Ah yes -- there they are -- someone should write that down πŸ˜‰

stuck elbow
#

I always instantly forget anything I write down

gloomy shuttle
#

Any idea why some PR's have artifacts and others don't?

stuck elbow
#

if they failed to build...

gloomy shuttle
stuck elbow
#

I think they get deleted after some time too

gloomy shuttle
stuck elbow
#

I'm out of ideas

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0-alpha.3-493-gc37f354d2 on 2021-07-02; FeatherS2 with ESP32S2

Code/REPL

import busio
import board
import displayio
import adafruit_displayio_ssd1306

displayio.release_displays()

i2c = busio.I2C(board.SCL, board.SDA)

WIDTH = 128
HEIGHT = 32  # Change to 64 if needed
BORDER = 5
display_bus = displayio.I2CDisplay(i2c, device_address=0x3C)
display = adafruit_displayio_ssd1306.SSD1306(display_bus,...
jaunty juniper
thorny jay
#

And a CircuitPython client to the BLE device?

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I2C works OK on an ESP32s2 SAOLA-WROVER with the current tip of main.

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

Code done running.

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

Adafruit CircuitPython 7.0.0-alpha.3-493-gc37f354d2 on 2021-07-03; Saola 1 w/Wrover with ESP32S2
>>> import busio
>>> import board
>>> import displayio
>>> import adafruit_displayio_ssd1306
>>> 
>>> displayio.release_displays()
>>> i2c = busio.I2C...
#

And it also works now on a FeatherS2

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

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

Adafruit CircuitPython 7.0.0-alpha.3-493-gc37f354d2 on 2021-07-03; FeatherS2 with ESP32S2
>>> import busio
>>> import board
>>> import displayio
>>> import adafruit_displayio_ssd1306
>>> 
>>> displayio.release_displays()
>>> 
>>> i2c = busio.I2C(board.SCL, board.SDA)
>>> 
>>> display_bus = display...
manic glacierBOT
#

Trying to reproduce the failing test setup - I have a STEMMA OLED SSD1306 132x64.
It also works for me on the FeatherS2

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

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

Adafruit CircuitPython 7.0.0-alpha.3-493-gc37f354d2 on 2021-07-03; FeatherS2 with ESP32S2
>>> import busio
>>> import board
>>> import displayio
>>> import adafruit_displayio_ssd1306
>>> 
>>> displayio.release_displays(...
#

It works fine when running in REPL the first time, but crashes on import adafruit_displayio_ssd1306 after a soft reboot.

Adafruit CircuitPython 7.0.0-alpha.3-493-gc37f354d2 on 2021-07-02; FeatherS2 with ESP32S2
>>> import busio
>>> import board
>>> import displayio
>>> import adafruit_displayio_ssd1306
>>> displayio.release_displays()
>>> i2c = busio.I2C(board.SCL, board.SDA)
>>> display_bus = displayio.I2CDisplay(i2c, device_address=0x3C)
>>> display = adafruit_displayio_ss...
solar whale
#

@gloomy shuttle strange bug -- glad it is reproducible now -- issue after soft reboot have come up quite a bit - especially with the esp32s2

manic glacierBOT
#

I enabled the audiomixer module for ESP32-S2, built the .uf2 file, installed it on my feathers2, and was able to mix WaveFiles.

Here's the diff:

diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk
index 1f5021bc1..479725211 100644
--- a/ports/esp32s2/mpconfigport.mk
+++ b/ports/esp32s2/mpconfigport.mk
@@ -18,6 +18,7 @@ CIRCUITPY_AUDIOBUSIO = 1
 CIRCUITPY_AUDIOBUSIO_PDMIN = 0
 CIRCUITPY_AUDIOBUSIO_I2SOUT = 1
 CIRCUITPY_AUDIOIO...
#

Well -- that does not make senses sice the code does the release, but for some reason, it has to be done before importing the ssd1306 library...

Adafruit CircuitPython 7.0.0-alpha.3-493-gc37f354d2 on 2021-07-03; FeatherS2 with ESP32S2
>>> import displayio
>>> displayio.release_displays()
>>> import busio
>>> ipormt board
>>> import displayio
>>> import adafruit_displayio_ssd1306
>>> 
>>> displayio.release_displays()
>>> 
>>> i2c = busio.I2C(board.SCL, board.SDA)
>>> 
>>> d...
#

It also works fine with QT PY Haxpress and the QT PY RP2040 without changing the order.

Adafruit CircuitPython 7.0.0-alpha.3-493-gc37f354d2 on 2021-07-02; Adafruit QT Py RP2040 with rp2040
>>> import busio
>>> import board
>>> import displayio
>>> import adafruit_displayio_ssd1306
>>> displayio.release_displays()
>>> i2c = busio.I2C(board.SCL1, board.SDA1)
>>> display_bus = displayio.I2CDisplay(i2c, device_address=0x3C)
>>> display = adafruit_displayio_ssd1306.SSD1306(display_...
manic glacierBOT
#

Well -- that does not make senses since the code does the release, but for some reason, it has to be done before importing the ssd1306 library...

The adafruit_displayio_ssd1306 library doesn't do anything on import, other than setting a few constants: https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SSD1306/blob/main/adafruit_displayio_ssd1306.py

This sounds like some kind of a race condition β€” maybe there is a delay required between releasing the displays and creating...

manic glacierBOT
manic glacierBOT
onyx hinge
#

@tulip sleet was any thought given to making split keyboards with the keypad module?

tulip sleet
#

We might eventually add more scanners that include I/O extenders.

onyx hinge
#

I assembled 2 of these and realized it's a split-ortho keyboard..

tulip sleet
#

how is it split? Two matrices, or I/O extenders

onyx hinge
#

well it's not designed to be a split keyboard.... it's just two copies of this same calculator keypad

tulip sleet
#

you can run two scanners; they are not singletons

onyx hinge
#

so they would both be driven by "something feather shaped" and there was no plan for how to get power and data to the other board

tulip sleet
#

it is only QWERT -- YOUIP without any side keys

onyx hinge
#

this is not an immediate goal, it's just a thought prompted by seeing these two boards together

tulip sleet
#

you could also run it as one big matrix if you provided the connections

onyx hinge
#

they're so cute and I can't imagine using it

tulip sleet
#

i agree πŸ™‚ I am not fond of ortho keyboards. The Stanford AI lab designed their own keyboard in the 70's. For some reason whoever did it decided the qwertyuiop row should be offset from the asdfghjkl row by the same half key as zxcvbnm instead of the 1/4 key or whatever it is. I am a touch typist and I thought it was terrible. My muscle memory was off by 1/4 key.

#

also they put ? over . for some reason

onyx hinge
#

I appreciate the people who see that the QWERTY is only convention, not ordained by basic physical law or human anatomy, and look for better solutions. But also I do well on QWERTY

tulip sleet
#

it's what I learned, starting with manual typewriters, and I am fine with it. If someone wants to start a new convention, great, but make it a "standard"

storm minnow
#

Need numpad

#

And like... space? enter? shift? numbers?

onyx hinge
#

@storm minnow typically those small keyboards make extensive use of modifier keys and layers, the details vary from keyboard to keyboard and firmware to firmware.

storm minnow
#

I think I would just get confused XD

onyx hinge
storm minnow
#

Not sure how well I could type on a QWERTY without key offsets...

onyx hinge
#

I like the keyboard I have, I'm good at it πŸ™‚ but I'm also happy that some people geek out about stuff like this

storm minnow
#

Keebs are fun!

#

I love my new full custom one :D

onyx hinge
#

me too -- this is my design. very traditional. https://www.thingiverse.com/thing:4129809

#

there are some interesting layout choices there wow

#

aside from how the punctuation is placed and all those weird symbols --JKOP cursor keys for instance are new to me

#

I want an infinity key!!!!

tulip sleet
#

that is not the one I had to use, it is more rational

onyx hinge
#

yeah OK it doesn't have those characteristics you named. I'll keep looking for the real thing.

tulip sleet
#

It was this one:

#

execrable

onyx hinge
#

I see it has an infinity key though

tulip sleet
#

MIT sort of copied it with many shift keys but they didn't tamper so much with the basic layout

#

I used the Knight keyboard on that same page (scroll down)

#

The Xerox 1108 Lisp Machine keyboard there is the same as the Xerox Star keyboard (same hardware)

#

I wrote my thesis on that keyboard.

#

I even drew a diagram of it

onyx hinge
#

(further off topic, seeing stuff like the early Xerox makes me see that the original Mac already had a real clear model of where they wanted to get to albeit in much more expensive products)

tulip sleet
#

The DELETE, COPY, MOVE, and PROPS buttons were great, a considerable improvement over their successors

#

The Mac is a lot like the Lisa, which was a lot like the Xerox products

#

I am on a ex-Xerox email list. Someone just sent this old cartoon, which is about the UI-copying lawsuits of the time:

onyx hinge
#

yeah maybe not the right topic anymore

tulip sleet
#

but fun

onyx hinge
#

I doodled up a class that could, in principle, merge multiple keypad event queues

#

so then I could even write a pure-python i2c/uart/whatever keypad-alike class and merge the streams

tulip sleet
#

we might add some kind of timestamp at some point to the Event class, so you could preserve the ordering

#

also I could make a constructor for the EventQueue class so you could write your own scanner (e.g. NeoKey)

onyx hinge
#

yeah, I thought about "what if so many events arrive on queue 1 that queue 2 is never consulted" and coded around that, but events could still come out of order

#

I imagined just duck-typing it

#

there's nowhere in the C API that needs to take the EventQueue back, yet

#

my two halves of a keypad wouldn't be on the same micro so I'm not sure timestamps would help order their events

#

(well if the background task could sample from an i2c peripheral it might)

tulip sleet
#

I agree abt duck-typing. Also two scanners could conceivably share an EventQueue. There is internal locking for other reasons

onyx hinge
#

I also wondered about Events linking back to a Keypad object; instead, I just made the 2nd Keypad's key numbers be bumped up by the number of keys on the first Keypad.

onyx hinge
#

if the standard deviation of 4df is 1.6mumble then a +2 bonus or invoked aspect is >1 standard deviation improvement which is a lot. no wonder stacking 3 of them gets you a lot.

stuck elbow
#

you basically run separate programs on each of the halves, and communicate over uart

#

you could also use a shift register on the other side, I suppose

manic glacierBOT
#

This issue stems from the fact that PulseOut is using PWM at a given
frequency.
That means that values that are less than the width of the PWM pulse are
not going
to be handled correctly. At 38Khz, a pulse is about 26 microseconds; 13
high and 13 low.
So, trying to send a pulseout pulse of 1 microsecond is not going to work.
That said;
hanging in a non-responsive state is obviously not the correct way to
handle this.
Some thoughts on what could be done; an error could be returned to the
Pytho...

manic glacierBOT
#

I think what you are looking at here is a timing issue. As stated in the
documentation;
pulsein.len() "Returns the number of pulse durations currently stored.".
So, since your
example is constantly streaming pulses, there will be times when you check
the len() and get
less than the maxlen you have specified. I don't believe this is an issue
with accuracy; just an
issue with calling popleft() before the maxlen pulses have been received.
If you replace the "pass"
in your first loop with a "time...

manic glacierBOT
#

It looks like there is some conflict between the digitalio on GP0 and
the pulseins on GP1 and GP2. If the pulsein pins are changed to GP5
and GP6 then things run as expected. I will continue to investigate.

On Tue, Jun 29, 2021 at 2:51 PM dmcomm @.***> wrote:

Sorry, that's more than I want to take on at the moment. If I'd known how
this was going to go, I probably wouldn't have started, but I hope it was
useful ;)

β€”
You are receiving this because you are subscribed to this...

lone sandalBOT
manic glacierBOT
noble mango
stuck elbow
#

it's a Rorschach test

#

others see butterflies or other things

manic glacierBOT
manic glacierBOT
#

Thanks for your reply. The maxlen isn't relevant here as long as it's at least 20. But indeed, more testing suggests the accuracy issue in this example is caused by calling popleft() before the desired number of pulses is reached (20 in this case). In other words, calling popleft() reduces the measured duration of the pulse currently in progress.

(I initially didn't think it was that because I had another example which seemed to work; but really the other example was introducing a delay th...

manic glacierBOT
#
Adafruit CircuitPython 7.0.0-alpha.3-495-gcece6492a on 2021-07-03; Raspberry Pi Pico with rp2040

Currently, 5us hangs while 10us does not, whether the frequency is 38kHz or 500kHz. So the hang doesn't appear to be due to the number of PWM cycles requested.

10us at 38kHz sometimes produces a pulse and sometimes does not, which isn't really a problem.

If that needed to be fixed, I would choose "delay for the specified number of microseconds without outputting anything".

manic glacierBOT
#

It appears we are talking past each other. πŸ™‚ Sorry, I should have been clearer which of my suggestions apply to the current situation where storage in sleep memory for persistence across deep sleep is not implemented yet, and which to the future situation where it is.

we try to make fake sleep as similar to true deep sleep as possible, so the stickyness should not be retained in that case either.

I agree with that goal. But I claim it is not what your code does.

In order to stop sp...

manic glacierBOT
plucky flint
#

Morning folks. After a bunch of fiddly work (and I don't mean violin-like fiddly..!) the new beta (5) of Mu is out. This includes a fix by the incomparable @tulip sleet for Apple M1 devices (thank you for the contribution and apologies it's taken so long to land in a release). Announcement and details all here: https://madewith.mu/mu/users/2021/07/05/beta5.html As always, constructive feedback is most welcome..! πŸ‘

Made With Mu

A blog to celebrate projects that use the Mu Python code editor to create cool stuff.

tulip sleet
plucky flint
jaunty juniper
#

and Hugo's and Dan's testing that made it possible πŸ˜‰

manic glacierBOT
fathom violet
#

Hi everyone! i have been trying different appproaches to see what is happening with the USB on my SAML21 port, but sometimes when i do debbug the USB is working properly and some times it does not work

#

Sometimes i got until this while and it does not do anything else

while (USB->DEVICE.SYNCBUSY.bit.SWRST == 0) {}

onyx hinge
#

@fathom violet have you considered trying another board (maybe component damage) or a tinyusb example rather than all of circuitpython? either could help you rule out various factors for why this is happening.

fathom violet
#

yes i have tried tiny usb alone and it just works

#

in the same board

manic glacierBOT
#

Hi everyone - thank you for the quick response and insight.

In the past week I have tried various different approaches with changing the order of initializing the ESP32 module etc but no luck. One thing that I did find is that setting WIFI_MODE_NULL causes the response of esp_wifi_get_mode() to return 0 - meaning an initialization error - this may be one reason it wasn't working since the expected result is 1 or ESP_OK. Based on the example in `examples/wifi/iperf/main/cmd_wifi....

#

I'm still having this problem. On an ESP32S2 MagTag 2.9", I do the following:

esptool.py  --port  /dev/tty.usbmodem01 erase_flash
esptool.py --port  /dev/tty.usbmodem01 write_flash 0x0 ~/adafruit-circuitpython-adafruit_magtag_2.9_grayscale-en_US-20210703-cece649.bin

and I get a fresh CP7 install. I then create the following boot.py:

# boot.py
import usb_midi
usb_midi.disable() 
print("disable MIDI")
import usb_hid
usb_hid.disable()
print("disable HID")

...

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0-alpha.3-471-g7f39779f4 on 2021-07-01; Adafruit Macropad RP2040 with rp2040

Code/REPL

import board
import displayio

from adafruit_displayio_sh1106 import SH1106

OLED_WIDTH = 128
OLED_HEIGHT = 64

displayio.release_displays()

display_bus = displayio.FourWire(
    board.SPI(),
    command=board.OLED_DC,
    chip_select=board.OLED_CS,
    reset=board.OLED_RESET,
    baudrate=1000000,
)

dis...
atomic summit
manic glacierBOT
#

I was able to reproduce with the Magtag (7.0.0-alpha.3-495-gcece6492a built locally, without tinyuf2).

  • The Magtag does not appear on USB.
  • It is able to be recovered by pressing boot on the yellow blink on reset. (Manually go to safe mode).

The Feather S2 in the same conditions reboots into safe mode (with the second boot.py).

You are in safe mode because:
USB devices need more endpoints than are available.
jaunty juniper
manic glacierBOT
manic glacierBOT
manic glacierBOT
#
Adafruit CircuitPython 7.0.0-alpha.3-495-gcece6492a on 2021-07-03; Raspberry Pi Pico with rp2040
import array
import board
import time
import pulseio
import pwmio

pwm = pwmio.PWMOut(board.GP0, frequency=500_000, duty_cycle=0x8000)
pulseOut = pulseio.PulseOut(pwm)

for i in range(20, 0, -1):
    time.sleep(2)
    print(i)
    pulses = array.array('H', [100,100,i,100])
    pulseOut.send(pulses)

Crashes somewhere between 8 and 5. The same if I change...

noble mango
# stuck elbow it's a Rorschach test

yeah now I see the Rorschach test. Man a lot opinions out there about the inkblots... etc.. I dont read watchmen but I always wondered why the patterns moved on the mask .. Now I now. Thats cool.

manic glacierBOT
idle owl
#

<@&356864093652516868> Greetings! This is a reminder that the CircuitPython Weekly meeting is happening today at 2pmET/11amPT (in approximately 3 hours). If you're planning to attend and participate, or have notes but are missing the meeting, please remember to add your hug reports and status updates to the notes document. Hope to chat with you all soon! https://docs.google.com/document/d/1g_QB0qxg528hkBo45Li_ROzIdkxiCx5j8t3EeJMPIxk/edit#

#

@tulip sleet Do you have a moment for a question about keypad and the MacroPad?

idle owl
#

Ok. Thanks.

#

@tulip sleet Do I understand it correctly that the way you setup keys in the code is simply an index, and if I want to "rotate" the keyboard, all I have to do is play swapsies with the keypin order in setup?

#

I moved a couple around, and it appeared to do what I needed, but I want to verify that this is accurate and the proper way to do it.

tulip sleet
#

yes, the key_number corresponds to the order of the pins argument.

idle owl
#

Ok. Excellent.

#

Mildly irritated that the key_number starts at 0 but the key pin names in CircuitPython start at KEY1, but I guess a lot of folks will never see that with the MacroPad library anyway.

tulip sleet
#

i mention that in the guide because it's confusing

idle owl
#

Ok, I'll mention it as well in the MacroPad guide.

#

Definitely means I have to think harder when generating these rotated key layouts. πŸ˜„

tulip sleet
#

0 makes sense based on how sequences are subscripted. We could have named them KEY0..KEY11, but that might also be confusing. No way around it, I think.

idle owl
#

I agree. I would have named them starting at 0, but I understand it is what it is.

tulip sleet
#

KEYA..KEYL

idle owl
#

Even worse! πŸ˜„

#

Β―_(ツ)_/Β―

#

It comes down to documentation regardless.

tulip sleet
#

righto

manic glacierBOT
jaunty juniper
#

@tulip sleet I've seen questions due to the alpha 3 on the MacroPad download page having the wrong NEOPIXEL pin, is the next unstable release ready to go soon ?

tulip sleet
#

i had hoped to fix a few more things before alpha.4, but that will probably not happen. So, yes, it should be soon, and we will live with what it has (macropad audio problems, etc.)

idle owl
#

@tulip sleet I added the pixelbuf shuffle to my list for this week. I wanted to get it in to a release, but I understand if it doesn't get done in time.

tulip sleet
#

i think we will have an alpha.5 sooner rather than later

idle owl
#

Fair enough.

onyx hinge
#
shared-module/keypad/EventQueue.c|48 col 96| warning: overflow in conversion from 'int' to '_Bool8' {aka 'unsigned char'} changes value from 'encoded_event & 32768' to '0' [-Woverflow]        
||    48 |     common_hal_keypad_event_construct(event, encoded_event & EVENT_KEY_NUM_MASK, encoded_event & EVENT_PRESSED);
``` @tulip sleet this seems weird ... If `bool` isn't really the C bool type, then it's true .. is it a bug in a header, that `bool` is typedef'd wrong?

spresense-exported-sdk/nuttx/include/stdbool.h: * use _Bool8 as the underlying type (unless CONFIG_C99_BOOL8 is defined)
spresense-exported-sdk/nuttx/include/stdbool.h:# define bool _Bool8


It seems we should consider defining CONFIG_C99_BOOL8 so that it typedefs to `_Bool` instead
tulip sleet
#

which compiler is giving you that warning?

onyx hinge
#

It is a special local build with a bunch of stuff jumbled together, but it looks like spresense build. compiler is gcc version 10.2.1 20201103 (release) (GNU Arm Embedded Toolchain 10-2020-q4-major

onyx hinge
#
make: Entering directory '/home/runner/work/circuitpython/circuitpython/ports/cxd56'
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
make -C mkspk
make[1]: Entering directory '/home/runner/work/circuitpython/circuitpython/ports/cxd56/mkspk'
make[1]: Leaving directory '/home/runner/work/circuitpython/circuitpython/ports/cxd56/mkspk'
QSTR updated
../../shared-module/keypad/EventQueue.c: In function 'common_hal_keypad_eventqueue_get':
../../shared-module/keypad/EventQueue.c:48:96: warning: overflow in conversion from 'int' to '_Bool8' {aka 'unsigned char'} changes value from 'encoded_event & 32768' to '0' [-Woverflow]
   48 |     common_hal_keypad_event_construct(event, encoded_event & EVENT_KEY_NUM_MASK, encoded_event & EVENT_PRESSED);
      |                                                                                                ^```
tulip sleet
#

@onyx hinge it seems like nuttx is doing the nonstandard thing. We could define CONFIG_C99_BOOL8, but would it break some nuttx stuff? I can't tell.

onyx hinge
#

I can't tell either for sure. We would need to ensure all the files are built with CONFIG_C99_BOOL8. We don't care about non-C99 compilers and hopefully not about binary blobs, but maybe there are some in there?

tulip sleet
#

we could change those boolean expressions like encoded_event & EVENT_KEY_NUM_MASK to encoded_event & EVENT_KEY_NUM_MASK != 0

onyx hinge
#

yes, maybe with extra parens

#
nuttx/libs/libnuttx.a
``` no, we link in two binary blobs from it
#

so if it's abi-changing I guess maybe we can't do it

manic glacierBOT
#

There may be an issue having some of these lines in the start_prom function:

  esp_wifi_stop() ;
  nvs_flash_init();
  esp_netif_init();
  ESP_ERROR_CHECK( esp_event_loop_init(event_handler, NULL) );
  wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
  ESP_ERROR_CHECK(esp_wifi_init(&cfg));
  ESP_ERROR_CHECK(esp_wifi_set_storage(WIFI_STORAGE_RAM) );
  ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA));

Most of that is already done at system start up time, I'm not sure w...

manic glacierBOT
onyx hinge
#

oh junk, clang doesn't like the way I use the flexible array member πŸ˜•

#
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
QSTR updated
../py/runtime.c:1008:5: error: designator into flexible array member subobject
    EXTENDED_FIELDS(
    ^~~~~~~~~~~~~~~~
../py/obj.h:643:34: note: expanded from macro 'EXTENDED_FIELDS'
#define EXTENDED_FIELDS(...) .ext[0] = { __VA_ARGS__ }
                                 ^~~~~~~~~~~~~~~~~~~~~
../py/obj.h:644:29: note: initialized flexible array member 'ext' is here
    struct _mp_obj_type_ext ext[];
                            ^
1 error generated.
make: *** [build/py/runtime.o] Error 1```
stuck elbow
#

you'd think that C is C

idle owl
#

(β•―Β°β–‘Β°οΌ‰β•―οΈ΅ ┻━┻

#

Turns out you can't have a singleton for importing a library and only use if half the time, while trying to do something in init the other half of the time. It initialises the library twice that way. And gives you pin in use errors.

#

I really wanted the singleton import for this lib, but there are a couple of things you might do on initialisation. So... that's out.

tulip sleet
#

if you want to share the code we could cogitate on it

idle owl
#

I have one idea.

#

I am trying it.

#

If that doesn't work I can share.

manic glacierBOT
#

CircuitPython version

7.0.0-something

Code/REPL

N/A

Behavior

N/A

Description

I have noticed that after loading a new version of CircuitPython via UF2, it can start up in safe mode immediately after loading. I did not see this before 7.0.0. For example:

halbert@tuna:~/repos/circuitpython/ports/raspberrypi$ macropad-load    # my alias for copying to RPI-RP2
halbert@tuna:~/repos/circuitpython/ports/raspberrypi$ acm0    #my alias for con...
solar whale
#

Just listening for the meeting today. Nothing to report.

modern wing
#

Happily listening quietly for the meeting today. Thanks everyone for their hard work.

thorny jay
#

Just listening too.

idle owl
#

Having audio issues. Naturaly.

modern wing
#

Audio issues? Remember to unplug your monitors! [yay apple]

idle owl
#

I did that already πŸ˜„

#

<@&356864093652516868> Reminder: it's CircuitPython Weekly meeting time! πŸ™‚

onyx hinge
#

OBS hears me. I feel heard

manic glacierBOT
#

tried removing these lines and few variations (STA / AP modes and including/removing start/stop wifi) but no luck - still freezing on the line esp_wifi_set_promiscuous(true);. in terms of "debug console on pins 43 & 44", could you elaborate on this? is this something to enable a log or a output other than the REPL ? thank you for your help!

attempt #1 :
void common_hal_wifi_radio_start_prom(wifi_radio_obj_t *self, uint8_t channel, mp_obj_t callback) {
esp_wifi_stop() ;
ESP_ERROR...

lone axle
old smelt
tulip sleet
#

i can do core

onyx hinge
#

thank you dan!

sterile bronze
#

lurking

manic glacierBOT
#

The RX and TX pins on the FeatherS2 can be connected to another USB port on your computer via a USB breakout or similar, and output can be monitored with your serial program. This requires rebuilding circuitpython with the DEBUG=1 flag as above. There are some messages that are output by the underlying Espressif core code, some have been added by CircuitPython contributors in common-hal, and you can add your own to aid in debugging. For example, see messages starting with ESP_LOG in...

tulip sleet
austere acorn
#

It was my first contribution, hopefully out of many future ones πŸ™‚

Thank you so much to everybody who helped me! (sorry, I don't know everyone yet)
Hugs from me too!

onyx hinge
solar whale
#

@tulip sleet late hug report -- the keypad guide is great! Thank you.having fun with it.

tulip sleet
#

yw!

blissful pollen
#

Have to drop off for another meeting

solar whale
#

@onyx hinge sorry I missed the release of the camera guide -- will check it out over the next few days. Thanks!

#

My attention span has not been 10 minutes lately πŸ˜‰ I have not seen it but will try to reproduce.

sterile bronze
#

@idle owl yes I had issues on the macropad display

solar whale
#

Does it happen with just the repl?

lone axle
onyx hinge
#

^^^ the image from that issue

modern wing
#

Thanks everyone!

onyx hinge
#

Next meeting is on the 12th (monday) at the customary time

lone axle
#

Hope everyone has a great week

raven canopy
#

Thanks all! Have a great week.

errant grail
#

Thanks!

austere acorn
#

It's okay, i don't have a mic ready anyway πŸ˜„

gilded cradle
#

Record short meeting in quite a while

onyx hinge
#

I'm going to sign off, see y'all later!

gilded cradle
#

Bye Jeff, I'm going to sign off too

idle owl
#

@tulip sleet

#

Did it almost immediately after plugging it in on this one.

stuck elbow
#

I might have set wrong polarity/phase in the board.c

idle owl
#

That's displaying text, but it does the same thing with REPL display only as well.

#

Sometimes Blinka goes upside down etc.

blissful pollen
#

that looks similar (but different) to what I've seen on ESP32S2. The col/row values being sent to the display are off. I know lowering the frequency "fixed" it but that's probably not the underlying cause but could be a temporary fix.

#

I don't have a macropad to test on though

stuck elbow
idle owl
#

@stuck elbow Yeah as soon as I'm done with the post-meeting whatnot.

stuck elbow
#

thanks

idle owl
#

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/17UaJ2NvMP61i1V6rIwAq5VecsdoTKfSQVTOHetINmQw/edit

onyx hinge
#

Thanks @idle owl !

idle owl
stuck elbow
#

ok, thanks

#

@idle owl want to try some more combinations?

tulip sleet
#

@idle owl could you drop that program that causes the display issue here? I also have some tests to run.

idle owl
#

@stuck elbow Sure.

tulip sleet
#

@stuck elbow I am seeing if disabling SPI DMA fixes things.

idle owl
#

@tulip sleet It includes an in progress library. Let me see if I can get it without the lib because I'm pretty sure I can simply using keypad.

#

@tulip sleet Or maybe not. Maybe it needs to involve displayio or board.DISPLAY. At least it's not happening as quickly without those two anyway.

tulip sleet
#

I did this which improved the audio playing. It's only scratchy the first time now:

import displayio
displayio.release_displays()
time.sleep(1)
idle owl
#

wait!

#

No. I thought it started doing it, it did not.

#

I'll add that.

#

Serial output stops displaying if I add that.

#

hmm.

tulip sleet
#

it just disables the display, so you don't see anything. I am not trying to debug the display, just figure out why it's interfering with audio.

idle owl
#

There it goes.

tulip sleet
#

@stuck elbow disabling SPI DMA did not help. There is a fallback non-DMA transfer in SPI.c, but using only that did not help.

stuck elbow
idle owl
#

I at least have display with that one @stuck elbow

stuck elbow
#

oh?

#

exciting

idle owl
#

@tulip sleet What's with the blue flashing on startup? I don't remember that.

tulip sleet
#

i am not seeing bottom-row garbage with the macropad keypad example

idle owl
#

@stuck elbow Now I try to get garbage. πŸ™‚

tulip sleet
#

i'm not sure - Scott's new BLE-pairing stuff does that, though this doesn't have BLE.

idle owl
#

It only started since I updated to the latest today.

#

Wasn't doing it last week.

#

@stuck elbow Garbage displaying 😦

#

@tulip sleet Let me send you a zip of the code that makes it happen quickly.

tulip sleet
#

the pairing blinking was recently merged

idle owl
#

Apologies for the half-done code.

tulip sleet
#

yeah, I am not seeing an issue

idle owl
#

brb.

idle owl
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0-alpha.3-497-g23baa02c1 on 2021-07-06; Adafruit Macropad RP2040 with rp2040

Code/REPL

Issue occurs on startup.

Behavior

After updating to the latest build of CircuitPython, the status LED blinks blue after the yellow safe mode blinking on the MacroPad. I was informed that the blue flashing is related to Bluetooth pairing, however the MacroPad has no Bluetooth capabilities. I did not test it on oth...

tulip sleet
#

i am banging on the keys like a 3-year-old, and am seeing no display problems

idle owl
#

Interesting new format of bug submission. Weird not being able to preview my entire post.

idle owl
#

That's confusing because it's happening on two of them for me.

#

I guess I could unscrew the back and reseat the cable?

gloomy shuttle
#

did you try a soft reset via the REPL?

idle owl
#

Many times.

#

Only thing that fixes it is a hard reset.

#

Then it comes back.

tulip sleet
#

certainly you could try the cable. Mine looks ok

gloomy shuttle
#

I meant for @tulip sleet

idle owl
#

Ah sorry πŸ™‚

tulip sleet
#

do you mean that it would happen after a soft reset?

gloomy shuttle
#

Yes, I reproduced it by doing that

idle owl
#

Oh!

tulip sleet
#

I am not seeing that: I ctrl-C'd and restarted several tikmes

idle owl
#

@gloomy shuttle It happened immediately after a soft reset for me as well. It was taking a while this time, so I did a reset from the REPL, immediate garbage.

#

I reseated the cable, no effect.

#

I didn't even have to interact with the hardware directly to get it to start this time.

tulip sleet
#

are you using the absolute latest build? This is what I am using (just pulled from main and freshly built)

idle owl
#

Most recent thing on S3. Is what I'm using. I'll try yours.

gloomy shuttle
#

7.0.0-alpha.3-497-g23baa02c1

tulip sleet
#

yes, same here

idle owl
#

Same fail.

tulip sleet
#

i tried it as code.py and as a different .py I imported from the REPL

#

I see no fail.

#

i will ask limor a q

idle owl
#

@tulip sleet Connect to the serial with screen or whatever.

#

Oh you just said you did.

#

That's what seems to make it happen fast for me.

manic glacierBOT
tulip sleet
#

ok, now it's happening for me. This is very odd. Maybe it had to be warmed up.

idle owl
#

Oh good. I was starting to think I was causing the issue somehow.

tulip sleet
#

i was thinking maybe there were multiple versions of the display that were put on the board

idle owl
#

Not that I'm aware of.

#

SH1106 afaik.

stuck elbow
#

sh1106 has a lot of clones

idle owl
#

Fair enough, but I don't think the displays differ on this small initial run.

stuck elbow
#

if that helps, I'm using exact same init code with a similar display with samd21, and it works fine for me

#

but no keypad

idle owl
#

Trying to get it with simpler code.

tulip sleet
#

I think it has something to do with the SPI, possibly the SPI being interrupted by ctrl-C, and the display getting in a bad state due to that.

idle owl
#

Got it.

#

With this: ```py
import time
import digitalio
import board
button = digitalio.DigitalInOut(board.BUTTON)
button.switch_to_input(pull=digitalio.Pull.UP)

while True:
pass
print("some text")
print("")
print(button.value)
time.sleep(0.3)```

#

So it's not keypad.

#

Unless you mean the existence of the physical keypad.

tulip sleet
#

The SPI code checks for ctrl-C and can stop what it's doing abruptly. That could cause garbage data to be sent to the display (data interpreted as commands), which could easily mess up the display.

#

i don't think it has anything to do with the keypad.

idle owl
#

Fair enough.

tulip sleet
#

@stuck elbow this code is in SPI.c for the RP2040:

        while (dma_channel_is_busy(chan_rx) || dma_channel_is_busy(chan_tx)) {
            // TODO: We should idle here until we get a DMA interrupt or something else.
            RUN_BACKGROUND_TASKS;
            if (mp_hal_is_interrupted()) {
                if (dma_channel_is_busy(chan_rx)) {
                    dma_channel_abort(chan_rx);
                }
                if (dma_channel_is_busy(chan_tx)) {
                    dma_channel_abort(chan_tx);
                }
                break;
            }
idle owl
#

@tulip sleet Should I file the issue? Or do you want to?

#

I got it with ```py
import time

while True:
pass
print("some text")
print("")
time.sleep(0.3)```

#

Guess I don't need the pass in there. Started with no prints.

tulip sleet
#

so a DMA can be interrupt while in progress, which could easily leave things in a bad state. I reduced the SPI speed of the display to 100kHz (from the initial 1MHz), and it was easy to produce. I increated the SPI speed to 10MHz, and I did not reproduce it.

idle owl
#

Yeah it eventually garbles with only the prints.

stuck elbow
#

I don't think ctrl+c should interrupt SPI transactions :/

tulip sleet
#

i agree

blissful pollen
#

I would think interrupting SPI may mess the current transaction up but future ones should be fine, unless the display core settings itself get "off"

stuck elbow
#

right, among other things it has registers for where the active display begins and ends

#

this looks like they get set to smaller values, so only part of the display is used

blissful pollen
#

I guess if the command itself got garbled (instead of the row/col/data commands) that could cause an issue

tulip sleet
#

also I saw the text become upside-down at the top

stuck elbow
#

I hope it doesn't mess with the voltage pump registers

tulip sleet
#

i also saw it flicker

stuck elbow
#

I believe the voltage registers can only be changed while the display is off

#

as protection from this kind of things

idle owl
#

@tulip sleet So adafruit_macropad.py has two classes in it. (You have a currentish version of it from the zip I sent you.) The second one is initialising the Simple Text Display library. Is there a way to make the second class accessible from the MacroPad class (the first class), so I can import only from adafruit_macropad import MacroPad and have everything? So I could do something like macropad.TextDisplay(title="Titlehere!") instead of having to import SimpleTextDisplay separately.

#

If this makes any sense anyway.

#

I tried to make it a property or something, but then it complained about the inclusion of the Title, which is only one of many things settable when creating the instance of it.

#

Googling it isn't helping.

manic glacierBOT
#

CircuitPython version

7.0.0 latest, easily visible on MacroPad

Code/REPL

# code.py could be as simple as:
import time

i = 0
while True:
    print(i, "some text")
    i += 1
    time.sleep(0.1)

Behavior

The MacroPad display can become garbled if the code above is run, and then interrupted with ctrl-C, and then restarted with ctrl-D. Trash will appear on the right side of the display. Other more display-intensive programs can cause worse pr...

tulip sleet
idle owl
#

Hmm. Ok.

#

Thanks.

tulip sleet
#

@idle owl I'll be out for a few hours startin soon

idle owl
#

I think I figured out how to do what I wanted. It's kind of kludgey but it'll work.

idle owl
manic glacierBOT
manic glacierBOT
lone sandalBOT
manic glacierBOT
#

There's a difference in the level of support for static initialization of flexible array members in gcc vs clang.

typedef struct flex {
   int i;
   struct {
       int a, b, c;
   } j[];
} flex_t;

flex_t f1 = {.i = 3};
flex_t f2 = {.i = 4, .j[0].a = 1, };
flex_t f3 = {.i = 4, .j = {{.a = 1,}}, };

Styles f1 and f3 are supported in gcc and clang; style f2 is supported in gcc but not in clang. Therefore, we must select style f3 when extended fields are being initialized.

onyx hinge
#

OK, the discovery of the difference between styles f2 and f3 puts me back on track and lets me NOT make a bunch of changes to the C types of the type structures that it looked like I would have to do. (I had done style f3 the first time but thought style f2 "read better")

#

I discovered it after making many/most of the edits 😬

solar whale
#

None of those "read well" IMO πŸ˜‰

#

That is any one will send me to google at first glance

onyx hinge
#

You're not wrong.

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
cobalt quiver
#

When is the keypad module set to be standard in circuitpython?

onyx hinge
#

@cobalt quiver in version 7.

#

right now you need to grab the latest builds from S3, look for the link like this on your board's page on circuitpython.org:

cobalt quiver
#

I know about the s3 thing, I was just wondering

onyx hinge
#

I think that we hope to release "alpha 4" soon, which will also include it

#

wow there are over 500 changes since "alpha 3" according to github.

cobalt quiver
#

Oh my

stuck elbow
#

SHIP IT!

idle owl
#

I need some help with I2C addressing with jumpers.

onyx hinge
#

@idle owl I'll try to help you with some wording

idle owl
#

I'm not even sure where I got the default address. Might have I2C-scanned it.

#

I can't find it in the product copy or wherever.

onyx hinge
#

I don't have a board to test so I'll be going off what I can see from source code

idle owl
#

I'm not going to test all possible permutations either πŸ˜„

onyx hinge
#

I am pretty sure that A0 adds 1, A1 adds 2, A2 adds 4, and A3 adds 8; that's what a programmer would do

idle owl
#

Ok that matches the other one with 3 jumpers too.

#

I guess I thought it would be 0x30-(whatever the next 15 hex values are), but I think that's wrong.

onyx hinge
#

do we write i2c addresses as hex usually?

idle owl
#

Apparently

#

Yes.

#

The I2C scan program converts it too.

onyx hinge
#

OK

#

I think that yes, the possible addresses are 0x30 through 0x3F. 0x30 is with all jumpers open, 0x3F is with them all closed.

idle owl
#

Ah ok

#

So I wasn't wrong.

onyx hinge
#

If you wanted to give it a test you could close A0 and check that you get 0x31, also close A1 and check that you get 0x33, A2 -> 0x37 and A3 -> 0x3f but that is, like I said, what a programmer would do

#

Knowing that after 0x39 is 0x3A is where a learner would get tripped up, but someone who wants more than 10 of these things maybe should learn something while they're busy soldering and wiring πŸ™‚

idle owl
#

Hah. Yeah.

onyx hinge
#

that's not a specific wording suggestion, but does it help?

idle owl
#

Yes.

#

Verified your hunch with Limor.

#

So I'll grab the wording from the MCP guide

#

and tweak it.

#

And then have you tell me what the addresses should be. πŸ˜„

onyx hinge
#

Now I want the flex PCB version of this so you that with 3d printed parts can make an ergonomic keypad/keyboard

idle owl
#

@onyx hinge What is 0x30 + 4 + 1 ? 0x35 ?

onyx hinge
#

should be! ```python

hex(0x30 + 4 + 1)
'0x35'

idle owl
#

Thanks.

#

@onyx hinge The default address is 0x30 and the address can be calculated by β€œadding” the A0/A1/A2/A3 to the base of 0x30. 
A0 sets the lowest bit with a value of 1, A1 sets the next bit with a value of 2, A2 sets the next bit with a value of 4, and A3 sets the high bit with a value of 8. The final address is 0x30 + A3 + A2 + A1 + A0 which would be 0x3F. 
So for example if A2 is tied to VDD and A0 is tied to VDD, the address is 0x30 + 4 + 1 = 0x35. 
If only A0 is tied to VDD, the address is 0x30 + 1 = 0x31
If only A1 is tied to VDD, the address is 0x30 + 2 = 0x32
If only A2 is tied to VDD, the address is 0x30 + 4 = 0x34

#

Is that accurate?

#

Spacing got weird.

#

But still.

onyx hinge
#

Yes I think that's all correct. Do you say that soldering up the jumper "ties" to VDD somewhere? Would it be better to say that "connecting the jumper" (or closing or soldering it) has an effect instead?

idle owl
#

No I do not mention that. I will.

onyx hinge
#

It at least looks like that MCP board doesn't have solder jumpers, it just has A0/A1/A2 as pins, so you do have to connect those to the pin labeled Vdd .. as opposed to this board

#

so I'd remove "tie[d] to VDD" and replace

idle owl
#

I just saw that. This board is VIN.

#

Replaced with "soldered closed"

onyx hinge
#

probably you don't want to connect VIN to the solder jumpers, you just want to close the jumper with solder. thanks!

idle owl
#

Yes.

onyx hinge
#

VIN might be a damaging voltage if you connected it there

idle owl
#

I'll link you to the page when I'm done so you can give me final feedback

onyx hinge
#

Sure thing, I'll be around much of the afternoon

idle owl
#

What if only A3 is soldered closed?

onyx hinge
#

which ties the pin to VIN.
I'm not sure this is accurate, but you would be able to tell from the schematic.

idle owl
#

ok I'll remove it

onyx hinge
#

'0x38'

idle owl
#

Don't care that much πŸ™‚

#

Thanks, I realised it was an easy one after I asked 🀦

#

Ok fixed

onyx hinge
#

about the photo .. is it usual to leave the view as the whole board when highlighting the small area? I don't have the easiest time telling which is the highlighted area when it's so small.

#

but that's outside the scope of your question, sorry

idle owl
#

Yes, it's usual. Only showing part of the board gets confusing.

#

Folks get confused about what they're looking at and where it is.

#

That's why I try to use super high res photos for pinouts.

#

So you can look at the original and zoom.

#

I don't always have high res photos tho.

#

I mean, look at Power LED. Even tinier.

#

Β―_(ツ)_/Β―

onyx hinge
#

Is it worth saying you could just write out in your code 0x30 + 8 + 4 + 2 + 1 instead of figuring out 0x3f?

idle owl
#

Mmmm...... nah.

onyx hinge
#

OK

idle owl
#

Because they can I2C scan for it too.

#

If I get further complaints, I'll add it πŸ™‚

#

That's the last of my guide feedback for the day!

onyx hinge
#

I think the technical bits are right

#

On the back of the board, are four address jumpers
I'm not sure whether this comma belongs here

idle owl
#

it does not.

#

Fixed.

onyx hinge
#

Thanks for taking my suggestions!

idle owl
#

Thank you for your help!

#

My hex is..... bad.

#

So...

#

heh

#

I mean I get it

#

but I have to write it out every time

#

my brain doesn't do it naturally

onyx hinge
#

That's why to pull up Python and make it calculate for you

#

I couldn't calculate 0xf - 0xc in my head like I can calculate 9 - 6, don't sweat that.

crimson ferry
#

I usually scribble a little binary-to-hex chart if I get confused

idle owl
#

My binary is nonexistent πŸ˜„

#

But that is super useful

onyx hinge
#

did you check at least one solder jumper setting to make sure we're on the right track?

idle owl
#

No. But I asked Limor about what jumper added what. And she said you were right.

onyx hinge
#

Turns out that soldering the jumper connects a pin to GND but I wouldn't bother explaining it there. Someone who wants to know can see the schematic.

idle owl
#

Fair enough.

idle owl
#

This display garbage is getting really frustrating.

#

Trying to work on displaying an image and have to hard reset every minute or so

#

I think I got it working πŸ˜„

#

Except now it displays the image and never mounts CIRCUITPY. I can reset into safe mode ok. Borked something, clearly.

idle owl
#

@gilded cradle I have a question about the graphics code in PortalBase. Why do you create a splash (https://github.com/adafruit/Adafruit_CircuitPython_PortalBase/blob/6ffe1034509c09f64a8790abd1137c186d9c484d/adafruit_portalbase/graphics.py#L51) and then create _bg_group (https://github.com/adafruit/Adafruit_CircuitPython_PortalBase/blob/6ffe1034509c09f64a8790abd1137c186d9c484d/adafruit_portalbase/graphics.py#L55) and then use set_background after show()? I wrote up some simpler code that "works" (worked) but it's now causing major issues and I'm trying to figure out what I did wrong.

#

I guess I'm asking why create two groups.

#

I don't think that's the problem I'm having, but it's the only major difference I can see in what I took out of this code. (Except mine is its own method, not class level setup.)

#

Wait I think I get why you did it. And I'm not sure I need to do it because I'm not handling things at class level and method level separately. So then I have no idea what my issue is.

#

It bogs everything down, CIRCUITPY disconnects, and doesn't come back up. I have to go into safe mode and rename or edit code.py to get it back.

#

There is garbage collection in PortalBase. I added it to MacroPad. It seems to be helping. Hmph.

#

Using with as Pylint insisted also seems to be helping without the garbage collection.

fathom violet
#

Hi everyone! my USB proble got solved, it was a bad configuration of the crystals and the GCLK selected for the USB

idle owl
#

Glad it was resolved!

fathom violet
#

now im facing the problem while mounting the Flash πŸ˜„

idle owl
gilded cradle
#

@idle owl I think I did it that way so the background could be changed out without removing all the other stuff inside splash. It could be done without the second group, but it requires more careful manipulation of everything. Much of the code in PortalBase originally came from the original PyPortal library that Limor wrote. Awesome that you got it working with with.

idle owl
#

Thanks

gilded cradle
#

Sorry for the late response, my computer was muted, so I didn't hear it.

idle owl
#

It was confusing there for a bit.

#

No worries.

#

I'm onto struggling to document things πŸ˜„

gilded cradle
#

πŸ™‚ That's always the hard part.

manic glacierBOT
#

We would need a plan for how ulab could be compatible with both CP and MP since it both needs to declare types with the extended fields, and also query an optional field.

I think it would be really great, if this proposal ended up in micropython proper. However, I just want to re-iterate my position with regards to ulab: if micropython needs more time, this fact shouldn't block development on the circuitpython side, and I am more than happy to accommodate temporary patches, if by...

idle owl
#

It seems to randomly fail with random issues that aren't really issues. Recopy the lib and it works again.

#

Β―_(ツ)_/Β―

gilded cradle
#

Like what kind of issues?

idle owl
#

Like this out of nowhere (e.g. it was working for an hour then this) AttributeError: 'tuple' object has no attribute 'pixel_shader'

#

Then recopied the lib, the only changes to which are documentation, and it runs fine again.

gilded cradle
#

Probably because it restarted

idle owl
#

It reloaded a bunch with that failure once it popped up.

gilded cradle
#

It's hard to say without seeing the code

idle owl
#

Yeah. I'm not sure the code will even help. I can push what I have to my branch though anyway.

gilded cradle
#

I could take a look if I could see the code and get some line numbers regarding the failure

idle owl
#

The line number won't match anymore. Because of the docs. πŸ˜•

#

And it's not failing now.

gilded cradle
#

ah

idle owl
#

I know what it was complaining about though, and it makes no sense.

#

Hold on, linking.

#

Would help if I committed before pushing πŸ€¦β€β™€οΈ

gilded cradle
#

No worries. I'm just sitting here working on getting annoyed with the Raspberry Pi OS not cooperating. πŸ™‚

idle owl
gilded cradle
#

Perhaps displayio.OnDiskBitmap returned a tuple for some reason

idle owl
#

Possible. But weird if so.

#

Working now. So who knows.

gilded cradle
#

Yeah

idle owl
#

Thanks for taking a look anyway.

gilded cradle
#

no worries

idle owl
#

Lib is coming along. Other than audio which is waiting on it being fixed in CP, I think it's got everything worth adding.

gilded cradle
#

Cool, I was holding off playing around with the Macropad since I knew the library was forthcoming.

idle owl
#

I think it's feature complete if you want to test it. I haven't documented everything with examples though.

#

I have a quick example that uses a few of the main features running right now.

#

@tulip sleet I'm trying to document keys and I'm not sure how to describe it. It's the keypad.Keys() object with the key pin index and so on already provided. So you can do macropad.keys.event.get() etc in your code with it.

tulip sleet
#

keys is a scanner. It scans all the pins provided for key transition events. It records those events in keys.events. (Is that the kind of thing you're looking for?)

idle owl
#

Maybe? I think that might work.

#

Maybe higher level than that.

#

Because the pins are provided and so on

#

User never sees that.

gilded cradle
#

Cool, I won't have time to test today as I'm trying to get a demo going before the meeting.

idle owl
tulip sleet
#

is there any language in the keypad guide Overview or Keys page that might help?

idle owl
#

I'll take a look.

#

I've gone to it so many times during this that typing "keypad" into my browser search bar brings that up as the first option.

#

No idea if this will render properly. I'll find out when I finally bother to get Sphinx building.

#

Also not sure if this is too much information.

#

Β―_(ツ)_/Β―

#

@gilded cradle Documentation question. I wrappered the entirety of MIDI and HID into this lib. Think it's reasonable to simply link to the RTD documentation for the individual things? RTD renders links, so they would be clickable in the RTD docs for this library.

#

Or I guess link to the general docs for MIDI and HID in case it's refactored later and the links change... I dunno.

gilded cradle
#

It's hard to say @idle owl. Either way would work I'd imagine.

idle owl
#

I linked it to the main docs and specified "look at this section". Probably good enough.

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

@mtk11 Hope the following helps. :)

I expected the high-level BLE library to be included in the nRF port.

  • Native modules provide only basic connection between the python layer and hardware.
  • Libraries are built on top of native modules and act as a wrapper for them. These make the interaction with the native modules easier and also provide functions that aren't related to hardware.

Flash space constraints is the primary reason for not including libraries with the port.

A...

manic glacierBOT
manic glacierBOT
#
  • My example with the countdown now runs to completion.
  • PulseOut crashes with the same symptoms if the first pulse is less than 40us, at both 38kHz and 500kHz.
  • I retested the first example in #4908 but changed to 500kHz, and that was OK for as long as I watched it for.
  • If we want to guarantee that a pulse is output for too-small values, stretching to half a cycle doesn't achieve that. I expect a full cycle is needed.
manic glacierBOT
#

Without having taken a look at your wifi myself id still go with the suggestion of it being a "wifi is wifi" sort of thing.
Im getting the same errors here and im in a very bad room, wifi wise. Its not uncommon to get request denials or getting similar issues when there are bad conenctions. Remember, the antenna on the esp32 isnt that big and since wifi is as it is...

However thank you all for the code, il try it myself and see if it works.

tulip sleet
#

@idle owl I have a potential fix for the scrambled macropad display. You seem to be very good at provoking it, so would you have time to test a .uf2?

idle owl
tulip sleet
#

sure

idle owl
#

Apologies for the delay. Slow starting day today.

tulip sleet
#

np

idle owl
#

@tulip sleet Lay it on me.

onyx hinge
#

@tulip sleet I wanted to enable a special mode in my calculator if two keys on the key matrix are held at start-up. How would you recommend doing that with keypad?

#

would I be guaranteed that all the held keys (up to the queue size) would be available immediately after creating the matrix? or are initially-held keys not sent as key presses?

manic glacierBOT
#

@dmcomm, a PWM 'cycle' includes both high and low states, whereas a pulsein
'pulse' is only one or the
other. That is the reason for using a half-cycle for PulseOut. I will check
on the short initial pulse, I did not test for that.

On Thu, Jul 8, 2021 at 5:06 AM dmcomm @.***> wrote:

  • My example with the countdown now runs to completion.
  • PulseOut crashes with the same symptoms if the first pulse is less
    than 40us, at both 38kHz and 500kHz.
  • I retested the firs...
tulip sleet
onyx hinge
#

would I need to wait up to the polling time for the first poll? or is the first one immediate? i.e., do I need to sleep(.040) or something

tulip sleet
idle owl
#

@tulip sleet I have it sitting here spewing garbage right now, so it's the perfect test πŸ˜„

#

Already getting artifacts 😦

#

Not nearly as bad yet though

#

give me a minute to stress it.

tulip sleet
#

@idle owl try power-cycling

idle owl
tulip sleet
#

so do a ctrl-C and restart, that's really what the problem is

#

if you have not done that already

idle owl
#

There are artifacts showing up on the right side.

tulip sleet
#

with the little sleep program?

idle owl
#

No with my MacroPad lib running.

#

So.... stressier.

#

Let me get vid.

tulip sleet
#

are you doing neopixel stuff

idle owl
#

Yes.

tulip sleet
#

I will change something in neopixels also. keep trying and i'll see about that.

onyx hinge
#
module 'isort' has no attribute 'SortImports'
internal error with sending report for module ['CircuitPython_Templates/cap_touch_one_pad.py']
module 'isort' has no attribute 'SortImports'``` wow this message occurs a lot in learn git repo during the pylint step
idle owl
#

@tulip sleet

#

So it's a HUGE improvement.

#

But still something is going on.

onyx hinge
#

pylint 3.9 (standard on debian testing / bullsye) is incompatible with the learn repo github πŸ˜•

idle owl
#

Yeah the Learn repo is still on 1.9.2 😒

onyx hinge
#

It will get harder to stay on 1.9.2, but it's not easy to change either

tulip sleet
#

again, load this and then powercycle. This removes being able to ctrl-C the rp2pio, which is used to drive neopixels (and uses DMA).

idle owl
idle owl
#

@tulip sleet So is that a viable solution? Or a kludgey workaround?

#

Display is so far fine. There's random flickers of individual lines of text, but I think that's not related. I think it might be due to how the code works to update part of the line. It's not ending with artifacts or garbage.

tulip sleet
# idle owl <@!329766224093249548> So is that a viable solution? Or a kludgey workaround?

Part of it is clearly right (don't let SPI be interrupted by ctrl-C). Not being allowed to interrupt an rp2pio transaction is probably also good, because it could be used for something like SPI. For the neopixel case, it should not matter. I know there is still some underlying DMA problem. But we can take this for now and I will continue to work on the DMA issues, and maybe undo some part of this later.