#circuitpython-dev

1 messages · Page 65 of 1

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.3(git tag), custom build for a RP2040 board

Code/REPL

import board
import sdcardio

bus = board.SPI()
# Run this, but do not connect the SD card's power
sd = sdcardio.SDCard(bus, board.SD_CS)

Behavior

No output, just stuck, for around 3 minutes

Description

No output, just stuck, for around 3 minutes. I think I found the cause, read more below. But I don't know how to improve it.

Add...

manic glacierBOT
#

Hello everyone.

I'm trying to bring the WM8988 audio codec to life on my own development board.
It's a bit old, but there's still a lot of it around.
My main goal is to get some sound out of it. Now that I've tinkered with the I2C registers, I've got some clicking noises on reboot - I'm definitely on the right track.

But! I noticed that the WM8988 codec should be driven by the main clock, which should be around 12 mHz. Nice, I thought it would be easy to get this, as I saw this clock ...

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.0-beta.0-52-g6c1e34e957 on 2024-02-17; M5Stack Timer Camera X with ESP32

Code/REPL

Adafruit CircuitPython 9.0.0-beta.0-52-g6c1e34e957 on 2024-02-17; M5Stack Timer Camera X with ESP32
>>> import wifi
>>> wifi.radio.connected
False
>>> wifi.radio.connect("Lunchbox", "loli hentai")
>>> wifi.radio.connected
True
>>> # I pressed Ctrl + D here.
soft reboot

Auto-reload is off.
Running in safe mode! Not r...
manic glacierBOT
manic glacierBOT
#

Here's my current workaound

diff --git a/shared-module/sdcardio/SDCard.c b/shared-module/sdcardio/SDCard.c
index 20c5afef0e..fc886964de 100644
--- a/shared-module/sdcardio/SDCard.c
+++ b/shared-module/sdcardio/SDCard.c
@@ -210,18 +210,26 @@ STATIC mp_rom_error_text_t init_card_v1(sdcardio_sdcard_obj_t *self) {
     return MP_ERROR_TEXT("timeout waiting for v1 card");
 }
 
+#define INIT_CARD_V2_ERROR_RETRY 5
 STATIC mp_rom_error_text_t init_card_v2(sdcardio_sdcard_obj_t *s...
orchid basinBOT
orchid basinBOT
#

Looks like the second language drop down doesn't get set if the web installer button isn't found in the first firmware box:
image

download.js:49 Uncaught TypeError: Cannot read properties of null (reading 'setAttribute')
    at download.js:49:50
    at Array.forEach (<anonymous>)
    at updateFileLinks (download.js:46:9)
    at findAndSetLocale (download.js:63:11)
    at downloa...
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.1.0-beta.0 on 2024-03-28; Adafruit Feather ESP32-S2 Reverse TFT with ESP32S2
Adafruit CircuitPython 9.1.0-beta.0 on 2024-03-28; FeatherS2 Neo with ESP32S2

Code/REPL

#

Behavior

boot_out.txt file contains 8 unexpected characters betweeen the newline after the UID and the start of "boot.py output". The characters (in hex) are: 1b 5b 32 4b 1b 5b 30 47.

Description

May be reproduced with no code.py...

manic glacierBOT
tepid trail
#

I am trying to get the neopixel library running on a raspberry pi 5. Has anyone got it to work?

random junco
tepid trail
onyx hinge
#

This is probably the best spot to discuss development of Blinka, which provides the low level hardware routines on SBCs. I don't know anything about this topic in particular, but there's an existing issue in which the primary Blinka dev acknowledges that the functionality doesn't exist right yet: https://github.com/adafruit/Adafruit_Blinka/issues/747

"RuntimeError: ws2811_init failed with code -3 (Hardware revision is not supported)"

GitHub

Board Name Raspberry Pi 5 Steps Output of example from here- https://learn.adafruit.com/neopixels-on-raspberry-pi/python-usage: File "/root/test.py", line 64, in pixels.show() File "...

manic glacierBOT
manic glacierBOT
#
    mp_hal_stdout_tx_str(line_clear);
    mp_hal_stdout_tx_str(_current_executing_filename);
    serial_write_compressed(MP_ERROR_TEXT(" output:\n"));

The "line clear" code is written by this line in main.c. It was added by @bill88t in 722d8ffca51835b26ae4a032fb5d4795faae974e for https://github.com/adafruit/circuitpython/pull/8725 and this code applies to running both boot.py and code.py. You can check that PR for more background about why it was added; It might be possible to u...

manic glacierBOT
#

Fixes #9180.

This is the only function that doesn't get captured into boot_out.txt.
I confirmed the line clear still occurs by adding some junk text.

Serial console setup
amogusAdafruit CircuitPython 9.1.0-beta.0-26-gc978768d37-dirty on 2024-04-15; M5Stack Timer Camera X with ESP32
Board ID:m5stack_timer_camera_x
UID:806BF178DD44
amogusboot.py output:
Early boot log:

The rest of the line clears are outside of what boot_out.txt captures and I opted to keep the existi...

slender iron
#

Thanks for the example. That enumerates all of the combinations but doesn't really show me how it'd integrate into things. The nice thing about a bunch of classes is that it can be documented

midnight ember
manic glacierBOT
manic glacierBOT
#

Hi, this patch doesn't solve the issue that under certain circumstances(or corner case) all call to cmd are timed out, leading to a maximum delay of 200 * 3 * 300 ms = 180,000 ms = 180 seconds.

The last parameter of cmd is a flag to indicate if it should wait using wait_for_ready, whose timeout is defined by READY_TIMEOUT_NS(300ms in the comment).

manic glacierBOT
#

This is really an obscure piece of hardware. Instead of directly attaching the SPI-interface to the ILI9488, they put 4 logic ICs in between that translate from SPI to 16-bit parallel.

The data is clocked out to the chip

  • on a rising edge of CS
  • every 16 bit

Commands and command-parameters are 8-bit, so it is necessary to either toggle CS after each command/command-parameter or send commands and command-parameters with an additional 0x00 fill-byte. Normal display data is 16-bit, s...

manic glacierBOT
fringe yarrow
#

I got a new ESP32 board in the mail.. It feels wrong that I didn't have to make a new Circuit Python board for it.

candid sun
manic glacierBOT
#

That is exactly what I think. So I just document what I have done and close this issue:

diff --git a/shared-module/displayio/bus_core.c b/shared-module/displayio/bus_core.c
index 301606c1f3..0b434ccd05 100644
--- a/shared-module/displayio/bus_core.c
+++ b/shared-module/displayio/bus_core.c
@@ -145,12 +145,12 @@ void displayio_display_bus_set_region_to_update(displayio_display_bus_t *self, d
 
     // Set column.
     displayio_display_bus_begin_transaction(self);
-    uint8_t ...
onyx hinge
#

@candid sun I'm happy to grab the "core" section if you like

candid sun
#

@onyx hinge thank you!

onyx hinge
turbid radish
#

😁

#

Glad to provide to the community

midnight ember
#

bme280 is temp/humidity/baro sensor

#

it's my fav sensor

#

oh the 680 nvm. it's slightly different but in the same family of temp senosrs

#

mp3's with the s3? 👀 YES PLZ!

#

the bear and erins never ending story are awesome projects. will be cool to see it working with bookworm.

lone axle
#

I think it could be supported in adafruit_imageload library. But the specifics of the implementation are over my head too.

manic glacierBOT
turbid radish
#

Thanks Liz!

onyx hinge
#

thanks liz

gilded cradle
#

Thanks

wraith crow
#

Thanks

lone axle
#

Thanks for hosting Liz. Hope everyone has a great week!

midnight ember
#

Thank you Liz for hosting. Looking forward to the CP version of the S3 BLE guide, someday. 🙂

gusty siren
candid sun
#

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/15BPPqHPszkw6a2gGAYxj4CmFXQuhpvArvodMLLIJVJ0/edit?usp=sharing

manic glacierBOT
#

In the next step I reduced the code to publish a random message to the MQTT broker and enter deep sleep for 1 second. Complete code is attached. It has been running for days on end (with the power bank attached to the battery charger). I have almost run out of ideas on what to try next. I am now seriously considering returning back to CP 8. Again, if someone can produce a CP 9 debug build that will capture the state of the RTOS when it hits the internal watchdog timer, I will run it and captu...

manic glacierBOT
#

Also, I keep wondering whether the operating system could simply reset itself upon encountering the internal watchdog timeout, like many conventional OSes do.

I have just discovered safemode.py and https://gist.github.com/anecdata/fe35dc6a94069fc920edf61a64750b53 which looks very useful (thanks @anecdata !). While it seems it will suffice to workaround my problem, it would be nice to have the means to find the root cause. Could CP possibly extract even more information (register dumps,...

manic glacierBOT
manic glacierBOT
#

Yeah, I noticed that too. I can't quite work out what's wrong.

How cool would it be if I could generate main_clock and use the synthio functionality on the rp2040 on my 4 channel board! For example, my board has 4 inputs! I want to try and implement a reverb or delay.

The main problem is that it's never been done before - that's my hypothesis. Maybe we can have a look at the source code and I can try to recompile it?

cunning sundial
#

Made this with CircuitPython and the Circuit Playground Express. Nice having sensors/LEDs built-in: https://www.youtube.com/watch?v=00ZI6rT8ne8

Sound-reactive cyberpunk style guitar strap with "Arduino" and leftover PCBs
Simplified version on JCo Audio: https://www.youtube.com/watch?v=qI9JWv_ScBo
Sponsored by PCBWay: https://www.pcbway.com/

ToC
0:00 Intro
1:11 PCBs repurposed for strap
1:41 3D-printed mount for Circuit Playground Express and battery
3:12 Soldering WS2112B LED PCBs toge...

▶ Play video
orchid basinBOT
tulip sleet
fringe yarrow
#

Is there something wrong with the PR process at the moment? My last PR failed on the docs runner with errors that have nothing to do with anything involved with my PR.

#
Processing ./circuitpython-stubs/dist/circuitpython-stubs-*.tar.gz
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/home/runner/work/circuitpython/circuitpython/circuitpython-stubs/dist/circuitpython-stubs-*.tar.gz'```
tulip sleet
#

anyway, don't worry about it right now

#

or maybe it now changes a - to an _ but it didn't before. It's a bit confusing

tulip sleet
#

@slender iron @onyx hinge I am fixing the doc build issue, per above. It broke the docs build for the 9.0.4 release, but not a big deal

onyx hinge
#

ah that makes some degree of sense. the "punctuation folding" where "-" and "_" are sometimes interchangeable in package names is 😕

#

thank you !

manic glacierBOT
manic glacierBOT
manic glacierBOT
lone sandalBOT
manic glacierBOT
#

Now there is a readthedocs build failure 😕 . Example: https://readthedocs.org/projects/circuitpython/builds/24089178/ . It's not clear to me what the failure is on the RTD side.

In successful vs the failed run, it's sphinx 7.2.6 vs 7.3.1. The latter gives this error in the log:

pickling environment... WARNING: cannot cache unpickable configuration value: 'autoapi_prepare_jinja_env'

autoapi_prepare_jinja_env() is a short function in circuitpython/conf.py.

tulip sleet
#

@short tendon I thought you had a written an Adafruit Playground note about ConnectionManager but I cannot find it

fringe yarrow
#

How goes the battle on that Doc runner, @tulip sleet ? Seems like you've been fighting it a while now 🙂

tulip sleet
#

This makes the release number really obvious

lone axle
#

Yes I'll go back to doing that. I was in that habbit for a while but have slipped out of it.

tulip sleet
#

I wish the release tag was in the right sidebar, but it is not

onyx hinge
#

@short tendon I was looking at the requests examples, specifically simpletest for wiznet. I think you were working in here recently due to connection manager. Anyway, is there a reason (besides inertia) to keep the style of response = requests....; ...; response.close() (which I would tend to view as error-prone, especially in the face of exceptions) vs the implicit close of: with requests...() as response: ... way? Not suggesting you need to change it, just wondered if you knew a reason it is like it is.

manic glacierBOT
manic glacierBOT
#

@anecdata @michalpokusa @justmobilize I've updated this branch and marked it out of draft mode. I've re-tested only on a W5500-EVB-Pico, not on any wifi micros. Any testing you care to perform would be helpful!

Based on internal discussions, this is the only board that doesn't already have SSL where we'll enable it, but where it's enabled, the core code will support the ability to wrap any socket-like object.

The situation with Pico W + W5500 is not expected to have changed (MemoryErr...

fringe yarrow
tulip sleet
manic glacierBOT
tiny peak
#

@slender iron I just committed a couple more prebuilt DFU files to my ocfpga repo that I built from orangecrab-examples/verilog/blink and orangecrab-examples/verilog/pwm_rainbow. I flashed them over JTAG, but I think they should work with dfu-util. There's also a Makefile I wrote to download and build yosys 0.40, nextpnr 0.7, and libtrellis 1.4 tools from source. I guess now I'm about to the point where it might make sense to try building a SoC.

manic glacierBOT
#

Config:
Adafruit CircuitPython 9.1.0-beta.0-27-g4ede914d45 on 2024-04-17; Adafruit QT Py ESP32-S3 no psram with ESP32S3
WIZnet "BFF" (WIZ850io W5500 module)
Adafruit_CircuitPython_Wiznet5k from PR#157 Core compatible constants & setsockopt
Adafruit_CircuitPython_HTTPServer from Draft PR#88 HTTPS implementation

WIZnet SSL client runs fine:

code...

import time
import board
import busio
import digitalio
import ssl
f...
short tendon
manic glacierBOT
manic glacierBOT
manic glacierBOT
lone axle
# short tendon Most of these I just made small updates. I think these could all be updated to u...

I don't have a definite answer to why, but I did get curious and look back through the history of the commits. It looks to me like originally both text() and json() used content property internally and inside of content() it had the call to close(). So originally they both did get closed. But in pr #31 that call to close() was taken out of content() https://github.com/adafruit/Adafruit_CircuitPython_Requests/pull/31 when the library was updated to re-use sockets more. In that same change the close() was added inside of json() but not text()

As long as removing that close() in the current json() doesn't cause any trouble (and I don't know of any reason it would) I'm in favor of removing it to get closer to parity with CPython requests.

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Available pins:

CLOCK/SCK
DATA/MOSI
D6/MISO           # D6 (PA06) on 3-pin JST SH
NEOPIXEL          # on-board NeoPixel
VOLTAGE_MONITOR   # 10K-10K voltage divider

board.SPI() is also available, using SCK, MOSI, and MISO.

Available modules:

>>> help("modules")
__future__        busio             neopixel_write    struct
__main__          collections       nvm               supervisor
adafruit_dotstar  digitalio         os                sys
adafruit_pixelb...
manic glacierBOT
manic glacierBOT
#

Pins:

>>> dir(board)
['__name__', 'NEOPIXEL', 'RING_1', 'RING_1_SWITCH', 'RING_2', 'SLEEVE', 'TIP', 'TIP_SWITCH', 'board_id']

Modules:

__future__        adafruit_hid/mouse                  math              storage
__main__          analogio          microcontroller   struct
adafruit_hid/__init__               array             micropython       supervisor
adafruit_hid/consumer_control       board             neopixel          sys
adafruit_hid/consumer_control_code  bui...
manic glacierBOT
manic glacierBOT
tulip sleet
onyx hinge
#

looking @tulip sleet

tulip sleet
#

I will start on a 9.1.0-beta.1 after these are merged

tulip sleet
#

@onyx hinge tnx!

crimson ferry
#

there are no UF2s for pre-CP8 anywhere, right?

#

could we consider retaining the last version of each major version number? (good for regression testing)

crimson ferry
#

3.0 lol

#

that was before my time

#

I have to go see if I still have 7.x.x installed on some board

short tendon
manic glacierBOT
manic glacierBOT
slender iron
#

Nice @tiny peak ! Will have to look next week

#

@vital matrix I started a port for renode was talking to the renode folks this week

tulip sleet
#

@stuck elbow ^^

orchid basinBOT
manic glacierBOT
#
[adafruit/circuitpython] New tag created: 9.1.0-beta.1
orchid basinBOT
tulip sleet
manic glacierBOT
lone axle
# short tendon I wonder if it would. I can imagine a bunch of non-ideal code out there where cl...

If we go through the libraries and update any that use json() to either call close explicitly or use the context manager would that mitigate most of the possible risk?

Anything remaining would be specifically user code outside of libraries that uses json() without the manager or call to close(). The solution for it there is the same, to either use the context manager or call close() which will make the code more closely compatible with CPython anyhow so that is a good change to make if I am understanding everything correctly.

manic glacierBOT
manic glacierBOT
manic glacierBOT
#
  • Fixes #8890.

On some Espressif chips (noticed on ESP32-S3 and ESP32-C3, not ESP32-S2, did not test others), a strayjunk byte of some number of consecutive 1's may appear as the first byte in the input buffer. Easy fix is to wait at least one byte time and then clear the input buffer.

Test program:

import busio
import board

for baudrate in (110, 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400, 468000, 921600):
    u = busio.UART(board.TX, board.RX, b...
short tendon
short tendon
#

@lone axle should I add that change with the use of with in the examples?

#

Or keep it separate?

lone axle
short tendon
#

Perfect

midnight ember
short tendon
midnight ember
short tendon
#

Hopefully we'll switch to ruff soon...

midnight ember
#

rust or ruff?

short tendon
#

fixed

manic glacierBOT
#

While the ESP-S3-GEEK and RP2040-GEEK boards are both currently using the Espressif pin naming convention (IOxx), @bablokb pointed out to me that the devices themselves have the pin labels printed on them and they are using the Raspberry Pi RP2040 pin naming convention (GPxx). This PR will update CircuitPython so the pin names match what is printed on the devices.

Only the RP2040-GEEK has been ported to the 9.0.x branch, so I'll submit a second PR to update that branch. @dhalbert Let me kn...

wraith crow
#

@alpine rapids 👆

manic glacierBOT
orchid basinBOT
manic glacierBOT
manic glacierBOT
#

tested

import time
import board
import keypad
import digitalio
import usb_hid
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS
from adafruit_hid.keycode import Keycode
import neopixel

pixel = neopixel.NeoPixel(board.NEOPIXEL, 1, brightness=0.4)

sleeve = digitalio.DigitalInOut(board.SLEEVE)
sleeve.switch_to_output(False)
ring = digitalio.DigitalInOut(board.RING_1)
ring.switch_to_output(False)

keys = keypad.Keys(...
manic glacierBOT
short tendon
manic glacierBOT
midnight ember
manic glacierBOT
#

I'm wondering how hard it would be to add support for the name property to FileIO (or wherever is appropriate for use with the built-in open())

Currently In CPython:

Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> f = open("something.txt", "wb")
>>> f.name
'something.txt'

Currently In CircuitPython:

Adafruit CircuitPython 9.1.0-beta.1-2-g87a400aa1d on 2024-04-21; Adaf...
short tendon
#

Sharing so people have the opportunity to think about it

manic glacierBOT
#

I agree. If we need a rotary knob we can use the stemma board, make a
custom build or use Arduino

Bill Binko
@.***

"Helping Makers Help Others"
Join us at http://atmakers.org

On Sat, Apr 20, 2024 at 3:14 PM ladyada @.***> wrote:

id remove rotaryio, i dont think we need it, and add busio instead


Reply to this email directly, view it on GitHub
https://github.com/adafruit/circuitpython/pull/9190#issuecomment-2067759676,
or unsubscribe
<https:/...

manic glacierBOT
#

@ATMakersBill @ladyada
I added busio.I2C and appropriate board. names for the STEMMA/QT connector.

These choices are currently made:

  • keypad
    • simple Keys is on.
    • Matrices are off.
    • ShiftRegisterKeys is on. @ATMakersBill: ShiftRegisterKeys is for things like SNES controllers that use a shift register to handle many buttons. Is this a potential use case for you?
  • rotaryio is OFF
  • touchio is ON
    • @ladyada is touch practical with a TRRS jack?
    • @...
manic glacierBOT
#

I agree on the many buttons: Chris uses “chording” to increase his
effective buttons and we’d use this.

I think touch might work if we used only one pin (tip probably) and left
the rest floating? I doubt a trrs cable could carry multiple touch signals
(right?). If it does work it would be very helpful. Also, using the “ring”
tab on top of the jack as a touch signal to change modes (with no plug in
jack) might be handy.

On neopixel can we leave it unfrozen (to keep touchio if it wo...

#

One more thought. We have HID mouse and keyboard… can we add gamepad or
does it have a C component? Also we’d want to use the custom HID profile
to enable only one gamepad (without mouse and keyboard) so it can work on
XAC

Bill Binko
@.***

"Helping Makers Help Others"
Join us at http://atmakers.org

On Sun, Apr 21, 2024 at 5:12 PM Bill Binko @.***> wrote:

I agree on the many buttons: Chris uses “chording” to increase his
effective buttons and we’d use this....

manic glacierBOT
#

I agree on the many buttons: Chris uses “chording” to increase his effective buttons and we’d use this.

Does Chris use a shift-register in some controller? There are older controllers that do this but I don't know if it is common any more with any kind of AT or game controller.

I think touch might work if we used only one pin (tip probably) and left the rest floating? I doubt a trrs cable could carry multiple touch signals (right?). If it does work it would be very helpful. Also, us...

manic glacierBOT
#

Chris mainly uses Arduino on his devices. However those copying his
approaches would be better off starting in Python

As for the libraries, I thought on the samd21 the image and storage were
both in the UF2. That’s why we could make a UF2 file that included the code
and libraries. On chips with separate memory we could do that. Doesn’t that
mean the UF2 could include libraries? Or at you saying there’s no build
process to do that (which would be fine)

Bill Binko
@.***

"H...

manic glacierBOT
#

In the ja translation, with touchio on:

  • ShiftRegisterKeys off, freeze neopixel, there are 268 bytes free.
  • ShiftRegisterKeys on, no freeze neopixel, there are 608 bytes free.
  • ShiftRegisterKeysoff, no freezeneopixel`, there are 1768 bytes free. That's confusing - I don't know why it's more than the sum of the above, might be translation-table savings.

So I can freeze NeoPixel for now, might have to take it away if something else grows.

manic glacierBOT
manic glacierBOT
#

I've been experimenting with multi-display support on the LILYGO T-Keyboard-S3, and was able to initialize and render a displayio.Group on each screen. I can also confirm that it is very unstable! CircuitPython will crash on reloads, so any file changes will require a manual reset of the device. 🙃

However, with as niche as this feature would be, I wanted to contribute in the hopes that we can push this forward.

![LILYGO T-Keyboard-S3 w...

tulip sleet
crimson ferry
#

Espressif spends >25% of revenue on R&D!

stuck elbow
#

I only do D&R

lone axle
lone axle
#

Would it be relatively easy to add the property os.SEEK_END to the builtin os module? It exists in CPython and returns 2. I'm guessing that it wouldn't be so hard, but I've never tried modifing os or anything that is also a CPython builtin.

Also is a changethat would be wanted in the core? it would make it so that some new code in a PR for requests would be able to match more closely between circuitpython and CPython

tulip sleet
#

but that adds to all builds

#

i looked at some of the seek() impls and wasn't sure they all implemented SEEK_END, but some do

#

<@&356864093652516868> meeting starting in two minutes

lone axle
#

The space was a concern I considered. It's very easy to just use the value 2 or make a SEEK_END local variable for it, and that also works in both CPython and CircuitPython. So it's probably not worth it if it has any chance to push any builds over the limit. (or even if there is more useful functionality that could use the space.)

tulip sleet
#

that is kind of micropython's attitude. We are more interested in helping folks, but I can't remember seek() coming up in support

lone axle
slender iron
#

@lone axle I think I know who travis consulting would be if you need a contact

lone axle
#

Nice, thank you. I'll reach out if so. Thus far I only saw the listing for it, but haven't tried out any of those prior images yet.

solar whale
tulip sleet
#

@jerryn could you mute

tiny peak
lone axle
#

I'd lean toward updating and they'll have to change their code. We could bump the major version.

#

I'll try to go through the open PRs before the change so there aren't merge conflicts.

midnight ember
#

This is true. The simpletests for sensors are usually serial only.

midnight ember
#

For beginners they might not know the difference in how to switch between displays and display drivers... there are sooo many different displays.

#

This would be great for the feather tft's and reverse tft's. i think the learn guides for those boards do exist with display code.

#

updating label text updating is a very common question in discord

solar whale
#

a guide to using guides 😉

midnight ember
#

We need a Displayio Guide to the Galaxy, edition 1.

short tendon
#

For the WIZNET5K socket.py => socketpool.py, should this be done before or after Jeff's ssl: work on anything (since it will create conflicts with that PR)

gilded cradle
#

Thanks Dan for hosting

lone axle
#

Thank for hosting Dan, hope everyone has a great week!

manic glacierBOT
#

@tannewt is it possible to use duck-typing here?

Not in the short term. Generally native modules need native implementations because they call functions on the other native object directly. Displays are extra difficult currently because we assume they all can run without a VM. Python-implemented APIs won't work in this case.

There is a future I can see where we do allow Python I2C busses but that requires us to use the Python function lookup instead of direct calls and it requires us ...

tulip sleet
#

Here is the notes document for next Monday’s CircuitPython Weekly Meeting. It is at the normal time of 11am Pacific / 2pm US Eastern here on Discord. Add your hug reports and status updates to the document before the meeting. If you are unable to attend but would still like to contribute, feel free to add your notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868>
https://docs.google.com/document/d/13qSa787bMKb6fA1Z0utzht-5TBOAT-q1_aWa2L-mAaw/edit?usp=sharing

short tendon
#

@lone axle - zero rush on this. Let me know when I should plow through doing the socketpool PRs for wiznet5k and esp32spi.

  • esp32spi has no open PRs so that's easy
  • wiznet5k has 5 - 4 are around connection (with one being a dup) and the other is Jeff's SSL one
manic glacierBOT
lone axle
#

@short tendon do you have an idea of how to test https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k/pull/150 ? Honestly the specifics of this change (and a few others it seems) are beyond my knowledge. All I can really do is test them out on hardware and look over to the best of my abilities.

Trying to figure out how to test this one, it's a change inside of __exit__() of socket class from adafruit_wiznet5k_socket.py I'm assuming I need to be using a context manager, but I'm unsure on the proper syntax and not having much luck so far.

short tendon
lone axle
sleek relic
#

While exploring CircuitPython apps and libraries, I did a side project. I created PyAPIDiffTool (https://github.com/mMerlin/PyAPIDiffTool), a tool to compare the API of different module implementations. This could be useful to developers working on CircuitPython packages. It has extensive configuration file and command line support to adjust what it reports. It can be used to show differences, not implemented, extensions between the base implementation and the port. It can report or ignore differences in docstrings, typehint annotations that exist in the port but not in the base, When doing differences, it can be told to report exact matches or not.

I wrote it for my own curiosity, so reporting is very rough. Developers working on library code should be able to understand it. That said, I could use some feedback on things I may have forgotten to implement, or better ways to do the reporting. It is now stable enough to write good unittests, but that would be a whole other project. The repo github issues is open for bugs and feedback. Contributions welcome.

As an example, here is the output comparing logging and adafruit_logging. Configured to show minimal information about public matched attributes with differences. It can be a lot more verbose.

14 base attributes skipped, 12 port attributes skipped.
13 Matched, 42 Not Implemented, and 15 Extension attributes found.

Matched in "logging" base and "adafruit_logging" port implementations.
"LogRecord" Differences: ('logging',)¦('adafruit_logging',)
  Base detail key class not equal port key namedtuple: cannot compare further
    ('class', Sentinel Tag: 'Other:Expand')
    ('namedtuple', "('name', 'levelno', 'levelname', 'msg', 'created', 'args')")
"getLogger" Differences: ('logging',)¦('adafruit_logging',)
  Method Parameters:
    positional parameter 0 name: base "name"; port "logger_name"
    positional parameter 0 default: base "None"; port :str ""
short tendon
lone axle
# short tendon I didn't. I can later today or tomorrow if it's helpful

Any testing or feedback on any of the open wiznet (or other library) PRs is definitely helpful and appreciated. I really don't have much in depth knowledge of ethernet or networking generally. It's possible that you're closer to this code and the surrounding usages of it than I am at this point honestly. Getting more eyes looking at, testing, and reviewing PRs allows us support more contributions and changes.

tulip sleet
slender iron
#
tio /tmp/cp-uart
[15:23:18.247] tio v2.8
[15:23:18.247] Press ctrl-t q to quit
[15:23:18.247] Connected

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

You are in safe mode because:
CIRCUITPY drive could not be found or created.
Press reset to exit safe mode.

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

Adafruit CircuitPython 9.1.0-beta.0-28-g64312c3b34-dirty on 2024-04-22; Renode Cortex-M0+ with cortex-m0+
>>> print("hello renode")
hello renode
>>> 
short tendon
#

@lone axle I wonder if it's worth adding a testing readme to wiznet5k on how to test some of these super specific things

lone axle
short tendon
lone axle
#

I'm never really opposed to additional documentation around testing (or much of anything else tbh).

crimson ferry
#

@short tendon I'm not sure either, I largely treat that lib as a black box. The PR is a one-liner, but I don't know what it's doing or why.

onyx hinge
#

I read some datasheets & web pages and wrote a semi-educated opinion.

crimson ferry
#

thanks @onyx hinge, I did the first part of that but couldn't come up with a semi-educated opinion 😉

#

the good news I think is that this PR should be independent of other planned work for the WIZnet library

short tendon
#

It will probably have conflicts once I jack it all up for socketpool...

#

Here's a question, in similar but very different environments, I have setup servers for testing things like timeouts (and other things).

For example you can make a post with the header close_after: 10 which will automatically hold and then close after 10 seconds.

Is this something Adafruit would find worthwhile?

manic glacierBOT
#

/ports/stm/mpconfigport.mk

The F4 series receive a blanket number of USB endpoints, but the datasheets reveal a more nuanced story. Shouldn't these be further separated?

0 pairs:
STM32F410xx

4 pairs:
STM32F401xx STM32F405xx STM32F407xx STM32F411xx STM32F415xx STM32F417xx STM32F427xx STM32F437xx STM32F429xx STM32F439xx

6 pairs:
STM32F412xx STM32F413xx STM32F423xx

6+8 pairs:
STM32F446xx STM32F469xx STM32F479xx

lone axle
#

The python library findimports parses python code file and finds all of the imports that it uses. Does anyone know of a similar tool that finds "other files" that the python code uses? Like if the script relies on blinka.bmp, arial12.pcf etc... it could return those as a list?

#

Or if such a thing doesn't exist is there any standardized way to signify required files in a comment near the top of a code file?

# Required Files: blinka.bmp, arial12.pcf

Or similar? I am thinking about this with regards to making tools that load examples onto devices. It's easy to load the example code file, but without some solution to this it won't be able to proper load other required files that the script needs.

manic glacierBOT
manic glacierBOT
short tendon
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.4 on 2024-04-16; PCA10059 nRF52840 Dongle with nRF52840
Board ID:pca10059
UID:44AF58CE0AE80785

Code/REPL

import time, board, _bleio, pwmio
from adafruit_ble import BLERadio
from adafruit_ble.services.nordic import UARTService
from adafruit_ble.advertising.standard import ProvideServicesAdvertisement

ble=BLERadio()
uart=UARTService()
advert=ProvideServicesAdvertisement(uart)
_bleio.adapter.enabled=T...
manic glacierBOT
#

I'm facing the same issue. After searching for long, it does look like this comes from a memory problem.
I am not completely certain, but it looks like I need about 60k bytes of RAM free to be able to be able to make an HTTPS request. I've read it would be enough if you had 40k-ish, but that has not been my experience (maybe you need 40k of continuos, non-fragmented space?)

You can try this to check if this is your problem (put this code right before the HTTPS request):

import gc
p...
manic glacierBOT
short tendon
#

@tulip sleet or @onyx hinge, do you know if the SSL for WIZNET5K will go in 9.1?

onyx hinge
short tendon
#

Could we do something like export a flag in shared-bindings/ssl/__init__.h that if existed we would know it was supported?

onyx hinge
#

probably not, because that would not be in standard python's ssl module (we don't add things if we can avoid it)

tulip sleet
#

you can check the CircuitPython version with os.uname() or sys.implementation.

#

sys.implementation breaks it out into a version tuple

onyx hinge
#

@tulip sleet the problem being, we can't promise justin what the circuitpython version requirement is

#

I think the PR will have to be un-merged until we know that

tulip sleet
#

I would say leave the code commented out or with and false in the library, and then it can be turned on in the library when the ssl PR is merged

short tendon
tulip sleet
#

the latter makes it clearer, I think.

onyx hinge
#

if cp_version >= (9, 1, 0) I think

tulip sleet
#

yup, that works! Tested in CPy:

>>> (9,0,0) >= (9,1,0)
False
>>> (9,1,0) >= (9,1,0)
True
>>> (9,1,0) >= (9,1,1)
False
>>> (9,1,1) >= (9,1,0)
True
``
onyx hinge
#

also test (10,0,0) > (9,1,0) for good measure

tulip sleet
#

True

short tendon
#

Oh cool. I'll update it, and make the version a constant. I'll leave it as a open PR for now

tulip sleet
#

make it draft so it won't be merged by accident

short tendon
#

@tulip sleet last question on the updating the wiznet5k/esp32spi from socket to socketpool => should ConnectionManager support both (socket and socketpool), or release all 3 together and have it just use the new one?

tulip sleet
short tendon
#

There would be 3 PRs:

  1. adafruit_wiznet5k/adafruit_wiznet5k_socket.py -> adafruit_wiznet5k/adafruit_wiznet5k_socketpool.py
  2. adafruit_esp32spi/adafruit_wesp32spi_socket.py -> adafruit_esp32spi/adafruit_esp32spi_socketpool.py
  3. having ConnectionManager use xxx.socketpool
tulip sleet
#

I@onyx hinge's CPy ssl pr is not useful for ESP32SPI, if i understand correctly.

#

so when 2 is done, can do 3 for 2, but save support for 1 as a separate PR for CM. Does that make sense?

short tendon
#

Sorry @tulip sleet 2 different conversations:

  1. about ssl on wiznet
  2. about making the socketpool a class, incase you have more then 1 radio
tulip sleet
#

ah, I see, but do you need jeff's PR before you can do 2 and 3?

short tendon
#

nope

tulip sleet
#

so is there something you want to add to CM that needs jeff's PR merged first?

crimson ferry
#

ssl is independent of the socketpool changes, but the SSL PR has implications for ConnectionManager

#

(to allow WIZnet SSL)

tulip sleet
#

ok, thanks, I was just connectin socketpool and ssl_context in my head

#

i am just saying don't be blocked on other things while awaiting the ssl pr

#

if we don't want two transitions of wiznet code, then wait on some of that

crimson ferry
#

I think the SSL PR is close (though understandably not highest priority), clients are robust and there's a lot of benefit to enabling that, any server fix could be merged later?

tulip sleet
slender iron
#

@tulip sleet I should probably upgrade us to 5.2

#

looks like I already did 🙂

tulip sleet
slender iron
#

we're on the latest release

granite pier
#

I’m playing around with the open PR to add HTTPS support to httpserver, and I’m trying to understand all the pieces at play. I know CircuitPython uses Mbed TLS, but I’d love to figure out if Mbed uses the hardware accelerated cryptography functions available in at least some ESP32 chips. Is that something someone happens to know?

slender iron
#

@onyx hinge has done the most recent mbedtls work

onyx hinge
#

We use the esp-idf version of mbedtls on that platform. So if they have hardware accel we should be getting it.

granite pier
#

heck yeah, thanks! gonna make this server go vroom vroom

short tendon
#

@tulip sleet - question on wiznet5k.WSGIServer. Currently it uses the fake socket(pool) globally with a call to set_interface. Should we keep it the same, and have that method create a global socketpool, or change it so you pass one in like you do for adafruit_httpserver?

manic glacierBOT
short tendon
#

I get:

Wiznet5k Web Server Test
Open this IP in your browser:  192.168.77.23
Root WSGI handler
Large pattern handler
Static file code.py handler
BTC handler
Traceback (most recent call last):
  File "<stdin>", line 137, in <module>
  File "adafruit_wiznet5k/adafruit_wiznet5k_wsgiserver.py", line 118, in update_poll
  File "adafruit_wsgi/wsgi_app.py", line 70, in __call__
  File "<stdin>", line 119, in btc
  File "adafruit_requests.py", line 687, in get
  File "adafruit_requests.py", line 619, in request
  File "/lib/adafruit_connection_manager.py", line 249, in get_socket
  File "adafruit_wiznet5k/adafruit_wiznet5k_socket.py", line 187, in getaddrinfo
  File "adafruit_wiznet5k/adafruit_wiznet5k_socket.py", line 202, in gethostbyname
  File "adafruit_wiznet5k/adafruit_wiznet5k.py", line 308, in get_host_by_name
  File "adafruit_wiznet5k/adafruit_wiznet5k_dns.py", line 275, in gethostbyname
  File "adafruit_wiznet5k/adafruit_wiznet5k.py", line 852, in read_udp
  File "adafruit_wiznet5k/adafruit_wiznet5k.py", line 810, in socket_read
  File "adafruit_wiznet5k/adafruit_wiznet5k.py", line 1135, in _get_rx_rcv_size
  File "adafruit_wiznet5k/adafruit_wiznet5k.py", line 1174, in _read_snrx_rsr
  File "adafruit_wiznet5k/adafruit_wiznet5k.py", line 1121, in _read_two_byte_sock_reg
  File "adafruit_wiznet5k/adafruit_wiznet5k.py", line 1349, in _read_socket_register
  File "adafruit_wiznet5k/adafruit_wiznet5k.py", line 1093, in _read
RuntimeError: pystack exhausted
crimson ferry
#

@short tendon try increasing pystack in settings.toml?

short tendon
crimson ferry
#

I don't know the wsgi server, but it's not surprising that server calling requests could be some nested calls

short tendon
#

yes, quite a few... 😉

crimson ferry
#

meanwhile... I can't connect to wifi with ESP32SPI o_O (haven't used it in a wwhile)

short tendon
#

That's strange

midnight ember
#

Airlifts prior to a certain nina version must be updated with the new TLS stuff. They won't work right until updated.

crimson ferry
#

"No such ssid", but if I increase the timeout then it's "Failed to connect to ssid" ...trying different APs / encryptions / etc ...I'll figure it out, it's probably something dumb (RSSI is -46)

crimson ferry
#

afaik, Airlift boards still ship with 1.2.2, which generally still works fine

midnight ember
#

yes i just woke up, still drinking my coffee, ignore me.

thorny jay
#

Hello, I could not find the meeting recording on Spotify (no worries, I have it on YT: https://www.youtube.com/watch?v=TmFugF2c4mk ), but maybe something went wrong.
Also, a message to @tulip sleet , your audio level is always much lower than the other, this is especially visible (and problematic) when you are the host, because you talk more. This is not new, it's been like that since a bit of time. Not sure if it is like that LIVE or only in your local recording... but I think it is generally low.

midnight ember
#

I had to rewatch it this week since I missed most of the meeting. Yes Dan's mic volume was super low.

#

Going from Dan to FoamyGuy almost blew out my eardrums because I had to crank the volume to full for danh and then 1/4 volume for foamyguy. Dan's mic is usually fine but was very low for some reason this week.

#

didn't know it gets syndicated on spotify, neat. only thought it was on youtube.

#

can't fix the video just something for dan to fix his volume before next weeks meeting.

short tendon
crimson ferry
#

yeah I have it looping and debug on

short tendon
#

😦

thorny jay
onyx hinge
# thorny jay Hello, I could not find the meeting recording on Spotify (no worries, I have it ...

I don't know the details of how the podcast feed is produced, except that someone at adafruit has a script that does it. The canonical URL for the podcast feed is https://adafruit-podcasts.s3.amazonaws.com/circuitpython_weekly_meeting/audio-podcast.xml and it has not been updated this week. It is created/updated by some script from the youtube playlist https://www.youtube.com/playlist?list=PLjF7R1fz_OOUvw7tMv45xjWp0ht8yNgg0 -- the latest meeting is on that playlist so that's not where the problem lies.

If the podcast version of the playlist misses an update next week I'll raise it internally with the script maintainer; you can remind me if so

short tendon
midnight ember
crimson ferry
#

@short tendon I should be able to look at the PR after dinner

short tendon
tulip sleet
#

@midnight ember @thorny jay I didn't change anything on my side, so I'll try a different mic next time, one that's closer to me. I storted of looked ok in the obs level meters.

midnight ember
#

I think Jepler also has one.

tulip sleet
#

I dislike wearing headphones in general because I can't hear myself. Does it have sidetone

#

Right now I am just using the mic on my Logitech webcam. I have a Zoom H2n I could hook up to be closer

midnight ember
#

I don't know what a sidetone is. Can you explain?

tulip sleet
#

that's when you hear a bit of yourself when you're talking. Old-fashioned desk phone do that

midnight ember
#

It's a unidirectional mic but has a wide view so it's almost omnidirectional.

#

ohh heck no, can only hear others, cannot hear yourself that would be too distracting.

#

you can set it up to hear yourself if you want, that's part of audio monitoring that singers need sometimes and is an OS level thing.

tulip sleet
#

i mean when you put on well-sealed phones you can't hear yourself talk very well, as opposed to when you don't wear headphones. And the sidetone should have no latency, that would be terrible.

#

it was designed into desk phones from the Bell system

midnight ember
#

oh that, they're circumaural meaning they go around your ears. honestly they work a bit too well as people can sneak up on me and i can't hear them coming.

#

well they're not like some military grade ear cups that are completely sound deadening but they're definitely better than most in that dept.

tulip sleet
#

I don't want that. I want to hear other things. My favorite headphones with original Sennheiser HD414's

#

I have not found a suitable substitute

midnight ember
#

ah then they might not be a good fit as they are sound deadening. not like bose electronic sound deadening, those things are amazing.

tulip sleet
#

I got mine in 1974

#

they are broken now

midnight ember
#

i know the sennheisers you're talking about they were great. the wireless capability of the cloud flight is better than any of the logitech g-series. i went through 4 sets of those they break easily.

tulip sleet
#

incredibly comfortable, could wear them for 8 hours while doing homework

#

i have not found anything else as close to comfortable

midnight ember
#

those are binaural type where the cushion rests against the ears instead of around it. i thought you were talking about a different type.

tulip sleet
#

"on ear"

#

the band was very light, and the cushions caused no pressure

crimson ferry
#

my brother had a pair like that, super light and comfortable

tulip sleet
#

this is not exactly circuitpython-dev

#

but oh well

midnight ember
#

thought you were talking more about this style. my dad had something like these they were amazing.

#

and i just realized their not a headset just headphones. :/

tulip sleet
#

HD414

midnight ember
#

those remind me of sony walkman kind of style. some of the earlier headsets in the 90's looked like that.

tulip sleet
#

the foam would rot after a few years and have to be replaced

#

no ear pain whatsover, and no sweaty enclosed ear box

midnight ember
#

same is still true today but you can find replacement earcups. same thing different decade.

tulip sleet
#

yep the cups are still available, and people put them on Grado's

midnight ember
#

one of the bad things about those is if you get up you yank the cord out and your neck down. one of the advantages of wireless. no more running over the cord with your office chair too.

#

we need to get you updated to 2020's standards. cloud flight. you think about that and i'll think about running linux someday. 🙂

tulip sleet
#

🙂 ok, I will check them out at microcenter or something

short tendon
manic glacierBOT
thorny jay
stuck elbow
#

why would you want to hear the sound around you, though

fringe yarrow
#

To avoid bear attacks

manic glacierBOT
#

I think I have a similar issue. Trying to use focaltouch library with my m5 cores3 device. It works for a few seconds and then:

OSError: [Errno 116] ETIMEDOUT

I have tried to modify the original code of the library and a can improve a bit repeating reads and things like that but I dont get it to work properly.

It fails mainly when you try to read more than 6 bytes en a row.

manic glacierBOT
manic glacierBOT
manic glacierBOT
onyx hinge
onyx hinge
crimson ferry
#

WSGI was removed from ESP32SPI last September. adafruit_httpserver is much more feature-rich and well-supported.

short tendon
#

It's all working in the PR, and was a good way to make sure I didn't break anything

tulip sleet
#

@short tendon i agree with jepler and anecdata about removing wsgiserver from wiznet if httpserver can now be supported with it

#

I made the decision to remove wsgiserver

short tendon
tulip sleet
#

make a separate PR

#

we can merge that one first if needed

manic glacierBOT
empty salmon
#

I would like to submit a PR to have the Adafruit_CircuitPython_Bitmap_Font added to the available set of frozen libraries.
I have not done a PR before. Do I make the change in the main branch of my fork or do I keep the change in a separate branch and make the PR from that?

tidal kiln
#

separate branch is best. typically a new branch made specifically for the changes related to the PR.

empty salmon
#

Thanks.

tulip sleet
#

you'll be adding that library as a new submodule.

empty salmon
#

Thanks @tulip sleet. I did it locally so I will make a clean environment and do it according to instructions in a new branch of a fork.

slender iron
tulip sleet
#

me too, and in the house, i want to hear when someone's calling me, the phone rings, etc.

fringe yarrow
#

also if there's bears in the house..

stuck elbow
#

I guess I'm spoiled, I don't walk where there are cars or bears, and I never pick up the phone. But crying children and loudly talking people seem to be everywhere.

tulip sleet
slender iron
#

k, let me look

fringe yarrow
#

Looks like recent changes have broke the CI flow for the website PRs, as well..

empty salmon
#

there appears to be an error in the documentation for adding a frozen library to the circuitpython build. The web page instructions gives the command make update-frozen-modules but the Makefile has the target as update-frozen-libraries.

empty salmon
#

thanks. I was not sure where to make the request

tulip sleet
#

thank you

empty salmon
#

I am still learning all of this stuff

tulip sleet
#

you can use the "Feedback? Corrections?" link in the left sidebar of the guide

empty salmon
#

ah. thanks for the pointer

manic glacierBOT
tulip sleet
empty salmon
#

I am adding it as a frozen to a new board. I thought I should do a PR for the frozen library before I submitted the PR for the new board

tulip sleet
#

that's fine, could also do at the same time

#

since it's related

empty salmon
#

like I said, I am new to this process and wanted to do it is baby steps

tulip sleet
#

no problem 🙂

manic glacierBOT
empty salmon
#

kind of fun having multiple windows open and watching this whole process hapenning in realtime

tulip sleet
#

github is so good at dynamic webpage updating

short tendon
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.1.0-beta.1-8-g260f3dadb3-dirty on 2024-04-24; Adafruit Feather ESP32-S2 TFT with ESP32S2

Code/REPL

import max3421e

Behavior

import max3421e
Traceback (most recent call last):
File "", line 1, in
ImportError: no module named 'max3421e'

Description

This commit: https://github.com/adafruit/circuitpython/commit/aca3191a5824b4afd466ba82fc6d9c7cf1c20919 says that max3421e module is enable...

crimson ferry
#

@short tendon I'll look at the ESP32SPI PR tomorrow, I have a config wired up with 2 airlifts, it's working with two copies of the libraries, so should be straightforward to convert the code to use the new socketpool (like WIZnet).

tulip sleet
#

merged

short tendon
#

Thanks!!

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Pending creators PR: https://github.com/creationid/creators/pull/63

This is a board that I can't find info about on wemos.cc, but is in common circulation on aliexpress and ebay.
It also has an identical usb-c version that can also be found.

My assumption is that it's an old board that is no longer supported by WeMos.
I couldn't dig up any more info about it.
But it's incredibly inexpensive (2-5€) and easily it can be acquired.

The best bit of info about it is:
https://mischianti...

manic glacierBOT
short tendon
manic glacierBOT
crimson ferry
manic glacierBOT
crimson ferry
#

@tulip sleet sorry to cross streams with my edit. I noticed it had come out of Draft, so thought maybe we'd be considering to merge. jepler knows best.

tulip sleet
#

np - I have been relying on you folks to test

manic glacierBOT
#

Bypassing the HTTPServer library and running a TCP server directly with this code, modified for WIZnet, results in the same OSError: [Errno 22] Invalid argument upon attempt to connect, followed by a safe mode.

I investigated this.

With an older version of wiznet, I also got an "OSError: [Errno 22] Invalid Argument".

This appears to be due to incorrect handling of timeout=None in recv_into. (the time...

manic glacierBOT
manic glacierBOT
onyx hinge
#

@short tendon ^^^ so yes, (9,1,0) will be the version check for core ssl module supporting wiznet

short tendon
manic glacierBOT
tiny peak
#

@slender iron I made some fpga progress this past week. Spent a long time researching pin constraint files. Reasonably confident that I have one now which is pretty comprehensive and will hopefully let me put the DRAM chip in low power mode without damaging it (it runs at 1.35V rather than 3.3V). Also managed to get a verilog-from-scratch serial loopback bitstream working, including an RX activity LED. Haven't finished writing that up yet though.

manic glacierBOT
#

Hi, I kind of gave up since this was for a workshop and I could do the workshop without it. This ticket was more meant as a heads up to developers or whoever cares enough to fix it :) I am pretty sure I checked the gc.mem_free and I think there was enough. I'm still interested in getting evrything to work, but I will have to revisit this later. I thought maybe it was a collision with the libraries and not a memory problem. But I will test this later at some point. :) Thank you for the replies.

manic glacierBOT
tulip sleet
short tendon
tulip sleet
#

I just don't know if publishing the new CM PR will break anything or not, or it's safe to do so now.

#

that's what I'm asking

short tendon
#

Ahhh, it shouldn't break anything

tulip sleet
#

ok, i'll release!

short tendon
#

🚀

tulip sleet
#

Socket programming q: I am implementing a user-specified timeout for socket connect(). lwip doesn't support this natively, so i use the socket as non-blocking (which is true internally for all sockets in CPy), and just keep checking select() to see if the connection occurred during the timeout. This is fine if the connection happens, but suppose it does not. What should I do to cancel the connection attempt? Should I close the socket?

I've done quite a lot of websearching on this but haven't found an answer. MicroPython does the above to get a user-specified timeout, but doesn't bother to do any cleanup if the timeout happens. Not sure that is the right thing.

#

answering my own q, esp-idf closes the socket

onyx hinge
#

standard Python does not close the socket after a timed-out connect. Instead, if the connection is not made or definitely failed before the timeout is up (including if you had a timeout of 0, e.g., non-blocking connect) it's in a state where you can check if it's connected in various ways including getpeername() (raises "Transport endpoint is not connected" if not connected)...

tulip sleet
#

Thanks, I can do that. It was a struggle to find any discussion of this. I did look at the Python impl and it didn't do anything.

onyx hinge
#
tulip sleet
#

Thanks - I did see both of these, but I don't see that they say explicitly that even if the timeout happens that the connection might eventually happen.

#

The second has a long discussion about how to check for connection, and I coded based on that and the MPy code

onyx hinge
#

more on standard python in linux:

import select
import os
import socket

s = socket.socket()
s.settimeout(0.001)  # unlikely to succeed in 1ms
err = s.connect_ex(("8.8.8.8", 443))
print(f"connect_ex -> {os.strerror(err)} ({err})")

try:
    print(s.getpeername())
except Exception as e:
    print(f"{e} trying to get peer name")

_, w, _ = select.select((), (s,), ())  # note: no timeout on select

print("After select...")
print(s.getpeername())
[Errno 107] Transport endpoint is not connected trying to get peer name
After select...
('8.8.8.8', 443)

If timeout is 0 instead of very small, I get connect_ex -> Operation now in progress (115) instead.

In either case (fully non-blocking, or timeout-before-connect) the socket stays in a case where the connection can complete, and when it does the socket will be treated as writable by select/poll.

#

if I try to connect to a non-routable IP the select() "never" completes (or, well, however long the TCP handshake timeout is in the linux network stack)

#

for "connection refused", ```After select...
Traceback (most recent call last):
File "/home/jepler/socky.py", line 18, in <module>
print(s.getpeername())
^^^^^^^^^^^^^^^
OSError: [Errno 107] Transport endpoint is not connected

tulip sleet
#

I was thinking of doing a getpeername() check in the code I was writing but realized it's really the responsibility of the user code.

short tendon
#

@tulip sleet when we think about making code and examples simpler, I wanted to share a util I have:

def connect(radio, env_prefix="CIRCUITPY_", retries=3):

It works similar to the ConnectionManager in determining the radio, and thus how to call connect, and then gets the connection vars:

wifi_ssid = os.getenv (f"{env_prefix}WIFI_SSID")

And then tries to connect.

So it takes all of this:

import os
...
wifi_ssid = os.getenv("CIRCUITPY_WIFI_SSID")
wifi_password = os.getenv("CIRCUITPY_WIFI_PASSWORD")

while not radio.connected:
    radio.connect(wifi_ssid, wifi_password)

And turns it into:

import connection_helpers
...
connection_helpers.connect(radio)

Does this seem worth adding to ConectionManager?

manic glacierBOT
midnight ember
#

https://github.com/adafruit/Adafruit_CircuitPython_ATECC/pull/35 I was asked to review a PR and discovered a scenario where a certificate signing request can be allowed to input 1 character into all CSR fields and it will still pass. I wrote up a section for in the weeds in this weeks meeting docs. Can someone take a look and see if my interpretation of CSR fields being required and amending the docstring is correct? It can wait until in the weeds but would be nice to have some input on it for a decision and not have an in the weeds topic.

#
# 2-letter country code
MY_COUNTRY = "US"
# State or Province Name
MY_STATE = "New York"
# City Name
MY_CITY = "New York"
# Organization Name
MY_ORG = "Adafruit"
# Organizational Unit Name
MY_SECTION = "Crypto"
``` intent, this will pass as an issuer of a CSR
#
# 2-letter country code
MY_COUNTRY = "1"
# State or Province Name
MY_STATE = "1"
# City Name
MY_CITY = "1"
# Organization Name
MY_ORG = "1"
# Organizational Unit Name
MY_SECTION = "1"
``` but so will this
#
# 2-letter country code
MY_COUNTRY = "US"
# State or Province Name
MY_STATE = ""
# City Name
MY_CITY = ""
# Organization Name
MY_ORG = ""
# Organizational Unit Name
MY_SECTION = ""
``` and so will this which I think is a problem.
short tendon
#

So it's definitely better, as previously the if/else was just around the value of common

#

I haven't looked in a while, you don't need to have all of them, but not remembering what's actually required

crimson ferry
#

@short tendon adafruit_connection_manager.get_connection_manager(pool) isn't typically needed by user code, is it?

#

(I'm getting unexpected behavior trying multiple ESP32SPI with CM#11 + ESP32SPI#198)

#

only if you wan to directly access the CM for a pool to do something deeper with its sockets?

midnight ember
#

but it's only checking that all fields have some kind of data in them. The check for 0 length doesn't quite match up with the actual minimum count of 55.

#

total length should at least be 55. checking against 0 only checks that at least 1 field isn't empty but the script won't allow that anyway since they are required fields... so 0 does nothing.

crimson ferry
#

@short tendon oh, maybe the issue is that CM #8 and CM #11 are, for now, independent... I need to make a merged copy

#

(I'm always getting the same ConnectionManager back, for multiple pools of the same type)

#

but I didn't have this isue with WIZnet

midnight ember
#

yes but each adds 11 at a minimum to the total count it's checking against.

#

so if 5 fields are required then the minimum should be 55 to check against not 0.

short tendon
crimson ferry
#

ok, that makes sense, but now I have to figure out what I did with WIZnet

#

that seemed to work

#

and it shouldn't have

short tendon
midnight ember
#

sorry i meant the PR proposed change ```py
def issuer_or_subject_length(
country: str, state_prov: str, city: str, org: str, org_unit: str, common: str
) -> int:
"""
Returns total length of provided certificate information.

:param str country: Country of certificate
:param str state_prov: State/province of certificate
:param str city: City of certificate
:param str org: Organization of certificate
:param str org_unit: Organization unit of certificate
:param str common: Common data of certificate
:raises: TypeError if return value is 0
:return: Total length of provided certificate information.
"""
tot_len = 0
if country:
    tot_len += 11 + len(country)
if state_prov:
    tot_len += 11 + len(state_prov)
if city:
    tot_len += 11 + len(city)
if org:
    tot_len += 11 + len(org)
if org_unit:
    tot_len += 11 + len(org_unit)
if common:
    tot_len += 11 + len(common)
if tot_len == 0:
    raise TypeError("Provided length must be > 0")
return tot_len
#

if country, state, city, org, and common are all required fields then total_len minimum to check should be 55 not 0?

#

in this case org_unit is also a required field so it should be 66. but i propose to make org_unit optional.

#

Seems fairly cut and dry to me. Checking for tot_len == 0 seems rather pointless when it should be 66 for the check to work correctly?

#

Fields can be blank with "" and still pass. I don't think that's how a CSR should work?

short tendon
#

So, I would specifically check that the required fields are valid first:

if not required_1 or not required_2:
  raise TypeError("Required fields missing")

And if that passes calculate the length

midnight ember
#

Thank you that's kind of what I was thinking. I wrote some feedback with a script that does that. It's my first PR review so I just wanted to double check that I'm not completely off base with what is really needed to fix that check.

#

The +11 prepended to the length ensures that it allocates the byte space needed for the crypto chip hash prior to each field.

short tendon
#

@crimson ferry CM/pull/11 is updated with main. So it should work if you pull it down

crimson ferry
#

@short tendon w00t! (I remembered that for the multi-WIZ test, I used a pre-CM version of Requests) ...now time to wire up the multi-WIZ / multi-ESP/ +native wifi monstrosity :p

short tendon
crimson ferry
#

new CM#11 + WIZ#159

#

I'll do esp too

short tendon
#

I've been using a UMS3

crimson ferry
#

UM FeatherS3... yeah we'll see about esp-idf memory

short tendon
#

I think you could get:
1 wifi
2 esp32spi
2 wiznet5k

#

🤞

crimson ferry
#

actually, not sure what of all this besides native wifi wouldn't come from PSRAM, so there may be plenty

short tendon
#

I haven't actually ran tests on a UMS3 for how many sockets I can open when not using the WiFi is (when I am, it's 7)

#

Because I was like, why would I?

short tendon
crimson ferry
#

esp32spi has potentially 10 total iirc

#

wiznet... depends on which model

crimson ferry
#

CM is going to be almost-mandatory now with all examples using it... it will be harder to not use it, so may want to keep it focused

short tendon
crimson ferry
short tendon
#

And then when we add the ESP64WIZBANG6000, the examples don't change 😉

short tendon
#

And memory usage should stay small, since it doesn't import anything that wouldn't already be used

#

I would also wonder if for the Pico W, if we could freeze it, to take up less space...

crimson ferry
#

does freeezing use less RAM than .mpy on disk?

short tendon
#

Yes, it's part of the space used by the build

#

Which is why it's done for some other devices

crimson ferry
#

ah, ok

#

Pico W is also somewhat flash-constrained

short tendon
#

Although, would need someone with a fuller understanding to confirm

short tendon
crimson ferry
#

@short tendon the wiznet run above, I had it set up wrong... I was creating the pools from my own import and appending them to a list. I'm not geting wiznet or esp32spi working across multiples with new #11 ...I'm not fully grok'ing the library... there's one pool per CM... is there one CM per radio type, or per radio?

short tendon
#

It's possible something isn't right. Sadly I only have 1 of each...

crimson ferry
#

or is it intended that I track my own pool per radio?

short tendon
#

Thinking....

#

It may be for this case (using the same radio code), you need to create the pool manually

crimson ferry
#

ok, that's fine

short tendon
#

CM doesn't key off the radio (it can't)

#

So multiple of the same radios would need some advanced code

#

But you should be able to have just the main py file (not needing to duplicate)

crimson ferry
#

yeah, I basically do:```
radios.append(ESP_SPIcontrol(spi, esp32_cs, esp32_ready, esp32_reset))
# pools.append(adafruit_connection_manager.get_radio_socketpool(radios[i]))
pools.append(socketpool.SocketPool(radio[i]))
ssl_contexts.append(adafruit_connection_manager.get_radio_ssl_context(radios[i]))
requestss.append(adafruit_requests.Session(pools[i], ssl_contexts[i]))

#

where is ConnectionManager class actually instantiated?

#

oh, must be in the requests etc libraries

manic glacierBOT
short tendon
#

Wait, this should work. As long as the radio is different, you should get a different pool.

#

Can you share the whole loop when you have a moment?

crimson ferry
#

@short tendon see the commented lines, 48-49: https://gist.github.com/anecdata/8e8db7d325df23f438e039b0ec8f615b If I get the socketpools from CM, I always get the same ConnectionManager and only the first radio gets used. If I allocate the socketpools myself and feed those to Requests, they each get a unique ConnectionManager and both radios get used.

short tendon
crimson ferry
#

yeah, I'll check and post, I'm about to wrap up for the eve too

#
pools.append(adafruit_connection_manager.get_radio_socketpool(radios[airlift]))
#pools.append(socketpool.SocketPool(radios[airlift]))
⋮
True  radios[0] != radios[1]
False pools[0] != pools[1]
#pools.append(adafruit_connection_manager.get_radio_socketpool(radios[airlift]))
pools.append(socketpool.SocketPool(radios[airlift]))
⋮
True  radios[0] != radios[1]
True  pools[0] != pools[1]
#

also in the first case (CM), connection_managers[0] != connection_managers[1] is False

#

two devices of the same class need separate pools, but if that needs to be manual, that's ok, it's not a common use case ...moving discussion to the PR

manic glacierBOT
#

Just an update: I did some more tests to find out why free memory decreased. One reason is a patch for tinyusb. That patch fixed some problems with the Pico and the Pi4/Pi400 but had the side-effect that it moved a lot of code from flash to ram (about 4K, mainly interrupt handlers, so there is good reason for this change).

With some hacks I managed to push this code back to flash (where it was in 8.0.5). The sections .data, .bss and .itcm did shrink the expected amount, but the net effect ...

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.1.0-beta.1-10-gc92bb9b3cc on 2024-04-25; Maker Go ESP32C3 Supermini with ESP32-C3

Code/REPL

import wifi
wifi.radio.connect("Lunchbox", "[REDACTED]")

Behavior

Traceback (most recent call last):
  File "", line 1, in 
ConnectionError: Unknown failure 2

Description

Regardless of if the password is right or wrong, the result is the same. Tried two different networks.

Additional ...

manic glacierBOT
manic glacierBOT
#

CircuitPython version

main

Code/REPL

not tested - just a typo spotted in source code

Behavior

not tested - just a typo spotted in source code

Description

I spotted an error in the pins.c file for m5stack atom S3u file: https://github.com/adafruit/circuitpython/blob/main/ports/espressif/boards/m5stack_atoms3u/pins.c

BOTH pin GPIO/D1/A1 and GPIO2/D1/A1 are labelled SCL - I imagine one of them should be called SDA

Additional informatio...

manic glacierBOT
fringe yarrow
#

@gilded cradle Is there something I'm supposed to be doing with that circuitpython-org PR of mine that keeps failing? It doesn't look like the failures are on my end, but rather the CI flow.

gilded cradle
#

@fringe yarrow as far as I can tell, it doesn't appear to be on your end either. Every so often jekyll or ruby needs some weird update and I think this is one of those cases.

#

I re-ran the job just in case it was only a hiccup in the system or something.

manic glacierBOT
short tendon
tulip sleet
#

this seems fine. I was waiting for the testers to finish.

#

you were awaiting feedback from them

crimson ferry
#

fine to me too, I'll defer to Retired Wizard to test since it their use case

short tendon
#

Sounds good!

manic glacierBOT
manic glacierBOT
#

Are there any native modules which do use the Python function lookup in the way that would be required?

adafruit_bus_device does this correctly: https://github.com/adafruit/circuitpython/blob/94afcaa48a225bd6655957c192df5524bdf95bad/shared-module/adafruit_bus_device/i2c_device/I2CDevice.c#L73-L77

displayio has the added challenge of running when no VM is present as well.

And, are there adafruit_* modules which are not pure Python, i.e. use native code?

There are only two...

manic glacierBOT
#
  • Fixes #8266.

In espressif, adds user-specified socket connect() timeout by doing connect() on the non-blocking socket, and then polling with select() for success.

RP2040 CYW43 already has similar code (though it doesn't check for ctrl-C or do background tasks)

Tested with adafruit_requests. IMPORTANT: adafruit_requests tries to connect twice, which can make the timeout appear to be twice as long. This is an issue with adafruit_requests, not with this fix. I will bri...

manic glacierBOT
manic glacierBOT
slender iron
#

@tulip sleet any chance you want to switch all of the circuitpython code over to #pragma once?

manic glacierBOT
tulip sleet
slender iron
tulip sleet
#

i can do this sometime soon. I can do it when you're away. Also maybe there's an upstream merge soon?

slender iron
#

I think Jim did say one would be soon

#

not sure exactly when though

tulip sleet
#

it will arrive when it arrives. But these other things don't need to wait

slender iron
#

it may give you something a little larger to work on too

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython version 9.4.0

Code/REPL

===========================================================================
# SPDX-FileCopyrightText: 2022 John Park and Tod Kurt for Adafruit Industries
# SPDX-License-Identifier: MIT
'''Walkmp3rson digital cassette tape player (ok fine it's just SD cards)'''

import time
import os
import board
import busio
import sdcardio
import storage
import audiomixer
import audiobusio
im...
short tendon
#

@tulip sleet I was looking for what else I needed to change for the SocketPool update and

found this: https://github.com/adafruit/Adafruit_CircuitPython_WSGI/blob/main/adafruit_wsgi/esp32spi_wsgiserver.py
and we removed https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k/blob/5.2.1/adafruit_wiznet5k/adafruit_wiznet5k_wsgiserver.py

In Adafruit_CircuitPython_WSGI Should I
update: WSGIServer.__init__(self, port=80, debug=False, application=None)
to WSGIServer.__init__(self, socket_pool, port=80, debug=False, application=None)

so it can be generic? This is what I did first in wiznet5k before we removed it...

tulip sleet
short tendon
#

HTTPServer is updated a lot more

tulip sleet
#

I'd just leave this alone, then.

short tendon
#

👍

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

@dhalbert using the test code you posted in the requests issue:

On: Adafruit CircuitPython 9.1.0-beta.1-12-g2060b2b390 on 2024-04-26; Adafruit Feather ESP32-S3 TFT with ESP32S3:

default success: 0.632004
default fail: 36.632
error: Error connecting socket: [Errno 119] EINPROGRESS
timeout success: 0.641022
timeout fail: 6.16202
error: Error connecting socket: [Errno 116] ETIMEDOUT

On: `Adafruit CircuitPython 9.1.0-beta.1-12-g2060b2b390 on 2024-04-26; Adafruit Feather ...

midnight ember
#

I finally sat down and played with the 800x480 7" TFT from Adafruit (purchased last year). It seems the RA8875 driver module was missed with displayio integration. Is this type of display not capable of displayio? Seems like a fairly normal SPI display though it is huge at 800x480. Found some posts dating back to Adafruit carrying them since 2014 so it pre-dates most of displayio (about 10 years ago) to the point people were using them Arduino Uno and Due. Seems most the driver is a port from Arduino around the time of the M4 Feather. Fast forward a couple of years and now the S3 drives it well enough to consider adding displayio. https://github.com/adafruit/Adafruit_CircuitPython_RA8875

#

The problem with the current RA8875 driver is it uses all native RAIO (chip manufacturer) registers to display images and text which is very reminiscent of Arduino's GFX library from a decade ago. It can do layers but nothing like displayio can. Would love to see this driver updated with displayio. Unsure if it's possible or how to start. Any advice appreciated.

#

Here is the 800x480 next to a 480x320 TFT Featherwing.

#

The 24-bit background image took about 3 minutes to draw to the screen line by line.

#

Without displayio this is about as useful as it gets. Drawing text is equivalent to Arduino GFX with a background color behind the text. There are native methods to draw text but not to remove it for layer updates, displayed text eventually turns into a jumbled mess.

tulip sleet
#

@short tendon After the review I did this morning, I started looking at the ConnectionManager code in more detail (which I had not really done before -- I was taking a more managerial approach). I see some refactoring that could reduce the code size slightly, but I also wanted to ask you some questions. Are you up for a brief audio chat?

tulip sleet
#

can meet you in Amelia Earhart

short tendon
#

@tulip sleet for when you are around, this looks a lot better. Thoughts?

        result = self._get_connected_socket(
            addr_info, host, port, timeout, is_ssl, ssl_context
        )
        if isinstance(result, Exception):
            # Got an error, if there are any available sockets, free them and try again
            if self.available_socket_count:
                self._free_sockets()
                result = self._get_connected_socket(
                    addr_info, host, port, timeout, is_ssl, ssl_context
                )
        if isinstance(result, Exception):
            raise RuntimeError(f"Error connecting socket: {result}") from result
tulip sleet
short tendon
#

Awesome. and it will make it easier to handle specific exceptions if wanted

tulip sleet
short tendon
#

yes, because if there are available sockets, we try again and have a new result

#

Code is pushed up for when you have time to look/comment on it

tulip sleet
#

oh, I missed the second assignment to result 🙂

manic glacierBOT
#

Hello CircuitPython Team,

the adafruit_dotstar.py code that is flashed during the installation of CP 9.0.4 as well as in the 9.1.0-beta1 is incompatible.

Please replace the adafruit_dotstar.py with the new version of UnexpectedMaker.

https://github.com/UnexpectedMaker/feathers2/blob/main/FeatherS2/CircuitPython/adafruit_dotstar.py

This works again with both CP versions.

With kind regards
CrackXT

#

Hello CircuitPython Team,

the adafruit_dotstar.py code that is flashed during the installation of CP 9.0.4 as well as in the 9.1.0-beta1 is incompatible.

Please replace the adafruit_dotstar.py with the new version of UnexpectedMaker.

https://github.com/UnexpectedMaker/feathers2/blob/main/FeatherS2/CircuitPython/adafruit_dotstar.py

This works again with both CP versions.

With kind regards CrackXT

I don't think they should do that, sorry.

What is not w...

arctic cliff
#

Has anyone already tried to build CircuitPython under Ubuntu 24.04?

I always get the following error message:

xyz@MARTIN-BARNER:~/circuitpython$ pip3 install --upgrade -r requirements-dev.txt
error: externally-managed-environment

Under Ubuntu 22.04 I did not need a virtual Python environment.

THX

tulip sleet
midnight ember
#

@short tendon sorry I didn't get to help test your CM changes. Looks like you got the feedback you needed though.

short tendon
midnight ember
#

I looked at a lot of them. Great work. Thank you for taking that on. It's nice not being the only one submitting stuff to those examples anymore. Seems like CM is also moving in a good direction again. Looking forward to seeing it all come together.

tulip sleet
arctic cliff
arctic cliff
# arctic cliff Many thanks for the information and links. I'm on vacation next Thursday and wi...

It works with this bash script under Ubuntu 24.04 . It's not pretty, but it should work as a temporary solution. Here I have used the solution from Pimoroni.

#!/bin/bash
PY_ENV_DIR=$HOME/.virtualenvs/adafruit
if [ ! -f $PY_ENV_DIR/bin/activate ]; then
printf "Creating user Python environment in $PY_ENV_DIR, please wait...\n"
mkdir -p $PY_ENV_DIR
python3 -m venv --system-site-packages $PY_ENV_DIR
fi
printf " ↓ ↓ ↓ ↓ Hello, we've activated a Python venv for you. To exit, type "deactivate".\n"
source $PY_ENV_DIR/bin/activate
read -p "Press any key to update Ubuntu"
sudo apt update && sudo apt full-upgrade -y
read -p "Press any key to update CircuitPython"
cd circuitpython
git pull
git checkout main
read -p "Press any key to fetch all submodules"
make fetch-all-submodules
read -p "Press any key to update requirements and update ARM path"
pip3 install --upgrade -r requirements-dev.txt
pip3 install --upgrade -r requirements-doc.txt
export PATH=/home/$USER/bin/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin:$PATH
export PATH=$HOME/circuitpython/mpy-cross/build:$PATH
read -p "Press any key to compile mpy-cross"
make -C mpy-cross
read -p "Press any key to compile Raspberry Pi Pico"
cd ports
cd raspberrypi
make clean BOARD=raspberry_pi_pico
make -j16 BOARD=raspberry_pi_pico
cp build-raspberry_pi_pico/firmware.uf2 /mnt/c/Users/pasca/Documents/CircuitPython/CircuitPython\ Firmware/Raspberry\ Pi\ PICO/
read -p "Press any key to compile Raspberry Pi Pico W"
make clean BOARD=raspberry_pi_pico_w
make -j16 BOARD=raspberry_pi_pico_w
cp build-raspberry_pi_pico_w/firmware.uf2 /mnt/c/Users/pasca/Documents/CircuitPython/CircuitPython\ Firmware/Raspberry\ Pi\ PICO\ W/
read -p "Press any key to exit script"

I still have a problem with the Espressif MCs because the Espressif build environment also uses a venv. I still have to find a solution for Ubuntu 24.04.

onyx hinge
#

It's possible to just make pip stop with its advise about the "externally managed environment", if you prefer to keep the old behavior where pip can install packages into the user's home directory without asking extra nicely. Article's written about Debian but should apply to Ubuntu, because it relates to apt & dpkg which Ubuntu is (afaik) using to package & publish python: https://emergent.unpythonic.net/01678908675

#

it's not Adafruit's advice but it's what I do on my own systems

#

the specific command may need changing if 24.04's python is 3.12 instead of 3.11.

tame creek
tulip sleet
#

I started upgrading my regular dev machine to 24.04 today, and expect to figure out the easiest way to do this (at least for me). I don't expect to override the "externally managed environment" requirement, but instead will try to make using the virtual environment as easy as possible.

small comet
#

I feel I've run into this before but can't remember the solution 🙂 is there a "standard" way to install python module dependencies just for tests for adafruit (pure python) libraries? Is it just a matter of adding it to optional_requirements.txt or is there a different approach you'd recommend?

midnight ember
midnight ember
#

I'm trying to get raw jpeg decoding working and it's been a rough night of going in circles with chatgpt. Seems like jpegio is only for displayio? Any chance someone has a raw jpeg decoder? Jepler perhaps?

#

I'm using a 192x128 24-bit JPG. I have the window padding showing up and I can see some color data but it's all scrambled and I cannot figure out why.

#

What I have so far. My first time with jpg headers so no, I do not know what I'm doing. I've been at it for about 6 hours now.

#

BMP works great, JPG has been a struggle.

lone axle
small comet
midnight ember
#

The amount of info out there for decoding jpgs with python is pretty slim. I'm hoping Jeplers work on it is recent enough that maybe there's a raw decode function to jpeg decode that I've completely missed.

#

99% of searches resulted in either PIL or numpy. We do have numpy so that might be an option but one that is way over my head.

manic glacierBOT
manic glacierBOT
#

A better place to discuss problems using the Adafruit CircuitPython dotstar library is in that github repo: https://github.com/adafruit/Adafruit_CircuitPython_DotStar -- creating a new issue there with a full description of the problem you're having would be a great idea. Please include the code you're using as well as describing the behavior you see and any messages that are shown "in the REPL".

Generally, around the time each CircuitPython release is made, each frozen library is updated ...

lone axle
#

Ah, maybe that node.js bit is just a warning and not the root cause of the action fail.

#

build
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
small comet
lone axle
#

but in the log for the failed run it looks like this is the root cause of it:

An error occurred while installing sass-embedded (1.58.3), and Bundler cannot
continue.

In Gemfile:
  jekyll-get-json was resolved to 1.0.0, which depends on
    jekyll was resolved to 4.3.3, which depends on
      jekyll-sass-converter was resolved to 3.0.0, which depends on
        sass-embedded

I don't have much knowledge or experience with Ruby / Gems, but I'll try to figure out how to get this straightened out. If anyone with more experience sees this feel free to ping me if you happen to know what it means / how to resolve.

midnight ember
slender iron
#

@small comet you were interested in renode right?

small comet
slender iron
#

yup! I have a PR adding a renode port

#

I was at a conference where renode folks helped me out

#

Hopefully the PR will go in today

small comet
#

Fantastic! Looking forward to it - will definitely check it out and scratch my itch to run a few more CI tests!

slender iron
#

I didn't implement digitalio yet but it shouldn't be too bad

#

It sets up a fake SoC to run on instead of trying to run on a real one

small comet
#

Ah, gotcha. Once you've blazed the initial path, hopefully more pieces will get added to it. That's awesome

slender iron
#

next on my wish list is to enhance tracing to include uart output and memory values

lone axle
#

It looks like the version of Ruby being used inside the actions is 3.3.1 and the datestamp on it shows it was released at basically the same time that the build stopped succeeding. https://github.com/adafruit/circuitpython-org/actions/runs/8814751421/job/24195299302#step:5:27. My local version is ruby 3.0.2p107 I think I just got it with apt install ruby but I'm not 100% certain. I'll try to figure out how to get a newer version. It seems we'll need to do some kind of updating to get things working under that newer version.

small comet
tulip sleet
#

no, that looks ok

lone axle
#

The library report one for the meeting?

tulip sleet
lone axle
#

it doesn't really matter, but it's interesting that mine are sorted into slightly different order

tulip sleet
#

firefox vs chrome!!

lone axle
#

I've looked a bit further into the failed library infrastructure issue (There are a few follow up comments above with what I've found). I do think that issue affects specifically the circuitpython-org build.

#

Ahh

tulip sleet
#

i would not expect that difference. That listing is generated by javascript

lone axle
#

Yep, I think more specifically it started using ruby version 3.3.1 and that one isn't able to install the dependencies

tulip sleet
lone axle
#

Yep, I can do that.

blissful pollen
orchid basinBOT
gilded cradle
#

@lone axle I'm having internet issues, so likely won't be able to read my notes today.

slender iron
midnight ember
blissful pollen
stuck elbow
#

(it's not the same image)

onyx hinge
#

@tulip sleet what's the error you're seeing with setuptools & virtual environments?

tulip sleet
#

example:

pip3 install --upgrade cpp-coveralls
Collecting cpp-coveralls
  Using cached cpp-coveralls-0.4.2.tar.gz (15 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [1 lines of output]
      ERROR: Can not execute `setup.py` since setuptools is not available in the build environment.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
#

setuptools IS installed, and is latest version

onyx hinge
#

what's the whole thing you run to get to that point?

tulip sleet
#

that was just the operative bug in pip3 install -r requirements-dev.txt.

#

requirements-doc.txt installs completley.

#

I'm in a venv in ubuntu 24.04

onyx hinge
#

but you ran some commands to create & activate the environment

spare jacinth
#

perhaps setuptools not up to date?

#

or somehow it is "locked out" of the build env

tulip sleet
#
sudo apt install python3.12-venv
python3 -m venv ~/.py
source ~/.py/bin/activate
#

this is a brand new clean install of ubuntu 24.04

#
(.py) halbert@cod:~/repos/circuitpython$ python3 --version
Python 3.12.3
(.py) halbert@cod:~/repos/circuitpython$ pip3 list |grep setuptools
setuptools                               69.5.1
setuptools-scm                           8.0.4
(.py) halbert@cod:~/repos/circuitpython$ pip3 list |grep pip
pip                                      24.0
(.py) halbert@cod:~/repos/circuitpython$ 
tulip sleet
onyx hinge
#
$ docker run -it ubuntu:24.04
root@f8fca6e6316a:/# apt update && apt install --no-install-recommends --no-install-suggests -qy python3 python3-pip python3-venv && python3 -mvenv _env && _env/bin/pip3 install cpp-coveralls
...
Successfully installed certifi-2024.2.2 charset-normalizer-3.3.2 cpp-coveralls-0.4.2 future-1.0.0 idna-3.7 requests-2.31.0 urllib3-2.2.1
```I'm not getting that outcome here in a docker image fwiw
silver tapir
#

I just tested it on a WSL ubuntu 24.04 and it worked as well, and I do not have setuptools installed.

tulip sleet
#

maybe I will uninstall setuptools. Will try more after the meeting

spare jacinth
#

i have no idea how eggs/wheels/whatever work, so i cant give any feedback other than reading it too, lol

tulip sleet
#

i can try the docker locally

midnight ember
#

I like how the weather forecast icons are circular around a clock, that's a great idea.

tulip sleet
#

if I avoid cpp-coveralls, the next module that fails, in the same way, is jsmin

onyx hinge
#

oops I forgot to join the voice channel headdesk

turbid radish
#

Please tell your colleagues, friends, students to subscribe

tulip sleet
#

aha:

ython 3.12.3 (main, Apr 10 2024, 05:33:47) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import setuptools
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/halbert/.py/lib/python3.12/site-packages/setuptools/__init__.py", line 9, in <module>
    import distutils.core
ModuleNotFoundError: No module named 'distutils'
spare jacinth
#

wasnt distutils moved into setuptools (or something like that) on a recent-ish Py update?

tulip sleet
#

i'll bring this up after the meeting so as not to clog the video recording

gilded cradle
#

I can read

onyx hinge
#

[huh I've heard of others having this problem (not hearing specific users) but I couldn't hear deshipu talk. linux, using discord app]

tulip sleet
#

it was really faint for me

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.1.0-beta.1-14-g126a1a4154 on 2024-04-29; WeMos LOLIN32 Lite with ESP32

Code/REPL

>>> import board
>>> import analogio
>>> a = analogio.AnalogIn(board.IO27)
>>> a.
deinit          reference_voltage
>>> dir(a)
['__class__', '__enter__', '__exit__', 'deinit', 'reference_voltage']
>>>

Behavior

No value property.

Description

No response

Additional information

No response

silver tapir
#

LOL on that sparky

midnight ember
#

happens to everyone

slender iron
#

I had tested it on one board and turned it on there

onyx hinge
#

textual is pretty cool

midnight ember
#

Foamy on fire with the circup improvements

#

oh very nice deshipu, represent!

onyx hinge
#

I'll be there!

tulip sleet
#

@stuck elbow will you be going anywhere else in the US?

stuck elbow
onyx hinge
#

I don't think anybody's done that (I haven't done that)

midnight ember
manic glacierBOT
silver tapir
#

need to drop for another meeting, I'll check in the weeds on the recording.

stuck elbow
#

people will still install those libs from pip without reading the docs

tulip sleet
slender iron
#

looks normal time to me

midnight ember
#

Thank you for hosting @lone axle have a great week everyone.

short tendon
#

Thanks all!

solar whale
#

@onyx hinge with a few simple changes for the pinouts, the "ascii-mirror" demo works on the pico/picowbell -- progress.

manic glacierBOT
#

Hmm, I had missed this, but something's not quite right. I don't have web-workflow enabled, my os is handling the networking, so it's a user-connected network, which should be disconnected on reload.

Quitting from my os and entering repl:

>>> import wifi
>>> wifi.radio.connected
False
>>> import board
>>> import analogio
>>> a = analogio.AnalogIn(board.IO27)
>>> a.
deinit          reference_voltage
>>> wifi.radio.enabled = False
>>> a.
deinit          reference_voltage
>...
lone axle
#

Here is the notes document for next Monday’s CircuitPython Weekly Meeting. It is at the normal time of 11am Pacific / 2pm US Eastern here on Discord. Add your hug reports and status updates to the document before the meeting. If you are unable to attend but would still like to contribute, feel free to add your notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1PhxHRJjWKLOBTZeKI6XBk54aA3Bz_tPxidR6AKUuY6U/edit?usp=sharing

manic glacierBOT
lone axle
#

I found that the PyCamera library is "circuitpython-pycamera" inside of RTD instead of "adafruit-circuitpython-pycamera". The latter I believe is the naming followed by most of the libraries (but I'm not certain). I've submitted a PR to change the badge link URL in the readme: https://github.com/adafruit/Adafruit_CircuitPython_PyCamera/pull/38 but it occured to me after submiting maybe we'd want to change the name inside of RTD instead if the latter convention is more typical and if that is an option. So I'm posing that here.

tulip sleet
lone axle
#

It is an Adafruit repo. The name in github (and pypi) do both contain the adafruit part, it looks like just the RTD name is missing the "adafruit" prefix.

tulip sleet
#

can you change the rtd name or do you need someone with more privs to do it?

lone axle
tulip sleet
#

what url do you need?

lone axle
#

That appears to have done the trick 🎉 the badge URL https://readthedocs.org/projects/adafruit-circuitpython-pycamera/badge/?version=latest is working now on the readme page to show the current badge status.

tulip sleet
#

rtd's project struture is not obvious

#

okee dokee, not sure if it's listed twice now, but I think not

lone axle
#

Agree'd

lone axle
#

Can anyone think of anything else that would be good to mention, or any improvements to the wording of this message for creating 'good first issue's from?

We would like to have a basic displayio example for this library. The example should be written for micro-controllers with a built-in display. At a minimum it should show a Label on the display and update it with live data readings from the sensor. 

The example should not be overly complex, it's intended to be a good starting point for displayio based projects that utilize this sensor library. It should be written to support as many micro-controllers as is feasible. Try to keep all visual content as near to the top left corner as possible in order to best facilitate devices with small built-in display resolutions.

The new example should follow the naming convention `examples/libraryname_displayio_simpletest.py` with "libraryname" being replaced by the actual name of this library.

You can find an example of a Pull Request that adds this kind of example here: https://github.com/adafruit/Adafruit_CircuitPython_BME680/pull/72

We have a guide that covers the process of contributing with git and github: https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github

If you're interested in contributing but need additional help feel free to join the Discord server to ask questions: https://adafru.it/discord
random junco
lone axle
#

Thank you!

short tendon
#

Question, does Adafruit pay for GitHub, I ask because since the libraries all have the same linting and such (or should), things could be cached to run faster, and if applicable save money

tulip sleet
#

We don’t pay for the open-source public repos. But if you have som suggestions about saving time, we’re all ears

short tendon
#

Sounds good. I'll look through some of the tooling repos and see what options I can come up with. There's so much downloading of libraries, that caching seems like it would save a good chunch of time...

manic glacierBOT
tulip sleet
#

@onyx hinge I created another fresh user on my 24.04 machine and that user can install cpp-coveralls in an identical venv. So I thought it might be something in my PATH, but pruning that down did not seem to help. I did some strace comparisons, but it's getting out of hand. But in any case seems to be something about my own environment.

#

it's useful to remove .cache/pip to start from scratch. I'll try some more "bare environment" things and see if I can get it to work.

#

I also compared the file tree in the two venv's and they were functionally identical

tulip sleet
#

If I take it away the pip install is fine, though now pre-commit complains, whether or not it's running in a venv.

tulip sleet
#

If I update the pylint in a .pre-commit-config.yaml (for instance, in Adafruit_CircuitPython_HID) then errors go away. This is after installing the latest pre-commit into my venv

onyx hinge
#

😕 we are a bit stuck due to whatever the exact incompatibility is of that old pylint.. is work on switching to ruff ongoing or stalled?

short tendon
#

@onyx hinge did I drop the ball? I thought ruff was in your court?

#

We can also just bulk update pylist to get us past this point

onyx hinge
#

me personally, or adafruit's court generally? I haven't been working on it.

short tendon
#

My impression was you personally. But I have no idea how priorities work. I can go update all the libraries and make PRs (and automate what I can)

onyx hinge
#

oof, OK. no, this isn't something Adafruit's prioritized for me to work on. 😕

short tendon
#

okay. @tulip sleet or @onyx hinge how can I help

#

We could update the pylint version and do the patch. Any repo that then fails tests I can pump through updating

tulip sleet
#

@lone axle has tools to make these sorts of bulk changes

#

we don't have to do this now. This is just a local problem. We have pinned python to 3.11 in the repos

#

this was just trying to figure out why i was having trouble installing things in a 3.12 system. It was due to a workaround for the pre-commit problem, which is due in part to the older pylint. So it's a multistage issue, but not urgent. I can always use a 3.11 venv locally to run pre-commit.

short tendon
#

okay... I still think getting pylint updated or switched to ruff would be a good idea. Is there a way I can help there?

tulip sleet
#

we can wake up the ruff work, but it's not urgent. We can ask foamyguy tomorrow or later.

short tendon
#

👍

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.1.0-beta.1-13-g7fb791023c-dirty on 2024-04-28; Pimoroni Badger 2040 with rp2040

(built from https://github.com/gdg-berlin-android/zepython, meaningful difference: https://github.com/gdg-berlin-android/ZePython/blob/10bf2bafb474783c30970ffb7c2567357697b938/shared-module/epaperdisplay/EPaperDisplay.c#L210 )

Code/REPL

import board

board.DISPLAY.refresh()

Behavior

sometimes the busy line doesn't ...

lone axle
# tulip sleet <@382939733107408897> has tools to make these sorts of bulk changes

@short tendon, @onyx hinge. IIRC from when Ruff was discussed during a meeting (or perhaps before/after in discord) we were going to start moving forward with rolling it out. I think we got @proven garnet involved at that time.

Tekktrik is this something you have the time to help with (rolling out Ruff to libraries?).

If not I can try to take a look into it with the tools that I've got, but I'm not sure that the way I've done things in the past will be able to fully automate the updates to Ruff compliant syntax. It could update the config files, but there would still be manual work to update the code to make it pass the new actions. I haven't really attempted, but this is my best guess based on how I've done some of the automation in the past.

fringe yarrow
#

Are we going to have a celebration when support hits 500 boards? Only 5 more to go..

tulip sleet
#

yes

#

we mark these milestones for various round numbers

fringe yarrow
#

I've already done all the stuff I had in my collection.. Was hoping I might get number 500, but I'm out of boards to do..

tulip sleet
#

there will always be more boards 🙂

fringe yarrow
#

I have the Heltec Wireless Paper board, which has an epd that's supposedly supported by CircuitPython, if the compatibility matrices between epd models are to believed.. But I can't get it to refresh without locking up.. Similar to that last submitted Issue, but instead of once in a while, it's every time..

tulip sleet
#

every board that gets added adds to the build times, so I encourage people to add boards they are going to use, not just boards for boards' sake (i.e. not random aliexprss junk)

fringe yarrow
#

Understandable.. the only one I'm struggling to find a use for that I've recently submitted is that 7" IPS display ESP32S3.. It's too big for most projects..

proven garnet
short tendon
#

@onyx hinge sorry, too many new people, I got confused on who was working on it...

onyx hinge
#

@short tendon no problem, and of course the fact is I do drop the ball more than I'd like to admit

short tendon
solar whale
#

I'm trying to use a PicoW with AIO and am running into memory errors in the connection manager -- am I doing something wrong? Here I am jsut trying to access a feed ```

Adafruit CircuitPython 9.1.0-beta.1-14-g126a1a4154 on 2024-04-29; Raspberry Pi Pico W with rp2040

import aio
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "aio.py", line 33, in <module>
File "adafruit_io/adafruit_io.py", line 748, in get_feed
File "adafruit_io/adafruit_io.py", line 578, in _get
File "adafruit_requests.py", line 591, in get
File "adafruit_requests.py", line 525, in request
File "adafruit_connection_manager.py", line 290, in get_socket
File "adafruit_connection_manager.py", line 215, in _get_connected_socket
MemoryError:

code runpy
import os
import ssl
import wifi
import socketpool
import adafruit_requests
from adafruit_io.adafruit_io import IO_HTTP, AdafruitIO_RequestError

WiFi

Add settings.toml to your filesystem CIRCUITPY_WIFI_SSID and CIRCUITPY_WIFI_PASSWORD keys

with your WiFi credentials. DO NOT share that file or commit it into Git or other

source control.

Set your Adafruit IO Username, Key and Port in settings.toml

(visit io.adafruit.com if you need to create an account,

or if you need your Adafruit IO key.)

aio_username = os.getenv("ADAFRUIT_AIO_USERNAME")
aio_key = os.getenv("ADAFRUIT_AIO_KEY")
pool = socketpool.SocketPool(wifi.radio)
requests = adafruit_requests.Session(pool, ssl.create_default_context())

Initialize an Adafruit IO HTTP API object

io = IO_HTTP(os.getenv("AIO_USERNAME"), os.getenv("AIO_KEY"), requests)

found_feed = False

Adafruit IO feed configuration

try:
# Get the 'camera' feed from Adafruit IO
feed = io.get_feed("picocam")
print("Got feed")
found_feed = True
except AdafruitIO_RequestError:
# If no 'camera' feed exists, create one
# it neese to be amnually created
print("Create a feed named picocam and turn off history")

lone axle
#

IIRC when it was discussed last I also thought we had talked about commiting changes directly rather than having to make PRs with the changes since it would end up being 1 per repo basically which will be a load of extra clicking around in the front end interfaces to get PR created / reviewed / merged.

tulip sleet
short tendon
solar whale
#

oops -- that was for @tulip sleet

tulip sleet
# solar whale

usb_host and usb_video are turned on, we wanted to turn those off. They grab ram

solar whale
#

@tulip sleet - sorry -- I lost track of the time and have to run out. I can try a build removing them later today or maybe tomorrow -- Thanks.

tulip sleet
solar whale
#

I'll check on that

tulip sleet
#

@short tendon so I will make the ESP32SPI and Wiznet libs get a major version bump after merging your PR's, right?

tulip sleet
#

okee dokee

#

and we can do the secrets updating business later

short tendon
#

Also, what do you want to do on that learn guide? Because it doesn't work now anyway. adafruit_azureiot dropped support for the ESP32SPI

#

Although, it wouldn't be hard to add in

#

ConnectionManager should also get a major bump

tulip sleet
#

oh, really, ok, maybe guide should be redone. I can mention it to Brent, the guide's author

#

what is the connectionmanager incompatibility that I should note in the release notes?

#

i thought it was only additional support for ESP32SPI and Wiznet, so I thought it was a minor bump

short tendon
#

it's changed to use the new methods for ESP32SPI and Wiznet

#

I guess it can be a minor

tulip sleet
#

so if you were using CM for ESP32SPI, that changed. (Now I forget whether it worked at all with ESP32SPI before.)

#

if that changed, yup, that's an incompatibility. no problem bumping the major veresion

short tendon
#

it worked with it before. but if you did an update with circup I think I would want it to ask for updating both

tulip sleet
#

i will do major, np

#

summary
2.0.0 - updated to handle changes in ESP32SPI and WIZNET5K API's

#

@short tendon ok all three release with major version bumps. Going for a walk.

short tendon
#

WOOT!!!

slender iron
manic glacierBOT
#

Nevermind, this is a board radio issue.
The ESP32-C3 Supertiny antenna is borked. Soldering a custom antenna fixes it.

I tested on my beetle c3 and that worked fine with latest master.
From there I googled about this specific board and found numerous threads that this board has borked wifi, linking sample.
https://community.home-assistant.io/t/esp32-c3-super-mini-wifi-signal-booster/657661

To verify it's really not CircuitPython, I tested idf5.2.1 `examples/wifi/getting-started/stati...

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.4 on 2024-04-16; Adafruit QT Py RP2040 with rp2040

Code/REPL

# n/a see Description

Behavior

n/a see Description

Description

Hi,

The sample on page https://docs.circuitpython.org/en/latest/shared-bindings/i2ctarget/index.html is kind of incomplete and insufficient.
Also, there is an error in this page.

First the error in formatting of the line "I2CTargetRequest.read() ack=False." a...

short tendon
tulip sleet
short tendon
# tulip sleet Thanks, I will mention the azure stuff to Brent. You said it already dropped sup...

Yes 2 years ago: https://github.com/adafruit/Adafruit_CircuitPython_AzureIoT/commit/75af72b6b80388f2365c736039deb8507b11451d. It was hard-coded to use ssl. I fixed a few things recently that made it work in general: https://github.com/adafruit/Adafruit_CircuitPython_AzureIoT/commit/10bb5307e030e18edf723bfda20e9addaf9e5c2c, but didn't spend the time to get it working for ESP32SPI .
Not that it would be hard to add

tulip sleet
#

Thanks - I will bring this up.

short tendon
#

Cool

slender iron
#

@tulip sleet around for a quick design chat?

tulip sleet
#

sure

prime flower
#

@short tendon Hi! You mentioned you fixed a few things that made the AzureIoT library work in general, namely fixing ssl and set_socket. What work would be required to get this library working with the ConnectionManager/ESP32SPI like we have in other libs. like Adafruit IO CircuitPython?

manic glacierBOT
#

To further complicate the (now closed) issue, I would toss in that I've used the Supermini C3s for many projects now and have never had an issue connecting it to wifi. I just built the latest to ensure this issue wasn't something newly introduced:

Adafruit CircuitPython 9.1.0-beta.1-11-g94afcaa48a on 2024-04-30; Maker Go ESP32C3 Supermini with ESP32-C3
>>> 
>>> import wifi
>>> wifi.radio.ipv4_address
192.168.73.185
solar whale
short tendon
# prime flower <@1152454697614069811> Hi! You mentioned you fixed a few things that made the A...

So looking at iot_mqtt.py:
we have:

    def __init__(
        self,
        callback: IoTMQTTCallback,
        socket,
        iface,
        hostname: str,
        device_id: str,
        device_sas_key: str,
        token_expires: int = 21600,
        logger: Logger = None,
    ):

and then later:

        self._mqtts = MQTT.MQTT(
            broker=self._hostname,
            port=8883,
            username=self._username,
            password=self._passwd,
            client_id=self._device_id,
            is_ssl=True,
            keep_alive=120,
            socket_pool=self._socket,
            ssl_context=ssl.create_default_context(),
        )

The ssl.create_default_context() is the problem.

If we updated it to take a SocketPool (which is what self._socket is already) and a ssl_context (instead of iface which isn't even used anymore), if should work.

And then the same thing in device_registration.py

manic glacierBOT
prime flower
short tendon
prime flower
# short tendon I do. I created a demo one to fix the other bug that was found

Okay, I see where the issue is.. I'm wrapped up in a large project currently and may not have time to implement this. If you are willing to make the changes to update the ssl.create_default_context() calls, and tag me on a PR, I can review and test. When changes are in-place, I'll also do a pass over that planter guide I wrote to ensure it's working.

solar whale
#

@tulip sleet FYI, I had bit of time, so I tried turning off PICODVI and USB_HOST,```GEN build-raspberry_pi_pico_w/genhdr/qstrdefs.generated.h
/Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: warning: build-raspberry_pi_pico_w/firmware.elf has a LOAD segment with RWX permissions
Memory region Used Size Region Size %age Used
FLASH_FIRMWARE: 1367472 B 1532 KB 87.17%
RAM: 89940 B 256 KB 34.31%
SCRATCH_Y: 0 GB 4 KB 0.00%
SCRATCH_X: 0 GB 4 KB 0.00%
Converted to uf2, output size: 2735104, start address: 0x10000000
Wrote 2735104 bytes to build-raspberry_pi_pico_w/firmware.uf2
jerryneedell@Mac-mini raspberrypi % scp build-raspberry_pi_pico_w/firmware.uf2 gjnpi5nvme.local:picow.uf2

tulip sleet
#

thanks for testing. as bablokb mentioned, there is still a lot of increased ram consumption

solar whale
#

This does not bode well for using the camera with the pico-w.... too bad.

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.4 on 2024-04-16; Adafruit KB2040 with rp2040

Code/REPL

if supervisor.runtime.serial_bytes_available:
    data = input()
    print(data)

Behavior

On windows, enter will be encoded as \r\n (0x0D, 0x0A)
However, the input seems only recognize the \r, and the 0x0A cause the code to freeze at the input()

I've tried to send 0x0D only, the input has response.
Then I tried 0x0A, the input has no res...

crimson ferry
#

@solar whale what does the RAM section there mean? On a fresh reload, I get gc.mem_free() of 126160 with CP 9, 16K more on CP 8 (Pico W). I think the assumption was that it was due to those two modules, but maybe there's something else going on.