#circuitpython-dev

1 messages ยท Page 374 of 1

manic glacierBOT
tulip sleet
#

@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
idle owl
tulip sleet
#

i think it was supposed to be any board with neopixels beyond the status led

idle owl
#

Oh. Ok.

tulip sleet
#

if there are some missing they should be added

idle owl
#

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?

tulip sleet
#

what does it do now on ctrl-D

#

yeah, they are kind of like a trinket or gemma

idle owl
#

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.)

tulip sleet
#

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

idle owl
#

I don't follow

tulip sleet
#

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?

idle owl
#

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.

tulip sleet
#

hmm, so maybe autoreload is acting differently than ctrl-d

#

which I would not expect

idle owl
#

I'll try it on Rotary Trinkey after lunch. See if they both act that way.

slender iron
#

we could add a clear after user code is done

storm minnow
#

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

tulip sleet
#

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

storm minnow
#

I needed to add... I think it was displayio? and I think it was just storage

tulip sleet
#

which board is it/

#

CPX

#

there is already a displayio build for CPX

storm minnow
#

It's the Slide Trinkey, trying to modify CP so I can run an OLED on it

tulip sleet
manic glacierBOT
#

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...

tulip sleet
#

so you could turn off several of those, especially math, _pixelbuf, analogio,...

#

displayio is big and you may still not succeed

storm minnow
#

Ok, going to turn those off. It's worth a try!

tulip sleet
#

usb_midi also, usb_hid if you don't need it

#

that's probably it, random, I guess, but it's not large

manic glacierBOT
#

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 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.

Ok, ...

storm minnow
#

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?

tulip sleet
#

it's CIRCUITPY_PIXELBUF (inconsistent omission of extra underscore)

storm minnow
#

Ah

#

Ok

tulip sleet
#

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

storm minnow
#

I do still want to use the NeoPixel, but I don't think I need HID unless I want to have it react

manic glacierBOT
#

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 ...

tulip sleet
#

if your remove _pixelbuf, then you need to use the python adafruit_pypixelbuf library instead

storm minnow
#

Does it make a difference on my ending size? What exactly is the difference between a module and a frozen library?

tulip sleet
#

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

storm minnow
#

Ah...

tulip sleet
#

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

manic glacierBOT
storm minnow
#

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?

tulip sleet
#

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

storm minnow
#

Ok, cool. So I'm gonna try building it now

tulip sleet
#

how many cores on your CPU?

storm minnow
#

That I'm building on?

crimson ferry
#

@storm minnow enable busio too?

tulip sleet
#

good point, need i2c

storm minnow
#

Ah, I probably should, lol

tulip sleet
storm minnow
#

2 cores, 4 threads

tulip sleet
#

do make -j<n> where n is number of cores to build faster

#

make -j4 then

storm minnow
#

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.

tulip sleet
#

you must run make when you are in ports/atmel-samd

storm minnow
#

Ah, yeah, I was in boards

#

Building :D

#

Ok, so, is there a way to reduce my space usage while still having displayio and NeoPixel?

tulip sleet
#

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

stuck elbow
#

analogio is surprisingly large

tulip sleet
#

it's off, and math is too :/

#

see about one hour ago above

storm minnow
#

Heh, I didn't expect to get into something that would make the pros scratch their heads

stuck elbow
#

touchio?

tulip sleet
stuck elbow
#

pwmio?

#

busdevice?

tulip sleet
#

it's trying to put 8 lbs in a 5 lb sack

ionic elk
#

@storm minnow what are you trying to put on there?

tulip sleet
#

those should be off already

idle owl
#

That's how I pack my carryon baggage.

#

Except it's more like 60lbs in a 20lb sack. ๐Ÿ˜„

stuck elbow
#

it's all in the right use of your knee

storm minnow
#

Uhhh, can I attach directly from my WSL files? Or do I have to copy out?

tulip sleet
#

click the + sign and select the file

storm minnow
#

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

tulip sleet
storm minnow
#

Trying to get displayio in to use an OLED, heavily modifying a Slider Trinkey

tulip sleet
#

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

storm minnow
#

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

tulip sleet
#

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

storm minnow
#

Let me try

#

What does PIXELBUF do?

tulip sleet
#

it is a helper for neopixel, but is not completely necessary if you use adafruit_pypixelbuf instead

#

(but that uses up RAM)

storm minnow
#

Ah

tulip sleet
#

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

storm minnow
#

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!

tulip sleet
#

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

storm minnow
#

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!

tulip sleet
#

also look at mpconfigport.h and mpconfigport.mk. If you don't need struct, could turn that off, but libraries may use it

storm minnow
#

What does struct do? I remember someone mentioning it was important

tulip sleet
#

packing fields into bytestrings and vice versa

storm minnow
#

ah

still zephyr
#

it was me ๐Ÿ™‚

storm minnow
#

You were one of the instigators of this madness :P

still zephyr
storm minnow
#

Maybe after I figure out the space issue XD

still zephyr
#

Great ๐Ÿ™‚

storm minnow
#

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!

manic glacierBOT
storm minnow
#

SUCCESS!

tulip sleet
#

CIRCUITPY will reformat because its size has change, or if it s messed up, then do storage.erase_filesystem()

storm minnow
#

Gotcha. Actually, I think I have enough room to add NeoPixel and PIXELBUF back

#

That would make sense, right?

tulip sleet
#

yes, if you are going to use them

storm minnow
#

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

jaunty juniper
#

doesn't matter, you are just setting compilation variables

storm minnow
#

Ok, thought so

#

Recompiling!

#

Rebuilding?

#

much faster without the processor being pinned 100% beforehand XD

jaunty juniper
#

recrossing your fingers

storm minnow
#

done!

#

Put on board, Hello World successful!

storm minnow
#

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?

jaunty juniper
#

there's not pull-up on the board, some breakouts have them

manic glacierBOT
#

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...

storm minnow
#

or VDD, whichever I'm getting power from?

jaunty juniper
#

yes, like 5-10 kฮฉ

tulip sleet
#

pull up to 3.3v, not 5v

storm minnow
#

Ok, thanks. Lemme dig out a resistor and try it out!

tulip sleet
#

you need two resistors, one on SDA, one on SCL

storm minnow
#

Gotcha. I wonder if this is the last hurdle

idle owl
#

There's never a last hurdle. ๐Ÿ˜‰

storm minnow
#

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

atomic summit
#

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.

tulip sleet
#

no problem, then, if there are significant numbers of potential users, that's fine

#

thanks for the response

ionic elk
#

@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.

storm minnow
#

So I added a 9.8~kOhm resistor to each SDA and SLC -- but still getting the error

tidal kiln
storm minnow
#

Oh, I confirmed I'm seeing resistance between SDA/SLC and 3.3V, so I know they're connected...

tulip sleet
ionic elk
#

no

tulip sleet
#

the datasheet says that? It's cleared?

ionic elk
#

it's the watchdog... let me double check

tulip sleet
#

maybe there are some preserved registers?

ionic elk
#

Yeah actually there are! I didn't look at the watchdog

tulip sleet
#

the wathdog has some scratch registers. We'd have to see if the pico-sdk or bootloader uses some of them

ionic elk
#

yep saw those just as you did

#

I was poking around power and reset for them

tulip sleet
#

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

ionic elk
#

I'm confused, all the watchdog registers are taken?

#

on the RP2040?

tulip sleet
#

no on ESP32-S2

#

RTC registers, actually, not "watchdog"

ionic elk
#

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

tulip sleet
#

i'ts just an aside about the ESP32-S2, not about the RP2040

ionic elk
#

but the scratch registers it provides are fine for preserving state, the STM32 has them too, that's what I use there

tulip sleet
#

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

ionic elk
#

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

tulip sleet
#

how is state saved on the nRF in a deep sleep?

ionic elk
#

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

tulip sleet
#

oh, so we reconstruct it. so on STM you used the RTC or equiv registers, have you looked at atmel-samd yet?

ionic elk
#

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

tulip sleet
#

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

manic glacierBOT
ionic elk
#

@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

manic glacierBOT
#

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
storm minnow
#

@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?

tulip sleet
#

which pins are you using?

#

whose display is it? ours?

storm minnow
#

Pins are SWC and SWD [which I believe to be PA22 and PA23?], display is the 0.91" OLED 128x32 with STEMMA

tulip sleet
#

those pins may not work - they are debugging pins. I though you would be using the potentiometer pins?

storm minnow
#

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

tulip sleet
#

so you have jumpers soldered to the round SWD/SWC pads?

storm minnow
#

Indeed

tulip sleet
#

i'll be back later after looking at the schematic

storm minnow
#

Ok, I'll be around, just ping me :D

still zephyr
#

the 0.91?

storm minnow
#

Yup, that's the one

still zephyr
#

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

storm minnow
#

The big thing we're not sure about is if we can use the pins I picked, lol

still zephyr
#

mmm, either case we will learn a lot

storm minnow
#

I've learned how to build custom CircuitPython at the very least!

still zephyr
#

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

storm minnow
#

It took 10 minutes on laptop here at one point XD

still zephyr
#

so what are the plans for the picos?

storm minnow
#

Uhhh... I dunno yet, lol

ember iris
#

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?

tulip sleet
#

@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?

manic glacierBOT
#

@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 ...

still zephyr
storm minnow
still zephyr
#

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

tulip sleet
ember iris
# still zephyr are you making examples as well?

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

still zephyr
tulip sleet
#

@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?

ember iris
#

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?

storm minnow
tulip sleet
#

are you measuring 3.3v at the display board?

still zephyr
ember iris
still zephyr
#

it is up to you :), the issue would be good because that way we do not forget that we need to solve that

storm minnow
still zephyr
#

either with your PR or without ๐Ÿ™‚

tulip sleet
# storm minnow Yes

at the 3v OUT pin on the display board, are you measuring about 3v (will be about .3v lower than the input voltage)

ember iris
# still zephyr either with your PR or without ๐Ÿ™‚

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?

storm minnow
tulip sleet
#

that shows the regulator is functioning

#

is 3vo connected to anything?

ember iris
storm minnow
still zephyr
manic glacierBOT
tulip sleet
storm minnow
#

Yes

tulip sleet
#

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

storm minnow
#

Ok, start with the resistors... How do I hand toggle digital IOs?

tulip sleet
#

wait, i know the problem, you have the wrong pin numbers, they are PA20 and PA21. see the schematic I posted above

storm minnow
#

Oh, glad I didn't disconnect the display yet XD

#

Using 20 and 21 instead of 22 and 23

manic glacierBOT
tulip sleet
storm minnow
#

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?

tulip sleet
#

delete them

storm minnow
#

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?

idle owl
#

RP2040 only.

#

But there are eraser files for the Trinket that might work.

idle owl
storm minnow
#

Worth a shot. Thanks!

#

Ok, did that eraser, it cleared, redid CP, came back clean.... but getting the same error again

still zephyr
storm minnow
#

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?

tulip sleet
#

they will be slightly larger

storm minnow
#

Hmm, I think something is wrong then, it didn't change

storm minnow
#

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!

onyx hinge
#

the suggestion of using PA30/31 is the compiler doing its best but giving bad advice

manic glacierBOT
#

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,...

storm minnow
manic glacierBOT
storm minnow
#

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

tulip sleet
# storm minnow Hmmmm.... this is weird. So if I remove the ignores for `PA30` and `PA31`, it'll...

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!

storm minnow
#

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

tulip sleet
#

an alternative to all this is to get another slide pot ๐Ÿ™‚

storm minnow
#

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

tulip sleet
#

i'm curious what the pot failure mode was? Did something get bent or pushed out of place?

storm minnow
#

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?

tulip sleet
#

so maybe a foreign body on the slider or something or somehow the slider was not making contact. hmm, thanks

storm minnow
#

Possibly. No problem!

manic glacierBOT
#

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...

storm minnow
#

@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?

tulip sleet
#

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

storm minnow
#

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...

manic glacierBOT
manic glacierBOT
#

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...
#

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)
#

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.

gloomy shuttle
#

@tidal kiln I just submitted a PR to fix the led_on example to initialize the keyboard.

gloomy shuttle
tidal kiln
#

know how to run black?

tulip sleet
#

it would be good to set up pre-commit

manic glacierBOT
gloomy shuttle
ionic elk
#

blegh, this sublime upgrade

#

what a mess. Anybody know if I can revert without losing all my packages and settings?

manic glacierBOT
#

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.

still zephyr
idle owl
#

@still zephyr In the middle of a thing at the moment, so I'll take a look later today or tomorrow.

tough flax
#

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!

tough flax
#

Here's the code to make a joystick show up on the XBox Adaptive Controller port (left or right)

ionic elk
#

@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

storm minnow
#

suddenly danh was incredibly popular

ionic elk
#

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?

manic glacierBOT
#

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:

  1. Throw a ValueError when attempting to use a TimeAlarm with deep sleep (current implementation)
  2. Allow RTC Alarms, but trust the user to supply a clock source. This isn't very Cir...
tulip sleet
tulip sleet
manic glacierBOT
slender iron
#

@ionic elk my feeling is to cut our losses and not do alarm on rp2040 if we can't run the rtc during dormant

manic glacierBOT
#

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).

>>> "| | | | | | | | | | | | | | | | | | | | | | | | |"
'| | | | | | | | | | | | | | | | | | | |...
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

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.

manic glacierBOT
ionic elk
#

@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

tulip sleet
manic glacierBOT
#

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...

slender iron
#

@onyx hinge Iโ€™m out until Tuesday but โ˜๏ธ seems fine to me.

onyx hinge
#

No hurry, take your time off!

#

I was tidying up my git and found this feature that I had not PR'd

slender iron
#

@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.

onyx hinge
#

I'm not sure how to make it backwards compatible, if you see a way I'm happy to re-work it!

ionic elk
#

@slender iron PR is up! Got it in yesterday.

slender iron
ionic elk
#

Just put together a really quick RTC deep sleep patch too, alongside some CI cleanup

slender iron
ionic elk
#

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

manic glacierBOT
#

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...

manic glacierBOT
#

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...
still zephyr
solar whale
#

@still zephyr Sorry, that must be one of the few Adafruit products I have not purchased ๐Ÿ˜‰

storm minnow
#

gotta buy'em all

solar whale
#

I've tried...

storm minnow
#

lol

still zephyr
#

is just an IC for a led matrix... I do not like leds or displays so who knows...

storm minnow
#

Don't like LEDs and displays? :O

still zephyr
#

nope, ๐Ÿ™‚ I like sensors ๐Ÿ™‚

storm minnow
#

But displays tell you what the sensors sense!

still zephyr
#

Good point...

#

So I correct myself I do not like to collect displays

storm minnow
#

lol

still zephyr
#

๐Ÿ™‚

storm minnow
#

I collect everything XD

#

But things that light up... they really butter my bread

still zephyr
storm minnow
#

D:

#

I have hundreds

#

Literally

ember iris
#

Sensors and eink is where it's at ๐Ÿ˜„

storm minnow
#

I have an eInk... but I think it may be damaged >~>

ember iris
#

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)

storm minnow
#

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

ember iris
#

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

storm minnow
#

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

thorny jay
#

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.

storm minnow
#

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

thorny jay
#

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.

storm minnow
#

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

idle owl
storm minnow
#

I think it was sitting for a year unrefreshed, maybe that damaged it >~<

ember iris
#

Try giving it a refresh once every 10 minutes for a couple of hours, that might help clean it up over multiple cycles

storm minnow
#

Worth a try

ember iris
storm minnow
#

For the refreshes to try to clean it, should I refresh all layers and leave it white? Or have an image?

idle owl
#

I feel like Collin did a few shorty videos on them too. Might be conflating with another type of display.

storm minnow
ember iris
#

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)

idle owl
#

Probably!

#

At least that would be the videos combined.

ember iris
#

It's a good one! I love eink stuff and watched that one a few times

storm minnow
#

eInk still feels like magic sometimes

ember iris
#

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

storm minnow
#

Some newer types of eInk can actually refresh a lot faster!

ember iris
#

Yeah I'm excited to see them come to fruition. How's the screen of yours looking by the way?

storm minnow
#

Haven't gotten to try to refresh yet, trying to get my FunHouse working

ember iris
#

Ah the dilemma of having multiple projects! Curses! Haha

storm minnow
#

yeah XD

idle owl
#

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.)

storm minnow
#

Is there a good place on how to github?

idle owl
#

I wrote a guide for it. Covers my CircuitPython workflow. Otherwise, I think they have pretty good docs as well.

storm minnow
#

Ok, cool. Can I see your guide? I'll poke their docs as well

idle owl
storm minnow
#

Danke :D

idle owl
#

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. ๐Ÿ™„

storm minnow
#

Too many things to do, not enough time...

idle owl
#

Pretty much.

storm minnow
#

C'est la vie

idle owl
#

waits on CI

storm minnow
#

CI?

idle owl
# storm minnow 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).

storm minnow
#

Ah... PR is Pull Request?

ember iris
#

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

storm minnow
#

Ahh, so a PR is the opposite of forking?

ember iris
#

also @idle owl I submitted my first pull request! Thank you for all of your help!

idle owl
#

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.

idle owl
storm minnow
#

'sort of' sounds like a better understanding than 'no, not at all' XD

idle owl
ember iris
# storm minnow Ahh, so a PR is the opposite of forking?

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!"

idle owl
#

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.

ember iris
#

Sounds good! Hope it's quick and easy!

storm minnow
#

Hope all is well with you vehicle!

blissful pollen
turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Region

us-west

Channel Categories

8

Text Channels

58

Voice Channels

6

Members

29374

Roles

35

storm minnow
#

Whoa, I didn't realize there were that many channels

ember iris
#

@honest nova mind if I ask you a couple of questions here if you're free?

still zephyr
#

yes go ahead

ember iris
#

Yup! Looking at the sgp40--some of the print statements were there before I edited the code, should I remove those as well?

still zephyr
#

yes ๐Ÿ™‚

#

thank you

#

I forgot my debug print sometimes too ๐Ÿ™‚ (this was not the case anyway)

ember iris
#

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)

still zephyr
#

go ahead There is no deep dive today and I am not running so I have a lot of time

ember iris
#

Should tuples be returned even if it's coming from a hidden function if the tuple adds computation time/steps?

still zephyr
#

yes, as I said this is an unspoken rule, but normally all the libraries do that

#

Not sure the reason

ember iris
#

(where did 98 come from here?)

still zephyr
#

98% of libraries

#

๐Ÿ™‚

ember iris
#

Ahh right. So in this case choose conforming with the api over optimization then?

still zephyr
#

why do you like the list?

ember iris
#

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

still zephyr
#

I see your point

#

could you use struct?

#

struct will do that for you to bytearray

ember iris
#

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

still zephyr
#

when I say struct I am talking about the API

ember iris
#

I don't think there's a reason not to use struct, I just don't often use it

still zephyr
#

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?

ember iris
#

Yes there is

#

it has a built in humidity and temperature sensor so this section of code is all handled on the sgp30 itself

still zephyr
#

and they use lists

ember iris
#

That I do not know, I'm looking at the source code now though

still zephyr
#

me too

ember iris
#

yeah it looks like in a couple of sections they return lists

still zephyr
#

yep

#

so problem solved ๐Ÿ™‚

ember iris
#

Ok cool, I'll keep those lists then.

still zephyr
#

๐Ÿ‘

ember iris
#

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

still zephyr
#

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?

ember iris
#

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

still zephyr
#

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

ember iris
#

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'

still zephyr
#

good, I think we have our answer, dont we?

ember iris
#

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

ember iris
still zephyr
#

well you are doing precisely that neokey

#

For me there is no need

ember iris
#

Ok--so I'll leave the humidity compensated raw measurement exposed in that case?

still zephyr
#

oh what I mean there is no need to expose it as they are use to compensate

#

could you change the raw humidity?

ember iris
#

Oh haha that's the opposite of what I was thinking

still zephyr
#

lol

#

I changed my mind again, lol

ember iris
still zephyr
#

so ok now final answer, is yes expose

#

we had this kind of discussion with the sea_level_pressure for altitude ๐Ÿ™‚

ember iris
#

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

still zephyr
#

yes I agree, that why I love them

#

If you have trouble with the documentation let me know

#

sometimes Sphinx is very picky

ember iris
#

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!

still zephyr
#

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

manic glacierBOT
ember iris
#

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!

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
still zephyr
manic glacierBOT
#

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...
#

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..

proven prairie
#

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.

jaunty juniper
proven prairie
# jaunty juniper 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?

jaunty juniper
#

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

proven prairie
proven prairie
# jaunty juniper ah yeah to build for samd you need the arm compiler

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

jaunty juniper
#

did you make BOARD=feather_m0_express clean ?

proven prairie
#

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'

jaunty juniper
#

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)

proven prairie
manic glacierBOT
jaunty juniper
#

nothing, I'm just saying I don't know if the installer does it

proven prairie
manic glacierBOT
proven prairie
manic glacierBOT
manic glacierBOT
#

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...

solar whale
#

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.

manic glacierBOT
solar whale
#

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

manic glacierBOT
#

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...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

@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">

solar whale
#

@still zephyr The main hang-up in testing the BME280 PR is my ability to find my BME280 -- searching....

ember iris
# proven prairie haha back to square one once I do that: make BOARD=feather_m0_express Use make ...

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

manic glacierBOT
#

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...

onyx hinge
#

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

manic glacierBOT
#

@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 ...

still zephyr
manic glacierBOT
manic glacierBOT
livid horizon
#

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?

manic glacierBOT
low sentinel
manic glacierBOT
#

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 ...

orchid basinBOT
livid horizon
# low sentinel First q, I donโ€™t think anyone is maintaining a build like that. Second q, if itโ€™...

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.

stuck elbow
#

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

livid horizon
# stuck elbow finally, that is just syntactic sugar, you can do exactly the same things using ...

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. ๐Ÿ‘

stuck elbow
#

iterators and context managers are syntactic sugar themselves

#

they don't do anything that you couldn't do with a bit more python code

tulip sleet
solar whale
tulip sleet
onyx hinge
#

before: 246652 bytes used, 6788 bytes free in flash firmware space out of 253440 bytes (247.5kB).
after: 248204 bytes used, 5236 bytes free

tulip sleet
#

@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.

onyx hinge
#

don't I know it

tulip sleet
#

@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.

jaunty juniper
#

I did look at that briefly when looking at how to disable uploads to S3 of non-main branches

tulip sleet
#

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.

#
wwa

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...

jaunty juniper
#

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
tulip sleet
#

we would also need to include the active non-main branches, like 6.3.x, etc., IK think

jaunty juniper
#

it would still trigger on pull requests

#

and releases

jaunty juniper
#

oh I didn't test a PR to not-main

tulip sleet
#

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

manic glacierBOT
low sentinel
low sentinel
storm minnow
#

Isn't everything just sugar when you have assembly? :P

still zephyr
#

please give me a sugar cane. thanks

manic glacierBOT
onyx hinge
#

<@&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!

thorny jay
#

So let's say in 25H from now... ๐Ÿ™‚

manic glacierBOT
manic glacierBOT
manic glacierBOT
livid horizon
#

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).

hollow token
#

cries in concurrency using both eyes

#

Even the new ESP32-S3 has a 2nd core

manic glacierBOT
#

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...

manic glacierBOT
#

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...
frozen flume
#

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+.

frozen flume
still zephyr
#

@idle owl ๐Ÿ™‚

frozen flume
frozen flume
still zephyr
#

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)

tulip sleet
idle owl
still zephyr
#

Ok got you (y)

idle owl
tulip sleet
#

@frozen flume you could just set CIRCUITPY_AUDIOMP3 = 0 to 1 in ports/esp32s2/mpconfigport.mk and rebuild and see what happens

still zephyr
#

Thanks Kattni

frozen flume
frozen flume
frozen flume
# tulip sleet <@!648901520703881247> you could just set `CIRCUITPY_AUDIOMP3 = 0` to 1 in `port...

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

tulip sleet
#

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

frozen flume
#

got it., well, thanks for your help!

idle owl
still zephyr
onyx hinge
#

@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

tulip sleet
#

@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

idle owl
#

@onyx hinge Can you not hear me? Hm.

errant grail
#

๐Ÿ‘‹

#

Just listening today.

modern wing
#

Good afternoon all you wonderful folks -- happily lurking ๐Ÿ™‚

low sentinel
#

Iโ€™ll be lurking today as well

blissful pollen
#

I'll be lurking and may be around text only

manic glacierBOT
lone axle
cobalt grail
#

๐Ÿ‘‹

sterile bronze
#

lurking

idle owl
#

I can't hear Dan either.

tulip sleet
#

skip me for now

silver tapir
#

Happy to help on tls stuff (an anything else)

gilded cradle
#

@solar whale I made a local change to Blinka, but haven't had a chance to test yet.

solar whale
#

I thought it was amusing to see the latest commit to the adabot repo was to master about moving to main ๐Ÿ˜‰

slender iron
#

๐Ÿ‘

gilded cradle
#

I think we need to update some of the other libs like Blinka and PlatformDetect to use Main instead of Master

modern wing
#

People keep telling me to "take a hike", sounds like it's a fun time ๐Ÿ™‚

slender iron
#

I think we can just build and deploy from adafruit/circuitpython

solar whale
#

All for removing as many of the alternatives as possible

idle owl
solar whale
#

Friends don't let friends use .txt

thorny jay
#

๐Ÿ’ฏ a good idea. Breaking change for 7.0

crimson ferry
#

are double extensions a problem for some platform? If not, could leave it... sometimes, periods may arise naturally in a filename

lone axle
# slender iron I think we can just build and deploy from adafruit/circuitpython

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?

gloomy shuttle
#

Yes, you should be able to multiple by -1

slender iron
#

@lone axle yup, I think so

thorny jay
#

There is a market with more than two input to have precision and safe rotary encoder. ๐Ÿ™‚

gloomy shuttle
#

I would be happy to look at the direction issue

#

Yup

modern wing
#

Thanks y'all!

silver tapir
#

Thanks all.

still zephyr
#

Thanks

solar whale
#

๐Ÿ‘

modern wing
#

We're so close to the finish line....let's push strong through the last mile of this marathon ๐Ÿ™‚

#

Cheers

idle owl
#

The cats were kind enough to do their plaintive meowing when I was muted today.

onyx hinge
#

awwww

solar whale
#

Mine can detect an open mic.

modern wing
#

How considerate! They decided to help mew.

onyx hinge
#

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!

modern wing
#

indeed, thanks @lone axle for doing the background legwork like that

#

It makes such a difference when following along

lime trellis
#

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

manic glacierBOT
#

+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...

manic glacierBOT
slender iron
#

@jaunty juniper @idle wharf @stiff pelican @still zephyr want to move circup to the circuitpython org?

lime trellis
tulip sleet
#

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

slender iron
#

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

lime trellis
#

thanks for the insight. I'll create a tracking issue and try and scope the work

manic glacierBOT
slender iron
#

thanks @lime trellis !

manic glacierBOT
tulip sleet
#

@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.

manic glacierBOT
slender iron
#

sounds good to me @tulip sleet. thanks!

manic glacierBOT
#

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
slender iron
#

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.

stiff pelican
#

Thanks

slender iron
#

np, sorry about that

#

I was thinking it'd be good to move so you can do reviews

idle owl
#

I thought we were going with new PyPI account for that org. I already added the new credentials to the CP org.

slender iron
#

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

idle owl
#

Sounds good.

orchid basinBOT
orchid basinBOT
manic glacierBOT
#

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 =...
manic glacierBOT
#

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...
slender iron
#

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'

still zephyr
slender iron
#

if you could answer that'd be really helpful. thanks!

onyx hinge
#

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

manic glacierBOT
#
[adafruit/circuitpython] New branch created: jepler\-patch\-1
orchid basinBOT
manic glacierBOT
#

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...
idle wharf
#

Wait, was that an ask for us to do it or was it an ask for agreement. ๐Ÿ™‚

onyx hinge
#

darn, there's no os.urandom on samd21

manic glacierBOT
manic glacierBOT
#

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-...

manic glacierBOT
manic glacierBOT
#

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...

next lily
#

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?

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

usb_cdc.enable(console=False, data=True) was not working.

  • Set usb_cdc defaults correctly
  • Use correct TinyUSB itf values 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.LED to 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...
manic glacierBOT
still zephyr
#
>>> %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

ember iris
#

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

idle owl
#

Do you mean simpletest ?

ember iris
idle owl
#

Ohhhh.

ember iris
#

haha yeah I was so deep in the code I forgot the context was needed

idle owl
#

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!

still zephyr
#

just a comment normally quickstart = readme.rst = simpletest, so you will need to update those too . sorry for the interruption ๐Ÿ™‚

ember iris
#

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?

ember iris
idle owl
manic glacierBOT
ember iris
idle owl
#

Ah!

#

OK.

#

Yeah, go for it.

ember iris
#

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

ember iris
ember iris
ember iris
ember iris
still zephyr
#

I think we include the comments too, but only 65% sure ๐Ÿ™‚

ember iris
#

Awesome, thank you!

gilded cradle
manic glacierBOT
#

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_...
idle owl
#

@lone axle Hello! Are you around?

lone axle
idle owl
# lone axle 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.

lone axle
#

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.

idle owl
#

Ok that's my thought too.

#

I'll change it on the PCB version first, and run it to be certain.

lone axle
#

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.

idle owl
#

It ran. So I assume it's fine.

idle owl
#

About the other question with updating the PCB cookiecutter?

lone axle
#

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.

idle owl
#

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.

lone axle
#

I haven't noticed, but i've been switching away after sending for a second.

idle owl
#

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.

lone axle
#

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?

idle owl
#

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.

lone axle
#

Ahh, I see.

idle owl
#

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.

lone axle
#

for changing space you can use the replace thing like:

 "repo_name" : "Adafruit-{{cookiecutter.sensor_name | replace(' ', '-')}}-PCB",
idle owl
#

ooh ok

#

Updated.

lone axle
#

in this templating language you can manipulate the variables further by using pipe and then having some way to change it afterward.

idle owl
#

It's jinja right?

#

I'm a noob, but I've used it some. The Pelican website generator uses Python and Jinja templates.

lone axle
#

Yep, I believe so. Django uses something very similar as well

idle owl
#

Ah ok.

lone axle
#

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

idle owl
#

I edited that

#

and that's what barfed.