#circuitpython-dev

1 messages · Page 20 of 1

proven garnet
#

Just the PR to do it next time

onyx hinge
#
  • 121295 PyPI downloads over 306 libraries
    is a lot 🙂
manic glacierBOT
onyx hinge
#

and thanks to scott for the original feature using the "dotenv" package

manic glacierBOT
turbid radish
#

😊

onyx hinge
thorny jay
#

There are a few gradient generating code in my thermal camera code.

lone axle
#

Nice, I'll check that out. I'm interested in any inspiration and prior examples I can find.

errant grail
onyx hinge
#

[everyone tries to figure out if cgrover is joking about the anti-happy-birthday ordinance]

turbid radish
#

👏

tulip sleet
#

i assumed it was a joke. thank goodness it's no longer copyrighted

turbid radish
#

Maybe a new SUbaru, Jeff?

onyx hinge
#

We've been mostly happy with subarus over the years, but weren't looking at subarus this time around.

#

prius hits a sweet spot for us with regard to size, and we like the fuel economy of the hybrid engine

tulip sleet
onyx hinge
#

yeah a used prius goes for the same price as a new prius, because you're buying "not waiting 6 months"

tulip sleet
#

we also got a 2013 very low mileage Corolla a year later, and those prices are also higher

lone axle
manic glacierBOT
onyx hinge
#

Week of December 26: no meeting

#

Week of January 2: Meeting bumped to Tuesady

slender iron
#

thanks for hosting @lone axle !

onyx hinge
#

Yes, thanks! I'll head out, but let me know if you turn out to need the back-up recording

ember iris
#

Thanks all!

manic glacierBOT
lone axle
#

Interesting new wrinkle in the host workflow for me. Drag and Dropping the video file to the upload box on YT was not working. I was getting "file invalid" type errors. It seems to work okay by using the Browse button instead of drag and drop though.

#

this is the first time actually uploading from my new computer I think. I switched primary browsers to firefox at the same time though so lots of variables. I can remember to use the button.

proven garnet
turbid radish
#

How's it going @lone axle ?

lone axle
turbid radish
#

👏

lone axle
#

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

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.5 on 2022-12-08; Raspberry Pi Pico W with rp2040

Code/REPL

import time
import traceback
import wifi
import socketpool
import ssl
import adafruit_requests
from secrets import secrets

TEXT_URL = "http://wifitest.adafruit.com/testwifi/index.html"

print("Connecting...")
wifi.radio.connect(secrets["ssid"], secrets["password"])
print("My IP address is", wifi.radio.ipv4_address)

pool = socket...
orchid basinBOT
#

I try to manage expectation about this board and avoid short circuit or broken sensor. 1) I almost burned myself by mixing LOLIN I2C JST SH accessories and Adafruit QTPy, reverse way, I could have destroyed an Adafruit sensor by connecting it to Lolin S2 Pico. 2) The screen does not work as expected for a build-in screen, DISPLAY is not defined when you import board

I did hesitate between making a special section like "Caveats" or highlighting how it deviate from one can expect from a bo...

onyx hinge
#

https://github.com/jepler/circuitpython/commit/e635457a32b1cc3b4b611808fcdd16951d12f99c @tulip sleet @slender iron and anyone else interested, this is a non-booting sketch of what I'm thinking when it comes to revamping supervisor allocation.

Key is, whenever gc is up, supervisor allocations are also 'regular' allocations, so making a supervisor allocation is just gc_alloc + some slight additional bookkeeping. A freed supervisor allocation becomes gc collectable. supervisor allocation moves are done when gc is initialized.

I didn't try to debug anything, only got it to where it'd build for pico w.

#

@tulip sleet I'll put that aside and look at the problem you saw with getenv

proven garnet
slender iron
#

@onyx hinge please file an issue for it so it hits my inbox

onyx hinge
#

@tulip sleet at 8.0.0-beta.5-27-g1b15985783 pico w wireless works, including workflow. hum. are either your ssid or password close to the size limit?

#

I'll get out an espressif board next

orchid basinBOT
manic glacierBOT
tulip sleet
#

i will try on Pico W

slender iron
#

@tulip sleet you have time now/soon? I'm thinking about pin management with the ULP

#

and you did preserved pins

tulip sleet
#

now is fine

slender iron
#

k, let me close the door

#

I'm in Amelia Earhart

manic glacierBOT
#

I have a sketch at https://github.com/jepler/circuitpython/commit/e635457a32b1cc3b4b611808fcdd16951d12f99c but it doesn't boot.

The idea is to do more to leverage the gc allocator to make the supervisor allocator work.

See the commit message for more details.

Entered as an issue at @tannewt 's request

I don't plan to work on this until after 8 is out, but it was in my brain and I had to do at least this much of it.

slender iron
#

@tulip sleet @onyx hinge any thoughts about exposing pin number to python? I'd need it to patch a ulp program

#

could do as .pin_number or int(pin) I think

#

or I could add a ULP function to do it

tulip sleet
#

is it RTC_GPIO_n or GPIO_n or is it lower level than that?

slender iron
#

RTC_GPIO_n

#

(which is a subset of GPIO_n)

#

0 - 21

tulip sleet
#

lemme look at the doc

slender iron
#

afaik it isn't expose to python yet

tulip sleet
#

on ESP32-S2, GPIO2 == RTC_GPIO2, but on ESP32, GPIO32 == RTC_GPIO_9, etc

slender iron
#

kk, I only looked at S3 and S2

#

I'll just add a module level function to espulp

tulip sleet
#

that was the craziness I mentioned in our video talk

slender iron
#

espulp doesn't target esp32 now anyway

onyx hinge
#

I think int(pin) is not great, I'd do .pin_number or .number.

slender iron
#

I'm just going to do espulp.get_rtc_gpio_number()

#

that way it won't leak to other ports

midnight ember
#

@slender iron just sitting down to listen to the meeting. Have you considered a dedicated NAS, synology is a very popular brand.

slender iron
#

I have an old qnap

#

I'll have to look more into it

#

I could also put the old cpu and mobo back in the comp...

midnight ember
#

Though if the PC would have just worked probably wouldn't even be bringing it up. Sucks to hear the PC woes.

slender iron
#

yup, frustrating for sure

midnight ember
#

Have you tried unplugging it, waiting a couple minutes, and plugging it back in? Sounds basic but during a lightning storm if there's an electricity loss sometimes my PC's actually refuse to power back on unless I do that.

#

it trips the circuit protection in the PSU

slender iron
#

I didn't unplug, just flipped the psu switch

midnight ember
#

Honestly don't know if there's a difference, I always unplug just to make sure the caps drain fully.

#

Make sure you got the motherboard headers for the power switch correct? If you get them backwards it might turn on and never again. The motherboard power switch pins wait for a 12V blip of a toggle switch.

#

Also make sure the power button isn't stuck... that actually happened to me with my current PC case. I had to dremel part of the power button so it would slide smoothly.

#

a way around PC power buttons it to jump the power sw headers with a screwdriver or jumper directly.

#

hopefully it's something simple that doesn't require parts replacement 🤞 wish you good luck.

manic glacierBOT
#

Thanks for 3620d14. Now my Metro ESP32-S2 is coming up in web workflow. I am still have odd crashes. Now I am getting HardFault_Handler safe mode when using the file browser to download a file that is not known to be a text file:
image

I am not having this problem with the tip of main right now.
Backtrace is:

0x400a8850: _send_str at /home/halbert/repos/circuitpython/ports/e...
tulip sleet
#

@onyx hinge I edited the report above -- I am seeing similar issue on Pico W

#

this seems like it might be a storage and/or gc issue

manic glacierBOT
onyx hinge
#

@tulip sleet this is wrong before and after

     } else {
-        _send_str(socket, "Content-Type: application/octet-stream\r\n");
+        _send_strs(socket, "Content-Type:", "application/octet-stream\r\n");
     }
tulip sleet
#

because of the missing NULL, right?

onyx hinge
#

right

#

I pushed a fix and enabled a gcc attribute so it would have been a compile-time diagnostic.

tulip sleet
onyx hinge
#

it's specifically the pico w that is not consistently coming up now?

tulip sleet
#

yes

onyx hinge
#

re-plugging or resetting?

tulip sleet
#

I do a UF2 load and CIRCUITPY does not appear. Plugging it in and unplugging several times and it eventually shows up, but not necessarily on the first power cycle

onyx hinge
#

I think I just had it happen on trial 6 of re-plugging

tulip sleet
#

aha

#

back later -- thanks!

#

i am unplugging at the USB-A end; easier on the fingers!

onyx hinge
#

yes

#

same here

#

I notice common_hal_wifi_radio_connect can throw, which would go crashy-crashy during wifi workflow startup, pursuing that angle..

#

doesn't look like anything that should happen though

jaunty juniper
#

you could get some magnetic USB plugs for testing plugging/unplugging, I think Adafruit has some 😉

onyx hinge
#

the cables weren't in stock last time I looked but yeah I have some of those

#

@tulip sleet this affected rebooting from the bootloader back to circuitpython, so it's different than the "delay 1s at startup" problem, right? because that was a cold boot only scenario as I understood it.

tulip sleet
onyx hinge
#

most failures return error codes, but a few failures don't

#
 wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t *ssid, size_t ssid_len, uint8_t *password, size_t password_len, uint8_t channel, mp_float_t timeout, uint8_t *bssid, size_t bssid_len) {
     if (!common_hal_wifi_radio_get_enabled(self)) {
-        mp_raise_RuntimeError(translate("wifi is not enabled"));
+        return WIFI_RADIO_ERROR_UNSPECIFIED;
     }
#

enabled is just a flag and web_workflow calls enable() so it can't happen

#
        mp_raise_RuntimeError(translate("Wifi is in access point mode."));
    }

```then there's this one, which is querying the device I think
#

but how could the AP be up at that point

tulip sleet
#

I changed some STM PWMOut code (I think that was it) to only return error codes, so I could call it outside the VM safely (maybe in LED status code or something). Or maybe I was just trying to be consistent

onyx hinge
#
From 90894014a2e146e07c2ea4f9f840242fc33bf6a0 Mon Sep 17 00:00:00 2001
From: Jeff Epler <jepler@gmail.com>
Date: Mon, 12 Dec 2022 19:43:10 -0600
Subject: [PATCH] Use the HW LED as status indicator

For me this made a rare startup failure stop, which is nonsense.
---
 ports/raspberrypi/boards/raspberry_pi_pico_w/mpconfigboard.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ports/raspberrypi/boards/raspberry_pi_pico_w/mpconfigboard.h b/ports/raspberrypi/boards/raspberry_pi_pico_w/mpconfigboard.h
index e5d8660b2b..a31ee7327c 100644
--- a/ports/raspberrypi/boards/raspberry_pi_pico_w/mpconfigboard.h
+++ b/ports/raspberrypi/boards/raspberry_pi_pico_w/mpconfigboard.h
@@ -4,5 +4,7 @@
 #define CIRCUITPY_DIGITALIO_HAVE_INVALID_PULL (1)
 #define CIRCUITPY_DIGITALIO_HAVE_INVALID_DRIVE_MODE (1)
 
+#define MICROPY_HW_LED_STATUS   (&pin_CYW0)
+
 #define CIRCUITPY_BOARD_I2C         (1)
 #define CIRCUITPY_BOARD_I2C_PIN     {{.scl = &pin_GPIO5, .sda = &pin_GPIO4}}
-- 
2.34.1

``` this is a nonsense fix
#

but it's made me succeed 15/15 tries, when I was getting >1/10 failures before. but never 50/50 failures like you seemed to be describing.

tulip sleet
#

I was getting 4/5 failures

onyx hinge
#

I certainly wasn't getting that

tulip sleet
#

it's confusing; I will try again with tip of main. I think this is timing or uninitialized memory or floating pins or something

#

are the CYW pins all firmly set to something before startup is attempted?

onyx hinge
#

that's an unanswerable question.

#

you mean the HW interfacing pins between Pico & CYW or do you mean the CYW's GPIOs, which is what the status LED above is?

tulip sleet
#

hw itnerface pins; the pins you use tot talk to it

#

CS, etc

onyx hinge
#

that is all managed in the sdk

#

I assume it's right

#
    never_reset_pin_number(24);
    never_reset_pin_number(25);
    never_reset_pin_number(29);
``` I never-reset them and that's all I ever do
#

reset_all_pins is called before this

tulip sleet
#

we don't accidently reset those pins ... just what I was going to ask, but on hard reset, are the never_reset's in effect? The espressif code has "reset forbidden" pins so the SPI flash pins etc are not disturbed

#

it's just a hypothesis

onyx hinge
#

if this is really the initialization problem then why did it only appear for you today?

tulip sleet
#

no idea; just a timing difference, maybe. I did not try my Pico W with web workflow before

#

but... I was having trouble before that, so never mind, I think that's not it. I am going to re-test the ESP32-S2 and try the BLE workflow name setting and get the PR merged. Then I will come back to testing this more systematically, maybe with a bisect

onyx hinge
#

at power on GPIO pull down is enabled. However, gpio reset (circuitpython reset_pin_number) turns pull down enable off. So it could allow an interface pin to float up

#

OK pushed those things

crimson ferry
#

you two are talking about behavior due to post-beta.5 changes, right, rather than generic beta.5 picow?

tulip sleet
#

it appears so

crimson ferry
#

don't know if it's relevant at all, but sockets are broken in beta.5 on picow if web workflow is enabled (you may have seen the issue)

onyx hinge
#

I wonder if #define MEM_SIZE 4000 this needs to be increased (in ports/raspberrypi/lwip_inc/lwipopts.h)

#

the repeated retries stuff in requests conceals the "real exception", whatever it is.

#

and it's written in a way that exception chaining doesn't help 😭

tulip sleet
#

fyi, sorry, CPB build is not working even without settings.toml

onyx hinge
#

OK

#

good to know

tulip sleet
#

maybe we should leave this all for the morning

onyx hinge
#

I pushed the cyw43 initialization changes at least

tulip sleet
#

tip of main for CPB is working

onyx hinge
#

mp_obj_t ble_name = common_hal_os_getenv("CIRCUITPY_BLE_NAME", mp_const_none); yeah this is suspicious, I don't think the heap is up so the object variant can't be used

tulip sleet
#

it does quick blue flashes twice and then nothing

onyx hinge
#

probably needs something like```diff
diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c
index 8948be1a5d..483895b5bb 100644
--- a/ports/nrf/common-hal/_bleio/Adapter.c
+++ b/ports/nrf/common-hal/_bleio/Adapter.c
@@ -346,9 +346,11 @@ STATIC void bleio_adapter_reset_name(bleio_adapter_obj_t *self) {
mp_int_t name_len = 0;

 #if CIRCUITPY_OS_GETENV
  • mp_obj_t ble_name = common_hal_os_getenv("CIRCUITPY_BLE_NAME", mp_const_none);
  • if (ble_name != mp_const_none) {
  •    common_hal_bleio_adapter_set_name(self, mp_obj_str_get_str(ble_name));
    
  • char ble_name[32];
  • getenv_err_t result = common_hal_os_getenv_str("CIRCUITPY_BLE_NAME", ble_name, sizeof(ble_name));
  • if (result == GETENV_OK) {
  •    common_hal_bleio_adapter_set_name(self, ble_name);
       return;
    
    }
    #endif
#

while the one in bleio-hci was assuing that the heap was live even before my change: self->name = mp_obj_new_str(ble_name, (size_t)name_len); and I must have copypasted my assumptions

tulip sleet
#

testing now

#

need to add some includes

onyx hinge
#

and the type was misspelled

tulip sleet
#

got that

onyx hinge
#

either way I'll stop for the night now

#

or after I hear your result

tulip sleet
#

ok, it's coming up without the workflow enabled

#

(I have an animation running, ahven't tried BLE yet)

#

(I was using this CPB on Halloween)

#

i mean without settings.toml, not without the workflow

onyx hinge
#

ah

#

that means workflow comes up but with default name?

#

presumably

tulip sleet
#

not seeing workflow yet, trying beta.5 to make sure

#

@onyx hinge I am too tired to figure out what is going on with the workflow, no worries, will test when I'm more coherent. I checked off the ESP32 workflow test.

onyx hinge
#

thanks, goodnight

tulip sleet
#

you too!

manic glacierBOT
#

suport pulseio.pulseOut on M5Stack Atom Lite
My check result shows below.

[ Circuitpython version ]
Adafruit CircuitPython 8.0.0-beta.5 on 2022-12-08; M5Stack Atom Lite with ESP32

[ Result ]
Start
Traceback (most recent call last):
File "", line 23, in
File "", line 17, in send_ir_pulse
AttributeError: 'module' object has no attribute 'pulseOut'

[ source code ]
import pulseio
import pwmio
import array
import board
import time

IR Pulses

IR_head_pulse = array.arr...

manic glacierBOT
young frost
#

Any activity using DMA with PIO and RAM in CircuitPython?

young frost
#

Oh, does ‘readinto’ utilize DMA?

onyx hinge
#

both read and write use DMA if the buffer is large enough but they block until completion. Often when people ask about DMA they are actually asking about background operation

#

so I answered that question instead

young frost
#

Thanks that makes sense. I am trying to port a microPython program to circuitPython for HID support. I had the DMA triggering from the RXFIFO

manic glacierBOT
#

As the Olimex ESP32-POE board is currently not listed on the CircuitPython downloads page I assume this is not supported so far:
https://www.olimex.com/Products/IoT/ESP32/ESP32-POE-ISO/

That is a great board, however, and one of the very few (if not the only) option if you need a very compact and energy efficient board with PoE support.

Is there a chance CircuitPython could add support for this?

This would be highly appreciated, thanks for all ...

jaunty juniper
young frost
#

Not host, doing device emulation

#

I’m using PIO for a high speed communication to FPGA

onyx hinge
#

@tulip sleet I have no idea how to test BLE workflow. is there an app for android?

tulip sleet
#

i don't think there is an Android app. Do you have no iOS device?

onyx hinge
#

none

manic glacierBOT
#

I performed a brief search for this issue and did not see anything.

I am running CircuitPython v 8.0.0 beta 5 from 12-11-2022 I believe.
Hardware is:
Feather ESP32 S3 TFT PID# 5483
MAX17048 PID# 5580 - Adafruit MAX17048 LiPoly / LiIon Fuel Gauge and Battery Monitor - STEMMA JST PH & QT / Qwiic

I am following the Adafruit Learn guide here

My library matches the tutorial as does my code belo...

#

Hello Dan,

first thanks a lot for your reply quick reply which is much appreciated!

I would be happy to help with that and I do think that I could get it to work in WiFi mode as this board is based on the regular ESP32 chip - so copying the configuration from one of the already supported boards should work. Here the hardware configuration of that board from PlatformIO which supports it:
https://docs.platformio.org/en/latest/boards/espressif32/esp32-poe-iso.html

The main challenge I ...

tulip sleet
onyx hinge
#

I tried code.circuitpython.org in chromium on my linux machine and even after making all the settings it asked for the "request bluetooth device" button is still greyed out

#

@tulip sleet let's assume I won't have my hands on an ios device today

tulip sleet
#

I will try it again in a few minutes and let you know what I am seeing. Doing a non-work thing.

onyx hinge
#

of course!

orchid basinBOT
#

Hi @deshipu , yes there must be a way to have the screen work as expected but apparently it is the first board where the screen is connected in I2C so there was no example to copy from.
https://github.com/adafruit/circuitpython/issues/7325#issuecomment-1345048637

If this PR make's it, and then later someone implement that the proper way, we can remove the warning (or say starting with CP9.0.0-alpha1 this statement is not true anymore).

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.5 on 2022-12-08; Waveshare ESP32-S2-Pico with ESP32S2
Adafruit CircuitPython 8.0.0-beta.5 on 2022-12-08; Raspberry Pi Pico W with rp2040

Code/REPL

import wifi
a = wifi.radio.start_scanning_networks()
for i in a:
  print(str(i.authmode))

Behavior

[None, None]
[None, None]
[None, None]
[wifi.AuthMode.WEP, None, None]

Description

wifi.Authmode.WPA2?
wifi.Authmode.OPEN?

Ad...

slender iron
#

@onyx hinge we have pyleap and glider for android on github

tulip sleet
#

not released as apps?

slender iron
#

both should be setup with CI that build apks

slender iron
#

not released yet. I encouraged antonio to do it but then sent him on a side quest...

edgy flax
#

ok, so on a pi pico does 'board' not return SCL and SCA?
from board import SCL, SDA
Traceback (most recent call last):
File "code.py", line 7, in <module>
ImportError: cannot import name SCL

amber sundial
#

I don't see them defined seperately in pins.c

tulip sleet
#

There is more than one set of "defaults"

onyx hinge
#

@edgy flax the silkscreen of the pico does not designate a default I2C bus so CircuitPython does not either. However, in 8.0 beta we do designate "board.STEMMA_I2C" which is the port that is compatible with the Adafruit "cowbell" add-on.

amber sundial
tulip sleet
amber sundial
#

anyways these two pins (and a combination of others) should work?

tulip sleet
#

so pick any two that are I2C0, or any two that are I2C1

#

you could use GP5 and GP4, you could also use GP5 and GP0

#

but that's more confusing

#

they don't have to be physically adjacent

amber sundial
#

@tulip sleet can I ask you about something else .. I have a problem at the moment where when I use a compiled uf2 from the RP pico SDK, my program doesn't boot on a power cycle. With a uf2 from circuitpython it does always work (hooray!!); where can I look up which flags you set for the pico SDK?

I already found this one

#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64

and are you also using this one?

#define PICO_DEFAULT_BOOT_STAGE2 boot2_generic_03h

In circuitpython I use EXTERNAL_FLASH_DEVICES = "W25Q64JVxQ", I have that one on my board.

#

So this isn't strictly a Circuit Python problem, more a problem that Circuit Python has already solved ❤️

#

The question would be, where can I look up what EXTERNAL_FLASH_DEVICES does

tulip sleet
#

have you set the multiplier already?

amber sundial
#

yes! building my board in circuit python works reliably with that flag

#

and it also reboots reliably

tulip sleet
#

so you need to also set that flag in the UF2 you are building in the pico-sdk. We have that set in our board definitions that were added to pico-sdk. lemme find that

#

i guess we are using the GENERIC flag in those .h files, but not in CircuitPython

amber sundial
tulip sleet
#
// Use slower generic flash access
#define PICO_BOOT_STAGE2_CHOOSE_GENERIC_03H 1
#

i thought it's used automatically as part of the complex CMake logic. You set which board you are compiling for, and it picks up that include? I forget, sorry. You can check that by introducing an #error temporarily in the .h file to see if it gets read

amber sundial
#

I'll have to say it was charmingly easy to set this up in Circuit Python

tulip sleet
#

thanks - we want to make it easy for us, and that transfers over 🙂

onyx hinge
#

@tulip sleet yes it seems like if I change the BLE name I have to forget & re-pair but that's probably expected

#

but I can set a custom name in settings.toml and connect to it

#

just pushed the fix, which was slightly different than the non-working patch I shared last night

#

(name_len was never being set anymore)

tulip sleet
#

i am having trouble getting Glider to connect again after changing from 7.3.3 to 8.0.0-beta.5. I forgot everything and even turned Bluetooth and and off on the iPhone. However, iOS caches BLE stuff very agressively. I may try power-cycling the phone.

#

i could also try with an Android tablet

#

ah, I had to clear bonding info yet again on the CPB

onyx hinge
#

I guess I did that too at somewhere along the line

#

CIRCUITPY_BLE_NAME="0123456789012345678901234567891" this works (31 chars) but 32 chars gets me the name "nRF5x"

#

which is weird, it should get default_ble_name!

tulip sleet
#

not checking return code from that properly?

#

might be deep in _bleio

tulip sleet
amber sundial
tulip sleet
amber sundial
#

yes and also most of the actual layout around the chip

#

ah hang on we used that from the pico documentation

tulip sleet
#

so 18 pF caps + their crystal?

amber sundial
#

there was a Kicad file and a hardware reference PDF

#

but we made a four layer board

#

my wife does the PCB and engineering so I don't have it from the top of my head

tulip sleet
#

the cap choice is described in one of the PDF's. Ah, interesting. We did a lot of experimenting because we originally we thought maybe we chose the caps wrong due to a typo, but replacing them did not fix the slow xosc startup. We know what our board yield was; we don't know what RPI's was; their samples didn't show this problem but maybe they are QA-ing those out

amber sundial
#

she says she calculated the caps from the formula in the reference PDF

edgy flax
tulip sleet
#

and you still had the problem, at least on some samples ... interesting

amber sundial
#

yes we only have 5 prototypes but they do behave differently

#

Circuit Python works reliably on all 5 so that configuration seems to work for us

onyx hinge
#

@tulip sleet OK I pushed another fix related to maximum buffer length

tulip sleet
#

lengthening the xosc startup seems very reliable

#

they might consider changing the default, I guess

tulip sleet
manic glacierBOT
slender iron
#

android glider and pyleap are in review @onyx hinge

#

for the play store

manic glacierBOT
manic glacierBOT
onyx hinge
#

@slender iron getenv_str and getenv_int could be moved to __init__.c (making os_getenv_buf_terminated part of the non-static API) but common_hal_os_getenv has to be in getenv.c so it can be linked with the unix coverage build without replacing the rest of 'their' OS module, which is a big undertaking we do not need right now. I like getting rid of the extra file, but I'd rather not do any of those other things right now.

#

(and honestly getenv_str and getenv_int would be nice to directly test in the testsuite; those are the code paths that are all about static buffers)

slender iron
#

that's fine. just document it somewhere

onyx hinge
#

I'll add a comment

// These functions are separate from __init__.c so that os.getenv() can be
// tested in the unix "coverage" build, without bringing in "our" os module
#

done & pushed

manic glacierBOT
onyx hinge
#

thanks for the pointer about _INTERNAL @slender iron

#

@tulip sleet one more build & review ! but no substantive change

#

that's interesting, when I "1200 baud trick" the CPB it gets into a broken bootloader mode and then when I reset-button it, I get into safe mode in CP

#

@tulip sleet is this the bootloader that is challenging to update? UF2 Bootloader 0.2.11-8-g2c13fd5-dirty lib/nrfx (v1.1.0-1-g096e770) lib/tinyusb (legacy-755-g55874813) s140 6.1.1 ?

tulip sleet
onyx hinge
#
Auto-reload is off.
Running in safe mode! Not running saved code.

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

Press any key to enter the REPL. Use CTRL-D to reload.
tulip sleet
onyx hinge
#

thanks

#

not sure I'll do that right now. Using the 1200 baud trick to reach bootloader is something I like to do but it's not really something commonly used by folks. I assume if this was still a problem for arduino we'd have heard about it.

#

(since it's the method arduino uses too)

manic glacierBOT
proven garnet
#

What's the status of the CircuitPython JTAG and MachXO libraries?

#

Asking because they haven't been updated other than upkeep in a while and they tend to be a large share of the Library Infrastructure page on circuitpython.org

tulip sleet
onyx hinge
#

e.g.,

For PyPI compatibility, missing optional_requirements.txt
https://github.com/adafruit/Adafruit_CircuitPython_JTAG  https://github.com/adafruit/Adafruit_CircuitPython_MachXO
tulip sleet
#

@proven garnet I don't see them in the bundle. Should we maybe leave Adafruit_CircuitPython_* libraries out if they are not in the bundle?

proven garnet
manic glacierBOT
tulip sleet
proven garnet
#

I think we could take the full list, we determine what isn't in the bundle (only non-Blinka libraries and exceptions), then use that new list for all the other checks

manic glacierBOT
proven garnet
#

The new list would include Blinka and the like

#

I can file an issue and self assign for adabot

tulip sleet
#

you have the whole list, so you could see what the exceptions are

proven garnet
#

Good idea!

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.5 on 2022-12-08; S2Mini with ESP32S2-S2FN4R2

Code/REPL

import board
import displayio
import adafruit_ili9341
import busio
import digitalio
import esp32_camera


displayio.release_displays()
display_bus = displayio.FourWire(
    busio.SPI(clock=board.IO7, MOSI=board.IO5),
    command=board.IO9,
    chip_select=board.IO3,
    reset=board.IO10,
    baudrate=40_000_000,
)
display = adafruit...
onyx hinge
#

@tulip sleet I don't reproduce the make check-stubs failure locally, do you?

#

oh wait I do

tulip sleet
#

i just did, I had to install the venv thing

#

something updated out from under us??

#

also fails on tip of main, not in your PR (as one would suspect

onyx hinge
#

I didn't check that

#

thanks for thinking to

tulip sleet
#

Using legacy 'setup.py install' for Adafruit-PlatformDetect, since package 'wheel' is not installed.

#

sudo apt install python3.10-venv caused new versions of mypy, isort, black, Blinka, pyserial to be downlaoded and instead.

#

so isort is the most suspicious update, considering that's the failure point

#

isort 5.10.1 was new in November 2021 :/

#

so hunh

#

5.10.1 was installed by pip, but we are using 5.11.2?

#

5.11.2 3 hours ago, 5.11.0 was yesterday

#

stopped supporting 3.6?

#

@onyx hinge are you debugging this, or should i try?

onyx hinge
#

no

#

I am not debugging it

tulip sleet
#

ok, i will spend a little time on it

onyx hinge
#

can you just pin isport?

#

I have a machine here with 5.9.3 of isort and it seems to be fine

#

but everything else is old too

tulip sleet
#

i will spend a few minutes on diagnosis, at least.

#

but will pin if it's not triviial

manic glacierBOT
#

On some URLs, with web workflow off, things appear to work. But the adding some print-debugging to Requests to expose the pass'd and retried exceptions, it looks like there is either OSError: [Errno 9] EBADF (in my case, for an mDNS address) or OSError: 32 [EPIPE?] (in my case, for a numeric local IPv4) on every other try, but the retry gets it, so nothing is reported with the standard library.

This happens in beta.4 and beta.5. So something has been lurking there that may be relat...

onyx hinge
#

@tulip sleet I'm back, did you figure anything else out about that stubs failure?

#

@tulip sleet from types import we seem to have this line in the generated _bleio.pyi

tulip sleet
#

from types import all alone by itself? hmm

onyx hinge
#

I think I have a fix if that's truly the problem

tulip sleet
#

that would be great, sounds simple

#

isort must have gotten stricter by accident

onyx hinge
#

yes older isort removed the line!

manic glacierBOT
onyx hinge
#
  File "<string>", line 1
    from types import ()
                       ^
SyntaxError: invalid syntax
```importing the empty tuple is not permitted either, interesting.
tulip sleet
#

I will undo the pin

#

force-push and merge the toml PR, sound OK?

#

well, I will merge your 7341 first, and then merge the TOML pr

onyx hinge
#

I'm not sure what you need to force-push but if you need to then do

tulip sleet
#

i pushed a pin of isort in your PR

onyx hinge
#

oh, yes, you can force-push it back out of my PR

#

I missed that, thanks

manic glacierBOT
slender iron
#

@proven garnet I can move those repos to myself too

tulip sleet
#

@onyx hinge I am cancelling some unnecessary PR runs to get things merged (in case you see "failed" email messages)

proven garnet
zenith sequoia
#

I just purchased a PyPortal Titano to do a PoC for a project that will use a large screen. This looks like a great product but for $60 will be too costly for a production run. What would be the process to add CircuitPython support for cheaper Chinese equivalents such as this:
https://a.aliexpress.com/_mKq21pC

onyx hinge
zenith sequoia
#

Are there detailed instructions for the whole process? I am happy to contribute but am not the maker of this board.

onyx hinge
zenith sequoia
#

Thank you

onyx hinge
zenith sequoia
#

Does this assume the designer of the board is doing this, or can a random user (me) do that for a purchased board?

onyx hinge
#

You can do it, for sure

#

Displayio is its own thing and not the most high performance.. micropython with lvgl might be something to consider as well. Not trying to dissuade you just offer alternatives

zenith sequoia
#

There is no port of LVGL to CircuitPython then I take it.

#

Interesting that last link mentions LVGL fits the vision of CircuitPython.

tulip sleet
#

a lot of what you want may be in various displayio-based libraries

manic glacierBOT
#

@ctmorrison I have been trying to reproduce this. I have been running your test program for about 8 hours, without a crash, on CircuitPython 8.0.0-beta.5. I reduced the sleep time from 15 seconds to 2 seconds to speed up the possibility of crashing.

Is this battery-powered? Might your battery be getting low when it starts crashing? I'm testing with a 5V AC adapter, so I am doing true deep sleep, but the power is steady.

manic glacierBOT
#

Forgot to mention that with web workflow on raspberrypi beta.5, when using the above code, I've tried several URLs. With the Adafruit URL, I don't know what the server sees, but none are successful. When I hit a WAN Apache server I can access (using domain name), the server shows HTTP 200 status codes and occasionally some are successful, but usually error as described above. But a LAN Apache server (using IP address) shows HTTP 408 status codes (server timed out). So it looks like some level...

manic glacierBOT
manic glacierBOT
jaunty juniper
#

would there be an interest for a full project in Circuitpython that acts as a client for Blinka ? Think U2IF but written in Circuitpython

tulip sleet
#

we can ask Management ( 🙂 )about it

jaunty juniper
#

I was wondering about firmata too, if there would be a point in blinka being able to talk to it

tulip sleet
jaunty juniper
#

yeah makes sense

manic glacierBOT
manic glacierBOT
#

Did some testing on espressif: none of the exceptions occur with beta.4 or beta.5 on QT Py ESP#@-S2 or QT Py ESP32-S3, including none of the "hidden" exceptions pass'd through Requests' retries.

However, with some URLs, the first try in the _send_request Requests loop gets an empty response (status code 200 on the servers in all observable cases) but the retry is successful.

manic glacierBOT
#

I'm testing with

Adafruit CircuitPython 8.0.0-beta.5-11-gfc13fba6e5-dirty on 2022-12-14; Raspberry Pi Pico W with rp2040

this contains some fixes to make a wider range of socket name lookup failures throw the "gaierror" exception as intended, but should be functionally identical to main.

wifi workflow is enabled. However, I have not connected to the web workflow interface or messed with resolving the device's mdns name from other computers.

To exclude as many factors as poss...

manic glacierBOT
manic glacierBOT
#

Just chiming in to say I think I'm having the same issue. I've designed a custom circuitpy board based around a raytac module but it uses the a split 1.8/3.3v rail where the nrf52480 and nvm run off 1.8v (VDD and VDDH are tied so it's in 'normal' mode). My status led's post circuit python uf2 upload seem to be working and suggest it's running, but I get no usb activity so I can't load programs onto it. The adafruit UF2 bootloader works without issue as well while things are in bootloader mode...

#

I tried running the original test script on the Pico W running the 12/8 beta.5 bits from s3 and after about 5 minutes I got the "OutOfRetires: Repeated socket failures" message.

I then flashed the latest bits from github and replaced my .env file with a settings.toml file and ran the test script which results in the success message being displayed repeatedly. I've run it now for several minutes without any failures.

stuck elbow
#

great success

#

in the end the source of all the problems were two swapped data pins in the information on the camera module

#

jpeg works too now

onyx hinge
#

yay!

storm minnow
stuck elbow
#

the sad thing is, I realized I can't use this camera shield with my robot, because I already use all 8 pwm channels to control servos

storm minnow
#

aww...

stuck elbow
#

and unlike the imagecapture lib, this one doesn't support the option of using an external crystal for that

#

I'm still super happy I got it to work, and I'm sure it will be useful in other projects

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
lavish saffron
#

Hi, when adding typing to libraries, is there a more elegant form of Union[bytes, bytearray]? Thx!

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.5-11-gfc13fba6e-dirty on 2022-12-14; Raspberry Pi Pico W with rp2040

Code/REPL

import wifi
import socketpool
import ssl
import adafruit_requests
from os import getenv

TEXT_URL = "http://wifitest.adafruit.com/testwifi/index.html"

print("Connecting...")
wifi.radio.connect(getenv('CIRCUITPY_WIFI_SSID'),getenv('CIRCUITPY_WIFI_PASSWORD'))
print("My IP address is", wifi.radio.ipv4_address)

poo...
lone sandalBOT
manic glacierBOT
tulip sleet
tulip sleet
#

testing dynobot repeated charswords

onyx hinge
#

@lavish saffron depending on the specifics you might be looking for circuitpython_typing.ReadableBuffer but that includes additional types beyond what you named, like memoryview, array.array, ulab.numpy.array

#

hah only 2 hours late with that answer, and repeating dan. considers going back to bed

tulip sleet
#

I do that all the time. It would be nice if discord flagged a post as having a reply.

slender iron
#

ya, I wish it had links to skip forward to replies

manic glacierBOT
#

Code for decompressing compressed messages is mostly in py/objexcept.py. In PR #7344, an exception wanted to use two arguments, an integer and a string, and it doesn't seem to be possible to use a translated string right now.

If a utility routine that converted a compressed string to a Python string were available, this would be easier to do, and that routine could also be used in py/objexcept.py, I think.

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
languid whale
onyx hinge
#

@lone axle if you get a chance, could you create the notes doc? otherwise let me know and I'll do it tomorrow sometime.

lone axle
onyx hinge
#

thank you!

lone axle
#

I created after the meeting, and pinged it here but never pinned the message 😅

onyx hinge
#

oh oops! I didn't search

orchid basinBOT
spiral elk
#

BTW, not slacking with the circuitpython-org entry for the luatos board. I soldered headers to my only physical one before I had a chance to take photos and I don't want people to see my horribly bad soldering skills. I have some more boards arriving next week from China.

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.3.3 on 2022-08-29; Adafruit Feather RP2040 with rp2040

Code/REPL

from adafruit_wiznet5k.adafruit_wiznet5k import WIZNET5K

Behavior

File "code.py", line 5, in
File "adafruit_wiznet5k.py", line 51, in
ImportError: no module named 'adafruit_wiznet5k.adafruit_wiznet5k_dhcp'

Description

The initial context:
The import worked when there was only the wiznet library to contend with.
The cod...

#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.5 on 2022-12-08; M5Stack Atom Lite with ESP32
Adafruit CircuitPython 8.0.0-beta.0 on 2022-08-18; PCA10059 nRF52840 Dongle with nRF52840

Code/REPL

import adafruit_irremote
import pulseio
decoder = adafruit_irremote.GenericDecode()

pulsein = pulseio.PulseIn(board.D32, maxlen=600, idle_state=True)
pulses = decoder.read_pulses(pulsein,max_pulse=91000,pulse_window=0.104,blocking_delay=0.102)

##...

manic glacierBOT
#

hi,

Good to know. I'll be careful of this in the future.

Once I changed the source file names there were no import name collisions.

The problem with the "featherwing" is there is no such thing as "ls -R", the whole OS seems
to be a python interpreter.

Too bad import doesn't accept a debug flag that prints its search path - but

I'm guessing for that to work, import would have to become a function, like print.

bob s.

#

Sorry, I just meant you could do ls -R /media/yourname/CIRCUITPY on the host computer (assuming it was Linux).

I think you would find the same issue with regular Python. It also uses sys.path to find things. Its sys.path does not include /lib, of course, but it does include various library locations. If you replaced only some of the files in a particular library, I think it would have the same import troubles.

#

the script ci_set_matrix.py in tools controls which boards are built based on the changed files. It has to be hand modified for exceptional files. It doesn't look like it has a facility right now to ignore whole directories, just individual files. So you could list your individual files, or you could add a facility to filter whole directories.

btw is there any possibility / utility to testing .devcontainer during our build? If a typo goes unnoticed, that's not great. If we could have...

#

sorry, I wasn't thinking. I'm still a newby with rp.

I'm also not used to an embedded device having its own "finder" window.

ls -R didn't behave recursively in my mac, but I think this is a mac problem

% ls -R ./wiznet
./wiznet5k.py ./wiznet5k_dns.py ./wiznet5k_socket.py
./wiznet5k_dhcp.py ./wiznet5k_ntp.py ./wiznet5k_wsgiserver.py

% ls -R ./lib/wiznet
init.py adafruit_wiznet5k_dns.mpy adafruit_wiznet5k_wsgiserver.mpy
adafruit_wiznet5k.mpy adafruit_wiznet5k...

#

There is the possibility to pre-build containers. But I'm not sure that this catches problems with the postCreateCommand. And I think pre-build containers are not suitable for CircuitPython-builds, because I think it is important to do the whole fetch-submodule logic every time after a fresh-clone.

I will try to find something useful in the Github-docs.

BTW: this error prevented the postCreateCommand to run at all, but there could be errors in the script as well. Or the script is outdat...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I can confirm that protomatter 1.5.3 does NOT work as-is on Adafruit Feather ESP32-S3 TFT. But we don't want to use an unreleased protomatter either. 1.5.2 doesn't build, and the commit in this PR is a non-accepted PR, not a release.

With modifications I can get the matrix to come up once but not a second time (including over soft reset). The code runs, but no display is visible.

Possibly because the featherwing uses TX and RX pins, running in DEBUG= mode makes it crash.

I will ...

#

This is probably expected behavior but I hadn't noticed it before. Prior to running this script the Pico W shows up in the web workflow list of "CircuitPython devices on your network" from another idle device, but while the script is running the device doesn't show up in the list.....

No, I think it would be expected to still show up. @tannewt can you say for sure?

slender iron
#

@tulip sleet ya, 7300 is coproc related

#

we could fix it before I get my pr in if we want

#

I was hoping to get it in before I'm out but its working less well now and I haven't figured out why

tulip sleet
#

can 7300 be fixed without coproc? Or we could revert the current coproc, and that would fix it?

#

is 7300 a regression right now?

manic glacierBOT
slender iron
#

ya, I can make a pr to fix it before my coproc stuff

#

its not really a regression since s3 sleep was only recently "fixed" and exposed this bug

#

the current coproc code tells the idf to wake based on the ulp even when no ulp alarm is set

tulip sleet
#

s3 everything is less than ideal.

slender iron
#

I was hoping to wrap up my changes and fix this issue along with it

tulip sleet
#

however you want, if you get stalled on coproc, then a quick PR early next week makes sense. coproc as a feature could be pushed beyond 8.0.0

slender iron
#

👍 that's a good plan

#

I have a couple hours now where I hope to figure it out

#

this code I have has the pin reset protection now so it should be close to ready

manic glacierBOT
manic glacierBOT
stuck elbow
#

is the .env file parsing currently broken on main?

wraith crow
#

The most recent bits are now using settings.toml instead. All strings need to be contained within double quotes.

#

i.e. CIRCUITPY_WIFI_SSID = "my ssid"

stuck elbow
#

awesome, thanks

manic glacierBOT
slender iron
#

@tulip sleet found the bug! the idf was turning off the rtc io clock when any of the pins was disabled

tulip sleet
#

that sounds like a bug -- great catch!

slender iron
#

yup, any instead of all

manic glacierBOT
slender iron
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

To test this with a module that doesn't have a crystal, you can create the PWMOut yourself before creating the camera:

import board
import displayio
import adafruit_ili9341
import busio
import digitalio
import esp32_camera
import pwmio


displayio.release_displays()
display_bus = displayio.FourWire(
    busio.SPI(clock=board.IO7, MOSI=board.IO5),
    command=board.IO9,
    chip_select=board.IO3,
    baudrate=80_000_000,
)
display = adafruit_ili9341.ILI9341(
    ...
manic glacierBOT
manic glacierBOT
#

This is the minimal crash-inducing program:

crash.py:

def crash():
    try:
        None.wrong()
    except AttributeError:
        pass
    i = None

crash()

Necessary elements:

  • The try block must be in a function. It does not crash when at the top level.
  • I tried raising ZeroDivisionError instead, and it does not cause the problem.
  • The local var assignment must be present. It doesn't really matter what it is. In Label, it was an assignment of 0.

...

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
serene token
#

@slender iron I think I've got it done! Except, there is one issue. I attempted to playback a sine wave, and it skips. This is because Python can't generate the sine wave fast enough (I'm using a QT Py RP2040), so the buffer is emptying (and then playing back silence) while the next portion is generating. I thought this might happen, and I may be able to work around it, but even if I can get a sine wave playing, more complex waveforms that take even longer to generate could still have issues.

I'm not giving up though! I'm going to see if a square wave (or triangle or sawtooth...) will work, as they don't require an expensive trig function. If those work, a lookup table for sine waves could be a valid solution. Alternatively, I could do it all in C and add yet another module for synth generation (which I was already planning to do eventually anyway). Regardless, there is definitely going to be some limit to how much complexity any given processor can handle before it takes too long to generate the audio samples.

Anyhow, if anyone is interested, the code is on my CircuitPython fork: https://github.com/Rybec/circuitpython The new module is audiostream. I'm going to do a bit more testing before putting in a pull request.

GitHub

CircuitPython - a Python implementation for teaching coding with microcontrollers - GitHub - Rybec/circuitpython: CircuitPython - a Python implementation for teaching coding with microcontrollers

manic glacierBOT
serene token
#

@slender iron I have some potential information on the issue with speaker noise happening when the board automatically resets on filesystem writes. During audio playback using my new class, the print function causes audio noise when the board is connected to a serial console. I'm not 100% sure these are connected, but I suspect they are. My class does not interact with the serial system at all, so it's unlikely that it's a bug there. I haven't tested this with the existing RawSample or WaveFile class, but I suspect the same noise would happen when communicating with the serial console while they are playing.

#

Alright, I've verified that the same thing happens during playback with RawSample. Each time something is printed to the serial console, garbage is output on the audio. This only happens when the device is connected to the serial console though. When there is no connection, it does not happen. (The noise during automatic reset, however, does happen even when not connected to the serial console.)

stuck elbow
#

crosstalk between the traces?

serene token
#

Possibly. This project is using the QT Py RP2040, and I haven't tested it on any other board. That said, the auto reset thing produced the noise on A0, A1, and A2 equally. Since I tested that, I soldered the speaker to A0, so I can't really test other pins anymore. (If my oscilloscope was out of storage... I don't have room for it right now though.)

#

It's not a huge deal for this project, as I don't need to use serial for the end product, and it doesn't produce noise on manual resets or power on/off. It's mostly just an annoyance. If someone did need to use serial and audio at the same time though...

blissful pollen
serene token
#

@blissful pollen Audio uses DMA, according to the source code in the part I was working on. It's possible that the serial and automatic reset are preventing the DMA from being updated on time when it gets to the end of buffer, either reading past the end a bit or causing just enough delay between updates to produce brief garbage output. It would only take a byte or two delay to turn smooth audio into something very rough.

brazen hatch
#

The module ipaddress is not present on Seeed XIAO nRF52840 Sense. Where am I meant to fetch it from?

#

Cause like, my wifi stuff are built to need it and not quite sure how to work without it

#

Also I am talking about 8.0

blissful pollen
#

I didn't think the nRF52840 Sense has wifi on the chip at all? Only BLE

brazen hatch
#

oh, what?

#

Not quite sure how I got that confoosed but fine, thanks!

blissful pollen
#

As far as I'm aware only the ESP32 family and Pico-w have wifi support in CP.

brazen hatch
#

It seems to not have wifi at all, not just in CP.
Oh well, ble time.

manic glacierBOT
#

Correction of information
I measured Panasonic air conditioner pulses. I show it below.

Adafruit CircuitPython 8.0.0-beta.0 on 2022-08-18; Raspberry Pi Pico with rp2040pulses sum: 249428 pulse count: 439 Max: 10480
pulses:
[3521, 1731, 453, 419, 455, 1310, 453, 420, 453, 420, 454, 420, 453, 420, 454, 420, 452, 422, 453, 421, 453, 420, 453, 421, 453, 420, 452, 422, 452, 1312, 451, 422, 451, 423, 450, 423, 450, 423, 440, 433, 433, 441, 448, 425, 431, 1333, 428, 1337, 427, 1336, ...

tulip sleet
lone sandalBOT
crimson ferry
#

in theory, one should be able to use a websocket to connect to serial to a web-workflow CP device, detect if it has hardfaulted (checking if in REPL... somehow, then by trying reload, perhaps), and reset it?

brazen hatch
#

still haven't managed to get a curses-compliant shell via the websocket
I will prolly write my own at some point

#

prolly will be a fork of some other, idk

#

but still no web-workflow-ssh

manic glacierBOT
young frost
#

Have you tried this mod? I think I got it working but it behaves very odd. Mu keeps thinking I have an esp32 connected. The python code runs but it doesn’t seem to actually work

onyx hinge
slender iron
lavish saffron
#

Hello, for private functions that will be compiled by mpy-cross, is it better to use doc strings? e.g.

    def _next_retry_time(self, *, interval: int = 4) -> int:
        """Calculate a retry stop time.

        The interval is calculated as an exponential fallback with a random variation to
        prevent DHCP packet collisions. This timeout is intended to be compared with
        time.monotonic(). Uses self._retries as the exponent, and increments this value
        each time it is called.

        :param int interval: The base retry interval in seconds. Defaults to 4 as per the
            DHCP standard for Ethernet connections.

        :returns int: The timeout in time.monotonic() seconds.

        :raises ValueError: If the calculated interval is < 1 second.
        """
        ...

Or should I use comments? e.g.

    def _next_retry_time(self, *, interval: int = 4) -> int:
        """Calculate a retry stop time."""

        # The interval is calculated as an exponential fallback with a random variation to
        # prevent DHCP packet collisions. This timeout is intended to be compared with
        # time.monotonic(). Uses self._retries as the exponent, and increments this value
        # each time it is called.

        # :param int interval: The base retry interval in seconds. Defaults to 4 as per the
        #     DHCP standard for Ethernet connections.

        # :returns int: The timeout in time.monotonic() seconds.

        # :raises ValueError: If the calculated interval is < 1 second.
        

I'm wondering whether mpy-cross throws away comments, saving space?
Thx!

tulip sleet
#

both comments and docstrings are discarded

#

so use docstrings

lavish saffron
#

Thx

orchid basinBOT
manic glacierBOT
#

According to this forum post the error is "Attribute Error:
'Processor' object has no attribute 'frequency'" It should instead say it isn't settable. I suspect we need to remove the setter when setting isn't possible. The code now returns a NotImplementedException that is being caught internally and producing the error seen. So conditionalize this:

https://github.com/adafruit/circuitpython/blob/10138f43d62a90fa9d090c7eb4bdaaa08...

slender iron
#

@tulip sleet does the notimplementederror actually make it to the user?

tulip sleet
#

Maybe I will take away that SETTABLE flag, and add a weak common_hal set_frequency

slender iron
#

I was guessing

#

🙂

tulip sleet
#

or we'll make CIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY have a useful default value. It's set to 0 or 1 per board, which I think is too many places. Should be mostly per prot.

manic glacierBOT
tulip sleet
# slender iron I was guessing

it looks like in py/runtime.c, mp_store_attr() gets a return value from the attempted call, even if it threw an exception, and turns that into a "has no attribute" error. This looks like it would be true for any property that threw an exception. I will see if it's true for reading attributes as well as writing, but I'm confused, because this would break all kinds of property error checking, and I don't see that right now. (e.g. setting a bad value in, say busio.UART

manic glacierBOT
#
>>> class X:
...     @property
...     def p(self): return 1
... 
>>> x = X()
>>> x.p
1
>>> x.p = 7
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: can't set attribute

Python uses AttributeError for a non-settable property but it has a clearer error ("can't set" vs "has no attribute").

Maybe we should fix this by making the failure to set the attribute have a distinct message:

diff --git a/py/runtime.c b/py/runtime.c
inde...
tulip sleet
#

@onyx hinge that is a better message

#

I'm still looking into why the NotImpl is eaten by that, but other exceptions raised in set-property impls are getting through

onyx hinge
#

NotImplemented in particular? weird!

tulip sleet
# onyx hinge NotImplemented in particular? weird!

it's even more weird. I had a random build on a Metro M4, and got this:

>>> import microcontroller
>>> microcontroller.cpu.frequency = -1
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'Processor' object has no attribute 'frequency'
onyx hinge
#

something to do with built in types? ```class X:
@property
def p(self): return 1

@p.setter 
def p(self, _): raise NotImplementedError()

x = X()
x.p = 1

tulip sleet
#

I then rebuilt with ValueError instead of NotImplementedError, and got ValueError: frequency is read-only for this board, as I would expect. Then I rebuilt back to NotImplementedError, and got NotImplementedError: frequency is read-only for this board.

#

that is, it was inconsistent. So maybe it's reading trash on the stack or something.

#

sometimes zero, maybe sometimes not?? I haven't yet been able to reproduce the "random build" behavior. It was a leftover build from debugging the other AttributeError DEBUG=1 issue

#

I rebuilt with DEBUG=1 but could not reproduce

onyx hinge
#

that feels like it could be a clue about the crashing error

tulip sleet
#

yes, maybe they are all related; it's rather odd syncrony

#

there is no special handling of NotImplementedError in circuitpython/py/*

onyx hinge
#

agree, based on a quick check. same for RuntimeError which NotImplementedError inherits

#

<@&356864093652516868> we're looking forward to chatting with you in about an hour -- it'll be the last meeting of the year, if you can believe that. Please add your notes to https://docs.google.com/document/d/1-zwAp6Jeh9Z4YiF197EHnHrXEuqxvpP4em1B3zusAak/edit?usp=sharing like I'm about to do. Hope to see you in the voice chat & here in the text chat. As usual, mark the document if you need the host (me) to read your notes.

lone axle
manic glacierBOT
midnight ember
#

Over 100 boards for Blinka milestone. 🙂

#

PyLeap for wifi sounds exciting.

slender iron
#

it was interesting to see how much easier it was to do vs ble

midnight ember
#

looks like someone copy pasted into my status update... unsure who it belongs to

lone axle
#

I think it's a copy of dan's section

stuck elbow
#

looks like it was some anonymous animal

midnight ember
#

I enjoyed reading your updates on how you used the clock to get back needed GPIO.

stuck elbow
midnight ember
#

the cosmetic version of the step switch for pcb designs, how it started

#

my first 3d model design 🙂

tulip sleet
#

@midnight ember it just dropped through the mail slot!

midnight ember
#

🤗

#

wait, that's gotta be a huge mail slot

tulip sleet
#

maybe 2 inches 🙂

midnight ember
#

Keep your chin up Melissa, hope you feel better soon. 🤗

#

the district mapping stuff you did was interesting

#

The circuitpythonukiahs look really neat. Saw it on mastodon. neat design.

blissful pollen
#

Two weeks is what I'd think is good, I don't think longer will really get anything more that 2 wouldn't

midnight ember
#

2 months sounds excessive, realistically after the holidays 2 weeks sounds good.

lone axle
#

2 weeks seems good to me as well.

midnight ember
#

closing 1 day after a final meeting is a good idea too

lone axle
#

Oh, I like that idea to schedule it day after a meeting for a "last call" to be mentioned during the meeting.

midnight ember
#

Next stop, 2023 all aboard!

thorny jay
#

Thank you for this year of CircuitPython.

stuck elbow
#

thanks

slender iron
#

thank you!

candid sun
#

happy holidays folks!

jaunty juniper
#

happy holidays

midnight ember
#

Thank you for 2022 Circuit Pythonistas! What a wonderful year.

gilded cradle
#

Thanks everyone

jaunty juniper
#

(meow ho ho)

lone axle
#

Thanks everyone! 👋

jaunty juniper
#

hey is there a known issue with timings on RP2040 ? I get random timings of the status LED blinks seemingly only on RP2040 boards

tulip sleet
#

i don't know of such an issue

jaunty juniper
#

all

tulip sleet
#

you mean the brief green flash every few seconds?

jaunty juniper
#

I was adding the status LED to the pico, but I see it on the picow, feather (I'm making a test build to log the timings)

#

yes

tulip sleet
#

that could be a idle time timing issue. If nothing is going on, it will

jaunty juniper
#

instead of every 5 seconds I get things like that:

[20:43:07.513] Pattern start
[20:43:42.173] Pattern start
[20:44:15.190] Pattern start
[20:44:36.533] Pattern start
[20:44:49.742] Pattern start
[20:45:03.570] Pattern start
[20:45:13.578] Pattern start
[20:45:23.595] Pattern start
tulip sleet
#

wait for an interrupt, and maybe it is not waiting for any ticks. Do you NOT see this on say a SAMD51?

jaunty juniper
#

(which are prints I added)

tulip sleet
#

ESP32xx is not a good comparison because of the RTOS

jaunty juniper
#

I have put latest on a ESP and a trinket and don't see it

tulip sleet
onyx hinge
#

Here is the notes document for the next CircuitPython Weekly meeting. It is on Tuesday January 3, 2023 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/13tKfczFaOh-Z6xRyjLMAkx6QTI5OBA1dWh9e8ld2Y04/edit?usp=sharing

manic glacierBOT
#

The ULP code to test is here: https://github.com/adafruit/Adafruit_CircuitPython_ULP_Blink

Here is a pre-compiled version along with the code.py's for them. (The blink examples compile .c to a .py wrapper library.)
Archive.zip

The libraries should work on S2 with sx_version=2 but I haven't tested it. They shouldn't be board specific because the pins are dynamically patched into the binary.

I plan on polishing th...

jaunty juniper
#

ah tio's delta timestamp mode ❤️

#

so that's frustrating, my build with a single print in it now doesn't blink at all, which is what I originally thought the issue was, but my previous build with more prints did blink randomly. The difference is that the new build doesn't print with the first blink

#

while the other build would print every time the LED was turned on

storm minnow
digital shoreBOT
manic glacierBOT
stuck elbow
storm minnow
stuck elbow
#

I'm working on a pi pico version still, that will be a separate project

storm minnow
#

I shall attempt to make a giant version!

stuck elbow
#

robots don't scale

#

make it 2x bigger, and suddenly it's 8x heavier, and needs 8x stronger servos

storm minnow
#

Oh... darn

#

I didn't think about that

stuck elbow
#

this is why small robots are much easier

manic glacierBOT
#

While adding MICROPY_HW_LED_STATUS on the Raspberry Pico I noticed that it didn't blink every 5 seconds. I did some tests on other boards and different types of satus LEDs, and it seems that it's a RP2040 bug.

It looks like the pico W is doing it correctly (and it already had the status LED defined).

Since staring at a LED for minutes to see when it blinks is not a lot of fun, I added a serial_write here, and it rarely blinks and seems to only react to the USB host doing something, ...

stuck elbow
#

also how ants can carry 10x their body weight

#

or was it 100?

storm minnow
#

Maybe I can find a way to increase overall scale without increasing mass drastically...

#

I think it's up to 100x

stuck elbow
#

in any case, the smaller it is, the stronger it is relatively

#

also the more resistant to falls and so on

storm minnow
#

Yeah, which is why bugs can fall off a skyscraper and don't care, cats can jump from 5-10 stories and be fine, but we get hurt falling out of a 2nd story window

stuck elbow
#

and you'd kill an elephant if you dropped it from 40cm

storm minnow
#

This is why we never drop elephants

stuck elbow
#

or flip cows

#

you could probably make the legs twice as long, there is some margin of strength in there

#

especially if you switch to metal gear servos, mg-90 instead of the sg-90

manic glacierBOT
manic glacierBOT
#

If you try to do a multi-byte read or write that is not aligned, could this cause an addressing exception in the common-hal implementation, because the compiler will be doing an unaligned read or write?

Maybe an example here would be good, and/or explaining that memcpy does not guarantee multi-byte reads or writes (at least I don't think it does) Maybe don't refer to memcpy specifically, since the user may not know its semantics. Or say multi-byte chunking is neither guaranteed nor for...

orchid basinBOT
manic glacierBOT
#

This is a followup issue regarding https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k/issues/67.
It is specifically about 8.x.

TLDR; If you mpy-cross the Adafruit_circuitpython_wiznet5k module with any optimisation (so, -O1 or greater), the entire module breaks apart.

  • .chip detection is broken
  • .link_status detection is broken
  • dhcp is broken
  • and basically every socket & request is also broken

I do not have the technical know-how regarding how mpy-cross wor...

brazen hatch
#

Anybody got any hints on working with the mpy-cross logic?

tulip sleet
#

@brazen hatch are the built .mpy's in the bundle or the library release on github defective, or only when you compile with mpy-cross by hand?

#

i don't see any optimization settings in circuitpython-build-tools, but I may be looking in the wrong place.

brazen hatch
#

-O0 is fine

tulip sleet
#

i understand, but are you doing that compiling or is the bundle version being built with -O1 or greater?

#

i.e. is the bundle version of this library fine?

brazen hatch
#

I am the one doing it, the bundles are fine

#

the are most certainly not using optimisation settings

tulip sleet
#

ok good, I wanted to know if this was urgent. thanks for discovering this. We never use these settings, and will look at whether micropython has any reported issues on this

brazen hatch
#

well I have been using -O3 with my whole project and never seen issues

#

so its prolly something very specific causing this

jaunty juniper
#

what does it even do ?

tulip sleet
#

do you see significant space savings?

jaunty juniper
#

is there any documentation of the optimizations ?

brazen hatch
#

complete borkage, basically no variables are being updated it so seems

brazen hatch
#

and my stuff has no issue with it

brazen hatch
#

something is really wrong with it

brazen hatch
#

it checks out on -O3 you get Line 1 on every error

#

but we struggling on -O1 here

tulip sleet
#

but only that library; others are ok, you say

#

there are tools to examine the .mpy code. I am not seeing any error reports in the micropython repo.

#

we will take a look, not immediately, but may pass the buck to micropython if we discover a problem.

brazen hatch
#

I will give it a try too, and pass you whatever findings

onyx hinge
#

@brazen hatch you're talking about when you run mpy-cross -O#, not about the compiler flags when building the mpy-cross program itself, right?

#

-O3 does deliberately disable line numbers, to save space.

#

-O1 or greater controls whether __debug__ is a true constant or a false constant.

#

based on source searching, I don't see any other intentional changes due to setting optimization levels in the mpy-cross commandline.

#

adafruit_wiznet5k/adafruit_wiznet5k.py: assert self._w5100_init() == 1, "Failed to initialize WIZnet module."

jaunty juniper
#

adafruit_wiznet5k uses assert a bunch

onyx hinge
#

OK, asserts are disabled too. And wiznet5k uses assert in a way that is .. not entirely appropriate

#

so for instance it'll just skip calling _w5100_init() when optimization is on

manic glacierBOT
tulip sleet
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.4 on 2022-10-30; Raspberry Pi Pico W with rp2040

Code/REPL

import alarm
import time
import board

print("Waking up")

# Create an alarm for 60 seconds from now, and also a pin alarm.
time_alarm = alarm.time.TimeAlarm(monotonic_time=time.monotonic() + 20)
pin_alarm = alarm.pin.PinAlarm(pin=board.GP12, value=False)

# Deep sleep until one of the alarm goes off. Then restart the program.
alarm....
brazen hatch
#

I did the asserts pr and will test it a bit

manic glacierBOT
slender iron
#

@tulip sleet just pushed an update to the pr. Didn't test it yet though. Will later when becca is back and can watch ari.

thorny jay
#

Hi, I have setup a temperature sensor MCP9808 connected to a Feather M0 Express that will monitor a room for 2 weeks (with a host gathering the data and putting that in an SQLlight database) all that following this great guide: https://learn.adafruit.com/diy-trinkey-no-solder-air-quality-monitor/circuitpython

However, I feel I need a guide or advice on how to make reliable piece of hardware/software to work unattended for 2 weeks. Some ideas/questions (none that I have implemented):

  • Use watchdog (poor choice, there is no CP support for the M0).
  • Use try to catch exception and force a reset.
  • Monitor the heap/memory space and write defensively using prealocated buffer.
  • For a restart every ??? day.
  • Do not trust the precision of monotonic over long period and use ad-hoc function for time comparison (I think @onyx hinge made some work on that?
thorny jay
# thorny jay Hi, I have setup a temperature sensor MCP9808 connected to a Feather M0 Express ...

Right now, for me it is too late as I will lose access to this place for 2 weeks, and I did not bring the right MCU for the job (watchdog), nor want to make last minutes change to the code... but I feel there is maybe a place for a learn guide or gathering experience on the best practice for "high availability CP". A bit like we did for memory issue and how to optimize your code.
I know CP is not targeted at that, nor at security, but having things that run for weeks without help would be great too.

tulip sleet
onyx hinge
crimson ferry
#

philosophical question re:libraries... Board helper libraries like the ones using PortalBase tend to be all-encompassing.

#

But should we try to keep lower-level driver-type libraries smaller and more minimal? Example: do we really need NTP in WIZnet5k library, or should WIZnet be simply a physical/link-layer/IP-layer library, and other code or libraries can build on that? Other examples in WIZnet, EPS32SPI, and the WSGI servers that are scattered around too.

onyx hinge
#

there are apparently hundreds of other uses of assert across the libraries!

#

for example rfm9x/adafruit_rfm9x.py:713:9: assert 0 < len(data) <= 252

#

at least 100 in files not named *test*

brazen hatch
#

honestly before today I didn't even know of assert

onyx hinge
#

some of them, like maybe that rfm9x example, are the kind of asserts you'd want to leave out of a -O'd mpy file so they really need human review

#

should this one be an assertion or an exception? (adafruit_atecc) no idea. ```py
self._get_response(status)
assert status[0] == 0x00, "Error during sha_start."

idle owl
#

@slender iron I have CircuitPython 2023 graphics for you. To add to your blog post.

onyx hinge
#

a motivated person would run the script, then using a tool like git-gui make a judgement call and either commit or revert each one. erring on the side of transforming, because it would be bad to lose an important error check.

#

assert is really an archaic C-ish thing imo, not surprised if anyone's not familiar with it.

stuck elbow
idle owl
#

@tulip sleet What ended up happening with the .toml guide updates?

tulip sleet
#

not merged yet, so we didn't do anything. Scott's coproc PR may or may not get in by tomw. In either case, I will make a beta.6 tomw that includes settings.toml.

manic glacierBOT
idle owl
#

Ok. I'll see where Liz is at, and decide how to proceed.

tulip sleet
idle owl
idle owl
#

@tulip sleet Ok, I talked to Liz. We figured out a plan, which I can explain when you're around. We'll be putting together the canonical page for you to mirror, and then there's a blurb on every applicable code page that will need to be updated, and we will compile a list of links for you. Liz and I will both be around tomorrow to answer questions, and Liz offered to help update guides if you wanted assistance.

tulip sleet
#

sounds good; i had to reboot due to a crash

idle owl
#

Ah fair enough. I saw you green again as I had already typed that part. 😄

tulip sleet
#

Linux USB support is flaky; it gets upset sometime when CircuitPython just stops abruptly

#

v annoying

slender iron
#

thanks @idle owl! I saw it hit basecamp and snagged it

slender iron
#

@tulip sleet just tested it and it looks good still

tulip sleet
slender iron
#

I'd rather not since they are sleeping and I'm just about out of time

tulip sleet
#

ok, I'll merge soon and microdev can open new issue(s).

#

I can start working on the release notes

slender iron
#

thank you!

slender iron
#

NTP shouldn't be redone unless you can't do it with sockets from the device.

crimson ferry
#

NTP is already in the WIZnet library (as is a WSGI server), but there's a PR to fix a bug. UDP sockets work fine on WIZnet. Similar issues with ESP32SPI.

#

We almost need a channel here for libraries for development and longer-term stuff... like the socket vs. socket+interface conundrum between native and WIZ/ESP

idle owl
#

@tulip sleet Do you want to vid for a bit to go through the guide update plan? We have a document, so it's not bonkers to try to remember it all. Also Liz can help, and I'll be around as well tomorrow to help out as well. I don't know what your timeline is, but I likely won't be around until noon or later, so if you want to get started before that, it's better to chat about it today.

spiral elk
#

What's the best way on espressif to extinguish an LED that would ordinarily start up floating at half-brightness in board.c while retaining it for later use at the circuitpython code level? Just something in reset_board()?

spiral elk
#

I'll play around with something like that later, just tired of staring at this second LED on this board every time I plug it in.

#

Annoyance, the instigator of change...

manic glacierBOT
#

I just tested this with latest S3
Adafruit CircuitPython 8.0.0-beta.5-22-ge9f032f46 on 2022-12-20; Raspberry Pi Pico W with rp2040
and .env converted to settings.toml.

This works now with web workflow enabled. (Requests is still often getting an OSError: 32 on the first, hidden, try, but the internal retry is successful.)

Does anyone know what was broken in beta.5 (it used to work in beta.4), and what fixed it?

crimson ferry
#

Do we have a preference for single vs. double quotes in setings.toml ? All the readthedocs use double (but no explicit mention that I could find), but the web workflow Welcome page uses single.

jaunty juniper
#

ah that needs to be updated then, prefer double quotes

tulip sleet
#

I think it has to be double quotes

tulip sleet
crimson ferry
#

Any thoughts of supporting a more complex type so we could essentially have lists or dicts? I want a list of potential servers in settings.toml that code could iterate over, but for now I'll just number them and know how many.

jaunty juniper
#

I wasn't sure, I remember seeing it mentioned, but it's not in the PR (about double quotes only)

jaunty juniper
crimson ferry
#

oh, good point, I can just parse a string

jaunty juniper
#

are there open issues relative to the web REPL ? I am seeing issues when pasting a line in it, namely it stops responding (without any javascript error)

crimson ferry
#
>>> os.getenv("EMOJI")
'😹'
```😹
#

I don't know of open issues, but sometimes it eats the first character I type when first opened

#

by web REPL, do you mean web workflow serial console?

jaunty juniper
#

note that the serial REPL does too if it's in the "press any key" stage

#

yeah

crimson ferry
#

that could be it, but nothing is displayed in the upper pane of the web workflow window until after it eats the character ...doesn't always happen

#

I've seen the hanging too

#

is it just Macs that get the authentication dialog twice?

#

I've seen that in other contexts, so I assumed it was not a CP issue

spiral elk
#

esp32c3 is still really unstable in web workflow console.

#

on both boards I have

manic glacierBOT
#
  • Fixes #7261.

This program crashed on SAMD51 when compiled with DEBUG=1:

def crash():
    try:
        None.wrong()
    except AttributeError:
        pass
    i = None

The stack variable fastn in mp_execute_bytecode() in py/vm.c was getting smashed. It was a Heisenbug because adding print statements caused it to work.

After narrowing down the point of smashing, I looked at the assembly code and saw that call to nlr_push() in `mp_execute_bytecode assumed ...

manic glacierBOT
#

Opening a separate issue for this:

On raspberrypi, mDNS is not shutdown on reload, so m = mdns.Server(wifi.radio) gets RuntimeError: mDNS already initialized. Even on reset, with web workflow enabled, m = mdns.Server(wifi.radio) gets RuntimeError: mDNS already initialized. This is probably the larger issue, but I'm not entirely sure how this should work across ports.

espressif shuts down mDNS on reload, so after a reload, m = mdns.Server(wifi.radio) works. It works...

#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.5 on 2022-12-08; Raspberry Pi Pico W with rp2040

Code/REPL

See #7326

Behavior

On raspberrypi, mDNS is not shutdown on reload, so m = mdns.Server(wifi.radio) gets RuntimeError: mDNS already initialized. Even on reset, with web workflow enabled, m = mdns.Server(wifi.radio) gets RuntimeError: mDNS already initialized. I'm not entirely sure how this should work across ports.

`espres...

lavish saffron
manic glacierBOT
orchid basinBOT
manic glacierBOT
#

Two questions:

  1. Do your boards not use QSPI for the external flash?
  2. There is a serious problem with SPIM in battery-only operation: #5233. We encountered this, and disrecommend using SPIM3 under those circumstances. So I'm wondering whether your board might have the same issue. It's also possible to disable SPIM3 completely at compile time.
onyx hinge
#

@tulip sleet I'm so happy you found an explicable reason for that crash!

tulip sleet
#

onward to the -O2 mystery, which we hoped might be the same

manic glacierBOT
#
  1. No, our board uses standard SPI.
  2. I don't think this is the same issue. I noticed when probing sclk that the frequency was 32MHZ which caused problem when reading the JEDEC ID. Reducing the clock to Max clock makes it work again. The problem is that the SPI interface is initialized to the max frequency when creating the bus and only reduced after having detected what memory device is attached. Could that be the problem you are also seeing ? This would occur after power on and reset.
#

2. I don't think this is the same issue. I noticed when probing sclk that the frequency was 32MHZ which caused problem when reading the JEDEC ID. Reducing the clock to Max clock makes it work again. The problem is that the SPI interface is initialized to the max frequency when creating the bus and only reduced after having detected what memory device is attached. Could that be the problem you are also seeing ? This would occur after power on and reset.

We are not seeing a flash problem ...

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 8\.0\.0\-beta\.6
orchid basinBOT
manic glacierBOT
#

Is it possible on your board to have VBUS not powered? If so, does SPIM3 work for you in that circumstance?
It does work yes, I just retested to be sure. Both directly after power on and after reset running only on battery and VBUS totally disconnected. I have attached a schematic for your reference (The body diode on the mosfet is drawn backwards).
And this is with the fix I implemented to reduce the SPI speed during initial JEDEC probing. Otherwise it just hangs, waiting for a non FF by...

manic glacierBOT
#

That is interesting -- thanks! Just to confirm: R5, the zero ohm jumper between VDD and VDDH is populated on your board? Your schematic is very similar to the Feather nRF52840.

I don't know why you don't see this SPIM3 problem. We saw it when trying to use SPIM3 much later, after CircuitPython starts, and as you can see from the Nordic DevZone complaints, other users are also having trouble when SPIM3 is used by user code.

I or @tannewt will review this more. I just want to make sure se...

onyx hinge
#

maybe we can use some service for converting to a format that pyportal can handle?

storm minnow
#

That could be fun for anything with a display -- I just imagined a little handheld device using something like a Pico W, and some option buttons to pick from sets of categories and descriptors, and at the press of a button it makes the request and displays the results for you on your TFT or whatever

idle owl
#

@tulip sleet Where are you with the release?

tulip sleet
#

it will finish building in about 20-30 minutes. I'm getting ready to publish the release notes after I update circuitpython.org (after the builds finish). Then I will do the settings.toml changes

#

doing some smoke tests right now

idle owl
tulip sleet
#

sure, thanks!

brazen hatch
#

I have no idea about settings.toml since i missed pretty much all related commits
So I will be seeing them for the first time

#

I plan on utillising it to its maximum for my project too

#

cuz I already had a config in root for defining core options like sd card pins, in case the user wanted to boot from an sdcard

#

in any case, the notes will receive lots of attention real soon

tulip sleet
#

https://blog.adafruit.com/2022/12/21/circuitpython-8-0-0-beta-6-released/
This release changes .env to settings.toml. See the release notes for details. The Learn Guides will also be updated.

Adafruit Industries - Makers, hackers, artists, designers and engineers!

From the GitHub release page: This is CircuitPython 8.0.0-beta.6, a beta release for 8.0.0. It is relatively stable, but there will be further additions, fixes, and changes before final release. NO…

idle owl
#

🎉

tulip sleet
idle owl
storm minnow
#

Is Blinka a WiFi logo for this one? :0

tulip sleet
jaunty juniper
#

it's an Espressif logo

storm minnow
#

Ahh

tulip sleet
storm minnow
#

I figured the poster was 8 in general, I just wasn’t familiar with the Espressif logo

#

It defining makes sense now! And I added it to my cart :3

tulip sleet
#

@idle owl the side2 image is kinda wierdly offset:

#

I added "double" to "double quotes" to emphasize what kind of quotes

idle owl
tulip sleet
#

that moves the text down but there's still a lot of whitespace around the pic

idle owl
#

I think that's fine.

tidal kiln
#

recrop it? side2 requires 4:3

sharp jacinth
#

Is a lot of espressif support added in 8?

idle owl
#

@candid sun ^^ (re: side2)

tulip sleet
#

moving on...

candid sun
#

i can redo the screenshot

idle owl
#

That would work.

#

@candid sun I would suggest making the screenshot bigger, and use an arrow or something to point to the relevant part.

tulip sleet
#

or add whitespace on the bottom to make it 4:3 in gimp or something

#

do you want me to delete or just unpublish the .env page?

tulip sleet
#

changing name of "Enivronmental Variables Docs" to "Environment Variables Docs" (more usual term)

idle owl
#

I thought those needed to be removed

#

Are they relevant to the .toml still?

tulip sleet
idle owl
tulip sleet
idle owl
#

Because mirroring a page does not mirror the link nested under it.

#

That must be added separately.

#

Oh wait

tulip sleet
#

I did add each external link page separately

idle owl
#

I see what you mean

#

I have no idea

#

Probably a bug

#

I'll get screenshots and send them to Learn

#

@tulip sleet Sent.

#

@jaunty juniper Maybe you've seen this. circup failing here. Do you happen to know why? Not sure who else to ask.

jaunty juniper
idle owl
#

Oh!

#

This is for someone else. I completely missed that line when looking at it. Thank you!

tulip sleet
#

@idle owl guides all updated except for some screenshots I need to redo in Carter's guide. I'll give it a few hours and then search for '.env' in google and the learn search engine to find any stragglers.

idle owl
tulip sleet
#

i mirrored the settings.toml setup page into some more of the guides, instead of providing an off-guide reference

tulip sleet
#

@tidal kiln I updated all the guides to refer to settings.toml instead of .env, now that beta.6 is out. Your guide https://learn.adafruit.com/circuitpython-with-esp32-quick-start has a bunch of screenshots that use .env instead of settings.toml. I could try to re-create these, or do you want to? (Probably neither of us wants to.)

tidal kiln
#

@tulip sleet i can take care of it. i should catch up a bit on the .toml thing in general. so that'll force me to do that.

#

is the TLDR that .env is now settings.toml?

tulip sleet
#

yes, a rename, and really main thing is use double quotes instead of single quotes.

spiral elk
#

OK, what should I do for a board definition about a GPIO pin that is broken out to a pin and marked on silkscreen, but will never work?

onyx hinge
#

@spiral elk don't include it in the board module

spiral elk
#

Thank you.

tidal kiln
tulip sleet
onyx hinge
#

yeah it's orange

tidal kiln
#

ahh...ok..seeing those. it just happens to show up 😦

#

ok. thanks. can use your orange boxes as a locator.

#

i'll go thru all that and update it tomorrow

#

i'll grab a beta.6 firmware and run thru it all

manic glacierBOT
orchid basinBOT
manic glacierBOT
lone sandalBOT
lavish saffron
#

I'm updating adafruit_wiznet5k_socket to match CPython. Part of this process is changing all socket.recv() calls to include a buffer length. What is a reasonable maximum length for a HTTP request (for the WSGI server)?

jaunty juniper
#

I think it might be more interesting to make it compatible with adafruit_httpserver and drop the wsgi server from the library, but maybe that's a longer term goal

lavish saffron
jaunty juniper
#

honestly I don't know

lavish saffron
#

Then it's 512 bytes until a reviewer tells me it's not! 🤪

stuck elbow
#

I think Apache has a limit of 2MB by default

lavish saffron
#

Wow. That's a lot. Maybe too much for a microcontroller.

#

adafruit_httpserver.server.py uses 1024 so I'll go with that

onyx hinge
#

I replaced it in the meeting repo and in the notes doc template

manic glacierBOT
brazen hatch
#

question regarding settings.toml
are subtables going to be supported?

#

and is there going to be a ‘native way’ for updating settings.toml?

tulip sleet
#

this was designed to be a minimal settings thing that uses only a very small amount of C code.

#

all the toml libraries I've seen parse the whole file and present you with a dictionary of dictionaries or similar.

brazen hatch
#

Oh well, guess I am writing a circuitpy-specific toml module

#

I will make sure to keep it as tiny as possibly

tulip sleet
brazen hatch
#

Honestly adapting them to circuitpy memory standards is going to take longer than to rewrite

#

I want not a single byte of leaked ram

#

especially something I plan on calling constantly

#

it will fetch and save keys without loading the whole file

tulip sleet
#

saving keys of a different length without rewriting the whole file will be a bit tricky

brazen hatch
#

nah

#

remember, I have ported nano to cp

tulip sleet
#

ok 🙂

#

the library will be welcome

manic glacierBOT