#circuitpython-dev
1 messages Β· Page 322 of 1
thanks.
The CookieCutter is about as fun as gargling glass though
I like evolving APIs to keep folks used to things evolving
@onyx hinge Jeff, don't forget to pull this in https://github.com/adafruit/circuitpython/issues/3265, before 6.0 goes out.
Keep people on their toes, just randomise all the method names, GO!
If there is one example library that only care about one chip, and then other library that rely on that for implementing board specific... then I am interested in analysing how that work and how it is done.
I don't think anyone would like that very much
I don't really want to invent something, but I can copycat.
sounds like JS obfuscation
Pimoroni ( or @hybrid scarab ) made some interesting variation in very similar library, doing the same thing mostly but with slight difference in the available function.
Like on library had brightness, the other not.
Oh yeah that's just classic me making a mess of things
And I was trying to port from one to the other trying to figure out why it was different.
I'll let you in on a secret- I have no idea what I'm doing
Well some hardward do not have brightness...
Big warning... I learned a lot about python by reading code from Gadgetoid!
(okay CookieCutter isn't that bad)
Ok, now I should figure out what resistor I need for SDA/SCL and if it's Ok to have not exactly the right value because of what I have in stock... and maybe why this is needed on the FeatherCap and what is the difference between a Pi and a Feather.
Well this is weird. circuitpython's ports/unix crashes with "import ulab.linalg"
so does "import ulab.fft", so it's not special to linalg...
This works on micropython import ulab from ulab import linalg
But I konw that on circuitpython you import differently.
You should get away with a pretty wide range of SDA/SCL resistors in my experience, as long as you're not doing anything challenging with i2c
at low speed it doesn't matter much
at high speed it does
what's this about pull-up sensing?
It throws a little message if you don't have pull-ups on your i2c lines, it's cute
But also makes me think I've broken something
yeah in micropython import ulab.linalg is not accepted, it says no module named 'ulab'
that is ... weird, @onyx hinge. That should be valid.
I am trying to figure out what has changed since 11a7ecf, which is the version you have.
@ivory yew in micropython it's a (I think) deliberate choice; they don't facilitate having hard-coded submodules. We added patches to make it work better
ah
import ulab.linalg works on circuitpython, phew
Oh, so was it a false alarm, then?
I mean, on hardware
@lapis hemlock for what it's worth, ulab.linalg.cholesky exists for me without your change in ulab
'0.54.0'
>>> ulab.linalg.cholesky
<function>
Oh my APDS9500 I'd almost forgotten about that
I haven't checked it, I worked from the issue that was posted on circuitpython, and then I realised that it didn't work on micropython.
@onyx hinge So, what do we do, then? Just close the issue, and walk away?
Figure out why it didn't work for the user?
I would also like to know, why it worked for you, and why it didn't work on your unix port.
Something is definitely fishy here.
yeah but almost certainly not ulab's fault
As I said, there was a problem in 0.54.0, I just don't understand, why it didn't affect circuitpython, and why the user claimed that it did.
the import-crash is not ulab's fault
One day, I will have a deep look at ulab. But it seems to be math... some of it I did understand in the past and succeeded at exam. Even if it was fun at the time, I manadge to forget almost everything. Now I start to see a lot of interesting use of math, maybe I should re-learn. My kids are not far enough that I cannot help them with homework. Let's hope one of them get deep into math and I have to help them!
@onyx hinge OK, but then I think either you, or @tulip sleet should respond to that specific issue.
It wouldn't be proper, if I mingled in circuitpython matters.
let me check whether circuitpython 5.3 behaves or not ...
still unable to checkout this PR
From https://github.com/adafruit/circuitpython
* [new ref] refs/pull/3237/head -> pr_3237
Fetching submodule lib/protomatter
fatal: remote error: upload-pack: not our ref 2408e9c033f5ec050967b1592b29a950a831d6c2
fatal: the remote end hung up unexpectedly
I can't reproduce that here with git 2.20.1 running on debian linux amd64. I used a fresh clone for testing:
jepler@eric:/tmp$ git clone https://github.com/adafruit/circuitpython
Cloning into 'circuitpython'...
remote: Enumerating objects: 29, done.
remote: Counting objects: 100% (29/29), done.
remote: Compressing objects: 100% (18/18), done.
remote: Total 128614 (delta 14), reused 13 (delta 11), pack-reused 128585
Receiving objects: 100% (128614/128614), 77.30 MiB | 32.04 MiB/s,...
Hi @kevin-tracy and thanks for your bug report. Can you let us know a little more about your setup? What version of CircuitPython are you using, what board is it on, and what steps did you follow to produce the problem?
I tried 5.3.1 on a Grand Central M4, and the function is present. However, I did not test its functionality.
Adafruit CircuitPython 5.3.1 on 2020-08-17; Adafruit Grand Central M4 Express with samd51p20
>>> from ulab.linalg import cholesky
>>> cholesky
<function>...
pystack appears to have gotten enough rest by CircuitPython 6.0.0-alpha.2-296-g6e5c2b3fe on 2020-08-17 :-) Thanks! (Github search for "pystack" yields no code or commits)
I can't reproduce that here with git 2.20.1 running on debian linux amd64. I used a fresh clone for testing:
jepler@eric:/tmp$ git clone https://github.com/adafruit/circuitpython Cloning into 'circuitpython'... remote: Enumerating objects: 29, done. remote: Counting objects: 100% (29/29), done. remote: Compressing objects: 100% (18/18), done. remote: Total 128614 (delta 14), reused 13 (delta 11), pack-reused 128585 Receiving objects: 100% (128614/128614), 77....
Yay! Tested irremote_simpletest on both feather_m0_express and pirkey_m0 --- all good now!
code run on pirkey_m0
[Jerry-desktop-mini:~/projects/feather_stm32f405] jerryneedell% cat /Volumes/CIRCUITPY/irremote_simpletest.py
# Circuit Playground Express Demo Code
# Adjust the pulseio 'board.PIN' if using something else
import pulseio
import board
import adafruit_irremote
pulsein = pulseio.PulseIn(board.REMOTEIN, maxlen=120, idle_state=True)
decoder = adafruit_irremote.Generic...
@half sedge PM25 library works nicely, I wonder if we can get Enviro+ added into the simpletest π
@hybrid scarab That depends, do you want to submit an update to the simpletest? π
Got me there π
also tested dht_simpletest with dht22 on a feather_m0_rfm9x build (with pulseio) -- it works!
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 6.0.0-alpha.2-152-g333a10ded on 2020-08-17; Adafruit Feather M0 RFM9x with samd21g18
>>> import dht_simpletest
Temp: 76.8 F / 24.9 C Humidity: 50.6%
Temp: 76.6 F / 24.8 C Humidity: 50.9%
Temp: 76.6 F / 24.8 C Humidity: 50.9%
@brentru just tested #3237 on an rfm9x build with pulseio enabled and it can now support the DHT sensors.
perhaps we should hold off on this until #32327 is merged and I can see if I can fit pulseio back into the build.
Works! Thanks for making room
perhaps we should hold off on this until #32327 is merged and I can see if I can fit pulseio back into the build.
@jerryneedell I don't see any learn guides/projects which utilize the DHT+LoRa RFM9x (aside from TTN ones, and those should be run on the SAMD51). Are you OK with merging this as-is, and we can create another PR to fit pulseio after?
Works! Thanks for making room
I can try to get pulseio back in tomorrow and if all is OK we move ahead -- it will pick up #3237 whenever it is ready -- don't really have to wait.
perhaps we should hold off on this until #32327 is merged and I can see if I can fit pulseio back into the build.
@jerryneedell I don't see any learn guides/projects which utilize the DHT+LoRa RFM9x (aside from TTN ones, and those should be run on the SAMD51). Are you OK with merging this as-is, and we can create another PR to fit
pulseioafter?
Yes -- absolutely -- go ahead -- pulseio may not fi anyway
Why is the PM25 header... b"BM" π
Also is the any reason why- in CircuitPython- you would do
if (self._buffer[0] != 0x42) or (self._buffer[1] != 0x4D):
instead of
if not self._buffer[0:2] == b'BM'
the first uses less memory but I'm not sure it's worth the worse readability
Oh lord what eldritch horror does indexing into a bytearray involve?!
the slice generates a new bytes object
So raw bytes + overhead * 2
Ah yes I'm aware of the magic of numbers < 32 bits
This is clearly written with a very keen eye for memory usage
yup, and bytes objects are actually two allocations
Similarly I would do self._buffer[2:] = data
one for the object and one for the array contents
I would only worry about this if you are doing it very often
But the O.G. code has a for-loop, copying each byte from the bytearray returned by serial read into the bytearray of the buffer
Now IIRC some serial libraries like to return surprising things
we've had a lot of libraries written by folks coming from C so they may lack python-isms like slicing
Aye you did mention
including libraries ported from arduino
This strikes me as some tread-very-carefully code though
which is why I'm excited to get you on board π another person coming from python land
But I will base a PR upon David's work to package-ize this, to hopefully bring some idiomatic python (or idiotic python if I trounce some careful optimisations) into the mix
I come from javascript land, I'm just passing through Python while the jobs are exciting π
I would only do the optimization if its in frequently called code
Yeah this is... infrequent to say the least
then readable is better
Usually every second, but the PM sensor will actually speed up if it detects a change
Knowing my luck this will catch fire on the Pi
thats odd - im not seeing the same? SCL == PA23 and SDA == PA22
#define DEFAULT_I2C_BUS_SCL (&pin_PA23)
#define DEFAULT_I2C_BUS_SDA (&pin_PA22)
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA22) },
{ MP_ROM_QSTR(MP_QSTR_SCL)...
@thorny jay I don't know if this will fix anything, but it's more idiomatic and takes the complete SoF sequence into account- https://github.com/dglaude/Adafruit_CircuitPython_PM25/compare/library-to-package...pimoroni:library-to-package
Actually it might break SoF sync
Since if it's never read a-byte-at-a-time it's possible to get one byte out of sync, and break indefinitely
I think flushing the input buffer is probably the right way to fix that on any system that has one, though, and not my weird bytewise read
Yeah, checking one byte only might not be the best... and checking the two from the signature might be best. I believe the UART code is doing minimal check and attempt to sync. Then code in init.py is (or could) do more test.
That split and reuse of code between I2C and UART is confusing to me. I guess I2C has no issue of that kind.
I can't seem to beak it on my m4
for _ in range(5): # try a few times, it can be sluggish π€
I was poorly inserting the connector and moving the cable to try to produce bad reading.
I'm guessing i2c.readinto(self._buffer) just performs a straight read of 32 registers right from the device into the buffer
But, yes, generally i2c doesn't have the same kind of problem space that fuzzy horrible UART does
To be fair you can still get erroneous bytes on i2c, but it'll normally bail the whole protocol and fail with an IOError before you manage to do anything with them
I believe that what I did in PM25 is the best I can do. But feel free to improve. At least it changed from an unreliable library to something that work for me.
Yeah I'd be interested to know if my change breaks reliability for you
I can omit the change to reading the SoF packet, the other changes just clean up some non-idiomatic Python
- for i in range(31):
- self._buffer[i + 1] = remain[i]
- # print([hex(i) for i in self._buffer])
+ self._buffer[2:] = data
for example
So now I need to understand how to deal with a PR on a fork that is a branch that is already a PR from me. I guess this is standard practice, but I usually only do one level. This is going to confuse me... I guess I need to git pull from your repo, take that branch and test on the board and wiggle the cable.
Checking just one SOF byte means it's possible for the sensor to read total garbage, but since there's a checksum test anyway it'll throw a RuntimeError("Invalid PM2.5 checksum")
Haha, I haven't raised as a PR against your feature yet
I just linked the GitHub diff URL so you could see the changes
I aim to raise them as a PR once yours is merged
Keeps the breakage nice and separate π
And it will not be my take.
The comments can probably be deleted from the __init__.py too, they are... perhaps a little obvious π
Not that they hurt
Not sure how much is mine and how much was there first. From memory, I just made a few more check in the UART version, and then the splitting.
They've been there since initial commit anyway- https://github.com/adafruit/Adafruit_CircuitPython_PM25/blame/master/adafruit_pm25.py#L88
If you go into the detail, you will see that my contribution is minor or mechanical.
Yeah you poll the start byte on a loop, versus just checking it once
and that also maybe empty the buffer if needed.
Near as I can tell, there's either a very small buffer or no buffer to speak of
What I don't get is how things works... I mean, the hardware send 32 bytes every seconds? The driver does not read every second, it is only because the user code read every second. So what if I don't read for 10 seconds? Do I get 10 seconds old data? What if I try to read every 0.5s? How does that "sync"?
Does the hardware know that we want to read?
I have been VERY confused with this hardware.
Two quick successive reads will fail if the serial timeout is 0, or block until some bytes are read
I lost all my basic understanding of UART, buffer and things like that.
So reading too fast will just fail or wait.
But reading too slow???
So the PM25 hardware just squirts 32 bytes over UART every 1sec, and if it sees a particulate change big enough it will speed up to something like 50x/sec (I can't remember the exact numbers)
Also, there is that thing where the value only change every 3 seconds or so. Was is with PM?
But in some test, I could see always the value repeating 3 times.
Reading too slow will, depending on your client:
- Slowly fill up your UART receive buffer with garbage/unread data
- If it's a FIFO buffer you will get the data in order, as long as you keep up with reads- so "old" data
- If your buffer overruns... AAAHHH
- If there's no buffer at all, you will get data as you request it
Could be the hardware itself doesn't update even as fast as the value is propagated out to UART I'm not sure
But the PM25 doesn't know you're asking for data, it's just diligently throwing it out there into the abyss
I read some documentation, and it was like: "Yeah, we send data every seconds, but in reality it only change every 3 seconds".
And that's half the problem with people running the sensor for six weeks and slowly filling the receive buffer on the Pi with unread data until you get a short read and it blows up
There is a reset pin... but not in use on the EnviroPlus. But I have the breakout now, so I could see if that part is helpfull.
I have PMS_RESET documented as being on D11 in the schematic
(though it might be an old schematic)
OMG, maybe now I start to prefer the I2C version? Maybe that one overwrite the memory with the lattest value and when you read, you always read the lattest.
Yeah with i2c you're explicitly asking for the contents of the registers, and clocking them out one-by-one as and when you ask for them
Wait... need to check if your code is using it. But in Adafruit simpletest, I remember it was not put to use.
So it makes not a lick of difference if you're too fast or too slow
I believe the issue is that it is asymetrical UART. You are not asking for the value, you are flooded with values.
Yep!
Like sticking your head under a waterfall for a drink of water, versus turning on a tap
This is broadly why:
- I hate UART
- People have to contrive horrible packet formats to make it work, including checksums and SoF bytes
Oh and
3. Inevitably some design-for-UART format ends up implemented in i2c and makes me cry
That is to make migration from UART to I2C more easy... they keep the same format.
Though I will yield that having a checksum is probably still useful in very extreme cases over i2c- ie: if you want to be 1000% sure the data you read is perfect and hasn't been bitflipped
But IMHO 99.99% of all sensor implementations wont care about a bitflip because it will be too incidental for any sensible algorithm to care
I think it's a bit tricky because CircuitPython isn't simply "decode image to screen". There is machinery around it that mixes pixels and tracks dirty areas.
There are a couple questions we'd need to answer:
- Is it ok to store the decoded bitmap in memory?
- Is it ok to store the JPEG in memory?
- Could we cache decoded blocks in memory?
If 1, then simply decode into an existing Bitmap.
If 2, then decode the needed block from memory into memory when we get a pixel.
If 3, do 2 b...
If you're reading temperature from a sensor at 1000Hz and you need to know in 1/1000th of a second if the temperature has just gone from 3C to 131C and isn't a result of a bitflip then... yes.. you're gonna care about checksums π
Here for PM... I guess filtering creazy data, taking some kind of average, ... that would be the way to go.
Thank you! I don't think we need to backport. 6.x isn't too far away and things haven't changed that much.
Yeah the accuracy on the data is questionable anyway
Though with UART you have to have a SOF and a checksum because you could be reading total random garbage
It's the only way to tell whether you've got a PM connected, or some random GPS module
And I really need to go to bed π
"RuntimeError: SDA or SCL needs a pull up" ... Maybe I should have put 4.7K rather than 1K ???
1K should work, in theory
As long as your resistor value isn't so low that the chip can't pull the pin low
One rename request to make things clearer. Thanks!
mp_const_obj_t display_bus_type = displays[i].bus_base.type;
Here and below.
I think the rule of thumb might be "use the highest value you can get away with before your signal turns into mush"
But that probably only applies if you're worried about burning tiny amounts of power or something
Like- if you put a 10M resistor on there then it might take so long for the line to go to 3.3V when it's released that your device has tried to pull it low again before it finishes
Yeah, I have read 2 or 3 page that google gave me to read... and yeah, gave 1K a try... now I am going to try 4.7K. If that also fail... then... I will start to instigate further.
Not even sure if that is a Pull Up resistor or some magic adaptation between what the Pi does and what the Feather does.
I've done some slightly crazy things with i2c (running it over long cables for Flotilla) but that's about as far as my "engineering" creds will take me
Looks like it was fixed already: https://github.com/adafruit/circuitpython/pull/3060
Please use the latest 6.0.0 pre-release. We're working on getting 6.x stable released so this won't be hit by others.
I NEVER had to worry about that because every board I use do the right thing.
Yeah Feather not having onboard pullups is weird to me, but I guess it makes those pins multi-purpose
Also no pre-populated resistor will ever be the right resistor for some specific edgecase, I guess
Glad it worked!
I turned on pystack here: https://github.com/adafruit/circuitpython/pull/3160 and the size was bumped here: https://github.com/adafruit/circuitpython/pull/3213
Not sure what you mean with caching decoded blocks, isn't that essentially the decoded bitmap?
My thinking so far was to do 1) and load JPEG from disk given that it is unlikely that M0+ could be supported with the already high memory requirements from CPY itself. Which pretty much leaves only MCUs which can easily hold a couple bitmaps in memory for even "higher res" 320x480 screens.
Please update the comment above too.
Thanks for adding this! Just a few corner cases to think about.
Construct and pass a PWMOut carrier instead"));
What happens when no channel is available?
@onyx hinge what do the _reconstruct calls for rgbmatrix and sharp do?
ooooh, folks will be happy. terminalio is 6k
Has the testing covered the case in which this line is reached? I expressed concern about it but that was from an abstract standpoint not a testing standpoint:
/// added code in pulsein_interrupt_handler
if (!supervisor_background_tasks_ok() ) {
common_hal_mcu_enable_interrupts();
mp_raise_RuntimeError(translate("Input taking too long"));
return;
}
Here's what I'd written earlier:
Raising an exception from an interrupt context seems even...
@ansonhe97 added the board. Wifi isn't supported though.
The font is missing many characters and the build needs the space. This frees 6k or so in M0 builds with displayio enabled.
We can optimize font storage when we get a good font.
The serial output will work as usual.
Could we add an aggregate message back for the font missing character line? It'll help us know when to disable terminalio because the characters are missing.
@slender iron when the framebuffer displays are initially created they allocate heap memory. "reconstruct" lets them recreate them as supervisor allocations on soft-reset.
ok, I think I fixed a bug then where the move memory would exit early if there was no terminal
(if they were ever allocated as a "built in" display it would probably not be necessary as they would already be supervisor allocations)
oh cool, thanks for fixing my bugs
np, I think it's very rare that it'd happen
it's in that "turn off terminal" PR?
yup
This would break any demo that used terminalio.FONT for displaying ASCII text and numbers, they would have to use external fonts instead, but only on ja and ko builds?
OK, making sure I understood the impact of this change.
Scott and I discussed on Discord that this change means any program that uses terminalio, approximately 32 files in the Adafriut Learning Systems Guides git repo, will stop working on ja and ko translated versions while continuing to work as written for other translations.
Those programs could hypothetically be modified to use a bitmap font read from flash, if there is enough RAM memory to hold the font. This is likely to be feasible for all but the most resource constrained builds, s...
I'm on adafruit/main, built and flashed espressif_saola_1_wrover.
Should I see a network module in help('modules')?
With the early return we were seeing a hang condition with no notification
to the end user as to a cause.
I agree that raising an exception from an interrupt handler is less than
ideal, but in this case the incoming pulse
would have lasted more than 1 second, which means that it would not be
valid anyway. The DHT and IR remotes
I've tested all complete the pulsein in less than 100 milliseconds, so a
pulse lasting 10x that would mean something's
wrong with the sender. Jerry did hit the "Input...
@idle wharf I think it was an artifact from MicroPython https://github.com/adafruit/circuitpython/pull/3164
@crimson ferry Sorry, I worded that poorly. I don't see a network module. I assumed with the native_wifi merge for an esp32s2 port I would see one now. I wonder if only the IDF\C part is implemented so far and not the CP Library...
Actually, looks that is exactly what that PR says... "coming soon" π
Thanks @crimson ferry !
I'm looking at Scott's fork now to see how it manifests
anticipation is high for playing with the new networking stack π
I'm borderline giddy
same. I like the finer granularity in the modules and eventually the libraries
oh github! You create such an opportunity for mirth! Scott's suggested change had two parts; after accepting one, the code would be broken. But at that point the second suggestion was no longer able to be accepted in the web UI. I did it by hand, hopefully it's right now.
@crimson ferry I think I missed the information on that. How will the modules be changing?
@idle wharf Looking through the native-wifi branch, looks like there are new modules, see the shared-bindings and common-hal in that branch, e.g., changes committed here https://github.com/tannewt/circuitpython/commit/a97ed1af0e940bc507ba0352efaf7f91227b79d8
The finer-grained library re-factoring is just my impression from some commentary in the Deep Dives.
Gotcha... As a C dev, you're able to see deeper in the dives than I can. π
uh, it's actually quite alien to me (not a C dev; not a Python dev really either)... it's taken me over a year working with CP to be able to navigate those directories and grok any meaning from it at all
@idle wharf the native_wifi branch adds wifi and socketpool modules
@slender iron AH, so I need to build the native_wifi branch in your fork, correct?
yup!
will hopefully get a PR out tomorrow for the basics
it'll require my version of requests I think too
Got it, thanks! I'll try out a built tonight on the Wrover and the FeatherS2
@slender iron Seems the library APIs will change? Will the break be 5.x vs. 6.x (different libs in the bundles)?
they will a bit but they'll apply backwards
all of the existing native networking is disabled
we have a python wiznet driver anyway
we never used that anyway did we? not since 3.x or 4.x with esp32spi or wiznet
(libraries)
not really no. anything we've used heavily is all python side
tested on:
- CLUE
- master branch. hash: 94ecf33a5ccd3682075e7a849621148ac72142a4
steps to repro:
Open REPL and then:
import _bleio
_bleio.adapter.erase_bonding()
It fails while trying to erase page address 0xea000 (page number 0xea).
circuitpython-6.0-alpha2 works Ok.
I compiled circuitpython following the instructructions from here: https://learn.adafruit.com/building-circuitpython/build-circuitpython using BOARD=clue_nrf52840_express
@tulip sleet I've just filed the bug posted by the bot (previous post)... not sure whether I'm compiling the firmware with incorrect parameters or what... but it seems that BLE cannot bond because of an issue with NVM.
thanks, I will take a look tomorrow
thansk!
in case it helps, I'm using gcc version: arm-none-eabi-gcc (GNU Arm Embedded Toolchain 9-2020-q2-update) 9.3.1 20200408 (release)
@gmeader I wrestled with this for a while, had even reformatted my card at one point during initial testing. Always something odd at 1024 bytes.
I just tried a new card, formatted with the official SD Card format utility, and it worked fine (your example gist code and mine). Odd that we both see errors at around 1024 bytes, which leads me to believe it's not random corruption, but some underlying card characteristic or state that triggers the IO error.
Curious if a new card, newly-forma...
Hi, I'd like to add my PicoPlanet Boards :)
Stripping out NUS, adding I2C support for the hardware RTC element.
thanks!
My kingdom for a CircuitPython library manager π
Though tbf I can search the "lib" folder in Windows
@hybrid scarab this may be of interest https://learn.adafruit.com/keep-your-circuitpython-libraries-on-devices-up-to-date-with-circup
+1 for Circup, I've started using it more recently. If you are familiar with using pip or npm for other projects to install and keep updated the requirements then you'll probably be able to pick up Circup quickly and use it for installing and updating Circuit Python libraries on your devices.
Aha thank you @solar whale
I guess circup is better... but I have a small python script for that. I download the new bundle, unzip, create a few folder, then run my script. It check the file/folder I have in D:\ (CircuitPython drive) and copy those from the bundle. Then I have my folder full of all the file I should copy over. So it assume that my board already has the set of usefull library, and get me the latest. Not fool proof, but I used it a lot recently: https://gist.github.com/dglaude/f5f3423288861bc44fe758212dbaac61#file-update-py
Initially the Gist was about PyPortal, and I created a list of file/folder I wanted. But then it became a way to get the latest version of all thing.
The Huffman code book for the translation is currently calculated with the translation and MP_QSTRs. However, I don't think they are actually used for QSTRs.
We can decrease the entropy a bit by calculating the codebook based only on the translation texts.
BOARD=feather_m0_express TRANSLATION=ja
(before) // 9342 bytes worth of translations compressed
βββ
(after) // 9149 bytes worth of translations compressed
BOARD=feather_m0_express
- en: 8398 bytes β 8239 bytes
-...
This is ready for a fresh look! Instead of adding a special case I removed one, so it's sure to be right(-er) this time.
@tannewt Is this specific change (to check the type of the bus before checking its bus property) right? I assume it's right (because if it's, say an I2CDisplay then the content at that address is unrelated but also would never equal the spi_singleton) but if it's intentional I'd change it back and add a comment explaining it.
It calls a runtime error in find_and_reserve. I guess we shouldn't have python errors in peripherals, though. I'll change it to return RMT_CHANNEL_MAX and fail inside the module on that condition.
The bdmicro_vina_m0 atmel-samd board is failing CI for me with just 76 bytes over. Probably had to do with me adding a new translation. Seems to me like no board should probably be that close without a little margin for error, but should I take something out or modify the translation somehow?
@ionic elk I just fixed that yesterday, and gave it plenty more room; is this new?
Following the rabbit hole on the original issue I linked, I saw a number of discussions involving tags vs robots, so there may be some resources available off that original discussion.
Excellent find, thank you !
There aren't a lot of devices that need this -- the other one I knew about, AD9850, doesn't appear on an Adafruit breakout. The driver complexity in Sharp Display from this is nearly nonexistent. So the only reason to do this would be "completeness". If we decide LSB first is not important, breaking out the bits that bring bitbangio.SPI up to compatibility with busio.SPI would be nice though.
At this point, I don't have a vested interest in whether we merge this or close it.
It's a lot of code for a little-used feature. No one else has asked for this yet. So interest of not growing the small builds, I think it's OK to close it. We can put a note in #775 and close that too.
@tidal kiln If you have the cycles, can you check this out? I'm assuming they don't have the right version of something, but I could be wrong. Either way, I don't have the cycles. https://forums.adafruit.com/viewtopic.php?f=60&t=168434
I think it's most likely that they need to update to the newest version of Adafruit_CircuitPython_HID
@idle owl @lone axle yep. agree. most likely. i responded and will cover it.
@tidal kiln Much appreciated!
We did implement this but in the end as there are few devices that need it we decided not to incorporate it. The code will remain attached to the closed PR https://github.com/adafruit/circuitpython/pull/3224
I wouldn't store the full decoded bitmap (aka all of the blocks) because it'll be one large allocation. If you store it at the decoded block level you have less memory overhead and more, smaller allocations. When evicting a block in favor of another the allocation can be reused then too.
Thank you! I intended on compressing QSTRs too but never did.
Thank you! I removed some trailing whitespace and will merge once the CI is happy.
One thing to make the builds pass and then should be good. Thanks!
RUN_BACKGROUND_TASKS;
Sorry I got this wrong. No (). (CI is unhappy with it.)
Ya, this looks correct to me. We check the type to know which union entry to use.
Thanks! This will enable us to do languages we don't know how to layout too like Hebrew and Arabic. Mandarin should be doable too.
sys.getsizeof would be really handy
Hey just a quick FYI on trying the native wifi branch from @slender iron's repo.
I successfully built and flashed the FeatherS2 and I could see the wifi module. Didn't see a Mac address nor did wifi.radio.start_scanning (not the right name) work. But I'm not sure I was doing it correctly and didn't spend much time looking at it.
On the Espressif WROVER, I couldn't get it to flash. I had a parameter error.
Anyway, nothing specific for anyone to act on, but I wanted to share the info in case it was a pattern someone else is seeing. I'll pull the branch and give it all another go tonight, be more methodical and take notes.
thanks @idle wharf. I'll be poking it after lunch. splitting pulseio now
This gives us better granularity when implementing new ports because
PWMOut is commonly implemented before PulseIn and PulseOut.
Fixes #3211
@dhalbert We should be able to do beta releases after this.
Hi @jepler, thank you for looking into this. I actually just got a Grand Central M4 and with CP 5.3.1 it worked for me as well. Thank you.
Looks like CI is concerned about stubs, not sure what that's about. I found a couple of mis-labeled comments but it looks good to me overall - you covered everything in Display and and the config settings that I can think of. Either this or ESP32-PulseIO will need some tweaks depending on which goes in first, of course.
accidental wrong name here?
I did a bisect and the culprit commit is this one: d83a4ac72db90253089fb33e6f01d6da8f99f8b3
I tried with both with:
- arm gcc 2020-q2-update (latest one)
- arm gcc 2019-q4-major (recommended for circuit python 5 according the adafruit documnetation)
and with both I got the error. So, it seems to be a compiler error. But until it is fixed I'd remove the OPTIMIZATION_LEVEL = 2
Typically these errors are us forgetting to make something volatile or something is uninitialized. The error is hidden with less optimization. I'm not sure we've encountered an actual compiler bug. Thanks for the bisect. I'll try tracking down the issue.
makes sense, thanks.
I debugged it a bit further, and:
- there is a
while (sd_flash_operation_status != SD_FLASH_OPERATION_IN_PROGRESS) {}... and code cannot exit this loop. sd_flash_operation_statusgets updated onSD_EVT_IRQHandler- but
SD_EVT_IRQHandleris not being called aftersd_flash_page_erase()is called. Not sure whether there is a race condition, or interrupts are masked
Might not be related to this bug, but seems to be safer to protect `sd_flash_oper...
I had some now-buried questions in the #help-with- channel about memory usage of imageload vs. OnDiskBitmap: https://discordapp.com/channels/327254708534116352/537365702651150357/745374089954197644 Do I have a wrong intuition about this, or what I am I missing?
looks
@crimson ferry this is a better place to ask implementation questions because the help-with channel is for more basic qs
OnDiskBitmap should use relatively little because it never loads the image into memory
it always fetches pixels from the disk to put them in the final bitmap portion that is output to the display
does it continually fetch from disk on every refresh? if not, how can it be displayed without taking up enough memory for all the pixels and color depth?
ya it does fetch every time. that's why it's slow
wow, OK, but still I saw a big memory drop after exiting the with... I couldn't account for that
ya, that seems weird did you gc.collect before doing gc.mem_free?
no, did that a couple lines later after some clean-up and checked again and free mem was back up
k, may be some intermediate memory then
thanks, that helped
np, Bitmap/OnDiskBitmap are really meant to be the two extremes
small in memory and fast vs large on disk and slow
@silver tapir usb doesn't work for me either... I get a dmesg error saying cannot set config
I'm glad it's working for you now. I'll go ahead and close this issue. Please feel free to contact us on the forums, discord, or open a new issue in the future.
@slender iron just finished soldering up a v3 soala feather adapter -- The QWIIC connector works!.. I had a real struggle getting the microusb connector soldered w/o shorts..... Thanks for creating the board -- it will make things a lot easier to test.
I used flux, but not enough I guess -- and definitely first next time!!
π practice helps too and you are well on your way
Yes -- this was great practice. And a good test of patience and resilience
sd_flash_operation_status is volatile, so that's not the issue.
We had tended not to use sd_mutexs because there were a number of things that happened when the SD was not enabled, but this is not one of those.
what is the purpose of the R/C parts you added?
ah -- good.
As requested by @tannewt this will show the count of missing characters, if it is nonzero.
The code is very flexible about the output. It needs about 13.5K RAM for the internal tables, plus it defaults to a 4K output pixel buffer. This is to buffer as many MCUs as possible before sending to a display. You can tell it to only buffer one MCU at a time if you prefer. You can capture the pixels coming out and do with them as you please. It can generate RGB565 little or big-endian as well as 8-bit grayscale. If you have any questions, just ask.
thanks! sorry about the trailing whitespace.
It is great that sys has:
sys.print_exception(exc, file=sys.stdout)
but it would be helpful if the exceptionstring would be available as well to process in it.
Hi @onyx hinge I have now the FeatherWing for M0 and M4 (actually, I am a bit confused because there is a different bonnet for nRF52840... but that's fine).
@thorny jay I haven't used the 64x64 matrix. The code should support the 5 address lines A through E, but the existing featherwing for feather m4 express would need to be modified to actually bring the signal to the header.
@onyx hinge Would love to get your feedback if you try it
I have identified where the E should be. But I need to figure out what pin from the Feather are in use for the [RGB][12] and other [ABCD] and what pin am I left with to solder E to it. It seems easy, I just need to make an informed choice.
@thorny jay I think that you are free to choose from any pin for the "address pins". Before committing, I would test that the RGBMatrix constructor will accept your chosen pin.
This is a draft implementation to get USB HID OUT report, which added a report property for usb_hid.Device to get HID OUT report.
With the feature. we are able to get the keyboard leds info (capslock, numlock).
Usage:
indicators = usb_hid.devices[0].report[0]
Besides, Have added a report property to BLE HID ReportOut too.
It's the RGB and LAT (I think?) pins that are highly restricted.
This is the one part of the Arduino code where some knowledge of the underlying hardware is required. rgbPins[] and clockPin must all be on the same GPIO PORT peripheral (e.g. all PORTA, all PORTB, etc.). The other pins have no such restrictions
OK, so it's RGB and clock ...
that bit is from https://learn.adafruit.com/adafruit-protomatter-rgb-matrix-library/arduino-library so it's a bit hidden. "beware the leopard"
Is there a reference for which circuitpython features work on which hardware platforms e.g. the SAMD51(grand central) doesn't currently support RS485
@onyx hinge I added board.A1 and it did not complain. It did when height was still 32: "ValueError: 5 address pins and 6 rgb pins indicate a height of 64, not 32
" so there is a fair among of testing of the parameter. I guess now I need to solder that:
'''
matrix = rgbmatrix.RGBMatrix(
width=64, height=64, bit_depth=1,
rgb_pins=[board.D6, board.D5, board.D9, board.D11, board.D10, board.D12],
addr_pins=[board.A5, board.A4, board.A3, board.A2, board.A1],
clock_pin=board.D13, latch_pin=board.D0, output_enable_pin=board.D1)
'''
If anyone finds themselves with a moment to spare today, I would be very grateful to get a quick review on this PR https://github.com/adafruit/Adafruit_CircuitPython_Display_Text/pull/88. This issue came from a recent change that was initially released yesterday, so it's only been in the bundle for 1 day I believe. But I do think it's likely going to be a relatively widespread issue so the sooner we can get the fix merged in the fewer people who will end up with the affected version of the library.
darn, I was gonna look but Jeff beat me to it. π
Hi @slender iron the recent discussion about rgbmatrix make me think about ESP32S2. If ESP32S2 is going to make a Feather, then choosing the pin so that it can respect the rgbmatrix constrain (to have various GPIO in the same register) would be great. It could even be better if the FeatherWing for M0+M4 or the FeatherWing for nRF52840 could work directly for the ESP32S2, that way there would be no need for yet another FeatherWing. I am clueless about the constain and if they would be the same for ESP32S2. But it would be sad not to verify if it will be possible before commiting to pin and pin usage? Cc: @onyx hinge
It's above my pay grade @thorny jay
@prime cove there is this https://circuitpython.readthedocs.io/en/5.3.x/shared-bindings/support_matrix.html but I'm not familiar with RS485 support -- is it supported on any boards?
By which I mean, I'm not the one who makes such decisions. It's an idiom, intended to be humorous, and perhaps missed the mark
Thank you Jeff and stargirl!
@solar whale thank you, that was what I was looking for. RS485 settings are listed under the busio>uart documentation, but running them gave an unsupported error
It looks like maybe esp32s2 and mimxrt10xx have at least some rs485 support, while samd, cxd56, nrf, stm do not. That's just based on quick searching within the source code and could be inaccurate.
Thanks! Any idea why the samd does not? I believe it's supported in hardware, though even without it you just need to be able to toggle 1 or 2 GPIO pins and have a uart to get it to work with most interface chips.
This doesn't actually change the code that is built, but it is "more correct".
It wasn't done initially because it hadn't been added in tinyusb.
@prime cove not sure, but this looks ominous for SAMD https://github.com/adafruit/circuitpython/blob/main/ports/atmel-samd/common-hal/busio/UART.c#L72
and a bit more information here https://github.com/adafruit/circuitpython/issues/2354
I suppose the best way for me to approach it would just be a wrapper class around the UART to handle DE and RE GPIO. I don't think being limited to 8 data bits is an issue; most 485 devices I've run into have configurable parameters or just use 8N1 or 8N2. Thank you for the help @solar whale and @onyx hinge
good luck!
@prime cove if you are comfortable in C you could expand the SAMD UART implementation
RS485 is a bit weird because its a specific form of a broader protocol (UART)
usually we have functionality enabled or disabled at the module level but this case is different
@thorny jay that's a good point! I'll chat with limor and philb about it
@onyx hinge want to chat CAN?
@slender iron I'm around, if you want to go to voice or video you'll have to give me 5 though
@ionic elk can you pick up https://forums.adafruit.com/viewtopic.php?f=60&t=168430
its a 405 feather
@onyx hinge that'll be easier and no rush
OK I'll ping you back in a few
k np
@slender iron I will check it out, thanks for the ping
np, thank you
Is there a CPython API you are referring to? I don't see sys.exceptionstring here: https://docs.python.org/3/library/sys.html
@slender iron I'm back at my desk, do you want to DM-video, try one of the public voice chats (that didn't work well for us last time for some reason), or what?
we can try amelia first
@slender iron @thorny jay I saw that thread about S2 Feather Pins...
Have you also mentioned this to @atomic summit ? I have his pre-release FeatherS2 and I know he's changed two pins in his production design.
https://unexpectedmaker.com/shop/feathers2-esp32-s2
https://gist.github.com/jepler/e1fc3705242794e91d7b7c28c7422844 @slender iron here's the draft pyi of what canbus might look like
from pyb import CAN
while True:
print("I am the receiver")
can = CAN(1, CAN.NORMAL, prescaler=2, sjw=1, bs1=14, bs2=6, auto_restart=True)
can.setfilter(0, CAN.LIST16, 0, (11, 12, 13, 14))
while True:
while can.any(0):
_id, rtr, fmi, data = can.recv(0, timeout=10000)
print(str(_id), '1' if rtr else '0', str(fmi), str(data), sep=',')
#f.flush()
data = int.from_bytes(data, 'little')
print(_id, rtr, fmi, data)
In a package, I have an abstract class (the parent class) that should not be instanciated without overriding a function. Should I use @abstractmethod decorator and/or raise NotImplementedError() to indicate that? I may also want to have abstract @properties so that you cannot derive without defining (in my case width and height). I am really rusty on OO concept and their name... and clueless about the Python way of doing thing, and what exist in CircuitPython. Any hint is welcome. Or better, existing CP code that does that so that so that I can copycat.
For the record, I learned OO with Ada9X ... in a year where the value of X was still unknow. π
Ok, I am lost in slackoverflow... I will do a few test, and it is always possible to make comment on the PR. PM25 does use "raise NotImplementedError()".
@thorny jay I think raising not implemented is the easiest way to do it
@onyx hinge can can messages be non-byte lengths?
@slender iron not in micropython's implementation at any rate
@onyx hinge here is where I'm at: https://gist.github.com/tannewt/89ee082de9f5a98675df901cdcfbe951
@deshipu may want to review as well.
@slender iron I think the "id" is some number that the sender and receiver agree on, I guess it could be said to identify the sender's address..
is that what the filter matches on?
yup
ah
Thanks again for fixing this up @DavePutz.
I think the core issue here is that we don't actually need to run background tasks every second anymore because things are added to the queue as needed. So, we need to modify the idea of what OK is to account for stretches where no background stuff is needed. I've commented inline how to do this by making last_background_tick mean the tick when the oldest background task was queued.
Another approach to detecting when pulses come in too quickl...
The background tick count shouldn't be updated outside of the code that runs background tasks.
Please don't raise an exception in an interrupt handler because it may mess up an interrupts we're nested in and also may raise the exception with an unrelated python stack trace. self->errored_too_fast was a way to signal the issue and the calls into PulseIn could see it and raise an error when called.
I think we need to add a bit more smarts between this and background_callback. Lets have get_background_ticks be 0 when no tasks are pending. That changes here so background tasks are ok if it's 0 or the difference is < 1024.
@slender iron the Data length code is a 4 bit number, and only values from 0 to 8 may be placed in it. so yes, the messages are always whole bytes. Not just as a matter of implementation.
Hey @slender iron I've been doing the testing I mentioned I'd do last night. I can't get my builds of Adafruit/main or your native_wifi branch to flash onto the Saola and boot CP.
At first they would only flash if i left off --no-stub from the esptool command. I then updated ESP-IDF and now that isn't an issue. I can use make BOARD=espressif_saola_1_wrover flash and the board successfully flashes.
BUT, it still does not boot to CP, mount the drive or show up in /dev/tty.* the output on the external USB (the one on the wrover board) is here: https://gist.github.com/askpatrickw/36be63d1b96fd57b043c0d0065c87af3
the last line is I (627) cpu_start: Starting scheduler on PRO CPU.
Worst part is nightly builds from S3 work. AND my builds for the FeatherS2 work. I'm stumped... Any suggestions?
I wouldn't store the full decoded bitmap (aka all of the blocks) because it'll be one large allocation. If you store it at the decoded block level you have less memory overhead and more, smaller allocations. When evicting a block in favor of another the allocation can be reused then too.
ah ok thats fair. So you want to have the ability to use up possibly fragmented memory space by normally dealing with the blocks instead of a continuos bitmap block? Though is this really more me...
Hmm,
in CPython I do:
exc_type, exc_value, exc_traceback = sys.exc_info()
errorlines = traceback.format_exception(exc_type, exc_value, exc_traceback)
and this will give me what I want!
Somewhere inside CircuitPython there must be code which generates "errorlines".
And these "errorlines" are printed inside "sys.print_exception"
I am looking for a way to get to these "errorlines" without the need to print them!
@idle wharf I'm not sure why CP isn't starting
but USB is definitely broken atm
gonna look into that right now
OK.. well that you are aware of a related issue makes me feel better. I'll wait and try later. tx !
π keep an eye on the commits
Is it difficult to pass each block to the display rather than buffering them?
I would say it should be possible without violating the CPY philosophy. You would want to pass a displayio object to the JPEG library and have some functions in there to tell it where on the screen to draw the picture and possibly scale, color format etc.
The other use case would be with the GFX library where you might want to compose a framebuffer with the picture and not just draw it to the screen, I guess that might be the use case that Scott sees where you would have to handle it differe...
Reproduced this on a Clue and other BLE functionality hangs as well. With the latest source BLE works as expected on a Circuitplayground Bluefruit. I commented out the spi and display initializations in ports/nrf/boards//clue_nrf52840_express/boards.c and then the Clue BLE works properly.
@dhalbert - do we possibly still have some memory conflict between BLE and displayio?
do we have a way to check that we don't create a usb descriptor with too many endpoints?
@slender iron no, I don't think so
When I did cleanup of some of the #ifs and makefile settings around USB configuration I think you mentioned it was a "would be nice"
is it what bit you this time?
yup, I enabled MIDI
ah
and now it's disabled again π
how would one check the number of supported endpoints? does tinyusb provide it as a macro or anything?
no, I think we'd need a port setting or something
Β―_(γ)_/Β―
I'm not going to worry about it now
ah ok thats fair. So you want to have the ability to use up possibly fragmented memory space by normally dealing with the blocks instead of a continuos bitmap block? Though is this really more memory friendly given that you have to keep track of all these blocks?
Right. It's easier to allocate small blocks into fragmented memory instead of small ones. I don't know how big each block would be but I'd do it at the JPEG unit level.
Is it difficult to pass each block to the display rath...
If you are OK with it, I would be quite happy to get rid of all the tick
checking in the Pulsein code and just set
the self->errored_too_fast flag if the buffer overflows. An overwritten
buffer will not have valid data in any case.
I am not quite sure where to check the self->errored_too_fast flag and
raise an error though. Looking at the
library code for irremote and the dhts it looks like they are looping and
calling popleft() until the pulsein object has a zero
length. Maybe check & raise...
.. however, the number of endpoints is only set for SAMD (8). Other ports need to set the value. Otherwise, the build will show the message
Unable to check whether maximum number of endpoints is respected
Once all extant ports set the value (I'm happy to add them to this PR) we'd change it so that it's an error to NOT specify it.
@idle owl For the PM25, maybe it would be more readable if I split the simple test into two copy, one purely I2C and one purely UART. Each will be more simple and not make unecessary include.
@thorny jay I believe we'd like a self-contained simpletest specifically for the simpletest file. If you'd like to do something different as an I2C or UART example, that would be something we could consider.
I'm heading out for the night. I will reply to any further discussion tomorrow. Have a good rest of your day!
I have been overwelm by the number of comment and the interface of GitHub to resolve that. I hope I did not mess too much, I did everything "online".
Ok, I think I fixed everything.
@thorny jay You didn't mess anything up, it's simply little tweaky things the doc rendering needs.
Doc, I need to check your Sphynx thing. Have a good night.
Circumventing displayio to talk with the display directly would break down whenever you have something about the image like text because the composition is done MCU side, not on the display itself.
Sure! Thats why I thought it might be nice to have both ways. Either decode JPEG into bitmap and do composition with other elements or if you just want to draw it on the screen directly you can do that too by passing the decoder the displayio object to write to
For the case where f.e. you hav...
@idle wharf here is my requests version: https://github.com/tannewt/Adafruit_CircuitPython_Requests/tree/http11
just pushed a new native_wifi with fixed usb
@slender iron Awesome! Iβll check it out tonight. First up. Go Flyers! (Hockey sport ball)
I missed these when I first added the utf-8 repl functionality in #3243.
?serverinfo
After #2879, Spresense did not work because usb_background function was not called.
This PR fixes this issue.
@idle owl maybe this issue will be interesting for you. I wanted to run the Pedometer learn guide https://learn.adafruit.com/clue-step-counter-st-lsm6ds33 on the CLUE. But the step count was missing from the library. Now the library https://github.com/adafruit/Adafruit_CircuitPython_LSM6DS has been fixed and splitted from library to package. So I wanted to manually do things... but now I discover that the CLUE library also used LSM6DS and so will fail as soon as it is release: https://github.com/adafruit/Adafruit_CircuitPython_Clue . This is where I give up (for the moment?)! There is some library dependancy and release management that will be required. Possibly, a lot of CLUE related learn guide will stop working when any of those two library change. Maybe there is a way to smooth the transition, like having two different library, the old one, and the package. And not remove the old one until a lot of things have been migrated.
I did give a "try" and catching import error, but I don't find a way with "import" "from" "as" to make the package look like the library or the library look like the package. It might be possible, but I failled. If there is a solution, then I am interested for PM25 and IS31FL3731, as the same kind of thing take place there.
hm I have to remember how to connect to the debug interface on the SAM E54..
@tannewt I think this should be good to go.
Thanks for the CPython example! That's what we'll want to follow when we add it.
I can't give more guidance because I don't know how the traceback code works.
I'm totally OK with it! I think that'll be much simpler.
Ya, I think popleft is a good spot. Perhaps also having an explicit errored property would be good too.
Thank you! I'll test with ESP32S2 once merged.
Thank you! @dpgeorge follow up you may want too.
Sorry for breaking it! Thanks for the fix.
I'm on a roll
anyone want to help test led matrix improvements here: https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3731/pull/32 ?
@slender iron are you declaring all functions in .h files as extern now, for gcc10? I thought you were doing that for globals, but not necessarily functions. I think extern is the default for non-static functions.
Use of extern with C functions:- By default, the declaration and definition of a C function have βexternβ prepended with them. It means even though we donβt use extern with the declaration/definition of C functions, it is present there. For example, when we write.
variables and types I think
I see stuff like that a bunch of places. ... OK, I just did a merge and a bunch of extern's were added
to functions?
yes, in _bleio
definitely have been adding them. not sure where
but I've been chasing compiler complaints so they must be needed
so the point is it's not necessary for functions, but is necessary for globals. On the other hand, it's a lot easier to be consistent.
i have NOT tried to build with gcc10 yet. I'll take another look. I just wanted to know if you had made a deliberate decision. tnx
π
This pull request is for the Mini SAM M4 board. I needed to add a second type of memory to the board file.
seems fine to merge if it passes CI. The list of commits stating that it merges our pull request #2 seems weird but the "files changed" looks as expected for the PR description.
Another issue is a url with special characters, all sorts of issues there. Unable to deselect the feature once set. Page won't load and filter the feature, etc.
Example:
https://circuitpython.org/downloads?manufacturers=Sean+'xobs'+Cross
anyone want to help test led matrix improvements here: https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3731/pull/32 ?
Thanks @slender iron Actually, I tested all the driver with my hardware. It give strange result as they don't use the same height and width, but the strange result are consistant (I should video record the original output and the new output, but mostly that part is unmodified). My last fight was with the documentation and how the documentation of package should be done. Some library only list one file: https://github.com/adafruit/Adafruit_CircuitPython_LSM6DS/blob/master/docs/api.rst where other list multiple: https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground/blob/main/docs/api.rst . I don't really know how to see the output of Sphynx to see the result, so I made blind change.
This is a response to #27 .
I have split the best I could the various driver, updated all the example and tested the one I could (mostly Scroll pHAT HD and LedShim).
The sub-driver for those two be...
Contribute to adafruit/Adafruit_CircuitPython_LSM6DS development by creating an account on GitHub.
ah, ok great!
doc build instructions are here: https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs
I keep running into this -- is there something "different" about the protomater submodule? or is it this PR -- I don't see this with other PRs ```[Jerry-desktop-mini:/Volumes/CircuitPythonBuild/circuitpython] jerryneedell% git fetch origin pull/3237/head:pr_3237_test
remote: Enumerating objects: 49, done.
remote: Counting objects: 100% (49/49), done.
remote: Total 62 (delta 49), reused 49 (delta 49), pack-reused 13
Unpacking objects: 100% (62/62), done.
From https://github.com/adafruit/circuitpython
- [new ref] refs/pull/3237/head -> pr_3237_test
Fetching submodule lib/protomatter
fatal: remote error: upload-pack: not our ref 2408e9c033f5ec050967b1592b29a950a831d6c2
fatal: the remote end hung up unexpectedly
If I repeat the command -- it does not complain and the branch exists ....
@thorny jay We are supposed to keep up with changes like those. The appropriate thing to do is file an issue on the library with the dependency failure (so in this case CLUE), and mention it needs to be updated. This sort of thing will happen, and exactly like we have to update guides associated with particular libraries when we make breaking changes to a lib, we should be updating libs using other libs when we change the lib. Adding a way to have different versions of a library is not a good solution, it will lead to confusion and support issues.
@solar whale I wish I knew
that PR has unintentionally modified the ref of lib/protomatter multiple times. As far as I can tell, the ref 2408e... was the ref of lib/protomatter during one of the intermediate commits but not at the tip of 3237's branch.
I think I'll just wait for the PR to be merged ...
if you want to do testing you can pick up uf2s from the PR's actions .. do you know how to do that already?
.. we love it when you do testing
yes -- good idea.
I wish I could figure out what types things into the REPL of every circuitpython board I plug in. I've removed modem manager. I've failed to identify anything else udev or systemd would be "running on" the device. But I always get some characters repeated back (slightly munged) from the boot-up messages into the REPL. "D Ado-reload is o"
"oh linux, you try so hard"
The spew actually occurs when I open the terminal device, whether or not it's a traditional terminal program
e.g., true < /dev/ttyACM4
does this happen to anyone else?
I get βKeyboard Interruptβ randomly and gibberish on the REPL input after I leave a board alone for a while and work on the computer (older iMac). Some random USB signals that check in on devices on the bus? But if doesnβt sound like what youβre getting.
@slender iron what do you think of "Listener" vs "Queue" vs "Receiver"?
I kinda like CAN.listen() -> Listener
@onyx hinge fine with me
What if .next() raises StopIteration in the case of timeout? That would let you process messages until there's a gap of 'timeout' between messages.
oh, that permanently makes t he object not iterable anymore?
if Listener.__iter__() returns self, and Listener.next() raises StopIteration for timeout, couldn't you repeatedly loop on the same listener?
ya, I suppose
This is the structure I'm imagining, but maybe it is not good structure:while True: for message in listener: process message do other stuff when gap in messages
NORMAL = auto()
LOOPBACK = auto()
SILENT = auto()
LOOPBACK_SILENT = auto()``` should this be one enum, or 2 bools? "silent" and "loopback" as bool properties
(and "silent" is the same as not giving a TX pin, ... I think ?)
the alternative is:
for message in listener:
if not message:
print("timeout")
continue
# process message
two bools seems better to me
easier to document too
if message is None:
do other stuff when gap in messages
continue
process message
(yeah I just said the same thing as you)
I don't expect the "do other stuff when a gap" is useful
because a time out is the end of a gap potentially
then what would you write inside 'if message is None:' -- just continue? break? sleep(1); continue?
true, if you have nothing to do then you don't need to set a time out
"do other stuff" would probably do before the if
oh if you set timeout=0 or timeout=None (whichever is standard circuitpython?) then you'd never get a None return so you don't have to deal with it?
right, instead of using stopiteration on timeout
I'll keep thinking about this, but now it's closing in on pizza making time
I do appreciate having your slightly revised doc to work from
Made changes to remove relying on ticks to decide if pulsein is taking too long. It will now raise an error when the call to popleft() is made. If uncaught this will result in a stack such as:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "test2_ir.py", line 18, in <module>
File "test2_ir.py", line 13, in <module>
File "adafruit_irremote.py", line 243, in read_pulses
File "adafruit_irremote.py", line 206, in _read_pulses_non_blocking
Or...
My guess is "because memory"... but I'm curious why CP doesn't implement .__dict__ on objects. In Python its one of my favorite hacky ways to figure out what I'm doing.
could you fake it? Something like (untested / incomplete) ```class DictProxy:
def init(self, obj):
self.obj = obj
def __getitem__(self, idx):
return getattr(self.obj, ix)
def __setitem__(self, idx, value):
return setattr(self.obj, idx, value)
# etc
@hierophect this looks weird, I think it's due to the way you split a long string across multiple lines inside translate().
Does it work to do it in the more standard way,
translate("Here is the first part of the string "
"and here is the second")
? If not it's probably best to have an overly long line in the source rather than have these spaces in the messages.
BTW WIFI is working on my Espressif ESP32-S2 Saolo as advertised !
(sysname='esp32s2', nodename='esp32s2', release='5.0.0', version='5.0.0-beta.0-2632-g80b15f6b3-dirty on 2020-08-19', machine='Saola 1 w/Wrover with ESP32S2')
Start Scan
SSID: Jenga
SSID: henther
SSID: xfinitywifi
SSID: xfinitywifi
SSID: PS4-FDBC7527F6EA
SSID: FBI_Van
SSID: MOTO4ACA
SSID: ARRIS-E5AD
SSID: WaveG Public WiFi
SSID: TP-LINK_3D37
SSID: INTRANET
SSID: xfinitywifi
SSID: xfinitywifi
SSID: The_GreenDragon
SSID: Pawnee Commons Wifi
SSID: KeepYourWifiInLine
Scan Completed
WIFI Connected: True
IP: 192.168.1.27
GoogleDNS Ping Response: 0.008
@onyx hinge I code more procedurally (linerally?) whatever the word is, so I would tend to try and make a function. Are you saying, I could define a class and that class would take an object and return the same object with an added property of .__dict__ ?
One rename request to make things clearer. Thanks!
I converted this to a draft pull request. Would be happy for someone else to take a look at it, but it's not on my short list right now. We can also close this up if it's not useful to leave it open.
WiFi also working on the FeatherS2 as advertised...
(sysname='esp32s2', nodename='esp32s2', release='5.0.0', version='5.0.0-beta.0-2570-gd615cc9fd on 2020-08-19', machine='FeatherS2 with ESP32S2')
Start Scan
SSID: henther
SSID: FBI_Van
SSID: Turn On, Tune In, Drop Out
SSID: WaveG Public WiFi
SSID: TP-LINK_3D37
SSID: INTRANET
SSID: xfinitywifi
SSID: comcast-gw-sea-guest
SSID: comcast-gw-sea-2g
SSID: Crouton
SSID: The_GreenDragon
SSID: Pawnee Commons Wifi
SSID: Ko_Olina
SSID: JP
SSID: Medialink_1E7250
SSID: xkcd910
SSID: Smartypants
Scan Completed
WIFI Connected: True
IP: 192.168.1.28
GoogleDNS Ping Response: 0.013
@onyx hinge I guess I should add... I know I could make it happen like you mention. I was curious as to the thought behind not including it.
I think you'd have to ask around at Micropython, it seems to be a decision made pre-circuitpython. Probably "it's not needed, it constraints implementation choices, leave it out". Except there also seems to be an option for a read-only or copy __dict__ property in the source of circuitpython. curious.
https://github.com/micropython/micropython/pull/1757 doesn't really seek to make it clear to outsiders what the trade-offs are
There is a nice little example though in the linked issue which is still open. I tried this on my FeatherS2.
print(dir(wifi.radio))
for p in dir(wifi.radio):
val = getattr(wifi.radio, p)
print(p, val, type(val))
Output
['__class__', 'connect', 'enabled', 'ipv4_address', 'mac_address', 'ping', 'start_scanning_networks', 'stop_scanning_networks']
__class__ <class 'Radio'> <class 'type'>
connect <bound_method> <class 'bound_method'>
enabled True <class 'bool'>
ipv4_address 192.168.1.28 <class 'Address'>
mac_address None <class 'NoneType'>
ping <bound_method> <class 'bound_method'>
start_scanning_networks <bound_method> <class 'bound_method'>
stop_scanning_networks <bound_method> <class 'bound_method'>
Anyway, fun stuff to research. Thanks @onyx hinge !
I have this code running on a PyPortal:
import board
from adafruit_pyportal import PyPortal
# Set a data source URL
IMAGE_URL = "http://192.168.1.109:8000/image_compressed2.bmp"
TEXT_URL = "http://192.168.1.109:8000/test.txt"
# Create the PyPortal object
pyportal = PyPortal(
# url=TEXT_URL,
# image_url_path=IMAGE_URL,
status_neopixel=board.NEOPIXEL,
debug=True,
# convert_image=False
)
pyportal.set_background(0xFF00FF)
# Go get that data
# pr...
Looking at the second example, perhaps it would make sense to have pulseio.reset() at this point.
Is there an easy way to check all the requirements.txt from all the repo part of the library bundle or community bundle and see if they make a refrence to "adafruit-circuitpython-lsm6ds"? Then check in https://github.com/adafruit/Adafruit_Learning_System_Guides if guide would be affected by the release of 4.1.0 of LSM6DS?
I just made a script that searched learn guide repo for projects using a specified library last week. I think it could help with that
With library restructuration into package, the import and/or usage is different. I will trigger that problem in PM25 and in IS31FL3731 ... so I am pretty much interested into detecting cascade effect of such change.
My script is in this issue: https://github.com/adafruit/Adafruit_Learning_System_Guides/issues/1209 when run inside the learn guide repo it will search for all projects that contain python files and then search all of those python files for adafruit_button in my case, but could be modified to any other library, Or could also search for constructor use or something beyond the import statement if desired.
In the adafruit_button library PR #23 the button API was changed slightly so that the button itself can be added to Groups and Displays rather than needing to add the group property like: button.gr...
moved the question to #help-with-circuitpython .
@frosty prairie the #help-with-circuitpython channel is probably the best place for this since it's not related to development of the project. It is fine to ask about questions micropython, but I will say there is likely a lot more experience with Circuit Python specifically than with Micropython amongst the community. So it may take a bit longer and be harder to get micropython specific things answered.
Adds _bleio support for UART-based HCI adapters. Tested with ESP32 firmware on Metro M4 Airlift and with an ESP32 breakout. Firmware used is attached to this PR.
This version supports operation as a peripheral only. Specifically it has been tested with UARTService, using the Bluefruit LE Connect app. Scanning, initiating a connection, access to remote characteristics, and bonding/pairing are not yet implemented. Code to be rewritten is commented out and mostly marked as //FIX.
The...
Use this firmware (unzip first) to test:
Hi @gilded cradle I have split into separate files the library IS31FL3731. So now I have copyright statement for each separate board. So I would like to know the board you added to the library, and those already present and done by Tony DiCola. I have the feeling you worked on the Bonnet because those imply Blinka work to implement on Raspberry Pi. I'll try to check the GitHub history, but with major rework like black or pylint, it is hard to use blame and know what lines are coming from you. My PR is here: https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3731/pull/32
anyone want to do a release today?
@thorny jay I think I just worked on improving overall functionality, so I'm not particular how you split it up.
It is split by board. I keep both of your name in every file, except the two Pimoroni board I added to the library.
Sounds good
@stoic parrotMelissa If I want to write a library to support Pimoroni 16x16 Unicorn Hat HD, should I use framebufferio like you do for matrix LED? I am a bit confuse between the framebuf, the pixelbuf and maybe other.
I'm not sure how that's setup hardware-wise. I believe that's for the Pi and there currently is no PyPixelBuf for the Blinka. I would think it would be neopixels though.
I think I need a big buffer because what Pimoroni does is to use numpy and basically it is SPI transfer of the buffer.
Updated board images and added a reference to our custom Evo M51 CircuitPython library bundle in the Downloads .md file.
ok, maybe use the neopixel spi library then
No it is not neopixel. And yes, it's for the Pi but the goal is to use that from a Feather.
The second example might be a bit misleading. In order to test and hit the
error I created a
PulseIn object with a buffer that was intentionally too small. So, to
correct and keep
going I re-created one with a large enough buffer. If buffer size was not
the problem you
could do something like:
pulsein.pause()
pulsein.clear()
pulsein.resume(100)
On Fri, Aug 21, 2020 at 2:37 AM Radomir Dopieralski <
notifications@github.com> wrote:
Looking at the second example, pe...
I have already used the neopixel library for Unicorn pHAT (4x8) and Unicorn HAT (16x16). But I made no driver no nothing as the code from Adafruit is sufficient... except if I could use the fact that the geometry is know to better handle the matrix.
But the Unicorn HAT HD does not use NeoPixel nor DotStar, they use normal RGB LED (non addressable) and they have their own electronic to drive that. So they implement an SPI protocol that I need to implement in Circuit Python.
Sounds like it's similar to an RGB panel which we don't have support for yet
So it pretty much look like RGB matrix for which there is support in CircuitPython: "RGB LED Matrices with CircuitPython". When you say "we don't have support for yet" you mean in Blinka? I am not really interested in the Pi or SBC. I am interested in driving Pi hardware from an MCU.
They even have Ubercorn and you can daisy chain those one behind the other to make larger board.
Yes, I meant Blinka. I thought that's what you were referring to since you said it's a HAT.
Maybe you have not seen the stuff I have done so far. From an MCU (Clue or Feather) I controled: Blink! + Scroll pHAT HD + LED Shim + Unicorn pHAT + Unicorn HAT + the RGB LED and segment LED of the Rainbow HAT.
I am pretty sure all of those would also work on a Pi... I mean on a Pi with Blinka and CircuitPython.
But that is not really very interesting as Pimoroni already provide Python Library.
Ok, I hadn't and I'm understanding now. Maybe look at https://learn.adafruit.com/rgb-led-matrices-matrix-panels-with-circuitpython then.
Ok, I'll try to understand the framebufferio that seems to be used. The goal is to be able to use DisplayIO and all the other stuff on top. So I need to provide the right API so that it is transparent.
I hope to have it all in Python as I don't want to go into the "firmware".
Yeah, I understand.
someone want to help get this into pypi: https://github.com/adafruit/Adafruit_CircuitPython_TC74 ?
Looks like this PR still has a lot of background tick changes. Want to just apply the changes to PulseIn.c from 6eae7ce78f8dd2c1968e54e98cfe1189c4d35062 ?
Why should this be <=? The original is <.
I wouldn't clear this here because you could call it a second time by catching the exception. I think it should be left in resume.
@slender iron Can you file an issue and assign it to me on the TC74 repo? The docs aren't working, Actions isn't setup, there's a lot of other things doing on. PyPI should happen automatically once all of that is working.
yup! thank you!
@slender iron PyPI creds do not need to be added. They're global now. It's everything else that needs to happen.
haha, ok. that's why I'm not doing it. I'm behind the times
Would you mind removing the actual build and un-drafting this? It'd be nice to get the gcc10 fixes in this PR merged in.
Translations update from Weblate for CircuitPython/main.
Please merge in the latest version of main. It has some code size improvements that may help this fit.
@slender iron For the community bundle, do we recommend running cookiecutter and so on before submitting?
The few I checked have our CoC in them, so I assume it was run on those. But I didn't check all of them.
ya, I think it's a good idea
not a requirement though
I think my sharing guide recommends it
Alright, that's exactly what I was about to say to someone. But second guessed it. Thanks.
np, thank you
Here are my comments wrt/shared-bindings only.
This seems very weird to me. It should just be a constructor. Maybe _bleio.adapter should be assignable.
Seems to me that we'll want this to act like a built in display where the board_init can set it up or the user code can and it applies after the VM too.
The other thing to think about is that the HCI transport can vary. I think SPI and shared memory are also used.
Did this move somewhere? I do want to get back to finishing it.
When hitting CTRL-C during the long output described in issue 2689 the pending exception was never being cleared.
As a result; in displayio_background() the call to mp_hal_is_interrupted() would always return true and the displayio screen would stop being updated. This patch simply clears any pending exceptions when readline_init() is called (i.e. when the REPL prompt is being printed).
Are there any known issues with using PWMOut after AnalogIn on a pin (with deinit()) on an nRF52840 based board like the CLUE? It doesn't seem to work for me.
This example is from a CLUE running 5.3.0
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.3.0 on 2020-04-29; Adafruit CLUE nRF52840 Express with nRF52840
>>> import pulseio, board
>>> p0out = pulseio.PWMOut(board.P0, frequency=50, duty_cycle=0, variable_frequency=True)
>>> p0out.duty_cycle = 32768 ### good
>>>
>>>
soft reboot
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most ...
@slender iron Can you review this right quick? You have to make changes for Actions to fire for the first time. I found a couple of things to fix. https://github.com/adafruit/Adafruit_CircuitPython_TC74/pull/2
yup
Thanks.
@slender iron Ok, RTD is set up, Actions is running properly, and it's uploaded to PyPI.
thank you!
I'm as usual checking to see if there are strings-to-translate to spanish in Weblate. I found an error message that might have some extra spaces. Not sure if this is a bug or not.
https://github.com/adafruit/circuitpython/blob/main/ports/atmel-samd/common-hal/pulseio/PulseOut.c#L104
The string itself is a line of text, the \n, and then 37 spaces, and then the second line. Not sure if the spaces belong there, can someone please confirm?
I'm facing a very difficult bug (I think), with I2CPeripheral. Most packets I intend to send are fine, but there are some combinations that will refuse to send with r.write()
This fails to send: 0xa8, 0x2f
Saleae logic output:
Setup Write to [0x0B] + ACK
0x14 + ACK
Setup Read to [0x0B] + ACK
<blank>
This sends fine: 0x67, 0x30
Saleae logic output:
Setup Write to [0x0B] + ACK
0x14 + ACK
Setup Read to [0x0B] + ACK
0x67 + ACK
0x30 + NAK
To expand on my i2cperipheral problem above, the ranges of ints that send are separated by a span of 128.
0-127 -> Can send
128-254 -> Cannot send
255-511 -> Can send
etc.
Perhaps just a quick question. What function can I use in the C source files to be able to log to the REPL for troubleshooting purposes?
BTW, I've tried v4.3.1, v5.3.1, and latest v6, as well as on M0, and M4
Revisiting this, I skimmed over the fact that the original repro steps for this were as simple as "try to write to the Circuitpython drive twice in a row". That definitely isn't happening anymore, at least not under any kind of regular conditions. We had several instances where memory corruption errors relating to dereferenced pointers were fixed earlier this year, I'd expect this was resolved with one of them.
@siddacious sorry I didn't get on this faster way back when it was still relev...
Reproducible code:
import board
from i2cslave import I2CSlaveregs = [0] * 16
index = 0
reg_check = 0while True:
with I2CSlave(board.SCL, board.SDA, (0x0b, 0x41)) as slave:
while True:
r = slave.request()
if not r:
# Maybe do some housekeeping
continue
with r: # Closes the transfer if necessary by sending a NACK or feeding the master dummy bytes
if r.address == 0x0b:
print("address 0x0b")
if not r.is_read: # Master write which is Slave read
b = r.read(1)
# if not b or b[0] > 15:
# break
index = b[0]
b = r.read(1)
if b:
regs[index] = b[0]
elif r.is_restart: # Combined transfer: This is the Master read message
print("Restart")
n = r.write(int.to_bytes(reg_check,2,'little')) #FAILS TO WRITE PACKETS AFTER 127
reg_check +=1
#else:
# A read transfer is not supported in this example
# If the Master tries, it will get 0xff byte(s) by the ctx manager (r.close())
I've confirmed there is a regression, looks like something broke in the low power code. It's not related to this issue so I'm closing this.
On the main branch, the Meowbit encounters an issue related to SysTick->CTRL at startup during clock configuration, and unexpectedly enters the reset handler before any code can execute. Not yet confirmed whether this occurs across all F401 boards or potentially the rest of the access line.
Tested with code starting at the default address, so the issue is known to not be related to the Meowbit bootloader.
I see it's getting stuck on the following in: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c
if (!self->sercom->I2CS.INTFLAG.bit.DRDY) { return 4; //changed this to return 4 for debugging }
When configured the CircuitPython heap will be on the external RAM.
When not available, the heap will be 48k inside the IDF heap.
Issue
Peripheral fails to send bytes when of certain range, spaced out by 128.
0-127 -> Can send
128-254 -> Cannot send
255-511 -> Can send
etc.
Hardware/Software
Have tried on a GrandCentral M4, and Trinket M0, same results. I've tried v4.3.1, v5.3.1, and latest v6.
Observations
- The span at which the transfers take place and do not are 128 bytes apart
- Changing to big endian bytes seems to alleviate the problem (at least in the low integer ranges, need to go fu...
@spice crypt to print to serial from C do mp_printf(&mp_plat_print, <regular printf args>);
hi want me to test on hardware?
I only have a Saola wrover, and not a wroom. Are they physically the similar?
I want to know if I can use the image that illustrates the wrover in the downloads page, as the image for the wrover.
My PR is failing for "Test Documentation Build"
/opt/hostedtoolcache/Python/3.8.5/x64/lib/python3.8/site-packages/autoapi/extension.py:133: RemovedInAutoAPI2Warning: autoapi_template_dir will be expected to be relative to conf.py instead of relative to where sphinx-build is run
344
345
warnings.warn(
346
/opt/hostedtoolcache/Python/3.8.5/x64/lib/python3.8/site-packages/recommonmark/parser.py:75: UserWarning: Container node skipped: type=document
347
warn("Container node skipped: type={0}".format(mdnode.t))
348
349
Warning, treated as error:
350
/home/runner/work/circuitpython/circuitpython/shared-bindings/_typing/index.rst:59:duplicate object description of _typing.ReadableBuffer, other instance in shared-bindings/_typing/index, use :noindex: for one of them
351
##[error]Process completed with exit code 2.
I suspect it's something to do with the documentation but I'm struggling to figure out where is the issue in my code.
Any hints on how to decode the error message?
Oh, no! Just realized I have 41 files changed.. Ugh!
You have to locally install Sphynx and see the result there.
I only have a Saola wrover, and not a wroom. Are they physically the similar?
I want to know if I can use the image that illustrates the wrover in the downloads page, as the image for the wrover.
@silver tapir I want to know which one to order to closely follow the streaming... I guess I need the wroom. Just one need a physical antenna added to the tiny coaxial connector.
Correct.
@mental nexus with the new stubs and AutoAPI, its a little esoteric to find some problems. I think I've found the issue; will comment on your PR if it pans out.
Thanks @raven canopy I appreciate any help.
The Sphinx build error is related to the formatting here. For multi-line descriptions on rST parameter fields, you have to use a hanging indent. I got the docs to build successfully by updating to the following:
//| :param int x: Horizontal pixel location in bitmap where source_bitmap upper-left
//| corner will be placed
//| :param int y: Vertical pixel location in bitmap where source_bitmap upper-left
//| corner will be pla...
@thorny jay The Saola Wrover has the 2MB PSRAM, same price.
@silver tapir I think the only difference is inside the module, and the wording on the module.
(wroom left; wrover right)
and of course the "I" variants have the IPEX antenna connector and bypass the onboard antenna via different resistor placement
The original is correct, I was thinking of self->len as a length rather than an index.
@silver tapir If it's the string I'm thinking of, I asked @ionic elk about it, but it was a comment on a merged PR so I don't know if it'll get attention. Someone should simply fix it in the source.
I think that since we are in an interrupt handler we should make sure other interrupts don't possibly conflict.
The background tick changes were left in because frequencyio/FrequencyIn.c still depends on them. Should we look at changing that as well? I don't have a FrequencyIn test, though.
@raven canopy Thanks for the help with the corrections on the Sphinx documentation!
If you like. I tested on WROVER and FeatherS2 on stream.
It looks like we might be subject to a new pylint check raise-missing-from
The newest CI actions are showing that they installed pylint version 2.6.0. The most recent actions that succeeded were 2.5.3
Yay! Thanks @sommersoft for the guidance on the docs.
I shortened some of the error strings to help it fit into all the M0 builds.
This page lists the relevant changes: http://pylint.pycqa.org/en/latest/whatsnew/changelog.html including the new raise-missing-from check.
maybe a long shot, but since y'all have deal with tinyusb a lot: I've added tinyusb to my usb firmware - I got it to enumerate, but I can't seem to get it to send or receive usb midi data. :/
Any ideas?
nvm, I got it figured out. I had the clocks wrong.
I don't know who need to do what, but it would be great to release a new version of the CLUE library ( https://github.com/adafruit/Adafruit_CircuitPython_CLUE ) now that it contain a fix for the breaking change in adafruit_lsm6ds that is available in bundle "adafruit-circuitpython-bundle-6.x-mpy-20200821". So if next bundle could fix it, it will make the live of CLUE owner (Adabox) more fun. For support, right now they can stick with "adafruit-circuitpython-bundle-6.x-mpy-20200820" or earlier but not use the Pedometer example.
Hey @tulip sleet how do you calculate the report_length in a USB HID Report descriptor?
I think I worked it out after a bit of investigation. A high-level formula could be:
SUM OF (REPORT_SIZE * REPORT_COUNT) IN HID REPORT DESCRIPTOR
Thanks @thorny jay I just made a new release for it that includes the latest fix.
Thanks to you. I have been frustrated that no Release Management was taken so that both lib with one relying on the other were not released simultaneously. I have not fix all of the Learn guide sample I found, but I made a few PR left and right, and except for the pedometer on CLUE, the other one are "blind change" based on the syntax change introduced (and only tested on one). So there is still a little bit of change to do. Most of those guide I cannot test, like Ukulele or what not. So I guess the author are best placed to check that.
ok this loaded onto my saola but i cant seem to get displayio demo on oled running
import board
import busio
import displayio
import adafruit_displayio_ssd1306
displayio.release_displays()
print(dir(board))
i2c = busio.I2C(board.IO8, board.IO9)
display_bus = displayio.I2CDisplay(i2c, device_address=0x3d)
display = adafruit_displayio_ssd1306.SSD1306(display_bus, width=128, height=64)
->
13:31:29.471 -> [0;32mI (862) cpu_start: Starting scheduler on PRO CPU.[...
The code itself is a bit beyond me still, so I can't offer up much feedback on that. I'm gaining a better understanding all the time, and looking over code like this is definitely helping.
The results are great though! I tested this out on PyGamer and Wio Terminal with this test script that copies a 16x16 blinka bmp and fills the screen with it:
import displayio
import board
import time
import adafruit_imageload
display = board.DISPLAY
def py_blit(target_bmp, target_x...
Is there any progress on this behind the scenes? I would also really like to see this happen in CPY. I think especially with the ESP32-S2 coming along you will absolutely need this for networking.
In my experience working with a lot of art students at my day job over the years, events are the easiest concept to understand as it is just a function thats being "called for you" but the asyncio way seems also fine to me albeit it needing a bit more things to understand and take care of but espec...
@PTS93 @WarriorOfWire has discussed this with us extensively on discord, and created a simple library: https://github.com/WarriorOfWire/tasko. I intend to look at this in more detail fairly soon. I have been working on another BLE implementation and have not had time to work on this for the past few months.
Could you please also provide the i2c host side with circuitpython to make it easier to reproduce. (Is this a clock stretching thing? I know the rpi doesn't support it.)
Yes, here it is, running on a Trinket M0. Even between the TrinketM0, and GrandCentralM4 alone, it fails to transfer.
import busio
from board import *
from adafruit_bus_device.i2c_device import I2CDevice
import time
with busio.I2C(SCL, SDA) as i2c:
device = I2CDevice(i2c, 0x0b)
bytes_read = bytearray(2)
while True:
try:
with device:
device.readinto(bytes_read)
except:
print("ERROR")
else:
...
This also fails on the PyGamer . Issue seems to be related to adafruit_sdcard . If sdcardio is used instead it works fine.
odb-test.zip
This example can use either adafruit_sdcard or sdcardio . Just comment and un-comment as needed.
As sdcardio works and is faster it would be a better default choice for PyPortal defaults. Working on a PR now.
Is there some sort of change in a build/CI file somewhere when a library changes from being a single file to being a directory with multiple files inside? in order to get the PyPi uploading / installing to work properly specifically.
[I had trouble adding the related issue to Linked Issues, until I edited it into the description of this PR]
ah yes packages vs. py_modules in the setup.py file.
Hello, and thanks!
I'd like to understand a bit better what is happening here, so please bear with me.
When ctrl-c is pressed and this bug occurs, I assume that (on serial) it just prints the ">>>" prompt, and not an exception? (in contrast to the interruption of a long-running calculation, say)
What type/value does mp_pending_exception have when this code is reached? Superficially, it looks like just after the call to readline_init, the call to readline_process_char will call `...
It looks like it's working for me. I think it's your wiring. What value of pull up resistor are you using?
Tests show that the pending exception is, in fact, an mp_kbd_exception. The code quoted is in mp_hal_delay_ms(), and there are no
calls to sleep() to hit in the example test. Interestingly, issuing a time.sleep(1) from the serial REPL prompt does clear the exception and the screen display resumes. I don't see any code in mp_hal_stdin_rx_chr() that looks like it would be clearing the exception.
Migrating to CircuitPython, 1-wire interface generates the following runtime error:
Traceback:
ow_bus = OneWireBus(board.D2)
File "/usr/local/lib/python3.7/dist-packages/adafruit_onewire/bus.py", line 79, in init
self._ow = busio.OneWire(pin)
AttributeError: module 'busio' has no attribute 'OneWire'
Process finished with exit code 1
----------------------------------...
It looks like we might be subject to a new pylint check
raise-missing-from
@lone axle Ok, now I understand what you mean. I made a minor unrelated change to a PR that was passing and now it is block on that pylint check. What should I do? (1) try to install pylint 2.6.0 on my side and make it happy? (2) make pylint ignore that line in my code? (3) change the pylint configuration to say it can ignore that (maybe that should be global thing for all the library)?
That looks good! Though I assume it will support more than just intervals?
Hardware and generalized software interrupts are definitely something I'm looking forward to the most.
So trigger on input change or trigger on message received (e.g async network, async busio).
@thorny jay I think the solution that pylint is looking for is to use from keyword when raising an exception from another one. In the case that I found we were catching a RuntimeError and re-raising it with a more helpful message. Using from like this got pylint to stop complaining:
except RuntimeError as run_error:
raise RuntimeError("Text length exceeds max_glyphs") from run_error
note the as run_error and then from run_error
I found this blog post to be fairly helpful in understanding it: https://blog.ram.rachum.com/post/621791438475296768/improving-python-exception-chaining-with
I used (3) by changing the rc file.
I think it would be best if we do go ahead and use the from keyword syntax. I was unfamiliar with it before running into this pylint check. But it does seem like a positive thing. It can make the stacktraces a bit more detailed.
I appear to have pasted alternate-universe contents of mp_hal_stdin_rx_chr. I apologize for the confusion.
Specifically, I appear to have been referring to a branch I haven't pushed, which was intended to fix the problem that during a call to input() or stdin.read(), ctrl-c did not raise a KeyboardInterrupt until some other char is pressed. I wrote the code I pasted and haven't gotten around to testing it.
5.6kohm, then tried stronger for sharper edges but didn't help. I think I know the cause of the problem, but not the mitigation yet.
When the 2-byte data packet to be transferred has a leading 1 in the first byte. Ex. 1000 0000 0000 0000, the SDA/SCL clock edge timing may just too tight, and cause the i2c peripheral to conk out.
I'm hoping there are some registers I can adjust to relax the timing. From what I've read, this may be under ASF4?
Here's a scope capture.
![good_vs_bad_t...
I noticed that during sys.stdin.read(1) or input(), hitting ctrl-c or doing something that should cause code-reload would fail to do so. This related to #2689 and is a possible alternative fix vs #3312.
@lone axle I think 'raise ... from' may not be supported in circuitpython. there's a test that is not run related to it: tests/run-tests: skip_tests.add('basics/exception_chain.py') # raise from is not supported
did you find otherwise?
oh, maybe it is. if so, nice!
Traceback (most recent call last):
File "zde.py", line 2, in <module>
1/0
ZeroDivisionError: division by zero
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "zde.py", line 4, in <module>
raise RuntimeError("ouch") from e
RuntimeError: ouch
jepler@babs:~$ src/circuitpython/ports/unix/micropython zde.py
Warning: exception chaining not supported
Traceback (most recent call last):
File "zde.py", line 4, in <module>
File "zde.py", line 4, in <module>
RuntimeError: ouch
``` sort of
so it'd be an improvement on blinka and a graceful degradation on circuitpython
I can double check on it. We put it into the display_text library to resolve the pylint issue. I thought it was working as intented, but maybe I didn't take a close enough look.
π
>>>
paste mode; Ctrl-C to cancel, Ctrl-D to finish
=== try:
=== raise Exception from None
=== except Exception:
=== print("Caught Exception")
===
Caught Exception
Looks like we should be good to go, sorry for raising an alarm unnecessarily.
No worries
much prefer false alarm to having already broken something π
Unrelated to that specific error, but I wonder if it's worthwhile for us to target a specific version of PyPlint within the CI system so that we aren't taken by surprise when a new release drops and starts checking for new things.
I'd check with Kattni, I think she had opinions. There are downsides both to being stuck on old versions, and to getting new versions without warning. I think that she consciously chose that we would get new versions without warning, but I may have events or identities wrong.
Testing performed: while in sys.stdin.read(1) or input(), ctrl-c promptly creates a KeyboardInterrupt; and modifying CIRCUITPY promptly causes a reload.
I did not use a board with a display so I could not check whether this is a fix for #2689.
Will do. For sure though it would be bad in other ways to let it get stuck on some ancient version as well. If it switches to manually we would have to be diligent about keeping an eye out for new ones.
It does look like I was mistaken in my belief that it makes the stack traces more detailed:
code.py output:
Traceback (most recent call last):
File "code.py", line 13, in <module>
File "/lib/adafruit_display_text/label.py", line 359, in text
File "/lib/adafruit_display_text/label.py", line 359, in text
RuntimeError: Text length exceeds max_glyphs
Looking into it more specifically now the only difference I can spot is that the File "/lib/adafruit_display_text/label.py", line 359, in text is duplicated when we use the Raise ... from syntax. Which does not seem all that helpful.
without Raise ... from I see the same stacktrace but with only a single copy of the line that is duplicated above.
@lone axleyeah it only improves the quality of the backtrace on desktop python3
I think circuitpython accepts but ignores the syntax
Maybe it would make more sense to disable that pylint check for our repos then unless / until we have that extra functionality supported.
it does increase the size of the .mpy files though
if we disable it inline with a comment in the file you mean?
111 bytes: ```try:
1/0
except ZeroDivisionError:
raise RuntimeError("ouch")
137 bytes: ```try:
1/0
except ZeroDivisionError as e:
raise RuntimeError("ouch") from e
Oh, I see. the extra text to include it in the code.
the comment shouldn't impact the size of the mpy file but I didn't check that
adding a bunch of comment lines to the top increases 111 -> 113 bytes, somehow. π€·
I wouldn't have expected that
Yeah, I hadn't even considered mpy filesize. I know some of them get fairly tight on the non-express M0 devices already. I would probably shy away from making them bigger unless we get a clear gain from it.
in current micropython raise ... from still doesn't improve the traceback message.
I don't know what the complexity of implementing it would be, but it might be considerable
for some history on pinning pylint to a particular version: https://github.com/adafruit/cookiecutter-adafruit-circuitpython/pull/69
we were pinned to 1.9.2 for like 2 years, and it was a beast of an effort to bring all the libraries up to date. i think kattni really wants to avoid that in the future, and handle new checks as they occur and through attrition.
@raven canopy do we have any good options for turning off this new pylint check across everything in the bundle?
Ah, I can understand that for sure. I just imagined 2 years worth of new pylint checks all hitting at once across hundreds of libraries and I can see how there would be a strong desire to avoid ever doing that again.
for the raise ... from we could probably ignore if circuitpython doesn't really support it. would be a "simple" adabot patch to all of the .pylintrc.
hmmm now what
...
* bad-continuation and bad-whitespace have been removed, black or another formatter can help you with this better than Pylint
this makes modules which previously suppressed it via comment .. error. π¦ π¦
adafruit_ads1x15/analog_in.py:31:0: E0012: Bad option value 'bad-whitespace' (bad-option-value)
their release versioning annoys me...
looks like about 150 instances of suppressing the tag via a comment-directive. There are more that suppress it via commandline, which seems to be OK (?)
the command line ones are in the Actions workflows for linting the examples, iirc.
they should all be the same across the libraries, so another "simple" update with adabot patching.
yes I think that's right
pylint 2.6.0 did update to a newer version of isort. I was finding that sphinx and pylint were requiring conflicting versions of isort [EDIT] before the update.
oh dear, that's irritating.
so now they DONT conflict
oh that's good then
Nice find @cjsieh! I was able to confirm your reproducer example and fix within it.
I'm including a slightly modified version of the code here for convenience and discussion:
import board
import displayio
import busio
import storage
import time
print("waiting 10 sec")
time.sleep(10)
print("continuing")
# Use the board's primary SPI bus
spi = board.SPI()
# works on pyportal and pygamer
import sdcardio
cs = board.SD_CS
sdcard = sdcardio.SDCard(spi, cs)
print(...
Is it good (or bad) practice to change the name of an issue if/when it becomes apparent that it could be better and more focused on the actual root cause of the issue?
@lone axle I change issue titles all the time; please do
@onyx hinge should I start doing wholesale reviews of the whitespace PR's?
@tulip sleet if you feel like it. There are some that are failing and I'm going back through those. most are black wanting to make additional changes, some are import order errors that I didn't reproduce locally yet. But I think the "green" ones should be good to merge.
I have also seen a few import order issues from the new version on some of the libraries
I don't think I will bother to explicitly review. I will just merge the easy ones
I don't represent Adafruit. I'm just a big fan. But it is my understanding
that CircuitPython will never be targeted to the ESP-32 because it doesn't
support host mountable USB disk. It was originally targeted but was dropped
when USB disk became the standard development tool. Adafruit considers that
to be a technology requirement for CircuitPython.
Adafruit has often pointed out that MicroPython is supported on ESP-32 and
various multiprocessing techniques have been implemented there.
Circu...
.. like this one https://github.com/adafruit/Adafruit_CircuitPython_LIS3DH/pull/61/checks?check_run_id=1018655807
others fail due to another pylint change, which I think will be adabot-patched(?) adafruit_mcp230xx/digital_inout.py:117:12: W0707: Consider explicitly re-raising using the 'from' keyword (raise-missing-from)
i had those same import order things after fixing minor things in adafruit_ble
@zencuke we are working on an ESP32S2 port. That does support USB.
thanks for getting the easy ones @tulip sleet
Good news. Thanks. I didn't know about the ESP-32 USB disk.
@onyx hinge for failed PR's, I am assignging them to CP Librarians to review
between black and pylint, when can we just write a paragraph describing the code and have it written for us. π
I guess makecode is close -- just draw pictures...
i dunno, pylint is more like management than labor
but at least pylint will find bugs, black just makes the code less readable....
both are micromanagers π
we have standards... they are low, but we have them...
slight mis-quote of Bette Midler
the problem with code formatters is they disagree with me sometimes, and by definition I'm always right in matters of style.
Wat am I supposed to do with/against those new PyLint message? I make a simple change to fix a library, but I now need to re-order the import in example I did not even touch. π¦ Problem solved.
it is a nuisance π
I am all for only checking the file I change and not the one I did not touch...
What if we could generate shared bindings from pyi...
can I force a device into safe mode? It's not connecting CIRCUITPY nor the serial console port. I suspect the code.py file on it might be causing trouble and auto-launching too fast to do anything about in normal mode.
I can double click reset and get to bootloader.
or maybe create a UF2 file that wipes code.py file?
Managed to restore access by flashing back to 4.0.0 and my code crashed with ImportError: This release is not compatible with CircuitPython 4.x; use library release 1.x.x which allowed my device to connect normally so I can change code.py
I think you can do it using microcontroller https://circuitpython.readthedocs.io/en/latest/shared-bindings/microcontroller/index.html
I think I have to be able to access REPL or be able to change code.py somehow to use that though right?
like maybe microcontroller.on_next_reset(SAFE_MODE)
oh, right
usually I get safe mode when there's an electrical disturbance, but... 
ah, yeah I guess I could try to get it to brown out
would be nice to be able to make a "recovery" uf2 that is just like normal but will rename code.py to not_code.py (and similar for main.py) when it boots up.
that way as long as you can access BOOT drive you can clean anything bad out of code.py and then flash back to "normal"
when I was trying out some disable write protection code I had to add some startup delay so I could get out if (when) things went wrong
or, might be worth it to put a 1-second startup delay in a boot.py
Heh, earlier today when I was playing with something similar I did make sure to put a nice delay in so that I'd have ample time to connect and keyboard interrupt. Didn't realize I was in dangerous territory with the code I'm using now though. saved it without the delay and then couldn't do anything about it π
maybe triple-click reset for safe mode, or double-click out of bootloader mode
What is the cheapest CircuitPython compatible board that I could wire 8 buttons to?
Is this thing not actually CircuitPython compatible? https://store.arduino.cc/usa/arduino-micro-without-headers
A small powerful board for your tiny projects.
@arctic violet Supported boards are here: https://circuitpython.org/downloads. Least expensive I've found are Adafruit Trinket M0 ($9, 5 pins; would need GPIO expansion), and Seeed XIAO ($5, 11 pins).
Thank you much
Saw page but was a little confused bc Arduino site says the MIcro was made in conjunction with Ada. Seems like a prime candidate for an inexpensive CP board?
We don't use ASF4 for I2CPeripheral so you'll want to look at the registers in the datasheet itself. (Section 36.)
@lone axle My understanding is there's supposed to be a pattern to tap the reset button in to provoke safe mode, but I have had limited luck at it. It's slower than the double-press for bootloader. I also didn't find docs explaining it yet.
the function implementing it is wait_for_safe_mode_reset
@lone axle the RGB LED goes yellow for 700ms during startup. During that time if you tap the reset button, it will reset into safe mode. It's a bit hard to react to the yellow light, so a slow double-click maybe more successful ( @onyx hinge )
@slender iron before you spend more time on the HCI _bleio review, I thought it might be good to have a chat (tomw) with you about its current state and how it got to where it's at.
yup, that'd be good. gotta get the newsletter complete after the meeting
ah, took me forever to find it @lone axle @onyx hinge it's in with individual board learn guides https://learn.adafruit.com/assets/75708
Hi,
I'm currently working on an esp32-S2 based board.
I'd like to give CPY support to my boards. Would it be possible to receive a VID/PID for this purpose?
Thanks!
Someone may want to check my PR and release PyBadge library. The CLUE part is not working because of the lsm6ds.
Ok @lone axle did validate the change and Limor approved it. Now the lib need to be released: https://github.com/adafruit/Adafruit_CircuitPython_PyBadger/pull/38
I can make a release for that.
Hi, are you a company or an individual? If a company, which company? Thanks.
@crimson ferry thanks for that link. I had seen that flow chart before, but totally forgot that it included a safe mode path.
@tulip sleet what is process for obtaining a VID/PID, if you're a company looking to get your own legitimate codes? Maybe if we documented it, less people would ask.
if you want to get them as your own co, you have to pay $5k to the USB org to become a member
that's prohibitive for individuals and some small co's.
Wow, that's pretty pricy yeah. No way I'm affording that for my stuff
I think someone was discussing last week an 3rd party entity that allows smaller companies or individuals to obtain VID/PID without the fee, the website pid.codes seems to be at least one such service. Not certain if it is the one that was discussed.
or perhaps with a more reasonably sized fee. I don't actually recall if it was specifically stated as free or not. But certainly less than the $5k I believe.
Yes, that was pid.codes. Their mission is to provide USB VID/PID pairs for open source hardware+software projects. They haven't approved any new PIDs lately (since april) but have a number of pending PRs so they may have shortage of administrative time. Tannewt had mentioned the possibility of reaching out to them but I didn't hear any result yet. I have a feeling a number of people would be happy to help them out.
FYI: Info on the USB-IF (Implementers Forum) Membership
https://www.usb.org/getting-vendor-id
Hi, are you a company or an individual? If a company, which company? Thanks.
@dhalbert I am an individual.
@tulip sleet @slender iron I have a error reporting question. I just spent some time tracking down a bug with the LSE that I had very intentionally tried to mark with a reset to safe mode but it ended up just making it even harder to detect. What's a good way of crashing for something like a clock error that lets me send some kind of message about what happened?
Considering a new category to safemode for BOARD_CONFIG_FAIL, let me know if that sounds ok.
Would be an option for triggering if a board dev puts in the wrong settings for clocks and power, like saying there's an LSE when there isn't one, stuff like that.
@ionic elk new safe mode is ok. usually we assume it's hardcoded correctly
I figured that was the philosophy but the clock bugs in this case are annoying and common enough that I really wanted to highlight them in particular. This is probably the third or 4th time I've had it come up.
Now it'll have a big flag to let you know you screwed up your clock settings
np
I have an "electrical" question... can I use an nRF52 Feather Sense as a FeatherWing for another MCU? I mean, I would like to use the I2C sensor of it from an M4 Feather, just because I don't have any standalone lsm6ds33 to play with sand. [Why use the M4 and not directly the nRF52??? Because I only have the LEDmatrix connector for M4 pins] I did something similar with the CLUE using it's sensor from a Raspberry Pi.
you'll have issues with the TX/RX and possibly with the power pins.
MCU feathers are not meant to be connected.
Maybe you could connect just the I2C pins, and GND. And then power the Sense separately from the M4?
I wonder if you can turn off the regulator on the Sense -- Ground EN -- then power the I2C devices via the 3V pin ??? Don't try this at home π
I guess that would still power the nrf52840...
[well, where else are we going to try it? π ]
Finding myself stuck in cpu_get_regs_and_sp a lot today while debugging, anybody know what the cause of that might be?
might just be memory corruption or something but it seems like a funny place to get stuck
Thank you... so I need to give this a try... and I can try slowly adding one pin at a time until it work or the magic smoke get out of it. I am mostly interested into I2C things.
It seems that the challenging part is that both MCU will try to make 3V3 based on 5V.
Good afternoon all you wonderful people. Happily lurking today, and I've updated the notes doc to reflect as such. 
Lurking
<@&356864093652516868> The notes doc for today's meeting is https://docs.google.com/document/d/107jDI0oM4DuBHe4GuAPO_i5bVhOH-HDi1Q8YbNSjbak/edit?usp=sharing and we're starting very shortly
Thank you
Also of interest is what code to run on the nRF52 to keep it "busy" but not disturbing. I had the same issue with the CLUE... what to run to make sure it does not do anything, I went for an empty code.py. But maybe I want to black the screen and turn off RGB and backlight.
lurking
if you can add your notes and "lurking" to the document it's super helpful!
alurkin
I didn't hear what Scott said at first so I wondered if it was a portmanteau of: camo + kawaii
lurking
Just looked at her channel it is "Ka-Moo-Ee"
Upcoming meetings: August 31 (Monday), September 8 (Tuesday) unless we want to make an executive decision to move it to CircuitPython Day September 9 (Wednesday)
Yes, should be 9/9/2020
We should move it becasue 9/8 is NH Primary day ... π
@slender iron I added it to In The Weeds π
lurking for status updates
Finally finished the code for Bolvarβs mace! SO EXCITED!!! https://t.co/mC1eCZm7XP
869
7246
Send projects, events, and interesting stuff via twitter hashtag #circuitpython-dev or @anne_engineer or via email at anneb(at)adafruit .com
Definitely at least the second time.
Lurking
27 authors wow
- 0 issues not assigned a milestone
πΊ
We've got some remaining problems with pylint, in case anyone wants to help.
We need those cleaned up before we can release the affected libs
pylint should have caught that.
There's also the raise ... froms, I think there may be more problems are actually unknown currently, until a PR or release attempt occurs
@onyx hinge Yeah I read through them. I'll see what I can do.
@thorny jay Are you text only for Status updates?
Maybe we need to check what PyLint would say if there was a change on all the library?
It says you're lurking.
Fixed.
Thanks for updating!
@thorny jay I'm not aware of how to do that "automatically".
some adabot? or just making a PR that only add an empty file?
I wonder how much money does running all the GitHub CI cost?
I am only lurking today.
Public github projects get GitHub CI for free
Driving a 64x64 RGB Matrix from @CircuitPython with just one extra wire (not soldered yet) on the @adafruit RGB Matrix Featherwing Kit (https://t.co/ERCsaMRFjp).
Demo using code fromΒ @firepixieΒ project:
https://t.co/ad9p73XIOm https://t.co/isd90bQtOv
@idle owl Thanks for keeping the docs in sync with my status!
@lapis hemlock Actually @onyx hinge beat me to it. We started typing at the same time.
Well, then @onyx hinge has earned some brownie points.
Yeah, I picked up the phrase while in the US.
we do, but they are small mythical humanoids
It's OK, mohnkuchen is pretty good
"performing various chores" liking keeping the docs up to date...
we don't usually eat them
The docs, do you mean? No, we don't.
historically some doctors did get eaten, especially the ship docs
I remember those message about SPI on Discord... Maybe that was I2C !!!
Wait, we're not supposed to eat the google docs?
ruh-roh
Some of my projects rely on the SPI high baud rate setting for TFT displays. Setting it low by default for SAMD21 would be okay, though.
omg I missed the meeting
@ivory yew want to do a special in the weeds status update or hug report?
we're still talking
Nah that's okay. I'm on the phone with the Department of Revenue right now π
I am in favor of Circuit Python Day meeting
But hug report to all of the CircuitPython folks - digging through the CircuitPython source code has helped a lot with getting my own firmware up and running.
yep. i like the idea.
Nah
Why aren't the guides under version control?
I have some code that I've used to search the Learn Guide repo a few times now that is posted in some of the recent Issues on that repo. Maybe there is some opportunity to integrate it with CI to see a list of potential projects that will be affected.
Would only help find instances of code that is in the Repo though, but not smaller snippets that are directly in the Learn Guides.
@lapis hemlock https://github.com/adafruit/Adafruit_Learning_System_Guides/
the code is
Right, but it would make sense to expose the guides themselves to PRs, wouldn't it?
A couple of months ago, I updated the code for one of the guides, but then the text dropped out of sync, so I had to bug Jeff for a fix.
I think it would be worthwhile.
The thing is, and I agree with this, you are an advocate of integrating text (docs) with the source code. Exposing the code without exposing the guide is not really useful.
requirements.txt & setup.py, yes. its just versioning based with Dependabot.
@lapis hemlock I'm not the one that needs to be convinced
OK, so I am barking up the wrong tree...
ya, limor needs to be convinced
@lapis hemlock Take this with a grain of salt, but I think one thing is that a lot of people who are writing content into the learn guides would state very strongly that they need the graphical editing tools vs "just writing markdown". I think the technical minded CircuitPython people are a minority of those writing guides, or at any rate perceived to be.
I think that is true as well. If it could moved to be backed by Git or some other version control, I think it would definitely need some sort of very easy to use UI (ideally the exact same that exists today probably) it must be much easier than editing md code and then using git to push / merge / PR it.
@onyx hinge I think, such an approach would definitely lower my contribution threshold. I am very reluctant to even try to add content, if I have to trouble someone with that in the first place.
Markdown is OK.
Rather than saying "markdown" and "GitHub", the goal is really to be able to suggest changes to Learn Guides, make it easy to approve and/or edit these changes, and give feedback to the proposers. Learn Guides do have a versioning scheme built in to the CMS, it's just not GitHub. It even shows diffs.
I don't care how it is done.
github, markdown etc. is OK with me, "ask Jeff to do something for me" is not.
right, it just needs to be discussed in terms of functionality rather than implementaiton
Yes, but the snag is that if you accept markdown/github, then nothing has to be implemented.
But then it's not easy enough to use for many of primarily intended guide authors.
But if you want to contribute to the code, you face the same difficulty, don't you?
I mean, this is really not a hurdle, or at least, not one that cannot be overcome.
It can be overcome. But I think it's easy for folks like us who are knee deep in code and development tools all the time to underestimate how challenging and daunting it can be to someone with basically no traditional coding experience. Many of the guides are created by authors in that situation, and they still are able to create great and useful content even without having to learn those skills.
What I am saying is that there is already discrepancy in the reasoning: you can PR the code in the guide (you have already overcome the difficulties), but you cannot suggest changes to the text that would reflect the changes in your code.
I don't get it.
There is a feedback link that can be used to suggest changes in guides.
That's true, but I cannot actually implement those changes. It is not efficient.
(not saying that git or version control wouldn't be nice. I'd definitely like it as well)
@slender iron I am not trying. I have already accepted your answer.
OK, fair enough.
Oh, that's a very good point.
Yeah, but some of the requirements are not even clear.
kk.
@onyx hinge I've replied to all of your PRs.
@idle owl you are a treasure
Thank you all.
Thanks!
See you all next timeπ
See you @lapis hemlock
π
@idle owl OK I'll go ahead and try to finish the process of getting those PRs to "green" by fixing the other pylint errors. I'm not as confident as you that I touched most/essentially all libs with this set of PRs, there were under 100 and aren't we over 200 libs?
@onyx hinge We are. I think in this case, the best option is to wait until they fail. It's not a great experience for a newbie, but we can handle the fixes ourselves on any newbie PRs that come in and explain the situation.
@tannewt suspicion on wiring was almost right. Even with the shortest possible connections, I was still having intermittent transfer success. I noticed that SDA and SCL ramp-up times were quite long on a scope and overlapping drastically when there was supposed to be an obvious order per I2C spec. I was able to mitigate the problem by setting SDASETUP in the I2C peripheral. SDASETUP is only present on M4 devices. I still cannot quite understand why data packets with leading 1's had the is...
<@&356864093652516868> any of you not have an esp32s2 board yet?
I don't yet