#circuitpython-dev
1 messages · Page 35 of 1
But as @jaunty juniper is suggesting the error message seems like it comes from the internal format operator not correctly receiving operands
the problem is that the adafruit_logging library uses % internally, so you have to pass a format argument to it: https://github.com/adafruit/Adafruit_CircuitPython_Logging/blob/main/adafruit_logging.py#L327
yeah I don't know actually, it seemed like it at first glance but I'm not quite sure
so log.debug("I2cConnection received raw: %s", self._data_to_log_string(result)) should work
yeah exactly, that sounds like what I suspected, but I haven't checked what the differnce with fstring version or python logging module do
yeah that's what I thought but:
>>> "no format" % ()
'no format'
Ah ok, that makes more sense
so can I fix adafruit logging too, and then my problem goes away 🙂
or are there very good reasons like arduino/samd to use the % version
@Nerdadoc but () isn't a tuple, whereas *args is guarenteed to be at least an empty tuple
fix how it's being called?
() is a tuple
yes it is
it's a special case
fix how it's not compatible with python logging module due to this bug
normally it should be (,)
or special case
ah, my bad, you're right.
that would be welcome yeah 🙂
let the yak shaving continue 😉
something like record = _logRecordFactory(self.name, level, (msg % args) if args else msg, args)
oh clever and simple, was assuming id have to dig into python logging module to compare
on python bracket order and if/ternary etc, does it need the brackets around (msg % args)
?
even if it didn't, it's easier to read with them
you don't have to guess
to be honest, I'm not sure myself, so I put them in there to avoid confusion
@tannewt responding to gpio changes. In the application I am working on, the user presses a button to turn the device on. Also connecting Vbus wakes the system.
oh there was one other technical question, I've had to comment out the future import due to cpy not having absoluteimport, this is the line from __future__ import absolute_import, division, print_function so my question is, is it just for python2 compatibility?
As I know future exists in cpy should I add a stub for absolute import (doing nothing), or if you were me and butchering the library anyway just comment it out everywhere and forgo Python2 compat (what ive done for now).
CircuitPython version
Adafruit CircuitPython 8.0.3 on 2023-02-23; S2Mini with ESP32S2-S2FN4R2
Code/REPL
>>> import wifi
>>> import ipaddress
>>> ipv4 = ipaddress.IPv4Address("192.168.1.100")
>>> netmask = ipaddress.IPv4Address("255.255.255.0")
>>> gateway = ipaddress.IPv4Address("192.168.1.1")
>>> wifi.radio.set_ipv4_address(ipv4 = ipv4, netmask = netmask, gateway = gateway)
>>> wifi.radio.connect(os.getenv('CIRCUITPY_WIFI_SSID'), os.getenv('CIRCUITPY...
The feather tft code only captures print() and not direct serial writes.
That is a known issue I assume? Or is it a non-issue?
(I just got the feather)
can you rephrase your question?
you are typing over webserial and it isn't showing on the lcd?
Hey all! Been a while since I've been in here so not sure where is appropriate to put this so feel free to delete/move this post. Have some news regarding EduBlocks (which as you might remember has CircuitPython support) 🙂
https://twitter.com/all_about_code/status/1654196244678430723?s=20
That seemed to work. On Windows had to connect to it within the OS settings. Then from the browser I could connect
stdout.write over regular serial isn’t printed
Congrats!
wait one moment
oh no it’s just usb_cdc.console not being printed
that’s fine I guess
hmm, supervisor.runtime.serial_connected being always true doesn’t feel right
the usb_cdc stuff work like normal, but the rest are very sus
Well i’m glad I moved to console objects.
This is so exciting! Congratulations on all counts!
I'm curious if specifying the BSSID (and maybe channel) of the hidden AP matters with the current API.
Looks like there's a scan config option to show hidden
https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/api-guides/wifi.html#scan-configuration
which we'd probably do where we allow connect to specify BSSID and / or channel
https://github.com/adafruit/circuitpython/blob/fa9b59d14c156b614410fa26a6228febc207131e/ports/espressif/common-hal/wifi/Radio.c#L304
not sure of wheth...
what are console objects? are you doing vt100 parsing?
If the latter form is more standard and creates less confusion, we should change it
With these you can read .connected, and read in/out_waiting with a single object.
So I made my curses library jcurses just accept these for it's data streams.
This way, I can plug a UART serial object to it just the same way.
And this means I can switch between different consoles in runtime.
I did this so I can in the future make diy ssh by a virtual console object.
Yea makes sense. I had forgor I switched all the prints to that.
Well, when I make it store multiple streams, I will add mirror capability.
I want to eventually make it autoswitch like micropy does.
you can make your own terminal grid and feed it your output
I have enough ansi magic already, any more and my head will explode.
I kinda do mean that.
This is running on the feather.
The display would have a stroke trying to display it regardless.
It would be funny tho.
Maybe when I finish the ljinux display driver stuff, I can make the display a virtual console object too.
stdin would be broken though.
Thanks for submitting. Could you please add the Adafruit product link as well? https://www.adafruit.com/product/5674. Also, please use an image without text if possible. You could use the one from the Adafruit Product link.
This updates the missing boards added in the last couple of releases of CircuitPython, some of the Blinka boards, and I was also able to find enough information on 3 previously hidden boards. I updated a few other boards as well.
thanks Jeff for all of this! this is my first time trying out synthio so trying to catch up a bit. just to make sure i'm understanding everything properly- the idea is that you'd make an array of notes and then tremolo and vibrato is affected live while you're playing? and then at this time, the envelope is more static and is only affected before/after a note is played? in that case i do like the idea of adding the envelope properties to this note object so that everything can be affected whi...
@BlitzCityDIY cracks and pops on speaker is familiar -- i get the best performance using this speaker https://www.adafruit.com/product/4445 with this amp https://www.adafruit.com/product/3006 On some projects I've given that amp 5V from a separate supply to make it happier.
The Metro M7 not showing up has happened a few times, I'm not sure if it's a USB cable issue or other.
the traceback is due to use of range where it's not needed:
>>> for i in range(hz_tones): print(i)
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unsupported types for __lt__: 'int', 'list'
>>> for i in hz_tones: print(i)
...
130
164
196
desktop python gives a slightly different error text that's maybe easier to understand:
>>> for i in range(hz_tones): print(i)
...
Traceback (most recent call last):
File "<stdi...
I've mostly been using other boards than the M7 for this, including the pygamer and now the prop feather.
huh TIL that this works in circuitpython (but only if it's for ... in range...: : ```>>> for i in range(3.1, 7.9, 2): print(i)
...
3.1
5.1
7.1
it's a bug but an unimportant one
oh wow that's right, thanks Jeff. my tiredness is showing ha. i'll try to get some demo code written with the wii controller and post it up tomorrow 🙂
Sure thing, I won't be home until tomorrow afternoon but I'll update it then. Thanks!
the range concept is pretty central to python
Could you also try with "Absolute Newest", linked from the board download page on CircuitPython.org?
Hi Dan, yes I will try the newest over the weekend as well. Thanks
1.I read the lvgl_binding_micropython code. It make the lvgl source file into a module like the the module framebuffer. I think it all run in the vm(loop the lv.task_handle()). so can do embed it!
2.if we use the c source lvgl to make a special ui,just like the peripheral to call!,this can make the lvgl running in the cpu_core0(eg esp32s3,2 core),we just need to call the python vm‘s task to make the task loop,but this have two ways to reach: (1)use the thread, like the micropython’s timer ...
Okay, I just reopened it then. I do typically see -m venv-name as opposed to -mvenv-name, and our own library instructions use that first form.
- Congratulations 🎉 2) The platform you created is amazing, great job and thank you for putting so much effort into making it easier for people to learn programming. 3) Do you have a preferred place or method to search for and/or submit issues? I've noticed the neopixel code that is generated is not complete enough to execute successfully on a device in some cases. Id be interested in attempting to help resolve it as well if you are open to other contributors (though I'll likely need to study up a bit on the JS tools in use). I found the Github here: https://github.com/edublocks/edublocks is that the best place to coordinate development efforts?
Thanks, really appreciate it! There's an in-app feedback section, however in this case I can take a look now at something like this. You can send me a DM pointing me in the right direction if that works for you!
seeing a RP2040 specific I2C quirk
here's test code:
import time
import board
i2c = board.I2C()
i2c.try_lock()
i2c.writeto(82, b"")
time.sleep(0.1)
i2c.writeto(82, b"")
the first i2c.writeto looks like this:
the second one looks like this:
why this lag in the first one?
test setup for ref:
Adafruit CircuitPython 8.0.5 on 2023-03-31; Adafruit Feather RP2040 with rp2040
>>>
also tested with a feather m4, which does not do that
@tidal kiln also not sure but I know that on rp2040 a zero-byte read is a special case that's actually using bitbangio, per a source comment: ```c
if (len == 0) {
// The RP2040 I2C peripheral will not perform 0 byte writes.
// So use bitbangio.I2C to do the write.
hmm. so maybe could be due to change over, from hw to bitbang?
curious what a non-zero followed by another zero len looks like....trying that now...
The UM Feather S3 has now been running 52 hours without crashing. Somewhere between 25 and 52 hours the Adafruit Feather S2 with the Lolin S2 Mini firmware crashed but I didn't capture any information as a terminal wasn't connected at the time. Before I build a debug image and try and capture a traceback, maybe I'll try a Lolin build with CIRCUITPY_ESP_FLASH_FREQ set to 40m.
I had another crash last night. I did not run any display code. So, this
was a clean run of just the asyncio.
On Fri, May 5, 2023 at 12:07 PM RetiredWizard @.***>
wrote:
The UM Feather S3 has now been running 52 hours without crashing.
Somewhere between 25 and 52 hours the Adafruit Feather S2 with the Lolin S2
Mini firmware crashed but I didn't capture any information as a terminal
wasn't connected at the time. Before I build a debug image and try and
capture a traceback, ma...
CircuitPython version
Adafruit CircuitPython 8.0.2 on 2023-02-14; Waveshare RP2040-Zero with rp2040
Code/REPL
import microcontroller
if __name__ == '__main__':
print(microcontroller.cpus[0].frequency)
print(microcontroller.cpus[1].frequency)
microcontroller.cpu.frequency = 1000000
print(microcontroller.cpu.frequency)
Behavior
125000000
125000000
Traceback (most recent call last):
File "stdin", line 5, in module
Attribut...
Hi, it was just added, it's only available in current main.
Which you get from the board's page https://circuitpython.org/board/waveshare_rp2040_zero/
Going through the "Browse S3" link, choosing the language, and downloading the top UF2.
You can consult the latest stable build documentation with the panel on the bottom left.
https://docs.circuitpython.org/en/8.0.x/shared-bindings/microcontroller/index.html#microcontroller.Processor.frequency
I installed
Adafruit CircuitPython 8.0.5 on 2023-03-31; Waveshare RP2040-Zero with rp2040
microcontroller.cpu.frequency = 1000000
still generates AttributeError: can't set attribute 'frequency'
8.0.5 doesn't have it. Only the latest builds have this functionallity.
You can get such a build using the instructions Neradoc provided in the comment above.
Alternatively you can wait for the stable 8.1.0 release.
I figured that out. Pulled the beta and now it works. Thanks!
Sooooooo... I am working on some CircuitPython wifi code, and this is now what I'm getting when I try to run it. CircuitPython core code crashed hard. Whoops! Fault detected by hardware.
The thing I updated was that I'm running ping in the loop.
Which I'm fairly certain I need to do for what I'm trying to do...
too many pings == crash
Even veterans forget.
No problemo.
I'm a CP wifi noob. So.. heh.
I have a fair bit of wifi code, so if I can be of help feel free to ping.
Do you know what kind of interval I should use?
I don't know. I just did 1s to mimic the regular ping command.
I guess, as long as it's not too fast it should be fine
And yeah the loop is way too fast, clearly.
Excellent, I'll do 1s.
Hmm. time.monotonic() question. If I'm tracking two different time intervals, in two separate time blocks, do I need a separate variable for current_ or initial_time for one of the blocks? Or how does this work. ```py
Initialise time tracking
initial_time = time.monotonic()
Track the first time the code runs.
first_run = True
5 minutes in seconds
time_check_interval = 300
ping_interval = 1
The times at which it should change from blue to red, and red to blue
color_time = [RED_TIME, BLUE_TIME]
Track consecutive ping failures
ping_fail_count = 0
while True:
current_time = time.monotonic()
try:
if first_run or current_time - initial_time > ping_interval:
wifi_ping = wifi.radio.ping(ip=ip_address)
if wifi_ping is not None:
ping_fail_count = 0
if first_run or current_time - initial_time > time_check_interval:
if RED_TIME <= sundial.tm_hour or sundial.tm_hour < BLUE_TIME:
print("Red time!")
pixels.fill(RED)
pixels.show()
if BLUE_TIME <= sundial.tm_hour < RED_TIME:
print("Blue time!")
pixels.fill(BLUE)
pixels.show()
# reset clock
current_time = initial_time
first_run = False
I need a current_time = initial_time in the first block inside the try, but I'm wondering now if that changes how the second block's tracking works.
This might have made more sense in the help-with channel. 😕
Just store one, and check if time.monotonic()-stored > 1.
And then in the loop's end set it with a new time.monotonic().
(That snippet is clearly not the entire program.)
Ohhhhh
I think I get it. Thank you!
So, like this? ```py
if first_run or current_time - initial_time > ping_interval:
wifi_ping = wifi.radio.ping(ip=ip_address)
print(wifi_ping)
initial_time = time.monotonic()
Because something isn't right again, and I am trying to figure out where to start.
The ping is happening 1 second apart at least.
Can be shortened by setting current time as 0 for first run.
The rest seems fine.
Wait, the variable names are kinda flipped, so by setting initial_time as 0.
I don't think I understand. 😕
Yea same.
It's midnight and I have been studying for 5 hours.
stored_time = 0
if time.monotonic() - stored_time > ping_interval:
...
stored_time = time.monotonic()
there's an issue https://github.com/adafruit/circuitpython/issues/5980
Ah hmm.
For the first run it will be time.monotonic() > ping_interval.
Wifi connection can take like 7s, so it's not a matter of being in that part in the first second.
Hmm ok
first_run is a tracked variable. And you're saying I can do it with time instead?
this, should work.
Ohh hm. Ok.
I see no reason to store a first_run just for this
Let me see if I can make that work.
Ooooh.
This is working time-wise now. I think.
Trying to make another part work the way I want now.
If you want to make it extra fancy you can do the rtt and averages.
This is supposed to be simple 😂
Ok, give me a minute to check whether the ping successful code works right. Then is it ok if I post it here for you to take a look at? I'm absolutely certain I'm doing extra that I don't need to, but this is how I know how to do it.
Ugh. Safe mode.
Well, I suggest you spam a few print(f"CT: {time.monotonic()}") around the code.
I'm spamming rando prints at least.
I have no problemo if you post the code here.
Just make sure to ping me cuz I am alt-tabbing.
is there an issue filed about this?
yep, an old one
It can prolly be fixed by the same time.monotonic logic, by storing a last_ping_time in the core.
I figured it out.
It's doing what I thought it would
the time is getting reset to time.monotonic() in the loop, so the second time interval is never met because it's longer. That's why I thought I might need a separate stored_time.
I think I need one more time variable.
Not sure I quite understand the issue. As long as stored_time is initially defined outside the loop, it should be fine.
Code?
Two shakes
I prefer using a variable that is set to when the next event must happen, when you have multiple timed things, each has their "next time" variable
"next time" or "last time" is equivalent, but I find that using the next time is easier to math
Ok, @brazen hatch here's my code. It is currently working like I want it to, or so it seems. No safemodes bounces, and it's doing the things when it's supposed to.
it also makes it easier to compute next time in different ways depending on whether you want to guarantee a delay or avoid drift
That said, I'm almost certain it could be simplified somewhere.
do you want to check the time if the ping fails ? doesn't that mean that you don't have access to the network ?
Oh the time thing in the beginning? I'm not even sure it's necessary. This is expected to be plugged into the wall and left alone. I think I did it more for myself than anything.
So in theory that could be removed entirely.
But good call.
One would probably not want to check it if the ping fails.
From a quick read:
- For 24/7 uptime with no hiccups,
safemode.py,del&gc.collect()are recommended. - Using regular NTP may be better.
initial_time == 0->(not initial_time).- Using parentheses in the
ifs is also good for readability. - psf/black formatting not applied.
It was a quick read, logic errors may have been missed.
watchdog handy too, and a try/except wrapper for the whole shebang
I'm walking the line between "simple" and "will keep working"
supervisor.reload and microcontroller.reset are two of my best friends 😉
overkill for present purpose, but here are all of the things I could think of for robustness of a CP project: https://gist.github.com/anecdata/cfc4c585406d17985885bfe3a1cc9c73
There's a reset on error function that will be switched back to microcontroller.reset()
This is the manifesto of ljinux code.
Ljinux is and has to be 100% ready for every exception and at the same time affect the stack as little as possible with no leaks.
Tending to gc manually is also critical for performance.
gc is a bit in heuristic territory I think, someone even mentioned a case where they had to gc twice in a row to make it happen
Yes, it's a matter of striking a balance.
You need to do just enough gc.collect()'s so that the heap doesn't significantly end up fragmented, or full with stuff to be deleted.
It's faster to clean 2 times 10k of ram, than clean 20kb when stack is full.
>>> wifi.radio.connect(ssid = "myap", password = "12345678", channel = 10, bssid = "12:34:56:AB:CD:EF")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: Invalid BSSID
>>> wifi.radio.connect(ssid = "myap", password = "12345678", channel = 10)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ConnectionError: No network with that ssid
I changed the BSSID in that output but for the test I used the MAC copy-pasted f...
But if you always spam it, it ends up way slower.
Doing 100 times 50 bytes is a million times slower.
This is very obvious in any ljinux tui application.
nano being the biggest mem hog.
By not doing any, garbage accumulates and then it takes several moments for it to collect all of it.
May I suggest temporarily swapping ping with a placeholder print function?
have you measured the gc time ? on boards with 8MB of ram it takes an eternity even if you didn't allocate anything
Of course you may, and I will do that.
By feel only.
By scrolling screen in nano.
I'd love to see some benchmarks
I plan to make some in the future.
Ljinux has a plethora of funcs and stuff that needs time benchmarks.
It will measure all system times.
I have done some parts in test code.
But never all in one.
I want a stress-ng equivelant.
I do want to see flash & psram performance with different block sizes.
@brazen hatch Is the point of this to basically prove that the issue is the ping feature?
I don't get it though. It ran for a while just fine, and then boom safemode again.
The point of what? Using a placeholder? There is nothing else that can safemode the board in that code, is there?
So by swapping it for now, you get to not have to reboot the board all the time.
I see where the safemode.py would come in handy, but if it's dumping into safemode approximately 8 seconds after it starts running every time, that isn't so handy.
I don't think there's anything else, no.
I think it's ping making it fail.
Just swap ping with something like print(f"PING! {time.monotonic()}") and set the result value with a 1 or something.
I was printing "ping goes here"
and it was running fine.
I slowed the ping down to 2 seconds, and now it's running ok. But .... nevermind.
Safemode.
Well, in the log, don't you see many ping messages if you add the print instead?
I don't think I follow what you're asking
With this in place of the .ping(), what does the serial output look like?
Oh man! Turns out I hadn't increased the delay. It doesn't matter, it did enter safemode eventually anyway. But! The ping returned None enough times for the full purpose of the code to work, where it stops showing blue, and blinks red when the ping fails, and then once ping is working again, returns to blue. So.... that's nice I guess.
Ok give me a moment
etc.
Interval currently set to 2 seconds.
It feels like something is hosed with ping.
bruh
@onyx hinge Can you give me a QT Py ESP32-S2 build? I can't remember where to find the assets or whether they're even built yet.
My code still works though, so 1s is fine.
@idle owl yes I can make one then I have to step away for dinner
Thank you.
I'll test it with my code.
@brazen hatch empirically it's somewhere between .2 and .3 seconds that it switches to "mostly working, no exception". not sure exactly why that would be.
If you need I'm about to make another build if needed
Cheers.
Thank you!!
afk, you're welcome though
Have a delicious dinner!
@brazen hatch OK, so here's the weird thing it's doing now. (Running the code to see if it fails.) Every 7 pings, it returns None. Every single time. One of the times it returned None two times in a row, but otherwise 7 successful, 1 fail, 7 successful, 1 fail..... This was happening earlier, and I thought I did something to fix it, but I a. don't remember what that might have been, and b. am unconvinced I ever did anything to fix this in the first place.
I fixed the thing where it wasn't printing None for every failure already.
None is a failed ping, is it not?
That is connection related as is specific to your wifi setup.
I have never seen anything as such on any of my boards.
You should prolly just treat failed and None the same way.
Ok, trying that.
I connect my boards to my pc's / pi's wifi hotspot so I can monitor wifi stuff via journal.
This way, severe errors are registered.
LLOL...... I ran out of memory??
u runnin it on a tater?
It's still doing the 7 on 1 off thing.
Possibly.
that might be a wrong error diagnosis ?
Perhaps it's time to begin le gc.collect() spam.
That's fair. I happened twice after about 16 pings, but that isn't consistent now.
could be mem, since I have never seen it.
but no safemode?
the code doesn't allocate anything big, and the QT PY has tons of RAM, was it an ESP memory error maybe ?
Correct!! No safemode!!
the PR only catches the error (to avoid safemode), not change the underlying reason
that's deeper in the ESP IDF
if esp-idf was stable we would have flying cars by now
I'm running your code on my FunHouse btw with a 2s delay and things seem to go well
0.005
0.005
0.005
0.005
0.005
0.005
0.005
0.005
0.004
0.005
0.007
0.005
etc.
over 1s should work, but...
I mean, this 7 on 1 off thing doesn't really matter - it doesn't do anything until ping fails 5 times in a row.
Switched back to 2. Trying that.
Still getting that None every 7 times. 🤷🏻♀️
But, I'm annoyed with it. Oooh, that time it None'd after 3 successes.
Well, I will go sleep now, have fun.
My last suggestion is to test the ping part of the code, in a different code.py, where nothing else is going on.
Thank you so much for all your help!!
No problem. Glad I could help.
I tested this on a QT Py ESP32-S2 running code including ping that was consistently resetting into safe mode, regardless of the ping delay. I can now successfully run the code without resetting into safe mode.
Thanks so much for the fix!
It's an espidf memory failure. Line 138 is the ping code. Maybe I merged that PR too quickly?
I need to go eat. I guess I'm done with this for tonight.
Maybe something isn't cleaning up completely. I think the PR still did fix one issue. Could be more then one was there
I think the PR converts the crash into an exception, it's an improvement
yes that's exactly right. on my system I started getting a "generic error" instead of the crash; kattni's error is a bit different, maybe because of different memory usage in her code vs mine
Hmm.
So am I supposed to catch the error now?
Is that the idea?
Already have it in try/except. I can try an if/else under the except I suppose. I assume that works.
The try/except should catch the exception if it shows up. You can't catch an exception with if/else normally
No I mean, inside the except, if the error is the espidf error, pass. And if it's other stuff, reboot the board.
Although I have no idea if it will keep running after that error.
Or if it requires the reload.
Basically this will reload all the time, it seems like. Sigh.
I'm using:
Adafruit CircuitPython 8.1.0-beta.2-12-g018f15de9-dirty on 2023-05-06; Sparkfun Thing Plus MGM240P with MGM240PB32VNA
Calls to the time module
import time
time.localtime()
were crashing the board into safe mode.
Apparently the rtc_time_source wasn't being initialized and calls to rtc_get_time_source_time would then crash. Adding a call to rtc_reset in silabs/supervisor/port.c seems to have resolved the problem.
question, I am making a board port,
this board has a battery hold pin
if it’s not held up, the board will power down when the power button not held and not plugged in.
Should I have circuitpython never reset the pin and hold it up by default?
It’s the m5stack timer camera x, straight from ada store.
It somehow doesn’t have a circuitpy port
It has a builtin camera and is a standalone battery powered package
I have arduino rtsp + webserver code and it can stream 30fps video just fine
I'm still getting this with latest release, when using pull_request_target: https://github.com/PX4/PX4-user_guide/blob/main/.github/workflows/flaw_checker.yml
- Failed build here: https://github.com/PX4/PX4-user_guide/actions/runs/4901190561/jobs/8752318407?pr=2487
It is quite likely something I am doing wrong'; this is for anyone else running into the issue.
This is a small formatting change.
The current description contains full width parentheses (). They aren't intended for English text and were probably left in when translating from Chinese. These are changed to half width ().
Additionally two periods are removed from the list of improvements for consistency within the list.
Also, how do I map camera pins to the mp_rom_obj_tuple_t camera_data_tuple that is set for others?
I have no clue. I only have the datasheet and a working arduino example.
bool espressif_board_reset_pin_number(gpio_num_t pin_number) {
if (pin_number == 33) {
// Turn on BAT_HOLD by default, so that the board does not power off.
gpio_set_direction(pin_number, GPIO_MODE_DEF_OUTPUT);
gpio_set_level(pin_number, true);
return true;
}
return false;
}
Doesn't really work. Not really sure why.
The pin stays unset.
I added a mp_printf(&mp_plat_print, "Resett.\n");
It gets printed on the correct pin deinit.
Just saw about your desire to use the LCD peripheral on the ESP32-S3 for a parallel display. Definitely doable but will need some work on the CircuitPython core. I made a fork to add a DotClockDisplay using the S3 LCD peripheral, but it was never merged. But had lots of fun hacking on it!
I have come to believe that there is a memory leak in the ESPIDF related to WiFi and requests. I'm not even using ping anymore because I couldn't get past 3 pings without it failing with a memory error. Now... it's failing when trying to retrieve the time service from Adafruit IO, saying Sending request failed but, if you ctrl+c in the middle of the reset sequence, it turns out that error is being directly caused by espidf.MemoryError.
@idle owl I would be happy to look at it in detail with you, maybe monday after the meetings.
Yes please.
I found something hinky in adafruit_io but I don't think it alone is the cause of the problem: https://github.com/adafruit/Adafruit_CircuitPython_AdafruitIO/issues/100
@idle owl which qtpy is your project using?
ESP32-S2.
OK, we can talk more Monday!
For sure. Thank you!
CircuitPython version
Adafruit CircuitPython 8.1.0-beta.2-24-gd2aca7eba0-dirty on 2023-05-05; ESP32-S3-DevKitC-1-N8R2 with ESP32S3
Board ID:espressif_esp32s3_devkitc_1_n8r2
UID:866B3BD27A8F
Code/REPL
import time
import wifi
from secrets import secrets
DELAY = 0.5 # this is fine, but lower values lead to exceptions after a few pings
wifi.radio.connect(secrets['ssid'], secrets['password'])
while True:
print(f"LAN ping: {wifi.radio.ping(wifi.r...
I get those routinely in _get_socket just using requests. Retry a couple of times, same. Do some other stuff then come back and do a request later and it's fine again. Checking available espidf memory (QT Py S2) prior to the (successful or failing) socket operations gives something like:espidf.heap_caps_get_largest_free_block(), espidf.heap_caps_get_free_size(), espidf.heap_caps_get_total_size() = 253952, 284736, 405960seemingly plenty of espidf memory.
I also have CIRCUITPY_RESERVED_PSRAM=262144, but that may not be working as we think??
or it's not actually an espidf memory error??
https://www.adafruit.com/product/4959
Working:
- Psram
- i2c
BAT_ADC
Not working:
BAT_HOLDTrueon startup.- The camera.
- The power button.
I have gotten the camera working and streaming video in arduino.
So I have a known good pin config.
The issue is I have no clue about circuitpy espcamera.
This uses very permissive allow lists - basically any valid bit of the address space is considered appropriate
@jepler , apologies for the delay in getting back. I did some further testing with the second MatrixPortal that I received. To your point about a potential power issue, I had been wondering the same thing. Since I had the 2 portals, I decided to try running them both at the same time with each panel using the same power supply but without the data chained together. I'm using Adafruit's 5V/10A power supply with their barrel splitter for just the LED panels and separate USB supplies for each Ma...
@PaintYourDragon any thoughts on this kind of distortion? I don't want to get into a technical explanation when I'm not confident of the details, but to me it looks like some kind of problem between the clock & data pixels that is scrambling the data the further left (further from the natrixportal) the pixel is.
To enable the WIZNET5K driver to be compatible with the Adafruit Adafruit_CircuitPython_HTTPServer the socket.socket module needs to raise OSError exceptions, since these are trapped in try: except: statements. What is the best source for these error types? I've been looking at the BSD Unix socket man pages. Do you think I'll get close enough using these?
@lavish saffron interesting, our errno module seems to be undocumented ... ```py
MicroPython 8.1.0-beta.1-4-g1ca435c5e3-dirty on 2023-04-05; linux version
Use Ctrl-D to exit, Ctrl-E for paste mode
import errno
raise OSError(errno.EAGAIN)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 11] EAGAIN
it would be nice if it were documented.
Ah, that's perfect. I'll see what I can do. Thank you!
It's actually documented at docs/library/errno.html but this is not obvious...
Traceback (most recent call last):
File "/Users/a/Documents/GitHub/circuitpython/ports/espressif/../../tools/gen_web_workflow_static.py", line 7, in <module>
import minify_html
ModuleNotFoundError: No module named 'minify_html'
make: *** [build-espressif_esp32s2_devkitc_1_n4r2/autogen_web_workflow_static.c] Error 1
is this something not installed as part of the circuitpython / espidf environment?
ditto jsmin
oh, that's a note in the "Manual Setup", which the macOS setup says to skip over
but I guess build error counts as "If the setup instructions above don't work for your particular OS setup, for whatever reason"
I build so infrequently, it's always a new experience 🤪
yeah if you didn't build since things were added, you'll be missing stuff
my build script runs the pip install every time, it takes 2s when there's nothing new
yeah I think the requirements stuff is new since I last did this
make -j got errors, so I'm doing no -j 😦
Using the latest "Adafruit CircuitPython 8.1.0-beta.2 on 2023-04-26; FeatherS2 with ESP32S2" and the code has the "feathers2.enable_LDO2(True)" the UMFeatherS2 has run for 10 hours without crashing. Using 2 UMFeatherS2 I have sent 140,000 MQTT messages from one to the other via a raspberry pi running mosquito. One way only and neither have crashed.
Thanks for your advise and look froward to the new 8.1 release.
I guess the remaining question is; should I try the test agains without the "fea...
I suggest keeping an env for circuitpython compiles, seperate from idf's
It's also that arch is now changing to py3.11, so a lot of stuff will break.
Can you put symbols in a computer hostname? Specifically _
@idle owl I think that letters, numbers and "-" OK, but "_" is not. Assuming you mean a computer name like you might have in a URL, "example.com" and so forth.
you can have "sub-domain.example.com" but not "sub_domain.example.com"
yes, try that
That's equally fine. I'm not married to _. I'm simply used to it from file naming.
Thank you!
@todbot you'll appreciate this. before and after of building up a chord from 9 notes. The note envelope has an attack level of 1.0, sustain level of 0.8, and a sine waveform with a volume of 14700
While some clipping will occur, overall I think it's an improvement. In technical terms, it's a dynamic range compressor with a fixed threshold and a hard knee. https://en.wikipedia.org/wiki/Dynamic_range_compression
The waveforms below are from the manual test program circuitpython-manual/syn...
Is the safemode.py feature merged into the 8.0.5 line?
Based on a search of the github release notes, I'd say not...
no
Thanks 😄
yeah, https://github.com/adafruit/circuitpython/commit/d8231f15886ef43cf3a052c50bca49ec6dd150ff only lists 8.1.0-beta.2 8.1.0-beta.1 8.1.0-beta.0 8.1.0-alpha.2
The UM Feather S2 has now been running for 6 days without crashing. I restarted the Adafruit Feather S2 running the Lolin firmware 3 days ago and it hasn't crashed either.
The only time I've seen a crash is when the terminal has been disconnected so I decided to use your logging routine and see if I could recreate the crashes without the serial terminal session. It turns out your code won't run under 8.0.5 because the safemode.py feature isn't implemented in the 8.0.5 line yet.
I'll reb...
Any thoughts on this? https://github.com/adafruit/Adafruit_CircuitPython_Colorsys/issues/28 (or perhaps it's good for weeds?)
We have a library that is a partially complete implementation of colorsys from CPython, but it was altered to have different return types for the functions that it has (ints 0-255, whereas the original CPython is floats 0-1). I think it makes sense to change it to be floats so it will match the CPython implementation to make code using it more portable. I had a preliminary look around Learn repo and Library Bundle examples and found no usages of the Circuit Python library specifically, but any code that is out there that uses it would need to get adjusted if we did make this change.
It should definitely match CPython if it shares a name
what's the magic these days to make space for a debug build? (esp32-s2 4MB flash) every combination I've tried gets some undefined reference
I think I disabled ulab last time I needed to make a debug build. perhaps one or two others but I don't recall them for certain.
did you make clean ?
I always make clean
I don't even see ulab in mkconfigport.mk ...do you do that on the command line?
CIRCUITPY_ULAB = 0 in the mpconfigboard.mk
oh, board level
or the command line
gmake BOARD=adafruit_feather_esp32s2_tft -j6 DEBUG=1 CIRCUITPY_ULAB=0
that was in my history
(not really, I have a script that makes those for me, but that's the result)
-j has been giving me errors, so I've been doing make and then do something else for a while
you can only override what is not set in stone in the board file from the command line though
(and what is defined in py/circuitpy_mpconfig.mk)
unless they use ?=
what is set in stone?
yeah board files don't use ?= maybe they should, I assume it also defeats the github custom build
everythin that is in mpconfigboard.mk that doesn't use ?=
then you're free to play with anything
Ok, that's promising to me actually. It means there is not something deep
in the bowels of CircuitPython or ESP-IDF causing this. Maybe I should just
change my board and then I won't have crashes anymore. Or perhaps I'll try
to slow down that frequency on the Flash chip like you were commenting on a
while ago.
On Mon, May 8, 2023 at 10:23 AM RetiredWizard @.***>
wrote:
The UM Feather S2 has now been running for 6 days without crashing. I
restarted the Adafruit Feather S2 running t...
I usually try to pin down all the possible settings in mpconfigboard.mk, otherwise someone always comes and changes the global defaults, and I only realize half a year later that it stopped working
this is very arcane stuff
did you see jepler turn of synthio on one of your boards?
no, I didn't
k, I pinged you on github but you must have missed it. his changes have made it better and larger. not sure what you want to do about it
well, I'm getting abuout 40 e-mails a day from github
The newsletter is ready to crib from in GitHub for the 2pm meeting
thank you!
https://github.com/adafruit/circuitpython/pull/7862#discussion_r1184001712 Ones with mentions are designated with a cc to a mention address https://docs.github.com/en/account-and-profile/managing-subscriptions-and-notifications-on-github/setting-up-notifications/configuring-notifications#filtering-email-notifications
thanks
I was hoping to use synthio in my games, but to be honest I never had the time to actually try it
maybe with the size gains of the newest micropython it will fit in there again, when they are merged
¯_(ツ)_/¯
progress
it does sound way better
for sure, I was planning to try and make something like the bfxr for circuitpython for years now
bfxr?
Sound-effects generation for your games in flash.
it's for generating sounds for games
I guess it's replaced with sfxr now that flash is dead
basically you set about a dozen parameters, and you get a cool sound
nice!
CircuitPython version
Adafruit CircuitPython 8.1.0-beta.2 on 2023-04-26; Metro MIMXRT1011 with IMXRT1011DAE5A
Code/REPL
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
import time
import usb_midi
import adafruit_midi
# from adafruit_midi.channel_pressure import ChannelPressure
from adafruit_midi.control_change import ControlChange
from adafruit_midi.note_off import NoteOff
from adafruit_mi...
CircuitPython version
Adafruit CircuitPython 8.1.0-beta.2 on 2023-04-26; Adafruit PyPortal Titano with samd51j20
Code/REPL
from vectorio import Polygon
import displayio
import board
display = board.DISPLAY
my_group = displayio.Group()
bitmap = displayio.Bitmap(300, 300, 5)
palette = displayio.Palette(1)
palette[0] = 0x125690
points = [(5, 5), (100, 20), (200.2)]
polygon = Polygon(pixel_shader=palette, points=points, x=0, y=0)
Behavior
...
<@&356864093652516868> We'll have our weekly meeting in just over an hour from now in this text channel and in the circuitpython voice channel. Please take the time to add your notes in advance to the document: https://docs.google.com/document/d/1y5tGjTm1zDpbaSjTIQLytXE_Eg4mmfI4kf95AclnJ2Q/edit?usp=sharing Thanks! Talk with you soon.
CircuitPython Weekly Meeting for Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates early. During the meeting, we go through them as a round robin sorted by username. If you can’t make the meeting and would still like to participate, add y...
I'm wondering if it's a memory leak in the ESPIDF, but this is certainly not my wheelhouse. Jeff and I are planning to look into it, I believe.
@onyx hinge Are you still up for looking into the wifi / requests issue today? Worth noting: I have no reason to believe that my code hasn't been running for a solid day or two at this point. That said, I have no way to know that it didn't fail and a soft reload resolved it, and that event was off my scrollback. Thing is, when it was failing previously, it would pretty consistently keep failing after that and a supervisor.reload() did not resolve it. So, I'm wondering if something I did is causing it to avoid failing now. I don't know anymore, heh.
@idle owl we can sure look at it still
Thanks so much!
brb
Keeping the MatrixPortal and matrices in the same chained order, try just swapping where the power cables go to the panels. Small but nonzero chance of something badly soldered or crimped. I’m highly skeptical this is the problem, but it’s quick and zero cost, worth a try.
Timing is much more likely, and “slop” from the shift registers will accumulate to the left as a chain grows longer. These panels are changing all the time, and what worked on last month’s panels might be different now. ...
A quick glance at the projects I’ve posted on this website makes it evident that I prefer to use CircuitPython when programming microcontrollers. Adafruit and the community have done an exceptional job maintaining the language and releasing libraries for a wide variety of sensors and peripherals. You can iterate, troubleshoot and finalize a proj...
Rust, clearly
Scott - something is rubbing against your mic, and it's causing staticky type sound from you.
👍🏻
#Picomputer 28 with @sinovoip ESP32S3 PICO
📽️CHECK VIDEO + MORE DISPLAYS SUPPORT!!!
It is crazy but #circuitpython code worked without changes.
Creating toys like this thanks to my supporters
https://t.co/V1yvr0DDKG
So that's what I call portability!
https://t.co/utZedsUnUQ
Project like this exists with big help of my Patreon supporters.
https://www.patreon.com/bobricius
Universal pocket (computer) with QWERTY keyboard
Support multiple display pinouts and CPU cores, etc latest tested ESP32-s3
😁
Hey I'm on the review list on the core for once! 😄
brb
tektriks got self review labelled today for my adafruit_circuitpython_logging pull request so thank you
🎉
@onyx hinge FIR for ESP32. I bit old, but it should be a nice example on how to use the espressif stuff to get an FIR working.
https://github.com/bobh/ESP_DSP/blob/master/ESP_DSP/ESP32FIR/README.md
self.plot_line_pint: List[Tuple[int,int]]] = []
@gilded cradle Good topic for on the weeds, this is a complex issue for riscv boards as well, as some board makers publish distros only sometimes, and normal distros like ubuntu/debian/fedora work only sometimes. A good example are the D1 boards, which all share a distro, and don't have device tree files for each boards so they might have i2c pins on the wrong place.
This is also a complex issue as it cannot be tested on something like Github's CI and even if the distros existed, they wouldn't run on the real hardware. Maybe github self-hosted runners could help with testing, but I'm getting off-topic here.
So far a markdown doc with a nice table should be good enough.
No, there is nothing specific about the distribution, so the code doesn't use systemctl or the package system.
But it is a good idea to know what has been tested so far, in case you are having problems, to just check the doc.
And yeah, circuitpython.org is a good idea as well.
@gilded cradle If there's documentation elsewhere pointing to circuitpython.org, you'll cover a wider user-base.
Keeps your external docs simpler, but still gets folks where they need to go.
Also, there are 100's SBC distributions, so making a new functions for each would be weird.
Exactly!
And the other problem is that it kinda has to be a matrix of distribution and boards, so the outcome will be quite large.
Debian might work on one board, but not on the next one.
Entirely unrelated, but I forgot to share earlier: I received my new MacBook Pro this morning. M2 Max with 96GB of RAM. Super excited!
Sweet @idle owl. I'm still on the one I got in 2019.
that's a lot of RAM!
If it's working for you, stay with it until it's not enough!
Right?
Thanks all.
Yeah, that's what I was thinking too.
Thanks all! Have a great one!
Thanks everyone
Thanks everybody!
I have 64GB on my Threadripper
96GB of RAM? You'll be able to run Chrome!
Relevant to Issue #7931
Server:
Adafruit CircuitPython 8.1.0-beta.2-12-g018f15de9-dirty on 2023-05-08; ESP32-S2-DevKitC-1-N4R2 with ESP32S2
>>> import wifi
>>> ipaddress
>>>
>>> ipv4 = ipaddress.IPv4Address("192.168.251.2")
>>> netmask = ipaddress.IPv4Address("255.255.255.0")
>>> gateway = ipaddress.IPv4Address("192.168.251.1")
>>> wifi.radio.ipv4_address_ap
>>>
>>> wifi.radio.set_ipv4_address_ap(ipv4=ipv4, netmask=netmask, gateway=gateway)
>>> wifi.radio.ipv4_address_...
Mine was still working quite well, but Rose needs an upgrade, and it makes more sense for me to upgrade and give her my current one.
Not since the Arduino Edison
@royal rover You can try following this stuff to add them to blinka. If they work with the linux gpio library, they almost for sure work with blinka.
https://learn.adafruit.com/adding-a-single-board-computer-to-platformdetect-for-blinka
https://learn.adafruit.com/adding-a-single-board-computer-to-blinka
looks like it's applying a new formatting rule to old code, do I edit the old code?
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/1xektzKK1vh8mua913H68WG-104GH4q00L6EmL87ZRGE/edit?usp=sharing
CircuitPython Weekly Meeting for May 15, 2023 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates early. During the meeting, we go through them as a round robin sorted by username. If you can’t make the meeting and would still like to partici...
several languages not building on PicoW variants
I took a look into this and I think the ints vs. floats is not the root cause.
In the specific code you posted, this line:
points = [(5, 5), (100, 20), (200.2)]
The last item in the list gets evaluated as a number, not a tuple with a number inside of it. Since there is no comma, the parenthesis are being evaluated for order of operations rather than meaning tuple.
If you use the code like this (note the extra comma after the number):
points = [(5, 5), (100, 20), (200.2...
Looks great! Thanks for the print/record follow up from last time too. Also interested to see if this helps RP2040 flash issues.
Oh also…if you have a second ribbon cable for chaining the displays, try swapping that out. Small but nonzero chance of something being badly crimped.
Attempt to resolve #7945
Added validation inside of Polygon creation to ensure the values inside the points list are tuples before attempting to get values out of them.
@lone axle Maybe you know. How do you format the :return: in this? It returns a color tuple. ```py
"""
Function description.
:param hour: Parameter description.
:return: ???
"""
I think Tuple[int, int, int]
Oh weird. OK.... I think that's too much for this code. I thought maybe it was a sentence or something explaining what it returns. Nope! Thanks so much!
@idle owl I think it can have an english description after the colon as well. Some like "Tuple containing 3 int values 0-255 representing red, green, and blue" Would be good if it needs to be comprehensive or is aimed at someone who may not know.
left of the colon would be where the Tuple[int, int, int] lives I think. And right of colon is human readable.
Oh.
That makes a little more sense.
It's within a code.py
So I'm trying to document, but also, it will have a guide so....
Maybe don't overcomplicate the inline documentation.
@onyx hinge Can I do if thing or second_thing and third_thing: and have it execute either if thing is true, OR if second_thing AND third_thing are both true?
Or do they need to be nested ifs.
Or can you do and twice with three conditions?
(Separate question)
I think I have to nest to do what I want.
I'll try that, and you can correct me tomorrow.
CircuitPython version
All
Code/REPL
my_group = displayio.Group()
# ... append some things ...
for item in my_group:
print(item)
Behavior
mypy flags an error on code like this indicating that a value is unsupported for use in the right operand of the in operator:
error: Unsupported right operand type for in ("GridLayout") [operator]
In this case GridLayout is extending Group. It flags the same issue whether its a subclass or ...
resolves: #7948
I noticed that mypy raises this error while testing some of the suggested fixes discussed during the weeds section of the meeting inside of this PR: https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_Layout/pull/85
This topic of the in operator didn't come up, but I noticed mypy outputting errors about it while working on that.
I tested the change successfully by building stubs and installing with pip install . and then running mypy on that PR branch ...
Is there any official or unoffical supported version of CPython for the libraries? The closest thing I know of is Blinka declaring a minimum of 3.7: https://github.com/adafruit/Adafruit_Blinka/blob/b84de4800b2c31023f29a536d26209bd7517d504/setup.py#LL52C1-L52C31 Is that considered the minimum supported version? i.e. would we want to hold off accepting a change that requires python 3.8+?
@tannewt I did a "git bisect" and found that it was your PR that introduced the problem. I haven't done any further troubleshooting beyond this. I mention it in case you want to step in or have any info to provide...
5bb8a7a7c68781e6edbd3aebaf7eeeecb310bd86 is the first bad commit
commit 5bb8a7a7c68781e6edbd3aebaf7eeeecb310bd86
Author: Scott Shawcroft <scott@tannewt.org>
Date: Tue Feb 28 15:07:35 2023 -0800
Improve iMX RT performance
<details>
<summary>
my bisect log...
when going across that pair of commits, the CIRCUITPY drive gets resized so make sure to freshly copy your code or otherwise verify that it's actually running....
Just finished up watching this weeks meeting. A DVI featherwing that offloads DVI onto a 2nd dedicated RP2040 is something I would definitely be interested in for taking HDMI to the next level stacked with an Airlift. Definitely looking forward to that becoming a thing. Baby steps. 🙂
this link in this guide https://learn.adafruit.com/feather-rp2040-dvi-video-synth links right back to the source guide
Yes. Probably copy the last script, when i was trying to figure out the tuple and int raise messages😊
I don't see anything obvious that'd do it.
Here are the rest of the Blinka boards. This is part 2. Part 1 was in #1194. This brings the count up to 120.
@devansau That's great news! If you could test it without the LDO2(True) to intentionally try to get it to fail that would definitely help.
Although convenient, the bundles are not board specific. Adding this to each board page may have the users thinking otherwise. Additionally, since the link changes each day, this may add additional overhead. Currently you can go to the Libraries link at the top of every page and download the bundles from there where having it in a central place makes updating the link easier. Is that acceptable?
I found that reverting the MIDI buffer size change fixed the problem here. However, I'm also seeing the tip of main fail to boot on my metro m7...
My bisect log so far, as I have to head out ...
git bisect start
# status: waiting for both good and bad commits
# bad: [b07de078f9dd640c28668cad3b5a5728a1d1024e] Merge pull request #7818 from CDarius/m5stack_stickc_fixes
git bisect bad b07de078f9dd640c28668cad3b5a5728a1d1024e
# status: waiting for good commit(s), bad commit known
# good: [cb6201d952c7be39024add8d91b79803ee191485] Merge pull request #7659 from dhalbert/gifio-displayio-doc
git bisect good cb6201d952c7be39024add8d91...
Move cursor to end of line in a file.
Use copy and paste keyboard shortcuts with nothing selected.
Cursor moves to new duplicated line.
Use keyboard modifier and arrow keys to select a part of the new line.
Observe the line above get highlighted instead
CircuitPython version
adafruit-circuitpython-metro_m7_1011-en_US-20230508-9e4dea7.uf2
Code/REPL
# N/A
Behavior
Board flashes safe mode LEDs (yellow), then flashes RED once, then is unresponsive on USB. it doesn't seem to be running code either.
Description
No response
Additional information
a9dc31a88198e5f09d46799870a921b92470b120 is the first bad commit
commit a9dc31a88198e5f09d46799870a921b92470b120
Author: Scott Shawcroft ...
This closes #7944 but it's fishy -- why is such a large buffer required? @hathach your feedback would be appreciated about this question.
It also includes a board-specific fix for #7952 but this may be needed on other boards. @tannewt do you know what's going on here? The USB_DM/USB_DP pins seem to just be dummy objects on 1011 but adding these to the list (as you did on the 1011 evk) does allow CP to start. If this is correct, the fix should be propagated to ALL boards, or incorporated a...
Good Morning All ! I am using analogbufio repeatedly in an application. While there is a deinit, I am uncertain about memory resources. I was hoping to re-use the same object repeatedly, but that returns messed up data. This feature might benefit from having a reset feature. Comments, Opinions?
@PaintYourDragon , thanks for the tips. I have already tried using a different ribbon cable so we can rule that one out. I think I've already tried swapping the power cables, but I will try it again to be sure. If that doesn't work, that I'll start digging into the clock settings. I take it the Arduino library for these overclock settings will work with the MatrixPortal?
@PaintYourDragon , thanks for the tips. I have already tried using a different ribbon cable so we can rule that one out. I think I've already tried swapping the power cables, but I will try it again to be sure. If that doesn't work, that I'll start digging into the clock settings. I take it the Arduino library for these overclock settings will work with the MatrixPortal?
Board definitions for these were added to Circuitpython the other month by a member of the community. These pages now make the builds more accessible.
I believe I have set everything up correctly (and as I have done for all Pimoroni's past board), but let me know if there's any issues.
@hidden rain Are you saying two readinto calls gives a bad result for the second call? that sounds like a bug. Otherwise, can you be more specific about what the Python code you're trying to run looks like..?
yes. the data the second or nth time around is total trash. I'd like to request a resource object reset to this feature.
I forgot how to do that (feature request) or open an issue.
Perhaps someone would confirm analogbufio.readinto() failures on use beyond first.
have you tried manually zero-ing the buffer ? Not good for performance, but to see if it has to do with the issue ? This does it without allocating a new buffer:
for i in range(len(buffer)):
buffer[i] = 0
opening an issue is here:
https://github.com/adafruit/circuitpython/issues/new/choose
Yes. The first thing I tried; pretty much just as you wrote it. I did the experiment several times. Before zeroing, the buffer is motly noise with a small reflection or shadow of what was previously good data.
It's easiest to do one at a time. Though we may want them all in one PR because they may have different mpy versions.
- [ ] 1.19
- [ ] 1.19.1
- [ ] 1.20
Where did you get these images? What license are they under?
Want to include distro info on the pages?
I've just started using circup and would recommend it too.
Please file this issue on the web-editor repo: https://github.com/circuitpython/web-editor
(I can't transfer because it is in a different org.)
Where did you get these images?
Various places. Let's See:
I got the LubanCat ones from Taobao
I got the ROC-RK3328-CC from Libre Computer's product page (which I linked to for purchase)
I got the Jetson Images from the Purchase Pages I linked to.
I got the Radxa ones from the Purchase pages I linked to.
What license are they under?
I'm not sure. Finding images for these boards was difficult itself.
Want to include distro info on the pages?
I think we should add that in ano...
Does it actually work? It isn't clear to me how it works.
contains would be for if x in group. for x in group is due to an interator. I think you want __iter__() instead.
@tannewt do you know what's going on here? The USB_DM/USB_DP pins seem to just be dummy objects on 1011 but adding these to the list (as you did on the 1011 evk) does allow CP to start. If this is correct, the fix should be propagated to ALL boards, or incorporated at a better location.
I don't. I didn't think that the reset code would get this far because it should be bounded by the IOMUXC count. Must be some loop bounds error.
Does it actually work? It isn't clear to me how it works.
It does work to eliminate that error from mypy. I'm not entirely sure of the 'how' beyond that mypy is looking at your installed libraries for known types when it runs to try to enforce it's rules. circuitpython-stubs seems to be where it's taking it's definition for displayio.Group.
I saw your message on the issue as well. Iter does feel more appropriate for this instance, although I think Group may support both. I'll doubl...
This closes #7944 but it's fishy -- why is such a large buffer required? @hathach your feedback would be appreciated about this question.
because usb highspeed endpoint size for bulk is 512 bytes. Maybe the buffer is overflowed or something. I will try to pull out and test tomorrow to see if we could still shrink the memory and not get into trouble.
who was talking about a streaming json parser?
the pirate weather api response is 30k+
CircuitPython version
Adafruit CircuitPython 8.0.5 on 2023-03-31; Adafruit Feather RP2040 with rp2040
>>>
Code/REPL
import time
import board
i2c = board.I2C()
i2c.try_lock()
i2c.writeto(82, b"")
time.sleep(0.1)
i2c.writeto(82, b"")
Behavior
Code runs fine without any errors. The issue is seen in the scope trace of the resulting traffic. See below.
Description
This behavior seems to be benign in most cases. However, it is potentiall...
is there a plan to update pylint in libraries? 2.11.x doesn't work with python 3.11
There's always a plan to update Pylint. 🙂
Eva's usually the one to do it, but she's been out. I'll sort out who can.
tekktrik has entered the chat
I can get a patch ready this week, either to run this week or next.
That's not the only thing though. There will be updated needed to conform with the new version. 😉
Basically, x number of libraries will fail to build due to new Pylint errors.
And someone will need to deal with all of that.
I can handle the unfortunate fallout
Excellent. Thank you so much!
thank you!
CircuitPython version
analogbufio object returns bad data for multiple use of the method "readinto". This api needs a reset method. Problem is not supplied buffer. Issue is most likely that the assigned ADC and or DMA needs to be reset. We would like to be able to use the one instance of analogbufio.BufferedIn object multiple times. Currently its good for a one shot. A reset method, or automatic reset after "readinto" would not clear the supplied buffer, but it would reset the ...
To everyone who was helping me with my ping and time-check code, thank you. After banging my head against this for longer than I care to admit, it turns out my code runs flawlessly on the QT Py ESP32-S3. I have no answers for why, and at this point, I need this project to run, so I don't care. But I wanted to let you know that I found a workaround, and things are happy now.
I was using the ESP32-S2.
And couldn't ever figure out making it work right. And it continued to fail in the weirdest ways.
@jaunty juniper and @brazen hatch It was apparently a hardware issue. So I either have a bad board, or there's something up with ESP32-S2 and the features of my code. Either way, it's working now on the ESP32-S3, and I've spent too much time on it already. So I'm handing it off with the hardware change, and that's what we'll be using for the guide.
Hmm, I should investigate, but schedule's rather full now.
No worries.
yeah it's a weird issue, I did not have ping errors on the FunHouse
Well, ping works great on its own on the S2.
It's something about ping and io.receive_time() together that end up failing in all sorts of weird ways.
@idle owl I also have network code that runs much better on S3 than S2, no idea why
Fair enough. I suppose at least it's not only me.
Fixes #7928. Also now builds a wheel now to upload!
adafruit_httpserver doesn't show up on the PR page? https://circuitpython.org/contributing there is an open PR
it's gone in and out of draft, maybe that's an issue?
Could you try erasing the flash completely and then reinstalling the UF2 bootloader and trying 8.0.x again?
Note that it's a C3, no bootloader.
I believe it's also the only 2MB C3 we have apparently ? So maybe there's an issue with the 2MB partition ?
Trying a full erase is a good idea, note that it's a C3, no uf2 bootloader. I believe it's also the only 2MB C3 we have apparently ? So maybe there's an issue with the 2MB partition ?
I always full erased before flashing. I also tried multiple times with different settings, speeds etc. I even tried the web flash.
I'm not sure. Finding images for these boards was difficult itself.
I'm wary about using pictures we don't necessarily have the rights to use. I realize that other images may be in the same bucket though.
If it supports both is it worth leaving contains and adding iter to the stubs?
Yup. But I don't think it supports contains. :-) I was talking about how it was implemented in CP. mypy is just a knock on effect.
I agree that multiple calls should work. I don't think there needs to be an explicit reset.
What board and version of CircuitPython are you running on?
Forgot to do this when I set up the port. Tested locally, works fine.
- minor feature updates
- updated URL to circuitpython quickstart
- updated pictures of latest board rev
Its a custom board using the RP2040, setup pretty much like the Pico with
4MB Flash and a jumper for the reset button.
Our product had to pause at CPy 8.0.4 (which is where we saw the issue). We
will upgrade in a few weeks.
-Lee
On Wed, May 10, 2023 at 2:19 PM Scott Shawcroft @.***>
wrote:
I agree that multiple calls should work. I don't think there needs to be
an explicit reset.What board and version of CircuitPython are you running on?
—
Reply to this email directly, ...
I might be late to the party, but just a heads up that GitHub is having several issues all around. Particularly, the GitHub Actions tubes are clogged: https://www.githubstatus.com/
Welcome to GitHub's home for real-time and historical data on system performance.
I'm not sure. Finding images for these boards was difficult itself.
I'm wary about using pictures we don't necessarily have the rights to use. I realize that other images may be in the same bucket though.
Fair enough. How would you like to proceed?
This is ready to go.
I'll try PicoW as a separate PR after this one is merged since: I don't know much about those internals; I haven't set up to build raspberrypi yet, and; PicoW wifi can be quirky. I looked at the code and I think I know what needs to be done, but if there are challenges with a straight-forward implementation modeled after station, then outcome is uncertain.
Discussed during our meeting and decided product photos are ok as long as we link to the shop where it came. (And we don't hear otherwise.)
@slender iron I found one use of plain "PyRate": https://github.com/dsilvestro/PyRate
also "Pyrate" is considered an alternate spelling of "Pirate" in English in general
huh, interesting
I'll leave naming up to pt and limor
@tulip sleet this is what I reimplemented: https://github.com/daggaz/json-stream/
I reimplemented it because I use the json module for value parsing
The upcoming collab project with Noe requires a CP fix that is currently only on main. What are the plans for the next release?
Or at least it's possible that it requires it. The failure that requires it isn't happening so far on S3, but I still think it's worth having so if it does happen, my code will keep running.
Did you implement the "visitor pattern"? That would let you check each parsed entry aginst all the required paths, so order wouldn't matter. This is all very reminiscent of SAX-style XML parsers, which maybe you were able to avoid in your work life up to now.
no firm plans, but the last release was two weeks ago, so I wouldn't want to wait more than a couple more weeks for a release. we can do a release at any time
Excellent. Cheers.
I didn't. ijson was another option
saw that too -- the visitor pattern could be implemented at a later time if we felt necessary
Has anyone been able to run the latest builds of the M7? Anything after May 1st is not even bringing up the CP drive. Tried with my own build and same thing
GitHub is back up, and all libraries should have a newly updated .pre-commit-config.yaml! black and reuse in particular are having new issues, please be aware. I'm currently running pre-commit on all the repos to fix the formatting issues, so if you're working on any libraries in the Adafruit bundle, you may want to merge/rebase accordingly. I'll follow up with fixes for REUSE and pylint as well over the evening and next couple days.
Libraries are patched! Minor fixes inbound for a handful of libraries that now have newly showing pylint issues, but otherwise everything is all set!
@DJDevon3 @dhalbert All good with the LDO2(True) removed.
I ran the code over 2 days, 10 hours at a time, >100k MQTT messages each day and all good on CircuitPython 8.1.0-beta.2
Thanks for your help.
@DJDevon3 I have used the adafruit motor featherwings and it works well. I recently upgraded the motors and smoked 2 motor featherwings. I think it was the back EMF so I have reverted to my own board which deals with this.
Latest commit adds __iter__stub.
As far as I can tell it supports both for _ in Group and if _ in Group. The following code executes successfully and outputs expected results:
import displayio
import board
bmp = displayio.Bitmap(100,100, 1)
palette = displayio.Palette(1)
palette[0] = 0x00ff00
tilegrid = displayio.TileGrid(bitmap=bmp, pixel_shader=palette)
bmp.fill(1)
main_group = displayio.Group()
main_group.append(tilegrid)
board.DISPLAY.show(main_group)
if til...
All post-patch fixes submitted as PRs! ( @idle owl )
Github is once again down 
While I personally do not have a huge problem with the current brightness of the status LED in general, I would really appreciate the ability to control the brightness during boot specifically. In my opinion the flashing in different colors can appear a little erratic to someone who does not know what the device is doing. A simple
import supervisor
supervisor.runtime.rgb_status_brightness = 0
in boot.py does not seem to effect brightness during boot. (Which makes sense)
S3 for some reason really dislikes nano
@tannewt can we merge this even if the reason the USB_DM/DP change fixes anything is murky? It's unfortunate and frustrating that metro m7 seems to simply not work at present.
- Stereo output. A
synthio.Synthesizermay be constructed withchannel_count=2. Thesynthio.Note.panningproperty controls whether it appears in the left, right, or both channels. - Vibrato was generalized to support two additional modes: Sweep and bend.
vibrato_rateandvibrato_depthproperties are removed, with newbend_rate,bend_depthandbend_modeproperties added. The defaultbend_modeisVIBRATO, so migrate existing code just by search&replace.SWEEPdoes a swe...
Jeff has a PR out with fixes
@onyx hinge I was hoping you'd figure out the reason but I can look if you don't want to.
Seems worth understanding
This would currently require a custom build to work.
It could maybe be made to read a settings.toml value.
It's a 'maybe' cause those flashes are really early (iirc in reset_port).
If the filesystem has init'ed by then, sure it's 2 lines of code.
Still that would be an api change, and would probably be held off until the next major release.
I am not familiar with the procedure for this.
It does sound nice having the ability to disable the led flashes entirely though. Not onl...
general tooling question - does this effectively centralize the CI stuff for CP?
https://github.com/adafruit/workflows-circuitpython-libs
Web Workflow startup is called from supervisor_workflow_reset which is invoked at every VM start/exit. Actual startup is not called until after safemode run has been attempted. Attempting to handle workflow background callbacks without having wifi connected references un-initialized socket objects which can cause corruption or crashes. This patch prevents the supervisor_web_workflow_background from being invoked if web workflow wifi is not connected.
Yup!
At least the most common shared parts for building and releasing
The libraries just call out and run those
@proven garnet hey. thanks for responding. actually asking this as part of looking at the arduino CI stuff - and the impending end of node12, etc. i think you actually brought this up? i got word of it via kattni.
Oh yeah, I did. It future proofs a lot of the issues regarding upgrading in the future.
Yeah, this was part of the fix for CircuitPython for the Node issue, or I did it right after.
cool. yah. that's what i was hoping / thinking.
current idea was to batch update all the repo's yml files
since it's a simple edit
but now wondering if doing something like this might be better
for now and future
Yeah, it's already paid dividends since.
You don't have to pack everything in it, but if it's shared across the whole codebase it at least gives you a single point to edit.
Since its a composite action you can still locally do extra stuff as well
neat. yah. this seems like a much better way to deal with this.
are there any limitations? like issues with keys or anything? not seeing anything obvious. seems like its just a different way to organize.
Looks good to me. Do you think we should split this in 9.0 into two objects? One for station and one for ap.
@tidal kiln, sorry for pinging you, but I have a very good question (in my opinion, you might think its stupid and not worth your time), why were these discontinued
I want a pair of these so I can make a one eyed wearable display like zack freedman but I cant find them anywhere, not even EBAY
Yeah, potentially. I think I always pass secrets to be safe, but each repository will need that secret stored (or potentially an org secret)
I think actually passing them may not be required, but definitely nice to see in the file in each repository explicitly what is being passed.
@muted current not sure. but not really #circuitpython-dev related. also no need for the ping.
sorry, I thought this would be the right place for this thing
where can I take this to???
probably #help-with-projects since it seems general
thank you, and sorry for ping
One typo and some builds that are too big. Good otherwise!
//| For ring to take effect, both ring_frequency and ring_waveform must be set."""
Do you think we should split this in 9.0 into two objects? One for station and one for ap.
The properties and methods keep growing, and we've known for some time that the naming can be confusing (e.g., get_ap_info is for station, but the AP things generally have an _ap suffix). Most things should separate easily into two buckets, but wifi.radio.enabled affects both. I think hostname does also.
The ability to enable wifi completely independently from starting or stopping statio...
Current pin name prefixes below. It is also the case that the individual pin names don't match. For instance, RFM9X_D0 vs RFM9X_DIO0 vs RFM_IO0, etc.
arduino_mkr1300:RFM9X_catwan_usbstick:RFM9X_feather_m0_rfm69:RFM69_feather_m0_rfm9x:RFM9X_adafruit_feather_rp2040:RFM_challenger_rp2040_lora:RFM95W_challenger_rp2040_subghz:RFM60HCW_
I am not sure it is worth making an incompatible change to regularize these. We could add u...
Thanks so much!
@onyx hinge want me to look into the usb pins on imx after I'm back from lunch?
The question arose in a recent wifi PR whether we should split station and AP into separate objects. radio is getting heavy, with a high count of methods and properties, and a long-running naming issue to distinguish station vs AP. For example, get_ap_info() is for station, but the AP things generally have an _ap suffix. Internal variables sometimes use an ap_ prefix and sometimes an _ap suffix...
Tweak DTCM and ITCM loading and prevent epd refresh while waiting for autoreload.
@slender iron my day is pretty shot at this point so if you can! (but for good reason, was helping my friend who had to move his metalworking shop on short notice last summer .. it's still not working yet but we made big strides)
yes moving that far is exciting 🙂
Kk will do once I’m back at my desk
I meant to say, I'm mostly out this weekend but can answer questions so feel free to ping or DM me so I see it!
- Fixes #7593.
Test on Metro ESP32-S2:
>>> import board
>>> s = board.SPI()
>>> s.frequency
250000
>>> s.try_lock()
True
>>> s.configure(baudrate=10)
>>> s.frequency
152
>>> s.configure(baudrate=100)
>>> s.frequency
152
>>> s.configure(baudrate=1000)
>>> s.frequency
1000
>>> s.configure(baudrate=100000)
>>> s.frequency
100000
>>> s.configure(baudrate=1000000)
>>> s.frequency
1000000
>>> s.configure(baudrate=10000000)
>>> s.frequency
10000000
>>> s.configure(...
cool. thanks. i think plan is to near term just do a simple edit of all the ymls in the arduino lib repos to bump the action versions used. so things wont break when node12 support goes away. but then also, longer term, take a look at changing to a setup like what CP is doing.
Whoops - sorry about that. All fixed now - just Wifi boards.
This prevents running into the pins that cannot be reset. On 1011 it was off by one pin that isn't attached to the package. So, having the USB pins forbidden prevented resetting to a NULL address.
Fixes #7952
Tested on a TinyS2 and works fine. Thanks for the fix!
Tested and this did give me access back to the Metro M7. If things work out I will get a new MIDI keyboard tomorrow and could try the MIDI part.
@devout jolt I was looking at your synthio test YT videos and you have, I think, an I2S to headphone jack breakout board? Wondering what it is. Would be nice to hook up to slightly better speakers
yeah I am a big fan of these cheapie PCM5102 boards you can find on Amazon or Ali. Here's one link: https://amzn.to/3M0gQMp Those are officially line-level out, but I think they drive most headphones
Descriptions: The DAC Module provides a super affordable high-quality DAC for the Raspberry Pi. Since it's digital audio, it sounds really good, much better than the onboard analog audio. The stereo jack comes soldered onto the board already. Features: Line out stereo jack. pHAT format board Uses...
Cool thanks. I have those little stereo 4ohm speakers and besides my shoddy wiring they're a "bit" tinny
it's really hard to get those I2S amps sounding good. You really need to be driving speakers in enclosures (turns out boxes are useful, not obvious to me) and of course, larger speakers == better sound, but now you have the power problem of how to drive those speakers off your USB. I like offloading all the audio amplification to a known-good solution of your standard cheap bluetooth speaker w/ aux in
Makes sense to me. Not a be all/end all type thing but would be nice to have it sound a little bit better. Maybe I should also 3d print a box 🙂
I think anything will sound better than a bare speaker!
Is it possible to include non-python files in libraries that get distributed in the bundle. Like font5x8.bin file that some of the older pre-displayio libraries utilize by default i.e. https://github.com/adafruit/Adafruit_CircuitPython_framebuf/blob/7c59940395afe427f2282bc648abd39cf3b64b7b/adafruit_framebuf.py#L493 That file is included in the examples folder of this library, but not other libraries that extend the main driver. They need to be copied over separately from the examples, but it'd be nice if the default would be included in the installed "package" so that it can work out of the box without hunting down other files.
I think the bundler would work ? I'm not sure if it only takes python files, but probably not.
@lone axle I don't know, but I'm nearly sure that non-python files can't be frozen in
I be filterin' yer square waves, fir sure
After all, it's hip to be square
old and busted
so that would actually require changes to circuitpython-build-bundles
RuntimeError: ('mpy-cross failed on', 'libraries/helpers/framebuf/adafruit_framebuf/font5x8.bin')
and I think too that it would make it un-freezable (it's not frozen in anything currently)
an alternative being to make it into bytes in a py file
Would it make sense just to include it in all the libraries that need it? I know it is duplicating the one file, but I don't think it is something likely to change
in the examples ?
The initial colors mostly use 0x30 (48) as the color value:
https://github.com/adafruit/circuitpython/blob/99a70474846c38348d4e91c74262e3959f642905/supervisor/shared/rgb_led_colors.h#L5-L15
Then this is further scaled by the default brightness values in
https://github.com/adafruit/circuitpython/blob/main/supervisor/shared/status_leds.c
https://github.com/adafruit/circuitpython/blob/99a70474846c38348d4e91c74262e3959f642905/supervisor/shared/status_leds.c#L42-L43
https://github.com/a...
that would definitely be easy to do
Yeah just include it in any example that needs it. Probably less risk then trying to include it in the library itself
Yeah, I am in favor of including it in all libraries that ultimately default to using it which is pretty much anything from old non-displayio type of drawing on displays and adafruit_epd, everything with display.text() AFAIK.
encoding it as bytes in a py file so it can be mpy-crossed and included with the current tooling is an interesting idea.
@blissful pollen @lone axle How about making it its own library? Then the other libraries would depend on it, and there would be only one copy to update if that was needed.
Sounds like a nice idea to me. adafruit_bin_font or something. It could be added to if ever there are more (although newer displayio supports different font formats). The logic in frambuf could maybe be tweaked to avoid importing it if the user does happen to set their own font file.
I don't think you would want to add more fonts in it, it would blow up in size
tangentially related, I do think that we need an Adafruit repo of selected (open source licensed) fonts, referenced in related guides (like the custom fonts guide and adafruit_display_text labels guide)
also if more than one dependent library wanted 5x8, there would be only one copy on CIRCUITPY
I agree a separate library is a good idea. The import failing will provide a clear clue as to what is wrong.
(I may have not been able to find this exact file at least twice I recall when I was starting out)
the library might just provide a directory to store the font file. Or it could have a small amount of code that would return the file path.
The CPython documentation says:
Return the value (in fractional seconds) of a monotonic clock, i.e. a clock that cannot go backwards. The clock is not affected by system clock updates. The reference point of the returned value is undefined, so that only the difference between the results of two calls is valid.
hey I would like to check that it's not my browser or content blockers, but does the search also not work in the library docs ?
Something like that:
https://docs.circuitpython.org/projects/httpserver/en/latest/search.html?q=html&check_keywords=yes&area=default
same for me. It's missing jQuery
I remember a similar thing from the core docs. Sphinx-rtd-theme or something it relies on changed something about how jquery was (or isn't any more) included. It needs a seperate pip requirement for it now iirc.
I didn't note it at first, but this also affect the search field, which doesn't work on any of the library docs.
Example: https://docs.circuitpython.org/projects/httpserver/en/latest/search.html?q=html&check_keywords=yes&area=default#
Note the irony of how the NEXT message after the error is about the loading of jquery...
<img width="1362" alt="Capture d’écran 2023-05-12 à 02 38 29" src="https://github.com/adafruit/circuitpython/assets/6160205/a693a6c6-3387-4b90-88b2-15c1bd75df65">
yeah you mentioned there that jquery is injected in the page, but too late
which matches my observations
(see the issue) 👆
Thank you! I doubt I would have figured this out as quickly as you.
#7964 was the better fix for the not-booting-at-all problem. This is now just to fix the MIDI problem. I only increased the RX (to microcontroller) buffer, and only tested this direction. Before merging, both directions should be tested to find out if they work.
CircuitPython version
Adafruit CircuitPython 8.1.0-beta.2-2-g057c152d6-dirty on 2023-05-10; BPI-Leaf-S3 with ESP32S3
Code/REPL
>>> @micropython.native
... def test_fxn():
... print("This is a test fxn")
...
...
...
>>> test_fxn()
Behavior
Device crashes immediately after above code w/o any output. Upon reconnection I see the following message:
Auto-reload is off.
Running in safe mode! Not running saved code.
You are in safe ...
ESP32-S3 defines two additional general use pins in
https://github.com/adafruit/circuitpython/blob/137e55696ebc46cdb20b444b9d7d01241c9930c1/ports/espressif/peripherals/esp32s3/pins.h#L120-L123
for which support is missing in the microcontroller module HAL.
Awesome! Good luck with your project. Thank you for the testing.
We have not re-tried this in a long time, so it is not so surprising it may be broken -- sorry.
Thanks -- I see we defined the pins in board, but forgot it in Pin.
I were able to narrow down the issue and I found a fix (at least on my code).
At some point, my code do:
# configure UART for communications with VESC
self._uart = busio.UART(
uart_tx_pin,
uart_rx_pin,
baudrate = 115200, # VESC UART baudrate
timeout = 0.005, # 5ms is enough for reading the UART
# 256 works
# 512 fails
# 1024 works
receiver_buffer_size = 1024) # VESC PACKET_MAX_PL_LEN = 512
I was using a value of 512 for the receiver_...
This fixes #7808 from my tests on a Feather STM32F405 Express.
I need to look at this again. I didn't notice time is going backwards slightly here:
>>> print(time.monotonic_ns()); r.datetime = time.struct_time((2022,1,1,0,0,0,0,0,0)); print(time.monotonic_ns())
1353792083741
1353791992187
I've been running my two S2 boards for another couple days without any luck reproducing the issue.
The Lolin board I ordered came in, unfortunately, it turned out to be one of the likely counterfeit devices based on the silk screen and lack of PS RAM. I was able to build a custom CircuitPython binary which started the REPL, however I couldn't run the test script for more than 15 to 20 minutes and the REPL/Web Access interface would peri...
Interesting. I wonder if mine are counterfeit as well. I got them on
Amazon, so not really sure. Either way, I was able to just deal with this
problem by auto-rebooting on crash, having it run safemode.py, logging the
error, doing another reboot to get into main.py and then proceed from
there. I still see a reboot roughly every 12 hours or so, but it hasn't
been a problem for my Marble Run project for a STEM lab at a high school.
The kids are having plenty of fun with the final working circui...
I'm glad you got something working :grin:. If you decide to test at the 40M flash speed let me know how it goes, but it looks to me like the issue is specific to the Lolin board so I don't think I can do much more at this point.
In my testing, the M7 can now receive (from linux vkeybd) and send (to linux timidity) midi events. So, the send buffer doesn't currently need a size increase, just the receive buffer.
Please don't force push after a review has started. If that is done, then the reviewer will see all of the changes again.
Thanks @dhalbert. I'm happy to try and debug this further, I just haven't debugged Circuitpython much yet. Is there a way to get a crash log or backtrack or something else for when this happens? Just looking for a place to start investigating.
This fixes #7808 from my tests on a Feather STM32F405 Express.
Thanks !
monotonic_ns() now always goes forward. subticks (32 per tick) were not being taken into account.
I am not so fond of the STM32 RTC peripheral.
@tulip sleet haha me too. the ones that keep time in actual calendar values are terrible
Any conversion time saved has been used up by all the engineers getting it to work or undoing the time format into something easily manipulable.
100% I assumed it was kept for backwards compatibility
This line should be wrapped in the if (args[ARG_chip_select].u_obj != MP_OBJ_NULL) { check below. Or at least have its own independent check.
As of right now, constructing this without a chip select specified causes an error to be thrown.
I shall retest and pay more attention this time
I wrote an extensive demo and uncovered some problems.
hopefully this is the last for now ^^ 🙂
@slender iron sorry for making your review harder, I know I should force-push less than I do but my mind was totally somewhere else than thinking about my reviewer
np 🙂
I am hoping to test some of the synthio stuff this weekend (new midi controller was just delivered!) so if there is anything in particular Jeff you'd like me to look at or try just let me know
@blissful pollen just have fun...?
Will do! 🙂
I have not tested all the combinations of things. the newest things are stereo/panning, ring modulation, and fir filtering so those probably have problems to be found. for sure if you give too many FIR filter entries your microcontroller will bog down and the audio will start skipping but there's really no fix for that
if you collect any good groups of settings that'd be cool to start a list of somewhere
@onyx hinge I have a note here to add a warning to the M7 guide about PWM Audio only working on A0 and A1, does this sound right to you?
I'm not sure where to add the warning. I have to update the template, and so I want to get it right on the first try.
Maybe after the wiring diagram section.
This is the page in question, if I understand it right. https://learn.adafruit.com/adafruit-metro-m7-with-airlift/pwm-audio
Doing it that way. Hope I'm on the right track here, heh.
- Fixes #7968
The native version of adafruit_bus_device.spi_device.SPIDevice did not allow chip_select to be None. The CircuitPython library did allow this. Also it would have not allowed passing None explicitly. Fixed those things, and also fixed documentation.
@tulip sleet think we can do 8.1 rc next week?
kattni would like me to do a beta.3 today (or over the weekend), to help a guide that will come out soon. I am not sure we have all the 8.1.0 issues covered yet
but the remaining issues are network crashes, not sure we can do anything about those
so maybe yes, and push those forward
I am a little mystified by #7932 (AiThinker C3). what is different about this vs C3 QT Py?
@idle owl when is the guide you need the beta for being published?
Checking, I have dates in Basecamp.
@tulip sleet Further out than I thought. May 24th.
So no rush, apparently. 😄
well, then if we do an rc (see above) next week, will be in time no problem
I don't know what related issues are already filed regarding what I was running into with this code on ESP32-S2, but I imagine someone might want to eventually look into it. I don't want to file a duplicate issue though, which is why I haven't. I don't have the cycles right now to go through what's already there and figure out how it's related, especially since I don't quite get what was going on in the first place.
was that the ping crashing?
we fixed something about pings crashing
Yes but seemingly only when having Adafruit IO time code involved.
You fixed that the espidf exception is now caught, so it doesn't dump into safe mode every time.
Meaning at least my code stopped being in safemode every 3 pings.
But the issue itself was not resolved.
It was reporting espidf Out of memory error every few pings or so. Which I passed on, and the code kept running, but I can't put that in a guide.
So when we figured out the issue wasn't present on S3, I switched and moved on.
Yeah I believe so
yeah, I don't think we would hold up 8.1.0 for that, since it can be worked around
I wouldn't think so
Also, S2 only.
So.....
¯_(ツ)_/¯
Typo of the day: PWN audio.
I don't even want to fix it.
sounds like a pirate station
Certainly does.
Just as a point of info: this sample code worked on a ESP32-S3-DevKitC-1-N8 running 8.1 beta 2
Adafruit CircuitPython 8.1.0-beta.2-27-g0a3faf8c9 on 2023-05-12; ESP32-S3-DevKitC-1-N8 with ESP32S3
>>> @micropython.native
... def test_fxn():
... print("This is a test fxn")
...
...
...
>>> test_fxn()
This is a test fxn
@tulip sleet I was going to check another C3 and punt if it works.
@proven garnet (he/him) I think the fix to this: https://github.com/adafruit/circuitpython/issues/7896 is a relatively simple minor addition to docs-requirements and a list inside of docs/conf.py. I'm going to try to confirm that on one library this evening.
Just wanted to check in with you to see if you already have anything in the works for this one so we don't duplicate effort. If you don't, I'll get prepared for a sweep to patch that in the libraries for next week.
(sorry if you got double pinged, I put this in the wrong room initially)
CircuitPython version
Adafruit CircuitPython 8.1.0-beta.2-16-gf8cbdf88e on 2023-05-09; Adafruit QT Py RP2040 with rp2040
Code/REPL
import time, random
import board
import audiobusio, audiomixer, synthio
# qtpy rp2040 SPI pins be sure SCK pin is tied to Gnd
lck_pin, bck_pin, dat_pin = board.MISO, board.MOSI, board.SCK
SAMPLE_RATE = 28000 # clicks @ 36kHz & 48kHz on rp2040
synth = synthio.Synthesizer(sample_rate=SAMPLE_RATE)
audio = audiobusio....
This is one of the issues that #7969 (earlier today) was intended to fix. can you test again?
Oh yes, testing now! Seems like synthio.Note.vibrato_depth and synthio.Note.vibrato_rate are gone?
Oh wait I see. new API. nevermind, back to testing
Yep, it's all good. With code to new API (see below), things work as intended. Thanks! And I get to close a bug! (a useless bug but still)
# ... synth init as before ...
# make and press note w/ vibrato
note = synthio.Note( frequency=110, bend_mode=synthio.BendMode.VIBRATO ) # 110 Hz = A2
synth.release_all_then_press( (note,) )
vibrato_rate = 5
vibrato_depth = 0.5
print("vibrato_rate & depth:", vibrato_rate, vibrato_depth)
note.bend_rate = vibrato_rate
note.bend_dept...
Thanks for the quick re-test!
@devout jolt just checking for your MIDI tests you go MIDI controller->computer computer->CircuitPython device?
Correct. I'm using a DAW (Ableton Live in this case) just as a MIDI forwarder. I have also just used OS-level tools to do that too, but a DAW is usually easier. You could also use a hardware dealie like https://retrokits.com/shop/rk006/ Or have hardware MIDI interface, which is just as easy in the software but a bit more of a pain to wire up
Thanks, just got an Akai MPK miniplus and been watching your synthio YT videos so want to see what this can do 🙂
The whitespace here is inconsistent: some tabs, some spaces. Doesn't matter that much, but might look different in different editors.
Totes! The MPK comes with a free DAW if you're on Mac/Windows that should work for MIDI routing if you want to stay all USB
@jepler is it easy for you to retest this? I don't have a Kaluga, though I have an Adafruit OV5640 breakout.
@anecdata When you last looked at this, it seemed like it was board sample dependent, if I understand correctly. Should we leave this open?
I meant only to note that in one instance, I had different apparent rates of safe mode between two otherwise identical boards.
The issue is still open, almost any wifi / requests code I can put together eventually goes into safe mode with recent 8.x.x (newer esp-idf too, of course). I have a number of similar long-running 7.3.3 devices that never go into safe mode. It's difficult to characterize the issue since the safe modes are intermittent. I have since seen safe mode on requests-only p...
Nope, didn't notice a double ping, thanks for this! That sounds good, I didn't have a fix in mind and my web development is rusty to non-existent, so glad you found a solution 😁
Happy to help with any of the patching though, feel free to ping and/or DM me about it. I actually have a decent list of patches to apply so I'm also happy to incorporate it into any of those if it takes a load off your plate.
perfect, thank you! This change ended up doing the trick: https://github.com/adafruit/Adafruit_CircuitPython_Logging/pull/50/files I tested it on the Logging library specifically and it has resolved the problem on the docs page. Those changes are ready to roll out whenever you do the next one.
@bill88t Please try this for #7716. I don't get any hangs with it.
Moved to long term because none of us Adafruit-funded folks have this board. QTPy C3 doesn't boot loop.
Thanks to @kreier and @tannewt we finally have a PID/VID that can be used for this device. @erongd Are you able to update your PR?
PID: 0x2023
VID: 0x1209
Reference: https://github.com/pidcodes/pidcodes.github.com/pull/827
https://pid.codes/1209/2023/
Excellent! I'll prepare a patch and add you as a reviewer to confirm.
Quick question, I've been tinkering with trying to get CPY to run on the inky 7_3, and just saw this come around. I'm more or less abandoning what I've done and I can start building on this instead.
I'm curious if the display is working for you on the 5_7? I've updated the init seq for 7.3 but still trying to iron things out.
PR has been updated with the assigned VID/PID for CircuitPython.
If anyone can let me know the right process to apply for VID/PID or can assign one. I can contribute the board definition for the Lilygo T-Display PICOC3 as well. That is the rp2040 board is the variant with the build-in wifi powered by ESP-C3 chip. The wifi part works with CircuitPython AT library support.
I don't know why is the github build failing. It is working fine on my local build. Any points on how to fix it would be appreciated.
I don't know why is the github build failing. It is working fine on my local build. Any points on how to fix it would be appreciated.
Maybe @dhalbert can offer some insight?
The use of displays has changed since that PR started a million years ago:
https://github.com/adafruit/circuitpython/commit/d5b747b305597c89430bfd8d7585340d93cfe012
And github builds the merged version, so you might need to rebase your local branch on main to build against the same code.
I think the changes I put here should work to make it work and build with main.
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
busio_spi_obj_t *spi = &bus->inline_bus;
Update to new display API.
displayio_display_obj_t *display = &allocate_display()->display;
Update to new display API.
so I had issues with fetch-submodules and the silabs build, had to install git-lfs (has that been added to the guide ?) and now with a fresh new clone, make fetch-submodules pulls 9GB instead of ~3.5 in the past (when exactly I'm not sure)
I'm still seeing issues with the REPL using these artifacts. Some of my issues could be Thonny related though, Thonny definitely is confused by the QTPY C3 at times and ends up making things worse.
I think the easiest way to see the issues I'm seeing is by trying to transfer a file greater than about 5K to the microcontroller using Thonny. I don't have the same problem sending files using the web workflow interface.
Before web workflow was available, I had written my own file transfer r...
Yup! I'd suggest opening a draft PR and we can follow up there.
Thanks @DavePutz ! So, after doing some git bisecting I ultimately found that the issue I'm having, ironically, corresponds to setting this definition in my boards mpconfigboard.mk file:
CIRCUITPY_ENABLE_MPY_NATIVE = 1
If I comment out that line I'm now able to use the @micropython.native decorator. I'm a little concerned that without that definition, though, the native emitter decorator isn't actually doing anything. Doing a quick grep I see that definition is disabled by defau...
git-lfs is included in the ports/silabs/README.md but I don't think there's a specific silabs build guide in the learning system yet.
the thing is, it seems that its absence makes fetch-submodules fail, and leave the submodules in a dirty state (I'm not trying to build silabs)
and that
❯ du -ksh ports/*
61M ports/atmel-samd
333M ports/broadcom
22M ports/cxd56
205M ports/espressif
200K ports/litex
673M ports/mimxrt10xx
33M ports/nrf
71M ports/raspberrypi
3,5G ports/silabs
781M ports/stm
400K ports/unix
Oh, I see what you mean. I've been blaming it on my ancient setup, but I usually have to run fetch-submodules/remove-submodules a couple times to get a clean state even with git-lfs installed. Perhaps the larger downloads is part of that problem as well though
CircuitPython version
Adafruit CircuitPython 8.1.0-beta.2-19-g93b0e5b74-dirty on 2023-05-12; Adafruit QT Py ESP32-S3 no psram with ESP32S3
Board ID:adafruit_qtpy_esp32s3_nopsram
UID:4F21AF44318F
Code/REPL
import busio
import board
import time
import displayio
import is31fl3741
from adafruit_is31fl3741.adafruit_rgbmatrixqt import Adafruit_RGBMatrixQT
from adafruit_display_shapes.circle import Circle
from framebufferio import FramebufferDisplay
i2...
Thanks for the suggestion. It is fixed.
Probably not directly applicable but incase you're interested, foamyguy poked at a very similar issue for a couple hours on his 4/7/23 youtube deep dive. I think he was using SPI displays though.
synthio feedback and questions
This PR adds support for Pimoroni's InkyFrame 5.7 display with integrated Pico-W.
This is not final yet, but I would like to discuss on how to best integrate the pins the inky-frame exposes via shift-register. The current pull-request exposes those pins as MP_ROM_INT, e.g.
{ MP_ROM_QSTR(MP_QSTR_SW_A), MP_ROM_INT(0)},
and is meant to be supplemented with a supporting python-library which uses the shift-register to actually extract the value of bit-number board.SW_A. ...
keypad.ShiftRegisterKeys is for inputs like this. I don't think we have any boards that expose the key numbers via board but it doesn't seem like a bad idea. Maybe it should be a nested dictionary, so that it'd be board.KEYCODES.A, and the value would compare to an event's keycode value (0, 1, 2, 3, ..., n)
Thanks for the idea - how do I model that? Something with mp_rom_obj_tuple_t?
I just noticed that the inky-frame has already been integrated as a board. I think I will close this PR and open a new one against the existing code.
something like this (untested):
diff --git a/ports/raspberrypi/boards/pimoroni_inky_frame_5_7/pins.c b/ports/raspberrypi/boards/pimoroni_inky_frame_5_7/pins.c
index 4496790c6c..038f94268d 100644
--- a/ports/raspberrypi/boards/pimoroni_inky_frame_5_7/pins.c
+++ b/ports/raspberrypi/boards/pimoroni_inky_frame_5_7/pins.c
@@ -3,6 +3,19 @@
#include "supervisor/board.h"
#include "shared-module/displayio/__init__.h"
+STATIC const mp_rom_map_elem_t KEYCODES_table[] = {
+ { M...
Are you using a recent git that can do the partial clones?
I'm on 2.40.0, a fresh clone after I installed git-lfs worked to get a clean status
also trying a fresh clone...
... it's taking a long time in git-lfs when cloning the silabs submodules
ok, yes, same thing in silabs port, 3.6G, and it took minutes to do that part
@jaunty juniper I'm not sure what we can do about this. Perhaps we could make make fetch-submodules be per port somehow.
For TinyUSB, Thach got rid of a lot the submodules and now has a Python script to fetch stuff
and I have 300Mb up/down Internet connection
yeah I don't know if we can define the "bigger ports" or "less used ports" and have them be retrieved only if explicitly asked for
something like fetch-submodules gets the most common, fetch-submodules <portname> retrieves the missing parts (and fetch-submodules all)
and remembers for subsequent calls ?
or each port's makefile detects if it was fetch-submoduled and warns ?
it's possible to specify paths for git submodule so in theory could work fine
automating it through the makefile sounds interesting
it could do the fetch if needed, and we could remove the need to do make fetch-submodules up front
Using tio and old ljinux 0.3.6 (latest master doesn't support incomplete console objects), I am unable to reproduce any of the original issues.
It can scroll in nano, redraw the whole screen, read and respond all the ansi escape sequences just perfectly.
Spamming spaces during boot (wifi & web workflow init) seems to have left a bit of unreadable garbage, but that's about it.
After it boots, it's rock solid.
I spent 15 minutes mashing the keyboard and using terminal applications.
I'll wait until this has been merged in and then re-test the issue I'm seeing. If I still see it and I can pull together a reproducible demonstration I'll open up a new issue. Really glad to see the C3 making progress!!!
say, I don't see GPIO4 referenced in the pins.c of the Feather RP2040, which is what the BOOT button is connected to in the revision, what do we do for that ? Add it as BUTTON (knowing that it's not available on older models) or GP4 ? (There is a D4 which is GP6)
https://github.com/adafruit/circuitpython/blob/main/ports/raspberrypi/boards/adafruit_feather_rp2040/pins.c
Perhaps, due to how few use console objects, it would be wise to just make a python module, to wrap the old serial functions.
It would only need to:
- Wrap the regular serial i/o.
- While serial bytes available is True, read them in a temporary buffer and return the count in in_waiting.
connected and out_waiting do not have to be implemented/wrapped, since they are not applicable.
I will make it and name it virtUART. Perhaps as a 9.0 api change, it should be considered do...
It will look very annoying on many editors, and some will complain or replace it automatically across the whole document.
Why are we in the modern era not using 'soft tab: 4' for everything?
Thanks for the lead @RetiredWizard!
@FoamyGuy I just watched your live stream. It sounds kinda similar to what I'm experiencing, but I'm not even able to get far enough to even try to get the second displayio display running. This one fails when initializing the IS31FL3741 object. This is I2C on one bus, though I'll try the ESP's second i2c bus for the second matrix and see if that makes a difference.
Did you happen to get any farther with your issue on the monster m4sk?
I tried using the other i2c bus for the second screen. No luck, same behavior. Each would work on their own, but not at the same time.
One interesting thing though, when I tried to break out of the code in to repl, it gave me an empty stack trace and restarted in safe mode. I'm going to try removing my build configs (2 display limit and native IS31) and see if that continues to happen.
No such file or directory: 'arm-none-eabi-gcc' I thought that was what I just installed
wasn't there some discussion a few weeks ago about setting up a way to build for a specific board on github?
well that would be a path issue ?
do you mean that ?
https://github.com/adafruit/circuitpython/pull/7594#issuecomment-1432525280
yeah, that, I guess that should work?
the mac install doesn't give any instructions other than "Download and install the appropiate .pkg file for your Mac" but maybe they need adding to the PATH ?
I don't do it like that anyway, I have the zipped versions in a directory, and my build script manages the path as needed
i don't know about that, I'm trying the GitHub action
worst case, I make a PR and test the artifact 🤪
YOLO
hopefully I didn't break the espressif local build with all this
crud, it did break
ok, that was obvious enough to fix
Draft for now... took a first stab at PicoW AP static IPv4. A couple of oddities...
- Unlike
espressif, AP needs to be started before the changed IP info takes effect:
>>> import wifi
>>> import ipaddress
>>>
>>> ipv4 = ipaddress.IPv4Address("192.168.251.2")
>>> netmask = ipaddress.IPv4Address("255.255.255.0")
>>> gateway = ipaddress.IPv4Address("192.168.251.1")
>>>
>>> wifi.radio.set_ipv4_address_ap(ipv4=ipv4, netmask=netmask, gateway=gateway)
>>>
>>> wifi.radio.sta...
Hello, I was trying to do something like JavaScript's setTimeout in CP, I found this article about multitasking https://learn.adafruit.com/multi-tasking-with-circuitpython/all-together-now, but the solution there is very manual. Is there a library for doing something like this (image below), and if not, would this be a good candidate for a new lib e.g. adafruit_eventloop? I would be happy to make it if that is the case.
like a helper for asyncio or something different ?
there's the circuitpython_schedule module too
https://cognitivegears.github.io/CircuitPython_Schedule/
Thank you 
This should be api-compatible with console objects and be able to be used by esp32 and esp32c3.
Why do you restrict the import of the module adafruit_ble if the board is not supported. It seems strange to do such a thing given the market offering of the airlift coprocessor ?
Traceback (most recent call last):
File "main.py", line 16, in <module>
File "adafruit_ble/__init__.py", line 25, in <module>
ImportError: no module named '_bleio'
@akoebbe I got some issues relating to multi-display resolved, but I think there are still some remaining. IIRC The Monster M4sk was working to initialize both displays when I last messed with it. But I did still have some hard faults with other combinations of devices and displays. I don't believe I ever tried specifically two I2C displays, and none of my testing was with FrameBuffer display / RGB Matrix.
The page is not published, but you can view it at this temporary link: https://learn.adafruit.com/welcome-to-circuitpython/board-and-port-specific-limitations?preview_token=WsdVgHQVBTr9iHLerIfyWA.
We ended up not doing this. Instead, there are some limitations listed in https://learn.adafruit.com/welcome-to-circuitpython/frequently-asked-questions. In the ReadTheDocs pages, there are now Limitations: sections describing various port-specific limitations.
Why do you restrict the import of the module adafruit_ble if the board is not supported. It seems strange to do such a thing given the market offering of the airlift coprocessor
adafruit_ble depends on _bleio. There are several implementations of _bleio:
- nRF native implementation.
- Espressif native implementation. This implementation is incomplete: see https://learn.adafruit.com/welcome-to-circuitpython/frequently-asked-questions#faq-3129409
- BLE HCI implementation done b...
I have tried with the featherS2 and featherS3 by unexpected maker and I’ve also tried the adafruit Rp2040 feather I’ve had no such luck with any of them but the strangest thing is I had it working on 6.x circuit python with the rp2040 but not amnymore on the later versions.
From: Dan Halbert @.>
Date: Sunday, 14 May 2023 at 17:31
To: adafruit/circuitpython @.>
Cc: kairos0ne @.>, Comment @.>
Subject: Re: [adafruit/circuitpython] document port, chip, and boa...
Perhaps move this up and use it for the return?
It should not make much difference since optimisations are made, but yea.
Haven't seen extras so it should be good.
Won't this affect gdb? I should probably test it.
Obviously I meant along side the Airlift Featherwing, plz excuse my tone I’m a little frustrated that I bought three boards and two airlifts – my project requires BLE only to find that its not supported for these boards. The Airlift coprocessor is advertised as a BLE solution for any feather based board and if there are three that it in fact doesn’t work with then people should know that before they spend money…
From: kairos0ne @.***>
Date: Sunday, 14 May 2023 at 17:36
To: adafruit/c...
Why do you restrict the import of the module adafruit_ble if the board is not supported. It seems strange to do such a thing given the market offering of the airlift coprocessor ?
Traceback (most recent call last):
File "main.py", line 16, in
File "adafruit_ble/__init__.py", line 25, in
ImportError: no module named '_bleio'
_Originally posted by @kairos0ne in https://github.com/adafruit/circuitpython/issues/6930#issuecomment-1546919567_
Obviously I meant along side the Airlift Featherwing, plz excuse my tone I’m a little frustrated that I bought three boards and two airlifts – my project requires BLE only to find that its not supported for these boards. The Airlift coprocessor is advertised as a BLE solution for any feather based board and if there are three that it in fact doesn’t work with then people should know that before they spend money…
- It's true that
_bleiosupporting AirLift is not turned on for ESP32-S2 ...
@kairos0ne I am going to close this issue because the original issue was a general one about documentation that has been addressed. Let's continue AirLift BLE support in #7977.
Try the RP2040 again -- it should be on (I verified on such a board), and I don't understand why you are not seeing it.
Turns out that lwip only provides the DHCP client. The DHCP server comes from shared/netutils, and it is inited only once, deep in the cyw43 driver when wifi is inited:
https://github.com/georgerobotics/cyw43-driver/blob/05d76fe0091f3a3383d5e310b604ddc7d9556ed2/src/cyw43_lwip.c#L236
I'm not sure if or how the DHCP server can be turned off and re-started, without a lot of side effects.
The Nano Connect RP2040 has 16mb of flash and may be able to support dualbank.
Does anyone know of any blockers for implementing this?
CircuitPython version
Adafruit CircuitPython 8.1.0-beta.2-31-g827eaeb1f on 2023-05-12; VCC-GND YD-ESP32-S3 (N16R8) with ESP32S3
Board ID:yd_esp32_s3_n16r8
UID:4F21AF1E1F4B
Code/REPL
print("hello world!")
Behavior
My IDE is VScode with Circuitpython extension.
after >CircuitCython: Open Serial Monitor , a serial port selection window pops up with the following information: COM20 Microsoft | 303A | 8166. The information followed by COM20...
Hi,
Those 2 Luatos boards are quite cheap and simple. Could you please add support to them? Thank you.
The schematics for luatos ESP32-S3:
https://wiki.luatos.com/chips/esp32s3/hardware.html
Note: the MCU is ESP32-S3R8, the flash could be 25lq128ewig or 25lq128cvig
There are two version of ESP32-C3:
https://cdn.openluat-luatcommunity.openluat.com/attachment/CORE-ESP32-C3%E8%AE%BE%E8%AE%A1%E5%8E%9F%E7%90%86%E5%9B%BE_V1.2.pdf
[https://cdn.openluat-luatcommunity.openlu...
Hi - Adafruit staff does not perform the work of adding boards that we don't sell. We welcome board additions by the community: https://learn.adafruit.com/how-to-add-a-new-board-to-circuitpython
Can someone in the following days help me finalize the m5stack timer camera circuitpython port?
It's a board sold by adafruit (yes, https://www.adafruit.com/product/4959), yet has no circuitpython port.
I have finished the rest of the port (led, psram, i2cs), I just need to do the camera part.
I have never used espcamera so it's really hard for me.
Thank you for the information. I have notified the manufacturer, and I believe they will add the support very soon.
Turns out that the netutils DHCP server can be turned off and back on again without obvious side effects.
AP:
Adafruit CircuitPython 8.1.0-beta.2-32-gcf124ab85 on 2023-05-14; Raspberry Pi Pico W with rp2040
>>> import wifi, ipaddress
>>>
>>> ipv4 = ipaddress.IPv4Address("192.168.251.2")
>>> netmask = ipaddress.IPv4Address("255.255.255.0")
>>> gateway = ipaddress.IPv4Address("192.168.251.1")
>>> wifi.radio.start_ap("Bob", "YourUncle")
>>> wifi.radio.set_ipv4_address_ap(ipv...
The dependency rabbit hole goes a deeper than I hoped for each port.
esp_ota_ops.c looks port specific and a significant chunk of code that is beyond my C expertise.
Quick update, I took a look at this PR and from what I can tell the only ISA supported by the native emitter is thumb:
https://github.com/adafruit/circuitpython/pull/2271/files
Naively, I tried a quick and dirty test where I force support for xtensawin by making this change to circuitpy_mpconfig.h:
//#define MICROPY_EMIT_INLINE_THUMB (CIRCUITPY_ENABLE_MPY_NATIVE)
#define MICROPY_EMIT_INLINE_THUMB (0)
//#define MICROPY_EMIT_THUMB (CIRCUITPY_ENABLE_MPY_NATI...
I also use VScode and on Linux.
Are you sure your serial port exists on your system? can you open the serial port on any terminal software??
Now that main.py works as expected, after I changed the UART receiver_buffer_size from 512 to 1024, another issue appear: the web page on circuitpython.local opens, however if I click on the editor, file browser or terminal, they do not work and even if I refresh the circuitpython.local, it will not work anymore, saying: Firefox can’t establish a connection to the server at cpy-29f7f0.local.
, but somehow doesn't have CircuitPython support.
The work-in-progress PR I made is here.
I would complete the port myself, but I am unable to do the camera.
I have it working under arduino, so the pins are known and tested.
The board schematics are available in 2 parts, [here](https://m5s...
You should try connecting to the board with Putty for testing.
You can find the COM port of the board from the windows device manager (Super + X -> Device Manager).
Remember to set the baudrate to 115200.
I am the one who made the board port, and it works on my sample.
The delay could be considered a 'necessary' part of stopping STA.
So perhaps it should just be added in the stop_station code.
If you guys agree on that I will go ahead and PR it.
On my Feather ESP32-S3 TFT, I can import microcontroller; microcontroller.reset() just fine. It reboots to normal mode.
That makes sense. If the delay is known, the code can wait. It could also poll some status itself and return quicker if it has stopped, but that may not be possible. It shouldn't poll indefinitely in case the status is never satisfied.
I have only fumbled a little bit with lwip (back when I did AP), but looks good to me.
@bill88t @casainho I have tested with putty, rather than some unreadable code, all others work good. But serial monitor in circuitpython still doesn't work.
<img width="505" alt="20230515212848" src="https://github.com/adafruit/circuitpython/assets/36795033/b62e41e9-34e2-4451-b5bc-b67da83fe89b">
Also, I did some test with the ESP32-S3-BOX V8.0.5. Once I close the Circuitpython cmd window in the vscode, the commands >circuitpython: Select Serial Port , `>circuitpython: Open Serial Monit...
If the REPL is working (you can read and write to it) the issue does not lie within circuitpython.
Raw REPL (can be opened with Ctrl + A), that these programs use also works on my sample as expected:
>>>
raw REPL; CTRL-B to exit
>OKHello world!
>
Taking a look at the circuitpython extension, it warns:
NOTE FOR WINDOWS USERS: I have seen trouble with the serial console, displayi...
How about looping this check:
https://github.com/adafruit/circuitpython/blob/827eaeb1f9e0d3711215cfeb6558ac64deda7fea/ports/raspberrypi/common-hal/wifi/Radio.c#L173
in wifi.radio.stop_station(), so that when it exits, it's a clean stop?
I think I've seen this on a Feather S2 TFT as well during testing of the HTTPServer library upgrades. In my case there is no camera in use. I had neopixels and in one case a 14x4 segment featherwing.
I think I've seen it occur even when no other hardware is in the mix beyond just the httpserver, but I'm not 100% certain and much more of my testing did involve at least interacting with neopixels.
I believe the hard fault occurred after the server was left running for a few hours.
...
Sounds good on paper, but will have to be tested. I will do so.
I will also add a regular timeout so it doesn't get stuck.
It's simple enough I should be able to make it a console object.
From there, plugging it into the os is a piece of cake.
Are there special steps needed in espressif port to have a debug build that can connect to WIFI? It seems that CIRCUITPY_WIFI_SSID and password in the settings.toml is not auto-connecting in the debug build. Trying to connect manually in user code reports this error: ConnectionError: No network with that ssid but I know the ssid does exist and has the correct name. The non-debug build on the same device does connect successfully to that network.
Hmm, I in the past used to only have debug builds on my boards (I blame stackless), and all that worked fine.
What board are you using?
Feather S2 TFT
Hmm, no idea.
I was also using s2 back then.
It's been a good while since I last used debug though.
If you scan, will it show up?
I will try to find the scanning code and give it a try. Up to now I've just copy pasted the connect code, and eventually removed that when automatic connect from settings.toml start happening.
From ljinux wifi:
def scan(self):
"""
scan and store all nearby networks
"""
if wifi.radio.enabled:
net = dict()
for network in wifi.radio.start_scanning_networks():
sec = None
if len(network.authmode) is 3:
sec = str(network.authmode[0])
sec = sec[sec.rfind(".") + 1 :]
else:
sec = "Unknown"
net.update({network.ssid: [sec, network.rssi]})
del sec
wifi.radio.stop_scanning_networks()
return net
return list()
@lone axle does the ConnectionError: No network with that ssid persist with retries? I can try a debug build and see what happens.
It does seem to persist. I tried maybe 3-5 times only though before switching back to non-debug to confirm
Tried scanning, but have fallen a little deeper into the rabbit hole: I got a single result the first time with a network that is visible around me, but not the one I was using. It did not show the actual network that I've been using. I was trying to get it to retry and now I've ended up into a (different from the one I was hunting I think) hard fault
I remember there was an issue back in the day that reduced effective range, but that was really old.
It was way before stackless.
In my case, based of the signal strength reported in my PC at least the real network I am using should be closer than the one that it did happen to list when I scanned.
Interesting. I have had another handful of retries now back in debug mode. I've seen 2 networks a few times, but vast majority of scan attempts only show 1. And neither of the 2 shown have been the actual one that I use.
I will try to move it closer to the router, but I'm a bit skeptical of the distance being a factor. It's already only ~6ft or so from the router, and I'm fairly certain that the network that is showing up most commonly in the scans is one that isn't from an AP inside of my house (I hope anyway 😅 ).
this debug build is a few days old, but```
W (120290) CP wifi: connected
I (120310) wifi:<ba-add>idx:0 (ifx:0, 00:1a:dd:re:da:ct), tid:0, ssn:1, winSize:64
I (120330) wifi:AP's beacon interval = 102400 us, DTIM period = 1
I (121290) esp_netif_handlers: sta ip: 192.168.6.148, mask: 255.255.252.0, gw: 192.168.4.1
W (121290) CP wifi: got ip
I haven't seen an issue with running wifi code
does the debug build use a different tx_power ?
Weird, now it's about 10 inches away from the AP and I am consistently getting an empty dict back from scan.
Doesn't seem the value is set by CP at all, just went to ports/espressif/common-hal/wifi/ and I can't find much with tx_power.
It's probably a default
are you basically at tip of main?
is there any kind of 5G vs. 2.4G that comes into the mix (forgive me if it's an ignorant question tbh I treat WIFI as mostly magic)?
I don't normally mess with it at all, and I'm not sure which my AP is.
I am at a fully updated main.
I will build debug for all my esp boards.
'retty sure esp only does 2.4
yes, only 2.4
I'll test a fresh rebuild
what did you disable to get the debug build to fit?
CIRCUITPY_ULAB = 0
same
My phone seems to think the network (that I'm trying to connect to) is 5G, though I would guess perhaps the AP outputs both. I'm trying to find a way to confirm that.
I would assume it does a compatible one though because networking does work fine for me in standard builds on this device.
I nuke audio stuff.
I tried that, but there seem to be a lot of dependencies there
Fair nough.
Okay, yep. I've confirmed with a different scanning utility I have 2 networks with the same name, one 5G and one 2.4G.
CP will only see the 2.4 one, the other should not exist as far as it's concerned.
takes me a while to build, can't do -j because... reasons
Built on my s2 board, loading now.
(errors with -j, some script issue isn't managing the parallelism right?)
top of main is fine for me
I did -j12 rn.
Using my pc, not the poor pi400 rn.
Adafruit CircuitPython 8.1.0-beta.2-30-gca01200b4-dirty on 2023-05-15; ESP32-S2-DevKitC-1-N4R2 with ESP32S2 DEBUG build connects fine, scan shows a few dozen APs (most of them mine) ...RSSI values from -33 to -86