#circuitpython-dev

1 messages · Page 247 of 1

gilded cradle
#

Not sure if anybody has subclassed other displays

meager fog
#

hm we still have a few examples that use sendcommand

#

er writecommand

#

but we're already doing much better

gilded cradle
#

Ok, so it's in the examples?

meager fog
#

in some arcade philb code, like eyeballs

#

some hallowing demos

gilded cradle
#

Ah, ok

meager fog
#

i think we're at a good stopping point with that project

gilded cradle
#

Ok

meager fog
#

i think next lets add some extra functions that could be useful for displays

#

we have invert() i think, but wake/sleep is pretty useful

#

a lot are single-command writes

gilded cradle
#

Yeah, I started adding some enable/disble one, but I forgot to add it to ili9341.

meager fog
#

maybe look at the DS, see if anything else useful is there

#

i'd like to have the same interface for all tho

gilded cradle
#

Good idea

#

Yeah, that sounds good

meager fog
#

then we can look at GFX, maybe fix some bugs

gilded cradle
#

Yeah, that one may have a few outstanding issues

meager fog
#

l0ts 😃

gilded cradle
#

Yeah

meager fog
#

if you're at all interested, i'd be curious to see if we can add BDF support in arduino

#

like we did in python, we have the parsing code

#

would make fonts a lot easier (but you need an M4 or M0)

gilded cradle
#

Yeah, that might be a fun little project

meager fog
#

and at a high level, id like to implement vgl or whatever its called

#

that's def M4

gilded cradle
#

little vgl

meager fog
#

yeh

#

iz nice tho

gilded cradle
#

littlevGL is the reason I started optimizing the RA8875 driver initially

meager fog
#

yep

#

ok lets start by adding all those functions now that we have a clean basis and safe sendcommand() 😃

#

and check back once we've closed all the issues

gilded cradle
#

Ok!

meager fog
gilded cradle
#

Ok, cool. like the setScroll function (though it's scrollTo in the ili9341 library right now)

#

Yeah, I see some other good ones in there too

meager fog
#

kk

mint prawn
#

@slender iron thanks for the http/https fix for #1833 on circuitpython - i'll try to improve my github reaction times 😃

stuck elbow
#

not everybody works on this full time

manic glacierBOT
orchid basinBOT
manic glacierBOT
manic glacierBOT
slender iron
#

@mint prawn no worries! I was extra eager to get it in for the release candidate. Usually I’m more patient

manic glacierBOT
manic glacierBOT
#

Agh, sorry about the regression. A test case should probably be added to cover it.

Is the fast path for 0 justified? It doesn't seem to save many instructions.

The long int path handles buffer sizes that aren't powers of two, and the short int path doesn't. This test case succeeds in Python 3 and fails with this patch:

(0x10000).to_bytes(3, 'little')

I don't fully understand the rationale of "using signed constants here... to avoid any unintended conversions.", but ...

#

In my first iteration of #1860 I had implemented this:

bool mp_binary_int_within_range(mp_int_t val, size_t nbytes, bool is_signed)
{
    if (!is_signed && val < 0) {
        // Negative numbers never fit in an unsigned value
        return false;
    }

    if (nbytes >= sizeof(val)) {
        // All non-negative N bit signed integers fit in an unsigned N bit integer.
        // This case prevents overflow below.
        return true;
    }

    if (is_signed) {
       ...
surreal saffron
#

ugh. I caught that mistake with bool values while testing my PR, and I fixed it in the two cases in binary.c and missed fixing it in objint.c. Sorry about that (and nice catch @meager fog !)

manic glacierBOT
#

Agh, sorry about the regression. A test case should probably be added to cover it.

I realized that after I submitted the PR, and I'll write one.

Is the fast path for 0 justified? It doesn't seem to save many instructions.

I was thinking that the most common case was zeroing a buffer, which may contain signed or unsigned values. The procedure call is quite a bit more expensive than the checks, so this may not be a big deal.

The long int path handles buffer sizes that aren't p...

#

In my first iteration of #1860 I had implemented this:

...

I expect that's not as fast for the common case of power of two buffer sizes as what you've got here, but it does handle the edge case of ones that aren't.

I may use that for the to_bytes() case. I was trying to use a right-shift instead of a left-shift, because then you can check for 0. But it's not defined in C whether right shift is arithmetic (dupes the sign bit) or logical, and there didn't seem to ...

manic glacierBOT
#

@godlygeek Could you take another look? Thanks. I've reused your shifting code above, since it's going to be fast for smallints. I could add a fast path for byte-sized values, but this is probably fine. My major reason for splitting the smallint and longint cases was to not use bytecodes to do the basic checking in the smallint case.

I split the tests up so the array overflow test wouldn't be skipped completely if longints were turned off, and I added some more tests.

I'm sorry I didn't...

slender iron
#

<@&356864093652516868> Here is the notes doc for the meeting tomorrow: https://docs.google.com/document/d/1LtpdR7a_rG4tJ724Fm6z32PEiyloRAWcPbeqyMakees/edit?usp=sharing Everyone is welcome to join! Let us know if you want to be a <@&356864093652516868> to get pinged.

manic glacierBOT
#

I didn't know that thing about hex vs decimal, agh.

Neither did I until just now, heh... I spotted that 0xffffffff didn't fit into a signed 32-bit int, and then went looking for what that would actually do, and was surprised by what I learned.

@godlygeek Could you take another look? Thanks

Looks good to me!

I could add a fast path for byte-sized values

Hm, I think that's a better idea than the fast path for zero, actually! We can skip the shifts for stuff that fits in ...

orchid basinBOT
manic glacierBOT
#

I looked at the machine code, and it's pretty minimal.The shifting is only a few instructions. So I think I'll leave well enough alone for now. Thanks for all your help on fixing this long-standing regular Python incompatibility.

@tannewt, this is ready for review.

000123a8 <mp_small_int_buffer_overflow_check>:
   123a8:	b508      	push	{r3, lr}
   123aa:	b180      	cbz	r0, 123ce <mp_small_int_buffer_overflow_check+0x26>
   123ac:	b922      	cbnz	r2, 123b8 <mp_small_int_buffer_o...
manic glacierBOT
#

@dhalbert @kdb424 I was able to confirm catching the OSError is a valid workaround by testing the following script (ignore the wildly inaccurate "frequency" function, but it gets the job done) against a Feather M4 Express (1) plugged into computer - received no blinks, and (2) plugged into power-only AC adapter - received frantic blinks.

import board
import digitalio
import time
import usb_hid

class HIDUsage:
    KEYBOARD = 0x06
    MOUSE = 0x02
    CONSUMER = 0x01
 ...
manic glacierBOT
granite crow
#

Hi, last weekend I got some free time to work with a circuitpython enabled board and a nrf24l01p radio as I already have a library for it in C. I did a little research and found the Circuitpython Badge project, it's using this radio. Is the source of the nrf24l01p radio available @stuck elbow ? I checked the linked bitbucket repo and couldn't find it

stuck elbow
granite crow
#

Cool, I'm afraid my code for it is not pythonic at all, I will take a look at it

#

I can try to adapt the library if you want me to @stuck elbow

stuck elbow
#

my project is on hold at the moment, but I'm sure it will come useful for other users as well

manic glacierBOT
#

From @nnja:

from adafruit_bitmap_font import bitmap_font
from adafruit_display_text.label import Label


class TextArea(Label):
    def __init__(self):
        self.x = 5  # what causes the PyPortal to boot in safe mode
        font = bitmap_font.load_font("/fonts/Helvetica-Bold-36.bdf")
        super().__init__(font, max_glyphs=3)


text = TextArea()

Comment out line 7 to stop the crash. I made a new class that inherits from Label. everything is fine until ...

manic glacierBOT
modern wing
#

Howdy! I've been busy with life, but finally I have an afternoon free! I'll be joining & happily lurking!

solar whale
#

Minor change in my plans today so I'll be on as well -- woohoo!

gilded cradle
#

I won’t be able to make it today. My notes are in the notes doc.

ruby atlas
#

I'll be lurking. I'm in an open concept desk farm today and haven't got the right kind of headset.

#

(My notes and hugs are in the doc)

sterile bronze
#

Just lurking

old smelt
#

Lurking

idle owl
#

<@&356864093652516868> Starting in a few, still in an internal meeting

tidal kiln
#

lurking

trim elm
#

lurking

ruby atlas
#

💯

modern wing
#

Loud and clear!

old smelt
#

👍

turbid radish
#

Heya - lurking today

pastel panther
#

lol

turbid radish
#

Crowdsupply!

pastel panther
#

#sickburn

river quest
#

:crow: --- see no crow emoji

slender iron
#

🎉

river quest
#

blinka !!

pastel panther
#

64 PRs! 🎉

turbid radish
#

Thank you ALL to folks who are helping, old & new!

meager fog
#

i gotta bail in a few min - if you wanna hugz + checkin me soon

idle owl
#

Yeah!

slender iron
meager fog
#

whew

#

bbiab

trim elm
#

I want to thank everyone from Adafruit that was at the Pycon sprints. On behalf of all of the high school students there, we would like to thank you guys for your generosity and for allowing us to have such a great experience. Everyone in my group said it was their highlight of Pycon. We've been using the Circuit Playground Expresses a bunch in school, and I've been having so much fun working on the GPS module. Thanks!

meager fog
#

k back

slender iron
#

that's the best way to start testing

manic glacierBOT
inland tusk
#

Just got here sorry I missed the meeting

slender iron
#

🍻

meager fog
#

gotta go l8r folks

raven canopy
#

👋

slender iron
errant grail
idle owl
#

@trim elm You can type out your status update if you'd like to

errant grail
trim elm
#

Since Pycon, I’ve been working mostly on the CircuitPython GPS module. I initially was working on some bug fixes and then went on to expanding some documentation. Now that I feel I understand the module and the NMEA protocol that it uses a bit better, I’ve been working on adding support for parsing more types of NMEA sentences from the GPS. I’ve finished all but one and will probably make a PR in the next day or two.

I forgot to mention this in my hug report, but I’d like thank to @idle owl and @gilded cradle for helping me with Travis and Github, and an especially big thanks to @pastel panther for help with Github, Travis and for some amazing help with the GPS module I was working on.

pastel panther
#

we'll miss you Radomir! Come back soon!

#

glad to help @trim elm !

trim elm
#

Ok. I have to head out now

ruby atlas
#

I have to head out too.

slender iron
#

nothing from me

modern wing
#

Glad everyone had a good time with PyCon, and I too share the jealousy with being unable to go. Thank you to everyone who helped with it.

solar whale
#

👋 have to run -- finish packing ... have a great week.

slender iron
#

@modern wing next year is in Pittsburgh in April

errant grail
#

Thanks all!

modern wing
#

@slender iron Does it normally change locations every year?

slender iron
#

every two years

modern wing
#

Thanks again for a good call!

inland tusk
#

Does anybody know what version of CP is being loaded on current adafruit boards?

manic glacierBOT
main meteor
#

@errant grail those are very nice looking boards. The layout is both technically logical and visually appealing. Colour me impressed!

errant grail
#

@main meteor Thanks!

slender iron
#

@inland tusk it varies with the tester setup. the newest we load is beta.7 I believe

manic glacierBOT
#

So it looks like it "just works" in CPython. This prints 1:

class Root:
    def __init__(self):
        self.x = 1

    @property
    def x(self):
        return self._x

    @x.setter
    def x(self, new_x):
        self._x = new_x

class TextArea(Root):
    def __init__(self):
        self.x = 5
        super().__init__()

text = TextArea()
print(text.x)

I don't think we'll be able to do this in CircuitPython easily because the native class isn't alloca...

manic glacierBOT
orchid basinBOT
manic glacierBOT
orchid basinBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
fluid helm
#

Does CircuitPython support any STM32 boards?

stuck elbow
#

no

lethal abyss
#

@tall yacht but maybe micropython

manic glacierBOT
trim elm
#

@gilded cradle I'm going to be working on a tool to allow people to see what pins are used by featherwings to see which featherwings can be stacked on top of each other, and which pins are left over. Is the only way to get all the pinouts getting them from the eagle files from each individual repository, or is there some place with all of them together?

gilded cradle
#

I like to check out the learn guides for that.

trim elm
#

Ok. I'll do that

manic glacierBOT
slender iron
#

@fast harness we don't support them but it may be possible to add support for it

#

it's not a simple task though

tulip sleet
#

@slender iron #1883 looks good but pybadge builds are failing due to stage, maybe just a #include missing

slender iron
#

kk, will look now

#

gah, ya

fast harness
#

@slender iron Not surprised to hear it wouldn't be a simple task... sigh

#

@slender iron Do you know if it has been done yet?

#

Or does anyone else know??

slender iron
#

I don't believe so

fast harness
#

@slender iron Any insight as to why it would be so difficult? I figured is the microcontrollers were running on the same ARM Cortex processors as the SAMD microcontrollers maybe it would be a similar process

slender iron
#

@fast harness the core is the easy part. it's the peripheral support that is hard

fast harness
#

@slender iron Ah okay, makes sense...

slender iron
#

getting the core workflow is a matter of getting usb and spi (for external flash) or internal flash going

fast harness
#

On that note... What is the smallest known MCU compatible (and supported on some level) with CircuitPython?

slender iron
#

the samd21 is 48mhz and 32k ram

#

256k flash

fast harness
#

The SAMD21 is great but I'm looking to go smaller... Maybe it would help to ask what the absolute minimum amount of flash is required in order to be able to run CircuitPython?

slender iron
#

you'd be hard pressed to go smaller on ram

#

flash footprint will depend with what modules you want to support

#

we do have some samd21 builds that use 64k flash for the filesystem and 192k for circuitpython

fast harness
#

The code I'm running is extremely simple... This is all I'm using: {import board
import adafruit_dotstar as dotstar
import time
from touchio import TouchIn}

manic glacierBOT
slender iron
#

@fast harness that would require spi support for dotstar and touch support

fast harness
slender iron
#

will probably fit. not sure how you'd do touch with it

manic glacierBOT
fast harness
#

@slender iron "will probably fit. not sure how you'd do touch with it" - What do you mean?

#

They both have SPI?

#

They both have SPI.**

slender iron
#

the code will probably fit in that much flash

#

the samd has a touch controller peripheral we use for touchio but the lpc doesn't seem to have one

fast harness
#

Hmmm okay, thanks for pointing that out.

simple pulsar
#

Hello all. When I made the library adafruit_ws2801, I based it on adafruit_dotstar It turns out I picked up a bug when the code is used on non-hardware-assisted pins. It hasn't manifested itself yet for dotstars perhaps because of a difference in timing wrt clock https://github.com/adafruit/Adafruit_CircuitPython_DotStar/issues/34. The bug does cause the WS2801 to fail in obvious, colourful ways. I wanted to trace back the code to see if it was based on existing code and who wrote it in case the bug was present elsewhere or author had replicated bug elsewhere. It was originally called ds_writebytes() as seen in https://github.com/adafruit/Adafruit_CircuitPython_DotStar/commit/14205d83ea14c6c0097d8e7132aff986238af03e#diff-18059db786163024e172bdbae20fb7b1R190 but perhaps there are earlier versions elsewhere

GitHub

Cookiecutter the library and update to match NeoPixel API.

main meteor
#

DotStars use a synchronous protocol, so they don't care much about timing (you can do it manually and it will work). NeoPixels are the ones where timing is important.

stuck elbow
#

it does matter whether you toggle the data pin or the clock pin first, though

#

and that is the bug

#

I suspect the problem is that dotstars use falling edge of the clock, and ws2801 rising, or something like that

main meteor
#

That does matter, but I'm having trouble understanding how hardware assistance is required to toggle pins in the correct order.

stuck elbow
#

look at the patch

#

hardware assistance is not required, just the hardware implementation doesn't have that bug

main meteor
#

Amusingly, I debugged a SCSI bug that had a similar underlying cause (tricky, as it worked with some devices but not others).

manic glacierBOT
simple pulsar
#

@main meteor @stuck elbow I stuck diagram in, it's not very detailed but strongly suggests rising edge triggering but the fact it works suggests they must either have a lag or continue to read any data changes for a "large" unspecificed window. But I was less looking for discussion on bug and more looking for its dark (or otherwise) back story.

main meteor
#

I understand, I just got confused by my misunderstanding of the real issue.

slender iron
#

@simple pulsar that code is old enough that I doubt anyone remembers details

simple pulsar
#

@slender iron I've worked on code that's older than Google. #justsaying

main meteor
#

I can completely understand the curiousity. There are some projects out there that use a series of shift register chips that are all clocked together, and the instructions have some vague hints that you have to invert the clock at some point. The real problem is ripple delay, so inverting the clock acts as if it were delayed.

fluid helm
slender iron
#

@fluid helm we've got preliminary work on the stmf4 in tinyusb

#

and there is plenty of example code in micropython, it's just not circuitpython-ified

fluid helm
#

Ah-gotcha.

lone sandalBOT
fluid helm
#

Might have a look to see if I can work something out

slender iron
#

that'd be awesome! I'd love to see support there too

stuck elbow
#

they will have a lua port, so probably a lot of code could be lifted from there

simple pulsar
#

@stuck elbow Is it C++ xor LUA or C++ with lua? I have just pledged for some so I will find out soonish. Interesting to see Pimoroni using kickstarter

stuck elbow
#

xor, but I suppose you can always write a lua module in C++, as with C and circuitpython

manic glacierBOT
manic glacierBOT
zealous barn
#

Looking for some guidance on if it's possible for CircuitPython to not reset pins (on MCU restart / entering REPL), but still allow them to be used. Right now if I use never_reset in board_init, pin state is maintained between resets (great!), but I get pin in use errors when I try to create a pin object in python after the reset.

raven canopy
#

@zealous barn not sure of your use case, but on the Python side you could wrap it in a try:

try:
   pin = digitalio.BlahBlah
except RuntimeError: # i forget the exception
   # accept state or deinit() and recreate the object?
#

Though, I'm not sure you'll ever get to a point where both the physical pin state and the Python object survive reset.

stuck elbow
#

you can't deinit the pin if you don't have the pin object

raven canopy
#

Hah! Excellent point... 🤦

zealous barn
#

I don't need the python object to survive reset, but correct that it's pin.deinit() -- I need a deinit(board.NAME)

stuck elbow
#

@zealous barn maybe you could deinit them just before reset?

zealous barn
#

Good idea. Is there a way to detect a reset before it occurs? Rather not have the pins be create/destroyed on every function call with enter & exit

stuck elbow
#

I think you can catch the ReloadException at least for the auto-reset, and you can catch the KeyboardInterrupt for ^C

#

out of curiosity, why do you need the pins to not be reset?

zealous barn
#

Because they control the reset line of a USB hub chip and USB upstream data line DPST switch. I'd rather downstream USB devices attached to the computer not unplug / replug when someone enters the REPL to change board behavior.

#

Biazarre use case I know. I

stuck elbow
#

so the functions that are going to use them are in C anyways?

#

you could look at what release_displays does to handle the never_reset pins

zealous barn
#

No. The MCU runs CircuitPython and upon boot configured the USB4715 with the appropriate register settings, then starts running a monitoring loop. I only want the MCU to reset the USB4715 once per power cycle -- ideally MCU soft resets just run the monitoring loop and don't reset & reconfigure the Hub chip.

#

I can detect if the chip is configured or not via I2C. The only issue is reclaiming / re-using the reset pin (after MCU soft reset) to allow for the user (or code) to force reset the USB4715.

sacred blade
#

Hi everyone ! I fear that the (external) flash on my itsybitsy M4 express is dead... Unable to format it, storage.erase_filesystem() works, but the drive is still not readable for the computer, and os.listdir('/') gives "OSError: [Errno 19] Unsupported operation"

#

Is there anything I can do to troubleshoot this ?

zealous barn
#

Thanks for the guidance all. I'm going to keep working on this -- have to sign off now

stuck elbow
#

@sacred blade what version of circuitpython are you using?

#

@zealous barn good luck

sacred blade
#

@stuck elbow Adafruit CircuitPython 4.0.0-rc.2, but tried with the latest stable (3.x) wit no luck

stuck elbow
#

ok, next up on the checklist is visual inspection

#

anything suspicious? burn marks? shorts? fungal growths?

sacred blade
#

Some green lime from a excess of flux, maybe...

stuck elbow
#

but around the flash chip specifically?

sacred blade
#

The chip near te SCK mark, I suppose ? Nothing special here...

stuck elbow
#

it's that black rectangle next to SCK

#

(sorry, had to check the photo)

slender iron
#

@zealous barn I'd probably do it as a staticly allocated DigitalInOut that you make available in the board module

sacred blade
#

(guessed it from the ship size)

manic glacierBOT
sacred blade
#

But nothing unusual here

slender iron
#

<@&356864093652516868> anything else to get in rc.3?

manic glacierBOT
tulip sleet
#

@slender iron I can't think of anything else.

gilded cradle
#

Nope, I’m good.

slender iron
#

kk, will do it now @tulip sleet. I just got back from the dentist so I'm not in the middle of anything

manic glacierBOT
#
[adafruit/circuitpython] New branch created: tannewt\-patch\-11
simple pulsar
#

@raven canopy Another angle on the problematic first incarnation of https://github.com/adafruit/circuitpython-build-tools/pull/31 is whether there was a better time to schedule it wrt other on-going activities. If Adafruit has a calendar which reflects signficant events then that could be used to schedule when changes happen to fine tune risk and reduce impact from any unforeseen problems. Something like PyCon might trigger a freeze or prompt for higher approval/review.

stuck elbow
#

@sacred blade I would write about this on the support forums

manic glacierBOT
simple pulsar
slender iron
#

no, it's not clear to me what is causing that issue

#

and I don't expect many people to have that issue so it's very low priority

simple pulsar
#

I don't need it to work just seemed rather odd. I've just noticed Ableton sees three things when I have one Feather M0 and 2 CPX in the MIDI setup but for some reason it's still not doing its hash2, hash3 append to give them all unique names.

#

I'd normally assume it would be more unique being a different type of board rather than less unique!

slender iron
#

ya, I have no idea what it could be

simple pulsar
#

I just fired up MuLab and it lists three with the same name (CircuitPython MIDI). I'm starting to wonder if Ableton is using a hacky technique to try and make unique names. I'll do a bit more experimenting later on.

vale zodiac
#

I'm working on a circuit python application and hit a road block -

Does anyone know any model or design pattern where you would have a three-way communication? Like between a Server, an App and a Device?

#

It's like Server-Client-Client

raven canopy
#

@simple pulsar yeah agreed, it may not have been the best time to merge that in. I'll still shoulder my root cause, even if the silver lining was that it highlighted the need for a test "gate" and just as importantly my personal bad method of testing.

raven canopy
#

I'll grab it if no one else is...

slender iron
#

@raven canopy want to merge too?

raven canopy
#

I can, if it lets me.

#

Nope. Still don't have perms.

slender iron
#

ah ok

manic glacierBOT
idle owl
#

@raven canopy Yes you do....

slender iron
#

I just enabled it

idle owl
#

Oh ok

slender iron
#

there are separate branch permissions besides the collaborators

idle owl
#

Ohh ok. Got it.

slender iron
#

😃

manic glacierBOT
#
[adafruit/circuitpython] New branch created: 4\.0\.x
#
[adafruit/circuitpython] New tag created: 4\.0\.0\-rc\.3
raven canopy
#

🎉 "With these new powers, I pledge to wield them with the utmost discretion and only for the betterment of human and robot kind, alike." or something like that. 😆

orchid basinBOT
trim elm
#

Thanks for making me a circuitpythonista!

idle owl
#

@trim elm You're welcome! Anyone can be, but oi you earned the heck out of it.

pastel panther
#

<@&356864093652516868> what is the most likely cause of a i2c Input/output error during a readfrominto?

>>> bd.active_input = 0
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/lib/adafruit_bd3491fs.py", line 191, in active_input
  File "adafruit_register/i2c_bits.py", line 90, in __set__
  File "adafruit_register/i2c_bits.py", line 75, in __set__
  File "adafruit_bus_device/i2c_device.py", line 167, in write_then_readinto
  File "adafruit_bus_device/i2c_device.py", line 97, in readinto
OSError: [Errno 5] Input/output error
tidal kiln
#

wiring

#

is it repeatable?

marble hornet
#

Recurring?

pastel panther
#

It's not wiring,. Or it scans fine at least

#

yes

#

every time, haven't made a good read or write from CP

#

pullups are good

#

I believe the registers are RO but weeno will at least not fail and return garbage (all 1s)

tidal kiln
#

are there other registers you could try?

pastel panther
#

They all do the same thing, at least the few I tried

tidal kiln
#

looks like something new? working on a driver?

pastel panther
#

It's fine, I'll grab the code to bus_device and jump in

#

ya

tidal kiln
#

i'd suggest scoping it

pastel panther
#

I don't follow

tidal kiln
#

logic scope

pastel panther
#

ah

tidal kiln
#

so you can see the actual I2C traffic

pastel panther
#

it seemed like it was going something last I checked but I suppose I can take a more exhaustive look

tidal kiln
#

i pretty much always have my saleewaelaeweeawa attached when writing a driver

pastel panther
#

I had mine hooked up but after the arduino driver went fairly well, I unplugged it

tidal kiln
#

yep. the software gremlins saw you do that. 😃

pastel panther
#

This is the first time the CP driver has been the more challenging of the two

tidal kiln
#

or is it hardware...?

pastel panther
#

I mean, maybe

exotic pumice
#

cool beans

tidal kiln
#

looks like a 5V chip?

pastel panther
#

ya, but sez it can take i2c high as low as 2.3v I think

#

I may just put in a level shifter

exotic pumice
#

that looks like a stereo receiver in a chip

pastel panther
#

basically

tidal kiln
pastel panther
#

ya

#

since vcc can only go to 5-ish I'm assuming that means it doesn't need the logic level to be at vcc

tidal kiln
#

were you using a 5v board with arduino by any chance?

pastel panther
#

ya

#

fiiiiiiine

#

I'll just use the level shifter

#

:pouts:

tidal kiln
#

what are you pulling up to on the i2c line?

pastel panther
#

3v3

tidal kiln
#

ah. you're using register.
are you basically trying to set the value for Input Selector at 0x04?

pastel panther
#

ya

tidal kiln
#

i'll admit to not having used register much

pastel panther
#

It's pretty groovy; does all the bitmasking/etc for you

#

it basically turns chunks of memory into attributes

tidal kiln
#

yep. it's just one of those things i haven't sat down and groc'd yet

pastel panther
#

And Limor made something similar for weeno

#

look at @idle owl 's VEML7700 driver. Pretty straighforward

#

Welp, the level shifter didn't help

#

scope says it's working as intended

#

puts on big boy pants

tidal kiln
#

the transaction looked valid and as expected on the scope?

pastel panther
#

to be perfectly honest I forgot what it's supposed to look like but getting NAKs seems like a problem

tidal kiln
#

another idea - try some low level i2c hacking at the REPL

pastel panther
#

ya

tidal kiln
#

you don't really need to worry about sharing the bus, so just make a busio.I2C object, grab the bus with try_lock and then start talking

pastel panther
#

ya

tidal kiln
#

the basic form looks pretty standard

gilded cradle
#

Which level shifter did you use?

pastel panther
gilded cradle
#

Ok, cool

#

I made the mistake once of using a non-i2c safe one.

#

similar results

pastel panther
#

got a IO error on a writeto; scope shows NAKs again

#

I'm going to read this TI i2c thing

slender iron
#

<@&356864093652516868> release candidate 3 is out and a 4.0.x branch is set for any fixes. master is 4.1 now

lone sandalBOT
tulip sleet
simple pulsar
#

@tulip sleet Thanks, there's quite a bit in there, hopefully something interesting for everyone. I have a fair number of friends with children who have CPX boards and are into music so perhaps it'll inpsire them, and other folk, of course. My first YouTube videos in a guide too. The image you see is my (matte surface) flat screen monitor off its stand and lying flat on the desk with CPX resting on it. I was surprised the technique worked so well for filming.

ruby lake
#

oh, usb midi does midi receive now? nice. I'll have to tinker with it.

simple pulsar
zealous barn
#

@slender iron Thanks for the suggestion. I don't see an example of that (permanent DigitalIO definition) in current board definitions and think it would be easier to just change a few resistors from pull down to pull up on the prototypes I have. That way the MCU can soft reset fully with no "don't reset" pins. Seems like a more robust long term solution.

marble hornet
#

one could theoretically use more than one language in a compiled project right? like c and c++?

stuck elbow
#

sure, as long as the binaries are C-compatible (which they are, most of the time), you can link them together

#

there are some caveats for calling C++ from C, though, but the other way around is relatively easy

marble hornet
#

think this could work in the kernel ? (I mean cp)

manic glacierBOT
tulip sleet
#

@marble hornet it depends on the code, but should work. If it's C++, you'll need to look up how to do C to C++ calling, but it's not hard

#

you'll need to write some wrapper routines, probably

old smelt
#

Has anyone tackled ATWINC1500 support with CP?

tulip sleet
#

@old smelt we are not going to support ATWINC1500 with CP: The Airlift ESP32 stuff is better for a number of reasons.

old smelt
#

Ok

#

Thanks

tulip sleet
#

cost, flexibility, open-source

old smelt
#

Understood

pastel panther
slender iron
#

@simple pulsar two products having the same pid is a bug, please file an issue

tidal kiln
#

@pastel panther did you get it working?

pastel panther
#

not yet. Limor suggested it may be a repeated-start or not issue. I'm going to switch to something else for a bit and come back

tidal kiln
#

yep. it looks to me like it does not support repeated starts.

manic glacierBOT
#

Currently we are using gcc-arm-none-eabi-7-2018-q2-update. 8-2018q4-major is available. There will probably be another release sometime in June 2019.

See this comment, which is interesting, and is cautious about moving forward: https://bugs.launchpad.net/gcc-arm-embedded/+bug/1820593/comments/1.

Compiling the en_US Trinket M0 build with the new release produces slightly smaller code:
2972 bytes free in flash out of 188160 bytes ( 183.75 kb )
vs
`2836 bytes free in flash out of ...

tidal kiln
slender iron
#

@tidal kiln I don't

tidal kiln
#

ok, no worries, just re-discovered that trying to use bitbangio on a metro

#

(because hardware SPI pins are not as easy to get to)

stuck elbow
#

@tidal kiln there are actually several sets of pins you can use for hardware spi on metro

tidal kiln
#

looking... so like other ones that can be muxed internally to spi?

stuck elbow
#

pretty much any pin that has sercom

#

starting with tx/rx ones

manic glacierBOT
tidal kiln
#

and then just pass those in to busio.SPI?

stuck elbow
#

yes

#

I think I used D0, D1 and D2 in my display shield

tidal kiln
#

neat. let me try that. never tried anything other than board.SCK etc.

stuck elbow
#

you can even mix them -- use board.SCK for clock but board.TX for MOSI, etc.

tulip sleet
stuck elbow
#

I now need to find 12 pins I can use with pwm on a samd51

tulip sleet
#

same freq? do you need variable freq?

stuck elbow
#

same, it's for servos

tulip sleet
#

a search like the above should work out ok in that case.

stuck elbow
#

I discovered that after fixing bugs, I can only have 10 pwms on the samd21e, so now I'm redesigning it for samd51

#

yeah, I just need to compile a custom firmware that exposes all pins

#

it's not hard, just boring :)

tulip sleet
#

you could try it on a Metro or Itsy M4, or even just use one of those temporarily as the firmware load, even though the pins are wrong, since the USB pins will be OK.

#

If you choose TCC-capable pins, the TCC's have multiple channels that can be shared in case of same freq (or maybe you know that already).

manic glacierBOT
stuck elbow
#

yes, and the order of initialization matters

#

which makes it a bit trickier

tidal kiln
#

indeed....this goes on for...quite a ways...

>>> import spi_locator
SCK pin: microcontroller.pin.A2          MOSI pin: microcontroller.pin.A1        MISO pin: microcontroller.pin.D2
SCK pin: microcontroller.pin.A2          MOSI pin: microcontroller.pin.A1        MISO pin: microcontroller.pin.D5
SCK pin: microcontroller.pin.A2          MOSI pin: microcontroller.pin.A1        MISO pin: microcontroller.pin.MISO
SCK pin: microcontroller.pin.A2          MOSI pin: microcontroller.pin.A1        MISO pin: microcontroller.pin.MOSI
SCK pin: microcontroller.pin.A2          MOSI pin: microcontroller.pin.A1        MISO pin: microcontroller.pin.SCK
SCK pin: microcontroller.pin.A2          MOSI pin: microcontroller.pin.D5        MISO pin: microcontroller.pin.A1
#

now to try it out...

stuck elbow
#

iirc there are SCK pins and MOSI pins, and any of them can be used as MISO

tulip sleet
#

SAMD51 is more restrictive than SAMD21 in choice of SERCOM pads for SPI, if I remember

tidal kiln
#

(that was Metro M0)

stuck elbow
#

oh, thanks, I will keep that in mind

tidal kiln
#

works! thanks @stuck elbow and @tulip sleet

#

used this:

spi = busio.SPI(board.D13, MOSI=board.D12, MISO=board.D11)

to talk to an RFM69 module:

>>> import rfm69_simpletest
Temperature: 30.0C
Frequency: 914.999mhz
Bit rate: 250.0kbit/s
Frequency deviation: 250000.0hz
Sent hello world message!
stuck elbow
#

are there any non-express m4 boards?

tulip sleet
#

no, but there's latent support: we ran with an internal flash CIRCUITPY while working on external flash support

stuck elbow
#

m4 has more flash, so it might make sense

tulip sleet
#

atmel-samd/boards/samd51x19-bootloader.ld vs samd51x19-bootloader-external-flash.ld

stuck elbow
#

thanks

tulip sleet
#

it was split in half - that was arbitrary

slender iron
#

my gameboy cart only uses internal flash

manic glacierBOT
modest atlas
#

I have a feather m0 rfm96, I'd like to load circuitpython to it, looks like it's the .bin format, I have BOSSA installed but the its version 1.9.1 and it's a GUI version and the adafruit tutorial only shows for the cmd line, any help with this?

tulip sleet
#

@modest atlas you can find bossac inside an arduino installation. If you use the GUI version, MAKE SURE you set the offset to 0x2000 so you don't overwrite the bootloader (if it lets you). Or, even if it doesn't, you'll lose part of the .bin

modest atlas
#

Got it working , thank you

tulip sleet
trim elm
#

Could someone review this PR? I'm trying to put out a release tonight and this was the last tiny thing left to fix

marble hornet
#

@tulip sleet are the code.py and boot.py supposed to not have the block shape around them? in the above link

tulip sleet
#

which link?

marble hornet
tulip sleet
#

that's "code style", like code.py

#

it's ``code.py`` in RST markup

marble hornet
tulip sleet
#

ok, that's a bug; i didn't see that, thanks

marble hornet
#

i'll propose a change

tulip sleet
#

ok, thanks!

raven canopy
#

there's a couple spots. 6 bullets up needs a fix too:

This means you cannot read state from ``code.py`` in the REPL anymore. 
manic glacierBOT
marble hornet
#

hrmm. i though i had already corrected that one 🤔 😕 ah well. @raven canopy look good?

raven canopy
#

yep. just waiting on Travis.

marble hornet
#

i think i missed the reason for the change from md to rst.

raven canopy
#

RTD/Sphinx, as i understand it. Sphinx handles rst natively.

#

there is a library to convert md to rst, but rst is much better at dynamic html generation.

marble hornet
#

ah okay. I must admit i never really learned sphinx 😬 , just wrote python script to output html 😅 . thanks for filling me in tho 😃

raven canopy
#

Sphinx is not easy to learn. i've only scratched the surface on it and rst.

#

well, "not easy" isn't the right term. its just takes time and exposure.

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

This has to do with the default setting of MICROPY_PY_BUILTINS_ROUND_INT, which was added by https://github.com/micropython/micropython/commit/b318ebf1015ced6354f8bbaf035308214b3f5c5d. The original idea was to add handling negative rounding of integers, like round(123,-1), but it took significant extra code, so the flag was added. I'm not sure it was Damien's intention to disallow two-arg rounding of integers completely. I filed an issue there and will see what he says. In the meantime, w...

manic glacierBOT
#

I was reviewing USB PID allocations, as you do, and noted that the PyPortal and GrandCentral M4 use the same one, 0x8032. @tannewt confirmed in discord that this sharing is incorrect.

Here's a summary of all of them in PID order generated from the ports/atmel-samd/board directory:

$ date ; grep USB_PID $(grep 'USB_VID.*=.*0x239[aA]' -l */*.mk) | awk -F: '{ print $2, $1; }' | sort -k 3
Thu 16 May 10:58:36 BST 2019
USB_PID = 0x8012 itsybitsy_m0_express/mpconfigboard.mk
USB...
simple pulsar
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
simple pulsar
manic glacierBOT
tidal kiln
#

@simple pulsar good point, glossed over the board. i think the issue is available timers.

manic glacierBOT
lone sandalBOT
simple pulsar
#

I've got a PyPortal now, a friend from Brooklyn brought it over to the UK for me, just powered it up and an exception error appears on the screen from set_background(). Is that a known issue with the demo code?

lone sandalBOT
tidal kiln
#

what's the exception?

lone sandalBOT
simple pulsar
#

TypeError: extra keyword arguments given

tidal kiln
#

sounds like an out of date library/code issue

simple pulsar
#

Probably, but seems odd to ship them like that. I have two, let me plug in the other one

simple pulsar
#

Other one does more and leaves me on a page with error and suggesting I update secrets.py

tidal kiln
#

if you update secrets.py are you still having issues?

lone sandalBOT
simple pulsar
#

@tidal kiln Thanks, I'm fine and now at 4.0.0 rc3. I really just wanted to alert you to PyPortals shipping with bad demo code on.

tidal kiln
#

thanks. yah. i think some of that is generally known. has to do with some stuff still being in works.

simple pulsar
meager fog
#

we're looking into it

manic glacierBOT
#
[adafruit/circuitpython] branch deleted: tannewt\-patch\-10
#
[adafruit/circuitpython] branch deleted: 2\.x\_crickit\_m0
#
[adafruit/circuitpython] branch deleted: tannewt\-patch\-11
#
[adafruit/circuitpython] branch deleted: deshipu\-patch\-1
#
[adafruit/circuitpython] branch deleted: asf4
#
[adafruit/circuitpython] branch deleted: asf4\_neopixel
#
[adafruit/circuitpython] branch deleted: test\_2\.x
#
[adafruit/circuitpython] branch deleted: programming\_guide
#
[adafruit/circuitpython] branch deleted: pdm
#
[adafruit/circuitpython] branch deleted: neopixel
#
[adafruit/circuitpython] branch deleted: tannewt\-patch\-4
#
[adafruit/circuitpython] branch deleted: license\-badge
#
[adafruit/circuitpython] branch deleted: add\-image\-badge
#
[adafruit/circuitpython] branch deleted: tannewt\-patch\-5
#
[adafruit/circuitpython] branch deleted: tannewt\-patch\-6
#
[adafruit/circuitpython] branch deleted: tannewt\-patch\-7
#
[adafruit/circuitpython] branch deleted: tannewt\-patch\-8
#
[adafruit/circuitpython] branch deleted: tannewt\-patch\-9
#
[adafruit/circuitpython] branch deleted: rtd\_test
#
[adafruit/circuitpython] branch deleted: sdcard
#
[adafruit/circuitpython] branch deleted: dm\-mixer
simple pulsar
#

Changing subject, I'm curious what the motivation was for the LC (low cost) version of the PyBadge was https://www.adafruit.com/product/3939 - was main motivation to get to a price point where it's more likely to be considered a give away gift for badge use? A friend and I are discussing vague plans for a summer camp and we might put some hardware in there. What's the spec for PyGamer variant going to be?

lofty nova
simple pulsar
lofty nova
#

Ouch missed it. Very very pretty !

manic glacierBOT
faint ibex
#

Does the new sysfs pwm stuff in blinka work? I seem to be running into an issue getting it to find my pwm channels.

meager fog
#

its only enabled for the coral, you can PR to add it for yours

#

you have to tell it the names/channels, etc

#

check Coral PR

faint ibex
#

I was just working on getting the PR together. I have everything in there similar to the Coral. I don't have the channel error anymore. Another error, I will keep messing with it.

meager fog
#

😃

#

you can do it!

faint ibex
#

I think there is an issue in linux with setting the duty cycle greater than the period

#

or something to that effect

meager fog
#

i could hve made some bugs too

#

i got it working with the guide as i wrote it

#

fixes wlecom 😉

faint ibex
#

Sure thing, I will keep poking

manic glacierBOT
simple pulsar
tidal kiln
#

that's another thing that changed

#

update your library bundle to latest

simple pulsar
#

I worked it out and added to the post. I'd be interested to know what the intention of the try code is at https://github.com/adafruit/Adafruit_CircuitPython_PyPortal/blob/master/adafruit_pyportal.py#L58 - it's currently confusing for new PyPortal owners. Is the code intending just to remind users to upgrade? If so, it needs a sleep after the print to allow user time to read it and if it's not going to be a terminal error then it might be better to do a file exists test or some form of less damaging import.

#

The update instructions do not say to remove the existing lib directory at the moment

tidal kiln
#

that's like a check and a failsafe:

try:
    from adafruit_display_text.text_area import TextArea  # pylint: disable=unused-import
    print("*** WARNING ***\nPlease update your library bundle to the latest 'adafruit_display_text' version as we've deprecated 'text_area' in favor of 'label'")  # pylint: disable=line-too-long
except ImportError:
from adafruit_display_text.Label import Label
#

if you're running with an older version of the library, the import will work and you'll get the warning

simple pulsar
#

The code then blows up later

tidal kiln
#

if you're running with the current version, the import will fail and the correct import is done in the exception handler

#

yep. see the warning.

simple pulsar
#

The warning cannot be seen as it's on screen for about a quarter of a second

#

That import then blows up later with an exception and no quote is seen on screen

#

The warning is more of an error (in severity terms) as the code as it is at the moment cannot work with that library present.

tidal kiln
#

it'll work with the current version of the library

#

that view issue is sort of a general issue with the new display

#

previously, you had to connect to serial output

#

that still works - so you would see the error there

#

for the display, having the CP stuff on the screen is super new

simple pulsar
#

On Windows I am not seeing COM entries for my two PyPortals, I've not looked into that.

#

But I have got a PyPortal, I've followed the upgrade instructions and the demo code fails with an exception for reasons that a typical user would not be able to decipher

#

Oh, cancel that, I missed this step First, delete all the files from your CIRCUITPY drive (so you don't have any old lingering files)

tidal kiln
#

for the COM port - do you have any other CP devices? if so, same issue with them?

simple pulsar
#

I've got a CPX attached at the moemnt and that's fine

#

That can wait til tomorrow

#

I've updated forum post with a note on the step that I failed to follow - others must have missed it to.

raven canopy
#

i can agree with @simple pulsar on what he's saying though. why not raise an exception there? continuing on, only to have it fail later seems confusing.

simple pulsar
#

@raven canopy The only reason to do that (carry on) would be if it worked with some versions/combinations of libs, possibly prior ones, I don't know any history here.

raven canopy
#

but it won't work... TextArea is never called in the proceeding code. only Label is. which will raise an exception, no?

simple pulsar
#

It looks that way from a quick glance, the pyllint suppression suggests it too

tidal kiln
#

i think it's there for Reasons(c)

#

i can see that whole try/except eventually going away

tidal kiln
#

oh. yah. that issue. there you go.

manic glacierBOT
#

I did some more looking at Bluetooth File transfer. There are some pre-existing specs There's OBEX, a general object exchange protocol which is used for IrDA, Bluetooth, USB, and other protocols. GOEP (Generalized Object Exchange Protocol) is a Bluetooth profile based on on OBEX. There's a File Transfer Profile (FTP).

https://en.wikipedia.org/wiki/OBject_EXchange
https://en.wikipedia.org/wiki/OBject_EXchange#Protocols
https://en.wikipedia.org/wiki/List_of_Bluetooth_profiles#File_Transfer...

granite crow
#

I'm using the adafruit_bus_device

manic glacierBOT
simple pulsar
tidal kiln
simple pulsar
#

@tidal kiln A good point, I've not yet got into PyPortal coding

tidal kiln
#

then it's probably the RGB status you linked

#

that's a general CP thing, for boards that have a RGB, so applies to PyPortal also

simple pulsar
#

I'm just searching for docs on what status_neopixel=board.NEOPIXEL does with colours

tidal kiln
#

the PyPortal library (class) let's you pass in a pin to be used for status

#

it's expected to be a pin to which a NeoPixel is attached, but it can be any pin

#

for boards with a builtin NeoPixel, that pin is board.NEOPIXEL

simple pulsar
#

The meaning of the colours is what I was after. That might help someone else too, I thought I'd seen someone asking about a possible disconnection issue

tidal kiln
simple pulsar
#

My COM port is still AWOL for PyPortal. I tried latest mu as I'd seen some discussion about how that scans for devices. When I plug it in there's no complaint about missing device but clicking Serial fails with dialogue. Windows device manager shows no COMx for it. mu's error log as viewed from settings is 2019-05-17 11:30:56,181 - mu.logic:1110(change_mode) INFO: Workspace directory: E:\ 2019-05-17 11:31:00,012 - mu.modes.base:221(find_device) WARNING: Could not find device. 2019-05-17 11:31:00,012 - mu.modes.base:222(find_device) DEBUG: Available ports: 2019-05-17 11:31:00,012 - mu.modes.base:226(find_device) DEBUG: ['PID:0 VID:0 PORT:COM1'] 2019-05-17 11:31:00,059 - mu.interface.main:701(show_message) DEBUG: Could not find an attached device. 2019-05-17 11:31:00,059 - mu.interface.main:702(show_message) DEBUG: Please make sure the device is plugged into this computer.

tidal kiln
#
# blue = connected
# red = not connected
# yellow = fetching data
# green = got data
#

do you see the CIRCUITPY folder?

simple pulsar
#

yep, and mu has found it as E:

#

The CircuitPython MIDI device is showing up in device manager and if I walk around the properties i see Driver Management has concluded the process to add Service usbaudio for Device Instance ID USB\VID_239A&PID_8032&MI_05\6&F36488&0&0005 with the following status: 0. so that looks correct and confirms other USB things are fine

tidal kiln
#

@simple pulsar thanks. added a few more possibilities to thread.

manic glacierBOT
#

Thanks for this! I actually implemented it myself but haven't merged it in because it plugs the keyboard directly into CircuitPython's serial input. My changes are here: https://github.com/adafruit/circuitpython/compare/master...tannewt:ps2io

I'd be happy to merge in this low-level stuff but would prefer it in a separate ps2io module. Having it in pulseio means it will be included in every build that wants PWM. With a separate module we can turn on and off the functionality independently.

simple pulsar
#

That Windows serial driver is 10.2.3.2 dated 30-Jul-2018, I'm about to go look to see if there's a newer one

manic glacierBOT
#
[adafruit/circuitpython] New branch created: tannewt\-patch\-4
#
[adafruit/circuitpython] New branch created: tannewt\-patch\-5
simple pulsar
#

@tidal kiln I put some detail in https://forums.adafruit.com/viewtopic.php?f=60&t=151872 on serial issue and Windows for PyPortal users. I think it'll mainly confuse existing (as they are likely to have installed device drivers sometime back which work for most boards) Adafruit users. Might be worth ensuring the wording in the Troubleshooting guides and the PyPortal secific Learn stuff reads well wrt this issue

manic glacierBOT
manic glacierBOT
#

Fixes #1890.

Set MICROPY_PY_BUILTINS_ROUND_INT = 1 for all builds, which implements round(n, <negative ndigits>), so that, for instance round(189, -1) will round to the nearest 10.

Also tweaks the implementation so that even if MICROPY_PY_BUILTINS_ROUND_INT = 0, round(<int>, <positive ndigits>) will still work. Previously rounding an int with a specified ndigits would throw NotImplementedError.

Adds 151 bytes or so to a build.

#

Fixes #1890.

Set MICROPY_PY_BUILTINS_ROUND_INT = 1 for all builds, which implements round(n, <negative ndigits>), so that, for instance round(189, -1) will round to the nearest 10.

Also tweaks the implementation so that even if MICROPY_PY_BUILTINS_ROUND_INT = 0, round(<int>, <positive ndigits>) will still work. Previously rounding an int with a specified ndigits would throw NotImplementedError.

Adds 151 bytes or so to a build.

#

@kevinjwalters OK, sorry, misread your error report. Yes, the reporting of it as a Grand Central is due to PID mismatch. However, all the CircuitPython boards install the same driver, so it doesn't really matter. I'll need to update the drivers at some point to add new boards.

If you are at all able to upgrade to Windows 10, I would recommend it, since all this would go away. However, I can understand if your machine is stuck on that or it's personal preference or admin reasons.

Does MI...

simple pulsar
#

@tulip sleet Win 8 on my desktop is coz I don't want to invest the time and money to upgrade. My rarely used laptop is Win 10 but I lent that to a friend so I now need to burn it / re-install it to purify it. I may "upgrade" Win 8 to OSX but it's a big step for me!

tulip sleet
#

@simple pulsar if your desktop is a Dell, my experience has been that it's still possible to upgrade a Dell for free to Windows 10. I do this all the time. At this very moment I'm prepping a refurbished Dell laptop to upgrade it from 8.1 to 10.

simple pulsar
#

Interesting. It's a 1999 dell dimension xps 500 (over 2000 USD new) but only in its case. I rammed a more modern asus motherboard into it with some masking tape plugging the gaps to tame the airflow.

tulip sleet
#

it has to be a Dell BIOS, ah well

simple pulsar
#

Useful to know though. I still use the original Dell PSU with its non standard connector for powering Dotstars - it groans a bit when you light up 300 of them. I've got good use out of the remnants.

#

The Microsoft crowd are asking for more info on that FAT12 bug thing https://twitter.com/zooba/status/1129209615743299584 - even if all the info is out there I'd say it's worth spoon feeding them as it would be great to get this fixed.

@kevinjwalters @qubitron We have a question about exactly which file systems are affected - FAT12 or 16, and what capacities? Do you have a page or bug somewhere with accurate details? It's hard to plan a next step, and acquiring/testing all possible devices isn't feasible.

fluid helm
#

Hey everyone, having trouble reading an image from an SD card on my PyPortal. Anyone around to help me out?

#
import board
import storage
import adafruit_sdcard
import os
import digitalio
import busio
from adafruit_pyportal import PyPortal

spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
cs = digitalio.DigitalInOut(board.SD_CS)
sdcard = adafruit_sdcard.SDCard(spi, cs)
vfs = storage.VfsFat(sdcard)
storage.mount(vfs, "/sd")

cwd = ("/sd"+__file__).rsplit('/', 1)[0]
countdown_background = cwd+"/countdown_background.bmp"

pyportal = PyPortal(status_neopixel=board.NEOPIXEL,
                    default_bg=countdown_background)
                    
while True:
    pyportal.set_background(countdown_background)
tulip sleet
#

@simple pulsar I'll reply to that tweet. I have LOTS of details.

umbral dagger
#

I just backed the 32blit at the Beta Tester level. CircuitPython will be really nice on this.

simple pulsar
#

@umbral dagger I asked about that in questions

#

The reply about micropython/circuitpython plan (3 days ago) was Initially we're going to focus on the C++ SDK and our Lua layer over that. It certainly *could* run MicroPython/CircuitPython though, it has plenty of power for that!

umbral dagger
#

Yes, the specs are really nice., I don't expect them to get CP running on it.

#

Although MP/CP support would be a nice stretch goal 😃

simple pulsar
#

Indeed. I think they were hinting at a minor h/w upgrade for initial goal x3

#

@tall yacht what doesn't work. I've got a brand spanking new PyPortal plugged in and rather randomly i have a selection of SD cards out

fluid helm
#
ValueError: SCK in use```
#

@simple pulsar

simple pulsar
#

Is that coming from the line where the PyPortal object is created?

fluid helm
#

yep

simple pulsar
#

An uneducated guess is that your code and PyPortal are trying to make it. That would suggest a way is needed for only one to make it. There's an arg you can pass in if you've already made it. I'd give that a go.

#

Add external_spi=spi to your PyPortal arg list

#

Just a guess but a reasonable one

fluid helm
#

TypeError: unexpected keyword argument 'external_spi'

#

nope

#

didn't like that 😦

simple pulsar
#

My libs are dated (by filestamp) 22-Mar-2019

#

I'll see what mine does

#

Me too. I would download that latest file (adafruit_pyportal.py) and give it a go. It may not be in sync with other libs but you've got nothing to lose at the moment.

#

@fluid helm good luck, I'm off now, if you get it working I'd suggest a post to forums to let others know. if you don't, perhaps do the same.

manic glacierBOT
tidal kiln
manic glacierBOT
cedar lichen
#

Hi, question re: pyportal. I've got a diy keyboard that connects to a serial uart. Ie: 3 pins with 5v, ground and 1 tx pin. Can I connect this to pyportal to read from the keyboard?

#

Ideally to interact with the repl

#

It looks like the hardware uart for samd is connected to the esp32

exotic pumice
#

you can probably connect to the i2c port and change the sercom to do uart instead

#

pyportal has an i2c port right?

quasi fjord
#

you'd probably need a resister to bring the 5V from the TX pin down to a safe 3.3v, then switch the i2c pins to be a UART instead like sajattack said but that seems reasonably doable

exotic pumice
#

I believe there's a selector

#

jumper

#

interacting with the repl will probably take a fair bit more work

quasi fjord
#

I think that's just for the +V output of the connector, you'd need need to bring down the voltage if the device is outputing 5V. You can try powering your keyboard at 3.3 instead of 5 and see if it still works

umbral dagger
#

You could use a level shifter breakout.

cedar lichen
#

Hmm thanks for tips, Does the hardware already on the portal need the i2c for anything?

#

The hardware guide seems to indicate the pyportal by default wants 5v?

raven canopy
#

@tidal kiln mangled Bundle release: looking at the Travis log, seems like there was a hiccup with deploying to GitHub. i was tempted to just restart the Travis job, but not sure how nice that even plays on a good run. hopefully tomorrow runs without hiccups.

fading solstice
#

has any else had problems with Adafruit_EPD in CP 4.x recently. I am getting an error assiging a int to a bytearray item. OverflowError: value must fit in 1 byte(s)

lofty nova
#

HI @fading solstice , I've read a few messages in the past days about a change in one of the latest rc* which broke other modules with the same error. I'm not sure if it occured in rc2 or rc3. Which release do you have ?

crimson ferry
#

rc3 fixed the issue that arose in rc2

main meteor
#

Yes, that's a new change, intended to point out possible bugs triggered by attempting to put values into variables into which they will not fit. You can fix it by constraining the value to one that will fit in a byte.

crimson ferry
#

There was also an issue where True and False wouldn't 'fit' in a byte, and that's fixed in rc3

fading solstice
#

@lofty nova 4.0.0 rc3

lofty nova
#

So for @fading solstice , I would believe that until the EPD library is updated to be aligned with the new policy, he shoud revert to rc1 ?

fading solstice
#

Maybe i should just fix EDP library

lofty nova
#

That's always better to be part of the solution

#

I'm too often part of the problem 😦

crimson ferry
#

"If you're not part of the solution, you're part of the precipitate"

lofty nova
#

Long time I've not played with chemistry

modest atlas
#

Using a feather m0 rfm96, any way to add external spi flash to allow me to use the oled and the rmf module at the same time, having memory issues already

#

It seems it will not let me create an instance of SPI and I2C at the same time

#

It will however let me store the necessary libraries on the feather

lofty nova
#

external flash will not help you with memory issues

#

only with code storage

#

Have you converted most of the *.py to *.mpy ? That makes a difference

raven canopy
lofty nova
#

If I understand, the bottom-left started a screen on the top-left to your metro with a screenlog file which is displayed on the top-right

#

and you're sending commands to the top-left session from the bottom-left term

raven canopy
#

yep. exploring an automated "phyiscal test environment" controlled by an RPi.

#

trying to avoid having to use UART, and have as much UX mimicked through USB.

lofty nova
#

What do you mean by UART ? using the separated TX/RX pair on the Metro instead of the USB CDC ?

raven canopy
#

yeah.

lofty nova
#

So through the USB CDC you can send easily commands to the REPL instead of having to code something on the Metro (for a UART protocol)

raven canopy
#

yep. still very early. thought process goes something like this: RPi has a webhook to trigger tests, downloads the necessary firmware (release, PR, etc), puts connected boards into bootloader mode, copies firmware over, copies over unittest files over, then uses screen to run the tests and capture results.

lofty nova
#

Do you need to hook a physical wire to do the double-reset trick to put the board in bootloader mode ?

raven canopy
#

currently plan on using the microcontroller.reset function, but a backup plan if that doesn't work is to use the RST pin.

granite crow
#

Hi, is there a way to control the status led from the repl?

#

I am trying to add support to use RGB LEDs as status leds, I had defined a new board with 3 pins to control the RGB led, implemented the rgb_led_status_init function initializing the three pins as pwmout, and also implemented the new_status_color function, but I can't see the led changing colors at all

modest atlas
#

@lofty nova and pointers on the py. To .mpy conversion

lofty nova
#

Let me check...

#

Which OS ?

#

You need mpy-crosstool to convert a *.py into a compiled *.mpy. It saves memory when loading because otherwise CircuitPython load the full TEXT of *.py in memory and compile it in-place. So loading the pre-compiled version save memory

#

I can't find a pre-built executable for v4.X but the 3.x version I'm using is still working with CiPy 4.0 ...

granite crow
#

I guess not but is cp compiled with debug symbols enabled?

#

I'm trying to debug a bin for nrf52840 feather, I'm using make BOARD=feather_nrf52840_express to build it

#

By checking at the makefile I assume that adding DEBUG=1 builds CP with debug symbols?

sly falcon
#

@solar whale @crimson ferry howdy! You both are awesome! Sorry I've been out-of-touch...personal life got turned on its side and then getting back into coding things took a bit of time.

#

My testing of the 1.3.1 build of the nina-fw has also gone well. I just got code added to the adafruit_esp32spi_wifimanager library that supports WPA2 Enterprise mode....I somehow forgot to actually spend some time testing WPA2 Enterprise 🙄 stupid life getting in the way of me having a life lol

#

After I let this enterprise support burn for 12ish or so hours, I'll put things together to submit a PR tomorrow for the NINA firmware and also my additions to the wifi manager library to support Enterprise mode

solar whale
#

@sly falcon life does happen 😉. I hope it’s going well! I’m away from hardware for the next week or so but look forward to updates. Good luck!

simple pulsar
raven canopy
#

@simple pulsar yeah. Travis deployment to GitHub had a hiccup. Service side, not ours (that i can tell). i'm hoping it runs today so i can see what's up.
EDIT: here is the specific ded message:

/home/travis/.rvm/gems/ruby-2.4.1/gems/octokit-4.6.2/lib/octokit/response/raise_error.rb:16:in `on_complete': POST https://uploads.github.com/repos/adafruit/Adafruit_CircuitPython_Bundle/releases/17430550/assets?name=adafruit-circuitpython-bundle-2.x-mpy-20190517.zip: 502 - Error updating policy (Octokit::BadGateway)
slender iron
#

<@&356864093652516868> (some who I just added) Here is the meeting notes doc for tomorrow's meeting: https://docs.google.com/document/d/1b6M-KEnnuny2x_3eZn4_ldevk-3DxdYuaHAYJ3_ZShU/edit?usp=sharing It is at 11am Pacific here in the CircuitPython voice and text channels. Everyone is welcome.

granite crow
#

Hi, yesterday while trying to add support for RGB status leds I think I bricked my board and will be able to recover it until tomorrow

#

I declared a custom board, with 3 outputs to drive the RGB led, on the function rgb_led_status_init I initialize the 3 pins as pwmout successfully

#

what I haven't able to do is how to map the uint32_t rgb parameter to the pwm duty cycle of each color

#

The uint32_t rgb value packs 3 8bit values, then I need to extract the 8bit value of each color and map it to a 16bit value for the pwm duty cycle

#

Am I right?

main meteor
#

Probably? ```python
rpwm = (rgb & 0xff0000) >> 8
gpwm = (rgb & 0x00ff00)
bpwm = (rgb & 0x0000ff) << 8

granite crow
#

I like it

#

I will test it tomorrow

#

The least significant byte of the 16bit duty cycle value isn't considered, if I understand correctly

marble hornet
#

I'm working on a new board, think it would be reasonable to use the swo pin as a digital input? (atsamd51j20)

#

running cp of course

lofty nova
#

Don't you need them for the initial programming of the chip ?

marble hornet
#

yes

#

but it is the non-required pin... and is ladled as an io. i'm not sure if it is cp compatible

lone sandalBOT
meager fog
#

@gilded cradle ok for the orangepi r1 - dya wanna do up the guide for it in blinka

#

would be a near-clone of the PC one, just new fritzings i think

#

or if not fritzings, maybe photos

gilded cradle
#

Sure. It's very similar to the existing orange pi guide

meager fog
#

dunno if there's a fritzobj for it

#

yeah hmm maybe you can just add new diagrams to the existing guide then?

gilded cradle
#

Ok, that would probably work better

meager fog
#

ok cool yeah i mean, i think armbian is 99% the same

#

just check the I2C, SPI and UART

#

you can pretty much do the same tests i did, its a good way to check all the ports

gilded cradle
#

Yeah, sounds good.

meager fog
#

another one you can do after is an ODroid C1

#

but honestly if you end up shopping at a 'sbc store' just get one of each

#

i did the odroid code and half the guide

#

i think it just needs a last check

#

and at the odroid store also get an odroid go 😃 fun

gilded cradle
#

Ok

#

I also have a Pine64 A64 SBC

#

@meager fog, just to verify, you meant get one of each of all the different oDroid products. Is that correct?

tired cloak
sly falcon
#

@tired cloak hi there. I saw some other chatting about this earlier today....looks like it's a known issue on the Travis service side and the auto-generated bundles aren't happening correctly right now

tired cloak
#

@sly falcon, ahh thanks, just wanted to make sure it was known!

meager fog
#

@gilded cradle yeah get 1 of each odroid boards

#

i think once you get one going, the rest are very similar

manic glacierBOT
gilded cradle
#

Ok thanks. I decided to not get the ODROID-MC1 since it was basically 4 of the ODROID-MC1 Solo with a fan.

meager fog
#

np yeah

#

even tho there's a lot of boards in the odroid/orangepi family they're not very different, and at least they all use the same distro - i think armbian

#

which is a pretty good distro

gilded cradle
#

Yeah, I've been using that on my Pine64 for a while

meager fog
#

we added PWM sysfs support so you can use that for sure if they expose PWM pins

gilded cradle
#

Ok

meager fog
#

and we can add ADC sysfs support too for analogin, its never very good but maybe for basic pot readings itz ok

gilded cradle
#

yeah

manic glacierBOT
manic glacierBOT
#

The file system of my PyPortal just got corrupted by me renaming a file as reported by chkdsk. I renamed cache.bmp to cache-iffy.bmp. That triggered a reload, of course. It's also more complicated because this is the nasa image viewer from Adafruit Learn and that makes the storage accessible and writeable. I've tried a chkdsk e: /f whilst at REPL prompt and it claims to be better now.

exotic pumice
#

is pybadge/gamer st7735r?

gilded cradle
#

Yeah

exotic pumice
#

thanks

manic glacierBOT
#

@dhalbert Did you create a separate bug/enhancement issue ticket to look at the file read triggering a reload? I've just noticed even inspecting file properties (was looking at /cache.bmp on a PyPortal) from the Windows Explorer GUI triggers a reload.

There is metadata that's written by Windows sometimes (like access times) that we can't distinguish from other writes. If you have some file monitoring, indexing, or anti-virus software on your machine, it can aggravate this. I don't thin...

manic glacierBOT
#

I'm not sure: did you want to submit this to circuitpython or micropython?

Looking at https://docs.python.org/3/library/binascii.html#binascii.hexlify, it appears that CPython doesn't take a second argument in any case. We aspire to be the same as "regular" Python or be a subset, not a superset, so just dropping the second argument is something we'd probably do in the long run.

manic glacierBOT
#

it's a good question... I'm happy to make a PR removing it instead if you'd like.

I was pondering adding the feature to CPython but realistically, binascii.hexlify is redundant in CPython as bytes, memoryview, and bytearray all have a .hex() method as well as a .fromhex() method on bytes and bytearray - no legacy module function needed. If I were to add it to CPython it'd likely go on those methods.

MicroPython doesn't appear to have those. They would get rid of the nee...

manic glacierBOT
manic glacierBOT
#

+1 To having CircuitPython work the way you'd do it in CPython. (Though it's tricky if you, @gpshead, makes it a moving target. :-P)

Here is the git voodoo I think you'd need:

  1. Create a new branch git checkout -b <new branch name>
  2. In your local CircuitPython repo: git remote add micropython git@github.com:micropython/micropython.git
  3. Then git rebase -i micropython/master. It should show four commits in the prompt (same as the PR). It should rebase just fine because I don't ...
manic glacierBOT
#

It's odd though that a properties view triggers that.

I've been trying to debug a problem with PyPortal / Adafruit IO, see https://forums.adafruit.com/viewtopic.php?f=60&t=151923. I need to be able to preserve images from the file system when it misbehaves for debug.

Years ago a colleague proposed mounting a ufs filesystem read-only from a second host concurrently. I had to explain why even that wasn't safe as there were no read locks, no memory cache coherence and worse case we could c...

manic glacierBOT
#

@gpshead If you'd like to make a PR to remove it that's fine. But another thing on the lis to do is to refactor extmod/modubinascii.c into shared-bindings and shared-module, as we've done with some other modules. It would probably make sense to leave extmod/modubinascii.c and remove the second arg as part of refactoring.

I notice we're missing issues for this refactoring, so I'll open individual ones. Added #1899 for binascii.

manic glacierBOT
tidal kiln
#

@idle owl @slender iron won't make meeting today. group hugs 2 all.

idle owl
#

@tidal kiln Thanks!

manic glacierBOT
trim elm
#

@idle owl Probably won't be able to make the meeting today. I might lurk if I can. Here's my status update:

I was able to finish adding all of the location and gps-related NMEA sentences that the GPS FeatherWing supports. I was able to do a bunch of testing and I learned even more about the NMEA protocol. I put out a release for that, and was able to use the new features in a personal project I was working on. I also was able to fix a few issues, merge some PRs, and close some issues that had been left open. This week, I want to do some more testing of the MCP23008 and MCP23017 modules to make sure there aren’t any issues with the recently refactored MCP230xx library.

idle owl
#

@trim elm Thanks! I'll add it to the notes.

trim elm
#

@idle owl Do you think you could run the thing that updates the contributing page on the circuitpython website? Thanks

idle owl
#

@trim elm How do you mean?

#

Oh you mean update the page?

trim elm
#

Yeah

idle owl
#

Yeah I'll do that, thanks

trim elm
#

Thanks!

swift arrow
#

am I going to the wrong spot for the CP libraries for all the adafruit goodies?

raven canopy
#

@swift arrow there was an issue between the CI service and GitHub, and the job failed before all bundles were deployed. It's being monitored.

swift arrow
#

I should be ok using the May16th with the latest RC though correct?

raven canopy
#

Yep.

swift arrow
#

danke!

raven canopy
#

bitte!

swift arrow
#

😃

#

It's funny how excited one gets when they get their first "hello world" of leds working.. the single blinking led on a breadboard. 😃

#

exactly! 😃

sly falcon
#

haha

#

so much blinky! 😄

main meteor
#

It is truly a good feeling.

swift arrow
#

So I have it working with DigitalIO.. but one should be able to control brightness if they use Analog out correct?

#

I'm trying to find an example but no luck so far

#

just using a GrandCentral, and a 10mm red LED on a breadboard with a 400 Ohm resistor.. using CP of course.

#

found it

idle owl
#

<@&356864093652516868> CircuitPython Weekly starts in about 10 minutes. Everyone is welcome!

tulip sleet
idle owl
#

@tulip sleet Thanks!

lofty nova
#

Same guide but 3 pages further

errant grail
#

Lurking today.

swift arrow
#

Wooohooooo more blinking goodness!

opal elk
#

hi folks! could I be removed from the circuitpython-helpers group? much as I'd like to I haven't had time to do much of anything with it in... forever, and so I keep getting pinged in the group

#

also hi, I hope all is well 😃

idle owl
#

@opal elk Of course, but you're welcome to be a part of it even if you're not involved 😃

slender iron
#

waves at @opal elk

raven canopy
#

👋 @opal elk. hope things are well!

idle owl
#

@opal elk I removed you. Let us know if you'd ever like to be added back!

opal elk
#

thank you! hopefully someday.

sly falcon
#

is lurking

#

Sure - thanks, Scott!

old smelt
#

Lurking

gilded cradle
#

Gonna be a little late

pastel panther
#

no, I can hear

idle owl
#

@inland tusk Restart Discord

simple pulsar
#

I'm lurking

idle owl
#

@simple pulsar Thanks!

sterile bronze
#

lurking

simple pulsar
#

Crystal clear audio in London too

slender iron
#

@inland tusk are you using the app or are in a browser?

idle owl
trim elm
#

Thanks @idle owl for adding me to the Github organization. In the small amount of time I’ve definitely learned a lot more Python by looking at PRs and issues. Thanks @pastel panther for the MCP230xx modules. Also, thanks to everyone who reviewed my PRs.

turbid radish
#

Never a problem @idle owl

pastel panther
#

@gilded cradle 🎉

gilded cradle
#

Thanks everyone 😊

raven canopy
#

there's always time to eat 🌮s.

turbid radish
#

@meager fog 's coding skillz are in a separate, rarefied category

idle owl
#

@pastel panther 😄

slender iron
gilded cradle
#

🍴

pastel panther
#

🍴 blinka

raven canopy
#

🔱

meager fog
#

whew excitingi nternet outage

#

im here now

slender iron
#

@meager fog I can go to you after sommersoft

#

@prime flower I read your notes off

prime flower
#

@slender iron thank you!

meager fog
#

@slender iron sure

turbid radish
meager fog
#

Don't Ask Its Not Siddacious Yet

turbid radish
#

oooh, Super Top Secret projects

meager fog
#

@pastel panther btw i added the SPI HW & SW to LPS as the test but yea plz do some testing

pastel panther
#

oh ok, thanks 😃

raven canopy
meager fog
#

hah

#

no audio

#

sorry

raven canopy
#

gotta drop off. brb, i hope

meager fog
#

wait for me

#

do something else 😄

pastel panther
#

hardware party 🎉

gilded cradle
#

Congrats Brent 🎉

meager fog
#

YAY

prime flower
#

Thank you!

idle owl
#

@sly falcon Ping me directly as well and I can go through it with you.

gilded cradle
#

I've been ready for a while

turbid radish
#

Do It!

#

The twitter bot will get it once GitHub registers it

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 4\.0\.0
inland tusk
#

hurrah

turbid radish
gilded cradle
#

Thanks Everyone

turbid radish
#

Thanks all!

pastel panther
#

👋

neat folio
#

totally distracted... 😦 good thing it all gets recorded! 😃

idle owl
manic glacierBOT
simple pulsar
meager fog
#

whats with the 🍴

simple pulsar
#

It originates from Scott's use of the phrase "stick a fork in it" when referring to 4.0.0 rc3's readiness for GA release.

orchid basinBOT
manic glacierBOT
#
[adafruit/circuitpython] New branch created: 4\.x
#

I've got a wireshark capture of this if that's of any use? No great revelations based on my inexpert (at USB) glance. When it behaves normally it shows a 208 byte response which I think is 27 header + 181 data. When it doesn't work there's an 80 byte response and then a 157 when user hits a key, as I hit enter an extra CRLF is appended explaining the 183 = 80-27+157-27.

swift arrow
#

oh dear.. my led stopped blinking

#

think I fried pwm output

#

it was blinking for like 30 minutes and just stopped

#

is there a way to tell it to stop soft rebooting?

#

I'm on windows 10

manic glacierBOT
tulip sleet
#

@slender iron I won't mess with the 4.0.x -> 4.x branch stuff until you're done, unless you're all done in github, but it should say 4.x in the pointer to readthedocs

stuck elbow
#

That OverflowError is really not something that should be done in RC

meager fog
#

4⃣ 4⃣ 4⃣ 4⃣ 4⃣

slender iron
#

@tulip sleet I think I setup rtd for it already

stuck elbow
#

I just fixed stage, but I'm afraid we might have more broken code there

slender iron
#

@stuck elbow I'm releasing 4.0.0 now. get it into the 4.x branch and it'll go out with 4.0.1

meager fog
#

🍀

stuck elbow
#

@slender iron so 4.0.0 will have broken Stage?

tulip sleet
#

we will have a 4.x branch shortly

stuck elbow
#

great

slender iron
#

I didn't know it was broken. is there an issue for it that I missed?

tulip sleet
#

@slender iron can I rename the branch yet or are you still building?

slender iron
#

I already pushed a 4.x

stuck elbow
#

wawa reported it yesterday, I didn't have time to test rc4 because I was travelling

#

I just fixed it now

#

didn't have internet on the plane on sunday night, sorry

slender iron
#

np, I'll list it as a known issue. when you are confident with it we'll do 4.0.1

stuck elbow
#

I'm confident with it now

slender iron
#

"I just fixed stage, but I'm afraid we might have more broken code there"

stuck elbow
#

sorry, by 'there' I mean 'out there'

#

not in stage itself

#

but across all the libraries and drivers

slender iron
#

oh, ya. totally possible

#

there are always bugs