#circuitpython-dev

1 messages · Page 410 of 1

onyx hinge
#

jepler@rat:~$ curl --http1.1 -v -H "Accept-Encoding: identity" https://analytics.usa.gov/data/live/top-traffic-sources-30-days.json -> prints (among other things < Content-Encoding: gzip

solar whale
#

probably should have just said .gov

idle owl
#

You have to enable them per board.

lone axle
idle owl
#

@gilded cradle Yeah, basically, check out CPX, and mimic the mpconfigboard.mk file.

idle owl
# gilded cradle Ok, thanks

I think you might have to add the submodule to CircuitPython though. It's been a while since a froze in a new library.

lone axle
#

For ones that aren't already in the frozen dir inside the core I think you may have to add them as new submodules to the core repo as well.

idle owl
#

Otherwise, it doesn't know what it's looking for.

gilded cradle
idle owl
gilded cradle
#

I think that'll be really helpful for folks

mental nexus
#

Thanks all!👋

idle owl
# gilded cradle I think that'll be really helpful for folks

Yeah boards that require bonkers levels of libraries to do their basic function (or are small) and you are super tight on blowing out the memory, frozen libs are really helpful. Be aware, CircuitPython looks for libraries in root (CIRCUITPY/) first, then frozen libraries second, then the /lib folder third. And the thing about Project Bundles is that they're not smart enough to know where libraries are frozen in. The memory issues come from running the library code, not simply having it on the board. Verify how much better it works once they're frozen, but it's possible you'll end up having to tell folks to do some fiddly things with the project bundles. In theory, you shouldn't, and the Project Bundle will still work fine. CPX project bundles include the CircuitPlayground library, but it doesn't run the code from inside the lib folder, so there's not memory failures. Etc.

jaunty juniper
manic glacierBOT
#

This board is a c3, so it can't support tinyuf2 and with only 2MB of flash, it doesn't have space for ota partitions.

  • Add a new variable UF2_BOOTLOADER to the port makefile that is 1 when IDF_TARGET is esp32s2 or esp32s3
  • Use UF2_BOOTLOADER to select whether to use a new partition variant, partitions-xMB-no-uf2.csv. I only added 2MB so far
  • Use UF2_BOOTLOADER instead of filtering out esp32c3 to select the .uf2 target

I made these changes with support for future (or past)...

crimson ferry
slender iron
mental nexus
lone axle
#

@mental nexus if you get a moment I would be grateful if you can point me towards the capacitive overlay / display that you're using. Honestly I had never run across the FocalTouch library before, didn't even know we had support for capacitive screens. I would love to get one set up to tinker with as well.

onyx hinge
#

so yeah they do not plan to change/update this to work properly 😕

lone axle
#

Possibly a root cause inside the behavior of S3. I suppose that makes it somewhat likely there are other services out there that made a similar decision

#

I would not have guessed this site / data API was available that long ago tbh. Good on them for actually making the data available even if not in the most convenient of formats (and for doing their development in the open on github). It will make an interesting IoT data displaying project for us but I could also be it being very valuable to web designers trying to figure out how to allocate their resources across so many client OS/browser/display sizes.

mental nexus
# lone axle <@!366059101203202052> if you get a moment I would be grateful if you can point ...

The Adafruit capacitive touch displays will provide single-touch capability. I've used the 2.8" version https://www.adafruit.com/product/2090. For the multi-touch capability, I found a conference-room schedule display (Crestron TSW-732) and pulled it apart and was able to decode the touch display pinouts. https://hackaday.io/project/183895-crestron-tsw-732-teardown. It has a multi-touch display using the FT5406 chipset.

lone axle
#

Neat! I may have access to some old Android tablets I should open one of those up, I would guess it has a similar driver inside of it.

mental nexus
#

I'm interested whether I can also reuse the display, but only if I use a chip with RGB and dot-clock driving capability. Perhaps the ESP-32 S3 can do that, but will need some coding.

#

I've been perusing the bewildering array of displays with touchscreens and have been a bit overwhelmed by the wide array of display controllers and touch controllers. I'm looking to see what chips are most common, but I think there are two or three of each that are in most common use. I'm especially looking for a 7" screen since a larger screen will be more usable for multitouch sensing.

#

This week I'll plan to finally dive in and order a couple of displays and start seeing what it will take to make them work in CircuitPython (maybe a new display driver library is required).

#

First look at polling the touchscreen in CircuitPython I can get responses every 7 ms. But let's see how that changes when display updates are going on too.

slender iron
#

Here is the notes document for Tuesday's CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord but 24 hours later. 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/18qlzNr5o2KUEwxZWGmxTlj0CBFyns3sBlGcCfc1j1D0/edit?usp=sharing

mental nexus
jaunty juniper
#

anyone knows if the ESP32-S3 has more USB endpoints that the S2 ? (where you basically can't enable CDC2 without disabling Mass Storage)

viscid pine
proven garnet
#

Catching up on the meeting, thanks again to everyone for being so welcoming! I forgot a hug report for @lone axle for helping me do my first reviews and become more comfortable with that process.

jaunty juniper
tulip sleet
#

Both the S2 and S3 datasheets say

Device Mode Features
• Endpoint number 0 always present (bi-directional, consisting of EP0 IN and EP0 OUT)
• Six additional endpoints (endpoint numbers 1 to 6), configurable as IN or OUT
• Maximum of five IN endpoints concurrently active at any time (including EP0 IN)
• All OUT endpoints share a single RX FIFO
• Each IN endpoint has a dedicated TX FIFO

jaunty juniper
#

oh well

tulip sleet
#

do you want midi too?

jaunty juniper
#

thanks for the clarification

manic glacierBOT
#

@dhalbert Installed 7.2.0-alpha.1-366-g528c2a322 on both M4 Feathers Thursday afternoon (evening?), and got the error on both boards Sunday night (EST).

Unit 1

pi@serialpi:~ $ cat /media/CIRCUITPY/boot_out.txt 
Adafruit CircuitPython 7.2.0-alpha.1-366-g528c2a322 on 2022-02-09; Adafruit Feather M4 Express with samd51j19
Board ID:feather_m4_express
pi@serialpi:~ $ grep monotonic_ns screenlog.0
monotonic_ns JUMPED MORE THAN A DAY! 262143997924816 524287999877941 : 34111132 loo...
jaunty juniper
#

I was just wondering if there was more wiggle room on the S3 in general

proven garnet
#

@danh, does the new typing module mean we'll unify types between Blinka and MCs? I don't think Blinka can support ulab.numpy.ndarry so curious what the solution should be for that and maybe other discrepancies

manic glacierBOT
tulip sleet
slender iron
#

@tulip sleet @onyx hinge want to chat now or pick a time tomorrow?

tulip sleet
#

now is fine for me

slender iron
#

I'm in the marie curie voice room

proven garnet
#

Not sure about the other typings or where they'll get used though

#

Ohhhhh I think I see, this is really still only the implementation for Blinka, just not in the Blinka repo

onyx hinge
#

@slender iron I've been chatting with kattni, sorry. I think we'll be done soon, so I'll join if you're still talking

onyx hinge
#

e1b4e9b7c7cdd7a022a5ab113b68c8fa6be2c74d is the ref where I changed uart

manic glacierBOT
warm stump
#

2 questions that came up from the Weekly Meeting stream:
1) What happens if you run CircuitPython on a new board with a Multiple Architecture chip? (e.g. 4x Cortex-M0 + 4x Cortex-A53 + V3D + etc...)
2) How would you go about adding and removing Secondary Memory to a CircuitPython System? (memoryio &&|| ramio and which protocols physically connect it)

idle owl
#

brb.

#

@onyx hinge Foamyguy is up for the Blit issue. I assigned him to it.

slender iron
#

@warm stump 1. we don't have any multiarch chips and don't do multicore anyway. 2. we can't support that now. is there anywhere it actually happens?

onyx hinge
#

Nice thanks!

warm stump
slender iron
#

@warm stump I think you are getting ahead of the game

warm stump
manic glacierBOT
slender iron
#

gotta get the broadcom port stable before worrying about the possible future

manic glacierBOT
onyx hinge
#
            if retry_count > 0:
                if any(self._socket_free.items()):
                    self._free_sockets()
                else:
                    raise RuntimeError("Sending request failed")
            retry_count += 1
main furnace
#

What about using a proxy server to uncompress gzip streams?

manic glacierBOT
onyx hinge
#

an adafruit io feature to act as a proxy for "challenging" servers could be cool. or maybe you could make your own out of a serverless platform.

thorny jay
#

Let's call that ReverseProxyIO?

blissful pollen
#

A rare time I miss the end of a meeting and a bunch of in the weeds I am interested in (of course)

  • For the gzip item I am still planning to look at it more this week, but if anyone else does as well no worries. Seems straigh-forward though.

  • For the native mod hope I didn't open up too much of a can of worms. I agree with basically all the points brought up. Willing to have a longer discussion about it if ever needed as well. I saw a lot of the points discussed on reasons why it has some potential use today but could cause issues too.

fiery fossil
#

I think I'm seeing an issue with adafruit_bus_device with SPIDevice set up for polarity=1. The SCK should be idle high before chip select goes low. Right? SCK does idle high in between the 2 clock pulses. But because it's not idle high before chip select is low, technically there are 9 rising clk edges in that first set of clk toggles.

#

Zoomed in sck

onyx hinge
#

@fiery fossil it's not unlikely that there's a bug, for the less common phase & polarity settings. It's also curious that in your trace SCK is slowly decaying at the end of the SPI transaction. I would have expected it to be acting as a push-pull output and remain high.

#

what circuitpython board?

fiery fossil
#

Custom board

#

STM32F412CG too, so custom custom

onyx hinge
#

OK, I'd try to figure out why SCK is slowly falling when the transaction finishes -- like, is the pin mode just incorrect somehow?

fiery fossil
#

Yeah, i'm guessing it's deactivating the SPI again before setting chip select high again

onyx hinge
#

you'll need to make the busio.SPI get the boardmicrocontroller in a state where it maintains the SCK pin's output value

fiery fossil
#

I am looking in common_hal_adafruit_bus_device_spidevice_enter in shared-module/adafruit_bus_device/spi_device/SPIDevice.c, thought that might be where it's setting chip select before grabbing the SPI

#

but it looks like it should be grabbing the SPI first...

onyx hinge
#

but it's just a convention that some users 'manage' the chip select pin using adafruit_bus_device. You could also manage CS manually in your own code if you wanted. busio.SPI must drive SCK into its idle state the whole time the device exists and is idle.

crimson ferry
#

@lone axle not sure if this tidbit has been surfaced yet, but I re-visited the jwst.nasa.gov URL on a DEBUG build and the errors that arise are:E (804107) esp-x509-crt-bundle: Failed to verify certificate E (804107) esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x3000 E (804107) esp-tls: Failed to open new connection

#

we have a facility in the CircuitPython API:py context = ssl.create_default_context() context.load_verify_locations('path/to/cabundle.pem')but I'm not sure if / how to get a pem file appropriate for that server to maybe override the default bundle, to test?

lone axle
#

Interesting! so it does seem likely that it's just the certificate being expired or otherwise non-working for some reason.

#

Thank you for trying that out!

crimson ferry
#

the certificate per se is probably fine, but something in the chain from our bundle seems off

lone axle
#

@prime flower I'm curious if you have any insight into SSL errors in CircuitPython. The initial discussion around this is in a thread here: https://discord.com/channels/327254708534116352/940343619217403984 if more background would be helpful, there was also some discussion in the weeds of today's (and a bit during last weeks) meeting.

Do you have any ideas about why we might be having the certificate fail to verify? or how we could go about getting a .pem file in order to try manually setting it to see if we can get the request to complete? Or really anything you can share about where the certificates that circuitpython uses come from. I'm willing to poke around a bit and try out some different things, but no idea where to go looking.

manic glacierBOT
fiery fossil
#

@onyx hinge It should at least be driving idle high while chip select is active low. outside of chip select active low, I don't think it should matter too much

#

I'm not understanding how adafruit_bus_device and busio interact, I'm missing something

onyx hinge
#

@fiery fossil I see what you are saying, and it could be true in some systems -- particularly those which use hardware management of chip selects -- but CP doesn't force any particular management of chip select. You might have a device without chip select (its /CS wired low on the PCB), and this behavior of letting the SCK output float when "not in use" would cause spurious clock edges as well. I still recommend changing the busio.SPI implementation until it drives SCK all the time, rather than letting it float.

fiery fossil
#

Agree, looking into it

crimson ferry
#

@lone axle Got it! The esp-idf example worked, so I just grabbed the cert from there and plugged it.

#

I'll post code in the old thread.

lone axle
crimson ferry
#

I suspect we just need an update to our bundle?

manic glacierBOT
#

resolves #5916 I confirmed the hard crash as described in the issue.

Tested on Feather TFT ESP32-S2 using this example code (mostly the same as posted in the issue):

import time
import displayio

print("waiting 8...7...6..5...4...3...2...1...")
time.sleep(8)

with open("/allblue.bmp", "rb") as bits:
    source = displayio.OnDiskBitmap(bits)
    dest = displayio.Bitmap(source.width, source.height, 64)
    dest.blit(0, 0, source)

output after this change:

cod...
manic glacierBOT
fiery fossil
#

and actually also resets the pin reset_pin_number(self->sck->pin->port,self->sck->pin->number);

#

yeah, that seems plausible...

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.2.0-alpha.1-344-ga8d865187-dirty

Custom Board with STM32F412CG

Code/REPL

import time
import board
import digitalio
import busio
from adafruit_bus_device.spi_device import SPIDevice

spi_sns_mag_cs = digitalio.DigitalInOut(board.SPI_SNS_MAG_CS)
spi_sns_mag_cs.direction = digitalio.Direction.OUTPUT
spi_sns_mag_cs.value = True

spi_sns = busio.SPI(board.SPI_SNS_SCK, MOSI=board.SPI_SNS_BIDI, MISO=None,...
manic glacierBOT
mild widget
#

Hi

manic glacierBOT
#

Adafruit CircuitPython 7.2.0-alpha.2-23-gd4c2ffea2-dirty on 2022-02-14; ESP32-S2-DevKitC-1-N4R2 with ESP32S2 (should be equivalent to https://adafruit-circuit-python.s3.amazonaws.com/bin/espressif_esp32s2_devkitc_1_n4r2/en_US/adafruit-circuitpython-espressif_esp32s2_devkitc_1_n4r2-en_US-20220214-d4c2ffe.bin)

W (9514) wifi: got ip
E (11164) ping_sock: esp_ping_new_session(270): create socket failed: -1
Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandle...
#

Possibly resetting the SPI on the STM on entering adafruit_bus_device.SPIDevice here by calling common_hal_busio_spi_configure:
https://github.com/adafruit/circuitpython/blob/main/shared-module/adafruit_bus_device/spi_device/SPIDevice.c#L57
And then not waiting for configuration to complete and setting chip select low.

common_hal_busio_spi_configure does reset the SPI as shown here:
https://github.com/adafruit/circuitpython/blob/main/ports/stm/common-hal/busio/SPI.c#L281-L290

#

@jepler same result without adafruit_bus_device. The 16 clocks on the read is a bug in ST's drivers that I know about, has to do with their half-duplex support.

import time
import board
import digitalio
import busio
from adafruit_bus_device.spi_device import SPIDevice

spi_sns_mag_cs = digitalio.DigitalInOut(board.SPI_SNS_MAG_CS)
spi_sns_mag_cs.direction = digitalio.Direction.OUTPUT
spi_sns_mag_cs.value = True

spi_sns = busio.SPI(board.SPI_SNS_SCK, MOSI=board.SPI_SNS_BIDI, M...
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

On page 821 of RM0402 STM32F412 reference manual there is this little note:
The idle state of SCK must correspond to the polarity selected in the SPIx_CR1 register (by pulling up SCK if CPOL=1 or pulling down SCK if CPOL=0).
Sounds like I need to add a pull up resistor to my SCK. Which I guess would make sense to tri-state the clock when not in use if you had a multi-master setup... Surprised that isn't better documented.

manic glacierBOT
manic glacierBOT
manic glacierBOT
onyx hinge
#

hmmm does 1.18 remove support for deprecated FROZEN_MODULES? This will be a bit of work, if so.

manic glacierBOT
orchid basinBOT
orchid basinBOT
manic glacierBOT
tulip sleet
#

@minor plume @lone axle @proven garnet @idle owl I am thinking about the outbreak of problems when a library is updated with type annotations but adafruit-blinka is not updated. The problem is that we didn't specify the blinka version. I think we should add a minimum version adafruit-blinka>=6.20.4 in setup.py install_requires and in requirements.txt for type-annotated libraries that depend on circuitpython-typing types. That would force the latest adafruit-blinka to be downloaded, and also complain on systems where python is too old (e.g v3.6) to handle that blinka.

Does this make sense to you?

But I would also like to get circuitpython-typing into the mix in the future. We can make blinka depend on circuitpython-typing later.

#

we might consider bumping blinka a major or minor version after the circuitpython-typing change to make this easier to remember (e.g 7.0.0 instead of 6.20.4)

#

@gilded cradle also of interest to you ^^

gilded cradle
#

Sounds good to me

tulip sleet
#

I think it would not be all type-annotated libraries because many don't depend on the circuitpython-typing types -- they just depend on regular from typing types

#

so it doesn't have to be a huge sweep

gilded cradle
#

👍

lone axle
#

Yep makes sense to me as well.

minor plume
#

That makes sense to me. I guess I should look at the circuitpython-typing module at some point soon.

tulip sleet
#

I need to release it. It is in a repo but I didn't release it yet.

#

it will not be in the bundle

lone axle
tulip sleet
#

or, more accurately, it doesn't need to be in the bundle.

minor plume
#

@tulip sleet So I’ll change requirements.txt and setup.py in my pull request, and the collective we can deal with the larger stuff separately.

gilded cradle
tulip sleet
idle owl
tulip sleet
#

I don't think it is that many, because it's mainly libraries that have ReadableBuffer, etc. annotations

#

is that right, the issues have been with libraries that have such from circuitpython_typing annotations?

proven garnet
#

If it was required for Bus Device does that mean the other libraries that depend on it would get the same error?

proven garnet
tulip sleet
#

yes, the transitive bus device dependency is the issue. So let's fix bus device first

proven garnet
#

So could we put it there and all the others we get made? Like just requiring it for Bus Device would trickle that requirement to anything that uses it right?

#

My python packaging knowledge is limited, but you could trigger the Blinka and Bus Device update when wanting a new version of a library using it, right?

#

As opposed to having to also put that requirement in every library that uses it directly

tulip sleet
#

if you install library A, and it depends on busdevice, but not a specific version, then busdevice will not get updated, and blinka won't either, and then you might get a failure. So it needs to propagate to the other libraries that need updated blinka and busdevice

#

but many libraries don't need updated busdevice and blinka

#

the mistake was that we started adding type annotations to libraries without updating their busdevice or blinka required version

idle owl
#

My only concern is inconsistent infrastructure files.

#

Wait, no, those are inconsistent anyway.

#

Nevermind.

proven garnet
#

Making sure I understand: basically anything that uses Bus Device should get minimum Blinka requirement so it doesn't freak out, is that right?

#

I guess there's no harm in using an older bus device though regardless of Blinka version, the old one works fine still if someone has it.

tulip sleet
#

right, the issue is that the addition of from circuitpython_typing import ReadableBuffer, WriteableBuffer into busdevice did not also force the requirement of a version of adafruit-blinka that supports that

onyx hinge
#

@tulip sleet this is puzzling me with the micropython merge, maybe it rings a bell immediately for you. all or almost all asyncio tests fail in the unix port ```Traceback (most recent call last):
File "extmod/uasyncio_basic.py", line 51, in <module>
File "/home/jepler/src/circuitpython/extmod/uasyncio/core.py", line 222, in run
File "/home/jepler/src/circuitpython/extmod/uasyncio/core.py", line 191, in run_until_complete
File "/home/jepler/src/circuitpython/extmod/uasyncio/core.py", line 176, in run_until_complete
File "extmod/uasyncio_basic.py", line 31, in main
AttributeError: 'SingletonGenerator' object has no attribute 'await'

#

SingletonGenerator has a __next__ but no __await__; is this related to how micropython sort of conflates the two?

tulip sleet
#

I have not yet figured out how to add __await__() to _uasyncio. I tried it but it didn't work.

#

so we are not using _uasyncio in our version of asyncio

onyx hinge
#

Thanks, that helps! I think I fixed my tests.

#

by changing __iter__ to __await__ in extmod/uasyncio for the sake of the tests

idle owl
#

Who's around who understands the type hint stuff we've been doing? I added two things to a library that's already hinted, and I don't want to leave them undone since they'll get missed.

blissful pollen
#

@onyx hinge Quick question in regards to the natmod stuff, I noticed you were building x86 tests. To do so locally so I just go to the unix port and run make from there? Haven't came across it before

idle owl
#

Basically, can someone typehint this property and setter for me 😄

slender iron
idle owl
#

I think the setter is -> None

onyx hinge
#

@slender iron I'll look into it. This? ../../supervisor/shared/translate.c:91:38: error: right shift count is negative [-Werror=shift-count-negative] 91 | return 1 + (compressed->data >> (8 - compress_max_length_bits)); | ^~

idle owl
#

except it's a tuple, not an int, so the other setter I was going to model after is not appropriate I think.

proven garnet
idle owl
proven garnet
#

Is the library on GH?

idle owl
#

This update isn't. I'll start a thread with the code.

proven garnet
#

Sweeeet

onyx hinge
#

@blissful pollen I think you need to make -C ports/unix VARIANT=coverage -j2 then run the steps you can see under "Build native modules" and "Test native modules" in .github/workflows/build.yml in my PR

#

you can change -j2 according to the number of CPUs / cores in your computer

#

quick update on the merge of 1.18: unix port builds & passes make VARIANT=coverage test. Haven't tested anything else. Will go look at this message compression thingy first.

blissful pollen
#

Thanks I'll take a look into it! Just needed that starting place

manic glacierBOT
manic glacierBOT
onyx hinge
# slender iron yup

so it looks like I assumed a translated string would always be <256 bytes in the utf-8 encoding, but the russian translation has this which comes in at 262 bytes in the utf-8 encoding: Pinout использует %d байт на элемент, что потребляет больше, чем идеальные %d байт. Если этого нельзя избежать, передайте allow_inefficient=True в конструктор

gilded cradle
#

@slender iron @tulip sleet quick question. I'm trying to add boards to circuitpython.org and a couple of boards (espressif_esp32s3_devkitc_1 and espressif_esp32s3_devkitc_1_nopsram) are on the site, but don't seem to be in circuitpython. Were they renamed or removed?

onyx hinge
#

@gilded cradle they were renamed, I think

#
espressif_esp32s2_devkitc_1_n4r2
espressif_esp32s3_devkitc_1_n8
espressif_esp32s3_devkitc_1_n8r2
espressif_esp32s3_devkitc_1_n8r8
gilded cradle
#

Ok cool. I'll just remove those from the data file because the other ones are accounted for

tulip sleet
onyx hinge
#

it turned out there were more variations (2 levels of flash, 2 levels of RAM), so we renamed them.

tulip sleet
#

or do it ourselves for now with Google translate

gilded cradle
#

Thanks, I was a bit stuck on that.

onyx hinge
#
    if (compress_max_length_bits <= 8) {
        return 1 + (compressed->data >> (8 - compress_max_length_bits));
    } else {
        return 1 + ((compressed->data * 256 + compressed->tail[0]) >> (16 - compress_max_length_bits));
    } 
}
``` It's supposed to be handled, but gcc throws up an error in the unreachable arm of the if-statement..
tulip sleet
#

The translations in Russian are less telegraphic than they are in other languages.

onyx hinge
#

so I also have a pretty simple fix, I think.. turn it into a #if / #else / #endif instead

manic glacierBOT
tulip sleet
#

If the Russian is in UTF-8, are most characters one byte or two? I was just wondering whether these non-Latin character sets cause double-length strings in general

onyx hinge
#

Most characters will be 2 bytes in the UTF-8 representation.

tulip sleet
#

I wonder if for these languages some other encoding would be better, though I'm not sure what

#

better -> "shorter"

onyx hinge
#

when it comes to the huffman code table and the "words" table we write them out as a 1-byte or 2-byte encoding, depending whether there are any code points >255 (so only code points <65536 can be used). so everything except american & western european ends up using 2 bytes

tulip sleet
#

i should look at some Russian websites and see what they serve up

onyx hinge
#

const mchar_t values[] = { 32, 97, 105, 115, 116, 99, 100, 101, 128, 109, 110, 111, 112, 114, 117, 1072, 1074, 1077, 1080, 1086, 39, 46, 131, 138, 98, 147, 144, 102, 103, 108, 136, 132, 141, 133, 146, 140, 120, 1076, 1083, 1084, 1085, 1089, 1090, 1091, 245, 217, 193, 216, 130, 129, 149, 45, 48, 95, 155, 169, 158, 177, 148, 104, 156, 139, 118, 119, 121, 1073, 150, 163, 1079, 1081, 1082, 157, 142, 137, 154, 1087, 151, 135, 1095, 1099, 1103, 134, 191, 207, 200, 223, 199, 194, 40, 41, 49, 50, 67, 68, 73, 79, 80, 82, 83, 84, 85, 176, 238, 218, 159, 171, 107, 167, 224, 165, 205, 170, 246, 192, 195, 172, 1053, 1055, 1075, 175, 181, 1078, 166, 164, 152, 143, 153, 160, 1088, 145, 162, 161, 173, 174, 1092, 1096, 1100, 219, 247, 37, 186, 47, 168, 51, 52, 53, 54, 56, 58, 61, 65, 66, 69, 76, 77, 78, 87, 225, 198, 187, 179, 201, 184, 178, 226, 180, 204, 206, 208, 122, 1041, 1042, 1044, 252, 1054, 239, 182, 183, 196, 1093, 1094, 1102, 242, 243, 210, 34, 42, 60, 189, 71, 72, 213, 188, 185, 86, 228, 215, 227, 214, 229, 231, 106, 234, 230, 113, 236, 235, 197, 1047, 1048, 253, 1050, 1052, 248, 251, 241, 1057, 1060, 220, 212, 190, 244, 209, 202, 254, 221, 203, 1097, 1098, 1101, 222, 33, 44, 211, 57, 59, 62, 250, 70, 237, 88, 96, 232, 1040, 1056, 1058, 1064, 1069, 1071, 233, 35, 43, 89, 91, 93, 126, 1045, 1059, 1063, 240, 55, 74, 123, 125, 1043, 1062, 249, 1105 };

tulip sleet
#

Korean is not currently turned on, are you saying if there is a single two-byte character, they are all 2 byte?

#

russian is the new largest language

#

and the translation is not close to done

onyx hinge
#

What choices besides storing UTF-8 or UTF-16 seem feasible to you?

tulip sleet
#

that's the thing, I don't know of any

onyx hinge
#
"Pinout uses %d bytes per element, which consumes more than the ideal %d "
"bytes.  If this cannot be avoided, pass allow_inefficient=True to the "
"constructor"
msgstr ""
"Pinout использует %d байт на элемент, что потребляет больше, чем идеальные "
"%d байт.   Если этого нельзя избежать, передайте allow_inefficient=True в "
"конструктор"
```to be fair, this is not much larger than the English
#

.. in code points

#

153 -> 160. it's in utf-8 bytes, which because of reasons led to a more efficient implementation of "know when decoding a string is complete", it's over 255.

tulip sleet
onyx hinge
#
``` If you had an efficient way to use 12-bit values instead of 16-bit values you'd get some savings, since the highest unicode code point is <2048. but that doesn't help with all languages, CJK languages have lots of higher numbered code points
tulip sleet
#

yes, CJK is going to be big. But since a code point can be a whole word, it might be a bit of a wash.

onyx hinge
#

making the entries in values[] and words[] variable length like utf-8 hurts in cases like CJK (because some things are 3 bytes) but also it creates a problem for efficiency, you can't just index you have to count by code points

tulip sleet
#
albert@tuna:~$ cat >foo.txt
использует
halbert@tuna:~$ more foo.txt
использует
halbert@tuna:~$ od -c foo.txt
0000000 320 270 321 201 320 277 320 276 320 273 321 214 320 267 321 203
0000020 320 265 321 202  \n
0000025
#

in the UTF-8 of the Russian above, the first byte of the pair is always 320 or 321 (octal!)

#

since it's a small-alphabet language. I am not pushing for a solution here, I am just wondering how to store such UTF-8 strings more efficiently in general.

#

that is, it's a small number of codepoints, but not in the zero block

onyx hinge
#

there are some other 'compression' schemes for unicode separate from huffman & dictionary style compression. They tend to be optimized for certain scripts. Often they have a code saying 'all the next values will be from some other 'page' of unicode, but they're all 1 byte' and have control characters to switch among some common or recently used pages

#

I forget what these algorithms are named

#

it's also worth noting that for our "dictionary" encoding we take advantage of the fact that character values 128..160 (?) are always unused, and for non-western-european, 128..255 are unused. those are the values[] entries that stand for whole sequences of code points.

#

switching to utf-8, or something else that would use more 'single byte values' would take away from that space of numbers we can use to represent repeated character sequences (that we call 'words' sometimes, even if it's a bit erroneous as they're unrelated to whitespace breaks)

#

It's almost certain that there's a better way than I have thought of, but there's a whole series of trade offs and layers that have been piled here and you may have to pick more than one thing apart in order to do better..

tulip sleet
#

thanks for the background on this, I ddin't know we used the upper byte values for word entries

onyx hinge
#

@tulip sleet SCSU and BOCU

https://www.unicode.org/notes/tn6/
The byte/code point ratio is 1 for runs of code points from the same block of 0x80 code points (and for Hiragana), and 2 for runs of CJK Unihan code points, as with [SCSU]. The startup overhead is very low (similar to [SCSU]), which makes it useful for very short strings like individual names. The maximum number of bytes per code point is four.

With BOCU-1, texts in languages with Latin-based scripts take about the same amount of space as with UTF-8, while texts in all other languages take about 25%-60% less space. Compared to UTF-16, texts in all languages with small character repertoires take approximately half as much space in BOCU-1. For large character sets, i.e., Chinese/Japanese/Korean, texts are about the same size for UTF-16 and BOCU-1.

fierce dust
#

Got the following error when build for raspberry pico on master branch.

#

make BOARD=raspberry_pi_pico -j 2
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
mkdir -p build-raspberry_pi_pico/genhdr
text data bss dec hex filename
250 0 0 250 fa build-raspberry_pi_pico/boot2.elf
GEN build-raspberry_pi_pico/genhdr/moduledefs.h
QSTR updated
../../extmod/ulab/code/numpy/transform.c: In function 'transform_compress':
../../extmod/ulab/code/numpy/transform.c:85:15: error: 'shift_ax' may be used uninitialized in this function [-Werror=maybe-uninitialized]
rshape[shift_ax] = true_count;
^
cc1: all warnings being treated as errors
make: *** [../../py/mkrules.mk:74: build-raspberry_pi_pico/extmod/ulab/code/numpy/transform.o] Error 1
make: *** Waiting for unfinished jobs....

idle owl
#

@tulip sleet There are a few things hardcoded into the Adabot library checks for ignoring - if you're not going to put Typing in the bundle, it may be courteous to also add it to the hardcoded ignore list. I'm verifying the other things Adabot checks for right now on this repo so it's not an issue that it'll ignore all library infrastructure checks.

#

Should CircuitPythonLibrarians have access to the Typing repo? @tulip sleet

fierce dust
#

The same build seems to work just fine with 7.1.1 tag

idle owl
#

I can add if so, but wanted to verify first.

tulip sleet
idle owl
tulip sleet
#

it's not bad to be in the bundle, it's just not necessary

onyx hinge
#

@fierce dust when you check out a different branch or tag, make sure your submodules are up to date. I am not entirely confident of the commands, I know what I run but I think it's different than what is suggested for the community. make fetch-submodules; git submodule update may be it, @tulip sleet do you want to say what's actually right?

idle owl
#

I fixed the other settings on that repo too. So it should be good to go.

onyx hinge
#

If it's actually in the bundle then won't circup actually install it? do not want.

tulip sleet
#

it got uploaded to pypi as adafruit-circuitpython-typing; does that or just circuitpython-typing make more sense to you? The actual repo is Adafruit_CircuitPython_Typing, but the import as you know is import circuitpython_typing

fierce dust
#

This is exactly what I did with fresh cloned master branch. make fetch-submodules the make BOARD=raspberry_pi_pico -j 2

tulip sleet
#

i was also thinking it might get included in Learn Guide project bundles

onyx hinge
#

@fierce dust otherwise, make sure you're using the specific arm toolchain that we are using during CI, because sometimes different compilers give different diagnostics.

idle owl
onyx hinge
#

(gcc-arm-none-eabi-10-2020-q4-major)

idle owl
#

Sounds like maybe it doesn't belong in the bundle then with all of those concerns.

fierce dust
#

@onyx hinge Ok, will give it a go. Thanks.

tulip sleet
#

make fetch-submodules at the top level is the "best" way, but is slower than git submodule update. Do make fetch-submodules the first time or else it will fetch 10GB of RPi broadcom firmware

#

ok, let's put it on the omit list. I can do that if you tell me where, or you can do it

onyx hinge
#

speaking of submodules, something in ports/stm seems to be making things very grumpy. Switching branches is telling me things like ```warning: unable to rmdir 'ports/stm/st_driver/stm32f0xx_hal_driver': Directory not empty

tulip sleet
idle owl
#

I prefer consistency in naming in general.

tulip sleet
onyx hinge
#

@tulip sleet that's frustrating, OK

tulip sleet
#

i tried a bunch of ways to fix it, but did not succeed

onyx hinge
#

every once in awhile something really seems to leave git confused

tulip sleet
idle owl
#

Nah because most imports aren't the full name.

tulip sleet
#

thanks for another brain on this

fierce dust
#

@onyx hinge Change arm tool change to the correct version solves the problem. Thanks.

idle owl
#

I thought Black ran on the entire library repo. I ran pre-commit manually and it ignored some obvious issues, so did Pylint. I'm a little confused.

#

@lone axle Are you around for a type hint question?

#

Nevermind! Got it sorted with Tekktrik.

manic glacierBOT
#

That's a cool tool. Seems to be a problem with an error return from the lwip component's ping. Why is there no common-hal; line in the trace?

espressif/build-espressif_esp32s2_devkitc_1_n4r2/esp-idf/../../esp-idf/components/lwip/apps/ping/ping_sock.c:347 (discriminator 5)
espressif/../../shared-bindings/wifi/Radio.c:536
espressif/../../py/objfun.c:136
espressif/../../py/runtime.c:656
espressif/../../py/runtime.c:671
espressif/../../py/vm.c:1102
espressif/../../py/objfun.c:297 ...
manic glacierBOT
idle owl
#

Oof, Learn in the editor is loading images like it's the 90s. It's not stopping me from doing what I need to, but it's combination annoying and hilarious.

stuck elbow
#

they don't make them like they used to anymore

idle owl
#

Not even close.

stuck elbow
#

even nostalgia is not the same anymore

idle owl
#

Hah, truth.

manic glacierBOT
tulip sleet
#

@idle owl cookiecutter, etc. are still using black 20.8b1. Circuitpython, when it does black uses the latest (it doesn't specify the version in the pre-commit yaml file).

Are we planning to move to black 22.1.0? The main difference I see is that it is now putting spaces around the ** operator

idle owl
#

Does that work?

tulip sleet
#

sure, I am just asking because I accidentally ran the 22.1.0 black over adafruit-blinka, and it made one change with **, which then the test job complained about. blinka doesn't use pre-commit (I opened an issue about that), so I could just change the version blinka uses now.

#

or I could undo the change

idle owl
#

Nah, update it.

#

We'll do the rest later this month.

tulip sleet
#

tnx fer guidance!

idle owl
#

You're welcome!

jaunty juniper
#

hey, so, I've had a Hiibot IOTS2 for a few months (well a year), and it shipped with tinyuf2 and CP6 on it. I'm not sure I identified who makes them outside of the github user (BradChan) associated with the tindie page, who tried and failed to PR it to Circuitpython repeatedly (due to not having a PID and not responding when asked about it).
I have a PR ready, should I just get a pid from Espressif myself ?

proven garnet
#

@idle owl no worries to do now, but just wanted to clarify what route you were picking for the getter method: do you want it to throw an error or return None?

#

It sounded like returning None was the move but just wanted to clarify.

manic glacierBOT
manic glacierBOT
#

Native modules are a feature of MicroPython that allow for code compiled to native assembly to be loaded dynamically into MP. This can be really helpful for adding fast code without having to recompile the main runtime.

There are some things we need to handle before we can enable it:

  • [ ] Establish a file name suffix convention so it's clear what platforms a native file support.
  • [ ] Also include this info in the file itself and error if the suffix or internal metadata don't match.
    ...
fierce dust
#

Got a question on free memory on esp32s2 wroom based board. It has 320k sram onbaord. However under micropython it shown as have 140k+ mem free, but the same board on circuitpython only shown as 46k+ mem free. Was wondering what is the reason behind the discrepancy?

proven garnet
#

@tulip sleet the PR for bus device, should Blinka version be specified in requirements.txt?

#

Saw it and want to know the fix if I come across it during typing

tulip sleet
#

you're right, that should be done on both of those PR's! I'll fix

proven garnet
#

Is the goal to release those now and then finally do the Blinka one?

#

At least in terms of order of operations

tulip sleet
#

it turns out the circuitpython_typing/ directory in adafruit-circuitpython-typing overrides the circuitpython_typing.py file installed by adafruit-blinka, so you get the new circuitpython_typing if both are installed

slender iron
orchid basinBOT
manic glacierBOT
stuck elbow
manic glacierBOT
manic glacierBOT
#

The _uasyncio implementation of Task does not provide__await___(). Our internal implementation of async/await (done by @WarriorOfWire) requires that. Otherwise code is going to fail. I had to add __await__() in the Python version in a couple of places:
https://github.com/adafruit/Adafruit_CircuitPython_asyncio/blob/28ef812f14ef1fde1036eb83a4878bd14aa9a67d/asyncio/task.py#L152
https://github.com/adafruit/Adafruit_CircuitPython_asyncio/blob/28ef812f14ef1fde1036eb83a4878bd14aa9a67d/a...

#

_uasyncio is not used for asyncio, right now because the _uasyncio implementation of Task does not provide__await___(). Our internal implementation of async/await (done by @WarriorOfWire) requires that. Otherwise code is going to fail. I had to add __await__() in the Python version in a couple of places:
https://github.com/adafruit/Adafruit_CircuitPython_asyncio/blob/28ef812f14ef1fde1036eb83a4878bd14aa9a67d/asyncio/task.py#L152
https://github.com/adafruit/Adafruit_CircuitPython_...

manic glacierBOT
#

In #6038 I ended up with the following changes to fix extmod/uasyncio to work during the host-computer tests. I'm not sure if it's a relevant piece of the puzzle:

diff --cc extmod/uasyncio/core.py
index 12833cf0c,12833cf0c..c3ce3ccaf
--- a/extmod/uasyncio/core.py
+++ b/extmod/uasyncio/core.py
@@@ -36,7 -36,7 +36,7 @@@ class SingletonGenerator
          self.state = None
          self.exc = StopIteration()
  
--    def __iter__(self):
++    def __await__(self):
          ret...
lone axle
#

If any reviewers have a moment today. Would appreciate if anyone can take a look at: https://github.com/circuitpython/CircuitPython_Library_Screenshot_Maker/pull/11. This change is needed to make the project files screenshot for my PyPortal Winamp guide look correct. (There are some files meant for PC only that should be excluded from the CIRCUITPY drive screenshot). It's in CircuiptPython org so I can't tag librarians as a group, but happy to have anyone who can take a look.

tulip sleet
lone axle
#

Thank you!

orchid basinBOT
proven garnet
#

@tulip sleet I'll probably get started on writing the docstrings for asyncio. Is taking the existing documentation and porting it into the code as docstrings sufficient?

#

Well, I guess the existing documentation is for uasyncio right? I guess that's a starting point, but (correct me if I'm wrong) there are differences between that and asyncio.

#

Not sure how that will translate for docstrings though

tulip sleet
proven garnet
#

Okay, I think I saw the comment disabling pylint and black in at least one of the files, I'll be sure not to touch them

#

At this point, are type annotation for the library going to be more in the way than not? I was going to do them in a separate PR but if there's the want to keep it close to the MicroPython code, I could see the value of not doing it right now.

tulip sleet
#

yes, I'd say omit them for now

proven garnet
#

Sounds good!

jaunty juniper
#

note that type annotations are mostly relevant to code completion in IDEs in my opinion, and they already have that for asyncio

tulip sleet
#

@proven garnet I looked more closely, and they do use black on the files, but as black --fast --line-length=99

#

it was pylint that had many more complaints, now I remember

#

without the 99, it changes about 12 lines across three files

#

so don't do it for now, but it's less of a worry than I thought

proven garnet
#

Got it, thanks for the clarification!

manic glacierBOT
idle owl
#

@proven garnet I think I understand what I was missing with regards to your PR question. I wasn't considering that you can also "get" the range... so the NotImplementedError needs to be in both. It was initially, but I removed it from the property because it seemed redundant. But if you can also print(range) for example, it needs to raise the error in both. I'll update it and submit the fix.

#

@proven garnet So does that mean the @property should be -> None as well now?

proven garnet
#

I would say if you're adding NotImplementedError it's appropriate to use the "eventual" type because it's impossible to actually get anything at (for example, you don't even get None since it raises the exception). So keep it as int in that case!

idle owl
#

Ok thanks

proven garnet
idle owl
#

Thank you!

proven garnet
#

Looks like you could remove the pylint: disable for busio there too

idle owl
#

Oof. Good call.

#

Done and pushed.

proven garnet
#

Looks good to me!

idle owl
#

@proven garnet Has anyone gone over doing releases with you yet?

proven garnet
#

No, just approving and merging

idle owl
proven garnet
#

Sounds great to me!

idle owl
#

Perfect. Added to my calendar. Wait - 12p-1p ET is your lunch?

proven garnet
#

ET, yup!

idle owl
#

Ok great. It's in my calendar so I'm more likely to remember. 😄 @proven garnet Don't hesitate to ping me on Friday though if I end up missing it.

proven garnet
#

Will do, and same here 🙂

manic glacierBOT
proven garnet
#

@tulip sleet is this correct? I assume this is written this way intentionally for under the hood but Sphinx gives a SyntaxError for doing return True from an async function. Trying to see about how to get around that, but just making sure.

manic glacierBOT
#

Nope, it's this error actually:

Error: Build matrixportal_m4 for de_DE took 1.[11](https://github.com/adafruit/circuitpython/runs/5221196089?check_suite_focus=true#step:9:11)s and failed
make: Entering directory '/home/runner/work/circuitpython/circuitpython/ports/atmel-samd'
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
mkdir -p build-matrixportal_m4/genhdr
FREEZE ../../frozen/Adafruit_CircuitPython_PortalBase ../../frozen/Ad...
tulip sleet
manic glacierBOT
#

I must use an I2C device that wants a write that is not followed by a stop bit or a (immediate) read.

The underlying Wire library offers clients the ability to send or suppress the stop bit after a write on the I2C bus.

The CircuitPython busio library always sets this flag to True in busio,writeto, forcing a stop bit after a write (except when using write_then_read).

Please expose the underlying control of Stop Bit behavior by adding an optional (keyword?) parameter to busio.writet...

#

you can totally do that, just as two separate calls: one write then one read. if you write, by default it will add a stop. if you write-then-read it will not add a stop. we do this because linux kernel doesn't allow a write without a stop in a single call without a followup read. this way we can make sure drivers will work on linux as well as microcontrollers.

https://circuitpython.readthedocs.io/en/latest/shared-bindings/busio/

please try it :)

#

Thank you for the prompt response! Unfortunately, a write followed by a
read does not work in circuitpython. The write is terminated by a stop
bit, which causes the peripheral device to abandon the operation.
I need to write data from the controlling microprocessor (without a
following stop bit), wait for a signal from the peripheral device
indicating data is ready, then read from the peripheral device then send a
stop bit/condition (then release the bus lock).
I can do it in c++, but not i...

#

I did not, but I will.
The specification from the device manufacturer says I must wait until a
digital signal from the device indicates that the data is available before
reading. In my preliminary tests, there seemed to be a significant delay
between the completion of the write and the signal indicating "data ready"
to read. I expected that writeto_then_readfrom would attempt the read
before the data was ready, but I can try it to see if it works to ignore
the data-ready signal...
Thanks,
D...

#

The device is a lighting control system. If I had access to/control of the
peripheral device software, I might be able to change it to look more
conventional, but I do not.
The specification of the peripheral device says I must write, then wait for
a data ready signal before reading. I will try writeto_then_readfrom, but
I suspect it will attempt the read before the data is ready... It may be
inelegant, but I believe the peripheral device conforms to the I2C
specification, but I'm not an I...

#

The signal is coming from another pin.
I cannot send the datasheet as we are bound by an NDA from the vendor.
I will try writeto_then_readfrom. Perhaps the clock-stretching is enabled
and the digital IO pin for "data ready" is superfluous.

On Wed, Feb 16, 2022 at 3:01 PM Dan Halbert @.***>
wrote:

Please tell us the device so we can look at the datasheet. The usual way
of doing this is that the device does clock-stretching until it is ready.
Is the signal you are talking about a...

#

OK, thanks. I will definitely contact the vendor about this.
I have had great success accessing other I2C devices using CircuitPython,
but this one is killing me.

On Wed, Feb 16, 2022 at 3:09 PM ladyada @.***> wrote:

a data ready line in between write and read is really completely outside
the i2c spec, please contact the vendor cause they're doing something very
weird.


Reply to this email directly, view it on GitHub
<https://github.com/adafruit/circuitpython/issues/60...

idle owl
#

@tidal kiln For the TFT feather, the final pin name is TFT_I2C_POWER ?

#

I mean I can dig it up, and so on, but you were in there recently, so I figured ask.

idle owl
#

Ok

#

Thanks

tidal kiln
#

for arduino

idle owl
#

Oh hmm

#

I meant for PrettyPins

#

Let me check CP

#

I2C_TFT_POWER

#

Blergh.

#

That's why that's what it is on PP.

idle owl
#

Yah.

#

I will ask Limor which one she wants as canonical.

#

And submit a fix to the other I guess.

tidal kiln
#

MAKE_STUFF_GO is my submission 🙂

idle owl
#

Duly noted! 😄

tulip sleet
idle owl
#

Did a git pull and then git status on CircuitPython... what is all this? Untracked files: (use "git add <file>..." to include in what will be committed) ports/stm/st_driver/CMSIS/ ports/stm/st_driver/README.md ports/stm/st_driver/STM32F0xx_HAL_Driver/ ports/stm/st_driver/STM32F1xx_HAL_Driver/ ports/stm/st_driver/STM32F2xx_HAL_Driver/ ports/stm/st_driver/STM32F3xx_HAL_Driver/ ports/stm/st_driver/STM32F4xx_HAL_Driver/ ports/stm/st_driver/STM32F7xx_HAL_Driver/ ports/stm/st_driver/STM32G0xx_HAL_Driver/ ports/stm/st_driver/STM32G4xx_HAL_Driver/ ports/stm/st_driver/STM32H7xx_HAL_Driver/ ports/stm/st_driver/STM32L0xx_HAL_Driver/ ports/stm/st_driver/STM32L1xx_HAL_Driver/ ports/stm/st_driver/STM32L4xx_HAL_Driver/ ports/stm/st_driver/STM32L5xx_HAL_Driver/

tulip sleet
#

a bunch of submodules in STM were changed

idle owl
#

But if they're remote, why are they untracked locally?

#

Also the espressif/esp-idf is still showing "modified" after doing the submodule update thing. 😕

tulip sleet
#

you could do git clean -xxffdd ports/stm and that might help. got to the top directory and do make fetch-submodules again. But Jeff and I found that our clones were somewhat messed up

idle owl
#

Usually the submodule thing fixes modified files.

#

Oh hmm ok.

#

Should I simply reclone then?

tulip sleet
#

you can do git submodule init --update again too, and it should not pull the the whole broadcom repo

#

If you don't have a lot of ongoing work, that would be easieest

idle owl
#

I think I already blew away the only ongoing stuff I had. So no, there's nothing.

tulip sleet
#

you'll need to do make fetch-submodules which will take a while, and rebuild mpy-cross

#

I ended up doing that, and i pushed a bunch of in-process work, so it was worth ti

idle owl
#

Is my ESP build environment going to disappear too?

#

I mean whatever, I'm redoing it regardless. But want to know.

tulip sleet
#

yes, you'll have to do esp-idf/install.sh again

#

too

#

but that fetches stuff elsewhere, so it won't take as long

idle owl
#

Alright, setting up new one now.

#

@tulip sleet OK, so I did the fetch-submodules and rebuilt mpy-cross. I should be good to go?

tulip sleet
#

esp-idf/install.sh, but you don't have to do that now

idle owl
#

I'll do it now because I'll forget what's involved when I need it.

#

@tulip sleet Where do I run that from?

#

What directory

tulip sleet
#

cd ports/espressif

idle owl
#

ok

weary hill
#

@minor plume Hey, sorry I missed your PR, I have been slammed with work. I left a small comment, but besides the quote format looks good to me. I also have a change I haven't had a chance to merge I would love for you to take a look if you have time sometime. I'll probably push it up to github later this week, but it should allow you to install any version of a package like poetry/npm etc.

minor plume
weary hill
#

Thanks, enjoy your travels. I'll make a PR when I finish. I think in the long run it might be best to actually use Poetry Core to do dependency resolution, but its a but tricky right now for a number of reasons. I looked into using CircUp as well but even though there is a lot of overlap I think Poetry core really fits the paradigm best in the long run.

weary hill
#

For now I did the resolution myself using the bundle index. Also I looked into the Github api which I know Circup uses but they have an api limit of like 60 requests per hour for anonymous requests, which makes it hard to do complete resolution. Poetry uses Pypi when it can but because of gaps in the Python ecosystem also installs and resolves dependencies that way when necessary. Basically I'm saying, everything has a lot of workarounds because the Python community has only recently been addressing all this.

tulip sleet
#

we weren't using poetry, but someone else was

weary hill
#

@tulip sleet That's very good to know. I have had one question lingering perhaps you know the answer to. Are the bundles just auto-built when a package has a new release, or do they promise any sort of compatibility between the packages?

tulip sleet
#

a bundle is just a snapshot, produced when any library in the bundle has a new release

jaunty juniper
#

circup doesn't use the github API, it uses direct links

idle owl
#

@tulip sleet I ran pre-commit manually before doing the PR, and it altered the circuitpython.pot file. I git stash'd and git stash dropped to get rid of the changes, and uninstalled the pre-commit hooks. It passed remotely without issue. What's the deal there?

weary hill
#

Also poetry is suuper slow, but I think its because the pypi dependency support is still being improved.

tulip sleet
weary hill
#

@jaunty juniper Oh okay, good to know. So it downloads for dependency resolution?

idle owl
#

It was a fresh clone though.

#

I'll try to fix it once this PR is merged.

tulip sleet
#

before starting a PR branch, I always bring main up to date

proven garnet
# proven garnet <@!329766224093249548> is this correct? I assume this is written this way inten...

Okay so it's not Python version because it fails to build the docs even at Python 3.7... I also can't wrap the code in question with a try/except for SyntaxError as it still gets raised. I tracked down what is actually throwing the error in CPython because @tulip sleet is right in that it is valid syntax and I also confirmed that it is like he did. Here's what's throwing it but I'm C illiterate, so if anyone knows what this code is in CPython and why Sphinx autodoc would throw it when parsing an async function that returns a value, that might help

#

Ah, the line number would help wouldn't it...

manic glacierBOT
idle owl
idle owl
#

I forgot about my fork until after, and didn't want to get caught up in a rebase. The merge was clean, so I left it alone for now.

weary hill
#

@jaunty juniper Nevermind I just went through the code.

jaunty juniper
# weary hill <@!199811382793863168> Oh okay, good to know. So it downloads for dependency re...

the dependencies are in the bundle zip, and it uses the headers from https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/latest to extract the latest tag of the bundle:

server: GitHub.com
date: Wed, 16 Feb 2022 21:41:13 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Accept-Encoding, Accept, X-Requested-With
permissions-policy: interest-cohort=()
location: https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/tag/20220216
tulip sleet
#

what is the version of python you are using?

proven garnet
#

I can't build the docs locally for some reason so I'm having the CI do it. I've tried 3.10 and 3.7 and neither work

#

In my local repo

weary hill
manic glacierBOT
tulip sleet
proven garnet
tulip sleet
#

i'll try it

#

you're right, I typed the search string wrong

#

it thinks it's a generator

#

now I remember it's asyncio. I'll try building the docs

proven garnet
#

I can add it as a draft if that would help

jaunty juniper
tulip sleet
#

@proven garnet

albert@tuna:~/repos/Adafruit_CircuitPython_asyncio$ sphinx-build -E -W -b html docs _build/html
Running Sphinx v4.4.0
loading intersphinx inventory from https://docs.python.org/3/objects.inv...
loading intersphinx inventory from https://docs.circuitpython.org/en/latest/objects.inv...
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 3 source files that are out of date
updating environment: [new config] 3 added, 0 changed, 0 removed
reading sources... [100%] index                                                                                                     
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] index                                                                                                      
generating indices... genindex py-modindex done
writing additional pages... search done
copying static files... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded.

The HTML pages are in _build/html.
halbert@tuna:~/repos/Adafruit_CircuitPython_asyncio$ python --version
Python 3.9.10
#

building for me, hmm

weary hill
#

Yes. Okay. That's good to know. I have just started looking into all this, been very busy with work. I guess that makes using Poetry / PyPi more challenging.

#

Thanks for the info!

jaunty juniper
weary hill
#

I'll stick with using the bundle json indices for now.

tulip sleet
#

yes

#

double-checke

proven garnet
#

I think main is only building the __init__.py file so it doesn't hit the error

#

In my PR I expanded the files it would document, I'll draft and tag you on the PR

#

(Based the contents of api.rst)

weary hill
#

@jaunty juniper Okay that's what I have working currently (if I understand you correctly). I need to dig into CircUp more. Is there an index anywhere mapping version of a package to build, in the long run thats what would be most helpful for Piku.

tulip sleet
#

@proven garnet i believe you, i'm looking at whether we can change the code

gilded cradle
#

@onyx hinge or @tulip sleet regarding frozen libraries, would it make more sense to point to the library folder inside of frozen directories instead of the entire repo or does it sort that all out automatically?

weary hill
#

Currently basically I take the version, use poetry core and find a candidate package using the bundle package indices. Then use the bundle package index to resolved dependencies. But by allowing installation from different bundle builds and using those json files I havent figured out how I am going to resolved dependencies between bundle builds yet. I guess I just assume it will work.

#

I also haven't addressed some of the issues CircUp does like checking that the dependency is micro-controller only etc.

tulip sleet
gilded cradle
#

Ok, cool. Thanks.

tulip sleet
#

(I may be missing some context in this conversation)

ornate breach
#

I was looking in the issues for circuitpython related to i2c issues on the RP2040 but I can’t find any. I was wondering if anyone was having issues using i2c scan on the RP2040?

gilded cradle
#

MatrixPortal build was too big because I added a bunch of frozen libraries

#

I'm just trying to figure out what to shave off

ornate breach
#

Someone messaged my tindie shop saying they couldn’t run the i2c scan on an RP2040 board with circuitpython using a similar code as they used on CPX

tulip sleet
#

you have to remove an entire library

gilded cradle
#

Right, but I added 7 libraries.

#

It was about 35K too big or so

ornate breach
#

I’m waiting to get code and whatnot back from the person but I figured I’d ask here if any i2c scan issues have been seen

idle owl
tulip sleet
idle owl
#

Not necessarily with I2C scan, but no issues using I2C boards.

ornate breach
#

Yeah, I’ve not run into any issues myself but I’m hoping to figure out the details

tulip sleet
#

the scanning is done with a zero-length I2C write, which has to be done with bitbangio because the RP2040 hw I2C doesn't support zero-length writes. There is a 1-sec potential timeout on that (which is too long, it should be shorter). There are a few badly-behaved devices that don't like zero-length writes, but very few

#

@proven garnet change the yield in that function to await asyncio.sleep(0). I think that will fix the problem. We don't generally want to use bare yields like that. In this case it makes the compiler think it's a generator

proven garnet
#

Sounds good, I'll make that change! Thanks for that

manic glacierBOT
onyx hinge
#

I need to test the builds (and make sure I'm comparing apples to apples) but it looks like we get ~300 bytes of flash space back from the 1.18 upgrade. if accurate, not bad!

jaunty juniper
#

by the way, let me re-ask, I'm not sure what to do about the Hiibot IOTS2: I have a PR ready to add it, should I get a pid from Espressif ? The github user (BradChan) associated with the tindie page where the board is sold, tried and failed to PR it to Circuitpython repeatedly (due to not having a PID and not responding when asked about it). I'm not even sure of who Hiibot are or if the Bluefi and IOTS2 are actually affiliated with them...

proven garnet
#

@tulip sleet That worked but now getting the draft PR has a new error for using await outside of async function, different part though so progress!

idle owl
#

@tidal kiln You might have better wording for the warnings.

jaunty juniper
idle owl
#

@lone axle Do you have a TFT Feather ESP32-S2?

idle owl
tidal kiln
#

@idle owl STEMMA QT section still says auto for both

#

and pin names also

idle owl
#

@lone axle I need to put together a page in the guide on using the display. Wanted to start with a simple thing, and then I'm going to show a GitHub Stars thing that Limor already has code for. I think that simpletest will work.

idle owl
tidal kiln
#

have you tested the neopixel behavior in arduino? says that's auto also

idle owl
#

@tidal kiln Updated.

idle owl
#

And it should be changed?

tidal kiln
#

meh. can't remember. easier to just check again.

#

one sec

idle owl
#

Thank you

#

BBIAF, need to eat before meeting.

lone axle
idle owl
#

Good call.

idle owl
tidal kiln
#

@idle owl not automatic

tulip sleet
idle owl
tidal kiln
#
#include <Adafruit_NeoPixel.h>

Adafruit_NeoPixel strip(1, PIN_NEOPIXEL);

void setup() {
  pinMode(NEOPIXEL_POWER, OUTPUT);
  digitalWrite(NEOPIXEL_POWER, NEOPIXEL_POWER_ON);
  strip.begin();
  strip.fill(0xADAF00);
  strip.show();
}

void loop() {
}
idle owl
#

Text updated

tidal kiln
#

comment out the power stuff and no neopix

idle owl
#

Should I add an alert too?

#

Like on the others

tidal kiln
#

maybe....if it'll fit.

idle owl
#

Sure

tidal kiln
#

that's called out in the middle of a bullet list

#

so not sure where to place it?

idle owl
#

@tidal kiln After the section is fine.

#

For people not reading the text and only the alerts, it's close enough.

tidal kiln
#

yah...it's a neopixel section. ok. yah. that should work.

idle owl
#

Found a copypasta fail on my part and fixed that too.

tulip sleet
idle owl
#

@tidal kiln Thanks for proofing this for me.

idle owl
#

That example is far simpler though.

#

the other one includes shapes.

#

Which is also ok.

lone axle
#

Ah, the purple and green rectangles? I think that is the standard driver one.

idle owl
#

I'll have to redo them anyway for the pins.

#

Right. Yeah, I was thinking that one, but it occurs to me that I'm already doing a complicated example, so maybe the basic one is better for this

#

That one plus a Blinka bitmap example to start

#

Then the GitHub Stars viewer.

#

@lone axle Can you toss together a centered Blinka bitmap display example? Or to the left if it's easier, doesn't really matter, but centered might look nicer on that display. That or find one that already exists which I suppose is also likely...

slender iron
idle owl
#

ok BBIAB again, hopefully pizza is ready this time.

tidal kiln
#

@idle owl it looks like TFT_BACKLITE also has to be manually set HIGH in arduino

tulip sleet
#

@proven garnet still works with async def runner(...) so add the async there too

manic glacierBOT
manic glacierBOT
idle owl
#

So simple too!

#

Excellent. This is really helpful.

lone axle
#

Hooray! blinka

proven garnet
idle owl
#

@lone axle Oh, while you have it there, can you do a simple example that displays the battery data from the onboard sensor? That's the other one we thought folks wanted.

#

There's a spot for a BME280, but it's not populated yet.

#

But there's the battery monitor on there.

lone axle
#

Ooo nice, I didn't realize it had the battery monitor

idle owl
#

Yep!

lone axle
#

Yeah I can make that one as well in a moment.

idle owl
#

Thank you!

jaunty juniper
idle owl
#

It's obviously Arduino.

#

I'm not certain about what it looks like, I think I already blasted both of mine so I can't verify it is the product image.

jaunty juniper
#

ah, I meant that as a suggestion to put in the guide, and guides in general: people get the board, there's something displayed on it, they want to look at the code to see how it's done (obv. it's not originally in CP, but having CP code to do it sounds like a good place to start)

idle owl
#

Oh!

#

I do like the idea. I think it's not something Limor would necessarily want me to be putting time into, but if you're interested in doing it, I can think about where to put the examples in the guide. Would you be interested in doing a short writeup for it as well? Basically, if all the info is there for me, adding it to the guide is trivial. It's writing everything out that I would be told not to put time into.

#

I did it ages ago with the Circuit Playground Express for the same reason you're thinking of. I agree with the concept.

idle owl
#

FWIW, it's typically the product image when it's a display, so that's probably an accurate thing to mimic. But we also have been trying to post the source code as well, which might be easier than simply trying to do it based on a photo.

idle owl
lone axle
idle owl
tulip sleet
#

@jaunty juniper Re your wsgi server: I was primarily interested in serving up files (and large files, at that; the javascript for the game is quite large). I added the routing only because it was in the original code I adapted.

#

But having a WSGI server for wifi.radio would make a lot of sense

jaunty juniper
#

I basically just ported the code from ESP32SPI

#

a couple of people contributed fixes and a file serving demo

tulip sleet
#

i don't actually know very much about the general use of wsgi, and how one would use it to serve static files efficiently

#

we could put it in the community bundle, or possibly adopt it

#

is it non blocking in some way, or does it just return after each serve

jaunty juniper
#

it returns after each serve, polling in a loop for the next

#

or more accurately, you poll it in the main loop

devout jolt
#

whenever I see party parrot I always think of @candid sun now

tulip sleet
#

i didn't start with the old wsgi server because it wasn't a fileserver inherently

candid sun
devout jolt
#

(wrong chat window sorry)

tulip sleet
#

i was just trying to make the tiniest simple server in a hurry

jaunty juniper
#

unless it's better to start clean ? a webserver could be an application for wsgi, but are there file serving optimizations that would be missing ?

tulip sleet
#

the fileserver in your examples does read chunking, which is all I was doing, and the code does EAGAIN, which the original code I had didn't do... it's really pretty much the same. I was thinking how to add route parsing, but wsgi has that already

#

i was just websearching about using wsgi servers for serving up files

manic glacierBOT
#

On espressif, responding to Press any key to enter the REPL. Use CTRL-D to reload is delayed.

The cause is port_idle_until_interrupt not waking up on any keys pressed. On other ports, a usb interrupt will wake the loop up, but on espressif, this a FreeRTOS task that is awoken upon ctrl+c being received by tinyusb.

My workaround is a little hacky, but shouldn't cause any issues as far as I can tell.

manic glacierBOT
viscid pine
#

scott noticed it on his deep dive stream and i noticed it about a week ago

manic glacierBOT
crimson ferry
#

Would select be useful in coordination with asyncio? Or does async accomplish the same thing? µP has uselect. There's not really a peek or available in CPython sockets that I can see.

manic glacierBOT
wide mantle
#

Hello! I'm trying to build CP 7.1.1 and having a few issues. I followed the Adafruit article about it, and ran this on a fresh checkout after installing the required dependencies:

make fetch-submodules
git checkout 7.1.1          # this is commit ea3c70a95
make -C mpy-cross V=2

It starts to build mpy-cross, but soon fails trying to build ../py/objgenerator.c due to unused variables and -Werror being set:

../py/objgenerator.c:83:66: error: variable 'n_kwonly_args' set but not used [-Werror,-Wunused-but-set-variable]
    size_t n_state, n_exc_stack_unused, scope_flags, n_pos_args, n_kwonly_args, n_def_args;

There are 5 warnings total in this file, this is the first one. I edited mpy-cross/mpy-cross.mk and removed -Werror from CWARN , and it eventually finished building, with more warnings (4 in ../py/vm.c).
I couldn't find any reference to these warnings with Google searches, or in GitHub issues, or in Discord logs here. Am I missing a step? I can't reconcile the presence of -Werror and these unused variables in the tagged version; I don't see how it could possibly build. Is there another way to build 7.1.1 without making these changes? – edit: I'm on macOS 11.6 if that makes a difference.

slender iron
#

@wide mantle what version of gcc are you using?

wide mantle
slender iron
#

I'm not sure what compiler the mpy-cross version uses. it might actually use clang

wide mantle
#

oh ok; in that case that would be 13.0.1

slender iron
#

if you got it building, then you should be able to use mpy-cross

#

I wouldn't worry too much about hacking it

#

I used to develop on mac but have switched over to Linux for it now

wide mantle
#

that's also what I thought for mpy-cross, but I'm getting tons of other errors trying to build the rest for a FeatherS2 Neo.

slender iron
#

what does your git status show?

wide mantle
#

HEAD detached at 7.1.1

slender iron
#

and no files that are changed?

#

I have 8.4.0 of xtensa-esp32s2-elf-gcc here too

#

is there a reason you are doing 7.1.1 and not main?

wide mantle
#

there's the .mk that I changed, and a bunch more that I assume are side-effects from the build, maybe? or related to submodules.

slender iron
#

I'd be suspicious of the others

wide mantle
#

umm… yeah 🙂 I'd rather run a released version (hopefully tested too) rather than bleeding edge

slender iron
#

mind posting the first chunk of git status?

#

bleeding edge will generally be better

#

we haven't done anything majorly destabilizing

#

though we did update the idf

wide mantle
slender iron
#

ya, the new commits line is a submodules thing

#

try doing the make fetch-submodules in the top level again

wide mantle
#

I did run make fetch-submodules but the docs mention it before checking out the tag

#

do I need to re-run it after too? I wondered about that and didn't see it in the article

slender iron
#

yup, do it after you switch commits

wide mantle
#

ok… that makes a lot of sense. Thanks! I'll give it a shot. I suspect this might help with the other build issues I encountered with the firmware itself.

slender iron
#

hopefully

wide mantle
#

oh! but I had tried that. Every time I did the command output started with:

# This update will fail because the commits we need aren't the latest on the
# branch. We can ignore that though because we fix it with the second command.
# (Only works for git servers that allow sha fetches.)
git submodule update --init -N --depth 1 || true
fatal: not a git repository: ~/src/circuitpython-7.1/ports/stm/st_driver/../../../.git/modules/ports/stm/st_driver
Failed to clone 'ports/stm/st_driver'. Retry scheduled
BUG: submodule considered for cloning, doesn't need cloning any more?
Submodule path 'data/nvm.toml': checked out 'e5b149599d14a8841167fe552846ca36925b87a0'
Submodule path 'extmod/ulab': checked out 'a99e0b98787266369eaa33bdae271de761eca05b'```
and more errors.
slender iron
#

the CI ensures that it generally stays ok

#

try doing a git submodule sync before

wide mantle
#

e.g. ```error: Your local changes to the following files would be overwritten by checkout:
modules/5.10.82+/kernel/net/netfilter/xt_DSCP.ko
modules/5.10.82+/kernel/net/netfilter/xt_HL.ko

Aborting
slender iron
#

st_driver was a git submodule and now it isn't

#

you can delete those files if they are in the way

#

since you haven't changed much, you can rely on git to pull files back in if it needs them

wide mantle
#

great, thanks

manic glacierBOT
wide mantle
# slender iron since you haven't changed much, you can rely on git to pull files back in if it ...

I got further and apparently close to a full build, but it failed to link build-unexpectedmaker_feathers2_neo/firmware.elf:

xtensa-esp32s2-elf-gcc: error: esp-idf/components/esp_wifi/lib/esp32s2/librtc.a: No such file or directory
make: *** [build-unexpectedmaker_feathers2_neo/firmware.elf] Error 1```
This feels like it could be a board-specific issue… maybe? The only commands I had run related to `esp-idf` were the `install.sh` for the toolchain and sourcing `export.sh` to add them to the path and set environment variables. The path itself where it's trying to find the files is correct, there are a bunch or `.a` files in there but not these two.
slender iron
#

does your git status show anything with esp-idf?

wide mantle
#
modified:   esp-idf (modified content, untracked content)
slender iron
#

sometimes there are submodules in the idf that don't get updated

#

ya, change into esp-idf and do git submodule update .

#

(don't do that directly at the top level otherwise you'll download gigs of repo content)

wide mantle
#

I see. Thanks again! It clearly did update some files.

slender iron
#

🙂 when in doubt git status

wide mantle
#

aha! now I see these two .a files. I agree with you but I've not found the status output super clear with submodules, it often just says something like "modified content" and I'm not always sure what to do.

slender iron
#

when that's the case I usually cd into the submodule and rerun git status

wide mantle
#

Wrote 2642432 bytes to build-unexpectedmaker_feathers2_neo/firmware.uf2

#

woohoo! thanks so much 🙂

slender iron
#

🎉

wide mantle
#

I'm always amazed at the size of .uf2 files. 2.5 MB for all this? 🤯

slender iron
#

uf2 doubles the binary size

#

because it encodes 256 bytes written to flash in 512 byte blocks to match usb mass storage write sizes

wide mantle
#

why can't it use the full 512 bytes if that's the amount that's fetched from the storage device? instead of only half of it.

slender iron
#

there is metadata in the other half

#

like the total number of block and what block number it is

wide mantle
#

just a few bytes though

slender iron
#

because it can't assume that blocks are written in order

#

ya, its nice to have a power of two 🙂

#

it should compress reasonably well if you are worried about the size

wide mantle
#

the waste is a shame, but it's even more impressive that CP takes such little space

slender iron
#

you probably download more browsing the web

wide mantle
#

definitely

slender iron
#

2.5MB isn't that much anymore

wide mantle
#

most web pages are way over this amount

slender iron
#

and those are our largest uf2s due to all of the networking code

#

the uf2s aren't actually stored on the device at that size

#

the uf2 filesystem is fake

wide mantle
#

yep I see it: 1,321,184 bytes for circuitpython-firmware.bin. crazy!

#

@slender iron actually, I just realized you might be the right person to ask about CIRCUITPY_DISPLAY_LIMIT in displayio. This is the reason why I'm building CP myself instead of using a pre-built image; I have two SSD1327 OLED screens connected and I can't use them with displayio without bumping this value to 2 (which I did in the .mk file for my board, this worked well). But I'm not sure why it's hardcoded like this. Is the idea to not waste space in extern primary_display_t displays[CIRCUITPY_DISPLAY_LIMIT];? This is clearly a good reason given that most users will have 0-1 screens, but it feels like this could probably be addressed by making it dynamic rather than fixed-size – linked list or re-allocated array of pointers or other. I found the constant itself on a GitHub issue where someone was complaining about it being set to 1, so I'm likely not the only one with this use case.

manic glacierBOT
slender iron
#

@wide mantle ya it’s for the static allocation because display objects live after the vm

#

We could have one be static and the rest dynamic but that’d involve reworking it internally

wide mantle
#

right, that makes sense. I could see something like displayio.enable_extra_diplays(how many more) being useful.

manic glacierBOT
#

May I "pull up" my desire to get the MAC-Address of an established connection here again?

Is there somewhere a "make a whish site" for features in CP.

Currently, with the example of Scott I can differentiate between different Apple IOS models, but not devices.
(If a user has for example two iPhones of the same model, maybe one private and one business phone)
Also so far I did not find in any Bluetooth connection to Windows PC a DeviceinfoService.

For me to have a member **MAC-a...

manic glacierBOT
tulip sleet
#

@onyx hinge I am getting

../../supervisor/shared/translate.c:90:10: error: "compress_max_length_bits" is not defined, evaluates to 0 [-Werror=undef]
   90 |     #if (compress_max_length_bits <= 8)
#

on clean builds at the tip of main. I am confused because the PR should have picked this up.

manic glacierBOT
#

When the phones are changing their MAC-Addresses, how do the "partners" are finding their pairing information when connecting again.
For my purposes also "unique" pairing information of a connection would be as helpful as the MAC-address.
I just want to "see who did connect to me" during advertising and disconnect from the connections "I am not interested in for the moment".

#

You mean you get no value for the serial number field, or some unknown (but possibly unique) value?

Pairing uses the IRK stuff, I forget the details. The device wishing to pair sends a key.

I did implement getting the address from a connection in _bleio, though I am having some build troubles for unrelated reasons. I can give you a test build when I get the build working. Which board do you need a build for?

tulip sleet
onyx hinge
#

@tulip sleet yeah I saw it too, a fix is in the merge-1.18 branch. it also helps explain why I did it like I did

#

that symbol isn't defined yet during qstr generation, so it can't be used in a preprocessor directive.

#

I think things end up "fine" because it just prevents any qstrs in that file from being generated

tulip sleet
#

we should fix it so the qstr generation error causes the build to fail at that point

onyx hinge
#

that would be smart

tulip sleet
#

are you out at the moment?

onyx hinge
#

want me to look into that? I am a bit between things

#

done-ish with the 1.18 merge (pending review) and looking for a reason to postpone physically modifying a floppy drive

tulip sleet
#

since 1.18 is in process, I think it would be good to fix now

#

separate it from the 1.18 PR and apply now

onyx hinge
#

oh I can do that too

tulip sleet
#

i reverted it locally to do an unrelated build

onyx hinge
#

do you think the resulting builds are actually broken?

tulip sleet
#

I don't know - I was about to test one, but it's an english build

onyx hinge
#

okay

#

I suspect it would be broken independent of language, the diagnostic occured during the en_US build as well

tulip sleet
#

well, I am seeing error messages, etc.

#

still worth fixing, because it causes a confusing large build error locally

#

i would say

onyx hinge
#

yes I agree

tulip sleet
#

i mean the strings are working in the en build

#

oh, wait, I don't know if it works, because I reverted the fix, so my testing does not say

proven garnet
#

@tulip sleet when you get a chance I managed to get the asyncio documentation to build. Had to change a fix more asynchronous generator errors, so just a heads up. I don't have the hardware on me right now to run tests on the changes, but they're in the PR draft.

tulip sleet
#

@onyx hinge ok, I built en_US and fr from the tip of adafruit/main, and the error messages are still showing

onyx hinge
#

@tulip sleet So if the build printed this and stopped (the ellipsis is by me for efficiency of pasting in discord) that'd be good? ```../../supervisor/shared/translate.c:90:10: error: "compress_max_length_bits" is not defined, evaluates to 0 [-Werror=undef]
90 | #if (compress_max_length_bits <= 8)
| ^~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Command '['arm-none-eabi-gcc', '-E', '-DNO_QSTR', ..., '../supervisor/shared/translate.c']' returned non-zero exit status 1.
make: *** [../../py/mkrules.mk:100: build-adafruit_feather_rp2040/genhdr/qstr.split] Error 1

tulip sleet
#

yes, I think so, since in the future there may be more serious errors in the qstr build step and we should have those stop the build

onyx hinge
#

it makes sense, and it seems to have been an oversight in how I was using the multiprocessing facility

#
    executor.map(maybe_preprocess, itertools.repeat(command), itertools.repeat(output_dir), check)
    executor.shutdown()

Apparently this DOES wait for all of the works submitted to executor.map to complete but it DOESN'T raise any exceptions that occurred in the work. You have to actually iterate through the return value of executor.map for that to happen.

tulip sleet
#

got it, I thought this was just a make status check missing

#

I am surprised there is not an optional arg for that

manic glacierBOT
onyx hinge
#

the return of executor.map is a generator, you have to try actually consuming the items in the generator before the exception will get thrown. shutdown must wait for everything but swallow the exceptions intead...?

manic glacierBOT
#

Dan noticed that builds were printing a scary message like

but continuing, apparently, just fine. This two part PR:

  • makes the scary message be followed by an actual error that stops make
  • fixes the original problem, which was harmless but wouldn't have been allowed to creep in if not for the first problem
#

This PR solves most of the TODO stuffs of atmel-samd alarm module. Notable changes are:

  • Make light sleep work with TimeAlarm (enable RTC_IRQ)
  • PinAlarm sets up pins just before light sleep, and resets them after wakeup. [1]
  • Support edge parameter of PinAlarm
  • Support all tamper pins in PinAlarm for deep sleep.
  • Implement SleepMemory
  • Add board_deep_sleep_hook() function to be called just before deep sleep. [2]

[1] It is because PinAlarm does not have deinit.
[2] It is a...

#

Here are two builds, Feather nRF52840 and ItsyBitsy nRF52840, that implement _bleio.Connection.address. I did not add a corresponding change in the library yet, but you can get to the address by reaching into the Connection object. See the print statement in the test program below, which I used with the Bluefruit Connect app on an iPhone and an iPad

I did not try this with a pairing connection, and I did not try it waiting more than a few minutes between iPhone connections to see if the ...

manic glacierBOT
#

The ESP32-S3 has a built-in LCD controller, including the ability to drive parallel (8080) and dot-clock driven displays. If CircuitPython can directly drive RGB displays, it may allow the use of lower-cost displays. I'm interested to understand whether using CircuitPython to drive RGB displays is feasible or if there are issues that make it not worthwhile.

I verified the Espressif RGB LCD demo is ...

manic glacierBOT
#

Using the firmware in the zip provided. (Thank you!)

I am getting this results:

Note: This is not code, this is my debug output!
<Address 4f:15:bd:df:4b:d1>
|Apple Inc.iPad5,3-#|
set self.isconnected = True

-> here I turned **off** bluetooth in IOS settings

playsound ((880, 0.25), 262)

-> the sound iss generated in my code if the connection "goes away"....

!!!!!!!!!!!!!!!!!!! Start advertizing: 101
hid nc. 199.104 29792   29776   -16

-> here I turned **on**...
idle owl
#

When you waste 5 minutes trying to put an ESP32-S2 board into the bootloader like it's an RP2040.... 🤦🏻‍♀️

blissful pollen
#

You mean you don't just randomly mash buttons until it is in bootloader mode?

idle owl
#

Depends on the board type, I guess.

blissful pollen
#

I rarely remember so a few random tries rarely hurts 🙂

idle owl
#

It's more that it never would have worked that way. I could have done it forever. Best I would have gotten is the ROM bootloader, which doesn't even mount anything, so I wouldn't have noticed 😄

manic glacierBOT
#

Thanks for the idea!
I'm looking at all options...

On Thu, Feb 17, 2022, 11:07 bludin @.***> wrote:

just an idea: on the hardware-level and depending on the timing of the
data ready signal, you might be able to (ab)use it to stretch the clock.


Reply to this email directly, view it on GitHub
https://github.com/adafruit/circuitpython/issues/6044#issuecomment-1043128740,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEOHKJMQFSNAH6QHR6YPWTDU3UMMBAN...

idle owl
#

@slender iron How far did we get with CP on the micro:bit v2? Does it work?

slender iron
#

It used to work via BLE

idle owl
#

I remember you doing something with it, but I don't remember the results.

#

Ok.

#

Thanks

slender iron
#

USB won't work due to the board design

idle owl
#

Right

#

Got it

manic glacierBOT
idle owl
#

@proven garnet Are you around?

manic glacierBOT
proven garnet
#

Yup! Just grabbing food but I'll be back at my desk in like 5

idle owl
#

Nice, ping me then. No rush!

#

@proven garnet Are you planning to try to get your CP build environment up now? Or will that need to wait?

proven garnet
#

I was gonna do that now

idle owl
#

It probably takes about 10 minutes if everything goes properly. There's one part that takes most of that time.

idle owl
#

I did it yesterday again, so I might actually remember answers.

proven garnet
#

I just finished fetching the submodules

idle owl
#

That's the long bit 😄

proven garnet
#

Sweeeeeet

idle owl
#

So, test by building for CPX before we make any changes.

#

When you're ready.

#

I think that's the example in the guide

#

Let me check

proven garnet
#

I did git status and I'm sitting here for a bit, is that normal?

#

I definitely meant to do git branch

idle owl
#

Sometimes it sits for a bit yeah.

#

But not ages...

#

And yeah, the example in the guide is conveniently CPX.

proven garnet
#

Got it just cleared

#

What branch should I use?

idle owl
#

Oh... use main.

#

Don't check out a specific branch for this.

#

You can use latest.

proven garnet
#

Sounds good, I'll get the python packages now

idle owl
#

Excellent

#

I have a build-circuitpython venv for it.

#

But don't go learning virtual environments simply for this if you haven't used them before.

proven garnet
#

Once or twice but not enough to really know them that well haha

idle owl
#

@onyx hinge What language is biggest at the moment?

#

Russian?

onyx hinge
idle owl
idle owl
#

Are you on MacOS? Or other..?

proven garnet
#

Windows, using MSYS2

idle owl
#

Ah ok

proven garnet
#

I've had issues with pre-commit on Windows so trying it this way

#

It's really struggling to get the cryptography library via pip...

idle owl
#

I don't have pre-commit going on my CircuitPython build. It did something locally yesterday that it didn't do remotely, so I removed it. Changing so few things that I am not concerned about the stuff pre-commit does

#

hmm

proven garnet
#

If I can avoid pre-commit, can I do windows? I don't know why it's struggling, it just keeps cycling though versions and none of them seem to sit well with it

idle owl
#

Once I'm actually submitting code, I'll add it.

#

You're not submitting code

#

so you don't need pre-commit yet

#

Pre-commit runs checks when you commit code.

#

We're going to be building locally only.

proven garnet
#

New plan, I'm gonna try to use my windows environment, just pulled my repo there to be current

idle owl
#

Yeah give it a try.

proven garnet
#

That worked

#

Got an error when trying to build mpy-cross

idle owl
#

What's the error?

#

Are you in the right directory?

proven garnet
#

Traceback (most recent call last):

File "../py/makeversionhdr.py", line 132, in <module>

make_version_header(sys.argv[1])

File "../py/makeversionhdr.py", line 83, in make_version_header

git_tag, git_hash, ver = info

TypeError: cannot unpack non-iterable NoneType object

make: *** [../py/py.mk:253: build/genhdr/mpversion.h] Error 1

make: Leaving directory '/c/Users/adelaney/Documents/Github/circuitpython/mpy-cross'

idle owl
#

Oof. @tulip sleet Can you assist?

proven garnet
#

I'm in the top level folder

idle owl
#

That's the right directory, yeah.

#

Which is the extent of my mpy-cross error troubleshooting. Dan will know better.

manic glacierBOT
tulip sleet
proven garnet
#

Proper

tulip sleet
#

give me a few minutes. But we almost never do builds in Windows, it's too hard to get it working properly

proven garnet
#

For it I can look into getting WSL up and running

tulip sleet
#

do you have a Linux machine or a Linux VM?

blissful pollen
tulip sleet
#

in the repo, could you run git rev-parse --short HEAD

proven garnet
#

Windows 10 but it seems I have WSL already installed I must have had it for something else a while ago

tulip sleet
#

if you have WSL1 installed you probably want to get rid of it and install WSL2. WSL1 is quite slow on disk io. The builds take a long time

proven garnet
#

Looks like I've got WSL2 from looking up how to check

blissful pollen
#

Windows 11 does have a few nice feature upgrades to WSL as well. I just updated yesterday. But I ran fine in Win10 with it for a long time too

tulip sleet
#

what's probably happening is that get_version_info_from_git() in py/makeversionhdr.py is returning None for some reason. But I'd want you to put some print statements in there to check it all. If you want to switch to WSL2 it might be easier

proven garnet
#

Working on the latter option now!

proven garnet
#

Okay new error, maybe?

make: Entering directory '/home/adelaney/circuitpython/mpy-cross'
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
mkdir -p build/genhdr
GEN build/genhdr/moduledefs.h
QSTR updated
make: msgfmt: Command not found
make: *** [../py/py.mk:260: build/genhdr/en_US.mo] Error 127
make: Leaving directory '/home/adelaney/circuitpython/mpy-cross'
#

When trying to build mpy-cross

blissful pollen
#

What I found when I was setting up WSL was anytime I hit an error like msgfmt: command not found google it and figure out how to install it (usually apt get or pip install)

proven garnet
#

Got it thanks!

idle owl
#

Is any part of this likely to change in the future? ```import time

while True:
print("Hello, World!")
time.sleep(4)```Asking because I have the option to add it as a code snippet into Learn, which means it's not editable except by folks with Learn access, or I can put it on GitHub where it can be updated by anyone. I feel like no part of that will change, but I wanted a second opinion.

tulip sleet
idle owl
proven garnet
#

Anyone know how to get what I think is the toolchain arm-none-eabi-gcc?

tulip sleet
#

it is explained in the Building CircuitPython guide

proven garnet
#

Oh it's in thr intro I must have missed it thank you!

tulip sleet
#

it is in the Linux part. you follow the initial WSL stuff, and then switch to Ubuntu Linux. I can make that clearer if it s not

slender iron
#

@onyx hinge @tulip sleet do we want MP 1.18 in CP 7.2?

tulip sleet
#

at this second I am writing a review sentence saying I want to defer until after 7.2.0

slender iron
#

haha, ok

proven garnet
#

New error, but I'll start a thread to declutter the chat. Is this the best channel?

manic glacierBOT
#

IThank you for doing this! looked this over and I don't see anything. I want to check for asyncio.py whether we need both __await__() and __iter__(), but that should not affect this merge.

Do we need to change our frozen module specifications to use manifests? I don't see any changes to any mpconfigboard.mk files.

I would rather wait and merge this after 7.2.0, because of the possibility of unforeseen problems.

manic glacierBOT
#

Here's the first of many questions:

1. The IDF has some high level constructs for connecting the display.  Should these be used, or will I need to burrow down closer to the hardware to make the links to CircuitPython.

I think it depends on how you plug into displayio.

2. Currently, the displayio makes a framebuffer, and the "bus" is just a pipe for shoving data down.  In contrast, with the RGB LCD driver, it defines its own display buffer.  Do I need a separate displa...
blissful pollen
#

@idle owl After talking earlier I will not admit how long I just spent clicking buttons on an UnexpectedMaker FeatherS2 to get it into boot mode 🤣

manic glacierBOT
#

In circuitpython.readthedocs.io, the API documentation for msgpack.pack gives the buffer parameter the type annotation circuitpython_typing.WriteableBuffer. bytearray is listed as one of the types that implements that protocol. However, this code fails:

>>> import msgpack
>>> buf = bytearray(20)
>>> msgpack.pack([2,3], buf)
Traceback (most recent call last):
  File "", line 1, in 
OSError: stream operation not supported

msgpack.unpack has a similar issue with `buffe...

slender iron
#

@tulip sleet want me to grab one of the 7.2.0 bugs from you so we can get an rc out and branch it?

tulip sleet
#

I am thinking that maybe we should revert the default HIGH (see #5931 above). The MagTag clicking is really distracting.

slender iron
#

sure! I'll look after I get back from a run

#

I don't think we need to revert it because we'll need a "special case this pin for a board" method either way

#

maybe a board specific reset hook that can override the default

#

it was changed to fix neopixels on the esp dev boards anyway

tulip sleet
#

maybe I will move 5931 to 7.2.0 then, and maybe you can take that one 🙂

slender iron
#

kk, I've got an idea on how to do it

tulip sleet
#

have a good run! It was 59 degrees here today

slender iron
#

I've been brainstorming a usb host api too

#

I'll try and braindump it today

#

that sounds nice! It's 46 here now...

#

gonna be a little chilly

idle owl
#

Oof, it's dumping snow here at the moment. Poured rain yesterday. 🙄

manic glacierBOT
#

Does the below code have to change? It is referencing CIRCUITPY_OPT_CACH_MAP_LOOKUP_IN_BYTECODE which was removed in 1.18. Maybe it has to change to MICROPY_OPT_MAP_LOOKUP_CACHE (or a CIRCUITPY equivalent). I ran into it when I was trying to enable the latter option. I found reference to the new MICROPY_OPT_LOAD_ATTR_FAST_PATH only.

https://github.com/adafruit/circuitpython/blob/16c44a4d50677c549ac9459d49cceaea2f7b6589/py/circuitpy_mpconfig.mk#L167

manic glacierBOT
proven garnet
#

Big thank you to Dan for the help! @idle owl I got the environment set up, but probably can't test things now. Feel free to leave any helpful tidbits for testing those changes (we can start a thread) and I also see the guide you sent shows how to freeze a module

idle owl
#

Sounds good!

manic glacierBOT
idle owl
#

Testing a frozen module in CP

manic glacierBOT
idle owl
#

@onyx hinge Russian translation is ru yes?

#

Ya looks like it.

onyx hinge
#

yup

idle owl
#

Thanks

manic glacierBOT
idle owl
#

TIL you can display a bitmap using only displayio. Also TIL you can't scale a bdf font. I mean you can... but it won't look right.

#

I was going to ping Foamyguy to find out whether the artifacting was a bug in the software, but was informed elsewhere that they're not meant to be scaled, and so weirdness is to be expected. So foamyguy escaped a useless ping.

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.1.1 on 2022-01-14; Adafruit Feather ESP32-S2 TFT with ESP32S2

Code/REPL

import board
import audiobusio
audio = audiobusio.I2SOut(word_select=board.A0, data=board.A1, bit_clock=board.A2)

Behavior

CircuitPython hard crashes to safe mode.

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

You are in safe mode because:
CircuitPython core code crashed hard. Whoops!
Crash int...
tulip sleet
#

@slender iron ok, competing PR's; I thought you were going to do the pin one first 🙂

slender iron
#

haha, nope.

#

that is next on my list

tulip sleet
#

so the status LED is off (mostly) when user code is running? I did an init and deinit

slender iron
#

it may be white when in the repl

#

but not init

#

I don't think you should call init/deinit because the user may have used the pins/resources already

tulip sleet
#

okee, I'll close my PR

slender iron
#

lemme check the API doc to make sure it makes sense now

tulip sleet
#

we are calling init/deinit on our private object

#

people sometimes set brightness to zero in boot.py

slender iron
#

the led is off and deinit in boot.py

tulip sleet
#

so if the API doc is OK, I'll close mine

slender iron
#

it doesn't make a ton of sense now

slender iron
#

so I'll update it

#

don't we have a value range checker now?

#

found it and updated the shared-bindings for it too

idle owl
#

Guide feedback was basically all "why is there no wifi or TFT examples in the guide" so... I imagine you're getting it too.

tidal kiln
#

@idle owl looks good. nice set of examples.

idle owl
#

Thanks! Foamyguy wrote a few of them for me. Super helpful.

manic glacierBOT
#

I reproduced this issue running CP 7.2.0-alpha.2. No autoreload occurred after editing code.py
The stack from gdb and the variables you mentioned:

#0  0x0000a628 in common_hal_mcu_enable_interrupts ()
#1  0x0001ccf8 in port_idle_until_interrupt ()
#2  0x00015a36 in mp_hal_delay_ms ()
#3  0x000237cc in time_sleep ()
#4  0x000100ee in fun_builtin_1_call ()
#5  0x000140a0 in mp_call_function_n_kw ()
#6  0x000299e6 in mp_call_method_n_kw ()
#7  0x00015070 in mp_execute_bytecode ()...
manic glacierBOT
jaunty juniper
slender iron
#

@tulip sleet I'd rather not change that line. Your version has three function calls on a single line. I think the current version is clearer

#

@jaunty juniper want to make a PR? I think you just need to wrap the #define DEBUG_UART_... in a #if DEBUG test for the board

#

I don't think we want to blanket disallow debug uart on boards

manic glacierBOT