#circuitpython-dev
1 messages ยท Page 415 of 1
ok
thanks for asking instead of blindly typing your password ๐
Thank you for clarifying!
Is there a quick way to check (or a cached place to look) for which languages on a given build result in the largest build size?
i.e. which language(s) are most important to test when looking at a PR in a library that is frozen in to some of the smaller builds.
@lone axle sadly, no.
Happy to have confirmation. I'll check a few more
Here is the notes document for next Mondayโs CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if youโll be attending the meeting - itโs super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and weโll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1fJ0odbK7m4jWHTnKL1medCeZAGBTZiNIW0np6nOd4hc/edit?usp=sharing
CircuitPython Weekly for March 28, 2022 Here is the notes document for next Mondayโs CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if youโll be attendin...
Ooof. It reformatted SO many files. I had to git stash and drop after copying my changes out and paste them back in (because I don't know how to do things the right way). Mine was not reformatted though, so it must be correct.
huhhhhh that's odd
I thought theirs was the same as ours ๐ was it .c files or .py files?
Py.
Started looking at git diff and it was going on forever, so I q'd out of it, and blew away the changes.
I guess that means it didn't touch my file. ๐
I can't get to the beginning of it, too much scrollback. But, it ended with the Black format message.
"Both C and Python code are auto-formatted using the tools/codeformat.py script."
I guess it did C first?
I can apparently pass arguments to only do the changed file, but there's no instructions on how to do that.
@jepler Finally passed CI. Just need one more :+1: from you.
If I connect via the uart, can I use rshell with the broadcom port of CircuitPython?
how do you move an issue from one library to another? (https://github.com/adafruit/Adafruit_Learning_System_Guides/issues/2115 I think should go to Requests)
I too would love to be able to disable the logo and the terminal output from my ssd1306. At the moment I'm having to use the adafruit_ssd1306 driver instead of the adafruit_displayio_ssd1306 because of the issue when my code that displays a splash in the boot.py and it finishes in the gap between code.py starting I see the logo and the words "code.py running" which is not what I want to see. Using the other driver it just seamlessly changes from one image to the next image that is ran from co...
"Transfer Issue" at the bottom of the right hand menu. If you don't have it, I can transfer it.
I don't seem to have that one
I'll transfer it then.
thank you!
Done! Thank you for identifying the need for the transfer.
I don't see why not
This is such a neat idea! Looking over the tasks you've outlined with an eye toward finding some part that I might be capable of helping with, I'm curious if the internal HTTP server that you mentioned is something that will get written with python code? or it's internal to the core and thus written in C?
Generally we need C code for things that run outside the VM. My plan was to look into the HTTP Server that the IDF has and probably use it. It might be pretty big though. We could proba...
A custom built server could also build on top of common_hal and be useful for any port that supports it.
@idle owl follow-up Q: if a Learn Guide is broken due to a library issue, do we want to track the issue in both places? If the library fix is long-term, it may help the guide to switch to a more friendly data source (in the present example)
Hmm, yeah. File an issue on the Learn repo and mention the Requests issue. That would be a good idea.
ok, I'll do that
This is about half done. The two remaining large pieces are adding GATT server support and bonding support. Unfortunately GATT server support probably needs NimBLE modifications to allow for adding servers, characteristics and descriptors after things are running. The SoftDevice can do this so we've assumed it in our APIs ability to just Service() at any point.
Oof. I can't get this I2C power pin to turn off. I thought my initial more-complex code was wrong, but I'm trying the basic code, and setting it True or False has the same results - the STEMMA QT connector still has power, and data is being read from the sensor.
@tulip sleet Even with the pin being turned on by default in CircuitPython (presumably on startup), shouldn't I be able to control it in code.py? Or am I missing something obvious here.
which board is this?
Feather ESP32-S2, rev B.
(I assume it's rev B, there's no marking on the back, it's one of the original boards.)
loooking...
I'm running absolute latest CircuitPython to have Limor's fancy code to start up both rev B and C.
Point was to duplicate it in Python. Which I think I did. But it's not affecting the pin.
i need to look at the rev B schematic; I have it in eagle
Ok
When the duplicated fancy code didn't work, I went back to basics, and that isn't doing anything either.
Adds Adafruit QT Py C3 board that uses it. Also revamps size
check script to work for S3 and C3 as well.
Fixes #6030
@tulip sleet when do you want to chat?
i have something in 45 minutes, could chat for a shorter time
I was planning on going for a run
free tomorrow between 11am and 4pm pacific
(or later after my run)
i might be free by 5pm your time, but that's dinner. tomorrow afternoon my time is good; taking Jesse to a long appt in the morning, back around the time you'll be free. tomw is probably better
we can say 11am your time 2pm my time tomw
๐
i'll put it in my calendar
(other folks are welcome to join too. we'll meet here on discord)
idea is to go over stuff before I'm out
My time is kinda hit and miss but if there is anything core related (and overly time sensitive) that could use another set of hands or review while you're gone feel free to reach out. I think by this point I have somewhat of an idea about it
Thanks Mark! I don't think there is. Your reviewing helps a bunch though.
@idle owl could you post your code? I will try barebones with current CPy and also maybe one before Limor's code fix
import time
import board
import digitalio
import adafruit_mcp9808
# i2c_power = digitalio.DigitalInOut(board.I2C_POWER)
# i2c_power.switch_to_output()
# time.sleep(0.1)
# rest_level = i2c_power.value
# print(i2c_power.value)
# i2c_power.switch_to_output(value=(not rest_level))
# print(i2c_power.value)
i2c_power = digitalio.DigitalInOut(board.I2C_POWER)
i2c_power.switch_to_output()
i2c_power.value = True
mcp9808 = adafruit_mcp9808.MCP9808(board.STEMMA_I2C())
while True:
temperature_celsius = mcp9808.temperature
temperature_fahrenheit = temperature_celsius * 9 / 5 + 32
print("Temperature: {:.2f} C {:.2f} F ".format(temperature_celsius, temperature_fahrenheit))
time.sleep(2)
Fancy code is commented out.
Was trying to get it to work. When it seemed like it was in terms of making things opposite, but nothing was happening with the pin, I switch to original.
So, no idea if I even did the commented out bit properly, but it looks like what's in CircuitPython.
I only have the TFT one, but I think it should be the same. I'll check the schematic
Um... I'm not certain it is the same. I mean, you should still be able to turn off the pin, but I feel like there was a difference. Could be wrong though.
VSENSOR part looks the same
Ok, then maybe it is
Except the pin is TFT_I2C_POWER on that one, I thought. Combined for the TFT and I2C.
I guess the logic should be the same though.
yes, it does control both the BME and the TFT, but the TFT is just another connection to VSENSOR
Ah ok
ok, hmm, on the TFT, the I2C pullups are powered by VSENSOR, but on the plain rev B, they are always powered. I think at least some sensors may end up being powered by the pullups by accident
that would explain it
oof.
Ok.....
Well then. I guess I'll ask Limor what she wants to do. Means you can't force low power with a sensor plugged in? Or maybe it stops talking to it in deep sleep anyway..... I don't know.
I have to go fix veggies for dinner. I'll pick this up tomorrow. Thanks for looking into it.
that is part of the redesign. Yes, ask Limor
there are at least two low-power problems with the <rev C plain Feather
Hmm... ok
Heading out. Talk to you tomorrow for specifics. Or read back here to find them if you post here.
@idle owl if all else fails, we could have a rev B pins.c and a rev C pins.c, and check hasattr for _INVERTED
An interesting data point which may (or may not) be of use.
I have a Lolin S2-mini (ESP32-S2) running CircuitPython 7.2.3. The device is driving 240 WS2812C-2020 "neopixels".
It's been glitching just as described above.
On the rare occasion where I plug it into my computer (Windows 10), I might get the "Unrecognized USB device" error. In these cases, the device still receive power but does not have any communications. What is relevant here is that it does not glitch in this situa...
is asyncio pretty lightweight or does it add significant overhead?
Removes:
- AUTORESET_DELAY_MS which never did anything but was introduced
somehow. - CIRCUITPY_BOOT_BUTTON in all but one ESP board because they all have
them. There is a default based on the strapping pins. - BOARD_USER_SAFE_MODE_ACTION because it was all the same for boards
with boot buttons. Now the safe mode code manages the message.
unlikely to be added any time soon, it is nontrivial
Looks like this release needs its PyPi release action triggered https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k/releases/tag/1.12.3 vs https://pypi.org/project/adafruit-circuitpython-wiznet5k/
Thanks for adding the suggestions
Looks good to me.
Does anyone know how we can tell what boards support the BLE workflow? VIa code.circuitpython.org I can connect to a feather bluefruit sense but I am also trying to use a Maker Diary nrf52840 USB Dongle and I don't seem to be able to get it to show up. It does not show the blue status LED on boot and may well not support the BLE workflow but I was curious how to look at the build to determine what boards do support it.
It looks like none of the release actions triggered when the release was made. That is odd, not really sure what could cause it. I think I recall mention of actions having trouble the other day, maybe this release was made during downtime and it got "lost to the ether" and never triggered once everything was back to working.
I'm looking at how to adapt the existing code to work with the ESP32-S3 lcd driver code, and I could use some pointers. It is a slog for me to understand some of the code, so I'd appreciate even a few sentences to guide me in the right direction.
The ESP-IDF functions don't really act like a "bus" like the I2C or SPI buses, so I'm trying to figure out an easy way of doing this.
Background:
- The ESP-IDF lcd peripheral library has a
_draw_bitmapfunction that takes a draw window. ...
@idle owl do you think making a new release with no code changes for this: https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k/releases/tag/1.12.3 is the right thing to do in order to trigger the release actions to run? I think pypi has issues if you try to release the same code again to it. But in this case it never made it to pypi or the release assets page.
It's worth a try. Worse cast we delete everything, edit something, and do another PR/release. I see it's not on the release actions page at all. So this might work.
ty, I'll give it a shot.
I made a new release and it does seem to have triggered the actions successfully this time. Latest version should be deployed on pypi now. Thanks for mentioning this issue.
@solar whale Merged! https://github.com/micropython/micropython/pull/8406
Yay!!! Congratulations!
Thanks! ๐
You are now a Micropython core developer!!
Hah! I don't know about all that ๐
Limor said basically the same thing within a minute of your message ๐
She used "contributor" which I guess is vaguely more accurate.
@solar whale Anyway, if you test it, let me know. I'm going to add a page to the Feather ESP32 V2 guide on using MicroPython. Which I will probably ask for your help with.
I'll try the "nightly build" hopefully tomorrow morning
Excellent! Thank you!
I did not venture into that yet. I was going to wait for a build on their end as well.
I thought so too -- but do I have to tap reset as it is starting? I tried, but I have not yet been able to see it in code.circuitpython.org
No big deal -- I'll keep trying
no that blinks blue.. just a red led
I think it should have different blink rates
that's just a power led though I think
the board def doesn't have a status led defined
I may just have to play with the timing. Good to know it "should" work.
right -- so I guess I just guess at the timing
the page says it has an rgb led
it does
I'll add it to my "todo" list! Be fun to try. but that should not prevent it from working woth BLE should it?
no, I don't think it should
but it'll make it easier to understand what is going on
OK -- sorry -- I have to run. I'll take a look at it later today or tomorrow to see I fI can make any progress -- as well as look into adding the LED
np. thank you!
@justinesmithies Would it be ok for you to have the splash setup in code.py? That way you won't have a gap where CircuitPython has control of the display.
@justinesmithies Would it be ok for you to have the splash setup in code.py? That way you won't have a gap where CircuitPython has control of the display.
Yeah minutes after submitting my comment that exact thought popped into my head. But it would be good and I'm sure that I'm not alone to have some kind of option in displayio to disable the terminal output / logo.
Does a library in / override a frozen library?
In the usual sys.path, it comes first, so yes, it should
thanks, came up in a library issue
That is super useful! I didn't realize there was a way to make it not use the frozen one.
@slender iron I am available now, but see you are working with Limor.
happy to wait for that to finish
I'm in the circuitpython voice channel
@onyx hinge we are going over issue lists before Scott leaves, if you have time, in the public CircuitPython voice channel
if not we'll just do it the two of us
@gamblor21 Do you have an idea of what's wrong here? Do you have time or are you busy at the moment?
Not sure why itโs occurring offhand but I should have a moment to look at it tomorrow or Thursday. I didnโt test scale being false as much.
Let's document in the shared-bindings docs that MP3 problems could be due to the bit rate being too high.
Could have key store load everything, or check that there is no bonding.
See if PulseIn needs to be long-lived also.
We think we'll turn off OneWire on ESP for now and move to long-term.
Oh yeah, we needed a simple way to iterate on things. This was a decision we made ages ago for that exact purpose.
Get rid of this feature in 8.0.0, and maybe make it non-operative in 7.x.x.
The IncrementalEncoder class needs two Pin instances to be instantiated, therefore it cannot be used with rotary encoders that are attached to a(n i2c) GPIO expander.
I'm wondering whether it would be possible to extend it, or to create a version of it which can work with values coming from an expander. An added bonus could be to make use of any interrupt pins on the expander which are connected to GPIO pins on the board.
- Check descriptor power settings and remote wake
- Before sending a report, see if we need to wake.
Thanks! Looks good, we discussed the one part I didn't understand at first.
So apparently at once point, wifi had reset() but now it does not? I'm not sure what you would use in place of that. Since I have no idea what it previously did.
It was suggested that I use this loop in my current example. I have it almost working properly, but it fails on this with no attribute found, and the documentation backs that up.
Can you move supervisor/serial.c out of the port? If needed, have e.g., port_bytes_available() and such functions that are port-specific.
@idle owl closest thing is:py wifi.radio.enabled = False wifi.radio.enabled = True wifi.radio.connect(secrets['ssid'], secrets['password']) # _added later_
Hmm ok.
less intrusive would be to stop the station, then start it and re-connect
I'm kind of fuzzy on what I was trying to do anyway. Chances are I will be handing this off to someone else. I'm 20 minutes shy of the timebox I was given for it, and moved on to something else because I was kind of going in circles.
(there's is no explicit wifi disconnect or reset (native esp32-s2), but supervior.reset would be the next escalation)
@lone axle did this end up being the fix for the docs?
https://github.com/adafruit/Adafruit_CircuitPython_PortalBase/pull/66
i lost track of that whole discussion
I think that PR didn't specifically fix it. Because it was still empty after that go merged.
yah...seeing the second PR now too...
My leading theory is that this one fixed it: https://github.com/adafruit/Adafruit_CircuitPython_PortalBase/pull/67 it it was weird. It got fixed on the live page as soon as I made this PR rather than waitng for it to get merged, which definitely seems odd to me. So possibly not correct.
ha! ok. so maybe some mystery still to it.
oh well. the docs are up now at least.
thanks for looking into that!
You're welcome
As the title suggests, this is PR for a new board. Product details on https://ilabs.se
is RS485 (rs485_dir keyword) support planned for the SAMD or RP2040 boards? There should also be a note in the docs indicating the it currently is only working for the ESP32 boards
When using label_direction="RTL" the label is inverted, would it be possible to implement the blow?
time.text = str(gatime - int(time() - gatimer))[::-1] time.text = str(score)[::-1]
NotImplementedError: only slices with step=1 (aka none) are supported
Hello all. I just released Piku v0.2.0. It will now automatically install a package dependencies, you can also now install specific versions of packages, it creates a lock file like poetry/npm etc, and there is an update command to update all packages to latest.
say @lone axle i'm trying to install vectorio_helpers w circup, but it's throwing a warning WARNING: vectorio_helpers is not a known CircuitPython library.
ah looks like they just aren't in bundle yet. I've installed them by hand, and the line works well, about to try outlined rectangle.
Is there any CircuitPython mdns example code? I'm having issues, but not sure which side of the keyboard they're on ๐
Yep, you ended up on the right conclusion. Not in the bundle yet so circup doesn't see them. I'll add them to the CircuitPython Org bundle this week though and after that circup should be able to find.
I may still end up tweaking the way that OutlinedRectangle works as well to try to make it as memory efficient as possible.
# SPDX-FileCopyrightText: 2022 Scott Shawcroft for Adafruit Industries
# SPDX-License-Identifier: MIT
"""
"""
import mdns
import microcontroller
import socketpool
import wifi
from adafruit_httpserver import HTTPServer, HTTPResponse
print("connecting")
wifi.radio.connect("skylab", "freewifi")
print("Connected")
pool = socketpool.SocketPool(wifi.radio)
server = HTTPServer(pool)
m = mdns.Server(wifi.radio)
print(f"Listening on http://{m.hostname}.local:80")
m.advertise_service(service_type="_circuitpython", protocol="_tcp", port=80)
for service in m.find(service_type="_circuitpython", protocol="_tcp", timeout=5):
print(service.service_type, service.protocol, service.hostname, service.instance_name, service.port)
@server.route("/temperature")
def base(request): # pylint: disable=unused-argument
"""Return the current temperature"""
# pylint: disable=no-member
return HTTPResponse(body=f"{str(10)}")
# Never returns
server.serve_forever(str(wifi.radio.ipv4_address))
Thanks! I got finding working, though it safemodes if there are no services of a given type.
Please file an issue. I may not have time to fix but it'll be good to track.
CircuitPython version
Adafruit CircuitPython 7.3.0-alpha.0-52-g4465adfe0 on 2022-03-21; FeatherS2 with ESP32S2
(this is the version that corresponds to the mDNS merge)
Code/REPL
import wifi
import mdns
from secrets import secrets
print(" Connecting", end="\r")
wifi.radio.connect(secrets['ssid'], secrets['password'])
print(wifi.radio.ipv4_address)
print("Starting mDNS server...")
server = mdns.Server(wifi.radio)
service_types = ("_http", )
pr...
Can you move supervisor/serial.c out of the port? If needed, have e.g.,
port_bytes_available()and such functions that are port-specific.
Done in the latest commit. :crossed_fingers: all of the boards build.
Fixes uart workflow on espressif not being able to interrupt code and slowness at the "press any key" prompt.
While I was working on this I noticed a board with a neopixel status LED didnt suffer from the slowness due to incorect expansion of CIRCUITPY_STATUS_LED so I fixed that too.
@lone axle does this look like it should work? open_box = outlined_rectangle.OutlinedRectangle(pixel_shader=palette4, width=10, height=6, x=40,y=300, outline_color_index=0, outline_thickness=4)
i'm getting an error File "outlined_rectangle.py", line 48, in __init__ TypeError: extra keyword arguments given
Ah, that is because of the color_index that it's passing to Rectangle super class constructor. That is brand new. Just merged into core within the past few days. But if you grab the latest build from S3 for your device I think it should be in there.
Indeed! it's a great way of drawing basic shapes without Bitmap overhead.
you can even say vectorio really connects the dots...
i'm playing around with it making this little circus game thing, based on some bouncing ball code from @devout jolt
Oooooh fun! that is coming out fantastic
Thanks! Here it is in motion
that's cool, and now i have that classic circus music stuck in my head
haha so sorry. I just learned recently that that was written as a military march, and boy would the composer be disappointed at how it now means ๐ช ๐คก to us
ha that's a cool random fact. I mean sorta has things choreographed to it still
@lone axle I've updated to S3 latest (Feather RP2040 w TFT FeatherWing for hardware) and the error has shifted! File "outlined_rectangle.py", line 61, in __init__ TypeError: 'module' object is not callable
That one is a stumper, not sure. Ill take a look in the morning. Possibly i changed something in the module on my device that didnt get checked in
right on, not urgent! Thanks much.
Lady Ada mentioned that in a revision of one of the Feathers she fixed the deep sleep current draw. Was that something related to these internal pull-downs and external pull-ups If it is, my intuition says we could fix this in software for the older revision of the board. Sorry if I remembered incorrectly.
I bumped into this because I wanted to see whether it was feasible to go into deep sleep in the asyncio library on the MagTag when all tasks are busy. Maybe by pickling the co-routines into RTC memory. I really like the async API.
Looks like this is still happening: https://forums.adafruit.com/viewtopic.php?f=60&t=189442
@idle owl I tried the 20220323 nightly build for MP on the feather esp32 v2 and I no longer get the invalid Pin error with scl = Pin(20)) but I am not able to access my I2C device ```MPY: soft reboot
network config: ('10.0.0.161', '255.255.255.0', '10.0.0.1', '75.75.75.75')
MicroPython v1.18 on 2022-03-23; ESP32 module (spiram) with ESP32
Type "help()" for more information.
import pos
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "pos.py", line 31, in <module>
File "lsm6dsox.py", line 95, in init
File "lsm6dsox.py", line 152, in __read_reg
OSError: [Errno 116] ETIMEDOUT
I tried a simple test -- connecting Pin 22 (SDA) to Pin 13 (LED) then ```from machine import Pin
p = Pin(22,Pin.OUT) --- the RED LED comes on
p.value(False) --- the RED LED goes off
then move to Pin 20 (SCL)
p = Pin(20,Pin.OUT) --- no response on RED LED
p.value(False) --- no response on RED LED
p.value(True) --- no response on RED LED
also tried Pin 14 -- works as expected -- LED responds
also reading back pin 20 after setting it to True or False. It always returns 0. Other pins return the expected value>>> p = Pin(20,Pin.OUT)
p.value()
0
p.value(True)
p.value()
0
p = Pin(22,Pin.OUT)
p.value()
0
p.value(True)
p.value()
1
wow is github having trouble yet again today? I'm getting a lot of unicorn pages accessing actions results. githubstatus is all green though ๐
I am looking for a program that runs on MacOS to log CircuitPython output. Thonny has a scrollback buffer of only about 1000 lines I can select with <command>A. Mu has a larger buffer, but no SelectAll shortcut. On Windows I use putty, but I can't/don't want to install putty on MacOS. I tried rshell, but it only runs with MicroPython (It needs ubinascii.unhexlify.) Likewise screen does not seem to work with CircuitPython.
TLDR: I need output logging on MacOS and CircuitPython.
I like tio, there are others like picocom or python -m serial.tools.miniterm
screen works with Circuitpython, but I don't even know how to get the scrollback if possible, though there should be a way to output to a file automatically
VSENSOR did not control the on-board pullups. Now it does
There was a different issue with the QT Py ESP32-S2, which has also been fixed.
tio -log logfile /dev/cu.usbmodemBLABLABLA for example will connect and log all to a file
or just something like cat /dev/cu.usbmodem146443133 > output.log will log all to a file
@jaunty juniper ooh I didn't know about the -log option of tio, I'll remember it!
@jaunty juniper Thanks. tio -loutput.txt /dev/tty.usbmodem487F307DBD4D1 works. Didn't think of the cat solution.
tio is nice because I can use the REPL.
@split ocean I tested out that outlined rect code you posted here last night and I am seeing the box drawn on the display. I put the code I ended with here: https://gist.github.com/FoamyGuy/296abd0d2800e1790b8c76276838ab27 I tried to copy the constructor from your message and just fill in the minimum other code to run on RP2040 + 3.5 FeatherWing. I did need latest from S3, but after that I'm seeing it get drawn.
If your still seeing the module object not callable when you get back to it, maybe try this bare bones version to see if you still get that error. And if possible you can send the code you have to me and I can try it on my end to see if I can track down the specific cause. Looking back at the error message and the lines of code referenced I'm not seeing any immediate issues jumping out, but could still be something that is somewhat environment dependent that I am missing.
Thank you! -- Tested with Dongle -- worked well -- I was even able to get the BLE workflow to connect now!!
@lone axle I tried that code to the same error -- maybe this has to do with me running outlined_rectangle.py and line.py as their own libraries and not from the vectorio_helpers library
that could be. Inside of outlined_rectangle.py the import it uses for Line assumes that it will be inside of vectorio_helpers You could change the import at the top of outlined_rectangle if you wanted though and it should be able to work that way I think.
i had already made that change to the Line import in outlined_rectangle
line 29 in outlined_rectangle.py is currently:
from vectorio_helpers.line import Line
but something like this should work I think if you moved it out on it's own:
from line import Line
Hmmm, then I am less sure. I would have expected it to work like that but maybe my understanding of how the imports work is not quite accurate.
ahah! i had done that wrong. I had made it import Line oops ๐
@lone axle ok now it works! thanks.
Ah. I'm surprised it wasn't a module not found error. So there is definitely still a gap in my understanding. Glad that got it going for you though ๐
Yay! Say, do you think things like rotation and scaling could be possible one day in vectorio?
Funny you should mention it. Your carnival looking example last night actually gave me the idea of a RotatedPolygon helper.
I think it will involve some geometry to do the rotation function on the given points in the polygon. So it'll take a bit of math to do but I think we can make a fairly easy to use helper class.
rotozoom
ah that does exist as well. in bitmaptools, though I don't think it can be used on vectorio shapes.
Yes, i wasn't about to solve those points in my head as i built the flags so i made them in Rhino, rotated them, and used Grasshopper to export the vertex coordinates to bring into CircuitPython
it looks like import is not case sensitive (is fat case sensitive ?)
fat is not case sensitive
I will make an attempt at a helper class for it in the next few days and add it to the repo if it ends up working how I am imaging.
so import Line imports line.py
oh @lone axle one other question related to the outlined_rectangle -- is there a way to have the rectangle fill be transparent and the stroke opaque?
related question -- is there a reason the outlined_rectangle seems to use a three color palette with first color for outline and third color for fill? I'm not sure what the second color is there for.
No specific reason. I was partially testing out the new color_index option from the core.
I don't think it can right now. But I'm not certain. Possibly somehow with Palette.make_transparent() That is definitely some functionality I'd love to have though I'll look into ways to make it happen.
right on, thanks
Oof. I have no idea how to begin troubleshooting that. I see you posted to the issue. Might have wanted to make a new issue, but I don't know how Damien likes things.
Yeah, I was not sure how to handle that. I canโt do anything else on this today. I have no idea what is wrong. If you can reproduce it, that would be good. It would be great if I am just doing something wrong.
It's on my list. Will be the first time using MicroPython... so a lot of variables where things could go wrong on my end unrelated to this. ๐
I will give it a try though.
Good luck!
Thanks!
Thanks for testing, @jerryneedell.
LED is the preferred name.
{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_P0_26) },
{ MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_P0_26) },
{ MP_ROM_QSTR(MP_QSTR_BLUE_LED), MP_ROM_PTR(&pin_P0_12) },
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_P0_21) },
{ MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_P0_21) },
Just some pin order suggestions.
Put the preferred name first in these lists.
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_P0_23) },
{ MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_P0_23) },
unicorn when getting build output is frustrating
I've seen another flag called CIRCUITPY_TERMINALIO so i guessed its for disabling the terminal output...
@jepler I spot checked failures and they all build for me. I can't load the files to know why they failed here. I suspect it's not my problem because they all fail in 4 minutes or less.
I noticed the Python Discord folks had a custom badge for their Discord chat on their various GitHub repos. I had Bruce design one for us. We can host it in the Bundle repo, and link to it that way in all of the Adafruit CircuitPython libraries. It would replace the "chat" badge. This won't show the total number of folks online like the current chat badge does, but I think that's fine. If anyone else has opinions on this, please let me know.
After reviewing the code more, I've decided to create a window_addressing flag, perhaps other controllers will come along that can also use this.
Not sure your exact need is, but if you are ok with disabling the terminal in the python-side, you can make use of this recently-added feature and move the root_group outside of the visible display. Keep in mind the terminal will still be present in memory and will reappear whenever you fall back into the REPL.
If you want to prevent an image from flashing on the screen, you can set auto_refresh to false while you make the change y...
To be exact, expander pins can be accessed as instances of DigitalInOut (with a slight difference in the available methods).
@solar whale I made the LED blink using the MicroPython REPL!
Also, I guess I'm getting similar results: >>> i2c = I2C(1, scl=Pin(20), sda=Pin(22), freq=400000) E (1051500) i2c: /home/micropython/esp-idf-v4.2/components/driver/i2c.c:767 (i2c_set_pin):scl gpio number error
Or an error, anyway.
๐ Not sure what to do with this. I wanted to try to do a simple scan, but it won't even initiate properly.
Wondering if there's some place where "valid" pins for I2C etc are called out explicitly, and this didn't get added there.
Also I have no idea how to upload a... main.py I guess it is. I got to the REPL and made the board do a thing, but I'm unclear on using MicroPython past that ๐
ampy --port /dev/tty.something put "main.py"
close your repl for it
yep, you can also change the name with put main_test_file.py main.py for example, so you can test different files without renaming them locally
Does MP have a serial console like CP?
It won't break out of the REPL for me at the moment, so I wasn't sure.
it works like CP, except no autoreload
also, you can use Thonny or Mu, enable the "file" panel, it will automatically switch to and from the REPL as needed, though uploading files is a little awkward with those
I downloaded the generic ESP32 build, but the REPL is reporting a specific board name. I have to head out for a bit. I'll look further into this when I'm back.
I verified my download... so I'm not sure what to make of this.
@kamtom480 Could you review these changes?
It'd be possible to make a CircuitPython library for it. We wouldn't want rotaryio to do it itself though because we want the option to use native peripherals when available and peripherals would only be able to use native pins.
Can you get access to the framebuffer yourself? If you can then you could use FramebufferDisplay to do the work for you.
- At first glance, I can't follow all the code in
_refresh_areaand how it uses the buffer. Does_send_pixelsalways send a complete rectangle?
I believe so. It chops dirty rectangles into subrectangles if needed and then sends the b...
Please explain why this fixes the UART issue. Ideally the UART code shouldn't need special cases for the debug UART.
The error comes from here: https://github.com/adafruit/circuitpython/blob/4465adfe01c0321adb27cde83afde24de8c4a210/py/objstr.c#L455
It doesn't look like there is a richer implementation that is turned off so this will take more work than just build tweaks.
I think you could always do reversed(text).
I'm using the artifact from a7afd66 (adafruit-circuitpython-lilygo_t_display_rp2040-en_US-20220320-1472b86.uf2). One of my boards seems to work, the other seems to have an issue with the display. It's wired as the demo (https://github.com/Xinyuan-LilyGO/LILYGO-T-display-RP2040/blob/main/firmware/firmware.uf2) runs fine.
It'll be simpler to support this through os.getenv(): https://docs.python.org/3/library/os.html#os.getenv Having it be a function will give us more flexibility to run code on access.
Also note the dotenv Python library looks like a really good model. https://github.com/theskumar/python-dotenv It is used to manage environment variables for projects in regular Python with .env files.
@idle owl do we have a standard pin name for battery voltage?
Um... let me think for a minute.
I'm not sure we do for battery voltage, but let me check.
This is on the Feather M4. { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_PB01) }, { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_PB01) },
What Dan said.
YW.
Hokay, so, MicroPython. REPL says MicroPython v1.18 on 2022-03-23; LILYGO TTGO LoRa32 with ESP32 I downloaded the generic ESP32 version, and it's reporting that board.
Wondering if that's why the pin assignment is failing.
But not sure how to get the right version if the website isn't providing what I need.
I mean, yeah, build it, but I don't know how to do that.
@slender iron thanks for the pointer to FrameBuffer. FrameBuffer experts: Are there any good examples showing to how a framebuffer gets hooked up to a physical display (eg how a display is initialized and connects the display board to a framebuffer) and then how displayio and framebuffer are setup to talk together.
I know when I use it on broadcom, it handles the framebuffer to display bits
it is also used for matrix displays
and protomatter handles the framebuffer
@idle owl I think you want the esp32 spiram build for the v2
I saw that in the issue you filed, and downloaded it and flashed it just now.
Type "help()" for more information.
>>> from machine import Pin, I2C
>>> i2c = I2C(1, scl=Pin(20), sda=Pin(22), freq=400000)
E (69290) i2c: /home/micropython/esp-idf-v4.2/components/driver/i2c.c:767 (i2c_set_pin):scl gpio number error```
Still getting the same error.
Use I2C 0
Yes
Same error.
I did that earlier, and it did work.
I can do it again though, hold on
Worked this time too.
I donโt know why it works for me.
I'm simply trying to do the I2C scan to see if the device shows up. Can't even get that far. ๐
Just canโt use it
Ah.
I copied that line from the "Getting Started with ESP32" page. Am I doing it wrong?
Iโll be home in about 15 min. Iโll check mine again.
Ok, thank you!
@idle owl this does work in arduino?
Which? I2C? or...?
I have not tried it
haha / argh
Scan at least worked in Arduino.
Author: Alberto Garciฬa Hierro <alberto@frsky-rc.com>
Date: Wed Apr 21 22:01:14 2021 +0100
Enable IO20 on ESP32
Some newer ESP32 variants (like ESP32-PICO-V3 and ESP32-PICO-MINI-02)
do implement this pin and it can be used as a normal GPIO.
Fixes #6016
Fixes #6837
Closes https://github.com/espressif/esp-idf/pull/6918
diff --git a/components/soc/esp32/gpio_periph.c b/components/soc/esp32/gpio_periph.c
index a413203741..d993cb42ac 100644
--- a/components/soc/esp32/gpio_periph.c
+++ b/components/soc/esp32/gpio_periph.c
@@ -35,7 +35,7 @@ const uint32_t GPIO_PIN_MUX_REG[SOC_GPIO_PIN_COUNT] = {
IO_MUX_GPIO17_REG,
IO_MUX_GPIO18_REG,
IO_MUX_GPIO19_REG,
- 0,
+ IO_MUX_GPIO20_REG, // This corresponding pin is only available on ESP32-PICO-V3 chip package
IO_MUX_GPIO21_REG,
IO_MUX_GPIO22_REG,
IO_MUX_GPIO23_REG,
diff --git a/components/soc/esp32/include/soc/soc_caps.h b/components/soc/esp32/include/soc/soc_caps.h
index ae88415cb4..03597fe989 100644
--- a/components/soc/esp32/include/soc/soc_caps.h
+++ b/components/soc/esp32/include/soc/soc_caps.h
@@ -116,8 +116,8 @@
// set pullup/down/capability via RTC register. On ESP32-S2, Digital IOs have their own registers to
// control pullup/down/capability, independent with RTC registers.
-// 0~39 except from 20, 24, 28~31 are valid
-#define SOC_GPIO_VALID_GPIO_MASK (0xFFFFFFFFFFULL & ~(0ULL | BIT20 | BIT24 | BIT28 | BIT29 | BIT30 | BIT31))
+// 0~39 except from 24, 28~31 are valid
+#define SOC_GPIO_VALID_GPIO_MASK (0xFFFFFFFFFFULL & ~(0ULL | BIT24 | BIT28 | BIT29 | BIT30 | BIT31))
// GPIO >= 34 are input only
#define SOC_GPIO_VALID_OUTPUT_GPIO_MASK (SOC_GPIO_VALID_GPIO_MASK & ~(0ULL | BIT34 | BIT35 | BIT36 | BIT37 | BIT38 | BIT39))
diff --git a/docs/en/api-reference/peripherals/gpio.rst b/docs/en/api-reference/peripherals/gpio.rst
index 9f92f8d5be..93a5e05523 100644
--- a/docs/en/api-reference/peripherals/gpio.rst
+++ b/docs/en/api-reference/peripherals/gpio.rst
@@ -118,6 +118,11 @@ Overview
-
-
-
+
+ * - GPIO20
+ -
+ -
+ - This pin is only available on ESP32-PICO-V3 chip package
* - GPIO21
-
```a change is needed in esp-idf for it to work, such as this one. It's in esp-idf v4.4 tag but not in older ones. which version is actually used to build micropython?
@onyx hinge wild guess. Did you erase the flash before loading MP?
I don't even have one of these boards ๐
I meant @idle owl
I did, both times.
Shucks
The scl gpio error says esp-idf-v4.2
Oof.
# build the boards, based on the IDF version
for board_json in $(find boards/ -name board.json | sort); do
mcu=$(cat $board_json | python3 -c "import json,sys; print(json.load(sys.stdin).get('mcu', 'unknown'))")
if idf.py --version | grep -q v4.2; then
if [ $mcu = esp32 ]; then
# build standard esp32-based boards with IDF v4.2
if echo $board_json | grep -q GENERIC; then
# traditionally, GENERIC and GENERIC_SPIRAM boards used manifest_release.py
MICROPY_AUTOBUILD_MAKE="$MICROPY_AUTOBUILD_MAKE FROZEN_MANIFEST=$(pwd)/boards/manifest_release.py" build_board $board_json $fw_tag $dest_dir bin elf map
else
build_board $board_json $fw_tag $dest_dir bin elf map
fi
fi
else
if [ $mcu != esp32 ]; then
# build esp32-s2/s3/c3 based boards with IDF v4.4+
build_board $board_json $fw_tag $dest_dir bin elf map uf2
fi
fi
done
oof that paste, but yes they build esp32 with idf 4.2 and the newer chips with idf 4.4. so this won't work without the right idf
Hmph. Ok.
but why does it work differntly for me -- at my desk -- wiil have an example in a minute
Type "help()" for more information.
>>>
>>> from machine import Pin,I2C
>>> i2c = I2C(0,scl=Pin(20),sda=Pin(22))
>>>```
is this the same build artifact that kattni used?
but Pin 20 in non functional for me -- Is that related to the IDF?
Looks like it....
should be -- I will upload the file I loaded
Type "help()" for more information.
>>> from machine import Pin, I2C
>>> i2c = I2C(1, scl=Pin(20), sda=Pin(22), freq=400000)
E (69290) i2c: /home/micropython/esp-idf-v4.2/components/driver/i2c.c:767 (i2c_set_pin):scl gpio number error```
er
I2C 0 gives the same error
It's not identifying itself closely, since that's not exactly "v1.18"
that was my first try.
Right but the build day is the same, and they only do nightlies, afaict.
I can use Pin 20 all I want, but it always reads 0 --- even if I just set it as an output and write a 1 to it
Identical hash to what I downloaded.
Yes to both.
says V2 in big letter
Yep ๐
I'm baffled
F? weird, how did you get my report card from 9th grade health class?
both as to why you get differnt results and why Pin 20 does not work for me....
Agreed.
@onyx hinge what is the issue with the IDF version?
@solar whale they had to add BIT20 to SOC_GPIO_VALID_GPIO_MASK so that it became possible to use pin GPIO20
idf 4.2 does the check a bit differently but yeah
it has const uint32_t GPIO_PIN_MUX_REG[GPIO_PIN_COUNT] = { and in the middle: ```c
IO_MUX_GPIO18_REG,
IO_MUX_GPIO19_REG,
0,
IO_MUX_GPIO21_REG,
IO_MUX_GPIO22_REG,
I don't know why kattni and jerryn would have different wrong results but I'm pretty sure it's not going to work with today's idf 4.2.
Kattni, you got thrown in at the deep end ๐
When am I not?
Is there a possibility for a weird bug? No? TOO BAD. KATTNI WILL FIND ONE.
where do micropython nightly builds come from?
So I guess it is in MP's court to update to 4.4
Their setup, I believe.
They build and upload to the downloads section of the website.
I only just now figured out the snek in the MicroPython "M" logo. ๐คฆ๐ปโโ๏ธ
I'm not sure what else to do -- except wait for a comment on the issue -- hopefully it will be seen even on a closed issue.
I literally can't find the script that checks out esp-idf version 4.2 within the micropython github. I can find evidence of 4.0.2 and 4.4. ```tools/ci.sh: ci_esp32_setup_helper v4.0.2
tools/ci.sh: ci_esp32_setup_helper v4.4
I would look at how long it took Damien to respond at the beginning of the issue, and then post a new issue after that amount of time if there is no response. Refer to the closed issue in the new one to link them.
but @idle owl maybe you should add your experiences - since they are different. -- feel free to open a new issue and reference the old one if you prefer.
Hah. We're on the same thought process.
I'll open a new one so it's not you reposting the same thing.
further action is required and the existing issue is closed, so there should be a fresh issue. my feeling.
Yeah agreed. Jerry, you can post to the new issue if you like once I file it.
It's kind of a new problem though.
Pin 20 is exposed, it's not working for I2C is the issue.
can you jsut do p20 = Pin(20,Pin.OUT)
then ```p20.value()
p20.value(True)
p20.value()
that is, is it just I2C
E (2562560) gpio: gpio_set_direction(263): GPIO number error```
MicroPython v1.18 on 2022-03-23; ESP32 module (spiram) with ESP32
Type "help()" for more information.
>>>
>>> from machine import Pin
>>> p20 = Pin(20,Pin.OUT)
>>> p20.value()
0
>>> p20.value(True)
>>> p20.value()
1
>>>
I thought earlier you said the value was always 0
earlier when you got 0, was an i2c device connected?
it's remotely possible that a freshly reset device could be have differently too
bah ````>>>
MPY: soft reboot
network config: ('10.0.0.161', '255.255.255.0', '10.0.0.1', '75.75.75.75')
MicroPython v1.18 on 2022-03-23; ESP32 module (spiram) with ESP32
Type "help()" for more information.
from machine import Pin
p20 = Pin(20,Pin.OUT)
p20.value()
0
p20.value(True)
p20.value()
1
p20.value(False)
p20.value()
0
p20.value(True)
p20.value()
0
is it just changing randomly? sum(p20.value for _ in range(1000))
sum(p20.value() for _ in range(1000))
0
okay, so it's not randomness
as you said may have been a reset condition
oh wait -- I hat it connected to Pin 13
with it disconnected
106
>>> ```
I clicked the reset button, and tried to make p20 again, and am getting the same error.
wait what, connecting something to pin 13 makes pin 20 behave differently?!
I'm going home.
106
>>> sum(p20.value() for _ in range(1000))
92
>>> sum(p20.value() for _ in range(1000))
86
>>> sum(p20.value() for _ in range(1000))
93
>>> ```
I had pin 20 connected to pin 13 so it could blink the led
So I'm not sure what to put in this issue ๐
I would just report the errors you see. I'll add my contradicting errors ...
I am not having a good time imagining how jerryn's getting these results
Ok.
all of kattni's results make sense to me, idf doesn't want to support pin 20
I've tried to build micropython for ESP32 but using IDF 4.4. No idea if this works, and no hardware to test on.
Ooh on it.
is taht for the SPIRAM
this is esp32 build-GENERIC/micropython.bin and the ref is v1.18-244-g66fe3d5cb
I don't know if it's spiram or not because frankly I don't understand how esp-idf builds. but spiram is not related to the issue, so a non-spiram build should also load(?)
teh V2 is the SPIRAM version
OK, well, it's GENERIC not GENERIC_SPIRAM
Tah tis a different build in the MP site.
Trying it anyway, I guess.
It is sad...
I have to go -- sorry -- will check on how you made out later, but I can't do any more on this untill tomorrow morning.
๐ฆ
Connecting to serial is displaying this repeatedly, no breaking out of it: rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 271414342, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3f400020,len:197668 ets Jul 29 2019 12:21:46
No worries! Thanks for your help!
You too!
OK, boo. 4.4 + GENERIC_SPIRAM doesn't fit in flash. ```/home/jepler/.espressif/tools/xtensa-esp32-elf/esp-2021r2-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: micropython.elf section .iram0.text' will not fit in region iram0_0_seg'
/home/jepler/.espressif/tools/xtensa-esp32-elf/esp-2021r2-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: IRAM0 segment data does not fit.
/home/jepler/.espressif/tools/xtensa-esp32-elf/esp-2021r2-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: region `iram0_0_seg' overflowed by 440 bytes
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
Hmm.
I hope you can get yours esptool'd back to something that doesn't bootloop ๐
On it.
Thanks for trying @onyx hinge Good evening !
No worries. It's back.
It was clearly foolhardy to submit & accept that PR without testing (aside from building) but that's water under a bridge now.
it's so weird to not have CI artifacts from github but they have their own ways I guess
Yeah...
Hmm......
>>> i2c = machine.I2C(scl=machine.Pin(21), sda=machine.Pin(22))
Warning: I2C(-1, ...) is deprecated, use SoftI2C(...) instead
>>> i2c = machine.SoftI2C(scl=machine.Pin(21), sda=machine.Pin(22))
>>> i2c.scan()
[]
>>>```
The power LED isn't illuminated on the I2C breakout, so it's not getting power from the STEMMA QT connector.
Looking to see which thing is the power pin
21 & 22 now, not 20 & 22?
oh and yes there's the power pin to activate, micropython won't do that for you
Oooooohhh... I did it!
hold on
scanning again
I pasted that... no wonder it worked
I didn't notice the pin number difference.
No, it's failing.
I got power to the breakout, but I2C is failing again.
E (437660) gpio: gpio_set_direction(263): GPIO number error
E (437660) gpio: gpio_set_level(215): GPIO output gpio_num error
>>> i2c = machine.I2C(scl=machine.Pin(20), sda=machine.Pin(22))
Warning: I2C(-1, ...) is deprecated, use SoftI2C(...) instead
E (449630) gpio: gpio_set_direction(263): GPIO number error
E (449630) gpio: gpio_set_level(215): GPIO output gpio_num error```
Need the 0 before pin
E (528380) i2c: /home/micropython/esp-idf-v4.2/components/driver/i2c.c:767 (i2c_set_pin):scl gpio number error```
Itโs backโฆ.
So I didn't actually get anywhere. ๐ฆ
Though I apparently learned enough to make a power pin work without help.
that's still with their nightly, since mine didn't work at all?
Yes
Progress is not always forward.
This board has both types of USB connectors, a display and buttons
to select items on the display. It also has a micro-B connector for
the UART output.
Here's what I have for the issue:
I submitted the fix to #8393 to expose pin 20 on ESP32. On the Adafruit Feather ESP32 V2, SCL is pin 20. When trying to initalise I2C, it is not accepting pin 20 as a viable option for SCL.
>>> from machine import Pin, I2C
>>> i2c = I2C(0, scl=Pin(20), sda=Pin(22))
E (2540280) i2c: /home/micropython/esp-idf-v4.2/components/driver/i2c.c:767 (i2c_set_pin):scl gpio number error
I2C set up works with pin 14 as SCL.
If I try to simply init pin 20 as an output, it also fails.
>>> from machine import Pin
>>> p20 = Pin(20, Pin.OUT)
E (19500) gpio: gpio_set_direction(263): GPIO number error
It has been suggested that perhaps the issue is resolved in the ESP IDF v4.4, but an attempt to build MicroPython with that version resulted in a failure to fit in flash. So, I have not tested this possibility.
Feels like I'm out of my wheelhouse here, so it seems awkward.
you gotta power past the awkwards, that is all
Does that seem acceptable?
you can say "@onyx hinge suggested that ..." it's ok
Ok, thank you
otherwise no change to suggest
@solar whale When you're around, https://github.com/micropython/micropython/issues/8440 is filed.
Thanks. Iโll repeat my tests and add them in the morning.
Thank you!
OK, I need to go dinner before our meeting.
Be back in a bit.
What exact code are you running? The prints don't match the code. (udp vs tcp).
I'm able to run a modified version ok:
code.py output:
192.168.1.94
Starting mDNS server...
_http _tcp
BRW7429AF6E7F02 Brother HL-L2340D series _http _tcp 80
_udp
_upnp _tcp
_udp
My version:
import wifi
import mdns
print(" Connecting", end="\r")
wifi.radio.connect("ssid", "password")
print(wifi.radio.ipv4_address)
print("Starting mDNS server...")
server = mdns.Server...
That's the right code (well, I changed it to print the IP address when connected). If I run that code above as-is, it works, but, for example, _http + _udp crashes.
supervisor.set_next_code_file(__file__, reload_on_error=True) hum this treats KeyboardInterrupt as an 'error' so it tricked me for a bit how to get out of it.
I wonder if it is an S2 vs S3 thing. I tested on S3s. I also tested with a later version off main.
safe mode via reset button would be one way
Simplifying the checks fixed it.
Fixes #6141
Amazing how a misplaced NOT operand can mess up a whole utility
I looked through the framebuffer code, and it looks like it creates a memory buffer and displayio (somehow) can write directly into it. If I can expose the pointer to the ESP32-S3 buffer, this might work. However, in the ESP-IDF code, after it writes to the lcd framebuffer in PSRAM, and it calls to flush the cache. Will the framebuffer code flush the cache? https://github.com/espressif/esp-idf/blob/56659cdf36790e182451cd892ea349b29a27d333/components/esp_lcd/src/esp_lcd_rgb_panel.c#L334-L337
Partially fixes #6091
Corrects error where non-scaled frame buffers were not displaying properly.
There is still a hard fault occurring that will take more time to figure out (something with memory release and the REPL).
Ok, Iโll look at that. Also, I canโt decipher how displayio โknowsโ itโs a framebuffer and writes directly to memory.
I think that's FramebufferDisplay's job
the whole group/tilegrid stuff writes into memory with a given format
This has a lot of tentacles, so it will take me a bit to grasp all of them.
ya, it's not simple
I need to get out my pinboard and string again.
Thanks, thatโs a great help! I didnโt realize frameBufferDisplay had its own updating code. I mistakenly assumed it relied on displayio. Thanks for the pointers!
it's a peer of Display I believe
Hi! I was wondering if anyone can help me with my problem. I have a project for school, and I'm trying to operate 16 individual servos on circuit python using a 16-channel PCA9685 connected to an Arduino nano. Right now, I'm just trying to have one servo on channel 0 move, so that I can test them individually for functionality purposes. However, I'm getting this error on circuit python and I'm not sure if it's a hardware or software problem. Any advice? Attached is my simple code and then the error ๐ซ .
that's a question for #help-with-circuitpython let's go there
circup folks may be interested in pipkin from the creator of thonny: https://forums.adafruit.com/viewtopic.php?f=60&t=189621
I've replicated this on an S2.
@split ocean I made some progress on a RotatedPolygon helper class:
Animating very quickly has some clipping artifacts. But for static or relatively slow moving things it will simplify things I think. Perfect for things like the triangle flags across the top of your latest demo
It's pushed into vectorio_helpers with a new minimal example showing it's usage: https://github.com/circuitpython/VectorIO_Helpers/blob/main/examples/rotated_polygon_simpletest.py very early draft though, no docstrings yet.
@lone axle nice!
Ooh, the previous video accentuates the clipping because it's moving by 10 degrees each frame. Moving by only 1 degree it's much smoother:
do you base pivot point on COG?
Not sure I know what COG mean
sorry, center of gravity, or some other geometric center
(COG was a sort of misnomer that stuck in cg animation)
Ah. I think that it rotates around the origin point (0, 0) in the plane with the points it's initialized with.
picking an optional pivot point would be highly rad
So if you use some negative and some positive starting points it will rotate about the center. I think mine is not quite the real center because I eyeballed the points to use to get it centered-ish.
thanks I'll play around with it
I'll need to play with it some more to get a feel for how it works. I think it should be possible to make the pivot point more arbitrarily selectable by transforming the points before feeding them to the rotation math.
right on, this is exciting
S3 is quirky too, but I think PR fix will fix S3 also. Thanks!
I often put a while True: loop after test code (with a pass or a sleep or a print) because I don't want to immediately drop into the REPL, partially since sometimes memory effects can take a moment to manifest. On S3, the non-existent checks would not crash immediately, but would either reset the serial connection or safe mode after entering the while loop.
mp_obj_new_tuple already sets the length to n, so instead of special casing num_results == 0, you can remove the assignment of len below.
@proven garnet I merged your pull request and released a new version with the initialize command. I also added an directory option to the create command and some tests to make sure creating/init in an existing directory didn't copy over existing files (hopefully).
@split ocean bedtime soon for me. But I just pushed a tweak to the RotatedPolygon for different colors, and a new example that draws these pretty rainbowy kaleidoscope-ish designs https://github.com/circuitpython/VectorIO_Helpers/blob/main/examples/rotated_polygon_rainbow_circle.py
ooh pretty! thanks @lone axle great stuff
I'm using the artifact from a7afd66 (
adafruit-circuitpython-lilygo_t_display_rp2040-en_US-20220320-1472b86.uf2). One of my boards seems to work, the other seems to have an issue with the display. It's wired as the demo (https://github.com/Xinyuan-LilyGO/LILYGO-T-display-RP2040/blob/main/firmware/firmware.uf2) runs fine.
It works just fine on two of the boards I got, so I am not sure ...
@fabaff BTW, I did not hear back from raspberry foundation at all on the PID request, did you get any response from them for your request? I am thinking to file the request again maybe they have system problems.
Would you suggest I change the value in mpconfigboard.mk to match the lsusb results? I don't think the esp32s2 one is using the factory value though.
Do you have any error you get from serial or it's not booting at all?
Unfortunately no error or other indication about the problem. I guess it's a hardware issue with the display. The unit is working fine otherwise.
did you get any response from them for your request?
No, I didn't
I added my notes -- still no idea why we get different results....
Does anyone know what board the "cp32-m4" is? It's in the duplicate pid/vid script, but was never documented on circuitpython.org. https://circuitpython.org/board/cp32-m4/
huh added by bryan / siddacious
To me, it made more sense to track which boards go together in a cluster; when reviewing a request to actually use a duplicate vid/pid, you want to know what board(s) it is aliasing.
I also revamped the detection of non-USB boards so that a board .mk file that couldn't be parsed by the code here would raise a problem instead of just being skipped for the purposes of checking.
There were some lines with comments on the end, and some variation in capitalization of the IDs. These are all n...
CircuitPython version
adafruit-circuitpython-raspberry_pi_pico-en_US-7.2.3
Code/REPL
def PlayTone(inst, length, pitch, mixer, volume, effect):
tone_frequency = int(440 * (pitch ** 1.059463094359))
tone_length = int(length // tone_frequency)
sine_wave = array.array("h", [0] * tone_length)
for i in range(tone_length):
sine_wave[i] = int((1 + math.sin(math.pi * 2 * i / tone_length)) * (volume / 7) * (2 ** 15 - 1))
sine_w...
It is odd, for sure.
Tested on PCA10059 dongle -- LED works and I am able to connect to BLE vi code.python.org and IOS Glider
@lone axle Hey can I rename the example/ directory in https://github.com/adafruit/Adafruit_CircuitPython_PortalBase to examples/ ? I'm trying to clean up adabot a bit and it wants the examples directory to be called examples, even if there's just one example
yes, definitely. It was meant to match all of the other normal libraries, I must have overlooked the plural name.
Cool
@onyx hinge esp32-m4 was a board that was geared to fitting a SAMD51 in an ESP32 footprint. never was produced
Quick show of L or D, who here uses light mode appearance on GitHub, and who uses dark mode appearance?
Pretty close to equal. Interesting, though I was basically expecting as much.
A fix for the reason I asked just popped into my head so before I bother asking for opinions on a thing, I'm going to try my fix.
it doesn't look like there is any 'flush' equivalent for busio.UART? Is this something that's not supported by the hardware?
Does it happen if you don't play the sound but do everything else? I wonder if there is an interrupt routine that we're doing but should be in RAM so it doesn't cause flash reads.
I set it to added below in case we can make the wrapper objects for all of the results. So, it may be different than the value at alloc time. Want me to make it compare the current len vs added and then set it if different?
So I resolved the issue with the white border not working on light mode by making it grey or Blinka-purple. But now I'm not sure which one looks best. I also included the original version with no border, which looked fine on light mode, but optical illusion made it look smaller than the other badges on dark mode. Thoughts? I'll upload them separately so folks can use reactions to cast their "votes".
No border:
Grey border:
Blinka-purple border:
I believe busio.UART writes synchronously. in other words, it flushes immediately
it should all be transmitted when the write call returns
(it might be once the byte is copied to the peripheral)
I had to add a 1ms sleep after the write before I toggled the drive enable line on a RS485 transceiver otherwise I would get bit corruption on the last byte, so it seems like it didn't fully push out that last byte before the line was de-asserted
what port?
the implementation is here: https://github.com/adafruit/circuitpython/blob/main/ports/atmel-samd/common-hal/busio/UART.c#L373
it's not unheard of to return a little too early
I'm not sure what the SERCOM exposes that we could wait on
looks like the write is non-blocking, but it waits until all bytes are transmitted
does async_status.txcnt get reset to 0 before each transmission?
I have no idea. I haven't looked into it
cause it just checks if the transmission count is >= the length of the data before returning
tx_cnt is incremented when the byte is written to the DATA register for the SERCOM peripheral. So it's not necessarily completely sent. Perhaps we should check usart_async_is_tx_empty() as well in the ASF4 driver API. (that checks an interrupt bit; I'm not sure it reflects that the byte has been completely sent. would need to check the datasheet).
@tulip sleet where is tx_cnt zeroed, before each write?
circuitpython/ports/atmel-samd/asf4/samd51/hal/src/hal_uasrt_async.c (from ASF4)
it is copied from tx_por
tx_por is zeroed in uasrt_async_write(). also see uasrt_process_byte_sent(), which increments tx_por.
got it, thx
@tulip sleet what is the httpserver code based on?
looking for that...
I think it was this, but I redid it a lot: https://nippycodes.com/coding/circuitpython-esp32-s2-http-server/
๐
It might be more interesting to use https://github.com/deckerego/ampule or https://github.com/Neradoc/circuitpython-native-wsgiserver
i didn't know about either of those beforehand
I looked at them
I've run up against the fixed route paths
I was thinking I'd do /fs/<file path>
i added routing only at the last minute
it bugs me that routing isn't just an if/elif
that sounds fine; one or both of those has file serving in their examples/ directory
but no frameworks I can find actually do that
I agree, I thought that was weird; it's WSGI or nothing
I was looking at ASGI too but it uses dictionaries everywhere
i looked at flask and some other stuff, but they were all too complicated or depended on urllib or whatever
pfalcon did picoweb
https://github.com/jczic/MicroWebSrv2 has 428 stars
I couldn't find a common C http server either
ESP-IDF has a custom one
is too big
you could take the routing arg stuff from one of the tiny WSGI servers and add it on to mine. I have no attachment to what I did; it's just that my first prio was serving a big file, and I had to make that work
I think my gut wants to undo the routing stuff
and have an iterator that returns a request
you can take it out; it's not that functional; it was just an idea I had at the last minute
I generally don't like function calls that never return because they hide stuff
for people who want routing, we can have a WSGI server
Change sdkconfig to enable SPIRAM support on muselab nanoESP32S2 wrover board. The board has 2MB of SPIRAM.
I mean with other CPython web code. it should be easy to sit on top of CPython sockets
if you make an iterator instead of serve_forever(), what will each iteration return?
a request object
after it has been served?
or will you need to call a respond function
note that wsgiserver does not call a function that does not return, it polls, you specify an application when setting it up, it's that app that does the routing if any (using adafruit_wsgi in the example)
so it could serve a file if there is no matching route
it was a bit tricky to get the root of the file serving path right
I don't understand the "application" pattern either
or, like in the example, file-serving is in the app
what they call app is an object instance that you can call with the request data
I'm reading all this and think I really have to read up on wsgi. Been too long since I really looked at stuff like that
https://peps.python.org/pep-3333/ is the defn of WSGI
technically it can also just de a function
with rationale
def do_the_thing(request, start_response):
# do the thing
wsgiServer = server.WSGIServer(80, application=do_the_thing)
wsgiServer.start()
while True:
wsgiServer.update_poll()
Scott, Neradoc would steer you right on this, more experienced than us with this
I'm not that experienced though, but the core code is really that simple, it calls the "application", which is a function (or a callable object), whenever there's a request in the poll
my struggle with these apis is that they put a layer of code between the code.py code and the users code in a function
which is why I lean towards a loop over requests
I totally get that this is weird for how it is done in normal cpython
yeah it's a callback that is automatically triggered by the poll
which is my preference personnally
right. I'm not a fan of hidden event loops
basically like the neotrellis library versus keypad
but your idea can be made into the other if that's what the user prefers too, with a library
ya, and they can coexist
I like this approach: https://kamilwu.medium.com/a-guide-to-python-asyncio-part-2-a30b9ce918ca
I like that it gives you a connection level function
5 in board.c is CS. Should it be called ENable here?
EN is the name used in the ESP docs. It functions like CS. I could add an alternate here.
Makes sense to me just wanted to be sure it wasn't something copy/pasted by accident.
First bug: with uart workflow (esp32-c3 boards mostly), pressing ctrl+c in the repl does nothing, while it should schedule a keyboard interrupt. In the usb cdc workflow this is done by setting a "wanted" char of ctrl+c and calling mp_sched_keyboard_interrupt when it's seen. Note the wanted char is only listened for on the first cdc interface (usb_cdc.console an...
Thank you for the explanation! Would you mind including a version of it before event_task to explain how it works there?
@slender iron do you have any objections to how i wrote the control flow for installing the uart driver? If needed i can try make it less... like that
I thought about it but no since the install params are different
one thing I thought about was if you should just always do the event
it seems more straightforward for sure
and its not like esp platform would care about one extra task doing nothing
you just need to ensure you only care about ctrl-c on the debug uart then
but waking the task is ok
is there a list of supported flash chips?
@rmilby13 That is a good idea. However I would recommend you look into using two RP2040s. Do you want to create a repo with discussions enabled where we could chat about it? If you want to use a single RP2040 this gets more complicated. There is a lot to talk about and they do not like that stuff here. I honestly am not sure they will get around to this, since its the only multicore MCU they support. Any meaningful API for building this would need their support, so that is too bad. They could...
CircuitPython version
adafruit-circuitpython-bundle-7.x-mpy-20220322
UF2 Bootloader v3.14.0 SFHWRO
Model: Metro M4 Express
Board-ID: SAMD51J19A-Metro-v0
Code/REPL
from adafruit_bitmap_font import bitmap_font
from adafruit_display_text import label
from adafruit_led_animation.animation.rainbowsparkle import RainbowSparkle
import audioio
import audiomp3
import board
import digitalio
import displayio
import framebufferio
import neopixel
import r...
Can you post the code that sets up the mixer? I haven't been able to replicate the corruption on the Feather RP2040.
I made the discussed changes: the task now starts for every uart and added some more comments. Let me know if theres anything else I should do.
Thanks for the merge! Though .... I've just re-compared the pinout to the schematic and LED_DAT should be LED_DATA ๐คฆ. Do I need to raise a separate PR for that, or can the change be merged again if I just update this branch?
Also, we have the 3 ADC pins labelled ADC0, ADC1, and ADC2 in the schematic, but A0, A1, and A2 in the pin def. I believe that's to be consistent with CircuitPython's typical naming so probably doesn't need changing ๐คท .
If anyone with the keys to RTD has a chance, adafruit_motor's documentation failed to build
I couldn't find anything small to submit a PR for to get it to retrigger ๐
I am triggering another build
Thanks!
ok, it worked!
Fixed, thanks again!
The only other related question I have is what's up with https://github.com/adafruit/Adafruit_CircuitPython_Pixelbuf
Does that have an RTD project made for it?
Because it's status is unknown and it brings you to a broken link
it is missing the webhook; I'll add it
I triggered the motor build directly in rtd
This is confusing: we have https://github.com/adafruit/Adafruit_CircuitPython_Pixelbuf and https://github.com/adafruit/Adafruit_CircuitPython_Pypixelbuf
Yeah, was it that pypixelbuf got changed to pixelbuf?
I can't find usage of pypixelbuf anywhere
I noticed that while I was typing some time ago and meant to follow up haha
we renamed it to adafruit_pixelbuf in the C implementation. We need to archive one of these, I think. @idle owl ^^
anyway, I will add the other one
Sweet, thanks!
@idle owl we have pixelbuf and pypixelbuf in the bundle. Can we drop one now because we aren't building <7.x bundles?
I think we would drop pypixelbuf and archive https://github.com/adafruit/Adafruit_CircuitPython_Pypixelbuf, or at least add some warning to its README
That worked, closed the pertinent issue!
@tulip sleet it's:
MP_DEFINE_CONST_FUN_OBJ_0(time_not_implemented_obj, time_not_implemented);
(that is swapped in the module globals table based on defines)
hmm, so maybe we should make it a FUN_OBJ_VAR (and change the signature)
testing it on QTPY, that seems to take 24 more bytes, maybe not worth it
or FUN_OBJ_VAR_BETWEEN, with 0 and 1
Does it mess up Thonny?
Right now you don't see the NotImplementedError, which is kinda bad. You see th arg error
It's worth 24 bytes, I think, to make it throw the right thing
in Thonny the error is just ignored, says "could not determine epoch, assume 1970" (I don't know why they need it)
Implemented in #5510.
The current way of writing to SD cards is slow, because the usual path uses "cmd24", which requires that the SD card fully commit each 512-byte block as it is written. (There is limited use of "cmd25" but only when a single writeblocks call spans multiple 512-byte blocks)
Implement cmd25 in sdioio, with logic similar to what was done for sdcardio (#5510)
I instrumented CircuitPython so that I could easily cause RTC overflows.
diff --git a/ports/atmel-samd/common-hal/rtc/RTC.c b/ports/atmel-samd/common-hal/rtc/RTC.c
index e2a67bd17..1d16e9b86 100644
--- a/ports/atmel-samd/common-hal/rtc/RTC.c
+++ b/ports/atmel-samd/common-hal/rtc/RTC.c
@@ -68,6 +68,9 @@ int common_hal_rtc_get_calibration(void) {
}
void common_hal_rtc_set_calibration(int calibration) {
+ mp_printf(&mp_plat_print, "Warping RTC in calibration setter\n");
...
@tulip sleet ^ I'm hoping I did something wrong in my testing setup but it seems the RTC can "overflow" well before the count register actually wraps around. does that make any sense to you at all?
you mean the overflow interrupt gets set early?
yes, it seems that way
i am just looking at the code
RTC_Handler overflowed with overflow_ticks=0xfffffffd
I saved off the value of the count register inside the interrupt and then print it later outside the interrupt
i was hoping if we synchronize the read then it should be sync'd up. I didn't read anything in the datasheet that it might be early
so my/your hope/assumption is unfounded
i did some forum searching etc about this and didn't see any cautions. We can open a ticket with Microchip about it too
seems very bad
adding the 'sync' in the interrupt doesn't markedly change the outcome. ```while ((RTC->MODE0.SYNCBUSY.reg & (RTC_MODE0_SYNCBUSY_COUNTSYNC | RTC_MODE0_SYNCBUSY_COUNT)) != 0) {}
overflow_flag = true;
overflow_ticks = RTC->MODE0.COUNT.reg;
i have to be afk for a bit but will check back with you about this, not sure how to get around it
just not use the overflow interrupt
though that's not working for me either, is there a 2nd bug?
you mean you are just checking for wraparound?
yeah basically.```c
static uint32_t _get_count(uint64_t *overflow_count) {
#ifdef SAM_D5X_E5X
while ((RTC->MODE0.SYNCBUSY.reg & (RTC_MODE0_SYNCBUSY_COUNTSYNC | RTC_MODE0_SYNCBUSY_COUNT)) != 0) {
}
#endif
// SAMD21 does continuous sync so we don't need to wait here.
uint32_t count = RTC->MODE0.COUNT.reg;
if(count < rtc_old_count) {
// Our RTC is 32 bits and we're clocking it at 16.384khz which is 16 (2 ** 4) subticks per
// tick.
overflowed_ticks += (1L << (32 - 4));
}
rtc_old_count = count;
if (overflow_count != NULL) {
*overflow_count = overflowed_ticks;
}
return count;
}
if we avoid caring about exactly when the OVF interrupt fires, we can just look for a wrap in _get_count. Missing one isn't important, unless you don't call a time-fetching function for over 1.5 days.
are you testing this on samd21 or 51?
samd51
it's true, we should test on both
hah OK I think I figured out the other bug, it was in my rtc-warping code
backspacing
you can write RTC->MODE0.COUNT.reg = 0xffffff00; but it doesn't mean that the value changes immediately
so maybe the interrupt is not early after all
OK I'll let this run for a few thousand overflows but I think it's "right" now.
oh, nvm, you are reading it back as already warped
westfw (who is active on the forums, etc.) noticed some synchronization delays on SAMD10: https://community.atmel.com/forum/samd10-rtc
when the clock speed is slow
i'm grasping at straws
so does that equation 5รPGCLK + 2รPAPB < D < 6รPGCLK + 3รPAPB mean that reading the RTC COUNT could be up to 6 RTC ticks behind the interrupt? I was seeing up to 3..
Dodika00 you solve your probleme.Can you help me
the notification didn't seem to make it to discord but I did open a PR https://github.com/adafruit/circuitpython/pull/6202 I'll test on samd21 after lunch
also no workflows were started for that PR ๐ข
Thank you for your detailed report.
RGBMatrix is continuously scanned by software inside the microcontroller using a timer interrupts. NeoPixel has to disable interrupts in order to correctly 'bit bang' the WS2812 protocol. So in this case it is unfortunately going to lead to the matrix glitching or blanking. You may get different results if you can use SPI as the neopixel communication method instead: https://learn.adafruit.com/circuitpython-neopixels-using-spi
I am not sure why MP3 p...
That is for SAMD10, not sure what is in the SAMD51 datasheet.
Same
so in any case, it can be behind. I think your solution is find, though it does have the need to fetch the time often enough
Yes, one can be archived. Whichever one isn't named the same as the built-in version. That was the plan all along, but we couldn't do it immediately.
it is the pypixelbuf one, substituting for _pixelbuf. ok, sounds good. I will make some PR's.
We should literally archive the pypixelbuf repo.
Once we're done making sure it's not referenced.
yes, I will add a message to it. Or do you want to do it or assign someone?
we just need a PR for the bundle
I can archive it, there's a process to it.
i will look in the learn repo
Which I could explain, but could also simply do it in the same amount of time.
Welcome_to_CircuitPython/code.py
13:* adafruit_pypixelbuf.mpy
Hah ok.
Let me know when we're ready to archive. I guess we'll have to manually remove from the bundle? I've never archived a repo that was in the bundle.
i started to do that, but then discovered a bunch of libraries still refer to it, so multiple more PR's:
halbert@tuna:~/repos/Adafruit_CircuitPython_Bundle$ ag pypixelbuf
libraries/helpers/pixelbuf/README.rst
93:This example tests that pypixelbuf works.
97: class TestBuf(adafruit_pypixelbuf.PixelBuf):
libraries/drivers/neopixel_spi/setup.py
39: "adafruit-circuitpython-pypixelbuf",
libraries/drivers/neopixel_spi/README.rst
25:* `Pypixelbuf <https://github.com/adafruit/Adafruit_CircuitPython_Pypixelbuf>`_
libraries/drivers/neopixel_spi/neopixel_spi.py
34: import adafruit_pypixelbuf as _pixelbuf
39: import adafruit_pypixelbuf as _pixelbuf
libraries/drivers/neopixel_spi/requirements.txt
7:adafruit-circuitpython-pypixelbuf
libraries/drivers/dotstar/adafruit_dotstar.py
25: import adafruit_pypixelbuf as adafruit_pixelbuf
libraries/drivers/is31fl3741/adafruit_is31fl3741/is31fl3741_pixelbuf.py
25: import adafruit_pypixelbuf as adafruit_pixelbuf
libraries/drivers/neopixel/neopixel.py
27: import adafruit_pypixelbuf as adafruit_pixelbuf
circuitpython_library_list.md
280:* [Adafruit CircuitPython Pypixelbuf](https://github.com/adafruit/Adafruit_CircuitPython_Pypixelbuf.git) ([PyPi](https://pypi.org/project/adafruit-circuitpython-pypixelbuf))
docs/drivers.rst
513: PyPixelbuf <https://circuitpython.readthedocs.io/projects/pypixelbuf/en/latest/>
Did my first esp32s3 build/flash today with an esp32s3-box and the latest main branch. the build/flash worked great! display works, USB-CDC serial console is operating.
Only oddity is that the USB filesystem is corrupted in a weird way I haven't seen before. the image is what it looks like on my Win11 system but the behavior is similar on an ubuntu system as well.
Is this a known issue (or a familiar pattern) or is it worth submitting a bug?
did you erase flash before flashing the initial stuff?
you can do import storage; storage.erase_fileystem() and see if it fixes it up
in the repl

knew I forgot something ๐ going to do a full erase reflash
let us know if that does not work
Ah yeah. Ok. I'll be around ๐
Thanks for adding a new tool to my 'wtf is this' debugging toolbox! worked great.
it's also good when the filesystem gets corrupted due to resetting too soon, etc.
Thankfully I haven't run into that yet but super good to know.
build/install from main on two other s3 boards i have on hand (devkitc-1-n8r2 and devkitm-1-n8) went great! lots of good work in the last few months on the s3 port. ๐
Is this the builtin font that comes from terminalio.FONT in code? https://github.com/adafruit/circuitpython/tree/main/tools/fonts
depends on the board, I think this one is used by default, but you can override it in the board definition
Thank you, I had recalled seeing on your devices it's a custom one and I found where that was set in the mk files.
One final call for which Adafruit Discord badge you prefer! Add a reaction to which one you like better, if you're interested.
Grey border:
Blinka-purple border:
Really only matters on dark mode - they look basically the same on light mode.
@tidal kiln - neopixel_spi is still at 0.9.3; how do you feel about it being 1.0.0? (I have to make release to change pixelbuf stuff.)
made executive decision to do so, since it's been around for years
Version numbers are free ๐
@solar whale So.... MicroPython question. Is there any point in using the nightly build on the ESP32 V2 Feather since pin 20 doesn't work anyway? Or is there still some improvement in the nightly build?
I'm writing a guide page for MP on the V2, and wanted to know if I should be pointing folks to the nightly, or the stable.
@tulip sleet np. what @idle owl said ๐
None that I am aware of.
Ok thanks!
@onyx hinge should rtc_old_count be reset anywhere? It's fine, right because a hard reset will zero it, and the ticks counter is not reset on a soft reload.
The CI job was never scheduled, not sure how to poke it.
@tulip sleet I rely on it being zero'd at startup. If there was ever a case where we changed the rtc COUNT register we would want to do something about rtc_old_count there, but there is no such place.
I force-pushed the branch and CI has picked it up now
excellent, thanks
Thanks for your excellent sleuthing on this.
I guess you could fix the missed overflow problem (the hypothetical "if you somehow go 1.5 days without calling a time function") by putting the overflow interrupt back and just having its action be to call _get_count and discard the result.
Blergh. Pylint issue I've never run into before, and after reading up on the PEP that led to it, I still have no idea how to fix it. I get what the problem is, but I don't even see why Pylint is failing on the line it's failing on, and I definitely don't see how to resolve it. Implicit string concatenation found in list (implicit-str-concat) is the failure. On line 16 in this file. Where is it even concatenating those into a string? I see it's an item in the for, but it's not used in the prints, so... I'm lost.
@jaunty juniper Your dot is green, but it doesn't mean you're around. If you are around... Do you understand this Pylint failure I'm getting and/or have any suggestions to resolve it?
You're missing a comma between 'WPA-PSK' and 'WPA2-PSK4'
Really? The code runs. Weird. Trying that.
that's why you're getting the "implicit concatenation" warning
๐ Your code has been rated at 10.00/10 (previous run: 9.58/10, +0.42)
yeah:
['Open', 'WEP', 'WPA-PSK' 'WPA2-PSK4', 'WPA/WPA2-PSK'] becomes
['Open', 'WEP', 'WPA-PSKWPA2-PSK4', 'WPA/WPA2-PSK']
Oof.
Why didn't the code barf when run on the board?
Or if it doesn't need that particular authmode, does it ignore it?
(I didn't write this, I've been tasked with getting it on GitHub.)
well actually pylint could also complain about a variable defined but not used since authmodes is not used
so, that it is wrong is irrelevant :p
it's not in the code you posted
for (ssid, bssid, channel, RSSI, authmode, hidden) in station.scan():
oh.
that's singular.
Wow.
I have no idea why either of them are there, then. Or how the code runs happily. But I don't know MicroPython at all, really, so ...
maybe it was originally supposed to match authmode and what is in authmodes, like authmode in authmodes or authmodes[authmode] if authmode happens to be an index...
like some more generic code that was reused
That would make a lot of sense. Limor loves reusing other code.
Hmm. I'm wondering what to do with this then. I mean, it works as-is, but that's not great.
I guess start by asking Limor where it came from. It's not in the quickstart for the board, or the docs for the network module.
oh yeah authmode is an int
that authmodes[authmode] gives you the human readable version
Oh ok
which explains why it was there
except it's not used properly here?
it's not used in this code
like there's a middle piece missing?
Ok
Trying to figure out how to present this to Limor.
I mean, in the end, if it runs, is it worth figuring out where that piece went? Or not and better to ignore it?
I would think authmodes would be more useful for Access Point
you can remove authmodes or add something like:
print(" - Auth: {}".format(authmodes[authmode]))
I tried deleting both authmodes and authmode but it fails on line 14 with ValueError: too many values to unpack (expeccted 5)
Hmm ok...
no you can't change the tuple in the for
yeah, or that too
it's unpacking each result of the scan
Ah ok
like that here, somebody's printer:
(b'DIRECT-C6-HP OfficeJet Pro 6970', b'\x80\xe8,\x02\x1c\xc7', 6, -81, 3, False)
(and you see authmode is 3, which is 'WPA2-PSK')
is the 4 a typo too ?
Someone's random WiFi scanning with the code I posted above. ```* SunGuest
- Channel: 5
- RSSI: -88
- BSSID: 92:....
- Auth: WPA/WPA2-PSK```
Thank you so much! I think I have the right amount of info to take to Limor, and working code either way. Much appreciated!
you may want to use some caution posting full MAC addresses, they can provide location info
right, either way
um... Can I do a string that uses .format(*bssid) but only displays part of it?
":".join("%02X" % _ for _ in buf[4:7]) + ":RE:DA:CT"
Or does it matter for the code, it's don't paste it into Discord?
just Discod
Oh ok ok ok. That makes more sense. Thank you for the heads up.
oops, I should fix that code line, it's adapted for something specific
first three bytes is manufacturer, last three bytes is the specific device
not sure how you get to a location from the MAC of an access point ๐ค
there are databases
I'm happy to be paranoid about that sort of thing.
same
I mean, in google's vaults maybe ?
like, from phones pinging locations of networks they detect ?
@crimson ferry Do you have info on what part is ok to display? Or is it the whole thing together that matters, and showing the first two parts is ok or something?
I need to edit the screenshot for this guide to cover them up.
it's pretty much ok to display the first three bytes, since that's just manufacturer
Keen thank you.
oh yeah some app that does some snooping
Mobile app makers (or their 3rd-party ad "partners") LOVE to have access to wifi to see what's around to pinpoint location even if you have location off (can't do that anymore on iOS from what i understand). Also, retail areas love to watch even client devices as they roam around.
(I just try to stay away from posting any unique identifiers)
Valid approach.
.eu has better laws, but the U.S. is the wild west for data aggregators
ok, enough #general-chat
Heh. Nah, all good. Thank you for the pointers.
Passed Pylint remotely for the PR. And works running it on the board. Seems like a win to me.
Guess that answers that question. Blinka-purple border it is!
does anyone use VSCode + WSL to do their development and building?
Do you want to add it back? If someone is timing something that's really long, it could go that long.
@tulip sleet so the thought would be, it doesn't matter if in the irq the overflow hasn't happened yet, just so that the old-ticks value gets updated so on a real call after overflow the overflow occurs. however, I'm not sure that's bulletproof, because (say) the pre-overflow value could be 0xffff_fffc one time and then 0xffff_fffd the next "overflow", it would not record an overflow.. if we actually care about that case, more thought is required.
do you mean if you got two overflows in a row (as opposed to the next time around)?
no, I meant 3 days later
oh, i see if it was not called at all the next cycle, I see
the userspace code has to be very careful never to call a time function over 3+ days, or it would work just fine. this would be an "every 6 days, a slim chance" problem.
userspace isn't quite the right term
I think the current PR is better than the existing code, in any case, because waiting a complete cycle before calling time is much rarer than calling it a lot
so let's merge and you can write a "Very Long Term" issue. Does that make sense?
I also think it's an improvement, though it still isn't tested on samd21 by me
either just in the normal case or in the overflowing case
can you easily test it with your setting of the clock reg? I think you are almost all set to do that. That would be great.
I would include this in beta.0 or whatever
write on the PR for me to do it and I'll try to get to it on monday ๐
@jwfmcclain any chance you would be able to take a look at this possible fix for your issue?
@jepler, sure, but I think I need a some help finding the right build artifact (M4 Feather Express).
The artifacts are at the bottom of this page: https://github.com/adafruit/circuitpython/actions/runs/2041944567, but GitHub is having trouble right now. Here is a Feather M4 build; just unzip to get the UF2:
fm46202.zip
@jepler I tested this on a CPX, using your test code above, with the SYNCBUSY part commented out. I stopped it after the last runs below. Looks OK, if I understand correctly. Looks like the problem is not present on SAMD21.
Warping RTC in calibration setter count=ffffff06 rtc_old_count=00000000
18725: duration 20141596
Warping RTC in calibration setter count=ffffff06 rtc_old_count=00000000
18726: duration 20080574
Warping RTC in calibration setter count=ffffff06 rtc_old_coun...
@dhalbert that's good, thanks for testing! While I think there's still the very unlikely problem in the case that the time isn't checked for a whole 3-day roll-over (or maybe just a 1.5 day half roll-over, not sure) that an overflow is lost, the fix of adding any calls to time.monotonic() in the program, even at extremely low frequency, would be a good user workaround.
After #6202 I think there's a (new! but extremely implausible) scenario where time will fail to progress. Adding back some form of the RTC interrupt would fix it, but the details got a bit messy as I considered them. Rather than try to fix this even rarer and even easier to work around bug (just call time.monotonic daily!) we decided to take #6202 and file this bug.
Basically, imagine a program that goes through the following steps:
- records a starting time
- waits for an event to oc...
Also, add a space between the value and the unit of measurement (follow the SI standard).
vectorio shapes do not currently support being hidden by the group that contains them.
This sample code illustrates the issue:
import time
import displayio
import terminalio
import vectorio
from adafruit_display_text.bitmap_label import Label
import board
display = board.DISPLAY
main_group = displayio.Group()
palette = displayio.Palette(1)
palette[0] = 0x125690
circle = vectorio.Circle(pixel_shader=palette, radius=25, x=70, y=40)
main_group.append(circle)
...