Please post the full error message, including any line number info.
#circuitpython-dev
1 messages · Page 40 of 1
CircuitPython version
Adafruit CircuitPython 8.2.0-rc.1 on 2023-06-27; Raspberry Pi Pico W with rp2040
Code/REPL
import wifi
wifi.radio.hostname = 'some-long-value'
print(wifi.radio.hostname) # some-long-value
wifi.radio.hostname = 'a-value'
print(wifi.radio.hostname) # a-valueng-value
Behavior
The value of wifi.radio.hostname is not replaced by the new value, but replaced.
Description
No response
Additional information
_No resp...
Occurs on Pico W, but not on Espressif.
I'd like to propose a docs change, or a functionality change. The docs currently say supervisor.reload performs the equivalent of ctrl+d. It's right above supervisor.set_next_code_file which is what I wanted. I read that and then ran something to set code2.py next. Then I typed supervisor.reload in the repl and nothing happened. Can we add to the supervisor.reload section (or maybe as a last point to set_next_code_file) that supervisor.reload doesnt work from the repl and you have to use ctrl+d.
Instead of the docs change can I suggest supervisor.reload could be made to work from the REPL too. It was explained to me there are possibly good exception catching reasons that are useful to the REPL that maybe prevent it working, so path of least resistence is probably a docs warning that could prevent other tired/confused users from losing time over it.
It's certainly confusing! Could you open an issue? Then it gets on the to-do list. You could submit a doc PR too, if you feel up to it.
I wanted to reload into code2.py. I used the built in serial monitor in vscode which has a ctrl-c button (it has a dropdown to switch to ctrl+d/z/etc), I used it to escape my code.py file and then imported supervisor.
I setup with supervisor.set_next_code_file('code2.py', reload_on_success=False, reload_on_error= False, sticky_on_success= True, sticky_on_error= True, sticky_on_reload= True)
then used supervisor.reload()
nothing happened. I expected it to soft-reboot. I daren't use microc...
Commenting out this line seems to eliminate the fault:
wifi.radio.enabled = False
There is no line number. The code finishes running (using serial port if connected), then the board disconnects from the Mu editor / windows, reboots, briefly displays "static", and finally displays "fault detected by hardware".
Photos-001 (16).zip
CircuitPython version
Adafruit CircuitPython 8.2.0 on 2023-07-05; Raspberry Pi Pico W with rp2040
Code/REPL
import wifi
import mdns
import socketpool
from adafruit_httpserver import Server
# set SSID and pwd in settings.toml
pool = socketpool.SocketPool(wifi.radio)
server = Server(pool, debug=True)
try:
mdns_server = mdns.Server(wifi.radio)
mdns_server.hostname = wifi.radio.hostname
mdns_server.advertise_service(service_type="_http...
import wifi
import mdns
try:
mdns_server = mdns.Server(wifi.radio)
mdns_server.hostname = wifi.radio.hostname
mdns_server.advertise_service(service_type="_http", protocol="_tcp", port=80)
except RuntimeError as e:
print("MDNS setting failed:", str(e))
Works if web workflow is not enabled in settings.toml, but not if web workflow is enabled.
mDNS only allows one service_type and protocol per port, and web workflow automatically sets up an HTTP (TCP)...
The issue is in the following line, strlen dosen't count the null terminator.
I have started working on a canio implementation for the Teensy Micromod (mimxrt10xx port).
I am not a circuitpython nor a CAN bus expert but I hope I can make a working version and pass on enhancing and supporting/testing more mimxrt10xx boards (other than Micromod) to others.
I am making this git issue to track/publicize my work (according to this forum reply: https://forums.adafruit.com/viewtopic.php?p=978568#p978568)
If there is any CAN bus expert who could do code review or make s...
It's mentioned in the mdns readthedocs, but not the complication of mdns + web workflow.
I've been accumulating a short list of readthedocs edits to PR for port-dependent network limitations, I'll add this.
This PR adds support for the Liatris, an RP2040-based Pro Micro replacement.
The firmware has been confirmed to work on a real board, with basic I/O tested and confirmed to work. UART/SPI/I2C have not been explicitly tested, but are assumed to be functional due to similarity with other boards already in CircuitPython.
The USB VID was obtained from Raspberry Pi.
I just received the Python on Hardware mailing: "Python on Microcontrollers Newsletter: CircuitPython 8.2.0 Stable Released" but that is like one day too early. Is there something special, or it is the 8.2.0 special edition?
Yup, it's a day early on purpose. Enjoy! 🙂
I was ready to announce you all and Anne about my new project: https://github.com/dglaude/Mouse_Jiggler_Trinket_M0/tree/main
Given the plan for this evening (I am in Europe), I don't even have time to finish or fill the meeting notes.
But if anybody want to have a sneak preview or has comment on the code, I can improve that for next newsletter and do my usual Mastodon / Twitter post about it.
It is the ultimate M0 based mouse jiggler.
I'm happy to include it in next week's newsletter!
<@&356864093652516868> We look forward to hearing from everyone during the weekly meeting after the week off last week. The meeting will be held here on discord in the CircuitPython voice channel at the usual time of 2pm Eastern / 11am Pacific which is just over 1 hour from now. You can fill in any notes you have to the shared document: https://docs.google.com/document/d/1ajdwXoubhG86rUVabqTcEzHvOKfUgK9TgPdDxqBDlSc/edit?usp=sharing. See you there.
Google Docs
CircuitPython Weekly Meeting for July 10, 2023 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 at...
@candid sun btw there is a way to do "more natural" (and more efficient) asyncio on keypad events but it needs a weird block of code.. https://github.com/adafruit/circuitpython/pull/6712
The weird block of code has never been put in a library/module/package or anything
If you are interested in this and want to learn more feel free to ask, but you don't necessarily need to do it that way.
cool, thanks @onyx hinge !
is there still time for a mic check? I'm on a different computer.
@onyx hinge I think you had an echo, and you're a bit loud.
I tried turning on echo cancellation, hopefully it's still good
Not a preview for this week's newsletter and the next two issues! (They will go out at 11am on Monday.)
Hooray! 😊 🎉
gotta start somewhere
I started a basic input text for displayio at one point. But realized how complicated cursors really are once I got into it. Mine ended up very wonky.
I have two SCD41's, and one SCD40
thanks all!
Thanks
Thanks, everyone!
Thanks all! Have a good week!
I wonder if new boards are enough of a reason to do 9.0 off main
Thank you! We're happy to review when you have some code you are ready to share. It doesn't need to be perfect. :-)
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/10AzCwaac8jCgfUiFIPchwTghFqHptCV99iMCsZfxAwo/edit?usp=sharing
are we ready for an 8.2.x milestone? seems like a couple of these new issue could go there
@slender iron seems fine by me!
sure - i wasn't sure, but I see several
I'll make one
thanks!
Have been text only watching the USB host work and drooling at the new possibilities. As for cursors for input, I made one for the pye editor for the cyberDUCK but just made the letter a simple inverse. Never tried for a real flashing “insert here” type of cursor. https://hackaday.io/project/171269-cyberdck-a-circuitpython-anatidae
@mental nexus how did you handle switching between running code and editing it?
ooh pye doesn't look too shabby
@mental nexus how'd your cursor work? A non-flashing block cursor would be fine as a starting point for me.
I guess that project's not displayio based is it
- Keebs Frood Rev7 uses a new 4 MB flash chip (Winbond W25Q64JVUUIQ)
I think you need to list the flash chip of all revisions here, separated by commas:
EXTERNAL_FLASH_DEVICES = "ZD25WQ16B, W25Q64JVxQ"
Otherwise, I think that running this on an older revision board with the ZD... chip would fail.
Typical example from an adafruit board:
ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk:EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C"
The syntax seems to be written "A","B" in some places and "A, B" in others. I'd u...
W25Q64JVUUIQ is 8MB (64 Mbit). This new build will not work on the old boards with 2MB flash. Or are there no old boards?
…/capablerobot_usbhub/mpconfigboard.mk:EXTERNAL_FLASH_DEVICES = "GD25Q16C, W25Q16JVxQ"
…/stm32f411ce_blackpill_with_flash/mpconfigboard.mk:EXTERNAL_FLASH_DEVICES = GD25Q16C,W25Q64FV,W25Q32JVxQ,W25Q64JVxQ
```It's probably not HURTING anything that we use all these syntaxes, assuming they work ...
¯_(ツ)_/¯
@onyx hinge any thoughts on how to handle a usb_host.Port living longer than a VM?
with displays we require you to release them
I wonder if we should just automatically release at next use
or something like that
can they just be created each time the VM starts?
they could but it throws an in-use error now
This is ancient history so just relying on memory. I started everything from the REPL. Just exec the editor to edit my file and then exec the edited file.
I have had some Ideas about replacing supervisor allocations with objects that can live through VM resets, and maybe can re-locate/compcat when the VM is reset, but it is in the "this is an idea" stage rather than something that's implemented.
and then of course there are the way that board.SPI / board.I2C work, would that model fit at all?
if the board has usb host natively, it can do it in board_init()
since I've concentrated on the host keyboard stuff I haven't actually used usb_host.Port
I made a terminal out of displayio. Can’t remember how I did the cursor will have to look at my code to remember. https://github.com/kmatch98/simpleTerminal
@onyx hinge you could have a cursor tilegrid that you blink on top of the regular terminal
Yep looks like I just have a white rectangle behind a black character.
@microdev1 Want to get this ready once more and we'll merge it now that 8.2.0 is out? Thanks!
Thanks @jepler, I had no idea I could do that! The firmware indeed works with both the new (Winbond) and the old (Zetta) revisions.
Connects up read, write and ctrl_transfer to TinyUSB. USB Host support is available on iMX RT and RP2040.
Fixes #6527 (imx) and fixes #5986 (rp2).
Thanks for spotting that, @dhalbert - I copied the wrong device identifier. The latest revision of my board uses W25Q32JVUUIQ, a 4 MB chip.
Funnily enough CircuitPython did actually work with the wrong second device identifier on both the old (2 MB) and the new (4 MB) boards...
one or two things that look fishy. but overall it looks fine and it looks like low chances of adversely affecting anything non-usb-hosty
are device addresses guaranteed to be small numbers <32?
should this remain or was it for debugging?
Debugging. Commented it out.
I believe so because we configure TinyUSB for 4 devices and a hub. https://github.com/hathach/tinyusb/blob/f1e006d09bd32088ab421d0b519eb89c531eda4e/src/host/usbh.c#L199
CircuitPython version
Adafruit CircuitPython 8.2.0 on 2023-07-05; Raspberry Pi Pico W with rp2040
Code/REPL
import wifi
for network in wifi.radio.start_scanning_networks():
str(network.ssid, "utf-8"), network.rssi, network.channel))
wifi.radio.stop_scanning_networks()
Behavior
Does not detect an iPhone personal hotspot - set with "Maximize Compatibility"
Is this a function of the WiFi chip or the hardware or an Apple issue. Needless t...
I was also getting issues when using ESPNow to communicate between a ESP32-S2 and a S3. In all this, I found that the initialization need to be a bit different between them.
For ESP32-S2, the initialization need to be this (see that I am communicating with 2 different ESP32 boards, one with ESP32-S3 and other with ESP32-S2):
# MAC Address value needed for the wireless communication
my_mac_address = [0x68, 0xb6, 0xb3, 0x01, 0xf7, 0xf3]
mac_address_power_switch_board = [0x68, 0...
@slender iron a different, wired keyboard was still working (accepting keystrokes) after running overnight.
I will review this, but I have a hw question: why use parallel shift registers instead of chaining them as a single long shift register? Is it to reduce latency?
It's possible the phone is creating a hotspot only at 5 GHz. Pico W (and current Espressif ESP32* chips) support only 2.4 GHz.
I will review this, but I have a hw question: why use parallel shift registers instead of chaining them as a single long shift register? Is it to reduce latency?
No in this case there are 4 independent and optionally connected button controllers. Each button controller has 32 switches (4x HC165 chained) and has a free independent physical location. All max 4 controllers are individually connected to the same control board with a 2meter wire (with 5 strands). So save 3x latch+clock pins o...
Makes sense, thanks. For things like keyboards, some people claim latency issues, but we are often skeptical. Yes, shift registers are fast.
I'm not entirely clear on the distinction, other than the shared _espnow for the (ESP32-S2) device with two peers. Does this setup not work if the ESP32-S2 and ESP32-S3 are swapped?
I'm not entirely clear on the distinction, other than the shared
_espnowfor the (ESP32-S2) device with two peers. Does this setup not work if the ESP32-S2 and ESP32-S3 are swapped?
The only difference is that this code is needed on S2:
wifi.radio.start_ap(ssid="NO_SSID", channel=1)
wifi.radio.stop_ap()
That makes sense. ‘’’ Note
Personal Hotspot uses a 5 GHz connection by default. On iPhone 12 or later, you can turn on Maximize Compatibility for Personal Hotspot to use a 2.4 GHz connection. Turning on Maximize Compatibility might reduce internet performance and Wi-Fi security for devices connected to the hotspot. For more information, refer to If Personal Hotspot is not working on your iPhone or iPad (Wi-Fi + Cellular).
@slender iron I noticed that e.g., the "product" string was shown with a trailing NUL '\0'. fix at https://gist.github.com/jepler/6db3b04596ce9dd7c6c0fa5482439b3c
do you have a philosophy about whether supporting e.g. USB MIDI would be done using pure Python code, or if it'd have C code in the core?
@slender iron I tried to use my USB MIDI device from CP but didn't have success.
Here's the code I can run on my host computer: py import array from usb.core import find, USBTimeoutError dev = find(idVendor=0x1c75) b = array.array('B', [0] * 8) while True: try: r = dev.read(0x81, b, 10000) print(r, b) except USBTimeoutError: print(end="...") (I have to run it as root and also "unbind" the kernel driver in the linux way: root@bert:/sys/bus/usb/drivers/snd-usb-audio# echo 1-1:1.2 > unbind)
On CP with rp2040 usb host feather, it just hangs at the dev.read call.
On Linux it prints something whenever I press a key on the MIDI keyboard, turn a knob, etc.
Good to try! I was running into an issue with tinyusb not calling us back.
[adafruit/circuitpython] New branch created: qtpy_esp32s3_4mbflash2mbpsram
@onyx hinge what device is it exactly?
@slender iron it's an Arturia minilab 3 midi keyboard, it was recommended by todbot and jp for synth stuff
I was thinking it'd be done from Python. I'd only do "workflow" related things natively
👍 I have some midi keyboard too I think
I'm about to head out to help a friend, so itmya be the afternoon before I'm back
and when I come back I want to test the rp2040 metro prototype, probably won't get back to USB immediately
I just got back from the daycare run so I'm just getting going
we can talk more later, whether today or later in the week!
Adding new QT Py ESP32-S3 with 4MB Flash/2MB PSRAM (PID 5700). grabbed VID/PID from spreadsheet.
I already added this here: #8130. It was just awaiting testing. It has another minor fix too.
@dhalbert oh! okay, i'll close this then.
Feel free to test and approve mine :)
Nope!
Wow, this is huge! Thank you!
Wow, this is huge! Thank you!
Thanks! It isn't bug free so please file issues as you find them.
Adding the new QT Py ESP32-S3 with PSRAM
Images automagically compressed by Calibre's image-actions ✨
Compression reduced images by <strong>65.3%</strong>, saving <strong>30.92 MB</strong>.
| Filename | Before | After | Improvement | Visual comparison |
|---|---|---|---|---|
| <code>assets/images/boards/large/01space_lcd042_esp32c3.jpg</code> | 349.95 KB | 173.80 KB | -50.3% | [View diff](/adafruit/circuitpyt... |
There is appropriately-licenesed code in pico-extras to support SD cards in SDIO mode. Adapt this code for CircuitPython.
The USB-C port on my Macropad just fell off…it had a little bit of a rough time in the theatre.
All is good though, as I repaired it as soon as I got home with some lollipop sticks.
It needed a quick reminder of all the sketches that were on it but it’s running again
meanwhile in the theatre…a splash screen?
@slender iron using code similar to what I pasted?
yup. it is an arturia keystep
(I removed the time out)
lemme see how many changes I have on my branch
On branch usb_host_keyboard
Your branch is ahead of 'jepler/imx_usb_host' by 1 commit.
(use "git push" to publish your local commits)
I have a commit that fixes the trailing '\0' in the device strings, that's all. I made sure submodules were up to date.
I was entering the code in the REPL since it tended to freeze the device and be difficult to recover from
I also don't know the correct way to find the endpoint number..
it involves fetching the descriptors and parsing them
it should be the same as it is in linux
yeah, lsusb -vv is how I found the endpoint number in linux. but what I meant was, I don't know your plan for how CP code would discover that information..
anyway I'll try that code tomorrow in code.py and see if it makes a difference. otherwise, 🤷 , I can just move on to trying something else I guess
cp code can fetch and parse the descriptors
or you hard code it
here is my branch: https://github.com/tannewt/circuitpython/tree/usb_sharing
@onyx hinge do you remember if we adopted some qstr changes from MicroPython early? I am seeing some things in the 1.19.1 merge that seem to be already merged, but the three-way merge is also showing "old" code that is not in the current adafruit/circuitpython. I looked in our PR's but could not find anything. There is a lot of restructuring of qstrs and their generation in this merge (separating out the hashes and length, for instance).
the last stuff is not our code. It's some other stuff that seems to be already incorporated
maybe this is just some peculiarity of three-way merge going back in time because there's a merge conflict
@tulip sleet no that doesn't ring a bell right now
thanks anyway
Looking at patching up the Learn Guide repo for a few things, among them the releases. I happened to notice that releases aren't being created for it, and it lines up with with the permissions update you did @tulip sleet for preventing non-PR pushes. Can we make adafruit-adabot have Maintain status for that repo? That should fix it I think.
I just saw your YouTube live video @tannewt. Amazing timing that you just completed it today! Congrats!
Anyway in that video you casually mentioned eventually being able to connect a USB device to an ESP32-S3 Feather and use it with an iPad over Bluetooth. I am looking into possibly doing that for my ZSA Moonlander, any ideas on how one would accomplish this feat using circuitPython?
Thanks for spotting! I switched adafruit-adabot to maintain. If necessary, I can turn off the branch protection rule again.
Thank you! I'll keep an eye out for things over the coming days 😁
i have the same problem
i works fine on 7.3.3
but the versions afer 8.0.0 makes it stuck in bootloop
( the same board)
I cannot find this to buy; it appears to be discontinued. If you have a US-purchase link, could you post it?
I looked through the changes between 7.3.3 and 8.2.0 and I don't see what would cause this. There are changes which partition table file are used, but those changes just seem to be renamings.
If anyone feels like doing a bisect, that would be great. Maybe start with 8.0.0-alpha.1 and see if that fails, and then bisect main vs that. But it requires an experienced builder. An alt...
Thanks for the support
I’ll check all the versions (alpha and beta)
And find which version it fails
I’ll let you know
-parsa
On Jul 12, 2023, at 4:49 PM, Dan Halbert @.***> wrote:
I cannot find this to buy; it appears to be discontinued. If you have a US-purchase link, could you post it?
I looked through the changes between 7.3.3 and 8.2.0 and I don't see what would cause this. There are changes which partition table file are used, but those changes just se...
Hello again,
The problem occurs on 8.0.0-beta2
It woks fine on 8.0.0-beta1 and previous versions
Thanks
-parsa
On Jul 12, 2023, at 4:49 PM, Dan Halbert @.***> wrote:
I cannot find this to buy; it appears to be discontinued. If you have a US-purchase link, could you post it?
I looked through the changes between 7.3.3 and 8.2.0 and I don't see what would cause this. There are changes which partition table file are used, but those changes just seem to be renam...
I'm not super stoked about the TX/RX pin naming but otherwise this looks good.
tested:
- boots to circuitpython :) :)
- sd card works with sdcardio
- red LED works
hihi @onyx hinge looking into this and hitting a wall with keypad and seesaw. it doesn't seem like there's a way to pass seesaw pins like GPIO pins to keypad? there is a seesaw keypad class (https://docs.circuitpython.org/projects/seesaw/en/latest/api.html#adafruit_seesaw.keypad.Keypad) but i think it has to be part of the device firmware, which the quad rotary encoder doesn't have or at least i wasn't able to get it working
@candid sun the idea was that the interrupt pins, which would be a Pin object from the board module, are what you'd be giving to the Keypad constructor .. maybe I don't know how the interrupt works, though. If it's not working, maybe better to move on than try to make it fit my half-baked ideas.
not the "press in to click" functionality
I don't have any of those boards so I can't do any testing/playing of my own
oh i see, i'll try the interrupts. thanks!
don't spend too much time on doing it "my way", if you see other ways of getting to your goals
right now i kind of feel like my brain is getting turned inside out trying to understand asyncio so i might also need a lunch break haha
that state does wear off .. eventually. and I still never reach for asyncio "by default", so in that sense I've never gotten super comfortable with it.
I'm not super stoked about the TX/RX pin naming but otherwise this looks good.
Alternatives welcome!
any suggestions for asyncio guide improvements welcome
Anyway in that video you casually mentioned eventually being able to connect a USB device to an ESP32-S3 Feather and use it with an iPad over Bluetooth. I am looking into possibly doing that for my ZSA Moonlander, any ideas on how one would accomplish this feat using circuitPython?
We don't have a device that does usb host and ble unfortunately. So, you'd need to come up with a two device solution for now. (Maybe hid reports over UART would be enough.)
also, improve reading properties like 'product' and 'manufacturer' by handling surrogate pairs (untested) and avoiding trailing '\0' that was not present in standard pyusb
One suggestion about where to put this. Looks good otherwise! Thanks!
Let's not add this to the usb module because it is meant to be a subset of pyusb. How about on supervisor or usb_host?
@slender iron @onyx hinge I am almost finished with the initial v1.19.1 file merging. I haven't even attempted a compile yet. This has been frustrating because some merges, especially in py/, especially the three-way merges, show many changes whose origin is obscure:
- who deleted these lines? git blame is very bad at helping you find this out.
- was this change something we did, diverging from the original, or does it just reflect some change we haven't picked up yet?
- "SPDX" changes that cause a merge conflict but are otherwise not useful. MPy has never warmed to the idea of SPDX (I looked at some closed PR's), and I'm not sure we should bother doing this in files we shared with them. It's not completely done anyway, so automated checking is not possible. I may change these back to minimize the churn in future merges.
- We really need to PR back simple changes that MPy would probably be fine with, such as spelling errors, and things like
inline-> ``MP_INLINE`. - because of 1 and 2 especially above, I am considering that we might label our changes with at least
// CIRCUITPY(possibly bracketed with// CIRCUITPY endor similar and making some further comments as necessary. This makes it clear where the origin of the change came from. I am constantly guessing, relying on imperfect memory, or plowing through github blame to figure these out, and I have to keep repeating that. I think this is really only mostly necessary for core stuff inpy/where we have diverged and may never converge again. It's a waste to time to keep rediscovering who made a change. - I think I will do another difftool merge between the current merge and pristine
maintip to handle 3 and 5 before attempting to compile.
sounds like it's been a real slog. I especially agree with trying to upstream more stuff.
we could upstream stuff until we can submodule mp for the vm
that would be quite an achievement.
any more than doing three merges?
i don't know if we will ever get to the submoduling possibility. there are some changes we've made they won't want back. I think since the last merge we have made more significant py/ changes than usual
The current divergences that I'm not sure about are the space squeezing you did, Jeff, in the type tables, traceback improvements, some different handling of properties, long-lived, some generator changes that may be partly related to async differences, and maybe a few other things. I still have to revisit objgenerator.c because it is so different. That is the last file that is not really merged.
also not relying on extmod/ at all would be great: there was a lot of churn in os and sys this merge. Of course that means we also can't "just merge" the imrpvoements from upstream
also there were a number of specious merges, where some random file that vaguely resembled our file was merged, despite not even being in the same directory. This may hav been due to a file move that git somehow was aware of, but not all seem like that. I don't remember specious merges like these from previous merges
long-lived allocators & the stricter generator/async distinction are two core differences I don't think we'd ever sell them
I've always wanted to try this on a "real situation" but ... it looks like it'll perform about 600,000 individual merge attempts in order to reconcile us with micropython 1.19 !? https://github.com/mhagger/git-imerge
hunh! I had not heard of this.
meld is my friend 🙂
but still hard to track things. I have clicked on arrows a few thousand times, but nothing like this
this doesn't replace the "mergetool", it just a way of scripting the finding of "smallest possible conflicts" by going along the changes on either side of the merge
there are apparently ~600 merge commits on the micropython side since our last merge and ~1000 merge commits on our side, and it wants to try every pair and have you resolve each conflict that arises. It appears not to scale well.
got it, just not sure whether this would help. I'm confused about whether it shows intermediate merges or not
it does but almost each micropython change has some conflict, of a "we deleted, they changed" type.
what I would really like is to be able to click on a conflict and get directly to the commits that caused the conflict
CONFLICT (modify/delete): ports/rp2/machine_i2c.c deleted in HEAD and modified in 7b0a42374e1ae6a4ab3f756090c6f3b66e82acb5. Version 7b0a42374e1ae6a4ab3f756090c6f3b66e82acb5 of ports/rp2/machine_i2c.c left in tree.
Automatic merge failed; fix conflicts and then commit the result.
Original first commit:
commit 01cabb0324186808c14ec1b02fb8a3be28837160
Merge: ddfcfca65d da4b38e756
Author: Jeff Epler <jepler@gmail.com>
Date: Tue Feb 15 12:36:26 2022 -0600
Merge tag 'v1.18'
[long log deleted]
Original second commit:
commit 7b0a42374e1ae6a4ab3f756090c6f3b66e82acb5
Author: Damien George <damien@micropython.org>
Date: Thu Jan 20 16:43:55 2022 +1100
rp2/machine_i2c: Provide more specific error codes from I2C transfer.
for instance it'll stop like this, after trying ~1000 individual merges .. After accepting the deletion with git mergetool, it starts again with the next commit from micropython, which will also have a conflict 😕
it's a cute idea but I don't think it works out with CP's git history
mmmmaybe if it was modified to run scott's conflict-fixing script and only treat the merge as failed if there's still a conflict
I don't think that more automation is going to help me. It is mostly more information I need. Then I need to study the breaking changes and figure out how to incorporate them into code we have already changed.
in principle this tool tells you what you want: this conflict is caused by THIS commit on their side and THIS commit on our side... but the reality is different
yes, I would live a GUI difftool that does that.
Has this issue been fixed? I'm using latest 8.2 circuitpython and minimqtt library and this problem still occurs.
We don't have a device that does usb host and ble unfortunately.
Wouldn't that just be any of the Pico form factor RP2040 boards + https://www.waveshare.com/wiki/Pico-BLE ?
This is the other variant (called classic on their website) of the luatos esp32c3 - the one with the attached ch343 serial chip. This configuration appears to be working for me but I haven't done extensive testing.
As this is the same board as the luatos_core_esp32c3, I'm not clear on whether or not it needs a separate ID. Based on the CI fail, I'm guessing it does.
Now with unique CIRCUITPY_CREATION_ID.
This is for the "classic" variant of this board, as described on the vendor's site, that has a CH343 TTL chip tied to the USB port.
• raspberry-pi port-specific notes / limitations
• potential service slot conflict between web workflow & mdns
It has been stale for over 2y. Is there any news on this?
Quick question: is there a way to expand the "default" ringbuffer? It can be found at "/py/ringbuf.h". It stores type uint8_t.
So far I made my own but it might not be needed?
Is it okay to add a second ringbuffer impl?
That is not storing a u8, but a pointer to u8, namely an array with many u8's allocated. Based on the other fields being u32's, its likely to have a big size (or at least being able to have it)
What's exactly your intention/change with the custom implementation?
I would like to store canio_message_obj_t.
CAN.c creates an rx fifo via the FlexCan SDK. It automatically uses message buffers and can id filters and gives me back a FlexCan frame in a callback (interrupt) where I convert the frames into canio_message and place them in a ringbuffer. Then the Listener.c in common_hal_canio_listener_receive would just grab the next element from this ringbuffer.
The problem I would like to solve is that the SDK expects to process the frame/message in the callback, but canio interface uses polling to consume the messages with the Listener method(s).
The PicoADK has an WS2812-compatible addressable LED on board, so
the NeoPixel MPY should be included in the firmware.
so the NeoPixel MPY should be included in the firmware.
This not in general a policy for boards. For Adafruit boards, we add frozen libraries for boards when we are worried about RAM space, which is not a worry on the RP2040. The disadvantage of freezing is that it uses up firmware space, and the library is frozen at a particular version. The user can override a frozen library by putting a version in /, instead of /lib, because sys.path by default is ['', '/', '.frozen', '/lib']....
@dhalbert My intention to freeze it was to include it in the base firmware, so it can be used by the PicoADK users. I think it is fine if we freeze it.
I'd love to see a driver for the ADC128S102 8ch 1MSPS ADC. It's used in the PicoADK.
https://forums.adafruit.com/viewtopic.php?t=202975
User tried to use os.getenv() on a Trinket M0. Fetching from settings.toml is turned off on SAMD21 boards for space reasons. However:
- This is not documented anywhere. Fix that.
- Suggest we raise
NotImplementedErrorforos.getenv()whenCIRCUITPY_OS_GETENV = 0instead of just returningNone.os.getenv()is useless whenCIRCUITPY_OS_GETENV = 0, and raising an error would make that more obvious.
Since Adafruit does not sell a breakout or use this chip, we would not make it an Adafruit-maintained library. However, you are welcome to contribute a library to the Community Bundle:
https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries#the-circuitpython-community-library-bundle-3105332
https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library
currently i have no use-cases for dmx...
otherwise i would try the fragment from @Tasm-Devil.
seems like a valid first starting point...
It has been stale for over 2y. Is there any news on this?
Just to confirm, is all that people want is a CircuitPython Library that does DMX control? Nothing more that this?
hello, I'm having a hard time making CircuitPython run on a custom board based on the nRF52840 (MicroPython works without problems though, so it's not something hardware-related). CircuitPython boots but never gets to the USB CDC serial console. I've tried both with internal and external flash storage, with or without HF/LF crystals. It seems to hang the moment it gets to setting up the filesystem. Any ideas on what to try next ?
(this is 8.2.0, up-to-date build system on OSX based on ARM GCC toolchain , Adafruit Bootloader running the show and working just fine )
@wallarug I would like to see a library which sends DMX packets periodically (min. 0.8 Frames/s, as per DMX Standard).
I wrote a display driver for a non-adafruit st7796 display for circuit python. #help-with-circuitpython message
Based on the adafruit_st7789 circuit python driver. It does not exist in the adafruit 8x or community bundle.
Currently named adafruit_st7796, should i name it something else to submit to the community bundle?
or submit to the circuit python library as adafruit_st7796?
It's my first display driver so unsure how to proceed. It's not an adafruit display it's something I got from aliexpress.
So maybe circuitpython_st7796 instead and submit to community bundle?
CircuitPython_ should be the prefix. Avoid including Adafruit as it is not an official Adafruit-supported library.
Yes!
Should I create my own CircuitPython_ST7796 repo first? I'm looking at an example for the community library using the GC9A01 here https://github.com/tylercrumpton/CircuitPython_GC9A01/tree/e31bc61f990f4d52b3b6b1a90eda3090d71f100a
Use that format structure?
Do I need to install cookie cutter? This is becoming more complex than I thought.
Is this only for contributing to adafruit repo or also the community bundle? https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/creating-a-library
Using cookiecutter is ideal, yes.
This guide kind of applies across the board, Adafruit and Community. There are obviously differences in what you would do for a Community library, but I think it's meant to work for both. I know cookiecutter certainly has a Community library setting when you run it.
I just copy/pasted from the GC9A01 example. It's not from cookie cutter but looks relatively enough the same.
@onyx hinge Do you have a moment for a question?
sure
probably intended to convert from seconds to milliseconds
Ohhhh.
but of course ping can return None ... in which case that's not so great
Right.
It's fine, it prints "none" I think
IS ping seriously returning seconds by default?
I thought it was ms?
See: "Ping google.com: None ms"
is what printed this last run.
I can add code to make it say it failed.
This page and code is outdated. I'm updating it. https://learn.adafruit.com/adafruit-metro-esp32-s2/circuitpython-internet-test
Not certain how complicated I want to get here.
If I don't use cookie cutter will circup still work with it? I don't use it just thinking about others.
I'll try to sit down and do a real cookie cutter version of it someday. The way it's formatted right now doesn't play nice with windows Git desktop application. Git says it's can't find my repo, I think might have something to do with the copy/pasted .git ignores.
Is there a learn guide on how to submit a new library to the community bundle?
The guide you linked earlier covers "Sharing in a Bundle" or something close to that.
If any of the folks on the CircuitPython review team has a moment, I would appreciate a review on this PR: https://github.com/adafruit/Adafruit_Learning_System_Guides/pull/2561 It's mostly formatting changes, but also updating the file to use settings.toml and adding a settings.toml starter.
@plucky tulip
Figured I should put thoughts on https://github.com/adafruit/Adafruit_CircuitPython_HTTPServer/pull/63 here and not in the help channel
Feels like this should definitely be two PRs, or a stacked PR though. Websockets are a pretty distinct functionality
But just addressing the routes aspect-
The key thing missing here is a way to get state in the route. For example-
import routes
something = Something()
server = Server()
server.route(...)
def handle(...)
something.do_thing()
server.add_routes([routes.otherroute])
def other_route(request):
<no way to access `something` or other objects not in scope>
otherroute=Route(..., other_route)
I also don't see that there's a clean way to define routes here either
like the ideal setup would be a route decorator that I can use in other modules
so the above example would be
@route(...)
def other_route(request):
FYI jimmo said on the MP discord they hope to release 1.21 in the next week
the way I implemented my hacky version of external routes is here- https://mystb.in/HitsTucsonSatisfactory
the key thing is when calling the route it passes the server object not just the request
which allows me an injectable state
to refrain from a breaking change the state could be added to the request object or passed as a kwarg
also added some syntaxy sugary decos like @get("/path")
also instead of putting closes everywhere I bet you could change poll's context manager close so it figures out if it's doing a websocket and shouldn't close
What is different from CircuitPython's view from the board version we currently have? Different pinout?
One small reword. Thanks for the updates!
Since port 80 (or the port assigned to `CIRCUITPY_WEB_API_PORT`) is used for web workflow, the `mdns`
[module](https://docs.circuitpython.org/en/latest/shared-bindings/mdns/index.html#mdns.Server.advertise_service)
can't advertise an additional service on that port.
We don't have a device that does usb host and ble unfortunately.
Wouldn't that just be any of the Pico form factor RP2040 boards + https://www.waveshare.com/wiki/Pico-BLE ?
I consider that two devices because it is two ICs. It can probably be made to work, just not from CircuitPython only.
It can probably be made to work, just not from CircuitPython only.
Shame, I am trying to figure out how to do this with just CircuitPython.
Circup will work if the library is in the community bundle and it can build. This is because circup could use either mpy or py files.. One step that is needed is to add the library as a submodule to the .gitmodules following the instructions in the mentioned learn_guide.
Yeah just read that part. A lot more involved to contribute to the community bundle than I realized. Everything has to be done with CLI git really. Can't use desktop git for something like this.
Contributing adafruit_requests examples is a cakewalk compared to contributing a new library.
It's more like creating a custom build of circuit python, which I've done once. There's a lot of moving parts and hoops to jump through.
yes is a little different, but cookiecutter helps with all the behind the scenes, and if you follow the learn guide it will be ok. if you need help let me know :).
thank you, i don't have time to do this today. will likely give it a shot tomorrow because i do want to contribute my first real display driver.
If you dont want to use cookiecutter coy the .github/workfloes directory
Yeah ill be around 🙂 ping me when needed or DM if you want
Gnu unifont emoji. Larger font 8x16 instead of 6x12
emoji is kinda neat. are you hatching a plan to fix the horizontal space between the letters?
I've run into a funky issue with the RP2040 RFM9x board and I'm wondering where to open an issue (with CP or the RFM9x library) I am experiencing USB disconnects when transmitting (especially at high power). On my MAC, the MAC will often freeze until I disconnect the board from USB, then it recovers. On a Raspberry Pi, l Ijust see brief disconnects on the USB (via tio)... Has anyone else seen anything like this? Any suggestion as to where to open an issue?
This may well be a power supply issue... much more testing to do. I have never seen i with other RFM boards though. When I have a clean example, I'll post it in #help-with-radio -- already started a discussion there.
Brainstorming yes. Debating how to store whether a unicode char is double width. May make it a binary search rather than linear unicode search.
we'll use more flash space in small builds to store the taller font
(and wider)
also brainstorming colors
less seriously
the monochrome terminal could be more endearing
right now my big wants are:
- I don't think it's possible to print a character in the lower right of the screen and not scroll
- block cursor
- reverse video would be nice, and provides a way to do block cursor
Full 16bg + 16fg colors is way after that, but those three items would really enhance the usability of the screen-based editor
struggles to get discord to render a list of points
what do you mean by reverse video?
Am I seeing correctly that the settings.toml provided by CircuitPython on a fresh install is completely empty?
For some reason I thought it had starter boilerplate.
@slender iron Is that expected, or is there something odd about the install I did a minute ago?
I think it is empty normally
turns out I broke safe mode entry on rp2040 with my picodvi work
OMG.
(via reset pin)
I have been fighting with that for so long..........
I thought it was me. Dan kept telling me it was possible, but I couldn't get it to work lately.....
I have been flash_nuking all of my RP2040s as I keep messing up the disabling of CIRCUITPY.
sorry!
Nah, no worries, I'm simply hugely relieved over here to know it wasn't a me-problem. 😄
feels an 8.2.1 coming on
for reverse video, do you mean like ANSI terminal codes that can have different colors for bg vs text?
The picodvi PR #7880 switched the saved word to the watchdog register since it reworked the RAM layout. This works for reset_into_safe_mode because the watchdog scratch registers are preserved by soft resets. They aren't preserved for pressing the reset button. So it broken manual safe mode. Switch back to using RAM to store the saved word but use the pico-sdks "uninitialized" designation instead of a fixed location.
Also fixes USB host feather status neopixel by setting the power pin.
I see what you mean, but in my opinion accessing variables that are not in scope is not really a good design practice, it would be better to have a server initialized in separate file, then importing it in code.py and routes.py. This way we can keep everything separated, while also giving access to the server for routes that are in other files, which is pretty much exactly the behaviour of decorator that you can use in other modules.
When it comes to passing server object and not only request, I am not sure whether I understand correctly, but you can access it now by using request.server. https://docs.circuitpython.org/projects/httpserver/en/latest/api.html#adafruit_httpserver.request.Request.server
Didn't know that request.server existed whoops
That said I have no idea what you're saying in the first paragraph
@rough folio Something like that, probably with more finesse, but it is just a proof of concept.
server.py
from adafruit_httpserver import Server
# connecting to wifi etc...
server = Server()
from server import server
something = Something()
@server.route(...)
def handler(...):
...
from server import server
import routes
server.serve_forever()
EDIT1: wow, Discords support markdown headers, didn't know about that
@slender iron I mean that colors 0/1 would be swapped. It's a common way that cursors were implemented on old platforms, by setting an otherwise unused bit in the display RAM. Sometimes it was the high bit of the character (ASCII was assumed in those days) or a separate attribute bit.
and yeah you'd trigger it by sending a VT escape sequence
the 2nd row of text here has some "reverse video"
tile grid can't do that unfortunately
probably simpler to have terminal manage a cursor tilegrid and move it around
yeah that's another approach that would require less change in the core.
otherwise you'd need pallete per tile indirect I think
Or a pallette offset
I'd call this pretty odd honestly
like, every lightweight api framework out there I know of (flask (through blueprints), litestar, starlette, fastapi) doesn't do this but instead opts for the "define route object, import, add to server object" method. I've got no idea how this would play with lazy importing either- and it would preclude or make fairly difficult defining the same route for multiple server objects but IDK how realistic that need is. Oh, and adding routes dynamically would be a fair bit trickier too come to think.
Though my initial example missed a detail of adding something to server which I now realize would be injected in the request so you could do request.server.something in the route handler which I think is what you were talking about with variables-out-of-scope
For a direct example with the hack I did (pardon the lazy form parser...)
@post('/pid-update')
def pid_update(request:Request, server:Server):
req = request.body.decode()
match = re.match('Kp=(\d+)&Ki=(\d+)&Kd=(\d+)', req)
if not match:
raise Exception(f'failure to match, {req}')
pid = server.state.trickler.pid
pid.Kp = int(match.group(1))
pid.Ki = int(match.group(2))
pid.Kd = int(match.group(3))
print(f'updated pids to {pid.Kp=} {pid.Ki=} {pid.Kd=}')
return Response(request, '', content_type='text/html')```
and then I can just import `pid_update` and add it as a route whereever to whatever server I like
in this case `state` is a fairly thin class that I enclose the global state and various sensors in for access throughout the project.
plus this implementation is really straightforward because all you do is move the route decorator from the server and add a route-registration method - `post` is just a thin wrapper around the original deco that has the method pre-set for handiness
@rough folio Nevertheless, you would have to use the state in routes and hope it will be populated somewhere else, in other module, there is also a problem with typing such class.
I never encountered something like adding state to server, seems to me like low cohesion of Server in this case, but I have the most experience with Django and some with Flask, don't know how Fastapi handles that.
Would it be expected that espidf.MemoryError: survives a reload?
it's not too hard to type- you can just do
if typing.TYPE_CHECKING:
class Request(Request):
state:State
Example from Flask docs, similar to my approach:
from flask import Blueprint, render_template, abort
from jinja2 import TemplateNotFound
simple_page = Blueprint('simple_page', __name__,
template_folder='templates')
@simple_page.route('/', defaults={'page': 'index'})
@simple_page.route('/<page>')
def show(page):
try:
return render_template('pages/%s.html' % page)
except TemplateNotFound:
abort(404)```
from flask import Flask
from yourapplication.simple_page import simple_page
app = Flask(name)
app.register_blueprint(simple_page)```
I mean, if you add e.g. a sensor to your state, it will not be types unless you create a new class for State, because without it, you wont get hints for e.g. state.bno055
as it so happens I did lol
the way I structure this is basically like
class State:
def __init__(self, sensor:Sensor):
self.sensor=sensor
.....
etc
makes a handy global state that I can fiddle with in a repl etc
This is a problem with Django setting for example, where you use a child but it is not statically defined, so it works, but is not looking good
I also tend to have a "default init" staticmethod that returns the class with the sensors initialized for use in a repl when debugging stuff
and then some .update() method which calls .update() on the state's children for some sort of async programming
but that's just how I style these
I would have to take a look at these Blueprints, although I believe the approach with importing server into multiple files where it is needed is more Python like, not lib specific
I can even point at non-web libs that use this pattern lol
like discord.py for example off the top with it's cogs
flask's default method assumes an amount of ownership over everything that the module is a webserver first and other stuff second imo
Would you be open to discuss it later this week? Right now (~1AM where I am) I think I am unable to fully understand the point you are making.
haha, fair enough
In case someone sees something I messed up: from a fresh install of CP (commit-id: 8de9d5a52) I run make -C mpy-cross, then make fetch-all-submodules then cd ports/unix; make axtls then make micropython This results in a compile error:
In file included from ../../extmod/ulab/code/numpy/vector.c:15:0:
../../extmod/ulab/code/numpy/vector.c: In function ‘ulab_sinc1’:
../../extmod/ulab/code/numpy/vector.c:580:20: error: conversion to ‘float’ from ‘mp_float_t {aka double}’ may alter its value [-Werror=float-conversion]
if (fpclassify(x) == FP_ZERO) {
^
../../extmod/ulab/code/numpy/vector.c:580:20: error: conversion to ‘float’ from ‘mp_float_t {aka double}’ may alter its value [-Werror=float-conversion]
if (fpclassify(x) == FP_ZERO) {
^
cc1: all warnings being treated as errors
../../py/mkrules.mk:62: recipe for target 'build-standard/extmod/ulab/code/numpy/vector.o' failed
It seems that mp_float_t is typedef'ed to double and for whatever reason fpclassify wants floats
Has this issue been fixed? I'm using latest 8.2 circuitpython and minimqtt library and this problem still occurs.
This issue is closed, so it would be better to open new one, describe your problem in detail and reference this issue.
CircuitPython version
Adafruit CircuitPython 8.2.0 on 2023-07-05; Raspberry Pi Pico with rp2040
Code/REPL
>>>
paste mode; Ctrl-C to cancel, Ctrl-D to finish
=== b_label = "Bat V"
=== b_value = "4.86"
=== t_label = "T/AHT °C"
=== t_value = "23.6"
=== "{label:4.4}".format(label=b_label,value=b_value)
=== "{label:4.4}".format(label=t_label,value=t_value)
'Bat V :4.86'
'T/AHT °:23.6'
>>>
Behavior
n.a.
Description
The format-specif...
CircuitPython version
Adafruit CircuitPython 8.2.0-19-g8de9d5a52 on 2023-07-13; Raspberry Pi Pico W with rp2040
Code/REPL
import os
#import ipaddress
import wifi
import socketpool
import ssl
#import adafruit_requests
import time
import board
import digitalio
import adafruit_minimqtt.adafruit_minimqtt as MQTT
import microcontroller
WIFI_SSID = "mySSID"
WIFI_PW = "myPW"
MQTT_SUB_TOPIC = "mySubTopic"
MQTT_PUB_TOPIC = "myPubTopic"
HA_MQTT...
Can you post the full exception trace?
CircuitPython version
Adafruit CircuitPython 8.1.0 on 2023-05-22; DFRobot Beetle ESP32-C3 with ESP32-C3FN4
Code/REPL
>>> from collections import OrderedDict
>>> d = OrderedDict.fromkeys('abcdefg')
>>> ''.join(d)
'agcbdef'
>>> type(d)
>>>
Behavior
- The returned type should be
- instead of - The object should return sorted keys (
'abcdefg'), instead it is in unsorteddictorder ('agcbdef')
Description
No response
Ad...
(Lmk if you folks don't have bandwidth to fix any time soon, but have cycles to review a PR smile )
We're totally game to review any PRs you feel like making! Thanks!
Also, check the MicroPython implementation first because it may have already been fixed there. We're currently working to update from 1.18 to (future) 1.21 for CP 9.0.
This may well be a problem upstream in micropython as well: https://github.com/micropython/micropython/blob/master/py/objdict.c. There has been some discussion about the new Python requirement that dictionaries are naturally ordered.
Would you mind testing the latest MicroPython? We inherit most of the relevant code for this issue from them and we're working to update CP to newer MP. Thanks!
The current rp2 micropython gives me
=== b_label = "Bat V"
=== b_value = "4.86"
=== t_label = "T/AHT °C"
=== t_value = "23.6"
=== "{label:<8.8}:{value:>4.4}".format(label=b_label,value=b_value)
=== "{label:<8.8}:{value:>4.4}".format(label=t_label,value=t_value)
===
'Bat V :4.86'
'T/AHT \xb0:23.6'
>>>
b0 is the extended ascii value of °, so it seems this bug is also present in micropython.
It has been stale for over 2y. Is there any news on this?
Just to confirm, is all that people want is a CircuitPython Library that does DMX control? Nothing more that this?
if i think about it for a moment -
i can imagine three simple scenarios:
- DMX receiving - so the CP device can act as device in an event/stage enviroment
- DMX sending - simple just some channels in a buffer that get send manually or automatically every x ms
- DMX sending - API compatible to use it w...
FYI -- I'm not sure whose attention to bring this to, but I think there is a real issue with interference between the radio and the USB ports on the RP2040 RFM9x board -- see this thread #1129476234678632540 message It has been bugging me for quite awhile but I finally got around to doing some more testing and I think it is real. Comments/suggestions welcome. I have not tried it under Arduino yet to see if it occurs there -- Adding that to my "todo" list.
USB 3 ports? they're an issue for 2.4GHz, at least the other way around, wouldn't be surprising with somewhat lower frequencies https://www.usb.org/sites/default/files/327216.pdf
oooh! -- good point
I does appear to also be an issue under Arduino so not a CP issue.
It may make more sense to document it in the cirucitpython_typing, and then link to that from the main documentation.
@solar whale I think we saw something similar on one of the other rp2040 boards
Good to know. I just wanted to get it “on the record”
I just started the thread in #help-with-radio Where would you like an issue?
circuitpython repo is fine. thanks!
Added second I2C bus and IO15, IO16 to board for UM FeatherS3 for P7 and later boards for the vertical Stemma/QT connector.
Fixes https://github.com/adafruit/circuitpython/issues/8173
It seemed like a small fix, and mostly independent of upstream plans around https://github.com/micropython/micropython/pull/6173 - so sending it your way
to use if convenient.
I also filed an issue upstream
https://github.com/micropython/micropython/issues/12011
Change looks good to me. Not sure how I can trigger it to test it. If you want me to do that just let me know I have the board sitting by me.
This does not appear to be a CP issue, but an issue with the HW. It was suggested that an issue be opened to discuss it.
Setting the transmit power to 23 on the feather RP2040 RFM9x board causes issues with USB connections. On my M1 Mac, it causes a disconnect of the CIRCUITPY drive and the board resets. In some cases, it will cause the MAC to "freeze" until the USB port is disconnected.
If I use a Rasberry Pi 400, the USB connection (monitored via tio) often disconnects with eac...
Created issue 8176 https://github.com/adafruit/circuitpython/issues/8176
Has anyone mentioned (or built themselves) a profiler for circuitpython like FunctionTrace?
https://functiontrace.com/
I could see target micropython/circuitpython audiences benefitting greatly from something like this
A graphical Python profiler that provides a clear view of your application's execution while being both low-overhead and easy to use.
Hi all, I'm trying to rebuild CP after pulling latest changes (it's been about 2 months), and trying to make fetch-all-submodules but hitting this error. I'm on main. Any suggestions?
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
Entering 'ports/mimxrt10xx/sdk'
fatal: couldn't find remote ref refs/heads/master
fatal: run_command returned non-zero status for ports/mimxrt10xx/sdk
.
ERROR: fetch-submodules.sh FAILED
Hi, is there way how can I clear displayio group/buffer? Is this (#circuitpython-dev message) only way ho to do it? I work with epaper display so I do not want to write something to the display, refresh it to clear it and then refresh it with new data. Thanks
@graceful rain Iirc there was some move to move from master to main so this error fatal: couldn't find remote ref refs/heads/master seems a bit suspect. Might it be simplest to just start over from scratch?
Is it possible that the actual transmission events are too short for the instrument to detect? If the sampling time is significantly longer than the current spike during transmission, it might register as a small average increase in current, while what is actually happening is a large but extremely short increase that gets averaged across a single longer sample. I'm not familiar with the PPK2, but maybe you need an oscilloscope to accurately view the current change (probably via voltage dro...
How do you mean clear the group / buffer?
If you intend to show noting on the display for some period of time (even a small peirod between changing from other things) then you would need to explicitly show "nothing" from the code (an empty group or None should work I think).
But you could also change from whatever is currently showing directly to the thing you want to show next without explicitly "blanking out" the screen inbetween.
Can you describe the type of behavior that you're hoping to achieve a bit more?
I think I know the reason. The personal hotspot SSID is only broadcast while the personal hotspot screen is open on the iPhone and (perhaps) for a short period of time after it's closed. I have successfully connected under these conditions.
Do I need to do something else? It seems like GitHub sometimes doesn't recognize that requested changes were made.
The PPK2 is sampling at 100,000 samples/sec so I think it resolves the transmission spike - here is a screenshot
<img width="1025" alt="Screenshot 2023-07-16 at 10 17 49 AM" src="https://github.com/adafruit/circuitpython/assets/15856834/dc7b98e3-1f55-449d-88a4-3bf43c1c787a">
I also tried looking at it with a scope and did not see any voltage drop.
I agree that it sure sounds like a power issue, but so far, I can't come up with any evidence.
whats the reason that question mark (bool) is unsupported in struct.unpack format strings?
https://docs.circuitpython.org/en/latest/shared-bindings/struct/index.html
I did see some mention of if not available C99 talk on the python docs (screenshot), but couldn't mentally see why not supported.
Another observation... On the Pi400, I have been using a power USB Hub on the USB2 port. If It connect the RP2040 RFM9x directly to one of the USB3 ports, I do not see any disconnects and it is working fine at tx_power=23
I aslo swapped the hub to the USB3 ports and directly connects to the USB2 port and I and now seeing the disconnects with each transmission ....
and If I connect the RP2040 to the USB hub when it is on the USB3 port, I do not see the disconnects....
so at least on the PI ...
I am working with Adafruit CircuitPython 8.2.0 on 2023-07-05; Waveshare RP2040-Zero with rp2040.
circuitpython 8.2.0 supports alarm.sleep_memory. Documents state the data type of sleep_memory must be byte, which makes sense. But the type returned is int. >>> import alarm
dir(alarm)
['class', 'name', 'SleepMemory', 'exit_and_deep_sleep_until_alarms', 'light_sleep_until_alarms', 'pin', 'sleep_memory', 'time', 'touch', 'wake_alarm']type(alarm.sleep_memory[0])
<class 'int'>
Which is it?
(I don't have a suitable uc to test) what does type(alarm.sleep_memory) return?
aargh .. this is extremely frustrating... back on the Pi400, I started seeing disconnects again but after swapping cables and ports, it does appear the such things do matter...
I have it working stably with a direct connection to a USB3 port on the Pi400.
I'm not sure what to think about this now but it still appears that there is something odd with the RFM9x RP2040 board and USB (when using tx_power=23)
Sorry for the confusion...
I wonder if this is WAI. In python, accessing individual elements of a bytearray should return an int (and is admittedly confusing.) type(alarm.sleep_memory[:1]) should probably work as expected.
that's normal, what's the issue ?
the bytes and bytearray types are arrays of bytes, they contain ints (limited to 0-255)
(and are represented as ASCII strings in the REPL, which does confuse people too sometimes)
import alarm
type(alarm.sleep_memory)
<class 'SleepMemory'>
OK. So it is not necessary to convert ints to bytes when assigning to alarm.sleep_memory? i.e. alarm.sleep_memory = 25 should work and only take up a single byte.
yes - looking at the code, that should be fine
It's expecting an int between 0 and 255, and should throw an error if that isn't the case: https://github.com/adafruit/circuitpython/blob/8de9d5a52259cd0422a3633b6cf562e44d0cca9d/shared-bindings/alarm/SleepMemory.c#L161
I'm guessing this might be a typo 🙂 but just to be clear - alarm.sleep_memory[0] = 25 should do the trick
Could you link to your repo so we can do some code comparisons? Could you also point to a schematic? And have you tried Arduino (with a generic board profile) and writing to the USB serial console? If the latter does not work, I would suspect hw.
This is apparently due to updating to the latest ulab. We don't build with ulab in the CI builds, because it's not needed for the tests. Could you file an issue in https://github.com/v923z/micropython-ulab/issues ? Thanks. I think Zoltán would be interested in this.
Also can try make remove-all-submodules first.
Ah, nice - thx for the tip! I'll add an issue as well.
This decision was made by the MicroPython folks: not sure why, maybe because using a b or B type will yield a "truthy" value anyway. We just inherited their implementation. I searched their github threads, found nothing on it.
If the user forgets to do a displayio.release_displays() at the top of the program, the program might raise Too many display busses. This error does not mean a lot to the average user: perhaps it should also say Did you forget displayio.release_displays(), or check for that case and print a better error.
From a thread in discord, starting here:
#help-with-circuitpython message
@jaunty juniper @drifting hearth @midnight ember I recorded the somewhat unhelpful Too many display busses discussed a few days ago in #help-with-circuitpython as an issue. ⬆️
Thank you. Also is it just me... when clicking on the help with alias channel comment links sometimes they take you to a place that's no where close to the actual comment it's referencing?
for example that link shows me this
which has no mention of display busses
but i know the conversation you're talking about and the opened issue 8178 is appreciated.
yeah it helps sometimes to go back and click the link again, I assume because the convo is already loaded then
I double-checked the link -- it's the right one, but you're right, it's going to something slightly above the actual post.
I am new at CircuitPython and may be misunderstanding some things.
I am trying to use CP's SPI functions on a Raspberry Pi Pico to access a SPI device (AT93C46D) with a transfer size of 16 bits. When I use the configure method, it reports that only 8 or 9 bits are allowed. I believe this is happening because of the line referenced below.
https://github.com/adafruit/circuitpython/blob/4b4fb47088dca33e85a5eaeb14096aa16692340f/shared-bindings/busio/SPI.c#L202
The datasheet for the RP2...
SPI doesn't really distinguish byte boundaries: a 16-bit value is two concatenated 8-bit values. What happens if you send or receive two 8-bit-bytes? We have plenty of libraries where 16-bit values (or larger) are sent that way.
I´m trying to recreate Google calendar PyPortal project but with epaper display and it works this way now:
At start it will connect to Wifi, get user conde for device and show it on the display. Then when I approve/connect device, it will get items from the calendar and displays it on the screen, but now, it does not clear the screen, but just add calendar items "on top" of the previous information. I know that I´m appending calendar data to the buffer with information for device setup and I would like to clear the buffer/group before I would write calendar data to the screen.
I hope that makes sense and in few words, I want display 2 pages with one display group.
There is a PageLayout helper class that can help with that use case. https://docs.circuitpython.org/projects/displayio-layout/en/latest/api.html#adafruit_displayio_layout.layouts.page_layout.PageLayout There is a basic example of it's usage here: https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_Layout/blob/main/examples/displayio_layout_page_layout_simpletest.py and a more advanced one within the same directory in that repo.
If you can share the code you're using I could look at it later on and see if I can recomend changes that don't involve using the library, but it kind of depends on what you have so far. Generally, it sounds like you're adding a new group to the visible group without removing the pre-existing one. You could use pop() or remove() functions on Group to get rid of the previous group (or keep it in a variable, but not on the display). You could instead use the hidden property of your Groups to make one visible and the other one hidden. Or you could keep entirely seperate groups and change between them by calling show() or setting the root_group to each different one when needed.
I'd like code to be closer to cpython compatible, to make my life porting things easier, and other peoples. Would it be better to add this desired functionality to circuitpython, or would it only be accepted via upstream micropython? Maybe I should at least pose the question on the micropython github issues, but I have the feeling (no idea) that micropython is less concerned with being cpython compatbile than circuitpython is, that may well be a mistaken impression gleaned from thin air...
I'm not really concerned with adding the functionality as it was only two lines to change to port a driver, but when things work unchanged like magic it's sooo good.
Thanks for your help. You can look at my code (which is not working currently as I have issue with datetime and strftime) here (https://www.dropbox.com/s/92v09j2y54fsqo5/google_calendar.py?dl=0). I will look for sure at PageLayout as I think it will help me organize different items (calendar, weather) on one page. I did not know about pop()/remove() functions but I think they are what I was looking for.
I looked at the datasheet for this device. The protocol is approximately SPI, but the chip-select line appears to be inverted (active high).
turns out it was the power failure management. Commenting out the nrfx_power_pofwarn_config stuff in port_init() allows this to proceed into boot and work well. I wonder why is so though.
question: when using external SPI flash with SPI_FLASH_FILESYSTEM = 1 and EXTERNAL_FLASH_DEVICES suitably defined, is there a general assumption that that SPI interface is exclusively used for the filesystem? What's the best practice in CircuitPython when you have a single SPI bus connected to the flash chip and to all other SPI devices on the board ?
that is odd. Note there are some issues about what the default GPIO level is -- there's a non-volatile memory setting, and maybe for some other things. So could be the "fuse" settings.
I think you could start by opening an issue in the MicroPython repo (or a PR). We'd be happy to add it, and if it were added upstream we'd take that too.
lowering the POF threshold from NRF_POWER_POFTHR_V27 to NRF_POWER_POFTHR_V25 also fixes this, so it might be that the default threshold is too high for when I run off battery
what kind of battery? a 3.7V lipo?
yes
hmm, our code is assuming 3.3V. (so that should match your use case) ... I seem to remember that there are several ways of wiring up power for the nRF52840, and the use cases are not completely obvious. You might compare your schematic with ours.
VDD and VDDH, etc.
yeah my setup is pretty complicated in that respect due to USB, LiPo, solar panel charger ... I'll look into it. Thanks a lot Danh for your time and feedback.
Yeah, 100k samples per second should get the transmission, especially given the length of the spike.
I wonder if it's something with the board's power rails. If the rails have too much resistance, that could limit the current draw, and if that limit is lower than the chip needs at the higher power output, that could cause issues. But then, if that's the case, it should have issues regardless of the power supply... Well, I wonder, what voltages do the different power supplies provide? ...
One stylistic question/suggestion. Not a requested change -- up to you.
I missed the 2 in STEMMA2_I2C the first time I read this. I'm wondering whether for consistency you might want to name these STEMMA_I2C2 and I2C2, so that both use I2C2?
[adafruit/circuitpython] New comment on issue #5153: PulseOut inverted (idle_state = carrier active)
I have verified that if I go in to esp-idf/components/driver/include/driver/rmt.h and do the following:
-
.carrier_level = RMT_CARRIER_LEVEL_HIGH, \ -
.idle_level = RMT_IDLE_LEVEL_LOW, \
-
.carrier_level = RMT_CARRIER_LEVEL_LOW, \ -
.idle_level = RMT_IDLE_LEVEL_HIGH, \
the infrared LED transmitter looks to be behaving properly, visually (through an IR sensitive camera on my phone) however the code that works to control my TV thr...
Good suggestions. I'll see if I can monitor the voltage to the RF module.
I interestingly, I noted that there is a difference in the schematics between the RP2040 RFM and the M0 RFM boards in that the there is a 10microfarad capacitor between 3.3v and GND on the RF module for the M0 board, but it is not shown on the RP2040 board schematic. However, looking at the board and the board layout diagram, it looks like the capacitor is actually in place on both. It appears to just have been omitted...
I've played around at the c function level but not the python one. I used the compiler's entry and exit annotations to do it.
The 3.3 V on the RF module looks very stable to me. I don't see any dip during transmission.
I tried sending/receiving two 8 bit values and it works.
Is there a reason to not allow configuration of the actual transfer size, especially since there is already a parameter for 'bits'?
post a photo of your antenna setup, the RF is feeding into the USB data lines, not power lines
I'm just using the spring antenna in this cases.
maybe try uFL to SMA and have the antenna much farther away?
Quick test does seem better on the Mac... I'll run a bunch more tests. Thanks!
keep that antenna away from data/power cables - it should be away from your computer :)
Is the spring likely to be worse than a simple wire?
With the UFL antenna, the MAC does sill occasionally freeze but it does seem better and it may well depend on keeping the antenna away. Also. I wonder if the "mag tip" cables are more susceptible. I'm trying different cables...
<@&356864093652516868>: The weekly meeting is in about 90 minutes at 2pm EST / 11am PST. I look forward to hearing your hug reports and status updates. Here is the link to this week's notes doc: https://docs.google.com/document/d/10AzCwaac8jCgfUiFIPchwTghFqHptCV99iMCsZfxAwo/edit?usp=sharing
Heads up that Node12 is gone for good on GitHub Actions runners starting August 14th! I think we're all set at this point across CircuitPython and Arduino but heads up in general (and your own projects!)
don't forget timestamps
that is the shortest list of library activity I remember seeing! I wonder if it's correct.
you're welcome. was pretty sure you wouldn't mind if I offered to do it
It is. I thought the same thing last week, but Tekktrik verified it.
I guess things are just quiet.
Nice to see foamyguy back online
specifically struct "?" format character
Different chip families have different SPI frame size capabilities. Eight bits is always availble. RP2040 is unusual in allowing 4-16 bits. Other chips are just 8 bits (e.g., nRF), 8 or 9 bits (MicroChip SAMD), 8 or 16 bits (STM), etc.
If we were writing a library for the AT93C46D or helping someone, we would recommend using an 8-bit frame size, so that the library would usable without changes and without conditional code inside it, across all chips that implement SPI.
So yes, we could ...
newsletter editors are basically Audrey saying "Feed me, Seymour"
The 9-bit size on the SAMD's I think may be a remnant of a use case of 8-bits + parity, which you don't see much anymore.
OK, thanks. This got me over my issue.
I appreciate the responses / assistance.
FYI @orrmany wrote this awesome article on how to load some adafruit devices https://blogarak.wordpress.com/2020/03/15/s340-softdevice-adafruit-nrf52840-express-feather/
Online hug for all the efforts on USB host and a CircuitPython editor.
👍
Hope Ari gets well soon.
Links to examples of the fonts?
a font with more language support sounds good
GNU Unifont free software utilities
Those fonts sound interesting, I'll have to test them later with the bribri/cabécar update I have.
@mental nexus nice to see you drop by!
Thanks, I’m still keeping an eye on all the great new things in CP.
Cozette doesn't look too different from terminalio so wouldn't be a drastic change, plus the extra language support, looks good to me.
The Bribri are an Indigenous people in eastern Costa Rica and northern Panama. Today, most Bribri people speak the Bribri language or Spanish.
There are varying estimates from government officials of the group's population. Estimates of the total Bribri population range as high as 35,000 people, although official estimates assert there are about...
The Cabécar are an indigenous group of the remote Talamanca region of eastern Costa Rica. They speak Cabécar, a language belonging to the Chibchan language family of the Isthmo-Colombian Area of lower Central America and northwestern Colombia. According to census data from the National Institute of Statistics and Census of Costa Rica (Instituto ...
cozette doesn't really do more languages but it does do emoji
I have to run.
Unifont looks more industrial, my preference is cozette with all things being equal?
if a language isn't supported by terminalio by default i could see how that could be a big problem for certain language
i would actually like to see a 5x5 supported by default too
smaller text is better for smaller displays and matrix panels.
Thanks for hosting Paul. Nice meeting.
Thanks for hosting Paul! Have a great week everyone 🎉
Thank you for hosting @random junco Great job!
our current font, terminus is 6x12
http://wenq.org/wqy2/index.cgi?BitmapSong_en
The Wen Quan Yi bitmap font includes complete CJK Unified Ideograph (U4E00 - U9FA5) glyphs at four different sizes (9pt-12X12 pixel, 10pt-13X13 pixel, 11pt-15X15 pixel, 12pt-16x16 pixel) and two weights (medium and bold). Use of this bitmap font for on-screen display of Chinese (traditional and simplified) in web pages and elsewhere eliminates the annoying "blurring" problems caused by the high stroke density of many Chinese characters and insufficient "hinting" of anti-aliased Chinese fonts. This font also provides bitmap glyphs for Japanese Hiragana (U3040 - U309F), Katakana (U30A0 - U30FF) and for Korean Hangul (UAC00 - UD7A3).
yup and with smaller font you can fit more lines on any display. you can fit one more horizontal line on a matrix panel using a 5x5 font.
you'll be squinting on a tiny SSD1306 with a 5x5 but on a matrix panel it's still quite large.
@lone axle any chance you made a backup recording? I only have my sound, not the speakers.
I even thought I tested it before the meeting. 😦
I do! I'll get it uploaded to dropbox and send a link in a moment
Thank goodness, I've got an early hug report. Thanks so much
@random junco https://www.dropbox.com/scl/fi/brr190mbjd7fqe9z470da/CircuitPython_Weekly_Meeting_7_17_23.mkv?rlkey=0ak6gd92i9chjttlnypzba8mg&dl=0 here we go. I had a quick scan through to make sure everything was captured, and I believe it was. But have not listened to the whole thing of course.
thanks! downloading now and I'll give it a run through
Can someone approve my PR to add the meeting notes? Then I can add the link to the video. Thanks! https://github.com/adafruit/adafruit-circuitpython-weekly-meeting/pull/125
thanks dan!
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/1Zx4UF48QN6YoRq-qVAJgdsfr-5KW401aJPTYwjxMQns/edit?usp=sharing
Google Docs
CircuitPython Weekly Meeting for July 24, 2023 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 at...
hey, i have a couple of aliexpress boards:
- https://es.aliexpress.com/item/1005005592730189.html
- https://es.aliexpress.com/item/1005003796653297.html black 16MB one with RGB
- https://es.aliexpress.com/item/1005004539320086.html "classic" model (not received yet)
...which i would like to "port". I dont mind having to fiddle looking for datasheets and whatnot, but i thought it would be somewhat easy to add them to the supported boards list, so less-experienced users could just download a fine-tuned firmware (and can find it with an image of the product instead of matching with similar stuff)
my assumption is that creating a "board" would be pretty much assigning the several aliases for pins, flash size, and perhaps some other config and that i dont need to be affiliated with the companies in any way, but can do it in a community-project way. i reckon that they would probably need unique vid/pid pairs, how to go about that?
confused about the 1st product, as the chip on it is a "regular" one, while all ESP32-S3 images on the download section are enclosed in a metal box, does that mean it is very different? 🤔
second one seems like it could be a clone of https://circuitpython.org/board/weact_studio_pico_16mb/, if it really is, is there some sort of aliasing method or would it require duplicating code?
This is the best place to start on adding a new board: https://learn.adafruit.com/how-to-add-a-new-board-to-circuitpython
There are hundreds of these ESP32-clone-ish boards on aliexpress. The manufacturer provides little to no support, and they come and go. A number have been "cost reduced" to the point that their functionality suffers. If you can find an existing build that works, I'd recommend just using that. If there is no generic build that works, then creating a generic build that would work for a certain class of board (combo of chip, flash chip, PSRAM) I think would be best.
ugh, that's definitely a stopper indeed, wouldnt be nice setting up building a board to then get some of its components changed without any warning, guess i will not make the ports then
but will hopefully be able to find a working build, so far i think it came with nothing flashed on it, unsure what/how to flash it - probably tinyuf2 shall be the 1st thing to throw at it
For instance, there are Espressif-built dev boards for all the different modules, and we have builds for many of them. They break out all the pins, and are pretty generic.
i almost forgot... thx both! 😄
UnexpectedMaker S3 boards are N16R8, not sure if the flash and PSRAM types would match though
i dont even know what that means rigth now, lol.... S3 are a "series" and thats one of the actual devices?
like board (1) above ...16MB flash, 8MB PSRAM
https://circuitpython.org/board/unexpectedmaker_feathers3/ (also proS3 and tinyS3)
for the RP2040 boards, the Pi Pico build would probably be just fine, it loks like the pinout is the same
i flashed it a couple months ago with i-dont-remember-what and i could work with it no issue, but im rather familiar with RP2040... im not with ESP
ESP boards are a Cartesian product of a bunch of choices.
ESP32, ESP32-S2, ESP32-S3, ESP32-C3 are all different chips. only S2 and S3 have full native USB support
ESP32 has no USB support; ESP32-C3 has only USB serial on chip
-S2 and -S3 are a lot easier to deal with for CPy purposes
cool, that make things slightly more clear
is this a known issue? i dont even know if my hw matches what that firmware is setup for... but the drive name does match
(time to manually copy the uf2)
no circuitpy drive for me, neither with that firmware nor the Pro one, time for a ride to compile some custom stuff?
@spare jacinth what tools produced those screenshots? You should be able to just drag the UF2, and it shouldn't need to match
but yeah, no surprise if the flash and / or PSRAM don't match
that was the experimental installer (from Chrome), gave it a try for the bootloader which i was not sure how to get into it (was reading on esptool at the same time) + give some feedback
bootloader seems to be working tho, i can see the external drive after double-pressing boot button, with what im guessing are the 3 expected files on it
but likely no bootloader on those boards, esptool can write the .bin file directly
ah, ok, there is a bootloader
the web installer did flash some tinyuf2 which is apparently working fine, yeah
it probably used esptool under the hood im assuming
not sure, never used that one (don't have Chrome)
(shall move this convo elsewhere?)
https://circuitpython.org/board/espressif_esp32s3_devkitc_1_n8r8/ might work, pretending to only have 8GB flash
maybe start a thread
ESP32-S3 setup issues
oh hai @onyx hinge, I just heard you mention this in the meeting notes. I will definitely like to help test sdioio support on RP2040!
@devout jolt keep an eye open for the pull request, hopefully this week
so the gh-pages commits are not always @ladyada
Another observation which you might want to document ...
I have web workflow enabled and I run this:
import wifi
import mdns
mdns_server = mdns.Server(wifi.radio)
mdns_server.hostname = wifi.radio.hostname # 'logger'
mdns_server.instance_name = "My service"
I then run the Discovery app on Mac OS to browse the bonjour advertisements. There is no indication that my Pi provides a _http service - the following is displayed though:
...
_circuitpython._tcp.
> My S...
@devout jolt It's not ready to PR yet (because capacity is not detected & write is un-tested, mainly), but it can read a FAT filesystem on the adafruit metro rp2040 prototype board I'm using for testing. in theory can work with other setups. main requirement is that DAT0..3 are sequential in GPIO numbering https://github.com/adafruit/circuitpython/compare/main...jepler:circuitpython:rp2-sdioio?expand=1
I'm not sure what's best here for docs. There isn't a new service being advertised, but hostname and instance name are changed. Web Workflow is documented as _circuitpython._tcp. https://docs.circuitpython.org/en/latest/docs/workflows.html#web
@onyx hinge could I talk to you on audio or video sometime today about some strategies about doing this merge? I don't want to give up, but I'm trying to figure out how to review all the changes more precisely and with less chance for error. I've done some studying of "review every change" kind of stuff in stackoverflow, and none seem quite right. I can explain more orally.
@tulip sleet sure. After 1:30 CT / 2:30 ET would be better for me.
sure, thanks, I'll ping you then, and do something else for the nonce.
I know there's no actual Doxygen or anything, but are doc-comments on CircuitPython internal C functions accepted?
what do you mean by doc-comments? I don't see why not
Doxygen-style comments for annotating parameters, mostly
there are a few cases of that already in the source tree, but very few
Looks good, and you have tested (I did not set this up to test.)
One q re API
For the user code, would it be more useful to return a tuple in the case of multiple shift registers? Instead of doing a gc_alloc, you could create a tuple, and you can index into that, and return it for .key_count. (I was thinking about a new .key_counts, but the input arg is still key_count, so it would not be consistent.)
This allows you to initialize usb_host.Port once successfully and then returns the same object as long as you pass the same arguments in. It does allow you to fix incorrect pins but not switching from one valid set to another. (It needs a reset for that.)
This also moves hcd cache operations to RAM so that they don't access the cache when doing maintenance.
How important is it to have a different key count per shift register? Is this needed for a real in-the-wild design, or is it more a hypothetical?
Another alternative would be to have a single argument giving the maximum count of keys. "shift register 0" would be 0..(n-1), "shift register 1" would be n..(2*n-1) and so on. Unused positions would need to be hard-wired to the non-pressed state (not an undefined state or the pressed state), and some key numbers would be unused if the real num...
@tulip sleet I'm back home and getting settled in, can video in ~10 minutes from now or maybe a bit earlier
sure - finishing up a conversation
@onyx hinge Kattni needs me to review something quick, I'll get back to you, if that's ok
that's fine
@onyx hinge ok, done with that for now. (I was doing a sample review for a library so Kattni could screenshot it to update a git guide.)
@tulip sleet OK, I hopped into video in amelia
The current use case i have is ragged, but I could live in my case with a single key_count and ignore unused keys (which would i my case be signalled as pressed and end up in the event queue). I believe the key_count() function is also used to allocate the currently_pressed / previously_pressed stuff for the toplevel keypad code, so a tuple might not work.
If this is needed to support already existing hardware then I'm not opposed to incorporating a feature that supports ragged shift registers.
nice! I think we can also test this with the Pimoroni Pico DV Demo Base, which has SD card wired for SDIO
I didn't check but I think it's a good assumption that the Pico DV Demo Base is wired for this code to work.
Adds two board config defines, which can be added in a board's mpconfigboard.h: BOARD_XOSC_FREQ_HZ, and BOARD_XOSC_IS_CRYSTAL, which are passed to clock_init(). External clock sources are currently only implemented for SAM_D5X_E5X series chips, so defining BOARD_XOSC_FREQ_HZ for a SAMD21 board will emit an error.
Depends on adafruit/samd-peripherals#45 — see that PR for more details on the implementation.
This is for #6161, but doesn't completely close that issue as this only im...
[adafruit/circuitpython] New comment on issue #5153: PulseOut inverted (idle_state = carrier active)
For the esp-idf RMT, I tried a bunch of combinations via Arduino. (I had a voltage divider on the output to see if it went high-impedence for any of them, but it didn't.)
idle_output_en - "Enable the RMT output if idle" - I still have no idea what false is doing. Assume it's true for the rest.
idle_level - "Set the signal level on the RMT output if idle" - as with CircuitPython's PulseIn, the output level when we aren't sending any pulses.
carrier_en - "Enable the RMT car...
this got somewhat buried..
i've just posted a little extra info, if anyone can/want to help, any guidance is welcome 😄
@onyx hinge thanks for the talk yesterday; I'm going to use difftool between our tip of main and the merged fileson some of the changed files to re-vet some changes, but probably not starting over. But I found some useful git log flags and args, e.g. git log --oneline --name-status v1.18..v1.19.1 lists all commits between the tags, and also changed files. Damien is very systematic about his commit messages, and that's very helpful.
@onyx hinge @slender iron my recollection (and what ag seems to tell me) is that these kinds of lines in the board-specific sdkconfig only act as arguments to some Makefile flashing targets. But am I wrong and they influence the build?
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 40m
CIRCUITPY_ESP_FLASH_SIZE = 4MB
as far as I can tell that's correct, is there a reason you're doubting it?
ports/espressif/Makefile: FLASH_SDKCONFIG = esp-idf-config/sdkconfig-$(CIRCUITPY_ESP_FLASH_SIZE)-no-ota-no-uf2.defaults```
flash size is used to select the sdkconfig file
i meant esptool args... ah, you're right, it selects the sdkconfig
@lone axle hey so I'm up to 5750 on the OSHWA stuff
I heard you were starting at higher numbers and working back
Please keep this discussion in the email thread as Phil requested. We cannot all remain on the same page if you spread it over multiple platforms. @lone axle
Will do. Sorry about that
I think i am done with the canio support for the port mimxrt10xx. I would like to make a build to test and verify. However I get the following error messages. What step am I missing?
maybe try make BOARD=whatever clean to clear out prior builds and force it to generate everything fresh.
i think i am doing that already
did you set CIRCUITPY_CANIO = 1 ? If so where?
okay, someone else may have better ideas for you. I don't recall needing to do anything specific, but I've mostly copy/pasted the boilerplate, possibly I've been doing a step that I overlooked.
@devout jolt I updated my branch for sdio .. reading is pretty solid, writing is causing a lot of hangs & FAT corruption 😞 and I failed at figuring out how to get the "CSD" which is where the card capacity info is stored.
not sure if this is the place for this kind of reports, but:
- https://learn.adafruit.com/mqtt-in-circuitpython/circuitpython-wifi-usage links to another tutorial for ESP32-S2 boards (thought i may need something different for S3, but code seems to work just fine)
- i guess S3 support is still not mature enough to want it listed on docs and/or they aren't not fully updated yet
- the code on such tutorial (https://learn.adafruit.com/adafruit-metro-esp32-s2/circuitpython-internet-test) does
ping = wifi.radio.ping(ip=ping_ip) * 1000which resulted in
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unsupported types for __mul__: 'NoneType', 'int'
```not always tho, but the `* 1000` could be moved to the `if ping is not None` block below i guess
@onyx hinge i used SD_Card_Size = os.statvfs(virtual_root) to pulll the card capacity
Your issue is likely much lower level than I can dive but you've been of tremendous help so if there's even a sliver of way I can help you back I'm taking it. 😉
@midnight ember that's good information, thanks. In this case, I need the number of sectors on the whole SD card (low level information) not details about a filesystem, so that I can implement https://docs.circuitpython.org/en/latest/shared-bindings/sdioio/index.html#sdioio.SDCard.count
that method should work whether or not there's a proper FAT filesystem on the SD card
but yes, mounting and reading the device's FAT filesystem works OK even if the "capacity" number is returned as 0
it was worth a shot. wish you the best of luck!
@spare jacinth code should run similarly on ESP32-S2 and -S3, with the noted exceptions in the release notes (plus any open issues) https://github.com/adafruit/circuitpython/releases/tag/8.2.0. ping on espressif in general has some limitations https://github.com/adafruit/circuitpython/issues/7940
you can leave feedback on a learn guide via the "feedback" link on the right of it
you are correct that the internet test should * 1000 in the if
(the github link is at the bottom od the code block on inserts like that)
PR on the way 😉
update: there it is
Motivation, shared-bindings, & rp2040 implementation made sense. Didn't test.
@microdev1 is there a possibility you can investigate this? I noticed that the addition of "storage extension" occurred between 8.0.0-beta1 and beta2. This particular board, with 2MB flash, has no OTA partition.
Hello. When porting CircuitPython to a new board, is it OK to share the same SPI lines / interface between external SPI flash and other peripherals?
Yes, but if you can make it not shared then that'd be better
this is why busio.SPI has try_lock
@tulip sleet @onyx hinge what do you think about me switching the heap allocation size for imx to 32 from 16. that way buffers will align with the cache lines
(I'm seeing tinyusb invalidate memory at a +16 offset and destroying the obj struct before it.)
it'll make allocating stuff on the heap tighter
(but maybe not by much)
worth trying. I wonder if it might improve available heap on small boards too. Or is there gc storage that gets bigger?
everything is 32 right now? Does MicroPython ever use 16 for any boards?
oh sorry, I misread
but will also reduce the bookkeeping overhead
the 1011 is pretty tight, maybe try synthio examples with 32 and see if we run into trouble
trying to think of what the main use cases for i.MX are
I can make it conditional on usb host
MIDI will want USB host so you can plug in a controller
though I wonder if it causes issues with device too
Thank you 👍
one issue I see (v8.2.0) when running with the CIRCUITPYTHON drive backed by the SPI flash chip, is that when I invoke the busio.SPI() constructor I get an error stating that the SPI signals (SCK, others) are already in use. If I use board.SPI(), I get the same error. Is there something I'm missing ? Thanks in advance.
@spice gate @slender iron I don't know that we have any boards that operate that way now. And I'm not sure it'll operate well, even once you get past that error.
A write to CIRCUITPY from the host computer via USB can happen at any time. If the SPI bus is locked by some Python code, I don't think we have an effective way to defer the write from USB until it's unlocked; the only possibility I see is to fail it when the bus's try_lock fails.
Anyway, when creating the SPI bus for the CIRCUITPY storage I think you'd need to arrange for common_hal_board_get_spi(0) to return supervisor_flash_spi_bus or a way for the routines in supervisor/spi_flash_api.h to use the SPI bus common_hal_board_get_spi(0) instead.
thanks @onyx hinge , this is insightful. Do I understand it correctly, that all of the currently supported boards use different SPI interfaces for the external SPI flash filesystem (when present) and for all the other SPI peripherals? Since this is a board for which I have all the peripherals (serial flash included) connected to the same SPI lines and MCU interface, what's the best approach for porting CircuitPython? Shall I simply fall back to the internal flash, and use the SPI bus for non-storage peripherals only?
of the currently supported boards use different SPI interfaces for the external SPI flash filesystem (when present) and for all the other SPI peripherals
From what I can see that's the case, but I sure don't know all of our hundreds of supported boards anymore. microbit_v2 is an example of an nrf board that uses a portion of internal flash for the CIRCUITPY filesystem.
fwiw it'd probably be a neat addition if similar to "sdcardio" it was possible to mount an external flash chip.
yeah I was thiking of that. Using the internal flash for the main "CIRCUITPY" filesystem, and then mounting the external flash over SPI using something like sdcardio. Thanks a lot for this feedback - much appreciated !
This documents which boards support the following items that are internal to a module, and can be separate enabled/disabled:
- builtins.pow3 (only in support matrix, there does not seem to be docs for this function)
- busio.UART
- busio.SPI
- keypad.Keys
- keypad.KeyMatrix
- keypad.ShiftRegisterKeys
- os.getenv
Closes #8168
.
... what platforms a native file support.
Also include this info in the file itself and error if the suffix or internal metadata don't match.
@tannewt how do you intend "platform" in this case? Upstream .mpy encodes the ARCH which is of course the minimum prerequisite for executing machine code. I'm not su...
This enables the specific use case of checking whether a note's release phase has ended, but is also potentially useful to implement a sort of "voice stealing" algorithm in Python code, which can take account of the note's envelope state as well as other factors specific to the program.
@todbot your comment on this would be appreciated
@tannewt how do you intend "platform" in this case? Upstream .mpy encodes the
ARCHwhich is of course the minimum prerequisite for executing machine code.
Architecture is what I meant. Not board.
Architecture is what I meant. Not board.
Then aside from establishing a filename convention ($ARCH.mpy ?), is there a need to deviate from the upstream native module implementation?
Last I tried to build the example native modules it was not an option because there was no rp2040 support in micropython, but this has been added in micropython v1.19, so after #7954 is completed I'd be curious to try that again.
Then aside from establishing a filename convention (
module.$ARCH.mpy?), is there a need to deviate from the upstream native module implementation?
I don't think so.
Probably best to have a designator that it's for CircuitPython if there are any MP specifc things we won't have.
- Unify "No foo pin" errors to simplify translation maintenance and improve consistency. Also one other "busy" -> "in use" change.
- Allocate 32 byte chunks on imx. This aligns to the cache lines and will save headaches when doing cache invalidations on the data.
- Move three find_qstr wrappers into tcm because find_qstr is already there and they should be small. (Otherwise code in tcm may to have to jump out to flash and back for a small wrapper.)
True, choosing something other than .mpy also makes sense since the dynamic linking table will be different so there will not be cross-compatibility. From the upstream docs linked above:
Linker limitation: the native module is not linked against the symbol table of the full MicroPython firmware. Rather, it is linked against an explicit table of exported symbols found in mp_fun_table (in py/nativeglue.h), that is fixed at firmware build time. It is thus not possible to simply call some...
Has anyone tried to use a Tinyusb audio device? For me, Windows at least doesn't accept the device.
I've only done the midi
Because I notice there isn't usb audio device support in CircuitPython and I'm wondering is there's maybe an issue with Tinyusb.
Idk if you've looked at audio, but the usb descriptor configuration is amazingly complicated 😵💫
not really. It'd be cool to have audio in and out to cp though
Agreed. Does Tinyusb have a Discord?
This is what I'd mark using the prefix public_hal_. The smaller it is, the easier to maintain everything.
That's .. interesting. Even though this PR didn't change the japanese translation, it no longer fits on mini_sam_m4. I went ahead and turned off synthio on this board as a part of #8186
Has anyone seen the error when trying to build for ESP32 (S3 in this case) of
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- The ASM compiler identification is unknown
-- Found assembler: xtensa-esp32s3-elf-gcc
CMake Error at esp-idf/tools/cmake/project.cmake:296 (__project):
The CMAKE_C_COMPILER:
xtensa-esp32s3-elf-gcc
is not a full path and was not found in the PATH.
The process I used to build was, from a fresh checkout and after installing all prerequisites:
cd circuitpython/ports/espressif
make fetch-port-submodules
make BOARD=adafruit_qtpy_esp32s3_nopsram
ahh nevermind. the new make fetch-port-submodules does not invoke the esp-idf/install.sh.
yeah that was always done by hand
yep yep, haven't built for esp32 in a while
Nice refactoring of errors, thanks!
oops, there is no mp_raise_RuntimeError_varg() right now
Looks good to me. Thank you for the size fix too.
Took me a bit longer, but I checked out the Blueprints and I managed to create a very similar behavior with minimal amount of added code. I already pushed these changes to the PR (https://github.com/adafruit/Adafruit_CircuitPython_HTTPServer/pull/63). I does not work exactly like Flask, I skipped the intermediate Blueprint object, mainly in order to save memory and to keep the codebase smaller, but you can import a Route the same way as you would import a Flask's Blueprint from external file, and register it to the Server.
Yeah I think the flask blueprint is a bit of a curious design lel
I'll take a looksy in a bit
They might be more intuitive in the large webapp with lots of routes, but I do not think that someone will reach this kind of scale on a microcontroller. 😛
yeah this is pretty much all you need I think- more or less the same api I used
lg2m
It is a shorthand for manually creating a ``Route`` object, that can be used only one time
per function.```
this wording is kind of weird though. First read it implies that the route can only be used once or something- but I'm pretty sure you mean you can only stack the deco once which I'd hope would be kind of implicit
idk minor nit doesn't really matter
something that might be worth thinking about is a route.add_route which would add a subroute but that's probably more than needs doing- ie
@as_route(/path)
def func(...)
...
@func.as_route('/subpath')
def xyzzy(..)
....
xyzzy could be accessed as /path/subpath
I don't _think_ this would be arduous to add?
whoops forgot to reply here's a ping @plucky tulip
Thanks for review
mini_sam_m4 ja build is too big by 24 bytes.
+1. I also would like to have support for this.
I have 3 VL53L4CX sensors and would like to connect it to my Pi...
This addition is really neat! Both items returned in synth.note_info() are handy. Here's the quick test I used; it maxes out all synthio voices while printing their note_info (and makes a nice distorty wall of sound). https://gist.github.com/todbot/e1e954889e47fafa7ef14429c53e2c2d
Am I correct that:
- The amplitude value returned is the same as
Note.amplitude - If it return
(None,0.0), synthio is done with that Note object
A few things I noticed:
- The whole system degrades...
Would it possible to compile CircuitPython in a way that keeps track of symbolic local environment, MicroPython docs says it is a optimization (https://docs.micropython.org/en/latest/genrst/core_language.html#local-variables-aren-t-included-in-locals-result).
Is it only the matter of changing a variable from OFF to ON or is it implemented deeply inside core?
Is it be possible to add such feature to CP? Would it be hard, or even possible?
This is a deep choice in the implementation: the locals are internally referred to with a slot number or something like that, so the name information is lost, sadly.
Added an espressif PID for this board & Bootloader.
0x81A2 | Waveshare ESP32-S3-Pico - UF2 Bootloader
0x81A3 | Waveshare ESP32-S3-Pico - CircuitPython
And also the secret had the wrong name, in Settings
This is the initial work to add circuitypython support for the waveshare esp32-s3-pico #8063. It builds, however I have not been able to load it and test it yet.
Probably better to ask the MP folks about difficulty too.
@jepler is out today and Monday so I'm going to merge this as-is to get the size fix. He can make a follow up PR if needed. Thanks for the feedback @todbot.
Quick question: I'm awaiting a review with my company's Legal team next week to get the official go-ahead to contribute (mainly a formality as they're pretty open-source friendly). In the meantime, I'm looking for places to start nibbling to get a better feel for the codebase before poking at multicore. Looking at the issues in GitHub, I see tags "help wanted" and "good first issue" am I correct in understanding that you think that these are good starting issues for new to the project contributors?
I noticed ESP32 boards have the default CIRCUITPY_SYNTHIO_MAX_CHANNELS of 2.
This puts it at 12, like RP2040 and others.
Tested on ESP32S3 QTPy and I2S DAC.
Ok, got it. The DOUBLE_TAP_PIN definition needs to be set in the board's mpconfigboard.h file. Thank you very much!
Hello and welcome! The Good First Issue label is definitely meant for folks who are new to contributing to open source in general, or those who are new to our project. Are you familiar with Git and GitHub?
Thanks! I am indeed familiar with Git and somewhat GitHub (I've mainly used Gerrit in my day job).
I've never heard of Gerrit! GitHub is pretty straightforward, though, so I don't doubt it will make sense to you as you get into it. Given that familiarity, I would say you can probably pick up any of the smaller issues, if something that isn't labeled Good First Issue interests you. We often use that label for folks who are new to the whole process.
Another thing to keep in mind is that you can always tackle larger items in smaller chunks, and submit multiple contributions as you work through it.
As long as it doesn't break things, obviously. 😄
I think it was made by Google originally and then released to open-source. It's basically a Git server with a wrapper that pushes the workflow into code reviews (similar to GitHub's PR) and a UI that's clearly built by backend people with little thought for UI/UX flare (like myself) as well as handy integration capabilities for external CI/CD systems.
Nowhere near as visually pleasing as GitHub or GitLab but, seems to be a solid self-hosted option.
That's interesting! I had wondered whether there was such a thing, but never looked in to it.
That's definitely something that I need to do in my day job as well. Might be good practice :).
rewrite last few commits from ladyada -> adabot
Depends on https://github.com/adafruit/nvm.toml/pull/15.
I'm still testing, but most things seem to work so far.
One issue is there are some board with inverted green/blue on the status RGB LEDs (see https://support.arduino.cc/hc/en-us/articles/9589073738012-About-Nano-ESP32-boards-with-inverted-green-and-blue-pins). Mine happens to be one of the ones with inverted green and blue pins, but I created this board based on the non-inverted LED.
Question is:should we have a second board ...
The current board definition doesn't work for me. The difference I found was in the pin definitions for the UART - the existing board uses:
#define CIRCUITPY_ESP_USB_SERIAL_JTAG (1)
While this variant uses:
// Default bus pins
#define DEFAULT_UART_BUS_RX (&pin_GPIO20)
#define DEFAULT_UART_BUS_TX (&pin_GPIO21)
// Serial over UART
#define CIRCUITPY_CONSOLE_UART_RX DEFAULT_UART_BUS_RX
#define CIRCUITPY_CONSOLE_UART_TX DEFAULT...
Not a big rush to debug this, but just in case someone sees anything immediately obvious: I attempted to build an esp32c3 board from main - with this: make V=2 BOARD=beetle-esp32-c3 PORT=/dev/ttyACM0 flash monitor
The build works well enough and flashes, but it looks like the board goes into a boot loop. The repeating output from the monitor part looks like this:
Waiting for the device to reconnect.
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x15 (USB_UART_CHIP_RESET),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x40049a42
SPIWP:0xee
mode:QIO, clock div:1
load:0x3fcd5810,len:0x24
ets_loader.c 78
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x7 (TG0WDT_SYS_RST),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x40049a42
SPIWP:0xee
mode:QIO, clock div:1
load:0x3fcd5810,len:0x24
ets_loader.c 78
device reports readiness to read but returned no data (device disconnected or multiple access on port?)
Waiting for the device to reconnect.
ESP-ROM:esp32c3-api1-20210207
I think there is an issue filed for this
Ah, thanks @slender iron ! Well, I guess I have a board that can reproduce the issue, so also happy to give any fixes a try if needed. Oddly, I am able to install the version provided at https://circuitpython.org/board/beetle-esp32-c3/ (Adafruit CircuitPython 8.2.0 on 2023-07-05; DFRobot Beetle ESP32-C3 with ESP32-C3FN4). Also, I looks like it has 4M flash. (board specs here: https://www.dfrobot.com/product-2566.html)
@onyx hinge (or anyone familiar with asyncio really) is this code https://gist.github.com/jepler/e620cb8396a941866c95501b22b6c0ee supposed to work with 8.2.0 when using the "native" IOQueue with the ioctl protocol? When I run it on my esp32c3 board, only the logic task runs. I'm not able to trigger the pin events. Moreover, in the logic task I added something to print out the map in the global _io_queue instance, and surprisingly it is empty. (Also confirmed separately, if I don't add any "logic" tasks, the asyncio.run() terminates right away.
fixed #7656
Added handling if arg is None and mapped to NULL
Pin names like A0 or A1 are convenience aliases that are usually added when the board silk has those labels. On the ESP chips, there are two banks of ADCs - generally you want to use ADC1_* pins (IO01 - IO10) if also using wifi.
@small comet I don't have any context in my brain about that, and I'm away from all cp hardware for a few days. it's possible that e.g., something about adafruit_circuitpython_asyncio pull #33 means this code doesn't work now. it would be nice to have working code that makes awaiting key presses "most performant", but that example code may well have bit-rotted because nobody's actually using it.
Ah, ok - no worries. Thanks for the additional context!
Hello,
I have tested with stable 8.2 (https://circuitpython.org/board/espressif_saola_1_wroom/) and with adafruit-circuitpython-espressif_saola_1_wroom-en_US-20230721-823e505.bin.
I have esp32-s2-wroom board and while trying to use DAC pins Im not able to. Module board wont show correct pins.
import board
dir(board)
['__class__', '__name__', 'IO0', 'IO1', 'IO10', 'IO11', 'IO12', 'IO13', 'IO14', 'IO15', 'IO16', 'IO17', 'IO18', 'IO19', 'IO2', 'IO20', 'IO21', 'IO26', 'IO3', 'IO...
Yes, use the IOnn pins. Are you using an Espressif dev board or some other board? Post a shopping link to the board you used if it is not the Espressif board so we can see a picture.
Does anyone know if matrix portal S3 is shipping with UF2 bootloader? I don't seem to be able to get the double click reset working. I can hold boot and reset and it does seem to be in a bootloader mode, but no drive appearing, only /dev/ttyACM0
And potential followup, if it doesn't ship with that is it possible currently to install it? The page here: https://circuitpython.org/board/adafruit_matrixportal_s3/ has a 'Download bootloader.zip' button at the bottom but it leads to a "Not Found" page atm.
I did find a combined.bin that seems to work in the release here: https://github.com/adafruit/tinyuf2/releases/ looks like maybe just the URL for releases changed or something.
Pin names like
A0orA1are convenience aliases that are usually added when the board silk has those labels. On the ESP chips, there are two banks of ADCs - generally you want to useADC1_*pins (IO01-IO10) if also using wifi. There are two DAC pins:IO17andIO18, butIO18is used for the NeoPixel.
Thx for the reply. Using IO17 atleast got me forward but other python code problems prevents me from actually confirming that this is working.
Yes, use the
IOnnpins. Are you using an Espressif dev board or some other board? Post a shopping link to the board you used if it is not the Espressif board so we can see a picture.
Yep IOnn pins most likely works.
https://www.ebay.com/itm/385252950700?mkcid=16&mkevt=1&mkrid=711-127632-2357-0&ssspo=ntQFEp1PQuy&sssrc=4429486&ssuid=C6bd3pbsS-m&var=653138665549&widget_ver=artemis&media=COPY
This is the board I am using.
This looks good to me.
I tested it successfully with this code on a Matrix Portal S3:
import random
import time
import board
import displayio
from adafruit_matrixportal.matrix import Matrix
import bitmaptools
main_group = displayio.Group()
matrix = Matrix()
display = matrix.display
display.show(main_group)
bitmap = displayio.Bitmap(matrix.display.width, matrix.display.height, 257)
print(f"{bitmap.width}, {bitmap.height}")
print(f"bits per value: {bitmap.bits_pe...
OK, yes, this is a Saola clone, so use the IO pins as described. If you are having other issues you can't figure out, feel free to ask in our discord https://adafru.it/discord or in the forums: https://forums.adafruit.com/viewforum.php?f=60.
hey folks! trying to get circuitpython 8.2 set up on a new MatrixPortal S3. the board comes with a simple sketch and doesn't seem to include the bootloader. i tried to do a full install using the installer (https://circuitpython.org/board/adafruit_matrixportal_s3/) but it is dying because it can't fetch the tinyuf2 bootloader.
it's trying to load https://adafruit-circuit-python.s3.amazonaws.com/bootloaders/esp32/tinyuf2-adafruit_matrixportal_s3-0.13.0.zip - which doesn't exist. the "download bootloader zip" for manually installing points at a different(?) non-existent file: https://github.com/adafruit/tinyuf2/releases/download/0.13.0/tinyuf2-adafruit_matrixportal_s3-0.13.0.zip.
as a member of the adafruit webdev team (👋🏻) i have the ability to peer into the actual bucket where we store these files and found this file instead: https://adafruit-circuit-python.s3.amazonaws.com/bootloaders/esp32/tinyuf2-adafruit_matrixportal_s3-0.15.0.zip
not sure how all these versions and builds are managed on circuitpython.org but it seems like this needs an update!
I think I might have an unrelated issue for the board I'm using (beetle-esp32-c3) - I was able to at least get a working system by switching to CIRCUITPY_ESP_FLASH_MODE=dio in boards/beetle-esp32-c3/mpconfigboard.mk. I'll avoid muddying the ongoing debugging on the issue, but fyi'ing here in case anyone runs into something similar.
Bootloader worked once I found it. Was able to get CircuitPython 8.2.0 loaded and JP's matrix clock example running. There's an... issue tho' 😅 a pixel addressing issue?
I think you need a newer version of circuitpython. Try the absolute newest links from S3.
I just set one of these up today and I was seeing similar artifacts on the display until I got a newer build than 8.2.0
I'm not entirely certain how the page on circuitpython.org gets built, but it might be worth considering supressing the top right panel with current stable release 8.2.0 for the Matrix Portal S3 since that build doesn't seem to be able to handle the matrix properly. There was a fix in protomatter that came afterwards I think that is necessary to get the display showing accurately.
wow that did the trick! i used yesterday's (20230721) build and it worked right away.
Nice, glad to hear it 🎉. I'll ask around a bit on Monday and try to see whether it's possible to have the device page link to a newer one, or at least remove the link to 8.2.0 for now.
another quirk on circuitpython.org: the original is listed as Matrix Portal M4 (two words for "Matrix" and "Portal") and the new one is listed as MatrixPortal S3 (one word). the search feature on the downloads page turns up both if you search matrixportal but only turns up the old M4 board if you search matrix portal.
😄 I noticed that as well. I think there may be a keywords list or something similar and I'm guessing the original contains the opposite "spelling" so it gets found with both. The newer one must not have the keywords loaded up yet.
if you have a moment, opening an issue on circuitpython-org repo would be good to get someone to take a look and try to make them work the same.
done! thanks for the nudge on that.
Thank you!
Hey @dhalbert - I totally missed this, sorry.
I've destroyed by CP fork again) trying to rebase, and can't seem to find a way to fix it to get this change made.
If I re-fork, the PR will get killed right?
Can you rename it for me here in the PR?
Thanks :)
@UnexpectedMaker No problem. Let's try to start this over with just https://github.com/adafruit/circuitpython/pull/8174/commits/9642e387839c7fad564edc9909f22e8fcf2bec2e. The original commit can stand on its own, you don't need to rebase or merge.
I mostly avoid rebasing myself, because it's too easy to break things unless I am quite careful/
Getting back to the original point, do you agree with my idea to name them STEMMA_I2C2 and I2C2`? If so, I think I can force-push the original c...
Or, try this yourself: git checkout 9642e38; git push -f.
That will get this PR back into shape, so you or I can then make the rename. After the PR is merged, you can delete the fork and re-fork.
In general, we very much advise making a branch for any PR. This PR is on main. You want your main to be the same as upstream. As a rule, don't make commits to main yourself: always use a branch. Then your main will track upstream.
I tried that - It did get me back to the state I was in before I tried to add this new change, but as soon as I tried to rebase again so I could make the change and commit/push, I ended up in the same bad state again.
So instead, I just changed the file and committed it here in the web view, and once it's been merged, I'll stomp and start the fork again, and try to remember to work in branches!
Sorry for all of this trouble!
This code is inherited from MicroPython but is not necessarily expected to work. We haven't tested it at all, and the I/O code in CircuitPython has no knowledge of this.
{ MP_ROM_QSTR(MP_QSTR_STEMMA_I2C2), MP_ROM_PTR(&board_stemma_i2c_obj) },
How's that? :arrow_up: If it's good, we can make this change and then I'll approve and merge.
I also am looking for support for the VL53L4CX sensor so I can use it with Circuit Python and Micropython.
Support Adafruit Metro RP2040 in 8.2.1
Backports #8035 and #8181 to 8.2.x.
Backport #8125 zlib doc fix to 8.2.x
Backport #8127 to 8.2.x: adds Metro M7 1011 sd, and does pin name additions and slight device rename to original M7 1011 to be "AirLift"
Backport #8129 to 8.2.x.
Enables PSRAM on S3 Box and Box Lite.
- Backport #8130 to 8.2.x
- Backport #8137 to 8.2.x. MatrixPortal S3 is now shipping, so this is an important backport.
- Backport #8142. New board.
- Backport #8160 to 8.2.x
- Backport #8152 to 8.2.x
- Backport #8154 to 8.2.x
- Backport #8156 to 8.2.x
- Backport #8165 to 8.2.x.
Does someone have a link to the CP6 source?
git clone https://https://github.com/adafruit/circuitpython -b 6.0.0 and/or https://github.com/adafruit/circuitpython/tree/6.0.0
6.x.y should be easy to find too
I got a Galactic Unicorn and would like to use it with CircuitPython. I'm mostly interested in using the RGBMatrix library, of course. While looking at the schematics in https://cdn.shopify.com/s/files/1/0174/1800/files/galactic_unicorn_schematic.pdf?v=1667910096 I am getting a little lost already, tho. Would you know what ports I should be providing to something like:
matrix = rgbmatrix.RGBMatrix(
width=32, bit_depth=4,
rgb_pins=[board.D6, board.D5, board.D9, board.D11, board.D10, board.D12],
addr_pins=[board.A5, board.A4, board.A3],
clock_pin=board.D13, latch_pin=board.D0, output_enable_pin=board.D1)
?
clone the repo and then git checkout 6.3.0 to get the last release or 6.3.x to get the branch that 6.30 was made from. If you want to build it you will need to fetch the submodules, and also maybe choose gcc 10.something
RGBMatrix drives HUB75-style matrices. It is not clear to me at all that the Unicorn is a HUB75-style setup
btw, #help-with-circuitpython is probably better for this, and we ask that don't ping folks unless you are already in a convo with them
Someone is having issue updating their NRF52840 on linux using the new bootloader update learn guide. #help-with-circuitpython message
CircuitPython 8.2.0 , adafruit_wiznet5k 3.0.0 ,
cs = digitalio.DigitalInOut(board.D10)
spi_bus = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
eth = WIZNET5K(spi_bus, cs)
socket.set_interface(eth)
socket.setdefaulttimeout(0.0) ------>>>>>> timeout
server = Server(socket, "/test")
server.poll()
Hangs and the timeout dont work.
Hi,
I have the same issue.
CircuitPython 8.2.0 , adafruit_wiznet5k 3.0.0 ,
cs = digitalio.DigitalInOut(board.D10)
spi_bus = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
eth = WIZNET5K(spi_bus, cs)
socket.set_interface(eth)
socket.setdefaulttimeout(0.0) ------>>>>>> timeout
server = Server(socket, "/test")
while True:
try:
server.poll()
expect...........
server.poll() never returns even if i have defined a timeout for the socket.
I am using chrome...
@Sinai The choice of non-blocking here is internal; we do timeouts outselves.
@dhalbert Thank you for your answer.
Yes i know. but it doesnt work and server.poll() hangs forever....
I think when you setup a Server using Wifi is different than using eth.
I have to built my own socket class. and set a timeout on that..
<@&356864093652516868> We'll have our weekly meeting in about 90 minutes 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/1Zx4UF48QN6YoRq-qVAJgdsfr-5KW401aJPTYwjxMQns/edit -- I look forward to everyone's updates!
Google Docs
CircuitPython Weekly Meeting for July 24, 2023 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 at...
@slender iron I think I will cancel some of the simplest backport merge jobs so we don't have to wait 30 hours for them to finish.
next time I will merge more of the cherry-picks into a single PR
fine with me
Missing the meeting today. Group hug plus one for danh for all the back port fixes
This is similar to the issue I'm having with ESP32-S3. Same error message, been scratching my head for a few days now and slimmed down anything wifi/socket related while still using wifi + AP + adafruit httpserver.
@dhalbert Want this in 8.2?
Question is:should we have a second board def for inverted led or just be fine with one board definition?
I think two defs are probably best to cover everyone.
nvm.toml should be ready to update too.
Let us know when you've tested it and we'll review. Thanks!
Something to note, I also saw usb disconnections with the RFM9x modules and pico at max power.
I am pretty sure RFM9x just causes voltage spikes.
I moved the module to pimoroni_picolipo_16mb and it no longer lost usb.
I blame the regulator, cause the only real difference between the picolipo and pico in terms of power distribution is the regulator.
This thing is that at max power the module is AUDIBLE when transmitting data. Mind you, I have excellent hearing, but still it should not be audible.
I presume the instantaneous current is much much higher than 150mAh. My usb doctor did not measure the spiking at all, reading 0.2A total board use regardless of if it was TX'ing or not.
Oh and I should also note, the usb disconnections only occured on the pico + module when I spammed packets, not when sending one or two.
I am pretty sure the solution to this is just a module revision that has a capacitor on 3v3 and a board revision that has a better regulator.
As a note, with the module, regardless of if it was powered with 5V or 3V the issue occured.
Attached: 2 images
It works y’all! A #circuitpython powered typewriter machine. The #adafruit KB2040 blips out a sequence of binary data into a Swintec 1146 CMP’s parallel port, one character at a time. When the typewriter receives a newline, it tells the code it’s busy, and taps out its text buffer.
The code is #opensource and can be found h...
We will likely keep it out on Mondays
Welcome back Anne ❤️
Thanks to everyone who worked on the newsletter over the past weeks, they did a great job.
@dhalbert Want this in 8.2?
I think so!
@todbot, would you be willing to test with ESP32 and ESP32-S2? I'm not sure why @jepler did not increase it for all? Is there significant use of RAM when it's increased, or only if you use more voices?
Woot! Can't wait to read the guide. Thank you for the backporting devs too.
Sounds like a fun time, nice one Deshipu.
@stuck elbow For your In the Weeds topic, are you referring to the core, the libraries, or both?
both
Got it, thanks.
You can get your own health data out of a fitbit api, you can't do that with an apple watch. So this is a semi-open source way to work with your own personal watch health data.
with the amount github changed the authentication process, that guide update must have taken ages! But goodness it'll be a huge help to have it working with the access token setup
That page was the least difficult, to be honest. 😄
The 100+ screenshots that went into the entire update on the other hand......
Nice job on all the projects including the arc weld and grind. 🧑🏭
oh wow yeah that would take ages to process and organize
The access tokens are such a pain to get right on linux.
I just have them in my dotfiles and copy the .gitconfig and .gitcredentials.
Making the files on your own is easier than doing it with commands.
You're not the first person to say/do that.
Yea I also have my own gitea instance, so it would be double the pain to do manually.
Oof yeah.
https://learn.adafruit.com/adafruit-matrixportal-s3 guide is now live
I'll actually agree. As a beginner the type annotations were labeled as a good first issue but I really struggled with it during hacktoberfest. You must have previous python experience to really tackle those.
yeah the ones I tried doing had like 50 types annotations to do per file
because the ones with only a few were taken out on like day 1
There are still a few that have a limited number of types required. But it would definitely be good to remove 'good first issue' tag from any that are the more gnarly ones.
https://github.com/adafruit/Adafruit_CircuitPython_MPRLS/issues/16 and https://github.com/adafruit/Adafruit_CircuitPython_MPL3115A2/issues/18 have fewer than 10 instances each. I think there are a few more. I'll try to work through that list this week or next and remove labels from the bigger ones.
There are also a few that have PRs with requested changes but have been dormant for a while since the review, those would be good candidates to remove the label from as well in most cases.
It wasn't an NRF52840 🤦♂️ It was a SAMD51 Metro M4 with airlift.
Thanks all
Thanks everyone
Thanks for hosting Liz, Have a great week everyone!
Thank you Liz, great job.
Thanks all, hope everyone has a great week!
thanks folks!
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/1RMdYD7ABzChlYjE7HK4RsJOmBiQUU2Vo0iU61Q5Lus0/edit
Google Docs
CircuitPython Weekly Meeting for July 31, 2023 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 at...
i just found a little bug, perhaps already reported, trying to combine 2 f-strings raises a SyntaxError: py print( f"Hello" f"World" ) funny enough, all other combinations (f + no-f, no-f + no-f and no-f + f) work
f-strings are a bit of a hack because they get transformed to a string format call
could be related to that
I ran into that recently. I think @tulip sleet had some idea why, but perhaps I'm misremembering.
Ok, I've added a board with the inverted status led. I kept having it crash whenever I was trying to access the TX/RX pins. Upon investigation, I realized that these are actually the RXD and TXD pins for the debug interface, so set them as such.
I'm not 100% sure that I set up to use the external flash correctly either. It matches other boards in the parameters used and the external flash file is looking for the parameters I used, but I'm not getting the full 16MB of space. It may just a ...
The Note.amplitude another value that is multiplied together with the envelope's current value to give an overall note loudness, so the two values are different. (A Note's panning is yet another factor into the overall note loudness)
Each note_state call does a linear search through the (typically) 12 note slots. If a note is found in an early slot it takes a bit less time, while if it's a note that is not playing or was never playing it takes the greatest amount of time.
Bulk print...
@onyx hinge I don't know how "back" you are. Do you have a comment about https://github.com/adafruit/circuitpython/pull/8189 ? We could put it in 8.2.1 if you think it's fine for all Espressif. Or do you think it needs testing on other ones? Can wait until tomw if you'd rather not think about it now.
@tulip sleet if it's tested it's probably reasonably safe.
we got back from our weekend road trip an hour or two ago. earlier I was doing a few things from my phone when it wasn't my turn to drive.
fwiw the "significant resource use" is computation & RAM bandwidth
Oh yeah, it's failing duplicate VID/PID now because of the 2 board defs for the same board.
fixed by #8185. Should be merged into main.
Also update frozen libraries in main. There is a major version change in adafruit_requests, I think.
Tested working on QTPy ESP32-S2 & QTPy ESP32-Pico via web workflow, and Lolin S2 Mini (ESP32-S2) via USB workflow. All report > 2MB free RAM via gc.mem_free().