#circuitpython-dev

1 messages ยท Page 336 of 1

tulip sleet
#

i think that has the right emphasis

#

you could say "Pin Mappings", but that's very jargonyh

idle owl
#

is the reason I considered but did not choose it as the first.

#

Yeah I thought that too

#

Ok

#

Pin Names it is. Thank you.

blissful pollen
#

Pin Names sounds good to me, when I was learning more I am almost certain I googled that term before when I was trying to find out is A2 = D2 or something (not knowing it didn't really matter)

idle owl
#

Thank you for the feedback! Working for someone like you is what really matters with this.

#

@atomic summit Are you perhaps around?

#

@tulip sleet I want to include a sentence explaining why the pin names changed. Can it be summed up in a sentence or is that a whole thing in itself?

manic glacierBOT
tulip sleet
#

the long answer is that we don't want to support our own Board Support Package on Arduino, and theirs uses the GPIO names which can't be changed. The short answer is probably that the names match the Arduino names.

idle owl
#

I mean a few sentences would also be fine. But I don't want to head down a rabbit path.

#

alright

#

I'll go with the short answer there then.

#

The four people who ask for the long answer, we can just tell them.

#

And the use of IO instead of D? To fit with standard ESP pin naming? or?

tulip sleet
#

or to say, the names match the Arduino NUMBERs. We are not using names starting with D because they would be in different possitions from the standard Metro/Arudino shaped boards, and that would be really confusing. Or you could just say that the "IO" prefix matches the ESP32-S2 standard (removing "GP" to save space)

idle owl
#

Or because it's a different map than previous metros so we wanted it to be clear so we changed the API.

#

ok

#

Got it.

#

I think I can work with that.

#

Might still have you preview it when I'm done.

tulip sleet
#

calling it the "API" is a stretch, I wouldn't use that name. It's "like" an API.

idle owl
#

nah I was using that for shorthand here.

#

Basically summing up what you said

manic glacierBOT
#

Seconding Scott here - if you can get everything in CountIO moved over to a peripherals/pcnt.c file, you can migrate all your init and reset functions over to it, and the two modules will be able to co-exist without accidentally trying to reserve each other's PCNT units. Check out rmt.c for an example - the RMT is used by PulseIn, PulseOut, and Neopixel_write, so they all share the same reservation system, init/deinit, and reset_all functions.

solar whale
#

How often to the 6.0.x updates get merged into main?

onyx hinge
#

@solar whale not on a particular schedule.

solar whale
#

@onyx hinge Thanks!

lone sandalBOT
manic glacierBOT
idle owl
#

@slender iron Does the J-Link work with the ESP32-S2?

slender iron
#

the debug plug is a JTAG port (not SWD)

idle owl
#

oh

slender iron
#

it doesn't work with JLink software but you can use OpenOCD with JLink hardware to connect

idle owl
#

Alright

slender iron
#

the debug plug is the same physically but the pins are for JTAG instead of SWD. SWD is an ARM CPU specific thing

idle owl
#

Wait, the connectors are called SWD though. The ones that solder into that space.

#

oh

#

I see

slender iron
#

the connector itself is just 2x5 1.27mm pitch

idle owl
#

So the connector will still work

#

ah thanks

#

I'll word it that way

slender iron
#

ya, same connector

#

on the left you can see the "SWD pinout" but the / show the alternative use for JTAG

idle owl
#

ah

slender iron
#

like TDO and TDI

#

the T ones are JTAG

idle owl
#

ok

tulip sleet
#

@slender iron are you suggesting PR 3639 would fix the SSL hanging problem, or just that it needs to be tested?

slender iron
#

I don't know of SSL hanging

#

I'm hoping it'll improve reliability

tulip sleet
#

sorry, not hanging failing

slender iron
#

it should reduce the memory footprint of SSL connections

manic glacierBOT
#
Saola 1 w/Wrover with ESP32S2
6.1.0-alpha.0-186-g872615e9d on 2020-11-03 (artifact from this PR)
Requests 1.7.4

After testing this for a couple of hours, to the point of confusion (encountering other open issues, intermittent errors, different behavior with different URLs, etc.)... some scenarios work fine, and I don't see any clear new issues. Not sure what the test case is for testing the reduced delay. I do still see intermittent espidf.MemoryError: in `File "adafruit_reque...

blissful pollen
#

@slender iron I could rename the busdevice library, but is there a way to handle the fact I2CDevice is now not in a separate file (adafruit_busdevice.i2c_device.I2CDevice where i2c_device.py existed)?
If its possible I can look into how to do it just don't want to chase the impossible by accident

manic glacierBOT
slender iron
#

@blissful pollen ah! take a look at microcontroller.pin. it is possible internally

tulip sleet
#

@solar whale I am confused about what canonical examples I should be using on ESP32-S2 to test requests. Are you using ones that you cooked up, or are there some examples floating around? Thanks.

#

@slender iron same q could be addressed to you, if you have some examples. The ones in examples in the requests library are not suitable, it appears, even the "cpython" ones, because they use socket.

slender iron
#

you can convert any esp32spi examples to the s2 pretty easily

tulip sleet
#

but they are mostly using the legacy API, right?

solar whale
#

this ahs been my usual test ```mport ipaddress
import wifi
import socketpool
import time
import adafruit_requests
import ssl
#import espidf

#import gc

#print("cp mem free", gc.mem_free())

#print("idf total mem", espidf.heap_caps_get_total_size())
#print("idf mem free", espidf.heap_caps_get_free_size())
#print("idf largest block", espidf.heap_caps_get_largest_free_block())

for network in wifi.radio.start_scanning_networks():
print(network, network.ssid, network.rssi, network.channel)

wifi.radio.stop_scanning_networks()

print(wifi.radio.connect("ssid", "password"))

print("ip", wifi.radio.ipv4_address)

ipv4 = ipaddress.ip_address("8.8.4.4")
print(ipv4)
print("ping", wifi.radio.ping(ipv4))

pool = socketpool.SocketPool(wifi.radio)
requests = adafruit_requests.Session(pool, ssl.create_default_context())

response = requests.get("http://wifitest.adafruit.com/testwifi/index.html")
print(response.status_code)
print(response.text)

response = requests.get("https://httpbin.org/get")
print(response.status_code)
print(response.json())

print()

response = requests.get("http://worldtimeapi.org/api/ip")
print(response.status_code)
print(response.json())

print()

response = requests.get("https://api.github.com/repos/adafruit/circuitpython")
print(response.status_code)
print("circuitpython open issues", response.json()["open_issues_count"])
print("circuitpython stars", response.json()["stargazers_count"])
print("done")

slender iron
#

ya, but the new requests api isn't that different, it's just on an object

#
pool = socketpool.SocketPool(wifi.radio)
requests = adafruit_requests.Session(pool, ssl.create_default_context())
#

that's the critical bit

solar whale
#

the last one used to take a very long time -- 60 seconds or more -- but getting much better -- just about to test PR3639

tulip sleet
#

ok, thanks! I thought https was not working at all

solar whale
#

I was , but has not been working for me lately

tulip sleet
#

eg. I am getting "Failed SSL handshake"

solar whale
#

welcome to the club

tulip sleet
#

so mayb 3639 fixes that or maybe not, and I can try Scott's idea of setting the date/time to something reasonable.

solar whale
#

somee https work -- seom don't ```ress any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 6.1.0-alpha.0-185-g7441344c6 on 2020-11-03; Metro ESP32S2 with ESP32S2

import wifi_test
<Network> Needell Airport -57 6
<Network> Needell Airport -47 1
<Network> WYZE_FBAB62DE71811B38 -68 11
<Network> central2.4 -80 8
<Network> 31A -81 8
None
ip 10.0.0.30
8.8.4.4
ping 0.055
200
This is a test of Adafruit WiFi!
If you can read this, its working :)

200
{'url': 'https://httpbin.org/get', 'headers': {'User-Agent': 'Adafruit CircuitPython', 'Host': 'httpbin.org', 'X-Amzn-Trace-Id': 'Root=1-5fa19b3e-20a0aede2bda0b7b3b22cc46'}, 'args': {}, 'origin': '73.61.89.123'}

200
{'timezone': 'America/New_York', 'utc_datetime': '2020-11-03T18:02:40.067080+00:00', 'raw_offset': -18000, 'client_ip': '73.61.89.123', 'dst_from': None, 'unixtime': 1604426560, 'utc_offset': '-05:00', 'datetime': '2020-11-03T13:02:40.067080-05:00', 'week_number': 45, 'abbreviation': 'EST', 'day_of_year': 308, 'day_of_week': 2, 'dst': False, 'dst_offset': 0, 'dst_until': None}

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "wifi_test.py", line 53, in <module>
File "adafruit_requests.py", line 555, in get
File "adafruit_requests.py", line 535, in request
File "adafruit_requests.py", line 429, in _get_socket
File "adafruit_requests.py", line 425, in _get_socket
OSError: Failed SSL handshake

#

this used to work with an older requests library

#

So I don't think it isthe certificates.

umbral dagger
slender iron
#

@tulip sleet can you do download counts for the new release or need me to?

tulip sleet
#

ah I forgot. I do have a script

#

how far back do you go?

slender iron
#

I think two weeks would be fine. I also have the s3 files from rc.0 so I may not have too much to download

tulip sleet
#

I will download and concat the previous months. It's nice we're on a month boundary almost

slender iron
#

๐Ÿ‘

manic glacierBOT
#

This one? http://api.coindesk.com/v1/bpi/currentprice/USD.json I don't see inordinate delays with rc.0 or this PR build. Maybe 0.1s improvement in time to print the headers.

https://learn.adafruit.com/api/guides/new.json?count=5 has long headers and long response body. Times are longer and much more variable, but it's hard to isolate out variations in server and network perform...

solar whale
#

these https requests all work with PR3639 ```TEXT_URL = "https://httpbin.org/get"
JSON_GET_URL = "https://httpbin.org/get"
JSON_POST_URL = "https://httpbin.org/post"

print("Fetching text from %s" % TEXT_URL)
response = https.get(TEXT_URL)
print("-" * 40)

print("Text Response: ", response.text)
print("-" * 40)
response.close()

print("Fetching JSON data from %s" % JSON_GET_URL)
response = https.get(JSON_GET_URL)
print("-" * 40)

print("JSON Response: ", response.json())
print("-" * 40)
response.close()

data = "31F"
print("POSTing data to {0}: {1}".format(JSON_POST_URL, data))
response = https.post(JSON_POST_URL, data=data)
print("-" * 40)

json_resp = response.json()

Parse out the 'data' key from json_resp dict.

print("Data received from server:", json_resp["data"])
print("-" * 40)
response.close()

json_data = {"Date": "July 25, 2019"}
print("POSTing data to {0}: {1}".format(JSON_POST_URL, json_data))
response = https.post(JSON_POST_URL, json=json_data)
response = https.post(JSON_POST_URL, json=json_data)
print("-" * 40)

json_resp = response.json()

Parse out the 'json' key from json_resp dict.

print("JSON Data received from server:", json_resp["json"])
print("-" * 40)
response.close()

manic glacierBOT
#

@tannewt and reviewers I have tested this branch by pulling it in and building from source on a Metro ESP32-S2 testing on my demo code:

import gc
import ipaddress
import wifi
import adafruit_requests
import time
import ssl
import socketpool
# import adafruit_dht
from secrets import secrets

# dht = adafruit_dht.DHT11(board.D7)

print(wifi.radio.connect(secrets['ssid'], secrets['password']))

print('ip', wifi.radio.ipv4_address)

ipv4 = ipaddress.ip_address('8.8.8.8')
...
solar whale
#

hmmm if I run this request first -- it works response = requests.get("https://api.github.com/repos/adafruit/circuitpython") print(response.status_code) print("circuitpython open issues", response.json()["open_issues_count"]) print("circuitpython stars", response.json()["stargazers_count"]) ```Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 6.1.0-alpha.0-185-g7441344c6 on 2020-11-03; Metro ESP32S2 with ESP32S2

import wifi_x
<Network> Needell Airport -58 6
<Network> Needell Airport -44 1
<Network> WYZE_FBAB62DE71811B38 -71 11
<Network> central2.4 -84 8
<Network> 31A -84 8
None
ip 10.0.0.30
8.8.4.4
ping 0.037
200
circuitpython open issues 336
circuitpython stars 1886
done

#

when it was third, it failed with SSL handshake error ...

#

Order makes a big difference -- now after some https requests succeed I get ```Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "wifi_test.py", line 47, in <module>
File "adafruit_requests.py", line 555, in get
File "adafruit_requests.py", line 535, in request
File "adafruit_requests.py", line 440, in _get_socket
espidf.MemoryError:

manic glacierBOT
solar whale
#

This is with PR 3639

idle wharf
#

Watched the deep dive last night, great overview of the NTP stuff @slender iron. When we were talking about it in the github issue, I didn't realize you were thinking about NTP being added to core vs updating the adafruit_ntp library which I had in my original description. I should have asked about that earlier. Is your UDP branch suitable for trying out with the new NTP changes, or do you have more work to go there?

solar whale
#

@slender iron I'm pretty confused.... Now that I am getting very different behavior depending on the order in which I do https requests, should I be posting to the issue under PR 3639 or the Request Library ... or somplace else.

slender iron
#

@idle wharf I haven't even tried to compile my udp branch. I'm hoping to hand it off and try and focus

#

but getting sucked into esp32spi debugging today

#

@solar whale the PR or a new issue

idle wharf
#

@slender iron That's what I needed to know. It failed to build for me, but if you've not gotten that far, then I should wait.

manic glacierBOT
#

I am finding the the order in which https calls are made makes a big difference
using this code -- note the first request is commented out

import ipaddress
import wifi
import adafruit_requests
import time
import ssl
import socketpool

print(wifi.radio.connect('Needell Airport', 'browndog'))

print('ip', wifi.radio.ipv4_address)

ipv4 = ipaddress.ip_address('8.8.8.8')
print('ping', wifi.radio.ping(ipv4))

pool = socketpool.SocketPool(wifi.radio)

https = adafruit_re...
atomic summit
#

@idle owl I'm here now (6am here)

idle owl
#

@atomic summit Oi! I had the wrong country entirely. I was wondering how you did your fancy pinouts diagram for your FeatherS2.

atomic summit
#

I make them by hand in Affinity Designer, which is a vector app for Mac and Windows.

idle owl
#

Wow. Ok. Well done, you, then ๐Ÿ™‚

#

I feel less bad that I've been doing this one by hand then.

atomic summit
#

I wish there was an app for it, or an easier way, but there isn't ๐Ÿ˜ฆ

idle owl
#

I thought you might have some kind of automation or program that did it for you.

atomic summit
#

Nope ๐Ÿ˜ฆ

idle owl
#

I don't know how to do vector stuff, so I'm in photoshop. ๐Ÿ™„

#

It actually doesn't look half bad, but yours is way better.

atomic summit
#

Ok. Issue with doing it as a bitmap is it wont scale/resize properly. Like if you want to go from screen DPI to print etc.

idle owl
#

Yeah I know. I realise that.

#

This isn't meant to be a full diagram, it's meant to show the CircuitPython pin names.

atomic summit
#

Though Photoshop does have some basic vector tools, so try to use those for shape primitives if you can. That will help.

idle owl
#

I started with the SVG from the Fritzing I made for it and then went from there.

#

So that was the size I began with. Because I also don't know how to export an SVG other than whatever size Illustrator decided it was.

#

This is super basic. Rectangles and text.

thorny jay
#

you can convert any esp32spi examples to the s2 pretty easily
@slender iron @tulip sleet Here is the ministry of silly creative idea... is it possible to connect an AirLift Feather Wing to a ESP32S2 Feather and alternatively use build-in Wifi or AirLift Wing Wifi to compare the behaviour? (feel free to discard)

atomic summit
#

Ok. I'm happy to do a pass over it once you have the info in place ๐Ÿ™‚

idle owl
slender iron
#

@thorny jay ya, you should be able to connect both

idle owl
#

Need to add the I2C, SPI and UART singletons next to their respective pins.

atomic summit
#

That looks great! well done!

idle owl
#

Thanks! I really appreciate that.

#

Downside is that screenshot is 100% the size, so no zooming. But like I said, it's not meant to be one of the giant diagrams.

#

Learned about linking layers though. Figured that out on my own. So I levelled up my Photoshop skills today I guess. ๐Ÿ˜„

#

@atomic summit Anyway, thanks. I'll ping you when it's done for another set of eyes, though Limor will give it a look as well.

thorny jay
#

I am sure there are "filter" to check how various colorblindness see colourfull image. There is more than one kind of this.

idle owl
#

I know. The color combos are endless and managing to compare them to all possible concepts is difficult. I usually ask Dan regardless.

thorny jay
#

Are you still using MISO and MOSI?

idle owl
#

Yes, but when spelled out we use something like Microcontroller In/Serial Out or Sensor Out depending on the situation.

thorny jay
#

Ok

crimson ferry
thorny jay
crimson ferry
#

I have a few ๐Ÿ˜‰

idle owl
#

@slender iron I know the I2C, UART, SPI "pins" in CircuitPython are singletons, but is there another less jargony name for them? Or is that simply what they are and we should be explaining it that way.

slender iron
#

I don't know of one. the idea is that the object is created the first time you access it and then returned forever more

idle owl
#

Ok. Thanks

slender iron
ionic elk
#

@slender iron I've been crash coursing on UDP/IP this morning, but I'm still pretty new to the python end of things. If I were to try and think about how to test your UDP code, where would I start?

#

Do we have any examples for Socketpool yet I can try?

tulip sleet
#

@idle owl I canโ€™t see the difference between the blue and purple at all really. I am red insensitive so the addition of red in the purple doesnโ€™t change much. More people are green insensitive

idle owl
#

Fair enough.

slender iron
ionic elk
#

so that was all from 2019? How does that work?

slender iron
#

I don't know what you mean.

ionic elk
#

or I guess only the UDP part is this year, sorry, I'm just trying to figure out where in the process I'm jumping in

#

I mean we didn't have any ESP32 in circuitpython last year so I'm confused as to when and why this was written

slender iron
#

when what was written?

ionic elk
#

The NTP library.

slender iron
#

it was originally done for ESP32SPI

ionic elk
#

ah

slender iron
ionic elk
#

So have you already modified this code to work with native UDP on the ESP32-S2?

#

or does that all need to be modified in

slender iron
#

I modified it to use UDP in CPython

ionic elk
#

ok

slender iron
manic glacierBOT
bronze shadow
#

I'm advertising an nrf52840 device as both a uart device, and a hid device. The name advertises correctly on the HID, but the name on the uart advertisment is None. Is this just an unsupported configuration, or is this a possible bug?

manic glacierBOT
slender iron
#
    def _get_socket(self, host, port, proto, *, timeout=1):
        key = (host, port, proto)
        if key in self._open_sockets:
            sock = self._open_sockets[key]
            if self._socket_free[sock]:
                self._socket_free[sock] = False
                return sock
        if proto == "https:" and not self._ssl_context:
            raise RuntimeError(
                "ssl_context must be set before using adafruit_requests for https"
            )
        addr_info = self._socket_pool.getaddrinfo(
            host, port, 0, self._socket_pool.SOCK_STREAM
        )[0]
        retry_count = 0
        sock = None
        while retry_count < 5 and sock is None:
            if retry_count > 0:
                if any(self._socket_free.items()):
                    self._free_sockets()
                else:
                    raise RuntimeError("Out of sockets")
            retry_count += 1

            try:
                sock = self._socket_pool.socket(addr_info[0], addr_info[1], addr_info[2])
            except OSError:
                continue

            connect_host = addr_info[-1][0]
            if proto == "https:":
                sock = self._ssl_context.wrap_socket(sock, server_hostname=host)
                connect_host = host
            sock.settimeout(timeout)  # socket read timeout

            try:
                if not sock.connect((connect_host, port)):
                    sock = None
            except MemoryError:
                sock = None

        self._open_sockets[key] = sock
        self._socket_free[sock] = False
        return sock
#

@bronze shadow you should be able to do a single combined advertisement

bronze shadow
#

I'll see if that works in my codebase, but I was unaware. Thanks!

#

I've stopped advertising HID and am only using UART. Example code is

self._ble.name = 'test'
for adv in self._ble.start_scan(ProvideServicesAdvertisement, timeout=20):
    print('Scanning')
    if UARTService in adv.services and adv.rssi > -70:
        print(adv.__dict__)

That print is returning {'data_dict': {6: b'\x9e\xca\xdc$\x0e\xe5\xa9\xe0\x93\xf3\xa3\xb5\x01\x00@n', 1: b'\x06'}, '_rssi': -58, 'connectable': True, 'mutable': False, 'address': <Address REDACTED>, 'flags': <AdvertisingFlags object at 20027300>, 'scan_response': False, 'adv_service_lists': {2: <BoundServiceList object at 20027900>}}

Advertising side looks like this

self._ble.name = 'test'
self._uart = UARTService()
advertisement = ProvideServicesAdvertisement(self._uart)
self._ble.start_advertising(advertisement)
#

Devices do connect, but I don't see a name in the __dict__ and it returns None as you would expect.

manic glacierBOT
lapis hemlock
analog bridge
#

@idle owl I can help you with the pinout diagram for the metro... would like to point you to the pinout diagram that I created for my microS2.

idle owl
#

@analog bridge I just finished doing up the one I was doing ๐Ÿ˜„ That does look lovely though. How did you do it?

#

I managed to scale it properly so now it's at least huge and zoomable.

analog bridge
#

I am using Inkscape and Adobe Illustrator

idle owl
#

@analog bridge I am completely lost when it comes to Illustrator. I can edit things fairly well, but creating new things is a massive struggle for me.

analog bridge
#

Are you working with svg ?

idle owl
#

The board image was an SVG, I exported it as a PNG so I could use it in Photoshop.

#

So this all started in Illustrator. It did not continue there. ๐Ÿ˜„

manic glacierBOT
idle owl
#

It's the SVG used for the Fritzing object.

#

For what it's worth, this will work for our current needs. I wouldn't want to do a full pinouts diagram like this though. This was simply to show the CircuitPython pin naming scheme we chose.

analog bridge
#

@analog bridge I am completely lost when it comes to Illustrator. I can edit things fairly well, but creating new things is a massive struggle for me.
@idle owl I feel it.

#

I think I made mine too huge... would be reducing dpi used for png export.

idle owl
#

This is also massive now that I figured out scaling the original SVG. Will need to bring it down for export as well.

#

Otherwise I imagine the Learn system might choke on it. ๐Ÿ˜„

topaz schooner
#

Got lucky enough to grab a couple QT-Py's. One needed a code reload - the neopixel was cycling, and I could get the BOOT directory, but the CIRCUITPY directory would not come up, nor would it connect with Mu (even though logs say Mu saw it). So I went to download the latest .uf2 and 6.0.0 Beta was the only one listed on the QT-Py page. That went fine, but I lost the demo code that comes with it. Anyone know if that demo code is available somewhere?

tulip sleet
#

@topaz schooner it's a bug that only beta is on the download page. I'll check on that, sorry.

faint delta
#

hi. is it okay to make and sell end-user products with circuitpython ?

onyx hinge
#

@lapis hemlock I think we'd like the CI steps to be the most like building ulab inside circuitpython as possible

tulip sleet
#

@faint delta are you selling a development board, or a purpose-built thing (like a thermostat or something)? It's open-source software, liberally licensed, so you can do what you want with it. We have some requests about how you'd use the nam CircuitPython if you were make that name visible.

lapis hemlock
#

@lapis hemlock I think we'd like the CI steps to be the most like building ulab inside circuitpython as possible
@onyx hinge That's OK, but we still have to set the NUMPY_COMPATIBILITY flag. If you'd like, we can have a separate ulab.h header file for circuitpython. That is a clean solution.

#

By the way, sorry for hijacking the "In the weeds" section yesterday. I didn't realise how long it went.

onyx hinge
#

@lapis hemlock why not do it the way we do for many other things, #if !defined(SYMBOL) #define SYMBOL (DEFAULT_VALUE) #endif so that we can add our preferences as -DSYMBOL=OUR_VALUE in CFLAGS?

faint delta
#

@tulip sleet it's for the next version of a product that's already out on the market. my dad is asking me to build it. his previous version didn't have a microcontroller. he's adding one and asking me to write the code, so i am trying to make sure it's alright. couldn't find a FAQ or anything about this, but i get this feeling like it can't be this easy ?

tulip sleet
#

well, if you expose CIRCUITPY, then someone could mess with the code you're writing, etc. Depends on the product, but it might be too easy to break. Or, if it's user-servicible, then maybe making it easily accessible is good.

idle owl
#

@tulip sleet @slender iron I finished the CircuitPython Pin names diagram so the documentation Limor expected to accompany our decision is thorough and completed ๐Ÿ˜„

lapis hemlock
#

@lapis hemlock why not do it the way we do for many other things, #if !defined(SYMBOL) #define SYMBOL (DEFAULT_VALUE) #endif so that we can add our preferences as -DSYMBOL=OUR_VALUE in CFLAGS?
@onyx hinge we could do this. But won't it get long? I mean, if you want to define all your symbols on the command line, then it might become a nightmare...

onyx hinge
#

apparently our CFLAGS are about 3.5kB, for some atmel-samd board

tulip sleet
#

yah, it's dozens and dozens already

#

if not hundreds

faint delta
#

that's what im thinking, @tulip sleet , the latter (user serviceable). i want the users to have as much freedom as possible, which circuitpython gives me, even over Arduino IDE approach (which suffers the same "gut feeling" i mentioned). I think as long as I can deliver working solution without risking security, and the customer (my dad in this case) is ok with the ability for competitors to look at the code, then there is no problem. would this be correct?

tulip sleet
#

Yes, it's fine. You could use a custom build of CircuitPython that doesn't expose CIRCUITPY (and doesn't act as an HID keyboard, etc.), but leave the bootloader there, with a reset button. If your code needs to be updated, someone could load a regular version of CircuitPython via UF2, expose CIRCUITPY, put in the new code, and then put back the non-CIRCUITPY version

lapis hemlock
#

@onyx hinge I really don't want to convince you, but we could just include a separate header, if CIRCUITPY is defined. Either way is fine with me.

tulip sleet
#

or if it's not meant to plug into USB most of the time, then it doesn't matter

faint delta
#

@tulip sleet i love that idea. yes it's not meant to even be plugged into USB, but curious users can tap into a usb port inside (not sure 100% on new hardware, but you get the idea) with simple instructions and play around. i appreciate the answer!

bronze shadow
#

If you only need to prevent modification to the code, and not hide the code, you could also use boot.py to mount it as read only (so the device itself can write to disk) but the host OS couldn't.

onyx hinge
#

@lapis hemlock a #if CIRCUITPY section is fine for us too

#

if we ever decide we DO want to vary some things on a per-board basis, though, we'd need to be able to do it via CFLAGS. We can deal with that when the need arises.

lapis hemlock
#

if we ever decide we DO want to vary some things on a per-board basis, though, we'd need to be able to do it via CFLAGS.
@onyx hinge This is actually a good point.

faint delta
#

interesting, circuitpython sounds so flexible. so we're okay to ship products with it. what an amazing future if our devices could just be plugged in and there's the code, in python ๐Ÿ™‚

tulip sleet
#

"The right to repair (or hack)"

#

If/when you do come out with something, let us know and we'll put it in the newsletter, etc.

faint delta
#

will do, he's in a hurry, so will be soon. i wish the NFC feature was implemented on the itsybitsy nrf52840

#

but ill find another way to pair a pair of those securely i guess

#

i figured if i can get this authorization, the USB access to the code.py is indeed an out of band place to share a secret ๐Ÿ™‚

manic glacierBOT
#

This PR adds the ESP-IDF gpio_reset_pin function to the Microcontroller/Pin module's reset_pin_number and reset_all_pins. This should resolve issues where pins would remain connected to previously used peripherals even after soft reboots or de-inits, since the IDF does not alter the pin matrix for most peripheral de-init functions.

Tested on the Saola 1 Wrover with Neopixel and I2C. Any help testing additional applications for unforeseen problems would be appreciated.

ionic elk
#

@analog bridge paused from my other work and gave gpio_reset_pin a spin on a couple of basic tests. Would welcome any testing help if you're interested.

slender iron
#

@tulip sleet have you built nina recently?

#

when I run make firmware it's prompting me to set a bunch of configuration

tulip sleet
#

@slender iron I built it to build the 1.7.1 release. I had various issues like that when the env was not set up perfectly, I think.

slender iron
#

the two IDF variables seem right

tulip sleet
#

i have a python2 virtualenv set up, and before I do a build, I source this script for myself:

export IDF_PATH=$HOME/bin/esp/esp-idf
export PATH=$HOME/bin/esp/xtensa-esp32-elf/bin:$PATH
source ~/bin/py2/bin/activate
PS1="(esp) $PS1"
slender iron
#

ah, my python was 3.8

tulip sleet
#

the esp-idf is 3.3.1. Both this and the ESP32-S2 build put stuff in ~/.espressif

#

not sure if they conflict

#

~/bin/py2 is my virtualenv for python2

#

sounds like you may have it. This was a big headache to get right

slender iron
#

ya, I'm going to take a break

#

the nina firmware needs to report errors back

tulip sleet
#

I set up the virtualenv, then I ran the install script in esp-idf to pip stuff into that py2 virtualenv

slender iron
#

@tulip sleet ok, trying it again with a python2 venv but still getting the config thing

tulip sleet
#

i start with make clean, let me try that. Might have to do make menuconfig, for no good reason.

blissful pollen
#

@slender iron If I rename the busdevice to match the existing library should I change all the filenames, etc. to be "adafruit_bus_device" too?
(I think I have to but still not 100% sure how all this QSTR stuff works yet!)

tulip sleet
#

@slender iron it worked for me after I sourced my script above and did a make clean

slender iron
#

@blissful pollen yes please. it'll work without but it's clearer if they match

#

@tulip sleet looks like it's going after a make menuconfig

tulip sleet
#

๐Ÿคท I find it bizarre

slender iron
#

did you see the md5 that needs updating?

#

I got a build out of it

tulip sleet
#

yah, I submitted a PR for that

slender iron
#

kk

tulip sleet
#

miniesptool, right?

slender iron
#

yup

tulip sleet
#

also I put the md5sum in the release notes

slender iron
#

gonna use it now

tulip sleet
#

why don't we just calculate the md5sum in miniesptool? There's hashlib

#

we could calculate it on the fly

slender iron
#

ยฏ_(ใƒ„)_/ยฏ

#

one more dep?

tulip sleet
#

hashlib is batteries included; doesn't need to be installed

#

I"ll open an issue for that

slender iron
#

on circuitpython?

#

miniesptool runs on circuitpython

tulip sleet
#

oh, sorry, I didn't realize that

#

i thought it was a substitute for esptool.py, not the passthrough

#

well, i created the branch without making a PR. Just made a PR

slender iron
#

kk

#

I can test in a bit. doing my own build atm

analog bridge
#

@ionic elk I can start tests on interrupt and touch based modules.

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

@SwannSchilling the MONSTER M4SK device has two displays built in. But they use SPI busses I believe instead of I2C. You can see an example of the build flag that allows mulitple displays in that devices port directory here: https://github.com/adafruit/circuitpython/blob/main/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.h

I don't have experience using multi-ple screens on any other devices, but perhaps looking over the configuration of this one can get you started on what you need to...

silent cove
#

I added a french layout for Adafruit_CircuitPython_HID with an example
https://github.com/usini/Adafruit_CircuitPython_HID/tree/fr

Test : https://twitter.com/m4dnerd/status/1323997253007278081

{o_o} : Hรฉ salut, je suis un clone de SAMD21 Mini programmรฉ avec @circuitpython!
Je peux รฉcrire avec des caractรจres accentuรฉs
grace ร  รงa --> https://t.co/fmEWsMuLCN ( ยฐ_ยฐ )

onyx hinge
#

@silent cove neat! I hope you'll make a pull request for it

manic glacierBOT
balmy stirrup
#

@prime flower will there be updated adafruit_io_mqtt and adafruit_io_simpletest.py with examples to work with the esp32-s2 rather than just the adafruit_esp32spi? Thanks in advance.

manic glacierBOT
thorny jay
#

I added a french layout for Adafruit_CircuitPython_HID with an example
https://github.com/usini/Adafruit_CircuitPython_HID/tree/fr

Hey @tulip sleet after the German keyboard, you now have a France-French keyboard that want to get into HID. You even have a PR for that. I believe it is time to open the gate or find the proper way to accept such internationalisation. It should be easy for me to do a Belgian-French keyboard (yes there is such a thing) https://github.com/adafruit/Adafruit_CircuitPython_HID/issues/53 (Merci beaucoup monsieur @silent cove)

cursive condor
#

hello here. I'm studying the best way to animate shapes. say a mix between display_shapes and led_animation. So I read the source code and I see a way, but I need advice on the viability of the solution. If I make a subclass of Rect with all the _pixbuffer methods (and internal maths to translate that to the palette and bitmap of the shape), and then pass it to any led_animation object, will it work ? is there any other more obvious way to do something like that ?

manic glacierBOT
#

@FoamyGuy thanks a lot for the Quick Response, and your suggestion! I realized that the MONSTER M4SK has two screens attached, actually I would want to use my to Oleds for kind of the same thing...
They are meant to be for robots eyes!
I just don't know how to compile Circuit Python for the ItsyBitsy M4, I could give it a try...but it might turn out to be frustrating.

I thought maybe I could use the one @darianbjohnson already compiled! Since he said, it took him a while to get the build...

prime flower
#

@balmy stirrup There should be, I may put time aside today or tomorrow to test with an ESP32-S2 Metro

cursive condor
#

(I'd love the outline of a rect to be animated like a circular RGB strip...)

balmy stirrup
#

@prime flower sounds great if you get some working code and would like me to test I can help.

#

I have my Metro ESP32-S2 ready to go.

manic glacierBOT
#

After some bus problems, canio sends packets multiple times instead of just once.

Using the "ack" demo from https://github.com/adafruit/Adafruit_Learning_System_Guides/pull/1293/ start the listener and then the sender and see that everything is in a steady state.

Pull out one of the bus wires and then plug it back in after a second or two.

Notice that now the receiver seems to get each packet 3 times and the receiver seems to get each ACK packet 3 times.

manic glacierBOT
#

@SwannSchilling There are some great resources to help you along if you do end up wanting to give it a try. This guide covers the process very well: https://learn.adafruit.com/building-circuitpython/build-circuitpython. Also there are plenty of helpful folks in the Adafruit Discord, linked in the readme of this repository, who are willing to help you through issues that come up.

I do understand though it can seem a bit daunting if you've never done it. And like with many things that are th...

manic glacierBOT
manic glacierBOT
#

I'm not sure we want to use gpio_pin_reset because 1) it enables pull up and 2) attaches GPIO to the output. (Source) The pull up behavior doesn't match other ports and we may want to switch back to the default pin function such as JTAG.

We definitely should refine this code though. We do want to reset individual pins.

We could store a table of default pin setting information, the way we do for the i...

slender iron
gilded cradle
#

Let me check what's on 378

#

@slender iron It's a different error that I fixed yesterday

slender iron
#

haha, great!

ionic elk
#

@slender iron is there an issue with having peripherals files have the same name as a HAL source file? when including the .h it requires using the peripherals/src.h name. But on other ports, HAL files tend to have a prefix (hdl_adc.h, nrfx_adc.c, stm32fxxxxxx_adc.c), so this is a new case

#

I named the peripherals/rmt file rmt.c and it didn't impact compilation. Is there a best practice here?

manic glacierBOT
slender iron
#

@ionic elk I think the rmt.c style is fine

manic glacierBOT
idle owl
gilded cradle
#

@slender iron, I just ran into this on absolute latest for CircuitPython:

You are in safe mode: something unanticipated happened.
CircuitPython core code crashed hard. Whoops!
MicroPython NLR jump failed. Likely memory corruption.

Is that a known issue?

#

That's on a Feather M4 Express.

#

I don't know, nothing seems corrupt, so maybe nothing to worry about. I think it came about because I2C wasn't being reset on reload and I think I recall an open issue for that.

manic glacierBOT
#

Following up that this still is an issue.

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
main.py output:
Traceback (most recent call last):
  File "main.py", line 8, in <module>
  File "0ฤฐ4|.df2๏ฟฝ3๏ฟฝ๏ฟฝ22๏ฟฝ3๏ฟฝ๏ฟฝ22[_init_coord_mappingkmk/kmk_keyboard.pyany
extensionsany
co", line 4, in <module>
RuntimeError: Corrupt .mpy file

Clean formatting storage with storage.erase_filesystem seems to help for a while. Eventually I have to run that or all fi...

slender iron
#

@slender iron What's the UF2 for the ESP32-S2 on circuitpython.org?
@idle owl We don't have a single file for that yet. It's on my TODO list for this week

idle owl
#

Fair enough.

slender iron
#

@slender iron, I just ran into this on absolute latest for CircuitPython:

You are in safe mode: something unanticipated happened.
CircuitPython core code crashed hard. Whoops!
MicroPython NLR jump failed. Likely memory corruption.

Is that a known issue?
@gilded cradle I've seen reports of this with dual exceptions happening

#

@idle owl I've been sucked into ESP32SPI/Requests issues

manic glacierBOT
idle owl
#

@lone axle Do you have a Feather Sense?

lone axle
#

I do

idle owl
#

Actually it doesn't matter. @lone axle Are you up for updating another lib folder screenshot for me? it's lsm6ds again.

lone axle
#

Yep for sure.

idle owl
#

I think we made you an editor so you can edit all guides, yes?

lone axle
#

Yep that is true. Just double checked as well and it does let me get to the editor. I can update that tonight with a new screenshot and info

idle owl
#

Great! Thank you so much!

slender iron
#

@tulip sleet you around?

tulip sleet
#

@slender iron I am here but am just about to eat dinner. I'll be back in 15 minutes or so

slender iron
#

k, np

tulip sleet
#

@slender iron all done

slender iron
#

I was going to ask you to build a new nina for me but I think I have a workaround

#

the ssl connections don't close automatically on failed write

#

write has no similar check

#

so the new requests leaks memory

tulip sleet
#

is that a bug? or are you allowed to retry? does a non-ssl connection do anything similar?

slender iron
#

the non-ssl version will close

#

I can have the circuitpython esp32spi side close

tulip sleet
#

given the low number of issues in the repo, maybe people are just doing very simple things, and are not recovering on error

slender iron
#

ya, that's my guess too

tulip sleet
#

you are not using WifiSSLCLient.cpp, is that right? So this is a behavior difference between SSL and non-SSL in the firmware? Should we be filing a bug on esp-idf??

slender iron
#

I'm debugging ESP32SPI so I am using it

tulip sleet
#

ah ok, I thought this was the ESP32S2 requests library issue. So does our Python library need to do the same thing?

slender iron
#

it is possible our native code has the same issue

#

but I can only debug so much at once ๐Ÿ™‚

tulip sleet
#

why would be getting write errors in the typical case, though? (and why did you see it?)

slender iron
#

they happen when we try to reuse an old socket

#

reusing sockets is new in requests 1.7

tulip sleet
#

got it

slender iron
#

the old version would just close right away

tulip sleet
#

i also don't understand why you are having build troubles. maybe at some point we can exchange local repo trees and compare

slender iron
#

I did manage to build but it didn't seem to work correctly

tulip sleet
slender iron
#

ah, it's pending

slender iron
#

oops

#

want to talk sleep?

tulip sleet
#

@slender iron missed your msg above. Too tired to talk sleep ๐Ÿ™ƒ ๐Ÿ’ค but will catch you tomw

lone axle
#

How does the PyPortal Pynt build get made? it's listed on the downloads page but seems to be missing from ports/atmel-samd/boards/

tulip sleet
#

@lone axle it is just an alias for the PyPortal build. The UF2's are identical.

lone axle
#

Ah, thank you

manic glacierBOT
#

@FoamyGuy thank you so very much...you saved me!! Everything is working out great! I really like displayio, and was a little bummed out, that it did not let me use two displays, but now it all works like a charm!! :)

One thing I noticed, it seems like the allowed memory size of a bitmap is reduced?

Also I can see quiet a bit of performance drop... those screens are I2C at the moment, I will give it a try using SPI later!

Is there any way to reuse the group/sprite on the second screen...

manic glacierBOT
#

Nice. I'm glad that it worked out for you.

I'm not sure about the allowed memory size of a bitmap. But you do probably have less memory to play with overall for your project since you'll need to keep 2 of some objects instead of 1.

On the Monster M4sk I played with it for a bit and figured out that you can use the same Bitmap object, but I think you need different TileGrids and different Groups for each screen.

I didn't find a way within CircuitPython user code to only generate ...

haughty holly
#

Matrix portal

manic glacierBOT
manic glacierBOT
#

This PR is not very elegant. But, in its defense, the following fixes were tried without success:

  1. I tried to find a way to interrupt or terminate vTaskDelayUntil(). However, nothing I found was able to do that. Trying to
    do anything about the sleep state during another interrupt handler (such as ticks or usb) generally resulted in either a
    complete hang or did nothing.
  2. The esp32s2 light sleep state was investigated. However, any light sleep past about 1 second resulted in th...
meager fog
#

@ionic elk hihi

manic glacierBOT
slender iron
#

@gilded cradle you around today and want to test my requests/esp32spi changes?

gilded cradle
#

Sure

#

What's the PR?

slender iron
#

for esp32spi

gilded cradle
#

thanks, I'll give it a try as soon as I finish up the guide I'm working on.

slender iron
#

k, thanks! I've got email to do before I get to it too

cursive condor
#

so ... I managed to have a rect as argument for a led_animation blink()... it's very rough, but my new class make a rect behave (enough) like a neopixel stripe ๐Ÿ˜„

#

no question here (for now), just a public hurray before I test the other animations. ๐Ÿ˜‰

manic glacierBOT
#

I think you could invert the API you need from FreeRTOS. Instead of using a time delay API, use one that is blocked on inter-task flag with a time out. xEventGroupWaitBits is what you'd need I think. https://www.freertos.org/xEventGroupWaitBits.html Then, share a group of event bits with TinyUSB callbacks that can indicate a ctrl-c. Then wait on the event bit while timing out with the sleep time.

ionic elk
#

@meager fog Hi, what's up?

ionic elk
#

D:

ornate breach
#

I've been waiting to use that GIF for a long time

ionic elk
#

Oh shoot I misread and thought it was sent at 2 something

#

yes I am late whoops

ornate breach
#

lol

#

I'm sure she just has another grand quest for you

#

๐Ÿ™‚

#

(lucky! ๐Ÿ™‚ )

#

hehe...

ionic elk
#

Discord is tough for me because I have lots of non-work friend message traffic on it, so I don't want to enable it on my phone, but I also miss work messages sometimes which is no good

ornate breach
#

it's too bad you can't mute those conversations and have notifications for specific people available

ionic elk
#

well, it's also just the temptation. I keep pretty strict device hygiene.

ornate breach
#

probably a good idea

#

I need better device hygiene

ionic elk
#

You should try my off-work project lol. It's a box that makes you check out your distraction devices and screeches at you if you don't return them on time

ornate breach
#

hahaha, sounds like something my whole house needs

analog bridge
#

does autoreload on save call module specific deinit functions ?

ionic elk
#

@analog bridge typically no, just module-wide reset_all

#

Almost no functionality I've encountered calls a de-init, I've only ever seen it in user code

#

They aren't required for soft reboots because the entire heap is reset

#

(unless they have a never_reset, of course. You'd have to poke Scott or Dan about the details, I'm a little fuzzy)

idle wharf
#

Since the libraries and tools don't show up here, thought I'd mention that the combo of PRs for Circup #40 & #41 look good to go.

#

I wanted to ask about something else circup related.
I was playing around on my brand new MetroS2 and which did not have a /Volumes/CIRCUITPY/lib folder. Without that folder, circup install fails... we could fix that in circup, but I wonder if CP builds should create an empty lib folder since the general guidance is to put libraries in that place.

manic glacierBOT
#

That sounds like a better fix than a clumsy loop. I will investigate and
see what I can do with the suggestion.

On Thu, Nov 5, 2020 at 1:01 PM Scott Shawcroft notifications@github.com
wrote:

I think you could invert the API you need from FreeRTOS. Instead of using
a time delay API, use one that is blocked on inter-task flag with a time
out. xEventGroupWaitBits is what you'd need I think.
https://www.freertos.org/xEventGroupWaitBits.html Then, share a group of
event bits with Tin...

slender iron
#

@idle wharf I think the lib folder should be auto-created. there is a bit of weirdness with the flash though that is also causing some folks to see NO NAME

#

my guess is that they're related issues

lone axle
#

I noticed that my Metro ESP32-S2 shows up with the storage space as it's name

slender iron
#

yup, that's how linux shows it I think

#

NO NAME is mac iirc

bronze shadow
#

It's not shown on all linux file explorers. If you check with command line tools, they are still correct on Linux as a heads p.

idle wharf
#

I see CIRCUITPY on my mac... with the MetroS2
I'll do a PR to circup so install won't fail if people delete /lib

manic glacierBOT
gilded cradle
#

@onyx hinge was it you who wrote sdcardio?

onyx hinge
#

@gilded cradle yup, what's up?

gilded cradle
#

I'm trying to use it on PyPortal, but am getting spi in use (probably due to the display). Do you know a workaround?

onyx hinge
#

you mean with the pyportal lib?

gilded cradle
#

Um, no. I was trying to use it outside of it. Perhaps I'm doing it wrong?

onyx hinge
#

oh right because the board constructs the display automatically

#

what code would you write to use the adafruit_sdcard?

gilded cradle
#

I was just trying to mount it.

#
import sdcardio
import storage
sdcard = sdcardio.SDCard(board.SPI(), board.SD_CS)
vfs = storage.VfsFat(sdcard)
storage.mount(vfs, "/sd")
onyx hinge
#

is the error when you call board.SPI() ?

#

maybe separate it out to 2 lines for clarity

gilded cradle
#

Ok, I think it's because PyPortal is already mounting it. I think you pointed me in the right direction.

#

Thanks

onyx hinge
gilded cradle
#

Yeah, I see the code now. I just missed it in the huge amount of code. Thanks

#

Probably should have searched first

onyx hinge
#

you're un-stuck? good!

gilded cradle
#

yeah, I believe so

#

I'm just going to use it through the library.

#

Yeah, totally unstuck

onyx hinge
#

weirdly another friend of mine just asked me a pyportal question. I really wish I could get them to join this discord and get help in #help-with-circuitpython !

#

but you know how it is when you're someone's personal support ๐Ÿ™‚

manic glacierBOT
simple pulsar
#

@idle owl For the images of file system trees for libraries in the guides, has there been any discussion on generating those with some javascript magic? That would make it easier and quicker to update them - it could generate both Mac and Windows look

manic glacierBOT
#

I might have also been confused, and saved the bitmap in a bigger version...it does not matter too much anyways, I will figure out which size is good for quality vs performance tradeoff! ๐Ÿ˜ธ

I actually did all of the above, I loaded in one bitmap using the adafruit_imageload and one TileGrid/Group for each screen. Also I reduced the bitmap size and scaled the group!

I am kind of thinking the performance drop is rather due to the limitations of I2C speed than bitmap size...but lets see!
...

onyx hinge
#

I'm seeing weirdness on my metro esp32s2 ... it doesn't actually import an import, and then it reboots itself. ```
Adafruit CircuitPython 6.0.0-rc.1 on 2020-11-03; Metro ESP32S2 with ESP32S2

import adafruit_ahtx0
adafrui_ahtx0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'adafrui_ahtx0' is not defined
import adafruit_ahtx0

[tio 16:03:16] Disconnected

#

and now it's made my host computer's usb lock up

#

the NameError was a typo on that run but even if I get the name "right" it's a NameError

#

adafruit_ahtx0.mpy is from the latest 6.x bundle, as is adafruit_busdevice. I didn't copy adafruit_register so maybe an importerror is occurring but is being obscured?

tulip sleet
#

@onyx hinge maybe try erasing the filesystem and recopying, in case there is some corruption (people are not seeing CIRCUITPY but some unnmaed drive).

#

@slender iron we could discuss deep sleep sometime in the next few hours if you're available

slender iron
#

@tulip sleet how about in 15 minutes? Just wrapping a late lunch

onyx hinge
#

no change with a fresh filesystem (storage.erase_filesystem()) and if I make sure adafruit_register is copied (not sure if important). ```Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 6.0.0-rc.1 on 2020-11-03; Metro ESP32S2 with ESP32S2

import adafruit_ahtx0
adafruit_ahtx0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'adafruit_ahtx0' is not defined
import adafruit_ahtx0

[tio 16:15:59] Disconnected
[tio 16:16:01] Connected
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

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

#

it's not entering safe mode either, it's rebooting in normal mode

tulip sleet
#

@slender iron sure, ping me. I am going to get a 3d print started

slender iron
#

Kk

manic glacierBOT
#
  1. Load 6.0.0-rc1 via esptool
  2. storage.erase_filesystem()
  3. Copy adafruit_ahtx0.mpy and adafruit_bus_device to CIRCUITPY/lib -- I used adafruit-circuitpython-bundle-6.x-mpy-20201105.zip the latest at time of writing.
  4. At the repl, try to import/use it. Somehow the import appears to succeed, but the imported module still doesn't exist. Trying to import it a second time does a reset that bypasses safe mode.
    Note: Repeating these steps also tends to trigger the Linux USB...
slender iron
#

I'm ready when you are

#

in amelia earhart

tulip sleet
#

just reading the relevant issues

lone axle
#

@simple pulsar do you mean creating "fake" ones that look like file browsers but are actually HTML / CSS rendered pages?

#

Or something more like seeing the real list of files but inside of a web browser or and then screenshot it?

#

I'm thinking must be the former the more I think about it. That is a nifty idea. It could parse a JSON list and generate the folder / file icon automatically based on whether that item has .mpy at the end.

#

Is there any functional difference (or preference within our code style) between importing things with uppercase letters on the module?

from adafruit_lsm6ds.LSM6DSOX import LSM6DSOX

vs.

from adafruit_lsm6ds.lsm6dsox import LSM6DSOX
#

I would have expected only the latter to work since the name of the file is lsm6dsox.py but it seems that both do work correctly.

manic glacierBOT
onyx hinge
#

@lone axle FAT filesystem is case insensitive, but you should try to use the way the filename appears on GitHub or on a host computer

cursive condor
#

Everything is working ... I'm quite proud XD

#

you draw a rect and use it like a neopixel strip.

#

I plan to make the whole kit of shapes, with lines also.

#

and I hope it can be integrated to the matrixportal object, like the scrolling text label to animate everything smoothly

lone axle
#

This looks awesome! thank you for sharing it. I am going to play around with it here in a little bit.

cursive condor
#

there is a lot of work left to do, but the PoC is here ๐Ÿ˜„

thorny jay
#

there is a lot of work left to do, but the PoC is here ๐Ÿ˜„
@cursive condor I still need to study your code to understand that, but this seems great. I am interested in using palette to do something similar. Basically you draw an image, but you use each palette index as a neopixel and change it's color.

cursive condor
#

yes I use the palette, because my shape is an indexed BMP, after all. my goal was to be able to animate the ball or the goal of my maze game for matrixportal, so the object used must be a tilegrid I can add to a displayio group

#

long story short, here you have animated shapes (anisha), any help is welcome ๐Ÿ˜‰

#

and I must say a lot of the code is copied from various libs from adafruit. I just made the links between 2 of them

lone axle
#

@cursive condor do you know what could be causing the "No more color available" error?

#

I get that from comet, rainbow_sparkle, and chase. Not with blink though that one is working.

cursive condor
#

you can set the colors argument when you initialize the Arect object

#

with 128 colors it's ok for all the animations of the full example

lone axle
#

I am trying to run it through my PyGameDisplay for Blinka_Displayio (admittedly outside the scope of what you've built it to run on ๐Ÿ˜„) I am getting that error even with color=128

#

there must be something different about how Blinka_Displayio is handling the colors or something

cursive condor
#

try 256

lone axle
#

I tried increasing to color=512 but still get the same error

#

same with 256

cursive condor
#

of course

lone axle
#

I notice the all of the prints except index 0 and 1 are the same. They are all:

106  :  {'transparent': False, 'rgb888': 0, 'rgba': (0, 0, 0, 255)}
#

0 and 1 are like this:

0  :  {'transparent': True, 'rgb888': 0, 'rgba': (0, 0, 0, 0)}
1  :  {'transparent': False, 'rgb888': 16384, 'rgba': (0, 64, 0, 255)}
cursive condor
#

strange ... so the problem is that self._palette_index() does not find the color when it search the palette

#

but it can find it when it's not initialised (return 0 == 0x000000 == BLACK)

lone axle
#

Could be a difference in python possibly as well. I am running with CPython 3.8.5 I'll poke around the _palette_index() and see if I can figure out why it's not finding the colors.

cursive condor
#

if the palette object behave differently, perhaps is there a method to get the index from color directly ?

lone axle
cursive condor
#

not exactly ๐Ÿ˜ฆ

lone axle
#

I'm thinking something in my matrix configuration may have gotten out of whack or something.

#

it should be full unbroken rectangle right?

cursive condor
#

how a Rect (without the A) is showing with the same dimensions ?

#

yes it should be a square, 30x30 stroke=2

lone axle
#

Alright now it's okay

#

my matrix portal had gotten slightly unplugged. The 2x8 was not as snug as it should be.

#

This is really cool!

cursive condor
#

yeah, but I dont like the corners when stroke > 1

#

I'm sure I can do better (reminds me of the turtle lib, on several sides)

lone axle
#

some of these would make really great "frames" to use around the edge of the display with other information inside.

cursive condor
#

yep

#

and seconds tracking for clocks

lone axle
#

oooh nice

cursive condor
#

I see also "loading bars" or "waiting animations"

lone axle
#

Thank you for creating this and sharing it ๐Ÿ™‚

cursive condor
#

among an infinity of possibilities

#

๐Ÿ˜Š

#

did you see you can use the whole rect as a "line" of pixels, (with animation_mode args to horizontal or vertical) instead of being circular ?

#

not tested yet, but I don't see why this would not work

#

punching off, good night ! TY @lone axle for the test ๐Ÿ˜„

lone axle
#

see ya. and you bet, thanks again for sharing!

slender iron
manic glacierBOT
orchid basinBOT
solar whale
#

Does the feather_m0_basic ship with a UF2 bootloader?

stuck elbow
#

I have some that shipped with the bossa bootloader, but they are old

#

in fact, I bricked one trying to switch the bootloader to uf2

solar whale
#

That is my concern -- trying to respond to a Forum question

lone axle
#

This may be a good 'in the weeds' topic. A lot of new folks who are new to displayio are getting some of their earliest experiences with a Matrix Portal now instead of PyPortal, PyGamer etc.. devices with more traditional screens.

Many of the existing examples for displayio in guides and library repos use board.DISPLAY which won't work on the Matrix Portal.

Are there any thoughts on whether we want to include extra examples tweaked to work with Matrix Portal, or keep them in the same file with comment/uncomment chunks? Or is there some other generalized technical approach that could allow examples to work on both without the end user having to worry about it if they don't want to?

tidal kiln
#

the guide talks about built-in vs. external displays, but that's separate from the examples

#

maybe look at updating the guide to better explain that? add boiler plate for RGB matrix?

#

using the Matrix Portal library, it's pretty easy

from adafruit_matrixportal.matrix import Matrix
matrix = Matrix( stuff )
display = matrix.display
thorny jay
#

I have a week off next week, in second wave confinement... and I was checking if I could revive my work on PM25. I would like a review of https://github.com/adafruit/Adafruit_CircuitPython_PM25/pull/8 and know if something is expected from me in this PR.
I am a bit lost on what is the status.

tulip sleet
#

btw, Monsoon meter is discontinued

thorny jay
#

Flemish. I am Belgian, I might be able to partially understand that!

tulip sleet
#

Google Translate is my friend :). I have been translating select pieces

#

The most interesting thing about it at the moment is the list above, which is more comprehensive than anything else I've seen

#

the Nordic device is quite nice for the price, but unfortunately the first three devices only go to < 100ma, and the ESP32S2 can draw much more than that, especially when transmitting wifi

cursive condor
#

So I have my shape animated. now I'm testing the group animations, turn out I can manage 4 shapes, with around 10 animations for each. more animations give a memory error. And the rainbow* ones requires the most memory...

#

but they are not sync, as I only supported "direct write" to the shapes, and I wonder how I can mimic the write() behaviour...

#

double buffering seems wasting a lot of memory...

tidal kiln
#

@lone axle are the examples being used the ones shown in the displayio guide? or from somewhere else?

lone axle
#

there are similar examples in display_shapes, adafruit_imageload, adafruit_progressbar and perhaps some others.

cursive condor
#

mmmmm progressbar ? I missed that

tidal kiln
#

i think it would be good to update the displayio guide

#

for the examples, it's tricky. a trade off of keeping the example clean vs. a bunch of commented out stubs for all possible scenarios

#

similar issue with sensors that can be I2C / SPI and hardware/software versions of each

#

probably should at least add code comments to those examples though

#
# example for use with board with built in display
#

or some such

lone axle
#

Yeah, I think I like seperate files for them instead of the comment chunks.

thorny jay
#

I have a week off next week, in second wave confinement... and I was checking if I could revive my work on PM25.
@thorny jay Thank you to @lone axle that found one more learn guide that depend on PM25.

lone axle
#

I can work on adding comments to the existing ones and making matrix portal versions of the ones that make sense on that size screen.

tidal kiln
#

ok. i'll take a look at updating the displayio guide.

#

could maybe have a new dedicated page that discusses display setup for various hardware configs

lone axle
#

I wonder if it's worth making up a single page that covers generally "how to convert code from built-in display to matrix portal"

tidal kiln
#

it could be more general

#

like how to create the display instance

#

then the rest of the code should (hopefully) just work

lone axle
#

Yeah, I think it will help out if we can try to consistently use a display variable in examples. It can be set to board.DISPLAY for devices with built-in.

tidal kiln
#

yah, that could help also

lone axle
#

isntead of referencing board.DISPLAY directly throughout the example. I am definitely guilty of this. But with a variable it will make it much easier to swap back and forth.

tidal kiln
#

yep. and easier to understand.

#
display =
#

the right hand side needs to be whatever for your setup (guide would cover that)

gilded cradle
#

@slender iron let me know when you're back online and we can work on testing/debugging requests and esp32spi.

tidal kiln
#

but then can just use display in same general way in rest of code

#
# use built in display
# see guide (url maybe?) for setting up external displays
display = board.DISPLAY
lone axle
#

yep. Nice! I like the idea of linking it there in the examples.

tidal kiln
#

or even more informative?

# use built in display (PyPortal, PyGamer, PyBadge, CLUE, etc.)
# see guide for setting up external displays (TFT / OLED breakouts, RGB matrices, etc.)
#

want to bring this up at the next in-the-weeds? suggest above. see if there is general consensus, etc.

manic glacierBOT
#

With the below code on the CIRCUITPY drive, you can put the board in to a bad state where the disk won't mount and the tty device doesn't show up, even with the board unplugged from the matrix. Tested with adafruit-circuitpython-matrixportal_m4-en_US-6.0.0-rc.1.uf2

import board
import displayio
import framebufferio
import rgbmatrix

displayio.release_displays()

matrix = rgbmatrix.RGBMatrix(
    width=64, bit_depth=0,
    rgb_pins=[
        board.MTX_R1,
        board...
lone axle
#

@tidal kiln yep will do. I'll add it to the notes doc in a moment.

slender iron
#

@gilded cradle I'm at my desk now

gilded cradle
#

Cool, me too @slender iron ๐Ÿ™‚

slender iron
#

@gilded cradle do we want esp32spi to work on its own?

#

the OSError 23 will cause a retry with the newest requests

gilded cradle
#

Do you know if there are any instances where it doesn't use requests?

slender iron
#

no, you'd have a better idea than I would

#

maybe mqtt?

gilded cradle
#

Yeah, possibly. It would be nice if the esp32spi still worked with requests 1.6.0 until we have a solid fix in place.

#

I haven't tested it out, so it may work at the moment.

slender iron
#

it may be the change of RuntimeError("No sockets available") to OSError(23)

#

if the calling code only tests for RuntimeError

gilded cradle
#

Yeah, that was my concern with backwards compatibility.

slender iron
#

I wouldn't expect to hit the other instance

#

with requests 1.6.0

gilded cradle
#

Like can we have newer versions of requests set a flag that causes it to return an OSError and just return a RuntimeError otherwise? Then when we have a solid fix in place, we can remove the flag.

slender iron
#

ya, I suppose we could

gilded cradle
#

I see a new pr you just submitted. I'll give that a try.

slender iron
#

those are the requests changes

gilded cradle
#

yeah

#

I want to see how well these work together. If they seem to be reliable then we probably don't need to worry about the flag option.

#

Ok, it's getting hung up on a content length missing error (for images). I'm thinking something was fixed and the error is in the pyportal library. Let me see if I can figure out a workaround, but this is looking promising.

#

@slender iron are the headers getting cleared between calls?

#

Cause it's returning a json header for the image url.

slender iron
#

it should be separate response objects

#

want to screen share with me? I don't have a ton of context about what you are testing with

manic glacierBOT
#

Using this test program on a metro_esp32s2 with freshly built main and freshly downloaded adafruit_requests

import ipaddress
import wifi
import adafruit_requests
import time
import ssl
import socketpool

print(wifi.radio.connect('', '))

print('ip', wifi.radio.ipv4_address)

ipv4 = ipaddress.ip_address('8.8.8.8')
print('ping', wifi.radio.ping(ipv4))

pool = socketpool.SocketPool(wifi.radio)

https = adafruit_requests.Session(pool, ssl.create_default_context())




...
gilded cradle
#

Sure, just a sec... as soon as I figure out how.

manic glacierBOT
#

another example that always produces an SSL handshake erro is:

import ipaddress
import wifi
import socketpool
import time
import adafruit_requests
import ssl
import espidf

import gc

print("cp mem free", gc.mem_free())

print("idf total mem", espidf.heap_caps_get_total_size())
print("idf mem free", espidf.heap_caps_get_free_size())
print("idf largest block", espidf.heap_caps_get_largest_free_block())

for network in wifi.radio.start_scanning_networks():
    print(netwo...
#

@dhalbert Apologies if I missed it, but is there a similar ticket for mass storage? It's pretty much expected that when I start using my computer in the morning, if I had a board (Feather M4 for sure, Metro M4 likely, nRF possibly as well) plugged in and running the night before it will run and have CDC working (in the same terminal window but I won't have a CIRCUITPY drive until I reset the board.

manic glacierBOT
manic glacierBOT
#

My particular application is as follows - every 8 ms, the master device initiates a transaction and begins shifting bytes of data over to the peripheral. The peripheral is expected to have staged a return packet as well, which it sends in return. Then the CS is returned to high and the peripheral is expected to gather all the information it needs for the next packet, which in this case is acquiring and staging hardware inputs, handling errors, and loading everything into the output buffer, al...

#

I tested this successfully with Feather Sense using some of the on-board sensors:

accel_gyro = LSM6DS(board.I2C())
mag = LIS3MDL(board.I2C())

I took adafruit_bus_device out of lib folder. Confirmed that it crashes on 6.0.0-rc.1 due to missing the library.

Installed the uf2 built from this PR and it's working properly to read values from both sensors. :tada: This is awesome! Thank you for working on it @gamblor21

lone sandalBOT
meager fog
#

@tidal kiln @ionic elk hihi either of you here?

lone sandalBOT
tidal kiln
#

@meager fog here now

ionic elk
#

@meager fog you still on?

manic glacierBOT
#

I was able to reproduce this on a Kaluga with a release and a debug build.

I (630108) gpio: GPIO[45]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.

Core  0 register dump:
PC      : 0x4008d4de  PS      : 0x00060430  A0      : 0x8008eb0f  A1      : 0x3ffdbb40
A2      : 0x00000006  A3      : 0x72666164  A4      : 0x3ffdba00  A5      : 0x3f00bc94
A6      : 0x00000000  A7      ...
thorny jay
#

"Thanks for the note! We are not currently offering "As seen on show and Tell" Stickers." ๐Ÿ˜ฆ

#

Why is the MagTag (4800) logo (and all the picture from the product) Black and white if that is Grey Scale eInk screen??? The FeatherWing (4777) has an Adabot logo that is grey scale and this is clear in all the picture!

manic glacierBOT
#

HI Richard,
If you haven't gotten this working here is a link to my various board files for what I believe is the same board. I also tested the board with some CircuitPython code to drive the display. I'll have to search around and see if I can find that, I probably just used the driver Scott mentioned above
https://github.com/skieast/circuitpython/tree/main-copy/ports/esp32s2/boards/lilygo_ttgo_t8_s2

https://gist.github.com/skieast/8c00274f557113cad4d5d377cfd57a9d

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Hi @jerryneedell,

I've tried this now for a number of hours and my adafruit_requests.py looks like a collection of print() statements. :D
I tried the same URL, but I have a different result:

RuntimeError: Sending request failed

The same code runs just fine for https://httpbin.org/get fails with the above for https://api.thingspeak.com/channels/1417/feeds.json?results=1

Are you on Adafruit_CircuitPython_Requests 1.7.5?

I noticed that DNS resolution gives two IPs for api.things...

hearty tapir
#

Tried to figure out what is wrong and now came here to find my own message. ๐Ÿ˜„ Great! ๐Ÿ™‚

timber mango
#

Working on the AdaBox 016 Weather display output ... Had problems with that 'Failed to send' ... Watched Deep Dive yesterday & saw the Request code update ... Loaded fix to my Display & viola, ran all night & still running ... Thanks Scott ... Actually beginning to follow what y'all R talking about in the chat ... (Last coding I did was back n the '80's ... Stopped coding B4 C & follow-ons ... Circuit Python has got me interested again but this Septuagenerian brain is struggling 2 keep up with you young 'whipper-snappers' ! ... lol)

manic glacierBOT
orchid basinBOT
manic glacierBOT
lime trellis
#

Hey CP team! Wanted to let you know your hard work is appreciated and does make a difference โค๏ธ At least FOUR spacecraft ๐Ÿ›ฐ๏ธ running CircuitPython (5.4.1) via "PyCubed" boards are launching next month! ๐ŸŽ‰ ๐Ÿš€

All hardware AND software repos will be public as soon as I get NASA's blessing. In the meantime, here's a teaser pic I put together

manic glacierBOT
#

I am looking to be able to hotplug an I2C device into my board. The normal method of scanning the entire I2C address space takes a bit too long for my liking and there does not seem to be a simple method to check for the presence of a single device. To get around this, I wrote a function to just scan for something at a specific address:

def I2C_checkDev(i2c, *args):
    for addr in args:
        if isinstance(addr, int) and (0 <= addr <= 0x7F):
            try:
                i2c...
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I set up a CPY build environment on Win10 WSL and, after a long night of disappointments, I could compile featherS2 UF2 builds this morning (actually noon + coffee). Unfortunately, even two different attempts of setting different certificate bundle options in menuconfig didn't lead to success. https to api.github.com & httpbin.org is OK; https to api.thingspeak.com & io.adafruit.com is NOK.

![menuconfig](https://user-images.githubusercontent.com/5174414/98466137-e6da2380-21cd-11eb-8c1a-ce...

manic glacierBOT
#

I found a reliable way to crash my Pi4:

#

This example code illustrates the issue:

import board
import terminalio
import displayio
import time
from adafruit_display_text import label
from adafruit_display_shapes.circle import Circle

display = board.DISPLAY
main_group = displayio.Group()

circle = Circle(100, 100, 20, fill=0x00FF00, outline=0xFF00FF)
main_group.append(circle)

text = "Hello world"
text_area = label.Label(terminalio.FONT, text=text)
text_area.x = 10
text_area.y = 10

main_group.append(tex...
lone axle
#

Is it possible to add print statements in C code in the core and see them get printed out in the serial console?

stuck elbow
#

yeah, see mp_printf()

lone axle
#

Thank you

#

How do I get the value of variables to print? I have code like this:

mp_printf(&mp_plat_print, "setting hidden %s - %s\n", i, hidden);

but print statements turn out like this:

setting hidden ร รŸ - ร รŸ
setting hidden รŸ - ร รŸ
#

ah, I see %d fixes the i one I probably need something for booleans on the last one.

stuck elbow
#

iirc booleans are ints

lone axle
#

Ah nice, yeah that prints the boolean values for me. Thank you.

#

I noticed it's much faster to make a build if I don't delete the old build-pyportal (or whatever device) folder. And it does seem that the new UF2s are containing my changes. Is there any reason that I should be deleting that and starting fresh each time? or is it okay to leave it around to cut the build time down

cursive condor
#

as a long time gentoo user, so compiling a lot, keeping the old build / cache data indeed speeds up the next compilation, and I only know some versions of PHP that were a pain in the *** with make clean mandatory if you change something in the config. so I would say : keep it unless unexpected results occur.

manic glacierBOT
#

Looking into this a bit I added some print statements inside of common_hal_displayio_group_set_hidden and displayio_group_set_hidden_by_parent These are the changes: adding_prints.patch.txt

The printouts look the same every time. But now the first circle and the label do become visible about half the time if I restart several times in a row with ctrl-C and ctrl-D.

Perhaps there is a race condition so...

manic glacierBOT
#

If the object position is updated after being un-hidden it will become visible correctly. i.e. from the example above if you modify the end of it like this:

circle = Circle(200, 100, 20, fill=0x0000FF, outline=0xFF00FF)
main_group.append(circle)
circle.x = circle.x + 1
while True:
    pass

then the original (green) circle will be visible at the end of the program every time. With the code like this the label still remains invisible about half of the time.

cobalt grail
#

I was checking out issue 3336 when I discovered this behaviour.

Adafruit CircuitPython 6.0.0-rc.1 on 2020-11-03; FeatherS2 with ESP32S2
>>> import adafruit_bitbangio
>>> import adafruit_bitbangio
Traceback (senaste anrop):
  Fil "<stdin>", rad 1
SyntaxError: ogiltig syntax
>>> import adafruit_bitbangio
[Disconnected]
[Connected]```
#

Second attempt to import something already imported gives a nonsense error message, and the third attempt crashes CircuitPython.

manic glacierBOT
manic glacierBOT
#
[adafruit/circuitpython] New branch created: unhiding\_tilegrids
lone axle
#

@idle owl, @slender iron, or @onyx hinge I just realized that I accidentally created and pushed to a branch in the adafruit/circuitpython repo insteado f my own. Very sorry. To the best of my knowledge I did not touch anything in any important branches.

manic glacierBOT
slender iron
#

@lone axle no worries! We have branch protections enabled for the ones we care about (main and *.x)

manic glacierBOT
#

Support for msgpack (https://msgpack.org/) encoding/decoding. Like json, but binary encoding.

Example:

import msgpack
from io import StringIO

objs = [
    ( True, False, None, 0, 1, -1, 'abc' ),
    { 'a': 1, 'b': (2, 3) },
    123,
    'abc',
    1.2345,
    ( 1, 'abc', 5.3 ),
    {
        "a tuple": (1, 42, 3.141, 1337, "help"),
        "a string": "bla",
        "another dict": {"foo": "bar", "key": "value", "the answer": 42}
    },
    tuple(range(50)),
]

f...
manic glacierBOT
manic glacierBOT
#

I've managed to come up with a way to consistently get corruption. I've frozen in as many modules as I could to fill up the primary storage. My custom circuitpython image is at 1.1MB. Adding only a few small files onto the CIRCUITPY drive and I consistently see corruption very often. Hopefully this will help you reproduce this more quickly to see what is causing the issue. I can send over the U2F for the nice_nano as well that I used to trigger this as well if it is at all helpful.

hoary hill
#

Hope this is a correct place to ask: does Sparkfun's Artemis board have CircuitPython support yet, I seem can't find it over circuitpython.org? If not yet, are there plans or anyone working on it? Thank you.

bronze shadow
#

If you can't find a download, it likely isn't. I don't believe that any ARM M4F boards can run Circuitpython, though porting is of coruse possible.

manic glacierBOT
onyx hinge
#

@hoary hill The Artemis does not have USB host support, so CircuitPython will not be available for it. (I'm bummed too)

#

@lone axle do you need one of us to delete that branch for you?

lone axle
#

I think I can delete it but didn't want to touch anything else until I was sure that is what should be done

#

Yep, got it deleted with no issue.

blissful palm
#

Sorry forgive me I haven't been following the UF2 stuff (been tied up in board design), will that bootloader enable CP and Arduino (or C - RTOS) to be booted into from the same Flash on ESP32-S2 ports?

tulip sleet
#

If you can't find a download, it likely isn't. I don't believe that any ARM M4F boards can run Circuitpython, though porting is of coruse possible.
@bronze shadow The SAMD51 and nRF52840 and other chips we support are ARM M4F.

orchid basinBOT
manic glacierBOT
onyx hinge
#

If you see JTAG errors (โ€ฆall ones/โ€ฆall zeroes) please check your connections, whether no other signals are connected to JTAG besides ESP32-S2โ€™s pins, and see if everything is powered on.
This is exactly what's I'm seeing. I've got a Kaluga and the only pins connected are 19/20 for native USB. Both built in USB ports are connected (power and usb) and the device works normally (circuitpython on native USB) Any advice?

Open On-Chip Debugger  v0.10.0-esp32-20200709 (2020-07-09-08:54)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi_tdo_sample_edge falling"
Info : clock speed 20000 kHz
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
sacred moth
#

Hello all, wondering if you could help a NOOB here get started. I don't seem able to get past square 1! I have a Circuit Playground Bluefruit attached now to a TFT Gizmo from Adafruit. Copying in their code from a tutorial and loading, I get absolutely nothing. CIRCUITPY mounts into when connected, but using "Mu" for the code and even when I click on "Serial" to access the REPL, it says cannot find an attached device.

tidal kiln
idle owl
#

@simple pulsar There has been no discussion to that end. I personally have no idea how to do it. I haven't done anything with javascript. It wouldn't even need to have both Windows and Mac, it simply needs to look like a file explorer - we don't put both in when we create them, we put in the OS of whomever generated the screenshot. If this is something you could put together as a proof of concept, I'd be willing to look into it. It would have to be simple enough for folks who aren't programmers first to be able to do it. Many of our more crafty folks put together guides with those images in them. So if it involves a crazy environment setup or something, it's kind of out.

manic glacierBOT
#

Is the code you're running using microcontroller.nvm or doing BLE pairing?
The code does run bluetooth pairing, but no microcontroller.nvm usage.

There is only 1MB of flash on the nRF52840! So I'm not sure why it's not catching that your image is too big. Even before this experiment of adding additional frozen modules, did you have some frozen modules?
I was referring the UF2 size, my apologizes. This issues was opened using only stock Circuitpython, downloaded from the official site.

manic glacierBOT
#

Thank you ladyada, that is a nice solution. Testing by device creation instead of a byte-read attempt makes sense. In either case the user simply has to catch the exception if the device is not connected. Additionally, calling I2CDevice(i2c, addr) certainly makes for more readable code than calling i2c._i2c._i2c_bus.read_byte(addr). My testing indicates I2CDevice() is also quite fast, so no problem there. I have much to learn.

orchid basinBOT
onyx hinge
#

Hi <@&356864093652516868> -- the weekly meeting is coming up in a bit. Please add your notes to the doc if possible. We'll be with you shortly!

manic glacierBOT
modern wing
#

Good afternoon all you wonderful folks -- happily lurking. Notes doc updated accordingly. Lapsang Souchong tea also updated accordingly.

trim elm
#

lurking

solar whale
#

@sterile shuttle -- I think you are new here -- Do you want to be able to speak during the meeting?

balmy stirrup
#

Yes

thorny jay
#

lurking (notes up to date)

tidal kiln
#

lurking (but may decloak for in the weeds)

turbid radish
#

Lurkin'

modern wing
#

๐Ÿ™‚

thorny jay
#

morning?

onyx hinge
gilded cradle
#

Adafruit parts also make great gifts

turbid radish
onyx hinge
old smelt
#

Lurking

modern wing
#

@gilded cradle I quickly read that as "Adafruit parts also make great gifs", and I was nodding in agreement.... "Yep, she's right about that."

gilded cradle
#

๐Ÿ˜„

modern wing
#

Thanks @lone axle ๐Ÿ™‚

onyx hinge
#

" CircuitPython library for the TI TMP117 Temperature sensor "

turbid radish
#

Yay 60 boards!! Yay @gilded cradle

idle owl
#

@cobalt grail Feel free to join the meeting, but please mute your mic. ๐Ÿ™‚

cobalt grail
#

Sorry, didn't find the button. ๐Ÿ™‚

idle owl
#

No worries, it's always something.

onyx hinge
#

discord UI has a few surprises no matter how long you've used it

idle owl
#

Yep!

thorny jay
#

I am thinking about a CP project will write the timestamp acting as a keyboard... Maybe one button to reset to 00:00 and one buton to send the timestamp + space. Could be the Clue to have button and screen.

onyx hinge
#

@thorny jay yeah it could be useful!

#

.. maybe all libs should be packages even if it doesn't seem like they need to be.

#

(what a lot of work that would be)

idle owl
#

and extra space taken up?

onyx hinge
#

true

idle owl
#

Bus device to the core! sounds like an 80's exclamation.

turbid radish
#

Like a sci fi movie

blissful pollen
#

@idle owl lol! now I'll be thinking of that the whole time I finish it ๐Ÿ˜†

idle owl
#

@blissful pollen Then I have done what I came to do.

onyx hinge
#

I don't see it in the community bundle, maybe someone can reach out to Arudinne -- @thorny jay ?

#

I think you're not the only one who would like that -- I think Erin St. Blaine wanted to switch between slideshow and other mode.

solar whale
#

ssssecrets blinka

onyx hinge
#

credentials.json

inland tusk
#

How about usr_secrets.py

onyx hinge
#

I think it only works with the built in font type

#

I think/thought all loaded fonts all use one bitmap per glyph

modern wing
#

Nice!

lone axle
#

โค๏ธ auto bed leveling

modern wing
#

I just picked up a low-end XVICO X3S 3D Printer. It had a bunch of features that even my Prusa Mk2s doesn't have, and the pricing was right for an impulse purchase. Plus -- 10 minute build time vs 6-12hr build time for a Prusa.

ionic elk
#

@idle owl that includes non esp boards?

gilded cradle
#

That's true ๐Ÿ™‚

ionic elk
#

Neat

turbid radish
#

Something Ladyada has asked for

ionic elk
#

So things like STM32 and i.MX being fast

#

or having more memory

thorny jay
#

I don't see it in the community bundle, maybe someone can reach out to Arudinne -- @thorny jay ?
@onyx hinge I wanted to write the support for the Unicorn HD... then hopefully I searched the internet first! I am not 100% satisfied with the code as it make 256 3 bytes SPI write. I can try contacting the author.

ionic elk
#

cool!

lone axle
thorny jay
#

Go go Mag Tag!

idle owl
#

@lone axle Exactly

ionic elk
#

@idle owl would love to help contribute some of the pros/cons of STM32/i.MX boards

idle owl
#

@ionic elk I would love to have help ๐Ÿ˜„

ionic elk
#

i really like meta view resources like this

#

super duper useful

idle owl
#

I'll let you know when I get to a page that includes them.

thorny jay
#

@idle owl I think I proposed something like that in the weed some time ago. It could be just a table with feature: Wifi, BLE, Screen, Formfactor, ...

idle owl
#

@thorny jay Data matrices are extremely difficult to maintain. There are entirely too many products for us to have a reasonable matrix. We discussed it. We don't have software to do it automatically yet, so it's not something we're going to do.

inland tusk
#

@gilded cradle Is that the return code errors?

gilded cradle
#

@inland tusk You mean for Requests/ESP32SPI?

thorny jay
tidal kiln
#

ill let @lone axle talk

inland tusk
#

Requests (ie 404 )

tidal kiln
#
# use built in display (PyPortal, PyGamer, PyBadge, CLUE, etc.)
# see guide for setting up external displays (TFT / OLED breakouts, RGB matrices, etc.)
display = board.DISPLAY
gilded cradle
#

There were a variety of issues. The latest one we were working on was Failed to send 3 bytes (sent 0)

#

The PyPortal HTTP error handling was more like 404

inland tusk
#

Okay Low level

gilded cradle
#

yeah

inland tusk
#

understood

gilded cradle
#

It had to do with the connection being closed and the ESP32SPI not handling it correctly.

thorny jay
#

Right now, a lot of example are with alternate wiring commented out, like all the AirLift example.

tidal kiln
#

@lone axle i'll take care of guide update (displayio guide) if you want to deal with libraries?

thorny jay
#

is31fl3731 is also like that with a lot of comment.

manic glacierBOT
thorny jay
#

Do you want MagTag to be in 6.0.0 ?

#

Like, what is the marketting highlight of 6.0.0?

tulip sleet
#

MatrixPortal is the new board that requires 6.0.0. MagTag is kind of early, and we expect more versions that will fix ESP32S2 issues.

lone axle
#

ah, if pasted a \t maybe it would try to use it for completion

onyx hinge
thorny jay
#

QT-Py is also 6.0.0

onyx hinge
#

I modified my terminal program to "fix" it

lone axle
#

unrelated to this issue, but curious if anyone knows while folks are around. Are there different requirements needed in order to build esp32s2 ports?

idle owl
#

Yes.

onyx hinge
#

@lone axle yes, there are steps for setting up the esp-idf

#

it installs a bunch o'stuff

ionic elk
#

@lone axle I wrote a big 'ol readme in the port

tulip sleet
#

it's quite complicated, depends on which python versions are installed

thorny jay
#

MagTag is grey scale too...

ionic elk
#

@tulip sleet it shouldn't be too bad?

lone axle
#

Oh nice, gotta get used to scrolling on those repo pages.

cobalt grail
#

My MagTag is due for wednesday.

ionic elk
#

or did you mean something else

thorny jay
#

My MagTag is due for wednesday.
@cobalt grail Thursday for me.

tulip sleet
#

it's not bad, but it's complicated. (You need a python, so you need python-is-python3 etc.

cobalt grail
#

@thorny jay Whoohooo! ๐Ÿ™‚

ionic elk
#

most of the stuff should be done by the IDF itself though

lone axle
#

Ooh, I have no python2 currently I'm sure I can get it figured out though

#

can set up a venv if needed.

ionic elk
#

@lone axle no venv, the IDF makes one

#

All you should need is python3.

lone axle
#

Ah, I misread that

ionic elk
#

IDF should do everything else, once you set the environmental variables, which should also be pretty easy if you follow the readme

lone axle
#

I have python on my system but it does run python3 Found this page now. Thanks for writing this up!

ionic elk
#

Don't install the IDF elsewhere either, that's kind of confusing if you go 100% off the IDF docs - when you have a local version like the one in Circuitpython you don't need a global install in your user folder

modern wing
#

Thanks all ๐Ÿ™‚

ionic elk
#

IDF actually makes its own virtual environment which it uses privately, so you can't use your own

#

or the two will conflict and it'll explode

analog bridge
#

Thanks! ๐Ÿ™‚

idle owl
#

@atomic summit Just broke out my Feather S2 to test esptool for a guide. Came right up as CIRCUITPY and played perfectly well with esptool. Great experience!

gilded cradle
#

Thanks

onyx hinge
#

thanks all!

thorny jay
#

I'll work on the CLUE board timestamp encoder. ๐Ÿ™‚

gilded cradle
#

It's really helpful for podcasts

modern wing
#

Snakes. Why does it have to be snakes....

solar whale
#

tricky snakes

#

yes

#

no UF2

#

I do but it does not have uf2 bootloader

idle owl
solar whale
#

ha -- never knew that was there...

tulip sleet
solar whale
#

life on the cutting edge

idle owl
#

@lone axle Did you get a chance to go through the MONSTERM4SK repo to find the references to MonsterM4sk?

slender iron
solar whale
#

Have a good week ๐Ÿ‘‹

lone axle
#

@idle owl I did. I think I got them all fixed in in a PR that is open on it.

modern wing
#

I didn't know that either -- thanks ๐Ÿ™‚

idle owl
#

@lone axle Ah! ok, will check

modern wing
#

Kattni's Pro-Tip of the Week ๐Ÿ™‚

onyx hinge
#

whoops I left myself in the audio channel. hope I didn't miss something.

modern wing
#

We discussed the "ultimate question of life, the universe, and everything" -- and bootloaders on the ESP32-S2. And by "we", I mean I listened in like a fly on the wall while others discussed it ๐Ÿ™‚

slender iron
#

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

olive abyss
#

Has anyone looked at watchdog support for the esp32s2 port? Seems like it's not too awful with esp-idf, I just don't have a feel for how the TaskHandles jives in with everything else yet. This is the first time I've been in this section of the esp-idf programming guide though so maybe it's not too bad, but I didn't want to start messing with it if someone has already found dead ends here

manic glacierBOT
#

On the FeatherS2, if code.py has wifi.radio.stop_scanning_networks() with no scan first, it causes the device to hang, stops showing up as CIRCUITPY, and there is no way to get the REPL. This is with MacOS and CircuitPython 6.0.0-rc.1. The board was purchased from Adafruit Nov 6, 2020.

See attached code:

code-crash.py.zip

Restoring the S2 requires the following (must have esptool.py 3.0+ for this to work):
...

slender iron
#

@olive abyss I haven't heard of anyone looking at it. We do have an existing watchdog API

olive abyss
#

@slender iron yeah I was perusing that one, I saw the NRF boards had it exposed. I'll probably take a look at it soon, would be nice to have to clean up after wifi/radio fails or other stuff. found myself wanting it for a RFM69 hangup this morning

slender iron
#

๐Ÿ‘

#

@mental nexus did you see rpi 400? could be one of the first self contained cp board

manic glacierBOT
#

I wonder if this is another case of a flag (self->scanning) being in an inapplicable state like in #3580? By calling stop_scanning_networks() you end up here

void wifi_scannednetworks_deinit(wifi_scannednetworks_obj_t* self) {
    // if a scan is active, make sure and clean up the idf's buffer of results.
    if (self->scanning) {
        esp_wifi_scan_stop();
        if (wifi_scannednetworks_wait_for_scan(self)) {
            // Ignore the number of records since w...
brazen cedar
#

What's timeframe on the 6.0 GA release?

slender iron
#

@brazen cedar we talked about it in the meeting today. basically we have one issue with an OLED I need to test

#

if it's minor we'll make rc.1 the stable release this week

brazen cedar
#

nice! sorry I should have checked the meeting notes first I guess?

hearty tapir
#

@slender iron I'll need to give up for today. I see log outputs now on console, but can't even get to CPY any more.

slender iron
#

@hearty tapir thanks for the help! what timezone are you in?

hearty tapir
#

It will probably best for me to start over fresh tomorrow (actually later today)

slender iron
#

I'll have more time to dig into it tomorrow

hearty tapir
#

Berlin

#

CET

slender iron
#

๐Ÿ‘ thanks!

gilded cradle
#

@slender iron do you know if there's a way to provide a string to import in CircuitPython? Looks like there's a couple ways in Python, but none of them worked with CP for me.

slender iron
#

@gilded cradle not that I know of

gilded cradle
#

Ok thanks, I'll just make a big if block

slender iron
#

what are you doing?

manic glacierBOT
#

Question 1: Should I make all the M0 small builds exclude this? (Basically all the ones that are failing)

Yes, for most of them. Just keep an eye out for the ones that freeze the python version in (like CPX). In those, you should be able to remove the frozen version in favor of the native one.

Question 2: not 100% sure if I should be running "RUN_BACKGROUND_TASKS and mp_handle_pending" during the I2C enter loop. When I did try it once it was very slow. Not sure why. I could expe...

manic glacierBOT
orchid basinBOT
manic glacierBOT
#

I'm currently working on my first circuitpython project, a 'busy light' that I'm hanging in front of my office. I'm using the resources from the latest Adafruit box which is a MatrixPortal and supporting hardware (like a 64x32 led matrix).

I wanted to give the system control via adafruit.io to turn the display on and off remotely. The closet solution I could find was to turn the brightness to 0. However my issues is that the font renders incorrectly once I turn the brightness back to 1. I ...

analog bridge
#

Hi @olive abyss I am working on watchdog implementation for the esp32s2. I would love to collaborate with you on this. ๐Ÿ™‚

thorny jay
#

I seems to be loosing click, I have tried another approach but it is not perfect yet. But if you Click not too fast, that is working OK.

#

Also, it is for US keybard... ๐Ÿ™‚

manic glacierBOT
#

@tannewt and I discussed this a few days ago, and I've been working on a further refinement of the API.

I will use the terminology "fired" to indicate an alarm "triggering" or "going off". "Going off" is a bit confusing, since it could sound like "turning off".

I would like to avoid talking about "deep sleep" and "light sleep" in the API, since there are circumstances when the implementation might not actually want to sleep, such as when connected to USB and enumerated. Instead, there a...

manic glacierBOT
#

Hi and thank you for your report. The only extra piece of info that would have been nice was the specific CircuitPython version you were using.

This was a bug in the underlying library that enables RGBMatrix to work. They've fixed the bug, but unfortunately we haven't upgraded to the fixed version and it looks like we will miss doing this before the release of 6.0.0 stable.

For now, you can create an empty Group object and show() it when you want to blank the screen, then show() your ...

onyx hinge
#

What's the closest equivalent of breaking on HardFault_Handler in esp32s2?

#

Thread 1 received signal SIGTRAP, Trace/breakpoint trap.
0x4008dab4 in mp_unary_op (op=MP_UNARY_OP_HASH, arg=0x72666164)
    at ../../py/obj.h:171
171        { return ((((mp_int_t)(o)) & 3) == 0); }
``` oh maybe it just did it automatically
analog bridge
#

@onyx hinge this might be relevant

onyx hinge
#
#2  0x4008eca0 in mp_map_rehash (map=0x3ffd0afc <mp_state_ctx+108>) at ../../py/map.c:136
136                mp_map_lookup(map, old_table[i].key, MP_MAP_LOOKUP_ADD_IF_NOT_FOUND)->value = old_table[i].value;
(gdb) x/24c old_table
0x3fd8bc10:    105 'i'    109 'm'    112 'p'    111 'o'    114 'r'    116 't'    32 ' '    97 'a'
0x3fd8bc18:    100 'd'    97 'a'    102 'f'    114 'r'    117 'u'    105 'i'    116 't'    95 '_'
0x3fd8bc20:    97 'a'    104 'h'    116 't'    120 'x'    48 '0'    0 '\000'    -40 '\330'    63 '?'
``` well that's not a very good "old table" is it
tulip sleet
#

@onyx hinge Do you feel the protomatter update is worth an rc.2?

onyx hinge
#

@tulip sleet again, there are workarounds that are totally fine (display an empty group)

tulip sleet
#

i am just worried about having to put these workarounds in Learn Guides, etc.

#

Perhaps more appropriately, we can release 6.0.0 and then follow up with 6.0.x's with various fixes

onyx hinge
#

yeah

#

I'm chagrined, I thought we had taken the fix for this in CircuitPython but I dropped the ball after PRing it in protomatter

tulip sleet
#

don't worry about it; maybe wait for Scott to get up so we can have a final consult about this

onyx hinge
#
(gdb) c
Continuing.
esp32s2: Target halted, PC=0x40084A60, debug_reason=00000002

Thread 1 received signal SIGTRAP, Trace/breakpoint trap.
vstr_ins_char (vstr=0x3ffdbea0, char_pos=0, chr=97) at ../../py/vstr.c:212
212        *s = chr;
(gdb) p s
$32 = 0x3fd8bc10 "~\001"
(gdb) p &mp_state_ctx.thread.dict_globals.map.table[0].key
$33 = (mp_obj_t *) 0x3fd8bc10
(gdb) where
#0  vstr_ins_char (vstr=0x3ffdbea0, char_pos=0, chr=97) at ../../py/vstr.c:212
#1  0x400a80ec in readline_process_char (c=97) at ../../lib/mp-readline/readline.c:242
#2  0x400a84df in readline (line=0x3ffdbea0, prompt=0x3f013138 "81\001?") at ../../lib/mp-readline/readline.c:482
#3  0x400ab982 in pyexec_friendly_repl () at ../../lib/utils/pyexec.c:455
#4  0x4009e60f in run_repl () at ../../main.c:443
#5  0x4009e687 in main () at ../../main.c:510
``` readline_process_char is somehow reading the line into the globals table, but no guarantee that this is the first thing that went wrong
#
$36 = 0x3fd8bc10 "~\001"
(gdb) p mp_state_ctx.thread.dict_globals.map.table
$37 = (mp_map_elem_t *) 0x3fd8bc10
#
>>> adafruit_bus_device
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'adafruit_bus_devada' is not defined
``` is it imports at the repl vs in a program?
olive abyss
#

@analog bridge just saw your message and the new PR; I'm excited to try it out, I'll try to find some time today to do a test build!

analog bridge
#

๐Ÿ‘

manic glacierBOT
#

Hi All,

Can we somehow collaborate on it ?

Double checking - Are we speaking about these:

LILYGOยฎ TTGO T8 ESP32-S2 V1.1
http://www.lilygo.cn/prod_view.aspx?TypeId=50033&Id=1300&FId=t3:50033:3

LILYGOยฎ TTGO T8 ESP32-S2 V1.1 ST77789 1.14 Inch LCD Display
http://www.lilygo.cn/prod_view.aspx?TypeId=50033&Id=1321&FId=t3:50033:3

These modules has USB-C functionality selectable by 4 dip switches (Serial or chip USB), so does circuitpython need both functionality at once ?

Ideal ...

#

This seems to have to do with the repl. Debugging shows that the memory used by rl.line.buf (readline) and mp_state_ctx.thread.dict_globals.map.table can end up overlapping (which shouldn't happen)

(gdb) c
Continuing.
esp32s2: Target halted, PC=0x40084A60, debug_reason=00000002

Thread 1 received signal SIGTRAP, Trace/breakpoint trap.
vstr_ins_char (vstr=0x3ffdbea0, char_pos=0, chr=97) at ../.....
onyx hinge
#

components/esp_common/include/esp_task.h:#define ESP_TASK_MAIN_STACK (CONFIG_ESP_MAIN_TASK_STACK_SIZE + TASK_EXTRA_STACK_SIZE)

manic glacierBOT
#

The main stack is bigger than CONFIG_ESP_MAIN_TASK_STACK_SIZE -- an "extra" size is added to it (TASK_EXTRA_STACK_SIZE). This total size is available as ESP_TASK_MAIN_STACK. Presumably TASK_EXTRA_STACK_SIZE is additional stack that can be used by the esp-idf runtime. But what's important for us is that some very outermost stack frames, such as pyexec_friendly_repl, could lie inside the "extra" area and be invisible to the garbage collector.

Closes #3649