#circuitpython-dev
1 messages Β· Page 61 of 1
I'm happy to setup the domain to the github pages for the repo if you want to add a simple page for it
i can put that on my todo list
probably not too hard to render the markdown either
The Feather DVI hello world examples gets much further with the first CP9.x release candidate dropped today. It runs out of memory now well into the demo.
Adafruit CircuitPython 9.0.0-rc.0 on 2024-03-08; Adafruit Feather RP2040 DVI with rp2040
>>>
soft reboot
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
File "code.py", line 328, in <module>
File "code.py", line 160, in widget0
Fil...
@slender iron
I enabled github pages, and the README is now showing up as https://creationid.github.io/creators/. You can set up creationid.org as a custom domain:
https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site
Will do now
I don't see a strong reason to do anything else right now. Any updates of the blurb could be done in the README, but it's quite fine as is
ok, creationid.org DNS updated
Hello,
I'm a consumer. Just spent almost all day getting this to work so I thought I would share. It's not identical to the Seeed C3 board. The pins are all different. They are using the same ESP32-C3 chip though. I was using the Seeed board files as an example. Should I try to get creation ids if I'm just a user?
It's fine for you to get creation ID's. But I cannot find a shopping link this board in a simple websearch. Could you give one? I am a bit reluctant to add random boards that have very few buyers. Someone else asked about a adding a board that had a total of two buyers on AliExpress, for instance.
I was looking into this board as well, and it is pin-identical to the ESP32-C3-DevKitM-1-N4 except the ICBbuy/MakerGo/DFRobot/DIYUser ESP32-C3-Supermini lacks pins 18 and 19, but the rest are all mapped the same.
Yes, if you can use a more generic build, I think that is best until/if this style of board becomes popular.
@danh Just to be clear, there are far more than 2 sales of that board overall, just that seller is probably new to that item. π There's LVGL graphics libraries for those boards, which support most of the variants, and platformio has definitions for all known variants.. You're right, however, that having a dozen or more incompatible clones makes it unattractive to add official support for.
Logic analyzers may be able to detect the baudrate of the UART. That may give you insight on what the clock issue is.
I usually use PWM to verify that my clocks are setup correctly but I'm not sure if the clocks between UART and PWM are shared.
I don't mind having one build/creationid for each as long as they are clearly documented so folks can know what they have.
if people are going to clone boards it would be nice if they actually made them the same π
They do clearly indicate on the back with a part number.
the 2432S028?
afk for an hour or less
yes. That model has spi ili9341 display.. some others have different combinations of display and touch interfaces.
its super low priority as they're not exaclty an Adafruit or Lilygo device.. I'll play with mine as I have time and will revisit submitting a pr if it seems worthwhile
I did the lilygo ones just because they are the only boards I have with parallel display connections
Here are two links. I bought mine from Lazada (currently living in Thailand). They're dirt cheap.
https://www.aliexpress.com/item/3256805781327184.html
https://www.lazada.co.th/products/i4954930372-s20827365800.html
which one has a parallel display? I was looking into doing support for a different version of that yellow board which had a parallel display and couldn't find an example to follow
oh yeah, look at that..
The "2432S022C" version has the ST7789 in a parrallel configuration, very similar to that.
Fixes: #8888
Turns out the error did occur in any authentication mismatch.
I investigated the underlying api a bit and played with examples, and saw a lot more weirdness there.
When attempting to connect to a secure wifi without a password, event_id becomes 2 and event_data.reason is 15 (WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT).
When attempting to connect to a secure wifi with an incorrect password, event_id becomes 5 and event_data.reason is 15 (`WIFI_REASON_4WAY_HANDSHAKE_TIMEO...
Thanks for your patience!
Thank you, great suggestion. Interesting findings. Using the exact same .bin FW image from CP 9.0.0-beta.2 for the SiLabs EFR32MG24 Dev Kit and my custom board the baud rate is different. It would be nice if it was a factor of 2, or power of, that would give some clues of what to look at, but no. The baud rate on the custom board is 83000 (see pictures) but is as expected (115200) on the Dev Kit for the exact same .bin file.
There is something in the Dev Kit setup/config for the build tha...
Update...Without making any changes I've been able to run the demo for over 40 minutes without issue.
The MemoryError I had seen seems fleeting like what @BlitzCityDIY encountered earlier.
This: https://www.seeedstudio.com/XIAO-ESP32S3-p-5627.html says that it's an N8R8 board. The instructions appear to use an N8 build. That shouldn't make a difference, but try the N8R8 version, and try 9.0.0-rc.0 or later.
A fix has been made to make CircuitPython 9 more compatible with Samsung Disk Magician. Closing this for now, but please reopen if you are still having problems.
Closing for now. Please reopen if you are still having trouble with the hints above.
Could you try again with 9.0.0-rc.0 or later?
Closing for now. Please reopen if you have further information.
Closing for now. Please reopen if you are still having trouble that is CircuitPython-related.
Closing for now as this is old. Please reopen if you have new info.
Closing for now due to no recent info. Please reopen if you have new info.
Sorry for the lack of response on this. It is over a year old. If you're still working on this, please update the bootloader on your Matrix Portal, and try CircuitPython 9.0.0-rc.0 or later. I'll close for now but we can reopen if there is fresh info.
This is over a year old. Have you found out the problem? Does it occur with the latest CircuitPython 9 builds? I'll close for now, but we can reopen with new info.
@Capekk This is an ancient issue, but did you get the SSD1309 to work with the SSD1306 driver?
I think we are set with this with TOML libraries and the built-in settings.toml support.
issue
Hello @dhalbert,
I did! In the end I used adafruit_ssd1306 and adafruit_framebuf libraries for my project. The setup was set like this:
oled = adafruit_ssd1306.SSD1306_I2C(128, 64, i2c)
It worked without issues. I don't think that the latter library is even necessary, since I've only used it for the graphics... Hope it helps.
Worth retesting with 9.0.0,but this might be a bunch of different issues, such as UART setup troubles and/or display troubles.
Great! Glad to hear that it worked!
I switched from a label to a bitmap_label and the problem went away. They've been running for over a year 24/7 without any screen garbage.
Howdy, I'm the dev who wrote Hancho. I'm looking at tannewt's branch out of curiosity.
@slender iron I wonder if "from pathlib import Path" should be part of the automatically-prepended-to-.hancho-files header
....clone all the submodules? π
Looks like different methods have different levels of implementation (and use) complexity https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/api-guides/wifi-security.html#wi-fi-enterprise Which method(s) are needed?
I think that most company will use PEAP and EAP-TTLS most. These methods can be used with username & password.
Could you help to implement these methods first? Thank you very much.
I was just clarifying requirements. I'm not the one to do the implementation. I've never used enterprise and have no access to test.
Thanks for your quickly response.
So do you know is there any plans or possibilities to implement these recently?
We have no immediate plans, but it doesn't mean we don't want to. It's not so easy to come up with a test situation at home.
Got it.
Wish we can have these features in near future when you team have time.
Thank you again.
ya, sorry about that! our build isn't simple
Retested on
Adafruit CircuitPython 9.0.0-rc.0 on 2024-03-08; Seeed Studio XIAO ESP32C3 with ESP32-C3FN4
Board ID:seeed_xiao_esp32c3
UID:43588150EB0B
tested http://10.1.99.10 (the correct IP address) for /, /code/, /fs/ and /cp/serial/ everything works.
tested http://cpy-50eb0b.local for /, /code/, /fs/, and /cp/serial/ everything works.
Okay to close as fixed in 9.0
Talked about Hancho on my stream today too: https://www.youtube.com/watch?v=tgwDZFTaYDw&t=3300s
Join Scott as he discusses the last few CircuitPython 9.0.0 bug fixes he did, experiments with a new build system and answers questions.
Visit the Adafruit shop online - http://www.adafruit.com
Thanks to dcd for the time codes:
0:00 getting started
1:04 hello
10:22 bugs and builds
10:40 issues closed in CP on github
12:14 issue 8994 web workf...
neat!
@slender iron have you tried doing the cd(file) in your function already?
I can't think of a clean way to do it in hancho yet
I'm kinda doing that already by capturing the cwd on import and then globbing relative to that
I was wondering if I'm working backwards still but need to pass a board id into a top level hancho instead
it is weird though since the board dictates the mcu and therefore the compiler settings
using absolute paths everywhere is a bit annoying because the commands end up really long
right now we build from the port's directory
I'll poke at it again tomorrow
CircuitPython version
adafruit-circuitpython-adafruit_qtpy_esp32_pico-en_US-20240305-main-PR9004-4a335af.bin
Code/REPL
Boot loops, no code.py executed
Behavior
Starting with the 20240305-main-PR9004-4a335af.bin build from the S3 list ESP32 boards that don't support CIRCUITPY over usb boot loop.
Description
After the board is reset, the first boot messages appear and then every ~10-15 seconds the board restarts again. The "Serial console set...
CircuitPython version
rc0
Code/REPL
-
Behavior
build crash
Description
I downloaded and installed rc0. During build for a new board lolin S3 PRO the build process stops with error: without rule to make target "lib/tlsf/tlsf.c". (My translation from text in Portuguese). I checked the lib/tlsf folder. It is empty. How do I proceed to correct this error?
Additional information
No response
No problem to build with CPY 9.0.0-alpha.1
Solved: copied the library folder from here, in this repo on github
You can do make fetch-port-submodules in the port/espressif directory or make fetch-all-submodules at the top.
Thank you Dan. I deleted Circuitpython, next cloned the latest. Did all the further steps. Then I was able to build BOARD for lolin_sr_pro. Flashed it. REPL shows: Adafruit CircuitPython 9.0.0-rc.0-3-gad6bc74f28 on 2024-03-09; LOLIN S3 PRO 16MB Flash 8MB PSRAM with ESP32S3
Just an FYI... Espressif ESP_IDF has the esp-iot-solution with examples. An one of those examples is the usb_msc_wireless_disk.
I have loaded this example on an ESP32S3 board and it works for windows very well.
May be take a look at what they have done in the example and implement something like that.
CircuitPython version
Adafruit CircuitPython 8.2.10 on 2024-02-14; Adafruit Feather RP2040 with rp2040
(similarly on feather-m4-express so I suspect it's a general issue)
I am trying to build a custom image for the Feather RP2040, enabling MICROPY_FLOAT_IMPL_DOUBLE, MICROPY_PY_CMATH and ULAB_SUPPORTS_COMPLEX. My local changes are in boards/adafruit_feather_rp2040/mpconfigboard.h (see below), and I noticed that since double was ditched in 2018 (?), apparently the newer gcc-a...
Have you tried on main instead? 9.0.0 is imminent, and includes a big jump in gcc versions and MicroPython updates. I think that is where to spend the time to get this to work.
Related to this, I have these two commits in one of my trees (port-posix): efcad6457b715dbdb3f38582467e1379ccc8b1b8 e6aac4014eb9b77c641d3fb3ccfa9c0580a3c584
Feel free to pull them into a separate branch and PR it, or use it as the basis of your own changes -- the port-posix work is not progressing at the moment.
@dhalbert, same thing with 9.0.0beta2, tried with m4 express:
/usr/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: /tmp/cctg8k9g.ltrans113.ltrans.o:<artificial>:(.text.ndarray_binary_power+0x268): more undefined references to `pow' follow
I also had issues with MP_STATIC_ASSERT in py.obj.h and commented it out - no idea if there are any side effects.
@jepler, I had to change many more places. Raw git diff below, but it is very possible I did not catch them all...
CircuitPython version
Adafruit CircuitPython 9.0.0 rc0
Code/REPL
n/a
Behavior
n/a
Description
The gcc compiler installed by .devcontainer/cortex-m/on-create.sh is an out of date version of the ARM toolchain for an x86_64 build host. The version installed is gcc-arm-none-eabi-10-2020-q4-major, but should be arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi for an x86_64 build host.
Additionally, support should be provided for oth...
This adds the images and board info template for the lilygo_tdisplay_s3
Happens to me as well on Feather ESP32 V2.
Would it be a correct thought that since the M5Stack ATOM Matrix ESP32 Development Kit has a CP port that adding the M5StickC Plus IoT Development Kit should be pretty easy, since it's the same chip?
Exactly the same issue on ItsyBitsy ESP32.
Yup, adding boards is easy
@RetiredWizard I will wait a bit in case you have a few more changes.
Thanks Dan! :grin: I've tested I2S Audio Out, I2C, SPI (SD Card/TFT), keyboard pins... All looks good to me.
After a bit of code reading, I think I found an ansatz. py/mpconfig.h, if _FLOAT is set, defines:
#define MICROPY_FLOAT_C_FUN(fun) fun##f
which chops the appended f from all function names in libm/*.c. Otherwise, if DOUBLE ist set, the define is
#define MICROPY_FLOAT_C_FUN(fun) fun
which chops nothing. Consequently, the functions in libm/*.c are not found. But they should not be found in the first place, but the functions in libm_dbl.
Later today, I'll introduce INTERNAL_LIB...
To add a new board, Lolin S3 PRO, yet not existing in circuitpython.org/downloads. @tannewt advised me to add this board and to create a PR.
Ohai π
I started work on porting CircuitPython for this board: https://electro-smith.com/products/daisy-seed
It's a STM32H750 mcu, wih 1MB RAM, but only ... 128KB of flash, so obviously I ran into some size issues with the build.
The board does have 8MB external QSPI flash, is it possible to load CircuitPython directly on that?
QSPI doesn't seem to be implemented for stm though, ports/stm/supervisor/qspi_flash.c only contains commented out code, do I need to figure out how to implement that first?
Any advice would be helpful, thank you! 
that would be a duty of your bootloader writing (flashing) code there, not really something to implement on circuitpy (commented code would be to write/read from it at runtime, not too useful)
tinyuf2 has code for H7 but didnt work too good in my experience and i have the exact same board for which code is written
OK it seems I should avoid this hack and try to use libm.a instead. Compiles now, but I'll need to throw out some unneeded modules on M4 Express. In RP2040, I don't get these -wrap-things to link with libm.a.
You'll have to figure out how to do XIP with this chip. It is possible, but we haven't done this for STM at all. Is this an exercise for your own interest? Consider whether it's worth it.
I already own this board, so I thought it would be an interesting challenge to add CP support, but it's proving to be an even bigger challenge than expected π
Still... the temptation of using the giant 65MB memory makes it worth it, for sure!
We don't do things because they are easy but because we thought they would be easy. π§
Having a microcontroller with 65MB of RAM would make me feel like Doc Brown. 21.1 Gigawatts!
Describe the m5stack_cardputer based on m5stack documentation.
Images not provided yet... not sure how to make it draft, I will try to rush and scale images.
Seems that this was made by copy and paste from another m5stack board.
In this repo, if I understand this correctly, a separate listener object is required to use FIFO1. I was comparing this implementation with another library (Rust), and noticed that in their receive handler, they check both FIFOs in one check.
CircuitPython version
Adafruit CircuitPython 9.0.0-alpha.6-1-gfcfe2018bd on 2023-12-14; LILYGO T-DECK with ESP32S3
Adafruit CircuitPython 9.0.0-rc.0-dirty on 2024-03-08; M5 Stack Cardputer with ESP32S3
Adafruit CircuitPython 8.1.0-beta.2 on 2023-04-26; VCC-GND YD-ESP32-S3 (N16R8) with ESP32S3
Adafruit CircuitPython 8.2.9-9-g325ae7c6fd on 2024-02-13; Pimoroni Pico dv Base with rp2040
Code/REPL
print(type(runtime.serial_bytes_available))
Behavior...
usb_cdc.console.in_waiting returns the actal number of bytes available on the USB CDC REPL channel. This function will return true for more kinds of serial input.
I agree it could return an int instead, and that's a mostly-compatible change, since 0 is falsey. We could make that change for 9.1.0 or 10.0.0.
@bablokb would you want to fix this?
in #9031 Dan suggested that it might be appropriate to modify the supervisor.runtime.serial_bytes_available behavior in the future, until then this will update the documentation to clarify the current behavior.
The Teensy 4.0 board was incorrectly tagged as part of the STM chip family.
I am already working on that. You can find a preliminary version here: https://github.com/bablokb/circuitpython/blob/devcontainer-9.x/.devcontainer/cortex-m/create_cortex_m_9.x.sh
Currently, I am trying to track down a problem with devcontainer creation: if I create a container with the default configuration and then start my script after first login manually, everything works. If I run the same script automatically as postCreateCommand, it fails, because the tags won't work as expected (`...
CircuitPython version
Adafruit CircuitPython 9.0.0-beta.2-25-g95f24318e4-dirty on 2024-03-11; Adafruit Feather M4 Express with samd51j19
I'm still trying to get double float to work. Linking against libm works fine. When MICROPY_FLOAT_IMPL_DOUBLE is off, I can do:
>>> import math as m
>>> m.sin(4)
-0.756802
>>> m.sin(4.0)
-0.756802
>>> m.sqrt(42)
6.48074
When I activate _DOUBLE and _CMATH, it looks like this:
>>> import math as m
>>> import cmath as c
>>>...
M5Stack Cardputer has a matrix keyboard with a demultiplexer to drive the rows.
I started from keypad.KeyMatrix and I have created a board specific module: cardputer.DemuxKeyMatrix
Usage example:
import board
import cardputer
import keypad
km = cardputer.DemuxKeyMatrix(
row_addr_pins = (board.KB_A_0, board.KB_A_1, board.KB_A_2),
column_pins = (board.KB_COL_0, board.KB_COL_1, board.KB_COL_2, board.KB_COL_3, board.KB_COL_4, board.KB_COL_5, board.KB_COL_6)
)
...
CircuitPython version
Adafruit CircuitPython 9.0.0-rc.0 on 2024-03-08; Adafruit MagTag with ESP32S2
Code/REPL
n.a.
Behavior
The close() method of Response fails in certain cases. This has already been fixed, see https://github.com/adafruit/Adafruit_CircuitPython_Requests/pull/156 but the submodule here needs an update as well, since it still ships the buggy version (I think circup does this too).
Some boards like the Magtag include Request...
@dhalbert : two minor notes regarding your "Building CircuitPython"-guide: it does not mention make fetch-tags at all. And secondly, the image on the very first page shows a git submodule update --init (which is more of a cosmetic problem).
- Wrapped main function in spresense_main
- video_uninitialize now requires dev path as parameter
- Waiting for tinyUSB PR to be approved (https://github.com/hathach/tinyusb/pull/2514)
- Waiting for spresense-exported-sdk PR to be approved (Update Spresense SDK to 3.2.0 #2)
I did update the frozen modules for 9.0.0-rc.0, but adafruit_requests needed a new release, which I didn't realize. I've made that release and will update again before final. We should check whether any other libraries need a release as well.
@lone axle do you have a script to find the libraries that need a release? I would imagine so. I would like to run it to check before I update frozen modules for 9.0.0. Thanks.
Yep, Adabot has that functionality for release sweep: https://github.com/adafruit/adabot?tab=readme-ov-file#making-releases-for-circuitpython-libraries it will compare latest commit with latest release on each library and prompt to release ones where they are out of sync.
theoretically the same list should end up here: https://circuitpython.org/contributing/library-infrastructure-issues but I've found it can be off by a day or two sometimes whereas the adabot report is run live. Also on this page they are seperated into categories of how far out of sync the release date from commit date is.
@tulip sleet and @slender iron, question on the most recent merge into requests. There are other open issues on this, and IMO fast_close does not feel like the right approach. Would it not be better to fix it more correctly, then add a param?
I have been working on an approch with https://github.com/adafruit/Adafruit_CircuitPython_Requests/issues/153, just haven't finished
@hathach did you have any more info about this yet?
I did not see the alternative PR. I agree if it can be fixed without a param, that would be great. Can you ping the other author to discuss in your PR?
I will, I probably won't have mine open until mid-week . My only concern is people using a param, that then gets dropped.
Drop a note on the PR too so that the PR author can participate in the alternative solution.
<@&356864093652516868> The weekly meeting will be held in just under two hours. Daylight savings time has already started in the US, so this may be a different time than you are used to if you are not in the US. Here's the notes document if you have not already added your notes: https://docs.google.com/document/d/1wyHuyLhHVop15ZEMZg2WSXNp-kdvO98wNbPvHk5b6WA/edit?usp=sharing. See you soon!
Is this fix going to get applied in 8.2.x branch? https://github.com/adafruit/circuitpython/issues/8986 I'm running into this exact same issue (web workflow reports that device is readonly even though I have storage.remount("/", False) in boot.py and confirmed that the REPL is able to write files). I was trying to work on https://github.com/adafruit/circup/issues/206 but I'm seeing this same issue on 8.2.10 and 8.1.0 tested on Feather S3 TFT and Feather S2 TFT.
If we don't get a fix for that in 8.2.x I'm not sure there will be much benefit in adding support in circup for < 9.0.x where this is already fixed. The change to the web workflow API had broken it, theoretically it could be updated to support the old API, but it appears this other issue results in it still being unusable anyway.
Presumably if I go back far enough I can find one that works because I know I used this successfully in the past. But that would leave gap in support between whatever versions end up being where it changed.
It is not clear to me which listener will get which messages when there is no matching/filtering setup. I suppose the likely recommendation is to use message id filtering.
Aka, incorrect usage (that will lead to weird behavior):
listenerFIFO0 = can.listen(timeout=.1)
listenerFIFO1 = can.listen(timeout=.1)
Correct usage:
listenerFIFO0 = can.listen(matches=[<list of message ids>], timeout=.1)
listenerFIFO1 = can.listen(matches=[<list of message ids different than FIFO0>...
<@&356864093652516868> Our weekly meeting is about 95 minutes from now -- the US (& Canada) switched to DST, so if you're in a different area this might mean the time of day is shifted by 1 hour for you. If you have notes, please take a moment to update the google doc: https://docs.google.com/document/d/1wyHuyLhHVop15ZEMZg2WSXNp-kdvO98wNbPvHk5b6WA/edit?usp=sharing
@tulip sleet ive merged https://github.com/adafruit/Adafruit_CircuitPython_Typing/pull/40 now. I saw your message about the plan for release. Do you want me to make the new release 1.10.3 or would you rather handle everything you mentioned all at once?
I think it's not worth the time to add circup support for 8.x.x for web workflow, given the imminence of 9.0.0.
Go ahead and make a release if there are no other useful pending PR's
I noticed playing with circup, that it doesn't take in account for frozen libraries. Would that be a good add?
in what sense? There are two reasons for freezing libraries: save RAM, and convenience. To override a frozen library, the updated library needs to be in /.
I think the use cases are complicated enough that it's probably not worth adding a feature right now.
I just noticed when I did a install from my code.py file that it downloaded it. I guess you are right and it would be in lib, but not used. Although if you later did an upgrade, it would show that it upgraded it and in reality it wouldn't be used.
Just a thought
I'm not sure it can detect which libraries are frozen and their versions, since they are not readable from the filesystem
yes, the pre-reqs often cause duplicate libraries to be downloaded but not used. That is also true of things like adafruit_bus_device.
what is frozen is kind of a "secret"
If I were to do it, I would probably have circup pull down the json file that's in the docs
And see if the versions could be added to that
it would be nice to reveal that, but it might require considerable code that is not going to fit on the boards where frozen libraries are important for space reasons
ah, I totally forgot about that. Though the version can vary per build, so it's a lot of data to keep
That's true... Well If you ever want to go down this rabbit hole - let me know. Happy to tackle it
it has not been that much of a support issue, so I think it is lower priority
Are there any tricks or known issues with updating submodules on main atm?
I'm getting this error:
fatal: transport 'file' not allowed
fatal: Fetched in submodule path 'lib/tlsf', but it did not contain 81d37795451578255c8d047404c4a179258dcec7. Direct fetching of that commit failed.
fatal:
::endgroup::
Duration: 1.7097632029999659
Traceback (most recent call last):
File "/home/timc/repos/circuitpython/circuitpython_copy/circuitpython/tools/ci_fetch_deps.py", line 237, in <module>
main(target)
File "/home/timc/repos/circuitpython/circuitpython_copy/circuitpython/tools/ci_fetch_deps.py", line 219, in main
fetch(submodules)
File "/home/timc/repos/circuitpython/circuitpython_copy/circuitpython/tools/ci_fetch_deps.py", line 133, in fetch
run(
File "/home/timc/repos/circuitpython/circuitpython_copy/circuitpython/tools/ci_fetch_deps.py", line 109, in run
subprocess.run(shlex.split(command), stderr=subprocess.STDOUT, check=True, cwd=cwd)
File "/usr/lib/python3.10/subprocess.py", line 526, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git', 'submodule', 'update', '--init', '--depth', '1', '.', 'frozen']' returned non-zero exit status 128.
make: *** [Makefile:341: fetch-all-submodules] Error 1
I'd suggest doing remove-all and then fetch-all or fetch-port. Also are you using a newish git?
β― git --version
git version 2.34.1
the repo for tlsf was changed
removed and re-fetching now.
git >=2.36 uses a superior way of fetching submodules
i would suggest adding the git ppa if you are on ubuntu
After remove-all and then fetch-all again it shows the same error but on a different submodule:
fatal: transport 'file' not allowed
fatal: Fetched in submodule path 'extmod/ulab', but it did not contain eacb0c9af47f85f5d4864b721c3b28661364e8e3. Direct fetching of that commit failed.
fatal:
::endgroup::
Duration: 146.4553917379999
Honestly I'm a bit superstitious around submodules. I'm going to try a fresh clone of the repo locally out of curiousity with my current version of git but then I'll add that ppa upgrade. I am on ubuntu.
Thanks for this new functionality! I'd prefer that this be added at the top level instead of for a specific board that way other user code can use it.
Thank you for the PR. There is one extra file.
This file shouldn't be changed for adding an ESP board def.
The freshly cloned copy was able to fetch-all and build successfully.
I've seen this sporadically for the last couple of months. I suspect there's an intermittent problem with github under load. When it happens, the download speed on the affected submodules drops to about 50K/sec before the failure.
When it does occur, I've found that a make remove-all-submodules followed by another attempt to fetch-all or fetch-port as Dan suggested does the trick.
I tested the functionality of this successfully on the Cardputer device.
<@&356864093652516868> meeting starting in one minute
I don't think it makes sense to map the reason to something else here because you lose information. Instead, do this mapping where the reason is used to produce an error.
One suggestion based on what I think your goal is. I think you are trying to improve the error message in this case.
βΊοΈ
A DIY guide to bringing your first robot to life with cheap and basic components.
Build Your Own Robot introduces you to the exciting world of robotics in a way thatβs fun and affordable! Youβll build your own real robot with easy-to-find hardware and free open source software. Plus, all the components you need can be assembled with simple tool...
What causes so many PyPi library downloads? Mostly for people doing Blinka or for stubs-type stuff for IDEs?
Some of both I believe. anytime anyone uses pip install on a library. I don't think we get visibility to different sources though.
I'm not even sure where the data comes from @devout jolt. I assume any time a blinka install or upgrade occurs, (even via being a dependency) it counts.
I think it would be worth investigating this. I wondered if it was cumulative in some way, and not just weekly. The numbers do seem very high. Maybe many are just touches.
344 623 4533
```slightly different number than I said but a *LOT* of people no matter how you sort it
does someone have a link to the cardputer repl thing?
floppsy π°
and now I have to run, thank you all and have a great week!
if 'compile_command' in dir():
# 9.0.0 alpha 7 or later supports multiple line statements
__line = input(",,, " if __cmd else "=>> " )
```nice, they found the "compile_command" code I added π
There are so many breaking changes from 8.x to 9.x go for it. Break all the things, might as well introduce it with 9.x
OAuth changes every year or so doesn't suprise me there are so many different iterations of it.
Every website seems to have their own quirks with 0Auth implementations.
A cheap way to emulate posterize is just drop the bit depth to 2 or 3. π
Thank you for hosting Dan. Wonderful updates this week. Thanks everyone!
Thanks @danh!
Thanks
Thanks for hosting Dan. Have a great week everyone!
you're welcome!
200+ unique contributors is impressive. Do we have stats to compare to 6-7 and 7-8?
Here is the notes document for next Mondayβs CircuitPython Weekly Meeting. It is at the normal time of 11am Pacific / 2pm US Eastern here on Discord. Add your hug reports and status updates to the document before the meeting. If you are unable to attend but would still like to contribute, feel free to add your notes and weβll read them off during the meeting. Hope to see you there! <@&356864093652516868>
https://docs.google.com/document/d/1A5vXAYyCHsXmquGVkXvxFn0wosleHI8NHVKkD6Zr4S4/edit?usp=sharing
I did not change this file. It appeared in my fork & branch. I performed a clean clone. How do I proceed?
It is likely due to the multiple heap setup on ESP32. An allocation fails into one heap because the size is too large but caused an assertion instead of failing over to the next heap.
Fixes #9026
@slender iron would it be ok if make the default branch of https://github.com/adafruit/tlsf be circuitpython instead of idf? Every time I go to look at it, I'm briefly confused about where your changes are.
totally!
[low priority] just in case someone here has been playing with renode - could someone point me at a working configuration for any board, that runs CP? I was even unable to launch the micropython config that theoretically is available via this: https://renodepedia.renode.io/boards/rpi_pico/?view=software&demo=micropython and before diving into it, wanted to see if more experienced folks have tips.
I don't know of anyone who has
CircuitPython version
Adafruit CircuitPython 9.0.0-rc.0 on 2024-03-08; Adafruit Camera with ESP32S3
Board ID:adafruit_esp32s3_camera
UID:CD4557ADE748
Code/REPL
Fancy Camera Example is running on Camera
Behavior
N/A. No error messages. See Description for more info.
Description
Occasionally, the SD folder shows incorrect files. I noticed this after a file operation especially when deleting or uploading a file, the only file that will show ...
Figured out after writing the ATECC eeprom it gets locked permanently. There is a warning in big red letters about this on the SparkFun site for this same crypto chip breakout. https://www.sparkfun.com/products/18077 No such bold warning on the Adafruit product page or learn guide or examples or code comment in the library.
I have figured out after being locked it goes into a permanently idle state and the only way to communicate with it is to send it a wake command. This command is malfunctioning in the adafruit_atecc library.
After being locked I can send it a wake command manually and it responds. The I2C device address becomes active and can print out the device serial number. That's as far as I've gotten so far.
The way it responds to wake frequency command prior to locking eeprom and after are different. There's something wrong with the wake function in the library after eeprom is locked.
The way it behaves suggests some type of watchdog timer. The wake command only wakes it up for about 10-20 seconds, then it goes back to idle. If continually fed print commands it stays awake indefinitely.
options for hardware revision checking in board.c?
We may end up with two versions of our hardware board. We would like to avoid forking our CircuitPython build for a small change.
Are there any popular / existing mechanisms which can be implemented in board.c? We do have the ability to make small changes to the second revision if there is something simple we can add and then detect.
Addendum: this is an RP2040 design
the uf2 bootloader on the samd chips lets you store a bunch of info in the bootloader itself, and then you can use it in your program. I use that to read the screen offsets for the pewpew m4 console, because I have different revisions with different screens
Thanks. I should have added "RP2040".
you could also have a small i2c eeprom memory on your board, like the raspberry pi hats do
or just encode some data with spare gpio pins
if you have a spare adc pin, you could encode the version with a resistor
I will look for an example of another board which accesses I2C. It would need to be accessible to both board.c and the end user.
I assume ADC would use a voltage divider?
I guess so, but it could be switched on/off by another pin
I will look at some of the other boards with I2C and an EEPROM.
I'm not sure there are any cp boards with eeprom
but there are some boards with i2c screens
Good point. Thanks for the starting points. I will do some digging.
I'm thinking about adding an i2c eeprom to my robots to store the calibration data, so that I can swap the microcontroller board with the brain between the robots
Good idea. Are there any kind of standards for this kind of thing, a bit like the pi-hat eeproms? I want to ensure I dont reinvent the wheel, but similarly wanted to store calibration data etc, but then it occurs to me I should have a standard mechanism for retrieving manufacturer / model / revision (of the "device" not eeprom chip)
the pi hats use an encoded linux kernel device tree overlay...
I know linux kernel overlay device trees, but whats the encoded bit?
well, you have to convert it into a single string
maybe I should have said serialized
Aha I get you
you could look at the uf2 format
Yeah that seems like a win (for some device config stuff), hadn't seen it before some makecode thing pointed me to it recently
it's still just a bunch of values packed in a struct
This happens if you request the sd directory while code is restarting. SD access depends on the user code being active.
eeprom has the challenge that it needs to be programmed
https://github.com/adafruit/circuitpython/blob/main/ports/atmel-samd/boards/pewpew_m4/board.c#L38-L67this is how I access it in board.c
if the pcb is different, you could use a shift register to shift in a number defined by the pcb
that's three pins
you could also use those three pins in a similar fashion to how some i2c chips let you change the address, by connecting them to gnd, vcc, other pins or each other
Ah ok. Yeah, I just checked and the file ops were causing a code restart. Do you know if there is a way to have it check if code is still restarting so that the correct contents are shown to the user. I could probably make something with the full code editor, but the problem would persist with the built-in one.
I don't think there is. My intent was to fix this by having SD cards mount automatically and persist on boards with it built in.
I may end up using a voltage divider because it offers a "1 pin" detection mechanism that can be completely transparent to the end user.
if you are using a number of gpio pins that are only connected internally, you can have your detection pin connected to one of them depending on the version, then in board.c bring it low, set all those pins to pull-up and see which one is 0, then release them all and initialize normally, with the detection pin set to input, so it doesn't interfere with all the rest
if you can spare more such pins, you can encode more states, (internal pins)**(detection pins)
it doesn't work if the pins are connected to buttons or something else that might hold them low, because then it's unreliable
but things like a parallel display bus are perfect for this
wow, there are i2c eeproms in sot-23-5 packages
for 3 cents a piece in singles
It's pretty simple really. I made one class to store byte/bytearray objects. Then I used the struct class to turn regular variables into a byte object to store them. And retrieve them as a tuple
would have been easier in C/C++ even π©
the problem is that it is an extra step in your production process
@stuck elbow - using a voltage divider can be done with just 1 pin and varying the resistors allows for multiple possible values.
but then you have constant power drain
One issue I can see with an I2C EEPROM is the user could overwrite it (unless the board has multiple I2C pins combinations)
True, but using high Ohm resistors can mitigate the drain considerably.
what are the differences between the board revs?
there is a write protection pin
@tulip sleet - We are trying to figure that out right now but it looks like it will be a slight difference in the display - requiring a small change to the init sequence.
I tested with Feather ESP32 V2 and QT Py ESP32. Thanks!
Failed build is not related.
ack - thx!
Hi! I made some changes in the markdown file and board images.
Please let me know if there is any problem or questions.
Thank you!
I tested the Titano with 9.0.0-rc.0, looks like same error.
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
πcode.py | 9.0.0-rc.0\Traceback (most recent call last):
File "code.py", line 57, in <module>
File "adafruit_airlift/esp32.py", line 198, in start_bluetooth
UnicodeError:
π198@adafruit_airlift/esp32.py UnicodeError | 9.0.0-rc.0\
Code done running.
Press any key to enter the REPL. Use CTRL-D to reload.
Thanks for this new functionality! I'd prefer that this be added at the top level instead of for a specific board that way other user code can use it.
Done, I've moved DemuxKeyMatrix in the keypad shared module.
Usage example:
import board
import keypad
km = keypad.DemuxKeyMatrix(
row_addr_pins = (board.KB_A_0, board.KB_A_1, board.KB_A_2),
column_pins = (board.KB_COL_0, board.KB_COL_1, board.KB_COL_2, board.KB_COL_3, board.KB_COL_4, board.KB_COL_5, board.KB_...
In a pull request I have added a class for the keypad module. I'm trying to disable it for the atmel samd board because the flash is limited. I've tried to disable it in ports/atmel-samd/mpconfigport.mk but without success. Can anyone help me on this?
https://github.com/adafruit/circuitpython/pull/9035
After a discussion with a few hardware designers, we plan to take an unused analog pins and add a voltage divider. This will allow us to switch the resistor values to "hard code" a voltage value on the pin, thereby distinguishing the board revision.
This will give us the ability to distinguish a few different revisions (if that should be needed in the future).
Interesting idea.
It feels a little bit like a kludge but at the same time, it has a big upside for the end user as we can make small changes to the hardware and preserve a simple experience on circuitpython.org for firmware. The end user need not be bothered with backend hardware revisions.
Can anyone clarify this for me -- According to the README in the repo adafruit-circuitpython-asyncio is not inteded to be released to PyPi yet, here it is https://pypi.org/project/adafruit-circuitpython-asyncio/ If I am using CircuitPython code on a Raspberry Pi (via blinka) and I want to use asyncio, I had assumed I should just use the CPython asyncio. Is that correct? If I run pip install adafruit-circuitpython-asyncio it happily installs but that does not appear to be the intended use and it is not clear to me what I get if I then import asyncio....
from the README Installing from PyPI This library is meant to be a subset of the ` asyncio module in CPython <https://docs.python.org/3/library/asyncio.html>`_, and will not be made available on PyPI. Use the CPython version instead.
I believe the information in the readme (that it's not intended to be released to PyPi) is out of date. At one point me made the decision to release all CircuitPython libraries on PyPi even if they were not intended for use with CPython, because it can still serve a useful purpose with more fully featured IDEs that will use the locally installed instance to populate context hints and documentation directly in the editor. We probably never went back and updated any readme's that state otherwise.
With regards to using asyncio with Blinka and CPython, I don't know but my instincts match yours that it would be best to use the "real" CPython asyncio in that environment not the CircuitPython one. If you install both the CPython and CircuitPython ones, I am also unsure what happens when you use import asyncio I assume python has some precedence rules for name collisions but I don't know what they are.
Thank you! That is just what I needed to know.
@tulip sleet or @onyx hinge do you have any knowledge of with adafruit_requests reads the rest of the response on .close(). I've played with it on a bunch of boards and have yet to have it cause any problems to not just close...
@short tendon I think it has to do with avoiding the cost of re-establishing a https connection. If this cost is tolerable on relevant boards these days, it seems like it'd be better to just close and re-connect (at least if the response hasn't been consumed already)
So, I tested that as well. On .close() the socket is flagged as free in ConnectionManager, but not actually closed. If you request the same host, it returns the same one and it's still connected. It had no issues grabbing the correct data.
I wonder if it is a leftover from ESP32SPI. adafruit_requests was originally written for ESP32SPI, way before we had native wifi ESP32 boards.
I saw a comment from jepler on an issue about that. I've tested pretty hard on the ESP32SPI and can't find any issues
I don't know who originally wrote the connection re-use code or whether they're still working on CircuitPython, I'd have to check out the git logs.
if you look at the "blame" associated with that code, you could go back in time and see whether the read was added at some point
Version 1.70 from Scott. First commit Switch to HTTP1.1 so that we can reuse sockets. https://github.com/adafruit/Adafruit_CircuitPython_Requests/commit/87d063329c97c00fb0988e2b255eaa827cccdd50 started the change (almost 4 years ago)
so, in particular, the draining of the connection on close() was added, right? So we could ask @slender iron what he had in mind when he added that code
Correct. It's also when request.Session was added
right. I added the draining code
because you can't reuse a socket if a bunch of data is remaining
I'd suggest making a new module instead
There are examples of disabling functionality in a module, e.g. CIRCUITPY_BUSIO_SPI. It raises NotImplementedEerror if turned off.
You were suggesting to make a complete new module and not adding DemuxKeyMatrix in the keypad module?
I prefer being able to enable/disable on a module boundary
Any suggestion for the module name?
but a separate module might be easier. You need to check that CIRCUITPY_KEYPAD is on if CIRCUITPY_DEMUX_KEYMATRIX is on. Maybe call it keypad_demux_keymatrix. So keypad_demux_keymatrix.DemuxKeyMatrix. Since it's so releated to original keypad
looks up what a demux is
3-to-8, in this case
ah, three binary bits select one of 8 inputs
i wonder if it is a demux or a mux. I'm going to look at the cardputer schematic
uses this: https://www.ti.com/product/CD74HC138 ; a demultiplexer
or maybe call it a MultiplexedKeyMatrix
Do you have an example of where this would fail?
maybe that's not such a great name, since the matrix is already "multiplexed"
I'd have to look where I added the consume calls. It was done for cases where we were done with a request before all data was received
I don't have the context for it anymore so feel free to change it
So how about we comment out the code, and just flag it as closed, and if it causes problems then use that to fix it?
I don't love it, but can't find a way to break it currently
https://requests.readthedocs.io/en/latest/user/advanced/#keep-alive is there any performance data of draining vs. re-establishing TLS?
and can we set a request to [fully] close (vs. drain and re-use)?
@tulip sleet Regardless the name, I can change it as you suggested, I have already implemented CIRCUITPY_KEYPAD_DEMUXKEYMATRIX to disable the module. Because the build of atmel-samd fails on flash size I added CIRCUITPY_KEYPAD_DEMUXKEYMATRIX = 0 but it keep fails. Can you help me to fix that?
Ahhh, so it might be when changing hosts, let me try that
someone mentioned the other day about streaming responses that never end (can't be drained)
(we can set stream=False)
So they could never close, becuse we read to the end.
I'm trying to get not reading to the end to cause an issue
if I read right, using a session preserves thes socket for reuse, otherwise socket is actually closed (but I wonder if the latter case needs draining?)
Just delete it. git has the code if we need it again
So everything is now using a session. I can't find a case that not draining causes issues
Are you seeing a clear size difference when CIRCUITPY_KEYPAD_DEMUXKEYMATRIX = 0? Make sure you do a make clean before recompiling. Also you could make including shared-module/keypad/DemuxKeyMatrix.c in the list of sources to compile be conditional.
True
I was looking to see if there was a lot of shared code between KeyMatrix.c and DemuxKeyMatrix.c, and there is, but maybe it's too complicated to merge the two and do run-time checks.
It also fixes HEAD and allows for OPTIONS
@vagrant wind but as a separate module it would be more straightfoward. It is a bit too bad there is a lot of duplicated code in shared-bindings, but that could be refactored at some point.
This can happen if the submodule wasn't updated correctly and then it was accidentally "added" to a commit. The easiest way to avoid it is to ensure you only add what you want to a commit. I'll follow up with a fix.
What I've implemented here https://github.com/adafruit/circuitpython/pull/9035 is not already a new module?
It was, but now it's inside keypad. tannewt's comment was asking you to put it in shared-module and shared-bindings. I looked at your original commits and it was in espressif/boards. So if you go back to that commit, and rename the whole module something more generic than cardputer, and move the files, that would be a generic separately-enableable module
I didn't have chance to look at that commit before it was changed until just now
i.e. this commit was a separate module: https://github.com/adafruit/circuitpython/commit/9f9dcd013c854418efae9f1f20e35f4c2c089400
- Fixes #8548
(pinging @aalhard for interest or testing)
_bleio.Adapter name setting for bleio HCI implementation did not include a trailing null as necessary. The logic for name setting was also a little bit tortured and redundant.
Tested on PyPortal Titano, using the UART echo test program in #8548.
- default name:
CIRCUITPY1234 - settings.toml:
CIRCUITPY_BLE_NAME = "abcdefghijklmnopqr" - in code:
adapter.name = "yet-another-name"
All worked and showed correct name in ...
@danh Noticed you using a leading '_' on the static function name _adapter_set_name in #9041. Is this a CP naming convention? Are there others I should be aware of?
sometimes it's a convention π . It's not necessary, and we're not that consistent.
@short tendon @crimson ferry is someone making a PR? The conclusion is to remove the draining code, and you've now tested it? We can make a release and freeze this into the next release candidate
Yes, I'm working on it and should have it open today
thanks!
Hi. Not sure if thread is stalled due to lack of ideas or people to implement feature - but here goes:
Instead of adding "drive strength", "slew", etc to DigitalInOut,
what if we instead had "common" >>>preset configurations<<< for all chips?:
#---------------------Common interface---------------------
class AbstractPinConfig:
@abstractmethod
def apply(pin_ref): #Apply config to a given pin.
pass #==> Might make more sense to pin.apply(pincfg). Not sure...
I'm going through the academic exercise of trying to get circuitpython to build and run on one of those as yet unsupported Sunton ESP32 OLED+Touch+SDCard devices. I know it works because I can upload basic arduino blink sketches via vscode and it's blinking away and printing serial output on the usb uart. Its a ESP-WROOM-32 at heart and every avenue I've tried so far has left me in a TG1WDT_SYS_RESET boot loop
Not sure where to post such things but MEMENTO board is missing in adafruit.com "CircuitPython" products category
This one?
Yes
If I was not precise, I mean it is not listed in a product list https://www.adafruit.com/category/956
its under sensors/cameras
But it is also a CircuitPython board, isn't it? There are multiple products that are listed on multiple categories
you're probably right.. I have nothing to do with it, was just making sure your comment was clear..
I've had success using the "Adafruit HUZZAH32 Breakout with ESP32" firmware, although it sometimes takes a few power cycles/resets to start up properly
Also note, that you need to grab either CP 8.x or the absolute newest. The boot loop issue was resolved yesterday by https://github.com/adafruit/circuitpython/pull/9039
@fringe yarrow π
- update tinyusb to include fix for multiple setup packets (reproduced by using macos) https://github.com/hathach/tinyusb/pull/2492
- fix #8824
tinyusb pr is merged, cpy PR is on the way https://github.com/adafruit/circuitpython/pull/9042 . @tlyu @eightycc would you mind testing out the cpy PR to confirm if issue is fixed. Thank you.
I still couldn't reproduce the issue with my machine, it take a bit of time (several seconds) to enumerate keyboard but seems to work just fine. @FoamyGuy are you testing with rp2040 connected to a macOS machine. If yes, then you maybe give this https://github.com/adafruit/circuitpython/pull/9042 a try, it fixes an issue with using with macos.
Further to my efforts to get circuit python to build and run on this Sunton "Cheap Yellow Display". If I flash it with a prebuilt 8.2.10 intended for the esp-eye device, it boots and runs hello world as you'd expect. If I flash it with the 9.0 prebuilt, it bootloops (TG1WDT_SYS_RESET). If I build from latest main for the esp-eye and flash it, its the same result, TG1WDT_SYS_RESET bootloop.. Curious..
All of my testing was performed with a Feather RP2040 USB Host (https://www.adafruit.com/product/5723) and it has been plugged into an Ubuntu PC for power and serial communication during my testing.
@alainman-krh The API design question is what to do with these configured "pin" or "pad" objects: are they a complete substitute for Pin objects that are taken as arguments, are they an additional possible argument, etc.
Right now Pin is an immutable object that names a pin and says nothing about its current state. Would a "Configured Pin" object be a complete substitute, an additional available argument, etc.?
If you configure a pin object, does its state change immediately, or is...
I will bring this up internally.
Moving this back to 9.0.0 assuming it's fixed.
@short tendon check your DM's
@tulip sleet Is this setting for the matrixportal s3 an error https://github.com/adafruit/circuitpython/blob/main/ports/espressif/boards/adafruit_matrixportal_s3/mpconfigboard.mk#L16 Should it be disabling CIRCUITPY_ESPCAMERA instead of CIRCUITPY_ESP32_CAMERA?
yes, that is obsolete, thanks for catching that. a quick PR would be great, or I'll do it.
I have to run out, but I can do it this afternoon.
i can just do it now, but I'll credit you
Thanks @jerryneedell for spotting this.
now added to category
The thing is that the idf now never returns WIFI_REASON_AUTH_FAIL, only WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT.
So information is not lost by the code, but by the idf that broke WIFI_REASON_AUTH_FAIL.
We are now always getting WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT.
So at least in the current version of the idf, we cannot tell what WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT really means, and we have to use a single error code.
It's possible Espressif is trying to get away from the 2xx nonstandard errors. We could filter out attempts to connect to a secure AP without a password. But with a secure AP, an authentication failure is a failure in the 4-way handshake, so that's a more standard error. Maybe Espressif should be delivering a more precise error on where things went wrong in the handshake, but that's probably a separate issue.
It looks like you saw the fix for the TG1WDT_SYS_RESET bootloop, but trying to use the 9.x esp-eye firmware is probably still going to cause a problem because starting in 9.x that device specifies a PSRAM size of 8M and I suspect your device only has 520K (I got mine from a different seller but it has the same ID on the back). The "Adafruit Huzzah32 Breakout" firmware is working on both 8.x and the "Absolute Newest" 9.x build (Adafruit doesn't have a web installer for the absolute newest so you have to use esptool or I suspect the esp webflasher would work).
That's likely the issue I'm having, yes, the psram mismatch.. Thanks for the tip.
I mean, WIFI_REASON_AUTH_FAIL literally used to be the specific 4way handshake error for password mismatch, so assuming this change was intentional, I don't expect new codes.
The authmode mismatch should be considered and implemented into a seperate error.
The incorrect password and actual WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT are stuck together now, so..
The busio.SPI class has a parameter to set the bit width, but this parameter is not available in the SPI device manager
@anecdata I'm not sure: could you clarify whether you think the proposed PR is what you'd like, or you want it to do something else? Thanks.
Having dug a bit more, I can see a pattern. All functions returning their results via mp_obj_new_float() exhibit this behaviour, which is why complex functions returning complex results appear to work fine whereas cmath functions returning reals (like phase() or polar()) return nonsense.
It appears that float64 results get masked out by 0xffffffff at some point:
c.sin(27)
(0.956375928404503+-0j)
m.sin(27)
1.46631046621851e-314
and decoded according to IEEE754 this conta...
It seems the implementation could be as simple as passing along the kwargs:
class SPIDevice:
def __init__(self, bus, cs:digitalio.DigitalInOut|None=None, cs_active_value=False, extra_clocks:int=0, **kwargs):
self.bus = bus
self.cs = cs
self.active_val = cs_active_value
self.extra_clocks = extra_clocks
self.config = kwargs
def __enter__(self):
assert self.bus.try_lock()
self.bus.configure(self.config)
...
All of my testing was performed with a Feather RP2040 USB Host (https://www.adafruit.com/product/5723) and it has been plugged into an Ubuntu PC for power and serial communication during my testing.
I also tested with both feather usb host + pico (with testbed brain) and a Linux PC. It probably has something to do with keyboard. Can you enable the CFG_TUSB_DEBUG = 2 then getting the tinyusb log from uart to see if there is any problems.
There are two distinct situations.
- Connect to secure wifi w/o password:
Here, behavior doesn't match Espressif docs: https://docs.espressif.com/projects/esp-idf/en/v5.1.3/esp32s2/api-guides/wifi.html#wi-fi-reason-code-related-to-wrong-password I'd expect a 201 (NO_AP_FOUND). The docs vary from the behavior we see in other ways too, so π€·ββοΈ . After more review, I don't think the API has the granularity where we could detect that case in code and pre-empt a connection, short of add...
@tlyu @eightycc could you test? I am not able to reproduce this reliably at all with tio and ctrl-t-q on my Mac Mini M1: maybe once out 100 tries. (Do you have any ideas why it works better for me?)
@dhalbert Getting this to reproduce reliably requires building at -Og. I think there's a timing component to the original bug. Testing it here at -Og and with the couple of RP2040 revs I have on hand is on my list for later today.
CircuitPython version
Adafruit CircuitPython 9.0.0-rc.0-8-g4f0da18204 on 2024-03-12; Seeeduino Wio Terminal with samd51p19
Code/REPL
>>> import os
>>> os.listdir("/")
['.fseventsd', '.metadata_never_index', '.Trashes', '.Trash-1000', 'Beryllium', 'code.py', 'boot_out.txt', 'repl.py', 'boot.py', 'settings.toml', 'LOST.DIR', 'Music', 'Podcasts', 'Android', 'Ringtones', 'Alarms', 'Notifications', 'Pictures', 'Movies', 'Download', 'DCIM', 'Documents', 'Audiob...
/Beryllium/mnt should be the mount point. Did that subdirectory exist beforehand?
Is the SD card empty? If not after the storage.mount(), is /Beryllium/mnt/ empty? It should show what is on the SD card.
Did that subdirectory exist beforehand?
Yes.
Is the SD card empty?
Has a single empty file inside.
I was incorrect in saying that /Beryllium/mnt is empty, it has a hidden file.
>>> os.listdir("/Beryllium/mnt")
['test_file.txt']
>>> os.listdir("//Beryllium/mnt")
['.gitkeep']
>>> os.chdir("/Beryllium")
>>> os.listdir("mnt")
['.gitkeep']
>>>
mount() is clearly trying to mount from working directory, that is really risky when we are talking about relative paths, and leads to issues like this.
I'm sure if I did anything like "../../../../Beryllium/mnt", it would explode.
Checking with logic is also really slow, and buggy.
The simpliest and safest way is:
chdir()to the directory above target (checkingrfind("/") != 1, if -1 it assumes it's in current working dir).- Ensure target exists.
- Attempt to mount.
- Go ...
I think @tannewt's comment was asking you to move the cardputer module you originally wrote, so it was top-level module in shared-module and shared-bindings. I looked at your original commits and it was in espressif/boards. I.e. this commit was a separate module: https://github.com/adafruit/circuitpython/commit/9f9dcd013c854418efae9f1f20e35f4c2c089400
So if you go back to that commit, and rename the whole module something more generic than cardputer, and move the files, that would be...
Tested on MacBook Air M1 with Sonoma 14.1.
Building current CP main using -Og without this PR, tio test fails with one or two tries. All the same with this PR, I cannot get it to fail. Tested with both RP2040 B1 and B2.
Looks good to me, I'd ship it.
@kamocat PRs to the Python busdevice and the core C implementation would be welcome.
Sounds like you may be hitting the object representation: https://github.com/adafruit/circuitpython/blob/main/py/mpconfig.h#L121
CircuitPython uses C which packs floats into the 32 bit pointers instead of allocating them separately to the heap.
To be clearer. I'm ok with this remapping but want it to happen outside this function.
Specifically, change how it works here: https://github.com/adafruit/circuitpython/blob/main/ports/espressif/common-hal/wifi/Radio.c#L379-L383 You can change what triggers the AUTH_FAIL to python there.
@lone axle I was using your instructions above and in the adabot repo to do a release sweep to see if anything in circuitpython frozen/ needs updating, but adabot installs locally as UNKNOWN instead of as adabot. Do you understand what is wrong here:
halbert@cod:~/repos/adafruit/adabot$ pip3 install .
Defaulting to user installation because normal site-packages is not writeable
Processing /home/halbert/repos/adafruit/adabot
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: UNKNOWN
Building wheel for UNKNOWN (pyproject.toml) ... done
Created wheel for UNKNOWN: filename=UNKNOWN-0.0.0-py3-none-any.whl size=1815 sha256=52cd05fa477ed99dca782887492296719671e88e5426410415a79f5b4fbd7a8d
Stored in directory: /tmp/pip-ephem-wheel-cache-6877435f/wheels/a7/8a/43/75aa8bf31ec17cf2d0324d08ecf1126c009bdefb067aa2960d
Successfully built UNKNOWN
Installing collected packages: UNKNOWN
Successfully installed UNKNOWN-0.0.0
the repo clone is up to date
python is 3.10.12
Hmm, I don't really. when I run the install with pip install . those UNKOWNs end up being adafruit-adabot
Successfully built adafruit-adabot
Installing collected packages: GitPython, adafruit-adabot
Attempting uninstall: GitPython
Found existing installation: GitPython 3.1.35
Uninstalling GitPython-3.1.35:
Successfully uninstalled GitPython-3.1.35
Attempting uninstall: adafruit-adabot
Found existing installation: adafruit-adabot 0.0.0+auto.0
Uninstalling adafruit-adabot-0.0.0+auto.0:
Successfully uninstalled adafruit-adabot-0.0.0+auto.0
Successfully installed GitPython-3.1.41 adafruit-adabot-0.0.0+auto.0
Building wheels for collected packages: adafruit-adabot
Building wheel for adafruit-adabot (pyproject.toml) ... done
Created wheel for adafruit-adabot: filename=adafruit_adabot-0.0.0+auto.0-py3-none-any.whl size=57548 sha256=18e95f327e61ea84c42ef7999dd568e0857720272b88c3baef180e18f2f3ccc4
what is your python version, and are you in an updated adafruit/adabot clone?
maybe it's some setuptools thing
Python 3.10.12 but my pip is a bit out of date: 23.2.1
mine is older 22.0.2
β― pip show setuptools
Name: setuptools
Version: 68.1.2
I will try with a fresh clone.
i am at 69.1.1
@tulip sleet are you in a virtualenvironment or directly in main python install?
main python install
i don't have trouble with any other pip3 installs
ubuntu 22.04
This comment chain is discussing the same symtom https://github.com/pypa/setuptools/issues/3269
maybe I will do a websearch for "UNKNOWN" ... aha
i will take a look at that, thanks, in a meeting right now
I'm able to reproduce the UNKOWN thing if I install it in the base python installation. It does work successfully in a venv with a fresh clone for me though. I'm not sure what could cause that difference. Presumably there is something we could do inside pyproject.toml or one of the other config files to have some effect on it, but I'm not sure what.
I'll consider it.
In the meantime, it seems the busio.SPI class only allows 8 or 9 bits, although the RP2040 supports anywhere from 4 to 16 bits and the ESP32 SPI has some really crazy settings.
I suppose it's because the SAMD21 Sercom peripheral only supports 8 or 9 bits and the NRF52840 only supports 8 bit words.
I wonder if the spi write and readinto functions handle 16-bit arrays transparently, without any need to set the bit width?
This is also discussed in
- #8179
@kamocat what is your use case for non 8-bit SPI?
I'm writing a driver for ADS131M04, which uses 16 bit registers and supports 16, 24, or 32 bit words.
I installed an upgraded pip3 in .local/.... That works but it started complaining about other existing installations. I'll undo that if necessary. Awaiting Ubuntu 24.04 soon anyway
I'm writing a driver for ADS131M04, which uses 16 bit registers and supports 16, 24, or 32 bit words.
You can just send 8-bit-bytes concatenated, which I'm assuming you know already. Lots of our existing CircuitPython drivers do that for various SPI devices. You can use struct or .to_bytes and .from_bytes` to convert to/from integers.
Unless anyone actually has a 9-bit SPI device, I think we can close this.
Thanks. I just tested and busio.spi will do this transparently with array.array buffers (as opposed to bytearray)
If you want 16-bit words, use short integers:
buf = array("h", [0] * 6)
with self.device as spi:
spi.readinto(buf)
and if you want 32-bit, use 'long' integers
buf = array("l", [0] * 6)
...
The 'integer' type happens to be 4 bytes but it's (implied to be "at least 2" bytes)[https://docs.python.org/3/library/array...
CircuitPython version
Adafruit CircuitPython 9.0.0-rc.0 on 2024-03-08; Teensy 4.1 with IMXRT1062DVJ6A
Board ID:teensy41
Code/REPL
import usb_cdc
import board
import digitalio
usb_cdc.enable(data=True)
if hasattr(board, "USB_HOST_POWER"):
d = digitalio.DigitalInOut(board.USB_HOST_POWER)
d.switch_to_output(value=True)
print("USB power on")
Behavior
The new beta and rc releases of 9.0.0 do not successfully enable power on the T...
Apologies. I thought the blocking issue was coming up with a solution that would be more widely applicable so that all chips can use the same API.
Quoting @HelenFoster :
Do all boards which have a drive strength option specify it in mA? What should
drive_strengthsbe for boards which don't have the option? And where should it go (like I was saying,DigitalInOutseems a little odd).
When it comes to implementation details, I sadly can't really contribute much right now.
My backgr...
Not sure if any of my opinions matter at this time, though. I don't really know how one contributes to the project yet. I'm assuming solutions have to be agreed upon by some committee - otherwise the codebase quickly becomes unusable (again, this is just my personal experience on building APIs).
- Fixes #9047.
I think the issue was due to https://github.com/adafruit/circuitpython/blob/4d1f558361ed25fbfdbd01ead0d5d2df7b2cb9ab/ports/mimxrt10xx/common-hal/microcontroller/Pin.c#L96-L99 which was added in #8928: pins were reset to inputs by default.
@praxiscode Could youttest with a build artifact from this PR?
I don't have the Teensy USB Host cable however I connected an LED to the 5V/GND pins of the USB Host header and when I placed the boot.py file from the issue on the Teensy and power cycled the board the LED did not light using the 9.0.0-rc.0 firmware from circuitpython.org. After replacing the firmware with this PR's artifact and using the same boot.py file the LED did indeed light up after a power cycle.
The issue seems to be resolved.
@jepler sorry, I was troubleshooting other usb issues, be back on uvc now, will let you know if I could figure out anything.
CircuitPython version
Adafruit Circuitpython 9.0.0-rc.0
Code/REPL
An attempt to flash the 9.0.0-rc.0 bin to an esp32h2 device is failing. REPL is not activated and a CIRCUITPY drive is not presented.
Behavior
Flash the device with this command:
esptool.py --chip esp32h2 --port /dev/ttyACM0 write_flash -z 0x0 adafruit-circuitpython-espressif_esp32h2_devkitm_1_n4-en_US-9.0.0-rc.0.bin
Response:
Serial port /dev/ttyA...
@tannewt Thank you for pointing this out! I see where this is going to.
When I set MICROPY_OBJ_REPR to REPR_D in mpconfigboard.h, the (mp_obj_t) casts in circuitpy_mpconfig.h:230 lead to an illegal pointer to int error. I replaced them with the (cleaner) MP_OBJ_FROM_PTR macro, which compiles cleanly with REPR_C, and removes the illegal pointer to int error with REPR_D, but now throws:
../../py/obj.h:292:28: error: initializer element is not constant
292 | #define MP_OBJ_FROM_PTR(p...
I got a good one for someone with more knowledge of the undergubbins of the circuitpython boot procedure. I have this board that looks just like an 01space ESP32-C3-0.42LCD device. I flash it with 8.2 or 9 from the web installer or from my own build, and after the post-flash reset, it boots and runs hello world and displays the IP on the tiny LCD. If I power cycle it, it never boots cleanly again. It reports CircuitPython core code crashed hard. Whoops! Heap allocation when VM not running. and gives me safe mode, though it still displays the IP info on the LCD. I've flashed it with the QT-Py ESP32-C3 image, and it boots fine. I'd like to have the proper image with the fully accurate pin and lcd definitions on it.. Any ideas? It's possibly a clone, but if so, it seems fully pin and peripheral compatible. I'd blame bad flash or something like that, but the fact that the QT Py ESP32-C3 image flashes and runs indicates the hardware is ok.
on further investigation, it seems like power cycling it is actually fine, its when i use the onboard reset button, after that it crashes and won't recover from a soft-reboot
I think this may have something to do with the on-board display not resetting properly on a hard pushbutton reset. In board.c for the 01space board, there is no reset pin specified for the display in that code (NULL argument in common_hal_i2cdisplaybus_i2cdisplaybus_construct) The code may be having trouble talking I2C to the display because there is no way to reset the display to get it back to a known state without power-cycling.
I looked at the 01space schematic, and there is no pin shown for the OLED display reset. Maybe one could be wired up with a spare pin -- I don't know.
I would say this is poor hw design.
the arduino examples in https://github.com/01Space/ESP32-C3-0.42LCD/ also indicates no reset pin is connected
getting an I2C OLED reset in the proper sequence is tricky; we have extra circuitry on various Adafruit boards to do this right
short of adding our own scan which is not ideal
@anecdata I mean, wifi is already taking 95% of boot time of pretty much everything.
It already feels like a system hang. One more thing isn't gonna make a difference.
Perhaps the best solution is to consider in the future adding descriptive strings for the more common error codes (I seem to recall some discussion of this).
Error codes should be accompanied with links. This is the one thing Windows of all things does really well wi...
Sounds reasonable.. Is there something special in how CircuitPython does this vs a basic arduino sketch? I can upload a basic LCD hello world sort of sketch from vscode and it will run and reset cleanly when i use the button..
maybe just adding a delay somewhere. CircuitPython sets up the I2C bus and display really early. Though I would think that would be true of the arduino sketch too. COuld you point to the Arduino sketch?
you could init the display in Python code instead of relying on the builtin one. Also I would want to see where the non-VM heap allocation is happening, but that requires some debugging and I don't have the hardware
#include <U8x8lib.h>
U8X8_SSD1306_72X40_ER_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); // EastRising 0.42"
void setup(void)
{
u8x8.begin();
Serial.begin(115200);
}
void loop(void)
{
u8x8.setFont(u8x8_font_chroma48medium8_r);
u8x8.drawString(0,0,"123456789");
delay(2000);
Serial.print("Loop End");
}```
which u8x8 library are you using?
/* reset=*/ U8X8_PIN_NONE
so they aren't resetting either
u8g2 v2.35.10
if its pertinent, this is what I get on boot after a rst button press: ```ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x40048b82
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5820,len:0xd0
load:0x403cc710,len:0x7c8
load:0x403ce710,len:0x2518
entry 0x403cc710
Auto-reload is off.
Running in safe mode! Not running saved code.
You are in safe mode because:
CircuitPython core code crashed hard. Whoops!
Heap allocation when VM not running.
Please file an issue with your program at github.com/adafruit/circuitpython/issues.
Press reset to exit safe mode.```
you get the same safe mode message on 8.2.x?
yes
I looked at the arduino repos and don't see a discussion of the reset problem. ... It's suspicious it's showing useful stuff on the display but you are getting that error. It -may- be unrelated to the display after all, or only partly related. You tried with rc.0? Could you also try with the absolute latest build from here? https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/01space_lcd042_esp32c3/en_US/
I've built from the latest commit for these tests..
In that case, please open an issue with the safe mode error message above, and say what you see on the screen after a hard reset (or take a picture). Maybe we can simulate this with some other hardware even though we (well, I, maybe someone else does) don't have the board.
is your code.py empty or just hello world?
hello world
we need to figure out how to reproduce this and then do some logging to see what allocation is causing the safe mode
@slender iron rc.1 status:
I have brought the draft release notes up to date, so could release any time.
- ESP32-H2 issue https://github.com/adafruit/circuitpython/issues/9049: I don't have any H2 board. If you have an idea of what the problem is, could work on that. I tentatively marked as 9.0.0 but it's a rare chip. 4 way handshake
- https://github.com/adafruit/circuitpython/pull/9025 needs a re-review, could go in, but also not vital for 9.0.0.
CircuitPython version
Adafruit CircuitPython 8.2.10; 01space_lcd042_esp32c3
Adafruit CircuitPython 9.0.0-rc.0-13-g39b16feaa0-dirty; 01space_lcd042_esp32c3
Code/REPL
print("Hello World!")
Behavior
Build:Feb 7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x40048b82
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5820,len:0xd0
load:0x403cc710,len:0x7c8
load:0x403ce710,len:0x2518
entry ...
Thanks for the issue.
thanks for being responsive π
I think the else if here is redundant: the new if handles the special case, the else if would get handled anyway by the return self->last_disconnect_reason;?
I agree with @anecdata's suggestion. Just delete these lines.
my guess is that the h2 issue is the same as esp32
can you do a debug build?
Think this is the first time I remembered to run black before submitting a PR. It still failed. https://github.com/adafruit/Adafruit_CircuitPython_Requests/actions/runs/8284863120/job/22671343869?pr=160 Something about isort?
try running pre-commit locally instead of black directly if you can.
That repo has had an extra check added to it's pre-commit tasks I think if you run it locally it should make the changes for you.
I don't think pre-commit works with Github Desktop. Seems it's looking for git executable but it doesn't exist.
pre-commit version: 3.6.2
git --version: Executable `git` not found
sys.version:
3.10.5 (tags/v3.10.5:f377153, Jun 6 2022, 16:14:13) [MSC v.1929 64 bit (AMD64)]
sys.executable: c:\Program Files\Python310\python.exe
os.name: nt
sys.platform: win32
error information
An error has occurred: FatalError: git failed. Is it installed, and are you in a Git repository directory?
Traceback (most recent call last):
File "C:\Users\Devon\AppData\Roaming\Python\Python310\site-packages\pre_commit\git.py", line 58, in get_root
cmd_output('git', 'rev-parse', '--show-cdup')[1].strip(),
File "C:\Users\Devon\AppData\Roaming\Python\Python310\site-packages\pre_commit\util.py", line 117, in cmd_output
returncode, stdout_b, stderr_b = cmd_output_b(*cmd, **kwargs)
File "C:\Users\Devon\AppData\Roaming\Python\Python310\site-packages\pre_commit\util.py", line 111, in cmd_output_b
raise CalledProcessError(returncode, cmd, stdout_b, stderr_b)
pre_commit.util.CalledProcessError: command: ('git', 'rev-parse', '--show-cdup')
return code: 1
I ran it from the directory I thought it needed. C:\Users\Devon\Documents\GitHub\Adafruit_CircuitPython_Requests\examples\wifi\expanded>
I can get black to work with ```py
C:\Users\Devon\Documents\GitHub\Adafruit_CircuitPython_Requests\examples\wifi\expanded>black requests_wifi_api_rocketlaunch_live.py
reformatted requests_wifi_api_rocketlaunch_live.py
All done! β¨ π° β¨
1 file reformatted.
I updated pip beforehand ```py
Successfully uninstalled pip-23.3.1
Successfully installed pip-24.0
and pre-commit
```py
Successfully uninstalled pre-commit-3.1.1
Successfully installed pre-commit-3.6.2
Do you have an espressif devkit you can test on? I don't have this board to test with.
Are there any log statements before the build line? The actual error happened before the reset.
I wouldn't wait for H2 for 9.0.0 either. Though I can look today
Too bad, because float64 and REPR_D references are all over the place, suggesting that one could use them, but apparently this is not (no longer?) the case. Any idea how to get this done?
Why do you want double support? What port are you targeting?
MicroPython has lots of settings but we only use a subset of them in CircuitPython. I'm not sure if they have any builds that do double. I only see references to it in the unix port. I know REPR_D is generally used for 64-bit builds though.
This isn't correct because WIFI_**REASON**_NO_AP_FOUND may not be the same thing as WIFI_**RADIO**_ERROR_NO_AP_FOUND. This is translating from ESP-IDF errors to circuitpython ones. I'm not sure why we return the reason otherwise. Maybe to at least show some number.
Please undo the last commit with this.
I can test, yes. There are no log statements before the build line, neither via usb uart or hooking an external usb serial device to pins 20/21.
Build:Feb 7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x40048b82
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5820,len:0xd0
load:0x403cc710,len:0x7c8
load:0x403ce710,len:0x2518
entry 0x403cc710
``` is the entirety of it.
theoretically the Github Desktop app must have a copy of git command line tool somewhere internally in order to work. It might be possible to find it and add it's location to your system path so that other programs will be able to find and use it, but I am not sure.
If not that I think you could install Git seperately with installer from https://git-scm.com/download/win (or probably use the portable one if you add it's location to the path). Then pre-commit should be able to find it and continue on with it's process.
It's been a long time since I used Git on windows though so I don't know much of the specifics.
It should also be possible to run isort directly similarly to how you're doing black but I don't know the syntax for it, maybe something as simple as isort <filename> Justin may have an idea how to do it.
yeah i'm trying to track down how to redirect pre-commit to the github desktop git. It's gotta be in there somewhere.
It's installed at C:\Users\UserName\AppData\Local\GitHubDesktop\app-3.3.11\resources\app\git\cmd\git.exe
if you add that to your system path it should make it so that it can be run from any CMD instance including the pre-commit one I think. I don't recall the exact way for windows though. Control Panel / System / Environment vars or something maybe.
the directory specifically would get added to PATH Just:
C:\Users\UserName\AppData\Local\GitHubDesktop\app-3.3.11\resources\app\git\cmd\
not the exe.
@lone axle Thank you for all your help. That worked! For some reason even though Github Desktop was using 3.3.11 the path was still using C:\Users\Devon\AppData\Local\GitHubDesktop\app-3.0.3\resources\app\git\cmd simply manually updated the app version path and voila! π€
Why Github Desktop doesn't do this automatically is a mystery.
I'd like to archive this here just in case I need to revert for some reason. I feel like this could also be added to the pre-commit learn guide as a special section for Github Desktop users. It will require occasionally keeping an eye on the path env manually. https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/check-your-code
@slender iron how does the H2 clock PR fix it not coming up? The changes are all in neopixel_write. So i thought it would just be that the neopixel wouldn't work
Ugh because I chose --all-files it ran on every file in the repo and not just in the folder I wanted. :/
They say install Git for Windows also: https://github.com/desktop/desktop/issues/3801
the status neopixels was triggering an assert
because the clock is 32mhz, not 40
pulse in and pulse out use 1mhz or less so they should be ok
eats lunch and then runs an errand
you mentioned on discord that this same board works when flashed with the qtpy firmware.
I'd check whether removing display initialization fixes it; if so, it greatly narrows the range of stuff to look at.
(that seems to be the main difference, aside from the content of the board module)
Use ...OBJ_REPR_A and MICROPY_FLOAT_IMPL_DOUBLE. That shold allocate 64-bit floats on the heap. As @tannewt mentioned, OBJ_REPR_D is used on 64-bit architectures, and we don't know that it would function properly on at 32-bit machine.
Note that SAMD51 does not have hw support for 64-bit floats, so it will be noticeably slower.
I keep failing isort. In the past I think it would tell me the sort it wanted. ```py
C:\Users\Devon\Documents\GitHub\Adafruit_CircuitPython_Requests\examples\wifi\expanded>isort requests_wifi_api_rocketlaunch_live.py
Fixing C:\Users\Devon\Documents\GitHub\Adafruit_CircuitPython_Requests\examples\wifi\expanded\requests_wifi_api_rocketlaunch_live.py
next time i run pre-commit it still fails on isort
this is why I don't do code reviews o_O
went through pre-commit-config.yaml and looked at the version numbers. my isort was out of date. ```
Successfully uninstalled isort-5.10.1
Successfully installed isort-5.13.2
@slender iron I think we are all ready for rc.1 !
I'm using pylint 3.1.0 but the yaml is looking for 2.17.4 is this a problem?
because i'm failing pylint
nvm pylint was just being cranky locally i suppose. PR checks passed. https://github.com/adafruit/Adafruit_CircuitPython_Requests/pull/160
Can someone take a look at this PR from 2023? Apparently it was approved but never merged. https://github.com/adafruit/Adafruit_CircuitPython_PCA9685/pull/55
merged π―
Thank you. π€ I didn't realize it until someone posted in there today and it showed up in my github notifications.
no prob!
After successful merge it offers to delete my working branch. Is this something that is recommended to do or can I just keep it syncd manually in the future?
I delete my PR branches, because I don't reuse them. I don't do a "Working Branch". I create a new branch for each PR. That way I can have multiple PR's underway, and the branch names mean something.
a branch is cheap and expendable
Automated website update for release 9.0.0-rc.1 by Blinka.
New boards:
- adafruit_feather_esp32c6_4mbflash_nopsram
- lolin_s3_pro
- waveshare_rp2040_tiny
I swear I've tried that and it Github Desktop will merge all branch commits under main into main.
Will keep an eye on it and experiment with it. Will delete since I don't plan on working with that library again anytime soon. Can always make a new clone.
Let's say I have working branch 1 & 2. When submitting PR's it wants to merge to my clone main and then submit all the PR's together. Maybe just something with github desktop.
that writeup is submitting a PR to "development", not to "main", but that would be typical for a larger organization that keeps a separate "main development" branch. We don't do that.
there's nothing unusual about our workflow. One PR per feature or bug fix, not combined
ahh I've been doing it wrong. Must have missed the publish branch when it shows up. I've been doing pull origin/push origin which I suppose just merges all the commits.
you would push the PR branch, it would ask you if you want to create a new branch. That's what it does in the CLI
Thank you! Slowly figuring things out. This git stuff can be a maze.
I use the CLI; I don't use GitHub Desktop at all
The Adafruit Learn Guides on git explain the workflow to use. You should be able to do that workflow in GitHub Desktop no problem
I learned a LOT from that article. Recommend a link to that in the Github Desktop section of a learn guide. A lot of great info in there. If it is there then I completely whiffed on seeing it. π€¦
do we have any discussion of github desktop in a learn guides?
we do ... but just for managing credentials
I only used git CLI once, Github Desktop every time since... I don't know how to do it there, but I use [deprecated] Atom and that makes it easy to select commits to stage
Sorry Dan, I should have reminded you when I saw you getting close to RC1, but it's probably not a big deal, this can be fixed in RC2 :grin:
Verified REPL is active on both target devices after flashing with adafruit-circuitpython-espressif_esp32h2_devkitm_1_n4-en_US-20240314-main-PR9051-fcac731.bin
I missed your last post, sorry!
@slender iron Your esp32h2 fix gets us through a good flash and into REPL, however I'm not seeing a CIRCUITPY drive on either target system. I'm available for device testing if you need anything checked. (do we have a debug build)
The H2 doesn't have native USB. so you won't see the drive
Only the S2 and S3 do
Interesting. So what is the procedure with the H2 for transferring a python program to the device?
That's clear. Thanks....
>>>
>>> import wifi
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: no module named 'wifi'
Are we including 'wifi' in the esp32h2 build?
the list of build in modules is listed on circuitpython.org for each board
Doesn't look like the esp32h2 has been added to that list yet.
I don't think the H2 has wifi support
its the first esp chip without it
In this variant, it looks like the entire board_init() function is dedicated to the construction and initialisation of the display.
Commenting out everything inside board_init() does seem to allow it to be reset without crashing, indicating that it is a problem talking to the display.
I see in the u8g2 code, they use "U8X8_START_TRANSFER()" at the beginning of the lcd init sequence, and that seems to mention a built in delay. Perhaps thats a point where their methodology differs from what Circuitpython is doing to init the screen, and why an arduino sketch using that library survives restarts?
could you give me a link in github? I was looking for a delay, but missed that
in https://github.com/olikraus/u8g2/blob/74393ef48b860f4a9a18df63c34bcb60a203ba0f/csrc/u8x8_d_ssd1306_72x40.c#L91 it is referenced in the comment, but i haven't dug deeper than that yet.
I think the delay is part of the init sequence. But the safe mode error is more like some initial I2C problem.
that is not a call but just a sequence of init bytes
I've changed the init sequence and it seems to be functioning now
oooh
let me keep restarting it for a while to see if it's just a fluke
I changed the ordering, which i'm not sure matters, < 0x2e, 0, //deactivate scroll < 0x40, 0, // start line is 0 < 0xa4, 0, // output ram to display < 0xad, 1, 0x30, // set internal ref to 240uA < 0xd3, 1, 0x00, // display offset added these lines, and changed 0xd9, 1, 0x22 vs the original 0xd9, 1, 0xf1. Basically I copied the u8g2 init sequence for this board..
This one sorry was busy with a project. https://docs.github.com/en/desktop/making-changes-in-a-branch/managing-branches-in-github-desktop I learned a lot from that one. Didn't know you could use a commit to create a branch either. It was very informative. The other one I already knew how to create and issue & PR.
i've been continuously restarting it for a few minutes and letting it complete hello, world then restarting it.. It has crashed once in a few dozen boots.. but before it was every reset without fail.
I am not that familiar with the init sequences. I wonder if it is missing some part of the initial sequence, but it is less critical when you reordered it.
try going back to the original sequence, but add mp_hal_delay_ms(1000); to the top of board_init(). You may need to add an include for py/mphal.h. If that works try reducing the delay, say to 100msecs or less
I'm not sure where the original author got the init sequence, but that 0xd9 is the "precharge period" and the 0.42" OLED's datasheet specifically says it should be 0x22.. and i just reverted to original code, changed that one thing, and it seems stable..
and if that is not 0x22, then it fails?
i dont know about other values, but if its 0xf1 it fails every reset.
acutally.. bizarre.. i just reverted to original code to confirm that statement.. and now it seems stable..
are you doing a debug vs a non-debug build?
no, just a normal make BOARD=
was your clone up to date when you were building previously? Did you update from upstream?
it was up to day as of earlier today, but before the rc.1 branch.. i guess its possible something was introduced there?
but i did just pull about an hour ago..
after rc.1
I would have expected something from a day or two ago to make a difference, possibly
are your submodules up to date? git status looks good?
yes looks good..
try the circuitpython.org rc.1 if you have not already. Also could be a warm-up thing. Maybe leave it unplugged for a big
disregard all that.. for some reason without me having changed anything.. after the 5th or 6th reset, it is now crashing every time again.. (with the unmodified latest build)
so, try adding the delay I talked about
now it seems to wait approximately 1000ms after reset before crashing: ```Terminal ready
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x40048b82
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5820,len:0xd0
load:0x403cc710,len:0x7c8
load:0x403ce710,len:0x2518
entry 0x403cc710
π
I would like to reproduce this locally to instrument what leads up to the crash. I'm not going to do that right now but the issue is open. I hope I can connect up an external SSD1306 to some board and emulate this board.
I dont THINK i'm going crazy.. but.. hear me out.. if i have the board laying flat on the table and tap the reset button, it seems to crash every time.. HOWEVER.. if i'm holding the board such that the pins GPIO3 through GPIO10 are in contact with my finger, it boots every time..
LOL
this seems more and more like a hardware fault and perhaps i've wasted everyone's time
is the table conductive?
no.. if there is nothing in contact with the board, it crashes.. if i hold it, it boots.. it's very repeatable..
this is either straight up faulty hardware or, possibly, some pin being pulled low through a very high resistor makes it stable on boot..
but the issue only comes up when initializing the display on i2c..
GHOSTS
I really want to ask what happens if you boot it while clapping your hands...
Only because I had an SSL issue this week that would work roughly on every other boot, so took FOREVER to find out the problem
This appears to be a hardware issue. As silly as it sounds, if I hold the board (thus giving a high resistance continuity to several pins) it boots stable every time. If I lay the board on a non-conductive surface and push the reset button with a probe, it crashes on reset every time. This is very repeatable.
I'm going order another one because otherwise i'll always wonder.
Well except, it works with arduino code....
Maybe something to do with how CP resets pins on startup, I believe CP lets some pins float that maybe the arduino environment pull one way or the other?
I'm having a similar problem, so I hope the full test code is posted!
I ran into the same problem on the two Feather ESP32-S2 boards I have. I narrowed down the regression to something that happened between these two UF2 files:
adafruit-circuitpython-adafruit_feather_esp32s2-en_US-8.2.0-beta.1.uf2[WORKS]adafruit-circuitpython-adafruit_feather_esp32s2-en_US-8.2.0-rc.0.uf2[FAILS]
I tested by installing the UF2, running the code, saving the same code back to the device (forcing a soft-reboot). As mentioned above, the initial load works, but forc...
The schematic for the original board is here: https://github.com/01Space/ESP32-C3-0.42LCD/blob/main/Schematic/ESP32-C3-0.42OED Schematic.pdf. I don't see any pull-up resistors for SDA and SCL on the board. Ideally there should be 10k or so pullups somewhere. Maybe they are on the display itself, maybe not. CircuitPython checks for pullups, and might initially fail creating the I2C bus because of that (though I'm not sure why the display would then sort of work).
Try setting `CIRCUITPY_...
I've been playing around with an esp32/ili9341 display board and decided to build a custom CP image because the python display and touch libraries were using up most of the PSRAM. I've got the firmware built and initalizing the display. The display seems to work fine until code.py exits at which point the display stops working. I can run the python screen initalization and the screen responds but the board.DISPLAY object doesn't work once code.py exits. It's like exiting code.py causes a displayio.release_displays() but I don't understand why that would be happening.
Thats been happening to my st7796s display. Pretty sure its caused by timing issues in the init sequence that I havenβt quite gotten right yet.
Thanks, gives me a place to look π
Integrated Connection Manager into my first API. Piece of cake! Thank you for making the transition so easy! https://github.com/DJDevon3/My_Circuit_Python_Projects/tree/main/Boards/espressif/Unexpected Maker Feather S3/4.0 ST7796S/RocketLaunch_Live API Display
Doh! Had a left over LED_STATUS pin definition stomping on the SPI bus of my display. No wonder I was losing the display when the board stopped running code.py.... I'm sort of surprised it worked as well as it did π
out of curiosity, did it save much RAM?
sure, having the "bare" C implementation instead of pure-Py or C+Py-bindings equivalent would take less space, but i want to get an idea how much that is
and i guess it is also helpful as it would now be using another "piece" of RAM, instead of the one reserved for Python's VM (?) π€
welp figured out what i was doing wrong with pre-commit. i kept doing pip install pre-commit instead of pre-commit install on the repo. isort started working after that.π
@spare jacinth I don't think so, my program still didn't run so I didn't look closely at the available space, I just reduced the size of the bitmaps I was trying to load which made a big enough difference that the generic firmware I was using worked. It's getting late or I'd load up the custom firmware again to check the free memory at boot for you but it's going to have to wait. I'll ping you tomorrow with the available memory at boot for both firmware builds.
I think Justin will be happy to hear I updated the new rocketlauch_live requests API example with connection manager too. Added a new commit. Might be the first api example in there with Connection Manager. I plan on switching and updating all of the api examples to use it.
It was a breeze to work with and cut out a couple imports making scripts look a little bit cleaner. I like it!
@tannewt The use case is a small scientific calculator based on a Keyboard Featherwing and a M4 Express or RP2040. While 6-7 digits display resolution would be acceptable, follow-up errors due to rounding would not. So I experimented with Jeff's udecimal and utrig libraries and wrote hyperbolic functions and complex decimal math extensions, which works fine so far. But memory is extremely tight even on the RP2040, and I would still like to squeeze e.g. Fractions in. And we haven't talked abou...
It did not help. I've ordered a second board for testing to ensure it isn't a fluke occurrence. One thing I note is that, if one solders pin headers to this and puts it in a bread board, one loses access to the reset/boot buttons as they are on the bottom. I wonder if it does affect all of these units, but given it's relative lack of use and difficulty of actually using the reset buttons, it has gone unnoticed, or at least unreported.
CircuitPython version
Adafruit CircuitPython 9.0.0-rc.1 on 2024-03-14; Adafruit Feather M4 Express with samd51j19
ulab.numpy does not seem to contain carray respectively it does not support complex arrays as documented. This is in the 9.0.0-rc.0 standard build as well as my custom build mentioned above with ULAB_SUPPORTS_COMPLEX explicitly set. Other functions are there, like conjugate:
>>> import ulab.numpy as np
>>> dir (np)
['__class__', '__name__', 'all', 'any', 'b...
I know that
ULAB_SUPPORTS_COMPLEXis set to0inpy/circuitpy_mpconfig.hbut this setting
seems to be checked nowhere in the entire source tree except inulab.h:
I see ULAB_SUPPORTS_COMPLEX checked in many places:
~/repos/circuitpython$ ag '#if ULAB_SUPPORTS_COMPLEX' -l
extmod/ulab/code/ulab_tools.c
extmod/ulab/code/ndarray.c
extmod/ulab/code/ndarray_operators.c
extmod/ulab/code/numpy/numpy.c
extmod/ulab/code/numpy/carray/carray_tools.h
extmod/ulab/code/numpy/car...
@dhalbert I did ...
$ grep SUPPORTS_COM ../../py/circuitpy_mpconfig.h
#ifndef ULAB_SUPPORTS_COMPLEX
#define ULAB_SUPPORTS_COMPLEX (1)
Do you see carray available in a MicroPython build with ulab on (I don't know which MicroPython builds it's turned on in).
Pinging @v923z here, as this may be a ulab issue.
Update: I found an memory conflict in video driver, when an PROBE_CONTROL(SET_CUR) is issue while streaming it wil corrupt the ep memory (since it is shared). Hopefully it is the cause for this issue.
No idea, I'm not into MP atm.
CircuitPython version
Adafruit CircuitPython 9.0.0-rc.0-4-g04843e8597 on 2024-03-11; M5 Stack Cardputer with ESP32S3
Adafruit CircuitPython 9.0.0-rc.1 on 2024-03-14; Adafruit HUZZAH32 Breakout with ESP32
Code/REPL
import os
os.chdir('/')
if not 'test' in os.listdir():
os.mkdir('test')
os.chdir('/test')
print('Directory set to test folder:',os.getcwd())
Behavior
Using Web Workflow to upload a file to the root folder when the indicated ...
I have been having intermittent issues moving the web workflow to subdirectories but hadn't been able to reliably reproduce the issue. I'm now thinking it's related to this issue and the web workflow file listing is also using the current folder of the device to look for selected target folders when attempting to change to a subfolder. Essentially the Web Worfklow file listing and the devices current folder are at different locations.
@spare jacinth The custom firmware resulted in exactly the same gc.mem_free() after a clean (no code.py) boot. The custom firmware initalized the display so moving the display function to the firmware didn't help memory at all. I also froze a few libraries though and doing so increased mem_free after my application loaded by 14208 bytes. The libraries I froze were all adafruit mpy libraries so freezing some of my own py libraries (or even compiling them to mpy) might have increased the available memory even more.
On micropython, I can conjugate numbers. I settings are in https://github.com/v923z/micropython-ulab/blob/master/code/ulab.h, so I must assume that ULAB_SUPPORTS_COMPLEX is defined somewhere by circuitpython.
The C implementation of adafruit_bus_device.spi_device.SPIDevice will hang on __enter__() if the busio.SPI() object is locked and not released while it's waiting for the lock. It cannot be ctrl-C'd.
Test program:
import board
import adafruit_bus_device.spi_device
spi = board.SPI()
spid = adafruit_bus_device.spi_device.SPIDevice(spi)
spi.try_lock()
with spid as spi:
print("waiting to write")
spi.write(b'abc')
# cannot ctrl-C here
print("wrote")
- Fixes #9054
The __enter__() for the native SPIDevice context manager would spin waiting for the lock. It did not check for ctrl-c or run background tasks.
This is an old bug: it is present and 8.x.x and probably before, so doesn't need to be included in 9.0.0 final.
Tested with the test program in #9054. Now it does:
>>> import spilock
Traceback (most recent call last):
File "", line 1, in
File "spilock.py", line 8, in
[typed ctrl-C here]
KeyboardInter...
(Sorry if I missed a faq answered elsewhere) if someone picks up https://github.com/adafruit/circuitpython/issues/8971 - would you ideally see it land as a community library, or as an adafruit one? (not that I'm signing up π just checking into adafruit org preferences on drivers for boards also in the store)
It would be an adafruit library, because it's our product. Someone internal might be working on a library -- I can check.
There are a couple of other INAnnn libraries that might be starting points, and there is already an Arduino library for the INA228
I might not hear back before Monday
Ack, and thanks for the pointers. [no rush] - just an excuse for me to see how these APIs are structured
ok - it is in process
pylint doesn't seem to understand some imports ```py
C:\Users\Devon\Documents\GitHub\Adafruit_CircuitPython_Requests\examples\wifi\expanded>pylint requests_wifi_api_mastodon.py
************* Module requests_wifi_api_mastodon
requests_wifi_api_mastodon.py:9:0: E0401: Unable to import 'adafruit_connection_manager' (import-error)
requests_wifi_api_mastodon.py:10:0: E0401: Unable to import 'wifi' (import-error)
any advice on how to make pylint happy here?
I used # pylint: disable=import-error if that's a bad idea please let me know.
Do you have pre-commit installed?
yes
What happens if you run pre-commit run --all-files?
it will run on everything in the expanded directory
It may be because you are in the examples directory
And that's okay, it will take a little more time, but everything else will pass
black failed immediately
On the new file?
on --all-files
But it should list what files it failed on
the list is about 1000 lines of errors
most of them are the unexpected line ending error. tons of them.
well isort works so that's progress
And it looks like black fixed it's issues
I wouldn't worry about the line ending issues
oh is it fixing them?
Pylint doesn't fix, but that's okay. By default git will commit with the right line endings
This is an area that Windows and the rest of the world fight every day...
Are there any other errors that aren't line endings?
This runs in Github Desktop which it never did before so that's pretty neat. I feel like I'm really close.
If it's just line endings, I would commit and push. You should be okay
it won't let me. this is the window that pops up when i attempt to commit.
When I use cmd line it gives me a score of 10/10.
C:\Users\Devon\Documents\GitHub\Adafruit_CircuitPython_Requests\examples\wifi\expanded>pylint requests_wifi_api_mastodon.py
---------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: -0.29/10, +10.29)
Then when pushing commit pylint runs inside Github Desktop and fails me but sees the previous 10/10 from the CLI.
It's like Github Desktop is running a different pylint than I am from cmd line.
git commit --no-verify -m "message here
Add the --no-verify
And reading for the weekend: https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings
C:\Users\Devon\Documents\GitHub\Adafruit_CircuitPython_Requests\examples\wifi\expanded>git commit --no-verify -m "messge here"
[MastodonBranch f88e6b4] messge here
1 file changed, 69 insertions(+), 73 deletions(-)
And now you can git push
with cmd line or github desktop?
i've never used cli for git. such a rabbit hole. π¬
I went to Github Desktop and it was just sitting there ready to be pushed. Hit push and it worked. https://github.com/DJDevon3/Adafruit_CircuitPython_Requests/tree/MastodonBranch
Am I going to have to do this every time? π₯Ή
No, you need to update your git checkout settings
I'm trying to create the 2nd separate PR but it seems like Github wants to automatically merge them. I usually do the actual PR from the Github website.
Are you still on the other branch?
yes
Are you trying to commit to that branch or a different one?
I have a PR for the rocketlaunch.live api example
but i don't want to merge this one with that and overload a reviewer with multiple api examples
so i'm trying to do 2 separate PR's from 2 different branches
Just want to make sure that what this looks like isn't going to merge with my other PR, because I've had that happen before.
the first PR is from "WorkingBranch" and this one is from "MastodonBranch"
That image shows from your to Adafruit's. So should be good. Do you just see the one file changed?
yes i'm just hesitant because of what happened last time.
hey it worked π Danh will be proud. have 2 separate PR's from 2 separate branches.
Thank you π There's no way I would have figured that out on my own.
and it passed on the first attempt whaaaaat. π― https://github.com/adafruit/Adafruit_CircuitPython_Requests/pull/161
Niiiiice!!!!
I don't understand why isort is doing this ```py
import os
import time
import adafruit_connection_manager
import wifi
import adafruit_requests
usually imports for circuit python have no spaces between imports.
That's what isort does:
- Python imports
- pip imports
- local imports
ohhh is this going to be a new thing?
well if it's all circuit python then shouldn't they all be local imports?
or does isort recognize that os & time happen to also be the names of python imports?
So isort knows what's included in python like os what's not but isn't local like wifi and what's local like requests
Thank you @vagrant wind for the M5Stack matrix keyboard.
I am trying to create the map from key_number to USB HID keycode with code like this from Jepler: https://learn.adafruit.com/ibm-pc-keyboard-to-usb-hid-with-circuitpython/coding-the-keyboard
I just hope that was not done in a stream by @lone axle or by you.
Sorry, got a bit sidetracked on other things.
I changed the documentation to my last suggestion, that should avoid some potential misunderstandings.
@dhalbert Is there anything else we need to discuss for the draft, or can I mark the PR ready for review?
No, Ihaven't done it but it was the next thing that was needed. I'm glad if you can do it
I plan to do the "first layer" just to identify the various "location" and the matching keyid. And I plan to do it with your pattern GPIO order:
km = keypad.DemuxKeyMatrix(
row_addr_pins = (board.KB_A_0, board.KB_A_1, board.KB_A_2),
column_pins = (board.KB_COL_0, board.KB_COL_1, board.KB_COL_2, board.KB_COL_3, board.KB_COL_4, board.KB_COL_5, board.KB_COL_6)
)
So in my ongoing quixotic quest to add support for unpopular devices, I've started working on a "ESP32-2432S022C" which has a SD slot, touch screen and one amplified GPIO for speaker. I have gotten all those functioning, though I had to use a modified adafruit cst8xx library, as the cst8xx touch in the device reports a chip id nowhere close to what the library expects, but works if the library is set to ignore that. I have run up against nothing but trouble trying to get the display working. It's a 240x320 lcd driven by an ST7789 in parallel mode (not spi). I believe I have all the pin configurations configured appropriately, I have an init sequence that works, gleaned from an arduino library that did make the display work correctly, but no matter what I try, when booting circuitpython and trying to run display tests, the display always looks like this:
pretty sure there's a circuit python st7789 driver. it's what i based the st7796s driver on. they're almost identical drivers except the st7789 has inverted colors and required a specific madctl sequence in the init sequence in comparison.
ah but you're running it in parallel mode, nvm.
just woke up, haven't had my coffee yet, ignore me
the lilygo-tdisplay is the only board with built in parallel display that has board definition files.. I've copied mostly from that, but since it's a different lcd, i got the screen working with the Arduino_GFX library first, then dug the init sequence out of that and put it in my board.c.. before the screen never even initialized, so it's progress.. but why it's lines and garbage, i haven't yet figured out.
It would be lovely to have deep sleep available on all the chips that can support it. I'm running the esp32-c6-devkitM-1 build from downloads (rc1)
Dear @vagrant wind here is what I could do (I hope it help):
https://gist.github.com/dglaude/6f2a3f9c3c1e2f1bdf055245f1a2edb7
You can reuse code.py, or check the table to fix some character mapping.
I am 90% satisfied, I took ESC for the upper left, I don't know what to do with the "fn" key, some special character might be wrong but this is a good start.
I did not compare with the demo code provided with the card computer (the USB and BT keyboard part of the app).
I tried creating a branch/PR on Adafruit_Learning_System_Guides, but ran into permission issues.
Read this. I created a fork and opened a PR to update the example. See https://github.com/adafruit/Adafruit_Learning_System_Guides/pull/2752
Thanks for this π , it made updating my virtual repl in preperation for EDario's merge a snap. While I was at it, I threw in CAP/FN locks and implemented held key repeats
Happy to help... PyDos and @lone axle recent streams are the reason for getting one and testing the keyboard support in CP.
Update: Under further testing, putting 10K pull up resistors on I2C pins 5 and 6 resolves the issue. I would consider this a closed matter filed under poor hardware design, however, as stated before, sketches compiled under the Arduino framework do work. Could there be a difference in the way the CircuitPython vs Arduino bootup sequences do things that could explain it? I've tried enabling the internal pullups in board_init before initalizing the lcd, as well as in espressif_board_reset_pin...
CircuitPython version
Adafruit CircuitPython 9.0.0-rc.1 on 2024-03-14; M5 Stack Cardputer with ESP32S3
Code/REPL
# for I2S audio with external I2S DAC board
import audiobusio
audio = audiobusio.I2SOut(board.I2S_BIT_CLOCK, board.I2S_WORD_SELECT, board.I2S_DATA)
Behavior
code.py output:
Traceback (most recent call last):
File "code.py", line 17, in
AttributeError: 'module' object has no attribute 'I2S_DATA'
Description
In board, the...
aren't these pull up resistors on the relevant lines? (it is weird that there are 3 R4s on the schematic though, there's another on on IO8)
This is fixed in the "absolute newest" version by #9020
Cool, if you're using the artifact with the DemuxMatrix and PyDOS you should grab the version of m5stackcardputerkbd.py from the cardputer_repl github repo. It improves the Shift/FN key behavior, adds key repeat and performs a CAP lock/FN lock with the OPT-Shift/OPT-FN key combination.
@fringe yarrow At one point did you mention that you had a chart comparing the differences between various "Cheap Yellow Display" versions? If so, is it somewhere I can grab a copy?
I missed those resistors the first time I looked, sorry. However, this board is a clone, not the original board, and maybe they omitted the pullup resistors.
Another possibility is that the resistors are there, but you made the pullups stronger, which may help.
Since CIRCUITPY_I2C_ALLOW_INTERNAL_PULL_UP = 1 did not help originally, it might be because we are checking for pullups when creating the I2C object. If this is turned off, via CIRCUITPY_REQUIRE_I2C_PULLUPS = 0 in `mpconfigbo...
https://github.com/rzeldent/platformio-espressif32-sunton/blob/main/esp32-2432S022C.json has a bunch of different cyd playformio definitions meant for use with the lvgl graphics library.
CircuitPython version
Adafruit CircuitPython 8.2.10 on 2024-02-14; Wemos Lolin C3 Mini with ESP32-C3FH4
Code/REPL
none
Behavior
The board does not connect to the AP, and web workflow is not started
Description
- settings.toml is OK
- but it does not connect to the AP
- I have read about the tx power problem so I added 'wifi.radio.tx_power=8.5' to code.py => no improvement
- If I run wifi.radio.connect(...) it connects, but is there a way...
Please try 9.0.0-rc.1, and please show us your settings.toml, with the SSID and password redacted.
I've got the 2432S028R en route. Should be here this week. I think that one has spi screen and should be simple to make work.
@fringe yarrow Mine is the 2432S028, it has the ili9341 spi screen/XPT2046 touch screen and works well with CP. I've used pre-built esp32 firmware from other devices and I also built a custom CP firmware for it. It has an SD card slot, speaker amplifier (pwm) and I've gotten I2C working on one of the JST connectors.
Yeah the 22c is similar in all respects except it has a parallel wired screen which im continuing to work at, but at this point I think it will take some reworking of the commonhal parallelbus code which is currently only used by the lilygo tdisplay and has some magic numbers and assumptions that I don't think hold true for this screen.
You going to submit a pull request for your custom build? π
I don't think so, it sounded like there were too many similar boards for Adafruit to try and support. I may spend a little time looking at the variants and see if there's some sort of generalized build that could work but at first glance it doesn't look promising. I did push my board files to https://github.com/RetiredWizard/micropython/tree/cheapyellowdisplay/ports/espressif/boards/cheap_yellow_display if you're interested for when your board comes in.
just to document this for myself. when working with isort it wants things in a very specific order (and does not re-order them for me so I don't see the point).
Windows cmd line
First do: black requests_wifi_api_fitbit.py # to clean up formatting
Next do: pylint requests_wifi_api_fitbit.py # clean up any errors pylint has until `Your code has been rated at 10.00/10`
Next do: git add .
Next do: git commit --no-verify -m "Update Fitbit API Example with Connection Manager" # add commit description
Go to Github Desktop and the push should be ready. Click push.
Go to Github Website for the repo, create PR, edit description and details, submit PR.
sit back and usually watch it fail on isort
What do you mean it doesn't order them for you?
isort --profile black .
Should update everything for you.
Or before you commit:
pre-commit run
Which will run pylint, black and on this repo isort
Added mfgr information for the RGB LED, mentioned which CircuitPython library is compatible with this LED, added information about the respin version 1.1 of the board which primarily moves the LED from GPIO 48 to GPIO 38
See https://docs.espressif.com/projects/esp-idf/en/stable/esp32s3/hw-reference/esp32s3/user-guide-devkitc-1.html#hardware-revision-details for details.
To quote Espressif:
"Both versions of ESP32-S3-DevKitC-1 are available on the market. The main difference lies in t...
Sometimes it does, sometimes it doesn't. Haven't quite figured it out yet. What I "should" have to do and what I have to do are 2 diferent things unfortunately. :/ It probably had to do with using Github Desktop. I'd love to figure a way for Github Desktop to do all of this for me before a commit.
The mystery's continue. Without my extra pull ups attached into the I2C plug on the board, there IS a 10K path from 3v to SDA/SCL. I did read somewhere about higher I2C frequencies requiring stronger pull ups. I don't know enough about the inner workings of CircuitPython vs a compiled Arduino sketch, as to whether it varies I2C clock, or has it fixed, but is that a possible reason why a 5K pull up (the built in pull ups plus my 10K additions) makes it function while a 10K does not?
It's a "stronger" pullup, so the settling time will be shorter. Did you try CIRCUITPY_REQUIRE_I2C_PULLUPS = 0 ?
Extra pin names could be added, like NEOPIXEL_V10 and NEOPIXEL_V11.
Confirmed. CIRCUITPY_REQUIRE_I2C_PULLUPS = 0 and CIRCUITPY_REQUIRE_I2C_PULLUPS = 1 both make no difference.
Extra pin names could be added, like
NEOPIXEL_V1_0andNEOPIXEL_V1_1.
That works for python land, but don't you want to know where the NEOPIXEL is connected to permit the boot color code or other indication from the kernel?
You can set it up that on commit that pre-commit runs. Did you fix your line endings?
Running:
pre-commit install
Will make it run before you commit (and fail if there are errors, so you need to fix and try again).
Or
pre-commit install --hook-type pre-push
Will make it run before you push (I prefer this personally).
Either one will work with git desktop or CLI
I've been doing them individually C:\Users\Devon\Documents\GitHub\Adafruit_CircuitPython_Requests\examples\wifi\expanded>pre-commit run --files requests_wifi_api_premiereleague.py is this a bad way to do it?
No, other than you need to remember what's been changed. Typical work flow would be:
- Change filed
git add file_a,git add file_bpre-commit run- Fix issues
- Repeat from #2 until no issues
If you are doing one thing at a time git add .
I've been wanting to learn how to make separate PR's since October of 2022. Because all of my PR's merged into 1 commit Hacktoberfest only counted them as 1 instead of 5 and I got screwed out of getting a hacktoberfest t-shirt for not making enough PR's. π€
What IDE do you use?
Mu
oh and Notepad ++ to actually save the file into the local github repo folder. Maybe that's where a lot of line ending errors are coming from...
I copy from Mu to Notepad++ and hit save.
Ahhh, I might recommend pycharm. The free version is still quite powerful and allows selecting exactly what you want to commit (like just these x changes from a file)
I think you can do some of that in git desktop too
So I have a working file in Mu and a file to save directly to the local github folder.
I've been thinking maybe it might even be easier just to copy/paste the file to github website PR somehow. Let adafruit's github actions do it all?
Tomorrow I'll send you a screenshot of how I use pyCharm. The pro version (sadly, not sure why it isn't in the free one), allows you to pick a folder and sync it to your device...
I'll try pycharm. I do have it set as the default editor for .py files π€¦ I have a decade+ of habit of using Notepad++ for quick edits.
Which for you and your monster repo would work really nicely
I do have pycharm syncd to my circuit python device it's just that Mu repl I find much easier and more enjoyable to work with.
I use sooo many things. Each has their purpose. Old enough to still use vim for a lot of things, text editors for quick and dirty, vs code for multi project and pycharm for serious work (and that's just my high use ones)
Ahhh, yeah, I use tio which works great for me
This is true. I see FoamyGuy using nano sometimes. I mean if it works it works. I did forget that Notepad++ has a really bad habit of not using UTF-8 line endings. JAVA used to complain a lot about that.
Might just be as simple as reconfiguring Notepad++ to be more python friendly.
Yeah I have no problem with anyone using anything as long as it works and in this case I think I might be shooting myself in the foot by forgetting about Notepad++ issues.
a simple issue in my workflow I completely forgot to mention... π¬ sorry
FoamyGuy's been knocking out my PR's but as he merges 1 I submit another haha!
You could get all yours open in draft, and then mark them all ready when you are done...
oh i think i see how isort wants things. each import section is then alphabetized?
I think if anyone was going to push one of these CYDs for approval into CircuitPython, it should be the 2432S028. It seems to be, by far, the most popular one when I'm trying to find pinouts. Any search for the 22 brings up results for the 28.. I've taken your code and incorporated some things I hadn't done yet into my local branch. Hopefully it shows up this week.
@short tendon - only to fill out the "IDE" discussion, I use VSCode for all my work but recently evaluated IDEs for a workshop series I will be teaching.
I settled on Thony.
Thony has one quirk and once you explain it, things make sense ... and even make for a better workshop experience.
That "one thing" is that Thony, by default, lets you edit files on your computer and "run" them on CircuitPython without actually saving them to the microcontroller. Thony will just stream the code into REPL.
The quirk is to remember that the code won't persist on the microcontroller unless you save it to the microcontroller as code.py.
I would like to rescind my comment from earlier. This board is NOT compatible with the ESP32C3-Devkit, as I thought, as it requires diferent UART settings. The beetle-esp32-c3, however, does work with it. That said, unless people who want to work with these boards dig in the source code or happen upon this thread, chances are that doesn't help anyone. They're among the cheapest ESP32C3 devboard available now, and might be worthy of reconsideration for adoption if their popularity on the eas...
I need to play with thony. I've heard good things. Since Python is my primary language these days, I like the simplicity of using one IDE, although of course that's across multiple computers since I need to keep work and personal separate...
Used Pycharm this time and no difference. pre-commit run still complained about a hundred unexpected line endings. So it's not Notepad++ fault. If I copy/paste everything from Mu to PyCharm then perhaps the improper line endings are getting copied with it. Maybe it's Mu?
This time I copied the file from Mu to PyCharm. Saved the file with PyCharm. ```py
pre-commit run
pylint requests_wifi_api_github.py
git add .
git commit --no-verify -m "Update Github API Example with Connection Manager"
I think some of the issues with isort failing I can work around if I manually setup the imports how it likes it anyway.
or maybe that's the point? I mean Pylint doesn't fix all errors it just tells you where they are. isort only tells me there's a sorting issue it doesn't show me the order it wanted. now that i know the order for the most part i can just work around it.
So git and windows checks out files with crlf by default, but that doesn't work when pylint is expecting just lf. You will need to switch the default for this repo (and any Adafruit repo) so it leaves them as-is
the reason i want to document this here is even though i'm committing a lot this weekend i might go months without making a PR. i guarantee you i'll need to look this back up in the future.
The git link I sent the other day should help you switch. Might be worth getting some documentation updated for that if it doesn't exist yes
yes yes i thought about that just before you typed it. i didn't do my homework this weekend. π
too busy making PR's!
There's also tomorrow... π
I wanted to try to get them all done on the weekend in a blitz. the fitbit api is complicated due to the use of nvm and took a whole day. :/
I hope you are having fun
I definitely am now that I can submit PR's more easily... and as separate PR's from branches. ποΈ
fine i'll go read that line ending stuff before working on more api examples. ugh homework. π
ok i did this yesterday git config --global core.autocrlf true but everything i'm working with is still producing those errors with pylint. do i need to checkout a fresh clone to make it work or something?
When I installed git for Windows I took its defaults and it did the right thing. But I rarely use git on Windows
I did look at the other program you suggested but I do prefer how easy github desktop is to use in most circumstances. it's only problematic when i attempt to make a PR for adafruit. on my personal repos i don't have to run any actions so normally it never complains.
if you are going to use git in a terminal window install git for Windows. Don't use the git that's internal to github desktop. I posted a link that noted that.
yes but i'm finding some work arounds π
and it does actually integrate with adafruit actions. i just need to find a way around these line ending errors and should be good.
I'll repeat the link: https://github.com/desktop/desktop/issues/3801
this is official advice from github
the only reason i need the terminal right now is to add . and commit no verify but that does also work in github desktop. i'm sure when i fix the line ending errors it'll work fine.
to be clear i'm not ignoring your advice. i'm just trying to find workarounds to keep my workflow somewhat the same as it was.
i was just wondering whether you got the wrong line endings because of not using a version of git that was not installed with the git for windows defaults
only other git i've installed was WSL git but I think that should be separate and only exists in WSL Ubuntu.
I'm running the git.bat recommended at the end of that github issue you linked to. It should keep up with github desktop versions now if it works as advertised. Closed and reopened github desktop so it seems to work so far.
@tulip sleet the .pylintrc specifically calls for:
expected-line-ending-format=LF
Meaning the default GIT windows behavior auto of checkout crlf, commit lf doesn't work.
I am often the only windows dev in the Mac/unix world and default to everything as lf
i guess we might consider changing that to nothing. It's either nothing (meaning don't care), LF, or CRLF
but the issue has been CRLF's infiltrating into the repos.
i've been using circuitpython_base64 as base64 a community library to do base64 conversions. should i be using binascii instead for examples? the opensky api examples are using them. wondering it would be better to switch to something that's built in?
binascii will be faster
I saw it in the doc too, but adding a .gitattributes might help. I've seen some success in groups. As long as you find the right settings...
but we would need to add it to all repos?
or is it something you wouldn't check in, or could be global?
I have to sleep, sorry
Sadly to all repos, so could go into cookiecutter, and then applied as a patch to all existing repos...
binascii worked like a treat.
Excellent work!
@hathach I can try but I'm not sure how to do that. Is there documentation for that process somewhere I could reference?
Or if not separately documented somewhere can you tell me where to put CFG_TUSB_DEBUG = 2 is that a build flag that you put on the make command line like circuitpython DEBUG? Or something that goes into one of the board files before you make a build?
Once that is enabled how are they logs accessed? do they just get sent out over the serial line? so if I'm connected ...
I had the same issue with the Arduino Nano ESP32 S3 and ended up creating separate board definitions for each. I used the "inverted status led" version to represent the less common board.
Following up on this issue, an updated deque implementation that adds iteration and subscription to the deque was merged into the MP core last night. Details on the implementation at https://github.com/micropython/micropython/pull/10724.
Thank you. We'll pick this up on the next merge from upstream MicroPython.
I've moved DemuxKeyMatrix in a new module: keypaddemux
Usage example:
import board
import keypad
import keypaddemux
km = keypaddemux.DemuxKeyMatrix(
row_addr_pins = (board.KB_A_0, board.KB_A_1, board.KB_A_2),
column_pins = (board.KB_COL_0, board.KB_COL_1, board.KB_COL_2, board.KB_COL_3, board.KB_COL_4, board.KB_COL_5, board.KB_COL_6)
)
event = keypad.Event()
while True:
if km.events.get_into(event):
print(event)
@fringe yarrow the display can look like that if the memory hasn't been written
that can happen if the bounds of the display are incorrect
I think this will fix the docs build failure. You can test locally with make html at the top level.
//| Create a `keypad.Keys` object that will scan the key matrix attached to the given row and column pins.
Thanks - this is what we had in mind.
I suggested some changes that I think will fix the docs build failure.
Also, how about calling it keypad_demux, with an underscore? I think that will be easier to read.
Also needed to fix docs build failure.
//| A `keypad.EventQueue` is created when this object is created and is available in the `events` attribute.
Could be.. It's a 240x320 screen, which I believe is the max resolution of the st7789.. I've tried defining it as 240x320 and 320x240 with no joy
that doesn't seem likely then. does it flicker like data is being written?
No, unchanging.. I've delved into common-hal/paralleldisplaybus/ParallelBus.c for the last couple hours.. Found a few things that I thought were ah-hah moments, like how there's several config parameters not being set by the code, and the defaults in the esp-idf struct definitions are not the same as this board's configuration.. also, there was no code for performing a software reset vs a hardware reset depending on the absence or presence of a reset pin, etc.. nothing has made a spec of change π
have you used a logic analyzer to confirm it is outputting what you expect?
no, i don't have such things handy..
hrm
Looking forward to seeing my <@&356864093652516868> pals in about 1 hour. Please take a moment to add items to the notes doc if you can! https://docs.google.com/document/d/1A5vXAYyCHsXmquGVkXvxFn0wosleHI8NHVKkD6Zr4S4/edit?usp=sharing
what speed are you running it?
try lowering it
running which? the frequency passed to common_hal_paralleldisplaybus_parallelbus_construct_nonsequential?
The board specs I found say 12mhz, which is 3 mhz less than the st7789 datasheet says is minimum π
or, no,.. f 1/t, so 15 is the maximum.. disregard..
i was running at 12mhz.. will downclock to 5mhz to see if it makes any difference
nope, same..
I'm trying to build the circuitpython documentation with 'make html' but it fails. Is there a guide how to setup the enviroment to build circuitpython documentation?
pip3 install -r requirements-doc.txt did you do that
you may need to update some of those pip3 installs if they are already installed but old
also do a make clean at the top to start
Also, how about calling it
keypad_demux, with an underscore? I think that will be easier to read.
@dhalbert are you suggesting to change only the QSTR module name with the underscore or also the dicrectories in shared_bindings e shared module?
Change dir name and qstr name to keypad_demux. These names should match.
yup, that's what I'm thinking
I noticed that in the sdconfig files for the esp32s3 boards there is a line like ```# LWIP
CONFIG_LWIP_LOCAL_HOSTNAME="espressif-esp32s3"
end of LWIP
This is just a hostname change. There is some default hostname. It's not going to affect size in any significant way.
Thanks -- it ssemed too easy π
Running it any higher than 12mhz, it doesn't init, just bright white screen.. I can bring it down to 3.25mhz and nothing changes.. any lower and it doesn't init,..
What about either of these OPTIMIZATION_FLAGS = -Os CIRCUITPY_PARALLELDISPLAYBUS = 0 I would expect the optimization will make it use more RAM, not less.
that is a flash size optimization for smaller flash. i dont' think it will make much of a RAM difference either way
I want to remove this in the long run. There's probably a function we can call to do the same
I just wanted to make sure it did not invoke some completely different part of lwip.
@lone axle do you still make back-up recordings? I upgraded my Debian since the last time I ran a meeting so I'm a little extra worried I might run into trouble (pre-meeting checks all look OK though)
I do still try to run backup recordings each week.
OK I'll breathe a little easier then π
π
I missed a hug for @candid sun for some quick PR reviews and feedback. π€
@lone axle I like how approachable your cardboard projects are. No special enclosure needed.
@solar whale I'm sure it will help. I really want to get around to using your library. Congrats on your first PCB! π
link in notes doc doesn't work @solar whale
" This project is owned by another user. " even when I'm logged in.
hmm -- not sure what to do to fix that .
I think there is an option for a permalink...
I just "shared" it
Was nice to see the Hancho dev stop by here too.
That one works. The one in the notes doc doesn't for some reason.
ah -- here it is https://oshpark.com/shared_projects/M1wdG7Iq
that works too π
your mileage may vary π
isort... my nemesis.
fixed in notes.
I'd just make a new board def. That will be clearest for folks. The boards are well labeled with the version.
That might make the next PR kinda complicated...
@lone axle let me know if I can help in anyway with looking at ruff
Thanks for this new functionality! I'd prefer that this be added at the top level instead of for a specific board that way other user code can use it.
Will this be automatic via "pre-commit" or will we all have to install/learn to use the new tool?
CRLF vs LF
We have CIRCUITPY_DEBUG_TINYUSB https://github.com/adafruit/circuitpython/blob/60bd748b96dcc739dc27e0e21548613fa07f9dbb/py/circuitpy_mpconfig.h#L483 It outputs to the console UART. I think it needs to be in mpconfigboard.h instead of on the command line. It needs to use the UART instead of USB because logging to USB would trigger more logging. :-)
I think we'd make it work through pre-commit
It's likely just my environment if it's not affecting anyone else's commits (from Windows users).