#circuitpython-dev

1 messages ยท Page 248 of 1

stuck elbow
#

a breaking change like that warrants a major version bump, in my opinion, and not something for rc4

#

well, that's why we do testing

#

to find those bugs

#

and fix them before a release

slender iron
#

too late, we can do 4.0.1 next week

tulip sleet
#

@slender iron so I'll delete the 4.0.x branch? I already cleaned up the GitHub branch protection rules.

slender iron
#

I'm not sure

#

I think we'll want a 4.0.x milestone to track bugfix issues

#

4.x will be features

tulip sleet
#

features are on master

#

until we start doing 5

slender iron
#

I'm talking milestones

#

would we blow minds if we dropped the master branch in favor of 4.x?

tulip sleet
#

I'd do fixes on 4.x. The milestone can still be 4.0.x -- it doesn't have to correspond to a branch name.

slender iron
#

kk

tulip sleet
#

if we had a version # roadmap for features, we could have a 4.x instead of master (or 4.1, 4.2, etc.), but we don't. We just have to make sure to merge back and forth as necessary.

stuck elbow
#

x can stand for 0 as well

tulip sleet
#

i'm still thinking about whether what I said makes sense. Trying to remember what we did for 3.0 and 3.1

slender iron
#

k, made a "4.x.x - Bug fixes" and "4.x - Features" for milestones

stuck elbow
#

by the way, what is the support policy for released versions?

tulip sleet
#

3.1 was only 3.1.0, 3.1.1, and 3.1.2

stuck elbow
#

now that 4.x is released, is all 3.x unsupported?

simple pulsar
#

We used to only put features in m or m.n versions and keep m.n.p for fixes when I worked on "real" software in a different world

slender iron
#

@simple pulsar that's our goal too. we try to follow "semantic versioning"

tulip sleet
#

they all have three numbers

slender iron
#

@stuck elbow I'd say technically yes but we won't break 3.x for a bit

#

(meaning library compatibility)

tulip sleet
#

we're still shipping boards with 3.1.2 and will be for quite some time due to stock. We're not going to reprogram stock

stuck elbow
#

@slender iron I'm more interested in bug fixes, rather than breaking :)

#

hey, espressif just released a board with usb support!

tulip sleet
#

@timber mango it says it's "USB OTG", so host mode (only)??

stuck elbow
#

otg means both host and device

tulip sleet
#

ok

slender iron
#

@stuck elbow I don't know of any 3.x bugs worth fixing and doubt there are ones lurking since it's been out so long

stuck elbow
#

@slender iron sure, but what is the official policy?

tulip sleet
#

There's "we won't make a new 3.x release", and there's "we won't help you with 3.1.2". The latter will be a while. There's not really a policy (like "we support two versions"). I think it has to do with when we gain confidence in 4.x.

manic glacierBOT
slender iron
#

@tawny creek is your translation better described as Tagalog or Filipino? cc @turbid radish

simple pulsar
#

Going back to working on "real" software, the one thing we failed to do (internally) was to publish a calendar of support status dates, e.g. the various phases of EOL. The big s/w houses like Oracle are pretty good at this. I'd imagine even Microsoft do it. Perhaps a lightweight/simple/indicative verison of that is worth considering? It allows your users to plan ahead.

stuck elbow
#

it's scary to base your own hardware on it without such promises

simple pulsar
#

I noticed this has relevance to non critical software the other day. I found a whole load of educational material using MIT Scratch. I wondered whether they had updated it to V3 which has a fairly different user interface. They had and that must have been a non trivial amount of work.

tawny creek
#

@slender iron The language itself is called Tagalog, but Google and others that refer to it use Filipino

#

Filipino to me describes the nationality

tulip sleet
#

I see there are two different ISO codes "fil" and "tgl", but I think the first is the major use, is that right?

slender iron
#

I don't think we can make promises of support as a CircuitPython project as a whole. Board support needs to be done by the creator of the board. What we can do is ensure a process for testing and accepting fixes.

stuck elbow
#

so if I made a board with esp8266, for example, I would now be forced to fork CP and do my own support?

tawny creek
#

@tulip sleet I agree, It sounds weird to say (even in Tagalog) "I speak Filipino", school classes/courses refers to it as Tagalog too

slender iron
#

I feel like I did diligence with the 4.0.0 release because I asked for objections in the meeting (no one had any) and the 4.0.0 milestone was empty.

#

@stuck elbow yes

tawny creek
#

Also good reminder! I need to update it with the latest CP, ๐Ÿ˜Š

stuck elbow
#

or with the nrf52832

slender iron
#

well, no. you can maintain the port in the circuitpython repo

#

I'm ok taking prs in to fix things

#

I don't know of anyone willing to do it for esp or nrf

tulip sleet
#

@tawny creek we are just wondering how to describe it in a sentence. Would you say "CircuitPython now has a Tagalog (Filipino) translation" or something else?

slender iron
#

I'd still want it rebrand due to the lack of usb

stuck elbow
#

how much of a warning are we going to get when samd21 is going to be scrapped?

slender iron
#

it won't be scrapped as long as someone wants to maintain it. given how many adafruit boards use it I think it's safe to assume that adafruit will maintain it for years

tawny creek
#

@tulip sleet that sounds pretty accurate to me!

tulip sleet
#

@tawny creek Thank you!

stuck elbow
#

sure, but if it was, for whatever reason, how much time we would get? a week, as with the rc4?

tawny creek
#

I can speak some dialects that are considered Filipino but isn't Tagalog

slender iron
#

who knows. we're not there. I waited until the meeting to check on the 4.0.0 release so it's safe to assume we'll meet before making such changes

tulip sleet
#

so not as extreme as "Chinese", which is meaningless as a language name, but similar

#

(as a spoken language name); written is diff

tawny creek
#

Yup, accurate to say it is a Filipino translation but even more as Tagalog :)

tulip sleet
#

sound good, since the language code "fil", the "(Filipino)" will help explain that to the uninitiated

#

tnx again!

slender iron
#

@tulip sleet want to update the release notes?

tawny creek
#

Anytime!

tulip sleet
#

@slender iron ok, will do!

slender iron
#

the website just says Filipino too

tulip sleet
#

@slender iron I was looking at the 3.x.x versions. we did introduce new features in the ..<n> numbers, very minor. They were minor feature additions, usually (serial_bytes_available ,for example)

slender iron
#

ya, we can decide as we reach them

simple pulsar
#

@tulip sleet I used to refer my fellow developers to the written policy when they wanted to do that. It worked eventually.

tulip sleet
#

@simple pulsar I think it was a psychological thing about not pushing people to upgrade for very minor things: 3.1.2 instead of 3.2

slender iron
#

so what branch did we decide on for bug fixes?

tulip sleet
#

eehhhh

slender iron
simple pulsar
#

It is very odd to end up arguing about a numbering scheme and perhaps even stranger for developers who have all agreed to follow a standard to then ignore it, for the case of my former world of software

slender iron
#

@tulip sleet how about 4.0.x? 4.x is just there for rtd

tulip sleet
#

ok, that's fine, but we'll need to merge from 4.0.x to 4.x. That's OK.

#

I was thinking yes, we should have branches that mean something.

#

but I think our decision long ago to drop "stable" was good, because it was so uninformative

slender iron
#

ya, we should pick one to PR fixes and then merge them over to master

tulip sleet
#

I already have at leaset PR for merging into 4.0.x

#

so we'll have people submit to 4.0.x.

slender iron
#

kk

tulip sleet
#

@timber mango, so please submit PR's against branch 4.0.x for fixes

manic glacierBOT
tulip sleet
simple pulsar
#

What determines the size of tx USB packets for REPL output? Is is the app, the tiny usb library and/or the hardware. It doesn't seem consistent so I'm guess it's not just the app.

tulip sleet
#

@simple pulsar at the low level, it doesn't accumulate characters, so I think it's just the size of the buffer that gets passed down. The dropped characters you're seeing may be USB code or may be higher up

#

at least I don't think it does accumulate. It will send what you ask it to send

#

@simple pulsar at some level there may a be circular buffer which overflows because it gets behind: someone is sending faster than the USB drivers can push the characters out

#

@slender iron I edited release notes for tagalog (and re-alphabetized). Didn't see forum or blog posts yet.

manic glacierBOT
slender iron
#

@tulip sleet haven't done them yet so they'll have edits. still waiting on the last travis build to finish

#

we'll need to improve the release upload process soon. it now takes a lot of job restarting

#

could polish up the azure stuff at the same time

simple pulsar
#

Do you know if wireshark shows some sort of simplified version of the USB packets by default? I don't think I'm seeing "token packets" but i'm still reading about how all this works.

slender iron
#

695 release assets for 4.0.0

#

@simple pulsar wireshark is from the kernels perspective so you won't see the lowest level

simple pulsar
#

disgraceful

slender iron
#

@tulip sleet doing the blog and forum posts now

#

I don't know how it'd get the lowest level of data

#

that is what a beagle or other sniffer is good for

tulip sleet
#

@simple pulsar I think it's unlikely there's an issue at the USB transport level. It's far more likely to be a buffering issue

simple pulsar
#

Indeed, it would just be comforting to see what's going on, particularly coz it sounds like in USB land the host has responsibility for asking for data from device

tulip sleet
#

There is plenty of bandwidth in USB land. We have had issues with too-small buffers on the CircuitPython side before.

simple pulsar
#

Is tinyusb library handling all the USB comms including the output from REPL down the serial console thing?

tulip sleet
#

@simple pulsar yes, and there's a layer above tinyusb that does the buffering inside circuitpython

simple pulsar
#

IF I'm seeing output on PyPortal then does that rule out the circuitpython buffering or is that usb specific buffering?

tulip sleet
#

they both do some buffering; I'd have to look at the code

#

ok, it looks like there's not necessarily buffering writing the string. It's simply that CPy calls tud_cdc_write() over and over until all the bytes are written. This is in supervisor/shared/serial.c

#

tud_cdc_write() calls tu_cdc_n_write(), which calls tu_fifo_write_n(). If you write too fast, the fifo will wrap around and you'll lose characters. There is this commented out code:

#if 0 // TODO issue with circuitpython's REPL
  // flush if queue more than endpoint size
  if ( tu_fifo_count(&_cdcd_itf[itf].tx_ff) >= CFG_TUD_CDC_EPSIZE )
  {
    tud_cdc_n_write_flush(itf);
  }
#

That is in lib/tinyusb/src/class/cdc/cdc_device.c.

#

So it looks like CircuitPython could check to see if there's enough space in the buffer to write more.

#

There's no synchronous waiting for the buffer to empty at the tinyusb (tud) level.

#

So we can fix this.

simple pulsar
#

ok, i'll have a glance at it, I think going from zero to hero in a few hours with usb is perhaps a bit optimistic for me..

tulip sleet
#

The code there that's checking the fifo count could be hoisted up, or maybe we should be calling tud_cdc_n_write_flush(). I'd have to ask Thach about this.

#

There perhaps should be more API that lets us figure out how much space is left in the buffer

#

I can ask him when he wakes up (he's on the other side of the world).

#

don't feel obligated to try to fix this yourself. I'll add notes to your issue.

manic glacierBOT
#

Diagnosing:

supervisor/shared/serial.c calls tu_cdc_n_write(), which calls tu_fifo_write_n(). If too many characters are written too fast, the fifo will wrap around and characters will be lost.

Note that in ib/tinyusb/src/class/cdc/cdc_device.c, there's this commented-out code:

#if 0 // TODO issue with circuitpython's REPL
  // flush if queue more than endpoint size
  if ( tu_fifo_count(&_cdcd_itf[itf].tx_ff) >= CFG_TUD_CDC_EPSIZE )
  {
    tud_cdc_n_write_flush(itf);...
trim elm
#

I was working on some testing with the MCP23017 and I noticed that the examples in its Adafruit learn page haven't been updated to reflect it recently being refactored. Is that something I could fix or if not, who should I talk to about this?

simple pulsar
#

@tulip sleet I'm curious about the lack of locking around reads in that fifo code. I'd imagine this is irrelevant for CircuitPython but it looks a bit iffy. Is the code relying on atomic reads for 32 bit quantities? Can you ask author about that too? I see a few places where it's reading multiple values from the fifo structure without a lock but perhaps this is highly optimised so that it's only done when the values changing between statements would be safe with assumption of a single reader

tulip sleet
#

@simple pulsar I'll ask

#

@tidal kiln ^^ MCP23017 guide examples

orchid basinBOT
tulip sleet
#

@stuck elbow are you deprecating ugame10 in favor of pewpew?

manic glacierBOT
#

I'd prefer to return the byte (typically an ACK) because it is kind of out-of band. If you use get_byte()^Wpopleft() to get the response, there could be other bytes there already, and flushing() the buffer before calling send_byte() would not be 100% guaranteed because a byte can arrive between the last popleft() and send_byte(). I agree raising and exception in place of negative returns which current version uses to signal errors.

manic glacierBOT
manic glacierBOT
manic glacierBOT
simple pulsar
manic glacierBOT
#

In addition to observations on Discord about locking not extending to all the read operations on the values in the fifo that can change (perhaps relying on atomic locks and/or typical style of use).

I see another very minor issue which will probably never get exercised and might well be harmelss even if it was, there's a drop in int precision for bufsize, comes in unsigned 32bit but then used 16bit:

$ fgrep -B 2 tu_fifo_write_n ./lib/tinyusb/src/class/cdc/cdc_device.c
uint32_t...
manic glacierBOT
tidal kiln
#

@tulip sleet @trim elm MCP230xx guide updated. thanks for catching that.

swift arrow
#

congrats on the CP 4.0 release!

manic glacierBOT
#

thank you very much for putting effort to look at the issue. The cdc fifo read/write doesn't need mutex protection, since all cdc_read/write are all invoked in main's thread, never within ISR. The mcu never switch the task while calling those API. Mutex is only needed in RTOS environment where preemption is possible.

indeed the uint32_t cast to uint16_t is inconsistent but it shouldn't be an issue since the fifo size is less likely larger than 64KB ( 128/256 in this case).

I am in th...

manic glacierBOT
#

If this only affects serial writes then I would say it's not overly important to address quickly.

I find it easy to reproduce on REPL and if there's a good way to debug a board where you can see what function is being used that would give away what's going on. For REPL if you keep trying to reproduce it it then the frequency of occurrence dramatically drops, it's almost as if it goes into hiding!

simple pulsar
#

What's the best document(s) to read to understand how the PyPortal display works? I'm more interested in the internals on the code than the current library, partly to understand why it's so sluggish from CircuitPython

tidal kiln
simple pulsar
#

Do you know what's the absolute max frame rate update for the screen based on its interface? Can the screen take partial updates? I'm curious what upper limits are?

slender iron
#

the screen can take partial updates and we aren't doing it now

#

take a look at arduino examples to know the upper limits

simple pulsar
#

Thanks, I was going to rummage just hadn't gotten around to it.

orchid basinBOT
simple pulsar
#

For that thing where CircuitPython code can remount CIRCUITPY as writeable but allow access from the host, is there a way to do that so it only remounts a subdirectory writeable to make it less dangerous?

manic glacierBOT
slender iron
#

@simple pulsar no because the mounting is done below the filesystem at the block level

#

it's a trade-off we make to get the universal support for the usb drive

main meteor
#

I can't help wondering how hard it would be to make either two USB drives or two partitions.

slender iron
#

I reeeeeeaaaallly don't want to do partitions because they are never the size you need

main meteor
#

Point.

slender iron
#

I do want to do multiple drives for sd cards at some point but then they have the same concurrency problem

#

this challenge is another reason to support BLE file transfers because we can do them at the file level rather than blocks

simple pulsar
#

I might modify the NASA code to save to the SD card slot if that's easy

slender iron
#

shouldn't be too bad I think

simple pulsar
#

Does PyPortal do bluetooth?

slender iron
#

no

manic glacierBOT
swift arrow
#

wow the CP 4.0 release is so low key.. not even mentioned on the front page of adafruit.

#

I expected at least party hats

#

๐ŸŽ‰

slender iron
#

anyone want to try some experimental display code?

sly falcon
#

Want to, yes. In a place to, sadly no ๐Ÿ˜ž

slender iron
#

k np, should be able to PR it soon

stuck elbow
#

@tulip sleet no, but since the builds for ugame10 are now all broken, I will have to host the firmware for it somewhere else

tulip sleet
#

@timber mango GitHub still has all the old releases; you could point there for now.

slender iron
#

@stuck elbow make another PR to the 4.0.x branch and I'll make a release later with it

meager fog
#

beep boop ๐ŸŽฎ coming soon

#

@stuck elbow if you want one...

slender iron
#

gets excited

celest zenith
#

I have a question about busio.SPI.readinto() is it possible to get less bytes than requested? and if so how can I tell how many bytes were read?

meager fog
#

@celest zenith spi isnt structured, it will always read the # of bytes that you requested, unlike I2C there's no ack for data

#

so it would be whatever's on the pin

celest zenith
#

what if nothing is there? would that raise an exception?

slender iron
#

if nothing is on the bus then you'll read random bits

celest zenith
#

ah I see.

#

Looks like I need to delve deeper into the hardware side.

manic glacierBOT
meager fog
#

grab em if u want em

sly falcon
#

wooo!

manic glacierBOT
prime flower
#

anyone have time to review a library PR? I think it's at a good state.

#

@sly falcon I left some comments on the WPA2 Ent. PR you submitted, looks great. I'm planning on testing it on thursday at my university's wpa2-enterprise network.

sly falcon
#

@prime flower Thanks! I saw those...I have some time this evening to get back to that PR and start looking at things

prime flower
#

Yup no rush, it should be functionally fine when I test it. My comments were cosmetic.

sly falcon
#

@prime flower I hafta admit, I'm embarrassed that I totally biffed it and didn't fully change the thermocouple stuff over to the wifi stuff ๐Ÿ˜Š

prime flower
#

@sly falcon heh, no biggie. That's why we do reviews. A bunch of CircuitPython-IoT libraries rely on the ESP32_SPI_WiFiManager (Adafruit IO, Microsoft Azure IoT). This'll be a great thing to have as it'll make them WPA2-Ent compatible "automatically"

sly falcon
#

Oh wow - that's super cool! I had no idea the ramifications of the changes I'm working on! haha

#

This all started as a "wouldn't it be neat if I could have the PyPortal display something cool on my desk at work?"

#

Plus my buddy/co-worker was taking our uni's intro to programming CS class this semester and it's in Python, so I gifted the PyPortal AdaBox to him...figured he might want to use it at work, too

prime flower
#

It's awesome, it'll get classrooms internet-enabled with blinka

quasi fjord
#

@sly falcon I don't have a build environment setup, but I can test against eduroam if you have artifacts I can load on a pyportal (esp firmware & matching .mpy)

sly falcon
#

@quasi fjord Thanks! Gimme a minute and I can dig up links for you. BTW - the library is just .py files...I have a lot of clean-up and a bit of refactoring before the pull request will be accepted

#

you should be able to toss the .py library files into the lib directory on your CircuitPython device of choice and use them as you would the distributed .mpy files

#

I didn't create docs or example code showing how to use the WPA2 Enterprise functionality in the WiFi Manager library, but it should mostly just work...you'll need to add some new items to your secrets.py file, which you can find in the adafruit_esp32spi_wifimanager.py file

#

Also... it's not mentioned anywhere, but the WPA2 Enterprise stuff only works on networks that use a username/password...which is what my campus uses. Certificate authentication isn't supported

old smelt
#

@slender iron - get any takers on your experimental display code request?

#

I confess I did not scour all the messages since you asked.

slender iron
#

one person wanted to but couldn't

#

it appears to be a bit faster with the quote demo

#

poking the font loading code now

old smelt
#

Ok. I'll have some time later tonight if you still need feedback. My PyPortal is at home. ๐Ÿ˜ฆ Thought it was here at the office. I need to get my M4/TFT setup going again.

slender iron
#

np ๐Ÿ˜ƒ

old smelt
#

Sorry for the bait-and-switch. Not intentional

slender iron
#

no worries

old smelt
#

So, I put my M4 setup back together, and I am getting errors in the code loading.

  File "code.py", line 40, in <module>
  File "/lib/adafruit_bitmap_font/bitmap_font.py", line 55, in load_font
  File "/lib/adafruit_bitmap_font/bdf.py", line 43, in <module>
ImportError: cannot import name Glyph```

I was going to go and grab the latest release, but this might be a good time to try out something new.
#

font loading, not code

slender iron
#

you'll need the latest core and latest lib

old smelt
#

So, the latest S3 release?

slender iron
#

or 4.0.0

#

my work isn't pushed yet

old smelt
#

Ok. I just installed 4.0.0

slender iron
#

Glyph moved from displayio to fontio

old smelt
#

is that a core module?

slender iron
#

yup

old smelt
#

ok

manic glacierBOT
slender iron
#

kk, I have a speed-up for the font preload ๐Ÿ˜ƒ

slender iron
slender iron
#

yup, definitely a speedup

granite crow
#

Hi, I'm compiling circuitpython 4.0 for a SAMD21E18 based board so I can get the elf file and debug the calls to new_status_color function. I'm compiling the source code as is, but the elf file I got seems corrupted, I load the elf to the target and halt it on reset, the registers values, the stack pointer are mostly F's. I don't know how to tell what I'm doing wrong, any pointers or tips?

slender iron
#

@granite crow seems like those registers could be ok if you just reset the cpu

granite crow
#

I had tried by loading the elf and then doing mon halt reset, then mon regs and I see those values, then continue but I'm getting a fault, I'm not in front of my pc right now but I can sent the session output once I get there

slender iron
#

try setting a breakpoint at reset_into_safe_mode to catch errors

manic glacierBOT
old smelt
#

@slender iron - had to run off to some meetings. Iโ€™ll give it a whirl later tonight.

meager fog
#

might be good for AT stuff - took a while to find a place that would make them the way i wanted em ๐Ÿ˜ƒ

tulip sleet
#

@slender iron (or anyone with a comment) I was thinking that we might introduce new features in 4.1.0-beta.<n>, and when we consider them all cooked, we can release a final 4.1.0. The PR's could be against branch 4.x or master. We didn't do betas for non x.0.0 releases before, but we could start.

sly falcon
#

@tulip sleet I'm new around these parts, so take this with a huge grain of salt, but I like this plan. I'm also a fan of the 3rd number being incremented for bug fixes and other minor stuff. Features bumps the middle number, but huge things and breaking changes gets a major number bump

tulip sleet
#

@sly falcon tnx, that has been our intention (https://semver.org), but we haven't been as faithful to that in the past: we've added minor features with the last number. If we can train people to expect the middle number ot increment quickly, I think we'll be fine.

sly falcon
#

haha...there is a website for everything, isn't there?

tough flax
#

@meager fog thatโ€™s awesome! It will be a great way to adapt things on a semi-permanent basis! Thanks for thinking about us!

meager fog
#

๐Ÿ˜ƒ yep!

#

i did - also its good for audio projects but specifically i was thinking this would be helpful for quick AT button connects

#

keep making cool stuff to inspire me ๐Ÿ˜‰

manic glacierBOT
tough flax
#

Probably the most powerful is that you can make at switch->HID keyboard/mouse without solder using the cpx!!

meager fog
#

yep!

#

totally

tough flax
#

While I have your ear... ๐Ÿ˜ƒ Iโ€™d love a wing/breakout that has an op amp circuit for better FSR sensing (and other times you need adjustable gain) ๐Ÿ˜ƒ

#

The minute op amps are involved Iโ€™m certain my board designs will add too much noise

meager fog
#

yeah FSRs kinda suck :/

#

hard to use

tough flax
#

But so ridiculously useful for AT

#

You donโ€™t have to life your finger off the switch

granite crow
#

Thanks @slender iron, I will do so

fathom basalt
#

Another option, a load cell, and a load cell amplifier might be more flexible and accurate, and tunable to a specific user's range of motion.

crimson ferry
#

@slender iron Not sure exactly what you're after, but I'm always happy to test. I have most of the FeatherWing displays.

tough flax
#

@fathom basalt the membrane switch has its used but is on/off. Variable input is critical because we can do lots more in the processing dept. we can activate on the differential, denounce better, set multiple actions for hard/soft press etc.

#

Debounce

#

Load cells might be useful but I think they needs amps as well right?

fathom basalt
#

Yep, and the amps are readily available.

tough flax
#

Iโ€™ve used FSRs with just a voltage decider and they work well for some things. But adjustable gain would be very helpful

fathom basalt
#

The load cells are used in just about every scale you can buy.

tough flax
#

Divider (new phone is learning electronics)

fathom basalt
#

Load cells are a lot more accurate than FSRs.

#

Much more consistent and repeatable.

tough flax
#

But the ones Iโ€™ve seen are much larger

#

FSRs can slip under a finger

#

Remember weโ€™re looking at <10g equiv of force

fathom basalt
tough flax
#

Ok, those might solve other problems but I donโ€™t see how it gives us adjustable gain or the tiny size of the FSR. Thanks for the input though

fathom basalt
#

Surely. These are very sensitive to change, via the load cell amplifier, and I would expect to be able to differentiate between very small pressures. Postage and kitchen scales can weigh a few grams accurately and repeatably.

manic glacierBOT
fathom basalt
#

I don't believe there are any accurate scales that use FSRs.

#

I still like FSRs for applications that don't need load cell precision, though.

main meteor
#

I read "decider" as "comparator" and it basically made sense.

gilded cradle
#

Hi @meager fog, I have a quick question regarding the PyBadge. Do you know if on the LC version that board.NEOPIXEL has a length of 1 or 5? Thanks

meager fog
#

1

gilded cradle
#

Thanks

meager fog
#

im always here to give #โƒฃ

stuck elbow
#

@slender iron sure, thanks

#

@meager fog thank you, but I won't have the time for a bit

old smelt
#

Is the TFT on the PyBadge the same one that's on the 1.8" TFT joystick shield? (Product 802)?

stuck elbow
#

yes, ST7735R

old smelt
#

Thanks @stuck elbow

#

So, could I approximate a PyBadge with an M4 Express and that shield?

#

Tempting to buy one, but I already have a mountain of electronics I'm not using. If I could McGyver something together that's close, it makes for a fun exercise.

#

...and I already have the shield/M4.

stuck elbow
#

the buttons are handled differently

#

on that shield they use Seesaw, on the pybadge it's just a shift register

old smelt
#

Right - there would need to be some code mods for the joystick and buttons.

stuck elbow
#

you can take a look at how the stage library handles the pybadge and the mini tft wing

lone sandalBOT
old smelt
#

@slender iron - great job on the Podcast.init interview. Lots of good background info on the origins and philosophy behind CP. Thanks!

manic glacierBOT
onyx hinge
#

Congrats and thank you everyone for CircuitPython 4.0!

slender iron
#

@stuck elbow ping me when you have a new pr please

#

@tulip sleet beta release sound good to me. I was thinking we'd at least do rc. maybe we do beta -> stable directly for them

stuck elbow
#

@slender iron sure, sorry, still at work

slender iron
#

k np. I'm around off and on for the next 8 hours or so

#

then vacation ๐Ÿ˜ƒ

stuck elbow
slender iron
#

perfect! looking now

#

waits for travis

slender iron
#

@stuck elbow FYI I'm waiting on github notifications to work with travis again. Even if I merge your PR I won't be able to release so I might as well wait

stuck elbow
#

@slender iron no worries, I already have a fixed binary to give to people who'd complain

#

this got me a bit by surprise, because I was at the maker faire berlin, and didn't have a chance to test rc4

slender iron
#

we never released an rc4, it was rc3 released 8 days ago

#

yup, sorry it was a bit quick. thought we were close to the end but know that the overflow check threw some things off

manic glacierBOT
slender iron
#

โ˜ github webhooks are alive again!

orchid basinBOT
manic glacierBOT
manic glacierBOT
#
[adafruit/circuitpython] New tag created: 4\.0\.1
slender iron
#

fyi I canceled the 4.0.x branch build in favor of the 4.0.1 one

swift arrow
#

so can we start the 4.0.1 party? ๐Ÿ˜ƒ

old smelt
#

@slender iron - back to the podcast for a moment... My ears perked up when I heard you mention potential long range plans that could include FPGAs. My company operates at the intersection of micros and FPGAs, and I'd love to chat on this topic sometime if you're game.

slender iron
#

@old smelt totally. I've got my eye on the open source fpga toolchain stuff

old smelt
#

Like Migen? ?

#

Have you looked at MyHDL at all? One of the main contributors, Chris Felton, is a friend of mine and was just here last week talking about it to some of our team. Cool stuff. Different than CP/MP, but related, IMO, at least as far as the kind of stuff I'm interested in.

slender iron
#

@old smelt and the underlying icetools and whatever the newer one is

orchid basinBOT
slender iron
#

mostly interested in a usb peripheral that tinyusb can support

#

plus a bootloader for the fpga that can drag and drop new configs

#

I haven't looked at myhdl

old smelt
#

Yeah, a drag and drop bootloader would be very cool.

manic glacierBOT
old smelt
#

It's one of my favorite things about CP.

#

Took me 5 minutes to upgrade all my hardware to 4.0

slender iron
#

ya, and I'd love to see the fpga SoC tools generate datasheets and some standard register layout machine readable file

#

nice!

old smelt
#

The idea of a "standard" anything across the FPGA vendors is...well...non-standard. ๐Ÿ˜ƒ

#

Or, as I have heard it said, "the great thing about standards is that there are so many of them."

slender iron
#

haha, ya

#

something standard for the open toolchains at least

#

I don't have interest in vendor tools

old smelt
#

Understood

slender iron
#

would be very cool to have a stable of different SoC images for different things

#

then most people wouldn't need to generate bitstreams at all

old smelt
#

Right. That's a goal I like as well. Give users access to the benefits of FPGAs without needing to scroll into the tools or HDLs.

slender iron
#

totally

old smelt
#

It's tricksy

slender iron
#

and then we could reorganize circuitpython around peripheral implementations instead of chip families. ๐Ÿ˜ƒ

#

yup, that's why it's on my way back burner

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 4\.1\.0\-alpha\.0
old smelt
#

I can understand that. But I am motivated to push it toward the front - at least for what we are doing - because I love using Python for the micro development. I think it opens the door to a lot of developers who might not even be giving FPGAs a second glance right now.

slender iron
#

I'd love it if you'd help get it there. ๐Ÿ˜‰

#

tagged 4.1.0-alpha.0 so builds off master don't say rc.3 plus some stuff

quasi fjord
#

@sly falcon no love on eduroam with the pyportal. It doesn't seem to even try. The connecting line just repeats as fast as the serial link can show it

stuck elbow
#

@slender iron interesting approach with the areas and masks -- you could probably even use dma transfers for the case of no transparent pixels

manic glacierBOT
slender iron
#

@stuck elbow ya, or a key color if there are. I glanced at the docs for the Chrom-ART in the stm32h750 when brainstorming how to do it. ๐Ÿ˜ƒ

stuck elbow
#

it also uses the cpu cache much better

slender iron
#

I'm not super happy with the extra bitmask for transparency but it's easy-ish to implement and works

#

same is true for the filesystem cache which is row-associative as well

stuck elbow
#

having to work with 16-bit colors is a drag, otherwise you could have the mask same depth as the data, and really & them while blitting

slender iron
#

missing that really hurts because fatfs always loads the full 512b block

stuck elbow
#

I do that for the sprites on the 1-bit oleds

slender iron
#

ya, I'm not exactly sure how things will change once we support different output bit depths

stuck elbow
#

and the mask, then xor the sprite data

slender iron
#

hrm, got a link to where you do it?

#

ah ok

stuck elbow
#

the blit() function in the last listing on that page

slender iron
#

k thanks!

stuck elbow
#

sorry, one-but-last

slender iron
#

I'll read it all ๐Ÿ˜ƒ

stuck elbow
#

I miss Amiga's hardware blitter

slender iron
#

we could probably use a module for faster bytearray manipulations

#

once could xor each byte to each other

#

or we make a superbytearray

#

๐Ÿ˜›

stuck elbow
#

ultra_mega_bytearray_turbo

#

deluxe

slender iron
#

haha, definitely

stuck elbow
#

my original plans for MicroPython were to turn the framebuf into a generic "image container" similar to your area

slender iron
#

or neobytearray to go adafruit style

stuck elbow
#

and then to build the scenes bottom-up, by blitting layers upon layers (with overdraw)

slender iron
#

ya, that approach would make it easier to do partial transparency too

#

next on my list after vacation is dirty rectangle tracking

stuck elbow
#

like blending?

slender iron
#

ya

#

blending isn't super high on my list

stuck elbow
#

one thing I never got to, which is very fun to do, is optimizing the dirty rectangles by merging them

slender iron
#

ya, I've spent a long time trying to decide how to do that

stuck elbow
#

basically when the unused corners of the encompassing rectangle are smaller than the overlap, you merge them

slender iron
#

I think my current approach is somewhat like a merge sort

#

hrm, I hadn't thought of it like that. I always assumed I'd make three rectangles out of it

stuck elbow
#

of course the order of merging matters

slender iron
#

I think I'll force myself to ignore merging to start

#

it'll still be faster without it

stuck elbow
#

yeah, it actually doesn't provide much speedup

#

but it's very fun from the algorithmic point of view

slender iron
#

definitely

#

I'd also love to differentiate overlapping sets of areas to prioritize some for update over others

#

since we can't push a full frame in one refresh cycle

manic glacierBOT
swift arrow
sly falcon
#

@quasi fjord ๐Ÿ˜• well that's less than ideal....

swift arrow
#

and 4.01 the second.. seems weird.

manic glacierBOT
sly falcon
#

@quasi fjord regarding the insane repeating of that line, yeah...I thought about reworking that portion of the loop, but left it as-is for now. The non-enterprise version of the loop keeps poking the ESP32 to connect. There is no real equivalent on the enterprise side. You just have to be patient and wait for the ESP32 to do its thing. If you don't turn on debugging you obviously won't see that nearly-infinite scroll, but yeah...I hope to fix that in a later version

stuck elbow
#

because 0 sorts before 1

sly falcon
#

@quasi fjord regarding the non-working eduroam....I don't have any clues off the top of my head. I can bring my test setup with me to the office tomorrow and give it a shot. I didn't bother trying our eduroam AP. That said, I have no nearby campus I can go to to really test whether the code works in that sort of environment

quasi fjord
#

@sly falcon yeah, I pulled that print out of the loop. I was able to have someone check the admin side of the system and it didn't register any activity from that Mac address. The expresif examples have a _start() call after the _ent_enable()

tulip sleet
manic glacierBOT
swift arrow
#

WOW!! I am mentioned by name in a Git CP issue!!! I'm someone important now! ๐Ÿ˜ƒ

sly falcon
#

@quasi fjord I seem to remember looking at that when working on the NINA firmware side.....let me bring my setup to work tomorrow and see what I can see and then we can go from there

#

@quasi fjord all that said, I super appreciate the testing and help! ๐Ÿ˜Š

lime trellis
#

@sly falcon @quasi fjord might this be helpful?

#

documents my process for custom nina-fw firmware for ESP32SPI and working eduroam code

#

@slender iron @tulip sleet have you come across a high-level micropython flowchart illustrating the VM/byte code execution by any chance? ๐Ÿ‘ผ

sly falcon
#

@lime trellis hey I just started following you on Twitter! haha... Anyways, I checked out the issue, but I'm sorry - I'm missing what specifically you're pointing to...it is the end of my workday, so it could entirely be my brain is fried heh

lime trellis
#

@sly falcon I just saw mention of NINA firmware and eduroam but couldn't find your initial convo with @quasi fjord so I threw that out there in case it'd be helpful

tulip sleet
#

@lime trellis no such thing that I know of

#

there might be something in video talks by Damien, but probably not at that level.

sly falcon
#

@lime trellis oh, ok, cool! I appreciate it. Looking at your repo, it looks like you're using the version of the NINA firmware where I added the WPA2 Enterprise support and my example CircuitPython code. Glad to hear it's working for you!

lime trellis
#

@tulip sleet good to know! I guess I'll be making one for a paper I'm writing on CP for use in satellites. Mind if I run it past you at some point to make sure it's correct-ish?

#

@sly falcon ah! yes I am. Nice work on that!!

#

working great for folks here

tulip sleet
#

@lime trellis You can, though we actually don't need to know the inner workings of the VM all that well. Also, you might post it in the micropython forum and see if you get feedback there

lime trellis
#

Seems like the rabbit hole might be deeper than I expected, then. Thanks Dan

sly falcon
#

@lime trellis thank you!! ๐Ÿ˜Š ๐Ÿ˜ƒ

slender iron
#

ya, I'd suggest starting with videos from damien @lime trellis

quasi fjord
#

@lime trellis I tried that example script too, but still no love.

#

When I enabled esp debugging with my PyPortal class based code I get a constant stream of ConnStatus 1 aka NO_SSID which is wierd because a scan picks up at least two APs broadcasting it.
It could have something to do with our WiFi overlords recently requiring TLS1.2 for all authenticated connections

manic glacierBOT
quasi fjord
#

ah-ha. I was able to setup an "eduwander" at home and connect to that, confirming that the esp32 is only doing tls1.0. If I set the minimum TLS version to 1.2 the connection is rejected.
The secondary issue is that the MAC address is printed backwards somehow so I was looking for the wrong one in the production eduroam tool
@sly falcon I think your firmware and library changes would have work perfectly had I tried them a week and a half ago, before they started requiring TLS1.2. So close

stuck elbow
#

ok, the market of homebrew game consoles is now officially overcrowded

manic glacierBOT
fading solstice
#

Airlift board with a EInk board: 2 SPI devices. Can I share the SCK, MISO, and MOSI lines between the devices?

tulip sleet
#

@fading solstice Sure, as long as they have separate CS lines

fading solstice
#

In the software then, would there be a shared busio.SPI object provided to control libary objects

tulip sleet
#

yes, you pass in the SPI object when you create the ESP32 library object:

spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
esp = adafruit_esp32spi.ESP_SPIcontrol(spi, esp32_cs, esp32_ready, esp32_reset)
fading solstice
#

@tulip sleet I have metro m4 (older model) with airlift and eink 1.54 monochrome. The airlift board queries the IO.Adafruit server and then the value is displayed on the eink board. Both work separately. They also work as a one-shot thing, but when I put them into a loop, the second time thru the loop, the Airlift board can no longer connect and retrieve data. i was looking for ideas to look at.

tulip sleet
#

@fading solstice could be a library bug, could be a latency issue. Update libraries to latest if you haven't already. On the metro m4 you have plenty of pins, so you could try a separate SPI object, so there's no contention. If that hangs there may be some non-SPI issue.

#

hard to tell without looking at the code in detail, but feel free to post it here or in the forums.

fading solstice
#

@tulip sleet i will try separate spi channels for now, but one supposed to work. right?

tulip sleet
#

yes, it should work fine, because the spi locking will cause its use to be serialized. So something is violating that, or it's some other issue entirely

manic glacierBOT
#

While using the cpx, the two buttons crash the entire board after playing a sound. There is no error message and the REPL and serial monitor crash. The buttons are supposed to play a sound when they're pressed. Here is the video of the serial monitor crash: https://imgur.com/O1GLBwN. The board crash is also recorded: https://youtu.be/53wDuqXmbi8. The code that seems to be causing the crash is below

while True:
    if cpx.button_a:
        cpx.play_file("foo.wav")
    elif cpx.b...
tulip sleet
brazen oxide
#

Is there any thought of porting CircuitPython to the announced ESP32-S2 device ? With the promise of native USB it would seem to fit into your board lineup. I teach occasional MicroPython IOT classes at a Makerspace. The ESP8266 Huzzah has been my go to board. But, it really is painful for students to deal with the complexities that come with the USB-Serial converter. This new ESP32-S2 device would appear to solve that.

tulip sleet
#

@brazen oxide The USB version was only announced days ago. It certainly caught our attention. A port to a new chip with its own proprietary peripherals is a major undertaking. Our current Wifi solution is to use an ESP32 as a co-processor. This has the advantage of offloading time-consuming tasks and their scheduling to another processor. It also means the Wifi solution can be changed out if needed. See the PyProtal and our new AirLift line of boards, and there are more coming.

brazen oxide
#

Thanks for the response. I'll stay tuned in, to see where Adafruit heads with this new device.

prime flower
#

you can also update the binary of the firmware running on the esp32 (wifinina) via a circuitpython script, no usb-to-serial flashing required

prime flower
#

Didn't get a chance to ask for reviews on this on S&T yesterday since hangouts was down, but the azure library is ready if anyone wants to review the PR https://github.com/adafruit/Adafruit_CircuitPython_AzureIoT/pull/1

manic glacierBOT
manic glacierBOT
sly falcon
#

@quasi fjord Huh...that's interesting. I'm at work, but I did a tiny bit of poking at the ESP-IDF docs and I didn't see anything that looked like it would prevent TLS 1.2 from working. Even more interesting, is that I can't connect to my own campus' eduroam setup while on my campus. But connecting to our normal WPA2 Enterprise SSID works just dandy.

#

The guy who manages our RADIUS setup is out on paternity leave for a few weeks, so I'm not going to be able to get info on our certificate setup until he gets back.

#

Kinda makes me wonder what Stanford is doing different that is allowing @lime trellis's setup to work ๐Ÿค”

manic glacierBOT
quasi fjord
#

did you remember to switch your userid to your full email when trying eduroam?

sly falcon
#

@quasi fjord yup....the Metro M4 just sits there angrily blinking its LED at me ๐Ÿ˜ฆ

#

I'll play around with it either this weekend or next. I want to wrap up the PR I have for the ESP32SPI library I've been working on first...then I'll go back to poking at the NINA fw

lone sandalBOT
idle owl
#

@tulip sleet Ok, I'll take a look at the guide.

idle owl
#

@tulip sleet There's more to that guide page that refers to copying the entire bundle. I'll have a go at it.

idle owl
#

@tulip sleet If you get a chance, can you take a look at the guide page? I made some changes, updated the section that talks about the bundle download, it was still referring to when it unzipped to lib directly.

tulip sleet
#

@idle owl, good point, that was confusing, and the new screenshots and text are good. The red box at the top still talks about updating from 2.x to 3.x. It should probably talk about updating, preferentialy to 4.x, or at least to 3.x

idle owl
#

Oh good call

#

@tulip sleet Updated.

tulip sleet
#

people could stay at 3.x if they want for a while; do you want to say "need". I guess we'll drop it eventually, not sure when

idle owl
#

Eh, I don't want to muddy it by saying "Seriously, we're not supporting 2.x but you can stay at 3.x for a while if you want"

#

I think it's fine. We'll eventually want everyone on 4.x anyway.

tulip sleet
#

yeah, you're probably right. anyone we're supporting with an issue we'll ask them to upgrade first

idle owl
#

Yep

manic glacierBOT
simple pulsar
#

Hello all. I hadn't realised the cache.bmp file creation was part of the adafruit_pyportal library. There are two different write block sizes in the code, one for built in flash and one for sd card, i see the built in is 12000 bytes but comments as 12k and the sd card is 512 bytes and a comment mentions the bug. Should the 12000 one be 12000 or 12*1024? And, not important, but what's the bug for the second one? https://github.com/adafruit/Adafruit_CircuitPython_PyPortal/blob/master/adafruit_pyportal.py#L751

manic glacierBOT
lofty nova
#

quick question: the library bundle v3 vs v4, what are exactly the difference ? the version of mpy-cross used ? or the release of the libs themselves ?

#

eg: adafruit_sdcard : is it the same code/API in both bundle ?

stuck elbow
#

version of mpy-cross

#

you need the version corresponding to your cp version

lofty nova
#

ok, is there a prebuild version for CiPy 4.0 ? I didn't found it. I don't even remind where I found the v3x version

stuck elbow
manic glacierBOT
lofty nova
#

that's the bundle, not mpy-cross. Or do you look at the wrong place ?

#

I may have not been clear sorry

#

I was looking for the v4 version of mpy-cross

#

sorry

stuck elbow
#

you will have to compile it, I'm afraid

raven canopy
#

i could've swore we had a precompiled mpy-cross-4.x at one point. but, i couldn't find it the other day... @tulip sleet am i dreaming?

marble hornet
#

@slender iron i think i'm really starting to understand the abstraction behind displayio. there are containers (groups) and things that have color and shape (sprites / objects). containers can go inside of other containers .

#

i went through and designed a spec for tg_gui version 3 without thinking about displayio and then later realized it is the same abstractions as the gameboy / displayio abstraction.

tulip sleet
#

@raven canopy et al - you can use the 3.x mpy-cross - there's been no change in the .mpy format

#

I'll make some 4.x mpy-cross executables eventually, but I think they'll work identically.

raven canopy
#

k. i know the previous ones were "happenstance" that the version changes would trip it up. i just could've swore i saw some 4.x before. ๐Ÿ˜„

marble hornet
#

or stand for

tidal kiln
#

that they are typedef'd

strange cargo
#

I was just looking for the API doc on the 're' (regex) package. I looked here:

#

... and it's not mentioned. should it be?

tulip sleet
#

We need to get those into the readthedocs for circuitpython

strange cargo
#

thanks!

manic glacierBOT
manic glacierBOT
#

A few mpconfigboard.mk files have language-specific build requirements, like this:

# Tweak inlining depending on language.
ifeq ($(TRANSLATION), zh_Latn_pinyin)
CFLAGS_INLINE_LIMIT = 23
else
CFLAGS_INLINE_LIMIT = 55
endif

However, build_release_files.py doesn't do a clean build for each language for a board. Only the first language is built cleanly: further builds don't do a make clean; make, but just a a make, reusing already compiled sources. This saves a lot of bui...

timid wind
#

Hey, i'm getting an import error for neopixels on the pybadge, does it not exist for the board yet?

meager fog
#

you need to install the library

#

download from the bundle ๐Ÿ˜ƒ

timid wind
#

thanks, sorry for the nub question ๐Ÿ˜…

timid wind
#

THAT IS FREAKING COOL

#

dynamic loading of lib files over usb MSD! Crazy cool

lofty nova
#

@tulip sleet @stuck elbow @raven canopy thanks. I'll keep using 3.x for now and eventually recompile properly a v4 later. ๐Ÿ‘

manic glacierBOT
#

On the PyPortal if I connect any powered I2C device to side 4 pin connector, the RTC/time stops advancing and just pauses. The time continues again (does not restart, just picks up where it paused) after disconnecting the I2C device's power. The code I used to just check the time behavior as follows, then just power on/off the I2C device:

import time

i = 0
while True:
    i = i + 1
    print("time: {0}, counter: {1}".format(time.time(), i))

I know the devices are c...

manic glacierBOT
manic glacierBOT
prime flower
#

@raven canopy It doesn't look like Adabot added a PA token to the travis config for the Adafruit/CircuitPython_AzureIoT lib

#

I added one manually and it built, though.

raven canopy
#

@prime flower i've never known adabot to add any tokens automagically. you can run it locally with the -t/--token command line arg, and it will prompt for a GH token to apply if the env var isn't set in Travis.

prime flower
#

Tokens on the adafruit/ repos haven't required me to create one in the past, not sure why it prompted me this time.

raven canopy
#

i think its usually part of the repo creation process... but i've only heard fables about that; its a mystical land i've never visited. ๐Ÿ˜†

marble hornet
#

ik adfruit uses the mit license but is the company comforatble with gpl code?

raven canopy
#

i would imagine its a case-by-case situation. certain GPLs can carry some daisy-chain affects (as i understand; could be wrong).

lofty nova
manic glacierBOT
manic glacierBOT
crimson ferry
#

Latest lib release: led_animation, test, tests, and utils (font_to_bin) (and maybe others) are deprecated, or just dropped off the priority list?

raven canopy
crimson ferry
#

Ah, thanks @raven canopy Much of it was a curiosity, font-to-bin is used by framebuf, which I understand is somewhat deprecated though is still included in the library bundle (I suppose for those still running 3.x, and I think the OLED still needs it for now).

#

The 5x8 font has come in very handy this past year ๐Ÿ˜ƒ

#

I've probably missed some things, those were not found in my script that makes a reduced bundle for flash-constrained devices.

raven canopy
meager fog
#

@tidal kiln heya for your esp32 wifi code

#

shall i merge that change? i didnt have time to test it but if you did and it helps solve the issue thats fine by me

#

there's lots of little failure possibilities ๐Ÿ˜ƒ

tidal kiln
#

maybe. i didn't make any PRs though. i just ran into same thing and found the current issues and PR(s).

#

looks like there was one issue/PR that was for something related

#

but maybe didn't 100% fix things?

meager fog
#

im confused - if you try that PR does it help?

#

or no?

tidal kiln
meager fog
#

yeah

#

ill make the guide live regardless

tidal kiln
#

ok. it still needs some prettying up. products, etc.

#

and i should PR the code at some point, right now its copy pasta

#

does the PR42 look OK to you? do you think raising an exception is the correct response?

#

the other one (PR44) just broke out of the loop it looks like

meager fog
#

i think either is ok

#

you'll get a failure later

#

i can merge and you can test

#

if it doesnt work we can revert?

#

ok merged

#

you could just use the py for now

#

you could set it up to run, see if it hangs while u PR the code

tidal kiln
#

ok. let me grab that and test.

meager fog
#

cool - we'll keep finding these lil bugs

lone sandalBOT
idle spindle
#

I have a feeling Ladyada and other staff will pop into work on more Circuit Python stuff....

#

I'm probably right

#

Who knows ๐Ÿคท

manic glacierBOT
manic glacierBOT
manic glacierBOT
idle owl
#

<@&356864093652516868> Here is the notes doc for the CircuitPython Weekly for 28 May 2019. REMINDER: The meeting is on Tuesday next week, NOT Monday. Hope to see you all there. Everyone is welcome! If you can't make it, you can always add notes to the doc and I will read them off during the meeting. https://docs.google.com/document/d/1ErgKcxoebEFgdZWQK-mTj65dnsHfS5dH5e1DNzuxci4/edit?usp=sharing

manic glacierBOT
manic glacierBOT
raven canopy
#

that moment when you've spent a week building a testing framework from the ground up, and then look deeper into the existing framework already built in. should've done that before starting. ๐Ÿคฆ oh well...that was fun at least.

#

although...i can still push forward on the physical testing aspect (actual GPIO interaction, etc).

lethal abyss
#

Just started with the idea to compile CircuitPython, first because I like learning, and then maybe contribute to a specific board I have.
Problem is that following instructions from the learn page on Adafruit website fails for my Ubuntu 18.10.

E: The repository 'http://ppa.launchpad.net/team-gcc-arm-embedded/ppa/ubuntu cosmic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'https://packages.microsoft.com/repos/vscode stable InRelease' doesn't support architecture 'i386'
tulip sleet
#

@lethal abyss that ppa does not have an 18.10 release. Hold on and Iโ€™ll find the tar file you can use instead

raven canopy
#

nevermind...

#

๐Ÿ˜„

lethal abyss
#

๐Ÿ˜ƒ

#

I saw there was no 18.10 so I guess @tulip sleet is right, I need to go on the source/compile way. I get the idea ๐Ÿ˜‰

raven canopy
tulip sleet
#

Get the 7-2018-q2 release from the link @raven canopy posted. Untar it and isdd its bin directory to your PATH

lethal abyss
#

noted. I go for it. thanks.

tulip sleet
#

iPhone is making a hash of my technical typing

lethal abyss
#

I will post here success or failure. maybe I should write a note from the adafruit learn guide. It may be better to know that not all Ubuntu version can use the ppa way

tulip sleet
#

I think we will give up on the ppa. @raven canopy is right; they seem to have abandoned the ppa

lethal abyss
#

if all is needed is download a tar and use it, that's not a huge issue

tulip sleet
#

Weโ€™ll be moving to to the latest version eventually and itโ€™s not in the ppa at all

raven canopy
#

"that's not the word you want to use, Dan." - Siri ๐Ÿ˜‰

lethal abyss
#

๐Ÿ˜ƒ

raven canopy
#

note: Android is no better...

lethal abyss
#

looks like compilation went well, thanks a lot for the help

raven canopy
#

๐ŸŽ‰ yay!

lethal abyss
#

note to self: 3 days of conference organization with the last one with a kids means you need to stop and sleep

#

I can go and sleep with a happy mind

raven canopy
#

sleep well!

obsidian dome
#

Do we have any support for either LoRa or Bluetooth in CircuitPython?

exotic pumice
#

bluetooth was a big push in circuitpython 4

#

not sure about lora

gilded cradle
obsidian dome
#

So cool. Thanks!

#

Anybody got thoughts on 433 vs 915 MHz?

gilded cradle
#

Hi @obsidian dome, if you're in the US, you'll want 915MHz. If you're in Europe, you'll want the 433 MHz most likely.

obsidian dome
#

@gilded cradle thanks!

solar whale
manic glacierBOT
#

This adds a make stubs step that generates type stubs using rst2pyi, and then builds a source distribution containing these stubs for upload to PyPI. Type stubs are validated for correct syntax, but there are a number of failures right now due to documentation that does not use valid PEP 484 types, uses method instead of function for module-level callables, or otherwise contains invalid Python syntax. Running make stubs also warns about a number o...

manic glacierBOT
manic glacierBOT
manic glacierBOT
short viper
#

On the Pygamer trying to detect button presses and not having any luck using the gamepad or gamepadshift modules. Can anyone point me at some example code that detects button presses on the PyGamer? Thanks!

lofty nova
#

I was looking at the code for seesaw/crikit and I saw that the crikit-hat has USB VID/PID (but not the crikit). I can't find what this would be used for (a bit lost with QP ;))
Any chance that USB could be used to send commands to a crikit from a linux/win PC just as from a RPi/CPX/Feather ?

raven canopy
#

@lofty nova iirc, the usb on the crikit is only for programming the SAMD09 chip. i'm fairly certain it doesn't contain a full USB CDC/MSC stack.

lofty nova
#

Hi @raven canopy , I would have expected that crikits have an uf2 bootloader which appears on double-reset (like CPX, Feather...). So the presence of VID/PID in the main code of seesaw/boards let me expect something more.
Still seesaw\source\USBcontains the code for CDC.
So it should be possible to support serial/CDC commands ?
Or better use HID ?
I see that as an interresting opportunity to use the Crikit as an PC I/O extender in CPython. But I don't know where to start from.

raven canopy
#

yeah, i was just looking at it. i am clearly wrong on the USB front. ๐Ÿ˜„

lofty nova
#

And theres a seesaw/source/AOUSB.cppwhich seems to register something in QP. But I've not yet understood how this QP thing is working. I need to read a bit of the doc probably ๐Ÿ˜‰

raven canopy
#

hehe. also, i forgot crickit uses a SAMD21 vs a SAMD09. in looking at the code though, i'm not sure that the firmware itself has USB available. the bootloader (CRICKITBOOT) to update firmware, has it yes. but i dont see anything activating SERCOM3 in the source; the USB D+/- lines are hooked to SERCOM3. i've gotta run, but hopefully i'm completely wrong and you can make it work.

lone sandalBOT
modest atlas
#

Good morning all

#

Is it possible to have more than 1 spi busses open at once

#

For example, use the feather minitft & a rfm96 module at the same time in circuitpython

rare geode
#

Is there any plugin for Atom similar to the one for Mu?

#

I'm somewhat interested in making one if there isn't one already available

stuck elbow
#

@modest atlas yes, you can also use the same spi bus for both, just use different pins for CS

modest atlas
#

@stuck elbow will try this, likely the cause of my problem, thank you

lone sandalBOT
pastel panther
#

@raven canopy Might you have a minute to help me fix a travis/pypi bug?

raven canopy
#

i can certainly try!

pastel panther
raven canopy
#

it needs the $GITHUB_TOKEN environment variable set in Travis.

#

it needs the $GITHUB_TOKEN environment variable set in Travis.

#

i believe its set to adabot's GitHub token, but i don't have it.

pastel panther
#

ah, ok. For whatever reason I hadn't done that on previous CP drivers, only the Arduino ones. Maybe I'll update the guide to make it more clear

#

buh; I must have messed up generating my PiPy creds

#

@raven canopy is there a way to test the travis "encrypted" PyPi password?

raven canopy
#

i don't know of any off-hand. there may be something in the Travis CLI tool. or, is maybe something on PyPI?

#

(resending; discord is having trouble) i don't know of a way off-hand. i don't see anything helpful in the Travis CLI tool...

manic glacierBOT
meager fog
#

@gilded cradle ok i gave u perms for the learn repo, you can now merge

gilded cradle
#

Thanks ๐Ÿ˜ƒ

lone sandalBOT
rare geode
#

Okay cool

meager fog
#

oh rad

#

nice work! that will be handy ๐Ÿ˜ƒ publish it somewhere and we'll let people know!

rare geode
#

It's not perfect by any means, and my JavaScript is not fantastic, I'll stick it on GitHub and will be happy to accept any feedback from people who know more about this than me haha

meager fog
#

indeed!

#

tag me with the url when ya do - so we can be sure to put it in the newsletter

rare geode
meager fog
#

awesome thank you

rare geode
#

I'm going to try improve stability before I put it on the atom package registry

meager fog
#

cool

#

i use atom a lot ๐Ÿ˜ƒ

rare geode
#

I might need to get some info about how circuitpython devices work on Windows as well, right now I'm just searching in /dev/ for /dev/cu.usbmodem* but I have a feeling this may not be the correct way of doing things

#

Ah! Found an NPM package, interesting

meager fog
#

yeah you will want to check against the PID/VID

#

or name

rare geode
#

I've managed to get this data ```json
{ comName: '/dev/tty.usbmodem14101',
manufacturer: 'Adafruit Industries LLC',
serialNumber: 'C48F2034D475E405A413E203F06240FF',
pnpId: undefined,
locationId: '14100000',
vendorId: '239a',
productId: '8019' } ]

#

I can check against manufacturer right?

#

actually VID & PID are probably better

#

are they the same for all circuitpython devices?

meager fog
#

there ya go - well they're not ALL the same

rare geode
#

Ah, wait

meager fog
#

but you can start by adding anything with 0x239A

rare geode
meager fog
#

that will get you adafruit products

#

yep good find

rare geode
#

Okay, awesome

meager fog
#

nowadays we do 0x239A (all with that VID) because we come out with boards too fast, and then there's a few others

#

just be ready to add lots more

rare geode
#

Okay, I'll make it something easily configurable in that case ๐Ÿ‘

marble hornet
#

hey, my script stops running after i try to read from any i2c device

#

no error

#

when I save a file to the drive it will restart running the script. CircuitPython 4.0.1-5-g63b253c33 on 2019-05-23

#

doesn;t seem like proper behavior. i can lock and scan but reading data does not work

solar whale
#

@marble hornet what board/device -- I am using I2C on that build without issue.

#
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.0.1-5-g63b253c33 on 2019-05-24; Adafruit PyPortal with samd51j20
>>> 
>>> import adt7410_simpletest
0.0
27.7109
27.75
27.7734
27.7344
modest atlas
#

Hello people!

rare geode
#

Hm, this node library is proving to be a nightmare

modest atlas
#

I'm using a m4 feather and a feather mini tft

rare geode
#

I wonder if I can go lower level to discover serial ports

#

Oh wait, I say that and then it works

modest atlas
#

Trying to use the example for displayio text but getting an error for no attri it 'DISPlAY'

#

Attribute *

marble hornet
#

@solar whale i;m in my tricorder.

#

it came back for a while then it when away

#

electrically (excluding the inductors on the internal regulator) is electrically the same as a metro m4 exp

rare geode
marble hornet
#

finding devices i mean

rare geode
modest atlas
#

import displayio

import terminalio

from adafruit_display_text import label

ย 

display = board.DISPLAY

ย 

# Set text, font, and color

text = "HELLO WORLD"

font = terminalio.FONT

color = 0x0000FF

ย 

# Create the tet label

text_area = label.Label(font, text="HELLO WORLD", color=0x00FF00)

ย 

# Set the location

text_area.x = 100

text_area.y = 80

ย 

# Show it

display.show(text_area)

#

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

#

Trying the example with a mini tft feather on a m4 feather

meager fog
#

please follow this guide

#

yes?

modest atlas
#

@meager fog i have that guild open but just trying to add the text demo from the "displayio" guild to display custom text

meager fog
#

follow the guide exactly as is first

#

then you can modify ๐Ÿ˜ƒ

#

gotta go!

#

l8r

modest atlas
#

I have the mini tft demo up and running, but cant seem to find room to adapt the code for the text demo on displayio guild

quasi fjord
#

@rare geode other than the vendorId HEX being capitalized in Windows it seems to work

rare geode
#

Ah, I'll take a look at that, cheers

quasi fjord
#

changing lib\board-view.js#32 to let chosenBoard = ports.find(e => vendorIDs.indexOf(e.vendorId.toLowerCase()) != -1); seems to do the trick

rare geode
#

Great, I'll change it and add in a second

quasi fjord
#

also I stumbled on this while trying to figure out why it wasn't finding my pyportal: in disconnect() you should check if this.sp is set before calling close(). It causes an exception when a board isn't detect and connected properly and I think Atom disables the package when it does

rare geode
#

Ah, of course

#

Right, good findd

#

ah, found out how to define globals in eslint

#

no more annoying atom is not defined errors

#

pushed ๐Ÿ‘ cheers for the help!

#

and immediately notice bug after pushing lol

#

okay awesome

#

Right, this seems pretty stable now

#

might be time to stick it on the APM

#

Okay, since it seems I am inept at using the APM the first version there is 0.3.0 lol

raven canopy
#

@rare geode firstly, awesome!! i will def try it out, as i use atom mostly these days. i would make mention of using it with the fsync-on-save atom package, though. not sure if APM has any dependency type stuff, so a helpful mention might at least save some corrupted file system occurrences.

rare geode
#

Ah yeah, I've got that package

#

I'll have a look at whether I can make it a dependency, and if not, I'll recommend usage in the readme

#

I think I can require from git

#

hm, actually that doesn't regisster it with atom

#

I'll just add a recommendation to the readme

raven canopy
#

yeah, i'm not seeing anything in the docs... ๐Ÿ˜ฆ

rare geode
#

I've put a message in the readme ๐Ÿ‘

#

published to the APM

#

Hm, I'm getting issues installing from the APM relating to node-gyp, looking into it

timber mango
#

Hiya - I'm having trouble with my machine seeing my Feather M0 Wifi as a mounted drive. I've read through the docs, tried uninstalling drivers, tried the device cleanup tool (https://www.uwe-sieber.de/misc_tools_e.html) and still struggling - just seems Windows 10 isn't enumerating the drive. Can "double-click" the reset and see that it's in bootloader mode (slowly blinking red light), but still not showing up. Can confirm a CPX works fine. Any last ideas before I give up?

raven canopy
#

@timber mango does the com port show up in device manager->ports? drivers aren't necessary on Win10.

timber mango
#

@raven canopy yes, it does, as a "vanilla" USB Serial Device

raven canopy
#

can you get to the REPL in a terminal?

quasi fjord
#

have you tried reinstalling CP? You probably want to upgrade to 4.0.0 anyway. The Feather M0 could be programmed with Ardiuno too, so it could be running an Arduino sketch instead of CP which wouldn't show up as a drive

timber mango
#

Thanks both, sorry for delayed replies. @raven canopy how would I do that? @quasi fjord , not clear how I do that w/o access to drive. Sorry, n00b...can you you point me in the right direction?

raven canopy
#

@timber mango with either Mu (Serial button) if you've been using that to write programs. or with a program like PuTTY.

timber mango
#

Ok, will get Mu - should have just listened to @meager fog and installed Mu ๐Ÿ˜ƒ

quasi fjord
#

oh, you aren't getting the CIRCUITBOOT drive. hmm.

raven canopy
#

yeah, that's what has me a little stumped too. it would have to be programmed with a rather old bootloader to not have the boot drive show up.

timber mango
#

Probably was...I bought these just as they released, and haven't picked up since.

raven canopy
#

oh..then yeah, that might be it if they were purchased pre-USB bootloader. for the record though, i'm not exactly sure when they would have started shipping with it. Arduino may be your best bet, to get the bootloader up to date.

timber mango
#

Mu-ving along...saw "Detected a new CircuitPython device" in bottom tray upon reboot.

#

...but nothing comes up. Have Arduino...can give that a try

raven canopy
timber mango
#

aha

quasi fjord
#

^ That sounds familiar. I think I did have to use bossa to put CP on my feather m0 lora before I realized it didn't have enough flash to do anything useful and went back to Arduino on it. The non-Express M0 and M4 boards can technically run CP, but you don't have enough space to include pretty much any libraries

timber mango
#

That's helpful, @quasi fjord - realizing this board might not meet my requirements anyway, given I want to store some audio files on the board. Looks like an "Express" trip to MicroCenter is in order! Thanks both - learned a lot in a short amount of time! ๐Ÿ˜ƒ

manic glacierBOT
#

I was playing around with a circuit playground express and a crickit. I got this error

You are running in safe mode which means something unanticipated happened.
Looks like our core CircuitPython code crashed hard. Whoops!
Please file an issue with.....
with the contents of your CIRCUITPY drive and this message:
Crash into the HardFault_Handler

My code:
`import time
from adafruit_crickit import crickit
#from adafruit_motor import stepper

print("Bi-Polar or Uni-Polar Stepper ...

meager fog
#

@gilded cradle heya does that font have other character sets like japanese or hebrew?

gilded cradle
#

It does, but they divided it into separate font files and it could easily fill up the memory on the badge. I just chose the one that supported the most languages in a single file.

meager fog
#

ok lemme l00ksee

gilded cradle
#

Ok

#

I just added a heading right above the section that addresses that.

meager fog
#

@gilded cradle do you mind trying hebrew, im actually curious if it handles opposite direction fonts

gilded cradle
#

Sure, I'll see what happens ๐Ÿ˜ƒ

meager fog
#

ื‘ืœื™ื ืงื”

#

and japanese: ใƒ–ใƒชใƒณใ‚ซใƒผ

gilded cradle
#

Japanese should work, but I'll try that too

meager fog
#

japanese should 'just' work for sure but good demo

#

lemme give you the hello text

gilded cradle
#

Ok

meager fog
#

ใ“ใ‚“ใซใกใฏ

#

and

gilded cradle
#

The Japanese font is 121 MB

meager fog
#

OMG

#

oh its all

#

can you get just katakana/hiragana font?

#

you dont need the entire language

gilded cradle
#

yes, either. Which would be better?

meager fog
#

hebrew, use: ืฉืœื•ื, ืงื•ืจืื™ื ืœื™

#

katakana

gilded cradle
#

Ok, thanks

meager fog
#

well actually you need both

#

the 'hello' is hiragana (native), the name is katakana (foreign)

#

im surprised, they dont have a font with both?

gilded cradle
#

Oh, I just relaized these are ZIPs. Lemme see what the font file itself is

meager fog
#

yeah they have each family

#

still kinda enormous

gilded cradle
#

yeah, that's probably the biggest limitation

meager fog
#

what happens whe you convert it to bdf

#

these fonts are just ridonkulous

gilded cradle
#

That's what I'm going to try. Downloading is going a bit slow

#

lol

gilded cradle
#

Ok, here's the error I got with Hebrew

Traceback (most recent call last):
  File "code.py", line 101, in <module>
  File "/lib/adafruit_display_text/label.py", line 79, in __init__
  File "/lib/adafruit_display_text/label.py", line 87, in _update_text
AttributeError: 'NoneType' object has no attribute 'height'
manic glacierBOT
meager fog
#

still honkin large

gilded cradle
#

Yeah, it's still downloading the Google Noto font. I'm not sure why since my connection should be way faster.

meager fog
#

well thing is we should just remove the non kana glyphs

gilded cradle
#

Yeah, the cute one is definitely better

meager fog
#

one sec

gilded cradle
#

ok

meager fog
#

but how...i dont know

manic glacierBOT
gilded cradle
#

It can be done with font forge, but I'm not sure which ones are which and it would probably take a while to do manually.

meager fog
#

not easily

#

you have to do it one char at a time

gilded cradle
#

Yeah

#

And know what you're doing

gilded cradle
#

That'll work

meager fog
#

any of those look reasonable?

gilded cradle
#

Yeah, I think so. I need to register before I can download, so it'll be a moment.

#

I got one onto there and am loading it up now...

#

Ok, I Japanese is working

#

It didn't center vertically well, but it does display.

#

Should I look for a different Japanese font that centers better vertically @meager fog or see what I can do to get Hebrew working?

meager fog
#

dunno exactly what you mean by verical center?

gilded cradle
#

It just is vertically shifted above the center line whereas the other fonts were vertically centered in the white part

meager fog
#

ooh

#

i think thats ok

#

thats the "hello" part tho

#

that goes where the white text is

gilded cradle
#

Ok, well I'll see what's needed to get Hebrew working with labels.

meager fog
#

ใƒ–ใƒชใƒณใ‚ซใƒผ
is the blinka name

#

so just swap em and take a pic

gilded cradle
#

Ok

meager fog
#

good

#

now do the HELLO text ๐Ÿ˜ƒ

gilded cradle
#

Did you want me to set the Hello text in Japanese for that picture? I did cover changing it to French at the bottom of the gguide page.

meager fog
#

yeah

#

thats what i mean

gilded cradle
#

Ok

#

Ok, so I can set the HELLO text to Japanese because it's the same font size as the name, but to change the My Name Is to Japanese, I need to create another BDF file and they're 1.3 MB each and it looks like the PyBadge has 2 MB of memory.

#

I can try it on the PyGamer since that has 8MB of storage.

#

There might be enough space on the screen to do it all in the same font size ๐Ÿ˜ƒ

tulip sleet
#

@gilded cradle does the font you're trying still have a bunch of kanji in it? We could trim various fonts to be just katakana, hiragana, and roman

gilded cradle
#

I'm using one that is just katahana

meager fog
#

mel, back from ๐Ÿ•

gilded cradle
#

๐Ÿ˜ƒ

meager fog
#

ok lets just do the name then, not the HELLO text

#

i thought the one font had both kata and hira

gilded cradle
#

Ok

meager fog
#

sorry for the distraction -

gilded cradle
#

I used the Gebamoji one.

meager fog
#

oki yeah i think thats fine

#

@tidal kiln heya if yr around i have a q about ADS1015, its still in my inbox

#

and not sure if there's anything i can help w/

tidal kiln
#

yep. go ahead.

meager fog
#

so i think last we checked, there was a thing of like ADS works, but you can't read from it fast

#

what happens if you put it in continuous mode, and try reading at like 1KHz?

tidal kiln
meager fog
#

yeah like instead of waiting for the pin to toggle, just read every n ms with delay

tidal kiln
#

and have the delay set to match the freq?

meager fog
#

yeah or close enough

#

you can oversample, as long as you hit it at least as fast as whatever, 868hz

tidal kiln
#

probably worth testing further...looking at what i did....

#

i think i only tested on a pi zero

#

maxed out at ~200hz

meager fog
#

i think skip the pin, yeah

meager fog
#

and set i2c freq to 1MHz

tidal kiln
#

that and a faster pi

meager fog
#

i think a zero should be able to do it

#

i2c freq is what is bottlenecking i bet

#

100khz is not very fast

#

half the time is spent on i2c

tidal kiln
#

yep. the i2c traffic is definitely a bottleneck

meager fog
#

ok use the library as-is, put it in continuous mode, and read as fast as you can

#

you'll get duplicate points but so what?

#

your math still works out

#

or rather, their

tidal kiln
#

ok. i'll need to setup that all back up for testing.

#

want me to just respond in that issue thread with results?

meager fog
#

no rush, it was in my inbox for a bit

#

i think try the above then reply

#

it'll probably work and then you can close all the threads

#

do it sometime this week

tidal kiln
#

yep

meager fog
#

w0rd

#

ok next up, i also had this note

#

for this guide

#

do we want to make a page called WARNING!

#

or something?

tidal kiln
meager fog
#

yeah

#

just like WATCH OUT page

#

i can start it

gilded cradle
#

I figured out the Hebrew font issue. It didn't have an "M" in the font set that label was looking for. After I added an M, I found out it displays Left to Right instead of Right to Left.

tidal kiln
#

could be on Expectations page? if you want to keep it to an existing page?

#

but a Watch Out page would make it more explicit

meager fog
#

@gilded cradle hmm what do you need an M for?

#

do you mean like for "hello my name is"?

#

@tidal kiln feel free to add some adorable gfx to that page of a brain

gilded cradle
meager fog
#

omg

#

thats right

#

does the font not have english characters? thats a little odd

gilded cradle
#

Correct

meager fog
#

ok well, we can use the font you have for now

#

lol

gilded cradle
#

I added just the M for testing purposes via fontforge