#circuitpython-dev

1 messages · Page 242 of 1

orchid basinBOT
manic glacierBOT
orchid basinBOT
manic glacierBOT
prime flower
#

@solar whale Heya - could I request a code review from you on a HTTP API helper library I wrote?

manic glacierBOT
orchid basinBOT
manic glacierBOT
solar whale
#

@prime flower sure, but I may not get to it until Monday - won't have much time this weekend.

orchid basinBOT
manic glacierBOT
#

@tannewt I followed the original MicroPython discussion on this over months. The idea is just to make it lower overhead to add special-purposes modules, segregated in another directory. Anyone using this would need to maintain a fork. I don't think we'd recommend using this except for private stuff. It doesn't flow with shared-bindings, shared-modules, etc. but it does make it easier to add a simple module.

@dmazzella Anything general-purpose (e.g., an FFT module, or something like t...

orchid basinBOT
manic glacierBOT
meager fog
#

@gilded cradle @tidal kiln heya i have a Q if you're around

gilded cradle
#

I'm around

meager fog
#

silly Q how do i initialize a display when i've built displayio into my board definition

#

i want to hook up my TFT gizmo to the CPX but it says my pins are in use

gilded cradle
#

oh, calling release_displays() should do it.

#

Let me check the exact syntax

#

displayio.release_displays()

#

If that doesn't work, I can try hooking up a display to a CPX and see if I can get it to work.

meager fog
#

nah i got it!

#

yay

gilded cradle
#

Cool

meager fog
#

sorry was distracted by CUTE

gilded cradle
#

It's all good

rigid crag
#

Just got the PyPortal Wondering if theres any games

#

and does pygame work?

exotic pumice
#

I think @timber mango made a snake game

#

oh that was for hallowing

gilded cradle
#

I remember somebody from Show and Tell this week was working on a slider puzzle game for the PyPortal, but that's the only one I'm aware of.

red harbor
#

hi there, just wondering what the deal is with CircuitPython on the m0 Adalogger? It appears to be a non-uf2 board, but there's a uf2 build of CircuitPython? does that mean there's a way to flash uf2 to it or does the build just build bin and uf2 for all boards?

upbeat plover
#

made default CP font 11866 bytes smaller by adding 5 missing glyphs, the ones need for zh translation

#

how do i do pull request on the fonts?

#

bdf files are kinda strange the 5 missing glyphs are made up of componets of other glyphs when i add stuff like that it makes the file size smaller.... weird

upbeat plover
#

@red harbor you can use the .bin files for it, i have adafruit mo adalogger with CP on it.

#

.uf2 is for the bootloader, i think you need to use the .bin atleast once

upbeat plover
#

@slender iron i tested my updated default font with hallowing here is what i got
hallowing old font english 2428 bytes free in flash
hallowing new font english 2480 bytes free in flash
hallowing old font chinese 'FLASH' overflowed by 592 bytes
hallowing new font chinese ``FLASH' overflowed by 532 bytesso i think it does make builds smaller, which is a great thing right??? i ended up doingCIRCUITPY_AUDIOBUSIO = 0` for hallowing, i dont use a speaker ever and that frees up a huge amount of space

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

In theory, I could have several SPI displays connected to the same bus, and displayio has provisions for that — locking of the SPI bus, toggling of the CS pin, even re-setting of the SPI frequency, polarity and phase. However, it's not possible to create two (or more) FourWire objects sharing the same DC and/or reset pins, but with different CS pins — because we will get a "Pin in use" error when the FourWire object tries to create them.

manic glacierBOT
manic glacierBOT
idle owl
#

@tulip sleet Are there any current issues with not being able to enter the REPL from the serial console?

tulip sleet
#

a few people in the forums were having trouble with windows, maybe

#

but not widespread

idle owl
#

Ok, thanks. Wanted to make sure I hadn't repro'd something important.

#

Works after reset, which I figured it would, but wanted to make sure I shouldn't be adding to an issue 😄

tulip sleet
idle owl
#

Ah I didn't run into anything that complicated. It's been connected all night, and then wouldn't enter the REPL when I tried.

tulip sleet
#

in that case, CIRCUITPY wouldn't show up either

idle owl
#

Yah I had CIRCUITPY

tulip sleet
#

what version are you running?

idle owl
#

Oh, hah, 3.1.2. So entirely nevermind. 😄 I thought I was running latest on this one.

tulip sleet
idle owl
#

I should have known better - this is the PyCon demo CPX, of course it's running stable.

#

🤦

tulip sleet
#

i thought 3.1.2 was perfect ( 😃 )

idle owl
#

😆

#

I won't tell anyone about this if you don't

#

😉

tulip sleet
#

Maybe we should have a Top Secret segment showing unknown bugs

#

LEEKS and BUGS

idle owl
#

Everybody loves a good bug

idle owl
#

@tulip sleet Just so I'm not missing something here.... all of the following are built into CP for CPX right? ```import array
import math
import audiobusio

tulip sleet
#

yes, they should all be in 3.1.2. I looked at the source

#

or just try an import in the repl, that's the ground truth.

idle owl
#

Ok thank you. I mean, the code worked, but I had it in my head maybe I had added a lib somewhere and forgotten about it.

#

If I had added it, REPL wouldn't have helped. It would have existed to import.

tulip sleet
#

no, those are all native so they're either buitin or not

idle owl
#

Ok right on, thank you for the sanity check 😄

#

Starting to put together the Open Spaces code content for PyCon. Which means going through every example, testing it, and then adding a docstring. Which, if it needs another lib, should be mentioned. The rest are obvious. That one I started second guessing.

simple pulsar
upbeat plover
#

@marble hornet how is the pocketbeagle going?

marble hornet
#

It was on hold since last night, I visited rit, but not well. I can't get pup to install nor apt-get

#

U can pull it out and plug it in

tulip sleet
#

@simple pulsar frozen modules are Python code that has been precompiled and included in the .uf2. They don't use up (much) RAM when imported, unlike .mpy files which are precompiled but live in RAM when imported. "Builtin" means native C code, at least to us.

upbeat plover
#

@marble hornet what version of linux are you using?

marble hornet
#

Uh. Checking. I downloaded the most recent Debian from beagle board.org

upbeat plover
#

maybe try "Other currently available software images" from the getting-started guide, does the Ubuntu work?

marble hornet
#

Let me link my phone to the computer, I have not yet tried Ubuntu

upbeat plover
#

i was just thinking ubuntu kinda like debian but usually more user friendly less errors probably??

marble hornet
#

would the adafruit blinka work on both?

tulip sleet
#

it should - raspbian is based on debian, for instance

marble hornet
#

and ubuntu?

tulip sleet
#

also based on debian, but more cutting-edge

#

i used to use debian but I've been using ubuntu for about 11 years

marble hornet
#

is pip the only way to install blinka?

tulip sleet
#

@marble hornet are you using pip or pip3? what version of debian is it?

#

installing any other way is painful. it's important to get pip3 to work right if it doesn't

#

I see from above apt-get doesn't work. If that doesn't work something is really hosed

marble hornet
#

pip3 and v9.5

tulip sleet
#

can you ping anything from the beagle?

marble hornet
#

i'm sshed in, let me try

tulip sleet
#

e.g. 8.8.8.8, which is a google nameserver; it will respond

marble hornet
#

can;t find it

tulip sleet
#

so your network connection is not working

#

hardwired or wifi?

marble hornet
#

usb

tulip sleet
#

that is a simulated local network connection; no routing unless you set it up, I think

#

which beagle is this?

marble hornet
#

the go is getting network connection

#

know of a guide?

tulip sleet
#

which beagle is it?

marble hornet
#

pocket

marble hornet
tulip sleet
#

all I would do is read through that too

#

what os is the host?

#

will be afk for a while

marble hornet
#

thank you, windows. reading now...

manic glacierBOT
manic glacierBOT
manic glacierBOT
tulip sleet
#

@hybrid field in the first screenshot, you're trying to use import in a CMD terminal window. That's not inside Python, so it won't work. You need to run Python with a program that imports pyautogui. You also need to install pyautogui so Python can see it.

manic glacierBOT
hybrid field
#

@tulip sleet yeah its solved
but thanks

stuck elbow
slender iron
#

thanks for the link @stuck elbow

#

I'm not to the optimization step yet though

stuck elbow
#

sure, but may be useful later on

slender iron
#

totally

stuck elbow
#

plus, some things are easier to optimize if you think about them in advance

#

like making CS part of the fourwire, so that we can later dma the transfers

slender iron
#

yup, agreed

solar whale
#

FYI - "pl" build failed for me again -- must be right on the edge -- travis did not complain. Note- I ran this Friday night, but just saw the results -- still current master, I think.

#
make: Entering directory '/home/jerryneedell/projects/adafruit_github/circuitpython_master/ports/atmel-samd'
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.

-8 bytes free in flash out of 253696 bytes ( 247.75 kb ).
24700 bytes free in ram for stack out of 32768 bytes ( 32.0 kb ).

Too little flash!!!

Makefile:309: recipe for target 'build-hallowing_m0_express/firmware.elf' failed
make: *** [build-hallowing_m0_express/firmware.elf] Error 255
make: *** Deleting file 'build-hallowing_m0_express/firmware.elf'
make: Leaving directory '/home/jerryneedell/projects/adafruit_github/circuitpython_master/ports/atmel-samd'

tulip sleet
#

part of the string difference has to do with the version string, which can grow if it includes "dirty", etc.

solar whale
#

I'll check but I cloned the repo after the last commit.

tulip sleet
#

set that limit to 48 or 45

solar whale
#

ok -- will try in a few minutes.- system updating...

solar whale
#

@tulip sleet -- ha -- just rebuilt after updating my Ubuntu and it succeeded...

#
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
QSTR updated
FREEZE ../../frozen/Adafruit_CircuitPython_BusDevice ../../frozen/Adafruit_CircuitPython_LIS3DH ../../frozen/Adafruit_CircuitPython_NeoPixel

100 bytes free in flash out of 253696 bytes ( 247.75 kb ).
24700 bytes free in ram for stack out of 32768 bytes ( 32.0 kb ).

Converting to uf2, output size: 507392, start address: 0x2000
Wrote 507392 bytes to build-hallowing_m0_express/firmware.uf2.
#

I had not changed the setting from 50....

#

Sorry for the false alarm -- I have to go AFK for a few hours.

tulip sleet
#

@solar whale great! make sure you start from a completely clean build, but not sure what else to say.

gilded cradle
#

Hi, I’m reinstalling everything on my mac and I forget which gcc-arm-none was the correct one to compile circuit python. I just remember something about a q2 version.

tulip sleet
#

7.3.1 2018q2 (sometimes called q3, I think!)

gilded cradle
#

Thanks dan

manic glacierBOT
orchid basinBOT
orchid basinBOT
orchid basinBOT
#

I can't speak to the site building after no.114 or not as I can't even see that side of things. But, could it maybe be related to the image source URL?

Its currently https://github.com/adafruit/awesome-circuitpython/blob/master/awesome_circuitpython.png. Navigating to that URL in a browser brings up the repo, not just the image.

Maybe the download URL would be better? https://raw.githubusercontent.com/adafruit/awesome-circuitpython/master/awesome_circuitpython.png

river quest
manic glacierBOT
umbral dagger
#

@tulip sleet That when module looks pretty cool.

tulip sleet
#

@umbral dagger tnx - It came from some thoughts I had before breakfast, so it's a bit rough, but I'm feeling like various ideas are coalescing.

umbral dagger
#

@tulip sleet I find that to be a dangereous time to have thoughts.

tulip sleet
#

sometimes a lack of blood sugar can make things seem overly clear when they're not

raven canopy
#

@tulip sleet 🎉

tulip sleet
#

thanks - I'm still baffled as to what went wrong with the other PR - the file comparison looks identical. it might have gotten overwritten later ?? anyway, this time, the commit listed looks good.

raven canopy
#

yeah, that's a weird one. i feel kind of silly pointing out in the issue, exactly what the previous PR was doing. 😄

tulip sleet
#

well, the PR disappeared when it was merged, so your point was the same as mine; gmta

stark needle
#

I have very silly question:
AFAIK circuitpython is limited subset of python
Why you wouldn't stick whole python ? Would it be so huge?

stark needle
#

In other words : why original python runtime haven't been used?

manic glacierBOT
#

MicroPython doesn't implement bytes(object) at the moment, the method syntax is the only way to execute it, i.e.object.__bytes__(). This can be see in CircuitPython too including 4.0.0 beta 5 (also shown in https://forums.adafruit.com/viewtopic.php?f=60&t=150071), example below from a REPL on CPX:

>>> bytes(obj1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'onetwo' object is not iterable

https://github.com/micropython/micropython/...

stuck elbow
#

@stark needle for the original Python you need something much more powerful than a microcontroller, for example, a RaspberryPi

#

for example, just to start, original Python needs 4MB or RAM memory. The SAMD21 microcontroller has 32kB of RAM total.

manic glacierBOT
#

For comparison, here is how you would do it with some kind of async framework (let's call it "then"):

import then
import time
import digitalio

async def blink1(pin):
    while True:
        pin.value = not pin.value
        await time.sleep(1)

async def blink2(pin):
    await time.sleep(0.5)
    while True:
        pin.value = not pin.value
        await time.sleep(1)

async def interrupt(pin):
    while True:
        await pin.interrupt(pin.RISING)
        p...
manic glacierBOT
#

@deshipu Right, right, yes, we're talking about the same thing! I left out the asyncs and awaits, or propose they might be hidden by the when mechanism.

trio and curio use async with as a style. I'll doodle with the same style:

import when

# similar defs as in previous comment ...
# ...

# I am deliberately leaving out the `async`s because I want to understand we actually need them and when we don't. How much can we hide in the library?
with when.loop() as loop...
#

The firmware has to live in internal flash, and there needs to be some code to set up using the SD card (though that could be built into the the firmware).

In general, having a large SD card doesn't necessarily help a lot, because the size of programs is limited by the size of RAM, especially on a SAMD21 (32kB). If you have large data files (e.g., data you are streaming out), then the SD card can help. But having 2MB of CIRCUITPY is not that limiting. It's also faster than the SD card, tho...

manic glacierBOT
#

It's not possible to "hide" the async keyword in the library, because then you create a function that is being invoked when you "call" it. With async, "call" will simply produce an iterator object, which the library can then exhaust in its main loop, handling any Futures it gets from it along the way.

I think that syntax makes a very big difference for beginners, and that the "callback" style that you propose is very difficult to grasp for people not used to it. With the async style syntax...

manic glacierBOT
manic glacierBOT
#

@deshipu But I am seeing trio use what you call the "callback" style:
https://trio.readthedocs.io/en/latest/tutorial.html#okay-let-s-see-something-cool-already
Notice child1, not child1(), below, etc.
There are other examples where the args are separated from the function, e.g. start(fn, arg).

Do you have an example of an await/async library that uses your style?

async def child1():
    # ...

async def child2():
    # ...

async def parent():
    print("pare...
#

Here is a very simple implementatin of such an async framwork, that can only await on a sleep function:

import time


TASKS = []


class Task:
    def __init__(self, when, coro):
        self.coro = coro
        self.when = when


def sleep(seconds):
    return [seconds]


def start(*awaitables, delay=0):
    now = time.monotonic()
    for awaitable in awaitables:
        TASKS.append(Task(now + delay, awaitable))


def run(*awaitables):
    start(*awaitab...
stark needle
#

@stuck elbow thanks 👍

stuck elbow
#

@stark needle what for?

stark needle
#

For explanation about python runtime

manic glacierBOT
stuck elbow
#

ah, ok, you're welcome :)

orchid basinBOT
river quest
#

@stuck elbow cool tetris game, tried it out 😃

stuck elbow
#

thanks

#

it's not entirely finished -- no full line deleting, no next block, no points, etc.

#

I just wanted to see if it's feasible in the first place

river quest
#

yah, good test!

stuck elbow
#

I'm thinking if the accelerometer wouldn't be a better interface for it

#

tilt it to move the brick, tap to rotate...

pastel panther
#

in my limited experience, tap detection is hard to do consistently

river quest
#

@stuck elbow if you want a pyportal btw, email me whenever pt@

stuck elbow
#

thanks, I will wait for PyBadge :)

river quest
#

@stuck elbow oh!

#

email, we have a pybadge for ya

stuck elbow
#

awesome!

pastel panther
#

lol

river quest
#

design will change, but we have 1 extra for prototyping

pastel panther
#

"I'm gonna wait for christmas"
pt: "It's december 25th!"

idle owl
#

<@&356864093652516868> Here's the notes doc for the CircuitPython Weekly for today! Please feel free to add your Hug Reports and Status updates even if you'll be there in voice. It's super helpful! Thanks! https://docs.google.com/document/d/1b2sGCYc7xplbESZ1XVPTf6DgM9FdzBIgZ4BysM64SGI/edit

fierce girder
#

@idle owl
I will miss the the meeting today, but wanted to share:

  • hug to @timber mango for additional PR on improving PocketBeagle support in Blinka and for writing nice Blinka test scripts for PocketBeagle
  • hug to hulkco (Gustavo Reynaga) for BeagleBone testing

My updates:
For https://github.com/adafruit/Adafruit_Python_PlatformDetect/issues/20 udev rules have been added by Robert Nelson to the BeagleBoard.org Debian customization package so debian user can now read the board ID from EEPROM without being root

For https://github.com/adafruit/Adafruit_Blinka/issues/100
I2C is working OK on PocketBeagle and no regressions on BeagleBone Black.

@timber mango helped identify that SPI device index (/dev/spidevX.Y) changes between different kernels. A solution was created by Robert Nelson to have consistent indexes (/dev/spi/X.Y). I will work on making Blinka support the new scheme for PB and BBB. I will also do additional SPI testing.

Thanks!

idle owl
#

@fierce girder Thanks for letting me know! I'll add it to the notes and read it off during the meeting!

fierce girder
#

thanks 😃

timber mango
#

@fierce girder thanks for the mention ;-)
i will be back at this Beagle things hopefully next week! 😃

idle owl
#

<@&356864093652516868> CircuitPython weekly starts in 5-10 minutes!

modern wing
#

Lurking today 😃 Hope everyone is doing well! Happy Monday!

wraith tiger
#

Just listening in today. No new tale to tell.

raven canopy
#

OBS: ""

#

Echo!!

tidal kiln
#

lurking

raven canopy
#

Better than nothing? 😄

old smelt
#

Mic issues here. Dropping out. Back soon.

gilded cradle
#

Hoping to have a mic by the time it’s my turn.

sterile bronze
#

just lurking

slender iron
#

💯

gilded cradle
#

Ok, I should have a Mic now.

#

I say "should" because I reloaded software on my computer this weekend and haven't tested it

slender iron
#

@paper rivet are you just listening in? (aka lurking)

paper rivet
#

ya

slender iron
#

k, welcome!

paper rivet
#

cheers

raven canopy
#
  • @kattni for all the behind-the-scenes PyCon prep.
  • @jwcooper, @pt, @danh, @tannewt for continued work on circuitpython.org.
  • The folks over at Python Discord. I think the partnership is working well. And, they hit 15K members today. Grats to them!
  • @Group for being awesomely awesome!
exotic pumice
#

I don't have a mic or sound but hugs to @gilded cradle for help with ST7735

slender iron
#

displayio ❤ eInk

raven canopy
#

Last Week:

  • nRF PDMIn: Did some work to implement the sinc filter. The number representations look better, but the audio is still garbage. Still working my way through understanding DSP filtering. (Latent hug to Audacity for including raw data processing; working on nRF AudioOut first may have been a better idea. Hehe)

  • adabot

    • "Updated libraries" list: started, but the plan is changing so that's on hold.
    • Did a fairly big refactor, moving the common use functions to their own file. Also moved the CP library validator functions to their own file to ease maintainability. All of this also has the goal of easier expansion for the future.
    • Began learning & playing around with GitHub API v4 (GraphQL vs REST). It's...interesting. Requests require more thought and construction, but the flexibility with what you can get out of one request is pretty awesome. Should cut down on execution a lot. I may be requesting authorization to use GH's GraphQL Explorer on adafruit repos, this week. I'm just not sure "who" the request is sent to...

This Week:

  • PDMIn: continue tweaking the sinc filter
  • adabot, adabot, adabot
#

sorry for the novel

slender iron
#

@raven canopy I can probably give you permissions

raven canopy
#

@slender iron k. It's listed in the OAuth Apps, iirc.

slender iron
#

k, just let me know what you need from me

inland tusk
#

IN THE WEEDS implement access to pin change events on mcp23017

pastel panther
#

@stuck elbow If you don't mind please post a link for that samd21 DMA spi example you found

old smelt
prime flower
#

woah - nice!

meager fog
#

hiya here but text only

slender iron
#

we're in the weeds now but feel free to post hugs and status

#

updates

meager fog
#

thanks my belated update: airlift breakouts going into the shop today - running @sly falcon 's updated 1.3.0 which added Enterprise support whoo! (hugz to docmollo)

#

pybadge PCBs are ordered, lotsa fun in a credit-card shaped board. has a samd51, minispeaker, arcadey buttons. 1.8" SPI TFT, battery charging, feather headers and stemma connectors

#

expect those in about a week

#

last week i did a big push to add all eink chipsets so if you wanna eink your circuitpython you can do that now

old smelt
#

Thanks all! Have to head out.

meager fog
#

@slender iron btw just verified that yeah i can pwm the backlight on TC2_0 - yeah the datasheet says so but always good to hand-check! thanks for the reminder 😃 - thats with arduino

slender iron
#

right, in circuitpython we don't support tc's wo[0]

#

because we use it for the top value

meager fog
#

yayay i know just saying "at least i didnt make a mistake with the hardware"

slender iron
#

yup, totally

meager fog
#

like TC6 doesnt always exist, want me to put in an issue?

slender iron
#

sure

manic glacierBOT
meager fog
#

z'done

slender iron
#

thank you!

tulip sleet
manic glacierBOT
gilded cradle
#

when.triggered

#

when.interrupted?

prime flower
#

@gilded cradle something like when.triggered(pin#, 'high') is pretty intuitive imo

wraith tiger
#

Meanwhile, in the Batcave....

stuck elbow
pastel panther
#

has anyone else had issues with pip installing stuff (like cookiecutter) somewhere not on your PATH ?

slender iron
#

do you have a virtual environment active?

raven canopy
#

Thanks everyone. Have a great day!

prime flower
#

👋

slender iron
#

thanks all! 👋

pastel panther
#

not as far as I know

gilded cradle
#

Thanks everyone

errant grail
#

Thanks!

solar whale
#

👋

tulip sleet
#

@stuck elbow thank you for bringing this up and for starting to work on meanwhile!

pastel panther
#

goobuhy errrabuddy

solar whale
#

I hope there will be a "perhaps" method in "meanwhile"

prime flower
#

😃

tulip sleet
#

"meanwhile, in another universe..."

pastel panther
#

does python have a directory where it sets up wrapper scripts for packages that are installed?

raven canopy
#

@pastel panther I think, but I'd have to dip into the folders. Did you run pip with --user?

pastel panther
#

I tried that as well, yes

raven canopy
#

And it won't run anything?

pastel panther
#

nope

#

just says it can't find cookiecutter

stuck elbow
#

@tulip sleet I just added simple pin polling (without edge/value options) to meanwhile

pastel panther
#

I can see it installed in site-packages but I don't know what the link between and something on my path is supposed to be

raven canopy
#

@pastel panther that seems...odd. do you have multiple Pythons installed (2.7, 3.5, 3.6)?

pastel panther
#

ya

raven canopy
#

Maybe the paths are crosswired? Might be worth it to force it: python3.x -m pip install --user cookiecutter?

#

if I was at home, I might be able to help more, rather than throwing out random questions

main meteor
#

I've become fond of using virtual environments for several versions of Python, and one of the reasons is I know right where any site packages are stored.

umbral dagger
#

Any thounghts on this? ```/tmp/ccu1TDZy.ltrans26.ltrans.o: In function memset': <artificial>:(.text.memset+0x0): multiple definition of memset'
/usr/local/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard/libc_nano.a(lib_a-memset.o):memset.c:(.text.memset+0x0): first defined here
collect2: error: ld returned 1 exit status

main meteor
#

Looks like you're including more than one library that contains memset()

celest zenith
#

@pastel panther you can check the userpath with python3 -c 'import site; print(site.getusersitepackages())'

#

replace python3 with the appropriate binary

pastel panther
#

hmmm /home/bs/.local/lib/python3.5/site-packages

#

which is where cookiecutter is

#

or rather there is a cookiecutter subdir

main meteor
#

Here's one way to see what object files and libraries in a directory define memset: ```
nm -A find /Volumes/ThunderBay/src/gcc-arm-none-eabi-7-2018-q2-update/lib -name "*.o" -o -name "*.a" | grep memset | grep -v U

slender iron
#

@umbral dagger trying cleaning and rebuilding

manic glacierBOT
umbral dagger
#

@slender iron I do.. constantly.

slender iron
#

are you using a -j flag? sometime concurrency can cause issues

#

🌮

tulip sleet
#

@umbral dagger also, you're using gcc 6.3.1; we use 7.3.1

swift arrow
#

@tulip sleet curious why you use 7.3.1, current version is 8.3 . I understand not going bleeding edge, just curious if there is a specific reason

tulip sleet
#

@swift arrow we would like to upgrade - there is just some code that currently throws warnings under gcc8, and we need to fix it

swift arrow
#

ah

tulip sleet
swift arrow
#

sounds like you "guys" have it pretty close to ready. Exciting times!

manic glacierBOT
orchid basinBOT
manic glacierBOT
raven canopy
#

@pastel panther if you're still having cookie woes, give me like 10 minutes and we can compare environments.

manic glacierBOT
slender iron
#

@tulip sleet another way of getting more space would be asf4 removal

manic glacierBOT
#

I am running a NeoTrellis with CircuitPython 4.0.0 Beta 6.
Whenever I create any kind of compilation error I get the following

Adafruit CircuitPython 4.0.0-beta.6 on 2019-03-30; Adafruit Trellis M4 Express with samd51g19

estingOpen
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'estingOpen' is not defined:

Even if I fix the syntax issue, I still get that error, even if I revert to a previously working code.py file, I have to erase and r...

tulip sleet
#

@slender iron yes, that's true, would look for the easiest things to remove first

slender iron
#

@tulip sleet check the make_new functions for builtins (like I did for UART)

manic glacierBOT
#

@dhalbert I think your "when" proposal has promise. I like the simplicity of it. And compared to other approaches, I think moving the interval outside the def is better because it makes the method more reusable and cleaner. From my perspective, the use of "callbacks" is not that hard for people to understand, whereas the use of await/yield requires explaining cooperative multitasking etc.

I'm interested to hear how your approach would handle terminating an interval. And did you consider gi...

manic glacierBOT
idle owl
#

@pastel panther Ping me when you get back so I can show you the rest of the steps necessary when creating a CircuitPython GitHub repo. Thanks!

manic glacierBOT
orchid basinBOT
#

@kattni I can start on it this week, I hope.

For the script component (if possible), I'd like to follow the same process we use for the files.json (https://github.com/adafruit/circuitpython-org/blob/master/_data/files.json) circuitpython release process. For libraries, we could simply add a _data/libraries.json file that is pushed to this repository on each release. Then, we can just pull in that data in jekyll, etc.

manic glacierBOT
orchid basinBOT
#

@jwcooper,

Using the same process as files.json shouldn't be an issue. The idea was to have the script in adabot anyway. It will most likely run in a Travis cron job, vs the release builds on circuitpython. Submitting PRs can be the same...

I'll try and get a schema together soon, though it honestly may just come straight out of GitHub's API replies.

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

OK, so this is a new pull request at last for #1042, replacing #1610 which I've closed.

This version moves the code for flash access into ports/nrf/peripherals/nrf/nvm.c which is used by both ports/nrf/supervisor/internal_flash.c and by ports/nrf/common-hal/nvm/ByteArray.c.

The NVM store uses page(s) at the end of the FATFS page allocation, depending on the size of CIRCUITPY_INTERNAL_NVM_SIZE.

manic glacierBOT
#

I have a keyboard that's built on circuitpython, and while on beta 4, I am able to plug the keyboard in, the code boots, and I can type. When testing on beta 5, 6, or even latest at the time of writing, I have to connect to the REPL for me to see output. Based on the lights on the keyboard, it appears to be running code, but it runs normal after connecting to REPL, so it's hard to check where the issue is.

ItsyBitsyM4
Code used to test was this https://github.com/KMKfw/kmk_firmware

manic glacierBOT
manic glacierBOT
#

Should this fix it?

diff --git a/ports/atmel-samd/common-hal/audiobusio/I2SOut.c b/ports/atmel-samd/common-hal/audiobusio/I2SOut.c
index af84bb807..bbe33c916 100644
--- a/ports/atmel-samd/common-hal/audiobusio/I2SOut.c
+++ b/ports/atmel-samd/common-hal/audiobusio/I2SOut.c
@@ -147,7 +147,7 @@ void common_hal_audiobusio_i2sout_construct(audiobusio_i2sout_obj_t* self,
         mp_raise_ValueError(translate("Invalid bit clock pin"));
     }
     if (ws_clock_unit == 0xff) {
-   ...
manic glacierBOT
timber mango
#

Hello

#

defining secondary uart on custom pins works on reading but nor on writing

#

can somebody help or give a hint

manic glacierBOT
umbral dagger
#

@tulip sleet Ah. Ok, I'll update and try

umbral dagger
#

@tulip sleet same behaviour with 7.3.1

solar whale
#

@umbral dagger did you do a make BOARD=xxxx clean before building

umbral dagger
#

@solar whale yes, every time at this point

solar whale
#

does it build OK for if you just use the unmodified repo - that is - without your changes?

umbral dagger
#

@solar whale Yes, it is definitly the files I am adding that are causing the issue. I can't see how though.

#

@solar whale They're not defining the functions being complained about.

solar whale
#

@umbral dagger odd.. is it possible they are including something that defines it. Do you have your fork on github? If so, post a link so we can better see what is going on.

main meteor
#

Still getting the multiple definitions for memset()? I'd take a close look at the link line and see what's being included.

#

It could be something obscure like a ranlib problem.

umbral dagger
solar whale
#

@umbral dagger I'll be tied up for the next few hours (day job) but will look at it when I can

main meteor
#

I'll give it a go. Wow, that's a nice README.

#

Hmm, seems to have an unresolved dependency ```
../../extmod/modxml.c:42:10: fatal error: mxml.h: No such file or directory

umbral dagger
#

odd

#

oh. I believe I added the header path in the Makefile for the atmel boards.

#

That should be moved.

#

No.. I did that already.,

lone sandalBOT
umbral dagger
#

All the stuff for my module is in py.mk

main meteor
#

Looks like it may be an issue with CP, the (new) modxml seems incomplete?

celest zenith
#

I was able to replicate the memset error

umbral dagger
#

If you look in py.mk 2 other mxml files are commented out. Add those in and you'll see a handfull of strnnn functions compaints of the same sort.

#

I.e. ```Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
/tmp/ccZPzFi6.ltrans28.ltrans.o: In function strncmp': <artificial>:(.text.strncmp+0x0): multiple definition of strncmp'
/usr/local/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard/libc_nano.a(lib_a-strncmp.o):strncmp.c:(.text.strncmp+0x0): first defined here
/tmp/ccZPzFi6.ltrans28.ltrans.o: In function strcmp': <artificial>:(.text.strcmp+0x0): multiple definition of strcmp'
/usr/local/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard/libc_nano.a(lib_a-strcmp.o):(.text+0x0): first defined here
/tmp/ccZPzFi6.ltrans28.ltrans.o: In function strlen': <artificial>:(.text.strlen+0x0): multiple definition of strlen'
/usr/local/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard/libc_nano.a(lib_a-strlen.o):(.text+0x0): first defined here
/tmp/ccZPzFi6.ltrans28.ltrans.o: In function memset': <artificial>:(.text.memset+0x0): multiple definition of memset'
/usr/local/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard/libc_nano.a(lib_a-memset.o):memset.c:(.text.memset+0x0): first defined here
/tmp/ccZPzFi6.ltrans28.ltrans.o: In function memcpy': <artificial>:(.text.memcpy+0x0): multiple definition of memcpy'
/usr/local/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard/libc_nano.a(lib_a-memcpy-stub.o):memcpy-stub.c:(.text.memcpy+0x0): first defined here
collect2: error: ld returned 1 exit status
Makefile:309: recipe for target 'build-grandcentral_m4_express/firmware.elf' failed
make: *** [build-grandcentral_m4_express/firmware.elf] Error 1

main meteor
#

Got past the mxml.h error, but weirdly I'm getting a completely different build failure. I wonder what I'm doing differently. ```
/var/folders/b6/60c379ms33d35cjmh5d612nr0000gn/T//ccLJQ2ny.ltrans25.ltrans.o: In function sync_window.part.2.lto_priv.1199': <artificial>:(.text.sync_window.part.2.lto_priv.1199+0x12): undefined reference to disk_write'

#

I wonder if I have some MicroPython stuff missing.

solar whale
#

@main meteor did you do git submodule update --init --recursive after cloning?

main meteor
#

Yeah, I did.

#

also sync

solar whale
#

🤔

stuck elbow
#

I always forget to sync

main meteor
#

I'll try it in my usual build arena and see what happens.

umbral dagger
#

@main meteor I haven't seen that one. Oh.. I'm building against beta 3

#

intentionally

#

That should be a given from the fork, though

main meteor
#

I figured. Do you know the tag/hash for that?

#

I have a lot of experience chasing down duplicate references like that, but I'm yak shaving trying to replicate your build environment so I can reproduce the problem. Perhaps CraigF is better at that part.

umbral dagger
#

The last merge from master was from commit 35cfc61607dc22453aeffbdcfcc0a74af2a25071

raven canopy
#

i imagine a simple test would be to just comment them out

umbral dagger
#

@raven canopy Right, they prevent a header from being included multiple times.

#

Some of the config.h things might be wrong, but I don't see how that would cause the problem.. they typically switch on the provision of local implementation for more esoteric string functions.

main meteor
#

Yeah, inclusion is a compile-time issue, it might define entry points, but the multiple definition is a link-time issue.

#

Basically at compile time, requirements for references (undefined references) are generated. At link time, the linker matches up defined references with undefined ones (so something asking for strcpy is linked to the definition of strcpy). The problem arises when strcpy is defined in more than one place (which can happen in one of several ways).

celest zenith
#

what generated the config.h ?

umbral dagger
#

configure script

#

But I've edited it since

main meteor
#

If you build it with V=2 it'll show the actual link command. I'd suggest eyeballing that for duplicated libraries.

#

Note it's a huge line with over 500 arguments 😃

#

Eyeing it, I'm wondering if something's breaking the library grouping.

#

That said, I just backdated the build environment to that beta3 tag and it built properly, so I still am unable to replicate the failure. 🤔

#

In particular, if you break up the link line by spaces and go down toward the end, there should be something like ```
-Wl,--start-group
-lgcc
-lc
-Wl,--end-group

umbral dagger
#

Yes. Right at the end

main meteor
#

Hmm. Those symbols are defined in 4 different libraries (-lc, -lg, -lc_nano and -lg_nano). Maybe grep out all the -l callouts and see if there are any others lurking somewher?

tulip sleet
#

you should only have one libc and one libg. We don't use the _nano versions.

main meteor
#

I'm guessing you should have libc OR libg: having both would cause the multiple definition problem.

#

I think libg is the "debug" (-g) version of libc.

#

libgcc is a separate thing.

manic glacierBOT
manic glacierBOT
exotic pumice
#

DMA code that isn't messy ASF4? I'm interested

#

I tried to write something that copied asf4 and it was garbage

stuck elbow
#

looks like you need something called "dma descriptor" that says where from and to copy the data, how much, etc.

#

I don't believe it can be too messy, since it only has 16 bytes

exotic pumice
#

yeah but there's a whole mess of library code

#

using it's not terribly messy, but if you don't have asf4 and you want to copy the asf4 implementation, you're gonna have a bad time

stuck elbow
#

I don't plan on copying the asf4 implementation

#

I suppose that's what the official examples all use

exotic pumice
#

yeah, I didn't really mean "you" I meant "I did this and it was awful"

#

so I'm interested to see what you guys come up with

meager fog
#

@exotic pumice adafruit_zerodma doesn't use ASF

#

we pulled it out a few months ago

#

@tidal kiln heya im in meetings but if you want to try a couple things with ESP32 + EPD i can give you Hints

exotic pumice
#

@meager fog cool I'll check it out

tidal kiln
#

@meager fog cool. please do.

meager fog
#

@tidal kiln ok first up change SRAM_CS and BUSY to -1

#

so we dont use the SRAM (in case thats being weird) and busy isnt actually used

#

id stick to hardware SPI tho, software SPI is more scary

#

then, theres an EPD_DEBUG thingy you can turn on in Adafruit_EPD - try that

#

it may slow things down enough

manic glacierBOT
tidal kiln
#

@meager fog SRAM_CS/BUSY=-1 = same thing
let me go back to HW SPI and re-verify that didn't work (i tried that initially)

meager fog
#

yeah

#

but turn on EPD_DEBUG

tidal kiln
#

yep - uncommented the #def in lib just to be sure
seems to be hanging in ::begin()
here's the ctor:

Adafruit_IL91874 display(264, 176, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS);
meager fog
#

can you trace down where its failin? :/

#

thats with EPD_DEBUG on right?

tidal kiln
#

also SRAM_CS = -1

meager fog
#

maybe litter some println()s

tidal kiln
#

yep

manic glacierBOT
#

I have been testing a "slideshow" using a feather_m4_express and an feather_nrf52840 wiht a TFT featherewing (ILI9341).

It runs fine on the feather_m4_express
but it does not work on the feather_nrf52840
It starts up OK, but only displays a small part of each image then eventually (after a few images) goes to a white screen.

This used to work on the nrf52840, but if I recall correctly, some changes were made to accommodate the BLE timing.
The REPL response is very sluggish on the n...

tidal kiln
#

@meager fog after much littering....
Looks like it has to do with SPI.beginTransactionbeing called twice, this line in csLow():
https://github.com/adafruit/Adafruit_EPD/blob/2.0.2/Adafruit_EPD.cpp#L635
first called here:
https://github.com/adafruit/Adafruit_EPD/blob/2.0.2/Adafruit_EPD.cpp#L503
and then the next line calls SPItransfer which calls it again here:
https://github.com/adafruit/Adafruit_EPD/blob/2.0.2/Adafruit_EPD.cpp#L584
and it hangs on that second call to SPI.beginTransaction in csLow()

slender iron
manic glacierBOT
tulip sleet
#

@slender iron I'm testing Nick's nrf nvm PR: something peculiar going on (nvm bytearray subscripts all out of range), trying to debug, and CIRCUITPY not appearing on a debug build 😦 so currently in a rathole

slender iron
#

does the main build work ok?

manic glacierBOT
manic glacierBOT
celest zenith
#

Is there a way to trigger the bootloader without pressing the reset button? i.e. via software

celest zenith
#

Thanks

manic glacierBOT
timber mango
#

Hi all, are you aware of anyone working on a dashboard/ gauge for the PyPortal? I'd like to render the Adafruit IO gauge on the PyPortal. I think the hacky way to do it is to render 100 different images for 0-100% (ok, maybe 101 😃 ) but I'd rather not go down that route if there's a different image rendering method.

manic glacierBOT
#

This PR prevents recursive calls to run_background_tasks().

In the nrf port, the filesystem flush code was setting the on-board NeoPixel. This code is often called from the background. The NeoPixel code has a long wait in it, and it runs background code while waiting. So background code was calling background code on the nrf port. This caused a debug build to hang up or run very slowly, and possibly had performance impacts on the regular build as well.

tulip sleet
#

@slender iron How are you adding commits to other people's PR's? I thought I had to do that via a new PR based on theirs (at least that's what seemed true when I googled it).

slender iron
#

by default you give project mods rights to edit your branch

#

so you can either edit through github or by pushing to their remote branch

#

you can try it with mine 😃

tulip sleet
#

OK, I'll fix your PR 😃

#

I didn't realize the default permissions were that way.

slender iron
#

ya, it's relatively new

#

I only do it if I plan on merging after

#

otherwise it could confuse people that their remote branch doesn't match their local one

tulip sleet
#

@slender iron I cannot push to your branch, at least via https. hmm. I could try the edit in your repo, I guess.

slender iron
#

really? what command are you trying?

tulip sleet
#
halbert@salmonx:~/repos/tannewt/circuitpython/ports/atmel-samd$ git push
remote: Permission to tannewt/circuitpython.git denied to dhalbert.
fatal: unable to access 'https://github.com/tannewt/circuitpython/': The requested URL returned error: 403
halbert@salmonx:~/repos/tannewt/circuitpython/ports/atmel-samd$ git branch
* fix_gc_never_free
  fix_uart_timeout
  master
  pulseio_too_fast
#

that is a direct clone of your repo, not a remote in mine

slender iron
tulip sleet
#

have you done it with a push instead of on github?

slender iron
#

ya, I think so

#

I added the git:// url as a separate remote

tulip sleet
#

i'll add it as a remote first and see if that works, but it might be https vs git

#

that didn't help, so I did it from github

slender iron
#

hrm, interesting

tulip sleet
manic glacierBOT
pastel panther
#

@timber mango I was kinda, maybe eventually going to do it but haven't gotten past thinking about it. You could probably have one bmp for the frame/scale and use shapes to draw the gauge

timber mango
#

@pastel panther yep. I went down a rabbit hole looking for cool graphics since it's pretty trivial to do bmps 😃

raven canopy
#

@slender iron @idle owl GraphQL Explorer access requested. still not sure who notifications would be sent to; it only mentioned "owners"...

manic glacierBOT
slender iron
#

@raven canopy approved

raven canopy
#

thanks! it'll be queries only for some time... manipulations are a ways down the road. 😄

raven canopy
#

variables aren't working in the explorer, so narrowing down by condition is impossible. but...it is an impressive protocol, even though its hard to understand.

manic glacierBOT
meager fog
#

@tidal kiln ahh dont forget you have to bump lib.properties

#

so do 2.1.1

#

i need to get adabot to warn ya

#

no human can keep up with it

manic glacierBOT
gilded cradle
#

Heh, I was wondering why my Feather M4 Express wasn't working. I put newly compiled firmware on there and everything and then I looked closer and saw that it was actually my Feather M0 Express. 😆

main meteor
#

Whoops! I've done that!

pulsar bobcat
#

Too many times...

manic glacierBOT
#

Hi,

At the top of rgb_led_status.c are some #ifdef checking for defined symbols which i assume are defned on the mpconfigboard.mk, like so:

#ifdef MICROPY_HW_NEOPIXEL
uint8_t rgb_status_brightness = 63;
#include "shared-bindings/digitalio/DigitalInOut.h"
#include "shared-bindings/neopixel_write/__init__.h"
static uint8_t status_neopixel_color[3];
static digitalio_digitalinout_obj_t status_neopixel;
#endif


#if defined(MICROPY_HW_APA102_MOSI) && defined(MICROPY_HW_APA102_SC...
slender iron
manic glacierBOT
#

How do you set the timers for PWM outputs when building custom CircuitPython boards?

I am getting an error at the moment about conflicting timers. However, everything should work fine using alternative timers on the SAMD21G (if it knows which to use).

All timers for this pin are in use.

<img width="301" alt="WeChat Image_20190410162543" src="https://user-images.githubusercontent.com/11770912/55856487-c9864300-5bad-11e9-909a-69cec398eee6.png">

This is running on a SAMD...

manic glacierBOT
manic glacierBOT
lone sandalBOT
manic glacierBOT
#

nevermind -- this is now working with the current master.


Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.0.0-beta.6-72-gde38ce798 on 2019-04-10; Adafruit Feather nRF52840 Express with nRF52840
>>> 
>>> 
>>> import slideshow_sd
cat_rug_320x240.bmp  Size: 153.7 KB
cats_320x240.bmp     Size: 163.3 KB
sibs_320x240.bmp     Size: 153.7 KB
skye320x240.bmp      Size: 153.7 KB
solar whale
#

@tulip sleet was the "background task" the issue that was fixed for the nrf52840 and tft display? -- it now works fine. running eddystone beacon and slideshow...

#

just pulled latest commits -- still works 😉

manic glacierBOT
tulip sleet
#

I didn't know if it was going to fix your problem, but it was interfering with my testing on nrf for something else. It made debug builds be unusable.

solar whale
#

Seems to have done the trick.

manic glacierBOT
solar whale
tulip sleet
#

@solar whale we can close, but we do need more testing, thanks for noticing

manic glacierBOT
manic glacierBOT
stuck elbow
#
>>> spi = busio.SPI(clock=board.BUTTON_CLOCK, MISO=board.BUTTON_OUT)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Invalid pins
#

that is a bit of a shame, I thought I could cheat and use spi to read a shift register :P

#

but I could probably use bitbangio for it

manic glacierBOT
stuck elbow
#

@meager fog I don't suppose it would be possible to change the shift register on the PyBadge to something that latches all the time, and not just on the falling edge?

umbral dagger
#

@tulip sleet @main meteor It looks like maybe the culprit is lib/libc/string0.c It defines the functions being complained about.

meager fog
#

@stuck elbow this is the only chip really, and its cheap

#

you can bitbang it very easily

stuck elbow
#

@meager fog the problem is that if I do anything else that takes time, I will miss keypresses

#

basically, I need "was any button pressed since I last checked" and not "is any button pressed right now"

#

I had the same problem with joywing

#

it's fine if all you do is sit in a loop and wait for the user to press a button, but if you need to actually run the game as well, it gets tricky

meager fog
#

@stuck elbow yeah we def need a C helper for this

stuck elbow
#

that's why I wrote the gamepad module

meager fog
#

@slender iron ^ were youthinking the same?

#

in arduino we would have a 1ms tick checker

stuck elbow
#

but it's for the wasteful option of a pin for every button

meager fog
#

yah this would be nearly identical to gamepad, but it twiddles 3 pins instead of reading 8 😃

#

do you want to adapt gamepad to allow a shift register?

stuck elbow
#

how fast can you read that shift register?

meager fog
#

umm really fast

#

lemme check

stuck elbow
#

because it's an interrupt...

#

I wouldn't want to have any delays in it

meager fog
#

tp = 13ns

#

so....

#

75MHz

stuck elbow
#

ok, great

#

faster than our system clock :)

meager fog
#

CMOS logic is pretty sweet 😄

#

note it ISNT quite SPI

#

so you really do need to bitbang it

stuck elbow
#

sure, I'm abusing it

#

but it works

meager fog
#

its not worth wasting a sercom

stuck elbow
#

I'm using bitbangio

#

code reuse :)

meager fog
#

ok if thats fast enough!

stuck elbow
#

oh, right, that may be a problem

meager fog
#

but yah i recommend C, running it beween 1-10ms intervals

#

10ms means it 'self debounces'

stuck elbow
#

in gamepad I actually require it to be low for two cycles

meager fog
#

adding to gamepad would be sweet and is a good spot for it

stuck elbow
#

for debouncing

meager fog
#

yah either way!

#

we didnt have enough pins to give one per button

#

so this was my best option

stuck elbow
#

yes, of course

#

for my esp8266 version of the console I used an attiny24 for this

meager fog
#

rad

stuck elbow
#

but this is obviously cheaper and faster

meager fog
#

hard to beet the price and simplicity of a '165 😄 ive been using that chip for 15 years

slender iron
#

👍

stuck elbow
#

by the way, maybe we could also add that logic to seesaw?

meager fog
#

me and the 165 are best buddies

slender iron
#

Please link to the code when you have it @stuck elbow

meager fog
#

@stuck elbow we kinda did? check neotrellis code

slender iron
#

I’m close to needing it too

stuck elbow
#

@slender iron well, when I have the gamepad code, I will make a PR

#

@slender iron I have python code already

slender iron
#

Ok thanks! I might use it today

#

Time for breakfast. Bbl

stuck elbow
#

gotta run

meager fog
#

so rad! 🎮

main meteor
#

@umbral dagger Seems to me that would be half the problem: the trick is to define each symbol exactly once, so it's defined in (at least) one more place to cause the error (at which time the problem reduces to which duplicate to remove and how).

umbral dagger
#

@main meteor I expect that are in lbc as well.

main meteor
#

I figured lib/libc/string0.c was part of libc already, but I may be tripping over my own (mis)assumptions.

tulip sleet
#

@umbral dagger are you including two libc's still?

#

also, CPy has its own definitions of some things

umbral dagger
#

I don't think I was including 2 libcs

tulip sleet
#

the _nano version

umbral dagger
#

I don't know how that's getting pulled in

tulip sleet
#

does the library have its own Makefile??

umbral dagger
#

@tulip sleet No

main meteor
#

I'd take apart the link command, and do some shell scripting to use nm to extract the symbol table out of everything it references and grep for the duplicate symbols. I was going to do this for you, but fell on my sword in my attempt to replicate the issue in the first place.

tulip sleet
#

@umbral dagger is the code with a problem in a repo I can pull and build?

#

I didn't have time to pay attn to this yesterday

umbral dagger
celest zenith
#

I think libc_nano being used because -specs=nano.specs is in the makefile

#

in the LDFLAGS

umbral dagger
#

@tulip sleet If I comment out the bit pf py.mk pertaining to my module (lines 109-124) it builds fine

#

That's in the standard codebase as well

main meteor
#

What CraigF mentions makes a lot of sense to me, and that would certainly do it.

tulip sleet
#

what board should i build?

main meteor
#

grandcentral_m4_express

celest zenith
#

I was building pyportal and got the same error

main meteor
#

Once you've captured the link command, you could try re-running it without the -lc library and see what happens.

#

Or without the -specs=nano.specs argument.

#

Sure enough, nano.specs includes the -lc_nano library

#

(along with a bunch of other tweaks)

tulip sleet
#

ok, so nano.specs is in the original make stuff, so that's fine, so there's something new in the xml stuff that's confliciting

#

so I wouldn't remove it

#

we use memset all over the place, so it's not new

umbral dagger
#

Yeah, removing the nano.specs bit doesn't change anything

main meteor
#

Hmm, it does end up using -lc_nano in mine.

#

To get an even more specific view of what's going on, capture the linker command and run it again with a -v option: then it will emit the actual command it's running internally, with the references expanded.

tulip sleet
#

I'm thinking this is a link line ordering problem

main meteor
#

You're looking for a command called collect2 (instead of the old ln name). It should have a bunch of -L options showing the actual library search path, the loader script, the object files, and the actual library options used.

tulip sleet
#

I'm going to diff the build logs

manic glacierBOT
solar whale
#

@meager fog just a heads up -- I tried updating an ESP32Huzzah breakout to NINA-W102-1.3.0 .binand it connected to my SSID once, then would never connect again - kept giving the "No such ssid" error. I reverted to the older NINA-W102.bin and it started connecting again. I can't create an issue on the nina-fw repo so I just wanted to let you know. I have to go AFK for a few hours -- I'll try to do more testing later. This was with a FEATHER_M4_Express and the esp32 breakout

sly falcon
#

@solar whale that's interesting....I have to admit - I didn't test the firmware against non-Enterprise WiFi as I was working on that code, but I also never touched any of the non-Enterprise code in there. Makes me wonder if there is something odd/broken with the Espressif environment I used to compile the code 🤔

#

I can test that when I get home tonight after work

celest zenith
#

what version of esp-idf did you use?

solar whale
#

@sly falcon great! -- This was my first test of the new version - I tried one I compiled myself and your version -- same results with both. I usually see on failed attempt to connect then it succeeds on the second try.

sly falcon
#

@celest zenith "latest"...whatever that means. I'd have to check that, as well, when I get home

solar whale
#

I have the esp-idf from sometime in February.

celest zenith
#

the upstream uses 3.1.3 but 3.2 and 3.3 branches exist

sly falcon
#

the one I have would have been from a few weeks ago

solar whale
#

sorry I have to run -- good luck -- I hope it's just something on my end...

sly falcon
#

I'm betting it would have been 3.2 or 3.3...I didn't grab a specific branch - I just did a clone w/o the branch option

#

@solar whale thanks! I'll let you know more tonight

celest zenith
#

It might be good to use a specific tag so it is easy to recreate.

sly falcon
#

@celest zenith I agree, but there was no mention of the specific branch that ladayada used, so I just grabbed what I assumed was "the latest", as per one of her commit comments

#

I'll get things sorted out later tonight

tulip sleet
#

@umbral dagger I think this has to do with mxml config.h thinking there is no vsnprintf (though there is, in lib/utils/printf.c). But I can't fix it by saying there is vsnprintf.

I'd suggest instead of using extmod that you use the shared-bindings and shared-module structure we use now. We're trying to get stuff out of extmod.

The build logs I saw seem to be OK, but the mxml files and command line args are showing up not in the order I'd expect. But the link line looks ok.

umbral dagger
#

@tulip sleet ok

umbral dagger
#

@tulip sleet I was aiming to echo the structure and approach of the json support

tulip sleet
#

the json support style is from MicroPython. We will make it a shared-module eventually

umbral dagger
#

Ah, ok.

sly falcon
#

This version was compiled using a fresh clone of the v3.2 branch of the ESP-IDF.

#

I'm heading off to lunch....I'll be back in about an hour

manic glacierBOT
meager fog
#

hmm ok i will not release 1.3.0

#

altho, i cant replicate your issue

sly falcon
#

@meager fog cool...good to know. Thanks! I don't have hardware at my office to test with today, so I'll have to wait until tonight to test

manic glacierBOT
#

This code looks correct, but doesn't work correctly in practice. Either I missed something obvious, or the timings are too fast after all.

Here is the code to test it:

import gamepad
import board
import digitalio
import time


data = digitalio.DigitalInOut(board.BUTTON_OUT)
clock = digitalio.DigitalInOut(board.BUTTON_CLOCK)
latch = digitalio.DigitalInOut(board.BUTTON_LATCH)

gp = gamepad.GamePadShift(data, clock, latch)

while True:
    print(bin(gp.get_pressed()))...
manic glacierBOT
solar whale
#

@meager fog @sly falcon what commands do you use to falsh the ESP32?

main meteor
#

I'm curious how the Certificates are updated (I have my own little CA I use for testing).

sly falcon
solar whale
#

hmm @meager fog @sly falcon I tried "pre erasing" the flash before loading 1.3.0 and it is now working

sly falcon
#

wooo!

solar whale
#

may have just been bad karma...

sly falcon
#

@solar whale is this the v1.3.0 firmware on the Learn Guide, or my experimental build I did earlier today?

solar whale
#

this was from the learn guide

sly falcon
#

OK, cool

solar whale
#

I'm going to try my own build next

sly falcon
#

good luck!

solar whale
#

sorry for the false aloarm

sly falcon
#

I'll think happy thoughts about the magic smoke staying put 😉

#

no worries....added a bit of excitement to an otherwise boring day at the office 😉 lol

solar whale
#

sigh -- my "local" build also works now -- possibly erasing was helpful -- who knows -- I'll do it from now on!

sly falcon
#

that's a good tip....I'll keep that in mind in case I run into any weirdness

manic glacierBOT
#

I get the same results with one bit per two system clock cycles, so this can't be a timing thing. I can't see what could possibly be wrong here. It receives the last bit correctly, the one-but-last bit is always 1, and the rest is always 0. Here is a test program that uses the same logic in python and in gamepad -- the python version works, the gamepad one doesn't:

import gamepad
import board
import digitalio
import time


data = digitalio.DigitalInOut(board.BUTTON_OUT)
c...
solar whale
#

@sly falcon @meager fog Hopefully this is my last post regarding NINA 1.3.0. -- I just tried uploading without first erasing to a feather Huzzah ESP32 and it is working fine. Clearly my issue was a fluke. If anyone has problems. erasing may be a good thing to try, but I'm I'm happy it it working. I'll try a pyportal next ... but proably not until later tonight or tomorrow.

sly falcon
#

@solar whale wooooo! No worries about another message...I appreciate the feedback!

#

Heck - if you let me know how the pyportal attempt goes, I'd love to hear that, too haha

#

This was my first contribution of code to an Adafruit thing......I was nervous as heck and wondered what sort of testing I should do, or others would do...so this has all been a good thing for me 😀

solar whale
#

It was a great thing to add -I'm sure it will get a lot of use!

sly falcon
#

Thanks - I hope so!

solar whale
#

@sly falcon had a few minutes -- pyportal update is working fine!! Thanks!

sly falcon
#

@solar whale cool beans! You're welcome and thank you, too!

manic glacierBOT
meager fog
#

@solar whale no biggie, its not too hard to update - so im shipping the pyportals + airlifts with 1.2.2

#

we'll have AirLift boards in stock within a day

#

so if you wanted one of em please sign up

sly falcon
#

signs up

meager fog
#

ships with 1.2.2 cause i got a lil spooked

celest zenith
#

Is there a reason to use the AirLift instead of the HUZZAH breakout?

meager fog
#

airlift is simpler, smaller, has RGB leds on it

#

and has a tristater on MOSI so you can share the SPI bus

#

the breakout isn't great for it, which is why i'm not promoting it for that use

#

its more of a development board - also a little more $

celest zenith
#

Thanks. Now to decide if I need a development board or just the AirLift 😃

solar whale
#

@meager fog how do you reprogram an airlift?

#

Never mind. I see tx/rx

#

I forgot they were broken out.

manic glacierBOT
sly falcon
#

@meager fog heh....I got super panicked...I'm glad there was still time to decide to not ship the code and allow a bit more testing 😁

manic glacierBOT
#

@tannewt cycling through all the servos starting at 1 to 8. Creating the PWMOuts based on SeeSaw's libraries (so hidden). I didn't have this issue with the circuitpython built in Feb / March 2019. The SeeSaw firmware that I built is ok - it uses the correct timers that were specified.

from Adafruit_CircuitPython_RoboHat.rm_robohat import RoboMM1
import time

from digitalio import DigitalInOut, Pull, Direction
from adafruit_seesaw.pwmout import PWMOut
from adafruit_seesaw.sees...
crimson ferry
#

Will the CircuitPython ESP32SPI library get controls for the R,G,B LEDs of the Airlift breakout? Not sure how that works in Arduino... is that in the NINA firmware? It's nice to have some signs of life on something like that.

meager fog
#

i didnt realize it existed till i designed this board

#

it is in the arduino lib, i dont have any immediate plans to add it to python

#

but it is not hard, will get to it eventually 😃

tulip sleet
#

@slender iron I missed what you suggested might be wrong with HID in the latest 4.0. Could you repeat? tnx

slender iron
#

if hid is checking to see if usb is connected

#

but the connection state might depend on cdc

tulip sleet
#

it completely does depend on cdc

#

so that's wrong

#

ok, got it, will look more carefully tomw

slender iron
#

thanks!

manic glacierBOT
#

Hi @nickzoic - This is your PR with some additions. Subscripting was not working when I tested nvm on nrf. I think there were some more rebase issues. I've corrected that and changed a few types. Could you test? If it's ok I'll merge this one and close the other one. I've tried pushing new commits to a PR, and though it's supposed to work based on the permissions we have set up, it does not seem to.

orchid basinBOT
#

@jwcooper,

How does the below schema work for you all?

Truncated Raw Example:

[
  {
    "library_updates": {
      "new": {
        "Adafruit_CircuitPython_LIFX": "https://api.github.com/repos/adafruit/Adafruit_CircuitPython_LIFX"
      },
      "updated": {
        "Adafruit_CircuitPython_INA260": "https://api.github.com/repos/adafruit/Adafruit_CircuitPython_INA260",
        "Adafruit_CircuitPython_RA8875": "https://api.github.com/repos/adafruit/Adafruit_CircuitPython_R...
upbeat plover
#

? lol what i say that gets blocked

manic glacierBOT
solar whale
#

@upbeat plover It looks to me like the "bot" does not like one of the words as it is transliterated - it matches a British profanity.

manic glacierBOT
meager fog
#

@stuck elbow hihi did you work out the shift register

#

i was swamped yesterday & couldnt look at yr PR

stuck elbow
#

@meager fog I did, I spent 3 hours yesterday debugging it, because I made a typo and my code wasn't being called at all -- only found it today morning

meager fog
#

lol oh nooo

#

thats the worst

#

likey ou keep tryig thing and the realize you're editing the wrong file

meager fog
#

@stuck elbow ok feel free to ask any other hardware design Q - maybe i made a mistake too

stuck elbow
#

@meager fog I wonder if we could make it default to 24MHz for the SPI clock — it's technically out of spec for the display, but it works reliably in practice

#

and makes the screen refresh slightly faster

meager fog
#

yeah i do it on arduino 😃

#

it is totally out of spec but ill say something we do on Pi is we do the commands at 16mhz then data at 80mhz and its fine

#

so i would continue to do commands slower if possible

stuck elbow
#

interesting, but I don't think we can do more than 24MHz on the samd, and the commands still seem to work with that, so...

meager fog
#

yes samd SPI is technically 24mhz max

#

however, the screen is really small

#

thats why pyportal we did 8bit

#

for 320x240 its worth it. on the little display, SPI @ 24mhz is plenty. anyways you DMA it

stuck elbow
#

we will DMA it, in the future

#

the problem is tearing

meager fog
#

that is something we cant do anything about really - there's no TE pin

#

i think the sort of games we're doing, 30 fps is plenty fast

stuck elbow
#

right, but faster clock means there is smaller difference between when the top gets updated and when the bottom does, and that means the snake in my game crawls more like a snake than a caterpillar

#

I'm not sure we are getting 2fps at the moment, tbh

meager fog
#

yah thats because the whole screen updates all at once

#

we'll be doing a ton of optimizations once the displayio is stable

#

you could use RGBdisplay if you wanted to, for now

manic glacierBOT
stuck elbow
#

well, I'm going to use that library I wrote for µGame for now, just need to make it work with fourwire

#

by the way, nice bootloader on the pybadge

#

with screen support

meager fog
#

yes!

#

its customizable, makecode folks did it

#

you can change the text and icons

stuck elbow
#

ah, so it's not just one big bitmap, nice

#

huh, and now my code mysteriously stopped working

#

eh, "I will just do a small refactor, it doesn't change anything, so no need to test it"

meager fog
#

😃

orchid basinBOT
umbral dagger
#

@tulip sleet OK, I moved it to shared-* and added build flags as per the others. disabling it results in a clean build, enabling it results in link error. Experimentally trying it with CP master next.

#

@tulip sleet Identical results

meager fog
#

@raven canopy hey when you're around i have a question about adabot for arduino libs

raven canopy
#

@meager fog I'm in and out on my phone, throughout the day. Can answer sporadically, or we can wait till I'm home later.

meager fog
#

np - @timber mango and i were trying to run adabot for checkingf the arduino libraries and not being terribly successful

stuck elbow
#

So, I want to make an addon for the hallowing that will add some buttons to it, and I'm thinking about a name for it. What do you think aboud "hallobutt"?

meager fog
#

haha

#

SKULLBUTT

stuck elbow
#

it would be fish-shaped, of course: https://en.wikipedia.org/wiki/Halibut

Halibut is a common name principally applied to the two flatfish in the genus Hippoglossus from the family of right-eye flounders. Less commonly, and in some regions only, other species of flatfish are also referred to as being halibuts. The word is derived from haly (holy) a...

meager fog
#

sure go for it, m0 is kinda weak for gaming :/

stuck elbow
#

it's enough for chess ;-)

raven canopy
#

@meager fog Do you have the environment setup, with the token and everything?

meager fog
#

yeah we get..

#
$ python3 -m adabot.arduino_libraries
Running Arduino Library Checks
Getting list of libraries to check...
Found 242 Arduino libraries to check

0 requests remaining this hour
0 requests remaining this hour
0 requests remaining this hour
0 requests remaining this hour
#

then like 100 more lines

#

Libraries have commits since last release: (3)
  Repo                 Latest Release   Commits Behind
  ----                 --------------   --------------
  Adafruit_SoftServo   1.0.0            2

raven canopy
#

🤔 has it been run a lot within the hour?

#

Looking at yesterday's cron, Arduino report uses about 800 requests per run. Running it 6 times in an hour could eat up the rate limit. Per token...

meager fog
#

i changed out my token tho

#

can we just see the latest cron output

raven canopy
#

Yep. It's on S3.

meager fog
#

ahh do you know the url?

#

or is it in the readme somewhere

#

i cant find :/

raven canopy
#

Yep, that's the folder. I'll try to repro tonight, to make sure it isn't related to my recent refactor...

opal mason
meager fog
#

@raven canopy np this output is great for onw

solar whale
meager fog
#

@solar whale 😃 😃 😃

prime flower
#

OH SWEET, missed the news of the AirLift dropping into the store, somehow...

meager fog
#

you were out! 😄

idle owl
#

@prime flower I think going forward, instead of a direct email, please file an issue on the applicable repo when you've gotten RTD as far as you can, tag me, I will finish it, and close the issue. This will be better for tracking and visibility.

prime flower
#

@idle owl Sounds good to me. That'll help non-adafruit folks as well with this process.

idle owl
#

@prime flower That's what I was thinking as well.

prime flower
#

@umbral dagger Ping me when you're online either here or over PM so we can set up RTD for itertools

orchid basinBOT
meager fog
#

@hard dove hihi do you have a rough idea when yr around

manic glacierBOT
slender iron
#

@meager fog I think you want @gilded cradle

meager fog
#

thats not the same person?

#

(its her email addr)

slender iron
#

I assume it's an old account

meager fog
#

ooh ok

gilded cradle
#

Yeah, I have a couple email addresses. My discord user in makermelissa

meager fog
#

oki! @gilded cradle hihi do you have a rough idea when yr around

gilded cradle
#

I’m usually around in the evenings and on weekends.

#

But I get direct pings too

meager fog
#

ok thanx! ill check with ya later

gilded cradle
#

👌

tidal kiln
#

@stuck elbow for hallowing addon - maybe something "crossbones" related somehow?

manic glacierBOT
manic glacierBOT
#

I've had some issues with my CP devices lately.

  1. I have a desktop USB hub, using that at times I can't get a CircuitPython device to enumerate to Windows 10
  2. I have had a good number of issues after upgrading from Mu 1.01 to beta to 1.0.2 getting the serial window to open properly. I cleaned out the unused COM ports in Windows Device Manager as a first try, still issues maybe related to #1.

Or it could be #2 is due to #1.

Issue logged per request of @dhalbert

errant grail
#

Is rotaryio officially MIA from the latest distrubution? import rotaryio can't find the module.

slender iron
#

there was a bug with it @errant grail

#

try from s3

errant grail
#

@slender iron Thanks!

slender iron
#

I am planning on doing a release later or tomorrow

upbeat plover
#

@slender iron idk how to hook the font thing like you said, and i was wondering if any glyph need to be added so that one font will work with all or most translations, also im working on japanese romaji translation, i got it already in JP characters from MS translate, now im using google translate for Romaji translation.. I'm hoping no accents will be needed in the font for it.

slender iron
tough flax
#

Hey @idle owl I have a documentation suggestion - or maybe I was just being slow and it took me longer than most to see the problem.

I have a pile of Trinket M0s that I bought for a keyboard interface - I use them for all kinds of wonderful stuff. But they all have the version 2.0.0 CP that they shipped with:
Adafruit CircuitPython 2.0.0 on 2017-09-12; Adafruit Trinket M0 with samd21e18

I'll upgrade (no problem) and I see a note saying that 2.0.0 isn't supported (again, np!). But I actually went straight to the AnalogIn section of CircuitPython Essentials and when I read from AnalogIn(board.A2) I got "module has no A2 defined"). I switched to "D0" which is the digital pin number and it worked, and I'll upgrade at least to 3.x to be sane, but it wouldn't hurt to add a note that says

"If you get pin not defined, make sure you're running 3.x or higher".

idle owl
#

@tough flax Did A1 work properly before upgrading?

tough flax
#

Nope

#

only A0

idle owl
#

Ok.

tough flax
#

I think it was only defined for the Analog Out pin

#

I'm sure someone has a memory of that 😃

#

It's just because the example didn't work that I raised it

#

I'm good either way

idle owl
#

Is that the exact wording of the error you received? module has no A2 defined ?

tough flax
#

Hold on, I'll get it

idle owl
#

Thank you

tough flax
#

AttributeError: 'module' object has no attribute 'A1'

idle owl
#

Thanks!

tough flax
#

Also, I'm CERTAIN that there's a reason D0 is named A2 not A0 (@meager fog doesn't do things like that by mistake), but I've made that mistake like 1000 times 😃

idle owl
#

Warning added to guide, thanks

modest atlas
#

Hello pythonions

#

Any good how to's on creating circuitpython librarys, or at least understanding them

#

Specifically i2c libraries

idle owl
#

The guide we have is more about the technical side of creating the library (GitHub, etc), not so much about writing it. We now use a library called register to write our CircuitPython libraries. You'd need to start with the datasheet, find the registers, then use register and bus_device (needed for I2C) to write the library. There are a couple of examples of using registerto access an I2C board.

#

But they're library examples, not documented examples.

modest atlas
#

I'm using that board with that i2c relay, running 4.0 beta 6

gilded cradle
idle owl
#

register is somewhat documented, so if you combine that with a working example, you might be able to get it sorted.

#

We can also answer questions. 😃

modest atlas
#

@idle owl thank you!!

idle owl
#

register is designed to make writing libraries a lot simpler - it handles a lot of things in the background.

modest atlas
#

I'm still pretty new to all this

idle owl
#

As was I when I wrote the library I linked you to 😃

manic glacierBOT
upbeat plover
#

dargh i didnt mean to merge my chinese font pull with the new default font pull..... oh well

modest atlas
#

Does adafruit sell the proper jst connectors/wires to fit in the 2 jst ports on the pyportal

manic glacierBOT
idle owl
#

@modest atlas Yes.

tulip sleet
#

@idle owl maybe we should add some suggested products for the JST connections to the main learn guide

idle owl
#

I added NeoPixels

tulip sleet
#

3568 3590 4030 maybe there are too many

#

4029

orchid basinBOT
solar whale
#

3893 and 3894 are useful as well ...

idle owl
#

Ok I added a bunch.

tulip sleet
#

tnx!

#

i added the stand too

idle owl
#

ok thanks. one of the PIDs you linked was wrong, so I didn't try to figure out what you meant.

tulip sleet
#

oops, 3950. I'll add it. 3590 is definitely someting else

river quest
#

hi hi @solar whale !

#

we are seeing particle today, any suggestions/requests?

tough flax
#

@river quest - you could ask Particle to contribute a CircuitPython library for their mesh network 😃

meager fog
#

@umbral dagger hey QUESTION

#

have you tried eLua?

solar whale
#

@river quest Sorry - was away -- First congratulate them on a very nice set of products! -- Would be really nice if the Argon could support the SPI interface to the ESP32!

modest atlas
#

@tulip sleet Dan @idle owl Katy possibly add speaker options aswell

modest atlas
#

What learn guild would they be added to, pyportal?

stuck elbow
#

@slender iron do you have any idea what I might be doing wrong? I copied board.c from hallowing to ugame10, defined all the buses and pins etc., but when I try to compile it, I get <artificial>:(.text.startup.main+0x1fa): undefined reference to `common_hal_board_create_spi' — it worked before the refactoring, when it was just board_spi()

#

ah, I see, I don't have DEFAULT_SPI_BUS_MISO

umbral dagger
#

@meager fog Nope. I've done very little with Lua, and that was just in the context of WoW addons.

manic glacierBOT
#

@dhalbert I think that I sorted out what the issue was.
https://github.com/KMKfw/kmk_firmware/blob/8bb55c84cdb00bbe8ffc6e4ba00d133df5a100c1/kmk/firmware.py#L142

return supervisor.runtime.serial_connected
I think I was exploiting a bug and using it as a feature in beta 4. This was used to see if the board was powered directly by 5V power or had USB data lines available. In beta 4, this returns True even if I am not connected to a REPL, and False if powered my 5V power directly. In the new...

manic glacierBOT
modest atlas
#

Can someone tell me the pin out of the i2c a and gpio ther are broken out on the pyportal

manic glacierBOT
manic glacierBOT
gilded cradle
#

@meager fog, I'm around now

manic glacierBOT
#

@tannewt I was using 4.0.0-beta.6
Unfortunately after reflashing and fixing a bug in my code I haven't been able to reproduce the bug (I've been saving directly to the board without any version control so I can't look back at the old code). I'm dealing with a new bug though where the interpreter doesn't seem to see some attributes of objects.
That new bug isn't addressed in S3

manic glacierBOT
#

@kdb424 We use a low-level call to the TinyUSB library, tud_hid_generic_ready() to see if there's an HID connection. That value is not exposed directly, but it's used by the HID report sending code, which will throw an exception if it's not available after waiting two seconds. See https://github.com/adafruit/circuitpython/blob/master/shared-module/usb_hid/Device.c#L48.

So you could test this indirectly just by sending a do-nothing report (like a keyboard report with no keys pressed), and...

karmic notch
manic glacierBOT
#

Hey @tannewt ,

Apologies for causing any confusion.

I was using SeeSaw to test that the custom board was not faulty (rule out hardware issue). I think I have also sent the incorrect sample code, which compounded confusion.

Effectively, when using the PWMOut function it says: "All timers for this pin are in use." after calling SERVO1 then SERVO3. It would look like the TCs are possibly being ignored as an option in CirucitPython.

Code

CircuitPython: https://github.com/ro...