#circuitpython-dev

1 messages ยท Page 10 of 1

onyx hinge
#

@edgy edge maybe you're missing MP_REGISTER_MODULE?: ```MP_REGISTER_MODULE(MP_QSTR_cyw43, cyw43_module, CIRCUITPY_CYW43);

tulip sleet
#

@edgy edge if you can point to a repo with the code, that would give the most context

edgy edge
#

@onyx hinge originally I was missing MP_REGISTER_MODULE but fixed it last night. I'll clean up my repository and create a single commit isolating my changes for this issue

tulip sleet
edgy edge
#

@onyx hinge could you take a look at this commit? Ignore the readme, it is a work in progress it will get updated once the process works.

tulip sleet
#

@analog bridge I had some questions and passed the esp32-camera fixes to @onyx hinge.

manic glacierBOT
tulip sleet
#

@edgy edge did you mean to submit a PR, or just point us to the repo?

edgy edge
#

I meant to point to the commit in my fork but generated an incorrect pull request by mistake

tulip sleet
#

just close the PR

#

you can just give us a link to the fork here

tulip sleet
onyx hinge
#

I don't see the problem. I built the firmware and opened it in the debugger. the new module is listed in mp_builtin_module_table: ```(gdb) p mp_builtin_module_table
$1 = {{key = 0x156, value = 0x94a0c <mp_module___main__>}, ...
{key = 0x4416, value = 0xa052c <neutonml_module>},
...
}


If you didn't try "make clean", then try it now. This could be a class of change that is not correctly tracked by the build system's dependency management.
#

@edgy edge ^

edgy edge
#

but ```Adafruit CircuitPython 8.0.0-beta.0-53-g676aa321a3-dirty on 2022-09-20; Aulitech Cato with nRF52840

help("modules")
future board onewireio touchio
main builtins os traceback
_asyncio busio paralleldisplay ulab
_bleio collections pulseio ulab
adafruit_bus_device countio pwmio ulab.numpy
adafruit_bus_device.i2c_device digitalio rainbowio ulab.numpy.fft
adafruit_bus_device.spi_device displayio random ulab.numpy.linalg
adafruit_pixelbuf dotenv re ulab.scipy
aesio errno rgbmatrix ulab.scipy.linalg
alarm fontio rotaryio ulab.scipy.optimize
analogio framebufferio rtc ulab.scipy.signal
array gc sdcardio ulab.scipy.special
atexit getpass select ulab.utils
audiobusio io sharpdisplay usb_cdc
audiocore json storage usb_hid
audiomixer keypad struct usb_midi
audiomp3 math supervisor uselect
audiopwmio microcontroller synthio vectorio
binascii micropython sys watchdog
bitbangio msgpack terminalio zlib
bitmaptools neopixel_write time
Plus any modules on the filesystem```

#

i'll do another make clean ...

#

winner. Thank you @onyx hinge and @tulip sleet

onyx hinge
#

yay!

#

It's a weakness of make that a change (like adding -DFOO=1 to CFLAGS) doesn't automatically cause targets that depend on the value of CFLAGS to be rebuilt.

edgy edge
#

yes, but I've been around long enough and should've known that. Sorry to waste your time

onyx hinge
#

it's no problem!

orchid basinBOT
proven garnet
#

Blinka now has a python wheel for download from PyPI ๐ŸŽ‡

tulip sleet
proven garnet
#

Before only source distributions we're uploaded, so there was also the local build process after downloading. Python wheels (and wheels in general) cut that later part out. So for the most part only the download is required.

#

I don't think it's massively important for us, but for a package like numpy it's a game changer because a wheel cuts out a lot of the local building required if you download the source and have to do a local install process.

#

Still, time saved is always good

tulip sleet
#

thanks!

manic glacierBOT
tidal kiln
tidal kiln
jaunty juniper
#

yeah saving the "last value" is something I tend to do indifferently in or out of that kind of test

manic glacierBOT
idle owl
#

Or file an issue, I guess.

#

Label it "Good First Issue" if you do.

#

Because that's a pretty good one.

manic glacierBOT
#

The documentation pages for _bleio don't clearly indicate that there is only partial BLE support for the espressif port. (Implementation is in progress and tracked by #5926.) This should be documented clearly in more places to avoid disappointing users who might purchase these devices hoping to have full BLE support in CircuitPython. I don't know offhand whether it will be easier to add a note to the support status of each board in the _bleio module or whether it makes more sense to add a...

manic glacierBOT
#

Instead of this, update the existing documentation:

  1. Make the type of the file parameter be Union(typing.BinaryIO, str)
  2. Change the :param ... file: line similarly. For the explanatory text, probably say "The name of a wave file (preferred) or an already opened wave file"
  3. Change the example to use wav = audiocore.WaveFile("cplay-5.1-16bit-16khz.wav") since will be preferred
#

Thank you! This looks very simple and sensible as a change. I do have a note about the documentation -- I only added a single comment but it looks like it applies equally to wave and mp3 sections.

In addition to that, if it is easy can also see whether you can make assigning a string to the mp3.file property can be made to work? If it is not easy, we can leave it for a future PR.

gilded cradle
onyx hinge
#

@gilded cradle looks like that line of code would be common to any board using uart as console, just based on the file path

gilded cradle
#

Looks like it varies after doing a search.

#

Thanks @onyx hinge but it looks like it's constructed in UART.c

onyx hinge
#

oh! hm. I love being wrong

manic glacierBOT
#

@jepler
I made the requested documentation changes. I chose to leave both options in the example, to be clear that both can be used if desired (at least for now). I hope this is okay.

mp3 = audiomp3.MP3Decoder("cplay-16bit-16khz-64kbps.mp3")  # preferred use
# mp3 = audiomp3.MP3Decoder(open("cplay-16bit-16khz-64kbps.mp3", "rb"))

I am a beginner at working with something like CircuitPython core (first core contribution actually), so I can't speak to how easy it would be to add ...

gilded cradle
austere acorn
#

@onyx hinge is the Union(str, typing.BinaryIO) with () or [] ? My doc check failed ๐Ÿ˜„

tulip sleet
austere acorn
#

I'm finding my way through first core contribution ๐Ÿ˜…

onyx hinge
manic glacierBOT
manic glacierBOT
proven garnet
#

Looking for feedback - if I'm going to show people how to get started with Hacktoberfest, is it better to do it from within Windows rather than Linux? I would guess that's what most people are going to use, but I have no idea. It's also my bias because I definitely did start there.

#

I imagine that showing people how to use GitHub Desktop might be more useful for a larger group of first-time contributors than using VS Code git window or command line...

tulip sleet
#

well, they might have a Mac
For library work, it doesn't matter, for core work, I would rather recommend vanilla linux

#

maybe WSL

proven garnet
#

Good point. And in that case, GitHub Desktop is available for macOS as well

midnight ember
#

If your target demographic is beginners on windows Iโ€™d recommend Mu and GitHub desktop. Canโ€™t use pycharm in windows with serial. VScode GitHub setup is very intimidating.

manic glacierBOT
#

@bill88t Would it be helpful if I ran your WiFiTester script for the extra data? I tried running it on my Feather ESP32-S3 4MB Flash / 2MB PSRAM but I didn't know how to handle the .env part (forgive my ignorance on this).
Happy to try and help, just need a pointer or two.

This bug is totally stalling my project on the Feather ESP32-S3. :/ I don't seem to have the option for this platform to downgrade to CircuitPython 7.3.3 either. I've ordered a Feather ESP32-S2 to see if I can reproduce...

manic glacierBOT
manic glacierBOT
#

Would it be helpful if I ran your WiFiTester script for the extra data? I tried running it on my Feather ESP32-S3 4MB

@saketvora It would be useful to get a reading from ESP32-S3 as to confirm it's behaviour.
For the .env please take a look here
If the board has no CIRCUITPY usb access, you can from within the repl do something like:

>>> from storage import remount
>>> remount("/", False)
>>> a = open("/.env", ...
#

@saketvora

This bug is totally stalling my project on the Feather ESP32-S3.

A temporary workaround would be to simply force the board to always .reset() upon code completion as this bug occurs only on soft reloads.

I don't seem to have the option for this platform to downgrade to CircuitPython 7.3.3 either.

You can try to build it if you'd like. Not gonna claim it will work, but you can try. Building
(mak...

brazen hatch
#

How can I tag a circuitpython build to have a specific name?

brazen hatch
#

I kinda need it to propely tag the picow builds as 8.0
because for some reason they are tagged as 6.0
even though they are 8.0

manic glacierBOT
#

In the long run, this functionality is probably better put in the usb module

Yeah, I think we discussed it in a line-comment thread above originally. It definitely would fit in a usb. namespace, but since the usb module right now is for a host api that would require some restructuring there and I'm not sure if and how PyUSB api-compatibility would work.

manic glacierBOT
manic glacierBOT
jaunty juniper
austere acorn
#

Hello ๐Ÿ™‚
Could someone help me with my PR please? https://github.com/adafruit/circuitpython/pull/6931

After making the requested documentation changes, all the checks passed... except for one, that timed out after like 6 hours.

Thinking it was a fluke, I did a rebase to trigger the checks again ... this time there were 12 failed checks with the same error as in the pic.

I made another small change + commit ... now one failed again, in a different spot, with a different makes-no-sense-to-me error.

I'm lost!

jaunty juniper
austere acorn
jaunty juniper
tulip sleet
brazen hatch
onyx hinge
#

@austere acorn well done on that PR to the core! ๐ŸŽ‰

manic glacierBOT
brazen hatch
#

Since you here Jepler, this is a nice moment to thank you for your work!
I will go stress test what works on the picow.

onyx hinge
#

oh, yeah, not much works and we're not ready for bug reports about it yet.

brazen hatch
#

oh alright

onyx hinge
#

but you're welcome

tulip sleet
#

basically this is pre-alpha ๐Ÿ™‚

brazen hatch
#

yea tbh

#

got mine connected, pinging both ways tho

#

its not insignificant

#

Wish I could actually help with the code..
My C is terrible though.

tulip sleet
#

your testing is helpful, don't worry, there are many ways to help, and we appreciate it!

manic glacierBOT
#

OK, will merge after the latest tweaks I made!

Tested this on Linux with a Metro M4, using lsusb. One interesting thing is that the manufacturer string is overriden by a known VID name. I had to try several before I got the mfr name I supplied to go through (e.g. try 0x0001 for the VID, and you'll get "Fry's Electronics")

Thank you @s-ol, and sorry for the delay!

#

Thanks for this! We want to make our API's be the same or a subset of what CPython provides. For that reason, could you make utime() take a 2-tuple instead of a plain int? Ignore one or the other value, I guess, or require that they are the same.

You can skip the ns argument support.

From https://docs.python.org/3/library/os.html#os.utime):

os.utime(path, times=None, *, [ns, ]dir_fd=None, follow_symlinks=True)

Set the access and modified times of the file specified by path...

austere acorn
#

@onyx hinge @tulip sleet Thank you very much! ๐Ÿ˜Š

austere acorn
# onyx hinge <@196904073255976961> well done on that PR to the core! ๐ŸŽ‰

If you have the time, could you give me a bit more details about what you asked for the MP3Decoder ?
I want to make sure I have the right idea.
Was it to add another MP3Decoder class property, like the file pointer, bits_per_sample, channel_count and so on? One that would store the file name and path as a string?

onyx hinge
#

@austere acorn I'm not sure, that's why I suggested to postpone it. I know that existing code assumes the mp3file.file object is an open stream. so maybe a new method mp3file.open that takes a str...? My original mp3 project, jeplayer, uses the file property: ```py
def change_stream(filename):
"""Change the global MP3Decoder object to play a new file"""
old_stream = mp3stream.file
mp3stream.file = open(filename, "rb")
old_stream.close()
return mp3stream.file


Later it uses the tell method on that file to estimate the playback percentage: `playback_display.progress = mp3file.tell() / file_size`
#

so what if change_stream becomes: mp3stream.open(filename); return mp3stream.file? That seems like a nice improvement.

manic glacierBOT
#

I think this is a more general problem of finding a consistent way of noting what is not implemented and what works.

In general we have noted these kinds of limitations in the Learn Guides for each board. Many pages are shared or "mirrored" so this does not make guide maintenance onerous as it sounds. Sometimes we forget to note such things.

We could make these notes in readthedocs, which comes from shared-bindings. But many beginners do not know about readthedocs. Or we could perhaps...

austere acorn
#

And I'm assuming that same behaviour makes sense for WaveFile too

onyx hinge
#

It's less important for WaveFile. It's important for MP3Decoder because MP3Decoder needs to allocate a few large chunks of memory. If you repeatedly construct your MP3Decoder within your program, you eventually get a MemoryError.

#

and because WaveFile is on even small devices like samd21 we don't want to unnecessarily add 'stuff' to it

#

so I'd do it only on MP3Decoder at this time

austere acorn
#

Okay, makes sense!

manic glacierBOT
#

We can't tell whether USB is going to be available or not. When the board powers up, we don't wait for USB, since we might wait forever. It's just not available at the time the remount() runs, so the remount() succeeds. We probably don't want to restrict remount() to being in boot.py only, because there are use cases for being in code.py, on, say, a battery-powered device.

edgy edge
#

we need to maximize both memory and storage available for machine learning models. Would it be advisable to remove modules we're not using? Any red flags in this list? We are using the stock XIAO nrf52840 BLE SENSE. Would there be any significant benefit to including BLE and IMU in the circuit python build instead of as libraries? We do use the USB port for debug and file loading```

Remove

adafruit_pixelbuf audiobusio audiocore audiomixer audiomp3
audiopwmio bitbangio bitmaptools displayio fontio
framebufferio keypad msgpack neopixel_write onewireio
paralleldisplay rainbowio rgbmatrix rotaryiosd cardio
sharpdisplay synthio terminalio touchio usb_midi
vectorio

Keep

_bleio adafruit_bus_device aesio alarm
analogio atexit binascii boardbusio
countio digitalio dotenv errno
getpass json math microcontroller
nvm os pulseio pwmio
random re rtc storage
struct supervisor time traceback
ulab usb_cdc usb_hid watchdog
zlib```

tulip sleet
#

the display-related modules are probably not important to you and could be turned off

#

or at least some of them

edgy edge
#

would any of these be unsafe to remove? ```
adafruit_pixelbuf audiobusio audiocore audiomixer audiomp3
audiopwmio bitbangio bitmaptools displayio fontio
framebufferio keypad msgpack neopixel_write onewireio
paralleldisplay rainbowio rgbmatrix rotaryiosd cardio
sharpdisplay synthio terminalio touchio usb_midi
vectorio

tulip sleet
#

keypad is useful if you have attached buttons

edgy edge
#

is there anything like a module dependency graph documented or derivable? It's hard to know where is something like terminalio is used

tulip sleet
#

there are some dependencies reflected in the builds, but they are not complete. See py/circuitpy_mpconfig.*

#

terminalio is used for displaying the REPL on a display

edgy edge
#

no displays no buttons, nothing attached. Just onboard mic, imu and ble. would terminalio be used for USB serial debugging/ development?

manic glacierBOT
#

Remounts in code.py should I not be mistaken are meant to be done only when one of the following is true:

  • the board only supports web-workflow
  • boot.py disabled usb access

In any other cases we should be getting a RuntimeError, yes?

If this is not the case it introduces a new issue:
We have no way of knowing if usb access is enabled from code.py.

It can take up to 3s for usb to init.
The code.py in that time cannot know.
And an early remount (even if used to test usb) can m...

stuck elbow
#

it's pretty easy to see when you have unmet dependency, because you will get a compile-time error

edgy edge
#

thanks. I was afraid of unresolved externals at run time that might not be caught easily

tulip sleet
#

you should get a link error

#

since we don't do dynamic linking ๐Ÿ™‚

edgy edge
#

makes sense and perfect answer

#

is setting CIRCUITPY_<module> 0 in /circuitpython/ports/nrf/boards/aulitech/mpconfigboard.mk the correct way to remove from build? Or will I expect some trial and error to find other build dependencies?

tulip sleet
manic glacierBOT
#

Thanks @DavePutz for diagnosis. The stack size on SAMD21 boards is very limited due to the limited ram (32kB). And if we increase the stack size, then some programs don't run because they run out of heap memory.

I incorporated the program into a single code.py and avoided the error. You can also put

import supervisor
supervisor.set_next_stack_limit(<4608 or larger)

in boot.py. This will cause code.py to run with the specified stack size.

See https://docs.circuitpython...

manic glacierBOT
analog bridge
#

Do we have a learn guide on dualbank module?

manic glacierBOT
jaunty juniper
#

huh funny, doing display.root_group.scale = 2 on a board with a builtin display, makes the scale keep growing on every reload

tulip sleet
#

whoopsie ๐Ÿ™‚

jaunty juniper
#

it's a hack to begin with, but it's cool that it (kind of) works, might make it easier to show text on an M0 without using adafruit_display_text

#

(no idea if it's actually corrupting memory by writing "outside of the screen" or anything)

stuck elbow
#

that's weird, what do you get when you print display.root_group.scale?

jaunty juniper
#

1

stuck elbow
#

I used that to get a bigger terminal on my robot, but I didn't notice it growing every time, just once as you'd expect

tulip sleet
#

maybe it's specific to a particular (kind) of display

stuck elbow
#

seems like it's getting propagated?

tulip sleet
#

something is doing scale = scale * new_scale ?

stuck elbow
#

right, on the contents of the group, probably

jaunty juniper
#

if I change it in boot.py it's fine since it changes only once, but I suspect I need to use reset_terminal

#

or something

#

the REPL text goes outside of the screen

#

(I'm testing on 7.3.3 right now too)

stuck elbow
#

the scale on root_group gets reset, but not on its contents, and when you set it to 2 again, it multiplies the contents again

#

I bet there is code that compares the old value and the new value, and updates the contents based on that

#

(just guessing, though)

manic glacierBOT
proven garnet
#

Hacktoberfest 2022

manic glacierBOT
manic glacierBOT
#

Not (yet) supported:

  • Various getters and setters of wifi.radio
  • listen, bind, accept are not implemented (no servers)

Also these modules/features are not supported or enabled yet:

  • ssl
  • mdns
  • web workflow

At this point, it passes a couple of very simple tests (ntp and plaintext http with adafruit_requests), but is probably not particularly robust.

A big shout out to pico-sdk for providing a great basis for work, and micropython for modlwip, large portions of w...

proven garnet
#

What format do I need to upload something to YouTube? MP4?

manic glacierBOT
proven garnet
#

If anyone that run/records the meetings remembers their settings ๐Ÿ˜„

onyx hinge
#

@tulip sleet do you want me to make the pico/picow share a USB PID/VID or do you want me to request a new PID from raspberrypi?```Running USB VID/PID and Creator/Creation ID Duplicate Checker...
Duplicate VID/PID usage found!

  • VID/PID: 0x239A:0x80F4
    Boards: raspberry_pi_pico, raspberry_pi_pico_w```
tulip sleet
onyx hinge
#

oh it is?

#

OK, in that case -- can you do that for me? or is it time for me to learn how?

tulip sleet
#

it's easy - an internal repo

manic glacierBOT
idle owl
manic glacierBOT
onyx hinge
#

@tulip sleet for picow I need submodules that are current living inside pico-sdk. also those are needed ONLY for one board, not for the whole port.

What do you advise me to do in ci_fetch_deps.py for this?

jimmo noticed to me that micropython puts copies of those submodules under lib/ so they don't have any recursive submodules, should i do that? and just list it for the whole raspberrypi port?

tulip sleet
#

ideally in the long run I would like to see different options for different submodules: e.g. shallow for broadcom firmware, full for small repos, recursive as necessary ,etc. I think we could figure that out but not right now

jaunty juniper
#

we don't support raise ... from ... right ? Or more accurately it ignores the from part ?

tulip sleet
#

i do not know

#

would be easy to test

jaunty juniper
#

it's used in the miniMQTT library and that kind of hides the original exception because of that

pine tartan
#

hi everyone, i'm using a QT PY ESP32 Pico and trying to subscribe to the adafruit MQTT broker. i'm following this Guide but when I try to run the code, I just get an exception and the exception doesnt Actually say anything.

Adafruit Learning System

Learn how to connect your CircuitPython devices to the internet with this lightweight publish/subscribe protocol.

jaunty juniper
#

it's used in a few libraries in fact, we should look into that maybe

#

ah that doesn't mention "from" though, but same thing

inner orbit
#

Is there ANY way to get a Trinket M0 to act as an I2C "slave" with CircuitPython??? I got ten I need to talk to. Don't wanna use C. Teaching some students.

jaunty juniper
#

I don't think i2cperipheral (now i2ctarget in CP8) is implemented on SAMD21 at all

#

it's on SAMD51, RP2040 and Espressif

crimson ferry
#

uart token ring? ๐Ÿ˜‰

jaunty juniper
#

makes me think that I would like to make an addition to the support matrix, or an alternate page, with support by port/variant

#

(so if it's not implemented on M0 you don't go looking through the list of boards to see if one has it enabled)

blissful pollen
#

Does somebody know offhand which source file sets the neopixel to indicate CP statuses?

jaunty juniper
#

in a board setup ? there's only 4 files ๐Ÿ˜‰

#

it's the .h with the defines

blissful pollen
#

Like when it drops to the REPL the pixel changes colors. Just blanking on where that is

jaunty juniper
#

oh the code that changes the color

proven garnet
#

Not that it's a switch to be turned on, rather checking that writing that doesn't cause an issue.

jaunty juniper
#

so yeah they allowed the syntax but ignore it

proven garnet
#

I don' think I ever realized it was implicit like that, thanks!

jaunty juniper
#

I didn't know either, the python docs mention it:

Exception chaining happens automatically when an exception is raised inside an except or finally section. This can be disabled by using from None idiom

#
>>> try:
...   raise OSError("hello")
... except Exception as ex:
...   raise ValueError("world")
... 
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
OSError: hello

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
ValueError: world
>>> 
edgy edge
#

What is the best mapping in a shared-bindings implementation for a C library function with float *inputs parameters? Is mp_obj_get_array() the way to go? ```i
// CircuitPython
import neutonml
nml = neuton()
my_floats.tile(my_floats.float32(0), 10)
nml.set_inputs(my_floats)

// Shared-bindings/neutonml/Neuton.c
STATIC mp_obj_t neutonml_neuton_obj_set_inputs(mp_obj_t self_in, mp_obj_t inputs)
{
int len, status;
float items
mp_obj_get_array(inputs, &len, (mp_obj_t
) items);
status = shared_module_neutonml_neuton_set_inputs(self_in, *items));
return mp_obj_new_int((mp_int_t)status);
}

// shared-module/neutonml/Neuton.c
int8_t shared_module_neutonml_neuton_model_set_inputs(neutonml_neuton_obj_t *self,
float inputs)
{
// call the C lib here
// int8_t neuton_model_set_inputs(input_t
inputs);
return neuton_model_set_inputs(inputs);
}```

manic glacierBOT
#

Built latest commit on my ovahclocked af Pi400, after tagging it 8.0.0-picow-01-887c259

Adafruit CircuitPython 8.0.0-picow-01-887c259 on 2022-09-22; Raspberry Pi Pico W with rp2040

The scans always find some networks duplicated:

Pi400
Pi400
Pi400
Pi400
Forthnet-AKzTk
Pi400
Feline34
WIND_2.4G_422DEA
COSMOTE-403528
WIND_C02F18
WIND_C02F18
WIND_C02F18
WIND_2.4G_9DE02B
WIND_2.4G_9DE02B
WIND_2.4G_9DE02B
WIND_C02F18

Created a [code.py](https://git.port...

thorny jay
#

Just saying: Displaying 333 boards. <= I know some in Adafruit are obsessed by numbers... so that is a number that talk to me. ๐Ÿ™‚

blissful pollen
#

Anyone have a thought offhand on why when my ESP32-S2 custom board goes into the REPL all the pins seem to be set to high (the built in LEDs all turn on).

If I set up one of the pins as a DigitalInOut the pin gets set low

jaunty juniper
#

pins are rest to high by default on ESP

#

did you set them up in board.c ?

blissful pollen
#

Yeah they are set in there. I vaguely recalled some change that they may be resting high now (didnt do that in 7.x when I last tried this).

#

oh in pins.c I did. I guess in board.c I could then default them low of course

#

Thanks @jaunty juniper. Defining the double tap pin also fixed the problem then of reset always going into boot mode.

Now just to figure out why it seems to exception into REPL after a reset IF I'm connected to a computer (vs straight power)

manic glacierBOT
edgy edge
#

I'm trying to figure out the best way to wrap a 3rd party C library for circuit python. Almost done, but need to learn the best way pass arrays of floats. The library contains two functions that don't match any examples I can find: /// /// \brief Make a prediction /// \param index - pointer to predicted class variable (binary/multi classification). Can be NULL. /// \param outputs - float[] array of neuton_model_outputs_count() elements, contains predicted target variable /// (for regression task) or probabilities of each class (binary/multi classification). /// \return Zero on successful prediction. Result > 0 - model not ready for prediction. /// int8_t neuton_model_run_inference(uint16_t *index, float **outputs); /// /// \brief Set input values /// \param inputs - input_t[] array of neuton_model_inputs_count() elements /// \return Zero if model ready for prediction. Result < 0 indicates error, result > 0 - model not ready for prediction. /// int8_t neuton_model_set_inputs(input_t *inputs);

manic glacierBOT
edgy edge
#

should i wrap the returned results in a python dict? like this```

STATIC const mp_rom_map_elem_t mcu_processor_locals_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_frequency), MP_ROM_PTR(&mcu_processor_frequency_obj) },
{ MP_ROM_QSTR(MP_QSTR_reset_reason), MP_ROM_PTR(&mcu_processor_reset_reason_obj) },
{ MP_ROM_QSTR(MP_QSTR_temperature), MP_ROM_PTR(&mcu_processor_temperature_obj) },
{ MP_ROM_QSTR(MP_QSTR_uid), MP_ROM_PTR(&mcu_processor_uid_obj) },
{ MP_ROM_QSTR(MP_QSTR_voltage), MP_ROM_PTR(&mcu_processor_voltage_obj) },
};

STATIC MP_DEFINE_CONST_DICT(mcu_processor_locals_dict, mcu_processor_locals_dict_table);

const mp_obj_type_t mcu_processor_type = {
{ &mp_type_type },
.name = MP_QSTR_Processor,
.locals_dict = (mp_obj_dict_t *)&mcu_processor_locals_dict,
};```

manic glacierBOT
#

Thank you @bill88t
Board: Adafruit ESP32-S3 4MB Flash 2MB PSRAM
Adafruit CircuitPython 8.0.0-beta.0-57-g32d8dd425 on 2022-09-16
WiFi network: 2.4GHz only, WPA2, Asus ZenWifi XT8 (mesh).
Location: 40ft from router through walls (i.e.., not close by or with line of sight)

Sorry, I just downloaded the latest WifiTester code from the GitHub link today but the results.json doesn't seem as well formatted for me. Here's the raw data:

`{"version": "8.0.0-beta.0-62-gb6f67be3e", "espmem_afte...

crimson ferry
#

blinka_cooking Adafruit CircuitPython 8.0.0-beta.0-65-g5781bd318 on 2022-09-22; Raspberry Pi Pico W with rp2040
with requests.get(TEXT_URL, headers={"User-Agent": "๐Ÿฅง๐Ÿฎ",}) as response:
This is a test of Adafruit WiFi! If you can read this, its working :) ๐ŸŽ‰

manic glacierBOT
#

@saketvora
The data is exported as a simple json by the wifi tester, I manually formatted them to be more readable.

Wait. "CompleteFail": 0 and PartialFail": 11???
So ESP32-S3 behaves differently..
The fact that CompleteFail is 0 means that at none of the 50 .env-less runs did it go blind.
So the bug's different there?

This bug is totally stalling my project on the Feather ESP32-S3.

From these results it means it can see at least some wifi's most of the times.
(Partial...

lone sandalBOT
blissful pollen
manic glacierBOT
#

i am getting an error trying to get the patch compiled

(.venv) ~/projects/circuitpython/ports/raspberrypi$ make -j4 BOARD=raspberry_pi_pico_w V=1
GEN build-raspberry_pi_pico_w/genhdr/mpversion.h
make: cmake: No such file or directory
make: *** [Makefile:95: build-raspberry_pi_pico_w/pioasm/pioasm/pioasm] Error 127
make: *** Waiting for unfinished jobs....
#

i am getting an error trying to get the patch compiled

(.venv) ~/projects/circuitpython/ports/raspberrypi$ make -j4 BOARD=raspberry_pi_pico_w V=1
GEN build-raspberry_pi_pico_w/genhdr/mpversion.h
make: cmake: No such file or directory
make: *** [Makefile:95: build-raspberry_pi_pico_w/pioasm/pioasm/pioasm] Error 127
make: *** Waiting for unfinished jobs....

Do you have cmake installed?

#

i am getting an error trying to get the patch compiled

(.venv) ~/projects/circuitpython/ports/raspberrypi$ make -j4 BOARD=raspberry_pi_pico_w V=1
GEN build-raspberry_pi_pico_w/genhdr/mpversion.h
make: cmake: No such file or directory
make: *** [Makefile:95: build-raspberry_pi_pico_w/pioasm/pioasm/pioasm] Error 127
make: *** Waiting for unfinished jobs....

Do you have cmake installed?

whoops... i thought that it was a part of build-essen...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

CircuitPython version

This has been checked with:

- `adafruit-circuitpython-hardkernel_odroid_go-en_US-20220920-b6f67be.bin`
- `adafruit-circuitpython-hardkernel_odroid_go-en_US-8.0.0-beta.0.bin`
-  a locally built version based on `b6f67be3e`

Code/REPL

# none, no REPL access, fresh flash without any file changes

Behavior

Running the various CircuitPython versions previously mentioned on my odroid go, I am unable to access the REPL via seria...

manic glacierBOT
#

If we want boards to be valid Python identifiers, we have more work to do and should do them all at once with a major release. Better to do it as soon as possible, or decide once and for all that board names are NOT required to be Python identifiers.

The following boards have hyphens in their names:

cp32-m4
kicksat-sprite
silicognition-m4-shim
ai_thinker_esp32-c3s
ai_thinker_esp32-c3s-2m
beetle-esp32-c3
lilygo_ttgo_t-01c3
lilygo_ttgo_t-oi-plus
morpheans_morphesp-240
raytac_m...
jaunty juniper
#

ah that bothers meeee

โฏ ag 'USB_MANUFACTURER *= *"Adafruit"' | wc
      20      60    1967
โฏ ag 'USB_MANUFACTURER *= *"Adafruit Industries LLC"' | wc
      45     225    4803
#

that too

ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.mk
4:USB_PRODUCT = "Feather ESP32-S2 TFT"
ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.mk
3:USB_PRODUCT = "Adafruit Feather ESP32S2"
#
โฏ ag 'USB_PRODUCT = "Adafruit' | wc
       4      27     482
idle owl
#

Fix!

#

๐Ÿ˜‰ If you want to anyway.

jaunty juniper
#

I'm also super bothered by the upper cases in Seeed_XIAO_nRF52840_Sense

#

but that's because I have a script that lets me use tab-completion to build a board

blissful pollen
#

Don't look in the ATMEL ports and see all the Adafruit boards with the "Adafruit_" leading them but the similar boards all have it

jaunty juniper
#

yeah Adafruit didn't put adafruit_ in their board IDs in the beginning, but at least it's lowercase ๐Ÿ˜‰

edgy edge
# blissful pollen Just so I make sure Iโ€™m clear youโ€™re trying to return an array of floats from yo...

I'm using a third-party C library for machine learning. This is how it would get called from C input_t inputs[] = { feature_0, feature_1, ... feature_N}; if (neuton_model_set_inputs(inputs) == 0) { uint16_t index; float* outputs; if (neuton_model_run_inference(&index, &outputs) == 0) { // code for handling prediction result returned in index and outputs } } but I will be calling it from python and I'm not sure how to handle pass by reference parameters in the shared-bindings code.

blissful pollen
edgy edge
#

instead of passing by reference would it be preferable to return an object { result: x, index: y, output : [] }

blissful pollen
#

As you say the alternative is to not pass in an array and create one yourself and return that. That may be better if you want to size the array according to result yourself.

onyx hinge
#

Just noticed this on my Android 13(?) phone

austere acorn
#

is that going to format an Adafruit device, or your phone? ๐Ÿ˜„

edgy edge
onyx hinge
#

@austere acorn my device I'm sure

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.3.3 on 2022-08-29; Adafruit Matrix Portal M4 with samd51j19

Code/REPL

import ulab

Behavior

Adafruit CircuitPython 7.3.3 on 2022-08-29; Adafruit Matrix Portal M4 with samd51j19
>>> import ulab
Traceback (most recent call last):
  File "", line 1, in 
ImportError: no module named 'ulab'
>>> ```

### Description

7.3.2 contains the `ulab` module as does 8.0.0-beta.0

circuitpython.org ...
manic glacierBOT
#

Wi-Fi promiscuous mode also seems to be broken, I can't get this code to output anything in 8.0 after the first run even after reboots:

import wifi monitor = wifi.Monitor(channel=1, queue=128) while True: packet = monitor.packet() if packet != {}: print(packet)

This also produces no output:

`for network in wifi.radio.start_scanning_networks():
print("\t%s\t\tRSSI: %d\tChannel: %d" % (str(network.ssid, "utf-8"),
network.rssi, network.channel))
...

manic glacierBOT
#

As @Neradoc suggests, following are the two approaches for extending CIRCUITPY:

  1. Static Approach: Turn off dualbank, remove ota_1 partition and extend user_fs partition during build.
    This is addressed in #6927.
  2. Dynamic Approach: Add API to turn off dualbank, combine user_fs and ota_1 at runtime.

I believe we need both, the static approach can be for boards which have a large overflow and require either turning off multiple modules or just dualbank, latter look...

manic glacierBOT
manic glacierBOT
#

Now, if the i2c bus is locked, camera operations that might access the bus will raise an exception instead of using the bus without taking the lock.

Testing performed:

  • ran a random demo on esp32-s3-eye
  • in repl, verified that when the bus is locked the error is raised, and not otherwise
>>> i = board.I2C()
>>> cam = ...
>>> cam.vflip
False
>>> i.try_lock()
True
>>> cam.vflip
Traceback (most recent call last):
  File "", line 1, in 
OSError: [Errno 11] EAGAIN
>>> i...
austere acorn
#

Hi @idle owl ๐Ÿ™‚ (or anyone else who deals with the libraries ๐Ÿ˜… )

I noticed that in this documentation https://docs.circuitpython.org/projects/charlcd/en/latest/api.html all the examples use lcd = character_lcd.Character_LCD_I2C(i2c, 16, 2), even those for character_lcd.Character_LCD, character_lcd.Character_LCD_Mono, and character_lcd.Character_LCD_RGB that all have a different set of parameters defined.

Is this a mistake, or am I missing something ?

jaunty juniper
#

(not that it's in anyway clear what that person in the GPS library issue is actually doing)

proven garnet
#

Ah gotchya, thanks for pointing that out. So downloading MicroPython firmware + Blinka libraries is valid use?

jaunty juniper
#

yeah

#

the person is linking to a MP forum discussion that doesn't seem to use blinka though, so ๐Ÿคท

manic glacierBOT
proven garnet
#

Gotchya, updated the comment. Thanks for correcting me!

#

(if the comment is still wrong let me know)

jaunty juniper
#

it's a MP question, let them deal with the MP forums I say ๐Ÿ˜‰

#

setting the clock from a source is an interesting use, maybe we could implement an rtc module in blinka just for that

proven garnet
#

Haha fair, I thought it was a running code locally on the computer or something. But yeah, looking more at it, I see that now. It was clear they had an interpreter, so now I see it with all the puzzle pieces that it was the MicroPython one haha.

jaunty juniper
#

it's tech support, people rarely start by saying what board they are using, what software, and volunteering the full code from the get go, instead... screenshots ! (Do they know we can't use the scrollbar in the picture ?)

manic glacierBOT
#

Is there an alternative method for using ulab on the matrix portal? The software-based RGB brightness control library I wrote (PaletteFader) depends on ulab.

As per the discussion we had at the time, we figured if anybody needed it, a custom build of CircuitPython would work (though you'd probably have to disable BLE in its stead). Perhaps when https://github.com/adafruit/Adafruit_CircuitPython_PortalBase/issues/59 is addressed (depending on results), it might be able to get optimize...

#

This is great, actually useful already! Do you want to hear about issues yet at this very early stage, and if so... where?
e.g.,
โ€ข doing socket operations (NTP, HTTP) in a loop every minute or two works fine, but if the loop delay is longer, say 5 minutes... OSError: [Errno 118] EHOSTUNREACH (NTP) ...device still has an IP address
โ€ข intermittent [CYW43] got unexpected packet -9 pop up, even when code is not running (just chillin' at the REPL prompt)

manic glacierBOT
analog bridge
#

Does the FatFs library used in CP provide functionality to re-size partition without loosing data?

manic glacierBOT
#

The behavior below is correct, but the Exception type / error message could be more helpful.

Example problem code and results

Adafruit CircuitPython 7.3.2 on 2022-07-20; Adafruit QT Py ESP32S2 with ESP32S2
>>> 
>>> import wifi
>>> import socketpool
>>> from secrets import secrets
>>> wifi.radio.connect(secrets["ssid"], secrets["password"])
>>> pool = socketpool.SocketPool(wifi.radio)
>>> server="nosuchhostname"
>>> pool.getaddrinfo(host=server, port=443)[0][4][0]
Traceback...
manic glacierBOT
manic glacierBOT
idle owl
austere acorn
jaunty juniper
#

yeah all the inline examples for the base class (which takes pins) are examples for the I2C subclass

austere acorn
#

The docs in character_lcd.py are not consistent

idle owl
#

It's entirely possible that the docs are not correct. But I would want verification on that from someone more familiar with it than me before saying that.

austere acorn
#

If it's helpful, I could open an issue, or straight up do a PR with the changes, and have someone verify and confirm?

digital shoreBOT
manic glacierBOT
idle owl
# austere acorn If it's helpful, I could open an issue, or straight up do a PR with the changes...

If you don't mind the possibility of doing the work and then having it not be necessary, please do put in a PR with the fixes. If you'd rather avoid that, file an issue. Both allow for discussion and verification, but the PR route would be more forward effort on your part. (Unless Neradoc has an explanation as to why it's currently correct. They are typing, and I don't know whether it's a response to you or not.)

jaunty juniper
#

nah

idle owl
#

Wanted to make sure I wasn't stepping on anything!

#

@austere acorn In that case, what I said stands. Completely up to you, but one or the other would certainly be helpful.

jaunty juniper
#

the examples are correct, but they are for a subclass of the class they are written in, which is a little weird, but you can't put them in the subclass, since the methods don't exist in the subclass docs

idle owl
#

Huh.

jaunty juniper
#

I don't care much for examples in the methods documentation anyway

idle owl
#

Fair enough.

jaunty juniper
#

I started implementing the web repl in my app, and these underlined links respectively open the file, and install the missing module

code.py output:
Hello World!
Traceback (most recent call last):
File "code.py", line 9, in
ImportError: no module named 'neopixel'

Code done running.

idle owl
#

Wow.

jaunty juniper
#

maybe it can detect if there's an error signaled with the path of a known module, and put a link to the docs

#

like, wrong number of arguments in neopixel.py ? here's a link to the docs !

idle owl
#

Oooh. That would be brilliant.

idle owl
#

@onyx hinge Since you're the only one around, I'll mention it to you. I'm going to put in a PR to reorder the pin names on the Metro M4 Grand Central. PhilB is doing the PrettyPins, and it came to my attention that the far less-used feature pin names are first in the list. So dir(board) is showing those, not the silk D names. Doing this before Phil did the PrettyPins would have been super helpful to him, but it is what it is. I still think it should be updated to match the now-updated PrettyPins, and to make the more likely-used pin name first in the list. Any objections?

manic glacierBOT
pine tartan
#

Hi everyone, I'm working with MQTT and had some implemention questions

#

When we run the MQTT loop, is there continuous polling happening in the background or is there an actual event driven things happening?

#

I'm trying to conserve battery and would like to implement something that isn't wasting battery by continuously polling for data

#

Since wifi is expensive battery wise

idle owl
#

@onyx hinge Nevermind. Looks like CircuitPython lists both the silk pins and the PCC pins in dir(board) which seems weird to me, but there it is. I thought it only listed the first instance of the pin name in pins.c? Which is why we swapped the order of LED and D13 on all the boards. Anyway, apparently no PR is needed.

jaunty juniper
idle owl
jaunty juniper
#

which is why we put the preferred name first

idle owl
#

Oh.

#

Apparently I am misinformed.

jaunty juniper
#

oh actually no it doesn't change the order, it changes which is the default

#

by which I mean:

>>> board.D13
board.D13
>>> board.LED
board.D13

because:

    { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) },
    { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) },
idle owl
#

OH..... right.....

#

yeah.

#

Ok.

#

I knew that.

#

What is that from? It should be LED first, lol.

#

Thanks for reminding me of what I apparently forgot.

jaunty juniper
#

it might change the order the underrated help(board)

  D12 -- board.D12
  D13 -- board.D13
  LED -- board.D13
#

that's the Feather RP2040

idle owl
#

Ok.

#

My dinner is here. Time to head out!

jaunty juniper
#

(on 7.3.3)

#

bon appรฉtit ๐Ÿง‘โ€๐Ÿณ

onyx hinge
manic glacierBOT
#

I have been playing with an esp32 proS3 and wifi has been almost completely unusable BUT only when I have the board connected to my desktop via the usb-c cable. At first I thought it was because I was screened into the board's terminal but it didn't matter in the end.

Using the same code, without change, it connects to WiFi almost 100% of the time after reboots. I have an ssd1306 connected which display the wifi status, which is how I confirm its connection (ip address) in addition I keep ...

manic glacierBOT
#

The Dualbank is effectively undocumented.

Do I take the .bin?
Does it work with tinyuf2?
How am I meant to know the offsets?

Assuming it's functionallity is as written in the docs, it seems pointless to have the partitions "split" by default.
From my point of view, it would be best if the dynamic system was implemented, but "expanded" being the default.
99% of users will prefer the lots of storage instead of the bank switching.

manic glacierBOT
edgy edge
#

so I've got my third party library integrated with the circuit python build. But it took an ugly hack to py/circuitpy_defns.mk and ports/nrf/Makefiles, changing CFLAGS for the entire build to get the unmodified library code to compile. The right answer is to get the vendor to fix their code, but I have no idea if or when they will do that. Would there be a better way to set these flags only for the glue code in shared-modules that must include their .h files? Every time a new model is trained this library gets pushed, so it's a recurring problem. And to be clear, building lib is isolated and fine, it's just the shared modules part that I can't figure out. Plan B is writing a script to fix the issues as part of each push.```
/Volumes/CPDev/circuitpython/ports/nrf/Makefile
// remove -Wmissing-prototypes from CFLAGS

/Volumes/CPDev/circuitpython/py/circuitpy_defns.mk
ifeq ($(AULITECH_NEUTONML),1)
BASE_CFLAGS +=
-Wno-strict-prototypes
-Wno-missing-prototypes \ why was leaving to play with the last minute percent nice 96% OK we're leaving in commensurate
-Wno-float-equal
else
-Wstrict-prototypes
-Wmissing-prototypes
-Wfloat-equal
endif```

onyx hinge
#

@edgy edge headers for third parties should be in paths that are included by -isystem, not -I or -iquote. That stops any messages that would occur directly in the headers (so probably the strict-prototypes diagnostics would be fixed this way)

You can place your own correct prototypes for functions in header files you control, which will fix missing-prototypes.

If you determine that float-equal is a mistaken warning, you can disable it on a per file basis by putting a line in the file at the top: #pragma GCC diagnostic ignored "-Wfloat-equal"

You can also apply CFLAGS on a per-file basis, like so: py/py.mk:$(BUILD)/extmod/ulab/code/%.o: CFLAGS += -Wno-missing-declarations -Wno-missing-prototypes -Wno-unused-parameter -Wno-float-equal -Wno-sign-compare -Wno-cast-align -Wno-shadow -DCIRCUITPY

If you want to do it just for a region of code you can use #pragma GCC diagnostic push/pop.

#

and of course you should consider whether you can contribute improvements to your upstream's code generator to make it better

edgy edge
#

Thank you! Another great answer

manic glacierBOT
manic glacierBOT
manic glacierBOT
onyx hinge
#

for instance in adafruit_requests.py, it replaces the line 'if sys.implementation.name == "circuitpython": with 'if 1:', which allows mpy-cross to eliminate the 'if' test itself as well as the whole 'else' branch. A couple of other idioms I identified are supported as well, and in particular you can write ```py
from future import annotations

try:
from typing import TYPE_CHECKING
except:
pass

if TYPE_CHECKING:
you can write a novel here, it's OK

If you need
```py
try:
    from typing import TYPE_CHECKING, cast
except:
    def cast(t, v): return v

the overhead seems to be 22 bytes, after it's transformed to def cast... inside an if 1:.

#

(you can also write except ImportError: to placate pylint and it's the same zero/low overhead in mpy-file-size)

#

it's called "astrogate" because it uses python's Abstract Syntax Tree, a parsed form of the Python code, to reason about what to do

jaunty juniper
#

what is that ??

>>> sphinx.__version__
'5.2.0.post0'
#

make html throws an error in the template because of that I think: too many values indeed

  File "/Volumes/CaseSensible/circuitpython-dev/venv-test/lib/python3.9/site-packages/sphinx_rtd_theme/layout.html", line 13, in top-level template code
    {%- set (_ver_major, _ver_minor, _ver_bugfix) = sphinx_version.split('.') | map('int') -%}
ValueError: too many values to unpack (expected 3)
#

(and that's after I sorted out the new :property: error)

manic glacierBOT
#

Wow that has to come from a sphinx related update, I didn't get that locally.
Now when I try to make locally with a fresh venv I get that:

WARNING: Using the :property: flag with the py:method directive is deprecated, use ".. py:property::" instead.
WARNING: Using the :property: flag with the py:method directive is deprecated, use ".. py:property::" instead.
WARNING: Using the :property: flag with the py:method directive is deprecated, use ".. py:property::" instead.
WARNING: Using ...
jaunty juniper
#

so if I pip install sphinx==5.2.0 it's fine

manic glacierBOT
austere acorn
#

Anyone know what this error means in core PR checks ?

manic glacierBOT
jaunty juniper
#

but why did that never come up before ??

#

I can only reproduce it locally by running python 3.7

austere acorn
jaunty juniper
#

also I see in your PR:

//|     def open(self, str) -> None:

it should be something like:

//|     def open(self, filepath: str) -> None:
#

but that's unrelated

onyx hinge
manic glacierBOT
austere acorn
tulip sleet
#

@jaunty juniper I don't know if you are working on that PR fix, but the recommendation is sphinx!=5.2.0.post0, which seems good to me (rather than pin to 5.1.1). If you don't have time to do it now I will push a new commit to your PR.

onyx hinge
#

@tulip sleet we may need to also pull that fix back to 7.3.x

#

though I guess we are not otherwise planning a future 7.3.x release atm

tulip sleet
#

maybe it will get fixed before we do any more 7.3.x releases

#

if any is right, I have nothing in the pipeline for 7.3.4

manic glacierBOT
onyx hinge
#

weird, this next error ... https://github.com/pandas-dev/pandas-stubs/issues/296 links to several bugs reported against mypy about it, and .. they fixed it by pinning python back to 3.10.6? https://github.com/pandas-dev/pandas-stubs/pull/298

GitHub

Describe the bug I have a project running mypy on panda-stubs. To Reproduce See https://gitlab.com/biomedit/sett/-/jobs/3016695046: $ mypy /usr/local/lib/python3.10/site-packages/pandas-stubs/_conf...

GitHub

Because of the bug in mypy with python 3.10.7 (see #296 (comment)) that has links to various mypy issues on this topic, we need to pin python 3.10 to 3.10.6 in the CI

onyx hinge
#

yes I should have linked that too. still don't grasp why a python upgrade would have triggered any difference though.

manic glacierBOT
onyx hinge
manic glacierBOT
#

Hello all,

I have been working on porting CircuitPython to a Nucleo-64 development board from ST (https://www.st.com/en/evaluation-tools/nucleo-f446re.html).

The Dev board has a STM32F446RE MCU, that comes with 512 KB of flash and 128KB of SRAM. Maybe not enough to run applications that require a GUI, but enough to run apps that use SPI, I2C, ADC or USB protocols.
Also supports USB composite device (serial + mass storage)

I made a screenshot with the serial console over USB, with a ...

manic glacierBOT
manic glacierBOT
#

@skickar To avoid an error: TypeError: unsupported types for __mul__: 'NoneType', 'int' I use the following code:

        n = wifi.radio.ping(ipaddress.ip_address("8.8.4.4"))
        if n:
            print("Ping google.com: %f ms" % (n*1000))
        else:
            print("Ping to google.com failed")

because when the result of the call to wifi.radio.ping() is 'None' (which happens) your code is trying to multiply 1000 with None.
As with all 'critical' calls it is be...

manic glacierBOT
manic glacierBOT
analog bridge
#

Why do a hard reset in erase_filesystem()? Can't we just re-mount the new filesystem and soft reload?

void common_hal_storage_erase_filesystem(void) {
    #if CIRCUITPY_USB
    usb_disconnect();
    #endif
    mp_hal_delay_ms(1000);
    (void)filesystem_init(false, true);  // Force a re-format. Ignore failure.
    common_hal_mcu_reset();
    // We won't actually get here, since we're resetting.
}

https://github.com/adafruit/circuitpython/blob/a7b10d41b418e4e612db255d382a01e3e8c0c217/shared-module/storage/__init__.c#L270-L278

manic glacierBOT
sinful spruce
#

Yesterday I was testing "CircuitPython's Web API" and it had a very modern looking user interface. Latter in the day the user interface was changed. What is going on?

jaunty juniper
#

you can access /fs/ or /serial/ for the basic access or /code/ for the enhanced version

blissful pollen
onyx hinge
#
>>> import board
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: no module named 'board'
```well that's a curious error
stuck elbow
#

"are you sure you didn't mean beard?"

lone axle
sinful spruce
lone axle
#

<@&356864093652516868> the weekly meeting is set to occur in about 2 hours from now at 2pm Eastern / 11am Pacific US time. If you plan to participate you can add your notes to the shared doc here: https://docs.google.com/document/d/1eqMwdLfb53MKA5T1Ck5D1lJQCDSs7naD7hZwnAid0-c/edit?usp=sharing We look forward to catching up with everyone participating.

proven garnet
#

One of the rare meetings I can talk!

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.0 on 2022-08-18; Adafruit Feather ESP32S2 with ESP32S2
Board ID:adafruit_feather_esp32s2

Code/REPL

https://github.com/adafruit/Adafruit_CircuitPython_BME280/blob/main/examples/bme280_simpletest.py

import time
import board
from adafruit_bme280 import basic as adafruit_bme280

# Create sensor object, using the board's default I2C bus.
i2c = board.I2C()  # uses board.SCL and board.SDA
bme280 = a...
tulip sleet
manic glacierBOT
onyx hinge
#

@tulip sleet can you advise on #6945? ^

idle owl
lone axle
idle owl
#

@lone axle Transfer it to me first.

#

I'll transfer it to Adafruit.

#

Always worth trying, but if it fails, do the intervening transfer first. ๐Ÿ™‚

lone axle
tulip sleet
onyx hinge
#

thank you Dan

idle owl
lone axle
#

and PR the bundle.

idle owl
proven garnet
#

I think the hook is still good if you do it before transferring too, for future reference. I tested it on the iBeacon library and it still seemed to work after transferring over.

idle owl
#

Interesting.

#

TOO LATE NOW.

#

๐Ÿ˜‰ heh

proven garnet
#

We'll fix it in prod!

idle owl
#

๐Ÿ˜‚ uff. Terrible!

lone axle
minor plume
idle owl
#

@onyx hinge @tulip sleet I want your thoughts on the current pin situation on the Grand Central. Not sure it's worth putting in the weeds. Might make more sense to save it for later here.

manic glacierBOT
#

We used to give out Adafruit PID's (we have an internal master list), but we stopped doing that a while ago for various reasons. Now if you need an independent VID/PID, we suggest you go to https://github.com/pidcodes/pidcodes.github.com if you cannot get one from the manufacturer. There is some discussion of ST sublicensing PIDs here: https://www.google.com/search?q=st+get+usb+pid+site:community.st.com, but I don't see it as a simple process. Does the board identify in any way with an ST VID...

tulip sleet
onyx hinge
#

pidcodes may not be appropriate unless the board's open source .. or am I confused?

tulip sleet
#

hmm, yes, though I'm not sure what else to do in this case

orchid basinBOT
royal rover
#

@lone axle time codes

onyx hinge
#

negative seconds ๐Ÿ™‚

modern wing
#

Yay to new reviewers! ๐Ÿฆœ

lone axle
idle owl
#

Tekktrik!

proven garnet
#

Haha it was me

#

But I also broke them

#

So call it even ๐Ÿ˜†

onyx hinge
#

I thought so but I wasn't sure in the moment ๐Ÿ™‚

proven garnet
#

Easy to do when you have a home field advantage ๐Ÿ˜„ Thanks!

modern wing
#

And thank you for being here part of it @idle owl ๐Ÿ™‚

onyx hinge
#

@idle owl this community we've built together has become the one I measure all other communities against.

#

thank you for being such a driving force

modern wing
idle owl
austere acorn
#

I was away from the computer, so late thank you for the hug report, @tulip sleet !
And thank you everyone else as well for being so awesome! ๐Ÿ˜Š
I never dared to contribute to open source before.

onyx hinge
#

@austere acorn keep it up! we can always use more help

#

August 18 so a bit past 1 month at this point

#

(djdevon3's pcb)

brazen hatch
#

What a "the silkscreen is free real estate" chad

proven garnet
#

@onyx hinge if you didn't come across it, check out LibCST. It works with visitors the same way I believe ast does, but as a concrete syntax tree it can keep track of things like whitespace and comments.

minor plume
#

Those NeXT keyboards were so great!

onyx hinge
#

@proven garnet I did not. thanks for the note

manic glacierBOT
#

Since it's a development board from ST, then VID can be the one from ST.
The PID should be the one that ST uses for a USB device that exposes itself as CDC (communication device class ) + MSC (mass storage class), but I can't figure out how to generate one.
The PID I used is the MSC generated by the STM32CubeIDE, and the board with my CircuitPython port is recognized on both my linux, and windows machines, so it's seems to work.

lone axle
austere acorn
#

not out yet, don't ask?

thorny jay
#

Ok, and there is a RP2040 feature I did not understood.

#

They will find it from the guide I guess.

#

learn guide I mean.

gilded cradle
#

Sounds fine with me

lone axle
idle owl
#

@proven garnet So basically like this? py mqtt_client = MQTT.MQTT( broker=secrets["broker"], port=secrets["port"], username=secrets["aio_username"], password=secrets["aio_key"], socket_pool=pool, ssl_context=ssl.create_default_context(), )

idle owl
thorny jay
#

Maybe in the "support matrix"?

#

USB Host on RP2040 is like that.

#

Wifi support in some board where there is a wifi chip but no support are like that too.

#

Could be in the release notes? Because it change from version to version... But no one is reading the release note before buying.

austere acorn
#

100% what Kattni said, I saw people complaining about it

thorny jay
#

Sometime I know about a limitation because I follow those meeting... but sometime I was surprise even with my involvement.

#

Warning the product page is only for product from Adafruit or resell by Adafruit.

errant grail
#

We need a "pretty pins" or badges approach to included features and CircuitPython modules.

jaunty juniper
#

in general the shop page should also say "Circuitpython support is in alpha there might be missing features and isntability" on S3 and C3 and such, like it used to say on the feather STM32

thorny jay
#

Don't forget the non Adafruit board...

austere acorn
#

Implementing what CGrover said would also help with the M0 limitations

idle owl
austere acorn
#

I see a lot of people trying to use M0 boards, and getting frustrated when they get the memory errors

idle owl
#

We don't have those boards, so testing the features on all of them is not possible.

austere acorn
#

Since they don't know CP is limited

idle owl
modern wing
gilded cradle
#

Thanks

austere acorn
modern wing
#

Thanks!

errant grail
#

Thanks!

minor plume
#

Thanks, everyone!

idle owl
#

That one we've gotten through to most folks, but it's not 100% prevented. Intermittent new folks still try to use the whole bundle.

minor plume
blissful pollen
#

Was text only, but had a question I think was talked about during in the weeds: the BLE support on espressif is not fully complete? Was briefly looking at it last night and wanted to confirm

jaunty juniper
#

it doesn't support starting a service, which is most uses

austere acorn
thorny jay
jaunty juniper
#

want an HID device ? start a service. Want to be able to connect from the Bluefruit app ? start a service !

minor plume
jaunty juniper
onyx hinge
#

dangit I used to study french and I still never made the Glaude / Chaude connection

jaunty juniper
#

for example the adafruit_ble_radio library works fine between an S3 and a C3 board

#

or you can connect an S3 to a NRF52 running a UART service

#

(I did that as a demo for a reverse USB-BLE-UART adapter)

blissful pollen
#

Thanks. I noticed I couldn't create an UART service and then saw it wasn't implemented. Wasn't sure how much was done. Probably don't have time to play with it now anyways

thorny jay
minor plume
# jaunty juniper but it can send advertisements and connect to existing services

I will say this is one frustration Iโ€™ve had when starting projects - itโ€™s hard sometimes to figure out which boards will support all of the things I need for a given project. But short of building a web app that lets you pick the specific capabilities and bundle libraries you want to use and then tells you which boards support those features and have enough flash for the libraries, I donโ€™t know how youโ€™d solve it. And building/maintaining such a configurator app is a substantial undertaking.

thorny jay
#

Back the "caveats" (is that the name), the first thing would be to list the most common mistake/complain from people that buy a board to later discover what they want to do is not supported.

thorny jay
#

The badge idea, I suggested that to the support for sensor, to have an Arduino logo and/or a CircuitPython logo. Because I have a very few number of I2C sensor not supported yet, or not supported at acquistion time. But if I had listen carefully (and not forgotten) to Limor video, I would have know.

#

For the "WIO terminal"(?), I made the edit to the board to put a warning on the absence of Wifi support. But despite that, I had a friend that got it and was "sad" it was not there.

jaunty juniper
# minor plume I will say this is one frustration Iโ€™ve had when starting projects - itโ€™s hard s...

I have been thinking for a while of adding an automatic list of supported features per port to the matrix (or a new matrix) by parsing what modules are on each board for this port and then showing "all" "not supported" or "some", this could be added to the modules list already computed on every release and shown on cp.org
And I was thinking of adding a manual list of caveats/additional info to that, so that each module can be indicated as full or partial support (and "more info" on things like the alarm module limitations on pull ups vs down etc.)

thorny jay
#

So you have caveats per MCU: "On that chip we cannot do X (totally/partially/at all)."

tulip sleet
jaunty juniper
#

the problem being maintaining the manual part

thorny jay
#

Then you have caveat per "module" where a module is not 100% full on some platform. (BLE is there, but not X or Y).

minor plume
tulip sleet
#

we could parse for .. note or .. warning or some other stock thing in the rtd docs

minor plume
#

But maybe itโ€™s a case where imperfect information is still better than no information.

thorny jay
blissful pollen
jaunty juniper
tulip sleet
#

the rtd text would have a standard way of of listing the flagged ports and or boards, using the standard names. I don't think we have to specify what's missing in the circuitpython.org lists -- that will be in the doc when you link to it. Just flag that you should take note

#

because the actual restrictions can be complicated

thorny jay
# blissful pollen Maybe oversimplification but even looking for the Not Implemented exception bein...

Sometime the "Not Implemented" is missing like: https://github.com/adafruit/circuitpython/issues/6527 but if there is a Not Implemented in the module, I guess that is true.

GitHub

I can't get data through endpoint of usb host implementation Where is my mistake? this is my code: import usb_host import usb.core import sys import board import digitalio import microcontr...

orchid basinBOT
lone axle
#

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

turbid radish
#

@lone axle - are you working on the Newsletter PR?

turbid radish
#

thanks!

idle owl
#

@onyx hinge @tulip sleet Will you both be around tomorrow?

languid whale
tulip sleet
onyx hinge
#

@idle owl yes should be available most of the day

jaunty juniper
#

Scott alluded to having NimBLE people working on adding dynamic service start to it, I don't know if that's a thing that is happening ? ( @tulip sleet @onyx hinge do you know ?)

lone axle
# idle owl Pretty sure you can do RTD, but there's one step you might not be able to do. Pi...

I didn't get into this until a bit later than I had imagined. RTD Project is created: https://readthedocs.org/projects/adafruit-circuitpython-displayio-flipclock/ and I added adabot as a maintainer. From this guide: https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs it looks like the last step is the webhook which I don't seem to have access to settings page in order to set up, I must have been remembering one of my own community bundle repos for the ones I'd done before.

I think it's ready for the webhook setup. If there is anything else I need to do still let me know once you have a chance to get into it.

idle owl
lone axle
#

Neither here nor there, but if there are any other folks here who looked forward to the PyDev of the Week posts that get linked in the newsletter. There hasn't been a new one for a few weeks but author indicates on Twitter that the posts will be returning, perhaps next week. https://twitter.com/driscollis/status/1574498928019415040

@MakeMyAndroidAp Yes. I have enough of a lead now that I am starting them up again next week

I still need more though. The holidays are always hard to get through

main furnace
#

Is there a pure python wheel for Blinka? Big news for pyscript.

lone sandalBOT
upbeat olive
#

Is there any reason Circuit Python would not work with the SAME51J20A Curiosity Nano Evaluation Kit? I have not tried, but was thinking of purchasing the kit esp if it can do circuit python.

tulip sleet
tulip sleet
upbeat olive
main furnace
#

Not there yet.

Couldn't find a pure Python 3 wheel for 'adafruit-platformdetect>=3.13.0'.

clear halo
#

Hey folks, the September Melbourne MicroPython Meetup is on tomorrow evening (in Australia, 6:30pm AEST), I think some of you may like some of the content!

On the meetup page you'll find an agenda and links to the zoom stream, MicroPython discord and a site that displays the meetup time in your local timezone.

We will record and publish the sessions in case you can't make it. Hope to see you there!

https://www.meetup.com/MicroPython-Meetup/events/277024098

Meetup

Yes, that's right! We're returning to an in-person meetup for September!

If you'd prefer to connect remotely don't fear! We'll be streaming over Zoom and using the MicroPy

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
onyx hinge
#

that causes a bit of churn.. 228 files changed, 1411 insertions(+), 2027 deletions(-)

manic glacierBOT
#

I think this is a good idea, since it canonicalizes the documentation.

One thing I do not understand is the removal of blank lines. Are you running black on the entire extraction of //| lines in each .c file?

Here's a typical set of changes, where blank lines between the defs are removed. This is not what black would do if they were all in one file:
image

Running black manu...

idle owl
#

@tulip sleet @onyx hinge So, Grand Central pin names. Turns out most of the pins are the D-names first (which has me confused about a different thing, but that's... a different thing). There is a chunk that is not. I'd prefer them to match the silk as the primary pin. I guess I wanted your opinions on it. This is what is affected. ```>>> board.D14
board.TX3

board.TX3
board.TX3```

#

I think it's a total of 6 pins.

onyx hinge
#

@idle owl if it's more consistent, go for it

tulip sleet
#

agree - make it like the silk. The order was probably done long ago before we realized what the order should be.

idle owl
#

Krad. Thanks!

onyx hinge
#

@tulip sleet I run black on each individual snippet of //| code, then string the results back together, so black doesn't have its normal memory from block to block that lets it know to add a newline between two 'def's

#

But also .. black has a distinct style for .pyi files!! ```jepler@bert:~$ cat bloo.py
class K:
def enter(self):
...

def __enter__(self):
    ...

jepler@bert:~$ black --pyi - < bloo.py
class K:
def enter(self): ...
def enter(self): ...
reformatted -

All done! โœจ ๐Ÿฐ โœจ
1 file reformatted.
jepler@bert:~$ black - < bloo.py
class K:
def enter(self):
...

def __enter__(self):
    ...

All done! โœจ ๐Ÿฐ โœจ
1 file left unchanged.

#

it squishes things differently

tulip sleet
#

๐Ÿคฆ oy

#

so you can run black on a def inside a class definition and it indents properly??

#

I did see that it folded the ... onto the same line in a few cases. I didn't review all the files, but I reviewed about 50

onyx hinge
#

if the first line of the /|| region starts with whitespace, I add an if 1: to black's input, then take it off again

tulip sleet
#

nice hack

stuck elbow
#

by the way, is there a reason why we don't use pyi files?

#

seems like it would be a much better way of avoiding the annotations getting in the way than the import shenanigans

manic glacierBOT
#
  • Fixes #6892. Simplifies internal logic for writing out status bar and controlling the writing to display or console. Prevents partial status bar writes when serial is at first disconnected and then connects in the middle of a status bar write.

This isn't necessarily less code than before but it's easier to understand.

Tested on an ESP32-S2 TFT. Further testing welcomed if you feel so inclined.

onyx hinge
manic glacierBOT
tulip sleet
#

@timber mango so do you mean removing the annotations from the actual source and just doing them in a .pyi?

stuck elbow
#

or at least putting them in pyi files from now on for new code

tulip sleet
#

is that technique used by other projects to avoid adding annotations to source? I don't know of another use case besides ours

#

I know you are not fond of annotations

stuck elbow
#

mypy supports it

manic glacierBOT
#

I run each 'section' through black, so black has no section-to-section memory to draw on.

After Dan's earlier comment I revised the script so that it includes a blank "//|" at the end of each block of "//|". This reduces the churn somewhat, in raw lines of code.

Here are the differences to the generated stubs from this branch:

diff -rU1 circuitpython-stubs-old/audiomixer/__init__.pyi circuitpython-stubs-new/audiomixer/__init__.pyi
--- circuitpython-stubs-old/audiomixer/__init__.p...
stuck elbow
#

I think that jedi -- and thus also jetbrains editors -- supports it too

idle owl
#

@tulip sleet @onyx hinge PR is in.

stuck elbow
#

not sure what visual studio uses

#

but considering how many python devs work at microsoft now, I would expect it to do the right thing too

stuck elbow
tulip sleet
#

@onyx hinge I am still seeing removed blank lines in cases like this?

onyx hinge
#

@tulip sleet that removal is the "pyi style" mode of black. should I turn that off?

tulip sleet
tulip sleet
onyx hinge
#

@tulip sleet so, remove the "--pyi" flag?

tulip sleet
#

no, I mean I would try to do what is done normally. If we are producing .pyi files, then --pyi makes sense.

stuck elbow
tulip sleet
tulip sleet
onyx hinge
#
Black automatically formats *.pyi files in a package in addition to *.py files
Stub files mostly follow the same convention with a few changes, as follows:
    If the body of a function or class is just ..., don't put it on a separate line, but just put it after the :
    Don't put blank lines between methods or functions, or between classes with an empty body
    Only put one blank line between other classes.
    Potentially allow longer lines. Typeshed's coding conventions currently allow infinite-length lines, but I'm not sure we should keep doing that.
stuck elbow
tulip sleet
onyx hinge
#

If we don't want the pyi-style that's fine, turning it off might be a bit less churn-y

tulip sleet
#

we could run the generated .pyi files through black after they are generated, when we build the stubs

onyx hinge
#

We do ๐Ÿ™‚

#

I think?

manic glacierBOT
idle owl
#

@tulip sleet For the GC pins PR, you want each pin that has an alias to have space between it and other pins? Want to make sure I understand before heading down that path.

tulip sleet
idle owl
#

Got it. Will do.

tulip sleet
onyx hinge
#

I don't have a strong opinion either

tulip sleet
#

lol

#

I don't care about the churn; i am more interested about making it easy to write doc for a new module

manic glacierBOT
idle owl
#

Which direction I mean

tulip sleet
#

what do you mean by direction?

idle owl
#

Which choice. Maybe I misread, but it seemed like there were a couple of choices here to choose from.

onyx hinge
#

To black with or without --pyi? I do not have a strong opinion, except that the non-pyi style is closer to what we have today which means less re-learning

idle owl
#

Does running it with make it easier in the future though?

onyx hinge
#

but I have a feeling most people editing these docs will have changes that are caught by pre-commit. if they can run it locally then it's easy to apply the fixes..

#

it's like every other kind of 'black thing', it always just changes it for you .. if it's set up right

tulip sleet
tulip sleet
#

ok, let's go with --pyi, since they are .pyi files, at least in some sense

idle owl
#

๐ŸŽ‰ (I'll pretend I helped.)

onyx hinge
#

OK thank you for deciding!

tulip sleet
idle owl
#

Hah ok

onyx hinge
#

the whole goal here is to NOT have to spend 2 minutes changing whitespace like Dan requested I do on a PR ๐Ÿ˜“ so now, 5 hours later, ....! ๐ŸŽ‰

idle owl
#

That's how to use time!

manic glacierBOT
tulip sleet
#

@onyx hinge, ok now I am going to quibble about the trailing blank lines which you preserved ๐Ÿ™‚ If black --pyi would remove them, then let's remove them

onyx hinge
#

๐Ÿคฃ

tulip sleet
#

I think you can just roll back the last commit?

#

otherwise we are inventing our own style

idle owl
#

Anyone want to come solder this quad alphanumeric backpack for me?

tulip sleet
#

just make sure it is not upsdie down; I did that once

idle owl
#

I triple checked that ๐Ÿ˜„

#

There's writing on the front of the backpack, and they're supposed to be upright with that. Display decimals on the bottom.

#

There are also dots on the backpack, that you're supposed to line up with the decimals, but there's only two, and they're not actually lined up with the decimals. So... it kind of works?

#

So many pins though.

tulip sleet
#

i missed the decimal dots, yeah

idle owl
#

Also I have to clean off my work table to even get to my iron. ๐Ÿ˜‚

#

It never remains clear for long.

#

Mostly because I haven't organised anything in here, and so it's all shoved off camera so it looks really nice in here, but really it's a monstrous mess.

tulip sleet
#

sometimes there is a lot of stuff on the floor behind my chair, you can't see that, or on the sides of the desk on the floor

idle owl
#

Right? The off-cam areas of this room are pretty much jam packed with stuff. Not much more can be stashed.

#

OK I should really go deal with this. I'm close to having everything together for this guide update, but one of those things is actually testing the code. Can't do that without an assembled backpack. So here we are.

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.0-30-g14498f793 on 2022-09-04; Adafruit Feather ESP32S3 4MB Flash 2MB PSRAM with ESP32S3

Code/REPL

import  asyncio
from asyncio import Lock

async def task(i, lock):
    while 1:
        await lock.acquire()
        print("Acquired lock in task", i)
        await asyncio.sleep(0.5)
        lock.release()

async def main():
    lock = asyncio.Lock()  # The Lock instance
    for n in range(1,...
thorny jay
#

Something very strange with 7.3.3 on a QT Py M0: ```>>> import random

random.random()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 15, in print_repl_value
OverflowError: small int overflow
print(random.random())
0.411096```
Why does it OverflowError in the REPL??? What is that line number 15 in print_repl_value? So many questions... Does that deserve an issue?

stuck elbow
#

well, if you don't have bigint enabled...

idle owl
#

@proven garnet For your example that was added to the HT16K33 library, I see where you got the wonky licensing at the top of your example, but you should be using the SPDX format. Please update the existing SPDX to be you (not ladyada), leave it as MIT, and remove the "Author:" and "License:" lines. While you're at it, please change the example explanation comment to a docstring. Thank you!

#

Is there a way in CircuitPython to cycle through a series of characters and numbers without adding them all individually to something? Use case: 14-segment display backpack example, where it scrolls the alphabet, 0-9, and maybe some special characters. Arduino has a feature that does this, evidently. No idea if CP has anything.

#

@onyx hinge Is this ^^ a thing?

stuck elbow
idle owl
#

Um.... Maybe, but that's still typing them out individually.

#

This is what Arduino has: ``` for (uint8_t i='!'; i<='z'; i++) {
alpha4.writeDigitAscii(0, i);
alpha4.writeDigitAscii(1, i+1);
alpha4.writeDigitAscii(2, i+2);
alpha4.writeDigitAscii(3, i+3);
alpha4.writeDisplay();

delay(300);

}```

#

I was basically asking if this concept exists in CP.

stuck elbow
#

well, you can do that, but... it's ugly for c in (chr(i) for i in range(ord('!'), ord('z')+1)):

idle owl
#

Harder to read as a comprehension, I suppose.

stuck elbow
#

you have to explicitly convert between chars and ints, in C++ they are the same thing

idle owl
#

Ah fair enough.

#

@stuck elbow so... I tried to make it work, and it's displaying 1. only. I'm clearly missing something.

stuck elbow
#
>>> for c in (chr(i) for i in range(ord('!'), ord('z')+1)):
...   print(c)
... 
!
"
#
$
%
&
...
#

works for me

idle owl
#

huh.

#

Not in the display code, it works for me too.

#

This does not work. py for c in (chr(i) for i in range(ord('!'), ord('z')+1)): display.marquee(c)

stuck elbow
#

do you need to call show or something?

#

or sleep?

idle owl
#

Hmm. Checking.

#

Tried adding sleep, no change. Tried adding a delay using the parameter to the marquee line, no change.

#

There's no show type thing being called in the existing example.

stuck elbow
#

maybe you want display.marquee(''.join(chr(i) for i in range(ord('!'), ord('z')+1)))?

idle owl
#

Hey!

idle owl
#

Even uglier, but it works!

idle owl
#

@stuck elbow The chr and ord bits are built into CircuitPython through Python? i.e. should I be looking in the Python documentation for an explanation of what they are doing...

stuck elbow
#

they are builtins

idle owl
#

Oh. Thank you!

#

I didn't realise they were friends.

idle owl
#

โค๏ธ Thank you!

stuck elbow
#

sorry, wrong lang

idle owl
#

Oh! Wrong that way. I thought you meant wrong programming language, and I was deeply confused for a moment.

#

Yeah, I would have struggled a bit to sort it out in French.

stuck elbow
#

no idea why the search engine gave me links in French

idle owl
#

Hmm. marquee seems to be a permanent loop. So you can't use it twice, apparently?

#

I guess I could use print and scroll together for the first one. The first one is a string.

#

That failed.

#

In a few ways. Sigh.

#

Code in play here: py display.print("Hello, world!") for count in range(7): display.scroll(count) time.sleep(0.2)

#

First, no matter what I provide to scroll, it results in this: code.py output: Traceback (most recent call last): File "code.py", line 27, in <module> File "adafruit_ht16k33/segments.py", line 220, in scroll File "adafruit_ht16k33/ht16k33.py", line 164, in _get_buffer IndexError: bytearray index out of range

#

Second, there appears to be no way to slow down the scroll, it jumps directly to rld!.

#

To clarify, line 27 is display.scroll(count) right now.

#

I tried it as py display.print("Hello, world!") display.scroll(various-values-here)

#

Same results both in the code failure and the display results.

#

It feels like scroll should have a delay parameter. Unless it's designed to jump to a different location.

#

Oh, hah. marquee has a loop param that takes a boolean, and if set to False, does not loop indefinitely. Which means I can do it twice.

#

Still want to know how scroll is supposed to work. ๐Ÿ˜•

gilded cradle
#

@idle owl for marquee, you can pass optional parameters to not have it do a permanent loop.

gilded cradle
#

Let me take a look at scroll. I can't remember what that did...

idle owl
#

Thank you!

gilded cradle
#

@idle owl maybe you wanted something more like this:

display.print("Hello, world!")
for count in range(7):
    display.scroll()
    time.sleep(0.2)
idle owl
#

But... it's still jumping right to the end.

#

Oh. Let me try that.

gilded cradle
#

you don't even need the 1 in it

#

ok

idle owl
#

Still w/o the 1, jumps to the end.

gilded cradle
idle owl
#

Oh so there IS a show()!

gilded cradle
#

yeah

idle owl
#

Does auto_write need to be off for marquee to work properly?

#

Oof, adding show into that for loop made it display weirdness.

gilded cradle
#

I'm not sure. It might handle that automatically.

idle owl
#

It's still not working how I picture it should. Instead it jumps to the end, then posts a bunch of ! before moving onto the marquee.

gilded cradle
#

It might be a bug.

#

What are you trying to get it to do?

idle owl
#

Basically what marquee does. But maybe print and scroll aren't meant to work that way?

#

I want it to print Hello, world!, and then, scroll to the end of the phrase.

#

Thought it would be nice to show other features too.

gilded cradle
#

Ah, yeah. It never worked super well, which one of the reasons I wrote marquee

idle owl
#

Ahhh.

#

Ok.

#

Then not worth including anyway. ๐Ÿ˜„

gilded cradle
#

๐Ÿ™‚

idle owl
#

Thanks for looking into this with me!

gilded cradle
#

No worries

idle owl
#

OK, this example is good.

gilded cradle
#

@idle owl a quick hack might be to add a bunch of spaces at the end of the string

idle owl
#

Eh, I don't want to point folks towards something that doesn't play nice.

gilded cradle
#

Ok, cool

idle owl
#

Showing how to create two marquees together, with the first one not looping is a good one to show.

gilded cradle
#

Yeah

idle owl
#

Let me ask you another thing.

gilded cradle
#

My main claims to fame with the segments part of that library are the marquee and adding multiple display chaining

#

sure

idle owl
#

This snippet writes 0 0 0 0 on each of the segments. py display.set_digit_raw(0, 0x2D3F) time.sleep(0.2) display.set_digit_raw(1, 0b0010110100111111) time.sleep(0.2) display.set_digit_raw(2, (0b00101101, 0b00111111)) time.sleep(0.2) display.set_digit_raw(3, [0x2D, 0x3F]) time.sleep(0.2)

#

Why are they written in such different ways?

gilded cradle
#

Oh and I added the set_digit_raw()

idle owl
#

How is that all doing the same thing.

gilded cradle
#

It's to show different ways to use the function, but you don't need to have that.

gilded cradle
idle owl
#

Hmm.

#

How, then, would I simply set it to display 0 four times?

gilded cradle
#

Maybe it needs some comments added to make that clearer

idle owl
#

That property is confusing to me.

#

The set_digit_raw because I'm no good at binary or hex.

gilded cradle
#

That's why I have a diagram in the guide

idle owl
#

Oh, fair enough. That makes sense

#

I got more confused when I saw this code using it. Because each of those results in the same thing. ๐Ÿ˜•

gilded cradle
#

Hehe, I forgot about that

#

I think it was to show 4 different ways to do the same thing

idle owl
#

Ahh. Fair enough.

#

Oh, I guess I see the pattern now.

gilded cradle
#

๐Ÿ™‚

idle owl
#

How would you comment it?

#

Best I can do is "This is four ways to display 0. It displays on each of the four digits" or some such.

gilded cradle
#

In order: 16-bit Hexadecimal number, 16-bit Binary number, 8-bit Binary Tuple, 8-bit Hexadecimal List

idle owl
#

Oooooh.

#

OK, thank you.

gilded cradle
#

Hold on, I'm editing...

idle owl
#

Ah ok

gilded cradle
#

There

#

I had 3rd and 4th reversed

idle owl
#

Ah. I never would have noticed! ๐Ÿ˜„

#

@gilded cradle Thank you so much for your help with this. I'll add the comments to this new example, and I'll go back and include them in the simpletest example as well. Already making changes in the repo, easy to make more.

gilded cradle
#

Cool. You're totally welcome.

idle owl
#

Oh, two quick things. I'll tag you on the eventual PR. And Limor wants you to QA this guide update before she does. I'll ping you when I'm ready for that.

gilded cradle
#

Ok, sounds good.

idle owl
#

Thanks again!

gilded cradle
idle owl
onyx hinge
#

@stuck elbow Optional static typing has at least two purposes. One is showing the contract that you, as a library, propose to the library's user. The other is in type checking all or substantial parts of a whole program to "prove" (term used loosely) that type errors will not occur at runtime. I think separate ".pyi" stubs only do the first of those two things.

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.0 on 2022-08-18; Adafruit QT Py ESP32-S3 no psram with ESP32S3
Adafruit CircuitPython 8.0.0-beta.0 on 2022-08-18; S2Mini with ESP32S2-S2FN4R2
Adafruit CircuitPython 7.3.3 on 2022-08-29; S2Mini with ESP32S2-S2FN4R2
Adafruit CircuitPython 7.3.0-rc.1 on 2022-05-18; Adafruit QT Py ESP32-S3 no psram with ESP32S3

Code/REPL

import time
import wifi
import ipaddress
from secrets import secrets
ip_to_ping...
manic glacierBOT
manic glacierBOT
lone sandalBOT
manic glacierBOT
#

Ran into this issue recently and saw it on both 7.3.3 and 8.0.0.beta0 on both ESP32-S2 and ESP32-S3.
Specifically the versions and hardware were:

Adafruit CircuitPython 8.0.0-beta.0 on 2022-08-18; Adafruit QT Py ESP32-S3 no psram with ESP32S3
Adafruit CircuitPython 8.0.0-beta.0 on 2022-08-18; S2Mini with ESP32S2-S2FN4R2
Adafruit CircuitPython 7.3.3 on 2022-08-29; S2Mini with ESP32S2-S2FN4R2
Adafruit CircuitPython 7.3.0-rc.1 on 2022-05-18; Adafruit QT Py ESP32-S3 no psram with ESP32S3
...

#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.0-67-gd44edc4a0 on 2022-09-25; FeatherS3 with ESP32S3
Board ID:unexpectedmaker_feathers3
# Hard faulting board, connected via USB

Adafruit CircuitPython 8.0.0-beta.0-72-ga7b10d41b on 2022-09-26; Adafruit Feather ESP32S2 with ESP32S2
Board ID:adafruit_feather_esp32s2
# Attempting to work with this board on different project

Code/REPL

[Contents of my Feather S3](https://github.com/DJDevon3/My_Circ...
manic glacierBOT
stuck elbow
lone sandalBOT
manic glacierBOT
#

#6952 should fix this, on boards that have native USB. The status bar is not written out at all if, when the write starts, the serial connection is not available.

On boards that have an on-board serial-to-USB converter chip, the USB status pins on that chip may not be connected to anything, which is often the case. In that case, there is no way to know if the host is connected via USB, so there may still be situations where the first part of the status-bar write is missed, and the rest app...

manic glacierBOT
manic glacierBOT
#

Result of overnight ping DNS & ping test:

 55864 Resolved google as 142.250.191.206
 55864 Ping google.com [142.250.191.206]: 47 ms
 55865 Resolved google as 142.250.191.206
 55865 Ping google.com [142.250.191.206]: 40 ms
 55866 Resolved google as 142.250.191.206
 55866 No response
 55867 Resolved google as 142.250.191.206
[...]
 55901 Resolved google as 142.250.191.206
 55901 No response
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "do_dns...
tulip sleet
#

@onyx hinge I am going out for a daily walk, but considering 8.0.0-beta.1, would you want to merge any part of the picow work in? Advantage is more testers, disadvantage is more testers ๐Ÿ™‚

onyx hinge
#

@tulip sleet mostly the state of it seems to be "it works fine for awhile, then it stops working". You can do useful stuff with it if you do the "reset when socket stops working right" dance, which is pretty much inevitable for socket code in CP anyway. I wish I would have time to rebase out all the commits that say "WIP" and might not even compile ๐Ÿ˜ but it probably won't happen

tulip sleet
onyx hinge
#

I should review that ๐Ÿ˜• not enough hours in the day

tulip sleet
#

I think a simple squashing in rebase -i would be quick and safe

#

I know -- if you are on a roll, take your time. could wait for a few days

#

those are two things I think would be nice for beta.1 ; there's nothing else I see that is knocking at the door urgently

onyx hinge
#

OK. I just figured out one big "it stops working" cause so that's grand

#

now the ntp test goes for >500 iterations instead of stopping after 8

crimson ferry
#

is that related to the thing where internet stops working if you don't do it often enough?

#

I ping once a minute so that the once-an-hour http works

manic glacierBOT
#

I rebased this to have a prettier history (intermediate commits may still not build, I didn't test this). The original history is preserved as https://github.com/jepler/circuitpython/compare/picow-v1?expand=1

I fixed a bug which caused open sockets to not be correctly tracked. As a consequence, things would stop working after 8 sockets had been opened, until reboot.

Tests performed:

  • dns & ping test (>50000 iterations)
  • ntp test (>500 iterations)
  • http test (>800 iterations)
    ...
onyx hinge
#

@crimson ferry no, it would not help with that.

#

@crimson ferry can you do me a favor and see if that problem reproduces in micropython?

crimson ferry
#

yeah, I have one set up, haven't done much uP but will give it a shot

onyx hinge
#

that'd be quite helpful, thanks

manic glacierBOT
onyx hinge
#

@tulip sleet should I merge that or do you want some actual testing done too? I don't know what to do to trigger the problems that were being reported in #6892 (I feel like there's a terminology problem or I'm mis-interpreting what I'm reading)

#

well, I'll let you decide now that it's reviewed

manic glacierBOT
idle owl
#

@tulip sleet Does it seem right to say that M0 boards don't have the adafruit_bus_device module included? I almost forgot to check this and would have not included it as a necessary lib in the guide. Or, looking at the dynamic screenshots, it's on there, so I probably would have remembered.

#

It would be nice to be able to filter the support matrix by boards that don't have a particular module.

#

No idea how to implement that. But it would be convenient.

tulip sleet
idle owl
tulip sleet
idle owl
#

Ok, I'll open an issue, thanks for the suggestion.

#

@jaunty juniper Is this something you'd be interested in doing?

#

I'm filing an issue, and could assign it to you if you're interested. But I don't want to do that if you're not so much.

jaunty juniper
#

it's implemented, just add - in front

idle owl
#

Oh seriously?

jaunty juniper
#

I didn't document it because I don't know where to

idle owl
#

Oh snap.

#

Thank you!

jaunty juniper
#

I planned to come back to it but...

idle owl
#

Issue filing aborted.

#

Thanks for letting me know!

jaunty juniper
#

it also doesn't filter the regexp, since modules only contains letters and _, so you can put a RE

tulip sleet
#

I would say add another paragraph at the first arrow, or mention "-" in the gray text in the box

idle owl
#

Paragraph seems better to me.

#

Wow I am inordinately excited that I know this feature now.

jaunty juniper
#

that's my favorite kind of feature request

idle owl
#

Entirely!

#

I'm glad you replied before I filed the issue ๐Ÿ˜„

tulip sleet
#

thanks for including that -- I will use it!

idle owl
#

apt-get always requires sudo?

manic glacierBOT
tulip sleet
jaunty juniper
#

@idle owl there is only one Adafruit ESP32-S3 Feather guide right ? It should be updated to mention the 2 different models, I'll leave feedback to mention that, but I am not missing a "ESP32-S3 Feather with PSRAM" guide ? (the issue discovered in #help-with-circuitpython is that it links to the CP.org page of the nopsram version only)

idle owl
idle owl
#

I saw that go by in the other channel.

jaunty juniper
#

ugh I clicked on a sub link in the page and I think I left the feedback on the wrong guide ๐Ÿ˜…

idle owl
#

Ooops.

#

Best kind of feedback, though; feedback we can simply delete. ๐Ÿ˜„

stuck elbow
#

I thought the best kind of feedback is when people thank you.

idle owl
#

General feedback, yes.

jaunty juniper
#

close second

idle owl
#

But guide feedback is a whole other beast.

thorny dove
#

Question about CPY core module i2cslave. In the list of core modules in https://circuitpython-jake.readthedocs.io/en/latest/docs/index.html is listed 'i2cslave'. However in the flashed version of CPY: 'Adafruit CircuitPython 8.0.0-beta.0-49-g14fc4a079 on 2022-09-14; Adafruit PyPortal Titano with samd51j20' there is no module i2cslave, but there are i2cperipheral and i2ctarget, both with the same named attributes. Someone can elaborate me on this?

manic glacierBOT
thorny dove
#

@onyx hinge thanks to the BOT showing here activity of you. I opened this: https://github.com/adafruit/circuitpython/pull/6933#pullrequestreview-1124233781 and I learned something from your code, especially the 'Test script do_dns_ping.py. I had some code for ping'ing that never worked, however I implemented that part of your example mentioned (especially ```
info = pool.getaddrinfo("google.com", 80)
addr = info[0][4][0]
print(f"Resolved google as {addr}")
ipv4 = ipaddress.ip_address(addr)

GitHub

Also supported:

board.LED can be used with DigitalInOut and works

Not (yet) supported:

Various getters and setters of wifi.radio
listen, bind, accept are not implemented (no servers)

Also these...