#circuitpython-dev

1 messages · Page 35 of 1

rough rapids
#

fstrings should work exactly the same way .format does (same format mini-language). The % formatting notation is a holdover from Python 2, which is a holdover from C, and unfortunately persists in the stdlib logging module as well.

#

But as @jaunty juniper is suggesting the error message seems like it comes from the internal format operator not correctly receiving operands

stuck elbow
jaunty juniper
#

yeah I don't know actually, it seemed like it at first glance but I'm not quite sure

stuck elbow
#

so log.debug("I2cConnection received raw: %s", self._data_to_log_string(result)) should work

willow totem
jaunty juniper
willow totem
#

so can I fix adafruit logging too, and then my problem goes away 🙂

#

or are there very good reasons like arduino/samd to use the % version

rough rapids
#

@Nerdadoc but () isn't a tuple, whereas *args is guarenteed to be at least an empty tuple

stuck elbow
jaunty juniper
#

yes it is

stuck elbow
#

it's a special case

willow totem
#

fix how it's not compatible with python logging module due to this bug

stuck elbow
#

normally it should be (,)

willow totem
#

or special case

rough rapids
#

ah, my bad, you're right.

jaunty juniper
willow totem
stuck elbow
#

something like record = _logRecordFactory(self.name, level, (msg % args) if args else msg, args)

willow totem
#

oh clever and simple, was assuming id have to dig into python logging module to compare

willow totem
stuck elbow
#

you don't have to guess

#

to be honest, I'm not sure myself, so I put them in there to avoid confusion

manic glacierBOT
willow totem
#

oh there was one other technical question, I've had to comment out the future import due to cpy not having absoluteimport, this is the line from __future__ import absolute_import, division, print_function so my question is, is it just for python2 compatibility?
As I know future exists in cpy should I add a stub for absolute import (doing nothing), or if you were me and butchering the library anyway just comment it out everywhere and forgo Python2 compat (what ive done for now).

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.3 on 2023-02-23; S2Mini with ESP32S2-S2FN4R2

Code/REPL

>>> import wifi
>>> import ipaddress
>>> ipv4 = ipaddress.IPv4Address("192.168.1.100")
>>> netmask = ipaddress.IPv4Address("255.255.255.0")
>>> gateway = ipaddress.IPv4Address("192.168.1.1")
>>> wifi.radio.set_ipv4_address(ipv4 = ipv4, netmask = netmask, gateway = gateway)
>>> wifi.radio.connect(os.getenv('CIRCUITPY_WIFI_SSID'), os.getenv('CIRCUITPY...
brazen hatch
#

The feather tft code only captures print() and not direct serial writes.
That is a known issue I assume? Or is it a non-issue?
(I just got the feather)

slender iron
#

you are typing over webserial and it isn't showing on the lcd?

zinc maple
#

Hey all! Been a while since I've been in here so not sure where is appropriate to put this so feel free to delete/move this post. Have some news regarding EduBlocks (which as you might remember has CircuitPython support) 🙂

https://twitter.com/all_about_code/status/1654196244678430723?s=20

🎉 Exciting News!!!

EduBlocks has been acquired by Anaconda!

I'll be joining the Anaconda team full-time to continue to lead and develop the platform further.

Really excited about the future and what we can achieve together!

blissful pollen
#

That seemed to work. On Windows had to connect to it within the OS settings. Then from the browser I could connect

brazen hatch
brazen hatch
#

wait one moment

#

oh no it’s just usb_cdc.console not being printed

#

that’s fine I guess

#

hmm, supervisor.runtime.serial_connected being always true doesn’t feel right

#

the usb_cdc stuff work like normal, but the rest are very sus

#

Well i’m glad I moved to console objects.

idle owl
manic glacierBOT
#

I'm curious if specifying the BSSID (and maybe channel) of the hidden AP matters with the current API.

Looks like there's a scan config option to show hidden
https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/api-guides/wifi.html#scan-configuration
which we'd probably do where we allow connect to specify BSSID and / or channel
https://github.com/adafruit/circuitpython/blob/fa9b59d14c156b614410fa26a6228febc207131e/ports/espressif/common-hal/wifi/Radio.c#L304
not sure of wheth...

slender iron
manic glacierBOT
brazen hatch
#

With these you can read .connected, and read in/out_waiting with a single object.

#

So I made my curses library jcurses just accept these for it's data streams.

#

This way, I can plug a UART serial object to it just the same way.

#

And this means I can switch between different consoles in runtime.

#

I did this so I can in the future make diy ssh by a virtual console object.

slender iron
#

👍

#

that'll go straight to usb and not the screen

brazen hatch
#

Yea makes sense. I had forgor I switched all the prints to that.

#

Well, when I make it store multiple streams, I will add mirror capability.

#

I want to eventually make it autoswitch like micropy does.

slender iron
#

you can make your own terminal grid and feed it your output

brazen hatch
#

I have enough ansi magic already, any more and my head will explode.

#

I kinda do mean that.

brazen hatch
#

This is running on the feather.
The display would have a stroke trying to display it regardless.

#

It would be funny tho.

#

Maybe when I finish the ljinux display driver stuff, I can make the display a virtual console object too.

#

stdin would be broken though.

orchid basinBOT
orchid basinBOT
manic glacierBOT
#

thanks Jeff for all of this! this is my first time trying out synthio so trying to catch up a bit. just to make sure i'm understanding everything properly- the idea is that you'd make an array of notes and then tremolo and vibrato is affected live while you're playing? and then at this time, the envelope is more static and is only affected before/after a note is played? in that case i do like the idea of adding the envelope properties to this note object so that everything can be affected whi...

#

@BlitzCityDIY cracks and pops on speaker is familiar -- i get the best performance using this speaker https://www.adafruit.com/product/4445 with this amp https://www.adafruit.com/product/3006 On some projects I've given that amp 5V from a separate supply to make it happier.
The Metro M7 not showing up has happened a few times, I'm not sure if it's a USB cable issue or other.

#

the traceback is due to use of range where it's not needed:

>>> for i in range(hz_tones): print(i)
... 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported types for __lt__: 'int', 'list'
>>> for i in hz_tones: print(i)
... 
130
164
196

desktop python gives a slightly different error text that's maybe easier to understand:

>>> for i in range(hz_tones): print(i)
... 
Traceback (most recent call last):
  File "<stdi...
onyx hinge
#

huh TIL that this works in circuitpython (but only if it's for ... in range...: : ```>>> for i in range(3.1, 7.9, 2): print(i)
...
3.1
5.1
7.1

#

it's a bug but an unimportant one

manic glacierBOT
orchid basinBOT
shadow vigil
#

the range concept is pretty central to python

manic glacierBOT
manic glacierBOT
#

1.I read the lvgl_binding_micropython code. It make the lvgl source file into a module like the the module framebuffer. I think it all run in the vm(loop the lv.task_handle()). so can do embed it!
2.if we use the c source lvgl to make a special ui,just like the peripheral to call!,this can make the lvgl running in the cpu_core0(eg esp32s3,2 core),we just need to call the python vm‘s task to make the task loop,but this have two ways to reach: (1)use the thread, like the micropython’s timer ...

manic glacierBOT
lone axle
# zinc maple Hey all! Been a while since I've been in here so not sure where is appropriate t...
  1. Congratulations 🎉 2) The platform you created is amazing, great job and thank you for putting so much effort into making it easier for people to learn programming. 3) Do you have a preferred place or method to search for and/or submit issues? I've noticed the neopixel code that is generated is not complete enough to execute successfully on a device in some cases. Id be interested in attempting to help resolve it as well if you are open to other contributors (though I'll likely need to study up a bit on the JS tools in use). I found the Github here: https://github.com/edublocks/edublocks is that the best place to coordinate development efforts?
zinc maple
tidal kiln
#

seeing a RP2040 specific I2C quirk

#

here's test code:

import time
import board
i2c = board.I2C()
i2c.try_lock()
i2c.writeto(82, b"")
time.sleep(0.1)
i2c.writeto(82, b"")
#

the first i2c.writeto looks like this:

#

the second one looks like this:

#

why this lag in the first one?

#

test setup for ref:

Adafruit CircuitPython 8.0.5 on 2023-03-31; Adafruit Feather RP2040 with rp2040
>>> 
#

also tested with a feather m4, which does not do that

onyx hinge
#

@tidal kiln also not sure but I know that on rp2040 a zero-byte read is a special case that's actually using bitbangio, per a source comment: ```c
if (len == 0) {
// The RP2040 I2C peripheral will not perform 0 byte writes.
// So use bitbangio.I2C to do the write.

tidal kiln
#

hmm. so maybe could be due to change over, from hw to bitbang?

#

curious what a non-zero followed by another zero len looks like....trying that now...

manic glacierBOT
#

The UM Feather S3 has now been running 52 hours without crashing. Somewhere between 25 and 52 hours the Adafruit Feather S2 with the Lolin S2 Mini firmware crashed but I didn't capture any information as a terminal wasn't connected at the time. Before I build a debug image and try and capture a traceback, maybe I'll try a Lolin build with CIRCUITPY_ESP_FLASH_FREQ set to 40m.

#

I had another crash last night. I did not run any display code. So, this
was a clean run of just the asyncio.

On Fri, May 5, 2023 at 12:07 PM RetiredWizard @.***>
wrote:

The UM Feather S3 has now been running 52 hours without crashing.
Somewhere between 25 and 52 hours the Adafruit Feather S2 with the Lolin S2
Mini firmware crashed but I didn't capture any information as a terminal
wasn't connected at the time. Before I build a debug image and try and
capture a traceback, ma...

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.2 on 2023-02-14; Waveshare RP2040-Zero with rp2040

Code/REPL

import microcontroller
if __name__ == '__main__':
    print(microcontroller.cpus[0].frequency)
    print(microcontroller.cpus[1].frequency)
    microcontroller.cpu.frequency = 1000000
    print(microcontroller.cpu.frequency)

Behavior

125000000
125000000
Traceback (most recent call last):
File "stdin", line 5, in module
Attribut...

#

Hi, it was just added, it's only available in current main.
Which you get from the board's page https://circuitpython.org/board/waveshare_rp2040_zero/
Going through the "Browse S3" link, choosing the language, and downloading the top UF2.

You can consult the latest stable build documentation with the panel on the bottom left.
https://docs.circuitpython.org/en/8.0.x/shared-bindings/microcontroller/index.html#microcontroller.Processor.frequency

manic glacierBOT
manic glacierBOT
idle owl
#

Sooooooo... I am working on some CircuitPython wifi code, and this is now what I'm getting when I try to run it. CircuitPython core code crashed hard. Whoops! Fault detected by hardware.

#

The thing I updated was that I'm running ping in the loop.

#

Which I'm fairly certain I need to do for what I'm trying to do...

brazen hatch
#

too many pings == crash

idle owl
#

Ahhhhh

#

Thanks so much

brazen hatch
#

Even veterans forget.
No problemo.

idle owl
#

I'm a CP wifi noob. So.. heh.

brazen hatch
#

I have a fair bit of wifi code, so if I can be of help feel free to ping.

idle owl
#

Do you know what kind of interval I should use?

brazen hatch
#

I guess, as long as it's not too fast it should be fine

idle owl
#

And yeah the loop is way too fast, clearly.

#

Excellent, I'll do 1s.

#

Hmm. time.monotonic() question. If I'm tracking two different time intervals, in two separate time blocks, do I need a separate variable for current_ or initial_time for one of the blocks? Or how does this work. ```py

Initialise time tracking

initial_time = time.monotonic()

Track the first time the code runs.

first_run = True

5 minutes in seconds

time_check_interval = 300
ping_interval = 1

The times at which it should change from blue to red, and red to blue

color_time = [RED_TIME, BLUE_TIME]

Track consecutive ping failures

ping_fail_count = 0
while True:
current_time = time.monotonic()
try:
if first_run or current_time - initial_time > ping_interval:
wifi_ping = wifi.radio.ping(ip=ip_address)
if wifi_ping is not None:
ping_fail_count = 0
if first_run or current_time - initial_time > time_check_interval:
if RED_TIME <= sundial.tm_hour or sundial.tm_hour < BLUE_TIME:
print("Red time!")
pixels.fill(RED)
pixels.show()
if BLUE_TIME <= sundial.tm_hour < RED_TIME:
print("Blue time!")
pixels.fill(BLUE)
pixels.show()
# reset clock
current_time = initial_time
first_run = False

#

I need a current_time = initial_time in the first block inside the try, but I'm wondering now if that changes how the second block's tracking works.

#

This might have made more sense in the help-with channel. 😕

brazen hatch
idle owl
#

(That snippet is clearly not the entire program.)

#

Ohhhhh

#

I think I get it. Thank you!

idle owl
#

Because something isn't right again, and I am trying to figure out where to start.

#

The ping is happening 1 second apart at least.

brazen hatch
#

Can be shortened by setting current time as 0 for first run.
The rest seems fine.

#

Wait, the variable names are kinda flipped, so by setting initial_time as 0.

idle owl
#

I don't think I understand. 😕

brazen hatch
#

Yea same.
It's midnight and I have been studying for 5 hours.

stored_time = 0
if time.monotonic() - stored_time > ping_interval:
    ...
    stored_time = time.monotonic()
idle owl
#

Ah hmm.

brazen hatch
#

For the first run it will be time.monotonic() > ping_interval.
Wifi connection can take like 7s, so it's not a matter of being in that part in the first second.

idle owl
#

Hmm ok

#

first_run is a tracked variable. And you're saying I can do it with time instead?

idle owl
#

Ohh hm. Ok.

brazen hatch
#

I see no reason to store a first_run just for this

idle owl
#

Let me see if I can make that work.

#

Ooooh.

#

This is working time-wise now. I think.

#

Trying to make another part work the way I want now.

brazen hatch
#

If you want to make it extra fancy you can do the rtt and averages.

idle owl
#

This is supposed to be simple 😂

#

Ok, give me a minute to check whether the ping successful code works right. Then is it ok if I post it here for you to take a look at? I'm absolutely certain I'm doing extra that I don't need to, but this is how I know how to do it.

#

Ugh. Safe mode.

brazen hatch
#

Well, I suggest you spam a few print(f"CT: {time.monotonic()}") around the code.

idle owl
#

I'm spamming rando prints at least.

brazen hatch
idle owl
#

Will do.

#

This was mostly working before. It is now less working than it was. sigh.

onyx hinge
brazen hatch
onyx hinge
brazen hatch
#

It can prolly be fixed by the same time.monotonic logic, by storing a last_ping_time in the core.

idle owl
#

I figured it out.

#

It's doing what I thought it would

#

the time is getting reset to time.monotonic() in the loop, so the second time interval is never met because it's longer. That's why I thought I might need a separate stored_time.

#

I think I need one more time variable.

brazen hatch
#

Not sure I quite understand the issue. As long as stored_time is initially defined outside the loop, it should be fine.
Code?

idle owl
#

Two shakes

jaunty juniper
#

I prefer using a variable that is set to when the next event must happen, when you have multiple timed things, each has their "next time" variable

#

"next time" or "last time" is equivalent, but I find that using the next time is easier to math

idle owl
#

Ok, @brazen hatch here's my code. It is currently working like I want it to, or so it seems. No safemodes bounces, and it's doing the things when it's supposed to.

jaunty juniper
#

it also makes it easier to compute next time in different ways depending on whether you want to guarantee a delay or avoid drift

idle owl
#

That said, I'm almost certain it could be simplified somewhere.

jaunty juniper
idle owl
#

So in theory that could be removed entirely.

#

But good call.

#

One would probably not want to check it if the ping fails.

brazen hatch
idle owl
#

Right, I haven't gotten to the formatting stuff yet.

#

Nice!

#

Thanks so much!

brazen hatch
#

It was a quick read, logic errors may have been missed.

crimson ferry
idle owl
#

I'm walking the line between "simple" and "will keep working"

crimson ferry
#

supervisor.reload and microcontroller.reset are two of my best friends 😉

idle owl
#

There's a reset on error function that will be switched back to microcontroller.reset()

brazen hatch
#

Ljinux is and has to be 100% ready for every exception and at the same time affect the stack as little as possible with no leaks.

#

Tending to gc manually is also critical for performance.

crimson ferry
#

gc is a bit in heuristic territory I think, someone even mentioned a case where they had to gc twice in a row to make it happen

brazen hatch
#

Yes, it's a matter of striking a balance.
You need to do just enough gc.collect()'s so that the heap doesn't significantly end up fragmented, or full with stuff to be deleted.
It's faster to clean 2 times 10k of ram, than clean 20kb when stack is full.

manic glacierBOT
#
>>> wifi.radio.connect(ssid = "myap", password = "12345678", channel = 10, bssid = "12:34:56:AB:CD:EF")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Invalid BSSID
>>> wifi.radio.connect(ssid = "myap", password = "12345678", channel = 10)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ConnectionError: No network with that ssid

I changed the BSSID in that output but for the test I used the MAC copy-pasted f...

brazen hatch
#

But if you always spam it, it ends up way slower.
Doing 100 times 50 bytes is a million times slower.

#

This is very obvious in any ljinux tui application.

#

nano being the biggest mem hog.

idle owl
#

(╯°□°)╯︵ ┻━┻

#

Safemode.

brazen hatch
#

By not doing any, garbage accumulates and then it takes several moments for it to collect all of it.

brazen hatch
jaunty juniper
#

have you measured the gc time ? on boards with 8MB of ram it takes an eternity even if you didn't allocate anything

idle owl
brazen hatch
#

By scrolling screen in nano.

jaunty juniper
#

I'd love to see some benchmarks

brazen hatch
#

I plan to make some in the future.

#

Ljinux has a plethora of funcs and stuff that needs time benchmarks.

#

It will measure all system times.

#

I have done some parts in test code.

#

But never all in one.

#

I want a stress-ng equivelant.

#

I do want to see flash & psram performance with different block sizes.

idle owl
#

@brazen hatch Is the point of this to basically prove that the issue is the ping feature?

#

I don't get it though. It ran for a while just fine, and then boom safemode again.

brazen hatch
#

The point of what? Using a placeholder? There is nothing else that can safemode the board in that code, is there?
So by swapping it for now, you get to not have to reboot the board all the time.

idle owl
#

I see where the safemode.py would come in handy, but if it's dumping into safemode approximately 8 seconds after it starts running every time, that isn't so handy.

idle owl
#

I think it's ping making it fail.

brazen hatch
#

Just swap ping with something like print(f"PING! {time.monotonic()}") and set the result value with a 1 or something.

idle owl
#

I was printing "ping goes here"

#

and it was running fine.

#

I slowed the ping down to 2 seconds, and now it's running ok. But .... nevermind.

#

Safemode.

brazen hatch
#

Well, in the log, don't you see many ping messages if you add the print instead?

idle owl
#

I don't think I follow what you're asking

brazen hatch
idle owl
#

Oh man! Turns out I hadn't increased the delay. It doesn't matter, it did enter safemode eventually anyway. But! The ping returned None enough times for the full purpose of the code to work, where it stops showing blue, and blinks red when the ping fails, and then once ping is working again, returns to blue. So.... that's nice I guess.

idle owl
#

etc.

#

Interval currently set to 2 seconds.

brazen hatch
#

looks right...

#

This raises more questonks than it solves.

idle owl
#

It feels like something is hosed with ping.

brazen hatch
idle owl
#

@onyx hinge Can you give me a QT Py ESP32-S2 build? I can't remember where to find the assets or whether they're even built yet.

brazen hatch
#

My code still works though, so 1s is fine.

onyx hinge
#

@idle owl yes I can make one then I have to step away for dinner

idle owl
#

I'll test it with my code.

onyx hinge
#

@brazen hatch empirically it's somewhere between .2 and .3 seconds that it switches to "mostly working, no exception". not sure exactly why that would be.

blissful pollen
#

If you need I'm about to make another build if needed

onyx hinge
#

@idle owl ^

idle owl
#

Thank you!!

onyx hinge
#

afk, you're welcome though

idle owl
#

Have a delicious dinner!

#

@brazen hatch OK, so here's the weird thing it's doing now. (Running the code to see if it fails.) Every 7 pings, it returns None. Every single time. One of the times it returned None two times in a row, but otherwise 7 successful, 1 fail, 7 successful, 1 fail..... This was happening earlier, and I thought I did something to fix it, but I a. don't remember what that might have been, and b. am unconvinced I ever did anything to fix this in the first place.

#

I fixed the thing where it wasn't printing None for every failure already.

brazen hatch
#

None is a failed ping, is it not?
That is connection related as is specific to your wifi setup.
I have never seen anything as such on any of my boards.

#

You should prolly just treat failed and None the same way.

idle owl
#

Interesting.

#

Yes None is a failed ping.

jaunty juniper
#

yeah a timeout

#

try pinging a local IP to see if it does the same ?

idle owl
#

Ok, trying that.

brazen hatch
#

I connect my boards to my pc's / pi's wifi hotspot so I can monitor wifi stuff via journal.
This way, severe errors are registered.

idle owl
#

LLOL...... I ran out of memory??

brazen hatch
idle owl
#

It's still doing the 7 on 1 off thing.

idle owl
jaunty juniper
#

that might be a wrong error diagnosis ?

brazen hatch
#

Perhaps it's time to begin le gc.collect() spam.

idle owl
#

That's fair. I happened twice after about 16 pings, but that isn't consistent now.

brazen hatch
#

could be mem, since I have never seen it.

crimson ferry
#

but no safemode?

jaunty juniper
#

the code doesn't allocate anything big, and the QT PY has tons of RAM, was it an ESP memory error maybe ?

idle owl
#

Correct!! No safemode!!

crimson ferry
#

the PR only catches the error (to avoid safemode), not change the underlying reason

#

that's deeper in the ESP IDF

brazen hatch
#

if esp-idf was stable we would have flying cars by now

jaunty juniper
#

I'm running your code on my FunHouse btw with a 2s delay and things seem to go well

0.005
0.005
0.005
0.005
0.005
0.005
0.005
0.005
0.004
0.005
0.007
0.005

etc.

crimson ferry
#

over 1s should work, but...

idle owl
#

I mean, this 7 on 1 off thing doesn't really matter - it doesn't do anything until ping fails 5 times in a row.

idle owl
#

Still getting that None every 7 times. 🤷🏻‍♀️

idle owl
brazen hatch
#

Well, I will go sleep now, have fun.
My last suggestion is to test the ping part of the code, in a different code.py, where nothing else is going on.

idle owl
brazen hatch
#

No problem. Glad I could help.

manic glacierBOT
idle owl
#

It's an espidf memory failure. Line 138 is the ping code. Maybe I merged that PR too quickly?

#

I need to go eat. I guess I'm done with this for tonight.

blissful pollen
#

Maybe something isn't cleaning up completely. I think the PR still did fix one issue. Could be more then one was there

jaunty juniper
#

I think the PR converts the crash into an exception, it's an improvement

onyx hinge
idle owl
#

Hmm.

#

So am I supposed to catch the error now?

#

Is that the idea?

#

Already have it in try/except. I can try an if/else under the except I suppose. I assume that works.

blissful pollen
#

The try/except should catch the exception if it shows up. You can't catch an exception with if/else normally

idle owl
#

Although I have no idea if it will keep running after that error.

#

Or if it requires the reload.

#

Basically this will reload all the time, it seems like. Sigh.

manic glacierBOT
#

I'm using:

Adafruit CircuitPython 8.1.0-beta.2-12-g018f15de9-dirty on 2023-05-06; Sparkfun Thing Plus MGM240P with MGM240PB32VNA

Calls to the time module

import time
time.localtime()

were crashing the board into safe mode.

Apparently the rtc_time_source wasn't being initialized and calls to rtc_get_time_source_time would then crash. Adding a call to rtc_reset in silabs/supervisor/port.c seems to have resolved the problem.

brazen hatch
#

question, I am making a board port,
this board has a battery hold pin
if it’s not held up, the board will power down when the power button not held and not plugged in.
Should I have circuitpython never reset the pin and hold it up by default?

#

It’s the m5stack timer camera x, straight from ada store.
It somehow doesn’t have a circuitpy port

#

It has a builtin camera and is a standalone battery powered package

#

I have arduino rtsp + webserver code and it can stream 30fps video just fine

manic glacierBOT
orchid basinBOT
brazen hatch
#

Also, how do I map camera pins to the mp_rom_obj_tuple_t camera_data_tuple that is set for others?
I have no clue. I only have the datasheet and a working arduino example.

brazen hatch
#
bool espressif_board_reset_pin_number(gpio_num_t pin_number) {
    if (pin_number == 33) {
        // Turn on BAT_HOLD by default, so that the board does not power off.
        gpio_set_direction(pin_number, GPIO_MODE_DEF_OUTPUT);
        gpio_set_level(pin_number, true);
        return true;
    }

    return false;
}

Doesn't really work. Not really sure why.
The pin stays unset.

brazen hatch
#

I added a mp_printf(&mp_plat_print, "Resett.\n");
It gets printed on the correct pin deinit.

mental nexus
#

Just saw about your desire to use the LCD peripheral on the ESP32-S3 for a parallel display. Definitely doable but will need some work on the CircuitPython core. I made a fork to add a DotClockDisplay using the S3 LCD peripheral, but it was never merged. But had lots of fun hacking on it!

idle owl
#

I have come to believe that there is a memory leak in the ESPIDF related to WiFi and requests. I'm not even using ping anymore because I couldn't get past 3 pings without it failing with a memory error. Now... it's failing when trying to retrieve the time service from Adafruit IO, saying Sending request failed but, if you ctrl+c in the middle of the reset sequence, it turns out that error is being directly caused by espidf.MemoryError.

onyx hinge
#

@idle owl I would be happy to look at it in detail with you, maybe monday after the meetings.

onyx hinge
#

@idle owl which qtpy is your project using?

onyx hinge
#

OK, we can talk more Monday!

idle owl
#

For sure. Thank you!

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.1.0-beta.2-24-gd2aca7eba0-dirty on 2023-05-05; ESP32-S3-DevKitC-1-N8R2 with ESP32S3
Board ID:espressif_esp32s3_devkitc_1_n8r2
UID:866B3BD27A8F

Code/REPL

import time
import wifi
from secrets import secrets

DELAY = 0.5  # this is fine, but lower values lead to exceptions after a few pings

wifi.radio.connect(secrets['ssid'], secrets['password'])
while True:
    print(f"LAN ping: {wifi.radio.ping(wifi.r...
crimson ferry
# idle owl ESP32-S2.

I get those routinely in _get_socket just using requests. Retry a couple of times, same. Do some other stuff then come back and do a request later and it's fine again. Checking available espidf memory (QT Py S2) prior to the (successful or failing) socket operations gives something like:espidf.heap_caps_get_largest_free_block(), espidf.heap_caps_get_free_size(), espidf.heap_caps_get_total_size() = 253952, 284736, 405960seemingly plenty of espidf memory.
I also have CIRCUITPY_RESERVED_PSRAM=262144, but that may not be working as we think??

#

or it's not actually an espidf memory error??

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

@jepler , apologies for the delay in getting back. I did some further testing with the second MatrixPortal that I received. To your point about a potential power issue, I had been wondering the same thing. Since I had the 2 portals, I decided to try running them both at the same time with each panel using the same power supply but without the data chained together. I'm using Adafruit's 5V/10A power supply with their barrel splitter for just the LED panels and separate USB supplies for each Ma...

manic glacierBOT
lavish saffron
#

To enable the WIZNET5K driver to be compatible with the Adafruit Adafruit_CircuitPython_HTTPServer the socket.socket module needs to raise OSError exceptions, since these are trapped in try: except: statements. What is the best source for these error types? I've been looking at the BSD Unix socket man pages. Do you think I'll get close enough using these?

onyx hinge
#

@lavish saffron interesting, our errno module seems to be undocumented ... ```py
MicroPython 8.1.0-beta.1-4-g1ca435c5e3-dirty on 2023-04-05; linux version
Use Ctrl-D to exit, Ctrl-E for paste mode

import errno
raise OSError(errno.EAGAIN)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 11] EAGAIN

manic glacierBOT
lavish saffron
manic glacierBOT
crimson ferry
#
Traceback (most recent call last):
  File "/Users/a/Documents/GitHub/circuitpython/ports/espressif/../../tools/gen_web_workflow_static.py", line 7, in <module>
    import minify_html
ModuleNotFoundError: No module named 'minify_html'
make: *** [build-espressif_esp32s2_devkitc_1_n4r2/autogen_web_workflow_static.c] Error 1

is this something not installed as part of the circuitpython / espidf environment?

#

ditto jsmin

jaunty juniper
#

it's in requirements-dev.txt

#

which you need to install in the idf env too

crimson ferry
#

oh, that's a note in the "Manual Setup", which the macOS setup says to skip over

#

but I guess build error counts as "If the setup instructions above don't work for your particular OS setup, for whatever reason"

#

I build so infrequently, it's always a new experience 🤪

jaunty juniper
#

yeah if you didn't build since things were added, you'll be missing stuff

#

my build script runs the pip install every time, it takes 2s when there's nothing new

crimson ferry
#

yeah I think the requirements stuff is new since I last did this

#

make -j got errors, so I'm doing no -j 😦

manic glacierBOT
#

Using the latest "Adafruit CircuitPython 8.1.0-beta.2 on 2023-04-26; FeatherS2 with ESP32S2" and the code has the "feathers2.enable_LDO2(True)" the UMFeatherS2 has run for 10 hours without crashing. Using 2 UMFeatherS2 I have sent 140,000 MQTT messages from one to the other via a raspberry pi running mosquito. One way only and neither have crashed.
Thanks for your advise and look froward to the new 8.1 release.
I guess the remaining question is; should I try the test agains without the "fea...

brazen hatch
#

I suggest keeping an env for circuitpython compiles, seperate from idf's

#

It's also that arch is now changing to py3.11, so a lot of stuff will break.

idle owl
#

Can you put symbols in a computer hostname? Specifically _

onyx hinge
#

@idle owl I think that letters, numbers and "-" OK, but "_" is not. Assuming you mean a computer name like you might have in a URL, "example.com" and so forth.

idle owl
#

I mean my computer's name, yeah.

#

So use - instead as a word separator?

onyx hinge
#

yes, try that

idle owl
#

That's equally fine. I'm not married to _. I'm simply used to it from file naming.

#

Thank you!

manic glacierBOT
#

@todbot you'll appreciate this. before and after of building up a chord from 9 notes. The note envelope has an attack level of 1.0, sustain level of 0.8, and a sine waveform with a volume of 14700

While some clipping will occur, overall I think it's an improvement. In technical terms, it's a dynamic range compressor with a fixed threshold and a hard knee. https://en.wikipedia.org/wiki/Dynamic_range_compression

The waveforms below are from the manual test program circuitpython-manual/syn...

wraith crow
#

Based on a search of the github release notes, I'd say not...

jaunty juniper
#

no

wraith crow
#

Thanks 😄

jaunty juniper
manic glacierBOT
#

The UM Feather S2 has now been running for 6 days without crashing. I restarted the Adafruit Feather S2 running the Lolin firmware 3 days ago and it hasn't crashed either.

The only time I've seen a crash is when the terminal has been disconnected so I decided to use your logging routine and see if I could recreate the crashes without the serial terminal session. It turns out your code won't run under 8.0.5 because the safemode.py feature isn't implemented in the 8.0.5 line yet.

I'll reb...

lone axle
#

Any thoughts on this? https://github.com/adafruit/Adafruit_CircuitPython_Colorsys/issues/28 (or perhaps it's good for weeds?)

We have a library that is a partially complete implementation of colorsys from CPython, but it was altered to have different return types for the functions that it has (ints 0-255, whereas the original CPython is floats 0-1). I think it makes sense to change it to be floats so it will match the CPython implementation to make code using it more portable. I had a preliminary look around Learn repo and Library Bundle examples and found no usages of the Circuit Python library specifically, but any code that is out there that uses it would need to get adjusted if we did make this change.

slender iron
crimson ferry
#

what's the magic these days to make space for a debug build? (esp32-s2 4MB flash) every combination I've tried gets some undefined reference

lone axle
jaunty juniper
#

did you make clean ?

crimson ferry
#

I always make clean

#

I don't even see ulab in mkconfigport.mk ...do you do that on the command line?

jaunty juniper
crimson ferry
#

oh, board level

jaunty juniper
#

or the command line

gmake BOARD=adafruit_feather_esp32s2_tft -j6 DEBUG=1 CIRCUITPY_ULAB=0
#

that was in my history

#

(not really, I have a script that makes those for me, but that's the result)

crimson ferry
#

-j has been giving me errors, so I've been doing make and then do something else for a while

jaunty juniper
#

you can only override what is not set in stone in the board file from the command line though

#

(and what is defined in py/circuitpy_mpconfig.mk)

stuck elbow
#

unless they use ?=

crimson ferry
#

what is set in stone?

jaunty juniper
#

yeah board files don't use ?= maybe they should, I assume it also defeats the github custom build

jaunty juniper
crimson ferry
#

just the usb and flash stuff

jaunty juniper
#

then you're free to play with anything

manic glacierBOT
#

Ok, that's promising to me actually. It means there is not something deep
in the bowels of CircuitPython or ESP-IDF causing this. Maybe I should just
change my board and then I won't have crashes anymore. Or perhaps I'll try
to slow down that frequency on the Flash chip like you were commenting on a
while ago.

On Mon, May 8, 2023 at 10:23 AM RetiredWizard @.***>
wrote:

The UM Feather S2 has now been running for 6 days without crashing. I
restarted the Adafruit Feather S2 running t...

stuck elbow
#

I usually try to pin down all the possible settings in mpconfigboard.mk, otherwise someone always comes and changes the global defaults, and I only realize half a year later that it stopped working

crimson ferry
#

this is very arcane stuff

slender iron
slender iron
#

k, I pinged you on github but you must have missed it. his changes have made it better and larger. not sure what you want to do about it

stuck elbow
#

well, I'm getting abuout 40 e-mails a day from github

turbid radish
#

The newsletter is ready to crib from in GitHub for the 2pm meeting

stuck elbow
#

thanks

#

I was hoping to use synthio in my games, but to be honest I never had the time to actually try it

#

maybe with the size gains of the newest micropython it will fit in there again, when they are merged

slender iron
#

¯_(ツ)_/¯

stuck elbow
#

progress

slender iron
#

it does sound way better

stuck elbow
#

for sure, I was planning to try and make something like the bfxr for circuitpython for years now

slender iron
#

bfxr?

stuck elbow
#

it's for generating sounds for games

#

I guess it's replaced with sfxr now that flash is dead

#

basically you set about a dozen parameters, and you get a cool sound

slender iron
#

nice!

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.1.0-beta.2 on 2023-04-26; Metro MIMXRT1011 with IMXRT1011DAE5A

Code/REPL

# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT

import time

import usb_midi

import adafruit_midi

# from adafruit_midi.channel_pressure        import ChannelPressure
from adafruit_midi.control_change import ControlChange
from adafruit_midi.note_off import NoteOff
from adafruit_mi...
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.1.0-beta.2 on 2023-04-26; Adafruit PyPortal Titano with samd51j20

Code/REPL

from vectorio import Polygon
import displayio
import board

display = board.DISPLAY
my_group = displayio.Group()
bitmap = displayio.Bitmap(300, 300, 5)
palette = displayio.Palette(1)
palette[0] = 0x125690
points = [(5, 5), (100, 20), (200.2)]
polygon = Polygon(pixel_shader=palette, points=points, x=0, y=0)

Behavior

...

slender iron
#

<@&356864093652516868> We'll have our weekly meeting in just over an hour from now in this text channel and in the circuitpython voice channel. Please take the time to add your notes in advance to the document: https://docs.google.com/document/d/1y5tGjTm1zDpbaSjTIQLytXE_Eg4mmfI4kf95AclnJ2Q/edit?usp=sharing Thanks! Talk with you soon.

idle owl
#

@onyx hinge Are you still up for looking into the wifi / requests issue today? Worth noting: I have no reason to believe that my code hasn't been running for a solid day or two at this point. That said, I have no way to know that it didn't fail and a soft reload resolved it, and that event was off my scrollback. Thing is, when it was failing previously, it would pretty consistently keep failing after that and a supervisor.reload() did not resolve it. So, I'm wondering if something I did is causing it to avoid failing now. I don't know anymore, heh.

onyx hinge
#

@idle owl we can sure look at it still

idle owl
slender iron
#

brb

manic glacierBOT
#

Keeping the MatrixPortal and matrices in the same chained order, try just swapping where the power cables go to the panels. Small but nonzero chance of something badly soldered or crimped. I’m highly skeptical this is the problem, but it’s quick and zero cost, worth a try.

Timing is much more likely, and “slop” from the shift registers will accumulate to the left as a chain grows longer. These panels are changing all the time, and what worked on last month’s panels might be different now. ...

lone axle
#

EduBlocks is a free tool that helps anyone learn how to code with text-based languages like Python or HTML using a familiar drag-and-drop blocks system.

devout jolt
#

Rust, clearly

lone axle
idle owl
#

Scott - something is rubbing against your mic, and it's causing staticky type sound from you.

#

👍🏻

lone axle
turbid radish
#

😁

idle owl
#

Hey I'm on the review list on the core for once! 😄

devout jolt
#

brb

silver tapir
willow totem
#

tektriks got self review labelled today for my adafruit_circuitpython_logging pull request so thank you

idle owl
#

🎉

silver tapir
onyx hinge
#

self.plot_line_pint: List[Tuple[int,int]]] = []

silver tapir
#

@gilded cradle Good topic for on the weeds, this is a complex issue for riscv boards as well, as some board makers publish distros only sometimes, and normal distros like ubuntu/debian/fedora work only sometimes. A good example are the D1 boards, which all share a distro, and don't have device tree files for each boards so they might have i2c pins on the wrong place.
This is also a complex issue as it cannot be tested on something like Github's CI and even if the distros existed, they wouldn't run on the real hardware. Maybe github self-hosted runners could help with testing, but I'm getting off-topic here.
So far a markdown doc with a nice table should be good enough.

tidal kiln
silver tapir
#

No, there is nothing specific about the distribution, so the code doesn't use systemctl or the package system.

#

But it is a good idea to know what has been tested so far, in case you are having problems, to just check the doc.

idle owl
#

@gilded cradle If there's documentation elsewhere pointing to circuitpython.org, you'll cover a wider user-base.

#

Keeps your external docs simpler, but still gets folks where they need to go.

silver tapir
#

Also, there are 100's SBC distributions, so making a new functions for each would be weird.

idle owl
#

Exactly!

silver tapir
#

And the other problem is that it kinda has to be a matrix of distribution and boards, so the outcome will be quite large.

#

Debian might work on one board, but not on the next one.

idle owl
#

Entirely unrelated, but I forgot to share earlier: I received my new MacBook Pro this morning. M2 Max with 96GB of RAM. Super excited!

gilded cradle
#

Sweet @idle owl. I'm still on the one I got in 2019.

random junco
#

that's a lot of RAM!

idle owl
idle owl
silver tapir
#

Thanks all.

gilded cradle
ember iris
#

Thanks all! Have a great one!

gilded cradle
#

Thanks everyone

random junco
#

Thanks everybody!

turbid radish
#

I have 64GB on my Threadripper

devout jolt
#

96GB of RAM? You'll be able to run Chrome!

manic glacierBOT
#

Relevant to Issue #7931

Server:

Adafruit CircuitPython 8.1.0-beta.2-12-g018f15de9-dirty on 2023-05-08; ESP32-S2-DevKitC-1-N4R2 with ESP32S2
>>> import wifi
>>> ipaddress
>>> 
>>> ipv4 = ipaddress.IPv4Address("192.168.251.2")
>>> netmask = ipaddress.IPv4Address("255.255.255.0")
>>> gateway = ipaddress.IPv4Address("192.168.251.1")
>>> wifi.radio.ipv4_address_ap
>>> 
>>> wifi.radio.set_ipv4_address_ap(ipv4=ipv4, netmask=netmask, gateway=gateway)
>>> wifi.radio.ipv4_address_...
idle owl
#

Mine was still working quite well, but Rose needs an upgrade, and it makes more sense for me to upgrade and give her my current one.

turbid radish
#

Not since the Arduino Edison

silver tapir
#

@royal rover You can try following this stuff to add them to blinka. If they work with the linux gpio library, they almost for sure work with blinka.
https://learn.adafruit.com/adding-a-single-board-computer-to-platformdetect-for-blinka
https://learn.adafruit.com/adding-a-single-board-computer-to-blinka

Adafruit Learning System

The first step to adding your favorite board to Blinka is correctly detecting it

Adafruit Learning System

Now that the board is being detected, it's time to add functionality.

manic glacierBOT
slender iron
#

Here is the notes document for next Monday’s CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if you’ll be attending the meeting - it’s super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1xektzKK1vh8mua913H68WG-104GH4q00L6EmL87ZRGE/edit?usp=sharing

manic glacierBOT
manic glacierBOT
#

I took a look into this and I think the ints vs. floats is not the root cause.

In the specific code you posted, this line:

points = [(5, 5), (100, 20), (200.2)]

The last item in the list gets evaluated as a number, not a tuple with a number inside of it. Since there is no comma, the parenthesis are being evaluated for order of operations rather than meaning tuple.

If you use the code like this (note the extra comma after the number):

points = [(5, 5), (100, 20), (200.2...
idle owl
#

@lone axle Maybe you know. How do you format the :return: in this? It returns a color tuple. ```py
"""
Function description.
:param hour: Parameter description.
:return: ???
"""

idle owl
lone axle
#

@idle owl I think it can have an english description after the colon as well. Some like "Tuple containing 3 int values 0-255 representing red, green, and blue" Would be good if it needs to be comprehensive or is aimed at someone who may not know.

#

left of the colon would be where the Tuple[int, int, int] lives I think. And right of colon is human readable.

idle owl
#

Oh.

#

That makes a little more sense.

#

So I'm trying to document, but also, it will have a guide so....

#

Maybe don't overcomplicate the inline documentation.

#

@onyx hinge Can I do if thing or second_thing and third_thing: and have it execute either if thing is true, OR if second_thing AND third_thing are both true?

#

Or do they need to be nested ifs.

#

Or can you do and twice with three conditions?

#

(Separate question)

#

I think I have to nest to do what I want.

#

I'll try that, and you can correct me tomorrow.

manic glacierBOT
#

CircuitPython version

All

Code/REPL

my_group = displayio.Group()
# ... append some things ...
for item in my_group:
    print(item)

Behavior

mypy flags an error on code like this indicating that a value is unsupported for use in the right operand of the in operator:

error: Unsupported right operand type for in ("GridLayout")  [operator]

In this case GridLayout is extending Group. It flags the same issue whether its a subclass or ...

#

resolves: #7948

I noticed that mypy raises this error while testing some of the suggested fixes discussed during the weeds section of the meeting inside of this PR: https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_Layout/pull/85

This topic of the in operator didn't come up, but I noticed mypy outputting errors about it while working on that.

I tested the change successfully by building stubs and installing with pip install . and then running mypy on that PR branch ...

lone axle
manic glacierBOT
#

@tannewt I did a "git bisect" and found that it was your PR that introduced the problem. I haven't done any further troubleshooting beyond this. I mention it in case you want to step in or have any info to provide...

5bb8a7a7c68781e6edbd3aebaf7eeeecb310bd86 is the first bad commit
commit 5bb8a7a7c68781e6edbd3aebaf7eeeecb310bd86
Author: Scott Shawcroft <scott@tannewt.org>
Date:   Tue Feb 28 15:07:35 2023 -0800

    Improve iMX RT performance

<details>
<summary>
my bisect log...

midnight ember
#

Just finished up watching this weeks meeting. A DVI featherwing that offloads DVI onto a 2nd dedicated RP2040 is something I would definitely be interested in for taking HDMI to the next level stacked with an Airlift. Definitely looking forward to that becoming a thing. Baby steps. 🙂

crimson ferry
manic glacierBOT
orchid basinBOT
manic glacierBOT
orchid basinBOT
#

Although convenient, the bundles are not board specific. Adding this to each board page may have the users thinking otherwise. Additionally, since the link changes each day, this may add additional overhead. Currently you can go to the Libraries link at the top of every page and download the bundles from there where having it in a central place makes updating the link easier. Is that acceptable?

manic glacierBOT
#

My bisect log so far, as I have to head out ...

git bisect start
# status: waiting for both good and bad commits
# bad: [b07de078f9dd640c28668cad3b5a5728a1d1024e] Merge pull request #7818 from CDarius/m5stack_stickc_fixes
git bisect bad b07de078f9dd640c28668cad3b5a5728a1d1024e
# status: waiting for good commit(s), bad commit known
# good: [cb6201d952c7be39024add8d91b79803ee191485] Merge pull request #7659 from dhalbert/gifio-displayio-doc
git bisect good cb6201d952c7be39024add8d91...
manic glacierBOT
#

CircuitPython version

adafruit-circuitpython-metro_m7_1011-en_US-20230508-9e4dea7.uf2

Code/REPL

# N/A

Behavior

Board flashes safe mode LEDs (yellow), then flashes RED once, then is unresponsive on USB. it doesn't seem to be running code either.

Description

No response

Additional information

a9dc31a88198e5f09d46799870a921b92470b120 is the first bad commit
commit a9dc31a88198e5f09d46799870a921b92470b120
Author: Scott Shawcroft ...
#

This closes #7944 but it's fishy -- why is such a large buffer required? @hathach your feedback would be appreciated about this question.

It also includes a board-specific fix for #7952 but this may be needed on other boards. @tannewt do you know what's going on here? The USB_DM/USB_DP pins seem to just be dummy objects on 1011 but adding these to the list (as you did on the 1011 evk) does allow CP to start. If this is correct, the fix should be propagated to ALL boards, or incorporated a...

hidden rain
#

Good Morning All ! I am using analogbufio repeatedly in an application. While there is a deinit, I am uncertain about memory resources. I was hoping to re-use the same object repeatedly, but that returns messed up data. This feature might benefit from having a reset feature. Comments, Opinions?

manic glacierBOT
orchid basinBOT
onyx hinge
#

@hidden rain Are you saying two readinto calls gives a bad result for the second call? that sounds like a bug. Otherwise, can you be more specific about what the Python code you're trying to run looks like..?

hidden rain
#

I forgot how to do that (feature request) or open an issue.

hidden rain
#

Perhaps someone would confirm analogbufio.readinto() failures on use beyond first.

jaunty juniper
hidden rain
manic glacierBOT
orchid basinBOT
orchid basinBOT
orchid basinBOT
#

Where did you get these images?
Various places. Let's See:
I got the LubanCat ones from Taobao
I got the ROC-RK3328-CC from Libre Computer's product page (which I linked to for purchase)
I got the Jetson Images from the Purchase Pages I linked to.
I got the Radxa ones from the Purchase pages I linked to.

What license are they under?
I'm not sure. Finding images for these boards was difficult itself.

Want to include distro info on the pages?
I think we should add that in ano...

manic glacierBOT
manic glacierBOT
#

@tannewt do you know what's going on here? The USB_DM/USB_DP pins seem to just be dummy objects on 1011 but adding these to the list (as you did on the 1011 evk) does allow CP to start. If this is correct, the fix should be propagated to ALL boards, or incorporated at a better location.

I don't. I didn't think that the reset code would get this far because it should be bounded by the IOMUXC count. Must be some loop bounds error.

#

Does it actually work? It isn't clear to me how it works.

It does work to eliminate that error from mypy. I'm not entirely sure of the 'how' beyond that mypy is looking at your installed libraries for known types when it runs to try to enforce it's rules. circuitpython-stubs seems to be where it's taking it's definition for displayio.Group.

I saw your message on the issue as well. Iter does feel more appropriate for this instance, although I think Group may support both. I'll doubl...

manic glacierBOT
slender iron
#

who was talking about a streaming json parser?

#

the pirate weather api response is 30k+

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.5 on 2023-03-31; Adafruit Feather RP2040 with rp2040
>>>

Code/REPL

import time
import board
i2c = board.I2C()
i2c.try_lock()
i2c.writeto(82, b"")
time.sleep(0.1)
i2c.writeto(82, b"")

Behavior

Code runs fine without any errors. The issue is seen in the scope trace of the resulting traffic. See below.

Description

This behavior seems to be benign in most cases. However, it is potentiall...

slender iron
#

is there a plan to update pylint in libraries? 2.11.x doesn't work with python 3.11

idle owl
#

Eva's usually the one to do it, but she's been out. I'll sort out who can.

proven garnet
#

tekktrik has entered the chat

#

I can get a patch ready this week, either to run this week or next.

idle owl
#

Basically, x number of libraries will fail to build due to new Pylint errors.

#

And someone will need to deal with all of that.

proven garnet
#

I can handle the unfortunate fallout

idle owl
#

Excellent. Thank you so much!

slender iron
#

thank you!

manic glacierBOT
#

CircuitPython version

analogbufio object returns bad data for multiple use of the method "readinto". This api needs a reset method. Problem is not supplied buffer. Issue is most likely that the assigned ADC and or DMA needs to be reset. We would like to be able to use the one instance of analogbufio.BufferedIn object multiple times. Currently its good for a one shot. A reset method, or automatic reset after "readinto" would not clear the supplied buffer, but it would reset the ...
idle owl
#

To everyone who was helping me with my ping and time-check code, thank you. After banging my head against this for longer than I care to admit, it turns out my code runs flawlessly on the QT Py ESP32-S3. I have no answers for why, and at this point, I need this project to run, so I don't care. But I wanted to let you know that I found a workaround, and things are happy now.

#

I was using the ESP32-S2.

#

And couldn't ever figure out making it work right. And it continued to fail in the weirdest ways.

#

@jaunty juniper and @brazen hatch It was apparently a hardware issue. So I either have a bad board, or there's something up with ESP32-S2 and the features of my code. Either way, it's working now on the ESP32-S3, and I've spent too much time on it already. So I'm handing it off with the hardware change, and that's what we'll be using for the guide.

brazen hatch
#

Hmm, I should investigate, but schedule's rather full now.

idle owl
#

No worries.

jaunty juniper
#

yeah it's a weird issue, I did not have ping errors on the FunHouse

idle owl
#

Well, ping works great on its own on the S2.

#

It's something about ping and io.receive_time() together that end up failing in all sorts of weird ways.

crimson ferry
#

@idle owl I also have network code that runs much better on S3 than S2, no idea why

idle owl
manic glacierBOT
crimson ferry
#

it's gone in and out of draft, maybe that's an issue?

manic glacierBOT
manic glacierBOT
manic glacierBOT
orchid basinBOT
manic glacierBOT
orchid basinBOT
manic glacierBOT
#

Its a custom board using the RP2040, setup pretty much like the Pico with
4MB Flash and a jumper for the reset button.
Our product had to pause at CPy 8.0.4 (which is where we saw the issue). We
will upgrade in a few weeks.
-Lee

On Wed, May 10, 2023 at 2:19 PM Scott Shawcroft @.***>
wrote:

I agree that multiple calls should work. I don't think there needs to be
an explicit reset.

What board and version of CircuitPython are you running on?


Reply to this email directly, ...

proven garnet
#

I might be late to the party, but just a heads up that GitHub is having several issues all around. Particularly, the GitHub Actions tubes are clogged: https://www.githubstatus.com/

orchid basinBOT
manic glacierBOT
#

This is ready to go.

I'll try PicoW as a separate PR after this one is merged since: I don't know much about those internals; I haven't set up to build raspberrypi yet, and; PicoW wifi can be quirky. I looked at the code and I think I know what needs to be done, but if there are challenges with a straight-forward implementation modeled after station, then outcome is uncertain.

orchid basinBOT
tulip sleet
#

also "Pyrate" is considered an alternate spelling of "Pirate" in English in general

slender iron
#

huh, interesting

#

I'll leave naming up to pt and limor

#

I reimplemented it because I use the json module for value parsing

idle owl
#

The upcoming collab project with Noe requires a CP fix that is currently only on main. What are the plans for the next release?

#

Or at least it's possible that it requires it. The failure that requires it isn't happening so far on S3, but I still think it's worth having so if it does happen, my code will keep running.

tulip sleet
tulip sleet
slender iron
tulip sleet
#

saw that too -- the visitor pattern could be implemented at a later time if we felt necessary

blissful pollen
#

Has anyone been able to run the latest builds of the M7? Anything after May 1st is not even bringing up the CP drive. Tried with my own build and same thing

proven garnet
#

GitHub is back up, and all libraries should have a newly updated .pre-commit-config.yaml! black and reuse in particular are having new issues, please be aware. I'm currently running pre-commit on all the repos to fix the formatting issues, so if you're working on any libraries in the Adafruit bundle, you may want to merge/rebase accordingly. I'll follow up with fixes for REUSE and pylint as well over the evening and next couple days.

proven garnet
#

Libraries are patched! Minor fixes inbound for a handful of libraries that now have newly showing pylint issues, but otherwise everything is all set!

manic glacierBOT
#

@DJDevon3 @dhalbert All good with the LDO2(True) removed.
I ran the code over 2 days, 10 hours at a time, >100k MQTT messages each day and all good on CircuitPython 8.1.0-beta.2
Thanks for your help.

@DJDevon3 I have used the adafruit motor featherwings and it works well. I recently upgraded the motors and smoked 2 motor featherwings. I think it was the back EMF so I have reverted to my own board which deals with this.

manic glacierBOT
#

Latest commit adds __iter__stub.

As far as I can tell it supports both for _ in Group and if _ in Group. The following code executes successfully and outputs expected results:

import displayio
import board

bmp = displayio.Bitmap(100,100, 1)
palette = displayio.Palette(1)
palette[0] = 0x00ff00
tilegrid = displayio.TileGrid(bitmap=bmp, pixel_shader=palette)
bmp.fill(1)
main_group = displayio.Group()

main_group.append(tilegrid)
board.DISPLAY.show(main_group)

if til...
proven garnet
#

All post-patch fixes submitted as PRs! ( @idle owl )

proven garnet
#

Github is once again down gx_Sunglasses_cry

manic glacierBOT
#

While I personally do not have a huge problem with the current brightness of the status LED in general, I would really appreciate the ability to control the brightness during boot specifically. In my opinion the flashing in different colors can appear a little erratic to someone who does not know what the device is doing. A simple

import supervisor
supervisor.runtime.rgb_status_brightness = 0

in boot.py does not seem to effect brightness during boot. (Which makes sense)

brazen hatch
manic glacierBOT
manic glacierBOT
#
  • Stereo output. A synthio.Synthesizer may be constructed with channel_count=2. The synthio.Note.panning property controls whether it appears in the left, right, or both channels.
  • Vibrato was generalized to support two additional modes: Sweep and bend. vibrato_rate and vibrato_depth properties are removed, with new bend_rate, bend_depth and bend_mode properties added. The default bend_mode is VIBRATO, so migrate existing code just by search&replace. SWEEP does a swe...
slender iron
#

@onyx hinge I was hoping you'd figure out the reason but I can look if you don't want to.

#

Seems worth understanding

manic glacierBOT
#

This would currently require a custom build to work.
It could maybe be made to read a settings.toml value.

It's a 'maybe' cause those flashes are really early (iirc in reset_port).
If the filesystem has init'ed by then, sure it's 2 lines of code.

Still that would be an api change, and would probably be held off until the next major release.
I am not familiar with the procedure for this.

It does sound nice having the ability to disable the led flashes entirely though. Not onl...

tidal kiln
manic glacierBOT
#

Web Workflow startup is called from supervisor_workflow_reset which is invoked at every VM start/exit. Actual startup is not called until after safemode run has been attempted. Attempting to handle workflow background callbacks without having wifi connected references un-initialized socket objects which can cause corruption or crashes. This patch prevents the supervisor_web_workflow_background from being invoked if web workflow wifi is not connected.

proven garnet
#

At least the most common shared parts for building and releasing

#

The libraries just call out and run those

tidal kiln
#

@proven garnet hey. thanks for responding. actually asking this as part of looking at the arduino CI stuff - and the impending end of node12, etc. i think you actually brought this up? i got word of it via kattni.

proven garnet
#

Yeah, this was part of the fix for CircuitPython for the Node issue, or I did it right after.

tidal kiln
#

cool. yah. that's what i was hoping / thinking.

#

current idea was to batch update all the repo's yml files

#

since it's a simple edit

#

but now wondering if doing something like this might be better

#

for now and future

proven garnet
#

Yeah, it's already paid dividends since.

#

You don't have to pack everything in it, but if it's shared across the whole codebase it at least gives you a single point to edit.

#

Since its a composite action you can still locally do extra stuff as well

tidal kiln
#

neat. yah. this seems like a much better way to deal with this.

#

are there any limitations? like issues with keys or anything? not seeing anything obvious. seems like its just a different way to organize.

manic glacierBOT
muted current
#

@tidal kiln, sorry for pinging you, but I have a very good question (in my opinion, you might think its stupid and not worth your time), why were these discontinued

#

I want a pair of these so I can make a one eyed wearable display like zack freedman but I cant find them anywhere, not even EBAY

proven garnet
#

I think actually passing them may not be required, but definitely nice to see in the file in each repository explicitly what is being passed.

tidal kiln
#

@muted current not sure. but not really #circuitpython-dev related. also no need for the ping.

muted current
#

sorry, I thought this would be the right place for this thing

#

where can I take this to???

tidal kiln
muted current
#

thank you, and sorry for ping

manic glacierBOT
#

Do you think we should split this in 9.0 into two objects? One for station and one for ap.

The properties and methods keep growing, and we've known for some time that the naming can be confusing (e.g., get_ap_info is for station, but the AP things generally have an _ap suffix). Most things should separate easily into two buckets, but wifi.radio.enabled affects both. I think hostname does also.

The ability to enable wifi completely independently from starting or stopping statio...

manic glacierBOT
#

Current pin name prefixes below. It is also the case that the individual pin names don't match. For instance, RFM9X_D0 vs RFM9X_DIO0 vs RFM_IO0, etc.

  • arduino_mkr1300: RFM9X_
  • catwan_usbstick: RFM9X_
  • feather_m0_rfm69: RFM69_
  • feather_m0_rfm9x: RFM9X_
  • adafruit_feather_rp2040: RFM_
  • challenger_rp2040_lora: RFM95W_
  • challenger_rp2040_subghz: RFM60HCW_

I am not sure it is worth making an incompatible change to regularize these. We could add u...

slender iron
#

@onyx hinge want me to look into the usb pins on imx after I'm back from lunch?

manic glacierBOT
#

The question arose in a recent wifi PR whether we should split station and AP into separate objects. radio is getting heavy, with a high count of methods and properties, and a long-running naming issue to distinguish station vs AP. For example, get_ap_info() is for station, but the AP things generally have an _ap suffix. Internal variables sometimes use an ap_ prefix and sometimes an _ap suffix...

manic glacierBOT
onyx hinge
#

@slender iron my day is pretty shot at this point so if you can! (but for good reason, was helping my friend who had to move his metalworking shop on short notice last summer .. it's still not working yet but we made big strides)

#

yes moving that far is exciting 🙂

slender iron
#

Kk will do once I’m back at my desk

proven garnet
manic glacierBOT
#
  • Fixes #7593.

Test on Metro ESP32-S2:

>>> import board
>>> s = board.SPI()
>>> s.frequency
250000
>>> s.try_lock()
True
>>> s.configure(baudrate=10)
>>> s.frequency
152
>>> s.configure(baudrate=100)
>>> s.frequency
152
>>> s.configure(baudrate=1000)
>>> s.frequency
1000
>>> s.configure(baudrate=100000)
>>> s.frequency
100000
>>> s.configure(baudrate=1000000)
>>> s.frequency
1000000
>>> s.configure(baudrate=10000000)
>>> s.frequency
10000000
>>> s.configure(...
tidal kiln
manic glacierBOT
blissful pollen
#

@devout jolt I was looking at your synthio test YT videos and you have, I think, an I2S to headphone jack breakout board? Wondering what it is. Would be nice to hook up to slightly better speakers

devout jolt
# blissful pollen <@352910176736772096> I was looking at your synthio test YT videos and you have,...

yeah I am a big fan of these cheapie PCM5102 boards you can find on Amazon or Ali. Here's one link: https://amzn.to/3M0gQMp Those are officially line-level out, but I think they drive most headphones

blissful pollen
#

Cool thanks. I have those little stereo 4ohm speakers and besides my shoddy wiring they're a "bit" tinny

devout jolt
#

it's really hard to get those I2S amps sounding good. You really need to be driving speakers in enclosures (turns out boxes are useful, not obvious to me) and of course, larger speakers == better sound, but now you have the power problem of how to drive those speakers off your USB. I like offloading all the audio amplification to a known-good solution of your standard cheap bluetooth speaker w/ aux in

blissful pollen
#

Makes sense to me. Not a be all/end all type thing but would be nice to have it sound a little bit better. Maybe I should also 3d print a box 🙂

devout jolt
lone axle
#

Is it possible to include non-python files in libraries that get distributed in the bundle. Like font5x8.bin file that some of the older pre-displayio libraries utilize by default i.e. https://github.com/adafruit/Adafruit_CircuitPython_framebuf/blob/7c59940395afe427f2282bc648abd39cf3b64b7b/adafruit_framebuf.py#L493 That file is included in the examples folder of this library, but not other libraries that extend the main driver. They need to be copied over separately from the examples, but it'd be nice if the default would be included in the installed "package" so that it can work out of the box without hunting down other files.

jaunty juniper
#

I think the bundler would work ? I'm not sure if it only takes python files, but probably not.

onyx hinge
#

@lone axle I don't know, but I'm nearly sure that non-python files can't be frozen in

#

I be filterin' yer square waves, fir sure

blissful pollen
#

After all, it's hip to be square

onyx hinge
#

old and busted

jaunty juniper
#

and I think too that it would make it un-freezable (it's not frozen in anything currently)

#

an alternative being to make it into bytes in a py file

blissful pollen
#

Would it make sense just to include it in all the libraries that need it? I know it is duplicating the one file, but I don't think it is something likely to change

jaunty juniper
#

in the examples ?

jaunty juniper
#

that would definitely be easy to do

blissful pollen
#

Yeah just include it in any example that needs it. Probably less risk then trying to include it in the library itself

lone axle
#

Yeah, I am in favor of including it in all libraries that ultimately default to using it which is pretty much anything from old non-displayio type of drawing on displays and adafruit_epd, everything with display.text() AFAIK.

#

encoding it as bytes in a py file so it can be mpy-crossed and included with the current tooling is an interesting idea.

tulip sleet
#

@blissful pollen @lone axle How about making it its own library? Then the other libraries would depend on it, and there would be only one copy to update if that was needed.

lone axle
#

Sounds like a nice idea to me. adafruit_bin_font or something. It could be added to if ever there are more (although newer displayio supports different font formats). The logic in frambuf could maybe be tweaked to avoid importing it if the user does happen to set their own font file.

jaunty juniper
#

I don't think you would want to add more fonts in it, it would blow up in size

#

tangentially related, I do think that we need an Adafruit repo of selected (open source licensed) fonts, referenced in related guides (like the custom fonts guide and adafruit_display_text labels guide)

tulip sleet
#

also if more than one dependent library wanted 5x8, there would be only one copy on CIRCUITPY

blissful pollen
#

I agree a separate library is a good idea. The import failing will provide a clear clue as to what is wrong.
(I may have not been able to find this exact file at least twice I recall when I was starting out)

tulip sleet
#

the library might just provide a directory to store the font file. Or it could have a small amount of code that would return the file path.

manic glacierBOT
jaunty juniper
lone axle
#

I remember a similar thing from the core docs. Sphinx-rtd-theme or something it relies on changed something about how jquery was (or isn't any more) included. It needs a seperate pip requirement for it now iirc.

manic glacierBOT
#

I didn't note it at first, but this also affect the search field, which doesn't work on any of the library docs.
Example: https://docs.circuitpython.org/projects/httpserver/en/latest/search.html?q=html&check_keywords=yes&area=default#

Note the irony of how the NEXT message after the error is about the loading of jquery...

<img width="1362" alt="Capture d’écran 2023-05-12 à 02 38 29" src="https://github.com/adafruit/circuitpython/assets/6160205/a693a6c6-3387-4b90-88b2-15c1bd75df65">

jaunty juniper
#

which matches my observations

#

(see the issue) 👆

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.1.0-beta.2-2-g057c152d6-dirty on 2023-05-10; BPI-Leaf-S3 with ESP32S3

Code/REPL

>>> @micropython.native
... def test_fxn():
...     print("This is a test fxn")
...
...
...
>>> test_fxn()

Behavior

Device crashes immediately after above code w/o any output. Upon reconnection I see the following message:

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

You are in safe ...
manic glacierBOT
#

I were able to narrow down the issue and I found a fix (at least on my code).

At some point, my code do:

# configure UART for communications with VESC
self._uart = busio.UART(
    uart_tx_pin,
    uart_rx_pin,
    baudrate = 115200, # VESC UART baudrate
    timeout = 0.005, # 5ms is enough for reading the UART
    # 256 works
    # 512 fails
    # 1024 works
    receiver_buffer_size = 1024) # VESC PACKET_MAX_PL_LEN = 512

I was using a value of 512 for the receiver_...

#

I've been running my two S2 boards for another couple days without any luck reproducing the issue.

The Lolin board I ordered came in, unfortunately, it turned out to be one of the likely counterfeit devices based on the silk screen and lack of PS RAM. I was able to build a custom CircuitPython binary which started the REPL, however I couldn't run the test script for more than 15 to 20 minutes and the REPL/Web Access interface would peri...

#

Interesting. I wonder if mine are counterfeit as well. I got them on
Amazon, so not really sure. Either way, I was able to just deal with this
problem by auto-rebooting on crash, having it run safemode.py, logging the
error, doing another reboot to get into main.py and then proceed from
there. I still see a reboot roughly every 12 hours or so, but it hasn't
been a problem for my Marble Run project for a STEM lab at a high school.
The kids are having plenty of fun with the final working circui...

manic glacierBOT
manic glacierBOT
slender iron
# manic glacier

@tulip sleet haha me too. the ones that keep time in actual calendar values are terrible

tulip sleet
slender iron
#

100% I assumed it was kept for backwards compatibility

manic glacierBOT
jaunty juniper
#

I shall retest and pay more attention this time

manic glacierBOT
onyx hinge
#

hopefully this is the last for now ^^ 🙂

#

@slender iron sorry for making your review harder, I know I should force-push less than I do but my mind was totally somewhere else than thinking about my reviewer

slender iron
#

np 🙂

blissful pollen
#

I am hoping to test some of the synthio stuff this weekend (new midi controller was just delivered!) so if there is anything in particular Jeff you'd like me to look at or try just let me know

onyx hinge
#

@blissful pollen just have fun...?

blissful pollen
onyx hinge
#

I have not tested all the combinations of things. the newest things are stereo/panning, ring modulation, and fir filtering so those probably have problems to be found. for sure if you give too many FIR filter entries your microcontroller will bog down and the audio will start skipping but there's really no fix for that

onyx hinge
#

if you collect any good groups of settings that'd be cool to start a list of somewhere

idle owl
#

@onyx hinge I have a note here to add a warning to the M7 guide about PWM Audio only working on A0 and A1, does this sound right to you?

#

I'm not sure where to add the warning. I have to update the template, and so I want to get it right on the first try.

#

Maybe after the wiring diagram section.

#

Doing it that way. Hope I'm on the right track here, heh.

manic glacierBOT
slender iron
#

@tulip sleet think we can do 8.1 rc next week?

tulip sleet
#

kattni would like me to do a beta.3 today (or over the weekend), to help a guide that will come out soon. I am not sure we have all the 8.1.0 issues covered yet

#

but the remaining issues are network crashes, not sure we can do anything about those

#

so maybe yes, and push those forward

#

I am a little mystified by #7932 (AiThinker C3). what is different about this vs C3 QT Py?

#

@idle owl when is the guide you need the beta for being published?

idle owl
#

@tulip sleet Further out than I thought. May 24th.

#

So no rush, apparently. 😄

tulip sleet
#

well, then if we do an rc (see above) next week, will be in time no problem

idle owl
#

I don't know what related issues are already filed regarding what I was running into with this code on ESP32-S2, but I imagine someone might want to eventually look into it. I don't want to file a duplicate issue though, which is why I haven't. I don't have the cycles right now to go through what's already there and figure out how it's related, especially since I don't quite get what was going on in the first place.

tulip sleet
#

we fixed something about pings crashing

idle owl
#

You fixed that the espidf exception is now caught, so it doesn't dump into safe mode every time.

#

Meaning at least my code stopped being in safemode every 3 pings.

#

But the issue itself was not resolved.

#

It was reporting espidf Out of memory error every few pings or so. Which I passed on, and the code kept running, but I can't put that in a guide.

tulip sleet
idle owl
#

So when we figured out the issue wasn't present on S3, I switched and moved on.

tulip sleet
#

yeah, I don't think we would hold up 8.1.0 for that, since it can be worked around

idle owl
#

I wouldn't think so

#

Also, S2 only.

#

So.....

#

¯_(ツ)_/¯

#

Typo of the day: PWN audio.

#

I don't even want to fix it.

crimson ferry
#

sounds like a pirate station

idle owl
#

Certainly does.

manic glacierBOT
slender iron
#

@tulip sleet I was going to check another C3 and punt if it works.

lone axle
#

@proven garnet (he/him) I think the fix to this: https://github.com/adafruit/circuitpython/issues/7896 is a relatively simple minor addition to docs-requirements and a list inside of docs/conf.py. I'm going to try to confirm that on one library this evening.

Just wanted to check in with you to see if you already have anything in the works for this one so we don't duplicate effort. If you don't, I'll get prepared for a sweep to patch that in the libraries for next week.
(sorry if you got double pinged, I put this in the wrong room initially)

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.1.0-beta.2-16-gf8cbdf88e on 2023-05-09; Adafruit QT Py RP2040 with rp2040

Code/REPL

import time, random
import board
import audiobusio, audiomixer, synthio

# qtpy rp2040 SPI pins be sure SCK pin is tied to Gnd
lck_pin, bck_pin, dat_pin  = board.MISO, board.MOSI, board.SCK

SAMPLE_RATE = 28000  # clicks @ 36kHz & 48kHz on rp2040

synth = synthio.Synthesizer(sample_rate=SAMPLE_RATE)
audio = audiobusio....
#

Yep, it's all good. With code to new API (see below), things work as intended. Thanks! And I get to close a bug! (a useless bug but still)

# ... synth init as before ...

# make and press note w/ vibrato
note = synthio.Note( frequency=110, bend_mode=synthio.BendMode.VIBRATO )  # 110 Hz = A2 
synth.release_all_then_press( (note,) )

vibrato_rate = 5
vibrato_depth = 0.5
print("vibrato_rate & depth:", vibrato_rate, vibrato_depth)
note.bend_rate = vibrato_rate
note.bend_dept...
blissful pollen
#

@devout jolt just checking for your MIDI tests you go MIDI controller->computer computer->CircuitPython device?

devout jolt
blissful pollen
#

Thanks, just got an Akai MPK miniplus and been watching your synthio YT videos so want to see what this can do 🙂

manic glacierBOT
devout jolt
manic glacierBOT
manic glacierBOT
#

I meant only to note that in one instance, I had different apparent rates of safe mode between two otherwise identical boards.

The issue is still open, almost any wifi / requests code I can put together eventually goes into safe mode with recent 8.x.x (newer esp-idf too, of course). I have a number of similar long-running 7.3.3 devices that never go into safe mode. It's difficult to characterize the issue since the safe modes are intermittent. I have since seen safe mode on requests-only p...

proven garnet
#

Happy to help with any of the patching though, feel free to ping and/or DM me about it. I actually have a decent list of patches to apply so I'm also happy to incorporate it into any of those if it takes a load off your plate.

lone axle
manic glacierBOT
proven garnet
manic glacierBOT
#

Quick question, I've been tinkering with trying to get CPY to run on the inky 7_3, and just saw this come around. I'm more or less abandoning what I've done and I can start building on this instead.

I'm curious if the display is working for you on the 5_7? I've updated the init seq for 7.3 but still trying to iron things out.

manic glacierBOT
jaunty juniper
#

so I had issues with fetch-submodules and the silabs build, had to install git-lfs (has that been added to the guide ?) and now with a fresh new clone, make fetch-submodules pulls 9GB instead of ~3.5 in the past (when exactly I'm not sure)

manic glacierBOT
#

I'm still seeing issues with the REPL using these artifacts. Some of my issues could be Thonny related though, Thonny definitely is confused by the QTPY C3 at times and ends up making things worse.

I think the easiest way to see the issues I'm seeing is by trying to transfer a file greater than about 5K to the microcontroller using Thonny. I don't have the same problem sending files using the web workflow interface.

Before web workflow was available, I had written my own file transfer r...

#

Thanks @DavePutz ! So, after doing some git bisecting I ultimately found that the issue I'm having, ironically, corresponds to setting this definition in my boards mpconfigboard.mk file:

CIRCUITPY_ENABLE_MPY_NATIVE = 1

If I comment out that line I'm now able to use the @micropython.native decorator. I'm a little concerned that without that definition, though, the native emitter decorator isn't actually doing anything. Doing a quick grep I see that definition is disabled by defau...

wraith crow
jaunty juniper
#

the thing is, it seems that its absence makes fetch-submodules fail, and leave the submodules in a dirty state (I'm not trying to build silabs)

#

and that

❯ du -ksh ports/*
 61M    ports/atmel-samd
333M    ports/broadcom
 22M    ports/cxd56
205M    ports/espressif
200K    ports/litex
673M    ports/mimxrt10xx
 33M    ports/nrf
 71M    ports/raspberrypi
3,5G    ports/silabs
781M    ports/stm
400K    ports/unix
wraith crow
#

Oh, I see what you mean. I've been blaming it on my ancient setup, but I usually have to run fetch-submodules/remove-submodules a couple times to get a clean state even with git-lfs installed. Perhaps the larger downloads is part of that problem as well though

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.1.0-beta.2-19-g93b0e5b74-dirty on 2023-05-12; Adafruit QT Py ESP32-S3 no psram with ESP32S3
Board ID:adafruit_qtpy_esp32s3_nopsram
UID:4F21AF44318F

Code/REPL

import busio
import board
import time
import displayio
import is31fl3741
from adafruit_is31fl3741.adafruit_rgbmatrixqt import Adafruit_RGBMatrixQT
from adafruit_display_shapes.circle import Circle
from framebufferio import FramebufferDisplay

i2...
onyx hinge
#

synthio feedback and questions

manic glacierBOT
#

This PR adds support for Pimoroni's InkyFrame 5.7 display with integrated Pico-W.

This is not final yet, but I would like to discuss on how to best integrate the pins the inky-frame exposes via shift-register. The current pull-request exposes those pins as MP_ROM_INT, e.g.

    { MP_ROM_QSTR(MP_QSTR_SW_A),        MP_ROM_INT(0)},

and is meant to be supplemented with a supporting python-library which uses the shift-register to actually extract the value of bit-number board.SW_A. ...

manic glacierBOT
manic glacierBOT
#

something like this (untested):

diff --git a/ports/raspberrypi/boards/pimoroni_inky_frame_5_7/pins.c b/ports/raspberrypi/boards/pimoroni_inky_frame_5_7/pins.c
index 4496790c6c..038f94268d 100644
--- a/ports/raspberrypi/boards/pimoroni_inky_frame_5_7/pins.c
+++ b/ports/raspberrypi/boards/pimoroni_inky_frame_5_7/pins.c
@@ -3,6 +3,19 @@
 #include "supervisor/board.h"
 #include "shared-module/displayio/__init__.h"
 
+STATIC const mp_rom_map_elem_t KEYCODES_table[] = {
+    { M...
tulip sleet
jaunty juniper
#

I'm on 2.40.0, a fresh clone after I installed git-lfs worked to get a clean status

tulip sleet
#

also trying a fresh clone...

#

... it's taking a long time in git-lfs when cloning the silabs submodules

#

ok, yes, same thing in silabs port, 3.6G, and it took minutes to do that part

#

@jaunty juniper I'm not sure what we can do about this. Perhaps we could make make fetch-submodules be per port somehow.

For TinyUSB, Thach got rid of a lot the submodules and now has a Python script to fetch stuff

#

and I have 300Mb up/down Internet connection

jaunty juniper
#

yeah I don't know if we can define the "bigger ports" or "less used ports" and have them be retrieved only if explicitly asked for

#

something like fetch-submodules gets the most common, fetch-submodules <portname> retrieves the missing parts (and fetch-submodules all)

#

and remembers for subsequent calls ?
or each port's makefile detects if it was fetch-submoduled and warns ?

tulip sleet
#

it's possible to specify paths for git submodule so in theory could work fine

#

automating it through the makefile sounds interesting

tulip sleet
#

it could do the fetch if needed, and we could remove the need to do make fetch-submodules up front

manic glacierBOT
#

Using tio and old ljinux 0.3.6 (latest master doesn't support incomplete console objects), I am unable to reproduce any of the original issues.
It can scroll in nano, redraw the whole screen, read and respond all the ansi escape sequences just perfectly.

Spamming spaces during boot (wifi & web workflow init) seems to have left a bit of unreadable garbage, but that's about it.
After it boots, it's rock solid.

I spent 15 minutes mashing the keyboard and using terminal applications.

manic glacierBOT
jaunty juniper
manic glacierBOT
#

Perhaps, due to how few use console objects, it would be wise to just make a python module, to wrap the old serial functions.

It would only need to:

  • Wrap the regular serial i/o.
  • While serial bytes available is True, read them in a temporary buffer and return the count in in_waiting.

connected and out_waiting do not have to be implemented/wrapped, since they are not applicable.

I will make it and name it virtUART. Perhaps as a 9.0 api change, it should be considered do...

manic glacierBOT
#

Thanks for the lead @RetiredWizard!

@FoamyGuy I just watched your live stream. It sounds kinda similar to what I'm experiencing, but I'm not even able to get far enough to even try to get the second displayio display running. This one fails when initializing the IS31FL3741 object. This is I2C on one bus, though I'll try the ESP's second i2c bus for the second matrix and see if that makes a difference.

Did you happen to get any farther with your issue on the monster m4sk?

manic glacierBOT
crimson ferry
#

No such file or directory: 'arm-none-eabi-gcc' I thought that was what I just installed

#

wasn't there some discussion a few weeks ago about setting up a way to build for a specific board on github?

jaunty juniper
#

well that would be a path issue ?

crimson ferry
#

I following the guide

#

to bulld for raspberrypi

crimson ferry
jaunty juniper
#

the mac install doesn't give any instructions other than "Download and install the appropiate .pkg file for your Mac" but maybe they need adding to the PATH ?

#

I don't do it like that anyway, I have the zipped versions in a directory, and my build script manages the path as needed

crimson ferry
#

i don't know about that, I'm trying the GitHub action

#

worst case, I make a PR and test the artifact 🤪

#

YOLO

#

hopefully I didn't break the espressif local build with all this

#

crud, it did break

#

ok, that was obvious enough to fix

manic glacierBOT
#

Draft for now... took a first stab at PicoW AP static IPv4. A couple of oddities...

  1. Unlike espressif, AP needs to be started before the changed IP info takes effect:
>>> import wifi
>>> import ipaddress
>>> 
>>> ipv4 = ipaddress.IPv4Address("192.168.251.2")
>>> netmask = ipaddress.IPv4Address("255.255.255.0")
>>> gateway = ipaddress.IPv4Address("192.168.251.1")
>>> 
>>> wifi.radio.set_ipv4_address_ap(ipv4=ipv4, netmask=netmask, gateway=gateway)
>>> 
>>> wifi.radio.sta...
plucky tulip
#

Hello, I was trying to do something like JavaScript's setTimeout in CP, I found this article about multitasking https://learn.adafruit.com/multi-tasking-with-circuitpython/all-together-now, but the solution there is very manual. Is there a library for doing something like this (image below), and if not, would this be a good candidate for a new lib e.g. adafruit_eventloop? I would be happy to make it if that is the case.

jaunty juniper
brazen hatch
#

This should be api-compatible with console objects and be able to be used by esp32 and esp32c3.

manic glacierBOT
manic glacierBOT
#

@akoebbe I got some issues relating to multi-display resolved, but I think there are still some remaining. IIRC The Monster M4sk was working to initialize both displays when I last messed with it. But I did still have some hard faults with other combinations of devices and displays. I don't believe I ever tried specifically two I2C displays, and none of my testing was with FrameBuffer display / RGB Matrix.

manic glacierBOT
#

The page is not published, but you can view it at this temporary link: https://learn.adafruit.com/welcome-to-circuitpython/board-and-port-specific-limitations?preview_token=WsdVgHQVBTr9iHLerIfyWA.

We ended up not doing this. Instead, there are some limitations listed in https://learn.adafruit.com/welcome-to-circuitpython/frequently-asked-questions. In the ReadTheDocs pages, there are now Limitations: sections describing various port-specific limitations.

#

Why do you restrict the import of the module adafruit_ble if the board is not supported. It seems strange to do such a thing given the market offering of the airlift coprocessor

adafruit_ble depends on _bleio. There are several implementations of _bleio:

  1. nRF native implementation.
  2. Espressif native implementation. This implementation is incomplete: see https://learn.adafruit.com/welcome-to-circuitpython/frequently-asked-questions#faq-3129409
  3. BLE HCI implementation done b...
#

I have tried with the featherS2 and featherS3 by unexpected maker and I’ve also tried the adafruit Rp2040 feather I’ve had no such luck with any of them but the strangest thing is I had it working on 6.x circuit python with the rp2040 but not amnymore on the later versions.

From: Dan Halbert @.>
Date: Sunday, 14 May 2023 at 17:31
To: adafruit/circuitpython @.
>
Cc: kairos0ne @.>, Comment @.>
Subject: Re: [adafruit/circuitpython] document port, chip, and boa...

manic glacierBOT
#

Obviously I meant along side the Airlift Featherwing, plz excuse my tone I’m a little frustrated that I bought three boards and two airlifts – my project requires BLE only to find that its not supported for these boards. The Airlift coprocessor is advertised as a BLE solution for any feather based board and if there are three that it in fact doesn’t work with then people should know that before they spend money…

From: kairos0ne @.***>
Date: Sunday, 14 May 2023 at 17:36
To: adafruit/c...

manic glacierBOT
#

Why do you restrict the import of the module adafruit_ble if the board is not supported. It seems strange to do such a thing given the market offering of the airlift coprocessor ?

Traceback (most recent call last):
  File "main.py", line 16, in 
  File "adafruit_ble/__init__.py", line 25, in 
ImportError: no module named '_bleio'

_Originally posted by @kairos0ne in https://github.com/adafruit/circuitpython/issues/6930#issuecomment-1546919567_

#

Obviously I meant along side the Airlift Featherwing, plz excuse my tone I’m a little frustrated that I bought three boards and two airlifts – my project requires BLE only to find that its not supported for these boards. The Airlift coprocessor is advertised as a BLE solution for any feather based board and if there are three that it in fact doesn’t work with then people should know that before they spend money…

  1. It's true that _bleio supporting AirLift is not turned on for ESP32-S2 ...
#

Turns out that lwip only provides the DHCP client. The DHCP server comes from shared/netutils, and it is inited only once, deep in the cyw43 driver when wifi is inited:
https://github.com/georgerobotics/cyw43-driver/blob/05d76fe0091f3a3383d5e310b604ddc7d9556ed2/src/cyw43_lwip.c#L236
I'm not sure if or how the DHCP server can be turned off and re-started, without a lot of side effects.

manic glacierBOT
torpid mantle
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.1.0-beta.2-31-g827eaeb1f on 2023-05-12; VCC-GND YD-ESP32-S3 (N16R8) with ESP32S3
Board ID:yd_esp32_s3_n16r8
UID:4F21AF1E1F4B

Code/REPL

print("hello world!")

Behavior

My IDE is VScode with Circuitpython extension.

after >CircuitCython: Open Serial Monitor , a serial port selection window pops up with the following information: COM20 Microsoft | 303A | 8166. The information followed by COM20...

#

Hi,

Those 2 Luatos boards are quite cheap and simple. Could you please add support to them? Thank you.

The schematics for luatos ESP32-S3:
https://wiki.luatos.com/chips/esp32s3/hardware.html
Note: the MCU is ESP32-S3R8, the flash could be 25lq128ewig or 25lq128cvig

There are two version of ESP32-C3:
https://cdn.openluat-luatcommunity.openluat.com/attachment/CORE-ESP32-C3%E8%AE%BE%E8%AE%A1%E5%8E%9F%E7%90%86%E5%9B%BE_V1.2.pdf
[https://cdn.openluat-luatcommunity.openlu...

manic glacierBOT
brazen hatch
#

Can someone in the following days help me finalize the m5stack timer camera circuitpython port?
It's a board sold by adafruit (yes, https://www.adafruit.com/product/4959), yet has no circuitpython port.
I have finished the rest of the port (led, psram, i2cs), I just need to do the camera part.
I have never used espcamera so it's really hard for me.

manic glacierBOT
manic glacierBOT
#

Turns out that the netutils DHCP server can be turned off and back on again without obvious side effects.

AP:

Adafruit CircuitPython 8.1.0-beta.2-32-gcf124ab85 on 2023-05-14; Raspberry Pi Pico W with rp2040
>>> import wifi, ipaddress
>>> 
>>> ipv4 = ipaddress.IPv4Address("192.168.251.2")
>>> netmask = ipaddress.IPv4Address("255.255.255.0")
>>> gateway = ipaddress.IPv4Address("192.168.251.1")
>>> wifi.radio.start_ap("Bob", "YourUncle")
>>> wifi.radio.set_ipv4_address_ap(ipv...
manic glacierBOT
manic glacierBOT
#

Quick update, I took a look at this PR and from what I can tell the only ISA supported by the native emitter is thumb:
https://github.com/adafruit/circuitpython/pull/2271/files

Naively, I tried a quick and dirty test where I force support for xtensawin by making this change to circuitpy_mpconfig.h:

//#define MICROPY_EMIT_INLINE_THUMB      (CIRCUITPY_ENABLE_MPY_NATIVE)
#define MICROPY_EMIT_INLINE_THUMB        (0)
//#define MICROPY_EMIT_THUMB             (CIRCUITPY_ENABLE_MPY_NATI...
manic glacierBOT
manic glacierBOT
#

Now that main.py works as expected, after I changed the UART receiver_buffer_size from 512 to 1024, another issue appear: the web page on circuitpython.local opens, however if I click on the editor, file browser or terminal, they do not work and even if I refresh the circuitpython.local, it will not work anymore, saying: Firefox can’t establish a connection to the server at cpy-29f7f0.local.

![image](https://github.com/adafruit/circuitpython/assets/147128/2697f22c-3e2b-4e7c-a587-99dba56a12...

manic glacierBOT
manic glacierBOT
#

@bill88t @casainho I have tested with putty, rather than some unreadable code, all others work good. But serial monitor in circuitpython still doesn't work.
<img width="505" alt="20230515212848" src="https://github.com/adafruit/circuitpython/assets/36795033/b62e41e9-34e2-4451-b5bc-b67da83fe89b">

Also, I did some test with the ESP32-S3-BOX V8.0.5. Once I close the Circuitpython cmd window in the vscode, the commands >circuitpython: Select Serial Port , `>circuitpython: Open Serial Monit...

manic glacierBOT
#

If the REPL is working (you can read and write to it) the issue does not lie within circuitpython.
Raw REPL (can be opened with Ctrl + A), that these programs use also works on my sample as expected:

>>> 
raw REPL; CTRL-B to exit
>OKHello world!

>

Taking a look at the circuitpython extension, it warns:

NOTE FOR WINDOWS USERS: I have seen trouble with the serial console, displayi...
manic glacierBOT
#

I think I've seen this on a Feather S2 TFT as well during testing of the HTTPServer library upgrades. In my case there is no camera in use. I had neopixels and in one case a 14x4 segment featherwing.

I think I've seen it occur even when no other hardware is in the mix beyond just the httpserver, but I'm not 100% certain and much more of my testing did involve at least interacting with neopixels.

I believe the hard fault occurred after the server was left running for a few hours.

...

brazen hatch
#

It's simple enough I should be able to make it a console object.

#

From there, plugging it into the os is a piece of cake.

lone axle
#

Are there special steps needed in espressif port to have a debug build that can connect to WIFI? It seems that CIRCUITPY_WIFI_SSID and password in the settings.toml is not auto-connecting in the debug build. Trying to connect manually in user code reports this error: ConnectionError: No network with that ssid but I know the ssid does exist and has the correct name. The non-debug build on the same device does connect successfully to that network.

brazen hatch
lone axle
#

Feather S2 TFT

brazen hatch
#

Hmm, no idea.
I was also using s2 back then.
It's been a good while since I last used debug though.

If you scan, will it show up?

lone axle
#

I will try to find the scanning code and give it a try. Up to now I've just copy pasted the connect code, and eventually removed that when automatic connect from settings.toml start happening.

brazen hatch
#

From ljinux wifi:

def scan(self):
        """
        scan and store all nearby networks
        """
        if wifi.radio.enabled:
            net = dict()
            for network in wifi.radio.start_scanning_networks():
                sec = None
                if len(network.authmode) is 3:
                    sec = str(network.authmode[0])
                    sec = sec[sec.rfind(".") + 1 :]
                else:
                    sec = "Unknown"
                net.update({network.ssid: [sec, network.rssi]})
                del sec
            wifi.radio.stop_scanning_networks()
            return net

        return list()
crimson ferry
#

@lone axle does the ConnectionError: No network with that ssid persist with retries? I can try a debug build and see what happens.

lone axle
#

It does seem to persist. I tried maybe 3-5 times only though before switching back to non-debug to confirm

#

Tried scanning, but have fallen a little deeper into the rabbit hole: I got a single result the first time with a network that is visible around me, but not the one I was using. It did not show the actual network that I've been using. I was trying to get it to retry and now I've ended up into a (different from the one I was hunting I think) hard fault

brazen hatch
#

I remember there was an issue back in the day that reduced effective range, but that was really old.

#

It was way before stackless.

lone axle
#

In my case, based of the signal strength reported in my PC at least the real network I am using should be closer than the one that it did happen to list when I scanned.

brazen hatch
lone axle
#

Interesting. I have had another handful of retries now back in debug mode. I've seen 2 networks a few times, but vast majority of scan attempts only show 1. And neither of the 2 shown have been the actual one that I use.

I will try to move it closer to the router, but I'm a bit skeptical of the distance being a factor. It's already only ~6ft or so from the router, and I'm fairly certain that the network that is showing up most commonly in the scans is one that isn't from an AP inside of my house (I hope anyway 😅 ).

crimson ferry
#

this debug build is a few days old, but```
W (120290) CP wifi: connected
I (120310) wifi:<ba-add>idx:0 (ifx:0, 00:1a:dd:re:da:ct), tid:0, ssn:1, winSize:64
I (120330) wifi:AP's beacon interval = 102400 us, DTIM period = 1
I (121290) esp_netif_handlers: sta ip: 192.168.6.148, mask: 255.255.252.0, gw: 192.168.4.1
W (121290) CP wifi: got ip

#

I haven't seen an issue with running wifi code

jaunty juniper
#

does the debug build use a different tx_power ?

lone axle
#

Weird, now it's about 10 inches away from the AP and I am consistently getting an empty dict back from scan.

brazen hatch
#

It's probably a default

crimson ferry
#

are you basically at tip of main?

lone axle
#

is there any kind of 5G vs. 2.4G that comes into the mix (forgive me if it's an ignorant question tbh I treat WIFI as mostly magic)?

I don't normally mess with it at all, and I'm not sure which my AP is.

#

I am at a fully updated main.

brazen hatch
#

I will build debug for all my esp boards.

brazen hatch
crimson ferry
#

yes, only 2.4

#

I'll test a fresh rebuild

#

what did you disable to get the debug build to fit?

lone axle
crimson ferry
#

same

lone axle
#

My phone seems to think the network (that I'm trying to connect to) is 5G, though I would guess perhaps the AP outputs both. I'm trying to find a way to confirm that.

I would assume it does a compatible one though because networking does work fine for me in standard builds on this device.

brazen hatch
crimson ferry
#

I tried that, but there seem to be a lot of dependencies there

brazen hatch
#

Fair nough.

lone axle
#

Okay, yep. I've confirmed with a different scanning utility I have 2 networks with the same name, one 5G and one 2.4G.

brazen hatch
#

CP will only see the 2.4 one, the other should not exist as far as it's concerned.

crimson ferry
#

takes me a while to build, can't do -j because... reasons

brazen hatch
#

Built on my s2 board, loading now.

crimson ferry
#

(errors with -j, some script issue isn't managing the parallelism right?)

brazen hatch
#

Using my pc, not the poor pi400 rn.

crimson ferry
#

Adafruit CircuitPython 8.1.0-beta.2-30-gca01200b4-dirty on 2023-05-15; ESP32-S2-DevKitC-1-N4R2 with ESP32S2 DEBUG build connects fine, scan shows a few dozen APs (most of them mine) ...RSSI values from -33 to -86