#circuitpython-dev

1 messages ยท Page 377 of 1

idle owl
#

@lone axle Any chance you could test the Community CoC PR on cookiecutter to make sure it builds properly with the appropriate CoC for both the "community" and "adafruit" choices? I know you and I talked about it, and you were pretty sure I did it properly, but I would appreciate an actual test before I merge that PR.

lone axle
idle owl
#

@lone axle That works. I'll make a note on the PR.

manic glacierBOT
#

I personally wanted events so I can tell when a key goes down and not have to maintain extra state myself. It's less useful for an HID gadget, where you are just copying over the up/down state to the report, but it is quite useful for a game or some stand-alone appliance. As @ladyada said:

being able to get events and also current key state is really valuable for UI and HID reports

#

Having it native is a higher bar than "nice-to-have" though. If we have a consistent current state API, then we can make a library to create events based on it for all implementations, not just native ones. A library would do the state tracking for you. One problem with a pure current state API is that it can miss presses. That's why gamepad latches presses and the current state API probably should as well.

How much code size is added by the event queue stuff? Moving it to a library woul...

stiff pelican
#

Are you able to delete the old uploiad from 2019? I think the current version numbering will never be newer than that old version number.

onyx hinge
#

However, by specifying an explicit epoch, the sort order can be changed appropriately, as all versions from a later epoch are sorted after versions from an earlier epoch:

2013.10
2014.04
1!1.0
1!1.1
1!2.0
lone axle
stiff pelican
onyx hinge
gilded cradle
#

Yep @fluid moss, part of the confusion was that the RGB bit was labeled BGR in arduino, which differs from the datasheet.

slender iron
#

@lone axle @stiff pelican @onyx hinge I've "yanked" the old release which makes it installable through pinning only

onyx hinge
#

Thanks @slender iron

lone axle
#

Thank you!

manic glacierBOT
#

My 2 cents, without having examined the code yet:

  1. Are we trying to reduce this API before merging, to avoid having to reduce it later and cut functionality? If so, what elements are in question?

I did originally intend to pare down the options, but if you are OK with keeping them, thatโ€™s fine with me too. I think we were approaching a consensus around https://github.com/adafruit/circuitpython/issues/1084#issuecomment-699491344.

  1. Related to the above, scanning the discussion,...
#

I was presented with multiple use cases. it was a goal to have all of them run quickly. For each case, there is a most convenient way to report and use the state of some keys. The reason I have provided multiple reporting methods natively is to make all these use cases nice and fast. Yes, I could choose one scanning mechanism, and layer others on top, in Python, but that would make the upper layers be slower.

slender iron
#

@tulip sleet want to chat about โ˜๏ธ?

tulip sleet
#

@slender iron Hi - I was cooking and eating. Sure.

slender iron
#

np

idle owl
#

@lone axle If that PR to cookiecutter works, please merge it after you've tested it. If it fails, obviously let me know and I'll deal with it tomorrow. Thanks again!

#

@lone axle Oh! I just saw you already commented.

#

I'll merge it. Thank you!

manic glacierBOT
#

Hi!!

Just to add another possible motivation / reason for WebREPL.

BIPES (https://bipes.net.br/) project relies on WebREPL, which is great for wireless interactive debugging, programming, uploading and downloading files and interacting with MicroPython shell. It would be great with CircuitPython also!

We have about 3000 users now, and many users reported flexibility and ease with BIPES + WebREPL, all using a web browser.

By the way, we already use BIPES + CircuitPython on ESP32-S...

simple atlas
#

Is there anyone here well versed in Micropython board development? I have a custom board I built about 7 years ago, and of course the version of MicroPython on it is way out of date. I've tried to update the BOARD files to the more or less latest spec, but I'm still running into problems when running make

#

This is what I'm seeing:

simple atlas
#

Figured it out

#

I was missing these four lines:

#

USB_VBUS,PA9
USB_ID,PA10
USB_DM,PA11
USB_DP,PA12

#

from the pins.csv file

manic glacierBOT
#

To support fully variable (not just 2 sizes), we can set aside some bits in type->flags as suggested. It would be nice if we could

  • allow builds that always make all type objects full size (binary size vs performance trade-off)
  • have some freedom to re-order fields, or even move them between the mandatory and optional parts of the type object (with optionalโ†’mandatory being easy and โ†’optional requiring more work)

Anyhow, I think the below design does this.

One critical part of t...

manic glacierBOT
#

Very cool, and good to know that clz can be resolved at compile time on const inputs. There's a significant win here for ROM so keen to investigate, and would be great to ensure that CPy and MPy take the same approach.

Not sure if useful, but another approach I had considered for fully variable is to add an indirection via an index table (i.e. all types would pay for a fixed N-byte table, but then only for the slots they use, where N ~= 12). Sketch below:

#define SLOT_MAKE_NEW (...
lone sandalBOT
manic glacierBOT
#

It could be easiest to decide on a small (say 5-10) set of allowed variations of mp_obj_type_t and then provide macros to initialise types. Eg:

// Only with print, make_new, and a locals dict.
MP_DEFINE_TYPE_V1(
    mp_type_simple,
    {& my_type_type },
    MP_QSTR_simple,
    simple_print,
    simple_make_new,
    (mp_obj_dict_t *)&simple_locals_dict,
);

// Lots but not all slots filled.
MP_DEFINE_TYPE_V4(
    mp_type_bytes,
    { &mp_type_type },
    MP_QSTR_bytes,...
manic glacierBOT
#

Firmware

Adafruit CircuitPython 7.0.0-alpha.3-97-g47a6b13d6 on 2021-06-22; Raspberry Pi Pico with rp2040

Code/REPL

import array
import board
import time
import pulseio
import pwmio

pwm = pwmio.PWMOut(board.GP0, frequency=38000, duty_cycle=2**15)
pulseOut = pulseio.PulseOut(pwm)

pulses = array.array('H', [1000,1000,1000,1000,1000])

while(True):
    print(".")
    pulseOut.send(pulses)
    time.sleep(5)

Behavior

Occasio...

manic glacierBOT
#

I thought about using len() again. The Python doc for len says "Return the length (the number of items) of an object. The argument may be a sequence (such as a string, bytes, tuple, list, or range) or a collection (such as a dictionary, set, or frozen set)." Since a scanner like Keys is not directly accessible via [] or get() or an iterable, I think using len() probably implies a little too much about its capabilities.

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
slender iron
#

thanks to @onyx hinge we're 13 commits behind micropython!

trim elm
#

Hi can anyone here check that the CircuitPython VSCode extension still works? I keep getting command not found when trying to run any commands and I'm seeing a few reviews stating the same, but this is my second time using VSCode so that could also be why

manic glacierBOT
manic glacierBOT
onyx hinge
#

@slender iron I think you're absolutely right to try to steer that discussion back towards what is an incremental improvement .. but I do want to find some syntax/macros that make further experimentation easier than my first round of experimentation..

#

"let's save 1.5kB now/real soon and maybe save more later" is a great plan

#

me, at my most productive. ๐Ÿคฃ

manic glacierBOT
#

Hi, I ended up here in this issue after noticing the file system size for the Arduino Nano RP2040 Connect is 1 MB rather than the expected 15 MB. Of course, this also means it's not possible to copy more that 1 MB to the file system so the remaining 14 MB go unused ๐Ÿ˜„

My guess is that the flash chip isn't correctly reporting its size.

I wrote a small pico-sdk application to see what the call to flash_do_cmd [here](https://github.com/adafruit/circuitpython/blob/6.3.0/ports/raspberryp...

onyx hinge
#
{}
QSTR updated
``` I've failed to figure out what's printing this `{}`, it's probably a debug-print that is better off removed.
tulip sleet
#

sometimes it includes some flash chip info in there instead of being empty

onyx hinge
#

ah so it is desirable that it appears

idle owl
#

Sekret {}.

onyx hinge
tulip sleet
#

i don't know if it's left over from some flash toml debugging or not. I think whether it's printed may depend on the port

#

@onyx hinge Feather RP2040 build, for example:

Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
{'sku': ['GD25Q64C']}
   text       data        bss        dec        hex    filename
    244          0          0        244         f4    build-adafruit_feather_rp2040/boot2.elf
QSTR updated
#

i don't think it shows up on any other port

onyx hinge
#

this was nrf

tulip sleet
#

right, nrf and samd, etc. all print {}

#

as opposed to {'sku': ['GD25Q64C']}

idle owl
#

@tulip sleet Do we have a plan for alpha.4? I have a no-rush library PR waiting on it, and simply wanted to know if we had some idea when that might be so I know when to remind myself.

tulip sleet
#

i think I will start on it after the keypad stuff is merged, which should be within a day or so. so maybe by the end of the week or early next week. It may be beta.0 instead of alpha.4

idle owl
#

Right on, I meant whatever next release. There was an indices flag that we fixed, but it missed alpha.3 by 10 hours apparently.

slender iron
#

@onyx hinge I think it's from cascadetoml

manic glacierBOT
#

@tannewt Ready for re-review.

  1. acf90fb: much renaming: num -> number, col -> column, etc.

  2. 7774b18: Overflow handling changes:
    a. .overflow is now read-only. It is set when an event arrives but the queue is full. Nothing else happens immediately; the extra event is just discarded.
    b. EventQueue.clear() will reset .overflow back to False, and also empties the queue. It does not affect the keypress history kept by the scanners Keys, KeyMatrix, or `ShiftRegiste...

slender iron
bronze shadow
#

I love it

slender iron
#

@sudden coral โ˜๏ธ

sudden coral
#

oooooooh that's awesome! also

Please note, the RP2040 chip does not currently have QMK support - this macropad is designed to be programmed in Arduino or CircuitPython! If QMK eventually does add RP2040 as a supported chipset (no ETA and no plans that we know of), we'll update this page.

some folks in the KMK Matrix/Discord have alluded to building hand-wired RP2040 boards successfully. if you could send @bronze shadow or I the pinout and diode orientation we could probably throw together a proper KMK board definition for this. rotary support (version... three? at least?) is WIP by a community member

slender iron
#

I can get you a schematic or do the def myself

manic glacierBOT
#

Reading through the docs in https://github.com/adafruit/circuitpython/pull/4891#issuecomment-862675187 and the example a comment or two below it, this looks nice to work with and it'd probably be pretty straightforward to port KMK over to this API and (1) rip out a bunch of messy DIY code I haven't really touched in years, and (2) get the C speed boost.

The only thing [our matrix implementation handles](https://github.com/KMKfw/kmk_firmware/blob/54f4644b5c8262618cff42e4ad7ac8f6b4eef6f7/kmk...

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Confirmed i2c.try_lock() is good now.

Try this code to see the exception crash:

import board
import time

time.sleep(5)

import adafruit_dotstar
# status_light = adafruit_dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1, brightness=0.1)

while True:
    print("", time.monotonic(), "\r", end="")
    time.sleep(1)

control-c within the loop works fine unless the DotStar line is uncommented

manic glacierBOT
manic glacierBOT
#

Has anyone taken a look at implementing promiscuous mode with Circuit Python + ESP32S2 ? I have tried a few approaches and no success.

Here is the sample code that I have been working on - after building using the make BOARD=unexpectedmaker_feathers2 command, the uf2 file is generated but freezes the chip when the esp_wifi_set_promiscuous(true) line is enabled.

Is there some other options that need to be set before setting esp_wifi_set_promiscuous ?

Similar to the AP Mode rec...

jaunty juniper
#

When making a PR I have the test CI error on Invalid or non-existent authentication information. See https://pypi.org/help/#invalid-auth for more information. during the stubs phase, we should probably guard against that.
The S3 upload uses [ -z "$AWS_ACCESS_KEY_ID" ] || do_stuff...
(should that be in your stubs-related PR 4907 @onyx hinge ? )

onyx hinge
#

@jaunty juniper quite possibly!

#
    - name: Upload stubs to PyPi
      if: github.event_name == 'push'
      env:
        TWINE_USERNAME: ${{ secrets.pypi_username }}
        TWINE_PASSWORD: ${{ secrets.pypi_password }}
      run: |
        if ! [ -z "$TWINE_PASSWORD" ]; then do
          echo "Uploading dev release to PyPi"
          twine upload circuitpython-stubs/dist/*
        fi
``` this?
jaunty juniper
#

I think so, though there might be a way to do that at the if: level with a github.event_name == 'push' && secrets.pypi_password != '' or something like that

#

(cleanly marking it unchecked in the jobs list)

slender iron
#

I did it with [ -z ] of a branch of mine

manic glacierBOT
#

The variable baud rate for commands vs display was found to have no affect on the reliably of the display so I stopped work on that aspect. The overall baud rate can still be controlled. I need to update the original issue with some more findings but still no solution. This PR would fix the issue but is more of a band aid then a long term solution.

onyx hinge
#

It would be nice if it was unchecked in the jobs list!

jaunty juniper
#

same goes for the S3 job in that regard (not that its if clause is not already complicated enough)

analog bridge
#

@slender iron adafruit/esp-idf submodule needs to be rebased due to the change in commit history between v4.2 and v4.3.
I have updated my fork microdev1/esp-idf to v4.3 but I don't have the permission to push directly to adafruit/esp-idf.

onyx hinge
#

I'm trying to read between the lines of the github documentation and find out what happens if you try to if an unset variable

manic glacierBOT
onyx hinge
#

maybe it's if: contains(secrets, 'pypi_password')

tulip sleet
analog bridge
onyx hinge
#

even if you have pypi secrets in your repo, the step probably shouldn't run if you're not in adfruit, since that user wouldn't have the correct secrets. ```- if: github.event_name == 'push'

  •  if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository_owner == 'adafruit'
    
tulip sleet
#

@slender iron how would you like to handle updating adafruit/esp-idf? should we make a new branch for 4.3?

manic glacierBOT
#

Fixes #4193 using the proposed simple solution.

When appending a layer (Group or TileGrid) to a displayio group, set the hidden_by_parent attribute to true if the group (the new "parent") is either hidden or hidden_by_parent. The *_set_hidden_by_parent functions propagate the value further down the tree as necessary.

This fixes in particular updating text labels while they are hidden, like you would with a pagination system, since it involves inserting one or more `TileG...

slender iron
tulip sleet
#

@analog bridge ^

analog bridge
#

@slender iron @tulip sleet I made the new branch circuitpython-v4.3... should I make it default?

tulip sleet
#

That's probably a good idea, otherwise it's kind of hidden. thanks!

analog bridge
#

folks with old cpy (i.e. prior to v4.3 update) will face build issues as they will get idf@v4.3 by default...
how about changing .gitmodules instead of making the v4.3 branch default.

[submodule "ports/esp32s2/esp-idf"]
    path = ports/esp32s2/esp-idf
    url = https://github.com/adafruit/esp-idf.git
    branch = circuitpython-v4.3
slender iron
#

sounds good

#

explicit is best

tulip sleet
#

does it matter if it's the default? Older builds just use a particular commit, not chosen by branch

#

this way is OK too

analog bridge
#

๐Ÿ‘

manic glacierBOT
#

We generally don't use the pico-sdk for board defines because we supported more out of the box. Both GigaDevice and Winbond flashes will report 0x21+ for capacity.

For this, I think we'll want a small Python script similar to https://github.com/adafruit/circuitpython/blob/main/tools/gen_nvm_devices.py that generates a header file that either allows for the current detection or a fixed flash size. Then,the detection code could be overridden.

silver tapir
#

A small clarification, since numerical dates are weird. When is circuitpython day this year? ( 8/6/2021)

#

Is that the 6th of August?

tulip sleet
silver tapir
#

Thanks.

tulip sleet
#

2021/8/6, to be unambiguous

silver tapir
#

I like more that format, but with dashes. So if you have a bunch of files and you "ls *" they show up nicely without extra work :).

tulip sleet
#

i agree, great for timestamps, with leading zeros

slender iron
#

@tulip sleet do you think bleak would have trouble with multiple services of the same uuid? I'm thinking ahead to cp serial

#

and whether I can use nordic uart service for it

tulip sleet
#

it had this trouble in the past, but I think they fixed it. I'll find the issue

slender iron
#

I think I'll do it verbatim except add a text descriptor to the characteristics to flag them for circuitpython

#

which should make them backwards compatible

tulip sleet
#

that sounds good

slender iron
#

๐Ÿ‘

tulip sleet
#

was fixed by using handles instead of uuids

slender iron
#

do they do that for services too?

#

looks like it came up later in the discussion

tulip sleet
#

i think so, I was going to put in a caveat, but then I wasn't sure

slender iron
#

nrf52833 is out of space...

tulip sleet
#

i can't remember that we ever got -flto working on nrf

slender iron
#

I can't either

#

for micro:bit we can at least disable usb

#

pca10100 build failed for me though

tulip sleet
#

turn off synthio?

slender iron
#

๐Ÿ‘

#

I should make sure it works first ๐Ÿ™‚

onyx hinge
#

@slender iron I finally noticed that the README.rst-stubs I had committed was not edited at all headdesk now I understand why you were not happy with what was there.

manic glacierBOT
#

Firmware

Adafruit CircuitPython 6.2.0 on 2021-04-05; Adafruit Metro M4 Express with samd51j19

Code/REPL

import board
import pwmio
import pulseio
import time
import countio

def send_signal(freq,dc):
pwm = pwmio.PWMOut(board.D5, frequency=freq)
pwm.duty_cycle = int(65535*dc)

print('Sending Signal')

def capture_cycles(p, num_cycles, timeout):
p.clear()
p.resume()
start = time.time()
while len(p) < num_cycles:
if time.time()...

manic glacierBOT
#

CircuitPython 6.3.0 on a Feather nRF52840 Express says:

>>> t
[2021, 6, 24, 19, 28, 37, 3, 175, -1]
>>> time.struct_time(t)
TypeError: time.struct_time() takes a 9-sequence
>>> len(t)
9
>>> time.struct_time(tuple(t))
struct_time(tm_year=2021, tm_mon=6, tm_mday=24, tm_hour=19, tm_min=28, tm_sec=37, tm_wday=3, tm_yday=175, tm_isdst=-1)

Standard Python 3.9.2 accepts constructing a struct_time from a list, and even CircuitPython's error message indicates a list is intended to...

manic glacierBOT
#

I tried forcing the pin low after the pulse completed, but that did not
work reliably. Only
a delay seemed to work. I was able to reproduce the issue with a C program
using the Pico SDK,
so I will open an issue with the SDK.

On Thu, Jun 24, 2021 at 12:41 PM Scott Shawcroft @.***>
wrote:

Does disabling PWM actually leave the pin in a know state or simply stop
the counter to it? Maybe we want to force reset the pin instead of waiting
a little time to hit the off phase of the pwm.
...

#

nRF CircuitPython boards will now provide the file transfer
service defined here: https://github.com/adafruit/Adafruit_CircuitPython_BLE_File_Transfer

USB capable boards will only advertise if previously bonded to a
device or if the reset button is pressed during the fast blue
flashes on start up. When pressed, the board will restart again but
the blue period will not flash.

Boards without USB will always advertise.

When previously bonded, the advertisement is private so that no
...

manic glacierBOT
manic glacierBOT
#

I believe the issue is because pulsein has no pre-defined protocol, so an arbitrary limit of 1 second was chosen to detect a runaway peripheral. If you chop up your capture cycles length into smaller chunks so that the 1 second limit isn't reached (a value of 500 worked for me) then you should be OK. I know this complicates your code, but there has to be some limit where pulsein can decide that "too much" data has come in.

manic glacierBOT
tulip sleet
#

@slender iron I will let you merge #4918, in case anything else has come up in the meantime.

slender iron
#

not that I know of. I was just restructuring it a bit

#

making a bluetooth subfolder

#

you could test it from another CP device if you wanted to

tulip sleet
#

let's go ahead and merge; I won't hold it up for me to test, since that's what you've been doing all this time.

manic glacierBOT
#

Looks good! I did not test it (I don't have the apps).

I think it would be nice in the long run to factor out the file transfer protocol code in shared/bluetooth.c into its own library (repo?) or at least its own file.

I just started on adding BLE serial support and I'm making a bluetooth subfolder similar to the usb one. I don't think it should be a separate repo because its build on top of common_hal APIs.

slender iron
#

I'm sure there are more bugs but there will be either way ๐Ÿ™‚

#

I may take a stab at a webbluetooth page for it

tulip sleet
#

right, i can always make an issue, and we'll get more testers on it sooner

slender iron
#

๐Ÿ‘

#

repl first though

tulip sleet
#

i was thinking about the protocol parsing and structs stuff, but maybe it's too intertwined with the common-hal-specific code anyway

slender iron
#

ya maybe

#

we can if we need it in arduino

tulip sleet
#

yeah, something like that, it's a protocol that stands independent of where it's used

manic glacierBOT
tulip sleet
#

the code is very clean; thanks for digging through all the new cases and fixing the broken edge cases in the old code

slender iron
#

np, I'm sure there are more

#

but we're continuing to improve things

manic glacierBOT
#

Firmware

Adafruit CircuitPython 7.0.0-alpha.3 on 2021-06-03; Raspberry Pi Pico with rp2040

Code/REPL

import usb_cdc
import binascii

while True:
    # get serial data
    while usb_cdc.data.in_waiting > 0:
        print(binascii.hexlify(usb_cdc.data.read(256)))

Behavior

The data printed by the program does not match what I send.

Description

Any data I try to receive appears damaged or partially overwrit...

manic glacierBOT
#

This has to be some kind of timing related problem. Here is my current code:

import usb_cdc
import binascii

expectedData = 560
bufferSize = 512

print("Buffer size: " + str(bufferSize))

while True:
    # get serial data
    while usb_cdc.data.in_waiting > 0:
        data = bytearray(expectedData)
        pos = 0

        while pos < expectedData:
            readNum = min(bufferSize, expectedData - pos)
            time.sleep(0.01)
            buffer = usb_cdc...
manic glacierBOT
manic glacierBOT
#

To work around this 1s limit now I've been doing as you suggested where I capture a smaller set of pulses then append that to a separate list, clear pulsein, resume pulsein, and continue that process until I capture all the data for the time period I want. Would it be possible to remove the 1s limit and just use the maxlen as the limiter to prevent peripheral runaway in future updates of pulseio? Would it also be possible to update the current documentation of pulseio to include the caveat th...

manic glacierBOT
manic glacierBOT
#

The problem with only using maxlen is if a peripheral just holds the line
high (i.e. a very long single pulse). In that
case the maxlen would never be hit, so we need some sort of timeout. The
current pulsein API doesn't include a
timeout value; although that might be a good idea to look at in the future.
I agree that a mention of the limit in the
documentation would be a good idea.

On Fri, Jun 25, 2021 at 8:32 AM rsolow @.***> wrote:

To work around this 1s limit now I've been doing...

manic glacierBOT
#

Seems to be fixed for my example, thanks!

However, I noticed another case, after first creating the objects. I'm thinking it's the same issue, as creating the PWMOut object starts the PWM, then creating the PulseOut object stops it.

Adafruit CircuitPython 7.0.0-alpha.3-418-g769805c9b on 2021-06-25; Raspberry Pi Pico with rp2040

import board
import pulseio
import pwmio

pwm = pwmio.PWMOut(board.GP0, frequency=38000, duty_cycle=2**15)
pulseOut = pulsei...
analog bridge
#

@slender iron #4195 is ready to merge... needs a review.

slender iron
#

๐Ÿ‘

#

I have it open in a tab ๐Ÿ™‚

#

but got distracted

analog bridge
#

nice! ๐Ÿ™‚

trim elm
#

Anyone on here that has run adabot locally before mind testing something for me? I would test it but I just got rate limited

manic glacierBOT
idle owl
#

I really want adafruit_pypixelbuf to be a drop-in replacement for _pixelbuf. This try/except import crap is frustrating. We did not think that through. There are very few Learn guides that trip on a search for "pypixelbuf". We should give some serious consideration to renaming it to adafruit_pixelbuf and renaming _pixelbuf to the same thing like adafruit_bus_device. The only time _pixelbuf is used is when I've written code that imports colorwheel() from it. So that's on me to figure out where I did that and update it if we decide to make such a change.

tulip sleet
idle owl
tulip sleet
#

i just mean for back-compatibility with 6.x

idle owl
#

Hmm. I suppose.

tulip sleet
#

we'd need to think the exact naming changes through, but i think you have a good point

idle owl
#

Filing an issue.

tulip sleet
#

we could just make adafruit_pypixelbuf or adafruit_pixelbuf be an alias for the native module _pixelbuf, so importing either imports the native module if it exists. Maybe that is the easiest thing to do. We could also rename it

idle owl
#

Hmm.

tulip sleet
#

i think... not sure what the priority is for a native module over an existing one. Like, if you had time.py, and imported it, which would it import?

idle owl
#

I don't know the technical options to make it happen, but as long as I can import one thing and have it work on all boards, I don't care how it's happening.

#

I don't know either.

manic glacierBOT
#

We included colorwheel() in both _pixelbuf and adafruit_pypixelbuf, but to use it across all CircuitPython-compatible, it requires a try/except import structure. This was something we did not consider from the beginning.

We should rename _pypixelbuf and adafruit_pypixelbuf to match so Pypixelbuf is a drop-in replacement for _pixelbuf.

@dhalbert has suggested another option involving making the latter an alias for the former, so a single import works for both, but we're ...

idle owl
#

@tulip sleet ^^ Issue filed.

#

This happening sooner rather than later would be ideal as I feel like we're in a pretty good place with there being only a few things needing to be updated if we make this change.

manic glacierBOT
ionic elk
#

@slender iron quick question, do you want the amount of filename storage memory the same across ports, or just runs?

#

NRF only has 256b of sleep memory, so it's kind of our hard cap if we want next-file length limits to be the same across all ports

#

if not I can give STM32 512b of filename storage and just cap NRF at 128

#

@tulip sleet you might have input on this too, maybe

stuck elbow
#

8.3 filenames should be enough for everyone

tulip sleet
#

the RAM sections are 4kB or 32kB depending on where they are.

dry dove
#

@slender iron how can I help? (BLE)

slender iron
#

@ionic elk runs, not ports

#

@dry dove the thing we need most now is apps to connect to the device

#

I think I have a reasonable handle on the nrf internals

#

(though esp ble support would be awesome)

dry dove
#

apps I can't do much. I can check the esp. when you say esp ble support, what do you mean more precisely?

slender iron
#

implement _bleio based on nimble in esp-idf (I think)

#

ideally we'd get ble-only CP on ESP32s

tulip sleet
dry dove
#

cool lots to learn, I don't know _bleio and my esp32 knowledge is fairly meh. I will check back in a couple of days (:

slender iron
#

thanks!

manic glacierBOT
manic glacierBOT
lone sandalBOT
manic glacierBOT
manic glacierBOT
#

Great, thank you. I was in fact thinking of having a go at it this weekend, but youโ€™re so much faster than I that you better just go ahead. I first want to take a look at what you did in #3454 and test it, so by the time I get to it youโ€™re probably done.

Is it clear what my planned change regarding REPL runs was? I donโ€™t recall the exact code change off the top of my head, but it was about removing the special case with MP_OBJ_SENTINEL.

manic glacierBOT
#

I just clones a fresh copy from the repository after the update of the esp-idf.
I did the usual

./install.sh
. ./esport.sh

then tried to build the merto_esp32s2 and the build stopped without completing. [ It stopped with ````
658/658] Generating ld/esp32s2.project.ld

Has something changed in the process or did I miss a step.

Here is the log

jerryneedell@jerryneedell-ubuntu-macmini:~/projects/circuitpython/ports/esp32s2$ make BOARD=adafruit_metro_esp32s2 clean
...

manic glacierBOT
neat current
#

I think this is the right place to post this, so if not please let me know. I have a funhouse connected to a relay for a lamp and a strip of neopixels, and when the PIR senses movement it causes the relay to turn on, turning on the lamp, the neopixel strip to turn off (it acts sort of as a night light when the lamp is off) and then there is a countdown on the display to say how long until the light turns off if there is no PIR input. Simple issue with the display ... it seems to be getting cluttered with stray pixels within only a few changes of the labels. The only way I've found to get rid of them is to reboot the funhouse, but then they just come right back. Is there any code to just refresh the screen from time to time?

#

My Funhouse, showing the issue of the stray pixels cluttering the screen.

solar whale
neat current
#

Maybe I'm a bit rusty with GitHub ... but how do I apply this fix?

solar whale
#

Are you set up to build CIrcuitPython locally?

neat current
#

Nope. Using the Funhouse from the Adabox is my very first dive into Circuit Python, and I have not gotten that advanced with it yet.

#

What do I need to build the library files?

solar whale
#

It's a "process" - you first have to configure your system to build CircuitPython -- see https://learn.adafruit.com/building-circuitpython once you can build it locally -- you can implement the PR by doing git fetch origin pull/4793/head:pr_4973 git checkout pr_4973 then rebuild -- or you can just wait for the PR to be resolved and merged ๐Ÿ˜‰

neat current
#

Thanks for the help. Looks like I have some reading to do

solar whale
#

Since it is a rather simple change you could just edit the source code locally and rebuild rather than fetching the PR.

storm minnow
#

As someone who started recently with CP, and within a week wanted to do things that required building it myself, I can confirm that the guides make building really easy!

manic glacierBOT
#

I tried this as well. I first did a git pull on my clone of adafruit/circuitpython. I got some errors at the end of that:

Fetching submodule ports/esp32s2/esp-idf/components/mqtt/esp-mqtt
From https://github.com/espressif/esp-mqtt
   2b20b51..f10321a  master     -> origin/master
Fetching submodule ports/esp32s2/esp-idf/components/tinyusb/tinyusb
From https://github.com/espressif/tinyusb
 * [new branch]        esp-based_on_334e95f   -> origin/esp-based_on_334e95f
 * [new branch...
manic glacierBOT
#

Hmm -- I did a complete reinstall and am getting the same failure.
If I run it without the -j8 I get an error message

jerryneedell@jerryneedell-ubuntu-macmini:~/projects/circuitpython/ports/esp32s2$ make BOARD=adafruit_metro_esp32s2 clean
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
rm -rf build-adafruit_metro_esp32s2 
jerryneedell@jerryneedell-ubuntu-macmini:~/projects/circuitpython/ports/esp32s2$ make BOARD=adafruit_metro_e...
#
-- Found PythonInterp: /home/jerryneedell/.espressif/python_env/idf4.3_py3.8_env/bin/python (found version "2.7.18") 

That explains the Python error. If you do this after the source export.sh, what do you see?

halbert@tuna:~/repos/adafruit/circuitpython/ports/esp32s2$ which python
/home/halbert/.espressif/python_env/idf4.3_py3.8_env/bin/python
halbert@tuna:~/repos/adafruit/circuitpython/ports/esp32s2$ python --version
Python 3.8.5
tulip sleet
#

@solar whale On my system:

halbert@tuna:~/.espressif/python_env/idf4.3_py3.8_env/bin$ ls -l python
lrwxrwxrwx 1 halbert halbert 15 Jun 26 10:02 python -> /usr/bin/python

So /usr/bin/python on your system is pointing to python2. I would suggest doing sudo apt install python-is-python3

#

Normally there is no python on ubuntu, to prevent this kind of version problem. Unfortunately the esp-idf expects there to be a plain python

#

somehow yours got pointed to python 2.7

manic glacierBOT
#

On my system:

halbert@tuna:~/.espressif/python_env/idf4.3_py3.8_env/bin$ ls -l python
lrwxrwxrwx 1 halbert halbert 15 Jun 26 10:02 python -> /usr/bin/python

So /usr/bin/python on your system is pointing to python2. I would suggest doing sudo apt install python-is-python3.

Normally there is no python on ubuntu, to prevent this kind of version problem. Unfortunately the esp-idf expects there to be a plain python.

Somehow yours got pointed to python 2.7

solar whale
#

@tulip sleet Thanks -- not sure what happened, but nice to have it fixed....

neat current
manic glacierBOT
#

Great, thank you. I was in fact thinking of having a go at it this weekend, but youโ€™re so much faster than I that you better just go ahead. I first want to take a look at what you did in #3454 and test it, so by the time I get to it youโ€™re probably done.

I really didn't have to do that much to #3454, it was mostly just checking that the merge didn't break anything, and replacing those gotos with a loop skip. It took longer to just grok how the code needed to maneuver around deep sleep ...

lone sandalBOT
orchid basinBOT
orchid basinBOT
idle wharf
#

I'm going to review\test circup PRs that have been waiting to merge. ...

orchid basinBOT
idle wharf
onyx hinge
#

did the unique ID of nrf boards in the USB descriptor change on purpose on 7.x vs 6.3 @tulip sleet ? /dev/serial/by-id/usb-Adafruit_Industries_LLC_Feather_nRF52840_Express_277393FAED062097-if00 vs /dev/serial/by-id/usb-Adafruit_Industries_LLC_Feather_nRF52840_Express_723739AFDE600279-if00

#

notice how the pairs of hex digits are swapped

manic glacierBOT
#

Closes: #4917 -- alternative to #4930.

I suspect this is the leaner alternative. The enhancement to mp_obj_get_array should be considered for upstreaming.

testing performed (nrf52840):

>>> t = time.struct_time(1,2,3,4,5,6,7,8,9)
>>> time.struct_time(t)
struct_time(tm_year=1, tm_mon=2, tm_mday=3, tm_hour=4, tm_min=5, tm_sec=6, tm_wday=7, tm_yday=8, tm_isdst=9)
>>> time.struct_time(tuple(t))
struct_time(tm_year=1, tm_mon=2, tm_mday=3, tm_hour=4, tm_min=5, tm_sec=6, tm_wda...
tulip sleet
tulip sleet
#

it might still be in the wrong order, but I think at least the nibbles are in the correct order now

manic glacierBOT
#

I'd say we could use one more of the following:

  1. CIRCUITPY eraser - the CircuitPython build system knows the board configurations so that's why I based this on CPy. A "board database" would be nice in the long run, but it's not holding up progress. This requires only one build per board because it is not translation-dependent.

Is there a how-to for this yet? I think anything that can be installed should have an uninstaller
We have a Metro M0 board that we cannot get to load an ...

#

Hi, I'm seeing the same hang reported in an earlier comment - I'm reading from the mic and then playing audio in a loop. I'm on v6.3. Is this a known issue still? Can I read from the mic and play audio in a different way to work around this?

Also not sure if I should open a new ticket for this..

# Restrict value to be between floor and ceiling.
def constrain(value, floor, ceiling):
    return max(fl...
manic glacierBOT
manic glacierBOT
#

I have tested the new version and it appears to work fine in my game console menu use case. :+1:

Some code review notes:

Your goto replacement brings some changes in behavior, but I believe they are inconsequential:

  • In the case of a reload-on-success, your version prints โ€œCode done running.โ€, mine didnโ€™t. Arguable which is better.
  • If result.return_code & PYEXEC_FORCED_EXIT, the new behavior is wrong. However, as far as I can see, that never happens (PYEXEC_FORCED_EXIT is o...
onyx hinge
#

@tulip sleet thanks, if it was deliberate that's good enough for me!

tulip sleet
#

do you have a non-CircuitPython program that also generates it? I'd like to make it consistent with something

onyx hinge
#

it's mildly inconvenient for some automatic script of mine when crossing the boundary, but so be it.

manic glacierBOT
#

Firmware

Adafruit CircuitPython 7.0.0-alpha.3-433-g5a4a80336 on 2021-06-25; Raspberry Pi Pico with rp2040

Code/REPL

import board
import pwmio
import pulseio
import time

pwmOut = pwmio.PWMOut(board.GP0, frequency=5000, duty_cycle=0x8000)
pulsesIn = pulseio.PulseIn(board.GP1, maxlen=100)
#GP0 and GP1 are connected by a resistor

results = []
while True:
    pulsesIn.clear()
    for i in range(20):
        while len(pulsesIn) == 0:
     ...
noble mango
#

Deep Dive w/Scott: BLE Privacy #adafruit
JohnPark tannewt

My point is 3rd paragraph down the top is my background.
Hi John and Scott. I enjoy both shows. I am by training software engineer but a jack of all tech. I gather requirements design code deploy support and maintain many times for many types of needs on many hardware platforms from mainframes to midrange to Server farms to desktop in the IBM and Microsoft world. Networks from the old IBM token ring to todays microwa. Locally and globally needed solutions.. I learned for example power in brazil is shut off 2 hours a day at X time. Probably not today anymore.
That said I always loved electronics and electricity but self taught. I started getting into embedded hardware programming primarily because of healthkits, sparkfun but mainly Adafruit. Those in tech that have had many projects and hats know how hard of job what ladayada has successfully accomplishedโ€ฆ Taking ART and Tech people and allowing them to enter the mystic world of digital circuits โ€ฆ I donโ€™t think people really know how hard it was to do what she has done to this point with Adafruit!! Its amazing. For example I see she wrote a C library for the new macro keyboard to import by python to make it faster.. I love that.. She filled a need and showed how to use python the best way!!!
So I was watching both you john and scott talk about true multitasking. For years multithreading programming could be the end of ones JOB so easily ๐Ÿ˜Š But along thread programming. Ladyada introduced the Adafruit ISO1540 Bidirectional I2C Isolator - STEMMA QT / Qwiic PRODUCT ID: 4903 .
The main reason I purchased some of them was to play around with modularity and pass state change information back and forth to get around single cpuโ€™s Even though the SAMD51 is plenty fast for doing most things. Yes I2C isnโ€™t my love protocol like spi but it works for the concept of taking a circuit that does a feature and add it to another circuit that needs itโ€ฆ think of feathers!!!
But now the RP2040 PIO has raised some interesting circuit design possibilities and questions. I havenโ€™t even touched PIO or even the RP2040. I like the SAMD51 and teensy 4.1.
So I just wrote this to through my 2 cents in the talk about multitasking.. No my way wont work for many of your customers but it could intro duce the concept of real multitasking and asynchronous programming..
By the way assembly language is my favorite language but not practical for these now a days speedy change needs. But I am diving into assembly again with the ARM chips. I wrote compilers and pc games video controllers with different versions of assembly codeโ€ฆ
Thank you
Bye

manic glacierBOT
manic glacierBOT
#

This is present in 6.3.0 and 7.0.0. I didn't test earlier versions yet. bytes(1,2,3) should raise an error, but it doesn't.

>>> bytes(1,2,3)
b'\x00'
>>> bytes((1,2,3))
b'\x01\x02\x03'

Same is true for bytearray. bytes() does not take the contents as a variable number of arguments. It needs a sequence as the first arg.
CPython:

>>> bytes(1,2,3)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: bytes() argument 2 must be str, not int

M...

manic glacierBOT
#

This is more complicated than it first appears:

>>> bytearray(1,2,3)
bytearray(b'\x00')
>>> bytearray(1,2,3,4)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: function expected at most 3 arguments, got 4
>>> bytes(1,2,3,4)
b'\x00'

bytearray and bytes are treated differently.

I think the reason the length check for bytes() is not done is due to #2220. We'll need to do the check without undoing that fix.

ornate breach
#

Okay, so small dilemma that i'm not sure what's happening

#

i'm working on a RP2040 design and it enumerates over USB just fine, but if i try to use the raspberry pi Pico to test (it has the same flash chip) it just disappears

#

it'll come back if i hit reset once as the default RP2040 boot loader

tulip sleet
#

"it just disappears": is it your new design or the RPi Pico?

ornate breach
#

my new design

#

i killed my Pico a while back hehe...

#

anyway, i figured the Pico uf2 should have worked having the same flash chip and whatnot. maybe i'm wrong

tulip sleet
#

so did you add your design as another board in the pico-sdk, and compile as that board? if there is any difference in the design then it would be in the board definition files

ornate breach
#

aside from a reset button, it's generally the same. i'm not doing anything special like reassigning the boot button as a user button or anything

#

pins numbers match GPIO numbers

#

it uses the same SPI NOR Flash that the pico uses

tulip sleet
#

all i could say then is to proofread your design and also if you have built multiple samples, see if they all act the same way, or see if it's just a soldering problem on one board

#

@ornate breach we had some trouble on our boards with the clock crystal capacitance being slightly higher and not matched as well to the crystal caps as they could be. This caused the xtal oscillator to take much longer to start. So I added a longer delay in the xosc initalization. See https://github.com/raspberrypi/pico-sdk/pull/457

#

if you are not using the identical crystal and caps, then that might be an issue. Because of the way the bootloader starts up, this does not prevent the bootloader from working, but can cause application programs not to work

manic glacierBOT
#
  • At soft reset, always reset the monotonic epoch. This means that a "fresh" session will not have the accuracy problems that result when time.monotonic() becomes a large float and the precision decreases

  • A new function reset_monotonic_epoch in supervisor can reset the epoch to now; Careful use within a program can prevent time.monotonic() from losing "too much" accuracy.

  • A new function ticks_ms in supervisor returns the possibly wrapped time since the epoc...

ornate breach
tulip sleet
#

try setting PICO_XOSC_STARTUP_DELAY_MULTIPLIER to something like 64 (default is 1)

ornate breach
#

capacitance was the same, using two 27pF capacitors. it didn't have 50ohm ESR, but 100ohm so i just adjusted the series resistor from 1k to 0.95k

tulip sleet
#

it's hard to scope it, because any probe on the xtal oscillator will add capacitance

ornate breach
#

i scoped failure boards before and it was fairly stable

#

but that doesn't necessarily tell me much

tulip sleet
#

it's that the startup time was much longer than a ms, and at the beginning it was running much higher than the spec'd frequency, so the clock to the SPI chip was too high and was also erratic

#

it's just one thing to try, but it's easy to try

ornate breach
#

i wish i had a digital logic analyzer and put some probe points on the SPI lines

#

how to I change the PICO_XOSC delay, is that in the pick sdk?

tulip sleet
#

yes, search for that symbol and change it somewhere. You could change the value temporairly where it's used in xosc.c so you don't have to hack the board definitions. Just to see if it makes a difference

ornate breach
#

okay, i'll give it a try

#

do i need to load the pico-sdk stuff before trying to load the circuit python uf2?

tulip sleet
#

it's just one thing to try; i have no idea how likely it is that's the problem

ornate breach
#

it might be that i'm just missing a step in the process

tulip sleet
#

you could try the qtpy uf2 if the pins work at all for you; i think it's the same flash chip

ornate breach
#

that one uses the 64mbit chip vs the 16mbit

tulip sleet
#

if you load CPy, it will erase whatever else is there

ornate breach
#

i did attempt to build the qtpy rp2040 but that threw some missing import errors

#
In file included from ../../py/obj.h:33,
                 from ../../py/mpstate.h:35,
                 from ../../py/runtime.h:31,
                 from ../../extmod/ulab/code/ndarray_operators.c:3:
../../py/qstr.h:42:14: fatal error: genhdr/qstrdefs.enum.h: No such file or directory
   42 |     #include "genhdr/qstrdefs.enum.h"
      |              ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
tulip sleet
#

you could try the blink program from the pico-sdk. If you haven't use it before, then you can study up on how to build an example program. If you don't have any other working RP2040 boards, then of course get another Pico

#

make sure you start from a clean build

ornate breach
#

same missing import error

tulip sleet
#

what is your build command line?

ornate breach
#

macOSX terminal, using make clean BOARD=adafruit_qtpy_rp2040

tulip sleet
#

could you upload the whole output of a failed run here, use the + on the left to upload a file

ornate breach
tulip sleet
#

it should not throw any error on make clean. It should just do the rm -rf build-adafruit_qtpy_rp2040

ornate breach
#

i'm recloning and trying again

#

maybe macOS is being weird

tulip sleet
#

what does arm-none-eabi-gcc --version print?

ornate breach
#

fairly certain i bumped it to 10 a while ago

#

the last thing i build was a 6.3 uf2 for a samd21

tulip sleet
#

trust, but verify

#

(which I have always found to be a bit nonsensical)

ornate breach
#

ah it's 9.3 still..

#

which is strange

tulip sleet
#

i'm surprised that causes that error, i would have not expected make clean to fail in any situation, since it doesn't really do anything except rm -rf

manic glacierBOT
tulip sleet
#
clean:
    $(RM) -rf $(BUILD) $(CLEAN_EXTRA)
.PHONY: clean
ornate breach
#

i recloned and now this is the output if i try to build the Pico sh o/autogen_display_resources.o build-raspberry_pi_pico/autogen_display_resources.c Traceback (most recent call last): File "gen_stage2.py", line 2, in <module> import cascadetoml ModuleNotFoundError: No module named 'cascadetoml' make: *** [build-raspberry_pi_pico/stage2.c] Error 1

#

same error building the qtpy rp2040

ornate breach
#

Did that before I built

#

Iโ€™ll do it again after my Mac finishes updating

manic glacierBOT
ornate breach
#

another interesting thing is on Windows the device shows no drivers available for the RP2040..

#

on windows as well, whenever i drag the uf2 over to the device, it just restarts and doesn't load circuitpython. just brings back of theRPI-RP2

#

Checking to make sure the flash chip has all good joints on the pins and will attempt things again. Downside if not getting a stencil for this

ornate breach
#

Maybe I messed something up, ๐Ÿคทโ€โ™‚๏ธ

manic glacierBOT
jaunty juniper
#

@idle wharf while there's no PR on circup, I was thinking we could move it from master to main, and to the circuitpython orga if that's validated

idle wharf
#

lol

#

We need someone with Admin rights to the repo.

jaunty juniper
#

๐Ÿ‘

idle wharf
idle wharf
#

Is there a Weekly Meeting doc for 28 June yet? I only see the 21 June doc pinned up top

onyx hinge
#

@idle wharf thanks, I will rectify that shortly

#

@idle wharf check the pinned messages again, it should be there now

manic glacierBOT
#

As discussed in #3410, this is a micropython-compatible (though differently named) function that allows creation of useful time and deadline functions in pure python.

Closes: #3410

An alternative to #4935 which only adds the wrapped ticks and doesn't change the monotonic reference time.

supervisor.ticks_ms() โ†’ int

Return the time in milliseconds since an unspecified reference point, wrapping after 2**29ms.

The value is initialized so that the first overflow occurs abou...

manic glacierBOT
manic glacierBOT
#

Firmware

Adafruit CircuitPython 7.0.0-alpha.3-433-g5a4a80336 on 2021-06-25; Raspberry Pi Pico with rp2040

Code/REPL

import array
import board
import time
import pulseio
import pwmio

pwm = pwmio.PWMOut(board.GP0, frequency=38000, duty_cycle=2**15)
pulseOut = pulseio.PulseOut(pwm)

pulses = array.array('H', [1000,1000,1000,2000,1,1000])

while(True):
    print(".")
    pulseOut.send(pulses)
    time.sleep(5)

Behavior

The ...

manic glacierBOT
#

I wonder, can you use memoryview and slices to work around this?

Can you create two Array with the same backing buffer? Though if you can, that would risk making really hard-to-trace bugs if you accidentally trigger a resizing operation.

Passing something that's not an Array, or is an Array with the wrong typecode, throws TypeError: Array must contain halfwords (type 'H'). I could investigate what it's checking exactly and whether there's a reasonable way to fool it.

manic glacierBOT
manic glacierBOT
manic glacierBOT
trim elm
turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Region

us-west

Channel Categories

8

Text Channels

58

Voice Channels

6

Members

29727

Roles

35

tulip sleet
#

@onyx hinge do you have a few minutes for a short audio or video chat re RP2040 audiopwmio? I am trying to debug it and had some random questions

idle owl
#

<@&356864093652516868> Hello! CircuitPython Weekly meeting is in a bit over 2 hours. If you'd like to participate (whether or not you're attending!) please add your Hug Reports and Status Updates to the notes document. If you're attending and participating, we'll call on you to read your updates. If you're text-only or missing the meeting, we'll read them off for you. Notes doc: https://docs.google.com/document/d/16nG56rv4MQlL4aoAd1B1IGLTNUuWtWuGYIobBSX9Vag/edit Hope to chat with you all soon!

onyx hinge
#

@tulip sleet I missed your question earlier .. would it work for me to show up 15 minutes early for the whereby meeting?

tulip sleet
onyx hinge
#

I'll grab something real quick then hop on whereby when I'm ready @tulip sleet

tulip sleet
#

i still have to eat, so I'll be there around 15 mins before

onyx hinge
#

OK, I'm around now

#

but take your time

slender iron
#

thanks @trim elm

trim elm
#

np

idle owl
onyx hinge
#

@idle owl it should not be in pypi. what is the correct thing to do? (whatever it is will apply to ov2460 too)

idle owl
#

@onyx hinge Replace the text in setup.py with a specific text stating it should not be on PyPI.

#

And name it setup.py.disabled

onyx hinge
#

@idle owl if that PR is right I'll do another one against 2640

#

or whatever the other number is

#

oh I guess 2640 had the file already. yay me for getting it right half the time

idle owl
#

@onyx hinge Approved the PR. Merge when passing.

modern wing
#

๐Ÿ‘‹ Happily lurking.

supple dirge
#

lurking

blissful pollen
#

lurking today too

errant grail
#

quietly listening today

sterile bronze
#

lurking today

modern wing
#

doo-doooo.

turbid radish
#

@slender iron , I'm not lurking today for once

idle owl
#

@turbid radish Please add your updates to the notes doc! ๐Ÿ™‚

modern wing
#

How bad is it in Seattle this week?

#

......wow.

turbid radish
#

@idle owl ni - link?

tidal kiln
#

to calibrate....anything >80F = "hot" in seattle

idle owl
lone axle
#

๐ŸŒก๏ธ

onyx hinge
#

Next week's meeting is on July 6 due to the US holiday observed on July 5.

lone axle
modern wing
#

CircuitPython on a calculator? ....yep, it adds up.

lone axle
manic glacierBOT
#
  • In the case of a reload-on-success, your version prints โ€œCode done running.โ€, mine didnโ€™t. Arguable which is better.

This was intentional, I didn't want the code to restart without any text indicator that it did so.

  • If result.return_code & PYEXEC_FORCED_EXIT, the new behavior is wrong. However, as far as I can see, that never happens (PYEXEC_FORCED_EXIT is only used in the context of the REPL). So Iโ€™m not sure why these lines had been there to begin with.

I will double chec...

onyx hinge
#

@idle owl can you add the direct link to that guide page in the chat and/or notes document?

idle owl
onyx hinge
#

ah I found the Arduino guide and of course it doesn't have that page. no wonder.

manic glacierBOT
tulip sleet
#

correction: "IS turned off" ^^

slender iron
#

what platform?

onyx hinge
#

@slender iron live stream on friday right?

lone axle
solar whale
#

Cats are always cool ๐Ÿ˜‰

errant grail
#

up to 115-117F today

modern wing
#

.....115-117? oh yikes. ๐ŸŒก๏ธ

slender iron
onyx hinge
#

that's 47ยฐC for all of you people who use celsius

modern wing
#

And here I thought that 98F was hot in Northeastern PA

#

Per Google, the average Death Valley temperature in July is 116F.

slender iron
#

(there is an icepack in the towel)

jaunty juniper
#

oh circuitpython org bundle ! that's cool we can test adding another bundle to circup with that (and also add it by default)

solar whale
#

Baby sparrows in the "birdcam" birdhouse

modern wing
#

Not to be confused with The Palisades in NJ along the Hudson River, also known for steep rock formations ๐Ÿ™‚

lone axle
jaunty juniper
#

oh we had a couple of pigeon eggs in the attic, they are about to learn to fly

onyx hinge
#

willfully misparses @jaunty juniper and wonders how a pigeon egg can fly

jaunty juniper
#

additional steps omitted for brevity ๐Ÿ˜‰

onyx hinge
jaunty juniper
# lone axle Nice! I'm interested in looking into the project bundling process as well. Hopin...

the circup version that was just released supports the community bundle, via a static list of bundles in the code (a bundle being identified by the user/repo string), you can just add "circuitpython/CircuitPython_Org_Bundle" to BUNDLES_DEFAULT_LIST to test how circup fares with it. The Bundle class init pretty much encapsulates all the url/file paths assumptions about the bundle format (plus the clean_library_name function)

tidal kiln
#

my "ac" hack. mcp9600 tc with emc2101 controlled 12v pc fan ramping up based on temp. coded in cp. ๐Ÿ™‚

modern wing
#

@onyx hinge If you get the reflective fabric from ebay, let me know. I'm hesitant to get a few yards of it without knowing the seller has the right stuff.

idle owl
#

@modern wing I ordered mine on Ebay and so did Anne. We both ordered from different sellers. The stuff I got is definitely right.

modern wing
#

@idle owl Awesome, thanks so much for confirming that. I'm assuming from the links in the guide?

turbid radish
#

I got my MacroPad just now

idle owl
#

@modern wing I don't remember if it's from those links. Ping me after the meeting and I'll point you to the two sellers.

modern wing
#

....wait, there's only 24 hours in one day?

idle owl
#

Alpha if that's the case. Sooner is better.

onyx hinge
#

@idle owl also curious how much material you ended up using.

idle owl
#

@onyx hinge We ordered 6 yards. We haven't set it up yet, but we ordered "enough". The place that could get it here in time was 39in wide, so we'll probably double it up.

#

We have an idea of what we're doing and 6 will work for us.

modern wing
#

My plan is going to mount it on a rope/metal wire, sew the seams, put in some grommets....and make it essentially a curtain. I totally don't have the space for a rigid setup, nor for a permanent installation.

tidal kiln
#

co-locate it with stuff like hsv->rgb coverters?

errant grail
#

I'm thinking that colorwheel is a conversion utility that takes a "linear" input and produces RGB for a given spectrum of colors.

tidal kiln
#

^^ yes

errant grail
#

spectrum could also be called a palette.

onyx hinge
#

rainbowio

jaunty juniper
#

fancyLED would otherwise be a natural place for it

tidal kiln
#

simpleio?

jaunty juniper
#

I for one didn't know _pixelbuf.colorwheel existed, and I keep having to copy and paste a wheel() function or self-contained module every once in a while

errant grail
#

Another use of colorwheel is to create a bitmap palette list.

jaunty juniper
#
>>> _pixelbuf.colorwheel(22)
12403200
idle owl
#

I made notes for ensuring they work the same.

modern wing
#

Thanks everyone for another excellent meeting.

turbid radish
#

Thanks all

ember iris
#

Thanks!

gilded cradle
#

thansk everyone

manic glacierBOT
#

We discussed this in the CircuitPython Weekly and decided that rather than rename anything, we can make a colorwheel() native CircuitPython module with a matching Python library for instances where the module is not enabled for a particular board (in the event that this is an issue).

We also need to ensure that the native module and the Python version work the same (there was concern about what is returned, a tuple or an integer - it appears the current Python version is different from t...

tulip sleet
#

@idle owl I'm thinking:

  • fork or otherwise copy the repo for adafruit_pypixelbuf, rename it to adafruit_pixelbuf, and remove colorwheel(). Add the new adafruit_pixelbuf to the bundle. Change guide code and neopixel/dostar libraries to use adafruit_pixelbuf.
    Create a new adafruit_colorwheel Python library or whatever we want to call it. Implement adafruit_colorwheel natively in 7.0.0 as well. Also in 7.0.0, rename _pypixelbuf to adafruit_pixelbuf .
#

the advantage of the copy/rename is that it's like a new version that we can use immediately

idle owl
#

Then, what, archive adafruit_pypixelbuf? Or...?

tulip sleet
#

later, after 7.0.0 stable is out

idle owl
#

Ok, fair enough.

onyx hinge
#

you can change adafruit_pypixelbuf.py to read from adafruit_pixelbuf import *.

#

or slightly more complicated if wheel is out of adafruit_pixelbuf

idle owl
#

Oh hmm. Then you need both? But it's backward compatible?

tulip sleet
#

so it would be a shell of a library

idle owl
#

Well yeah colorwheel will break things. But that was expected.

onyx hinge
#

feel free to close that PR in pypixelbuf I just filed, it probably ends up being unneeded with the rest of this

idle owl
#

Ok.

tulip sleet
#

it only exists for backward compatibility and then we can drop it.

idle owl
#

Ok. I'm on board with this.

tulip sleet
#

I will paste my tentative recipe in that issue

idle owl
#

Sounds good. I think I follow anyway. I mean I follow the crux of it, not so much the technical aspect of it, but we'll get there.

manic glacierBOT
#

i"m thinking:

Fork or otherwise copy the repo for adafruit_pypixelbuf, rename it to adafruit_pixelbuf, and remove colorwheel(). Add the new adafruit_pixelbuf to the bundle. Change guide code and neopixel/dostar libraries to use adafruit_pixelbuf.
Create a new adafruit_colorwheel Python library or whatever we want to call it. Implement adafruit_colorwheel natively in 7.0.0 as well. Also in 7.0.0, rename _pypixelbuf to adafruit_pixelbuf .

@jepler notes we can change `ad...

onyx hinge
#

OK, afk! thanks again all, and have a great week

tidal kiln
#

@tulip sleet can CP do hidraw?

idle owl
#

@errant grail Disconnected you from the audio chat to avoid surprises.

tulip sleet
tidal kiln
#

@tulip sleet ok. thanks. i'll take that as no. it'd be for a guide project, so don't want to do anything too hacky.

tulip sleet
idle owl
#

I read that as hi-draw and wondered what that even was. I realise now I am reading it wrong.

stuck elbow
#

pronounced "hydra" ;-)

idle owl
stuck elbow
#

for all the precision you need to get computers do what you want, programmers sure do love ambiguity

idle owl
#

Agreed.

slender iron
#

Here is the notes document for Tuesday'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/1g_QB0qxg528hkBo45Li_ROzIdkxiCx5j8t3EeJMPIxk/edit?usp=sharing

manic glacierBOT
thorny jay
#

Sorry I missed the meeting and did not provide notes. It was my first non teleworking day, I am/was wasted by commuting. Nothing to say anyway except group hug and that I am in a retrogaming trip on PS Vita, and Pi4.

slender iron
steel granite
#

Hi everyone!

I have been trying to do a port for the SAML21, we have circuit python compiling alright but it isn't working, i have been trying to debug with cortex-M and visual studio code but have no luck finding the bug, we have already working a tiny USB port working (https://github.com/hathach/tinyusb/pull/895), we are using the same configuration on ASF4 for clocks and init them but it seems to be breaking when intializing the stack i think.

Does anybody here know how the ld constructor script works?

Does anybody have manage to debug circuit python with cortex debug?

tulip sleet
#

I wrote the ld constructor script. We debug with Segger J-Link

steel granite
#

i have a segger jlink plus, i have kind of debbuged with the GDB but when doing the steps in some time it gets like null pointer, so i was wondering if the ld script is working bad since it was intended for samd21 instead of saml21

manic glacierBOT
tulip sleet
# steel granite i have a segger jlink plus, i have kind of debbuged with the GDB but when doing ...

The script is fairly straightfoward; it just figures out where to put things in flash and RAM, depending on the size of various features like microcontroller.nvm. It is not very architecture dependent. Does the SAML21 have something different about how it does the ISR vector? I'd suggest turning off as many features as possible, and then trying for a minimal implementation. If you have compiled DEBUG=1, the null pointer location should be identified. If you set a breakpoint at main(), does it fail before it gets there?

steel granite
#

nope it is failing inside main()

tulip sleet
#

do you know which line it's failing on?

steel granite
#

im gonna debbug again to search it cause right now i dont remember, how do you use the segger jlink to debug? with gdb too?

tulip sleet
#

yes, compile with DEBUG=1, set a breakpoint at main(), and then start single stepping. Or you could set a breakpoint on reset_info_safe_mode() which is called whenever something bad happens, and examine the stack.

manic glacierBOT
tulip sleet
#

My typical pattern is:
Start gdbserver for the board

target extended-remote :2331
mon reset
load   # if needed
mon reset
# set breakpoints
c
#

are you using external flash?

steel granite
#

no im not using external memmory

tulip sleet
#

that is probably simpler for now

#

so you can just start with the above, let's see where you get

manic glacierBOT
tulip sleet
#

this is completely typical for a new port bring up

fathom violet
#

Hi @tulip sleet im doing the compiling stuff and debbuging

#

did you refer to the wait_for_safe_mode_reset() function inside main?

tulip sleet
#

no, reset_into_safe_mode() , which is in supervisor/shared/safe_mode.c

#

you can just say bre reset_into_safe_mode

#

HardFaultHandler in ports/atmel-samd/port.c calls it if there is a null pointer, etc.

fathom violet
#

this ' bre reset_into_safe_mode ' inside gdb client?

slender iron
#

one early to do is to verify your clocks by using PWMOut to send out a signal of a known frequency and then measure it with a logic analyzer or scope

manic glacierBOT
#

All other boards that HAD gamepad or gamepadshift seemed to already have keypad enabled.

Before I added keypad, pretty much all the SAMD21 CIRCUITPY_FULL_BUILD boards had gamepad, i.e. there was something like:

CIRCUITPY_GAMEPAD ?= $(CIRCUITPY_FULL_BUILD)

I had to set that to 0 for all SAMD21 to get the builds to fit. So if possible it would be good to put keypad back in the CIRCUITPY_FULL_BUILD

fathom violet
tulip sleet
manic glacierBOT
tulip sleet
#

that whole guide may be helpful. It has J-Link and openocd mixed so ignore the openocd stuff

fathom violet
#

i will put the breakpoint there

tulip sleet
manic glacierBOT
tulip sleet
#

when you hit the breakpoint, issue a bt so you can see the stack trace

manic glacierBOT
fathom violet
#

ok its not breaking there

tulip sleet
#

could you paste the error you see then?

fathom violet
#

shure one sec

#

it did not break

fathom violet
#

so i issue a Ctrl+c

#

after some Run and Ctrl+C i can see it does not move from the RTC function

#

why does circuit python uses RTC?

manic glacierBOT
tulip sleet
#

to keep calendar time; you can set it to the actual time if you know it. So maybe do another build with CIRCUITPY_RTC = 0,

manic glacierBOT
#

I'm suspicious that there's some odd issue, but don't worry about it for the doc purposes. You did what you had to do. I was just helping a user today who seemed to be getting the builtin module in one case and the Python module in another, depending on how the import of adafruit_bus_device was done inside several different libraries. https://forums.adafruit.com/viewtopic.php?f=60&t=180698. That may be related to the linking difficulty you saw, but I'm not sure why.

tulip sleet
manic glacierBOT
fathom violet
#

๐Ÿค”

tulip sleet
#

hmm, so are you saying it's looping in that interrupt handler? I don't remember if we enable the RTC all the time for other purposes. @steel granite mentioned a null pointer, but we're not seeing that right now

slender iron
#

RTC is always on

fathom violet
#

i think that nuller pointer error was fixed with the new ASF4 because later i was able to see it too

slender iron
#

since it powers monotonic

tulip sleet
#

ok, yes, the rtc is set up in ports/atmel-samd/supervisor/port.c, and perhaps there's something that must be done differently there. In fact, it has #ifdef SAMD21, so it's not doing anything for SAML21, I assume. There are many places where we check for SAMD21, so those places should be inspected for what you need to do for SAML21. Perhaps it's the same, so you could check for either.

fathom violet
#

ok

tulip sleet
#

sorry, I have to go to a mtg now! will check back in a couple of hours

fathom violet
#

dont worry

#

one last thing

#

quick

#

i put 3 breakpoints

slender iron
#

that looks ok

fathom violet
#

and its never getting into the 3rd breakpoint

#

the third breakpoint was at board_init(); and it never reaches it

onyx hinge
#

Then you could "step" (gdb command) into filesystem_init, or set breakpoints inside it instead.

fathom violet
#

Yes! thanks we are right there haha

fathom violet
onyx hinge
#

That's going to enter code that writes to the filesystem, which if I understand correctly is in the microcontroller's flash .. it could indicate a problem down in ports/atmel-samd/supervisor/internal_flash.h

fathom violet
#

we type next on that function and never stoped again

onyx hinge
#

or you could comment out the f_mkfs call and see whether writing to the flash is the only problem

#

you wouldn't get a CIRCUITPY drive but you might get a USB serial REPL

fathom violet
#

mmm ok ok

#

let me try it

onyx hinge
#

btw if flash code is wrong, problems could include erasing/writing the wrong block which would corrupt parts of the program firmware

fathom violet
#

well the flash code is the problem, and now i just realized the USB_init too haha

onyx hinge
#

sounds like you know where to concentrate your efforts then! That's great progress.

fathom violet
#

thanks!

manic glacierBOT
#

The messages given by standard Python when this constructor is used wrongly are varied:

TypeError: structseq() takes at most 2 arguments (5 given)
TypeError: time.struct_time() takes an at least 9-sequence (5-sequence given)
TypeError: constructor requires a sequence
TypeError: time.struct_time() takes an at most 11-sequence (14-sequence given)

In this case, I think it's worth considering that taking away one of those messages doesn't actually hurt error checking (incorrect c...

fathom violet
onyx hinge
#

That's another great step. I'd be thrilled to get that on my screen ๐Ÿ˜ I'm sure you'll figure out the flash problem too @fathom violet

fathom violet
#

well it jst worked one time haha

onyx hinge
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Firmware

Adafruit CircuitPython 6.3.0 on 2021-06-01; Teensy 4.0 with IMXRT1062DVJ6A

Code/REPL

import board, digitalio
led = digitalio.DigitalInOut(board.D13)
led.direction = digitalio.Direction.OUTPUT
led.value = True

Behavior

N/A

Description

Obviously the code runs fine, and turns on the on-board LED. However, I also have an LED wired up to pin D11, and when I switch D13 out for D11 in...

manic glacierBOT
manic glacierBOT
#

Firmware

Adafruit CircuitPython 7.0.0-alpha.3-452-g8a5a7457a on 2021-06-29; Raspberry Pi Pico with rp2040

Code/REPL

import board
import digitalio
import pulseio
import time

#GP0 to GP1; GP2 grounded

print("start")
digitalOut = digitalio.DigitalInOut(board.GP0)
digitalOut.direction = digitalio.Direction.OUTPUT
time.sleep(5)

print("creating PulseIns")
pulsesIn1 = pulseio.PulseIn(board.GP1, maxlen=20)
pulsesIn2 = pulseio.PulseIn(board....
manic glacierBOT
#

Firmware

Adafruit CircuitPython 7.0.0-alpha.3-452-g8a5a7457a on 2021-06-29; Raspberry Pi Pico with rp2040

Code/REPL

import board
import pwmio
import pulseio
import time

pwmOut = pwmio.PWMOut(board.GP0, frequency=10000, duty_cycle=6554)
pulsesIn = pulseio.PulseIn(board.GP1, maxlen=100)
#GP0 and GP1 are connected by a resistor

while True:
    pulsesIn.clear()
    while len(pulsesIn) < 20:
        pass
    for i in range(20):
        pr...
stuck elbow
#
FREEZE ../../frozen/circuitpython-stage/ugame10
Traceback (most recent call last):
  File "../../tools/gen_nvm_devices.py", line 2, in <module>
    import cascadetoml
ModuleNotFoundError: No module named 'cascadetoml'
make: *** [../../supervisor/supervisor.mk:63: build-ugame10/genhdr/devices.h] Error 1
#

what am I missing?

#

now I pip-installed cascadetoml, but I still get ValueError: Missing root .cascade.toml

jaunty juniper
#

maybe update submodules ?

stuck elbow
#

they are updated

#

also, pewpew_m4 compiled without problems

jaunty juniper
#

oh weird

stuck elbow
#

ah, it's because pewpew_m4 doesn't use a flash chip

#

oh well, I guess I won't do it before my vacation then, I will try again next week

jaunty juniper
#

the file it's looking for is data/nvm.toml/.cascade.toml, nvm.toml being a submodule

stuck elbow
#

hmm, git submodule update --init fixed it

#

thanks for the hint

solar whale
#

@tulip sleet FYI - regarding the issue I had recently with python2 vs python 3 on Ubuntu. It turns out that the problem was VirtualBox. I need it for a project I am doing and when you install it, it install python-is-python2 !! I kept installing python-is-python3 which uninstalls virtualbox6.1 -- All was fine but when I reinstalled Virtualbox6.1, it reinstalled python-is-python2 -- My workaround is to manually change the symlink in /usr/bin to point python to python3. Now I can build esp32s2 AND Virtualbox seems happy....

manic glacierBOT
tulip sleet
solar whale
#

Some googling indicated it is a known annoyance, but so far it seems OK with the symlink redirected. Python2 is available if it needs it.

tulip sleet
#

i have found that the free vmware works better than virtual box and is less idiosyncratic, but it is proprietary. On the other hand, Oracle is hardly a paragon of any kind of virtue

onyx hinge
#

I'm just realizing how many little pieces were set up beforehand to make the camera to displayio pipeline work .. bitmaps as memoryviews is a big one. Lucky(?) that I had happened to write that stuff in the recent past.

solar whale
#

I should give vmware a try... but mostly I should finish the project (for my former employer) and be done with it.

#

Or have them provide me a Windows computer....

stuck elbow
#

I like libvirt personally

solar whale
#

@stuck elbow not familiar will libvirt -- I'll look it up as well. Thanks.

stuck elbow
#

@solar whale it's the open source vittualization solution, it comes with a gui in the form of virt-manager, but you can also drive it entirely from the command line

solar whale
#

I'll have to do some reading. It is not clear how I can use that for running the applications I need, but it looks intriguing.

hollow token
#

libvirt generally uses KVM as the hypervisor

#

virt-manager is a GUI and installing virt-manager (its package name is just virt-manager) will install libvirt

#

libvirt comes from Red Hat

#

since you're on linux, its a million times easier to use and manage than virtualbox

#

and allows nice things like PCIe passthrough and full device virtualization via KVM and all the performance that KVM has

#

(since KVM is the default "driver" on linux)

solar whale
#

Sounds great -- I just need to wrap my head around how to use it. Thanks for the tips.

hollow token
#

tbh, just use virt-manager because the GUI in that is really straight forward

#

if you use your virtualbox VM's disk as the boot disk for your KVM VM, it'll just boot from where you left off

solar whale
#

AH -- thats the big picture I was missing...

hollow token
#

(that is if you don't need to convert the disk image first but that is just installing qemu-utils and using qemu's disk image converter)

#

virt-manager is the GUI

#

sorry I should have made that a little more clear

#

I use it basically daily because I'm a sysadmin by trade

solar whale
#

That makes a lot more sense than what I was picturing. I will take a closer look at it.

hollow token
#

nw!

idle owl
#

(โ•ฏยฐโ–กยฐ๏ผ‰โ•ฏ๏ธต โ”ปโ”โ”ป

austere acorn
#

what did the table do to you? ๐Ÿ˜„

#

Hi all ๐Ÿ™‚ and @idle owl

I'm Silvia, and I'm new to contributing to Adafruit projects (or any open source project, actually)

So I picked a "good first issue" to start with.
Not sure it's the correct label for issue 18 https://github.com/adafruit/Adafruit_CircuitPython_TCS34725/issues/18 but whatever, go big or go home, right? ๐Ÿ˜†

I think I found the source for the calculations.

GitHub

The current implementation of color is in need of replacement. See discussions in #14 and #10 .

idle owl
austere acorn
#

very little, and loooooong time ago, but i'm reading stuff to figure it out

#

your guide is very detailed and helpful, thank you

idle owl
#

Ok, that's what I was going to suggest. Best thing to do first is comment on the issue to the effect that you think you've found the calculations and are choosing to work on it.

#

The next step is to implement it locally, and then submit a PR. We welcome early-and-often PRs - it's totally ok to submit something not ready to receive feedback on it.

austere acorn
#

I wanted to discuss it first, because I don't think there is actually much to do.
From what I can figure out, the code works fine at the moment, and the calculations are correct.

But since people can't figure out where they are from, I could add some comments about it?

#

Also, the simple example given for the library is not very useful, it doesn't show how to use the sensor to read colors, just the color temperature

idle owl
#

Yeah that would work, but I'll be entirely honest, we're sometimes not great with keeping up with issues. That's why I suggested a PR, but I see what you're saying, and think commenting on the issue first would make sense.

#

Carter created the issue, so I can tag him to ask him to follow up with you.

austere acorn
#

there is also a PR for the issue, and both are rather old, so maybe it would be good to get rid of them ๐Ÿ˜„

idle owl
#

We're trying to get through all the old PRs on libraries. Some will end up closed, yes.

#

@tulip sleet Ok I'm going in circles. I can't get the submodules to update on this repo. It appears to be tied to the move to main on the submodule repo. I really wanted to figure this out on my own, but this is turning into a waste of time. I need help.

tulip sleet
#

which repo

idle owl
#

git submodule update --init works, but it checks out a commit from 22 days ago, and won't find anything newer.

#

The circuitpython-org repo, and the adabot submodule.

tulip sleet
#

cd into the the submodule repo. Then do git pull, and git checkout main. That should bring you to the latest commit on main

idle owl
#

Ok, I wasn't sure that was a valid way to do it.

#

I did try that and it worked.

#

But then I second guessed it.

tulip sleet
#

it's confusing because a submodule is set to a particular commit, which could be ANY commit. You've now advanced the commit to the one you want, so when you cd .. and do git status you'll see it's "modified", and then you can commit that

idle owl
#

Ok.

#

I had to specify git pull origin main to get it to work. git pull told me to stuff it and be more specific.

tulip sleet
#

however you do it, you just want to get to the commit you need, and then commit that commit in the parent repo

#

i think you could have done git fetch

idle owl
#

That's where I'm now confused.

#

It wants to commit everything in the repo now doesn't it?

tulip sleet
#

or git fetch --all to make sure

idle owl
#

not the commit.

tulip sleet
#

what's the message that makes you think that?

idle owl
#

Hold on.

#
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
    modified:   adabot```This isn't the whole repo? It's only the commit?
#

The whole repo folder I mean, with files in it.

#

Or wait, it would be making the files all separate lines if it was doing that.

tulip sleet
#

that just means that the submodule adabot's particular commit has been updated

idle owl
#

Ok.

#

Ok the PR looks appropriate.

#

Thank you, @tulip sleet !

tulip sleet
idle owl
#

I read that ๐Ÿ˜„

#

Among many other things

#

trying to figure this out.

idle owl
#

@austere acorn Let me know when you've posted to the issue and I'll invite Carter to take a look.

austere acorn
#

I left a comment on the issue 18 github page, but I forgot to tag anyone

idle owl
#

No worries, I was already on it, so I got the email.

slender iron
#

we should probably spend some time refactoring the CI to only build the minimum needed

manic glacierBOT
manic glacierBOT
idle owl
#

@tulip sleet Why is there no board.DISPLAY for the MacroPad?

#

I am looking at FunHouse and I don't quite follow how to add it.

#

Actually maybe I do.

#

Should I add it?

#

Nevermind.

#

I had the tab still open from an earlier commit. It's already in there.

#

Though I'm unclear on how board.DISPLAY is used now.

#

@gilded cradle Looking at PortalBase and FunHouse libs, it looks like board.DISPLAY is supposed to be the intialised display? But it's saying nonetype object has no attribute show when I try to use it on the MacroPad. Am I missing something obvious?

#

For a minute I thought maybe I had a version of CP too old to have board.DISPLAY in it, but it's there.

tulip sleet
#

@idle owl I am not sure whether the MacroPad build has the display set up properly. I was going to look at that but don't have time at the moment.

idle owl
#

Ok.

manic glacierBOT
onyx hinge
idle owl
#

Hmm.

#

I'm running the latest build.

#

There haven't been any more since I grabbed the last one.

stuck elbow
#

I use the same code on my samd21 board with that display, and it works, but maybe on the rp2040 you are supposed to refer to the display differently somehow

#

is there any other rp2040 board with a built-in display?

idle owl
#

Not that we make, or that I have @stuck elbow

#

Says someone else tested it though.

#

So maybe I'm doing something wrong?

stuck elbow
#

the display works

#

as in, it displays the REPL

idle owl
#

Yeah

stuck elbow
#

but we didn't check if board.DISPLAY works

idle owl
#

the board.DISPLAY doesn't seem to be doing what it should.

stuck elbow
#

I copied that code from the samd21 boards

idle owl
#

Ah. Hmm.

stuck elbow
#

it might be a bug in the rp2040 port

gilded cradle
#

@stuck elbow thanks for helping out @idle owl. It sounds like you may be on the right path.

tidal kiln
#

@idle owl what's not working? i'm trying latest build and seems ok?

#
Adafruit CircuitPython 7.0.0-alpha.3-456-g826e25989 on 2021-06-29; Adafruit Macropad RP2040 with rp2040
idle owl
#

@tidal kiln Seems ok how? That's what I'm on.

#

What did you do to test it?

#

That's why I'm not sure I'm doing anything right.

tidal kiln
#
import board
import displayio
import terminalio
from adafruit_display_text import label

WIDTH = 128
HEIGHT = 64

display = board.DISPLAY

# Make the display context
splash = displayio.Group(max_size=10)
display.show(splash)

# Draw a label
text = "Hello World!"
text_area = label.Label(
    terminalio.FONT, text=text, color=0xFFFFFF, x=28, y=HEIGHT // 2 - 1
)
splash.append(text_area)

while True:
    pass
idle owl
#

That worked?

tidal kiln
#

yep. got hello world on oled.

idle owl
#

I got NoneType object has no attribute show.

#

Testing with your code.

tidal kiln
#

check version also? it was merged only hours ago.

idle owl
#

I'm running the latest CP.

#

As in the last available build on S3.

stuck elbow
#

but before that there was no board.DISPLAY so it would be an AttributeError

tidal kiln
#

yah...hmmm

stuck elbow
#

and not None

idle owl
#

This code runs, but I'm not seeing anything on the display but the same stuff as earlier.

stuck elbow
#

@idle owl do you see the REPL on the display when you reset the board?

idle owl
#

Yes.

tidal kiln
#
Adafruit CircuitPython 7.0.0-alpha.3-456-g826e25989 on 2021-06-29; Adafruit Macropad RP2040 with rp2040
>>> import board
>>> type(board.DISPLAY)
<class 'Display'>
>>> 
idle owl
#

REPL stays up with that example running.

tidal kiln
#

what do you get with that?

idle owl
#

Same as you

#

REPL is still displaying and updating on the display.

tidal kiln
#

hmm..should i add a call to release to example above?

idle owl
#

Wait.

#

I'm dumb.

#

Updated the wrong file.

stuck elbow
#

no you are not

idle owl
#

There it is.

#

Ok. So whatever I did with it earlier was wrong, but board.DISPLAY definitely works, so I can use it in this library. As long as I figure out what I did wrong earlier. ๐Ÿ˜„

#

@stuck elbow @tidal kiln Thank you for going on this adventure with me ๐Ÿ˜„

tidal kiln
#

np

stuck elbow
#

so much excitement :)

#

I was hoping we would find a bug in the supervisor code

idle owl
#

I'm disappointed it was a me-problem and not a bug. I love bugs.

stuck elbow
#

I'm sure there are plenty still lurking in there

idle owl
#

@tulip sleet You're working on RP2040 audio, right?

idle owl
tulip sleet
#

yeah, but I stopped to do the keypad guide, then will go back to that

idle owl
stuck elbow
#

@tulip sleet I wonder how I should proceed with updating the Stage library code for pygamer/pybadge โ€” do we still want stage in them?

tulip sleet
#

are there guides that use stage?

stuck elbow
#

the ugame10 seems to be running super-slow with 7.0 for some reason, not sure if I can keep supporting it

#

@tulip sleet there is one

#

it's from before displayio IIRC

tulip sleet
#

i don't know how to think about this now. we should figure out why ugame10 is slow, because it may be a symptom of a bug

#

could you ping ladyada in an appropriate issues? I would defer to her thoughts on that

stuck elbow
#

I think I will create an issue for this then

gilded cradle
#

@idle owl perhaps you should add a check to see if board.DISPLAY is None and if so, direct users to update their firmware?

idle owl
#

@gilded cradle They need to be running the latest to have keypad anyway. So hopefully we'll have a new alpha release soon with all of that in it. Right now, you have to grab it from S3 regardless, so I don't see the point in having the check for backwards compatibility.

gilded cradle
#

Ok cool.

stuck elbow
#

you wouldn't get None, you would get an AttributeError, but of course you can check for that

idle owl
#

Right.

#

Not concerned about that. I imagine we'll have a new alpha/beta by the time this lib is released.

#

@tulip sleet What happens if you button mash, is there a way for keypad to return an array or list or something?

#

Button mashing your example returns three things in pretty quick succession, but they appear to be separate events.

tulip sleet
#

all the mashes correspond to keypresses. They are returned in the order scanned. So you can't distinguish mashing from consecutive. We could return a timestamp in the event, but we don't do that right now.

idle owl
#

Ok.

tulip sleet
#

do you have a use case for mashing?

idle owl
#

My use case is button mashing. ๐Ÿ˜„

#

No, I am exploring what this can do and tried to do that and it didn't do anything different.

#

So I asked.

tulip sleet
#

ok, I will add an event.frustrated flag

idle owl
#

๐Ÿ˜† Well played.

tulip sleet
#

which corresponds to mashing

stuck elbow
#

you really have to be very lucky to get two events in the same 20ms timeframe

#

especially since the buttons also bounce

idle owl
#

Fair enough. I guess I was thinking of some previous code where it showed multiple keys at once. It's not a need, it was simply a question.

stuck elbow
#

the way you usually do this, you record the press and release events, and keep track which buttons are currently pressed using that

idle owl
#

Ah ok

#

So it's something to do in user code.

#

The library simply makes the keys object available.

stuck elbow
#

so you totally can have several buttons pressed at once, you just get separate events for pressing (and releasing) each of them

idle owl
#

Ok makes sense

stuck elbow
#

yes, it's up to user code to track the state

idle owl
#

Alright. I'm on board with that.

#

I'll have to put together an example for that I suppose.

idle owl
#

Ah

stuck elbow
#

but that also latches presses, to emulate the original behavior of gamepad

#

last_state is what keeps track of what is currently pressed

#

(I use bits, but you can use a set instead)

idle owl
#

Good to know.

tidal kiln
#

is the idea with rtc.set_time_source that it can be set to a real RTC and then time.time() will be based on that? i.e. - be actual time if RTC is set correctly

#
>>> time.localtime()
struct_time(tm_year=2021, tm_mon=6, tm_mday=29, tm_hour=15, tm_min=43, tm_sec=56, tm_wday=1, tm_yday=180, tm_isdst=-1)
>>> time.time()
678296640
>>> 
#

checking value in python3:

>>> time.gmtime(678296640)
time.struct_time(tm_year=1991, tm_mon=6, tm_mday=30, tm_hour=15, tm_min=44, tm_sec=0, tm_wday=6, tm_yday=181, tm_isdst=0)
jaunty juniper
#

(that's the epoch being 2000)

tulip sleet
tidal kiln
#

should the values above agree then? seems like localtime is working but time is not?

tulip sleet
#

as Neradoc notes, I think we are using the 2000 epoch

#

as opposed to the 1970 epoch

jaunty juniper
tidal kiln
#

ah...there it is...thanks.

jaunty juniper
#

(because there is more than just the doc to fix, for no known benefit)

tidal kiln
#

looks like scott is arguing to go back also

#

ok. this is probably just a temporary thing with 7.latest.

#

thanks @jaunty juniper @tulip sleet

jaunty juniper
tulip sleet
#

i found it in an example in the GPS library:

albert@tuna:~/repos/adafruit/Adafruit_CircuitPython_Bundle$ ag set_time_source
libraries/drivers/gps/examples/gps_time_source.py
24:rtc.set_time_source(gps)

libraries/drivers/gps/adafruit_gps.py
315:        """Return struct_time object to feed rtc.set_time_source() function"""
tidal kiln
#
import board
import rtc
import adafruit_pcf8523

pcf = adafruit_pcf8523.PCF8523(board.I2C())
rtc.set_time_source(pcf)
#

that's what i'm doing. works fine now that i understand the epoch base.

jaunty juniper
#

ah I didn't ag in the right directory !

tulip sleet
#

i love grepping through the bundle to find things

tidal kiln
#

if only there was a way to pipe that output to something that would paginate it for easier viewing

thorny jay
manic glacierBOT
crimson ferry
manic glacierBOT
analog bridge
#

@slender iron what is the status of BLE workflow? Is it possible to add boards which only support bluetooth?

slender iron
#

the file transfer code is checked in

#

there isn't a ble-only example yet

#

but it shouldn't be too far off

#

I'm distracted by web bluetooth at the moment

#

the CP side isn't very useful without a host app

analog bridge
#

nice! ๐Ÿ‘ thanks for the update.

#

by web bluetooth... you mean something like circuitpython.org/ide which can upload code over bluetooth?

slender iron
#

serial is working too I think. I need to circle back and see how the CI did

#

yup

#

since it reads better ๐Ÿ™‚

analog bridge
#

is there an easy way to turnoff tinyusb... I am assuming thats the only thing holding back ble-only board

slender iron
#

I think CIRCUITPY_USB will do it but I haven't tried it yet

#

do you have an nrf board to try it on?

analog bridge
#

nope... I'll try to get esp32/esp32c3 working...

slender iron
#

haha, that's a much bigger task

#

it'd be awesome to support though

#

I think I leak a little nrf stuff into the supervisor bluetooth stuff

analog bridge
#

yep need a new ble driver

slender iron
#

it shouldn't be too bad though

#

it's mostly agnostic

analog bridge
#

I might have overthink this a little... I am also imagining a wifi-only workflow...

#

device on start-up will present as a wifi network... you can either connect to it directly and upload code or give it router's ssid/password to appear as a network drive

slender iron
#

ya, that's a whole separate thing

analog bridge
#

haha... I haven't poked around the code yet... will be taking a look at adding ble-only board today.

#

at least there is repl over serial to fall back to

slender iron
#

do you have any nrf you can test with?

analog bridge
#

not at the moment... I have a couple but they are already occupied in existing project... ordering one now

slender iron
#

๐Ÿ‘

manic glacierBOT
#

I agree, since I don't know that switching to 2000 has any advantage (at least until 2038) I don't see why we should break compatibility with existing code and the Unix Epoch.

Note that technically the epoch is platform dependent in CPython https://docs.python.org/3/library/time.html

The epoch is the point where the time starts, and is platform dependent. For Unix, the epoch is January 1, 1970, 00:00:00 (UTC). To find out what the epoch is on a given platform, look at time.gmtime(0).
...

manic glacierBOT
manic glacierBOT
idle owl
#

@tulip sleet or @onyx hinge Are either or both of you around for a feature implementation question about this library I'm writing?