#circuitpython-dev

1 messages Β· Page 405 of 1

manic glacierBOT
idle owl
#

PRs would be great! (I'm off this weekend through Tuesday, but I wanted to get you unblocked.) We're only keeping it in CP so that the examples we missed could be caught and not be found because they're failing. We did not intentionally leave it anywhere, it was simply missed. It will be deprecated as of 8, so catching them before that would be ideal. Thanks!

lone sandalBOT
warm stump
#

oh wait that also came up here... 0x0000AA was more authentic Sony VCR but Macropad doesn't have blue pixels

bleak crane
#

Anybody familiar with NRF24L01 wireless module?

proven garnet
manic glacierBOT
#

Simple fix for this, which I am doing as part of #5816:

@@ -108,11 +108,9 @@ digitalinout_result_t common_hal_digitalio_digitalinout_set_drive_mode(
     digitalio_digitalinout_obj_t *self,
     digitalio_drive_mode_t drive_mode) {
     gpio_num_t number = self->pin->number;
-    gpio_mode_t mode;
+    gpio_mode_t mode = GPIO_MODE_DEF_OUTPUT;
     if (drive_mode == DRIVE_MODE_OPEN_DRAIN) {
-        mode = GPIO_MODE_DEF_OD;
-    } else {
-        mode = GPIO_MODE_DEF_OUTPUT...
lone sandalBOT
manic glacierBOT
warm stump
manic glacierBOT
#

There are various Onewire implementations for Espressif chips.
This one uses delays, and is similar to what we do, including using the same ldeay mechanism:
https://github.com/UncleRus/esp-idf-lib/blob/master/components/onewire/onewire.c

This one uses RMT. The README says the original implementation used bitbanging and delays, but it was too unreliable:
https://github.com/DavidAntliff/esp32-owb

RMT is a better idea.

bleak crane
#

@brazen phoenix I have the code in python,

#

reciver shows " No received acknowledgement"

#

I suppose to get this

manic glacierBOT
#

My experience with you and I having different results is that tinyuf2 is usually the difference and...

Installing Circuitpython (from the PR) with esptool on the QTPY ESP32S2, the sensor is not detected.
Reinstalling tinyuf2 (latest release) and CP from the PR, the sensor is detected and reports temperatures.
I did a couple of back and forth with consistent results.

I don't know if it's related to the open-drain issue or belongs more to the OneWire issue.

#

Before this PR fix, I saw no signal on the onewire pin with my Saleae, and simple manipulation of the output with a DigitalInOut and open-drain drive did not work. With the .bin from this fix, I do see the signal, but the timings are a bit off (too long). The Saleae display program says that the waveform is in error, and the sensor does not respond.

I'll try the UF2, and see whether the timings are different. Something that TinyUF2 is doing may be changing the clock handling in some wa...

manic glacierBOT
#

I tried the UF2 version, and it does not work for me on my QT Py setup, but it gets a lot further, usually, and eventually gets a CRC error. Below is a screenshot showing the two. The top is the UF2 version: the SEARCH ROM command works, and there's a lot more waveform to the right. The bottom is the BIN version. It has a longer delay before the SEARCH ROM (1m vs about 560us), and you can see the SEARCH ROM pulse timings seem rather messed up.

I looked briefly at TinyUF2, and don't immedia...

#

https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/api-reference/peripherals/gpio.html#_CPPv411gpio_mode_t Is it possible that CircuitPython should be setting GPIO_MODE_INPUT_OUTPUT_OD = ((GPIO_MODE_DEF_INPUT) | (GPIO_MODE_DEF_OUTPUT) | (GPIO_MODE_DEF_OD)) instead? If the state of the pin needs to be read back in, the DEF_INPUT bit may need to be set.

The docs also read a bit like the DEF enums should not be used directly but the MODE ones instead..

#

If the state of the pin needs to be read back in, the DEF_INPUT bit may need to be set.

I was able to print the output value of the pin from the REPL without DEF_INPUT being set. Hmm. The shared-module code for bitbang OneWire does not assume that the pin can be bidirectional: it flips the direction back and forth to write and read.

I agree with you about the macros: I didn't read the doc carefully enough to realize those constants were available.

manic glacierBOT
warm stump
# bleak crane reciver shows " No received acknowledgement"

Have a look at CRC (Cyclic Redundancy Check) in each, it’s different. Disabled vs. 8 bits vs. 16 bits. I think I had 32 bits once.
Arduino's begin() seems keen on disabling it for that sketch. Update: I had CRC7 and CRC16 for SD/LoRa/BT, 32 in python temporarily, 64 yet to write
CRC16 from SD is also different from CRC16 from Bluetooth 4.0 -_(\ (I won't be making a Minecraft video on that, there's too many combinations of bits and tabs)

manic glacierBOT
manic glacierBOT
#

@pree-T Sure! See these guides for how to get started:
https://learn.adafruit.com/building-circuitpython
https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github

Currently the only thing to do is to document that rotaryio.IncrementalEncoder assumes that the encoder's pins are connected to ground, and sets pullups on the pins accordingly. The documentation is inline in the C code in [circuitpython/shared-bindings/rotaryio/IncrementalEncoder.c](https://github.com/ad...

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.2.0-alpha.1-109-gfce6d16c8 on 2022-01-15; Raspberry Pi Pico with rp2040

Code/REPL

import sdcardio
import busio
import digitalio
import board
import storage

# Connect to the card and mount the filesystem.
spi = busio.SPI(board.GP10, board.GP11, board.GP12)
cs = board.GP15
sdcard = sdcardio.SDCard(spi, cs)
vfs = storage.VfsFat(sdcard)
storage.mount(vfs, "/sd")
spi.deinit()
print("spi dinited")
sdca...
manic glacierBOT
#

The new operation during deinit occurs to ensure that all data is written out to the card, so it's important.

The shared-bindings routines that wrap from Python to C like busio_spi_configure are where the 'check for deinit' logic is, so when sdcardio calls directly down to common_hal_busio_spi_configure it bypasses the usual check that leads to an exception, and instead does things like access hardware registers anyway.

It implies we need to move those checks to some new middle laye...

solar whale
#

@tulip sleet I finally had a chance to work through your asyncio guide -- very nice! Thank you!

tulip sleet
#

yw! I am hardly an experienced asyncio programmer, but then again, I think many of the existing asyncio examples are too complicated and too unstructured. The Trio manifesto and related conference talks, etc. were very helpful

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.2.0-alpha.1-112-g9b32d549f-dirty on 2022-01-16; Adafruit Feather ESP32-S2 TFT with ESP32S2

Code/REPL

>>> import microcontroller
>>> microcontroller.on_next_reset(microcontroller.RunMode.BOOTLOADER)
>>> microcontroller.reset()

Behavior

Board disconnects completely. (I thought it restarted as with a regular reset, but that's not what's happening right now). It should restart the uf2 bootloader.

No...

#

CircuitPython version

Adafruit CircuitPython 7.2.0-alpha.1-112-g9b32d549f-dirty on 2022-01-16; Adafruit Feather ESP32-S2 TFT with ESP32S2

Code/REPL

>>> i.try_lock(); i.scan(); i.unlock()
True
[11, 104]
>>> hex(104)
'0x68'
>>> import adafruit_pcf8523
>>> adafruit_pcf8523.PCF8523(board.I2C())

Behavior

Traceback (most recent call last):
  File "", line 1, in 
  File "adafruit_pcf8523.py", line 160, in __init__
  File "adafruit_bus_devi...
onyx hinge
#

@solar whale your bug about spi & sdcardio is valuable, thank you. we strive to give good errors when things go wrong, not just crash or lock up...

#

especially for code that "used to work"

solar whale
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.1.1 on 2022-01-14; Adafruit KB2040 with rp2040

Code/REPL

import board
spi=board.SPI()

Behavior

Traceback (most recent call last):
  File "", line 1, in 
NotImplementedError: No default SPI bus

Description

Error while using SPI on KB2040 board. Using the following instructions creates a working SPI object:

import board,busio
spi = busio.SPI(board.SCK, board.MOSI...
manic glacierBOT
manic glacierBOT
manic glacierBOT
digital shoreBOT
#
adafruit
Owner

adafruit#3230

Category Channels

8

Text Channels

61

Voice Channels

6

Members

32696

Roles

36

mortal mica
#

Getting closer! 0b111111110111000

solar whale
#

Ah -- no wonder the meeting notes are so so thin -- the meeting is tomorrow!!

proven garnet
#

Is circuitpython_typing new in 7.2? It looks like it's just the old _typing right? Asking because I assume this would likely make typing things like readable/writable buffers possible, and for that reason change some existing type annotations, correct?

#

I had trouble in the past working with _typing but maybe I just wasn't doing it properly

#

Which I guess is my second question haha: is it too early to start typing with it because it's alpha?

onyx hinge
#

<@&356864093652516868> Reminder that the meeting is postponed 24 hours until tomorrow .. see you then at 2PM ET / 10 AM PT

lone axle
#

I think except blocks should prevent it from crashing. So I lean toward thinking it's okay to start using now. But it should be tested, if possible on a microcontroller as well as in Blinka / CPython environment to make sure both have good behavior.

proven garnet
ember iris
#

Does anyone have a SHT31-D temperature and humidity sensor they could test for me? A few weeks ago I Think I fixed the crc so it matches the datasheet to solve an issue, but the user later said they had a power issue and now I want to make sure I didn't introduce a bug in the process
https://github.com/adafruit/Adafruit_CircuitPython_SHT31D

proven garnet
ember iris
proven garnet
#

I haven't actually used it for anything, it's still in a bag πŸ˜…

ember iris
#

Sure! All I'm trying to do is make sure the crc actually matches the checksum the micro attaches, which I really think it does.

#

But there's that nagging bit in the back of my mind I want to put to rest lol

proven garnet
#

Sure thing, I can go ahead and run the simpletest for the SHT40 if that helps establish equivalence πŸ™‚ I'll let you know in a few minutes

ember iris
#

I really appreciate it! Thank you!

proven garnet
# ember iris I really appreciate it! Thank you!

After a, uh, methodical test of running the simpletest along with warming the sensor with my hands and breathing on it to change humidity, the code is functional and behaving as expected πŸ˜†

ember iris
#

Woo! If you got any data it's a success!

proven garnet
#

Tested with RP2040 Feather with CP 7.1.1

ember iris
#

Thank you for pulling it out and giving it a test! Even if the crc change for the SHT31-D is wrong and needs to be reverted, I at least feel better about having made the change now. Thanks!

proven garnet
#

My pleasure! Glad I could help! celebrate

modern river
#

whoops posted in the wrong board...

proven garnet
# lone axle I think except blocks should prevent it from crashing. So I lean toward thinking...

No problems on a microcontroller, but yeah, Blinka/CPython is different. I think it's because _typing isn't included as one of the emulated libraries so while current code typed with Union[bytearray, bytes] would work because it's valid CPython, _typing.ReadableBuffer does not and it wouldn't moving forward. Using that typing causes a ModuleNotFoundError in CPython, but it looks like CircuitPython just completely ignores typing during interpreting (I think?) so it doesn't fail.

#

So if _typing or it's change to circuitpython_typing is going to be used, maybe it's best to add it as an emulated library for Blinka?

#

For what it's worth, if the intention is to type with those types where possible, that all of the modules imported there would need implementations (or stand in duds maybe?)

tulip sleet
#

I have an SHT31D

proven garnet
#

For example, rgbmatrix.RGBMatrix is a valid ReadableBuffer but rgbmatrix isn't implemented for Blinka

tulip sleet
ember iris
tulip sleet
#

i will try, and ping you after test

ember iris
#

Thank you!

lone axle
tulip sleet
proven garnet
ember iris
#

nevermind, the latest release includes my fix

#

Eva is on top of it!

tulip sleet
#
Temperature: 21.6 C
Humidity: 46.2 %

Temperature: 21.6 C
Humidity: 46.2 %

Temperature: 21.6 C
Humidity: 46.1 %

Temperature: 21.6 C
Humidity: 46.1 %

Temperature: 21.6 C
Humidity: 46.0 %

#

works with simpletest!

ember iris
#

sweet, that means the checksum is passing!

main furnace
#

steamy

tulip sleet
#

tested on a Qt Py SAMD21 with 7.1.1

ember iris
#

thank you both so much for looking through and testing it, I changed enough that it was nagging at the back of my mind. I really appreciate your help validating the fix

tulip sleet
#

np! very good to verify

proven garnet
#

Alright added it to the notes doc, sorry for the Wall of Text ochako_whistle

#

Added my thoughts since it's 50/50 whether I'll be lurking

blissful pollen
#

I got delayed on PR 5726 and it is currently aimed at 7.1.x. Is there a way to update this or just close the PR and open a new one?

tulip sleet
blissful pollen
#

Thanks, I'll try that and if not just rebase it. Does sending it to main make most sense right now?

tulip sleet
blissful pollen
manic glacierBOT
#

@tannewt The merge build for this failed on all the ESP32-S2 builds, not sure why if the original build worked:
https://github.com/adafruit/circuitpython/actions/runs/1709893707

/home/runner/work/circuitpython/circuitpython/.idf_tools/tools/xtensa-esp32s2-elf/esp-2021r2-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: build-adafruit_feather_esp32s2/esp-idf/esp-idf/esp_phy/libesp_phy.a(phy_init.c.obj):(.literal.esp_phy_load_cal_...
#

A factory fresh Feather ESP32-S2 TFT INFO_UF2.TXT has

TinyUF2 Bootloader cd9d938 - tinyusb (0.10.1-109-g9b3ec69b)
Model: Adafruit Feather ESP32-S2 TFT
Board-ID: ESP32S2-FeatherTFT-revA
Date: Dec 17 2021

This does work properly:

>>> microcontroller.on_next_reset(microcontroller.RunMode.UF2)
>>> microcontroller.reset()

And this sends it all the way to the immutable ROM bootloader:

>>> microcontroller.on_next_reset(microcontroller.RunMode.BOOTLOADER)
>>> microc...
manic glacierBOT
lone sandalBOT
manic glacierBOT
manic glacierBOT
#

This request is a result of a support topic in the forum under https://forums.adafruit.com/viewtopic.php?f=60&t=187178
And also relates to the issue: https://github.com/adafruit/circuitpython/issues/4639

To be able to implement a good HID-keyboard solution it is necessary to be able to pair with multiple centrals on the one hand,
on the other hand, it does not make sense to send keystrokes to every connected central simultaneously. Managing the connection from the UI of the central is te...

manic glacierBOT
#

For my use case, yes. This makes it just the same as other family Adafruit boards. Basically it allows me to have a single make rule which operates across different microcontroller families that builds & programs circuitpython all at once.

If there's a way to tell whether tinyuf2 is not present, and fall back to the ROM bootloader, that's fine. Or, if a specific board is designed to run without bootloader, we could make it compile-time conditional instead. Or to notice at CP start that ...

manic glacierBOT
#

There are some situations where you may want to read data from a display:

  • verify the code and hardware is working, and the display is connected properly
  • reduce microcontroller memory usage by storing data on the display rather than in a large buffer (for example, interactions with the display could be β€œnon-displayio”, possibly with display drivers that have hardware acceleration)
  • Creative visual or display interaction projects

Note: With SPI displays, they will need to have ...

idle owl
#

<@&356864093652516868> Greetings! The CircuitPython Weekly meeting is in ~1.5 hours. If you want to participate, please add your hug reports and status updates to the notes doc - same if you want to leave notes but can't attend. Looking forward to seeing you there! https://docs.google.com/document/d/1adH6JMqjSxUkdThbXvb9EbfQHxXELwffE2QLgQ-NLmo/edit?usp=sharing

manic glacierBOT
#

Yep I’ve got it working in Arduino by adding some found readPixel code to the Adafruit TFT library. I’ve demoed readPixel on your 2.8” capacitive touch breakout connected via SPI (this unit uses a ILI9341 driver chip) to the Metro M4 express.

(Note: I haven’t tested on ST7789 displays.)

Attached demo video is grabbing the pixels and redrawing pixels at an x,y offset.

I see that many of the Adafruit all-in-one display/micro controller boards d...

lone axle
#

I've marked myself 'text only' in the doc for today. I may have to step away without notice to talk to some folks working on my fence. As my turn approaches I'll remove that label and read it if I end up being here for my turn.

idle owl
#

Sounds good!

lone axle
slender iron
#

@onyx hinge you are unmuted

onyx hinge
#

argh sorry!

lone axle
solar whale
#

Does it support 8 1/2 inch floppies?

onyx hinge
#

@solar whale not yet!

lone axle
slender iron
#

(even though I was wrong)

solar whale
#

It's the thought that counts.

slender iron
#

πŸ™‚

thorny jay
#

How big is too big @solar whale ? 32*24=768 pixels, it could be bytes, but if you limit the number of colour and maybe compress as most pixel have a colour very close to the adjacent colour?

solar whale
#

It's not too big, just bigger than one packet. the max packet for LoRa is 256 bytes. It probably could be made to fit with tome clever techniques. I am using one byte for each pixel.

onyx hinge
#

I think if Blinka ships circuitpython_types as an importable module, the typeshed version would still be used when type checking.

#

but it needs to be tested

#

if that's true then doing the subset will be fine

#

we renamed it from _typing to circuitpython_typing (or _types?) because _typing was not a good name to squat on

#

typeshed version = .pyi file version

#

thanks πŸ˜‰

#

that's right, I can still build esp32-s2 locally from the tip of main

solar whale
#

Is there a plan to eventually support the esp32-C3-devkitc-02?

slender iron
#

my plan is to look at the C3 after I have ble going on the S3

onyx hinge
#

thanks for looking at it Scott!

slender iron
#

(hopefully it'll just port over)

errant grail
#

Thank you!

onyx hinge
#

thank you!

mental nexus
#

Thanks all!

gilded cradle
#

Thanks

ember iris
#

Thanks all!

thorny jay
#

Thanks

blissful pollen
#

I'm have a question about a PR I just submitted for Adafruit_CircuitPython_IS31FL3741 I am getting a reuse error or missing copyright information showing up for the font file (.BDF) in the examples folder. So I can't just include a copyright line like python.

solar whale
#

@idle owl I did it several months ago. I'll take some time to bring it up to date before sending it to you if that is OK.

idle owl
gilded cradle
#

@blissful pollen I think you have to include a separate file that ends in .license

manic glacierBOT
idle owl
#

Let me see if I can find an example.

#

The audio files at the bottom of the list.

blissful pollen
idle owl
idle wharf
solar whale
#

@idle owl I orignailly used an esp32s2 because alarm was available for it first. For this, I think a feather rp2040 will be better -- you don't need wifi so I'll check it out on an rp2040

idle owl
solar whale
idle owl
solar whale
#

You are back in the US, correct so 915 MHz.

idle owl
#

Keen ok.

solar whale
#

yes to 4074

idle owl
#

LoRa wing should match?

solar whale
#

yes

#

3231

idle owl
#

Found it! Do I need an antenna?

solar whale
#

a 3 inch piece of wire will work

idle owl
#

Neat

solar whale
#

hardest part is making the outdoor one weather proof.

idle owl
#

In my mind, it would go in the mailbox. But I suppose that doesn't work for line-of-sight.

#

Also, temperature and batteries.

#

Is a consideration.

solar whale
idle owl
#

Hah just found that too

solar whale
idle owl
#

I added the little spring antenna to my cart

#

Mailbox is plastic

#

iirc.

solar whale
#

They may also be fine for that distance.

#

May just take some experimentation.

#

We'll make it work!

idle owl
#

I'm excited! Might have to sit on this until Father's Day or something, surprise him with it πŸ˜„

#

We'll see if I can wait that long.

#

Also not sure how to test that distance here, I don't have anything that far away still on my property.

#

My folks live on a much larger lot.

#

(40 acres vs maybe 0.5 acres here.)

#

The house is in the center of the front 20 acres though.

solar whale
#

I just test by walking around the block -- pushing the button!

tulip sleet
#

A straight wire antenna is as good or better than the spring, probably

manic glacierBOT
solar whale
idle owl
#

They are!

solar whale
#

I've used both but have not really tested distance. It is easy to swap between the spring and a wire.

blissful pollen
#

You can probably google it but there are lots of resources to select the proper antenna wire length based on frequency too. Also important to make sure the antennas are orientated the same way (vertical/horizontal/etc.)

manic glacierBOT
idle owl
#

Hmm. Looks like LiPoly batteries handle pretty cold temps. But it's been sneaking up on bonkers cold here every so often lately.k

solar whale
#

Since you are only going a few hundred meters, it may be more foriving.

idle owl
#

What happens if it's too cold? Do they simply not work? Or do they end up damaged?

#

Oof.

#

Looks like damaged.

blissful pollen
solar whale
#

good question... I forgot about that.

idle owl
#

I imagine I would have my dad bring it in to charge it.

#

Give him a couple to swap out.

solar whale
#

I also think charging is the big problem.

idle owl
#

From some rando site: "if the battery is charged and discharged in a low-temperature environment for a long time, metal lithium will be separated out on the surface of the β€œbattery anode”. This process is irreversible and permanently damage to the battery capacity."

#

But this would be short bursts.

#

Which it says is fine, and doesn't do permanent damage.

blissful pollen
#

My largest problem is the low sun angle and lack of it this time of year. But from all I recall using it is fine. Charging it is what can cause the damage

idle owl
#

Fair enough. Good to know.

#

I'll supply a couple of batteries and suggest bringing it in to charge it.

#

Easier than making the project box have a charging port anyway.

blissful pollen
#

I put one in just to see how it would be after a year or two. My $10 experiment πŸ™‚

idle owl
#

Makes sense!

#

How cold does it get there though?

blissful pollen
#

The low tomorrow evening is -18F (-28C) and it has been colder this year

idle owl
#

Ok, yeah, fair enough. Your experiment is satisfactory for my purposes.

#

It got down to -30F or some such the other night...

solar whale
#

@blissful pollen that is great to know.

idle owl
#

But again, this is only short bursts, and would, in theory, be during the day.

solar whale
#

What MCU do you have out there?

blissful pollen
idle owl
#

Unless someone is delivering mail at midnight.

blissful pollen
#

I have a Feather M0 running it all

solar whale
#

Great -- I was concerned that it was outside the operating range of the feather as well.

idle owl
#

I put a Feather in the freezer when I was doing that cursed datalogger.

#

It was fine.

#

Before Limor told me it shouldn't go in the freezer, anyway πŸ˜„

#

Any reason to think the cylindrical batteries will handle cold better than flat ones?

blissful pollen
#

The only problem I have ran into is the low sun angle, just lack of sun hours and more cloudy days in a row then normal lately. And a neighbors tree

#

I did li-ion because it was cheaper if I wrecked it πŸ€·β€β™‚οΈ

idle owl
#

Understandable.

solar whale
#

plus more capacity.

idle owl
#

For sure.

#

Ok, ordering one each of a few capacities because I don't know what will fit in the enclosure.

solar whale
idle owl
#

So Feather RP2040, LoRa FeatherWing, LoRa bonnet, enclosure, batteries.

#

Oh hmm.

#

Would it be worth using the Feather ESP then? That's built in.

solar whale
#

or use the esp32s2 with it built in

idle owl
#

How hard is it to send battery level info along with a "Hello, check the mail" packet?

solar whale
#

It's in my code already

idle owl
#

Hah! Fair enough.

blissful pollen
#

If you can get wifi that far can use adafruitio (though wifi will take more power then lora)

solar whale
#

I was thinking the Pi in the house could do the AIO link πŸ˜‰

idle owl
#

I don't think the WiFi will go that far, doesn't reach the barn outside or the other end of the house (which is a line-of-sight issue, not a WiFi issue). We needed repeaters.

#

Can a Pi be made to send an email when a thing happens? Or, even better, a text message? Email would probably work ok though.

blissful pollen
#

I mean the obvious answer is to use the Satellite modem and really overengineer this πŸ™‚

solar whale
#

Then it can tell Kattni the mail is in and she can call her father.

idle owl
#

Ok Feather ESP added too.

blissful pollen
idle owl
#

Anything else?

solar whale
#

stacking headers

idle owl
idle owl
#

Anyway I usually use normal headers to make skinnymini Feather sandwiches.

#

Or Feather shorty headers.

#

All of which I have too many of.

solar whale
#

I think you have it covered. I'll try to have some code to you by tomorrw.

idle owl
#

Great! Again, no rush. This is a pet project that's been in the back of my mind for a while.

#

Weird, UPS must have changed regulations. I forgot they usually yell at me for more than 3 LiPoly cells. I have four and they apparently don't care.

#

Unless it's ... there it is.

#

It doesn't get mad until you click go.

#

Fixed and done.

#

This should be fun!

solar whale
#

Yes!

blissful pollen
#

Be cool to see the results

idle owl
#

Occurs to me we didn't sort out what actually makes it trip πŸ˜„

solar whale
#

yes. I think the opening of the mailbox door can trigger it.

idle owl
#

Which also means it might not be able to live in the project box, without modification. Unless I use a light sensor or something and put the box in the mailbox?

#

Still means wires coming out of the project box, though, doesn't it?

solar whale
#

Yes, but it has holes for that!

idle owl
#

I suppose I can drill a small hole and then seal them in with hot glue or something.

solar whale
#

yup!

idle owl
#

What type of sensor would I use to have it trip when the door opens?

blissful pollen
#

The magnetic contact switches work good for opening doors and such

idle owl
#

Ah

blissful pollen
solar whale
#

you can get them Normally open or normally closed

idle owl
#

Which do I want?

#

I get what they do, but I'm always fuzzy on which works for what.

solar whale
#

I have to check on what wakes up from sleep -- high or low.

idle owl
#

OK, I'll wait to order that then.

#

Though that's the only Adafruit option. So hopefully it'll work.

solar whale
#

I have a pull-up on the button so a low signal triggers it. The problem with that switch is that it is normally open but when the door is closed the switch is closed. I originally did this with similar switches, but I found some that are normally closed so when the door is close they are open. looking for the link.

idle owl
#

Could you compensate for that in code? Or is it not worth it, and better to use the proper hardware?

solar whale
manic glacierBOT
idle owl
#

Ah

solar whale
#

You would need to invert the signal -- so you need additional hardware.

idle owl
#

Ahhh ok.

#

Additional for the Adafruit one? Or for the Amazon ones as well?

solar whale
#

The amazon one has both options. the terminology is confusing because depends on what you want the state to be when the magnet is present.

idle owl
#

Fair enough

solar whale
#

the adafruit one would need to be inverted,

idle owl
#

Looking on Amazon for a proper one already wired in a way that I can seal it easily.

solar whale
#

I tried a bunch of them!

idle owl
#

Would that work?

#

I've ordered whatnot from that brand before is why I ask. Whatever it was, it worked.

solar whale
#

I'm trying to understand their wording -- just a sec.

idle owl
#

Yeah I was confused there as well.

solar whale
#

no good switch Type: nc(normal close Type), the circuit is close normally, and, that If a magnet comes near it, the circuit closed. when to mailbox is closed, the magnet will be next to the sensor so it would be closed. You want it open and closed when the magnet goes away.

idle owl
#

Ok

solar whale
#

Thats why I like the ones with both options !

idle owl
#

So probably better to get one that does both because you can't go wrong there. Not sure how to make it weatherproof though.

#

Wait

#

found one with decent reviews that is already wired

#

for both options

solar whale
#

I think the switches are ok themselves.

idle owl
#

Has 3 wires

solar whale
#

like the last one I posted.

solar whale
#

should be fine.

idle owl
#

Excellent.

#

Ordered! Thanks!

#

And thanks for dealing with my indecisiveness and uncertainty. Appreciate it! πŸ˜„

solar whale
#

No problem! You'll have lots of new toys!

idle owl
#

Na we'll make it work! No worries!

tulip sleet
solar whale
#

When I first worked on the project, for some reason, I needed a reed switch with the opposite state than was available in the Adafruit shop. I don't recall why now and it seems like either should be useable. I'll verify that tomorrow!

manic glacierBOT
main furnace
#

Happy to report that the beta Mu 1.1 can access the CircuitPython console via USB serial on the Pi Zero W. πŸŽ‰

main furnace
#

Trying to drive the 1.14" PiTFT on the Pi Zero W. It takes 136 seconds to fill the 135x240 screen with a constant color565 value. This doesn't seem to be running at 64 MHz.

slender iron
#

☝️ should fix the build

viscid pine
#

working for me on s3 with and without psram

proven garnet
#

Just caught up on the meeting today! Thanks for the discussion! I'll go ahead and implement a typing module for Blinka as a subset of the CircuitPython one. I don't think the type checker should be an issue - worst case, an IDE says you can use a class that just isn't available on Blinka so it's not a problem. And you'll never get the opposite on Blinka.

#

Thanks y'all!

slender iron
#

@analog bridge when you are up and available: how far have you gotten with BLE on ESP? I'm starting to work on it

manic glacierBOT
orchid basinBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.1.1 on 2022-01-14; Adafruit Feather M4 Express with samd51j19
Board ID:feather_m4_express

Code/REPL

# --- code.py ---
import time

import board
import digitalio
from analogio import AnalogIn

from src.common import Clock
from src.common.IntervalTimer import IntervalTimer

ledPin = digitalio.DigitalInOut(board.LED)
ledPin.direction = digitalio.Direction.OUTPUT

time.sleep(1)

ledTimer = IntervalT...
orchid basinBOT
solar whale
#

@idle owl I've done some testing on the radio switch. I tried it on both the esp32s2 and rp2040 feather. The esp32s2 is definitely preferred.It has the built-in battery monitor but also the alarm.sleep_memory is not implemented on the rp2040 and it is useful for keeping track of the number of messages sent and for diagnostic information. It looks like rp2040 sleep is still not fully implemented. I also tried swapping the type of door sensor and so far it still works much better with one that is "open" when the magnet is present (door closed). I have not yet been able to get the opposite type to work properly. It may be possible, but it is good to have the type of switch that allows you to choose. I can provide some example code any time you would like to have it. I will create a github repo for it. Just a personal one. I'll do some more work on it to make it more clear what it is doing and I have done very little on the receiver side. Right now it just prints out the received message. I may end up installing one here! My wife really liked the idea!

manic glacierBOT
proven garnet
#

For the Blinka typing module, should I use _typing since that's currently what it is and update later? Or circuitpython_typing and just ask for that to be merged when that is in the latest stable release for CircuitPython?

tulip sleet
#

you can also fail softly if either import fails

#

or import _typing as circuitpython_typing

#
try:
    import circuitpython_typing
except ImportError:
    import _typing as circuitpython_typing
proven garnet
#

So should I keep it up to date with current or future proof it to the new name and just wait until that is in the stable release?

#

I don't actually know when that would be

tulip sleet
#

I would name it circuitpython_typing.py and then also add an _typing.py that does something like:
from circuitpython_typing import *. I think that will provide two identical namespaces.

proven garnet
#

Ah, good idea! Thanks!

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.2.0-alpha.1-132-gba008ddfb on 2022-01-18; Raspberry Pi Zero W with bcm2835

Code/REPL

import board
import busio

def test(n=1_000_000):
    bus = busio.SPI(board.SCK, board.MOSI, board.MISO)
    with bus as spi:
        while not spi.try_lock():
            print("no lock")
        spi.configure(baudrate=n)
        spi.unlock()
        print(f"frequency={spi.frequency}")
    bus.deinit()
test()

...

proven garnet
#

Going though my PRs and noticed some unclosed issues, could someone please close this issues addressed by PRs I'd they get a chance! Both were implementations that were tested or deemed safe! Thanks in advance!

https://github.com/adafruit/Adafruit_CircuitPython_BLE/issues/85
https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI/issues/55

GitHub

Implementing eq method for Advertisement class will allow them to be compared in a useful way. Documention on how this works when some fields are not set would be useful. Interim workaround is ...

GitHub

https://docs.python.org/3/library/socket.html#socket.socket.recv_into Adding _into methods would allow for a long lived buffer provided by the client code rather than a new, potentially large, buff...

proven garnet
#

Here's the PR for adding CircuitPython typing modules to Blinka. I added a long list of how and why I designed it as such as well as a consideration about memory I wouldn't mind feedback on. Thank you!

https://github.com/adafruit/Adafruit_Blinka/pull/543

GitHub

Address inability to use CircuitPython's typing module _typing (which will become circuitpython_typing) by adding a subset of the module. In CircuitPython these are stub files, as my under...

manic glacierBOT
orchid basinBOT
manic glacierBOT
slender iron
#

@analog bridge ok, I found that yesterday. it looked like you were using bluedroid

#

my plan is to go with nimble

manic glacierBOT
slender iron
#

my hope is that we can use nimble on more than just esp in the longer term

#

just getting everything stubbed out and compiling first

#

then I can add things and test them as I go

analog bridge
#

I didn't get far with ble on espressif... the only common-hal api that is completely implemented is UUID. Thanks for starting working on it!

slender iron
#

np, I'm excited to get it working

#

thanks for getting S3 and C3 going!

idle owl
#

@solar whale The Adafruit gear will get here tomorrow; the switches will arrive today. So I'll have to wait until at least tomorrow. Really, I should wait until this weekend since it's not a work project πŸ˜‰

#

Anyway a GitHub repo is a great idea. I can fork it and we can collab on it!

manic glacierBOT
solar whale
pallid echo
# orchid basin

I'd like to learn from this.. How did you now those puns weren't intended?

pallid echo
#

I'm sorry.. Had a rough day. Nice to see a PR that made me smile. πŸ™‚

solar whale
slender iron
#

@solar whale yup!

solar whale
#

ah -- now I see the xxN4 on the cover...

slender iron
#

ya, the N number is the flash size

solar whale
#

Woot! ```
Adafruit CircuitPython 7.2.0-alpha.1-157-g42fbebe62 on 2022-01-19; ESP32-C3-DevKitM-1 with ESP32-C3N4

help('modules')
main collections microcontroller socketpool
_bleio digitalio micropython ssl
adafruit_bus_device displayio msgpack storage
adafruit_pixelbuf dualbank neopixel_write struct
aesio errno onewireio supervisor
analogio espidf os synthio
array fontio ps2io sys
atexit framebufferio pulseio terminalio
audiocore gc pwmio time
audiomixer getpass rainbowio touchio
binascii gifio random traceback
bitbangio i2cperipheral re ulab
bitmaptools io rgbmatrix uselect
board ipaddress rtc vectorio
builtins json sdcardio watchdog
busio keypad select wifi
canio math sharpdisplay
Plus any modules on the filesystem

manic glacierBOT
idle owl
#

Since when does pressing the boot button on startup on a CircuitPython board go into safe mode? I thought that was reset?

#

Also, bumps it into the UF2 bootloader if pressed when the LED is purple on the ESP32-S2. I thought that was reset as well.

#

All of this means I can't use the boot button to put the board into a read-only state for a storage example.

#

Bleh.

slender iron
#

that's an esp thing

idle owl
#

Oof.

#

Ok.

slender iron
#

holding boot when pressing reset will get you into the rom bootloader

idle owl
#

Right, I was hoping there was an inbetweeny time where CP could read it.

#

And not end up in the ROM bootloader.

slender iron
#

the read only thing could work if you wait

idle owl
#

I tried waiting..

#

and ended up in UF2 bootloader or safe mode.

#

When should I press it?

slender iron
#

the trick is knowing when to press it

idle owl
#

Hah.

#

OK

slender iron
#

boot.py could set the neopixel to tell you

#

just like the other times

idle owl
#

Yeah I was about to try that.

#

OR something like that. NeoPixel is a better idea than a print statement.

slender iron
#

print is what I do on macropad

#

(since it has a screen)

idle owl
#

It worked!

#

Thanks πŸ™‚

slender iron
#

np

manic glacierBOT
#

CircuitPython version

CircuitPython 7.1.1

Code/REPL

https://forums.adafruit.com/viewtopic.php?f=60&t=187420#p907592

Behavior

If the code is run as shown, everything runs as expected - the program runs continually and the LED flashes indefinitely.
If the time.sleep(15) line is uncommented, the program runs for 16 seconds then the board is reset and the program re-starts.
Again, this is as expected.
However, if the print(b) line is uncommented ...

slender iron
manic glacierBOT
#

This tweaks the RMT timing to better match the 1/3 and 2/3 of 800khz
guideline for timing. It also ensures a delay of 300 microseconds
with the line low before reset.

Pin reset is now changed to the IDF default which pulls the pin up
rather than CircuitPython's old behavior of floating the pin.

Fixes #5679

idle owl
#

@blissful pollen I think I'm going to try to add solar to this project, by the way. While my dad is fully capable of taking a project box apart repeatedly to swap out a battery (my folks built their own house), I figured if I could avoid that necessity, it would be more ideal. Also would make mounting it easier because it won't have to be easily removable. But we'll see how this works!

#

Not sure whether idiots driving around with a baseball bat to wail on mailboxes is still a thing, but it definitely used to be, so I'm trying to figure out mounting it with that in mind.

blissful pollen
#

If it is deep sleeping most of the time solar would likely work real well. I used a SparkFun solar device I had around for mine but Adafruit had an equivalent I think

idle owl
#

Yeah, I found a breakout and solar panels.

#

Ordered both.

#

I figured it would work, because so little power will be used.

blissful pollen
#

Cool, watch for how the sun tracks different times of the year. If its good enough may work just aimed at one spot (that's all I do)

idle owl
#

That is my plan, heh. Forgot about needing the sun direction to matter though. πŸ˜„

#

Or a 3D printed mount for it that can be aimed slightly or something.

blissful pollen
#

yeah mine is aimed south as the sun tracks the sky at about 30 degrees from vertical. In the winter here the sun barely gets 30 degrees high (where all the trees from my neighbors I want to remove are πŸ™‚ )

idle owl
#

Heh fair enough

manic glacierBOT
manic glacierBOT
solar whale
#

hmmm -- has anyone tried the latest build for the feather-esp32s2? For me, it builds OK but when I load it, it does not boot. the board returns to the bootloader on reboot.

manic glacierBOT
devout bolt
#

Hey Everyone, I'm new to discord (and programming hardware). Just received my 1x4 LED Arcade Buttons breakout today. I just realized I don't know to work with I2C! I can make the buttons/LEDs work when I connect them directly to GPIO pins on my Feather RP2040, but once I put them on the breakout board I'm not sure how to work with them over I2C. I've followed some general I2C tutorials and am connecting to the breakout using the busio library but I think I'm missing something. Any help is greatly appreciated! πŸ™‚

solar whale
# devout bolt Hey Everyone, I'm new to discord (and programming hardware). Just received my 1...

Welcome to this server. This type of question should go into one of the #help-with channels -- If you are planning to use CircuitPython then #help-with-circuitpython or for Arduino #help-with-arduino -- if it is a general question about your project #help-with-projects. This channel is meant for discussion of the development of the CircuitPython code itself. There are lots of people willing to help.

proven garnet
#

@gilded cradle I added a follow up PR to Blinka to add the typing modules to the README and other doc touchups, just wanted to let you know!

pulsar bloom
#

Quick question, I have got circuitpython repl and network running on esp32-s3-DevKitM-1. My question is any chance bluetooth works?

manic glacierBOT
solar whale
#

Anyone else tried the esp32s2 yet today?

lone axle
solar whale
#

Whew! It's not just me....

lone axle
#

Interestingly I also tried funhouse-en_US-20220120-1cd3faa.uf2 on a FunHouse and that one seems to load and run and behave normally. So it's specific to the feathers or at least not effecting all ESP32-S2 based devices.

solar whale
#

Also fails on the QTPY esp32s2

lone axle
#

It may be a red herring or coincidence. But I loaded feather_esp32s2_tft-en_US-20220120-8bae6af.uf2 (yesterdays build) and after loading that my feather booted into CircuitPython and immediately hard fault crashed to safe mode. After resetting once with the button it came back and successfully launched circuitpython and behaves normally.

Almost feels like something wonky was "leftover" from today's build that didn't get resolved until that reset occurred. But I don't know if that is even a possibility really.

solar whale
#

hmm - I did not verify how well it booted afterwards -- checking

#

Mine is OK now with 8bae6af12 but I have loaded/reloaded it many times this morning.

#

hmmm -- I take taht bak, it boots, but it is not running my code normally. something is not right....

#

My code is now regularly crashing into Safe mode -- due to HardFault....

#

even with the 7.2.0-alpha.1 release

gilded cradle
solar whale
#

@lone axle On my feather esp32s2 it boots O, but if I run the lc709203f_simpletest using the onboard battery monitor, it hard faults

lone axle
#

Mine has only the stock print("hello world") code but after that initial reset it does seem to run that properly.

solar whale
#

Mine is pretty well hosed...

#

OK -- whew -- it works with 7.1.1 stable.....

#

I was concerned that the HW had gotten damaged...

#

ah -- 2a09c37 is also working OK for me

#

as is 42fbebe ...

#

now that is weird -- I am back to 8bae6af and my code is running fine -- no more hard faults

#

but if I load 1cd3faa -- it stays in bootloader as before, but reloading 8bae6af seems to be OK -- it did go to safe mode once after the reload but it seems to have recovered

manic glacierBOT
tulip sleet
solar whale
#

I am using uf2's

#

I tried bin for 1cd3faa once and it failed as well -- went back to bootloader which I thought was odd since I thought loading vial esptool would remove the uf2 bootloader.

tulip sleet
#

you have to erase_flash if you use a bin because you need to clear the partition table

solar whale
#

ah - OK -- I can try using ,bin if you think it might make a difference

tulip sleet
#

sometimes it seems like clearing the flash helps -- I find that mysterious, as if there's some state that's read by the ESP-IDF code on startup

#

I don't think the BIN/UF2 makes a lot of diff here. But there has been pot-stirring in the ESP impl recently which might be causing this problem. An issue would be in order for any of your seeing trouble.

solar whale
#

I filed an issue alredy

jaunty juniper
#

on my QT py it looks like it goes all the way to the yellow blink before rebooting into tinyuf2

tulip sleet
#

@solar whale I tested 1cd3faa (neopixel change) ONLY with a .bin (yesterday), and it worked. So maybe try the bin. The PR also made some default pin state changes, which may be some kind of issue

solar whale
tulip sleet
#

metro esp32

solar whale
#

OK -- I'll try the feather then I can also try a metro -- @lone axle found it was not an issue on the funhouse....

lone axle
#

(all of my tests on both FunHouse and Feather TFT ESP32-S2 were UF2 files)

solar whale
#

@tulip sleet on the esp32s2 -- after erase, the bin does not boot

slender iron
solar whale
#

I was able to recover it by reloading the uF2 bootloader and loading 8bae6af

tulip sleet
#

@solar whale I tested the neopixel fix by building in Scott's repo, not from the final merge. I will test again.

solar whale
#

@tulip sleet metro esp32s2 boots ok with 1cd3faa06 but the CIRCUITPY drive comes us as 983KB volume

tulip sleet
#

did you erase the flash beforehand?

solar whale
#

I did not erase it first -- and it had been used for wippersnapper

#

no -- I'll try that

tulip sleet
#

you can't switch from uf2 to bin without erasing

solar whale
#

I loaded the UF2

tulip sleet
#

1cd3faa06 .bin comes up on my Metro

#

I'll try the UF2 after loading the combined.bin

solar whale
#

Do you heave feather esp32s2?

#

or qtpy esp32s2

tulip sleet
#

yes, I can try bin on those

solar whale
#

how do you erase the metro -- webtool is failing

tulip sleet
#

put it in boot mode, press erase, but I used esptool:
alias erase-flash-esp32s2='esptool.py --chip esp32s2 -p /dev/ttyACM0 -b 460800 erase_flash'

solar whale
#

erasing

trim elm
#

@proven garnet @lone axle Heya! Just ran a patch and would really appreciate some help/input on some CI failures I don't entirely understand but I think y'all might.

font issues:
https://github.com/adafruit/Adafruit_CircuitPython_Simple_Text_Display/runs/4872502365?check_suite_focus=true
https://github.com/adafruit/Adafruit_CircuitPython_Display_Button/runs/4872497567?check_suite_focus=true

Probably type-hints related:
https://github.com/adafruit/Adafruit_CircuitPython_AzureIoT/runs/4872495272?check_suite_focus=true

Thanks!

#

P.S. Thanks for all the work y'all have been doing. It's for sure been making my job a lot easier :)

solar whale
#

@tulip sleet after erasing and with .bin, the metro is fine -- be interested how you do with the feather or qtpy

lone axle
trim elm
#

Ahh ok trying that. Thanks!

manic glacierBOT
lone axle
#

previously it was kind of a "loose" requirement. Needed only if you want to use a custom font specifically. But it's become more strictly required to build the docs with some of the recent typing information added.

If that doesn't work out let me know and I can dig a bit further into it as well.

trim elm
#

Hmm yeah I see

#

Will do!

slender iron
#

don't we have a font protocol for typing now?

#

@solar whale metro vs qtpy is weird. it looks like they have the same esp module

tulip sleet
#

@solar whale but you tested the bin on metro, not the uf2

solar whale
#

Trying uf2 now

slender iron
#

metro doesn't have status led power

#

(no idea why that'd matter)

solar whale
#

ugh -- nevermind -- don't have uf2 bootloader on metro now...

#

I thought loading an arduino setch would restore it, but I guess not.

tulip sleet
#

no, do the factory reset

#

.bin is NOT working on QT Py ESP32-S2, even after full erase

#

@slender iron maybe we should revert that PR for now

#

unless you want to debug it immediately. I'd assume it has to do with the new quiescent pin state stuff

slender iron
#

I can look right now

#

just gotta find my qtpy

solar whale
solar whale
#

@tulip sleet I see factory reset for the QTPy -- is there something similar for the metro?

idle owl
#

I think we weren't generating them consistently when the Metro came out.

#

That was a more recent thing that we started doing. With the plan to go back and do it for all of them.

#

I don't think we have yet though.

solar whale
#

metro does not do the neat trick with Ardunio loading the bootloader 😦

idle owl
#

Oh weird, really?

#

It should..... as far as I know... that's not good.

solar whale
#

oh wait -- it does

idle owl
#

Because that guide page will end up in the Metro guide eventually with that trick in it.

solar whale
#

I did not tap fast enought

idle owl
#

Oh whew!

#

Ok.

solar whale
#

all good

#

@tulip sleet the UF2 works OK on the Metro esp32 as well

tulip sleet
#

I repeated the BIN load on the QT PY, does not work. So also works for me on Metro and not Qt Py

#

so something to add to the issue if that is not already clear

solar whale
#

So far, I have not see any difference between bin and UF2 response.

#

both work or don't work

tulip sleet
#

it's good that's not a variable

solar whale
#

And FYI -- loading an arduino sketch on the metro does restore the UF2 bootloader.

#

I just load blink

tulip sleet
#

that is good too!

slender iron
#

the pull up could be causing the RC reset circuit to be high

#

the build does work if the new gpio_pin_reset() calls are commented out

solar whale
slender iron
#

I don't have a feather

#

I'm testing on a qtpy

#

trying to get uart output

solar whale
#

Ok -- I can try commenting those on a feather

#

commenting those lines does allow the feather esp32s2 to boot and it seems to be working OK

proven garnet
#

@trim elm can't figure out the other one though, thanks @lone axle for the explanation for the font ones

trim elm
#

Yeah, that one really stumped me

proven garnet
#

I wish I could tell which exactly line is stumping it or something. I can't figure out why it's looking for a __qualname__ either

slender iron
#

is it not the logging line?

proven garnet
#

Well, it says the class causing it, but not what strings its trying to specifically concatenate

#

There's only a handful there, but nothing seems out of the ordinary. Unless when it's running through the library and import classes, maybe an error? I thought I heard someone say in another repo that Azure IoT library had an issue (I thought it was resolved though). Could that be it?

#

The + self._hostname is really the only one that isn't straightforward so that would be my guess but I can try digging further

slender iron
#

I was thinking it was the __init__ type info causing the problem

#

the concat is being done by sphinx

proven garnet
#

Oh okay

slender iron
#

(my guess)

proven garnet
#

Oh, wait, I think you're right!

#

It looks like logger is typed as a module and not Logger

lone axle
#

Ah, still catching up. I see there was some more discussion about it. Will take a look later on though if it's still occurring.

proven garnet
#

Branched it and testing it in my fork's CI now πŸ™‚ if that's it I can submit a PR

#

I branched it off of the patch I believe

slender iron
#

@solar whale I think the issue was resetting the flash pins

solar whale
#

Glad it is making some sense to you! Is flash handled differently on these boards than on others?

slender iron
#

no, which is weird

#

some boards do have never resets for it in board_init

proven garnet
#

Still fails, I'll investigate further gx_Sunglasses_cry

slender iron
#

hrm, ok

#

thanks for trying it

manic glacierBOT
slender iron
#

@solar whale ☝️

solar whale
#

Cool! I'll give it a try.

#

57 files changed !!! 😱

manic glacierBOT
solar whale
tulip sleet
#

i am also testing

orchid basinBOT
solar whale
#

OK on qtpy esp32s2...will try metro next

#

😦 CI not happy

#

metro esp32s2 seems OK as well

tulip sleet
#

same here, both UF2 and BIN on both boards work

#

I used that Arduino trick to load the bootloader. thanks for that!

solar whale
#

@idle owl taught me that -- great time saver. And brain saver ...

manic glacierBOT
#

Also verified that both .uf2 and .bin on QT Py ESP32-S2 and Metro ESP32-S2 work. S3 and C3 builds are not working:

common-hal/microcontroller/Pin.c:54:9: error: "CONFIG_IDF_TARGET_ESP32S2" is not defined, evaluates to 0 [-Werror=undef]
     #if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3
         ^~~~~~~~~~~~~~~~~~~~~~~~~
common-hal/microcontroller/Pin.c:54:38: error: "CONFIG_IDF_TARGET_ESP32S3" is not defined, evaluates to 0 [-Werror=undef]
     #if CONFIG_IDF_TARGET_ES...
manic glacierBOT
#

A user did open("filename", "b"). No error is reported by the open() call, but later, when the file handle was used, bad things can happen, e.g.:

>>> f = open("bad.py", "b")
>>> m = audiomp3.MP3Decoder(f)
Traceback (most recent call last):

(that is the whole traceback!)

The CPython error for the above:

ValueError: Must have exactly one of create/read/write/append mode and at most one plus

For a completely invalid mode (bad character):

ValueError: inval...
manic glacierBOT
manic glacierBOT
idle owl
#

@proven garnet Hello! The patch has been run, and Eva is now going to put together what's left to do to cleanup after it. We're going to create an issue with the necessary info in it, and I'll ping you again once that's ready so we can go over it.

proven garnet
#

If I don't respond here quick enough, just DM me, otherwise I'll look through the chat and catch it πŸ™‚

crimson ferry
#

blinka_cooking toebeans ESP32-S3 (N8R2) working like a champ on latest S3 (20220120-5d54d02)! Very minor code changes to my full app, usually a good stress test for a new chip or port (S2 vs. S3, and microcontroller.cpu.temperature not impl.) 🎊 πŸ“Ά

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
proven garnet
#

Caught up on the meeting from last week, regarding the question about typing protocols for duck typing:

#

Since Blinka requires python 3.7 as the minimum I believe the way to do it is with an abstract Base class, but 3.8 introduces Protocol, which seems to be the new standard

pallid echo
#

Speaking of static analysis tools. I've been lurking a while, and every once in a while I see people having space issues. Do the tools that build .mpy files do any tree shaking?

proven garnet
#

I had a follow up to that but I answered it myself haha

onyx hinge
#

@pallid echo no, they do not.

#

It's not clear it's a good idea except for final deployment by sophisticated users, since everyday and beginner users are accustomed to copying .mpy files once and freely editing code.py.

#

@proven garnet ```py
shared-bindings/fontio/BuiltinFont.c://| from typing_extensions import Protocol # for compat with python < 3.8
shared-bindings/fontio/BuiltinFont.c://| class FontProtocol(Protocol):

#

ReadableBuffer is not a matter of duck typing, because it is about how some core C APIs can treat the object. You can't reproduce this just with creating a class in Python.

tulip sleet
#

also might be true still on a number of single-board Linux systems that are not up to date

#

This is a Melissa question

gilded cradle
#

Normally I'd be fine with moving it to 3.8, but Dan makes a good point in that 3.7 was the standard install on Buster and Bullseye is so recent that there are things still broken on it, so we have to sometimes refer users to Buster.

onyx hinge
#

yeah I'm guessing it's because 3.7 was the standard (only?) version on buster. bullseye has 3.9.

#

ubuntu 18 has 3.6, ubuntu 20 has 3.8, and ubuntu 22 will likely have 3.9 (not 3.10! even though it's not out yet)

tulip sleet
#

22.04 has 3.10 scheduled. Just last night the package updates included 3.10, but did not remove 3.9

onyx hinge
tulip sleet
#

I just found this a few days ago

gilded cradle
#

It's always a balancing act of having newer features vs excluding older boards.

tulip sleet
#

@onyx hinge I am on 22.04 because i needed a newer kernel

#

it has been surprisingly bump-free

onyx hinge
#

It does feel risky to transition from python 3.9 to 3.10 just 3 months before release! I wish them luck.

tulip sleet
#

@proven garnet ^^

onyx hinge
#

debian bookworm & sid have 3.10 available (apt install python3.10) but it's not the default yet. of course, debian bookworm's much more than 3 months from release.

proven garnet
#

Thanks for the ping!

proven garnet
proven garnet
proven garnet
idle owl
#

Mailbox project

slender iron
#

anyone here have a pink rp2040 with a winbond flash chip?

jaunty juniper
slender iron
#

pr 5899 does add the winbond chip to the list and change the settings slightly

#

would you mind testing it?

manic glacierBOT
pallid echo
#

Hi, is it expected behaviour that when I install a new uf2, my python code isn't erased?

idle owl
#

Sometimes it gets erased if there was corruption, so always back up your code, but that is the expected behavior.

manic glacierBOT
pallid echo
#

Wow

#

I was already happy with the repl

idle owl
#

You can do the following from the REPL to erase the filesystem if that is your intention. This does not erase CircuitPython. py import storage storage.erase_filesystem()

#

I think that's right anyway... heh.

pallid echo
#

d

#

There's not that much on there... But I didn't expected to be greeted with Hello, World when I connected to the serial device πŸ™‚

idle owl
#

Excellent πŸ™‚

pallid echo
idle owl
#

That is definitely possible.

pallid echo
#

Should I just do a PR for that too.. Is there some doc on that?

idle owl
#

You would need to do a PR to the site on GitHub to add the info for your board. We've been meaning to add that to the guide as a necessary step, but I guess we haven't gotten around to that.

#

Let me look.

#

I'll get you something regardless.

#

Ah we did a guide

pallid echo
#

Perfect. Thanks. Sorry for abusing you as a search engine... Caryy on πŸ™‚

idle owl
#

No worries! If you don't know what to look for, you can't very easily find it. πŸ™‚

pallid echo
#

I'll be on my way. I got two other boards today from the same manufacturer for testing and adding. Should be fun.

idle owl
#

Sounds good!

lone axle
#

My pink feather also has a flash chip that says winbound. It has CircuitPython loaded and running as normal. Not certain of the version atm, but can check and also try out new builds for testing later on if there is still a need.

manic glacierBOT
jaunty juniper
solar whale
#

same here and it worked ok before the PR as well... at least as much as I tried it

idle owl
#

Oof. You are in safe mode because: CircuitPython core code crashed hard. Whoops! Crash into the HardFault_Handler.

#

I am confused by this one... It's a simple program.

#

TFT Feather, trying to read the battery monitor data.

#

No battery plugged in, but that's never mattered before..?

#

I'll try with a battery

#

Nope. Still HardFault_Handler.

#

Anyone have a TFT Feather, want to try this?

solar whale
#

I have one here -- what code are you running?

idle owl
crimson ferry
#

I've seen that, I think when I didn't have the power enabled

idle owl
#

Docstring lies.

#

I tried enabling power, it says pin in use. CP does it automatically for this board, is my understanding.

crimson ferry
#

the pin shouldn't be in use? user should be able to turn off and on

idle owl
#

ValueError: I2C_TFT_POWER in use

solar whale
#

same for me

#

hardfault

idle owl
#

It does not crash into the HardFault_Handler with the power pin code in it, but it fails with that ValueError.

crimson ferry
idle owl
#

Pulled it up, looking

#

Um...

#

Oh.

#

Let me update CP. This is old.

crimson ferry
#

jepler re-opened that issue, I'm not sure it's really fixed

idle owl
#

Same issue, pin in use.

crimson ferry
#

that's got to be a bug, user has to be able to go low-power

idle owl
#

Oof ok.

#

I'll file it.

crimson ferry
#

what about if you release displays before trying the TFT POWER pin?

idle owl
#

Not sure how to do that.

crimson ferry
#

it would be weird, but import diaplsyio, then displayio.release_displays()

idle owl
#

Same error.

crimson ferry
#

it was just a thought, but I doubt that would be the design for expected low-power use

idle owl
#

Fair enough. Worth trying!

solar whale
#

I updated to latest build and now I get ```Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
File "code.py", line 12, in <module>
File "adafruit_lc709203f.py", line 117, in init
ValueError: No I2C device at address: b

idle owl
#

Latest like S3 latest?

solar whale
#

just built it here -- it has a non realted PR in it as well -- I ll go back to straight main

idle owl
#

Or tip of main, etc.

#

Hmm ok

solar whale
#

tip of main +

idle owl
#

That's interesting

solar whale
#

rebuilding

idle owl
#

Can you do a build from main? Ah thanks

#

Grabbing from S3 to try here.

#

Hah!

#

It works properly without the power code.

#

But pin in use when power code is included.

#

So that's... interesting.

#

I need to eat, I'll be back in 10-15 minutes or less.

solar whale
#

I am still getting the above error -- No device at address: b -- with your original code.

#
code.py output:
Traceback (most recent call last):
  File "code.py", line 12, in <module>
  File "adafruit_lc709203f.py", line 117, in __init__
ValueError: No I2C device at address: b

Code done running.

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

Adafruit CircuitPython 7.2.0-alpha.1-177-gdab35f7c7 on 2022-01-21; Adafruit Feather ESP32S2 with ESP32S2
>>> 
#

Are you using esp32s2 tft? I don't see I2C_TFT_POWER pin only I2C_POWER_INVERTED

#

but it is also "in use"

idle owl
#

I was told CircuitPython pulled the pin high by default.

#

So the current behavior I am getting makes sense.

winter mortar
#

I have an S2 TFT Feather running 7.1.0 and I can toggle that pin ok

idle owl
#

However, if that means the user cannot change the state of the pin, because it's "in use", that is bad.

solar whale
#
Adafruit CircuitPython 7.2.0-alpha.1-177-gdab35f7c7 on 2022-01-21; Adafruit Feather ESP32S2 with ESP32S2
>>> import board
>>> dir(board)
['__class__', '__name__', 'A0', 'A1', 'A2', 'A3', 'A4', 'A5', 'BOOT0', 'BUTTON', 'D0', 'D10', 'D11', 'D12', 'D13', 'D14', 'D15', 'D16', 'D17', 'D18', 'D3', 'D35', 'D36', 'D37', 'D38', 'D39', 'D4', 'D5', 'D6', 'D7', 'D8', 'D9', 'I2C', 'I2C_POWER_INVERTED', 'L', 'LED', 'MISO', 'MOSI', 'NEOPIXEL', 'NEOPIXEL_POWER', 'RX', 'SCK', 'SCL', 'SDA', 'SPI', 'TX', 'UART', 'board_id']
>>> 
idle owl
#

You're not using TFT @solar whale

solar whale
#

hmm

idle owl
#

Adafruit CircuitPython 7.2.0-alpha.1-181-gf2713afff on 2022-01-21; Adafruit Feather ESP32-S2 TFT with ESP32S2

solar whale
#

oops

slender iron
#

Thanks @solar whale @lone axle and @jaunty juniper . I'll still have the PR merged in. I'm glad it already works though

solar whale
#

@idle owl works now πŸ˜‰

idle owl
#
>>> import board
>>> import digitalio
>>> i2c_power = digitalio.DigitalInOut(board.I2C_TFT_POWER)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: I2C_TFT_POWER in use```
idle owl
solar whale
slender iron
solar whale
#

I misread -- sorry

idle owl
#

Pin error doesn't happen on 7.1.1.

#

So... something changed since then to cause a problem.

#

The code worked for a hot minute there, and now is failing with Auto-reload is on. Simply save files over USB to run them or enter REPL to disable. code.py output: Traceback (most recent call last): File "code.py", line 17, in <module> File "adafruit_lc709203f.py", line 117, in __init__ ValueError: No I2C device at address: b which Jerry reported earlier.

#

Oof.

manic glacierBOT
idle owl
#

Reset and it works again.

#

With and without the power pin setup in code.py.

trim elm
#

Hey @proven garnet! (cc: @idle owl) I wrote up an issue with the libraries that still need the patch applied to them. If you're still interested in helping out with it, this issue should have everything you need to know to do so. I'm going to start at the top of the list and if you'd like to start at the bottom that'd be great :). Thanks!

#

Also if you have any questions/need any guidance getting started I'd be glad to help :)!

pallid echo
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.1.1 on 2022-01-14; Adafruit Feather ESP32-S2 TFT with ESP32S2
Adafruit CircuitPython 7.2.0-alpha.1 on 2021-12-29; Adafruit Feather ESP32-S2 TFT with ESP32S2
Adafruit CircuitPython 7.2.0-alpha.1-181-gf2713afff on 2022-01-21; Adafruit Feather ESP32-S2 TFT with ESP32S2

Code/REPL

import time
import board
import digitalio
from adafruit_lc709203f import LC709203F, PackSize

# Pull the I2C power pin high
i2c_p...
orchid basinBOT
manic glacierBOT
solar whale
#

@slender iron πŸ‘† Thank you!

idle owl
#

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

proven garnet
#

That's handy dandy convenient then!

proven garnet
trim elm
#

Thanks a bunch!

#

I'll be online for a while so feel free to ping me if you've got questions

slender iron
#

@atomic summit let's move here. I did write a script to verify I hadn't changed the sdkconfigs after the refactor

atomic summit
slender iron
#

np

atomic summit
#

it's really weird... all intermittent. kinda.

slender iron
#

probably pin reset related

atomic summit
#

i thought it might be to do with IO3 and the JTAG boot mode... but messing with that didn't help

#

You know the S3 has 2x USB phy's ? Only one can be active at once,

#

It's got it's regular USB OTG like the S2, but also has USB Serial JTAG

slender iron
#

I knew it had the converter too

#

I didn't know how they were related

atomic summit
#

I thought maybe it's booting wrong ... so no USB mounted, but CPY is running because I can see the neopixel do its flash flash flash on yellow on boot.

#

just sometimes I get a drive and sometimes not.

slender iron
#

weird, try a debug build and see what the uart output has

atomic summit
#

just DEBUG=1 with make? been a while πŸ˜‰

slender iron
#

yup. I usually clean before

atomic summit
#

I always clean before I build ... always

slender iron
#

c CP changes should build right

#

hrm, failed to init external ram

#

probably because this chip doesn't have it...

#

heh

atomic summit
#

I tried with and without RAM_TEST... and you dont have the IGNORE flag on

slender iron
#

I don't know what that is

atomic summit
#

There's a flag you can set to make it ignore PSRAM if it cant find it... so a PSRAM build works on a non PSRAM board

#

# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set

slender iron
#

I'm not sure CP will do the right thing in that case

atomic summit
#

ok

#

my debug build looks fine... and it's mounting fine...

#

and on my test jig (rPI4)... if I try to pyserial to it.... boom...

#
Traceback (most recent call last):
  File "tester.py", line 1632, in <module>
    raw = str(ser.readline())
  File "/home/pi/.local/lib/python3.7/site-packages/serial/serialposix.py", line 596, in read
    'device reports readiness to read but returned no data '
serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)```
#

btw, I'm still using IDF 4.4rc1

#

didn't get anything working 4.4-dev (from inside CYP repo)

slender iron
#

I'm using the commit that we have in cp for my environment and build

atomic summit
#

I'm building tinys2 now with latest to see if it's failing as well.

slender iron
#

I don't know what to tell you about that crash. tinyusb is the same across all of our boards

#

the latest build works for me if I get the right board

atomic summit
#

Serial is working with latest CPY (against 4.4rc1) on my TinyS2 in the test jig. Just not on the TinyS3.

#

Guess I need to go hunting through menuconfig to see if there's an SDKCONFIG I need to add for taking care of the USBSerialJTAG - or maybe something else that's new.

slender iron
#

are you expecting to use the usbserialjtag?

atomic summit
#

Users might want to... but it looks like it's blocking using the board as a general serial device 😦 if that's the issue

#

I'm playing with the settings in sdkconfig-opt now

slender iron
#

I'm assuming they aren't on the S3. real usb is better

viscid pine
#

and it has your py files in it

atomic summit
atomic summit
#

in sdkconfig-opt

slender iron
#

ah, it could be an artifact from my c3 work

atomic summit
#

All of those settings seem to be ignored on the S2 - but on S3 are causing grief... but I cant work out what combo I need to have them work like on the S2

slender iron
#

πŸ‘ thanks for looking into it. the script in tools is what I use to separate things

atomic summit
#

no I mean, i cant work out what combo of these settings

# CONFIG_ESP_CONSOLE_USB_CDC is not set
# CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG is not set
# CONFIG_ESP_CONSOLE_UART_CUSTOM is not set
CONFIG_ESP_CONSOLE_NONE=y
# CONFIG_ESP_CONSOLE_SECONDARY_NONE is not set
CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG=y
CONFIG_ESP_CONSOLE_MULTIPLE_UART=y
CONFIG_ESP_CONSOLE_UART_NUM=-1

Need to be changed to have it work like the S2.

#

and searching the IDF code on most of these give me no clue...

#

BTW, I am assuming this is the cause os my pyserial stuff not working... but maybe not

slender iron
#

maybe ```
CONFIG_ESP_CONSOLE_SECONDARY_NONE=y

CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG is not set

atomic summit
#

splitting them all kinda makes sense - def easier to find "target specific" things - but there are so many new configs now...

#

I tried that

#

tried about 6 combos so far

#

not trying all of them commented out - lol

#

it's a slow process πŸ˜‰

#

I think the issue is... it enumerates and finds the UART /dev/ttyAMC0 - but there's no RX/TX on it

#

so bails

#

if I set the pyserial timeout to looooong - it waits a long time, then fails... so it's waiting for RX but getting nothing.

slender iron
#

what is it expecting to receive?

atomic summit
#

CPY output from my test code

slender iron
#

ah

atomic summit
#

i'm using serial on both sides to send test commands and get back results

#

works great (usually) and very fast...

#

so I have it:
erasing the board
flashing UF2
resetting and mounting uf2
copying CPY over and mounting CPY
copying test code over
.... fail to get anything back from the test code.

#

I'm still getting 1 in maybe 5 or 6 times CPY doesn't mount.... but I'll deal with that later.

#

could be a raspberryos thing.

#

if I do an ls on my DUT before the test I get
ls end b'boot_out.txt\ncode.py\ntinys3.py\n'

#

so the files are copied over

#

I wonder if it's just a timing thing... maybe the S3 is taking much longer to boot up CPY and start running the code?

#

trying a 5 second delay before I connect via serial.... lolz...

#

nope. same.

#

oooooh.... I got it...

#

and it's not me !

slender iron
#

what was it?

atomic summit
#

so, remember how you said you fixed that USB + wifi bug? well, nope! πŸ™‚

#

as soon as I test wifi.... USB device goes away

slender iron
#

it is fixed in CP main

atomic summit
#

disable all of the wifi references, and it works... but of course fails the test.

slender iron
#

I'm not sure what exact version you have

atomic summit
#

I'm on latest latest... pulled 5 mins before the stream started this morning

#

hang on

slender iron
#

the esp-idf folder should be on 6db2ebd7897be544ad0f169871db4b13b4c0941e

atomic summit
slender iron
#

what is your git status showing

atomic summit
#
On branch main
Your branch is ahead of 'origin/main' by 240 commits.
  (use "git push" to publish your local commits)

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
  (commit or discard the untracked or modified content in submodules)
        modified:   ../broadcom/firmware (modified content)
        modified:   esp-idf (new commits)
        modified:   esp-idf-config/sdkconfig-esp32s3.defaults
        modified:   esp-idf-config/sdkconfig-opt.defaults

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        boards/unexpectedmaker_feathers3/
        boards/unexpectedmaker_pros3/
        boards/unexpectedmaker_tinys3/

no changes added to commit (use "git add" and/or "git commit -a")```
slender iron
#

modified: esp-idf (new commits)

#

you have the wrong idf checked out

atomic summit
#

but I'm using 4.4rc1 of my own

slender iron
#

git submodule update esp-idf

#

it's broken

atomic summit
#

ok, hang on

#

in MP, wifi is broken in 4.4dev - but works in 4.4rc1

atomic summit
#

Oh you fixe that IN the IDF ?

slender iron
#

yup

atomic summit
#

I thought it was. CPY side fix. interesting

#

that wojuld explain it

slender iron
#

gotta run! glad you got it sorted

atomic summit
#

thanks for your help.... 5 hours I'll never get back !

#

hahaha

#

my own fault.

#

Still crashing the same way

#
 ❯ git status                                                             
HEAD detached at 6db2ebd789
#

did a clean then build

#

and for good measure, I opened a brand new terminal session with no IDF paths and re-exported and built again. same crash when I init wifi.

#

gonna re-boot for extra extra "sure no IDF screwup".

viscid pine