@gilded cradle I am curious if you have any thoughts on this: https://github.com/FoamyGuy/Adafruit_Blinka_Displayio/blob/7415eb6aa7a245f0e627503f4f805241f06b1370/displayio/display.py#L204 I added a save_screenshot() function to Display in my fork of Adafruit_Blinka_Displayio. Do you think something like that is within the scope for Adafruit_Blinka_Displayio? If so I can work on cleaning it up and make a PR. If not I'll plan to refactor it out of Adafruit_Blinka_Displayio into it's own separate module.
#circuitpython-dev
1 messages ยท Page 314 of 1
@lapis hemlock In this case,
ulabis more akin to the way I design hardware -- doing things in parallel whenever possible. Since I'm more hardware-oriented, it was nice to have something that matched that approach.
@errant grail Actually, creating hardware-oriented code that is supposed to do number crunching is a bit of strange feeling. Most of the code can be implemented in hardware (there are hardware implementations of FFT, sorting, summing and the like), but there are some pieces that are a bit odd. E.g., finding the roots of an arbitrary function, or fitting.
@errant grail I see you went for the voltage divider and diode clamp scheme for your inputs.
@onyx hinge now that you mention it, I don't recall how the Mouser Saola's were packaged. the ones from Digikey were definitely in pink foam.
@ivory yew Yes, but in the next version I'll switch to a single zener instead of the two clamping diodes.
@lapis hemlock Early in my career, doing it in hardware was the only approach. I've been on the planet for a while. Finite state machine with EPROM lookup tables was a life-saver.
@lone axle in order to maintain backward compatibility, I'm trying to not add too much functionality that isn't already in the main displayio. That's why I have it accessing private functions. One of the features I added that's not backwards compatible is the ability to open gifs, jpgs, pngs in addition to bitmaps, but I think that was planned on being added eventually. If someone wanted to add the screenshot capability to the main circuitpython displayio, it would be a nice feature to have and I'd have not problem including that functionality.
@onyx hinge Jeff, is your CNC machine some open-source/open-hardware beast? If so, what would it be?
@lapis hemlock I have been a developer for LinuxCNC off and on for years, but I don't have a machine that runs it at the moment. Just a 3D printer.
@slender iron what are your thoughts on @lone axle's screenshot suggestion?
@gilded cradle Okay that makes sense. Thank you. I will probably work on refactoring it to it's own module. I might be able make a version that works with Circuit Python devices as well (instead of Blinka). But it will almost certainly have to be a seperate module if I do it. I think Display in Circuit Python is backed by C code instead of Python and that is a bit beyond my reach at the moment I think.
@onyx hinge I am thinking of getting one, and it should be compatible with LinuxCNC.
Hence my question.
Ah yeah it is in c code. ๐
But Jeff did point me toward some functions in the existing Display class that I think could make it work with Circuit Python deviecs. Though what to do with the screenshot after it's taken is a bit more akward on Circuit Python devices since most likely we cannot write it to the filesystem.
I had a small CNC machine years ago that I didn't use very much, probably 1% as much as I use a 3d printer now. I had hoped it would let me mill PCBs but I never got the process to go smoothly and predictably.
If you want to talk about it more perhaps we should take it to #general-chat instead
Probably will require either using a device with external storage SD, or else having the system mounted for write-ability.
grbl seems to be reasonably well-regarded these days and is probably much more reasonable to set up (doesn't need a dedicated PC)
Perhaps write it to an sd card? Let's get Scott's opinion on the functionality first before we scrap it.
Okay, sounds good.
@errant grail single zener? Like I do with BHB?
@ivory yew Yes. My spider sense tingles a bit when using zener diodes for input protection instead of power rail clamping diodes. The modern variety such as the MM3V3V6 seem to have reliable and accurate zener threshold voltages, much better than ones I used to use back in the 'ol THT days.
I do like the reduced component count and simplified PCB routing with zener input protection.
It's also really not the zener doing the protection in the case of bhb
@tulip sleet @onyx hinge do you want me to report a user who seems to try to push some commercial stuff?
It's the op amp acting as a current driven input
@lapis hemlock in discord?
Yes. Private message.
Can you DM me a screenshot of their profile, showing that they have a "common server" of adafruit with you?
And confirm that this is just an unsolicited message from them, you don't have prior chat history?
screenshot the message too please
This is the first time I have heard of the chap.
If they are sending spam to you, they're probably doing it to others and we'll ban them
we have had similar complaints recently about unsolicited DM's, so I think you are not alone
fwiw mods were just working on some specific users, if it was one of them I'll let you know
I had a bizarre DM several weeks ago
Yes, it was a user that another moderator had already banned. We can't control who DMs you, but when they share the CircuitPython server with you, we do treat it as a moderation issue so feel free to contact community moderators, including by @-mentioning the role
@onyx hinge Hats off. Really. I wish I could fix bugs in ulab as quickly as this.
There are a pretty big number of moderators and only one of you
and in these cases it's very clear cut, not a subtle bug
Can one DM the moderators in discord?
@ivory yew Ah, in BHB it's using the zener as a voltage reference, right? Here's an example of input protection:
@simple pulsar Of course.
@simple pulsar Unless it needs handling privately, it's better to @-mention the role, because there's no telling which specific moderators are actually there, green circles lie
(at any rate that's my opinion)
I just had a random person asking to use my "upwork" account. I don't have one of those so it seem rather uninformed. I just explained to him why that would not be a good idea.
That's the same thing happening to others. It's a scam. We've banned a couple of users already for that. They are joining the server, but not posting anything here, and simply DMing users that same scam.
@errant grail ooooh. Neat. That certainly wins for parts count!
Ok, I've fixed this by setting it twice before it is used. It isn't held by the IDF.
Is GC still lacking compaction? I've just fixed a MemoryError by trial and error (and hope). This is on nRF52840 boards. I spoke too soon ๐ฆ
They do and this would have been a problem. I've removed the handle and just use &self->semaphore in its place. (FreeRTOS just passes the pointer back.)
@slender iron struggling a little with the package management structs again. Do you remember when we were chatting about the mcu_pin_globals.map.table, which is the "array" that holds all the package pins? I'm trying to figure out how to get the size of it - it's a pointer, so MP_ARRAY_SIZE doesn't get the right value.
Aaaand as usual literally as I ask the question I figure it out.
๐
@simple pulsar fragmentation isn't actually my biggest concern at this point. I'm more worried about careless allocations in libraries
Python isn't exactly designed to tell you when it's allocating things
that doesn't mean our libraries shouldn't be designed for it though
Ok, I exit the loop now if it is < 0.
Ok, please take another look. I updated I2C, SPI and UART and briefly tested each.
I'm having two issues with the SPI functionality on the STM32F405 Feather Express board running Circuit Python 5.3.
The first issue is that it seems to be leaving an old value in the buffer. For example if I connect a wire from 3.3V to the MISO pin, and then I run the following
import board
import busio
spi = busio.SPI(board.SCK, MISO=board.MISO)
spi.try_lock()
True
spi.configure(baudrate=5000000, phase=0, polarity=0, bits=8)
result = bytearray(1)
spi....
I verified that this same code works perfectly fine with CircuitPython 5.3 on an Edge BadgeBoard (samd51j19)
I grounded the MISO pin, and then ran the following in REPL
import board
import busio
spi = busio.SPI(board.SCK, MISO=board.MISO)
spi.try_lock()
True
spi.configure(baudrate=5000000, phase=0, polarity=0, bits=8)
result = bytearray(1)
spi.readinto(result)
result
bytearray(b'\x00')
Then I connected MISO to 3.3VDC
spi.readinto(result...
I've brought this to the attention of our STM expert.
btw, when you insert code, you can surround it in triple backticks, to make it format nicely. I edited your posts to do that. If you edit one, you can see how to do that.
thanks and wish you follow that !
Will CircuitPython has plan to binding littleVGL ?
Unfortunately, but I can't use this file because it includes <nuttx/config.h>. This file is specific to NuttX and is not present on the native system that is used to build the mkspk tool.
Hello! The RAK5010 (nRF52840) board I'm currently porting CircuitPython to uses 1.8V GPIO voltages as set by the UICR/REGOUT0 register.
However I found that the code in ports/nrf/peripherals/nrf/nrf52840/power.c is overriding this and pushing REGOUT0 back to 3.3V. I understand this was due to 3.3V level boards falling back to the default 1.8V when users happened to wipe the UICR.
However this practice is bad news for my RAK5010 - for reasons to do with the BG96 cellular module onboard we need to keep system voltages to 1.8V internally - we level shift only the user accessible IO pins to either 3.3 or 5v levels as the users wish.
Any recommendations on how to handle this? Should I add a new define for this board which effectively skips that code in power.c and keeps the 1.8V setting even when users wipe the UICR?
One more item I noticed around locking/unlocking I2C objects .. thanks for the revisions!
If already self->has_lock, it gets lost.
Here's what samd does:
bool common_hal_busio_i2c_try_lock(busio_i2c_obj_t *self) {
bool grabbed_lock = false;
CRITICAL_SECTION_ENTER()
if (!self->has_lock) {
grabbed_lock = true;
self->has_lock = true;
}
CRITICAL_SECTION_LEAVE();
return grabbed_lock;
}
As for internal object pointers, a problem will only arise if the object is locked WHEN it becomes long-lived. I'm com...
@viral minnow yes, feel free to propose a PR with a #define to disable the voltage reset. Note that we try to use #if, not #ifdef checks, so that we can make sure something is definitely defined one way or the other.
This PR adds a timer management system to the peripherals/ directory, which mediates how modules are granted timers out of all timer peripherals available for a given STM32 SoC. It also adjusts the PulseIO modules to use ST's "General Purpose" and "Advanced" timers, in addition to the "Basic" ones. Once a module has claimed a timer, it cannot be used by other modules - thus, the timer search function attempts to select timers with minimal exposure to pins wherever possible.
This PR is w...
Submodule extmod/ulab 039480193..48cb93983:
Merge pull request #130 from v923z/argmin-fix
Merge pull request #127 from v923z/sosfilter
Merge pull request #125 from v923z/openmv-fix
Merge pull request #123 from jepler/fix-actions-paths
@tulip sleet does nrf SPI use DMA?
@ionic elk I believe nrfx_spim_xfer is using DMA internally. https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.0.0%2Fgroup__nrfx__spim.html&anchor=gae4b5f522da698ed536ce915ede1216ac
Note
Peripherals using EasyDMA (including SPIM) require the transfer buffers to be placed in the Data RAM region. If this condition is not met, this function will fail with the error code NRFX_ERROR_INVALID_ADDR.
@ionic elk nrf uses DMA for pretty much everything (they have "EasyDMA"). It's kind of hard not to use DMA
@ionic elk if you are debugging that DMA issue, you might try it on a SAMD as well to see how it behaves
We don't have plans to add it. If someone made a PR I'd be happy to merge but would want to make sure the API is pythonic (attributes instead of getters/setters for example) instead of a straight-C wrapper.
@tulip sleet STM32 SPI doesn't use DMA at all right now. I'm examining whether I should swap over to it
Looking into this issue, it's unfortunately looking more complicated than I anticipated. What I'm seeing is that the BSY flag in the SPI2 Status Register (SR) is never being reset and is causing a hang in a HAL timeout routine (we don't enable timeouts for SPI right now, which might be an appropriate temporary fix).
It isn't obvious to me from the reference manual why this is happening. The BSY flag should be automatically cleared when the SPI device is disabled (clearing the SPE bit in CR...
I'll also revisit older versions of Cpy and see whether I can replicate this... I don't recall any issues like this occurring when putting together the SPI system or related modules. I'd like to find out if it was caused by recent changes to the low-power/clock system, or something similar.
I've discovered that neither of these issues (speed change hang or delayed read) occur when both the MOSI and MISO pins are defined. Tracking down a fix, but you can try defining a MOSI pin if you need an immediate solution.
A new version of ndGarage ndbit6 is created. Thanks.
@tulip sleet have you ever reached out to talk to NRF about software bugs before?
oh sure, they are reasonably responsive
I think that the SPI issue is actually a HAL bug - the reference manual implies that a busy bit is never cleared when in receive only mode, but the HAL checks for it anyway
which spi issue?
wondering if it's worthwhile to reach out to ST about it? or should I just hardcode in some workaround
the one you directed me to
but you were asking about nrf? ST I have no experience with
I know I was just wondering if that was something you'd done
But I guess they aren't that comparable, since NRF is kind of small, right?
at least compared to ST
atmel was better than microchip, nrf is pretty good all around, and they have a good forum (devzone). Is there an ST forum?
Yeah, I tend to avoid it though, I haven't seen much dev engagement
the nrf forum has staff responding, unlike the atmel community
i would look for this issue in the forum if you haven't already; I'm sure you're not the first person to come across it
Yeah I've searched but haven't found much so far? I'm wondering if it's maybe an obscure issue - I don't know how many projects allow unidirectional SPI
right, I think maybe the use case is unusual. If you did a write/read, then does it work correctly?
This is for the case where the user declares only a MISO pin
If you include both pins, it works just fine
It was reminiscent of an atmel idiosyncrasy about the read being one byte behind that stargirl ran into
so if you declare both pins but only read, it works fine, without a write?
yes
how can you be an SPI main and only do reads? I would think a main always does writes to communicate with a peripheral
and it doesn't jam when you try to change frequency
is there a separate driver for being a peripheral?
anyway. yes, there's a separate slave driver mode
what is the use case for MISO only?
use case is to allow the other pin to be used for IO, according to the datasheet
yeah, but if you are a controller, can you just do clocked reads? Or are you a peripheral then?
e.g. a display is a peripheral, and might only do reads
i don't see the use case for being a controller and only doing reads; you'd want to send commands to the peripheral
๐คท allowing one-directional SPI was a requested feature, so it's in there - I think it's used for a number of sensors
do you think the HAL library is fixable? Do you see the bug
Yes, I think so. I believe there should be a catch that prevents it from checking the BSY flag if it is in the SPI_MODE_MASTER/SPI_DIRECTION_2LINES_RXONLY mode combination
and there isn't, so it gets stuck
I could be wrong, but that means that BSY is getting stuck high for some other reason, and is ignoring the primary shutoff valve for itself (SPE, the SPI enable bit)
i'd look for an existence proof of a driver fpr a sensor like that being read by MISO only. e.g., "oh look, here on github is an STM-only driver for the whatsis read-only temp sensor" or whtaever, and see how it codes that
I mean, it was the reason the issue on Github came up - they were declaring only one of the pins and encountered this issue. But I'll poke around and see if there's other examples.
@ionic elk right, I just mean maybe someone has come up with a way of using the current hal for MISO-only that works around the issue
I'm trying to see whether I can actually use the other pin in IO mode just by not setting it to the SPI altfunction...
Yeah, MOSI is fully usable and I don't see any disruption when MISO is taking in data
So I'm not sure what exactly the point of this one-directional mode even is, if you don't even need it to access the other pin...
Anyway I'm going to hotfix it and then post something to the ST forum I guess, see if they say anything about it
do you have an example of a one-directional sensor? I could ask Bryan if you don't know of one off the bat.
I don't have any examples. One-directional SPI lines are supported by the API, and had an issue attached, which is why I implemented them
I don't remember why I filed that issue other that for consistency ๐
@S4WRXTTCS We were wondering what your use case is for MISO only. Do you have a peripheral that just sends data?
could be a shift register for input-only
yes, that's a good simple case
I actually don't have a use case for MISO only. I was simply following example code, and didn't give it much thought.
I wanted to get that to work before moving on to testing out the Analog Devices ADXL355 on it. The ADXL355 needs both the MISO, and the MOSI pins.
Resolves #3097. Simplex SPI was suffering an issue where when in the "SPI_DIRECTION_2LINES_RXONLY" mode, it would hang when the frequency was lowered, and would deliver delayed data. It's still not 100% clear why this was happening, but testing shows no issues with using MOSI as an IO pin without this mode enabled, so it's been removed.
Also adds -ggdb3 to both debug and optimized builds, which assisted with debugging this issue, and there's no real reason to remove it as per #2790
@slender iron can you explain what you mean? I think there is a shift register but I don't understand the significance of that to the existence of the mode or to this problem specifically. As per RefMan for this mode: "Only the receiver is activated and the received data on the MISO pin are shifted in serially to the 8-bit shift register and then parallel loaded into the SPI_DR register (Rx buffer)."
i think he means an external shift register: you would clock it with the SPI clock to get its data out
ah hmm
Kattni's been working on a 74hc595 guide which is exactly that
er wait that's the reverse
ya, exactly
limor suggests max31855 as an example
74hc165 is another
I should perhaps clarify that my existing PR just now doesn't actually disable RX only SPI, it just stops using the internal mode for it, which from what I can tell doesn't seem to actually do anything other than break stuff?
Because my testing shows that using MOSI as an IO is totally unimpeded by using the regular two-direction SPI mode, since you mux it with a different altfn anyway.
not sure if you care to chase down any "why"s but I notice some things in the ST driver like to disable the SPI peripheral in this case ```static HAL_StatusTypeDef SPI_EndRxTransaction(SPI_HandleTypeDef hspi, uint32_t Timeout, uint32_t Tickstart)
{
if ((hspi->Init.Mode == SPI_MODE_MASTER) && ((hspi->Init.Direction == SPI_DIRECTION_1LINE)
|| (hspi->Init.Direction == SPI_DIRECTION_2LINES_RXONLY)))
{
/ Disable SPI peripheral */
__HAL_SPI_DISABLE(hspi);
Yeah these are important to the issue because they're supposed to be how you turn off the BSY bit, which is used all over the place to determine whether SPI can be used or not. But when you enable RX-only mode at certain speeds, they don't seem to affect BSY at all, so the program just hangs forever
Thanks for addressing the issues I saw!
We don't have plans to add it. If someone made a PR I'd be happy to merge but would want to make sure the API is pythonic (attributes instead of getters/setters for example) instead of a straight-C wrapper.
LVGLโs team grow quickly , and I think it world be the best fit GUI for micropython , actually they had finish the python objects and has full samples of all widgets. but still less data about micropython.
https://github.com/lvgl/lv_examples/tree/master/src/lv_ex_widgets
Hello o/
Is this the right place for me to ask a few questions about a problem I'm having with neopixels?
I'll ask it because I have to AFK, but if this isn't the appropriate place, I apologize and would appreciate if someone can point me to the appropriate channel
I attached 2 single RGBW LEDs and followed the tutorial on installing circuitpython. I ran the neopixel_rpi_simpletest.py script, with no problem after commenting out the RGB stuff and uncommenting the RGBW stuff, as noted in the .py file. The script seems to run fine and the test is successful.
I then decided I would like to see what the White component of the LEDs looks like, since they weren't used in the that script at all.
I assumed I could change the (r,g,b,w) values to accomplish this, so I changed the part of the script that lights up the Red pixel "pixels.fill((255, 0, 0, 0))" to "pixels.fill((0, 0, 0, 255))" expecting to see White when I ran the script.
The red no longer lit (as expected) but the White didn't light up either. Am I completely misunderstanding what I should be doing?
Here's the edited script for reference. https://pastebin.com/ZTdp0Ea6
ESP32-S2 is so much faster now ๐ https://github.com/adafruit/circuitpython/pull/3083
Hmm, "Guru Meditation Error: Core 0 panic'ed (IntegerDivideByZero)" with spi = busio.SPI(board.IO36, MOSI=board.IO35, MISO=board.IO37)
@grim copper i think #help-with-circuitpython maybe fits better..
regarding your question:
your explanation seems fine.
i have striped your example a little bit https://gist.github.com/s-light/82fdfe0c98b2fb46f3261bd30473a70f
to get a better 'what is happening'
(untested i have not the correct hardware here at my desk.)
this should light up red green blue white one after each other -
and finally all in low brightness.
this way i think it is easier to check at what part something goes wrong..
@slender iron I was trying to test I2C on the esp32s2 with the saola feather adapter but it looks like it uses IO45 for SCL -- when I try to set it, I get "Invalid pins" which looks to be correct https://github.com/adafruit/circuitpython/blob/main/ports/esp32s2/common-hal/busio/I2C.c#L65 ... so will I2C work via the adapter or am I misunderstanding something? I2C works fine if I use IO1 for SCL but I cannot use the QWIIC connector or the "standard" feather SCL pin. Nice to have I2C working!! I am reading from an AHT20 temp/hum sensor.
Hi there,
I would like to add some new custom HID devices in CircuitPython but have been blocked by usb_hid.devices not containing the device I created.
How can I add custom USB HID devices in CircuitPython?
[adafruit/circuitpython] New branch created: type\_hints
Translations update from Weblate for CircuitPython/main.
This PR adds sdioio support for Spresense.
Another question, can't circuit Python build esp32s2?
`Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
IDF_PATH=/home/dahanzimin/circuitpython/ports/esp32s2/esp-idf cmake -S . -B build-espressif_saola_1_wrover/esp-idf -DSDKCONFIG=build-espressif_saola_1_wrover/esp-idf/sdkconfig -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;boards/espressif_saola_1_wrover/sdkconfig" -DCMAKE_TOOLCHAIN_FILE=/home/dahanzimin/circuitpython/ports/esp32s2/esp-idf/...
I have similar issues but I've been shrinking sizes and reducing stepping to make it less apparent.
I think the current nrf implementation does some degree of deallocation which may be useful sometimes but not all of the time. I've created a CircuitPython workaround which appears to have solved my recent spate of 2048 MemoryError exceptions: Adafruit Forums: Audio on nRF52840 with low or fragmented memory
Making this issue so I can track what's been done and what needs to be done
- [ ] aesio/
- [ ] analogio/
- [ ] audiobusio/
- [ ] audiocore/
- [ ] audioio/
- [ ] audiomixer/
- [ ] audiomp3/
- [ ] audiopwmio/
- [ ] bitbangio/
- [ ] _bleio/
- [ ] board/
- [ ] busio/
- [ ] countio/
- [ ] digitalio/
- [ ] displayio/
- [ ] _eve/
- [ ] fontio/
- [ ] framebufferio/
- [ ] frequencyio/
- [ ] gamepad/
- [ ] gamepadshift/
- [ ] gnss/
- [ ] i2cperipheral/
- [ ] math/
- [ ] micro...
A lot of these bytes and bytearray types are really just checking that something obeys "buf" protocol.
The actual argument validation checks in C are:
mp_get_buffer_raise(buffer, &bufinfo, MP_BUFFER_WRITE); // Buffer must be writable.
// or
mp_get_buffer_raise(buffer, &bufinfo, MP_BUFFER_READ); // Buffer need only be readable.
How to specify this in type annotations is still an open issue in Python-land:
https://github.com/python/typing/issues/593
https://bu...
This might be worth its own discussion somewhere, maybe in #3108.
Ok, I'll change them to that
Aha, this two-week-old PR: https://github.com/python/typeshed/pull/4232/files
added these defs:
ReadableBuffer = Union[bytes, bytearray, memoryview, array.array, mmap.mmap]
WriteableBuffer = Union[bytearray, memoryview, array.array, mmap.mmap]
We don't have mmap.
So I think ReadableBuffer and WriteableBuffer would be the best choices for now
I confirmed that defining both MISO, and MOSI fixes the two issues I had. So I can continue on with my project.
FYI - The Adafruit example is what I was using to test it out, and it doesn't define the MOSI pin. This is the likely starting point of someone who gets the Feather STM32F4 from Adafruit.
https://learn.adafruit.com/circuitpython-basics-i2c-and-spi/spi-devices
@trim elm what times did you find black and pylint disagreeing? beside line length, which I think is already disabled?
Hmm... I don't really remember since I did that a while back, but I'll try to see if I can find a PR where that was the case.
Please, I'm interested because I've been doing black enforcement on my own projects too, and I'd like to figure out if I need to disable some (more) pylinting
(the line length is the obvious one, and I was more than happy to disable on my projects :P)
On a grand central M4: Is time.monotonic_ns() expected to return with microsecond resolution? And is it normal for this statement total = time.monotonic_ns() - time.monotonic_ns() to take 17us to execute?
@topaz quest Ok, so the only thing they disagree on is Pylint's bad-continuation. That's a well-documented bug with Pylint that has been around for a number of years. We actually updated all of the pylintrc's to disable that, so that's not an issue anymore. The only other things were black making longer lists take up like a million lines, like here https://github.com/adafruit/Adafruit_CircuitPython_HT16K33/pull/73 and some weirdness arising with the comments and pylint disables getting moved around when black made something that was one line into multiple lines.
I think the actual reason that I didn't want black to actually the changes was because of stuff like what happened in the HT16K33 PR since people would likely not notice the change until it was already merged
yeah I think those lists are the only place where I really wish black was a bit more flexible ๐ฆ
@S4WRXTTCS glad your project is working! Still, simplex SPI is a part of the Circuitpython API so it definitely should be working. I've put in a PR above that I believe resolves the issue, though I'm still testing and investigating it.
@golden jay it should be about us resolution. I would not be surprised that a single statement with a couple of calls takes 17us; these processors are not incredibly fast. And there can be interruptions due to garbage collection or servicing background tasks or interrupts that will make things vary. You cannot depend on predictable timgin.
bytes won't work for dest because it is read-only.
I'd do int here even though it's write-only.
Can we use ReadableBuffer here as I mentioned above? In all this, is there a place for a user-defined type name to be given?
@tulip sleet Thanks! If I was looking for consistent timing in a small section, would I want to consider disabling the garbage collector around that portion of code?
@golden jay you could, but there could still be other interruptions. What is your use case for consistent timing?
in general we implement things that need consistent timing in C and make them available from Python
@solar whale I messed up the I2C pins on the first rev of the adapter
it can actually work but it messes up the reset into bootloader stuff
and maybe the flash voltage
@slender iron np -- just wanted to confirm my findings. will you be doing another rev? What pin will you use for SCL -- I may try a cut/jumper
@tulip sleet I come from a C background so I want to get a better sense of the language and things to consider. I've done some python as well, but nothing where I've had to worry about memory or timing really.
@slender iron unless you are reorganizing more pins -- then I'll just wait for the new version - no rush.
@solar whale I did another rev but haven't assembled it: https://oshpark.com/shared_projects/so2j8UmP
it's IO2 SCL and IO1 SDA
may do a third rev to add a resistor and cap for double tap to bootloader
ah -- great - OK -- look forward to trying it when it is ready
@golden jay gc is fast because the amount of RAM is small, but in general, you cannot predict the latency or variance. You won't notice for most things that are 10's or 100's of msecs, but trying to use microcontroller python for applications that require strict timing of small intervals is just not what it's built for. That's why we have native modules for things like PulseIn and PulseOut, reading and writing audio data, controlling neopixels (which require precise timing), etc. If you have ever used Java and dealt with timing issues, you could think of it similarly.
anyone know if discord is accessible from china?
@slender iron assembling the adaptor was a good way for me to experiment with SMD parts and hot-air soldering -- It also works well for USB and blinking LED so I'm very happy I built one.
I'll be trying few different I2C and SPI devices over the next few days -- great to have it working.
@tulip sleet Thanks for the additional info. I'm definitely not expecting deterministic timing on anything. Also I just want to check, would my questions have been better suited to the help-with-circuitpython channel? I'm not sure which channel is more appropriate.
@solar whale ya, sorry it's the wrong i2c pins. I actually made them fail after I tried it so others wouldn't make the same mistake. you could modify the board for v3 and order it ๐
@golden jay this is more of a dev channel, but you are asking questions the devs might know more about. You could use either. For general questions or library questions, #help-with-circuitpython may get more eyes on the question, especially from other users
@slender iron or I can wait until you are done with it ๐
heh, I should probably assemble v2 to make sure I didn't mess I2C up
I assume that as it is now, it is not good to plug any I2C feather or QWIIC into it since that will pul-up IO45 -- so for now it is a good set of headers for connecting to -- works for me
right now I just use jumpers to use IO0 and IO1 for I2C
you can use it
but plug it in after it's started
because those pins are read at startup
(you'll also need to disable the check in cp)
OK -- good to know
Hi @dahanzimin, please open new issues for new questions. Can you join Discord? That is the best place to get help getting going: https://adafru.it/discord
I believe that issue happens when the version of cmake is too old. Try 3.13 or newer (iirc)
Yup! I didn't see your comments until after I finished. Definitely a better option.
ReadableBuffer and WriteableBuffer are in _typeshed, which is included in PyCharm, MyPy, etc.
@prime cove another thing about monotonic_ns: CircuitPython has to switch to arbitrary precision integers whenever a value exceeds (I think?) +-2^30, so this function is essentially always dealing with objects that have to be allocated. So far we didn't come up with a solution for reporting time to the user that is (A) substantially like Python 3 (B) doesn't have precision problems, (C) doesn't wrap and (D) doesn't require allocations just to get the current time or do arithmetic on times. And, for better or for worse, we made (A) a priority over (D).
Hi @wallarug, HID descriptors are currently statically defined here: https://github.com/adafruit/circuitpython/blob/main/tools/hid_report_descriptors.py and used here: https://github.com/adafruit/circuitpython/blob/main/tools/gen_usb_descriptor.py You'll need to rebuild CircuitPython to include a new descriptor.
I'd love to move to dynamic USB descriptors but it's not a priority for us now.
I've confirmed that this is a HAL bug, as there's an appropriate check for this timeout in the most recent version: https://github.com/STMicroelectronics/STM32CubeF4/blob/5d01400afd60410f6e049cbd19179a67d44d53fd/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c#L3465
Real solution should be updating the HAL to reflect this fix.
I've confirmed that this is a HAL bug, as there's an appropriate check for this timeout in the most recent version: https://github.com/STMicroelectronics/STM32CubeF4/blob/5d01400afd60410f6e049cbd19179a67d44d53fd/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c#L3465
I'll chat with @hathach about updating it.
@tulip sleet ^ I was right, it was a HAL bug! I actually got it right on the money
excellent! how did you find out it's def a bug?
I looked at the latest version of the HAL on Github
and it has the exact fix I was going to suggest, already implemented
if you just update the submodule, will you get it?
You can see it in the link I posted with my issue comment
yeah exactly, I'm going to suggest an update with Hathach now
๐ great sleuthing!
Yeah I had a whole big bug report written out to ST and everything and then as I was grabbing the permalink for the exact line of code that needed fixing I was like "wait a second"
"they already did this"
@slender iron I believe that discord is blocked in China btw
various ways around it of course
@dherrada If I understand correctly, I think @tannewt agrees with replacing the various bytestring unions with ReadableBuffer and WriteableBuffer, so that would be another commit before a re-review. Thanks.
Updating the submodule to include the HAL fix in version 1.24.1 resolves the hang on lower SPI speeds. I still see a one write delay at high speeds (5000000) which does not occur on low speeds (500000). Is this still a problem for your application? I'm wondering if that's just something to do with the crude nature of this test and how the HAL module handles the RXNE (RX Not Empty) register in the update. If it's still a problem for your test I can look into it further.
@dhalbert Ah, I hadn't seen that. Sure thing
@raven canopy Do you know if there's a way to get the adabot output from whatever runs adabot to put it on circuitpython.org?
About that "SeeedStudio Wio Terminal", is the WiFi and BLE also supported in CP?
Also Adafruit blog say "Realtek RTL8720DN" and hakster.io say "Realtek RTL7270DN"?
It seems that Adafruit is right: Wio Terminal: ATSAMD51 Core with Realtek RTL8720DN BLE 5.0 & Wi-Fi 2.4G/5G Dev Board
@thorny jay I don't believe it is supported
this is just the first initial board def
I think they plan on following up on the screen too
@slender iron can you link me (again) to the C code where list memory gets dynamically allocated? like when an append needs more room. as i remember - it tries to allocate 2x the current amount?
@dense jasper Thanks for your help. I ran your script... and the White lights didn't activate unfortunately. I've moved the convo over to #help-with-circuitpython as per your suggestion.
@tidal kiln yup! looks right
cool. thanks!
ok, I'm gonna work on a release
will be 6.0.0-alpha.1
will do one more pass over PRs
@hierophect Please review this.
@ryevertigo Any update on this?
@namaRyo What do you still want these added? You may want them to be used by CircuitPython instead.
Thank you! Any more changes can be done in follow up PRs.
@Flameeyes I can't fix the merge conflicts so you will need to.
Anyone want to do the work to make sure we can't use the returned object differently than we would in CPython? Otherwise I'll close this PR.
@slender iron I'll rebase and do the conflict dance later/tomorrow.
I'm still trying to get a hold of Brad Conte for some of the source files that are without a license and with a public domain dedication in passing.
Version 1.3 of the board has an additional digital pin exposed and a LED on the board.
Thanks for the new board! Do you have a link to info about the new board?
Please use a different PID for new boards. (This is the same as the original: https://github.com/adafruit/circuitpython/blob/main/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.mk#L3 )
this is just the first initial board def
@slender iron It seems that their marketting department is quick to announce support... they could not even wait for a release to be available on circuitpython.org. ๐
For my application I define MISO, and MOSI so it's not an issue. The only issue I can see is with people following the Adafruit example.
@slender iron it's on adafruit blog pointing to hackster.io and Seeed web site. Let me search, I was on my phone.
ya, I saw it on the adafruit blog. we like to post things asap ๐
If we have full support, that will make a great board supported both by MP and CP. Also BLE and Wifi and screen and Pi HAT...
the screen should work with the ILI9341 driver
And that "HiiBot BlueFi by Hangzhou LeBan": CLUE format, Wifi, BLE, screen... but I could not find it anywhere but on Adafruit.
Some folks want to associate their board with the CircuitPython for the name recognition. ๐
That's "fine" except that if a board is only partially supported... they should be more explicit: "Screen, BLE and Wifi are not supported yet... but you have REPL and GPIO"
Sorry for the last minute PR, I figured out I will push it out since it's sitting on my disk anyways.
@dhalbert Ok, just switched them to ReadableBuffer and WriteableBuffer.
Hi @dahanzimin, @ryevertigo, @namaRyo, and any other Chinese devs, would you be interested in starting a WeChat group for CircuitPython? I can sort out how to get an account. Thanks!
[adafruit/circuitpython] New tag created: 6\.0\.0\-alpha\.1
๐
Every 15 seconds or so my ItsyBitsy will reset itself, even with no code on it. I just got it today and am barely able to program it since it keeps disconnecting and reconnecting with my computer. I have the latest CircuitPython release on it.
@tannewt I did not know the definitions, MICROOPY_HW_LED_TX & MICROOPY_HW_LED_RX.
I cancel this pull request. Thank you.
Here is the notes document for Mondayโs CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if youโll be attending the meeting - itโs super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and weโll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1FciLohS6r-mTAAGyOgZYshFS0YRcj7bAAVjMvaINLb4/edit
[adafruit/circuitpython] New comment on issue #3111: ItsyBitsy M4 Express resets itself periodically
old bootloader caused the issue
[adafruit/circuitpython] New comment on issue #3111: ItsyBitsy M4 Express resets itself periodically
Hey, thanks for the update, I'm glad you were able to resolve the problem. I was just writing a response suggesting that you take this to our customer service forums: https://forums.adafruit.com/viewforum.php?f=62
looks like files.json is too large now: {"message":"This API returns blobs up to 1 MB in size. The requested blob is too large to fetch via the API, but you can use the Git Data API to request blobs up to 100 MB in size.","errors":[{"resource":"Blob","field":"data","code":"too_large"}],"documentation_url":"https://developer.github.com/v3/repos/contents/#get-contents"}
When initializing an object, the error that is produced when the wrong number of positional arguments is given shows the wrong number of arguments given and required. It is off by +1. From my testing, this only happens when the object being initialized is a subclass.
Example:
import board
import neopixel # subclass of either _pixelbuf or pypixelbuf, depending on CP version and/or board
extra_arg = None
pixels = neopixel.NeoPixel(board.D5, 24, extra_arg) # This is suppose...
@tannewt thank you for the feedback.
I couldn't work out how the gen_usb_descriptor.py script works. I was discussing adding new devices with @dhalbert in the circuitpython chat about a month and a half ago.
I presume anyone can just add in the new devices on this line and rebuild CircuitPython https://github.com/adafruit/circuitpython/blob/main/tools/gen_usb_descriptor.py#L19
As @tannewt mentioned, you have to add new HID device descriptors to https://github.com/adafruit/circuitpython/blob/main/tools/hid_report_descriptors.py, and then modify https://github.com/adafruit/circuitpython/blob/main/tools/gen_usb_descriptor.py to include them.
Add the descriptors to the first file, and add them to the lookup table here: https://github.com/adafruit/circuitpython/blob/main/tools/hid_report_descriptors.py#L39. Then add the ones you want to https://github.com/adafruit/ci...
Hey @dhalbert thank you for the advise.
First file I have already sorted out. Line 19 was the trick I was missing. Thanks again team!
Hello Scott @tannewt, this is Elaine from Seeed! We just finished the LCD driver added into Wio Termina today :) I will be glad to join the WeChat group to share more CircuitPython dev process for the community in China. May I add your WeChat if you already get the account?
Hi Elaine! I don't have an account yet but you can always email me scott@adafruit.com too. I'll let you know when I have a WeChat account.
Ok, I'm tannewt on WeChat now! ๐
- Added Wio Termnal's functional pins such as buttons, switches, Light sensor and so on.
- Added LCD driver to board init.
Hi, my name is Ryo Ikuyama. my weChat id is "ikuyama"
please invite me if I can join.
I know the Monday meeting is on Monday. But what is the US rule when the 4th of July is on a Saturday?
@slender iron I am following up on this discussion https://discordapp.com/channels/327254708534116352/537365702651150357/727020698782138408 we had about extending CP to add a ISR to sample I2C (in my case ads1115) into a buffer. I have read through the examples for extending CP. Would you be able to give me an outline of steps of the approach you were imaging? Would you have any example you could point me at of something similar? Thank you!
@spare prawn what time zone are you in? Iโm about to go to bed but can coordinate tomorrow
@thorny jay most folks have Friday off and some have Monday off too. The meeting will be on Monday like it is on the calendar
๐ค will be around tomorrow
Timezone are a strange thing, especially with early bird and late sleeper... I am just starting my day here. ๐
Thank you! Any more changes can be done in follow up PRs.
@thorny jay In the US, for holidays that are not on a fixed day of the week, in general, they are "observed" on the closer weekday to when they occur -- so saturday -> friday, and sunday -> monday. Here's what the library we're using for holidays says:
>>> for date in ('2020-7-3', '2020-7-4', '2021-7-4', '2021-7-5'): print(date, hols.get(date))
...
2020-7-3 Independence Day (Observed)
2020-7-4 Independence Day
2021-7-4 Independence Day
2021-7-5 Independence Day (Observed)
Sorry, i misunderstood and posted an incorrect response, which I've deleted.
@thorny jay If we had talked about it beforehand, the Americans might have preferred to go ahead and shift this meeting, but since it was NOT discussed explicitly in advance we felt it was fairest to everyone to keep the date we had scheduled.
@tannewt please add adafruit when ya can too! (that's our wechat id)
Reproduced. I also tried a third layer of class nesting (not shown), and got the same off-by-1 error (as opposed to, say, off by 2).
This bug is also present in MicroPython, so I'll file an issue there.
class A:
def __init__(self):
pass
class B(A):
def __init__(self):
super().__init__()
try:
print("A(1)")
A(1)
except Exception as e:
print(e)
try:
print("B(1)")
B(1)
except Exception as e:
print(e)
@thorny jay If we had talked about it beforehand, the Americans might have preferred to go ahead and shift this meeting, but since it was NOT discussed explicitly in advance we felt it was fairest to everyone to keep the date we had scheduled.
@onyx hinge That's fine, I am not American. That was the only US special day I know about, all the other were surprise to me.
@slender iron I'm trying to sign up for wechat, but I'm getting a security verification step with a QR code that requires a wechat user who's been on it for more than a month?
Did you do that?
I remember signing up without anything like that (but it was ~3 years ago)
@slender iron I am in Pacific USA timezone.
It seems extract_pyi isn't finding things that don't have a class, and many things in __init__ do not. I'll get that working, and that should let me finish the last 17 things.
This is a huge amount of work. Thanks!
Can you stop adding more modules to this PR? It's so huge, and re-reviewing goes through a lot of files. Break future PR's into one or a few modules, so they're more manageable to review.
Should be a _bleio.Address, not str.
__eq__(self, other: Any) -> bool
You can compare with any other object, and it always returns a bool (never None or similar).
Also, don't bother to thumbs-up each fix. Just "Resolve conversation" is fine.
can this also take a single int? Need to check the code.
@ionic elk have pt add you by phone number. I had a friend add me
@spare prawn ok, me too. I'm up now
Hey all. Would anyone be willing to help verify my account? Would love to help with any stm32 discussions.
Ok, seems like this avoids the edge cases I was worried about. Nice reduction, thanks! I'll work on bringing this same strategy into UART and I2C next week.
Ah, I was confused about mp_const_none on line 144
Sorry, which types exactly? I'm not very familiar with the different types of buses
One request but looks good otherwise. Thank you!
{ MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_PB01) },
We normally call it CS for chip select and we're trying to move away from the term slave as well. https://circuitpython.readthedocs.io/en/latest/docs/design_guide.html#terminology
{ MP_ROM_QSTR(MP_QSTR_TFT_CS), MP_ROM_PTR(&pin_PB21) },
{ MP_ROM_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_PC19) },
@slender iron Hi, Iโm online now.
@spare prawn ok, so you looked at the extending guide and would like an example?
I should be able to find a PR
@slender iron ok great, i guess my general hope is an example showing how to integrate an ISR and understand what else is going on interrupt wise so when i start to debug i can reference that.
I2C ISR right? I don't think we use it directly
for SAMD I think it's done through ASF
@dhalbert Ok, I made all the changes except for the ones I've left open. I've gotten the script working for things in __init__ so I'll go through and get all of that done now.
@slender iron I guess I need to research what that means. CP on SAMD and a mechanism called ASF? So look at CP for SAMD?
what chip do you want to add it for?
i am working with NRF
ah, oops ๐
then you don't need ASF
basically, it's the software library for the atmel chips
on nrf it's nrfx
I think so. Is your goal to have a timer trigger an I2C read at a set interval?
looking at GNSS.c it would seem that ISR init would happen at instantiation of object? I was thinking of just trying to do a blinking LED first. Prove i can build and interface.
yes that is my goal...read values...put into a ring buffer
kk
ya, we usually turn interrupts on when an object is initialized
UART has an example of a ringbuffer I think
maybe i try to stand that up blinking, then simple ring sans io, prove that, then work on getting i2c running...will take UART as reference?
sounds like a plan!
๐
By the way, thanks for doing such a thorough review
can someone look at โ๏ธ? It'll help me finish the release
How about using just one space per indent level instead of tabs? It will be the same compactness.
Done! Working on removing the filenames in the longer term by adding extension and language list.
thanks!
Done! Working on removing the filenames in the longer term by adding extension and language list.
Yah, maybe sort of like how I do the bootloaders file; I have a template for the URL.
I suppose using a "files.json.gz" is not feasible for techncal reasons?
it wouldn't be human readable then
New boards are: seeeduino_wio_terminal, loc_ber_m4_base_board, same54_xplained, unexpectedmaker_feathers2
@namaRyo I invited you as a friend and can add you to the group chat after that.
Also:
- Remove download count update because the files are no longer
on GitHub. - Add "extensions" and "languages" to each board dictionary so we
can stop using "files" entirely.
Should I be doing ulab?
anyone around to do the 6.0.0-alpha.1 review?
@slender iron I have not had a chance to do more than a quick first pass but I wanted to ask what your sense of the architecture of a more general solution might look like. For example does this need to be integrated with the event infrastructure, other drivers etc or could it be a custom thing for each platform. I could see the benefits of both approaches and in general would like to keep things as low overhead and simple as possible. But for example I am curious if this could be kept within the "shared" concept instead of writing drivers etc. I am also perhaps not understanding how everything works. At any rate any suggestions would be greatly appreciated.
and within NRF what would the components be?
I'd probably duplicate uart because of the ring buffer and take in an I2C and a command
then within the module setup the timing and do the i2c
I'm starting to stream now so I won't be able to reply further
ok np, thanks!
Hi,
I'll request a new PID for this revision and submit a new PR.
I just set up a preliminary page on Hackaday. The link is
https://hackaday.io/project/173537-feathersnow-v2
Thanks,
-Henry
On Thu, 2 Jul 2020 at 15:00, Scott Shawcroft notifications@github.com
wrote:
@tannewt requested changes on this pull request.
Thanks for the new board! Do you have a link to info about the new board?
In ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigbo...
I'm requesting a VID/PID for my new SAMD21E18-based FeatherSnow v2. This revision is tested OK.
The change includes several fixes in hardware like reassign pins and some cosmetic touch. A preliminary page is up on Hackaday. The link is https://hackaday.io/project/173537-feathersnow-v2.
Thanks,
-Henry
Translations update from Weblate for CircuitPython/main.
Just loaded 6.0.0-alpha.1 on my ESP32S2-WROVER and the storage class (CIRCUITPY) driver is working but I can't get the CDC control endpoint (239A:80A6) talking on my Windows 8 host. Is there is a USB driver I need to force install? Update: I'm good now - Zadig sorted me out.
Sorry it's the WROVER version
Should I be doing ulab?
I think that would be done in the ulab repo. @jepler and @v923z are the ones to consult.
I'm not seeing any entries for the ESP32-S2 assigned pids in https://github.com/adafruit/Adafruit_Windows_Drivers/blob/master/Drivers/Adafruit_usbser/Adafruit_usbser.inf yet
@slender ironIs there an example that shows initialization and use of a timer interrupt including setting priority?
i am looking at watchdog but its not working in this version of CP. It also appears to be missing initialization unless i have misunderstood what i am looking at.
@spare prawn timers are usually used in pulseio
feathersnow VID 0x239A PID 0x00B9 # bootloader
PID 0x80B9 # arduino
PID 0x80BA # circuitpython
Right now the .pyi files of ulab live in CircuitPython. @v923z and I have discussed the possibility of moving them, and we'd like for it to happen, but I don't know whether he's started any of that work. Can you leave it for a future PR until there's a firm answer?
Translations update from Weblate for CircuitPython/main.
@oonid thanks for your contributions! I noticed a few places where you had written "% q" or "% s" where "%q" or "%s" were needed. I have corrected it.
huh, I'm puzzled. I ran across this: mp_raise_TypeError(translate("%%c requires int or char")); -- note that it's not a _varg call, so how does the extra % disappear in the message?
even weirder, in micropython 1.12ish, the %% is doubled in the message.
okay, in cpy mp_obj_new_exception_msg calls mp_obj_new_exception_msg_varg, which explains it .. it's just a surprise, that the non-_varg in the outermost function needs its literal percent signs doubled
'night
55830dd9bf4fee87c0a6d3f38c51614fea0eb483 in micropython changes this, but it missed removing the doubled percent in that one message
Just made the suggested changes :)
sorry about it @jepler
I will check more carefully next time.
@oonid thanks for your contributions! I noticed a few places where you had written "% q" or "% s" where "%q" or "%s" were needed. I have corrected it.
Has anyone else gotten the dreaded guru meditation error (IntegerDivideByZero) on ESP32-S2 with spi = busio.SPI(board.IO36, board.IO35, board.IO37)? (CircuitPython 6.0.0-alpha.0-69-gfcddfd0f3)
Adafruit CircuitPython 6.0.0-alpha.1 on 2020-07-03; Saola 1 w/Wrover with ESP32S2
>>> import board
>>> import busio
>>> spi = busio.SPI(board.IO36, board.IO35, board.IO37)
>>>
no error here
let me update to latest
don't think the latest changes are relevant butt just takes a few minutes...
did you get the error at that line or actually using SPI? What device are you using?
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 6.0.0-alpha.1-7-gf6aee9800 on 2020-07-04; Saola 1 w/Wrover with ESP32S2
>>> import board
>>> import busio
>>> spi = busio.SPI(board.IO36, board.IO35, board.IO37)
>>> ``` still ok here
Thanks @solar whale I picked the version where SPI was merged into the Adafruit repo, but I'll update to latest. I don't get past the spi = line, no circuitpython exceptions caught, just guru meditation error on the usb connector. It works in REPL as you posted, so I'll try to narrow down preceding code or imports that could be complicating things.
I just hooked up a BME280 sensor via SPI and it is working -- I was not able to get an SDCard to work
If I get this working, I'm going to try an Airlift ๐
ooh - good idea -- I'll try one as well.
hmm -- running out of memory...
@crimson ferry I am running out of RAM when I try to run the esp32spi_simpletest -- it starts with ~63K of RAM -- not sure what ESP32SPI needs
17k just for the import (from Scott's deep dive yesterday)
We may have to wait until the memory sharing with RTOS and all that gets figured out and user memory can get bumped
I may still have a pared-down version of esp32spi around that I was trying to get onto a M0 ๐
yup -- ```Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 6.0.0-alpha.1-7-gf6aee9800 on 2020-07-04; Saola 1 w/Wroom with ESP32S2
import gc
gc.mem_free()
63728
import esp32spi_simpletest
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "esp32spi_simpletest.py", line 7, in <module>
File "/lib/adafruit_esp32spi/adafruit_esp32spi_socket.py", line 19, in <module>
MemoryError:
yeah, I don't think the WROVER external PSRAM is configured in yet
well -- nice to see SPI working with the bme280 -- good start
I'm excited to try out CircuitPython and am hoping to teach a student who wants to dabble in SW & HW. I think he'll be glad to be able to re-use the Python skills for other future programming (RaspPi, CS classes, maybe ML). We both want to do WiFi connected IoT and so my hope was to use the HUZZAH32, until I realized it's not supported yet in CircuitPython ๐ข . In lieu of that, what's the next best HW platform to start with? Will a Feather M4 Express + FeatherWing(ESP32) work out ok with CircuitPython? Any other recommendations?
yes, definitely
@sick yarrow ESP32 is not in the cards for direct support, but as you noted it's used as the wi-fi co-processor with the ESP32SPI library. There is development of the new ESP32-S2 chip for direct support by CircuitPython.
The feather_m4_express will work well with the Airlift Featherwing https://www.adafruit.com/product/4264 - you can also consider the feather_nrf52840_express with the airlift featherwing if you want to try BLE
There are tons of board combinations that could work... there's a Metro with Airlift built in, or one of the PyPortals.
or the metro_m4_airlift_lite -- already has the ESP32 module
yes pyportals have displays -- many options
Great, thanks for those suggestions! @solar whale @crimson ferry
if you go with a featherwing for the esp32 -- make sure it is the airlift, not the Huzzah ESP32 feather board
My other question about CircuitPython and these HW platforms is whether or not we'll be able to put the HW into standby/sleep states, to do battery-powered projects that can last much longer by only waking up as needed to sample sensors and transmit over WiFi, for example. Can that be done at the python level, or does it require any lower level processing/C work?
There has been a lot of recent work on the low power modes, but i am not sure of the status at this point. I hope someone more knowlegeable can comment.
In one of the 5.x @slender iron added support for some sleep mode. But I have never seen it in use, nor a board specifically build to limit the transient current. Today I would use a TPL5111 to control the enable pin (or TPL5110 to control the power) and have sleep of a fixed among of time, and at each wake up do what you want to do (and write the code as a state machine that record it's state before shutting down). But I don't know how to wake up on GPIO or a voltage level on a ADC. Maybe there is a learn guide in preparation that explain the low power mode.
we have implemented a simple low-power mode right now that goes into a light sleep mode until an interrupt arrives. Deeper-sleep modes with lower power consumption are on our radar but are not being coded at this moment.
In ESP32 there is a "language" to program the low power computing and wakeup rules. Maybe that is there in ESP32S2?
@solar whale off-topic q here: I am corresponding with some linux devs about the USB-related crashes. I want to be precise about what you have seen. Have you seen crashes on unplugging only, or just on plugging in?
if the latter, is it not long after you have unplugged?
only on unplug and immediatley
so it's been connected for a while and then you unplug, and poof
yes - exactly -- sometimes -- sometimes OK
have you ever seen it on resetting the board but not unplugging?
BTW -- it has not happened on my RPi ... yet
did anyone report it happening on RPi?
not that I am aware of
as to RESET, I am not certain, but I think it did happen ... if you need me do I can try it
@thorny jay I like your idea of the TPL511x options. I don't need a wake on external input (though that'd be sweet someday), and I think we can do a lot with a simple timed power-off. Maybe I can rig up a way to kill the power feed to everything (main board plus any attached Wings) except the TPL?
@tulip sleet have done several RESET with esp32s2 board and not triggered it
of course unplugging it did not trigger it either...
not necessary now, since I've seen that too. I am looking for additional failure modes.
@tulip sleet It's @raven canopy who had trouble with his pi crashing when trying to reset boards. It was affecting his rosie pi work. I think he's seeing it less after some changes on his end, but I don't know the details.
Have updated my branch with a new USB PID. Not sure if I should create a new PR?
Have updated my branch with a new USB PID. Not sure if I should create a new PR?
No new PR is necessary. (A PR is rarely perfect the first time :smiley:) You pushed the change and we will re-review.
I saw the pre-built failed again due to the CRLF or the end of file things.
I am using a mac. Is it possible to have automatic conversion when I commit
the changes to my branch? I know that .gitattribute can be used for this
purpose. But how?
On Sat, 4 Jul 2020 at 11:03, Dan Halbert notifications@github.com wrote:
Have updated my branch with a new USB PID. Not sure if I should create a
new PR?No new PR is necessary. (A PR is rarely perfect the first time ๐) You
pushed the chang...
I think it's because you added an extra blank line at the end of these files:
Fixing ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.h
Fixing ports/atmel-samd/boards/ndgarage_ndbit6/pins.c
@solar whale I figured it out, I had brought over some code that was the problem in this case. Turns out spi.configure(baudrate=non_zero_value) will crash if the parameter is zero.
Does the airlift work for you?
PyPortal:dir(str) ['__class__', '__name__', 'center', 'count', 'encode', 'endswith', 'find', 'format', 'index', 'isalpha', 'isdigit', 'islower', 'isspace', 'isupper', 'join', 'lower', 'lstrip', 'partition', 'replace', 'rfind', 'rindex', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'upper']
ESP32-S2:>>> dir(str) ['count', 'endswith', 'find', 'format', 'index', 'isalpha', 'isdigit', 'islower', 'isspace', 'isupper', 'join', 'lower', 'lstrip', 'replace', 'rfind', 'rindex', 'rsplit', 'rstrip', 'split', 'startswith', 'strip', 'upper']
@solar whale wi-fi scan, ping, ntp all work fine. there seems to be enough memory for requests ```LAN ping: 10ms
WAN ping: 250ms
Fetching text from http://wifitest.adafruit.com/testwifi/index.html
Text Response: This is a test of Adafruit WiFi!
If you can read this, its working :)
200 b'OK' {'server': 'nginx/1.10.3 (Ubuntu)', 'content-type': 'text/html', 'date': 'Sat, 04 Jul 2020 19:31:47 GMT', 'last-modified': 'Thu, 16 May 2019 18:21:16 GMT', 'connection': 'close', 'content-length': '70', 'etag': '"5cddaa1c-46"', 'accept-ranges': 'bytes'}
โฐ NTP: 0
โฐ NTP: 2020-07-04T14:31:53-05:00
โฐ NTP: 2020-07-04T14:31:58-05:00```
I haven;t tried WiFiManager, maybe that's what puts it over
I actually have a use case for esp32-s2 with an additional esp32spi co-processor ๐
I just tried the esp32spi_simpletest when I ran out of memory
oh, strange, no WiFiManager on that one, I'll try it...
I didn't get any memory errors, just the ujson missing
I'm still on CircuitPython 6.0.0-alpha.0-69-gfcddfd0f3
hmmm -- ah -- I was using the .py libs -- are you using the .mpy
Just a matter of time hopefully, this board has plenty of resources
better, but not quite ```
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 6.0.0-alpha.1-7-gf6aee9800 on 2020-07-04; Saola 1 w/Wroom with ESP32S2
import esp32spi_simpletest
ESP32 SPI webclient test
ESP32 found and in idle mode
Firmware vers. bytearray(b'1.4.0\x00')
MAC addr: ['0x21', '0x54', '0xd', '0x33', '0x4f', '0xc4']
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "esp32spi_simpletest.py", line 48, in <module>
File "adafruit_esp32spi/adafruit_esp32spi.py", line 404, in scan_networks
File "adafruit_esp32spi/adafruit_esp32spi.py", line 381, in get_scan_networks
File "adafruit_esp32spi/adafruit_esp32spi.py", line 308, in _wait_response_cmd
File "adafruit_esp32spi/adafruit_esp32spi.py", line 292, in _wait_response_cmd
File "adafruit_esp32spi/adafruit_esp32spi.py", line 268, in _wait_spi_char
RuntimeError: Error response to command
is it consistent, or just one of those intermittent SPI glitches?
I used IO 1,2,3 for spi, and 4,5,6 for the extras (b/c I'm still on a half-size breadboard)
I'd be surprised if the pins made the difference. The File "<stdin>", line 1, in <module> seems like an oddity in the trace?
or is that from importing code into the REPL or another file?
I think that is typical when importing from REPL
import esp32spi_simpletest
I took out the scan and just tried connecting to my AP ```Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 6.0.0-alpha.1-7-gf6aee9800 on 2020-07-04; Saola 1 w/Wroom with ESP32S2
import esp32spi_simpletest
ESP32 SPI webclient test
ESP32 found and in idle mode
Firmware vers. bytearray(b'1.4.0\x00')
MAC addr: ['0x21', '0x54', '0xd', '0x33', '0x4f', '0xc4']
Connecting to AP...
could not connect to AP, retrying: Error response to command
could not connect to AP, retrying: Error response to command
could not connect to AP, retrying: Error response to command
could not connect to AP, retrying: Error response to command
could not connect to AP, retrying: Error response to command
Will have to resume tomorrow --- dog wants a walk ...
I had a spate of these a fortnight ago and I just got one now on a CLUE running 5.3.0 and fairly recent libs (20200625).
Listening for (,)
Traceback (most recent call last):
File "code.py", line 1520, in
File "code.py", line 914, in broadcastAndReceive
File "code.py", line 691, in startScan
File "adafruit_ble/__init__.py", line 235, in start_scan
MemoryError: memory allocation failed, allocating 65536 bytes
That number is clearly suspicious for being so large an...
The issue has been traced to the amount of time it takes to synchronize the RTC timer when the COUNT field is accessed. It can take more than 100us, which exceeds the length of the incoming DHT pulses. As a result, interrupts will be missed. The solution is to utilize the continuous synchronization ability of the RTC. Since that setting will be reset anytime an RTC register is written, those writes , which are primarily done in port_interrupt_after_ticks(), will need to be avoided for the dur...
Implementation of RTC continuous synchronization during pulsein. See comments in Issue#3049 for the rationale behind these changes.
Maybe we are missing a adafruit-circuitpython-bundle-6.x-mpy-YYYYMMDD.zip :
You can always find the latest releases of the libraries bundle on GitHub.
Bundle Version 5.x
This bundle is built for use with CircuitPython 5.x.x. If you are using CircuitPython 5, please download this bundle.
I know/guess that there are no difference between 5 and 6 (and maybe 4). But since a major version in the past changed the mpy format, the documentation say to take the associated bundle.
@thorny jay the 5.x bundle will work with 6.x -- as far as I am aware there is no difference in the 4/5.x bundles. The .mpy format has not changed since 3.x. I expect we sill see a 6.x bundle version soon.
Yes thank, but our documentation say one need to take the matching version... I reased an issue on circuitpython-org.
I saw and you are correct. It should be made consistent and i'm sure it will be soon.
One question in that issue is the whole depreciated I2C (or other) stuff. If library rely on that, they break (I think we avoided that). So that was one the point raised by @tulip sleet "In the weed".
I have not raised an issue, but there are 3 unknown board, and I don't see where that come from while quickly browsing the repo. I only see one unknow.md, so maybe that one get's use when there is a board but no specific information.
good point and a major version release often means thinks break... I have not run into any issues ...yet
Maybe we should chase for picture, like @stuck elbow for https://circuitpython.org/board/fluff_m0/ there are picture there: https://hackaday.io/project/171381-fluff-m0 we just need one with proper size and rights.
Also that nice!nano (I did try to order one, but they only produce 1000 and in less than 6H it was sold out).
@thorny jay I don't have a fully working version of that board yet
Tested on feather_m0_express -- I can read from the DHT22 again!! Thank you!
I also tested this on my feather_m0_rfm9x build and it works there as well.
What about a fully working picture? ๐
@crimson ferry FYI -- my featherwing airlift works normally (up to ujson) with the esp32s2 -- using differenet pins (33/38/34 for READY/RST/CS) . Not sure why the breakout was not working- even tried with same pins.... ahh -- the issue appears to be related to way I had it wired to the breadboard. Got the afirlift breakout board working as well
Hey @dhalbert ,
Sorry to bother you again on this one. I have one last issue / question.
How do you trigger / run the gen_usb_descriptor.py file? I tried building some boards but it doesn't trigger the updates / changes. The usb_hid.devices array still only has 4 devices.
Thought I would ask as it might be quicker than working it out myself ๐
Have no fear! I figured it out. Notes below for reference (and for when I inevitably forget tomorrow ๐คฃ ).
ports/atmel-samd/boards/<your board here>/mpconfigboard.mk
USB_HID_DEVICES="KEYBOARD,MOUSE,CONSUMER,GAMEPAD,<custom>"
The gen_usb_descriptor.py script does check the defaults array as proposed by you Dan, however, only as an error checking mechanism. It takes the given value string as the source of truth. It takes the USB_HID_DEVICES from the individual board conf...
There are several allocations that might be happening at that line. I looked at the code and don't see anything obviously wrong.
If I set up two boards running your code and just let it run for a few hours, might I see this, or is it rarer than that? Could you supply some sample code? Thanks.
Thanks! Could you merge this into the main branch instead, we don't expect more releases on the 5.3.x branch.
I tried changing the base branch to "main", but it created merge conflicts so I changed it back. I recommend preparing a fresh PR from a fresh branch based on "main".
- Is it OK to use Version 5.x for CP 6.x?
Yes.
- Is Version 5.x any way different from Version 4.x?
No.
- Does that only change with MPY format change or there are other possible area if incompatibility such as depreciated and now removed things in I2C API?
Right, it would be for a .mpy change, but there hasn't been one for a while. We have talked about having different bundles for different versions, but haven't come up with a mechanism yet. Instead, right now we add compa...
Wouldn't this be originating from one of the m_malloc calls buried in the C code?
It does not occur with long runs which is partly why I suspect it's not my app and could be either a peculiar buried bug in CP for size (like an absent initialisation) or a roguish random BLE packet in the ether, i.e. it could be when someone with a particular high power BLE device walks down my street broadcasting unusual Advertisement packets.
This might be worth running up briefly but I wouldn't spend...
I need a sanity check
@solar whale Good to hear it's working! I thought maybe it was something spurious, there aren't very many special pins that I know of (0, 18, 19, 20, 26, 43, 44, 45, 46), nothing in the 30s.
Since the saola is too big for a single breadboard, I combined some like the picture above. The issue I am having is that the Airlift breakout only works reliably if I connect the 3V and GND as shown - directly to the board pins. If I move either 3V or GND to the "rail" it fails during some SPI transactions. Anyone have a clue why?
WiFi current spikes and inductance? Maybe some local capacitance at the power supply pins might help?
I tried a 100microfard cap in the "rail" but no help from that.
but that seesm like the issue -- it happens when WiFi is active.
That is odd. Maybe just some connection resistance, in which case you could try different holes, or it could be that the wires are acting as an antenna. I'll admit I'm just guessing here.
Thanks -- all makes sense -- all guesses welcome.
Itโs happy this way and I can work with it. Lost to many hairs over this already...
Sometimes you just have to roll with what works and get on with what you were originally doing.
hah, I had a "deja vu" feeling on one of the python-pcapng pull requests, then I realised that @slender iron wrote the first couple of commits in that pull request ^^;
is it "bad" to add things to board within a script? like on a device without a built-in display to set up the display and then do something like this board.DISPLAY = display that way the rest of the script can use board.DISPLAY as though it were actually built-in even though it's not.
Does that work? I get AttributeError: 'module' object cannot assign attribute
I does work for me, though I've only used it on Blinka / RasPi
and after thinking about it a bit more. I think the opposite might make more sense. use the display variable throughout the rest of the script. and at top use display = board.DISPLAY for devices with it builtin.
Mostly I'm just looking for the most painless way share code.py scripts between built-in displays vs. external displays.
Wow, I haven't done anything with Blinka, but looks like board is just assignments rather than an immutable class (I may be abusing that term)?
?serverinfo
@crimson ferry it's a module implemented in C
Can do! I guess the โEdit on GitHubโ button automatically chose the currently viewed branch. Iโll fix that up on the main branch shortly.
I have been able to get a crude channel estimate by measuring the delta monotonic_ns() from the start of the scan in my GAEN code for supporting Covid Watch.
It would be handy for me to get a timestamp when the packet is received, not just when it can be processed in a loop. It would be even better if it can be compatible with time.monotonic_ns(). And even better if it was a read-only attribute of ScanEntry.
I have been using _bleio in a GAEN sniffer for supporting the work at Covid Watch. Anything coming that might break my code or I want to exploit?
Is it possible to inherit from a ScanEntry. (I haven't even tried. Yet.)
@bright aspen You can subclass ScanEntry, but the other native classes won't know what to do with that. Have you considered using Adafruit_CircuitPython_BLE as a wrapper, or modifying it?
@slender iron Maybe this is an in-the-weeds topic for 3 months from now, but I've been experimenting with improving the blocking nature of requests, getting potentially much more non-blocking time by separating the request send and response receive (polling .available on a tighter loop to trigger receive). In big python, requests has separate connect and read timeouts but isn't async-friendly without some added framework on top, but in our embedded environment some additional API may be justified. HTTP 1.1 keep-alive should help with overall performance, but perhaps we can provide less blocking through exposing more granularity of the requests process as an optional part of the API.
@tulip sleet, I did briefly consider Adafruit_BLE a few months ago, but at the time it seemed complicated. I know I am duplicationg some work. The documentation is unclear to me. I can't find a defintion of advertisement types. The example shows a scan_entry attribute but none is in the documentation. I did consider creating a class that contains a _bleio ScanEntry, but right now I am using a tuple (ns, channel, scan_entry).
It might be that I"m looking at old documentation.
Oops, there were a few sound samples missing, try this rps directory: https://github.com/kevinjwalters/circuitpython-examples/tree/master/clue/rps
Unrelated to all this, in the CP code I spotted a few variable length arrays are being allocated on the stack with a size based on values that were coming back from the bluetooth library. I wasn't sure if those were all sanity checked to make sure the size was reasonable/within expected range. Has this been discussed before?
A small bump on this, as it's something I'd really love to see happen.
Notable things that we'd get:
- Type annotations (PEP 526).
- Walrus assignment operator (PEP 572).
- Matrix multiplication
@operator (PEP 465). - Underscored numeric literals (PEP 515).
- Support for dynamically loading native modules in
mpyfiles. - Numerous code size improvements.
- Significantly better native code emitter.
I don't presently have the time (or expertise) to do this myself, but I would...
https://github.com/adafruit/Adafruit_CircuitPython_VL53L0X/issues/20 It seems like this issue might be affecting some of he libraries. I only checked a few, but all that I checked were having this issue.
the discord link in their readme is showing invalid. Should they get linked to http://adafru.it/discord ?
@topaz quest I think you and I have crossed paths since gentoo a decade or more ago
Right now the .pyi files of ulab live in CircuitPython. @v923z and I have discussed the possibility of moving them, and we'd like for it to happen, but I don't know whether he's started any of that work.
No, I haven't yet had time for that, but it is definitely high on my list.
@slender iron I was a gentoo dev as well :). (sparc64 stuff)
Shouldn't:
ReadableBuffer = Union[bytes, bytearray, memoryview, array.array, mmap.mmap]
WriteableBuffer = Union[bytearray, memoryview, array.array, mmap.mmap]
Be:
ReadableBuffer = TypeVar['ReadableBuffer', bytes, bytearray, memoryview, array.array, mmap.mmap]
WriteableBuffer = TypeVar['WriteableBuffer', bytearray, memoryview, array.array, mmap.mmap]
To account for functions that accept and then return the same buffer? Like AnyStr is!
@slender iron @silver tapir it's a small world I guess ๐
Recreated the PR off of the main branch instead of the 5.3 branch, as discussed in https://github.com/adafruit/circuitpython/pull/3118#issuecomment-653884572
Thanks!
ok
Update Spresense SDK to version 2.0.1. Add a flash writer as a python script. Add NuttX config which can be used to build the Spresense SDK for CircuitPython.
@ionic elk What's your plan for STM32 support over the next couple of months? Is there some family you're going to write support for? I'm ordering some MCUs / dev boards in a day or 2 so want to ensure I can test all STM32 that CPY supports.
I move back and forth between STM32 support and i.MX support, and Scott has recently asked me to start checking out the ESP32, so I won't necessarily guarantee that I'll be directly involved with any new STM32 families. If I am, it'd be the F1 (I think the hope is that the Chinese community will take over that but I haven't seen any firm indication of that) or the L5.
In all cases we're focusing on chips that have at least the stats of a SAMD21.
Ok...I've started L4/L5 support....the USB stack is different to the one we use at the moment...so I've started to port that.
Module wise I'll be aiming for RotaryIO, better NVM, more displayIO stuff, etc
@lucid solar I'm not sure what you mean. We will probably support L5 if and only if tinyusb adds support.
They do support it...
It's not the usb stack...but...err...tinyusb has support for both...
CPY works with synopsys, but not stm32_fsdev
I'm about 80% done with the flash support for L4 also. I'm using a L433 on a board I've made, so that's my main focus at the moment.
@lone axle Probably. re: adafru.it/discord.
@lone axle Wasn't there a library you added display rotation to? I was wanting to use it in this project I'm working on with pyportals
Ah, that was the gesture sensor
@trim elm I think the rotation thing I... yep
although it looks like displayio does support rotation now: https://github.com/adafruit/circuitpython/pull/2390
oh, I did not know that
The other thing I did recently with rotation was test the rotation with Blinka_Displayio when melissa implemented it.
Thank you @idle owl I will make PRs for the ones I've found later tonight. If it turns out to be a widespread issue I may try to pick your brain a bit @raven canopy to see if you know any tricks that could help us automate checking for dead discord links in the readme and updating them.
@lone axle Updating the readmes is a bit tricky because they're different from each other. But it's doable. I would find out how widespread it is first so you're not wasting time on a few PRs if we're doing it overall.
Hi all and especially <@&356864093652516868> ! The weekly voice meeting is starting in about a half hour, at 2PM US Eastern time. If you can, please add your notes (hug reports and status updates) to the document https://docs.google.com/document/d/1FciLohS6r-mTAAGyOgZYshFS0YRcj7bAAVjMvaINLb4/edit -- If you'll be listening in but not participating, letting us know that is SUPER helpful. Just tell us you're "lurking", or write it in the doc.
Todays document seems different somehow
Someone changed the margins.
ah
my whitespace!
Good afternoon all you wonderful folks -- happily lurking today, doc is updated ๐
Listening only today.
@modern wing Thanks!
oof my mic's not set up
That's contagious Scott ๐ฅฑ
Listening only.
good day everyone.
lol. s'allright, I've been fighting the weight of my upper eyelids all day.
Lurking today
I'm going to have to find a talking stick for @onyx hinge and @slender iron
If anyone has Python/CircuitPython news for today's newsletter, drop me a note anneb(at)adafruit.com or PR https://github.com/adafruit/circuitpython-weekly-newsletter/blob/gh-pages/_drafts/2020-07-07-draft.md
Gotta burn your house down, only way to make sure the wasps are gone
@blissful pollen I support this method.
Hello to great CircuitPython team,
wasps are better than hornets.
@maiden chasm Hello!
I'm lurking today
@maiden chasm Thanks, I'll note it in the doc
Reminds the time we had tome huge costarincan (bigger that yellow) hornets in the feeder of a vsat antenna (when people still used vsat...)
Lurking
A weird species that gives honey, btw.
Not a true story, but I could say that I quit my old job because of the wasp nest above the front entrace.
.. just something that happened at around the same time though
Honeybees? That's worth a call to a local beekeeper. Wasps? Well....that's where a less than kind approach needs to be taken. Late at night when they're dormant.
Nah, wasps are cool. Don't kill them ๐ฆ
I had a hornet nest over my driveway and noticed after i parked my convertible right under it shudder
wasps are a no-go for me, since I'm allergic to wasp stings.
If they are native bees, in spanish we call them "meliponas", they give out honey and don't have stingers. Recommended hobby for everyone in america.
[picture of a wasp, my driveway some years ago]
deadly boi
That's nightmare fuel ๐
Release 6.0 is gonna be called "wasp" ๐
lurking today
let's call it "Stingy death boi" instead.
I kept having wasps trying to build nests in my outdoor grill. I just turned it on a couple times and they stopped building there.
I had "Cicada Killers" at my old place. The would swarm around the backyard a few times a day. They look like the most gnarly wasps, but don't tend to mess with humans.
poor scott is trying to have a meeting and we're still on wasps
lol
๐ nice to scott
"you can ๐ text only"
This may ๐ distracting
aw, I miss 2017.
2๐ || !2๐
https://www.hackster.io/news/seeed-studio-s-wio-terminal-gets-official-circuitpython-support-1e228a10b50a?82dbce7b4ff9f093aa7ff9c43ae70d8a https://circuitpython.org/board/seeeduino_wio_terminal/
Hackster.io
Available in source now and as a pre-built firmware soon, CircuitPython support for the Wio Terminal is here at last.
Community News -- it really generates a buzz for CircuitPython.
Geez, what is this, a sting operation to distract Scott?
Yes
Adafruit Industries, Unique & fun DIY electronics and kits : - Tools Gift Certificates Arduino Cables Sensors LEDs Books Breakout Boards Power EL Wire/Tape/Panel Components & Parts LCDs & Displays Wearables Prototyping Raspberry Pi Wireless Young Engineers 3D printing NeoPixe...
Awww, ty
Thank you to the new authors who are contributing translations on Weblate!
@timber mango let us know if you will have anything to contribute during Hug Reports or Status Updates. If not, we'll assume you're just listening in. ๐
Lurking
I hear your mic TG Techie
BH1750 Ambient Light Sensor
Un-lurking
In CPython 3.8 time.time() returns a floating point value. In CircuitPython 5.3 it returns int (or rather a long integer).
time.monotonic() returns float though.
Sorry, not participating this week. I have put my (or some) Hug report... and did not do much, so no Status Report.
thanks @thorny jay !
It appears this is behind a #define:
STATIC mp_obj_t mod_time_time(void) {
#if MICROPY_PY_BUILTINS_FLOAT
struct timeval tv;
gettimeofday(&tv, NULL);
mp_float_t val = tv.tv_sec + (mp_float_t)tv.tv_usec / 1000000;
return mp_obj_new_float(val);
#else
return mp_obj_new_int((mp_int_t)time(NULL));
#endif
}
I don't
No
group hug
@old smelt It was fun to see your product covered on Ask an Engineer. congrats
๐
STATIC mp_obj_t mod_time_time(void) {
This is only in ports/unix/modtime.c. The erroneous code returning an int is in
shared-bindings/time/__init__.c.
We do assume all CircuitPython impls have floats (but not longints).
Thanks @onyx hinge !

every lime in the original file?
@exotic iris I server muted you because you were disrupting our meeting
itโs OK that Linux crashes when a USB flash drive changes out from under the filesystem driver
huh wow that is not okay with me
lol classic linux
(the USB people may well be in despair of the filesystem people fixing some well known bugs...)
๐ฆ
works great! thanks!
@onyx hinge re: your PR. Should have thanked you for that as well in hug requests sorry
good fix
Another belated hug report: kamtom480 for the SDIO implementation for spresense
one day I'll remember the 74xx series chips and what they do. ๐
wikipedia has a pretty good article for them
@idle owl nice guide! 74hc595
If I can do it, anyone can do it
I also constantly forget what the family abbreviations mean
my newest project has a teeny lil 74LVC part
Welcome to episode 14 of Micro-controllers with kingernorth. Have you ever wondered how sonar works using sound? If so be sure to watch as I will be using an ultrasonic sensor with both CircuitPython and Arduino. I will show you how easy it can be to program and measure a dist...
Thanks @onyx hinge
2:00 conflict. Have a great week, all!
thanks @old smelt !
I'm not seeing it with any frequency lately. I've changed a lot of things (linux kernel version, USB hub, etc). I used to experience it most often when debugging with SWD.
You may want to automate crashing by using this: https://www.tindie.com/products/8086net/usb-power-switch/
If you can make it happen frequently, you could disable "automount" and find out whether it still happens. This would exclude any filesystem-layer stuff
Alias?
bundle-4x-5x-6x-20200606
?serverinfo
@thorny jay Thanks! I ordered one of those.
@tulip sleet I hope it does data. I think it does but I only used it to blink a light.
yeah
on STM32 that'll bork your whole system
had that happen just recently with the timer
@onyx hinge
Thanks everyone ๐
Thanks
๐ see you next week if not sooner
Thanks for the meeting everyone.
@silver tapir Glad you could join us!
hi
@solar whale for the ESP32, i'm thinking I/you could saw a half-breadboard in half in the slot down the middle to spread out the two sides. Since it still has foam tape on the back, I can then put it on a scrap piece of plastic or something like that. (Or maybe you suggested that already.)
I have done that split a breadboard in two. It's a lot plastic to get rid of, not easy to cut, but that give a usefull result.
Seeing that, reminds me I need to order from oshpark, @slender iron's feather adaptor.
they snap together like this.
@silver tapir check with him first -- may be an update coming.
v3 with reset button?
@solar whale thanks good too -- i forgot about the removable power rails (which I rarely use anyway)
my issue is with the power rails. in this setup they don;t work for SPI (sometimes) No problem with I2C
but I have lots of connections without them...
still think it is a noise issue when WiFI active on the Airlift.
I'm not sure I ever tried this with another MCU -- adding to "todo" list. I usually go right to a header on the board
maybe add .01uf or .1uf or similar across power and ground near the board, if it's coupling through there
oh -- I tried 100 uF -- maybe too much
usually you use something like 100uF for low-frequency noise, and .01uF or similar for RF noise. The 100uF may have high impedance at high frequencies
Thanks -- I'll try that.
100uF is a big boi
"the next CircuitPython is called Wasp, and we're done with the cute snake themes" would be good April 1 material, maybe.
"no legs bad, six legs good"
๐ท๏ธwhat about 8 legs?
@hierophect any reason you didn't merge? @jepler, looks like there is a conflict.
Thank you! I'm excited to see this merged in.
QQ: what's the status of SD card support in CP 5.3.0 on the STM32F405?
Thanks! I'll go dig out an AdaLogger.
jeff started on it but it was more complicated than expected
No that's cool. Sometimes they're just difficult. ๐
Um... the AdaLogger should work, yes
@Dar-Scott Want to try and add it? It shouldn't be too hard. Looks like it's already captured internally: https://github.com/adafruit/circuitpython/blob/main/shared-module/_bleio/ScanEntry.h#L42
You'll just need to add a field in shared-bindings and return the value in shared-module.
@hlovatt what is the advantage of TypeVar over Union? We're all new to Python types.
I'm not sure this will work if we sleep with a PulseIn active because no interrupt will wake us after the sleep completes. The PulseIn interrupt will wake us as well but that relies on an input signal.
I think this will break sleep during PulseIn as-is because we won't have an interrupt to wake us below. I think you'll want to add a check to the if (!tud_task_event_ready()) { line to prevent sleep when PulseIn is active.
@tulip sleet @ivory yew tried .1 and .01uF -- no change in the response with the airlift breakout.
@slender iron fwiw https://github.com/rshk/python-pcapng/pull/29 โ once the write support is in python-pcapng I'm happy to take your conversion script and add it to usbmon-tools
๐
(and at that point I'm going to make the cython usbmon module useful by having it write pcapng files without needing wireshark
and if you (or anyone interested) want to have a chat one of these days to whiteboard a modern replacement for the kernel's usbmon interface, count me in โ I think a netlink version with bpf for capture filters would be quite the improvement
I don't think I'm the right person to ask
either ktemkin or danh are probably better
@tulip sleet @crimson ferry @ivory yew @slender iron FYI -- I have reproduced the SPI issue with the AIRlift breakout on a feather M4 express. It only works if connected "closely" to the power/ground pins on the board. It does not work using the "rails" of the breadboard. This is not an issue with the ESP32S2...
๐
Here is the notes document for Mondayโs CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if youโll be attending the meeting - itโs super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and weโll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1LKHP_3O2fKuOAymWkKaHGSAgTnGf6QKk5CcDESAP7t4/edit?usp=sharing
@drowsy geyser the work in progress code is mentioned here https://github.com/adafruit/circuitpython/issues/3095 and is on github here https://github.com/jepler/circuitpython/tree/sdio-stm32-broken-rename but I think in its current state it does not even compile.
we decided that getting the project to a defined stopping point so that I could move to this timer / background tasks stuff was a higher priority. Would love to see a community member pick it up, and I can absolutely answer questions for someone who's doing that
@drowsy geyser the Adalogger "should" work. And it should be able to use the sdcardio code in the "core" -- just not the onboard SD card
what do folks think about replacing the secrets.py approach to secrets with an "environment" file that would be accessible through os.env?
that would better match cpython and also remove the conflict with the built in secrets module
not sure on this, but why you keeping Secrets?!?!?
hehe
"So let it be written, so let it be done" - Metallica
it's for things like wifi password
so, something like @tidal kiln example for Blinka```import os
os.environ["BLINKA_FT232H"]="1"
import board
what is the builtin secrets module for?
I was just wishing for os.environ for some reason. but I also wanted it to be state that could be modified and received from one interpreter to the next after soft restart
I'm not sure where it would be loaded from .. would it be like nvm and always preserved unless erased?
@drowsy geyser the Adalogger "should" work. And it should be able to use the sdcardio code in the "core" -- just not the onboard SD card
@solar whale Ahhhh, I was trying to follow the guide and I couldn't get past "no SD card." I'll try sdcardio!
hmmm -- either way "should" work
@drowsy geyser hmm -- it's not working for me either
either with SDCard or sdcardio
I did put "should" in quotes ๐
Yeah, I noticed that. Well, foo. I'll have to figure out another way to configure this new accelerometer to throw it off the building.
"more degrees of freedom than data points". Where's that on a t-shirt? ๐
(from the ulab src)
Hahahaha! I was watching a Formula 1 race last season, and after someone "left the track" one of the announcers said, "more ambition than adhesion."
๐
I've also just read, also from the ulab src, "imaginary and real parts must be of equal length".
I'm gonna start selling out of context src code tshirts...
Oh wow, that's good, too.
"La traducciรณn ha finalizado." Spanish is now 100% ish.
A couple of things I wanted to read the src to understand better the context of the message. But when I click the weblate link, it sends me to a 404.
So I'm trying to drive hundreds of neopixels (around 400) and I'm quickly realizing that even on the feather m4, FPS performance of animations can be a bit lackluster. I'm considering switching to the raspberry pi zero and using the circuitpython libraries there to hopefully improve performance. Any gotchas I may not be thinking about?
Quite a few. Pi's aren't really good at driving NeoPixels.
You might want to consider switching to DotStar LEDs.
@hushed hedge can you clarify? What makes the pi so bad at driving neopixels
Hm. So, at 400 you still aren't running up against the limit of what you can blow down the line (from https://learn.adafruit.com/adafruit-neopixel-uberguide/advanced-coding it looks like you ought to be able to push ~82 frames per second down the wire)
@hushed hedge also I'm specifically working with the RGBW variant of the neopixel
so FastLED isn't an option. Also, I'm working with circuitpython so...
No, nevermind, I just looked at the guide.
๐คท Most of the things that popped into my head as pitfalls don't sound like huge problems, overall.
i mean, processing power is 10X+
alternately, does CP have any kind of DMA support for Neopixels?
@onyx hinge Have started to translate CPY to Australian ๐
I have an ItsyBitsy M4 and am trying to use pin A5 as a pwm output however I am getting this error.
Here is the line that errors:
fan = pulseio.PWMOut(board.A5, frequency=5000, duty_cycle=0)
A5 is not used for anything else so that shouldn't be an issue.
Thanks!
Timers are shared between several pins. It possible all the timers that pin A5 can use are already used by other pins.
I have no other PWM pins in use, I have an SPI and I2C bus set up, I don't know If those count as PWM or require timers but they are the only other pins that are used I can think may interfere.
Unfortunately, I cannot use another pin because I am using the ItsyBitsy as an embedded microcontroller for a PCB I made.
On a side note, I tried initializing the PWM pin before anything else (any digitalio/analogio/busio) and it still errored.
It's not like it errored later, it errored on the line of code initializing the PWMOut.
Hey Circuitpythonisters. Do you know if the REPL can be run on a different serial port / a second instance of it?
what are you trying to do?
@stuck elbow read the REPL over serial pins instead of USB
but why
I don't have USB connected on my HAT board.
The serial is directly connected to the RPi Headers
wait, if you are talking about rpi, that's python 3, not circuitpython
you can enable login screen on the rpi's serial and use that
no
I meant what I asked.
Can the CircuitPython REPL on a CircuitPython board be sent over serial instead of USB. I have a CircuitPython HAT (Robo HAT MM1) that has direct serial pin connection to a Raspberry Pi. I don't want to use USB from the HAT.
sorry, I don't understand what you are trying to do so I can't help you
On ItsyBitsy M4, pin A5 is PA06. Looking at the datasheet for SAMD51, only TC1/WO[0] is available on that pin. I wonder if that timer is used internally for something.
@silver tapir hum that's an interesting problem, the link that weblate offered you. That code is in a git submodule, but I guess weblate doesn't understand such things. https://github.com/v923z/micropython-ulab/blob/master/code/filter.c is the file in question.
@craggy galleon You would likely need to use a custom build of CircuitPython. I don't think it will work with the default one.
@lucid solar ha ha ha
@onyx hinge Thanks, I did got to it "by hand". I actually could finish ES to ๐ฏ
@lucid solar lol. That's to be expected. ๐ ๐ Is it even possible is a better question?
gooooooaaaaalllllllll
yeah.. not good at sports :รพ
The TCx/WO[0] timers are used for some special function (floating point maths or something) and are not usable as PWM or other functions.
@silver tapir I've made a feature request to weblate about this situation, though it's probably not trivial. In case you're interested in tracking it: https://github.com/WeblateOrg/weblate/issues/4139
@lucid solar lol. That's to be expected. ๐ ๐ Is it even possible is a better question?
@craggy galleon yes...I've done it for the STM32 port. If you just want to build it for yourself, then you could edit the serial.c files...am not sure if you know C though...
I'll take a look. Thanks Mark! ๐
@craggy galleon https://github.com/adafruit/circuitpython/pull/2837/commits/007c92ee6ab8da342dacb8967ef999b6d83596ec this is my code for the STM32 port
Thanks heaps! Where are DEBUG_UART's defined? Is this something that would need to be customised / added on the D51 port?
in the board definition, in ports/atsamd/.... (I'm guessing the path...hope you find it.)
I know where that is ๐ I can work it out from there. Thanks!
Not floating point, but #1766 I believe is talking about the fact that we can only use one capture channel per TC if we want 16-bit frequency accuracy, because of the way the TC registers are used for different functions. So we cannot use some TC channels despite them appearing to be available. @tannewt may remember the details.
@onyx hinge @solar whale I was thinking it'd be stored in a non-py file at the root of the fs
anyone know why this text blinking would be happening? https://forums.adafruit.com/viewtopic.php?f=60&t=167092&p=818635#p818635
@slender iron so similar to secrets.py but not a .py file... what is the conflict with "secrets" in CP?
cpython has a secrets module: https://docs.python.org/3/library/secrets.html
which is not what we have
ah -- thanks
@slender iron I'm not sure about blinking, but that problem might be related to the anchored position issue in display_text
Maybe should should make a separate PR to fix that issue by itself. I believe that fix is relatively quick and easy. But it's gotten bundled in with the changes to remove the usage of 0 sized bitmaps which has kind of gotten a bit complex and isn't quite ready yet.
Basically the setter for anchored position was updated to allow it to work with scaled labels. But unfortunately I missed the getter, it was not updated to reflect the same changes as the setter.
So code that was relying on the getter has been causing trouble. For me it doesn't look like blinking, but rather the text "jumps" downward a few times until it's no longer on the screen.
WO[0] on the TCs is used for the top value in 16-bit mode. That gives us much finer control over the PWM frequency.
If you want to make it more advanced, then you could have it work but with coarse frequency. What are you using it for?
Thank you @DavePutz ! Looks good.
I've just created a PR with the anchored_position fixes by itself here: https://github.com/adafruit/Adafruit_CircuitPython_Display_Text/pull/62 I won't be able to test it thoroughly until later on this afternoon though.
@silver tapir I just noticed this in some text you pasted on github: Archivo "electioncal_graphics.py", lรยญnea 76, en load_data. Where it should be lรญnea. Is this what you're actually seeing, and if so in what terminal software? Does it show properly on the LCD?
This is the mu-editor serial repl, it doesn't have utf-8 support.
There's a bug for it and has been there for some time.
If I use screen or another tool, it does show properly.
And yes, it shows nicely on the screen.
okay, I'll stop worrying then ๐
This is the board: https://www.raytac.com/product/ins.php?index_id=81. This board appears to be a simple breakout / demo board for all of the pins on the Raytac MDBT50Q-1MV2 module used in other products and available here: https://www.adafruit.com/product/4078
I used the nRF Connect suite and a JLINK EDU Mini to load the same UF2 bootloader used by the PCA10059 and then I was able to install CircuitPython without issue.
This is the output from boot_out.txt:
**Adafruit CircuitPython...
Please don't reuse the PID. See the learn guide for requesting a new PID.
Thank you for the new board def! Just a couple suggestions.
We do support a tricolor as a status NeoPixel. See here for an example: https://github.com/adafruit/circuitpython/blob/main/ports/nrf/boards/particle_argon/mpconfigboard.h#L35
This board doesn't have a neopixel, it has 3 separate LEDs and one spot for a 4th LED of the user's choice. Or at least I assume that is Raytac's intention. It costs roughly $20 USD at the time of this post and it's the only nRF52840 board I know that breaks out all of the pins at that price point.
@lapis hemlock Sorry you got tagged by the bot. I've unmuted you.
I was told that I cannot reuse the VID/PID in this pull request: https://github.com/adafruit/circuitpython/pull/3127
I do not have my own pair and I do not see anything about one in Raytac's documentation for this board: https://www.raytac.com/product/ins.php?index_id=81
Thanks!
@lapis hemlock Sorry you got tagged by the bot. I've unmuted you.
@idle owl Oh, no problem at all, don't worry!
Jeff found out what the problem was. Apparently, I wasn't supposed to mention multiple people in a message.
Ah, and you quoted someone else who did. Right.
Either way, apologies. It's there for a reason, but it still catches things that it shouldn't from time to time.
@idle owl I think it is absolutely OK. I just didn't know that you had made the rules a bit stricter, but I definitely understand the underlying reason.
@lapis hemlock We added the Adafruit server to something called Discord Server Discovery, which means people can search for keywords and find our server. It also means bots can scrape and find it too. And we've had an enormous influx of issues since then. So we enabled a lot of things we had left out before.
@idle owl Fair enough.
I am just using it to control a small fan, nothing fancy.
I don't understand anything you guys are saying but it sounds like you are saying that pin A5 cannot do PWM, if that is the case you probably should update the pinouts section for the ItsyBitsy M4 for it says, "A4 and A5 have PWM output.".
Here you go!
RayTac MDBT50Q-DB-40 VID 0x239A PID 0x00BB # bootloader
PID 0x80BB # arduino
PID 0x80BC # circuitpython
For CircuitPython, use these values.
USB_VID = 0x239A
USB_PID = 0x80BC
Ok, seems like this avoids the edge cases I was worried about. Nice reduction, thanks! I'll work on bringing this same strategy into UART and I2C next week.
@hierophect I rebased the branch to fix the merge conflict, no other changes. You should be able to re-review and merge now.
@tannewt was just waiting for rebase @jepler thanks for wrapping this up, looks good.
So...is there anything I can do to use at least very rudimentary PWM on this pin?
So...is there anything I can do to use at least very rudimentary PWM on this pin?
I haven't tried this but I had an idea (probably a bad one).
What if you DigitalWrite() (change pin.value) many many times in a while loop?
Don't know how fast you can switch it that way. There are probably some extra hardware / circuit requirements as well.
Yeah, that's a good idea but I can't do that because my loop has many things in it that take a lot of time (multiple seconds) :(
I guess you are out of options for using just one board ๐
You might just have to get another expansion chip that can do the PWM function for you or a small Arduino and send it the commands over serial or something. In the short term, WO[0] is not going to be freed up.
The difference is that TypeVar is exactly one type in a single definition
that uses it in more than one place (typechecker must pick one of the
options and use in all places in a single definition), whereas Union is any
of the types in any of the positions it is used (i.e. one definition can
have different types in different places). EG
AnyWritableBuf = TypeVar['AnyWritableBuf', bytearray, array.array, mmap,
memview] # AnyStr style.
WritableBuffer = Union[bytearray, array.array, mmap, memvie...
In debugging an issue with Label, I uncovered an unexpected error when using insert with an empty Group. Normal lists allow insert to be used on an empty list and the function is effectively equivalent to append. However when trying to insert with an empty displayio.Group, an unexpected error IndexError: Group index out of range is triggered. Due to this unexpected behavior a kludge to is required overcome this by...
I'm not sure if this helps in anything, but I have described my struggles with safe mode and power dipping here: https://hackaday.io/project/158981-kubik-m0/log/180416-safe-mode-problems
Any ideas would be appreciated.
@deshipu The safe.c workaround mentioned above works well for me so far.
@ita1024 I would rather change the BOD33 level in port.c to something lower, and maybe enable the hysteresis. Especially since my boards don't have any other component with higher voltage requirements. However, I would like to publish my projects at some point, and have them added to the CircuitPython's repository, and that means I can't simply just hack the firmware.
Perhaps there could be an option for switching the minimal voltage per board?
I am willing to do this when I have time. We are thinking of waiting for the MicroPython 1.13 release.
?serverinfo
@deshipu I put code in the UF2 bootloader to wait for 100ms after reaching the BOD33 level (2.7V). But I only did this on the SAMD51. I read your Hackaday post. Is that on SAMD51?
No, that's SAMD21, sorry for not being specific. I suppose a delay would work in this particular case.
I still think it would be nice to be able to modify the level per board โ I could make the PewPews work on battery much longer that way, for example, since they don't use flash.
I'm sure why the merge check is failing. It seems to be indicating an issue with the white space that I can't see on my end.
@tulip sleet just hung my linux box by trying to put a feather_m0_rfm9x in bootloader mode (double-tap reset). No unplug needed.... This is annoying -- I will be moving to Mac or Pi for awhile.
is it off a usb hub?
yes -- USB2 hub
you could try interposing yet another hub, but I can understand not wanting to bother. I think the hubs just introduce a little useful delay. I found just one hub was good enough
I am using this cheap one: https://www.adafruit.com/product/2998
@slender iron On SAMD51 I've got Audio & USB converted to having their background task triggered based on interrupts. Displayio & filesystem need to be triggered based on time, though. I don't have a plan for this. Any advice? Can we get a time-based wake-up from the RTC?
I have six devices now running. I just got one of those ultra rare 65536 MemoryErrors.
I might be doing one atypical thing, I have concurrent start_advertising and start_scan in my code.