#circuitpython-dev

1 messages ยท Page 353 of 1

ionic elk
#

I'm poking around and I don't see anything of that sort, but it seems kind of unusual that this has never come up before

tulip sleet
#

it's just a few lines of code:

    const mp_int_t max_length_int = args[ARG_max_length].u_int;
    if (max_length_int < 0) {
        mp_raise_ValueError(translate("max_length must be >= 0"));
    }
#

that's from Characteristic.c; there are other examples

#

there are some validate_ routines that don't do negative checking, but they factor out common code

#

there isn't a common place to define these kinds of validators, else there might be more.

ionic elk
#

Is that something worth thinking about?

#

It seems like maybe mp_arg_parse_all does some validation?

tulip sleet
#

it just makes sure something is an INT, BOOL , etc.

ionic elk
#

making set of validators, or something, I mean

tulip sleet
#

it could be finer grained.

#

you can copy-pasta the code above for now

ionic elk
#

Sure, I had my own version written, I just thought it seemed unusual that it didn't exist already.

#

Since it's going to be in so many places

tulip sleet
#

you could make a shared-bindings/validators.c or util.c or something

ionic elk
#

I'd consider it for sure if you or @slender iron thought it was worth working on

#

seems like this is very widespread across shared bindings, not a lot of sanitation/validation going on

#

but I dunno if we care, seems like it hasn't come up before

tulip sleet
#

getting the bugs fixed is higher prio, but then it could make sense. I'd weight your priorities. It's been easy to just copy the code. Another frequent validator is whether an object is of the right type.

#

if you can do it easily and it will save you time, then go ahead

ionic elk
#

Right I'm thinking just one validator function that gets passed some enums describing what's valid

tulip sleet
#

you have to pass it a string or a translate() string so that it can throw a useful error message.

ionic elk
#

Sort of like an expansion of MP_OBJ_IS_TYPE, I guess

tulip sleet
#

i don't think you should do enums, just have multiple functions. These functions are so small that they may be inlined

ionic elk
#

true

#

I should see what kinds of errors Cpython returns for this stuff

tulip sleet
#

but do this if you think it will save time and/or space now, don't spend much time on it

ionic elk
tulip sleet
#

what we want to prevent is bad arguments that will cause crashes

ionic elk
#

and there weren't any built-in tools for dealing with that

#

In this particular case that shouldn't be a big deal, Socket will just fail if you pass it a ridiculous port, but for some of the other peripherals there's probably some risk.

crimson ferry
#

oh, is that a shared-bindings to common-hal translation... None becomes -1?

#

ok, I think I got it

#

nope, I don't... non-blocking is default, but -1 is default timeout (blocking)?

manic glacierBOT
#

I have installed the bitmap font library via pip
pip install adafruit-circuitpython-bitmap_font

I use it with Blinka_Displayio on this computer.

I've noticed that if I have that library installed in my python environment then I will get this error when attempting to build circuitpython:

$ make BOARD=nucleo_f767zi
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
Unable to check whether maximum number of endpoints is respec...
manic glacierBOT
#

executing usb_background() right away can remove the need for introducing usb_background_schedule(). However, I am not entirely sure at this point of reload (stopping vm), it is appropriate to run background task. There is bunch of init() afterwards. Therefore I choose the safer option to schedule it. I will leave the decision for you since you understand this better.

lime trellis
#

is there anyway to set microcontroller.Processor.frequency from inside the VM?

#

Processor.frequency.setter(INT) doesn't seem like it does anything

crimson ferry
#

it would need to be written for the port / chip family in common-hal, and exposed to CircuitPython in shared-bindings

lime trellis
#

roger. thank you @crimson ferry

onyx hinge
#

@lime trellis not at present

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Not sure if this is a CircuitPython issue, or an issue with the ESP network code. My home network issues 4 DNS servers (two comcast-issued DNS servers, and 8.8.8.8/1.1.1.1 as backups) via DHCP. When my MagTag gets all 4, requests with FQDN's fail:

`Connecting to dragonfly-manor
Connected to dragonfly-manor!
My IP address is 10.225.0.6
Ping google.com: 38.999985 ms
Fetching text from http://wifitest.adafruit.com/testwifi/index.html
Traceback (most recent call last):
File "code.py", ...

manic glacierBOT
lone sandalBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Not sure if this is the ticket to discuss this, but I installed the latest tinyuf2, to test out @skieast's PR.
While both these PRs work as expected individually, once I have both installed on the board, I'm seeing some ghosting when using displayio (the slightly dark text at the top and the bottom of the screen).

![photo_2021-02-05_15-04-57](https://user-images.githubusercontent.com/196144/107043595-8609b980-67c3-11eb-95dd-...

manic glacierBOT
manic glacierBOT
ionic elk
#

@crimson ferry -1 is the equivalent to None, as you said, so it means it will never time out. Timeout 0 means non-blocking (functions will fail with EAGAIN if they can't be performed immediately) and timeout None means it's blocking and will never stop unless interrupted. None is the default in Cpython and for us here.

crimson ferry
#

oh wow, thanks, blocking was counterintuitive to me

ionic elk
#

wait no I got it confused. It's exactly the other way around, not enough coffee

crimson ferry
#

lol, same

ionic elk
#

you are right to find it counterintuitive it is literally the opposite. editing

#

lmao

#

my bad

#

Also, of course, any actual timeout number is blocking, but will throw ETIMEDOUT after that span of time.

crimson ferry
#

Makes sense. Requests does settimeout by default to 1 second (it's also a kwarg).

tidal kiln
lone axle
#

@still zephyr Am I correct in thinking that you are on github and your username is jposada202020?

gilded cradle
#

@tidal kiln it was activated by an overlay. Something called i2c-gpio or something and that just had it try more i2c configs. That was prior to the extended bus library that handles it more gracefully.

gilded cradle
#

Yeah, it makes sense.

tidal kiln
#

any case where one sets up a i2c-gpio, they should use that extended bus library?

gilded cradle
#

Maybe add a note to use the extended bus library if they have any alternative mappings.

#

Yeah

#

The problem was the number of possible combinations was huge.

tidal kiln
#

the i2cPorts def in Blinka should only be for hardware pins/ports?

gilded cradle
#

And it's just trying to maps the pins you give to the /dev/i2c-* port

#

yeah

tidal kiln
#

ok. yep. it's a tricky issue. since the number of combos is huge.

gilded cradle
#

The extended bus just kind of shortcuts the whole give me some pins and I'll figure out your bus number part.

tidal kiln
#

looks like that bus 3 line was added to help with a specific use case

gilded cradle
#

It was

tidal kiln
#

but now with the other lib, should just remove it from blinka

#

and use other lib instead

#

?

gilded cradle
#

Yes

tidal kiln
#

ok. i'll send a PR real quick

gilded cradle
#

Awesome. Thanks.

tidal kiln
#

np. thanks for helping fill in the history.

gilded cradle
#

yw

solar whale
#

Has anyone tried using neopixels on a Pico with the neopixel.py library? I am getting some very odd behavior.

manic glacierBOT
#

I am having trouble controlling neopixels on a Pico when using the neopixel.py libray
Here is an example

Adafruit CircuitPython 6.2.0-beta.1-80-gadaf43d6d on 2021-02-04; Raspberry Pi Pico with rp2040
>>> 
>>> import board,neopixel
>>> pix = neopixel.NeoPixel(board.GP27,8)
>>> pix[0]= 0xff   --- OK  -- pixle 0 is red
>>> pix[0]= 0xff00  --- neopixel 0 turns off
>>> pix[1]= 0xff00  --- neopixel 0 is blue ???
>>> 
```

I have tried it with a few different neopixel strings --...
slender iron
solar whale
#

Its not so much the color, but the correct pixels are not responding ...

#

pix.fill(x) does not fill all the pixels the same

tulip sleet
#

do you have another string to try? It could be marginal timing. If you have a recent string or ring, try that. Also it's not RGBW?

solar whale
#

I've tried a few, but are pretty old. I agree that it looks like timing...

#

not rgbw

tulip sleet
#

the WS2812B are more finicky than SK6812, which are the newer ones

solar whale
#

it is not consistent -- also suggesting timing.

tulip sleet
#

string powered via 3.3V?

solar whale
#

these are ws2812b

#

I'll think I have some newer ones -- Ill try them.

#

powered on 5

gloomy shuttle
#

I just ran the sample code you posted and don't have an issue running on a pico

solar whale
#

but I tries on 3 with same behavior

#

hmmm @gloomy shuttle did you use 3V or 5? and which type of neopixel?

tulip sleet
#

try powering on 3.3V, the WS2812B are marginal when driven with 3.3v control signal and powered by 5v

#

try a short string

#

oh never mind

gloomy shuttle
#

I take that back, I think my colors are inverted

solar whale
#

I'be be happy with inverted ...

#

just confirmed same behavior with 3 and 5 V -- with flicker at 3V

#

looking for some sk6812's

gloomy shuttle
#

I was using vbus

#

I playing with it more now and I am getting strange behavior as well.

solar whale
#

ah -- maybe it's not just me....

#

are yours w2812's?

tidal kiln
#

@gilded cradle i merged the PR, but i'll leave it up to you on releasing. i don't think it's a super urgent need.

gilded cradle
#

Ok, thanks

gloomy shuttle
#

yes ws2812

#

if I run in the REPL I am getting that odd behavior. If i put the same commands in a code.py, I think it is behaving as expected.

#
>>> import board,neopixel
>>> pix = neopixel.NeoPixel(board.GP27,8)
>>> pix[0]= 0xff   --- OK  -- pixle 0 is red
>>> pix[0]= 0xff00  --- neopixel 0 turns off
>>> pix[1]= 0xff00  --- neopixel 0&1 is green

on vbus

onyx hinge
#

@solar whale I have a pico with some flora neopixels running from vbus and I get glitches too

#

most of the time it's fine but some updates glitch the whole strip

#

I'm not using neopixel library, just neopixel_write

#

it could of course just be the vbus problem and thus my fault

#

and as it's a circuit sculpture it's not trivial to modify to try using the 3.3v rail for led power instead

solar whale
#

ok -- If I just set up my onwn PIO I am not hav ing any problems -- only with the library that uses neopixel_write.

onyx hinge
#

maybe the causes are different then

solar whale
#

at least -- not yet..

#

@gloomy shuttle I feel so much better ๐Ÿ˜‰

onyx hinge
#

where's pio neopixel code hiding out?

blissful pollen
gloomy shuttle
#

that was my output on vbus and when I moved to 3.3v it acted exactly as yours did with switching pix[0] to blue at the end.

solar whale
#
#
# SPDX-License-Identifier: MIT

import time
import rp2pio
import board
import adafruit_pioasm
import array

# NeoPixels are 800khz bit streams. Zeroes are 1/3 duty cycle (~416ns) and ones
# are 2/3 duty cycle (~833ns).
program = """
.program ws2812
.side_set 1
.wrap_target
bitloop:
  out x 1        side 0 [1]; Side-set still takes place when instruction stalls
  jmp !x do_zero side 1 [1]; Branch on the bit we shifted out. Positive pulse
do_one:
  jmp  bitloop   side 1 [1]; Continue driving high, for a long pulse
do_zero:
  nop            side 0 [1]; Or drive low, for a short pulse
.wrap
"""

assembled = adafruit_pioasm.assemble(program)

sm = rp2pio.StateMachine(
    assembled,
    frequency=800000 * 6,  # 800khz * 6 clocks per bit
    init=adafruit_pioasm.assemble("set pindirs 1"),
    first_set_pin=board.GP27,
    first_sideset_pin=board.GP27,
    auto_pull=True,
    out_shift_right=False,
    pull_threshold=8,
)
print("real frequency", sm.frequency)
NUM_LEDS = 8
bar = bytearray(3*NUM_LEDS)
#blue
for j in range(0, 255):
    for i in range(NUM_LEDS):
        bar[3*i] = 0
        bar[3*i +1] = 0
        bar[3*i +2] = j
    sm.write(bar)
    time.sleep(.010)
#green
for j in range(0, 255):
    for i in range(NUM_LEDS):
        bar[3*i] = j
        bar[3*i +1] = 0
        bar[3*i +2] = 0
    sm.write(bar)
    time.sleep(.010)
#red
for j in range(0, 255):
    for i in range(NUM_LEDS):
        bar[3*i] = 0
        bar[3*i +1] = j
        bar[3*i +2] = 0
    sm.write(bar)
    time.sleep(.010)
#OFF
for i in range(NUM_LEDS):
    bar[3*i] = 0
    bar[3*i +1] = 0
    bar[3*i +2] = 0
    sm.write(bar)
#for i in range(100):
#    sm.write(b"\0x0\0x0\0x0a")
#    sm.write(b"\0xa\0x0a\0x0a")
#    time.sleep(0.1)
#sm.write(b"\0x0")
print("writes done")

time.sleep(2)
``` @onyx hinge I use something like this
blissful pollen
solar whale
#

@blissful pollen yes it does use PIO

onyx hinge
#

@blissful pollen yes that was my understanding too

#

but if @solar whale says it makes a difference there's often something to the observation

solar whale
#

something may be different in the timing -- there is a delay in neopixel_write that is set to 0 now

#

I have not tried adjusting it...yet

onyx hinge
#

my glitches are similar with rp2pio.StateMachine as with neopixel_write fwiw

#

My writes are 100ms apart minimum so that's not it

solar whale
#

good to know -- I may not have exercised my pio example enough -- I'll do more poking at it. Glad to hear I am not the only one having issues...

onyx hinge
#

I didn't notice it at first because the light display code I had was pretty random anyway, with regards to colors

solar whale
#

same here -- the simple writes are what turned it up for me

onyx hinge
#

I'm not working today ๐Ÿ˜œ so I'll leave it at that for now.

solar whale
#

Thanks -- enjoy the rest of your vacation

onyx hinge
#

thank you. it's been nice, read some books, etc

solar whale
#

I have to go for awhile -- will try more exploring later -- thanks @gloomy shuttle

blissful pollen
#

I'll try to take a look at it later if I have a moment. I spent a lot of time with the PIO for the parallelbus so its all loaded in my head currently

solar whale
#

and @blissful pollen

manic glacierBOT
#

The Common-Hal API for Socket had some inconsistencies argument size and type between functions, such as the "port" argument. Some of these were even using uint8_t, which is far too small for many common port values. This PR converts all arguments to uint32_t and adds some sign checking since Python always passes them in as signed ints.

Further down the line, it may be appropriate to add more comprehensive input sanitation to this and other shared-bindings implementations.

Resolves #4127

slender iron
stuck elbow
#

@slender iron not quite, we got it to work with the full-screen refresh (when col and pos is 0), but not with partial refreshes. I think I would need a way to force it to update each row separately, like it does with sh1106, but not use the sh1106 addressing.

slender iron
#

๐Ÿ‘

#

we should probably have an issue to support it properly. I feel like I'm hearing more about it

cobalt grail
#

I must admit to don't understanding it enough to make a translation.

#

Also note that it is used in a mp_raise_NotImplementedError_varg, does that mean I shouldn't even bother to translate it because you will get to it eventually? ๐Ÿ˜Ž

manic glacierBOT
tulip sleet
#

@slender iron do you have time for a secondary CDC API discussion video chat? Also we could talk about some planning for the next beta.

slender iron
slender iron
cobalt grail
tulip sleet
#

wow, can you comment on the auto-translater?

cobalt grail
#

Comment? I have no idea how to do that.

#

Or comment on just that one you mean?

tulip sleet
#

google translate lets you supply a better translation; I wonder if it does that or just learns from the translations you suply

cobalt grail
#

Yeah, this is Weblates own engine. Not sure how that learns.

manic glacierBOT
ionic elk
#

@jaunty juniper thanks for pointing out that problem with Socket.connect() yesterday, just put up a PR for it. I don't know how on earth it made it through my connect tests, I had a whole gauntlet I put it through.

manic glacierBOT
jaunty juniper
#

thanks for fixing it ๐Ÿ˜‰

ionic elk
#

it works with the gist you put up

manic glacierBOT
#

So, I hooked up a small test bench using a raspberry pi to test one of the flash chip and found out it is OK.
I tried to attach it to the SAMD51 board without success.

I searched a bit more about SPI on circuitPyhton and found out this.
According to the datasheet, the wiring I used works for SAMD21, but not for SAMD51 due to the restriction on SERCOM pads.

I checked is using your ha...

solar whale
#

Adding a pushbutton from RUN to Ground on the Pico sure does make life easier ๐Ÿ˜‰

stuck elbow
#

@slender iron do you think it would be possible to add a flag that would disable all the sleep code in time.sleep that was added in 5.x?

slender iron
#

why?

stuck elbow
#

to get rid of the flickering

slender iron
#

I have zero context for what you are talking about

#

what flickering?

#

it sounds like a bug, not a reason to turn off sleep

stuck elbow
#

ok, thanks

manic glacierBOT
solar whale
#

@blissful pollen @gloomy shuttle I can confirm that I get the same behavior with my PIO example -- so it is consistent with using neopixel_write. It looks to me like one byte of the transmitted array is getting missed. Not sure, on which end .

manic glacierBOT
tulip sleet
#

@slender iron STM32G0x and STM32G4 both have 8 USB endpoint pairs.

manic glacierBOT
#

Just to add some support to this case, my Pico just arrived today and I immediately hooked it up to an "official" neopixel ring (16 pixels). With the example code supplied and minimal modification, I get a random selection of colours all over the ring and a number of points not illuminated.

My code:

`import time
import board
import neopixel

Update this to match the number of NeoPixel LEDs connected to your board.

num_pixels = 16

pixels = neopixel.NeoPixel(board.GP1, num_pixel...

blissful pollen
#

does the make translate build go into the raspberry pi port yet? Had to add a new error and I don't see it checking that path

manic glacierBOT
#

Unfortunately their labels don't match the actual function. As their examples don't match the hardware. I spent a few hours trying to read the ST7789 registers with no success, trying all the various pins.
Looking at he OLED end they label everyything as if it was I2C and not SPI
image

I rang out the various pins using a meter and there is no MISO on the display. They use the same di...

blissful pollen
supple gale
#

Yes, lol. I think i did use the IO4 pin to toggle a LED to test that it was working.

manic glacierBOT
#

I think it's from here:
https://github.com/adafruit/circuitpython/blob/c6a7b00030ffd8d7a9f566622fc12fcc3fd0e85b/tools/gen_display_resources.py#L27

It looks like this file does some path manipulation and import tricks to load up it's own version of bitmap_font. When I have the real one in the environment it's causing it to import the real one instead of this one internal to the circuitpython repo.

manic glacierBOT
manic glacierBOT
still zephyr
lone axle
#

I tried out your proposed label change for the baseline alignment. I need to poke at it a bit more but I wanted to ask you as well. How is the user supposed to use that? set the new parameter to True on both labels in order to align along the baseline? and false otherwise?

still zephyr
#

So, Yes exactly, but we apply False in this case when we try to align both labels, also taking into account that we do not want to break the old code, by default the parameter is set to true, that way old code will work too

#

At the present, the bsaline is calculated with the decend+ascend function that varies if the Font is different in both labels

#

I put some examples in my repo, and I try to explain the best that I could, in the new learning guide. This morning I modify the code to include the brackground also with the new proposed parameter and it worked. I did not test very much, but I just want it to knwo your and kmatch opinion regarding that

manic glacierBOT
still zephyr
#

If you read paint your dragon issue is basically what we can do in some of the example using the offset parameter. But we can tinkering, change it, or refactor it

waxen vault
#

Turns out creating a pull request, and having it merged was a faster way to build a binary than setting up the Circuitpython build system on my PC Thanks @slender iron !

lone axle
#

@still zephyr awesome, thank you I will tinker some more as well this weekend. (sorry for big delay I got distracted a bit by the stream in the other channel.)

cedar moth
#

I have a noob question about a recently updated library Adafruit_CircuitPython_DisplayIO_SH1107. My PR was merged into the library yesterday and today I tried downloading the latest bundle (also dated yesterday) but it appears that the new functionality is not there. My name was listed in the list of contributors on the library bundle download page so I thought it was in the bundle, but after seeing the issue I double checked and the Adafruit_CircuitPython_DisplayIO_SH1107 library wasn't included in the list of Updated Libraries. I am guessing that the library was updated too late to make it into yesterday's bundle, but since my name was on the contributor list and this was my first PR, I just want to be sure there isn't a possible issue with my code?

still zephyr
lone axle
#

I do think it's a great idea, would love to see it made easier to align them like that issue notes. I didn't have one of the fonts you used but I subbed in some others that I have into the example. I'll try to test a good range of different ones to see how it works with them.

manic glacierBOT
still zephyr
#

Yeah , any different size (16) will do the trick for testing I could not find the one in the issue either.

manic glacierBOT
#

I ran into an issue trying to remove these. All the samples are set pindirs 1 or out pindirs 1 and from what I saw in the RP2040 docs it seems only 5 pins max set at once. Even when I run out with 0x1F and then 0x07 (for outputting 8 bits for 8 pins) it doesn't work. I tried to move my pin group to set as well as out groups and I cannot set 8 pin directions at once. The SDK code has the pins grouped into 5s and set that way. I'm thinking this may be a limit.

Every parallel pin exampl...

crimson ferry
cedar moth
#

No worries, thanks for confirming it wasn't me @crimson ferry... I appreciate it!

crimson ferry
#

Is this intentional on MagTag: microcontroller.pin.GPIO8 --> board.CS board.EPD_CS ? (all of the other EPD pins have the EPD_ prefix)

#

Also, should we have a board.LED alias for board.D13?

lone sandalBOT
manic glacierBOT
manic glacierBOT
#

When using the following code, I am getting the error that all the timers are used for pinblue(GP19)

import pwmio
import board


pinred = pwmio.PWMOut(board.GP17, frequency=5000, duty_cycle=0)
pingreen = pwmio.PWMOut(board.GP18, frequency=5000, duty_cycle=0)
pinblue = pwmio.PWMOut(board.GP19, frequency=5000, duty_cycle=0)

code.py output:
Traceback (most recent call last):
File "code.py", line 7, in
ValueError: All timers for this pin are in use
...

manic glacierBOT
#

Testing different builds on S3, I see the error existed on January 1, disappears after #3930 "UMFEATHERS2 - implement use of DotStar for status led", and consequently comes back after #4013 which reverts 3930.

The original PR included the following change in ports/esp32s2/common-hal/microcontroller/Pin.c

bool pin_number_is_free(gpio_num_t pin_number)
(...)
-    return (never_reset_pins[offset] & mask) == 0 && (in_use[offset] & mask) == 0;
+    return (in_use[offset] & mask) =...
manic glacierBOT
#

I have the same issue when running the mcp230xx_simpletest.py with an MCP23017:

Traceback (most recent call last):
  File "<stdin>", line 9, in <module>
  File "adafruit_mcp230xx/mcp23017.py", line 52, in __init__
  File "adafruit_mcp230xx/mcp23017.py", line 102, in iodir
  File "adafruit_mcp230xx/mcp230xx.py", line 49, in _write_u16le
  File "adafruit_mcp230xx/mcp230xx.py", line 49, in _write_u16le
OSError: [Errno 19] Unsupported operation

on line
ht...

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

i think this would be best done as a pure python library - rather than built into the circuitpython core. is it something you'd like to hack on?
-- @ladyada

Full Yaml specification is more complex to implement than it seems, as it includes many little-known features, such as anchors and refs, flow style, etc.

A light yaml spec subset is probably more relevant for onboard electronics, as it's faster to execute.

In particular, [strictyaml](https://hitchdev....

manic glacierBOT
solar whale
#

anyone have a clue what is going on here ```Press any key to enter the REPL. Use CTRL-D to reload.

Adafruit CircuitPython 6.2.0-beta.1-127-ga10ce39ae on 2021-02-06; Adafruit MagTag with ESP32S2

import board
import adafruit_si7021
sht = adafruit_si7021.SI7021(board.I2C())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "adafruit_si7021.py", line 110, in init
File "adafruit_si7021.py", line 107, in init
File "adafruit_si7021.py", line 107, in init
TypeError: extra keyword arguments given

manic glacierBOT
blissful pollen
solar whale
#

I hope it is something different....

manic glacierBOT
blissful pollen
#

That driver uses read_then_writeinto which I may have missed testing

solar whale
#

I'm not finding it in the code

blissful pollen
#

with self.i2c_device as i2c: i2c.write_then_readinto(data, data)

Line 107

solar whale
#

I meant in the C code

blissful pollen
#

shared-bindings/I2CDevice.c starting at 220

#

Yup I think i see what it is ugh... wait mayb enot

solar whale
#

I don't see I2CDevice.c in shared-bindings...

blissful pollen
#

sorry shared-bindings/adafruit_bus_device/I2CDevice.c
Apparently I need more caffeine still

solar whale
#

got it.

blissful pollen
#

okay now I know what I did...

#

in the other functions the optional keyword is last, in this one one is in the middle and I just skip the array index going like [4] = ... [5] = ... [8] =...

solar whale
#

Sorry - I'm not following you on that, let me know if you want me to try something.

blissful pollen
#

I'll submit a PR in a few minutes just double double checking my change ๐Ÿ™‚

#

I don't have that device so can't test it fully against the driver

solar whale
#

Thanks -- I'll test it when its ready

#

Take your time !

manic glacierBOT
solar whale
#

building it now

blissful pollen
#

Thanks, sorry about that. Fixed the no long int bug and introduced a new different issue.

solar whale
#

No problem -- life on the cutting edge is always interesting ๐Ÿ˜‰

#

Works!

blissful pollen
#

yay!

manic glacierBOT
#

Tested fix with si7021 on MAgTag
It was failing prior to fix with:

Press any key to enter the REPL. Use CTRL-D to reload.

Adafruit CircuitPython 6.2.0-beta.1-127-ga10ce39ae on 2021-02-06; Adafruit MagTag with ESP32S2
>>> 
>>> import board
>>> import adafruit_si7021
>>> sht = adafruit_si7021.SI7021(board.I2C())
Traceback (most recent call last):
  File "", line 1, in 
  File "adafruit_si7021.py", line 110, in __init__
  File "adafruit_si7021.py", line 107, in __init__
  File...
solar whale
#

@blissful pollen Thanks for the quick fix!

blissful pollen
solar whale
#

uh -oh -- something odd happening

#

Adafruit CircuitPython 6.2.0-beta.1-14-gea4a12005-dirty on 2021-02-06; Adafruit MagTag with ESP32S2
>>> import board,adafruit_si7021
>>> sht = adafruit_si7021.SI7021(board.I2C())
>>> 
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.


Code done running.

Press any key to enter the REPL. Use CTRL-D to reload.

Adafruit CircuitPython 6.2.0-beta.1-14-gea4a12005-dirty on 2021-02-06; Adafruit MagTag with ESP32S2
>>> 
>>> import board,adafruit_si7021
>>> sht = adafruit_si7021.SI7021(board.I2C())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "adafruit_si7021.py", line 99, in __init__
ValueError: No I2C device at address: 40
>>> 

```  after pwere cycle -- it works once -- then after soft reboot it does not ...
manic glacierBOT
#

odd behavior with this PR
It works normally after a power cycle, but not after a soft reboot.

Press any key to enter the REPL. Use CTRL-D to reload.

Adafruit CircuitPython 6.2.0-beta.1-14-gea4a12005-dirty on 2021-02-06; Adafruit MagTag with ESP32S2
>>> import board,adafruit_si7021
>>> sht = adafruit_si7021.SI7021(board.I2C())
>>> 
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.


Code done running.

Press any key to enter...
blissful pollen
#

Hmm I never had an issue with the BME280 and the code to scan for devices isn't related to what I just changed

thorny jay
#

ESP32-C3 on it's way to my home... wake me up if you start porting to it.

solar whale
#

@blissful pollen I've never seen this before either.

blissful pollen
#

what do you do to cause the soft reboot? just reset button? or dropping to the REPL

solar whale
#

Control - D

#

let me try it on another board

onyx hinge
manic glacierBOT
blissful pollen
solar whale
#

A hard RESET (reset button) clears it. seems to only be the soft reboot.

#

I'll try it on a PyPortal and Metro_esp32s2

#

It does not happen on the PyPortal

blissful pollen
#

Could be an ESP32S2 issue, or busio issue on it

solar whale
#

yup -- happens on metro_esp32s2 as well

manic glacierBOT
gloomy shuttle
manic glacierBOT
#

While testing #4146 I ran into this behavior on a MagTag.
It is also reproducible on a metro_esp32s2
but
it does not occur on a PyPortal (samd51)

the issue is that I can access the I2C device after a Power Cycle or Hard Reset but it fails after a soft reboot on esp32s2 boards.

Press any key to enter the REPL. Use CTRL-D to reload.

Adafruit CircuitPython 6.2.0-beta.1-14-gea4a12005-dirty on 2021-02-06; Adafruit MagTag with ESP32S2
>>> import board,adafruit_si7021
>>> sht = ...
stuck elbow
thorny jay
#

Did I just see that on Twitter with someone running it on a Pico?

stuck elbow
#

no, that was the regular vacuum invaders

#

I literally just finished this now

#

right now the controls.py is for pygamer, I will probably need to provide a set of different controls.py for different boards

#

I wonder if we could standardize this and include it on the boards that have game-like controls by default

thorny jay
#

Yes for board that have controller, this is much wanted to simplify the process. My current trip is Wii Classical joystick, in I2C, or over Bluetooth or connected to my GD3X Gameduino Dazzler. So I am searching a way to abstract joystick and plug them into game.

manic glacierBOT
#

I don't have a full answer yet but looked into this a bit further. I used neopixel_write to write raw to the string (skipping the neopixel library). What I noticed is on the RP2040 the first byte of the array being sent to the string wasn't always sent correctly, resulting in the rest of the pixels being incorrect. E.g. If I sent 0xFF, 0x00, 0x00 (GRB order so a green pixel) there are times I would not see the first pixel light up (or just flash quickly on/off). If I sent 0x00, 0xFF, 0x00 (so...

jaunty juniper
#

so, PR #4138 makes it possible to connect without SSL, but when I try to get some http with requests using this build it gives me OutOfRetries (but works on 6.1 or SSL).

crimson ferry
#

confirmed with requests... what works for you, tcp socket without http?

#

something getting lost in translation between requests and socketpool

jaunty juniper
#

it works with SSL, I have a test with a simple GET without requests that does work, I have a simple version of websockets that does not work

#

it connects, sends the headers to the server, which replies with headers of it's own, but when the code reads, recv_into returns 0, and returns instantly even if I give it a timeout

crimson ferry
#

yeah, SSL is fine post-split, 6.1.0 was before all the changes and HTTP worked

jaunty juniper
#

I wasn't sure if I should comment on the PR or open a new issue

crimson ferry
#

"OutOfRetries" indicates it's not even getting a socket

#

no amount of retrying or longer timeouts gets around it

#

something's wrong across that API boundary

#

so... what's different between your purehttp and requests...

crimson ferry
#

requests is behaving like your websocket... no data is coming back with socket.recv_into()

crimson ferry
#

server is receiving the request and returning a 200 status code and all the bytes

crimson ferry
jaunty juniper
#

oh if you read one by one it returns 0, but if you read more you get something

crimson ferry
#

yeah, there's always an extra \x00 at the end (or just \x00 in this case of reading one byte), and the code was looking for just one real byte ("H")

jaunty juniper
#

I have that annoying feeling that this extra zero rings a bell, but I have no idea from what or if I just need sleep >_>

crimson ferry
#

there was something where wifi country code was getting returned with extra bytes, but that seems a tenuous link

#

yeah, definitely time for ๐Ÿ’ค

jaunty juniper
#

the change was:

-    int bytes_received = lwip_recvfrom(self->num, buf, len - 1, 0, (struct sockaddr *)&source_addr, &socklen);
+    int bytes_received = lwip_recvfrom(self->num, buf, len, 0, (struct sockaddr *)&source_addr, &socklen);
#

and recv_into does:

received = lwip_recv(self->num, (void*) buf, len - 1, 0);
#

so the same fix should apply ?

#

hmmm though that was there in 6.1.0 ? maybe ?

jaunty juniper
#
  • switching to recvfrom_into() makes the test code run as it should
  • so does a build (based on PR4138) with the fix in recv_into:
-    received = lwip_recv(self->num, (void*) buf, len - 1, 0);
+    received = lwip_recv(self->num, (void*) buf, len, 0);
#

now, what does it break ?

manic glacierBOT
manic glacierBOT
gloomy shuttle
thorny jay
gloomy shuttle
manic glacierBOT
#

I think I have it solved. I noticed the problem only occurred when the transfer was smaller then the amount to use DMA for in StateMachine.c (32 bytes). In the non-DMA transfer part of the code after each byte is written "RUN_BACKGROUND_TASKS" is ran. It seems that most times after writing the first byte there were background tasks to be ran, delaying filling the TX buffer and throwing off the timing. That would explain the random pauses seen.

One solution is to run RUN_BACKGROUND_TASKS ...

#

Partial fix for #4135 to run background tasks before starting a non-dma transfer of data. Non-dma transfers are used when writing less then 32 bytes (which equates to 10 RGB neopixles). The fact a background task may not need to run explains why it was also further unpredictable.

Running background tasks at all during a loop writing the 32 or less bytes could cause a timing issue so discussion should take place on if that should even take place.

#

Ah -- that makes sense -- so when working with any string > 10 pixels and setting them all, the problem will not occur -- This explains why it was working so well with the 16 pixel ring but I started having issues with the 7 pixel jewel, and when testing writes to single pixels.

I would remain concerned if there is a known likelihood of failure during the 40 microsecond window. It will happen at the lest opportune time ;-)

blissful pollen
#

Ugh I somehow messed up GIT and commited a bunch of other commits with my latest PR gotta fix that

manic glacierBOT
solar whale
#

Giving it a try

blissful pollen
#

Cool, think I fixed the git issue too.

manic glacierBOT
blissful pollen
#

One thing you could try @solar whale is to comment out the RUN_BACKGROUND_TASKS that exists in the loop as well. Not sure if it will help. Thinking I also was playing with the PIO program timings let me try that again too

solar whale
#

ok -- trying that now.

#

also moving my comment to the PR -- should have gone there.

manic glacierBOT
blissful pollen
#

Other thing to try if it still acts funny is to change the dma_min_size_threshold value down. Not a good long term solution but let me tell that the DMA/non-dma transfer was part of the problem

solar whale
#

It's still misbehaving with the RUN_BACKGROUND_TASKS in the loop commented. May be a bit "better" but still not reliable.

blissful pollen
#

Strange, I can't get mine to misbehave anymore.

solar whale
#

what test are you running

#
>>> from digitalio import *
>>> from board import *
>>> import neopixel
>>> import time
>>>  
>>> pixpin = GP27
>>> numpix = 7
>>>
>>> strip(0)= 0xff
>>> strip = neopixel.NeoPixel(pixpin, numpix)
>>> strip[1]= 0xff
>>> 
```  fails for me -- nothin lights on first write -- then 2 blue pixels on second
blissful pollen
#

I have a string of 30 (from the last adabox) hooked to GP15. Then running:
`import board
import digitalio
import neopixel
from neopixel_write import neopixel_write

pin = digitalio.DigitalInOut(board.GP15)
pin.direction = digitalio.Direction.OUTPUT
pin.value = False

b = bytearray(6)
b[0] = 0x22
b[3] = 0x22
neopixel_write(pin, b)`

#

Your example is working for me. My second pixel lights blue

solar whale
#

your example only lights one pixel green for me

blissful pollen
#

which pixel?

solar whale
#

teh second

#

actually not sure

#

my be third

blissful pollen
#

you could try my example but lower the byterray to 3 (or up to 9) for 1 or 3 pixels total respectively

solar whale
#

I forget which is which on the jewel

#

sorry -- I left a line out of my example -- fixed above -- there are two writes

blissful pollen
#

So I did a new example and I'm getting my first pixel light green randomly

#

b = bytearray(30) #10 pixels b[0] = 0x22 neopixel_write(pin,b) for i in range(1,30): b[i] = 0x22 b[i-1] = 0x0 neopixel_write(pin,b) time.sleep(0.2)

solar whale
#

๐Ÿ˜ฆ I think it is still funky

blissful pollen
#

but somewhat reproducible now, i'll take that as a sorta win

solar whale
#

but your explanation of the potential issue sounds great!

#

Just stick to arrays of >10 pixels ...

blissful pollen
#

yeah going to try my last example with 11 pixels to see if it always works

#

Hmm interestingly enough it's doing it for longer strings too, maybe a second timing issue

solar whale
#

what about the RUN_BACKGROUND_TASKS in line 573?

blissful pollen
#

maybe but I think that would be more while the DMA is still running and in theory the CPU/DMA shouldn't matter worth a shot. I'm going to look at the PIO program timings. The CP ones differ from the RP2040 example

solar whale
#

Good luck! I have to go off for awhile -- will try more tests later this afternoon.

blissful pollen
#

Thanks for your help, i'll update the PR/issue later too

manic glacierBOT
#

I am still seeing an issue so there is another timing issue as well. I tried the following to ensure DMA is being used:

b = bytearray(36) #12 pixels b[35] = 0xff for i in range(1,36): neopixel_write(pin,b) time.sleep(0.15)

While this runs I notice the last blue pixel will dim at times (missing the LSB I'd assume) and the first pixel lights up bright green (getting those missing bits on the high side). If I alter the delay in the sleep it will not happen.

I do not have a...

gloomy shuttle
# blissful pollen Thanks for your help, i'll update the PR/issue later too

I am not seeing issues when I run tests in code.py but when I run the individual commands in REPL I am seeing a difference

import board, digitalio, neopixel, time

strip = neopixel.NeoPixel(board.GP15, 10)

strip[0]= 0xff
strip[1]= 0xff
strip[1]= 0x00ff00

In code.py , the neopixels light up with strip[0] as blue and strip[1] as green. In the REPL, strip[1] ends up off and strip[0] ends up purple.

blissful pollen
#

Hmm interesting if I run it in code.py I can't trigger the issue either. But in the REPL easily can

#

As I type that I just had it trigger ๐Ÿ˜† but way less often

manic glacierBOT
manic glacierBOT
#

Opening a fresh issue, based on comments in adafruit/Adafruit_CircuitPython_Requests#63:

On CicruitPython (since PR#4049), non-TLS HTTP requests fail:

import sys
import time
import socketpool
# import ssl
import wifi
import secrets
import adafruit_requests as requests
from secrets import secrets

wifi.radio.connect(secrets["ssid"], secrets["password"])
print("RSSI", wifi.radio.ap_info.rssi)

socket = socketpool.SocketPool(wifi.radio)
# http = requests.Session(socket, ssl...
manic glacierBOT
slender iron
manic glacierBOT
#

I've been banging my head against this for a while, so apologies if this isn't clear!

Background: I'm trying to connect my Magtag to a Mosquitto server. I'm able to subscribe, publish, and receive published messages. However, I'm encountering errors when loop()ing when there are no messages to receive. Note that if you want to reproduce this, you'll have to use an IP for secrets['mosquitto_broker'], not a .local address because #4059.

When I run the following code, I get OSError ra...

sour river
#

@slender iron got the audiopwmio running, though I think the sampling got mangled somehow. Circuitpython's pretty cool, though, I gotta say. The build process was pretty smooth, too.

#

This is just with the sample code from the docs running for the sine wave. You can see that it's producing a signal with a frequency close to 440 Hz, and that there are chunks of PWM that settle at different values at 8 kHz. But the spots of 0 PWM are unexpected, so idk if the 16-bit -> 10-bit conversion is a problem, or maybe the sample rate was just too low. I'll maybe try 8-bit and some other rates, and maybe try to figure out some of the print stuff.

slender iron
#

ya, the 16-bit is broken

#

nice work getting it going!

sour river
#

ah, makes sense, then, haha. and thanks!

slender iron
#

๐Ÿ™‚

sour river
#

while you're here, is 8-bit mode as easy as using an 8-bit sample and changing the quiescent value? i'll see if i can give that a try

slender iron
#

yup! you can omit quiescent value too. I think the default is sane

sour river
#

oh, i see, so it still converts from 8 to 16 bits, looks like. looking siny! just a sec for the screen grab

slender iron
#

yup, it converts up to 10 bits

#

the 16 -> 10 is broken for some reason

sour river
#

oh oh i see. "sample resolution 8" "ouput_resolution 10" I was thrown off by the 8 -> 16 bit sample 0: 512 messages but I'm not sure what those are from anyway

slender iron
#

those are printing out the value after the conversion

#

for debugging ๐Ÿ™‚

sour river
#

looks like a sin, but maybe the absolute value of a sin? It was double the frequency, too.

slender iron
#

8 bit in?

sour river
#

yeah array.array("B",...

slender iron
#

it could definitely be wrong ๐Ÿ™‚

sour river
#

it's definitely closer!

slender iron
#

that's my test code

sour river
#

hmm still looking like absolute value. or maybe it's only a half period?

#

yep, looks like. so that's the reason for the octave shift. also nice decay at the end--i think that was discussed on one of the vids (edit: or maybe that's just caps draining? but it looks like the PWM continues, so i figured that was what it was)

#

it's got the 2 Pi, though, so i'm pretty confused how that happened

#

maybe audiocore is only converting the front half of each wave? idk...

manic glacierBOT
#

@waiweng83 If you have time, could you check https://adafruit-circuit-python.s3.amazonaws.com/bin/raspberry_pi_pico/en_US/adafruit-circuitpython-raspberry_pi_pico-en_US-20210206-a10ce39.uf2 or later for this problem? It is from #4141 and incorporates a fix in the pico-sdk. Thanks.

Yes, I tested with code.py and main.py and it's working perfectly now.

0x414b on discord reports the old program seems to be gone: #help-with-circuitpython message...

manic glacierBOT
manic glacierBOT
#

We welcome ports to additional chip families. It's a lot of work, primarily due to supporting the clock architecture and peripherals of a particular chip family. Sometimes they resemble other chip families from the same manufacturer, sometimes not.

It sounds like you want to support existing boards, rather than a new design. The LPC17xx family, as you know is Cortex M3, which is not used in new designs that I have seen. The max RAM on the family is 96kB, which is adequate, but not great. T...

manic glacierBOT
#

@Jerryneedell noticed that this problem affected strips short enough to not use the DMA peripheral, thanks for the hot tip!

Instead of checking for background tasks after every byte transfer, try up to 32 transfers before attending to background tasks.

This fixes the problem I was seeing on my 5-pixel circuit.

Closes #4135.

I wrote this before seeing the simpler #4149. I think this MAY be a bit better than #4149, and here's why: Occasionally, background tasks and interrupts ca...

#

What is in code.py when this happens. Is it print("Hello, world!\n")?

The way you are starting code.py from boot.py isn't necessary. code.py will run after boot.py, so you should be able to just omit these lines:

# Finally code
exec(open("/code.py").read())
main()

A different thing you may want to do is to reset the board entirely if you've loaded a new code.py, by doing microcontroller.reset(). But try just omitting the lines above first

It is poss...

#

What is in code.py when this happens. Is it print("Hello, world!\n")?

Yes.

The way you are starting code.py from boot.py isn't necessary. code.py will run after boot.py, so you should be able to just omit these lines:

I need to keep the context of the WiFi radio and the socket pool; in my experience, it gives me an issue if I didn't.

A different thing you may want to do is to reset the board entirely if you've loaded a new code.py, by doing microcontroller.reset(). But try ju...

turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Region

us-west

Channel Categories

8

Text Channels

58

Voice Channels

6

Members

27307

Roles

34

manic glacierBOT
#

Hello,

As you know, I built a few custom board prototypes using SPI Flash GD25Q64C.
CircuitPython now works great, but I noticed a problem with file transfer to the CIRCUITPY drive.

When I try to send a "large" file (87 kB wave file), the transfer stays stuck at 0% and never complete.
image
A 23 kB files is ok
A 63 kB file stayed stuck for a while at 33% and eventually finished ...

ionic elk
#

@tulip sleet could you link me to Socket issues that you review on Github? It's probably more likely at this point that I'll have worked on something than Scott, and I'm sure he'd appreciate having those issues off his inbox.

tulip sleet
#

@ionic elk sure, np. I forgot you were involved in that particular one, and it's good to take it off of @slender iron's plate.

ionic elk
#

@tulip sleet at this point there basically isn't a socket issue that I haven't been a part of

blissful pollen
#

@tulip sleet About the I2CDevice fix, I was talking to jerry on the weekend and think it's good to merge, but wasn't sure if I should just hit the green merge after we both tested it or let you guys choose when to merge the PR in? So I waited ๐Ÿ™‚

manic glacierBOT
gloomy shuttle
#

@onyx hinge I built the #4155 PR for the neopixels and am no longer seeing the issues via code.py or in the terminal REPL

manic glacierBOT
#

Sorry to report this still not working for me.

using a 7 pixel jewel:

dafruit CircuitPython 6.2.0-beta.1-128-g5423e4966 on 2021-02-08; Raspberry Pi Pico with rp2040

>>> from board import *
>>> import neopixel
>>> import time
>>>  
>>> pixpin = GP27
>>> numpix = 7
>>>  
>>> strip = neopixel.NeoPixel(pixpin, numpix, brightness=0.3)
>>> strip.fill(0)
>>> strip.fill(0xff)
>>> strip.fill(0xff00)
>>> strip.fill(0xff0000)
>>> 
```  after the last write, pixel 0 is green ...
#

also ```Adafruit CircuitPython 6.2.0-beta.1-128-g5423e4966 on 2021-02-08; Raspberry Pi Pico with rp2040

from digitalio import *
from board import *
import neopixel
import time

pixpin = GP27
numpix = 7

strip = neopixel.NeoPixel(pixpin, numpix, brightness=0.3)
strip.fill(0)
strip[0]=0xff
strip[0]=0xff00
strip[1]=0xff00
strip[1]=0xff
strip[0]=0xff
strip[0]=0xff00

pixel 0 is not responding properly.

solar whale
#

What are the e-mails with 162 messages in the thread from github -- are others getting them?

#

from Christopher Barnatt

idle owl
#

@solar whale We're dealing with it.

#

It's an attempt to use Actions maliciously.

blissful pollen
#

@solar whale Even more fun with pixels today. I hooked my second pico up as a basic analyzer, and if its connected to the data pin, things work great of course, but as soon as I disconnect it, the issue occurs.

solar whale
#

I'll reconnect my Logic analyzer in a bit.

#

need to clear a path on my workbench ๐Ÿ˜‰

blissful pollen
#

For a $4 pico it works remarkably well as a basic analyzer, if nothing else that has been fun to try

solar whale
#

What are you using for the code -- something available to look at?

blissful pollen
#

I haven't put it anywhere yet I just took the pico example PIO/logicanalyzer code, wrapped it in a loop to run forever, and changed the frequency

solar whale
#

Just curious -- I have a Salea so will use that but alway fun to poke/prod.....

gloomy shuttle
#

@solar whale I ran your example in the PR #4155 on my neopixel strip using the REPL with no issues on both 3.3 and vbus

blissful pollen
#

It's just a PIO program that does "in pins, 1" repeatedly upon a high trigger (or low if you change it). For neopixels works remarkably well

solar whale
#

@gloomy shuttle good to know -- hope it is something on my end....

gloomy shuttle
solar whale
#

I will rebuild/reflash and retry with multiple strips.

solar whale
#

@gloomy shuttle @blissful pollen so -- apparently -- the Airlift was somehow causing some change in teh behavior ...

blissful pollen
solar whale
#

I had also been seeing spurious USB disconnects -- waiting to see if they recur with nothing else connected.

gloomy shuttle
#

Is this the right place to ask a Read the Docs question?

manic glacierBOT
solar whale
#

@gloomy shuttle should be fine.

gloomy shuttle
#

I am working on a library that has subclasses but build the docs is only pulling in the main file for the API Reference. I then looked at the PyPortal library and that is doing the exact same thing. Is this right? I would like the API reference section to pull all the files.

manic glacierBOT
#

Thanks for your quick response and hints!

Let me give you some background information of given issue.
There are number of projects based on this MCU in our company. It will be superseded by SAME51 in next projects however. The life cycle of our products is at least 10 years. During this time we have to manufacture and test those boards.
I am going to provide low level access to MCU and peripherals to our HW developers and testers for existing devices.
Using circuitpython they will be a...

gloomy shuttle
#

I think I solved my problem, but is the PyPortal Read the Docs only suppose to list the PyPortal class and non of the other modules?

manic glacierBOT
#

To be fair, I had more that just the Airlift connected.
I had the following connected:
ARILIFT -- lots of pins near the pin used for the neopixel
10Kpullups on SDA.SCL (GP0,GP1) - were for a previous test
pushbutton from RUN to GND -- to facilitate entering bootloader.

I have not determined which was the culprit...yet ... I just assumed it was the Airlift -- perhaps hastily.

With just the bare Pico -- my "jewel" is behaving very normally with this PR.

slender iron
tulip sleet
#

moved issue to library repo

solar whale
#

@onyx hinge I put a place holder "in the weeds" for some discussion of the neopixel/pico

modern wing
#

Good afternoon all you wonderful code slingers! Happily lurking today, and updated the notes doc accordingly. adabot

errant grail
#

Just listening today.

idle owl
#

<@&356864093652516868> Meeting in a few minutes. Please add yourself to the notes doc as lurking if you're listening in, or add your hug reports and status updates. Chat with you soon! https://docs.google.com/document/d/1RTjIOUogdNgKSO5TdfzvsEoJBb1ohP5yREz6ZulzORA/edit

solar whale
#

๐Ÿ‘‹

idle owl
#

We're finishing up an internal meeting. We'll be here soon!

tidal kiln
#

lurking (not sure where exactly to add that in notes doc?)

supple dirge
#

lurking

idle owl
#

@tidal kiln Alphabetically under Hug Reports and Status Updates

#

brb

onyx hinge
#

I'll be taking notes -- if you're lurking in the audio channel and haven't noted it in the doc, please let me know and I'll add you.

old smelt
#

Lurking

modern wing
#

That's my secret cap'...I'm always on a zoom meeting.

thorny jay
#

Lurking

lone axle
onyx hinge
#

So many animals in the list this week .. owls, bumblebees, and ferrets. oh my.

#

"Long Term" doesn't mean we don't want a community member picking it up and working on it!

manic glacierBOT
onyx hinge
tidal kiln
#

oof. back. ok...well, upgrading to ubuntu 20 did not solve USB lock up issue.

onyx hinge
slender iron
#

ivan

onyx hinge
#

Nice to see you @stuck elbow

thorny jay
#

@lesamouraipourpre sound French "les amour ai pourpre" (but what is "ai" or is it AI). And where is the plural s on "amour"?

onyx hinge
mental nexus
onyx hinge
jaunty juniper
onyx hinge
#

we can help with specific git commands when you want @marble hornet

lone axle
#

Very possible... I was the one that originally butchered the name ๐Ÿ˜…

modern wing
#

oooo, the dreaded BIOS bricking of Big Sur.

onyx hinge
#

pours one out for all the bricked Macs

slender iron
#

@modern wing have you ever done APFS recovery? my mac's APFS in a sparsebundle is corrupt

#

(I used it for all my git repos....)

onyx hinge
#

@tulip sleet long term will the new usb-cdc object and busio.UART grow to have the same API?

slender iron
#

they'll both have stream apis

#

so they should be the same from the start

lone axle
#

I'm going to have to drop off for another meeting. I'll note it in the doc. Please read my section when you get to it.

onyx hinge
#

good, thanks @slender iron

modern wing
#

@slender iron No I haven't, sorry.

Thankfully, I haven't experienced any of these issues firsthand...just read about them, as it updates the BIOS and the charge chip firmware.

On many models, including my old 15" late-2013 model specifically, it has a strong chance of bricking the system without any chance of recovery.

tulip sleet
onyx hinge
slender iron
#

fixing socket is super helpful! thank you!

marble hornet
#

@onyx hinge Thank you, I'll take you up on that if (when) I have trouble doing it.

mental nexus
#

๐Ÿž

solar whale
#

need a beta tester?

marble hornet
#

I'm going to drop off. Great to hear updates from everyone.

thorny jay
#

"a real computer" ๐Ÿ™‚

onyx hinge
#

laughs like a maniac

slender iron
#

oooh, ๐Ÿ”ฅ

gloomy shuttle
#

@onyx hinge any particular resources that you have found to be helpful for learning KiCad?

onyx hinge
#

@gloomy shuttle just spending time using it is most helpful for me.

slender iron
#

I know chris gammell has getting started videos about kicad

onyx hinge
#

If I have a specific thing, like "I want a special curved pad" then it's search time ... (and the workflow for that is not great but you can do it...)

blissful pollen
#

I apparently just need more sensors to test against

onyx hinge
#

svg2shenzen

gloomy shuttle
#

probably your stream from friday

slender iron
#

๐Ÿ™‚ he's a host of the amp hour too

#

and does "contextual electronics"

thorny jay
#

A document or a video that explain once perfectly and can be referenced.

#

But that time at the beginning is a chance to finish editing the doc... so if we cut it short, we need to be ready more in advance.

stuck elbow
#

How about not recording the introduction?

#

Start the recording later.

solar whale
#

@gloomy shuttle 4157? is that the right issue number -- not seeing it

gloomy shuttle
#

Its a PR

solar whale
#

ah -- thanks

thorny jay
#

If something change, and we have to do differently, please give a warning.

#

+1 for that.

#

@slender iron look at all the example using AirLift and the pin.

onyx hinge
#

if hasattr(board, 'ANALOG_JOY_X'): set up analog joystick...

ionic elk
#

Is there a way to extract the board name in python?

gloomy shuttle
#

You might also have accessories that are not in board that could be used for a game as well.

onyx hinge
#

^^^ check for properties in board to decide what "kind" of input there is

thorny jay
#

Can we have a library that is different for different board?

ionic elk
#

Do we/should we have a board.name()

thorny jay
#

I am interested in "added" gamepad, like Wii and wireless Bluepad32.

onyx hinge
#

brb setting DMA jumper on soundblaster

thorny jay
#

In PC game you can also choose at startup the kind of input you are going to use...

#

Remember, this is the year of the "Python Game Computer"...

#

You need those new (positional) neopixel with 3 wire and capture the signal at the end.

gloomy shuttle
#

are you using vbus or 3.3v?

thorny jay
#

Did you try without the NeoPixel library?

onyx hinge
#

@thorny jay my test/demo is using pioasm, yeah

gloomy shuttle
#

"of course they are" ๐Ÿ˜†

onyx hinge
#

There are some libs that have def __init__(self, bus=board.I2C()): ... and those libs will fail without it .. but ALSO they will construct board.I2C() whenever the lib is imported, which is not good. but I see that's not really what the discussion is about.

solar whale
#

๐Ÿ‘

thorny jay
#

Can we have a default pin for putting a NeoPixel... and a UF2 with colour indication like CP board?

slender iron
#

@onyx hinge those libraries need to be fixed

#

they should default to None and then have an if statement

onyx hinge
#

@slender iron agreed -- the one I know about was only because someone was fixing it...

thorny jay
#

Could be enhanced Pico with Power LED, NeoPixel and Reset button.

#

There could be a default Pico marking for CircuitPython usage.

onyx hinge
#

We could change the error message to say AttributeError: This board has no default I2C bus. Construct an I2C bus using busio.I2C.

thorny jay
#

I seems to remember that the new way of specifying I2C was also helping when you want to use a library use I2C and you also want to use it.

slender iron
#

brb

gloomy shuttle
thorny jay
#

Pico will be an entry point to CP for a lot of user... so you have to make it easy for those.

onyx hinge
#

(specifically, this means board.I2C has to be a property and I don't think that actually works)

thorny jay
#

User that will not find driver in the MP (I guess).

tulip sleet
#

it could throw NotImplementedError with a board-specific message

tidal kiln
#

probably same with any option

thorny jay
#

I want a super Pico with power LED, RGB LED, reset button, ... and Feather format!

crimson ferry
#

Pico is more like Saola... every pin available for anything

thorny jay
#

Are the library are still using that?

#

Can we catch an exception and use the other construct if it is not present.

onyx hinge
#
./libraries/drivers/crickit/adafruit_crickit.py-if "I2C" in dir(board):
./libraries/drivers/crickit/adafruit_crickit.py:    crickit = Crickit(Seesaw(board.I2C()))  # pylint: disable=invalid-name
thorny jay
#

There are no label on the Pico... or they are on the wrong side!

#

Or when you call board.I2C() it take random pin that could be I2C, different each time.

#

What about Pico on a bigger board, where some pin have choosen usage, like Pimoroni is doing... what about the Pi Zero Board Limor is doing?

slender iron
#

@thorny jay if it's soldered down they can have a separate board def

onyx hinge
#

we have cpx + crickit board def too, I don't know that it strictly has to be soldered down

solar whale
#

great idea!

onyx hinge
#

so a rp2040-zero could have a board def .. I guess? not sure.

thorny jay
#

I have test script for PioASM. ๐Ÿ™‚

crimson ferry
#

I'd love access to dev test scripts

solar whale
#

are thinking a new repo or within CP?

onyx hinge
#

tests/manual/audioio ? sure.

slender iron
#

in CP tests/manual/<module>

crimson ferry
#

plus the stuf that's not in shared-bindings

onyx hinge
#

๐Ÿƒโ€โ™‚๏ธ marathon session ๐Ÿƒ ๐Ÿƒโ€โ™€๏ธ

blissful pollen
#

i'll take the blame I finally had an in the weeds item ๐Ÿ™‚

manic glacierBOT
gilded cradle
#

Thanks

blissful pollen
#

Think reseting the pin direction and value to 0 may fix the neopixel problem I still was seeing

slender iron
manic glacierBOT
#

I crash my Cucumber when doing this. I had to do some I2C changes as the Cucumber has no pullups on its internal I2C bus (not great). Moving some of the constructor bits around seems to get rid of the crash but then nothing is found on doing a scan. I will keep looking. I am also wondering if espressif has put changes/fixes into the idf since the commit that we (CPY) use. I did try building wit version 4.2 of the idf, nothing really changed.

thorny jay
#

Bye.

manic glacierBOT
#

Closing this after discussion in the weekly CircuitPython meeting of 2021-02-08, timestamp 1:26:18. We decided that trying to ameliorate board designs that fail to label default pins is beyond our purview. We can document the problem in the FAQ section in the RPI Pico guide. If and when the board silkscreen is updated to designate default bus pins, we can reopen this.

uncut nexus
#

@slender iron - if someone was to be to bold as to attempt implementing pulsein using pio on the pico; would it be appropriate to implement common_hal_rp2pio_statemachine_read and, if so, is there any reason to use/not use DMA when doing so?

gloomy shuttle
#

Thanks. I agree with the outcome on the Pico busio conversation. It is unfortunate just because of the sheer number of people who may try CircuitPython projects because of the Pico and will likely run into issues with it. The FAQ should help.

solar whale
#

Have a great week ๐Ÿ‘‹

slender iron
#

@uncut nexus yup, I'd use DMA. coordinate with @onyx hinge on read. I'm not sure when he'll get to it

#

the PWM peripheral might be able to do everything we need

#

it can do some capture

uncut nexus
#

OK, thanks!

tulip sleet
#

@idle owl do you want me to write a FAQ for the Pico for the missing board. attributes?

#

or do you ahve something in mind?

idle owl
#

@tulip sleet Yes please. No, I added it to my list, but I didn't have any ideas for it. Can you also add another entry about MOSI and MISO being SPI_RX and SPI_TX?

tulip sleet
#

sure

idle owl
#

Thank you so much!

slender iron
#

ok, I'm off for a bit while I start the bbq for dinner and then have lunch. (making pulled pork)

tulip sleet
#

sounds great!

idle owl
#

Excellent choice of food.

tulip sleet
#

we have local bbq joint but we haven't ordered from them in a while

slender iron
#

๐Ÿ™‚

idle owl
#

@slender iron If you do not have meat claws, you will wish you did. https://thebbqbutler.com/collections/best-sellers/products/the-original-bear-paws-meat-claws-black

BBQ Butler

As featured on BBQ Pitmasters, Guy Fieriโ€™s Diners, Drive-Ins, and Dives, and Americaโ€™s Test Kitchen. Bear Paws have been named โ€œBest BBQ Toolโ€ by the National BBQ Association. BBQ Butlerโ€™s Bear Claw meat shredder is the answer to perfectly shredded meat without the mess and headache of knives and forks. Perfect for pulling pork and any meat. Eas...

tulip sleet
#

Ballard: A slight chance of rain and snow showers. Partly sunny, with a high near 43. Calm wind. Chance of precipitation is 20%.

#

sorry about the weather

slender iron
#

@idle owl i just use forks ๐Ÿ™‚

idle owl
#

@slender iron meat claws ftw.

slender iron
#

@tulip sleet better than weather later this week

tulip sleet
#

it is 27deg here now after snowing all day yesterday

slender iron
#

๐ŸŒจ๏ธ

manic glacierBOT
blissful pollen
#

@solar whale I just put in a new PR that may fix your problem as well. Seems to have solved mine at least

solar whale
#

Great! Just saw it and will try to test.

solar whale
#

@blissful pollen Yes! It seems to be working!

#

with the other devices attached!

manic glacierBOT
blissful pollen
#

awesome

tulip sleet
solar whale
#

I have both 4155 and 4160 in my build

blissful pollen
tulip sleet
#

so if you two approve, we'll merge those too

#

one or two, either

solar whale
#

Both look good to me.

blissful pollen
#

I do though I wrote one of them

tulip sleet
#

i will wait for the other one to build successfully

solar whale
#

Thanks -- Nice work @blissful pollen and @onyx hinge

stuck elbow
#

@slender iron sorry, I forgot to mention, I reopened the PR for https://github.com/adafruit/circuitpython/pull/3536 because that way of keeping time still gives me much nicer display (no flickering at all) and lets me not worry about long-running programs.

GitHub

The time.sleep() and time.monotonic() functions break the timer
interrupt on which PewPew10 display relies, so we can't use them
anymore. Instead I'm adding a time-keeping function ...

idle owl
blissful pollen
manic glacierBOT
idle owl
#

May I DM you?

blissful pollen
#

sure

manic glacierBOT
slender iron
#

@idle owl it'd be good to link to your guide from the cp.org download page for the pico too

idle owl
#

@slender iron Do we do that with other boards?

slender iron
#

some yes. they can have general links in the description

idle owl
#

Fair enough

manic glacierBOT
manic glacierBOT
#

Just so I'm clear. I double press reset on the Metro ESP32-S2 and then drag over the UF2 file I got from the "Artifacts" dropdown for Metro ESP32-S2 to the CIRCUITPY dir. The boot_out.txt shows:

Adafruit CircuitPython 6.2.0-beta.1-136-g5c129f813 on 2021-02-08; Adafruit Metro ESP32S2 with ESP32S2

My lib folder items are all from Feb 4 2021.
The app I'm testing is my full application that sends temp and humidity via miniMQTT and then deep sleeps for 60 sec. It also post it's loop count ...

manic glacierBOT
manic glacierBOT
#

@gc-elec Your main appears to be way behind ours, causing many commits. Could you merge from upstream, and perhaps submit a new PR that is cleaner in terms of commits?

Note that this cluttered commit history can also be a function of how you do git merges. You should merge adafruit/main into your feature branch and not the reverse. So, it matters that you start on your working branch before merging.

slender iron
#

@ionic elk do you need a socket break?

manic glacierBOT
manic glacierBOT
#

I have received new PIDs from Espressif for the various cucumber variants.

These should be used for the non-sensor R variants (R and RI)
0x80A0 | GRAVITECH CUCUMBER R ESP32S2 - Arduino
0x80A1 | GRAVITECH CUCUMBER R ESP32S2 - CircuitPython
0x80A2 | GRAVITECH CUCUMBER R ESP32S2 - UF2 Bootloader

These are for the non-sensor M variants (M and MI)
0x80A3 | GRAVITECH CUCUMBER M ESP32S2 - Arduino
0x80A4 | GRAVITECH CUCUMBER M ESP32S2 - CircuitPython
0x80A5 | GRAVITECH CUCUMBER M ESP32...

#

@tannewt [observed](https://github.com/adafruit/circuitpython/pull/4155#pullrequestreview-586038240}:

I think it'd be clearer if you replaced the original if statements with while loops. That way you'd load up the 4 or 8 entry FIFO and then move on. 32 seems arbitrary and I'm skeptical you'd ever hit that many due to the FIFO size.

Just in case I don't get to this during some upcoming PIO work, I wanted it filed in an issue instead of in the review comments of a closed PR!

slender iron
#

@sour river I just pushed a fix for 16 bit conversion

sour river
#

Ooh awesome! I'll try that out later, or maybe tomorrow. I did look around for a while to try to figure out why only half of the 8-bit samples were making it to the output, but I didn't find anything yet.

slender iron
#

it was missing *

#

so it was converting the wrong memory....

#

love how fresh eyes can find problems faster

sour river
#

oh no! I had a bug like that once. My friend and I were working on some embedded code to work with a radio module and we couldn't figure out why the output was garbled at the bit level... turned out he forgot to initialize a pointer, and the message was being passed through a buffer that happened to exist in IO registers ๐Ÿ˜ฌ so naturally some bits got masked. That was quite a fun one to find haha

slender iron
#

๐Ÿ˜„

#

when I was at google there was a gmail bug that marked accounts as spam and was due to a missing *

#

pointers are hard

sour river
#

haha yeah, they are. It's been a while since I worked with C too so reading all the audio code was pretty intense! but it's fun; I miss those embedded days

slender iron
#

๐Ÿ™‚ you can get your kicks in the CP source

#

it's pretty well laid out

#

audio and display are the weeds

sour river
#

haha if i do much more i may have to take a shot at the SWD interface. There's only so much you can do with print statements

slender iron
#

yup yup. I'm excited to have jlink support

sour river
#

But yeah, I just might! Circuitpython seems really fun, and I'm intrigued by the PIO stuff a lot

slender iron
#

๐Ÿ™‚

#

we're just scratching the surface I think

sour river
#

Oh I'd bet there's a lot that could be done with them! They're practically like little cores to themselves. I haven't read too much of the docs yet but I want to see how far they can be pushed. I have a few charlieplexing modules on the way and I'm going to see if I can get a module working that does all the strobing in PIO, if that's possible. Then maybe rotary encoders next.

slender iron
#

ya, rotaryio would be nice to have

sour river
#

yeah i saw there was a module for that, so that could be a good interface for it. I've never actually done anything with micropython or circuitpython before but i'm down to learn! I'm guessing on the other uC's rotaryio just sets up interrupts, right?

slender iron
#

ya, it uses an interrupt handler

#

I was thinking with pio we could atleast watch for pin changes and then interrupt

#

I did see one example go by that had 32 instructions I think but I'd rather not use a whole PIO of memory for it

sour river
#

yeah so that's the big limitation, right? the 4 PIO modules share a block of only 32 instructions? That is pretty constraining

slender iron
#

correct

#

most things I've used it for only use a few instructions though

#

neopixel is 4

#

it's pretty dense overall

sour river
#

4 instructions on a single PIO? neat

slender iron
#

ya, single state machine

sour river
#

my friend and i made a routine for driving those on MSP430 once. 100% cpu, clock perfect, all asm. It was fun but pretty tough to make it work. Getting all that on a programmable peripheral is awesome

slender iron
#

ya, 100%

sour river
#

in 4 words no less

tulip sleet
#

@onyx hinge You are right, it's driving CS high, but then why did it work ??

onyx hinge
#

I dunno, Limor seemed to indicate that not all cards needed it

tulip sleet
#

yes, I can pass the raw spi and cs. The original code created the new spi in the init routine, which was unnecessary

onyx hinge
#

if you did it right once it would persist until you power cycled the card even if you needed it

tulip sleet
#

i might be able to use an SPIDevice and still force it high inside the with. or just use a raw write, as you suggested.

onyx hinge
#

I have no idea whether toggling CS with no clock edges is with or against the letter of SPI SD cards

#

since you would get a toggle

tulip sleet
#

i didn't know about CS high, I completely glossed over that, because I wouldn't have expected that. Where is the spec?

onyx hinge
#

but you gotta expect those as a system initializes itself, it could have a pull or startup transient or whatever

tulip sleet
#

the card I have works on a power cycle without the "proper init, hmm, thanks, I will read them carefully.

#

Power ON or card insersion
After supply voltage reached above 2.2 volts, wait for one millisecond at least. Set SPI clock rate between 100 kHz and 400 kHz. Set DI and CS high and apply 74 or more clock pulses to SCLK. The card will enter its native operating mode and go ready to accept native command.

onyx hinge
#

Part1_Physical_Layer_Simplified_Specification_Ver8.00.pdf page 231

#

The host shall supply power to the card so that the voltage is reached to Vdd_min within 250ms and start to supply at least 74 SD clocks to the SD card with keeping CMD line to high. In case of SPI mode, CS shall be held to high during 74 clock cycles

#

๐Ÿ’ค

tulip sleet
#

night!

manic glacierBOT
idle wharf
#

Comment from someone who watched the Weekly meetings on YouTube most of the time. Its easy enough to skip ahead, but I'm sure it gets old to say the same thing over and over... But if you're going to do something... I think a theme song is needed. ๐ŸŽถ

manic glacierBOT
manic glacierBOT
manic glacierBOT
supple gale
#

Olimex has kindly provided USB PIDs for Circuitpython andTinyUF2 for their ESP32-S2-DevKit-Lipo.
This an Open Source board.
https://www.olimex.com/Products/IoT/ESP32-S2/ESP32-S2-DevKit-Lipo/open-source-hardware
https://github.com/OLIMEX/ESP32-S2-DevKit-LiPo


Sure, no problem. Our Olimex VID is "15BA".

For PID we assign these two :

"28DB" - ESP32-S2-DevKit-Lipo Circuitpython
"28DC" - ESP32-S2-DevKit-Lipo TinyUF2 bootloader

Best regards,
Lub/OLIMEX

I'll probably get a PR out for the TinyUF2 bootloader later today or tomorrow.

onyx hinge
#

@idle wharf I did not track the full progress of circup, but I recall that you were needing to query github for certain information. Did you raise the question of whether we can add the needed info to the bundle so that you have it locally instead? It would be nice if circup operated "offline" except to download the bundle itself.

manic glacierBOT
idle owl
manic glacierBOT
solar whale
#

With the recent changes to Requests, I may have run into an issue. I have a MagTag that fetches some data from a URL then I post the data to AIO. It WAS working until today -- now I can either do the data fetch via magtag.fetch or access AIO but if I try to do both, I get an "Out of Sockets" error. Anyone have have a clue what is going wrong?

mental nexus
#

Hereโ€™s the general query regarding documentation (Sphinx?): so weโ€™re designing this new design of classes for graphical widgets. Iโ€™m struggling to keep track of all the ideas of how it will be configured and realized that the โ€œread the docsโ€ pages is where we eventually need to go. So, why not generate the same kind of thing while weโ€™re still batting around ideas. So to the questions:

#
  1. Can we create โ€œdummyโ€ files of the class definitions with just all the documentation statements that describe the input parameters and three key functions? And then run Sphinx to generate the docs so we can discuss?
#
  1. Itโ€™s confusing to newbies like me when there is a whole bunch of nested classes. For example, a Widget is a subclass of Group. Group contains x,y parameters. When we show the parameters for โ€œWidgetโ€ in the docs, will it also automatically include and show all the other inherited parameters for Group? Or do you have to type them all into the documentation for the subclass Widget?
idle owl
mental nexus
#
  1. Itโ€™s confusing to newbies like me when there is a whole bunch of nested classes. For example, a Widget is a subclass of Group. Group contains x,y parameters. When we show the parameters for โ€œWidgetโ€ in the docs, will it also automatically include and show all the other inherited parameters for Group? Or do you have to type them all into the documentation for the subclass Widget?
#

Mainly just wondering if we can use the same tools for generating the docs, but in the development stage so we can communicate the definition more clearly and also do the documentation work at the same time.

idle owl
idle owl
mental nexus
#

Ok, so inheritance isnโ€™t captured. Ok thatโ€™s important to remember.

idle owl
#

If you have plans for much more thorough documentation, for example, than makes sense inline in the code, we could try to figure out rendering that, or, as we typically do, have you write a guide ๐Ÿ™‚

mental nexus
#

Right now mainly thinking about it as an easy way to document the different class organization proposals to make it easy to read, understand and give feedback and improvements.

idle owl
#

Ah hmm. For RTD to build, it needs to be merged, I believe. I'm not sure we can build docs out of a PR.

#

You can build locally, but then you'd have to add the files manually to the PR and that doesn't do anything close to what you're looking for.

#

I think the best you can do for multiple proposals of something like that is create draft PRs from different branches, and open the discussion on each one. Mention all of them in the comments for the others so they're linked in the thread.

#

Unless I'm misunderstanding your intention, which is likely.

tulip sleet
#

@idle owl I want to refer people to a Pico pinout diagram, but I don't see one in the basic guide. Should I add the colorful RPi one on the Overview page, or do you have other plans?

#

this is for the no board.I2C() etc FAQ

idle owl
#

@tulip sleet I did not have plans. I suppose the overview would work? Or we could create a pinouts page? Let me ask Limor what she wants.

tulip sleet
#

there is no Pinouts page

idle owl
#

@tulip sleet I'll create a pinouts page and you can add it there.

tulip sleet
#

tnx!

ionic elk
#

@slender iron I'm already getting a bit of a break with this I2C thing but I'm flexible to work on anything rn

idle owl
#

@tulip sleet Refresh. Page is created. Feel free to edit the short copy I added, then make the page live when you're done.

gloomy shuttle
# idle owl So since the library was cookiecuttered with our setup, once I set up Read the D...

This kind of goes to the question I raised earlier yesterday, that I think got lost in preparation for the meeting. The cookiecutter or learn guide about libraries doesn't take into account how to deal with packages/submodules in the documentation portion. I noticed that none of my submodules were showing up in the RTD so I looked at the how the PyPortal RTD handled it and noticed that none of the submodules for that were listed in it's RTD either. I started going through some of the adafruit libraries last night and created a couple PRs to add them and see if that was the right approach.

ionic elk
#

@solar whale how many sockets in total are you using? TLS sockets in SSLSocket were changed to use 2 sockets under the hood in order to accept connections, but Scott was noting they might be better off dynamically adding sockets only when they start being used as a server.

idle owl
solar whale
#

@ionic elk I think I found a workaround -- I was not using the magtag.push_to_io -- I may have been duplicating things.

mental nexus
ionic elk
#

@solar whale good to hear, let me know if you have further issues, the low socket count thing is an ongoing issue

idle owl
solar whale
#

@ionic elk Thanks -- all good now -- it's working again.

gloomy shuttle
uncut nexus
#

@onyx hinge - Scott mentioned you might be working on state machine reads for the RP2040 ; if so have you got anything I could use? If not, mind if I take a crack at it? I'm working on implementing pulsein using pio.

ionic elk
#

@slender iron also, you want to create this new test folder or should I?

mental nexus
crimson ferry
#

@solar whale there may still be some conditions in Requests that don't close the socket, happy to troubleshoot if you encounter it again

solar whale
#

Thanks! Iโ€™ll do more tests later today to see if I can break it again!

gloomy shuttle
# mental nexus How does this work if a superclass is in core CircuitPython (C-code), does that...

No, I don't know how you would deal with superclasses outside a library. When I was looking at this issue yesterday, I saw that PortalBase included the other submodules in the API portion, while the PyPortal did not. PyPortal is a subclass of PortalBase, but they are not linked in the docs, that I can tell.

PortalBase - https://circuitpython.readthedocs.io/projects/portalbase/en/latest/
PyPortal - https://circuitpython.readthedocs.io/projects/pyportal/en/latest/

onyx hinge
#

@uncut nexus I haven't started writing any code yet, thanks for asking

uncut nexus
#

@onyx hinge OK. I'll see what I can do with it then.

onyx hinge
#

My initial focus is gonna be - support for reading IN from PIO; support for looping output data; and understanding PIO assembler well enough to create code that will drive a 7-segment 4-digit display smoothly (or know why it won't work out). Dunno how far I'll get this week.

idle wharf
# onyx hinge <@!624005998696333331> I did not track the full progress of circup, but I recall...

I considered it, but it was pointed out, I could get it from github, and since the verify the bundle version and download the bundle occurs all the time time anyway, it seemed fine to have to go off-box to get the requirements.txt.
But both methods could work, but the implemented method didn't require me touching every library. ๐Ÿ˜‰
https://github.com/adafruit/circup/issues/50

onyx hinge
#

@idle wharf and API rate limits didn't turn out to be a big problem?

tulip sleet
#

@onyx hinge I can merge your "note about sharing SPI bus with SD cards" PR if you are ready. How do you feel about my PR from yesterday now? I pulled CS high in a simple way.

tidal kiln
#

@idle owl i think this may have been part of discussion in yesterday meeting? sry i didn't fully follow it, but - is there some plan to add pico specific info on setting up I2C / SPI to learn guide?

idle owl
#

Dan's working on it or did it.

onyx hinge
#

@tulip sleet I will check that PR again

#

but yes I think my PR is mergeable if the docs built

tidal kiln
#

wait. maybe it just appeared ๐Ÿ™‚

tulip sleet
#

@tidal kiln @idle owl just added a Pinouts page, which I just finished. I also added a FAQ pointing there. See whether you think it's clear.

onyx hinge
#

but it didn't build

tulip sleet
#

The Pinouts page is minimal. I had to do surgery on their diagram to make it less wide, otherwise it was too blurry when reduced. I stacked the color key in two rows at the bottom.

tulip sleet
idle wharf
# onyx hinge <@!624005998696333331> and API rate limits didn't turn out to be a big problem?

The API rate limit did become a problem in testing. I was using it to get the default branch. So, instead I used regex.
https://github.com/adafruit/circup/pull/72

idle wharf
tidal kiln
#

@tulip sleet thanks. looks really good. ok with you if i edit to add a specific example each for I2C / SPI / UART?

idle wharf
#

@onyx hinge I'm totally up to changing any of it though. I just did what made sense at the time.

tulip sleet
#

@tidal kiln sure, but you might mention that UART isn't implemented yet ๐Ÿ™‚

tidal kiln
#

ok. i'll just skip that for now. better to just not show it then.

tulip sleet
#

specifics for each is a v good idea

#

you can just add a red box warning for now. We can remove it in a week or two or whatever

tidal kiln
#

yep. i can see the next question being "but how do i do SPI?" etc.

#

@tulip sleet you've got the pinout page locked. ok if i take over?

tulip sleet
#

@tidal kiln go ahead; I have to go out for a car inspection and will be phone only for a while

tidal kiln
#

np. thanks.

idle wharf
#

@idle owl do you know why in the cookiecutter repo there are filename.rst.license files alongside the filename.rst files? Is. I am assuming they are used as an include.
If so, should the library author also be added to those copyrights?

idle owl
onyx hinge
#

@idle wharf I looked into doing this in circuitpython-build-tools and it looks doable. Hypothetically, the bundle would begin to include packages like ```unzip -l bundles/Adafruit_CircuitPython_Bundle-6.x-mpy-20210209.zip | sort | grep requirements | head -3
102 2021-02-09 11:50 Adafruit_CircuitPython_Bundle-6.x-mpy-20210209/requirements/adafruit_fancyled/requirements.txt
102 2021-02-09 11:50 Adafruit_CircuitPython_Bundle-6.x-mpy-20210209/requirements/adafruit_waveform/requirements.txt
111 2021-02-09 11:50 Adafruit_CircuitPython_Bundle-6.x-mpy-20210209/requirements/adafruit_azureiot/requirements.txt

slender iron
slender iron
idle wharf
slender iron
tidal kiln
slender iron
#

ok, grocery time for me

gloomy shuttle
#

@mental nexus it looks like there is a :show-inheritance: flag that can be set. When I tested it, it shows the name of the base class library. If the base class is within that library/module it will link to it. There are possibly ways to manually link to the docs for the base class outside of a given library.

idle owl
#

@gloomy shuttle Nice find!

gloomy shuttle
#
fossil gorge
fossil gorge
#

What I haven't tried yet, though, it whether it will follow down to the base-most class, or if it's just the parent.

#

Oh, actually, what I found was slightly different - I got :inherited-members:, which shows them inline

#

So if "B" inherits from "A", and "A" has a method "DoTheThing()", the RTD for "B" would show "DoTheThing()" as if it were a method in "B" (which it is.. ish).

tulip sleet
#

thanks!

tidal kiln
#

np. thanks for creating it.

idle owl
#

It looks right, but you'd know better than I would I think

tulip sleet
#

yes, that's needed now

idle owl
#

ok, right on. Thanks

ionic elk
#

@slender iron I can do another socket thing if you need it, might as well since I've been thinking about it

slender iron
#

fine with me if you are up for it. I think there was an issue that came up yesterday

#

the i2c bugs would be good to look at too

ionic elk
#

You mean the ESP32S2 I2C bugs

slender iron
#

ya

ionic elk
#

Sure

slender iron
#

thanks

jaunty juniper
#

I haven't tested it but issue #4152 looks to me like it could be fixed by what was merged yesterday

crimson ferry
#

all of the libraries that use sockets need to be exception-proofed too, to avoid socket leaks

manic glacierBOT
#

I have a hard time reproducing this but I get occasional drop outs for the REPL that are only recoverable after resetting the Pico.
Most of the times this would happen after a code change but also happened just while printing values to the console. It seems to have started to appear after I added the pwmout module but can't say for certain as I haven't extensively used the REPL either before adding that module.
The MSD is working fine after that and code changes are still being applied afte...

#

@tannewt - We are currently checking whether a PWM channel is in use and throwing an error if it is. That is why the reported error it hit when GPIOs 21 and 5 are both used - they share channel 2B. However, the datasheet says "The same PWM output can be selected on two GPIO pins; the same signal will appear on each GPIO.". So, should we just take out the check for channel re-use?