I think the pin API for PulseOut is the best choice in the long run. We can deprecate the non-pin API in 7.0.0 and drop it in 8.0.0, or be more abrupt.
#circuitpython-dev
1 messages ยท Page 374 of 1
@idle owl These boards reset the neopixels on soft reset:
ports/nrf/boards/circuitplayground_bluefruit/board.c
ports/atmel-samd/boards/adafruit_slide_trinkey_m0/board.c
ports/atmel-samd/boards/pybadge/board.c
ports/atmel-samd/boards/circuitplayground_express_crickit/board.c
ports/atmel-samd/boards/blm_badge/board.c
ports/atmel-samd/boards/pybadge_airlift/board.c
ports/atmel-samd/boards/circuitplayground_express/board.c
ports/atmel-samd/boards/pygamer_advance/board.c
ports/atmel-samd/boards/circuitplayground_express_displayio/board.c
ports/atmel-samd/boards/pygamer/board.c
ports/atmel-samd/boards/neopixel_trinkey_m0/board.c
ports/atmel-samd/boards/adafruit_proxlight_trinkey_m0/board.c
Should NeoKey Trinkey be added to that? Why only a limited list of boards?
i think it was supposed to be any board with neopixels beyond the status led
Oh. Ok.
if there are some missing they should be added
NeoKey is only one LED. But with the key on it, it's more than status I guess.
I imagine slide and proxlight only have one as well though?
I had RGB code running, then when I saved a new file that had no LED stuff in it, it stayed blue.
which is where it left off from the previous code.
(Blinking red green blue.)
so it didn't change due to status code. So that may be new from the status led changes. we should try it on something innocuous like a Gemma: suppose you change the status LED in your program, what happens
honestly I don't remember
or have ever tried
I don't follow
suppose I had a Gemma running 6.2.0, and i changed the status LED color, and then did a soft reset. What did it do in 6.2.0, and what does it do now with the new status LED changes? And if it's different, is that deliberate?
Ok, so I went back to blink code, then saved new code, and it stayed red. Then I went to the serial console, and did ctrl+d and it shut off.
I'm running latest here.
I'll try it on Rotary Trinkey after lunch. See if they both act that way.
we could add a clear after user code is done
Is there a full list of modules somewhere? Trying to do a custom build now, want to turn off whatever I can to make space
look at the module list for your board, and then you can turn off what is still on
what are you trying to make space for? turning off modules will not increase RAM space
so if you are getting an allocation error, that will not be corrected
I needed to add... I think it was displayio? and I think it was just storage
It's the Slide Trinkey, trying to modify CP so I can run an OLED on it
From an user perspective, there's also one important note: PulseOut does not declare itself as being solely an IR tool.
There's plenty of other places where you may want to use pulse trains without using IR, for instance if you're trying to bitbang a serial protocol (I have in front of me a device that needs a 104bps serialโฆ which might be easier in some cases to bitbang than hope that the hardware supports such low baudrate).
In my case, I am actually using this for a remote contro...
It looks like the failing check is spurious, or at least unrelated. While installing build dependencies via pip:
ERROR: Could not find a version that satisfies the requirement click (from versions: none)
ERROR: No matching distribution found for click
so you could turn off several of those, especially math, _pixelbuf, analogio,...
displayio is big and you may still not succeed
Ok, going to turn those off. It's worth a try!
usb_midi also, usb_hid if you don't need it
that's probably it, random, I guess, but it's not large
when Arduino and the IDF have no such conflict.
We shouldn't design our APIs for people who have used Arduino, the IDF or read the datasheet. Our APIs should be freestanding and not require underlying knowledge of chip features.
Looks like I'm outvoted on next steps so let's plan to deprecate the PWMOut version in 7.x.
I think the pin API for
PulseOutis the best choice in the long run. We can deprecate the non-pin API in 7.0.0 and drop it in 8.0.0, or be more abrupt.
Ok, ...
Looks like I'm outvoted on next steps so let's plan to deprecate the PWMOut version in 7.x.
We can discuss this in a meeting too. We could also allow both possibilities in the constructor to make it backwards compatible.
For those uses, the pin-based interface would definitely feel easier to use, as long as there's a way to disable the carrier signal. Otherwise we're back to square one.
Could you take a look at the ESP32-S2 RMT peripheral and see if it meets your various use cases, including no carrier and low baud rate?
So they'll be CIRCUITPY_USB_HID = 0 CIRCUITPY_USB_MIDI = 0 CIRCUITPY__PIXELBUF = 0 CIRCUITPY_ANALOGIO = 0 CIRCUITPY_MATH = 0 right?
And remove the SimpleMath library?
it's CIRCUITPY_PIXELBUF (inconsistent omission of extra underscore)
remove HID and NeoPixel from the frozen library list too if you don't need them. they are big
if you are turning off native HID then you certainly don't need the frozen library
I do still want to use the NeoPixel, but I don't think I need HID unless I want to have it react
For those uses, the pin-based interface would definitely feel easier to use, as long as there's a way to disable the carrier signal. Otherwise we're back to square one.
Could you take a look at the ESP32-S2 RMT peripheral and see if it meets your various use cases, including no carrier and low baud rate?
Well, I hadn't heard of the RMT peripheral before today, but as it turns out I do have a long weekend coming upโฆ so yeah I guess I can give it a bit of a deep dive and see what ...
if your remove _pixelbuf, then you need to use the python adafruit_pypixelbuf library instead
Does it make a difference on my ending size? What exactly is the difference between a module and a frozen library?
a frozen library is python code compiled to essentially an mpy. a native module is C code
but a frozen library does not use up (much) RAM when imported
Ah...
it's also true that our sizing takes into account the largest translation. The English translation is smaller, so there is already some room if you don't need a different translation
- [ ] Update all libraries (probably only IRRemote) for the new API.
If you can provide a way somewhere to know that the new API needs to be used, I can also add it to pysdrc's Circuit Python wrapper (https://github.com/Flameeyes/pysdrc/blob/main/pysdrc/circuitpython/transmitter.py). Otherwise I guess I should just update that to have a cut-off for the older CP instead.
Ohhh, ok. I'm currently just targeting English since I have a feeling I'm the only person who will use this XD
Now one thing I'm confused on... if I don't explicitly set modules to 0 or 1, do they get loaded or not?
there are many default values, which depend on the particular chip and aspects of the build
so just set those to 0 in mpconfigoard.mk. You do no need to explicitly enable anything except displayio
Ok, cool. So I'm gonna try building it now
how many cores on your CPU?
That I'm building on?
@storm minnow enable busio too?
good point, need i2c
Ah, I probably should, lol
yes
2 cores, 4 threads
Ok, so... I had copied the directory from the Slide Trinkey, modified the files in there, but get make: *** No targets specified and no makefile found. Stop.
you must run make when you are in ports/atmel-samd
Ah, yeah, I was in boards
Building :D
darn
Ok, so, is there a way to reduce my space usage while still having displayio and NeoPixel?
10k is pretty hopeless given all that you've turned off. You could shrink the size of CIRCUITPY though that restricts your program size, but we rarely do that. in ports/atmel-samd/mpconfigport.h, you can change #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (64 * 1024) to say (48 * 1024).
you are in uncharted territory here, maybe some alternative use for this no-slider slider is in order
analogio is surprisingly large
Heh, I didn't expect to get into something that would make the pros scratch their heads
touchio?
upload your mpconfigboard.mk using the + sign on the left
it's trying to put 8 lbs in a 5 lb sack
@storm minnow what are you trying to put on there?
those should be off already
it's all in the right use of your knee
Uhhh, can I attach directly from my WSL files? Or do I have to copy out?
click the + sign and select the file
I mean, can I navigate to it in File Explorer? I don't know where it lives, wasn't sure if it was like a VHD where it's only visible from inside the guest system
Trying to get displayio in to use an OLED, heavily modifying a Slider Trinkey
ah, i see, not sure if the wsl filesystem is visible or not
copy/paste it into an editor, or just paste it inline; it might be small enough
I can't seem to copy from WSL to something else
Oh, lemme look at that
Sorry that took so long, this thing is struggling XD
how is it if you comment out frozen neopixel (which does not have to be frozen to be used)
turn off PIXELBUF also for now
it is a helper for neopixel, but is not completely necessary if you use adafruit_pypixelbuf instead
(but that uses up RAM)
Ah
also do CIRCUITPY_BUSIO_SPI = 0
that is a tricky thing I put in recently to remove busio.SPI on a board that could not use it
Ok, changes made, let me try it
building
this laptop is going to implode XD
I forgot to do -j4, but everything is at 100% so I dunno if it would make a difference
4044 bytes overflowed DX
But that's less than half of what it was before!
you can look at things in py/mpconfig.h to turn off; some are already. But this is a lot of work for a $10 board
another $10 board like RP2040 would do much better
it's a good exercise to learn the build
At this point I just want to do it for the sake of doing it, lol. I have a pile of Picos, I just like this experience!
also look at mpconfigport.h and mpconfigport.mk. If you don't need struct, could turn that off, but libraries may use it
What does struct do? I remember someone mentioning it was important
packing fields into bytestrings and vice versa
ah
it was me ๐
You were one of the instigators of this madness :P
I have some issues to tackle if you want the memory alocation problem experience ๐
Maybe after I figure out the space issue XD
Great ๐
Ok, so looking at mpconfigport.h... trying to figure out where exactly I put the #define for space?
Ah, found it!
Fingers crossedl but I think this might do it!
Remove boards that did not turn into products.
SUCCESS!
CIRCUITPY will reformat because its size has change, or if it s messed up, then do storage.erase_filesystem()
Gotcha. Actually, I think I have enough room to add NeoPixel and PIXELBUF back
That would make sense, right?
yes, if you are going to use them
Yeah, I want to be able to use the NeoPixels still for status lights
mmmmaybe I should close some things so it doesn't take so long...
Does it matter what order modules are in for enabling/disabling them? or can I have them mixed up?
I figure best practice to have them all deactivated in a group and activated in another, just curious
doesn't matter, you are just setting compilation variables
Ok, thought so
Recompiling!
Rebuilding?
much faster without the processor being pinned 100% beforehand XD
recrossing your fingers
Ok, so now I have my code and libs on -- did I wire something wrong, or did I miss something in the build?
I don't know if there are pull-ups built on on those pins? Or would I have to add one?
there's not pull-up on the board, some breakouts have them
Looks like I'm outvoted on next steps so let's plan to deprecate the PWMOut version in 7.x.
We can discuss this in a meeting too. We could also allow both possibilities in the constructor to make it backwards compatible.
Ya, I think we should in 7.x and then remove the PWMOut in 8.x.
- [ ] Update all libraries (probably only IRRemote) for the new API.
If you can provide a way somewhere to know that the new API needs to be used, I can also add it to pysdrc's Circu...
Ok, so I've never added a pull-up resistor XD so it's a resistor from VCC to the pins in question?
or VDD, whichever I'm getting power from?
yes, like 5-10 kฮฉ
pull up to 3.3v, not 5v
Ok, thanks. Lemme dig out a resistor and try it out!
you need two resistors, one on SDA, one on SCL
Gotcha. I wonder if this is the last hurdle
There's never a last hurdle. ๐
Hehe
I have to say, this is the most I've dug into something in a while! Usually I spend lot an hour at most and do some relatively simple changes to things XD
Yeah it has different I2C pins. I'm not sure if folks are still using the pre-release boards, but I sold a few hundred so possibly.
no problem, then, if there are significant numbers of potential users, that's fine
thanks for the response
@tulip sleet I have a decision to make for RP2040 deep sleep. The RP2040 does not lose the state of RAM in deep sleep, even if you put it in "shutdown" mode. So for true deep sleep, I need to either
a) remove NORETURN from the global API for common_hal_alarm_enter_deep_sleep and actually let it return for the RP2040, in which case it would return to run_code_py in a similar way to fake deep sleep
b) run reset_cpu() after waking, but since the RP2040 doesn't actually expect to ever lose memory, it doesn't have easy ways of storing wakeup information across resets, so I would have to either ditch alarm.wake_alarm or use NVM.
note that RP2040 deep sleep is only different in terms of its treatment of RAM. It still shuts down USB and peripherals, so just using fake deep sleep all the time isn't sufficient.
So I added a 9.8~kOhm resistor to each SDA and SLC -- but still getting the error
@gloomy shuttle hey, i think you were asking about this:
https://learn.adafruit.com/circuitpython-libraries-on-any-computer-with-raspberry-pi-pico/other-rp2040-boards
(recently made live)
Oh, I confirmed I'm seeing resistance between SDA/SLC and 3.3V, so I know they're connected...
Is the RAM preserved after reset_cpu()?
no
the datasheet says that? It's cleared?
it's the watchdog... let me double check
maybe there are some preserved registers?
Yeah actually there are! I didn't look at the watchdog
the wathdog has some scratch registers. We'd have to see if the pico-sdk or bootloader uses some of them
i was just looking at the ESP32-S2, which has preserved registers, but they seem to all be reserved! We are using one but it's not working with TinyUF2
but if RAM is preserved, then you could leave it anywhere
Could you rephrase? I'm not totally getting your argument.
I doubt that the watchdog preserves flash since its supposed to get you out of infinite loops which it wouldn't do if the program counter was preserved
i'ts just an aside about the ESP32-S2, not about the RP2040
but the scratch registers it provides are fine for preserving state, the STM32 has them too, that's what I use there
so look at watchdog_reboot() in the pico-sdk, because it uses some scratch registers
again, if RAM is NOT cleared, then you can just store the state in RAM even in deep sleep
it doesn't specifically seem to say if RAM is cleared or not, but it says it reboots the processor via the reset controller, so I think it's implied?
And I don't know why they would include scratch registers if the RAM doesn't go away
So I'm pretty sure it gets reset like everything else, just like most chips
RP2040 deep sleep is just funny because it has a low-power mode for the RAM that doesn't require you to actually shut it off, and they don't give you shutoff options
how is state saved on the nRF in a deep sleep?
It isn't, NRF has specific flags like NRF_POWER_RESETREAS_RESETPIN_MASK that provide the reset reason directly
same with ESP32-S2
STM32 is annoying about reporting what it reset from, hence why I use scratch
oh, so we reconstruct it. so on STM you used the RTC or equiv registers, have you looked at atmel-samd yet?
no
Haven't done anything for samd, sounds like it might not be next priority for me
Anyway, I'm all set with these scratch registers, thanks for helping me find that
i'd say look at that too, to plan ahead. yes it may make sense to drop the NORETURN, depending on SAMD.
Yeah, but doublecheck if someone else is using them. That's the problem on ESP32-S2 (We were using one for something else, not deep sleep, and it doesn't seem to be surviving a reboot that goes through the UF2 bootloader)
we were using it to support the safe mode reason
Sounds like you found the right place! We're happy to help get you started on discord: https://adafru.it/discord
@tulip sleet the RP2040 datasheet seems to be written with the SDK in mind, and it only makes mention of magic numbers across a couple of registers. So I think I'm in the clear to use a coupel of them
Their use is featured in datasheet examples, so
I rebuilt CP and changed shared-module/gamepadshift to verify that this works. All I changed was the for loop in init.c to 16 instead of 8, and all of the relevant uint8_t's in that file and GamePadShift.h to uint16_t's, and that does the trick. I'm just not 100% about:
- how to bring that out to the CP API
- whether making the returned value a uint16_t or even a uint32_t would break any existing code/projects
uint32_t is problematic because without longint support, integers are only 31 bits. So 16 or 24 is better.
@tulip sleet so I added pull-up resistors, but still getting the error about pull-ups... Attached to 3.3V like you said. Is there a software side I might have missed?
Pins are SWC and SWD [which I believe to be PA22 and PA23?], display is the 0.91" OLED 128x32 with STEMMA
those pins may not work - they are debugging pins. I though you would be using the potentiometer pins?
It was intimated that those pins might well be usable, and I connected to those since I'd need 2 pins, and I wanted to try leaving the touch pad free [but that can be used like a regular pin, so I was told] if SWC and SWD don't work
so you have jumpers soldered to the round SWD/SWC pads?
Indeed
i'll be back later after looking at the schematic
Ok, I'll be around, just ping me :D
Question is this an Adafruit display?
the 0.91?
Yup, that's the one
so I can confirm that it works with the samd21 with the resistors
I do not know if you can display anything
That I did not try
Just to clarify here, I am talking about the QT py
The big thing we're not sure about is if we can use the pins I picked, lol
mmm, either case we will learn a lot
I've learned how to build custom CircuitPython at the very least!
yes, I have never build CP for the samd21
my comuter takes like 5 minutes to build any board
my raspberry 4 pi is faster
It took 10 minutes on laptop here at one point XD
so what are the plans for the picos?
Uhhh... I dunno yet, lol
Mind if I ask a couple of questions: first--I'm working on the SGP40, and am about to test that I can get the raw score for the sensor with humidity compensation. That's going to be an important feature for the voc algorithm for that sensor, but it can be a stand alone improvement as well--would it be better to make that it's own pull request, or should I hold off until I have the voc algorithm running as well?
@storm minnow the SW pads should be ok. So I think it's the wiring? could you give a link to the product page for the display?
@dhalbert thanks for waking up this thread. From my standpoint, I am happy with my local build that fixes the skip PR-3967. That PR works well in my application, as it solves the skip when fine tuning a setting, up and down. A 'request for change' on that PR, is non-specific on what acceptance criteria could be. Maybe only the name of the variable last_state is the issue -- (sorry deep dive here) to save space that var gets mutated in ...
are you making examples as well?
These displays are small, only about 1" diagonal, but very readable due to the high contrast of an OLED display. This display is made of 128x32 individual white OLED pixels, each one is ...
normally we try to add example for new features, that why folks can see these improvements and the reviewer can use them as test code
is the raw value useful? It's fine to separate if you think the voc is a long-term thing. It doesn't matter all that much. It's easy to do releases
Oh! I certainly can add examples. I'm adding it so I can have better sensors and learn the workflow to submit things to circuit python, but when I'm done with the code I'll need someone to point me to where to add the examples
ping me if needed I can help you with that
@storm minnow that display board already has pullups. Did you wire all four appropriate pins: SCL, SDA, 3.3v power, and ground? which power pin did you use on the board?
Right now it just returns a random measurement that's kind of related to voc stuff, in fact it leads to my second question question
The second question could be an issue on github, but since I'm working towards a pull request I figured I'd ask it here. On this line: https://github.com/adafruit/Adafruit_CircuitPython_SGP40/blob/66ddc29e46ca20c4a2bc7e8c2aab460294da12e5/adafruit_sgp40.py#L39
the 'no humidity or temp reading' command is constructed (in this sensors instance you fill it in with dummy values) The values chosen don't match up with the data sheet. I don't imagine it matters much but it could conceivably throw someone off. Is there a reason for it, should I change the default values, or should I leave it as is?
Oh... so I shouldn't have gotten the error XD Yes, SCL, SDA, GND, and VIN, because the other one was 3Vo which I thought was not the right one. Used the lone pin close to the USB from the slider for GND
in this case I prefer to open an issue, and then manetion in the pr that you are solving that issue with the PR
Awesome, should I open the issue and make the pull request at the same time or hold off a bit?
it is up to you :), the issue would be good because that way we do not forget that we need to solve that
Yes
either with your PR or without ๐
at the 3v OUT pin on the display board, are you measuring about 3v (will be about .3v lower than the input voltage)
Ok, if that's the case I just need to test the changes a bit, format accordingly, then this evening I'll open the issue and make a pull request. I think it'll make more sense to make two pull requests--one for sgp40_raw measurement with humidity compensation, and one for the voc algorithm. In the humidity compensation I'll adjust the default dummy variables as well. Does that seem like a good workflow?
I'm getting 3.26V from both VIN [soldered] and 3Vo
yes,
sound like a plan
Awesome thank you!
No, floating
No, thank you!
I defer to core team members to choose: this PR or go for a different tack. I'll try to help if you give me some direction.
there is an "on" tiny LED on the back near one of the STEMMA connectors. is it on?
Yes
ok, then I would say there is something funky about the wiring to the SWD and SWCLK pads. Why don't you try toggling those by hand with DigitalInOut's, disconnecting them from the display board. Measure at the end of the wire, not the pad. If they seem OK, try connecting some other I2C board up (like a sensor). The fact that it said it thought there were no pullups is very odd, because the display board has them
remove the resistors you added
Ok, start with the resistors... How do I hand toggle digital IOs?
wait, i know the problem, you have the wrong pin numbers, they are PA20 and PA21. see the schematic I posted above
(for DigitalInOut help, and lots of other stuff, see https://learn.adafruit.com/circuitpython-essentials/circuitpython-digital-in-out
Oh, glad I didn't disconnect the display yet XD
Using 20 and 21 instead of 22 and 23
afterthought: the state machine that we are trying to wrangle here, is required to debounce those physical contacts. That combined with the possibility of missed interrupts, necessitates a really hardened, all possibilities handled, solution.
And looking forward to seeing a PR2040 PIO solution ๐ธ
Take away the corresponding IGNORE_PA20and PA21 lines in mpconfigboard.h
Done, rebuilding
Hmm... I commented out those lines and rebuilt, but same error
@tulip sleet I see they have 1 next to all the items -- do I comment/delete the lines or change the 1 to 0?
delete them
Ok, let me try again
Ok.... so... it's acting strange. I rebuilt CP, copied it over, same error. I tried using storage.erase_filesystem() but it rebooted and then still showed CIRCUITPYTHON with files intact
@tulip sleet I know there's a flash_nuke.uf2 for the Pico if it starts having these weird issues -- does that file only work for the Pico? Or is there a different file for different boards?
Check the Troubleshooting page in the Welcome to CircuitPython guide, and try the Trinket eraser. No guarantees.
Worth a shot. Thanks!
Ok, did that eraser, it cleared, redid CP, came back clean.... but getting the same error again
Oh no, are you going to use the pico now?
That's not the point of this exercise :P
I'm gonna keep trying until someone tells me it's impossible XD
Hmm... Should my builds be the same size with the ignore statements for PA20 and PA21 removed?
they will be slightly larger
Hmm, I think something is wrong then, it didn't change
Hmmmmm.... ok... so I went into pins.c and added lines for PA20 and PA21, but it said boards/oled_trinkey_m0/pins.c:7:45: error: 'pin_PA21' undeclared here (not in a function); did you mean 'pin_PA31'? 7 | { MP_ROM_QSTR(MP_QSTR_SD1), MP_ROM_PTR(&pin_PA21) },, so I changed them to 30 and 31, and it built like that, but it says "Invalid pins" using those designations [either as microcontroller.pin.PA30 or board.SD0 [because I did SD0 and SD1 because I don't know which one is SDA and which is SDC yet]]
Well... I need sleep DX leave pings with any suggestions. Good night, thanks for the help!
the suggestion of using PA30/31 is the compiler doing its best but giving bad advice
Firmware
Adafruit CircuitPython 6.3.0-rc.0 on 2021-05-25; Raspberry Pi Pico with rp2040
Adafruit CircuitPython 6.2.0 on 2021-04-05; Seeeduino XIAO with samd21g18
Code/REPL
codepico.txt
REPL
[3500, 241, 465, 351, 514, 403, 463, 1269, 464, 321, 464, 428, 438, 1268, 465, 429, 437, 402, 252, 404, 462, 1270, 463, 405, 461, 404, 462, 1021, 462, 406, 461, 1272, 462, 405, 86, 1272, 463, 429, 438, 403, 463,...
Once more I am deceived by the machines!
It might be worth offering this change to MicroPython as well, if you feel like it.
micropython#7209 pending review since May 3rd -- would anybody like to help them review it?
Hmmmm.... this is weird. So if I remove the ignores for PA30 and PA31, it'll build, and I can add entries to pins.c. If I remove ignores for PA20 and PA21, it doesn't let me add entries for them in pins.c and builds, but doesn't recognize them when I try to call them
alright, I read the schematic wrong. It is PA30 and PA31 for SWCLK and SWDIO respectively. The schematic I was looking at is blurry and the "3"s are mashed up. So forget about PA20 and PA21 -- I'm sorry. .... However, PA30 and PA31 support PAD[2] and PAD[3] on SERCOM1 , and you need PAD[0] and PAD[1] for I2C. So those pins are not going to work for I2C. AND, neither are the slider and touch pins. They are PA02 and PA07, and they similarly do not support a PAD[0] and PAD[1] for I2C.
On some chips you can use any pins for any function. That is not true on the SAMD line.
so this whole exercise is failing up front. You learned a lot about builds, but your goal is not going to work, sorry!
Ah, that explains it XD Oh well! Thankfully solder is cheap and yes, I did learn a lot!
Thanks for all the help in my fruitless adventure XD
an alternative to all this is to get another slide pot ๐
Heh, yeah... I did manage to get the old one working after disassembling it, but I've mangled the pins on it and the pads on the Trinkey enough that I couldn't it back on XD
i'm curious what the pot failure mode was? Did something get bent or pushed out of place?
I'm honestly not sure! before opening, resistance read like 8kOhm regardless of position. Opened it up, got 10kOhm across the one side, nothing on the other. Looked at the pins, seemed good... squeezed it together and it worked
I think something might have been blocking that I didn't see fall out?
so maybe a foreign body on the slider or something or somehow the slider was not making contact. hmm, thanks
Possibly. No problem!
Similar results trying to play a RawSample on the Feather RP2040 with MAX98537.
Adafruit CircuitPython 7.0.0-alpha.2-646-g7df5d74d9 on 2021-05-22; Adafruit Feather RP2040 with rp2040
dac = audiobusio.I2SOut(bit_clock=board.D5, word_select=board.D6, data=board.D9)
clip = make_squarewave(440*Hz, duty_cycle=0.5)
dac.play(clip)
time.sleep(0.5)
dac.stop()
I hear a click at dac.stop() but not audible tone is produced. I measured a 320 kHz signal on the MAX98537 te...
@tulip sleet Oh, just so I don't try something else that won't work, since I have a feeling I don't have more to learn in the CP build direction from the same sort of exercise... what can I do with the pins that are exposed, since we've eliminated I2C? Touch and the slider pin I assume can be used for any regular digital IO functions?
right, and same for SWCLK and SWDIO.
they can all be used for timers (e.g. PWMOut)
PA02 can be used for AnalogIn. It is not connectable to any SERCOMs, so no use for I2C, SPI, UART, etc.
you can use PA31 and PA30 for SPI SCK and MOSI, so you could drive an SPI display (since it does not need MISO; it's output only). This works:
spi = busio.SPI(microcontroller.pin.PA31, microcontroller.pin.PA30)
(I tested it)
this works:
u = busio.UART(microcontroller.pin.PA30, microcontroller.pin.PA31)
that's about it; this is all from studying the datasheet, chapter 7
Ahh, ok, cool. I hadn't dug that far into the datasheet, I only found the pinouts XD
I'll have to see if I have an SPI display...
I was surprised to find ulab absent from the KittenBot Meowbit recently as the devices for MakeCode Arcade generally have a decent amount of resources like flash.
Discussed this in the comments in https://github.com/adafruit/circuitpython/pull/2693#issuecomment-841891259 and @hierophect mentioned it's more to do with the fiddly aspects of layout then quantity and it could be done.
[adafruit/circuitpython] New comment on issue #4814: Add ulab to KittenBot Meowbit \(STM32F401RET6\)
I don't have immedite need for this but it would be nice to "port" the code from my new component tester onto it.
[adafruit/circuitpython] New comment on issue #4814: Add ulab to KittenBot Meowbit \(STM32F401RET6\)
interesting! this isnt something we have any plans on working on - @kevinjwalters please try! any PR is welcome!
[adafruit/circuitpython] New comment on issue #4814: Add ulab to KittenBot Meowbit \(STM32F401RET6\)
lazy copy paste, here's how Micropython packs structs into the ISR section.
/* The startup code goes first into FLASH */
.isr_vector :
{
. = ALIGN(4);
KEEP(*(.isr_vector)) /* Startup code */
/* This first flash block is 16K annd the isr vectors only take up
about 400 bytes. So we pull in a couple of object files to pad it
out. */
. = ALIGN(4);
/* NOTE: If you update the list of files contained in .i...
Reportedly, actions/cache@v2.1.6 fixes https://github.com/actions/cache/issues/467 -- for more details about the change, https://github.com/actions/cache/pull/596
I think 467 is related to our occasional problems where the esp-idf cache within actions becomes corrupted.
Apparently, "actions/cache@v2" is updated to include this change, so we should get it automatically. I was unaware of this element of this aspect of how tags are managed in actions/cache.
commit c64c572235d810460d0d6876e9c705ad5002b353 (HEAD -> main, tag: v2.1.6, tag: v2, origin/main, origin/HEAD)
Author: David Hadka <dhadka@users.noreply.github.com>
Date: Thu May 27 10:46:35 2021 -0500
Catch and log unhandled exceptions stemming from closed file descriptor (#596)
[I added "closes:" line to the initial comment, so that accepting this PR will automatically close the related issue]
What I think I see is that by removing the "stop", dma_hw->timer[self->pacing_timer] is no longer set to 0, causing each play-while-already-playing to allocate a new pacing timer.
If you revise your test program to repeatedly start a new looping sample without closing it first, does it soon fail due to "No DMA pacing timer found"?
I did not actually test anything, I just looked at the code.
@tidal kiln I just submitted a PR to fix the led_on example to initialize the keyboard.
I think more work needs to be done. I didn't look at the other examples that need the same thing.
know how to run black?
it would be good to set up pre-commit
Is this ready for review?
(LILYGO memory misconfigured?)
Does the LILYGO have less memory? That could cause a crash. The UART output from a debug build may have more details too.
yes, I didn't realize I hadn't ran pre-commit install in this repo.
blegh, this sublime upgrade
what a mess. Anybody know if I can revert without losing all my packages and settings?
It should have 8MB, just like FeatherS2. I don't know what these params do, but there are differences in the sdkconfig files between the two boards. For example, the LilyGo has these where the FeatherS2 does not:
CONFIG_SPIRAM_SPIWP_SD3_PIN=28
# ...
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384
CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768
No idea what accounts for espidf.heap_caps_get_total_size() for FeatherS2 reporting 161844, but LilyGo reporting 8583106.
@idle owl hello could you take a look to this PR https://github.com/adafruit/Adafruit_CircuitPython_DPS310/pull/15. we would like to put some comments in the Readme, and I would like your input ๐
Sure.
@still zephyr In the middle of a thing at the moment, so I'll take a look later today or tomorrow.
Thanks
Happy to say that @tulip sleet helped me get the new Dynamic USB stuff working on the XAC! That means we won't need my custom build anymore & the broken USB stack Microsoft shipped has been overcome!
what about bitbangio ?
Here's the code to make a joystick show up on the XBox Adaptive Controller port (left or right)
@tulip sleet So, for Dormant mode on the RP2040, the RTC actually doesn't work unless you supply it with a fully external clock through a GPIO pin. Do we want to support that somehow or should I just put a NotImplemented in there for RTC deep sleep?
I'd thought I'd gotten around it somehow but it turns out it just wasn't going fully dormant
suddenly danh was incredibly popular
Alternatively, I could put some kinda flag system in there so that when an RTC alarm is included in the alarm list, it just uses regular sleep rather than "dormant" but clocks way further down than we normally do, disabling the USB clocks and stuff.
Dormant is <1mA but regular sleep with almost everything turned off isn't too much higher, like 5mA
Might just be clearer to be upfront that RTC alarms won't get that kind of savings though? I'm not sure what approach adheres the best to the Circuitpython philosophy here. Maybe you have thoughts @slender iron?
This PR adds the Alarm module for the raspberrypi port, with the TimeAlarm and PinAlarm alarm types (the RP2040 does not have a touch module). Tested on the Raspberry Pi Pico.
When code.py is running, sending a certain quantity of characters to the serial port disables ctrl-C.
Here is a test python script that takes the serial as argument, and can be run to see if it interrupts the code, using a simple code.py blinking an LED. Different values of NUMCHARS will cause the issue depending on the board/port.
# that's for convenience
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('port', type=str, help="Serial port of the board", ...
One complication of this implementation was the RP2040's inability to wake off the RTC when in "dormant" mode, unless the RTC is supplied with an external clock input from a GPIO pin while sleeping. There are a couple options for how to approach this, and I'm not sure which is the best fit for Circuitpython:
- Throw a ValueError when attempting to use a TimeAlarm with deep sleep (current implementation)
- Allow RTC Alarms, but trust the user to supply a clock source. This isn't very Cir...
good idea
do you mean exit_and_deep_sleep() is not implemented? I would say let's go into as deep a sleep as possible
3. It might seem like a mysterious degradation in battery life from the user's perspective when compared to only using PinAlarms.
On other boards the opposite is true (though not 5mA, but 1.5mA, say): PinAlarms are more expensive in terms of power than TimeAlarms. So I'm not sure this is terrible, though it is disappointing.
@ionic elk my feeling is to cut our losses and not do alarm on rp2040 if we can't run the rtc during dormant
On NRF52 boards (CLUE, Feather NRF52840 Express) pasting code to the REPL can lead to characters missing sometimes, unpredictably. I couldn't reproduce the issue on Circuit Playground Express or other non NRF boards.
For example repeatedly pasting "| | | | | | | | | | | | | | | | | | | | | | | | |" (with a return) can lead to that kind of display (can take multiple tries to reproduce).
>>> "| | | | | | | | | | | | | | | | | | | | | | | | |"
'| | | | | | | | | | | | | | | | | | | |...
- The
out_report_lengtharg for theusb_hid.Deviceconstructor was checked to be 1-255 instead of 0-255. There was also a bug of what type the arg was, which meant that an arg of 0 was interpreted as 1, so the check was not triggered. Fixed. - Check the the
report_id_indexis in range, not past the end of the report.
Tested by @ATMakersBill.
I think @FoamyGuy had something similar on one of their streams. Pasting into the REPL wasn't reliable. I can't remember what the board was.
I found the stream:
https://youtu.be/fkEcwVXkMgc?t=2049
The first bad paste is at 34:24
My gut feeling is that there is a (keyboard) buffer that is overflowing, but why is it only losing a single character at a time?
I want to take a small slice from a larger .wav file and loop it.
Something like this would be great:
dac.playSlice(waveFile, offset, duration)
Units for offset and duration would be samples, the user would have to be aware of the sample rate.
I want to build a handheld audio sample and playback device. The current workflow is to cut up the samples using Audacity, export individual slices as .wav files, then play them on the device.
A lot of webpages return HTML responses instead of JSON objects. It would be great if there were a simple HTML parser built into circuitpython that could allow users to extract data from HTML response webqueries for their projects.
@tulip sleet @slender iron whoa hang on I must have miscommunicated, Alarm on RP2040 is done, exit and deep sleep works just fine with PinAlarm and both alarm types work with light sleep. The only thing that doesn't work is waking from DeepSleep on an RTC alarm using "dormant" mode.
I have examples of RTC waking from a 5mA heavily-gated light sleep mode that we could use for deep sleep, too, I just wasn't sure if it was the right call for the API
the light-sleep RTC mode to use for deep sleep TimeAlarms sounds OK to me, we just have to document the idiosyncrasies of the the different chips for one or the other: ESP32-S2 is great for deep-sleep TimeAlarm, not so great for PinAlarm. RP2040 is the reverse, etc.
A lightweight Python-based library might make sense, though "HTML" and "lightweight parsing" don't tend to go together. I don't think we'd have the room for a C-based one in a number of boards. Using regular expressions to scrape data from HTML is frowned upon, but is possible. Are you using re right now?
Please check the comments in issue #3152. What I found was that the flaky pasting depended upon how the client program was sending the string to the CP board.
Oh it's a known issue, I completely missed it !
Well sorry for that.
Before, when an OnDiskBitmap was a paletted bitmap type, the palette was internal to the OnDiskBitmap, and it internally performed the palette conversion itself. When using with a tilegrid, a ColorConverter() object always had to be passed.
Now, an OnDiskBitmap has a "pixel_shader" property. If the bitmap is a paletted bitmap type, it is a (modifiable) Palette object. Otherwise, it is a ColorConverter() object as before. This allows palette effects to be applied to paletted OnDiskBitmap...
@tannewt requesting your review since this is an incompatible change.
@onyx hinge Iโm out until Tuesday but โ๏ธ seems fine to me.
No hurry, take your time off!
I was tidying up my git and found this feature that I had not PR'd
@ionic elk I think the deep sleep call should raise an exception when given a time alarm then. I just donโt want to see any more major rework done on it. Time to PR what youโve got
@onyx hinge it should probably be backwards compatible though.
I'm not sure how to make it backwards compatible, if you see a way I'm happy to re-work it!
@slender iron PR is up! Got it in yesterday.
Make pixel shader a kwarg? If none then provide a default equivalent to what it does now
Just put together a really quick RTC deep sleep patch too, alongside some CI cleanup
Ok great! I can look Tuesday if no one gets to it before then
Can't use PinAlarms and RTC alarms at the same time for some weird reason but I'm not going to dive into that. Probably best for an actual support email, if RaspberryPi offers such a thing like Espressif does.
literally, ungating the pad clocks turns off rtc interrupts. It's wack.
no wait I just messed up my masks, it all works. bleh
Added the definition for Cytron Maker Pi RP2040.
RMT
Need to try the actual code, but looking at the documentation yes this should be perfectly fine to use: the carrier is optional and controlled by carrier_en. Which is exactly what I need in my cases: RMT without a carrier.
(Having a way to have PulseOut without a carrier is literally what I need, and it sounds like, if this is exposed correctly, it would be an even better fit fo...
While working with the Makefiles I noticed that some items are listed twice in $(OBJ). This doesn't usually pose a problem, but it seems unusual and would be nice to understand and fix. (It caused me a problem because I used $(OBJ) rather than $^ for placing the list of objects in a commandline.
During a build for feather_stm32f405_express, the following items appeared in $(OBJ) multiple times; the count is given.
2 build-feather_stm32f405_express/shared-bindings/audi...
Hello @solar whale by any chance do you have the MAX7219? to test some example code in this PR https://github.com/adafruit/Adafruit_CircuitPython_MAX7219/pull/32
@still zephyr Sorry, that must be one of the few Adafruit products I have not purchased ๐
Thanks... ๐
Sounds like you should fix that... :P
gotta buy'em all
I've tried...
lol
is just an IC for a led matrix... I do not like leds or displays so who knows...
Don't like LEDs and displays? :O
nope, ๐ I like sensors ๐
But displays tell you what the sensors sense!
lol
๐
I do not own a single neopixel
Sensors and eink is where it's at ๐
I have an eInk... but I think it may be damaged >~>
what's the issue with it?
(I am not an expert in eink at all, I just plan on making an ebook in the next few years)
I've had issues with getting it to update, and it appears to be permanently red around the edges and pinkish all over [it's a tri-color one]
Black on the edges is faded
Ohh, red tri-color screens have a permanent pink color to them that, to my memory, becomes increasingly present over their lifetime
I don't know about the edge issue though. I only have black and white screens
Ahh... it was perfectly white when I got it [outside of the Blinka red bits], and I had no idea they changed color over time
If you refresh the screen, the pink should go... no? I mean, it become pink if you keep the same image for ever and powered off.
It doesn't seem to totally go away on the edges when it refreshes, no. I did notice it would start to fade into pink after being left with an image and unpowered, but it seems worse... I need to play with it again in CP, I was messing with Arduino and it was acting weird
There might be a special "refresh" cycle that help bring back balls in the right place with more aggressive power. And maybe that cycle is not present in the library you use. Also could be problematic if you do partial update and never a full refresh.
Ahh, the first one, maybe that's it. It was doing full refreshes -- it would clear and flash white a few times, then black, then white, then red, then white, before updating the image/text, and was still stained
From a guide You don't have to refresh often, but with tri-color displays, the larger red ink dots will slowly rise, turning the display pinkish instead of white background. To keep the background color clear and pale, refresh once a day
I think it was sitting for a year unrefreshed, maybe that damaged it >~<
Try giving it a refresh once every 10 minutes for a couple of hours, that might help clean it up over multiple cycles
Worth a try
Eink screens are basically micro-fluid devices so it's not as simple as setting a 1 or 0 for their 'pixels'. It's a lot more of a model fluid flow under the force of a charge. For an insane deep dive, there's this project: https://dmitry.gr/?r=05.Projects&proj=29. eInk Price Tags
For the refreshes to try to clean it, should I refresh all layers and leave it white? Or have an image?
I feel like Collin did a few shorty videos on them too. Might be conflating with another type of display.
Oh, I dunno if it makes any difference at all, but it's this one https://www.adafruit.com/product/4868
Easy e-paper finally comes to microcontrollers, with this breakout that's designed to make it a breeze to add a tri-color eInk display. Chances are you've seen one of those ...
After the refresh cycles go ahead and just leave the screen blank/white. That way every pixel has to move and the 'stuck' ones get pushed as well over time. (I don't think it should technically matter, but for the sake of anyone in the future with this problem it might help avoid the issue of using various pictures and some of them being more helpful than others)
https://www.youtube.com/watch?v=eipKg2pUQ_8 Would this be the video you're thinking of?
It's a good one! I love eink stuff and watched that one a few times
eInk still feels like magic sometimes
For sure! I wish it had fewer limitations but it's such a great platform to read on, or display infrequent updates. I feel like it's one of the forms of hardware that software just forgot about, but that happens
Some newer types of eInk can actually refresh a lot faster!
Yeah I'm excited to see them come to fruition. How's the screen of yours looking by the way?
Haven't gotten to try to refresh yet, trying to get my FunHouse working
Ah the dilemma of having multiple projects! Curses! Haha
yeah XD
He did.
KeithTheEE found a link to the series concatenated. ๐
In unrelated news, git status is your bestie. (I completely forgot to add 2 out of 6 of the files I need to PR. Noticed there weren't enough files listed in status.)
Is there a good place on how to github?
I wrote a guide for it. Covers my CircuitPython workflow. Otherwise, I think they have pretty good docs as well.
Ok, cool. Can I see your guide? I'll poke their docs as well
Danke :D
It's a bit out of date, the GitHub interface has changed slightly. But it isn't enough of a change to make it unusable.
And I wanted to add some more Git stuff to it, like how to rebase when your branch is out of date.
But priorities.
ยฏ_(ใ)_/ยฏ
I want to do some shorty posts on my personal site about using Git and GitHub. Basically that guide, but more bite-sized pieces. But there's a lot I want to do for that site. And then I get nothing done. ๐
Too many things to do, not enough time...
Pretty much.
C'est la vie
waits on CI
CI?
Continuous Integration. It's what runs on every PR you put into CircuitPython or associated libraries. GitHub Action is an example of continuous integration (testing is implied).
Ah... PR is Pull Request?
Yup! Once your code is ready to start considering pulling into the main branch, you can run checks over it to test it and make sure you didn't accidentally mess something up
Ahh, so a PR is the opposite of forking?
also @idle owl I submitted my first pull request! Thank you for all of your help!
Continuous Integration Testing helps ensure things are kept to a standard. You can put whatever tests you want into your CI setup. pylint etc can be included.
That is sort of a way to look at it...
'sort of' sounds like a better understanding than 'no, not at all' XD
Hurrah! Congrats! And you're entirely welcome!
Yes, more or less. It's kind of like a river, sometimes it'll fork and not meet up, but sometimes it'll merge again and bring added... code. The river metaphor is failing here because silt and code aren't the same thing but oh well. A pull request says, "Hey, I added this and I think it's generally useful so maybe the main branch might want it!"
It's a "request" for the original project to "pull" your code into the original project code.
On that note, I need to go get some vehicular maintenance taken care of. I'll be on mobile when I'm not driving. And around again later.
Sounds good! Hope it's quick and easy!
Hope all is well with you vehicle!
Dan posted a link to this github book once and I found it very helpful: https://git-scm.com/book/en/v2
?serverinfo
Whoa, I didn't realize there were that many channels
@honest nova mind if I ask you a couple of questions here if you're free?
yes go ahead
I am avalaible if you are
Yup! Looking at the sgp40--some of the print statements were there before I edited the code, should I remove those as well?
yes ๐
thank you
I forgot my debug print sometimes too ๐ (this was not the case anyway)
Rodger, and (I'm trying to handle formatting here and PR stuff in the PR thread so bear with me as I'll duplicate some of my comments)
go ahead There is no deep dive today and I am not running so I have a lot of time
Should tuples be returned even if it's coming from a hidden function if the tuple adds computation time/steps?
yes, as I said this is an unspoken rule, but normally all the libraries do that
Not sure the reason
(where did 98 come from here?)
Ahh right. So in this case choose conforming with the api over optimization then?
why do you like the list?
In this case it's prepping a byte array and keeps the build of the array clean _cmd = _compensated_read_cmd + humidity_ticks + temp_ticks
tuple isn't an issue, I'd just append the index of the element, but that's why I chose a list return. I'm new to editing circuit python so I'm just trying to learn what choices to make
when I say struct I am talking about the API
I don't think there's a reason not to use struct, I just don't often use it
yes me neither, depends on the library author I would say.
But I would say, that in this case whatever is easier to understand for the next person that would need to look at your code
that is also a factor
Question from me: is there a SGp30?
Yes there is
it has a built in humidity and temperature sensor so this section of code is all handled on the sgp30 itself
and they use lists
me too
yeah it looks like in a couple of sections they return lists
Ok cool, I'll keep those lists then.
๐
As to the measure_raw and raw functions: should I hide the measure_raw or leave it exposed. Because (from my assumption) I don't think a user would ever use raw if voc_algorithm was available. But in it's absence raw was as close to a return value as possible
This strays closer to the conversation for the pr itself though
I agree with you, there is no need if this is done for internal calculation
question here...
this is more Scientific that other...
so, this sensor calculates the VOC?
to do this it will fit temperature vs humidity curves
then it will go to the VOC and get the data
is that correct?
Give me one moment to reread the datasheet so I don't misrepresent something--I'm kind of constantly re-discovering it's process that it uses to return a value
no problem I could write why I am asking this, I do not know if you have work with health safety standars, so normally they will list all the compounds... and then they will give the VOC or TVOC, that is the sum of all of that. then they said this is for standard temp and humidity
meaning sometimes these raw measures are important
Walking backwards for this device, the actual usable value is an air quality score with a range of 0-500. That is the output of the voc algorithm which takes a raw sensor value (a 'humidity-compensated VOC based indoor air quality signal') and, in conjunction with a rolling model of how long the sensor has been powered up, and how much variance the sensors output has had within some timescale (I don't actually know much about this section, this is what I'm about to tackle) it calculates the 0-500 score.
In the datasheet they refer to the sensor output as SRAW which is in 'ticks' again and 'is proportional to the logarithm of the sensor resistance'
good, I think we have our answer, dont we?
Incidentally their datasheet has a suggested design of a voc index driver which outputs the humidity compensated raw signal, the voc index, the relative humidity, and the temperature in it's report
What would that answer be then?
Ok--so I'll leave the humidity compensated raw measurement exposed in that case?
oh what I mean there is no need to expose it as they are use to compensate
could you change the raw humidity?
Oh haha that's the opposite of what I was thinking
Yes each time you call measure_raw you provide an updated temperature and humidity
so ok now final answer, is yes expose
we had this kind of discussion with the sea_level_pressure for altitude ๐
Awesome, I'll add documentation and keep it exposed in that case!
Haha all of these sensors--while delightful to toy with--have so many niche 'consider this' aspects
yes I agree, that why I love them
If you have trouble with the documentation let me know
sometimes Sphinx is very picky
haha I'll let you know, and I can almost promise you I will. Sphinx, while powerful, is one of those libraries I loathe the most. Once I'm past my learning curve I'll love it, but for now it gives me headaches
Thank you again for all of your help through this!
No thank you :), But there are some tips in the design guide regarding Sphinx, just in case, this case will be simplier I think!~(Hope?)
๐
ping me if you need help I ll be around
This configuration is used by @ladyada (and no other regular developers?) and more often than it should we've discovered late that a change introduced problems building there.
By adding this to regular CI, hopefully we learn about and fix these issues sooner rather than later.
esp-idf specifically doesn't support windows, but the rest all build.
I'll be it is, all of the guides I've been using--the contribute to circuit python with git, and the creating and sharing a circuit python library--have been amazing, I'd wager the docs one is just as helpful!
Thank you! I have one requested change for you to make.
Please update the copyright information. It is appropriate to include your name as well as the name of the company for whom the work was done, if applicable.
I'm sorry I missed that out.
It's already updated.
Thanks.
I'm wondering if there is a way to bundle a library together for this board?
For example I would like to include the neopixel.mpy together with the build.
Is this possible?
yes you can by 'freezing' a library - then it will be automatically included in the firmware
https://github.com/adafruit/circuitpython/blob/main/ports/atmel-samd/boards/adafruit_rotary_trinkey_m0/mpconfigboard.mk#L23
yes you can by 'freezing' a library - then it will be automatically included in the firmware
https://github.com/adafruit/circuitpython/blob/main/ports/atmel-samd/boards/adafruit_rotary_trinkey_m0/mpconfigboard.mk#L23
Thanks. Should I submit another pull request or just modify this one?
keep modifying this one until its exactly how you want it!
keep modifying this one until its exactly how you want it!
Alright. Will update here once it's done.
yes you can by 'freezing' a library - then it will be automatically included in the firmware
https://github.com/adafruit/circuitpython/blob/main/ports/atmel-samd/boards/adafruit_rotary_trinkey_m0/mpconfigboard.mk#L23
How about the library which is not in the frozen library list?
I would like to include the SimpleIO as well.
We use that to generate tone for the buzzer.
Hello, I'm seeing this error on PyCubed board in both 6.2 and 7.0 Alpha 1 versions of CircuitPython, any ideas? Thanks!
After merging #4772, pre-commit on the main branch reported an indentation problem. Fix it.
you can add any library by using git submodule to add it :)
Does this line needs to be changed after bumping up our python compatibility version "Programming Language :: Python :: 3.5", this is in here, https://github.com/adafruit/cookiecutter-adafruit-circuitpython, just copy the library as the link is very long..
Firmware
Adafruit CircuitPython 6.2.0-beta.2 on 2021-05-28; Arduino Nano Connect RP2040
Adafruit CircuitPython 7 built on 2021-05-27; Arduino Nano Connect RP2040
Code/REPL
--- snip ---
print("Connected to", str(esp.ssid, "utf-8"), "\tRSSI:", esp.rssi)
print("My IP address is", esp.pretty_ip(esp.ip_address))
print()
print("Fetching json from Initial State")
r = requests.get("https://api.init.st/data/v1/events/latest?accessKey=abcd...
You are correct; we need to stop if the dma channel is currently playing. So, I've made modifications in common_hal_audiopwmio_pwmaudioout_play() to detect if that is the case and only do the 'stop' if the dma channel is already in use.
what if you use the URL / pinout / code from
https://github.com/adafruit/circuitpython/pull/4802
(without the OLED display)
Thanks for the super fast response!
That was exactly where I pulled the pinout from for my code, was from your wifi example. I first started with that exact code, minus the OLED, to retrieve the DOGE coin value. The URL gave me the same error, so I thought I would try and use a different URL and pull the sensor values from my Initial State dashboard like I do with several other boards I have.
All of them keep giving a socket error whenever trying to make the request..
there are also pre-commit changes that need attention. thanks for your continued work here!
Note that ...get_playing checks for the dma channel number:
bool audio_dma_get_playing(audio_dma_t *dma) {
if (dma->channel[0] == NUM_DMA_CHANNELS) {
return false;
}
so this added check may be unnecessary. If it is necessary, please add a source comment why and check if PWMAudioOut needs the added check too.
hey everyone, I'm going through my first build of CircuitPython on my Mac M1 using the Adafruit guide at: https://learn.adafruit.com/building-circuitpython but I've been running into some issues.
Currently when I run the command: make BOARD=unexpectedmaker_feathers2
I get this:
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- The ASM compiler identification is unknown
-- Found assembler: xtensa-esp32s2-elf-gcc
CMake Error at esp-idf/tools/cmake/project.cmake:307 (__project):
The CMAKE_C_COMPILER:
xtensa-esp32s2-elf-gcc
is not a full path and was not found in the PATH.
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
Call Stack (most recent call first):
CMakeLists.txt:12 (project)
Any help would be greatly appreciated. I'm at a loss for what's happening.
I believe the ESP IDF version used by Circuitpython does not support the M1
Hmmm. I've looked into the idf_tools.py file to check for the M1 fix which apparently the line:
'Darwin-x86_64': PLATFORM_MACOS,
which is suppose to "pretend it is x86_64 until Darwin-arm64 tool builds are available", and it appears this fix is in place. To see if I could get tanother board build and when I tried the circuitplayground express running this:
rune_b@MacBook-Air atmel-samd % BOARD=circuitplayground_express
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
[Errno 2] No such file or directory: 'arm-none-eabi-gcc'
seems like a similar issue too?
ah yeah to build for samd you need the arm compiler
did you do that step ?
I thought building for S2 would not need it
does that even have a m1 version yet ? https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads
i can install it and I think it did this a few days ago, so that should be in place. but i'm just waiting to download it again and try again.
well, I mean the good news is i'm getting a different error. I thought i had installed it but all I did was reinstall and restart and now that error is gone. anyway I get this now:
make BOARD=feather_m0_express
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
ERROR: Empty preprocessor output - check for errors above
make: *** [build-feather_m0_express/genhdr/qstrdefs.enum.h] Error 1
make: *** Deleting file `build-feather_m0_express/genhdr/qstrdefs.enum.h'
which i'm still sorting out
did you make BOARD=feather_m0_express clean ?
haha back to square one once I do that:
make BOARD=feather_m0_express
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
[Errno 2] No such file or directory: 'arm-none-eabi-gcc'
might not be in the PATH, did you open a new shell after installing it ? I'm not sure if you need to do something to add it to the path (I do, but I manually put it in a local dir)
i did open a new shell, but i'm also unsure if i need to add it the PATH. i'm not exactly sure what you mean by putting it in a local directory. Do you think that would work in this case?
The issue is that in common_hal_audiopwmio_pwmaudioout_get_playing() we are accessing self->pacing_timer before it has been set. So, the second PWMAudioOut will reset the timer (and so stop the first one). I could either initialize self->pacing timer in audio_dma_init() or leave the current code as is. Which do you think would be cleaner?
nothing, I'm just saying I don't know if the installer does it
fair enough. I'm trying to figure that out now
Thank you. This looks OK to me now. This can be merged once the automatic Checks have passed.
I reached out to the unexpected maker Discord and it turns out there's a way to run legacy command line for the Mac M1. I found this guide: https://medium.com/swlh/run-x86-terminal-apps-like-homebrew-on-your-new-m1-mac-73bdc9b0f343 FYI
Thank you. This looks OK to me now. This can be merged once the automatic Checks have passed.
Thanks a lot.
I added additional Test.
In Adafruit CircuitPython 7.0.0-alpha.2-697-g96c04b753 on 2021-05-29; Raspberry Pi Pico with rp2040
This version can count 65535usec pulse.This makes it possible to distinguish between noise and signal.
pulse_window=0.15,blocking_delay=0.1(Parameters in Adafruit_irremote)
minimum pulse width = 381usec
83 3115 381 [3115, 1678, 489, 400, 464, 400, 464, 1271, 463, 1270, 458, 408, 456, 1276, 460, 431, 431, 410, 454, 408, 458, 1271, 468, 400, 459, 406, 457, 1276...
FYI - I ran into an issue trying to use Blinka under Micropython on a Raspberry Pi Pico. I was trying to see if I could use an "airlift" with the esp32spi library. The esp32spi library uses time.monotonic() but time.monotonic() is not provided by the micropython time module... It looks like a simple fix is to just use time.time() use MP but it does mean a lot of CP code won't work without modification.. I did make that change and ran into some more significant issues that may indicate bigger problems, but I wanted to point out the time.monotonic issue to see if I was missign some thing simple to get around it.
The "bigger issue was this - after fixing the timne.monotonic calls ```MPY: soft reboot
MicroPython v1.15 on 2021-04-18; Raspberry Pi Pico with RP2040
Type "help()" for more information.
import esp32spi_simpletest
ESP32 SPI webclient test
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "esp32spi_simpletest.py", line 50, in <module>
File "adafruit_esp32spi/adafruit_esp32spi.py", line 335, in status
File "adafruit_esp32spi/adafruit_esp32spi.py", line 324, in _send_command_get_response
File "adafruit_esp32spi/adafruit_esp32spi.py", line 232, in _send_command
File "adafruit_bus_device/spi_device.py", line 76, in enter
File "/lib/busio.py", line 377, in configure
AttributeError: type object 'SPI' has no attribute 'MSB'
I opened an issue in blinka
Hi Adafruit !
I would like to use CircuitPython on my MuseLab nanoESP32-S2 WROVER board, so I started to create the board definition - based on the nanoESP32-S2 WROOM board - to submit a PR but realized that the WROOM version uses Adafruit USB VID 0x239A.
It would probably be more consistent if the WROVER version also uses this VID, is it possible to assign one PIDs to this board?
The branch with the new board (and the reword of WROOM version to be more explicit)
https://github.com/re...
hi, espressif can assign you a PID, that way it has the espressif VID. you'll need two per board as one is needed for the bootloader. please check with them - :)
Thanks, I'll try to ask Espressif :)
So the WROOM version that already exists have an Adafruit VID and the WROVER version of the same board will have an Espressif VID, right ?
right! might be a good idea to get matching ones - altho really thats up to you, it doesnt matter as we have many VID's
@ladyada , I've narrowed down the requests issue. It definitely seems to be an SSL/TLS issue with the request and socket establishment. I ran a small webserver on my phone that I've used in the past to serve code files up real fast, and it uses basic HTTP. The Nano Connect had no issues retrieving the contents from it!
<img width="1648" alt="Screen Shot 2021-05-30 at 1 06 24 PM" src="https://user-images.githubusercontent.com/49820403/120113491-aed60600-c148-11eb-8cc5-3fbeafa40e64.png">
Decided that initializing the pacing_timer was a better way to go, so made the appropriate changes.
@still zephyr The main hang-up in testing the BME280 PR is my ability to find my BME280 -- searching....
Sorry to pop in and run, but this looks similar to an issue I ran into. If you use conda for stuff, conda might be fighting between various forms of gcc in the background due to different installed python libraries needing different c compilers. My solution to this was to create a new environment and then install the arm compiler, and while you're in that environment run the build commands. But I've got to run out for the day. I'll check back in this evening and see if it made progress (or if this doesn't apply at all): conda create --name buildCircuitPython
This only applies if you use conda to manage virtual environments though
yay! found it!
Current examples that download images from the web require you to write them to storage and then display them. This requires the filesystem to be read-write , a potentially destructive requirement.
Circuitpython io supports BytesIO, but there is no way to display an image that's loaded into a BytesIO object.
bg_bitmap_file = BytesIO(requests.get(url, stream=True).content)
bg_bitmap = displayio.OnDiskBitmap(bg_bitmap_file)
This code doesn't work as is throws an object type error.
...
Untested, as I don't have mac hardware. However, Linux identifies the resulting files as expected:
mpy-cross: Mach-O 64-bit x86_64 executable, flags:
mpy-cross-arm64: Mach-O 64-bit arm64 executable, flags:
mpy-cross-macos-universal: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit x86_64 executable, flags:] [arm64:Mach-O 64-bit arm64 executable, flags:]
In theory, the x86_64 versions still work with catalina (and up, presumably), b...
hmmm maybe it was just a dream that I created a wasm version of mpy-cross. I think I'm thinking of the aws lambda mpy-cross together wtih the wasm/emscripten pcf font converter and getting them confused in my head...
I was thinking that if anyone uses the webservice mpy-cross it needs to be updated for v7's mpy format
@ladyada , I have also just tested and noticed the exact same behavior using MQTT. I adjusted the RP2040 pubsub code for Adafruit IO to use the proper pinout for the Nano Connect, and once again experienced failure trying to connect to AIO using MQTTS port 8883.
As soon as I manually added the standard port 1883 when creating the mqtt_client object, all works fine once again! Definitely something up when trying to use TLS...
<img width="1648" alt="Screen Shot 2021-05-30 at 4 12 ...
Thanks @solar whale ๐
Looked it all over and looks good to me. I won't approve until someone else can view the incompatibility part.
Artifacts tested on M1 Mac Big Sur:
mpy-cross, mpy-cross-arm64, and mpy-cross-macos-universal
Artifacts tested on x64 Mac Big Sur:
mpy-cross, mpy-cross-macos-universal
Artifacts tested on x64 Mac High Sierra:
mpy-cross, mpy-cross-macos-universal
All worked and produced identical .mpy files.
Does anybody have a build of the Circuit Playground Express image that has async/await enabled? Or do I need to build that myself? Does enabling it do something bad?
Espressif PIDs obtained :)
0x80B2 | Muse Lab nanoESP32-S2 WROVER - CircuitPython
0x80B3 | Muse Lab nanoESP32-S2 WROVER - UF2 Bootloader
Thanks @ladyada !
First q, I donโt think anyone is maintaining a build like that.
Second q, if itโs not in the official build for your board then youโd need to build it yourself yep.
If you can voice a more specific concern maybe someone can help address your third question!
I think the merged PR 4668 fixes issues I had with Feather RP2040 not picking up the 9ms and 4.5ms pulse of NEC8 infrared remote :)
In 6.2 those pulses didn't appear at all, now in 7.0.0-alpha.2-705-gc80e25307 I am picking up the pulses and able to semi-succesfully funnel them into the decoding function I lifted from micropython_ir and get the right command code out.
I was also unable to use adafruit_irremote with ...
Added new board Maker Pi RP2040 from Cytron.
Well, I kind of donโt understand why youโd ever disable the syntax. It doesnโt seem to cost anything, though I understand that most people couldnโt use it without asyncio.
In my case, Iโve got some LoRa modules that speak TTL serial. Iโd like to use a CPX, as they are about the most versatile platform I can find for the price.
Ideally, Iโd build multiple concurrent listeners that could talk to the LoRa unit. However, the LoRa unit does not take kindly to concurrent requests.
With no threading and no async, Iโm left with all of my remaining options being ugly and difficult. Iโd rather roll my own event loop and concentrate the complexity there than build an ad-hoc callback nightmare.
So, yeah, Iโm probably not the target audience for the CPX, but itโs a lovely little unit and I donโt get why youโd ever disable the syntax in the first place.
So Iโm just kind of left wondering if Iโm missing something. Does it cost that many bytes of flash or something? Is it just off because it canโt be used easily? Is it because theyโre trying not to confuse students learning on it? Is it a conservative default?
Iโm trying to figure out how intentional it is, how unreasonable it is to ask for, and if anyone else is likely to want it, too.
the non-express samd21 boards have very limited amount of flash available, that feature takes additional flash
not sure why it's disabled on express boards as well, but probably the same reason
finally, that is just syntactic sugar, you can do exactly the same things using yield and yield from
I was under the impression that async iterators and async context managers arenโt exactly possible with yield / yield from (I tend to use the former but not the latter).
Iโm actually kind of curious how much more flash it actually takes. Iโd imagine asyncio itself is a lot of code, though it could be packaged separately as an mpy.
I guess Iโll probably end up building it and find out.
But, yeah, this answers most of my questions, I think. Thanks everybody. ๐
iterators and context managers are syntactic sugar themselves
they don't do anything that you couldn't do with a bit more python code
async/await is turned off for space reasons on the SAMD21 builds and a few nRF builds. It is turned on for all other builds. It takes about 1600 bytes.
FYI - I opened an issue on the HCSR04 library , but this may be a PulseIn issue on the Rp2040 https://github.com/adafruit/Adafruit_CircuitPython_HCSR04/issues/25 Every other reading is bad when running the hcsr04_simpletest on the rp2040. It runs fine on an M4.
It will fit on many builds if you build it yourself. We had issues with the larger translations on some boards in the past
@livid horizon fwiw adding async to cpx took 1552 bytes of flash, and the de_DE translation still fit according to my quick testing. https://gist.github.com/jepler/fc839d40f69088e25e57860ee30660f1 I didn't actually load the firmware anywhere.
before: 246652 bytes used, 6788 bytes free in flash firmware space out of 253440 bytes (247.5kB).
after: 248204 bytes used, 5236 bytes free
@onyx hinge it definitely didn't fit at some point, but in my standardization of things I made have made it fit on most SAMD21 boards. It might be an issue on tiny boards with frozen libraries. At one point we were really close to being full on many.
don't I know it
@onyx hinge well, doing a test build with a PR not from a fork was a bad idea. It's building everything twice; once on pull-request, and once on push. I see this when we make a new release (it builds everything twice). I wonder if we can turn one of those off.
I did look at that briefly when looking at how to disable uploads to S3 of non-main branches
did you come to any conclusions? Are there use cases for both?
for releases, it hasn't been so bad, because with the unreliability of Actions, I often had a few random failures, and they were usually covered by the re-run. I used to have to do a manual re-run sometimes.
In continuous integration, we often reuse the same GitHub workflow for multiple events. For example, we may need the build workflow when we push a new commit, or when someone creates a new pull request, or before we create a new release. However, we may end up having the same workflow multiple times with this approach: both for a push and a pull...
it builds on push and on pull requests, it's part of the triggers, I believe we could restrict to pushes to main like that:
on:
push:
# Sequence of patterns matched against refs/heads
branches:
# Push events on main branch
- main
we would also need to include the active non-main branches, like 6.3.x, etc., IK think
but when I make a release, I need it to rebuild with the new tag
https://github.community/t/duplicate-checks-on-push-and-pull-request-simultaneous-event/18012/2 is what you are suggesting, I believe
I ran tests for the uploads rules on a toy repo that logs a "compile" and "upload" tasks and got this, that's when I noticed the duplicate compiles. I didn't test a PR via a fork
https://gist.github.com/Neradoc/fc581d60543db01afed946f8435ea7ac
oh I didn't test a PR to not-main
the builds are overflowing on boards with lots of pins. It looks like some of those could be trimmed by more IGNORE_PIN_Pnnn decls.
Those macros are hard to get right. Maybe we should reverse the sense and ignore almost all pins up front, and have each board declare the pins it actually uses
e.g. compare trinket_m0 and arduino_zero
Added Muselab nanoESP32-S2 w/WROVER and rename nanoESP32-S2 w/WROOM to be more explicit and consistent
Python itself is syntactic sugar. Nothing you couldnโt do with a bit more C ๐
Itโs fun code to write and I encourage you to do it! In case youโre unaware, there is a lib on GitHub called tasko that implements a small slice of asyncio (I wrote it when I enabled async/await for circuitpython)
Isn't everything just sugar when you have assembly? :P
please give me a sugar cane. thanks
this is doing a board rename
<@&356864093652516868> just a reminder -- due to the US holiday today, we'll hold the Discord meeting tomorrow at the same time of day.. hope to see you then!
So let's say in 25H from now... ๐
Indeed, if you are OK with that I will push an update for the circuitpython download site for the new board as well as the renamed board.
https://github.com/reppad/circuitpython-org/tree/nanoESP32-S2
Patch to fix build of mpy-cross on Apple M1 machine
(Fix is a direct copy from latest micropython/py/nlraarch64.c)
I reviewed all the code and it looks good to me, based on my past LED matrix experiences. Were you looking to have someone else also try it out on an actual device? I have a FeatherS2 but unsure if I have the cables to hook it up. I may be able to rig up something with jumper wires though.
As a data-point for the interested, the difference in an async-enabled versus async-disabled CircuitPython build for the CircuitPlaygroundExpress is about 5kB (486kB versus 491kB).
yep! just making a note of it!
@djx123 I tested #4832 on an M1 and did not get an error. I'm not doubting this is necessary, but what problem did you run into?
Using 'gcc-arm-none-eabi-10-2020-q4-major' I get:
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
QSTR updated
Undefined symbols for architecture arm64:
"_nlr_push", referenced from:
_mp_iternext in runtime.o
_mp_load_method_protected in runtime.o
_mp_parse_compile_execute in runtime.o
_it_iternext in objgetitemiter.o
_mp_execute_bytecode in vm.o
main in main.o
(maybe you meant: _n...
@jepler Do you know why we did not see the problem above when you added the M1 builds?
Yes, when built by the ci it used a different makefile which forced setjmp-based nlr. That will be unnecessary after this change.
I tried to look into re type stuff but could not get it to work. I think I just need to get more familiar with this.
There is already the imageload library that lets you load images and display them from memory.
yeah its wierd because some analog pins are routed thru the esp32!
I might be a week or two late on this but here's a very simple example in micropython of blinking the lights:
# WIFININA spi driver https://github.com/arduino-libraries/WiFiNINA/blob/master/src/utility/spi_drv.cpp
# Commands https://github.com/arduino-libraries/WiFiNINA/blob/master/src/utility/wifi_spi.h
# Adafruit esp32spi https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI
# NINA 27, 26, 25 are R, G...
Quick question: Which version of circuitpython supports audiomp3 ? I'm trying to play mp3 audio on my board but it complains that this module is not found. I'm testing with Circuipython 6.2 and Circuitpython 7.0+.
I tried this example and it won't work because it can't find the audiomp3 library
go to https://circuitpython.readthedocs.io/en/latest/shared-bindings/support_matrix.html and type audiomp3 in the search box in the middle of the page
@idle owl ๐
Thank you Dan, how can I make my board compatible with this audiomp3 module? I know it can handle the audio as I've tested with wav files using i2s.
To answer your question, yes I have access to the learning guides, I followed the training but could not edit any Learning Guide. @idle owl (y)
@onyx hinge is there a reason not to try audiomp3 on ESP32-S2? It looks like the impl is all C now.
That's because you need to be added to any guide you're going to edit. You're able to create new guides of your own, but to edit existing guides you must be added as a collaborator.
Ok got you (y)
You'll want to email Anne to get added to a guide, I would say. She is sort of the Keeper of Learn. In the case of the DPS310 guide, I can add you as a collaborator. Very little needs to be updated, but it's important.
@frozen flume you could just set CIRCUITPY_AUDIOMP3 = 0 to 1 in ports/esp32s2/mpconfigport.mk and rebuild and see what happens
Yes no problem, will do
Thanks Kattni
I tried that CIRCUITPY_AUDIOMP3 = 1 but I was still not able to use it.
Actually I added that to my board's mpconfigport.mk, I will try now adding it at the one you pointed out just to test it out.
Actually, I got an error when I compile it using that flag.
In file included from ../../lib/mp3/src/mp3common.h:47,
from ../../shared-module/audiomp3/MP3Decoder.c:40:
../../lib/mp3/src/mp3dec.h:80:2: error: #error No platform defined. See valid options in mp3dec.h
#error No platform defined. See valid options in mp3dec.h
^~~~~
make: *** [build-atmegazero_esp32s2/shared-module/audiomp3/MP3Decoder.o] Error 1
ah, ok, I was wondering where the assembly code was. lib/mp3 is ARM-based, so no go for ESP32-S2
lots of asm() code in there
got it., well, thanks for your help!
I added you to the DPS310 guide.
Thanks Kattni
@tulip sleet I think I tried it but the performance was very unsatisfactory. on the other hand, we did enable it on rp2040 where the perf is low too. you're limited to very low bitrates & maybe even mono-only, or else it skips
and hm I guess there's a build problem too .. oops. I probably had a fix for that locally but it's long lost by now
(there's a "pure C" code path available and it is another cause of low performance)
<@&356864093652516868> the weekly meeting will be TODAY in about 1 hour. since it does not immediately follow an adafruit-internal meeting today we stand a better chance of getting started on time. Please add your notes or placeholders if you have hug reports, status updates, or in the weeds topics. If you just want to listen in, no need to do anything. Notes document: https://docs.google.com/document/d/13v0TziugOYU3FsWjs3_pu1H3IQEKqORbYPE14RIKmb8/edit?usp=sharing
Google Docs
CircuitPython Weekly for TUESDAY June 1st, 2021 THIS MEETING is 24 hours later on TUESDAY. Monday is a holiday in the US. Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates early. During the meeting, we go through them as a round robin sorte...
@onyx hinge thanks; I can't think of another path except to try -O3 on the C code path, which you probably tried already
I don't even know if ESP32-S2 has native floats
@onyx hinge Can you not hear me? Hm.
Good afternoon all you wonderful folks -- happily lurking ๐
Iโll be lurking today as well
I'll be lurking and may be around text only
I looked at imageload https://circuitpython.readthedocs.io/projects/imageload/en/latest/api.html
That seems to only load from a file - I believe I tested this and found it was looking for a file object and didn't take the bytesIO object.
๐
lurking
I can't hear Dan either.
skip me for now
Happy to help on tls stuff (an anything else)
@solar whale I made a local change to Blinka, but haven't had a chance to test yet.
I thought it was amusing to see the latest commit to the adabot repo was to master about moving to main ๐
๐
I think we need to update some of the other libs like Blinka and PlatformDetect to use Main instead of Master
People keep telling me to "take a hike", sounds like it's a fun time ๐
I think we can just build and deploy from adafruit/circuitpython
All for removing as many of the alternatives as possible
Re: settings.py - not documented that I'm aware of.
Friends don't let friends use .txt
๐ฏ a good idea. Breaking change for 7.0
are double extensions a problem for some platform? If not, could leave it... sometimes, periods may arise naturally in a filename
I ended up using data_files inside of setup.py instead of package_data to get the stubs copied into the root of site-packages rather than inside of site-packages/circuitpython-stubs this allowed the imports to work like normal i.e. import digitalio instead of from circuitpython import digitalio. Assuming my tests work out is my next step to PR to adafruit/circuitpython with the changes to setup.py?
Yes, you should be able to multiple by -1
@lone axle yup, I think so
it checks for .py.txt, etc.
There is a market with more than two input to have precision and safe rotary encoder. ๐
Thanks y'all!
Thanks all.
Thanks
๐
We're so close to the finish line....let's push strong through the last mile of this marathon ๐
Cheers
The cats were kind enough to do their plaintive meowing when I was muted today.
awwww
Mine can detect an open mic.
How considerate! They decided to help mew.
this week I have been strongly missing having cats in my home. not sure why, usually it isn't something I think about
@lone axle thanks as always for getting the links!
indeed, thanks @lone axle for doing the background legwork like that
It makes such a difference when following along
Is there an open issue for deep sleep/low power implementation on other ports? I'm interested in the progress of the samd port and how I can help
+1, I would love to see a solution that allows displaying images that came from the internet in displayio without needing to have the CIRCUITPY mounted as writable.
It's not relevant to all cases, but if your device has an SDCard connected you are able to download images to the SDCard without needing to have the CIRCUITPY filesystem be writable. If your using a device with an SDCard slot, like a PyPortal or PyGamer, or if you can attach an external breakout for it that might be another opt...
let's ping @ionic elk here
Hi - some build issues due to board_deinit() not found.
I think the best option is to fix ImageLoad to take any file-like io object.
The first place to start when wanting to add an API is to look at what is available in CPython. I think the most common Python version is BeautifulSoup: https://www.crummy.com/software/BeautifulSoup/bs4/doc/
Then the challenge is picking the small subset to provide in CP.
Looks good to me! clarity++
Which library are you trying to move to 7.0? If it is an mpy then you'll need to snag one from a 7.x bundle or release zip.
Fixed by #4668. (comment if not and I'll reopen.)
Lucian is taking the week off. I don't think we have immediate plans to add SAMD. @lime trellis it'd be great if you added it!
@jaunty juniper @idle wharf @stiff pelican @still zephyr want to move circup to the circuitpython org?
any issue/discussion of where it stands for the SAMD? what the challenge is?
main takeaways are:
- figure out where to store a small amount of state while deep-sleeping so you can tell why you woke up (reconstruct Alarm object)
- light sleep may do nothing more than the equivalent of
time.sleep(). light sleep needs to leave all the devices on so the program can continue from where it left off - find out which pins you can use for deep-sleep wakeup and how they work (active low, active high, touch, etc.)
for the state storage, there are often some registers in the RTC or similar that can keep state during a deep sleep
samd51 has backup ram as well
the API for sleep is all set so that makes it easier
debugging can be trickier though so I don't think adding support is particularly easy
SAMD21 doesn't really have sleep modes so WFI is as good as you'll get IIRC
feel free to make a tracking issue. I didn't find one
thanks for the insight. I'll create a tracking issue and try and scope the work
@musimasami Is it fixed in absolute latest then? We'll get a proper alpha out this week.
thanks @lime trellis !
@polygnomial Make sure you have the latest version of the SDCard library. IIRC we stopped using the .spi property from the SPIDevice class.
Another way to do it would be to add reading of samples from the Wave and then they could be loaded into their own RawSample to be looped.
@slender iron I am going to release 6.3.0 final. No negative feedback on 6.3.0-rc.0. I had a few people upgrade to it for various reasons unrelated to 6.2.0 vs 6.3.0.
I'm not sure this is a bug because the spaces are getting queued up by TinyUSB and not being read by the user code. The CTRL-C then is never actually transmitted to the device because the USB buffers are full.
sounds good to me @tulip sleet. thanks!
On our way to 7!
This issue is intended to scope and track the remaining work needed to extend existing deep sleep API (alarm) to the SAMD port.
Current state
From discord:
dhalbert:
main takeaways are:
- figure out where to store a small amount of state while deep-sleeping so you can tell why you woke up (reconstruct Alarm object)
- light sleep may do nothing more than the equivalent of time.sleep(). light sleep needs...
[adafruit/circuitpython] New tag created: 6\.3\.0
This looks good to me! I believe it'll only break indexed on disk bitmaps. non-indexed bitmaps will use ColorConverter regardless.
sorry, bot caught you
(for too many mentions)
I'm exempt because I'm an admin
let me grab the text
It sounds like a good candidate to me.
It could be the first repo that has it's ownership transferred from adafruit to circuitpython to preserve history. It would need confirmation that the secrets for PyPI and readthedocs are configured the same.
I assume most people who use it get it from PyPI so it should be a transparent move to most people.
Thanks
I thought we were going with new PyPI account for that org. I already added the new credentials to the CP org.
kk, we'll just want to add the new account as a maintainer for the packages on pypi that will have both the old and new accounts
Sounds good.
Automated website update for release 6.3.0 by Blinka.
Here is the download page for the new CircuitPython build for the Muse lab NanoESP32-S2 w/WROVER.
This pull request also update the download page of the original NanoESP32-S2 that is now named NanoESP32-S2 w/WROOM.
For reference, the related PR in CircuitPython repo: https://github.com/adafruit/circuitpython/pull/4834
Firmware
Adafruit CircuitPython 6.2.0 on 2021-04-05; Raspberry Pi Pico with rp2040
Adafruit CircuitPython 6.2.0-beta.2 on 2021-03-01; Raspberry Pi Pico with rp2040
Code/REPL
import board
import displayio
import busio
from adafruit_st7789 import ST7789
spi = busio.SPI(board.GP18, MOSI=board.GP19)
while not spi.try_lock():
pass
spi.configure(baudrate=24000000) # Configure SPI for 24MHz
spi.unlock()
tft_cs = board.GP17
tft_dc =...
Displays hold onto their pins so that they live through the reset. You'll want a displayio.release_displays() before you reconstruct it.
When I run the hcsr04_simpletest on a feather_rp2040, every other reading is very short. The ~40cm reading is correct.
This works normally on a feather_m4_express
I am using the RCWL-1601 sensor
Adafruit CircuitPython 7.0.0-alpha.2-705-gc80e25307 on 2021-05-31; Adafruit Feather RP2040 with rp2040
>>>
>>> import hcsr04_simpletest
(44.047,)
(1.411,)
(43.911,)
(1.326,)
(43.911,)
(1.071,)
(43.197,)
(1.768,)
(42.415,)
(1.7,)
(42.143,)
(1.479,)
(39.355,)
(1.445,)
(41...
More specifically, you'll want it before you reconstruct the SPI.
Traceback <most recent call last>:
file "code.py", line 5 in <module>
File "adafruit_display_text/label.py", line 30, in <module>
ImportError: no module named 'adafruit_display_text.Label base'
anyone recognize โ๏ธ ? from https://forums.adafruit.com/viewtopic.php?f=60&t=179783
maybe missing __init__, I try the weather project on the magtag and work for me, do you want me to answer and point to #help-with-circuitpython ?
if you could answer that'd be really helpful. thanks!
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/1jk_X-gKdYgwsbuwJQGqcf9GrFDfPqGBuB_SP1yQW-00/edit?usp=sharing
Google Docs
CircuitPython Weekly for June 7, 2021 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 me...
[adafruit/circuitpython] New branch created: jepler\-patch\-1
I stopped the duplicate pull-request/push Action runs. Just running PR.
We'll need to update the _data/files.json to update the board names (https://github.com/adafruit/circuitpython-org/blob/master/_data/files.json#L14864-L14944) or we will have an Unknown Board appear for the old name. I see they are already updated in circuitpython itself, so that shouldn't really be an issue.
I cannot get PWM to work in CircuitPython 6.2 or 6.3. Almost all pins do PWM when using C, C++.
I have tried many frequencies and duty cycles.
Have tried several older hex loads of CP and the latest.
Code/REPL
import pwmio
import board
import time
p = pwmio.PWMOut(board.D0, frequency=5000, variable_frequency=True, duty_cycle=2**15)
time.sleep(120)
Behavior
Script runs and the board outputs on the REPL (for example: "pwm: 0x403e0000, sum 2, chan 0, mux 2"
...
Firmware
Adafruit CircuitPython 6.3.0-rc.0 on 2021-05-25; Arduino Nano RP2040 Connect with rp2040
Code/REPL
"""CircuitPython Essentials NeoPixel example"""
import time
import board
import neopixel
pixel_pin = board.D9
num_pixels = 8
pixels = neopixel.NeoPixel(pixel_pin, num_pixels, brightness=0.3, auto_write=False)
def wheel(pos):
# Input a value 0 to 255 to get a color value.
# The colours are a transition r - g...
Fine with me
Wait, was that an ask for us to do it or was it an ask for agreement. ๐
darn, there's no os.urandom on samd21
Please use the pre-release version 7. 489163b74ed (#4530) is only in the main branch, not in any 6.x branch.
Ok, approving because this looks good. I'll submit a follow-up PR to fix the resulting unknown board.
This will solve an unknown board resulting from #703.
With package_data and packages the installed files end up like:
/[Python]/lib/site-packages/circuitpython-stubs/digitalio
/[Python]/lib/site-packages/circuitpython-stubs/displayio
/[Python]/lib/site-packages/circuitpython-stubs/...
when it is like this the IDE will not recognize the stubs unless they are imported like this:
from circuitpython import digitalio
To fix we can use data_files to install all of the circuitpython stubs into the root of `../site-...
The following code crashes CircuitPython 6.2 (tested on Wio Terminal) :
a = 10**10
a *= 0
a.bit_length()
This PR fixes the problem.
As seen in #4845 this was not well-tested and had a problem. Add test(s)!
I found that the error was reduced by extending the pulse_window time. But I will miss that multiple pulses are generated by pressing and holding the button.
The time of one ir remote data of the air conditioner is about 0.24 seconds.
Panasonic Air conditioner decode results
Adafruit CircuitPython 6.2.0 on 2021-04-05; Seeeduino XIAO with samd21g18
pulse_window=0.04 decode result
[2, 32, 224, 4, 0, 0, 0, 6, 2, 32, 224, 4, 0, 64, 44, 128, 175, 0, 0, 6, 96, 0, 0, 128, 0, 6, 141]
**...
Improved. But No.
I uploaded comments and detailed datas.
2021ๅนด6ๆ2ๆฅ(ๆฐด) 5:01 Scott Shawcroft @.***>:
@musimasami https://github.com/musimasami Is it fixed in absolute
latest then? We'll get a proper alpha out this week.โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/adafruit/circuitpython/issues/4813#issuecomment-852408953,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHV...
hello, i am trying to connect the Jetson Nano with PCA9685 connected to L298N h-bridge to drive dc motor, would anyone help me with the wiring of PCA9685-L298N and python libraries?
Github seems to having problems:
https://www.githubstatus.com/incidents/76nv9h8pmkv4
I thought this had been changed already, but I made the change adafruit/pico-sdk, and failed to update the submodule. :facepalm:
I will backport this to 6.3.0 and make a 6.3.1.
if it doesnt work in arduino or circuitpython its probably not a firmware thing. try powering the NeoPixel strip from 3.3V or adding a level shifter. you should probably invest in a scope or logic analyser as well
Awesome! Thank you! Do we have auto-release set up already?
I think @DavePutz would know about the current PulseIn state.
Here is an example of adding support to the RP2040 port: https://github.com/adafruit/circuitpython/pull/4816
It should be similar structurally for SAMD.
[adafruit/circuitpython] Pull request opened: #4848 Fix usb\_cdc\.enable\(console=False, data=True\)
usb_cdc.enable(console=False, data=True) was not working.
- Set
usb_cdcdefaults correctly - Use correct TinyUSB
itfvalues when only one CDC is used. Number them from zero. This was the main bug. - Don't watch for ctrl-c if console is not enabled.
- add
board.LEDto Metro M4. (Discovered it was missing by accident when i was trying to blink the led for debugging purposes).'
Tested on Feather STM32F405 and on Metro M4.
Thanks to discord user osten who found the problem and...
I don't think it is currently set up. There is a circuitpython-stubs listing on PyPi so perhaps it was at one point but doesn't seem to be actively running still.
In the libraries there is a workflow in the release.yml actions file that uses twine to upload to pypi. Only glanced through the actions files in this repo but didn't any pypi related actions in them.
Do we want to use essentially the same release action from the libraries? if so I can PR that, or if there is a different wa...
(I am thinking mostly of atmel-samd here, due to space constraints and how its pin table works. I haven't looked at this for other ports, but they are less space-constrained.)
Currently the pins table includes all pins, unless you turn on IGNORE_PIN_PAxx for the pins you don't care about. It's hard to get this right and the list of ignorable pins can change.
Proposal:
- Invert the macros to
INCLUDE_PIN_Pxnn. - Write a script to be run at build time that extracts all the pins actua...
Makes sense, but no testing performed. Are there more places we should switch to tud_cdc_n, in the long term?
@gilded cradle just FYI testing for this PR https://github.com/adafruit/Adafruit_CircuitPython_DPS310/pull/15, enconuter some problems with Micropython and Blinka, I test with the Original library and I got this error:
>>> %Run -c $EDITOR_CONTENT
Traceback (most recent call last):
File "<stdin>", line 10, in <module>
File "/lib/adafruit_dps310.py", line 228, in __init__
RuntimeError: Failed to find DPS310 - check your wiring!
I know wiring is ok, because I was doing the BME280 test with the stemma qt connector
Are there any circuit python sensor libraries with two quickstarts? Or a quickstart version a, and version b? Or should I avoid that entirely and just leave it in the examples
I don't understand the question.
Do you mean simpletest ?
Sorry
https://github.com/adafruit/Adafruit_CircuitPython_SGP40/blob/66ddc29e46ca20c4a2bc7e8c2aab460294da12e5/adafruit_sgp40.py#L50
In the class definition there's a quickstart guide. The one in this works if there isn't temperature or humidity present, but for the case where a user has the current temp and humidity I was trying to figure out if I should add a second quickstart section outlining what to do with the values, or if I should just leave this bit as is
Ohhhh.
haha yeah I was so deep in the code I forgot the context was needed
Nah, do it up! If you want to add more, that's absolutely fine. Keep it "quickstarty", for lack of a better term, but as long as it's still within that concept, go for it!
just a comment normally quickstart = readme.rst = simpletest, so you will need to update those too . sorry for the interruption ๐
Thanks for the input!
Awesome, so in this case, can I leave most of it as is, and once the raw attribute is explained, can I add, "If you have a sensor, such as the BME280, which can read the temperature and humidity, you can ...." and mimic the above format with those values?
Thank you! I didn't know that and will walk through those as well!
Wait, why are you referring to a different sensor in that section? I am perhaps confused again.
Makes sense, but no testing performed. Are there more places we should switch to tud_cdc_n, in the long term?
Yes I am
The sgp40 gives you access to a raw attribute related to VOC, but if you have temperature and humidity, the sensor can compensate that raw attribute and adjust for temperature and relative humidity changes. But that sensor isn't built into the board, so those values must be provided from an external sensor
Yeah, it's caused me a lot of confusion with respect to, "How best to explain x, or implement y" when trying to think of a user who's not very familiar with the sensors datasheet
Awesome! Will do!
I'm poking through the files and the simpletest file is a problem. I'm not entirely sure how to write it because measure_raw takes a temperature and humidity value as input, and that comes from a second sensor. So for that should I just 'make up' a temperature and a humidity?
thinking...
https://github.com/adafruit/Adafruit_CircuitPython_BMP280/blob/main/examples/bmp280_simpletest.py
This example provides commented out alternatives which might be a good way to go?
yes ๐ good idea
Should the commented out bits only be in the test, or in the readme.rst and quickstart as well?
yes, good question, normally is like that, but follow the lead as per BMP280
I think we include the comments too, but only 65% sure ๐
Awesome, thank you!
I'm not sure why that would be. Want to submit a issue to Blinka?
Makes sense, but no testing performed. Are there more places we should switch to
tud_cdc_n, in the long term?
I looked in all the places to understand them, and added comments. Mainly, I fixed the broken simmel build.
I noticed today while looking at the build logs from ports_windows.yml for something else that the error Font missing 1 characters appears on the feather_mo_express build for zh_Latn_pinyin.
I have verified that the same error appears in the full Build CI workflow for this board
Build feather_m0_express for zh_Latn_pinyin took 17.56s and succeeded
make: Entering directory '/home/runner/work/circuitpython/circuitpython/ports/atmel-samd'
Use make V=1, make V=2 or set BUILD_...
@lone axle Hello! Are you around?
yep, whats up?
I have need of your cookiecutter expertise. Couple of questions. One: is there any reason not to move the repo to main? e.g. would cookiecutter stop working properly if the repo was using a main default branch vs. master. Two: would you be willing to either show me how to update or update a couple of things about this other version of cookiecutter we have (https://github.com/adafruit/cookiecutter-adafruit-pcb) - I need a couple of things changed, and I can't figure out how to do it.
I can't find any references to a specific branch mattering, but I wanted to ask you in case you'd seen something.
Or the fact that you understand it way better than I do.
I am not sure about cookie cutter main vs. master I know the command doesn't specify a branch when you run it like cookiecutter gh:adafruit/cookiecutter-adafruit-circuitpython so I assume github gives it whatever branch is marked as default.
Ok that's my thought too.
I'll change it on the PCB version first, and run it to be certain.
If there is anything that would need to change I would guess it's more likely to be a hardcoded reference to master inside of one of the links somewhere. But I'm not sure if there are actually any or not.
It ran. So I assume it's fine.
I was wondering about that as well. I'll have Dylan take a look I suppose.
About the other question with updating the PCB cookiecutter?
Yep I'd definitely be willing to help out with that. I've got a decent understanding of it because it happens to use a templating engine I was already familiar with.
That's great. Ok. Basically it was written to work with sensors which have one name, and a description. And I use it more for microcontrollers which often have multi-word names, and no description. I tried editing the .json file, but it barfed on my change, so I put it back and left it.
I have to retype out half the prompts that are supposed to be automatic to fix how it generates because of what it was designed for.
Are you noticing your messages take a second to send? Mine are hanging for a moment then sending.
I haven't noticed, but i've been switching away after sending for a second.
I'm pretty sure what I need is a super simple change. It's that I don't understand it well enough to do it.
To make sure I understand, the goal is to get rid of description as a prompt? and allow names to have multiple words like with spaces you mean?
ah I see the way it appends "pcb" in a few places. Trying to get rid of those I assume as well?
I wasn't super specific in my explanation. Let me be clearer. sensor_name[] expects a single word, and I give it, let's say, two, such as "Rotary Trinkey". Then when it gets to sensor_description [Sensor], I either hit enter or type a space, or whatever, but it doesn't matter because I don't want it included. Then, when it gets to product_name [<sensor_name> <sensor_description>], it doesn't generate properly because it puts a space in the middle, which mean the GitHub repo it generates has a space instead of a -.
So what I need is for sensor_description to default to nothing, and the product_name to put a - in the sensor_name if there is a space.
So the GitHub repo is adafruit-product-name-PCB or whatever.
Appending PCB is ok in all cases, the local directory name is irrelevant to the final product.
Ahh, I see.
Yeah because it creates a git folder, which doesn't matter to the final destination, the remote is what matters, and as long as I type it out right, it's always right.
The README is out of date.
The instructions are missing some prompts.
I think what happened when I did what I did was that {{cookiecutter.sensor_description}} can't be empty.
Which I need to be possible.
Or it needs to be done differently so that it's possible to have a description or not.
Because eventually I'll do it on a sensor again. So it should be able to handle both.
for changing space you can use the replace thing like:
"repo_name" : "Adafruit-{{cookiecutter.sensor_name | replace(' ', '-')}}-PCB",
in this templating language you can manipulate the variables further by using pipe and then having some way to change it afterward.
It's jinja right?
I'm a noob, but I've used it some. The Pelican website generator uses Python and Jinja templates.
Yep, I believe so. Django uses something very similar as well
Ah ok.
I think having the "Sensor" value on the right on this line:
"sensor_description" : "Sensor",
might be what is not allowing it to be blank
