I just tried this with the new 6.2 Beta 1 and the issue appears to be gone.
#circuitpython-dev
1 messages · Page 351 of 1
@slender iron any ideas?
https://forums.adafruit.com/viewtopic.php?f=60&t=174668
i can recreate. i scoped it and in the pico case it NAKs on the write setup.
yah. i recreated via repl for the underlying single transaction.
Adafruit CircuitPython 6.2.0-beta.0 on 2021-01-22; Raspberry Pi Pico with rp2040
>>> import board
>>> import busio
>>> i2c = busio.I2C(board.GP27, board.GP26)
>>> i2c.try_lock()
True
>>> buffer = bytearray(2)
>>> buffer[0] = 0x01 | 0x80
>>> buffer[1] = 100
>>> i2c.writeto(0x29, buffer)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 19] Unsupported operation
>>>
same thing works fine on itsy m4, fwiw
beta.1 is just out
thanks @tulip sleet !
I found an older talk from katie bell: https://www.youtube.com/watch?v=U33L10xoWzM
Katie Bell
https://2020.pycon.org.au/program/HHPFHW
The vast majority of code is written through some kind of text editor, whether it's notepad, a sophisticated IDE, or a heavily customised Vim environment. These tools mitigate common text editing problems like unclosed brackets and syntax errors, but can't eliminate them completely.
In th...
yw, i just meant for @tidal kiln 🙂
np
should i just try a firmware upgrade real quick?
i don't know it would fix it, but worth trying, no specific fix for that that i know of
always worth testing with latest
they look identical to me
can you make sure and capture from power up of the sensor?
there might have been a previous transaction that messes it up (specifically the address probe method is different)
ok. let me upgrade firmware and repeat experiment and report back.
could be an oddball sensor too. i sanity checked with a bme680 and that seemed to talk just fine.
yup. the probe works the same on blinka on rpi
it didn't throw the os error. but it's still NAKing.
Adafruit CircuitPython 6.2.0-beta.1 on 2021-01-27; Raspberry Pi Pico with rp2040
>>> import board
>>> import busio
>>> i2c = busio.I2C(board.GP27, board.GP26)
>>> i2c.try_lock()
True
>>> buffer = bytearray(2)
>>> buffer[0] = 0x01 | 0x80
>>> buffer[1] = 100
>>> i2c.writeto(0x29, buffer)
>>>
itsy m4 for comparison
Adafruit CircuitPython 6.1.0 on 2021-01-21; Adafruit ItsyBitsy M4 Express with samd51g19
>>> import board
>>> i2c = board.I2C()
>>> i2c.try_lock()
True
>>> buffer = bytearray(2)
>>> buffer[0] = 0x01 | 0x80
>>> buffer[1] = 100
>>> i2c.writeto(0x29, buffer)
>>>
@lone axle @mental nexus Initial issue filed! https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_Layout/issues/1
@marble hornet Initial working version of my code for the light box. README needs to be updated 😄 https://github.com/kattni/light_box/blob/main/light_box.py
Huzzah! I have the intial code almost ready to go. Few more CI quirks to fix up tonight.
I used this as my excuse to finally get pre-commit going locally.
@idle owl will take a look at it once back at my desk!
Started on a user guide (though nowhere near done but might clear up what I said) https://github.com/TG-Techie/TG-Gui-Quick-Guide
Nice! I'll take a look when I get a chance.
I've just skimmed the issue so far. But you are totally right about "View" I kind of just lifted that term from my Android development background. There is not (yet) a specific displayio concept using that term that I am aware of. I will put some more thoughts in the issue tonight.
Right on! I basically put down everything I "ran into" while using it.
It's meant for discussion for sure.
@tidal kiln I'm out of ideas
ok. i'll keep poking at it.
just wanted to make sure it wasn't something known w/ pico
thanks for looking
nope, an issue would be good
ok. np. i'll just dump the above info and link to forum thread.
@idle owl if/when you have the time could you snap a photo of the light_box interface?
The GUI on the display? @marble hornet
Yes please , I'm having a hard time visualizing what looks like from just the code
Re this thread:
https://forums.adafruit.com/viewtopic.php?f=60&t=174668
Maybe some weird edge case for this hardware combo? Used an Itsy M4 as a sanity check and it works fine there. Tested via REPL doing essentially the same I2C transaction as the library.
RPi pico
Adafruit CircuitPython 6.2.0-beta.1 on 2021-01-27; Raspberry Pi Pico with rp2040
>>> import board
>>> import busio
>>> i2c = busio.I2C(board.GP27, board.GP26)
>>> i2c.try_lock()
True
>>> buffer = bytea...
@marble hornet
The way I did the color balance control is because there are only so many buttons available.
It's controlling that when the little select < is on that line.
otherwise brightness.
Ditto for me, neither 6.1.0 or 6.2.0-beta.1, they get to the end, no errors show, but no rainbow and fomu flashes red, no usb drive appears
dfu-util 0.9
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2019 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
Match vendor ID from file: 1209
Match product ID from file: 5bf0
Opening DFU ca...
@marble hornet Great start on the docs!
Blinka has terminalio, but I'm guessing I should expect support to be quirky or partial? I get no exceptions. I don't see any Blinka issues or PRs for terminalio. I was hoping to do one of these:logbox = displayio.TileGrid(terminalio.FONT.bitmap, #... logterm = terminalio.Terminal(logbox, terminalio.FONT) print("TFT!", file=logterm, end='\r\n')
@lone axle before I put you too terribly on the spot, do you mind if I write this in my update for next week's newsletter?
To make it work how I wanted, I had to write a function to precisely wrap text according to its width in pixels. Discord's FoamyGuy (Tim) has stepped up and plans to bring this feature to a future version of the adafruit_display_label library.
I think termainlio in Blinka_Displayio is primarily just for FONT https://github.com/adafruit/Adafruit_Blinka_Displayio/blob/master/terminalio.py it doesn't seem to have the terminal behavior.
But also I didn't realize you could use terminalio like that in CircuitPython so that neat to me!
@onyx hinge I call @lone axle out regularly in my update 😄
@lone axle ah, thanks, so maybe I go learn purple pillow, or is there something better on RPi?
@idle owl 😅 the chat really helped. And that really packs a lot of control onto one page, I like the control scheme. I see how grid layout was crucial.
@onyx hinge thank you for checking. And yep all good by me. adafruit_display_text is the library (granted though the naming is confusing at the object level with label)
Corrected, thanks!
Isn't the Text class name reserved for paragraphs, once they're implemented?
@crimson ferry what is the end text you are trying to end up with? would it make sense to put it in a label and update that instead of having the scrolling and print() statements?
@marble hornet Glad it helped! Thank you very much, it took a bit of thought to manage to figure out how to control everything I wanted to in the way I wanted to.
Hmm I'm not sure about the reservation. the existing bitmap_label works well with paragraphs I think as long as you have a big enough display and/or small enough font.
it doesn't do auto-wrapping, so you do have to add linebreaks, but there is a helper function for it in the library now (formely was in PyPortal library)
The # represents the three different panels right?
Correct.
Oh, it's in the source 🤦♂️.
@lone axle for now I just want the most of screen to be a console of scrolling text. I use the terminalio construct to do that in CP, so I thought I'd just cut-and-paste 😉
😄 Yah but there's a lot to it.
It would be neat functionality to have in Blinka_Displayio.
@tulip sleet I take it this assumes a CPB? https://github.com/adafruit/Adafruit_CircuitPython_BLE_Adafruit/blob/master/adafruit_ble_adafruit/button_service.py
Context: I'm going to add Bluetooth to this project I'm working on, and wanted to use the Adafruit services if possible instead of the Nordic UART services, but it looks like I might have to go with Nordic because it's 2 buttons, and a 5-"button" joystick. (As in the joystick is coded like buttons, not a joystick.)
Oh hmm. other bits are available for future buttons and switches
I think button service may work for at least 8 buttons because I believe there are 8 in the Bluefruit Connect app and I think it uses that.
@lone axle I think the Bluefruit Connect app uses the Nordic UART service.
It's the Circuit Playground app that uses the Adafruit services.
Ah I see. So the buttons are going the other way. Physical button values into the phone. Not virtual buttons in the phone telling their value to the microcontroller.
Um... no? I've had it where a Bluefruit was looking for a button packet from the phone, and did a thing based on that...
I thought?
Or used button packets as a way for two Bluefruits to talk, but it worked with the app too.
It's been a while since I messed with it. But on the Android Playground app at least I think it's the A/B buttons on the playground sending their value into the phone, it puts some things on the screen based on which one is pressed.
Ok right
That's the other app, yeah
I see what you're saying though
I think. That the Adafruit services isn't for sending from the phone to the board, it's the other way around. Now that I'm looking at it, that makes sense. So I probably need the UART service anyway.
Because the ButtonService is coming from the board, not the app.
Got it. Yeah.
I would like to thanks the CP community and in particular @slender iron .
Thank to him and likely to the skills acquired here, I recently found a second job in electronics and I am doing good progress designing board and writing code in assembly language.
This is eating a bit my time and I will likely have a bit less time for CP now. I hope to come back stronger when I will regain some equilibrium in my free time.
I was just hired* by Shenzhen Longteng Electronics Co., Ltd.
- The game Schenzhen I/0 was hinted by Scott in his last Deep Dive when explaining the RP2040's PIO.
@thorny jay Congratulations!
congrats!
You understand it is not a real new job, just I started playing Schenzhen I/O, a game where you are hired in that company and do electronic challenge. 🙂
😄 Hah! Your post makes more sense now.
haha, ok
I found it too similar to my day job
I wanted more registers than the game gives me
Well, it seems to be like PIO assembly, and those sleep you put.
ya, definitely
Looks super-plausible. No testing performed.
@marble hornet here's what I got for thoughts and tips on streaming: https://gist.github.com/FoamyGuy/96dd64865cf77f9fe100fc0f7a764543 I tried to keep it relatively short, but am happy to expand further if you're interested in something specific. Also one other thing I'll mention is so a private test stream at least a day before you intend to do the real one. Youtube I think may have a 24hr waiting period depending on your account.
Thanks for taking the time to write it up😁, I'll give it a read through and see if i have any clarifying question.
would it be possible and make sense to have pre-commit take care of pylint and the sphinx build also? so that a single step can take care of more of the pre-reqs
Do you mean the tidying up, or verification?
I set the jobs to re-run. There were many GitHub network errors.
@prime flower I was just this weekend porting a library to CP to talk to my Bloomsky weather station and was thinking about how to handle some datetime stuff. So I REALLY appreciate you eliminating my need to think about that with your work on https://github.com/adafruit/Adafruit_CircuitPython_datetime !!
I'm going your latest PR in my library tonight.
@slender iron Do you know if https://www.adafruit.com/product/4701 is planned to get CircuitPython support? Or, is there anything difficult or disallowing that from being possible?
This RFID tag is really unique: it works with mobile phones just like other RFID tags, but you can reprogram it over I2C. The tag shows up as an ISO/IEC 15693 (13.56MHz) chip which is ...
Thank you much! 🙌
@idle wharf no problem! Feel free to review the PR thats outstanding (fixes bugs)
I think changing the original message is a better long term solution. After replacing the text in the C file, how do I handle the translation files?
Do I replace the msgid and set the msgstr to "" in the circuitpython.pot and each language file?
I'm looking at Weblate and gettext and it seems to me that all I need to do is change the C source code?
[adafruit/circuitpython] New comment on pull request #4077: Add support for Lilygo TTGO T8 ESP32\-S2
@tannewt I've only tested this with the one with the display.
You can get a build from the CI artifacts, and try out the example I linked in the description.
@tannewt I got lucky. The system where I originally built the debug build of CP was undisturbed so I just did a git pull on the CP git directory and it update to 6.2.0-beta 1.
So which program do you want me to test, the minimal one that only increments NVM and deep sleeps?
?serverinfo
Just for your information:
In CP 6.2.0-beta.1 there is no hard fault anymore...
But the code "hangs" for one minute or two in
i2c.scan()
after that the board reboots.
Right , you don't need to change circuitpython.pot or any of the .po files. Just change the actual message in I2C.c
brownout was enabled at the first voltage setting, I think 2.44
Try with CONFIG_ESP32S2_BROWNOUT_DET disabled (you are probably already going to do that). The 2.44V is interesting: if it's that problem, it's not that we're triggering too easily.
@dhalbert is CONFIG_EPS32S2_BROWNOUT_DET disable in the build with menuconfig?
Here's what I changed in menuconfig:
→ Component config → ESP32S2-specific I disabled
Hardware brownout detect & reset. It was enabled previously and set to 2.44 in the submenu
Then after disabling I built the .uf2 to test
To test this, you can just set
CONFIG_ESP32S2_BROWNOUT_DET=n
in ports/esp32s2/esp-idf-config/sdkconfig.defaults. I checked this by putting an #error in esp-idf/components/esp32s2/cpu_start.c:
#if CONFIG_ESP32S2_BROWNOUT_DET
#error BROWNOUT_DET on ,--------- addded
esp_brownout_init();
#endif
I didn't bother to use the menuconfig "GUI".
I'm hoping what I did still achieves the goal. I now have that firmware.uf2 installed in my ESP32S2 Metro
I'm running my simplified deep sleep and increment counter test, powered by a USB power brick and posting the loop count to UART on pins 5/6. I'll try the test with a 10 second deep sleep first and see how high I get, then use a 60 second.
code:
import busio
import board
import alarm
import time
def alarm_deepSleep(how_long):
time_alarm = alarm.time.TimeAlarm(monoto...
@tannewt @hathach I tested this on a variety of boards with 6.2.0-beta.1. On the problem boards, the writes are severely delayed or never complete. The different behaviors may help in debugging.
Metro M0 Express (SAMD21): problem: finishes, but /var/log/syslog shows USB issues
Metro M4 Express (SAMD51): problem: finishes, but /var/log/syslog shows USB issues
Feather STM32F405: problem: gets completely stuck and never finishes: /var/log/syslog shows worse problems than SAMD
Feath...
@lone axle you can do reviews right? if so can you review https://github.com/adafruit/Adafruit_Learning_System_Guides/pull/1432 for me?
Yep, will do.
Appreciate it!
@slender iron - have you used DEBUG=1 build on the RP Pico with the SWD debugger?
@uncut nexus early on I did. I followed the instructions to do swd from an rpi4. I didn’t use a jlink
Did you run into an issue where an assert in the SDK function hw_claim_clear() was constantly getting triggered?
No I didn’t see that. Sounds like it could be a bug in our code
Could also see if it was a pico-ask bug that’s been fixed. They are fixing stuff in the develop branch
OK, I'll check there. It seems like the hw_claim_clear() expects the pio being cleared to already have been claimed; which is of course not true at boot
?serverinfo
The brownout enabled may have been causing the issue. I ran the 10 minute loop of the program above until it reached 125. I think changed it to 60 minutes and hooked the board up to power from the barrel connector and I have my Raspberry Pi 4 logging the Debug UART port and also the UART on pins 5/6.
I just checked and we are up to 25 minute/loops without a PowerON exit from deep sleep. All exits from deep sleep have been with been with DSLEEP status.
I'll keep this running until i...
@uncut nexus that definitely sounds like my bug then! I did swd debug very early on when I was crashing because the code ran into the file system portion of the flash. 🙂
@slender iron - I posted the issue on the Raspberry Pi Pico forum - I'll see what they have to sat about it. We may need to check the claimed status before 'unclaiming' when we want to reset the state machines.
Ya that’s fine with me if we track it too. Can probably tell with the program id
hey @idle owl @gilded cradle do you know who maintains this page?
https://learn.adafruit.com/adafruit-metro-esp32-s2/circuitpython-internet-test
@tidal kiln nope, I don't. Is there something that needs changing?
yah. there's a weird copy edit issue. not even sure what the original intent was for the section in question.
It's Kattni's guide, so it's likely on her, but I don't think she is working today or tomorrow.
ok. thanks. nothing super urgent. i'll send her an email.
ok
@gilded cradle ok, i think this one is you?
https://learn.adafruit.com/circuitpython-display-support-using-displayio/ui-quickstart
Oh yeah, things have probably changed since I made that
there's one feedback thats essentially asking how to use with non-built in display boards
since it only uses board.DISPLAY syntax
I think there's a number of examples in other guides, so maybe a little blurb about replacing it with the output of initializing the driver in place of that?
or show both? change code to do something like:
display = board.DISPLAY
# now use display in rest of code
that way you can say something like "if you don't have a built in display, change that line to"
display = <insert external disp init here>
but the rest of the code would be the same
That sounds good
Ah, ok. Makes sense
The "serpentine" display order leads to much better wiring (shorter ribbon cables) and is preferred. Change the default accordingly.
thanks @dhalbert , I will take a break from rp2040 and switch to troubleshoot this tomorrow. There are a few of RP2040 usb issues (usbnet, webusb etc..) though those will probably take time since I will need to go through datasheet reading. Will ping you if I could find out anything.
Hi, apologies in advance for the noob question or if this is the wrong place. This is my first time trying to contribute to an open-source project, and I have read your Design Guide and tutorials on contributing using GitHub. I am working on a project (carbon monoxide monitor for a boat) that uses your Adafruit FeatherWing OLED - 128x64 OLED Add-on For Feather - STEMMA QT / Qwiic. Everything is working great, but I need to be able to sleep the display to prolong battery life and realized that the current Adafruit SH1107 driver does not have this functionality. After reviewing the SH1107 datasheet, I have figured out how to implement sleep/wake functionality and have it working on my test rig (a Feather M4 Express connected to the OLED FeatherWing). I have implemented the functionality in a forked version of your current Adafruit_CircuitPython_DisplayIO_SH1107.py driver. Since this seems like something others might want to use, I was wondering what the correct / courteous approach is to offering this work as a potential contribution to the driver? Does one simply submit a pull request out of the blue, or should I bring it up somewhere like here in Discord or on your forums first to see if you are even interested? Should I submit an issue first? Again, this is my first time trying to contribute to open-source and I haven't seen anything about typical GitHub / open-source "social protocols" so your input (and patience) is appreciated!
Go ahead and make a PR to the library, with an explanation of your goals, and we'd be happy to discuss it there. You could also make an issue, but if you have suggested code, a PR is fine.
Thanks Dan, will do shortly. Appreciate it!
@tulip sleet my PR's failing all the xtensa builds ... https://github.com/adafruit/circuitpython/pull/4084/checks?check_run_id=1786152942 I thought it was up to date on master, but I'll double check.
that looks like a bad cache as before 😦
subprocess.CalledProcessError: Command '['/opt/hostedtoolcache/Python/3.8.7/x64/bin/python', '-m', 'virtualenv', '/home/runner/work/circuitpython/circuitpython/.idf_tools/python_env/idf4.2_py3.8_env']' returned non-zero exit status 1.
same with mine
#4083
there were a bunch of failures yesterday due to GitHub network problems and maybe the latest cache is messed up. @onyx hinge could you change the key as usual? @analog bridge see https://github.com/adafruit/circuitpython/pull/3997 as an example
@tulip sleet yes I can put in a PR to use a new cache key
or just add it to your current PR, since that PR so simple and already approved.
I'll do that
I try to start a TCP server on my Lilygo TTGO T8 ESP32-S2 with display.
code.py output:
192.168.43.83
will timeoutTraceback (most recent call last):
File "code.py", line 18, in
OSError: [Errno 11] EAGAIN
Code done running.
I am using the code from here:
https://gist.github.com/hierophect/5bb6133a69f8395841531013d46d2703
for #4083 is a merge from main needed once the key is updated or can it be ignored since the PR is regarding RP2040
yes, we can ignore the xtensa failures
@xobs can you make a PR now? If you get the unicorn again please share the full url. I get this if I'm on the wrong base branch.
@hathach Make sure and read the discussion on #4075 too.
@jfabernathy Thanks! @igrr it does seem related to the brown out detector.
[adafruit/circuitpython] New comment on pull request #4077: Add support for Lilygo TTGO T8 ESP32\-S2
@netroy Ok, that's fine! Let's add _display to the end of the board ID to make that clear. It'd be nice to include the display init in board_init too. Want to give that a try? I think the pygamer_advanced has ST7789 init code in it.
One nitpick. Looks good otherwise! Thank you for adding the translation stuff too!
Please do the full path to the include so it's clear it's from the sdk and where it is in the sdk.
[adafruit/circuitpython] New comment on pull request #4077: Add support for Lilygo TTGO T8 ESP32\-S2
@tannewt sure. but, lilygo_ttgo_t8_esp32s2_display sounds a bit mouthful. should I shorten the board name to lilygo_t8_display instead?
argh, I pushed the key-changed to the wrong branch and wandered off
[adafruit/circuitpython] New comment on pull request #4077: Add support for Lilygo TTGO T8 ESP32\-S2
@netroy sure! fine with me
[adafruit/circuitpython] New comment on pull request #4077: Add support for Lilygo TTGO T8 ESP32\-S2
@netroy there is another T8 board (with and without display) from LilyGo, but with ESP32 instead of ESP32S2...so I would keep ESP32S2 in the name of the board...
http://www.lilygo.cn/prod_view.aspx?TypeId=50033&Id=983
[adafruit/circuitpython] Issue opened: #4086 ulab: unexpected result of ulab\.numerical\.std\(list\)
Running the benchmark code from A Simple Benchmark
From adafruit-circuitpython-itsybitsy_m4_express-en_US-6.1.0-rc.0.uf2 forward, the result of ulab.numerical.std(nums_list) is larger than expected. 35358 instead of 3535.
First observed on Raspberry Pi Pico.
Tested release versions on ItsyBitsy M4:
adafruit-circuitpython-itsybitsy_m4_express-en_US-6.2.0-beta.1.uf2
traditional ...
[adafruit/circuitpython] New comment on pull request #4077: Add support for Lilygo TTGO T8 ESP32\-S2
In my ports I had named them
lilygo_ttgo_t8_s2_st7789 (obv with display)
lilygo_ttgo_t8_s2 (without)
I was about to finish up my tinyuf2 changes for both boards but will wait a bit to see what the consensus is.
@v923z can you take a look?
How would I check board for an SPI function?
if 'SPI' in dir(board): ...?
I'm thinking about a pull request for the adafruit_seesaw package. I want to maintain the existing behavior (create a TFTShield18 object with the default board.SPI) but allow the package to load if the board doesn't have SPI (RP2040 pico I'm looking at you).
>>> import board
>>> hasattr(board, "SPI")
True
>>> hasattr(board, "PANCAKES")
False
>>>
>>> import board
>>> hasattr(board, "SPI")
True
>>> hasattr(board, "PANCAKES")
False
>>> hasattr(board, "CREPES")
True
@tannewt One more post before happy hour. (us retirees can start happy hour anytime we want)
My increment and deep sleep test has worked without PowerON problems for over 261 minutes. That's higher by a lot from what I remember.
I also put the new firmware.uf2 onto my other Metro that is setup for remote temperature humidity logging. That system post everything via mosquitto/ nodered to an influxDB database. I include the alarm.memory loop counter in that posting. It up to 130 right now...
mmmmmm.....crepes...
@tulip sleet https://github.com/adafruit/circuitpython/pull/4084 is green now if you'd care to re-review and merge
@tidal kiln any more thoughts on the adafruit_nunchuck library. Are you happy with the latest approach you purposed? If so, I would like to get moving on the other extension controllers like the Classic Controller, Guitar, etc. Also, I have several questions about implementation (e.g. this library vs community bundle library.
No problem. Just thought I would check here.
looks like you're getting OK performance with the classic controller now?
Yes, using the values property works the best. The do_read with the other functions makes it pretty clean and only requires one i2c transaction.
ok. cool. then i think now we're just working details of how to code it. like what you're asking about _buttons() etc.
but the basic approach seems to be working
Should dir(library) be sorted the way it is in CPython ? That might be a MP optimization now that I write this...
They don't mention it in their docs
@gloomy shuttle added some comments over there
This will allow microcontroller.cpu.temperature, etc. to work properly on an RP2040 or other multi-cpu chip. It will default to the values for cpu 0. In addition, it adds microcontroller.cpus, indexed by cpu number, to allow access to the values for other cpus (for example, microcontroller.cpus[1].voltage) Note that microcontroller.cpus is only added for chips where CIRCUITPY_PROCESSOR_COUNT is defined to be > 1.
Yes... MP just appends to a list and returns that.
a few weeks ago I recall LadyADA wanting to know what projects people are wanting to do that can't be done with the current version of Circuit python. so that they knew what the community wanted to use Circuit python for. I tried to find where to send my input but couldn't find where to send/give my feed back.
Here's the blog post about it: https://blog.adafruit.com/2021/01/01/where-should-circuitpython-go-in-2021-circuitpython2021-circuitpython/
To sum it up, post it somewhere - GitHub Gist, blog post, tweets, Adafruit Forums, etc. Tag it with #CircuitPython2021 and email a link to it to circuitpython2021@adafruit.com
Okay, I am going to think on it some more.
[adafruit/circuitpython] New comment on pull request #4077: Add support for Lilygo TTGO T8 ESP32\-S2
@tannewt updated and rebased. unfortunately I could not get the display_init code to work. I do have the code working in python. but, my C skills are just garbage.
@skieast I'll wait for your tinyuf2 PR. I suppose you already saw the PID for that.
Would you mind changing it to do a fixed number of retries? I'm worried about a hang as-is. Thanks for looking into this!
Sure, will do.
I was able to recreate this in 6.2.0.beta-1. It happens when you use board.I2C(), but appears to function fine if you use busio.I2C(board.SCL, board.SDA).
It also continues misbehaving even after switching to the busio method until you hard reset.
Hey @hierophect,
I've been running a hacked together code for NTP sync on an ESP32S2 board, and it has stopped working since this change.
git bisect has located the breaking commit from this PR.
Reverting the merge commit fixed the issue for me.
Here is the code
import struct
im...
What is the proper way to indicate a method is deprecated in a library?
Hi, I just submitted a PR on Adafruit_CircuitPython_DisplayIO_SH1107 and the checks failed on the Pre-commit hooks with the following error:
I don't think this is related to my code and wasn't sure how to handle it?
Mine just did that for the first time today too, so I am curious as well
Glad it isn't me then... this is my first PR so I figured I probably did something wrong!
@cedar moth try changing latest
- repo: https://github.com/python/black
rev: latest
hooks:
- id: black
to 19.10b0
in .pre-commit-config.yaml
You didn't break it... but you can fix it 😉
Actually use "stable"
I will try, thanks for pointing me in the right direction.
In the failed actions which ran previously (prior to your PR) the error is called out.
https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SH1107/runs/1684015020?check_suite_focus=true#step:11:12
What repo were you working in ?
I'm also doing Github actions stuff for work today... might as well do them for CP too 😉
SAK, I told you to use stable because that was the value in Nunchuk which I assumed was working... give me a few minutes to read the docs 😉
OK 🙂 Thanks for the help!
I can't get this to work at all anymore. Even after a deep sleep it fails.
@slender iron or @idle owl which version of these do you want on the libraries for pre-commit? You can't specify latest or stable any longer (or ever?)
https://pre-commit.com/#using-the-latest-version-for-a-repository
Which version of black? - 20.8b1 is latest
https://github.com/psf/black/releases
Which version of reuse tool? - v0.12.1 is latest
https://github.com/fsfe/reuse-tool/releases
It is 6:20pm Pacific so people might not be around...
Understood, I am Pacific time as well
@cedar moth you could try the latest versions to see if it works 😉
OK, will do that now.
@idle wharf This is my first PR so just want to be sure, would I make the changes to .pre-commit-config.yaml and then commit it like any other changes in my PR?
Yes, edit that file, commit it your branch and the PR will see it automatically and the Github action will run again.
your same branch
cool, thanks! I will report back when it is done...
Yes, got past the previous error, thank you @idle wharf !
I feel a little weird updating the license text, is that appropriate? I would use the text from a file that is passing, but am not sure if that is overstepping my bounds since it is Adafruit code?
@trim elm I think you added all the pre-commit checks, can you advise ? In this case, the reuse is complaining about .gitignore and .plylintrc
https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SH1107/pull/2/checks?check_run_id=1788799231#step:11:35
I have to say, I am learning a ton on my first PR... thanks for all the hand holding @idle wharf , I appreciate it!
I see in another repo those files have
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
#
# SPDX-License-Identifier: Unlicense
You can add that too @cedar moth
Will do it now...
Thanks @cedar moth !
@idle wharf looking now, it won’t load on mobile. But if they’re just missing the copyright, then just add it to the top of the files
@trim elm No worries... I think we're close. Do you know which version of black and reuse-tool is preferred? pre-commit is unhappy with stable and latest.
@idle wharf So I think I actually forgot to add the licenses like I did in other libs. If you feel comfortable running pre-commit and adding licenses, go ahead, but if you don't, I'll do it tomorrow.
I think SAK is doing that right now
Ok. Sweet. I should be reasonably available the rest of the night so feel free to ping me with any more questions
Actually @cedar moth, looks like all these files need to be updated.
The following files have no copyright and licensing information:
- .gitignore
- .pylintrc
- examples/displayio_sh1107_game_of_life.py
- examples/displayio_sh1107_random_motion.py
- examples/displayio_sh1107_simpletest.py
If you don't want to do that, that's fine too 😉
I just got them all and resubmitted 🙂
💥 Boom ! Nice !
Wife just got dinner ready, will check back in a little bit to get this wrapped up.
When you're wanting to continue: Add a blank line to the end of .gitignore
@trim elm It also failed on black. I thought black would just change all files and pass.
black....................................................................Failed
- hook id: black
- files were modified by this hook
reformatted /home/runner/work/Adafruit_CircuitPython_DisplayIO_SH1107/Adafruit_CircuitPython_DisplayIO_SH1107/examples/displayio_sh1107_random_motion.py
reformatted /home/runner/work/Adafruit_CircuitPython_DisplayIO_SH1107/Adafruit_CircuitPython_DisplayIO_SH1107/examples/displayio_sh1107_simpletest.py
reformatted /home/runner/work/Adafruit_CircuitPython_DisplayIO_SH1107/Adafruit_CircuitPython_DisplayIO_SH1107/setup.py
All done! ✨ 🍰 ✨
3 files reformatted, 3 files left unchanged.
@idle wharf So black has to be run locally for it to pass. The command that runs on the CI just checks the files but doesn't actually modify them
@trim elm Gotcha... that makes sense now that I think about it.
so SAK should just run black .
I'd personally recommend just installing pre-commit through pip and running the whole thing with pre-commit run --all-files
I'm honestly not sure. I think we may have moved to doing that (running black .), but the safest bet would be to run black --target-version=py35 .
Kewl.. @cedar moth when you're back. I'm a nightowl if you want help. Thanks @trim elm !
You can also setup pre-commit to run as a pre-commit hook on your local repo, to get that feedback as early in the process as you can
pip3 install pre-commit
cd your-repo
pre-commit install # do this in each repo
This will save you pushing multiple "fix" commits to the library
you may need pip3 install black ,etc. if you don't already ahve it
Correct. I think "Sphinx" is the only other one that would be needed
Just make sure you use Python3/Pip3
in case you have python around that's calling to python2
oh, and pylint
eventually we will document this in the "contributing libraries" guide
@idle wharf I am back and just got caught up. I thought I had my IDE setup to run Black automatically, but it appears to be doing it to only Python files, sorry.
I have Pylint and Black installed and my Python version is good (no 2.x lurking anywhere), so I will install Sphinx and pre-commit and try following the instructions above.
Try it without Sphinx first. I don’t think it’s required for pre commit.
To build locally yes. Hugo may know.
I'm going through the "Building CircuitPython" guide, and trying to think a few things through. At this point, might it be worth having a virtualenv setup for it, that would install the pre-reqs, and possibly (prompting maybe?) also install the pre-commit hook?
Unfortunately I just realized that things are never simple... my Python environment is an Anaconda environment and I just checked that Pip doesn't play well with Anaconda and the pre-commit package isn't available through Anaconda.
@fossil gorge I would rather just list things for people to install. A virtualenv is yet another complication, and black, Sphinx, and pylint are all things people might install for themselves anyway.
esp-idf has a virtual environment within so I don’t think you can nest them.
I use Anaconda for work, I can look into setting a different environment up for this but I am trying to figure out if it is a rabbit hole I should go down...
@cedar moth only if you want to.
at one point we had a vagrant environment people could use, but it aged badly, and was more trouble to set up than to just use vanilla setups
That's a good point. I was coming at it from the "up and running quickly" side of things, and knowing me, likely as a "I read the first 3 lines, I know what I'm doing! Hold my beer!" person 😉
@cedar moth one of the library reviewers or adafruit folks will look at that repo and get it spiff’d up.
I am happy to help if I can, but I am starting to feel like some of what I would need to do might start infringing on Adafruit standard operating practices since it isn't just my code I am starting to muck with?
i understand that a prepackaged thing is nice, but if we were to do that, then a self-contained dev environment with everything (e.g. the tool-chain too) might make more sense. However, everyone is different. The vagrant env depended on virtualbox, and getting that installed properly was more work than just saying "start with a clean system"
the python environment on Macs is enough of a nightmare, and the BIg Sur security lockdown is also a complication. A clean Ubuntu is a really good place to start.
I think I have sorted out the pre-commit stuff, but now I am running into a build docs issue. adafruit_nunchuk.Nunchuk:6:Unexpected indentation.
I did debug builds on my mac using docker (and virtualbox) and a clean Ubuntu, it really helps not having to bother with installing more stuff on the mac and screwing with python and whatnot
Sadly all too familiar with that, and my hardware isn't even "Big Sur" worthy. Nightmare is on a good day :/
As someone relatively new to contributing the review process is always friendly and will point out anything you may not realize
Probably should just setup a dedicated Linux box or VM of some flavour for this work.
@blissful pollen Agreed, this is my first PR and everyone has been awesome... and I am learning a ton.
I am on not on Big Sur, but I am using a Mac as well and just set up a custom virtual environment for CP stuff and installed everything needed there and that seems to be working pretty well for me.
@gloomy shuttle you removed some blank lines whic you might need to put back.
Yeah, when I copied something they got removed. I have them added back in my local repo but the build docs is failing locally now with the spaces added back.
I am almost 100% certain I have run Black on the three example .py files in the repo I am working on but are failing the Black test in the PR. I don't see any specific error in the test, just that Black is reformatting those three files. On my end it doesn't seem like anything needs changing?
Could it be whitespace changes? Such as tabs instead of spaces?
Could also be whitespace at the end of a line, or end of the file
I think I may have figured it out looking at what Black did on my end in the commit. What is the maximum line length standard for Adafruit?
That is provided by black
We use 120 characters for my work and that is what I have black set to. I see a case where it reformatted a statement in one of the example .py files that was originally three lines into a single line.
I believe the black default is 100 characters?
we use black --target-version py35 and use the default length
If you let black format the files and then commit them. I think you’ll be good. Just don’t edit the files again
I just looked, black defaults to 88 characters
About the ONLY parameter you can muck with in black is the max line length, and I had that set to 120 for work. Let me change it back and re-blacken the files and see what happens.
thanks, I did this and ran pre-commit and sphinx, but the issue persisted. I ran pylint again and then tried to build the docs and it succeeded.
Looks like the line length was the problem for the three examples, sorry about that everyone. Now onto what is wrong with setup.py...
Hmm what are you seeing with setup.py?
There were a number of Pylint errors and I seem to still be having a Black issue, the PR check says Black is reformatting the setup.py file but I can't seem to get Black to find anything on my end.
I am trying to get my IDE to pass the -t py35 parameter danh said is used to see if that could be the issue.
have you tried running black from the command line and doing the commit also from the command line ?
If your IDE's settings are the issue... that would work around that
I think I need to do that at this point... trying one last thing and then will resort to the command line.
this is the change it is making when it runs
install_requires=[
"Adafruit-Blinka",
],
before its all one line. After is ^^^
How did you see that Patrick, by running it on your local system?
Command-line 😉
yes. I also ran pre-commit locally. That is the only thing not passing.
with that change, all looks clear
So weird, I can confirm that black working on my end and reformatting the file when I put in some extra blank lines and spaces at the end of lines, but it isn't making that change.
black --version
black, version 20.8b1
I think but I am not 100% sure that pre-commit is running black . not with a target version.
It is true in some adafruit repos there are checks that run with that --target, but I don' think precommit does.
CP team just started rolling out pre-commit
I am running 19.10b0. I am going to have to setup a dedicated "working on Adafruit open-source" environment on my system since the Anaconda version environment I use for work isn't being flexible. It won't let me update Black beyond the version I have now.
I have manually made the change to setup.py and am going to push, fingers crossed!
Whoever reviews my PR is going to need a beer... or three 😐
lol... No I think your original changes are quite easy to review.
I made 7 commits today to a work repo to get github actions to set a timestamp properly... it happens. 😉
Hey thanks for all the help and support Patrick, I would have been dead in the water on that first error if it wasn't for you!
I think the biggest thing I have learned is to just take the bull by the horns on this stuff (while still knowing my place). I didn't realize how much ability to just dig into things and fixing them was an option, I thought just dealing my my code was the limit.
No, I think I got another error... are you looking at https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SH1107/pull/2
You got further this time. Its building the docs
Looks like Sphinx completed with Error Code 2
Unexpected indentation... let me see what I did there, I have never used Sphinx before.
RE: Environment. If you're on MacOS. I really like pyenv to manage python environments
I got too fancy with the docstring formatting and overly indented the five numbered items I think.
I am on Windows
I used to use this on Windows https://pypi.org/project/virtualenvwrapper-win/
But there might be something new\better
Or four numbered items, in the sleep method.
Oh look... https://pypi.org/project/pyenv-win/ I've never used it
I will look into virtualwrapper. Anaconda works great for our work but it does tend to lag behind on release versions. On the other hand it is pretty much rock solid. I am using Visual Studio Code for the IDE and have installed the Python extension for VS Code. That should give me a separate environment from Anaconda that I can install all the required functionality into without affecting my Anaconda environment.
Is it appropriate to rebase a draft PR to clean up a bunch of small commits before you switch to ready for review?
Pyenv lets you install Python, Anaconda, ... all the things side by side
In my experience the CP team isn't picky about commit history the way other folks are. If you know how to do it and want to that's great.
thanks
The reviewer can always rebase and merge if they want..
@cedar moth... I bet it passes this time !
Let's hope they aren't picky... I am going to have 50 commits for just adding about 15 lines of code to a driver! 😫
And helping fix something that was broken
My fingers are sore from all the crossing! This is commit #9, though to be fair only three are directly related to my proposed addition.
there it is !!
The green check of external validation!! Woot !
Holy crap!
My first PR ever... that was a learning experience! THANK YOU @idle wharf !!!
@idle wharf do you know the proper way to indicate a method is deprecated in a library that you don't want to remove yet?
First of many !
@idle wharf If you live in the Seattle area I will buy you a beer after this COVID crap is behind us. I REALLY appreciate all the help and patience.
I do live in Seattle... in Ballard.
I am in Gig Harbor 🙂
@gloomy shuttle I don't know of any official way other than that when they release the change, the Major version number should be incremented. There was a liibrary where the name of the library and the class name of he object didn't match. I fixed that and that's the only thing we did. Up the Major version and put a note in the release. In the CPython world there's all kinds of ways and python decorators like @deprecated. In CP its all handled in the docs.
Beautiful anchorage there !
OK... going to be AFK for a while. Congrats @cedar moth on your first PR !
thanks!
Night, thanks again!
This seems to be a similar problem as described in https://github.com/adafruit/circuitpython/issues/4046
@bspsbee Thanks for bringing up the issue and the detailed report!
@jepler It seems to me that this crept in between 6.1.0-beta.1, and 6.1.0-rc.0. Can you point me to the ulab commit tags that you link to for these two versions? You found a small glitch with the std function a while ago, and I am pretty sure that I messed up something, when I tried to iron that out.
The indentation in this file is all over the place, not sure what the standard should be. In other files I more or less followed along.
Also, not sure how to handle attribution. I'd like to link back to https://github.com/adafruit/Adafruit_SleepyDog/ if possible, considering it's probably a great resource to forward port for other arch if need be.
The fix is only used for less than 1ms during enumeration and power on, for CircuitPython it’s unlikely you’ll have another serial port running — and another serial port is the main trigger for the bug. Also for basic GPIO it’s probably not an issue at all, it would only really be a problem if it’s assigned to a peripheral.
The fix will not output anything to the pin, but it will stop the output path from an active peripheral for a short period. The function select changes both the output ...
Reverted change to en_US.po. Changed error message in C source files to No pull-up detected on SDA or SCL; check your wiring
Congrats @cedar moth! The project, and thus the community, is better from it because of your hard work 🙂
Build CI test is failing for the trinket_m0 ja translation with:
`Build trinket_m0 for ja (clean_build) took 34.80s and failed
make: Entering directory '/home/runner/work/circuitpython/circuitpython/ports/atmel-samd'
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
QSTR updated
188168 bytes used, -8 bytes free in flash firmware space out of 188160 bytes (183.75kB).
10060 bytes used, 22708 bytes free in ram for stack and heap out of...
Builds OK on my local machine:
`$make BOARD=trinket_m0 TRANSLATE=ja
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
QSTR updated
186896 bytes used, 1264 bytes free in flash firmware space out of 188160 bytes (183.75kB).
10060 bytes used, 22708 bytes free in ram for stack and heap out of 32768 bytes (32.0kB).
Converting to uf2, output size: 374272, start address: 0x2000
Wrote 374272 bytes to build-trinket_m0/firmware.uf2
`
Thanks for working on this!
This could be rewritten as a loop that shifts cycles to the right to divide by two and decrements bits.
This should be SAM_D5X_E5X because we also support SAME54.
I think the refs are ...
jepler@eric:~/src/circuitpython$ git diff 6.1.0-beta.1 6.1.0-rc.0 -- extmod/ulab/
diff --git a/extmod/ulab b/extmod/ulab
index 8242b8475..c4b06e419 160000
--- a/extmod/ulab
+++ b/extmod/ulab
@@ -1 +1 @@
-Subproject commit 8242b84753355433b61230ab6631c06e5ac77f35
+Subproject commit c4b06e419f3d515478b05bb8ce03ebdb29cddec4
there are a lot of ulab commits in that range, because CircuitPython had fallen behind.
$ git rev-list 8242b84753355433b612...
@idle owl I think there is an error is the lc709203f guide, here
the class should be called LC709203F but is called LC709023F with the 0 and 2 switched.
Is there a public facing interface for the community to pr changes?
(I pinged you as the guide lists you as the author, idk if that's the usual method?)
@jepler Thanks! I have found the glitch, the fix is on the way. I'll ping you, once it is ready.
Excellent, thank you! I'll pull-request the updated legacy branch into our main branch.
Closes #4086
Thanks to @v923z for a prompt fix to the underlying problem!
@bspsbee can you let us know if this change fixes your problem?
@onyx hinge Jeff, I think you can update link to ulab: https://github.com/v923z/micropython-ulab/releases/tag/1.7.2
@lapis hemlock thanks for the amazingly quick bug fixing
@onyx hinge I have noticed that the github checks run much faster. Is it because you modified the script a couple of weeks ago, or has github in general become faster?
I am talking about a factor of 3-4, which is significant.
I dunno, could be
I am not complaining, mind you!
the adafruit/circuitpython checks are still taking quite some time
looks like #299 was quick because it failed
some kind of github checkout problem
@onyx hinge I can finish this off if it runs past your break start
I'll look into it.
I think it's just github being github..
@lapis hemlock yeah I think everything is fine, the build failed for some github reason not a real reason
@tulip sleet do you know if there's a reason we're using actions/cache@v1 instead of @v2 ?
@onyx hinge Thanks for the info!
@tannewt I enabled it for my raspberry_pi_pico. Works great. Is that possible?
I thought maybe there was a way a "workflow_dispatch" could be used to clear an actions cache but that does not appear to be the case.
@aallan I think you are assuming that USB is init on power up. That's not generally true though because we'll start to see battery powered boards where USB is connected later. (CircuitPython is likely to restart user code after USB starts though so the impact will be short lived.) I think the fix could be improved to reset the pin function back to the original value. As-is I don't think it changes it afterwards.
Hi @netroy, an issue with this PR was that when it expanded the timeout system to support non-blocking calls, it inadvertently set the default timeout of a socket to 0 instead of the Cpython default of None (ie infinite timeout). #4049 will change back to None, but until then you can use settimeout(None) to extend the timeout yourself. I think that should resolve your problem, but feel free to follow up with an issue if it doesn't.
I think this is probably because the Server Socket PR inadvertently changed the default timeout of sockets to 0 instead of None. You could try increasing the timeout with settimeout(None) or try #4049 which will revert to a no-timeout default.
@marble hornet, @idle owl There isn't a full PR system for learn guides. There is a Feedback? Corrections? at the bottom of the navigation links on the left. The guide authors can see the messages reported in there. In the specific case of this fuel gauge I think some portion of the library repo had the incorrect name for a while and was just recently spotted and corrected. That's likely why the guide page is now "out of sync" with the library.
not that I know of
I had a free minute waiting on a big file to move around, and I have access to edit the guide page so I went ahead and fixed the name of the class. Thanks for reporting @marble hornet if you have a second try checking again and verify it looks good now.
@lone axle looks good.
Thank you
@bspsbee can you let us know if this change fixes your problem?
Output looks correct.
traditional : 2.349ms [result=3535.843611]
ulab, with ndarray, some implementation in python : 0.284ms [result=3535.853624]
ulab only, with list : 0.166ms [result=3535.853624]
ulab only, with ndarray : 0.073ms [result=3535.853624]
well this is an interesting attempt to work around broken caches .. https://github.com/actions/cache/issues/432#issuecomment-740376179
it ensures any successful build updates the cache, but I'm not sure that really helps once a bad cache can be retrieved..
More failures, but they all are just GitHub network hiccups of some kind.
//| (clock frequency) on chips with more than 1 cpu. The index selects which cpu.
@marble hornet , @idle owl Just a heads up, if I remember correctly, the lc709203f guide change request was submitted when I did the PR to fix the name in the library itself. So it is in the queue. My guess is the Adafruit team was busy on RP2040 at the time.
And I see @lone axle fixed it... nvm. 🙏
FYI, over 24 hours continuous without any resets. Both boards under test running fine. I'll report in on Monday
Thanks for keeping up with this.
Thanks for the board name update! Just a couple other things.
Remove this please. You should have a unique PID now.
Why freeze these in? You shouldn't need them frozen.
#define MICROPY_HW_BOARD_NAME "LILYGO TTGO T8 ESP32-S2 w/Display"
[adafruit/circuitpython] New comment on pull request #4077: Add support for Lilygo TTGO T8 ESP32\-S2
@tannewt updated and rebased. unfortunately I could not get the display_init code to work. I do have the code working in python. but, my C skills are just garbage.
Want to try and get it going or do it later? I can help point out differences if you push the C version and link to the Python version.
I don't. I've been trying to ignore minor issues knowing I do want to run it through something. MicroPython settled on astyle: https://github.com/micropython/micropython/pull/5668 That's probably the simplest thing for us to adopt.
@jamesbowman Totally, just make a PR for it.
@hierophect Maybe we should fix this outside of #4049 so we can get it in faster.
See https://github.com/micropython/micropython/pull/5700. MicroPython adopted uncrustify instead. (I think it was the fourth formatter they tried)
sys.platform is missing from the raspberrypi ports.
I started to make a PR, with #define MICROPY_PY_SYS_PLATFORM in mpconfigport.h. However, it seems to require some thought. According to the docs for sys.platform:
For baremetal ports it is an identifier of the chip on a board, e.g. "MicroChip SAMD51". It thus can be used to distinguish one board from another.
(This is exactly what I want it for... to distinguish between boards in the Gameduino driver and assign the...
Could a python-y person explain what MP_QSTR___del__ is within shared-bindings? Something is automatically closing every socket before I get to it on a soft reboot and I think this is it, but I'm not 100% sure
that could be the finalizer
googles finalizer
it requires you allocate the memory stating it has a finalizer
basically runs when the memory is cleaned up
sys.platform usually just indicates the chip that's used, not the individual board. That documentation could be phrased better. Take a look at sys.uname(), which provides board info:
>>> os.uname()
(sysname='samd21', nodename='samd21', release='6.2.0', version='6.2.0-beta.1-9-g70a5f464d on 2021-01-29', machine='Adafruit Trinket M0 with samd21e18')
gotcha, makes sense
well, now I feel foolish for engineering this whole automatic cleanup system that does nothing
np 🙂
Why don't we just use finalizers for every kind of hardware object that gets reset? Seems like this could have been used for UART, I2C, PWM, etc
instead of these search and shutdown reset_all functions
that's a good question
finalizers are weird to use because you don't know when they run
although we do shutdown the heap well so they should run then at least
I just found it because I discovered something was running socket.close on soft reboot, only on my open sockets, before it hit reset
they are not so useful on the python side of the world, because when they run is indeterminate.
so my manual reset would look for things to do, and not find any
@tulip sleet does that apply here? because I have several very clunky reset_all functions that would be made much simpler if they worked like socket does here
no, because they are more guaranteed to run. But if someone pressed reset or there was a crash, they would not be run. I'm not sure that's an issue
I mean I'm glad to get rid of this socket tracking system - it was storing things in an array and was super messy since Sockets could have variable indexes
it's just that in the python world, people don't use them a lot
They won't run on a crash? That... might be bad? I dunno.
are the reset_all() run on startup, or do you start from a known state?
is it run at the beginning of main() too?
and right after board_init yeah
so you need them anyway?
so yes
I guess so
I mean for most chips having the reset at startup is probably unnecessary
I can't think of any cases in STM32 land where we'd need it. Maybe for weird edge cases somewhere
Should I keep my double-check system for closing Sockets in the event of a crash or just get rid of it?
but the reset at the beginning is truly everything, so you don't need to keep track.
sockets is different, they are not hardware, unless you reset the whole chip.
in other words there is no socket state to reset on power-on
unlike, say, I2C state or pin state or whatever
but if you can do socket reset based on finalizers, that sounds nice. I would just worry about an error condition or some crash that left you without a Socket object to finalize and reset. The finalizer depends on there being a Python object.
I didn't do it, it was there already - I just found out about it after I realized the stuff I made wasn't actually doing anything haha
I'm currently dealing with some kind of issue where LWIP thinks there are more file descriptors in use than Python does
But I think that's something else
I wish there was some kind of global LWIP function that would give me every active file descriptor, or guarantee they were all closed, or something, but I don't see anything to that effect.
i know zero about it, sorry
@tannewt nah it's already in, this problem was one of the simple ones. I do think we can go ahead and merge #4049. The big issue is what's going on in #4061 which I'm still hacking at but can put in a different PR
Wait I probably read that wrong, you mean change the default in a new PR so we can take more time on #4049?
@slender iron @tulip sleet This is similarly priced to the joulescope: https://www.crowdsupply.com/zscircuits/zs1100a-power-meter
os.uname() on a Pico:
>>> os.uname()
(sysname='rp2040', nodename='rp2040', release='6.2.0', version='6.2.0-beta.1 on 2021-01-27', machine='Raspberry Pi Pico with rp2040')
Excellent, thanks.
So should I send a PR with:
#define MICROPY_PY_SYS_PLATFORM "rp2040"
for the raspberrypi ports?
Yes, that would be good, in mpconfigport.h
Use RP2040, capitalized, because that's the chip designation.
Tested with hardware. Looks good.
Follow on from #4054
I've been working on this more in my #4049 PR build. Here are the results I get, with extra debug information added from the C level:
None
ip 192.168.10.117
Init IO
GetIO
New Socket:60 errno:9 Bad file number
New handle index:0
Wrapping socket:60
Counter: 0
Sending to Adafruit IO...
Data sent!
Counter: 1
Sending to Adafruit IO...
Error sending data - try again Failed SSL handshake
Counter: 1
Sending to Adafruit IO...
New Socket:62 errno:9 Bad file number
New handle inde...
wifi.radio.connect() call seems to improperly raise a ConnectionError: No network with that ssid even when the SSID is found by a WiFi scan.
Platform: Adafruit CircuitPython 6.2.0-beta.1 on 2021-01-27; Adafruit MagTag with ESP32S2
Code
import ipaddress
import ssl
import wifi
import socketpool
# Get wifi details and more from a secrets.py file
try:
from secrets import secrets
except ImportError:
print("WiFi secrets are kept in secrets.py, please add them there...
I can also confirm none of this happens with time.sleep(15) either - it just uses socket 60 happily over and over with no failures or new sockets created.
@slender iron you want me to make that hotfix for the default socket timeout?
I tried this on a Metro ESP32S2 running the 6.2.0b1 and it connected to my SSID. Might be Magtag-specific
Platform: Adafruit CircuitPython 6.2.0-beta.1 on 2021-01-27; Adafruit Metro ESP32S2 with ESP32S2
Would it be possible to add an optional pin pull.UP attribute to countio.Counter? The capability would accommodate a variety of digital sensors with open-collector outputs, eliminating the need for an added pull-up resistor.
Others have reported it on Discord. I've seen this on rare occasions on other esp32-s2 boards and prior releases, chalked it up to intermittent wifi issue since it usually recovers on subsequent retries. Does your exception persist?
It does persist between retries and router restarts. Tried connecting to a new WiFi network I spun up on my phone, same issue.
@brentru Is this with NINA 1.7.1?
I do see occasional failed connects even if the SSID is in the scan, but it always recovers on retry.
Sorry -- this is on an S2 --- I'm not sure if I have seen the failed connects or not on S2.
NO AP FOUND is an "Espressif-specific Wi-Fi reason-code: when the station fails to scan the target AP, this reason code will be reported." there is the explicit scan you do in your code, but the esp32-s2 also scans implicitly when connecting, there could be a bug in the IDF. Just curious... does it also happen if you don't do an explicit scan before connecting (ruling out a bug in our stop_scanning_networks)?
BTW -- I just compiled from the tip of main 6.2.0-beta.1+ for metros2 and was able to connect ok
not seeing any failed connect/retry -- yet
I haven't seen this yet with >=6.2.0-beta.1, but then I'm <10' from the AP and RSSIs are in the -30s to -40s.
Also just ran it on a MagTag with out any problems ...
PR #3854 accidentally set the default timeout of the Socket module to 0, which does not match Cpython's default of None (as in, never time out). This was causing some user programs to throw unexpected EAGAIN errors. Additionally, when Socket was placed in non-blocking mode (with a timeout of 0), even successful calls from some functions would result in ETIMEDOUT. This PR fixes both issues.
Resolves #3836
@tidal kiln thanks for all your help and back and forth on that nunchuck PR.
np. thanks for not giving up!
The next question I have is if I want to add support for the other extension controllers where should that go?
individual Community bundle library for each based on this one, added directly to this one, or create a new single community bundle library with all of the extension controllers?
good question. not something i want to decide myself. so we'll see if we garner some discussion here and see what makes the most sense.
Done, but just the one file locally. The upstream configs aren't in the tools/ dir here.
This is more or less greek to me sadly. I've more or less copy and pasted the code from the sleepydog repo without much thought. If this is a blocker, I'll take the time to grok it.
Again, just copy-pasta. If it bothers, I can refactor it, but it's simple and fast as is.
Hi everybody online! Good evening from Lisbon. I am in need of help. Wrote a CP script reading uart.readline() into a bytearray() buffer, to receive GPS AV400 sentences (short messages) from MSFS2020. Printing to the REPL window is OK, but printing to a 20x4 character LCD is garbled with non-ascii characters it are '\x00' in the bytearray(). I tried all sorts of x.decode() or struct.unpack but I did not succeed in either: filtering unwanted values or converting them. I have two screenshots. One with the output to the REPL and a second to the LCD. Anyone that can help me out please?
Output to REPL
Output to 20x4 character LCD
hey @thorny dove welcome! can you please ask this in #help-with-circuitpython . this channel is more for the core firmware development questions.
@tidal kiln Hi, yes, sorry, I forgot to choose that group
all good. no worries. thanks!
No need for my name, just leaving Adafruit.
With settimeout -1 it give other error EATIMEOUT or something and it did print out the client IP address.
I then try with #4049 (without settimeout) and now it proceeds further:
code.py output:
192.168.43.83
Connected by ('192.168.43.17', 22723)
bytearray(b'Hello, world\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\...
I think this might actually be a Requests library error after all? Does this line seem like it could be a potential socket leak? The debug output suggests that sockets are not being closed properly - I think what's happening here is that the first call creates a new socket, then the second one tries to re-use that socket and fails, but doesn't close it. I still don't know why the sockets are incrementing by 2 internally, though...
Would be great to have a common TLS approach.
Okay, thanks!
Please - somebody implement sdioio lol - I really need it for my project
@slender iron talking about QuadSPI in deep dive reminded me of the driver I wrote a decade ago. At the time a 4-channel digital O-scope was kind of a luxury. And one that decoded bits to ASCII was $$$. Fun times.
I loaded 6.00-rc.2, 6.1.0, and 6.2.0-beta.1 on a Teensy 4.1, using the Teensy Loader GUI app on Ubuntu 20.04. These simple tests work for me:
Adafruit CircuitPython 6.1.0 on 2021-01-21; Teensy 4.1 with IMXRT1062DVJ6A
>>> True==False
False
>>>
Please try one of the latest .hex's.,
How are you loading the .hex? I'm thinking you are getting an incomplete load or something like that.
it is impossible to install micropython on MATRIXBOOT (matrix portal m4).
using board.ADC(4) throws an error in Mu. Am attempting to convert the ADC temperature example on page 13 of the Raspberry Pi Pico Python SDK to CircuitPython. Have also posted in the Adafruit Forum and Discord
`import machine
import utime
sensor_temp = machine.ADC(4)
conversion_factor = 3.3 / (65535)
while True:
reading = sensor_temp.read_u16() * conversion_factor
temperature = 27 - (reading - 0.706)/0....
I will be streaming some CircuitPython library development this morning if any one is interested in watching along. Will drop links in #live-broadcast-chat in just a moment.
Answered in forum: https://forums.adafruit.com/viewtopic.php?f=60&t=174784&p=851901#p851901
The forum or discord is appropriate for support questions like this. Please don't cross-post so many places at once.
Hello,
I designed a custom board prototype based on ATSAMD51G19A and I try to build CircuitPython for it.
I can build without problem with external flash enabled, but I need a build with internal flash too.
When I try to build with INTERNAL_FLASH_FILESYSTEM = 1, I get an ld error :
arm-none-eabi-gcc -o build-0_m4/firmware.elf -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_AESIO=0 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=0 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_...
can you submit a draft PR for the board - that was we see the config (and then we could also get it included anyways)
This line is messing up my work in Requests: del self._socket_free[sock]. The exception it throws is weird, Error sending data - try again <SSLSocket>, instead of something like Error sending data - try again Failed SSL handshake, so somehow it's returning a class as an exception? And then every call I make to requests from that point on returns the same error message
Context:
def _close_socket(self, sock):
print("REQ _close: attempt to close")
sock.close()
print("REQ _close: closed")
del self._socket_free[sock]
print("REQ _close: deleted")
I have a vague memory of trouble in the past when I used the division operator / in an ld script. Try rewriting any constants you specified without using division. But please also let's see your configuration files, as @ladyada suggests.
@tulip sleet would you have any ideas about this? the sock.close() works, but then this wacky delete error blows up the whole program
there is no guarantee that using a del statement will execute the finalizer right away. But I don't know why you would see that error.
The error, at least, comes out right away, because the print statement right after the del is never reached
Ie I never see print("REQ _close: deleted")
if you catch and print the exception, what is it?
That's what's happening
code.py code is except Exception as e:, print("Error sending data - try again ", e)
and it prints Error sending data - try again <SSLSocket>
I could try catching the error locally
yeah same thing:
try:
del self._socket_free[sock]
except Exception as e:
print("explode!")
print(e)
literally prints
<SSLSocket>
no, i have no idea 🙂 . I'd set a breakpoint on mp_raise or whatever to see what's being thrown from where
if the object has been returned to the heap, then maybe it's a stale pointer
bonus info, in shared bindings I have { MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&ssl_sslsocket_close_obj) }, but I know it never actually hits my sslsocket_close function because it would throw messages if it did
@tulip sleet sorry to keep bugging you, I'm just weirded out by this python stuff. So, print(self._socket_free) returns {<SSLSocket>: False}? Does that give you any clues to what this might mean?
_socket_free is a dict, so is this an object being used as a key?
yes, exactly, that's a one-element dictionary
so del self._socket_free[sock] is trying to do what, delete the key or the value?
I've found that attempting to print(self._socket_free[sock]) causes an immediate exception returning <SSLSocket>
Thanks for your quick reply, I just finished preparing the requested PR draft.
I'll try removing the divisions from the ld script, but I'm not sure where I should do this so that I don't break anything for the other boards?
What does arm-none-eabi-ld --version print? I think this may have a been a bug in ld that was fixed.
Maybe it doesn't like the objects being compared in that way? I'd like to put in a PR to Requests that fixes this, but this is all feeling super weird and out of my usual domain
are SSLSockets hashable? They need to be hashaable to be used as dictionary keys.
I don't know what that means, unfortunately
it means they have a hash() function implemented __hash__ exists
Hmm, that sounds promising. Maybe when porting over Socket to SSLSocket I neglected a hash-related thing
did the old code have a dictionary also?
//| def __hash__(self) -> int:
//| """Returns a hash for the Socket."""
//| ...
//|
STATIC mp_obj_t socketpool_socket_unary_op(mp_unary_op_t op, mp_obj_t self_in) {
switch (op) {
case MP_UNARY_OP_HASH: {
return MP_OBJ_NEW_SMALL_INT(common_hal_socketpool_socket_get_hash(MP_OBJ_TO_PTR(self_in)));
}
default:
return MP_OBJ_NULL; // op not supported
}
}
implemented like that ^^
i can look at your PR
or is it merged already?
#4049, right?
Yeah
//| def __hash__(self) -> int:
//| """Returns a hash for the Socket."""
//| ...
//|
STATIC mp_obj_t ssl_sslsocket_unary_op(mp_unary_op_t op, mp_obj_t self_in) {
 switch (op) {
 case MP_UNARY_OP_HASH: {
 return MP_OBJ_NEW_SMALL_INT(common_hal_ssl_sslsocket_get_hash(MP_OBJ_TO_PTR(self_in)));
 }
 default:
 return MP_OBJ_NULL; // op not supported
 }
}
Here is the version text from ld :
GNU ld (2.27-9ubuntu1+9) 2.27 Copyright (C) 2016 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or (at your option) a later version. This program has absolutely no warranty.
Are hashes supposed to be unique and unchanging? Because right now they're derived from self->num which is going to go from a viable integer to -1 whenever the socket closes. Which it does, right before this del happens
that is bad 🙂
Yes :smile: . You should be using the ARM 2010 tool chain. Did you read and follow https://learn.adafruit.com/building-circuitpython ?
Should I pass the pointer for the object, or something? That won't be changed until the object itself is destroyed
that is often used for a hash. If the object moves, then that's not a good hash. I would take a look at some other hash functions in common-hal
it's not long-lived, is it? In general you have to be careful when computing hashes on mutable objects
I have no idea, sorry. The lifecycle of a socket, best I can tell, is that it's created as a socketpool_socket_obj_t, which is then given a ->num attribute corresponding to an internal LWIP socket. When you call sock->close(), num is set to -1.
so the same issue may have occurred on regular sockets.
this is a bug. Is there any immutable value in the socket struct?
if it's a TLS socket, the socketpool_socket_obj_t is stored as a member of an ssl_sslsocket_obj_t, and LWIP also makes a second secret socket for MBED TLS that persists until the TLS shutdown functions are called
an immutable unique value in socketpool_socket_obj_t? no, not really, not at the moment.
I could make one, I guess?
I've never seen another hash call in common-hal, at least not in the modules I've worked on
so this is all kinda new to me
So you're saying the address of socketpool_socket_obj_t is not necessarily immutable, it could get moved around for some reason
if it were long-lived, or if we implemented a compacting gc, yes. And the idea is that if two objects are ==, then their hashes are the same. We don't even have an == operator here. This use of dictionaries for sockets is not a good idea if these objects aren
aren't nicely hashable
even, if say, we remembered the original num, and used it as a hash, then when something gets looked up in the dictionary, and there are two objects with the same hash, then we try to compare them to see if they're really the same
I don't know when if ever a socket could be compared to another with ==
they would just not be equal, because it defaults to comparing the addresses
If we remembered the original num and used it as a hash, could you have the scenario where a socket object is created, closed, and then another socket object is created again with the same hash since LWIP will reuse the number, and they'd be considered equivalent?
that would be bad, right?
well, no, because there's no __equal__ defined. But it's an abuse of dictionaries to do this. Is there something else about a socket that's immutable, like the port number or something? I have defined a few hash functions, but hey are based on something immutable in the object, like for instance it's a BLE UUID or a BLE address, both of which don't change after creation
Are sockets in Cpython hashable?
i have no idea, i'd have to look
no, they aren't
so maybe this just calls for rethinking the code in Requests
There are no aspects of Socket I would consider immutable
yes, so what is the dict used for, and is it the only dict?
it just says whether it's free or not, right?
I'm not a regular Requests contributor so I'm not totally sure, there are two dicts in Session:
self._open_sockets = {}
self._socket_free = {}
both use sockets as keys
are those sets disjoint, is a socket either open or free?
Are there specific folks who push the development on Requests? We might want to run this by them
I don't know, that's internal lingo
Yes, I would open an issue on Requests, that storing sockets in dictionaries is not a great idea
does this code come from CPython requests??
Yes
wait no
not Cpython sorry
I read that wrong. This is all from Adafruit_Circuitpython_Requests
Original problem is here: https://github.com/adafruit/circuitpython/issues/4061
Original issue was an uncaught exception, but solving it brought me here.
Yes, but it was long ago when I build 4.x for SAMD21
I just updated the building environment to
GNU ld (2.34-4ubuntu1+13ubuntu1) 2.34 Copyright (C) 2020 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or (at your option) a later version. This program has absolutely no warranty.
No more syntax error 👍
But now I get region FLASH_FIRMWARE' overflowed by 116560 bytes`
I can see that d...
@ionic elk ok, the issue is that one shouldn't use sockets as dictionary keys. This code was added recently. That shouldn't be done. You can open an issue and cite me as backup. And we should remove the hash function from sockets.
in the past there was also a socket pool, but the sockets were the values, not keys. The keys were tuples
@tulip sleet looks like @slender iron was the one who added it, he might have justification for it that we don't know about
(the hash function, I don't know about the requests part)
I think he added it so he could put them in dicts in requests. I think he forgot that that paritcular hash might change. But it's not a good idea. They are mutable objects that don't have a reasonable hash
the idea was probably to do a quick lookup
instead of a linear list search or something
Ok, this all makes sense. I'm going to go grab some lunch and then I'll come back and write up an issue for the Requests lib
thanks for helping me understand all of this! I would never have gotten there without your help haha
if they need a .free or .open state, that could be added as a built-in attribute. np!
CIRCUITPY_SMALL_BUILD no long is functional. So you'll need to turn off modules you don't need in mpconfigboard.h. You can leave CIRCUITPY_FULL_BUILD on or turn it off and then turn on the modules you want. It's probably easier to leave it on and disable modules. Or you could reduce the size of the internal filesystem.
Should I close this issue and open a new one about the overflow?
This has turned into a support issue. We'll just close it when your build succeeds.
@ionic elk I am writing an issue for circuitpython about the hashing, and trying to figure out if there is reasonable solution or not. For user-defined classes in Python, they are hashable: the hash is the id() (which is the address), and equality is defined as whether the id's are equal.
We have had some issues about ids changing from underneath things: I will find that issue
i think if we make the hash be the id() that will be OK, though I think it's worth looking at the requests code to see if it's really necessary to have sockets as dictionary keys, since it seems to be substituting for some attributes that could be on the socket objects themselves.
@tulip sleet back, that sounds reasonable to me
__hash__() was added to Socket so a Socket could be put in a dict, for use in the adafruit_requests library. However, the hash used is not immutable, and changes when the socket is closed.
The hash returned could be id(), to make it immutable.. However, it might be worth looking at whether the use of Socket in adafruit_requests really needs a dictionary. I see two uses: ._open_sockets and ._socket_free. I'll bring this up in an issue in that repo.
Tagging @hierophect o...
@tulip sleet besides when objects are "moved" to the long-lived heap, I don't know when else an object's address would change
@dhalbert as a follow up to our conversation, just noting that returning (mp_uint_t)self for common_hal_ssl_sslsocket_get_hash does solve the keys issue in #4061, as predicted (I don't know if that's how I'm supposed to code it though, can I use id in the shared-bindings layer?). You mentioned you were concerned about other instances where the ID could change unexpectedly, making the hash mutable, were you able to find those issues?
the only other case I know of is this: https://github.com/adafruit/circuitpython/issues/2687
The only other issue is this: #2687, which I think is not applicable. You could try the fix above, and see how it works.
You can can return mp_obj_id() to get the id value for the hash. I would think it's OK to do that in shared-bindings, because calling that function is kind of like calling a common-hal function: it's executing the value.
I disabled a lot of modules (almost everything I found in circuitpy_mpconfig.h) but I still have an overflow and undefined references to neopixel :
/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: build-0_m4/firmware.elf section.text' will not fit in region FLASH_FIRMWARE' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: region FLASH_FIRMWARE' overflowed by 68472 bytes
/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: firmware.elf.lto.o: i...
You are still using gcc9. Upgrade to the gcc10 toolchain, as suggested. That will gain you some (not a lot) of space. Disable CIRCUITPY_ULAB. Take a look at the other disabled modules for similar boards to yours, such as kicksat-sprite.
Note this important change:
# Override optimization to keep binary small
OPTIMIZATION_FLAGS = -Os
SAMD51 is now normally compiled with -O2, which makes for considerably larger code.
You disabled neopixel_write, which is needed for th...
Users have seen some glitches writing NeoPixel strings on SAMD51 with CircuitPython. I took some timings in July 2020 of the NeoPixel one and zero waveforms, both for the Arduino code and neopixel_write. It seems like some SAMD51 times could be adjusted

@PaintYourDragon You mentioned recently about the "1/3 - 2/3" rule of thumb for NeoPixels, if I remember right. Do you see m...
This turned out to be a 4(!) part issue:
- The very first problem was that
Failed SSL handshakewas being mis-reported as[Errno 128] ENOTCONNbysend(). That was my bad, it just needed some extra code to check the MbedTLS errors properly. - The first "real" problem, which, jerryn was encountering, was that only
_SendFailedexceptions were being caught when Requests made asend_request. So when an SSL connection timed out, which was the case for the 60s delay, the resulting `Fai...
@tulip sleet I did a big sum-up of everything in https://github.com/adafruit/circuitpython/issues/4061#issuecomment-770274825
Revisiting NeoPixel timing is One Of Those Things I’ve Been Meaning To Get Around To But There’s Always More Pressing Issues. The “1/3 - 2/3 rule” isn’t so much a rule as just a hacky thing that seemed to work for Adafruit_NeoPixel_ZeroDMA and Adafruit_NeoPXL8 but isn’t grounded in science, datasheets, or anything else. It might fall apart on really long runs, I haven’t checked.
Because datasheets lie, and because NeoPixel-alikes reshape the signal on the way out, a winning strategy would ...
@tulip sleet so this hash from ID trick is just replacing return MP_OBJ_NEW_SMALL_INT(common_hal_ssl_sslsocket_get_hash(MP_OBJ_TO_PTR(self_in))); with return mp_obj_id(self_in);, right?
yes, that's what I was thinking
How did you even know about mp_obj_id()? I can't grep it anywhere else
certainly looks a lot cleaner
i looked for the implementation of the id() function by looking for QSTR_id, and then following from there.[
I may be recalling wrong, but I thought default CONFIG_LWIP_MAX_SOCKETS was 10, and we bumped it down to 4 (maybe to save memory)? Having only 2 usable TLS sockets doesn't leave much headroom.
@anecdata I think you're right, but I wasn't the one who lowered the max so I don't know how much of a memory drag it is.
@tulip sleet it works! Nice.
Is it possible to have multiple configs for RAM, like we do for flash circuitpython/ports/esp32s2/esp-idf-config/ so that boards with more RAM could be allocated more resources, like more sockets, more pystack, etc.?
The nRF ports do RAM allocation to set aside RAM for use by the nRF SoftDevice and to allocate RAM for a SPIM3 buffer (a hardware bug workaround):
https://github.com/adafruit/circuitpython/blob/70a5f464df709737fb90a9ab69baf08671c8f383/ports/nrf/boards/common.template.ld#L21-L31.
We have CONFIG_SPIRAM_SIZE in board-by-board sdkconfig, but it seems if other resource parameters are board-by-board, capabilities may fragment and be harder to troubleshoot when issues arise.
@onyx hinge I'm going to tweak the logic in the wrapping just a bit. In this main if statement that decides what happens with each word I think we don't want to set firstword = True in the last else branch:
if firstword:
partial.append(word)
firstword = False
width += wwidth
elif width + swidth + wwidth < max_width:
partial.append(" ")
partial.append(word)
width += wwidth + swidth
else:
lines.append("".join(partial))
partial = [indent1, word, ' ']
width = measure(indent1) + wwidth + swidth
firstword = True
on lines other than the first one this logic actually ends up applying to the second word which makes it "skip" the check to see if the line is too long. As is if the first two words are "too long" they won't get split
I didn't test this scenario, but the intent is that "firstword" indicates it is the first word on a given line. That word needs to be placed on its line, REGARDLESS of whether it's too long (or you could break it based on individual letters instead of words)
Ah yeah, I do now
firstword must be doing double duty, preventing an extra space. maybe there's a better way.
yay I'm glad you are testing this!
I see. Yep, by removing first word going back to true it makes the first space of the line always end up doubled.
Here we go
we can "start" the new partial with indent1, word (and no space). Then the space gets added in the next iteration before it's word.
I think we may have gotten the word-splitting across lines with hyphens in the other wrap function. I'll try to bring in a similar solution to this one.
You can't add to the socket API without making sure CPython sockets have it.
got it
i think just using id() will work. I guess you had to have that odd dictionary, though maybe it could just be a list of free sockets
@slender iron in CPython, socket.fileno() will return -1 if the socket is closed.
that is supposedly the way to tell
In CPython sockets, socket.fileno() will return -1 if the socket is closed. So we could implement that (just return .num).
Hi friends. I'll be sending a PR here and over at uf2-samdx1 to add Binary Star's configuration. Could I have a set of PIDs please? 😺

Looks good, and thanks for fixing the sys.platform issue.
hah, @tulip sleet closed an issue as I was applying labels
thank you for the the housekeeping 🙂
I was there and tried to leave it better than I found it 🙂
I'm sad that I haven't had as much time to spend with CircuitPython lately.
But I still love y'all.
you are busy!
you know we'll be here when you get back -- take care @ivory yew
Winterbloom Binary Star,bootloader,0x239A,0x00F5
Winterbloom Binary Star,arduino,0x239A,0x80F5
Winterbloom Binary Star,circuitpython,0x239A,0x80F6
Many thanks!
On Sat, Jan 30, 2021 at 6:19 PM Dan Halbert notifications@github.com
wrote:
Closed #4104 https://github.com/adafruit/circuitpython/issues/4104.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/adafruit/circuitpython/issues/4104#event-4269725465,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAB5I4ZVBEXSVA4T53QH6GLS4SHZXANCNFSM4W2X2NRQ
.
I followed the guide again to use the exact version of the toolchain, and added the optimization flags but I still exceed the allowed size by almost 13 kb
gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: region 'FLASH_FIRMWARE' overflowed by 12984 bytes
I disabled more modules than kicksat-sprite but still oversize :(
I also noticed a lot of multiple definitions notices from ld, is this expected?
gcc-arm-none-eabi-10...
My own CP repo was way behind so I pulled latest )(main) and thought I better run ./install.sh again just in case, and it hard crashes and brings down my terminal window (macOS 10.15.7)
So I went to a different Mac that has never had a CP redo on it before, cloned, ran .install/sh and again it downloaded all of the espressif tool chain stuff and then brought down my terminal window.
Anyone else seeing this? I can't complete install.sh so can't export & build.
I'm about to kill off my fork and create a brand new one... as I REALLY need to build source ASAP...
but I thought I'd ask if this was a know issue before I re-fork
hmm, rebasing my original fork (in SmartGit) is asking me for SSH credentials for use git ?
I don't have a user called git, so this would have to be one of the submodules? I've never seen this request before.
It says it's for lib/tinyusb
Ok, I killed off my fork and re-forked. Let's hope this one works ok!
install.sh still kills the terminal window "at some point"....
maybe something in the system log would give a hint why
it's probably a python version issue
I'm not sure what can kill a Terminal window, even quitting the shell doesn't
so a clean fork fixed those "git user" permission issues...
Does anyone happen to know if Adafruit plans on stocking the USB C version of the TinyPICO?
@arctic oasis that's a Q for me, more than Adafruit 😉
Right now I'm only doing small production runs of TinyPICO USB-C, so I'm not distributing them through anyone but me. That might change in the future, but no plans yet.
Sub-one minute response from the creator themselves, and I'm not even a customer (yet), thanks very much!
Ok, I tracked down what that ssh error is (I still get it)...
Warning: Permanently added the RSA host key for IP address '13.237.44.5' to the list of known hosts.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'git@github.com:raspberrypi/tinyusb.git' into submodule path '/Users/seon/circuitpython/ports/raspberrypi/sdk/lib/tinyusb' failed
Failed to clone 'lib/tinyusb'. Retry scheduled
Cloning into '/Users/seon/circuitpython/ports/raspberrypi/sdk/lib/tinyusb'...
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'git@github.com:raspberrypi/tinyusb.git' into submodule path '/Users/seon/circuitpython/ports/raspberrypi/sdk/lib/tinyusb' failed
Failed to clone 'lib/tinyusb' a second time, aborting
Failed to recurse into submodule path 'ports/raspberrypi/sdk'```
it seems the raspberrypi tinyusb stuff is using SSH and not https for inclusion as the submodule?
❯ cat ./ports/raspberrypi/sdk/.gitmodules
[submodule "tinyusb"]
path = lib/tinyusb
url = git@github.com:raspberrypi/tinyusb.git
branch = pico
yup
I've tried changing .gitmodules to:
path = lib/tinyusb
url = https://github.com/raspberrypi/tinyusb.git
branch = pico```
but still get the same git@ error
Failed to clone 'lib/tinyusb'. Retry scheduled
Cloning into '/Users/seon/circuitpython/ports/raspberrypi/sdk/lib/tinyusb'...
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.```
so apparently there is such a thing as .git/modules/ports/raspberrypi/sdk/modules/tinyusb/config
oh .git/modules/ports/raspberrypi/sdk/config first
git modules are complicated
I just caved and setup SSH
but I'm going to open an issue for this as I don't see why it's setup like this.
I mean, it's a raspberrypi thing.... not a circuitpython one, but this is a bad stumbling block for using source.
oh yeah it's raspberrypi's sdk that uses ssh for their tinyusb fork
there needs to be a way to not bring down the raspberrypi stuff (I'm not using it) or to have it not be SSH (IMHO). Nothing else requires SSH.
hey, im new to circuitpython, can help me with the new socketpool module?
someone*
ive worked with the python socket module in the past but im having trouble creating a simple tcp socket with the socketpool module
@idle owl in the guide for using black, it say to use black --check --target-version=py35 . Is that still correct or shout the --target-version be omitted?
Please merge from adafruit/main to reduce the number of changes. Also, are you building locally? There is no newline at the end of mpconfigboard.mk, and you are failing the pre-commit checks.
To run pre-commit locally (saves a lot of commits):
$ pip3 install pre-commit Sphinx pylint black
$ cd your-repo
$ pre-commit install # do this in each repo
Yes, we are still using that --target-version
i added a shell alias to include that all the time
Thanks .
removed. I added them because I saw them on other boards, and assumed they were meant to be bundled in the firmware.
[adafruit/circuitpython] New comment on pull request #4077: Add support for Lilygo TTGO T8 ESP32\-S2
@tannewt updated and rebased. unfortunately I could not get the display_init code to work. I do have the code working in python. but, my C skills are just garbage.
Want to try and get it going or do it later? I can help point out differences if you push the C version and link to the Python version.
I'd like to try this, but in another PR, if that's okay.
The ESP32 ADC is frightening without correction which is what you get in Arduino-land. I just repeated my ADC test and also threw in a Raspberry Pi Pico and a random Arduino Uno Rev3 clone board I had lying around. https://forums.adafruit.com/viewtopic.php?f=60&t=174020&p=852007#p852007
I followed the guide again and then noticed I did a mistake when rebasing my local repo.
Now everything is clean and up to date, but I'm still oversized by 39 kb :(
arm-none-eabi-gcc -o build-0_m4/firmware.elf -DCIRCUITPY_FULL_BUILD=1 -DMICROPY_PY_ASYNC_AWAIT=1 -DCIRCUITPY_AESIO=0 -DCIRCUITPY_ALARM=0 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=0 -DCIRCUITPY_AUDIOBUSIO_I2SOUT=0 -DCIRCUITPY_AUDIOBUSIO_PDMIN=0 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCI...
Push to your own repo and I will take a quick look. You only have 512kB of flash, so only 256kB for firmware, so you want to choose modules that, say, an M0 Express would pick.
@ladyada they shipped out samples to some makers on youtube, ahead of world wide release time
Ok, I pushed to my repo with the latests changes.
I saw that the PR triggered a new build on your side which shows the failing and the 39 kb oversize.
I disabled the I saw disabled for the kicksat-sprite but I missed CIRCUITPY_AUDIOMP3 and CIRCUITPY_BLEIO_HCI.
I'll try desabling these two but I could need CIRCUITPY_AUDIOMP3 later.
Aaaaand it PASS :)
With CIRCUITPY_AUDIOMP3 and CIRCUITPY_BLEIO_HCI disabled, the build passed.
I pushed to my repo and I'll try it on the board.
Thank you very much for your time and help :)
Great! Before you make the final PR, could you add a "manufacturer", and change the board name to something more descriptive? Also maybe do some rebasing to clean up the commits (and/or start a new PR).
Yes, I will clean up everything.
I didn't planned to do the final PR yet because the board is still in an early stage (need to fix some mistakes on the PCB and pin assignments) and I will have to troubleshoot the flash chips I have (only one out of 3 boards have the flash chip detected, I don't know why yet).
@street-grease-coder hi what are the specific links for folks who have em?
@simple pulsar there should probably be a note in the learn guides for S2 board about the voltage limits
@worthy robin basic calls are in place, an example is here: https://github.com/adafruit/circuitpython/pull/3854, but there are a couple of PRs not yet merged with feature and bug improvements
@slender iron Looking at the displayio.parallelbus for the rp2040 seems doable, but just wondering if there's a good device to test again? I don't have a display like that so will grab one
@crimson ferry The ESP32 is weirder in some ways. I've not tried MicroPython yet to see if they apply corrections to the raw ADC values.
@ladyada can I pm you somehow?
https://www.youtube.com/watch?v=tcrFiZuUi18
https://www.youtube.com/channel/UCu7_D0o48KbfhpEohoP7YSQ
I would include more details, but not here, hope that's useful to you anyways..
hi - that video is esp32-c3 not s3?
I incorrectly said on here the other day that precommit isn’t using the target, but actually it is and that setting is found in the pyproject.toml for libraries based on the cookie cutter. Cc: @solar whale
Just a heads up since I'm not sure who would know about this, but for some reason the CP 5.x bundle doesn't have a link on the "libraries" page.
@fossil gorge We have discontinued the 5.x bundle (it was the same as the 6.x bundle anyway). It is a bug that the text about it is still there. I'll look into that -- thanks.
Ah, good to know. I wasn't using or needing it, but figured I'd mention something was off. I was just on the wrong side of what "off" meant!
The text about the bundle was there, but there was no link.
This might be automated in the future, but fixing quickly for now.
@idle wharf I'm still a bit confused. I don't see where in the repo --target-version is specified. I'm sure I am just not looking the correct place.
For a library, using the cookiecutter template, it is specified in the pyproject.toml which black always check.
I'm looking at the Adafruit_CircuitPython_RFM9x lib. I don't see that file.
Adafruit_CircuitPython_RFM9x does not have the pyproject.toml. I'm not sure if that on purpose or not.
ah -- so it is not in each repo.
I have no idea. It's been around a long time.
so what does it do if that file is missing?
It would run with Black's defaults.
example:
halbert@salmonx:~/repos/adafruit/Adafruit_CircuitPython_BLE$ ag --hidden black
.github/workflows/build.yml
41: - name: Pip install pylint, black, & Sphinx
43: pip install --force-reinstall pylint black==19.10b0 Sphinx sphinx-rtd-theme
48: black --check --target-version=py35 .
Ah -- I see it in some other repos -- guess not all have been updated
Note that it's in the .github dir, so you have to search in a hidden dir
in the rfm9x repo -- the build.yaml does not call black at all ??
that seems like an oversight; it might be missing from a master list of repos that has been used to do bundle-wide changes
@tulip sleet you added that to the cookiecutter build.yml but it was reverted because it runs in the pre-commit.
I guess the real answer is the repo's aren't all standard yet
I added it? I don't remember.
something is odd though -- it is not called out in the rfm69 repo either, but a PR yestrday failed CI due to black
Sorry, Kattni added it and reverted it. You merged it originally...
oh yeah, there was weird trouble with it, and we reverted it quickly to stop builds from breaking
it is is not in build.yaml -- is it being run from something else as part of the CI workflow?
Pre-Commit
Which is also run during a "test" https://github.com/adafruit/cookiecutter-adafruit-circuitpython/blob/master/.github/workflows/test.yml
ah -- it just refers to black -- so I assume it runs without any target-version then
Yes, if there is no other setting in the pyproject.toml
So for that repo you mention. Its running defaults
ok -- that clears it up -- thanks
Or make PRs 😉
It is not causing any problems - just confusing me 😉
I wonder what else needs updating -- could be a can of worms!
I just used the cookiecutter yesterday for the first time so I just learned all this. timely questions !
Is that maybe why circup is failing?
@oak yacht I will test that.. thanks !
@oak yacht "There was a problem downloading the bundle. Please try again in a moment." -- is what you saw ?
Yep!
That's my guess... fixing.
@idle wharf It has been a long time since I created a new library so I have not used the cookie-cutter recently.
@oak yacht if you can to test the fix https://github.com/adafruit/circup/pull/76
Just post a comment on the PR if it works for you
The Pi Pico has 2 physical cores, but only one core is usable in CircuitPython. Micropython has limited multicore functionality when used with the pico, allowing the user to start a separate task while passing variables in the task call, like this:
def mytask(pin, delay)
# bang away at a pin or whatever, call with
import _thread
_thread.start_new_thread(mytask, (GP2, 0.2))
mytask runs independently of the main mcu core, and runs until it returns or mcu reset.
Is this plan...
Thanks @oak yacht for testing!
Circup 0.9.0 is live
pip uninstall circup --yes && pip install circup && circup --version
up sos wrong thread will re post in the help one
So I may have found a bug, but I'm not 100% sure if it is or not, or if I want to open an issue on it.
when using the following code:
import board
import busio
import adafruit_bus_device.i2c_device as i2c_device
i2c = busio.I2C(board.SCL,board.SDA)
i2c_addr = const(0x40)
print(i2c.try_lock())
print("trying to do this")
i2c_dev = i2c_device.I2CDevice(i2c, i2c_addr)
print("we got to this point")
buffer = bytearray(2)
i2c_dev.write_then_readinto(bytes([0x00]),buffer, in_end=None)
print(buffer)
i2c.unlock()
The code hangs on the line
i2c_dev = i2c_device.I2CDevice(i2c, i2c_addr)```
I tried it on 6.1.0.beta.1.8 and also on the very latest beta build for my CP Sapling.
It hangs for all the i2c breakouts i have
I'm going to try it on a Qt Py to verify.
i've seen that behavior before. not new.
any way around it?
it's because you are passing in a locked bus.
ah okay
I2CDevice could maybe handle that better
you're probably right, let me change it
i've shot myself in the foot with that before when doing stuff in REPL and forgetting i called try_lock several lines prior
yeah it works doing this
basically just trying to check out if this temp and humidity sensor I made works
it kind of does but I'm not 100% sure so more code to verify
I thought we had put in code you could Ctrl-C out of there, does that work? I wasn't as familiar with how to keep CP going while waiting on something when I wrote it
yah. i think you can....been a while.
it was more of the general behavior
it just silently sits there and never returns from the init call
so is a bit ??? when it happens
yeah I gotcha, almost needs a timeout value
or check if it's locked in the I2CDevice.__init()__ and throw an exception to let you know?
Problem is then you're moving any logic to wait for a lock outside of the bus device which, my understanding, was trying to manage some of that
I believe this has been fixed but I'm not positive. Worth checking in tinyusb. Note, after you change the url in .gitmodules you need to run git submodule sync to update the internal state to match.
I think these three are options: https://www.adafruit.com/product/1743 https://www.adafruit.com/product/1770 https://www.adafruit.com/product/2050
Add some jazz & pizazz to your project with a color touchscreen LCD. This TFT display is really big (3.2" diagonal) bright (6 white-LED backlight) and colorful! 240x320 pixels with ...
Add some jazz & pizazz to your project with a color touchscreen LCD. This TFT display is big (2.8" diagonal) bright (4 white-LED backlight) and colorful! 240x320 pixels with ...
Thanks, I have something in place that at least doesn't crash my pico, but not sure if it is even working at all. I'll grab one of those to test on
Yup, spent most of saturday pouring over the PIO docs (and some of the DMA but realized after that's built into the statemachine code you already have)
For parallel though it's a real simple PIO program at least
nice! yup, it is
ya, good place to start
doing pulseio with the PWM peripheral is probably doable too
Yeah likely, they had PWM as an example. If I can get this one going I may take a look at some of the utility modules that could use PIO
👍
Can one programatically shut down an M4 express board running circuitPython?
@mild fog no
[adafruit/circuitpython] New comment on pull request #4077: Add support for Lilygo TTGO T8 ESP32\-S2
Yup, no problem! Thank you!
What are some example sensors? How much does the resistor value matter? It's usually better to be explicit with an external value.
We could have the ssl module actually do SSL over the wrapped socket.
Note that right now we don't use external ram for sockets or pystack. We simply use all external RAM for the CP heap. To allow for more sockets, we'd need to change how RAM is shared between CP and the IDF. Basically now we don't tell the IDF about it. In the future we could tell the IDF and then allocate the heap through the IDF.
One wrinkle is that then the IDF memory may not be DMA-able so for any IDF buffers we'll have to be careful.
Thank you! Don't forget to add it to https://github.com/adafruit/circuitpython-org too!
It isn't a short-term goal. We have many other APIs to implement before we do multi-core.
I'm considering an API to facilitate running native code on the second core instead of additional Python. What are you using it to do?
Before trying countio, an internal pull-up was sufficient to work with both optical and hall-effect interrupter sensors. The pull-up value is not critical for most low to medium-speed applications like motor RPM. Don't know if the internal pull-up value provides enough current for the speed of a remote control IR sensor.
Sensors tested:
Hall-Effect: https://www.adafruit.com/product/158
IR Reflective: https://www.adafruit.com/product/3930
T-Slot Interrupter: [https://www...
What version of C python is CircuitPython / MicroPython based on at the moment?
Thank you - I tried reflashing CircuitPython and now it works for some reason lol. I guess it got corrupted somehow
Should this be mentioned in docs somewhere (maybe here), or is this a temporary thing? It's caused me some issues on 6.2.0-beta.1 and I feel like it'd be helpful for it to be documented if it's going to be a bug that sticks around for a while.
Hello again
Now that the internal flash build works and the board is usable, I'm trying to make the external SPI flash operational.
I'm not sure if I could ask here or open a new issue?
I use the GD25Q64CSIG chip connected with the same pins as on the Feather M0 Express :

I successfully used this setup with a SAMD21, but it looks like the SAMD51 does not detect the c...
Well it's been 3.6 days without issues and I need to re-purpose this board. Do you think this Brownout Reset disable will go into the normal release for both Metro ESP32S2 and Magtag?
Hi, I need a little guidance on a pull request. I have a CircuitPython PR (#4078) whose Build CI is failing on the Trinket M0 ja translation due to insufficient firmware flash. The same board builds successfully on my local machine so I am not sure how to proceed. Any and all advice gratefully received!
Okey it works when, before connecting socket, setting socket.settimeout(None).
Thanks!
I'm thinking this was most likely to be read(65535) against a source producing about 36 bytes a second. I'll close this for now.
I have a Pi Pico with CircuitPython noob question: I'm using the example on the Adafruit website for HID input 'A' and 'Hello World' typed as a keyboard. After getting my brain around the strict requirements for formatting indents 🙂 I managed to get the code working fine. But, how do I get it to run without having Mu present and having to press CTRL-D? Happy if you could point me in the right direction for info, if I've missed something on the website.
Did you get a reply to this?
Did this get resolved?
Looks like Dan answered your question?
Yes, Thanks!
@idle owl I think so yep. It was the fuel gauge device name being swapped around right?
The library got updated when someone noticed the name had transposed characters. I remembered seeing that go by. More recently tg-technie noticed the guide hadn't been updated yet.
Did the guide get updated?
Yep I got the guide when it was mentioned here.
Oh great! Thank you.
@Larrxi no problem. Note that since #4095 has now been merged, you shouldn't even need to take that step anymore on the most recent builds, as the default behavior has been returned to a timeout of None.
And now to add to the naming confusion...... 😄
I think I linked this by accident? $4095 is only tangentially related. I think I meant to link #4085?
@dhalbert you mean, keep the hash as returning id() so it isn't mutable, but implement socket.fileno() so we can still access the socket number? I think fileno was on my list anyway, along some of the other "filler" functions in socket.
@igrr Seems like we should disable brownout. Do you think we only need to do so before deep-sleeping, or should we disable it all the time? Thanks.
Yes, keep using id(). But if we implement .fileno(), can we take advantage of the fact that it returns -1 when the socket is closed, rather than keeping local state about that? It's really a question about what the requests library can do with it.
I tried using hash() on Cpython's sockets, and it seems to work fine. It's not related to the result of fileno of course, as that's also mutable in Cpython. I can't find any takes online about whether it's advisable to use Sockets as keys, though.
Did my question get a bit lost LOL
They sometimes do on here, I'd ask in #help-with-circuitpython that area gets a lot more traction to answer questions most times. This tends to focus more on developing circuitpython (sorry I don't have an answer for you myself)
Thanks for the pointer @blissful pollen I'll try there 🙂 - UPDATE Issue fixed with help from @tidal kiln and @tulip sleet with thanks.
@dhalbert if you mean internal state within the Requests library, I think so, yes. We create a sock->num in C when the socket is created, and set it to -1 when closed, and that's all that fileno would be returning. The only potential issue is that TLS sockets don't strictly need to have the original socket open to keep working - in Scott's original implementation, they didn't call the lwip_socket function at all, which is what allocates the file descriptor. But my implementation calls t...
This recently came up in #4061, since TLS sockets take up 2 sockets apiece now, so you can only have 2 of them total. @anecdata noted that might be a bit restrictive.
If your local fork has not merged from upstream recently, then there may be less code in your local version, causing it not to fail on TRANSLATION=ja. Also it may depend on which compiler you're using. I can look at your PR and suggest some changes. I am trying to simplify how we squeeze various builds.
to be fair, @atomic summit has been using that name since 2019
@crimson ferry There was no implication that RPi came first. That name has been used ubiquitously across this field for years.
yeah, it's dangerous to use any of those prefixes
It's a fun short word that implies small. How can you not want to use it.
Yes, I opened an issue in the cookie cutter repo. I’ll PR when I have time, maybe not today though
A user reworked this example to use GP14 and GP15, and their code.py would not start automatically. Changing GP15 to another pin fixed the problem.
#help-with-circuitpython message and following.
@idle wharf Excellent. Thank you for following up!
See: #3192 for closure reasons
@tannewt Made the change you requested.
@dhalbert The simmel build is still too large. Only CI problem as far as I can see.
Hi there,
I'm currently testing a new board that uses the ESP32-S2 and has an integrated SD card. When I try using one of the existing board from the website it works fine but when I flash it with my own board definition the SD card won't work and I get the following error message:
Traceback (most recent call last):
File "code.py", line 16, in
File "adafruit_sdcard.py", line 101, in __init__
File "adafruit_sdcard.py", line 122, in _init_card
File "adafruit_sdcard.py", ...
I shrank the simmel build and pushed a new commit to this PR.
@tulip sleet Did I see we added code to default to a specific core when using microcontroller.cpu? Or did I imagine that. And if so, where did that end up?
My colleague has pointed to this forum post that suggests clearing the "Brownout reset enable" bit before entering deep sleep: https://www.esp32.com/viewtopic.php?f=13&t=19208#p71084.
I'm going to submit this change for IDF master and release/v4.2 branches, so that esp_deep_sleep_start disables BOD reset automatically. In the meantime, please try to add this workaround in your app before calling esp_deep_sleep_start.
@idle owl currently you have to say microntroller.cpu[0]. temperature. That is going to get fixed but PR #4087 hasn't been merged yet.
It's 3.4 plus some bonus things. CircuitPython has f-strings in most builds for example.
@idle owl just merged it, so it will be fixed in beta.2
Ok, I'll keep an eye out for the beta, and update the guide page.
See https://github.com/adafruit/Adafruit_CircuitPython_LIS3DH/issues/67
The issue is resolved if native BusDevice is not used.
Can also resolve by building with LONGINT_IMPL = MPZ
But then it won’t fit in Flash unless something else is removed.
<@&356864093652516868> Meeting in ~40 minutes. Please add your notes to the document. If you're going to be lurking, it's super appreciated if you can add your name to the doc in alphabetical order under Hug Reports and Status Updates with (lurking). Thanks much! Chat with you all soon! https://docs.google.com/document/d/1W2OIZkZ6Rkrl7se8LjBNxb2orUtyb5SmK53AmiAZkrY/edit
Google Docs
CircuitPython Weekly for 1 February 2021 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates early. During the meeting, we go through them as a round robin sorted by username. If you can’t make the meeting and would still like to participate, ...
I think this is a bug on our end. I believe beta.0 should work in the meantime.
Is there a spot in the docs listing the “bonus things” beyond 3.4 functionality? I didn’t know CP had f-strings!
?show
Thank you for the response @tannewt, that explains why this build worked adafruit-circuitpython-unexpectedmaker_feathers2-en_US-6.2.0-beta.0.bin but not if I compile it using make for the same board.
I will give it a try with beta.0 and see if that helps.
Thanks again!
Happily lurking today -- notes document updated -- snow shovel not updated. ❄️
Lurking again today, as usual. I enjoy the goodness shared and the company before an architecture meeting!
Just listening today.
Be back in a minute.
Nothing is ever easy.
Unless its eggs, they go over easy.
On in NJ, they are runny.
lurking
lurking
lurking
$4 for the Pico even 🙂
hey anyone get "Unable to import 'adafruit_trellism4' when trying the blink program in adafruit learn ?
@sweet ocean lets head over to #help-with-circuitpython
** lurking **
Limor Fried
https://lca2021.linux.org.au/schedule/presentation/122/
A love story of Blinka, going through the background, history and story behind Blinka.
linux.conf.au is a conference about the Linux operating system, and all aspects of the thriving ecosystem of Free and Open Source Software that has grown up around it. Run since 1999, in a ...