#circuitpython-dev

1 messages ยท Page 326 of 1

onyx hinge
#

Good to know, thanks Jonah.

#

(it's a room full of J-people .. at my old jobs the meetings with me, josh, james, and joel were tough)

teal bear
solar whale
#

off to walk the dog --- good luck all!

marble hornet
#

enjoy!

onyx hinge
#

@teal bear that's almost certainly my fault. there's only one clock ๐Ÿ™‚ that's documentation taken from desktop unix python3's time.clock_gettime_ns which actually does have multiple clocks it can refer to. A PR to remove the text about the non-existing clock specification would be very welcome. Thanks!

thorny jay
#

@onyx hinge I should modify the Debouncer library?

teal bear
#

@onyx hinge will do. also.. clicking Edit at the top 404s

thorny jay
#

I need the lattest version of CP because it use the usb_hid report to tell me about CAPS_LOCK and other... so there is no version with both long integer and this.

onyx hinge
#

@half sedge If you follow what I am suggesting, I think a change which does similar to Adafruit_CircuitPython_LED_Animation with the monotonic_ms function should be acceptable. Careful, I updated the link because it was to the wrong fork. ms not ns, because working in milliseconds is a pretty good compromise that gets accuracy but doesn't overflow for ~12 days

#

It's still not perfect, because I think as written it will give a Python exception at 12.4 days for platforms without longs

thorny jay
#

There are ways to deal with warp arround. When the value goes from very high to negative or near zero, it is possible to detect and deal with that.

#

I feel like not all consequence of removing long int have been identified.

onyx hinge
#

@teal bear hmmm I don't know what to do about that link 404'ing, can you file an issue so we can at least remember it happens? It has to do with the way we generate our documentation in several steps, and I guess that works differently than readthedocs needs

teal bear
onyx hinge
#

@teal bear desktop python3 documents it as follows: ```Help on built-in function monotonic_ns in time:

time.monotonic_ns = monotonic_ns(...)
monotonic_ns() -> int

Monotonic clock, cannot go backward, as nanoseconds.
#

it's very terse in the pydoc and there's probably a longer description in the online manual

teal bear
#

cannot go backward - so it doesn't wrap, and "int" means forever?

onyx hinge
#

"int" means the values are whole numbers (integers)

thorny jay
#

It is present but not working:

#

import time

hasattr(time, "monotonic_ns")
True
time.monotonic_ns()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NotImplementedError: No long integer support

onyx hinge
#

Again you can check out the LED library, it also checks whether calling the function results in NotImplemented.

#

I believe this workaround is as complete as it can be

#

I agree with what you say about the ability of properly written code to deal with clock wraparounds. That's why I straw-proposed microcontroller.montonic_ms_wrapped earlier in this discussion. This is something where @slender iron also has opinions, so I'd recommend bringing your best proposal to an in-the-weeds sometime soon. Something that is (A) not placed in a desktop Python module like time -- microcontroller or rtc are the only places I can think of, (B) can work with/without longs, (C) does not have precision problems due to using float and (D) implementing in blinka is likely to be easy seem like a good set of considerations to meet. Showing that it's needed by 2+ libraries (LED animations & debounce) and showing how it could be used would be very good information to bring too.

thorny jay
#

That's above my head... I just want to use a library that is now broken. I understand most of it, but I don't have a solution to propose. I'll fill an issue and try to apply a check for NotImplemented... that might solve my problem, but not the underlying problem.

#

Thanks

onyx hinge
#

I don't believe it has to be above your head, but I understand if you don't care to engage at that level.

thorny jay
#

I can raise the question "in the weed" and let you discuss between Pythonistas. ๐Ÿ™‚ For me, the best solution could be to restore long integer (if it's possible). But it start to be sad to work on M0, things seems to fall apart loosing feature left and right.

teal bear
#

@onyx hinge int and "cannot go backward" together imply it will never wrap - is this correct?

onyx hinge
#

It is not possible to satisfy all interests, even more so on the more resource constrainted boards. As always, you have the opportunity to use a custom build or an older version, if it better satisfies your particular needs.

#

@teal bear right, it increases forever, it never goes back to 0

teal bear
#

sweet.

onyx hinge
#

And yes we never foresee all the consequences of our decisions, it's impossible. We can always work to better foresee consequences, but we know each time we compromise that someone will be impacted more heavily by the decision than another.

teal bear
onyx hinge
#

I think circuitpython's time.time uses a different epoch date

#

also most boards without a battery-backed RTC have time.time referenced to "no particular time, maybe the moment that power was applied or reset was pressed"

teal bear
#

yeah. that's really what I was wondering about

onyx hinge
#

The docs there could use some love

#
OverflowError: timestamp out of range for platform time_t
>>> time.localtime(2**30)
struct_time(tm_year=2004, tm_mon=1, tm_mday=10, tm_hour=13, tm_min=37, tm_sec=4, tm_wday=5, tm_yday=10, tm_isdst=-1)
#

maybe the docs are accurate (for time.localtime, on boards with long ints anyway)

teal bear
#

time_ttime.localtime(946684800) is 1/1/2000 ... 946684800-1 is OverflowError: timestamp out of range for platform

#

time.localtime(2147483647) 1/19/2038 struct_time(tm_year=2038, tm_mon=1, tm_mday=19, tm_hour=3, tm_min=14, tm_sec=7, tm_wday=1, tm_yday=19, tm_isdst=-1)

#

time.localtime(2147483647+1) OverflowError: overflow converting long int to machine word

#

2147483647 - 946684800 = 1200798847 ... which is ... odd.

manic glacierBOT
#

https://circuitpython.readthedocs.io/en/latest/shared-bindings/time/#time.monotonic_ns

click "edit on github"
https://github.com/adafruit/circuitpython/blob/main/shared-bindings/time/index.rst
404

for this one, correct seems to be:
https://github.com/adafruit/circuitpython/edit/main/shared-bindings/time/__init__.c

Jeff E.Today at 11:21 AM
@CarlFK hmmm I don't know what to do about that link 404'ing, can you file an issue so we can at least remember it happens? It has to do with...

#

This an improvement to Python3 compatibility. However, I note that standard Python signals an error when the specified size is nonzero and bigger than the buffer, which this code doesn't do (yet):

>>> import socket
>>> b = bytearray(7)
>>> s = socket.socket()
>>> s.recv_into(b, 8)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: buffer too small for requested bytes

Feel free to merge and treat this as a separate issue if desired.

#

I'd prefer to see no extra text written here. The reason is that string storage is precious, and I am not confident that the optimizer will eliminate the string by determining that USER_SAFE_MODE is an impossible value for reason. I intended that when USER_SAFE_MODE was entered but there was no BOARD_USER_SAFE_MODE_ACTION, the MANUAL_SAFE_MODE message would be displayed, but I got this wrong in the code I shared on discord. A second alternative would be to re-use the "Unknown reason" s...

teal bear
#

#define EPOCH1970_EPOCH2000_DIFF_SECS 946684800 - this is the missing chunk: 946684800 + 1200798847 == 2**31-1

manic glacierBOT
manic glacierBOT
#

It'd be nice to be able to specify the specific mac address of the access point you want to connect to as a backup/sanity parameter in multi-access point environments.

When connecting, the exact AP associated with seems to be chosen somewhat at random - sometimes it's the strongest signal, other times it definitely isn't. In the field with MicroPython based devices, I've seen it try to connect to an AP with an RSSI of -80, rather than the one right next to it at -45. To get around that, ...

manic glacierBOT
#

While checking whether we can enable -Wimplicit-fallthrough, I encountered a diagnostic in mp_binary_set_val_array_from_int which led to discovering the following bug:

>>> struct.pack("xb", 3)
b'\x03\x03'

That is, the next value (3) was used as the value of a padding byte, while standard Python always fills "x" bytes with zeros. I initially thought this had to do with the unintentional fallthrough, but it doesn't. Instead, this code would relate to an array.array with a typecode...

onyx hinge
solar whale
#

guess they want to be sure

tulip sleet
#

@onyx hinge That is weird: I'm looking for a setting that might have gotten changed accidentally.

#

@onyx hinge It's because it's a PR against master instead of main. Maybe Scott changed the minimum number as an alert that it was against the wrong branch.

teal bear
#

Is main the new thing?

tulip sleet
#

yes

#

it's been true for a couple of months at least

#

Maybe we should just delete the master branch now

onyx hinge
#

@tulip sleet do you have the necessary permission to change which branch that PR points at? I know tannewt was able to do it for some PRs when doing the master->main transition

#

but I don't see a UI element for it, I could be missing it, I could have the details wrong, or it could be outside my permissions

tulip sleet
#

I don't think that's possible; it just needs to be resubmitted as a PR against main. @teal bear could you rework? Thanks.

onyx hinge
#

oh there it is

tulip sleet
#

how did you do that magic?

onyx hinge
#

click "edit" by the PR's title and then "master" becomes a clickable box. I selected "main"

tulip sleet
#

great! thanks

teal bear
#

do I need to do anything, or is it done?

onyx hinge
#

Looks like it requires changing -- there are "conflicts"

tulip sleet
#

Jeff fixed it

onyx hinge
#

probably better to start a fresh branch and just make the change again. I think basically we reformatted all our docs since the old revision you based your PR on.

teal bear
#

got it.

onyx hinge
#

Thank you!

tulip sleet
#

actually, probably not safe to delete the branch in case want to go back in time. It would be nice to lock it down but it doesn't appear possible.

onyx hinge
#

replacing branch master with a tag master is suggested by some sources to in some sense keep it, but prevent being able to create PRs

#

however, I kinda suspect changing a branch to a tag may confuse existing clones when they pull again

onyx hinge
#
        if (nbytes == 4) {
                *value = hri_sdhc_read_BDPR_reg(hw);
        } else {
                sr = hri_sdhc_read_BDPR_reg(hw);
                switch (nbytes) {
                case 3:
                        value[0] = sr & 0xFFFFFF;
                case 2:
                        value[0] = sr & 0xFFFF;
                case 1:
                        value[0] = sr & 0xFF;
                        break;
                }
        }
``` this code can't possibly be right, can it?
#

(from asf4)

manic glacierBOT
#

@tannewt - I had left this one for a while, getting back to it. The
pulseio changes are working fine on
an irremote, but the DHT11 is failing. We seem to be picking up 2 extra
values (83 instead of 81)
which is causing the input to fail. I will post a note when I've figured
out the issue, thanks!

On Thu, Sep 10, 2020 at 2:55 PM Scott Shawcroft notifications@github.com
wrote:

@DavePutz https://github.com/DavePutz Would you like me to finish this?
I think it has more to remove to leav...

manic glacierBOT
#

removing line 144 'solves' it!

see https://github.com/adafruit/circuitpython/pull/3219/files for possible reasons

ladyada@LimorFried MINGW64 ~/Dropbox/micropython/circuitpython
$ make -C mpy-cross
make: Entering directory '/c/Users/ladyada/Dropbox/micropython/circuitpython/mpy-cross'
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
QSTR updated
Traceback (most recent call last):
  File "../py/makeqstrdata.py", line 455, in...
#

We can either set the standard output encoding to utf-8 on all platforms when running this script:

diff --git a/py/makeqstrdata.py b/py/makeqstrdata.py
index 721fa8320..d5502330f 100644
--- a/py/makeqstrdata.py
+++ b/py/makeqstrdata.py
@@ -16,6 +16,8 @@ import collections
 import gettext
 import os.path
 
+sys.stdout.reconfigure(encoding='utf-8')
+
 py = os.path.dirname(sys.argv[0])
 top = os.path.dirname(py)
 

which should ALSO solve it for windows .. or `sys.stdout...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

@jepler my bad, I got the fallthrough definition wrong. Thanks for pointing that out.

Considering what you said about string storage, I implemented the following change to get to the Unknown Reason output.

                break;

Following is the serial console output:

You are in safe mode: something unanticipated happened. 
CircuitPython core code crashed hard. Whoops!
Unknown reason.
Please file an issue with the contents of your CIRCUITPY drive ...
onyx hinge
#

๐ŸŽถ my code is in in the community bundle ๐ŸŽต

onyx hinge
#
>>> _TICKS_MAX
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name '_TICKS_MAX' is not defined
``` huh haven't run into that in the repl before.  I kinda know why it happens..
stuck elbow
#

Yeah, const makes no sense in repl

onyx hinge
#

I sometimes like to paste things from .py files into the repl, and usually it's just fine

#

probably if I'd done those lines together in the "paste" repl and they were evaluated together it would have worked? Not sure

solar whale
#

@onyx hinge its the "_" that makes it not defined -- x = const(123) will define x

marble hornet
#

I have a new bluetooth board (custom hardware with and nrf52840) that is crashing whenever
import adafruit_ble
is run. If i remember correctly this can be caused by the lack of a soft device. I'm trying to use a jlink to upload the flash and sd but it seems to not work.

solar whale
#

@marble hornet IIRC you should flash the sd first, before the firmware. just in case that helps

#

but that was from a long time ago... may have changed

#

when loading the bootlaoader I did make BOARD=feather_nrf52840_express erase make BOARD=feather_nrf52840_express sd make BOARD=feather_nrf52840_express flash

marble hornet
#

okay, i'll give that a try. i have been doing that but typing out the BOARD parameter every time

solar whale
#

yes you need that -- sorry

onyx hinge
#

To flash SoftDevice (and chip erase):

make BOARD=feather_nrf52840_express sd

The Adafruit_nRF52_Bootloader's readme says this

marble hornet
#

okay, i just re-tried those three steps and it it still crashing. it seems like the core goes of the end of the world...(?) after the import the device just hangs. the screen session does not disconnect and the device does not response at all. only hard-reseting it helps

#

any suggestions?

solar whale
#

sorry -- you are way beyond my level of experience with it.

marble hornet
#

okay, thank you. I think i'm in a similar spot, do you know who would have some more experience with this?

slate scroll
#

@marble hornet maybe the flash operation is overwriting your sd - fiddle with the commands that the makefile executes

#

if does nrfjprog --erase or something like that maybe there's your culprit

#

also I THINK that instead of make BOARD=feather_nrf52840_express flash you need make BOARD=feather_nrf52840_express SD=<sd_version> flash

manic glacierBOT
#

Hey guys, Sorry if this as been discussed already but I can't find anything using google and search on here.

I've been playing around with the Feather M4 express and an 64x32 RGB matrix. First thing I've been looking for when I started running demos is for a way to reduce the brightness.

I found that you can only turn on or off the LEDs by setting the brightness attribute to 1.0 or 0.0:
https://circuitpython.readthedocs.io/en/5.3.x/shared-bindings/rgbmatrix/RGBMatrix.html

Is there ...

solar whale
manic glacierBOT
#

I plan to raise this issue In the Weeds on Monday and if there is a consensus about approach I can be the implementor

Problem statement

Libraries and users need a way to manage time durations, and existing solutions are not entirely satisfactory. Thanks to @dglaude for raising this issue on Discord and github.

For consistency and portability reasons, we have only included compatible time-related functions ...

marble hornet
#

@slate scroll i gave a look at the flash rule and it does not Seem to have sd erasure in it. and i'll give the SD=<...> flash a try.

slate scroll
#

nah, @solar whale is right

marble hornet
#

huh?

slate scroll
#

try flashing the circuitpython hex by hand, without any erase flags

#

sd won't make a change during normal flash

#

do you have a debugger attached? maybe you can see if there's anything on the sd address

marble hornet
#

i do, is that 0x0 thorugh 0x25000?

slate scroll
#

through 0x26000

#

check the first 100 bytes

#

and do a hexdump of the sd as well - just to be on the safe side

#

but something tells me that's not it - every time I need to dig this deep with these mcus something else (and very simple) is wrong

#

also since you have a debugger, where does circuitpy crash?

marble hornet
#

will do. (am doing). i'm not super comfortable with using the debugger (i mostly have used if for flashing bootloader). i'm a jlink connected to a mac. may take a moment, i have to read the man pages

slate scroll
#

duh, I feel you, I'm not comfortable around debuggers either

#

keep in mind VSCode has amazing debugging experience, even for me. since you're getting your hands dirty, take a day to set it up properly

#

(and I can't stress enough that you got to try VSCode if you haven't)

marble hornet
#

I've been using atom and jlinkexe

#

and just found how to dump. give me 1 mo

slate scroll
#

yy

marble hornet
#

okay, i've dumped 0x0 -> 0x26001

#

want to see? it is non zero information

#

**as in upload ?

slate scroll
#

I don't have the SD handy, so just do a hexdump on the SD (the one you downloaded from adafruit) and check if the first bytes are the same with your dump

marble hornet
#

the one i downloaded from adafruit?

#

which one are you referring to?

#

ah

#

they are only different by a few bytes at the end. I dumped off of a feather 840 stock from adafruit (never programmed) and the custom board

#
$cmp dump-feathersd.hex dump-watchsd.hex
$dump-feathersd.hex dump-watchsd.hex differ: char 155649, line 728
slate scroll
#

perf, I don't think you have a problem with the SD then

#

I'd start debugging (crying as well)

marble hornet
#

i regret putting the swd pin on pogo pads ๐Ÿ˜ญ

#

I'll just solder them, i haven't debugged before with a jlink, any guides, recourses, advice you would have found useful going it?

ionic elk
#

I'm trying to get readthedocs going for my community bundle. How do I get Sphinx to not freak out about the use of const in my library?

onyx hinge
#

@ionic elk I'm not sure but we could look together at a module that uses const in the bundle. I spotted adafruit_fram.

tulip sleet
#

it's a mock import thing; just double-checking

onyx hinge
#

it has from micropython import const then later _MAX_SIZE_I2C = const(32768)

#

it does not have the mock import library enabled as far as I can see: ```# Uncomment the below if you use native CircuitPython modules such as

digitalio, micropython and busio. List the modules you use. Without it, the

autodoc module docs will fail to generate with a warning.

autodoc_mock_imports = ["digitalio", "busio", "micropython"]

tulip sleet
#

actually not, but it's in blinka, so that covers it

#

is adafruit-blinka in your requirements.txt?

ionic elk
#

what is the mock import library?

#

no

tulip sleet
#

do that, that should fix it

ionic elk
#

adding adafruit blinka? But I'm not a blinka library

tulip sleet
#

could it be used under blinka?

ionic elk
#

and actually no wait it is in there

#

by default I guess

onyx hinge
#

Are you getting this message locally or from ci? If locally, you may/probably need to install blinka yourself.

ionic elk
#

locally

#

is that just pip install blinka?

tulip sleet
#

pip3

#

do not do sudo pip3

#

on windows, just pip

#

depending on how python is set up, pip might install for python2, not python3

onyx hinge
#

the pakage name is adafruit-blinka so that's what you'd put on the pip commandline

manic glacierBOT
slate scroll
#

i regret putting the swd pin on pogo pads ๐Ÿ˜ญ
@marble hornet yea, always break them out properly (breadboard friendly)

ionic elk
#

Ok, I installed adafruit-blinka, but it still fails

#

is this even worth it? Like, the docs are up on readthedocs, the library works, is it actually required to do this?

#

I don't really even care about setting up github actions, is it required to be on the community bundle?

tulip sleet
#

could you show the error?

tulip sleet
#

could you push this to a repo so I could look at the whole thing and try it?

ionic elk
tulip sleet
#

btw, if you enclose a link in < >'s, it will not add the attachment in discord

ionic elk
#

interesting protip

#

ty

tulip sleet
#

I don't see a from micropython import const in the code

ionic elk
#

is that actually required?

tulip sleet
#

it should be, but it seems not to be

ionic elk
#

It doesn't seem to need it in testing

tulip sleet
#

anyway, add that

ionic elk
#

nice, that solved it

#

what about the image thing? If I want to add images, do I need to copy them into the docs folder? or something

tulip sleet
#

look at the adafruit_circuitplayground for how to do that; i know that library has them to show where the pins are on the board

ionic elk
#

ok. Thanks for your help, dan!

tulip sleet
#

np, yw!

ionic elk
#

I think that guide could use an update, though. The github actions part is especially confusing, it doesn't really relate to what you see on Github at all. Might have changed as an update?

#

There's this whole select workflows thing

#

Anyway, heading out to lunch, again, appreciate the help!

tulip sleet
#

if you can make simple updates, go ahead, else just clikc on the feedback link to at least note it. tnx

ionic elk
#

ok, will do when I figure it out

marble hornet
#

okay, I think it is a hw issue. i just flashed the custom firmware to an adafruit nrf52840 and it works. seems like nrf52840 cannot have a functioning (uf2) bootloader without the sd.

tulip sleet
#

But there has not been a release since then

#

@onyx hinge I am not bothering with #3404 because it's part of #3405, right?

onyx hinge
#

@tulip sleet yes, I think so, unless #3405 is going to stall -- I (just) marked #3405 ready for review since it passed CI without further problems.

tulip sleet
#

ah, great, I will re-review (I did an informal review)

manic glacierBOT
#

You're right that this isn't possible right now. It would need to be added "upstream", so I've filed a bug there: https://github.com/adafruit/Adafruit_Protomatter/issues/19

Until that feature is added and then made available in Circuitpython, depending on what you're doing, you can

  • just select different color constants, like 0x7f7f7f or (127,127,127) instead of 0xffffff or WHITE or (255,255,255)
  • modify your images before exporting them as bitmaps
  • if you use paletted images, dy...
#

I think it's a good idea, since it could catch a number of port-specific bugs. The main issue I had with the nRF port and its hal layers is that it does #if on undefined preprocessor macros.

For better or for worse, we apply more stringent warning flags to the atmel-samd port than to other ports.

I looked in atmel-samd/Makefile and didn't see a lot of this. What are you thinking of?

manic glacierBOT
onyx hinge
manic glacierBOT
#

@dhalbert happy you're here, are these FALLTHROUGHs or missing break;s?

common-hal/_bleio/PacketBuffer.c: In function 'packet_buffer_on_ble_server_evt':
common-hal/_bleio/PacketBuffer.c:175:16: error: this statement may fall through [-Werror=implicit-fallthrough=]
  175 |             if (self->conn_handle == ble_evt->evt.gap_evt.conn_handle) {
      |                ^
common-hal/_bleio/PacketBuffer.c:179:9: note: here
  179 |         case BLE_GATTS_EVT_HVN_TX_COMPLETE: {
      |  ...
manic glacierBOT
ionic elk
#

@tulip sleet so, does Adafruit have a set of git actions that they've designed and use? Are those available for public use?

#

I'm getting the vibe that I'm simply missing the actual workflows I need. Presumably I need to copy them from somewhere?

onyx hinge
#

cookie-cutter gives you what we use, plus or minus modifications made in individual repos.

ionic elk
#

you mean cookie cutter is supposed to install git workflows?

#

@onyx hinge

#

it didn't create anything for me. I don't even have a .github directory

#

maybe my cookiecutter version is old?

ionic elk
#

Whew. Got it in. Thanks for the reference material @onyx hinge

queen widget
#

Anyone here ever have a problem trying to send MIDI SysEx over USB with CP?...... If so - I found da bug!

onyx hinge
#

@queen widget I don't know midi but I'm happy to see bugs squashed

queen widget
#

PR sent - but it is in an upstream library... so it make take a short bit to get it into CP.

onyx hinge
#

Nice, thanks.

#

@queen widget after it gets merged to tinyusb feel free to shoot us an issue or PR so we don't miss updating it

queen widget
#

will do!

manic glacierBOT
mental nexus
#

If anyone is running an ESP32-S2 with a parallel display, has anyone done a comparison with display update speed vs the pyPortal?

manic glacierBOT
#

Hello,

I have tried to create my own board spec for Lilygo module, but I am getting following error. First I have got error about mismatching 2MB ram but installed 8MB which I have changed in configuration. But it probably caused that partitions does not match, which is what I understood from error invalid SPI size. I have even tried expand partition 4 to 512K, but it does not look like it helped.

Could you help me with that? Is there better place to discuss than here? It is very nice m...

manic glacierBOT
#

There is a LONGLONG implementation of long ints which we don't use, is simply 64 bits of integer, not indefinite length. Unfortunately, it builds to be even larger than the regular MPZ implementation. But this is due to it dragging in double-precision float routines, which are huge and which should not be necessary. I am looking at how to prevent this, and perhaps LONGLONG could be included even in the smallest builds, which would make monotonic_ns be available for all ports.

wispy badger
#

Hello guys, I need your help. I am using the Seeeduino Xiao and I have installed the latest CircuitPython on it. The problem is that the displayio module is not available for this board. Why is this? How can I use the board with a display if the displayio module is not installed?

onyx hinge
#

@wispy badger The Xiao's M0 microcontroller doesn't have a lot of resources, so not all the modules fit in the flash storage available. You can check out the page in our documentation called "Support Matrix" or the built-in help() for an accurate list.

#

@ionic elk remember how months ago you asked me to look into whether the RGBMatrix worked right on STM for me? welp.

manic glacierBOT
#

The LONGLONG longint implementation uses 64-bit long long boxed integers. Because it's conceptually simpler than the MPZ implementation, it could be smaller in terms of firmware size. It would enable using time.monotonic_ns() on small builds, which is the primary reason I looked at this.

However, right now LONGLONG actually builds out to be larger than MPZ. This is primarily due to a few long long conversions to and from float that cause large double-precision floating-point li...

onyx hinge
#

@tulip sleet I had wondered about that, good sleuthing about where the binary size growth comes from.

manic glacierBOT
ionic elk
#

@onyx hinge yeah looks a little stretched. That's on my bugfix list after I get these ESP32 and SPI things taken care of

onyx hinge
#

I'd have called it ghosting, I guess

ionic elk
#

is it possible to include DisplayIO on a SAMD21 by cutting other modules?

onyx hinge
#

I know there's at least one M0 Express board with displayio but I don't know about non-Express boards.

ionic elk
#

Nice

wispy badger
manic glacierBOT
#

Reworked the check for pulsein. We couldn't use an input past the requested length as an indicator, as it seems that the DHT11 provides 83 bytes while the library code only looks for 81 bytes(1st two are ignored). Went to a check on the number of overflows on the 16-bit timer used for pulsein; 15 overflows works out to about 1 second. So, the current logic says that if there have been that many overflows since starting the current pulsein something is wrong and the RuntimeError "Input taking ...

analog bridge
#

Is there a default pin definition for a push button, something like MICROPY_HW_BUTTON ?

onyx hinge
#

@ionic elk limor sez:

hmm probably a timing thing
looks like needs more NOPs on the address lines
check with heiro if thats something he can look at

ionic elk
#

sure

onyx hinge
#

I dunno that it's intended to modify your priorities, but it has come up because of a forum thread

ionic elk
#

Good info from Limor, I don't know as much about the matrix communication profile as you two

onyx hinge
#

me either

#

honestly

ionic elk
#

I'm pretty close to finishing my existing bugfixes so I'd rather not context switch today until I'm done, but I can check it out right after

onyx hinge
#

@analog bridge { MP_ROM_QSTR(MP_QSTR_BUTTON_A), MP_ROM_PTR(&pin_PA28) }, and { MP_ROM_QSTR(MP_QSTR_SLIDE_SWITCH), MP_ROM_PTR(&pin_PA15) }, in the pins file for the circuitplayground express

#

@ionic elk I'm sure that's fine

analog bridge
#

@onyx hinge I want to add a pin definition for the boot button on microS2. It just acts like a user button during code.py execution.

uncut nexus
#

Can someone take a look at PR #3237 and tell me why two files (supervisor/shared/tick.c and supervisor/port.h ) show changes when they are identical between my branch and adafruit/main? I do not want to make any changes to those two files...

hearty forge
#

Hi folks- I'm interested in helping get the rotaryio library working on the ESP32S, and developing a simple library for the L293D motor driver . I have some limited C & Python abilities... any pointers on where to start - e.g. a recommended port to use as a reference for rotaryio and a good example of a basic library I can copy from will be appreciated! (Back story: been looking to make a low cost, approachable, robotics kit for quite a while. MicroBit almost did it... I think ESP32S does - WiFi, MicroBLocks, CP, ROS for programming- and I've sourced parts to make a 2 wheel cart + sensors for ~$30 Canadian.)

manic glacierBOT
#

@tannewt suggested I chime in with this project I'm working on, circuitpyui. It's a bit basic at this point but has some of the same goals (adding interaction to displayio groups with touch and joystick control). Might be some useful stuff in there, like locating tapped views in a hierarchy and routing events to views that want to respond. There's an example for the PyPortal [here](https://github.com/joeycastillo/circuitpyui/blob/main/examples/Py...

thorny jay
#

I'll be lurking (on the road). My notes are in the document (more or less up to date). I'll try to connect for "in the weed" as there is a topic that interest me.

manic glacierBOT
#

This PR adds a Readme to the ESP32-S2 port, containing information on how to connect, build, flash and debug ESP32-S2 development boards.

Added partially as an extension to #3392, since the configuration files for OpenOCD are presumably GPL and can't be included in the port, so I've documented how to find and modify them yourself. Also includes notes about flashing on Mac OSX figured out by folks on the discord.

onyx hinge
#

<@&356864093652516868> The meeting is coming up in about 10 minutes. If you plan to speak, please make sure you've at least added your name as a placeholder in the two round robin sections. You can also add notes and we'll read them if you are missing the meeting, don't have a mic, or prefer not to have your voice recorded for any reason. https://docs.google.com/document/d/1vPWZyHRhsrAMZdc7nQJCDBmshHgtot2UotPJuIgSM_U/edit?usp=sharing

#

@slender iron I'll work on taking notes, as far as I know you're running this one

slender iron
#

yup, I'm planning on running it

manic glacierBOT
onyx hinge
#

earlier I popped an SD card out of one of those spring loaded sockets accidentally. It landed somewhere on the shelves'o'stuff. I wonder if I'll still remember that when I find it

manic glacierBOT
#

The graphical side of circuitpython has been growing and, in my opinion, the lack of a unified user input scheme can be felt.

I think adding featureS like these can be broken down into several categories:

  • the ui-tree, this is the data structure constructed by the developer of a ui-application that represents the onscreen data. This seems to be more than covered with the facilities provided by displayio. the only functionality it odes not seem to provide is bi-directional tree traversal...
modern wing
#

Good afternoon all you wonderful folks -- happily lurking today, updated the note doc to reflect as such. adabot

lone axle
#

I am text only today due to a scheduling conflict. I do have it noted in the document as well.

old smelt
#

Lurking

turbid radish
#

Lurking

modern wing
#

I remember when a team of construction folk were demolishing a dilapidated community center to build a row of townhouses.

For about 3 years, it was never-ending nail guns and reverse-beeping.

timber mango
#

Lurking today

stuck elbow
#

lurking

onyx hinge
#

@silver tapir I'm moving your notes down in alphabetical order

turbid radish
onyx hinge
#

@slender iron we'll let you run it everytime if you want

modern wing
#

Sharing is caring ๐Ÿค—

analog bridge
#

No YT stream this time ?

onyx hinge
#

That was special just for CircuitPython day.

errant grail
#

Just listening today.

onyx hinge
#

@analog bridge having trouble joining us on the discord audio stream?

analog bridge
#

@onyx hinge Yup! no audio

manic glacierBOT
onyx hinge
#

@analog bridge you should be able to listen in just with speakers, no mic needed. Either way, hope you can join us sometime in the future

lone axle
#

If you click on that CircuitPython title with the speaker next to it, you should join the voice channel to hear us.

analog bridge
#

Yeah! now I am in blinka

manic glacierBOT
onyx hinge
#

23 pull requests merged

lone axle
#

The oldest library PR was updated this weekend and is passing actions now! if anyone is interested in LED PWM driver breakouts we could use some eyes on reviewing.

#

will do

manic glacierBOT
#

FWIW, I never saw the tty.SLAB_USBtoUART until UnexpectedMaker had me install some drivers.

I now find on MacOS I can connect to the the tty.usb* devices just fine.
2020-09-13 I built main and flashed with the following commands on MacOS.

make BOARD=espressif_kaluga_1 PORT=/dev/tty.usbserial-1413201 flash    <-- over the external USB
make BOARD=espressif_saola_1_wrover PORT=/dev/tty.usbmodem01 flash     <-- over the esp32s2 native USB
make BOARD=unexpectedmaker_feathers2 PORT=/...
trim elm
#

lurking

stuck elbow
#

sorry

silver tapir
#

What's an F1? An STM32?

slender iron
#

yup

silver tapir
#

thanks

onyx hinge
#

@slender iron I put in an "approve" review but didn't merge [for the recv(0) implementation]

solar whale
#

๐Ÿ‘

mental nexus
#

Anybody running an ESP32-S2 with a parallel display? Wondering if the 240 MHz gives 2x display update speed vs the PyPortal running at 120MHz with the M4. Is the parallel Bus code working for the S2? .......Trying to find a good excuse for buying a Saola ๐Ÿ™‚

slender iron
#

it's not implemented afaik

#

but you should get a saola

mental nexus
#

Noted and noted...

thorny jay
#

So we could add a AirLift ESP32 in BLE mode connected to a ESP32S2 and have both WiFi and BLE... ?

onyx hinge
#

@tulip sleet do you think there's a way to get the LONGLONG implementation to fit? how hacky? [OK I'll wait for In The Weeds]

solar whale
#

@thorny jay yes, but not simultaneously

#

if I understand correctly

idle wharf
#

Is it expected when building esp32s2 and flashing over the native USB, that in the end the reset will fail and you have to do that manually?

onyx hinge
#

Tiring? I bet!

thorny jay
#

Thanks. So if anybody has a use case for talking with 3 bits between two M0... I am interested.

silver tapir
#

@lone axle Are those video series on your youtube channel or for learn or something like that?

onyx hinge
#

@ionic elk I think you identified that maybe other ports also missed implementing this feature of spi readinto

ionic elk
#

Yeah everything but atmel and i.mx doesn't have it

#

which is just, like, 4/6 but whatever lol

silver tapir
#

I'll read up on jepler_udecimal. This weekend I learned how Babbage's differential did it :).

ionic elk
#

but yes NRF, Spresense, ESP32 and STM32 would need it

onyx hinge
stuck elbow
#

@onyx hinge I can help you with code for that keyboard if you want

onyx hinge
#

@stuck elbow awesome! they have some sample code and also I may give kmk a try

stuck elbow
#

kmk is kinda overengineered...

onyx hinge
#

way overengineered

stuck elbow
#

my keyboards have like 100 lines of code

onyx hinge
#

makerdiary has a matrix scanning library (implemented for nrf) that looks like it might be good to pull in to circuitpython

thorny jay
#

Matrix scanning? There is a CP library for that already.

onyx hinge
#

@marble hornet whoops, I didn't list you in the notes doc for status updates -- did you have anything?

ionic elk
#

Or do a Circuitpython Phone!

#

my secret ambition

marble hornet
#

@onyx hinge i do

stuck elbow
#

I have arturo's keyboard wing and want a lora communicator at some point made out of it

marble hornet
silver tapir
thorny jay
#

Watch. โค๏ธ

silver tapir
#

I like the LIGO ESP32 watch, but it's not -s2 ๐Ÿ˜ฆ

marble hornet
silver tapir
#

Hmm, nobody said that they were going to start the C64-cpy project.. :). (the cortex A0 port)

mental nexus
slender iron
#

@silver tapir I was looking at using the rpi3

onyx hinge
silver tapir
#

I started compiling the micropython port for the pi, but haven't tested yet.

ionic elk
#

@onyx hinge the beefiest of issues, so thorough

slender iron
#

pi3 only has one usb peripheral though

errant grail
#

A set of CircuitPython programmable nsec and msec timers would be handy.

solar whale
#

is it your goal to make it micropython compatible?

marble hornet
#

embedded storage hot potato

errant grail
#

Timer operations: set, reset, read value, status, mode: up, down

#

stop, start

thorny jay
#

One annoyance is when you discover that library X does not work on hardware Y.

idle wharf
#

I was really surprised esp32s2 went to Main so fast...

thorny jay
#

If you don't know it is hardware and that was not build for that hardware, you discover when it is too late.

manic glacierBOT
thorny jay
#

What about a piece of code.py that check many things and print it as working or not.

onyx hinge
#

CIRCUITPY_DIGITALIO = 3/5 # 60% supported

thorny jay
#

The worth is if someone acquire a board for specific use, and discover it can not do that.

onyx hinge
thorny jay
#

If you have many board, you just switch to another feather...

silver tapir
#

What boards a currently "low-power"? I think only the Feather S2 from @atomic summit

thorny jay
#

Most Adafruit board have an LED ...

slender iron
#

nrf52840 I believe

idle wharf
#

@thorny jay I find it hard to understand the capabilities between any two boards on the store, but that's not a CP issue.

silver tapir
#

And, is there a way on software to call a deep sleep mode yet in cpy?

thorny jay
#

A buyer guide could help to say based on your needs what board is recommended.

#

What do you need? BLE? WiFi? QT? Screen? Form factor? ...

analog bridge
#

esp32s2 comes with ULP (Ultra Low Power) coprocessor

silver tapir
#

@ionic elk Some nice tools for this are either the ลณCurrent or the CurrentRanger. (andreas spiess has showed a bit of this in ytb)

#

@analog bridge The idf docs says that it is not working yet.

analog bridge
#

esp32s2 comes with ULP (Ultra Low Power) coprocessor

#

not sure if that can handle CPY

silver tapir
#

@analog bridge You can only run a bit of riscv C code when it's available.

idle wharf
#

@silver tapir which IDF features link are you looking at ? the last one I looked at was out of date

thorny jay
#

Andreas really was showing what it really mean to be low power...

silver tapir
#

@idle wharf How to use the ULP riscv core. When I say it, it just say "not yet..."

#

I'm actually learning how scott did the spram on the esp32s2, because I want to learn how to implement low power on the riscv core.

ionic elk
#

@silver tapir I can't google the ลณCurrent, does that have a different name for marketing?

solar whale
#

๐Ÿ‘‹

errant grail
#

Thanks everyone!

modern wing
#

Thanks!

analog bridge
#

Thanks!

thorny jay
#

If ever you have a summer time change, don't hesitate to warn non US.

mental nexus
#

Thanks everybody!

silver tapir
tulip sleet
#

Sunday nov 1,2020, 2am is end of daylight savings in US

silver tapir
#

I would be nice to share the PPM data in a group feed in AdafruitIO ๐Ÿ™‚

onyx hinge
#

This is how the nov 2 meeting shows. The offset is noted specifically beacuse it's the next one after our change to standard (winter) time

solar whale
#

Drags out the election for one more hour ๐Ÿ˜ฆ

idle wharf
#

My first time listening live today.

slender iron
#
Joulescope Store

Joulescope is the most affordable and easy-to-use precision DC energy analyzer. Joulescope measures current and voltage, then computes power and energy. Use Joulescope to optimize energy consumption and battery life during product development. Great for reducing microcontrolle...

onyx hinge
#

@idle wharf happy to have you!

silver tapir
#

Oh the joule seems to be a bit $.

#

I think the trick with the Spiess ones, is that they are cheap.

idle wharf
#

Thanks @onyx hinge this whole group is pretty awesome ๐Ÿ˜‰

silver tapir
#

So, $60 vs $700

#

And good luck if you try it with cuneiform :รพ

#

I do have a question but outside the meeting. In one of our talks, the owner of Electric Cats was talking about how to add cpy to your own boards. He had this question, so I relay it here.

#

How it the process for getting a usb PID for a circuitpython board? And what would be their limitations if any?

slender iron
#

since they are a maker company making multiple boards they should consider purchasing a USB VID for themselves

silver tapir
#

I was thinking of talking about this, but for the rest of us, the ones we don't have companies with multiple boards.

lucid solar
#

@slender iron I'm working on the F1 port, it gets stuck in tud_msc_test_unit_ready_cb. Do you know how that works?

onyx hinge
silver tapir
#

But I agree that for a company they should get their own.

slender iron
#

for makers who aren't selling their stuff we can gift PIDs with the adafruit VID

silver tapir
#

Ah ok, so that would be the limitation. If I plan on getting 50 boards on tindie, then I should invest in getting my own.

slender iron
#

@lucid solar not really sure what the issue would be

#

@silver tapir 50 different board designs then yes

silver tapir
#

But for like a badge, or demo project, etc, their fine. And how would one request a PID?

#

I meant 50 board of a single design.

marble hornet
#

a circuitpython based ammeter would be a great edition to the circuitpython ecosystem. since the profiler and profiled would be in cp. and hopefully bring the price down.
I don't have the expertise or time to develop the expertise to make a product like that but thought the idea was worth putting out there.

slender iron
#

for 50 of a single board we could donate a PID

silver tapir
#

@slender iron Thanks for the info.

slender iron
#

np

silver tapir
#

We are kinda trying to push more latam makers into building their own boards, and maybe start businesses around them.

lucid solar
#

@slender iron get_vfs(int lun)
what's a lun? ๐Ÿ˜‰ I tried to find out, but I don't get it.

slender iron
#

logical unit

#

I think

#

basically if you have multiple drives

lucid solar
#

lun 0 is the main one right?

slender iron
#

yup

lucid solar
#

mp_vfs_mount_t* current_mount = MP_STATE_VM(vfs_mount_table);

#

seems to fail here...

#

is that mount table set somewhere else? so it probably means the flash isn't being setup right?

slender iron
#

I don't remember where

#

but yeah, if cdc works but not msc then it's usually a flash issue

#

not used to it getting stuck though

lucid solar
#

ok...thanks...I'll keep looking into it.

tulip sleet
slender iron
#

@silver tapir do you have a youtube playlist for the Dia CircuitPython videos?

lucid solar
#

@slender iron (or anyone else) I have 192kb for FLASH_FIRMWARE, that doesn't seem to be enough. It already feels like it's a minimal build, but do you know of something that will shrink it even further?

slender iron
#

can you link me to a diff of what you have?

slender iron
#

thanks!

lucid solar
#

can you link me to a diff of what you have?
@slender iron was this to me?

slender iron
#

yes

slender iron
#

there is also CIRCUITPY_FULL_BUILD that you should set to 0

#

the firmware.elf.map file is a good way to see what is included still

lucid solar
#

Yeah, I just don't know what is needed or not...

slender iron
#

you should be able to turn everything off to start

lucid solar
#

But that shrunk it quite a lot...~7k left to remove

#

but I can get that by moving around the 'partitions'

slender iron
#

make sure you build with -Os and --gc-sections

#

the SAMD21 builds also have lto enabled

#

not sure STM is setup for it

lucid solar
#

-36 bytes

#

soooo close!

slender iron
#

๐Ÿ™‚

lucid solar
#

-O2 (that's ok right?)

slender iron
#

-Os will be smaller

#

-O2 is faster

lucid solar
#

but I thought -02 includes -0s?

tulip sleet
#

s is for "size"

lucid solar
#

Ah, I had it the wrong way round...

#

'Optimize for size. -Os enables all -O2 optimizations except those that often increase code size:'

#

@slender iron @tulip sleet @ionic elk this is good right? ๐Ÿ˜‰

slender iron
#

yup! ๐Ÿ™‚

#

Here is the notes document for Mondayโ€™s CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if youโ€™ll be attending the meeting - itโ€™s super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and weโ€™ll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1lkj5xteD6rW1eqh9swbGeuidZTKsB3CtW2Lpgff1P3U/edit?usp=sharing

slender iron
turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Region

us-west

Channel Categories

8

Text Channels

54

Voice Channels

6

Members

24922

Roles

34

marble hornet
#

@tulip sleet thank you, i'll pick one up on my next order. ..
do you have any tips for debugging _bleio? the watches crash on every import (except for one of them, which always times out on connections) and there definitely is an sd @ 0x0

onyx hinge
#

aha the LED controller on the makerdiary keyboard is IS31FL3733A, I think.

hybrid scarab
#

Crumbs, had the day off with my toddler and totally forgot it was Monday!

manic glacierBOT
onyx hinge
#

@hybrid scarab sounds like a good use of your time!

#

hmm maybe there's no IS31FL3733A support in CircuitPython yet at all !?

hybrid scarab
#

True, god knows I spend too much time working

#

Trying to remember if I've written any code for IS31FL3733A ๐Ÿ˜†

#

Ah- no- IS31FL3730

onyx hinge
#

and there's support for 3731 as well

hybrid scarab
#

Oooh 12x16

onyx hinge
#

In this case there are 61(?) RGB LEDs, it's a keyboard backlight

hybrid scarab
#

Math checks out

stuck elbow
#

the ISSI chips are relatively easy to support

#

they all have similar commands

hybrid scarab
#

Mapping the darn LEDs is the tricky part

stuck elbow
hybrid scarab
#

I wrote a - bad - Python library for the IS31FL3730 about 5 years ago

tulip sleet
#

@marble hornet I haven't seen that kind of crashing before. Your SD version should be 6.1.1, not 7.0.x, which is a 1k larger in size internally

#

this is a 52840, right?

marble hornet
#

ah, okay. let me see if I can find how to check that. when the sd is being flashed it erases 0 -> 0x26000 (iirc)

#

and yes!

tulip sleet
#

that is right, 7.0.1 goes to 0x27000

marble hornet
#

ah, and (asking explicitly to be sure) that version does not work w/ cp?

tulip sleet
#

the latest version of the nrf52 UF2 bootloader (not released yet, I think) will report the SD version in INFO_UF2.TXT

#

someone has an nRF52833 board def that (must) use 7.0.1, and that seems to be working

#

it think it is pretty much upward compatible

marble hornet
slender iron
#

you want to pull from main now

tulip sleet
#

i think the uf2 bootloader is till using master, but circuitpython should be from main

thorny jay
#

I wrote a - bad - Python library for the IS31FL3730 about 5 years ago
@hybrid scarab I adapted an existing CP driver to support the Led Shim and Scroll pHAT HD.

marble hornet
#

checking the repo agrees about main vs master,

hybrid scarab
#

@thorny jay for the best ๐Ÿ˜†

tulip sleet
#

if there is no SD present, it will note that too

thorny jay
#

Whoever made the mapping of the Led Shim... need to give me an explanation! LadyAda did not want a big table, so I made if/then test and math to make the mapping.

manic glacierBOT
marble hornet
#

that's really cool! All six of the TG-Watch02B boards have 6.1.1 installed ; I'd love some guidance on how to proceed with an issue like this? if you wouldn't mind pointing me in the right direction or if you have some time (at some point) and wouldn't mind helping dig a bit deeper , either would be greatly appreciated.

manic glacierBOT
slender iron
#

I wonder if we should have maintainers listed in board defs

#

so we know who to ping when someone needs support on a board

ionic elk
#

maybe port level?

slender iron
#

perhaps port level but I'm more worried about simpler board-level issues

ionic elk
#

I'm just a little concerned about the implication of associating circuitpython maintainers with specific 3rd party products

ionic elk
#

Or would we be linking the people who actually submit board PRs?

marble hornet
#

The only edge case I see for that is if the person who submitted the pr is the person who made the board.

slender iron
#

@ionic elk right, the maintainers of third-party boards wouldn't be us

#

I think an empty maintainer list is ok for third-party boards. at least then we have something to point to

manic glacierBOT
#

wifi.radio.connect() works fine after a scan has been done, but without doing a scan first it does not return - keyboard interrupt after a few minutes gives a trace pointing to the wifi.radio.connect() line.

This is very repeatable as far as I've seen.

This works:

for network in wifi.radio.start_scanning_networks():
    print(network, network.ssid, network.rssi, network.channel)

wifi.radio.stop_scanning_networks()

print(wifi.radio.connect("ssid", "pass"))

This wai...

ionic elk
#

I should note that I've seen a lot more board-specific support tickets in the forums than on github.

slender iron
#

ya, that's the ideal

#

maybe we also need a support forum link

ionic elk
#

So you mean this mostly as an Adafruit product support thing? Less of a link-board-creators deal

marble hornet
ionic elk
#

Would probably want to verify that they were the ones who submitted the board def first, of course

manic glacierBOT
slender iron
#

@ionic elk @marble hornet Exactly, most companies have support forums. I'm kinda ok pointing folks there even if they didn't add support because they should tell the board maker they want circuitpython support. ๐Ÿ™‚

#

@onyx hinge I swapped one issue from 6.0.0 to 6.x.x. I don't want to block 6.0.0 on esp being stable

#

(which is why I want us to explain stability of each port)

ionic elk
#

@slender iron seems reasonable

marble hornet
#

agreed

ionic elk
#

Ach, how do I solve Warning, treated as error: /home/runner/work/circuitpython/circuitpython/ports/esp32s2/README.md:document isn't included in any toctree again? I'm certain I've done it before but I don't remember the file I gotta edit

slender iron
#

you need to add it to another table of contents

#

otherwise no one will be able to reach the doc

#

I think it's in docs/supported_ports or something

ionic elk
#

Ahh, gotcha.

manic glacierBOT
#

I suspect it's connecting to the first channel that has an AP with the desired access point. The connect redoes a scan and stops on the first channel it finds. I added channel as an option to connect in order to speed up the connection process. That should solve your issue if your APs are on different channels.

Would you like to help add bssid to the Network class? It should be a straightforward edit to https://github.com/adafruit/circuitpython/blob/main/shared-bindings/wifi/Network.c#L7...

#

This URL returns a valid HTTP 200 status code, headers including a 'Content-Length': '0' header, and no message-body.

This URL / code:

for _ in range(0, 5):
    response = requests.get("https://httpbin.org/status/200")
    print(response.status_code)
    print(response.reason)
    print(response.headers)
    print(response.text)

returns right away (less than a second) consistently in a browser or in python 3 (macOS).

In CircuitPython,...

slender iron
#

thanks for the explanation @tulip sleet

manic glacierBOT
spare prawn
#

How to enable WebREPL over BLE UART for NRF52 Circuitpython? The impression I have from documentation I found is that I need a custom build of Circuitpython. Is this available somewhere or do I build it?

slender iron
#

I don't know of an easy way to enable it

manic glacierBOT
onyx hinge
#

@slender iron thanks for letting me know about switching issue milestone -- in that case I didn't have a strong opinion, I just wanted to get the "no milestone" count down

slender iron
#

totally, thanks for setting it

#

I just want to push us to stable faster than the esp32s2 will let us

#

lots of good stuff the other ports would already benefit from

manic glacierBOT
manic glacierBOT
#

OK, so, I've had a short look. I'm going to preface this with I am completely out of my league as far as this type of programming goes, and am primarily going off of how the usage example looks. I expect I'm going to make some assumptions that are wrong, so please do correct me!

I'm going to assume there's something to differentiate between how the camera is interfaced (SPI, I2C, UART, whatever) during initialization.

The VC0706 in particular, though, can take pictures at 640x480,...

manic glacierBOT
#

Hi Richard! Thanks for adding a new ESP32-S2 board to CircuitPython. We're always happy to see more boards supported. The best place to get support developing with CircuitPython is the Adafruit Discord server, the #circuitpython channel specifically. You can join it by going to https://adafru.it/discord . Discord is blocked in China, so you can add me (tannewt) on WeChat if you are there.

The Factory app partition error is a red herring because we intend on placing the TinyUF2 bootloader t...

hearty forge
#

Which repo/branch is the "best" to start from for the esp32s2? Adafruit/circuitpython main? tannewt's wifi branch?

idle wharf
#

Adafruit/circuitpython main is good2go, native_wifi was merged

#

Now if you want something specific not yet done... might be in Tannewt's might be in someone else's fork...

hearty forge
#

Thanks @idle wharf ! Looking to make a simple l293d driver library, and then maybe try to port the the rotary encoder library.

idle wharf
#

Might be in your fork ๐Ÿ˜‰

hearty forge
#

@idle wharf - Oh! I'm completely new to the CP source- can you give me a pointer to where it might live; I'm blindly cding around ports\esp32s2 ๐Ÿ˜‰

idle wharf
#

What are you looking for exactly?

#

The libraries ?

#

@hearty forge ^

hearty forge
#

@idle wharf - sorry, was re-reading readthedocs + github (FYI rotaryio page readthedocs page has a broken github link)

#

I'm wanting to be able to setup rotary encoders; as it's not on the suport matrix for the esp32s2 I assumed there's some work to be done. Just found the C code in shared-bindings... does everything in shared-bindings "just work"??? I'd assumed there's some work to be done & a "build it" flag to be flipped in the makefile.

idle wharf
#

I'm not a contributor to the C code, so I'll have to let someone give you a definitive answer, but i think if you look for where it exists in another port (like nrf) then I think you'll see what you're looking for. I'm actually trying to see if I can figure out RTC so if you figure out, let me know

hearty forge
#

Thanks @idle wharf - nrf looks to be an excellent suggestion for a reference to look at. And I quickly looked at the RTC and found this issue (https://github.com/adafruit/circuitpython/issues/2958) which reading through it gives me some more ideas at least of the moving pieces. Nothing like jumping in the middle and not knowing much about any of the directions ๐Ÿ˜‰

GitHub

CircuitPython - a Python implementation for teaching coding with microcontrollers - adafruit/circuitpython

#

@idle wharf what's not working for you with RTC? From that issue it looks to be working???

idle wharf
#

The specific RTC module is needed for some other libraries (mini mqtt )

#

So the common-hal/rtc needs to added. I might be able to figure out just from patten matching what is going on the other ports. (I donโ€™t know C) but if not, thereโ€™s an open issue on it https://github.com/adafruit/circuitpython/issues/3321

GitHub

It does not look like you can manage or use any system time without RTC. Note: This is the lowest level dependency as I work up the stack to using the Azure IoT Library. Board: FeatherS2 Build: 08-...

manic glacierBOT
#

I think so, I definitely understand the style you're going for, and will certainly look towards the BLE adapter for inspiration. I'm thinking I'm going to write from the "top down", so the python layer first and then fill in what it needs to be usable. I'll open a draft PR when I feel like the python layer looks sound so we can make tweaks starting there, before ugly accidentally stumbles all the way down the hill!

Excited to get started!

hearty forge
#

Hardware safety question for esp32s2 saola - I'm got CP flashed via the built in usb socket. Next step is to add a socket for the built in usb. If I'm connecting to the same PC is it ok to have both sockets connected at the same time? Or should I leave the +5V from the breakout socket disconnected from the 5V (Vin?!) pin on the Saola? And if both USB sockets are wired up (ie usb V+ from breakout is connected to 5V pin on Saola) should a PC only be connected to one or the other?

slender iron
#

for rotaryio you'll want to enable CIRCUITPY_ROTARYIO in mpconfigport and then add an implementation in ports/esp32s2/common-hal/rotaryio

#

@hearty forge I usually connect both

hearty forge
#

Thanks @slender iron ! Re the usb cables- there's "what you can get away with", and "what you should tell students/beginners..." Like current limiting resistors for LEDs (ie short term/low risk projects- risk it. For a medical device... don't ๐Ÿ˜‰ ) Do you know which category plugging both in falls?

slender iron
#

I've been doing it since I started working on it. both cables come from the same hub

#

I make no promises

hearty forge
#

@slender iron ๐Ÿ˜‰

slender iron
#

๐Ÿ™‚

#

I'm willing to risk an $8 board

hearty forge
#

@slender iron - I'm 3-4 days away from a replacement + $100 minimum order... and I plan to sell/lend these to kids for minimum cost to make it as accessible as I can, so longevity is important to me... and my "save a penny" up bringing ๐Ÿคฃ

manic glacierBOT
slender iron
#

@hearty forge they are saola's? you'll be better off waiting for a better board then

hearty forge
#

@idle wharf I'm probably in a similar skill bracket, but mqtt is on my list of wanted features. I'll ping you when I get that far- if it's not already working, maybe we can figure it out ๐Ÿ™‚

#

@slender iron don't disagree, but I think/hope it'll be good enough to start with - ie learn, build just enough code, build some examples, do some trial runs, and see if there is some local interest. I've got a few spare- but I don't want to fry them as quickly as the first set of trinkets I got... accidentally got the 3.3V version ๐Ÿคฆโ€โ™‚๏ธ

orchid basinBOT
hearty forge
#

Last question for a couple of days- is the socket code at a point where you can write a basic tcp echo server?

slender iron
#

@hearty forge no, I only did send and recv, not bind or accept

hearty forge
#

@slender iron - I think that would be enough to test ideas in a "backwards" sense. Really appreciate the answers; I think I have a roadmap for my project now, and a couple of places I might be able to help the project (flesh out some missing bits) because you and the team have done an orbit or two, providing some examples/scaffold for less experienced folk to start from. Super cool what you've all done!

slender iron
#

thanks!

hearty forge
#

Do you happen to have any test/example code of where you left it?

slender iron
#

bind and accept?

#

I didn't start it

#

though they are commented out in the shared-bindings code I inherited from micropython's socket

hearty forge
#

No- the send and recv- I'm very rusty; any memory-kicks are very helpful ๐Ÿ™‚

slender iron
#

it is a subset of CPython's socket api

hearty forge
#

Doh- I was just reading over readthedocs & missed that- also was looking at the shared bindings. Think it's time to take a break. Brain is full!

slender iron
#

readthedocs defaults to 5.3.1 which won't have socketpool so make sure you are looking at latest

manic glacierBOT
#

Thanks @joeycastillo and @TG-Techie for the great comments and background. I like how the discussion is already going. Please forgive me if the words I use are inaccurate with typical terminology and feel free to correct me and clarify anything that I say here.

I've started thinking about the user experience. I agree with @TG-Techie that a full Model-View-Controller is probably more complex than most new users will be able to create as a first project. In particular, I'm concerned abou...

manic glacierBOT
#

I looked at the other ports, picked the simplest one that had RTC an copied it.
In the original port it used tv in the espressif sample it used tv_now.
This is a partial implemenation for #3321

NOTE: I'm not sure if the calibration stuff which was essentially n\a in the one I copied should be implemented for the ESP32S2

Seems like its working...

>>> import time
>>> import rtc
>>> r = rtc.RTC()
>>> r.datetime = time.struct_time((2020, 9, 14, 23, 22, 15, 0, -1,...
stuck elbow
#

Version 3, this one is pretty much a flat Planck, since I added two more columns of keys. I'm happy with it and I think I'm going to keep using it.

#

I still have the previous verson, but with RGB LEDs to assemble

onyx hinge
#

I think I need a proper plate before this'll be usable. My first experience with keyswitch sockets hasn't been going well, and my attempt at a 3d printed plate didn't "fix" it. not flat or rigid enough, it keeps pulling some keys out of contact. but this isn't a channel about keebs so I'll stop there.

manic glacierBOT
#

For my project I often have to deinit a pin from bitbanging, start SPI, deinit SPI, bitbang again etc...
After a pin or spi is deinit(),
it would be the best if the pin hardware can keep its electrical state before deinit().
For my use, only CLK pin is important to be glitchless.
Currently a 1-CLK glitch happens which is luckily of consistent shape and is workaroundable
in the code but I'd like to have cleaner solution if possible.

ESP32 (non-S2) with micropyhton has some SPI pinout w...

#

@Andon-A Thank you for your comment!

The VC0706 in particular, though, can take pictures at 640x480, 320x240, and 160x120, and can flip between those on a whim. It looks like your initializing it at one set size. This... works? but can be restrictive if, say, you want to take a smaller picture to transmit it over a packet radio faster. but also take larger ones to save to local storage. Again, a lot of this is stuff I quite frankly don't know enough about to know what I'm looking at, b...

ornate breach
#

Does the Atmega32u4 support circuitpython ? I saw circuit python classic, but is that well supported still?

slender iron
#

no

#

only 32-bit CPUs

#

(well 32+ bits)

ornate breach
#

gotcha

onyx hinge
#

ooh I have received my own message in loopback mode on CANbus with sam e54

ornate breach
#

oh nice! ๐Ÿ™‚

#

I was going to ask you about how the CAN bus development was going @onyx hinge

#

My team is interested in using CAN bus as an interface for our VLC system

ionic elk
#

@hearty forge re: usb, can't you just leave the USB breakout cable power off? That's what I do. I just have power coming in over the UART-USB debug cable and the USB I just leave the power unplugged and it works fine

onyx hinge
#

however when NOT in loopback mode, I don't receive my own messages or other messages on the bus

#

@ornate breach basic functionality is not yet ready for a pull request .. hopefully soon, then we can see what else is needed for it to be useful.

ornate breach
#

๐Ÿ™‚ sounds good, it'll be a few months before we are ready to even start implementing CAN

onyx hinge
#

what is a VLC system in this case?

slender iron
#

@onyx hinge I got my plate from lasergist

onyx hinge
#

hm the transmit and receive programs both start to fail when I set non-loopback mode

#

I think this register's state is probably relevant: ACT: SYNC Node is synchronizing on CAN communication - Activity -- it sticks in SYNC when not loopback, but gets to IDLE when loopback

#

๐ŸŒฎ

ornate breach
#

Visible Light Communication

#

using Free Space Optics

slender iron
#

@onyx hinge sounds like a clock issue

#

are you providing all of the correct clocks?

onyx hinge
#

With "loopback", it's a bit of a misnomer. It can be, and is, received by other devices on the bus.

slender iron
#

oh, weird

onyx hinge
#

So it seems like clocks are okay, my bits are all going at the right rate

#

Yeah I'll look again after food, and go back to the asf4 complete program that I think worked but I'm loopback mode

ornate breach
#

oh.. what was the link for requesting VID/PID for CP boards?

idle wharf
#

@idle wharf - sorry, was re-reading readthedocs + github (FYI rotaryio page readthedocs page has a broken github link)
@hearty forge I forgot to mention last night. re: that bad link. You can open an issue in github about it.

manic glacierBOT
#

I feel like each display or control element's value should be persistent so that any other element could react to its value. And somehow each element needs to be "informed" to react to any change in the control. Rather than try to refresh the display elements every cycle, maybe each element needs the equivalent of "dirty-rectangle" tracking to trigger an update only when the value of a related object was changed.

I would caution against having this be part of what you are trying to achie...

manic glacierBOT
#

I improved the initial comment on this PR and also added an explanation in the comments of translate.h:

+// - code points starting at 128 (word_start) and potentially extending
+//   to 255 (word_end) (but never interfering with the target
+//   language's used code points) stand for dictionary entries in a
+//   dictionary with size up to 256 code points.  The dictionary entries
+//   are computed with a heuristic based on frequent substrings of 2 to
+//   9 code points.  These ar...
#

I don't think setting pin to input is good idea, because
Rest of hardware may pull it differently and we can't rely in charge
capacitance.

Correct way would be if clk pin was e.g. in output state and driving "1" out,
after deinit() it should continue to drive "1", not float.

On 9/15/20, Scott Shawcroft notifications@github.com wrote:

It doesn't look like we're returning pins to INPUT when reset. Would you
mind trying to do

        gpio_set_direction(i, GPIO_MODE_DEF_INPUT);...
copper crescent
#

Hmm @thorny jay :) did you have any luck using Gamepad on Commander?- I can't get it to work reliably in 6.0.0-alpha.3 but it did work OK in a self compiled 6.3.1 back when I submitted the patch to add it.

manic glacierBOT
thorny jay
#

Hi @onyx hinge , I know I am late for the party, but I just watched the PythonDay video about sdioio. What I did not catch from the video or quick read from the guide is if PyPortal is properly wired for sdioio or only for sdcardio.
I get that the PyGamer is sdcardio and STM32 is sdioio. But do you have a table that say which is sdioio compatible?

onyx hinge
#

They're all wired for SPI except for STM32F405 Feather.

#

so that means use sdcardio

thorny jay
#

Hmm @thorny jay :) did you have any luck using Gamepad on Commander?- I can't get it to work reliably in 6.0.0-alpha.3 but it did work OK in a self compiled 6.3.1 back when I submitted the patch to add it.
@copper crescent It was unsatisfactory, but my first use of it, so I could not tell if it was me or a problem.

#

I used nightly build because I needed the usb hid report.

copper crescent
#

err 5.3.1 even

solar whale
#

@slender iron I am still getting the SSL failure on teh esp32s2 when I try this request response = requests.get("https://api.thingspeak.com/channels/1417/feeds.json?results=1") failes with ```Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "wifi_cheer.py", line 39, in <module>
File "adafruit_requests.py", line 507, in get
File "adafruit_requests.py", line 456, in request
File "adafruit_requests.py", line 405, in _get_socket
File "adafruit_requests.py", line 401, in _get_socket
OSError: Failed SSL handshake

thorny jay
#

I was "missing" button press or a bit of delay. I returned to using denounced library (that I had to fix).

#

Could not use 5.3.1 because usb hid report is only on 6.0.0.

slender iron
#

@solar whale please open an issue to use the cert bundle we use in esp32 nina fw. my guess is that we don't have the root cert for that domain

#

right now the s2 is using the default bundle

solar whale
#

ah OK -- and is it normal for the "star count" request to take a really long time -- like 20 seconds...

copper crescent
#

@thorny jay yeah, I'm seeing lots of missing button presses too

thorny jay
#

Should write a very simple test code that only does unitary test to confirm the feeling. An run on another hardware with buttons... but not sure what I have that will not require breadboarding or worse.

#

Not sure about the internals of gamepad implementation. But with long int removed from M0 it could be affected...

manic glacierBOT
thorny jay
#

That was discussed in the weed in last meeting 25 hours ago.

slender iron
#

@solar whale ya I think so. it's doing a lot of json parsing

manic glacierBOT
#

the following request work OK with and ESP32 with the NINA firmware, but not with the esp32s2 native wifi

response = requests.get("https://api.thingspeak.com/channels/1417/feeds.json?results=1")
 fails with 
Traceback (most recent call last):
  File "", line 1, in 
  File "wifi_cheer.py", line 39, in 
  File "adafruit_requests.py", line 507, in get
  File "adafruit_requests.py", line 456, in request
  File "adafruit_requests.py", line 405, in _get_socket
  File "adafruit_req...
solar whale
#

OK -- not a problem -- just wanted to check -- seems to work reliably

thorny jay
#

@copper crescent Maybe I can try on uGame ... it has buttons, don't you have one too?

manic glacierBOT
slender iron
#

@solar whale the new requests changes parsing to be byte by byte. I think its slower but it'll use less memory

solar whale
#

patience is a virtue

slender iron
#

I suspect there is a middle ground we could do to grab 32 bytes at a time or something

copper crescent
#

@thorny jay no, I've dug out an M0 feather so I'll give it a go on that

slender iron
#

to minimize overhead and memory

solar whale
#

At this point -- just having it work is amazing

slender iron
#

๐Ÿ™‚

thorny jay
#

Maybe try with the first build after your change was accepted. All build are on S3, so you can check it was working and got broken...

#

Sorry @copper crescent , I am on my phone and into a hot tub... except for my memory and idea, I am not really useful to dig into code or test right now.

slender iron
#

@stuck elbow what USB PIDs do you use on your boards?

thorny jay
#

Did you get my report that commander reboot on SDcard insertion? Your support page did crash when I submitted all the details and I lost the detail output.

manic glacierBOT
copper crescent
#

@thorny jay not a problem was just wondering if you had it working but it looks like it's OK on the Feather M0 Express with 5.3.1 but missing presses with 6.0.0-alpha.3 using the example code so it might not be all me ;)

stuck elbow
#

@slender iron firmware-wise it's fluff m0

#

that's what I needed it for - to have a board that has all the pins but just naked samd21

copper crescent
#

@thorny jay Hmm no I didn't, feel free to email/msg details when/if convenient

slender iron
#

@stuck elbow I'm trying to sort out CP USB PIDS and it looks like pewpew10 shares with gemma and ugame10 shares with the trinket

stuck elbow
#

that's possible, they were made before I had my own PID

#

@slender iron if Adafruit could assign some of its PIDs, I see no problem with that, should I go the formal path with this through the bug tracker?

slender iron
#

I can do it. I just want to know what you are using now

stuck elbow
#

otherwise I can try getting some more from OpenMoko

slender iron
#

/ what you need

stuck elbow
#

pewpew m4 uses my openmoko pid, and fluff m0 got pid from adafruit, otherwise I don't have any more

#

so it would be nice to assign separate pids for pewpew10 and ugame, if possible

#

I don't think I have any more CP boards officially published

#

the keyboards are for my own use so far, and I still didn't finish the robots

slender iron
#

kk will update pewpew and ugame

#

what is the id for fluff? I don't see it in our file

stuck elbow
#

Fluff M0 VID 0x239A PID 0x00AF # bootloader
PID 0x80AF # arduino
PID 0x80B0 # circuitpython

#

except I don't have an arduino board definition

slender iron
#

kk, do you expect to have one? or should we use it for one of your other boards?

thorny jay
#

@stuck elbow I believe you were behind the Gamepad library? Did you recently tested Gamepad code (the pin version)? Because we have a problem on Commander 8086 where it was recently added.

slender iron
#

@stuck elbow ugame will be 0x80AF and pewpew10 will be 0x80D5

manic glacierBOT
#

Yes It is causing the glitch.

IMHO, deinit() should at least have some parameter how to leave the pin
or it should leave it in the state it found. When a pin is deinit() it doesn't
mean we are done with the rest of hardware. Image half-bridge driver
solid state relays and similar things... going into input mode is not good.

Source is here, an example line when workaround is done.
https://github.com/emard/esp32ecp5/blob/master/circuitpython/ecp5f.py#L71

On 9/15/20, Scott Shawcroft <notific...

#

OK, tried a bunch of things, even what seemed to be the recommended approach with SSLContext.wrap_socket() didn't get a connection, but this worked:

https = requests.Session(socket, ssl._create_unverified_context())

With this change to https://github.com/adafruit/Adafruit_CircuitPython_Requests/blob/master/examples/requests_https_cpython.py that code runs fine.

Then, ...

stuck elbow
#

@slender iron thanks

#

@thorny jay I didn't test it properly, but I did try 6.x with pewpew m4 that uses it and it seems it worked

onyx hinge
#

wahoo, packet reception now works. I had failed to set the data direction of the RX pin to input, so while I could (somewhat surprisingly!) monitor the logic level RX signal on the board and it showed what I expected, the CAN peripheral didn't get any data in.

thorny jay
#

@thorny jay I didn't test it properly, but I did try 6.x with pewpew m4 that uses it and it seems it worked
@stuck elbow Thanks, I tested on my Sam minifig (single button) that is also M4 and it works. Will investigate further... maybe an M0 issue???

stuck elbow
#

possible

#

I didn't touch pewpew10 in a while, I recently have very little usable time

thorny jay
#

Does ugame use gamepad? I will have a new usb ID... so I need to test. ๐Ÿ˜‚

stuck elbow
#

it does

#

wait, pewpew10 doesn't, it scans buttons as a part of metrix display routine

#

but ugame and pewpew m4 both do

manic glacierBOT
#

Tested & working:

  • Send standard packets
  • Receive standard packets (1 FIFO, no filter)

Interoperation between SAM E54 Xplained running this tree and MicroPython running on STM32F405 Feather with an external transceiver was also tested. (SAM-to-SAM is not actually tested yet)

Many other aspects of a full implementation are not yet present, such as error detection and recovery.

The listener program should be started before the transmitter program. Otherwise, the tr...

slender iron
#

nice @onyx hinge ! that was going to be my other guess

onyx hinge
#

I'm happy I didn't spend much more time stuck.

slender iron
#

๐Ÿ™‚

manic glacierBOT
onyx hinge
#

๐Ÿ‘† nice

#
['\x00\x00\x00\x00\x00\x00\x00\x00.\x00\x00\x00', '\x00\x00\x00\x00\x00\x00\x00\x00.\x00\x00\x00', '\x00\x00\x00\x00\x00\x00\x00\x00.\x00\x00\x00', '\x00\x00\x00\x00\x00\x00\x00\x00.\x00\x00\x00', '\x00\x00\x00\x00\x00\x00\x00\x00.\x00\x00\x00', '\x00\x00\x00\x00\x00\x00\x00\x00.\x00\x00\x00'โ€ฆ``` that's not healthy
slender iron
#

noooopeeee

manic glacierBOT
#

@jepler - do you know what the intent was for PR #3244? I asked @xiongyihui but have not received any response. Since qspi_disable() is called in port_sleep_until_interrupt(), any routine that calls mp_hal_delay_ms() will turn off QSPI. In effect, this disables QSPI by default at boot time when USB is not connected, as several startup routines have short delays in them. The effect on the Clue is to disable the display (which uses SPI) and there does not seem to be any way to turn it back on....

copper crescent
#

@thorny jay @stuck elbow looks OK here on a Feather M4 too but not the Feather M0 or Commander (M0)

teal bear
#

I have some buttons on an 405f board. and I should be looking into debounce some day. would it help someone if i tested something?

#

I hope 405f is an adequate nickname

manic glacierBOT
#

(I was a little confused that the top level makefile only generates documentation.)

No problem, anything else that was confusing as a first-time port builder? Would like to make this accessible as possible.

Over all, very impressed - better than what I got to see over peoples shoulder 10 years ago from commercial vendors (worked adjacent to base port devs.) it would be helpful to have a few short readme files sprinkled around in the HAL, binding, driver directories for both the ...

hearty forge
idle wharf
#

Building the docs is hard. I ran into an issue with some Microsoft docs where whole sections were missing.

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Over all, very impressed - better than what I got to see over peoples shoulder 10 years ago from commercial vendors (worked adjacent to base port devs.) it would be helpful to have a few short readme files sprinkled around in the HAL, binding, driver directories for both the shares and port directories. I imagine if youโ€™ve seen a BSP package before/HAL abstractions it might be a different kind of confusing due to some of it being for python bindings.

In case you haven't seen, all of the ...

manic glacierBOT
#

Probably not the cause, but from reading the config files and pattern matching, wonder if it's to do with /docs/autoapi/templates/python/module.rst - search for index.rst. To me the paths that I think this template generates match up to the incorrect links on RTD.

I've built the docs locally and the resultant structure is quite different than RTD- so I'm lost as to how to reproduce it locally.

But after some googling, I think the GitHub links on RTD are added by their theme, which ...

#

Over all, very impressed - better than what I got to see over peoples shoulder 10 years ago from commercial vendors (worked adjacent to base port devs.) it would be helpful to have a few short readme files sprinkled around in the HAL, binding, driver directories for both the shares and port directories. I imagine if youโ€™ve seen a BSP package before/HAL abstractions it might be a different kind of confusing due to some of it being for python bindings.

In case you haven't seen, all o...

crimson ferry
#

@slender iron Thanks for answering my flash question to unexpectedmaker the other day, looking at the build files had me baffled. I'm guessing bigger partition in general for esp32s2 is due to the added network modules, but curious why an extra bump on larger flash modules?

slender iron
#

just to give us more headroom

#

I'm worried we'll run out with ~1400k

#

and for really big things people will use an SD card

crimson ferry
#

got it, thank you

slender iron
#

np

manic glacierBOT
crimson ferry
#

I've never had processor-internal time.time() go bad on me before... glitch in the matrix?```>>> time.localtime(time.time())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: overflow converting long int to machine word

time.time()
2206332817```

#

(Feather M4)

crimson ferry
#

so I guess I should put a check in for seconds values > 2**31 - 1 before doing time stuff on them

manic glacierBOT
#

From what I can see SPI and QSPI do not share pins on the Clue.
From boards/clue_nrf52840_express/board.c:
void board_init(void) {
...
&pin_P0_13, // TFT_DC Command or data
&pin_P0_12, // TFT_CS Chip select
&pin_P1_03, // TFT_RST Reset
...
&pin_P1_05, // backlight pin

and in supervisor/qspi_flash.c:
nrfx_qspi_config_t qspi_cfg = {
.xip_offset = 0,
.pins = {
.sck_pin = MICROPY_QSPI_SCK, // defined as NRF_GPIO_PIN_MAP(0,
19)
...

manic glacierBOT
hearty forge
#

Trying to understand rotaryio and have found that CIRCUITPY_ROTARYIO = 0 in all the mpconfigboard.mk files- even the ports that list it as available in the support matrix on RTD. How does this flag work? Is there another layer of config that flips this prior to building it?

manic glacierBOT
manic glacierBOT
tulip sleet
#

@hearty forge That's odd. What are some examples of boards that set CIRCUITPY_ROTARYIO to 0 but have it?

manic glacierBOT
simple pulsar
#

Hello. Is there a single github repository where all the uf2 files are stored for the sample program which comes with each Adafruit device? I thought there was one but can't find it.

stuck elbow
#

uf2 files are not stored in a git repository

#

and they don't contain sample programs either

lone axle
#

Often (but not always) they pre-loaded demo contnet is available in the Downloads section of the device specific guides.

manic glacierBOT
simple pulsar
#

@lone axle I spotted that for CLUE but not CPB with a very quick browse.

lone axle
#

@simple pulsar coincidentally I was just looking for the CPB pre-loaded demo the other day and Jerry had a copy of it that he was able to share with me. If you just need a copy of it, not an official source I can pass that along to you.

manic glacierBOT
lone axle
#

It does seem to be missing from the main device guide for CPB though I did notice that as well.

manic glacierBOT
simple pulsar
stuck elbow
#

no idea, but it's not a uf2 file for sure

lone axle
#

Yes, I think so. But it's not a uf2 file. It's .ino file.

tulip sleet
#

Usually the demos are Arduino programs that sometimes also serve as factory test programs

lone axle
#

I'm not 100% sure what Arcada is all the way. But I think perhaps CPB does not support that? which is maybe why it's not included in that repo.

manic glacierBOT
lone axle
#

Just in case it becomes helpful. Here is the pre-loaded CPB uf2 file that Jerry shared with me. I'll be out for a bit.

manic glacierBOT
simple pulsar
stuck elbow
#

that's weird

#

anyways, that's all Arduino, not CP

#

or Make Code

simple pulsar
#

Where's best place to read about vectorio ? I saw it mentioned on https://github.com/adafruit/circuitpython/releases/tag/5.4.0-beta.1 but the link's not working yet https://circuitpython.readthedocs.io/en/latest/autoapi/vectorio/index.html

GitHub

This is the second beta release of CircuitPython 5.4.0. This release adds basic lower power support when in time.sleep(). The lower power work changed time keeping and may have introduced bugs. Ple...

crimson ferry
simple pulsar
#

@crimson ferry Yes, that's what I was thinking of, but I'd forgotten it was CircuitPython-centric.

manic glacierBOT
manic glacierBOT
hearty forge
#

@tulip sleet re CIRCUITPY_ROTARYIO my search didn't include the ?= makefile operator (it's new to me)- it's defaulted to enabled in /py/circuitpy_mpconfig.mk. Which I believe means it's enabled by default, disabled for a specific port/board. Which if I'm inferring the meanings correctly makes a lot of sense: py/circuitpy_mpconfig.mk defines which features are considered core platform ones (being disabled is for a port/board is an exception) and which ones are optional (being enabled for a specific port/board.)

tulip sleet
#

@hearty forge I think you've figured it out! Yes, the ?= is pretty new, and is easier to read

hearty forge
#

@tulip sleet I agree- once you know about it ๐Ÿ™‚

manic glacierBOT
slender iron
#

@idle wharf did you try deleting the CIRCUITPY_RTC line?

wispy badger
idle wharf
#

@idle wharf did you try deleting the CIRCUITPY_RTC line?
@slender iron No I didnโ€™t. I see what youโ€™re asking for now.

manic glacierBOT
idle wharf
#

When we're building ESP32S2, we should be using the IDF as it is in the repo, not in our HOME directory (even though the setup process does put a copy there). And by this I mean we should use CP/ports/esp32s2/esp-idf/export.sh not the GET_IDF alias created in the IDF setup guide which runs HOME/esp/esp-idf/export.sh Correct ?

ionic elk
#

@tulip sleet do we have a specific variable for appending CFLAGS to make? So I can run something like make BOARD=blahblah BUTALSO=-Wno-unused-variable

tulip sleet
#

not that I know of

ionic elk
#

Thinking of maybe adding $(ADDFLAGS) for voluntary temporary warning suppression then?

#

for debuggin

manic glacierBOT
#

@kamtom480 I have a Spresense board and camera, and thought I would try out your PR when reviewing it. I loaded the bootloader and other firmware, v2.0.000 successfully. I built the firmware, first from your PR branch and then from main after the merge. In both cases I built just fine, and did make BOARD=spresense flash. But after flashing, I did not get a /dev/ttyACM0, but only /dev/ttyUSB0. I did unplug and plug in the board after flashing when it did not work immediately after flas...

tulip sleet
#

@ionic elk how about BUILDER_CFLAGS or USER_CFLAGS or something like that, to make it clear it's CFLAGS?

ionic elk
#

USER_CFLAGS sounds good

#

or maybe EXTRA_CFLAGS or ADD_CFLAGS? To make it clear that these are added on. Referring to a builder as a USER is always a little confusing

onyx hinge
#

whee, CAN bus error handling works now. If I provoke errors by randomly un-plugging the network wires I can get to BUS_OFF state, which leads to a restart and continuation of successful transmission. ```
'Sender ___' 254 _canio.BusState.BUS_OFF
RESTART
'Sender ___' 0 _canio.BusState.ERROR_ACTIVE

manic glacierBOT
#

I tried this on a feather_m4_ express and reproduced the problem with CircuitPython 6.0.0-alpha.3-106-g66cf6c46c
BUT
I updated the libraries to the most recent (9/15 bundle) and the problem went away.
This is puzzling since adafruit_busdevice has not bee updated recently.....
adafruit_rfm69 has, but it is not clear how that could impact this issue...

I'll update to current main and try it a few more times ,,,,

ionic elk
#

How fast is our NOR flash usually? In terms of SPI speed?

slender iron
#

When we're building ESP32S2, we should be using the IDF as it is in the repo, not in our HOME directory (even though the setup process does put a copy there). And by this I mean we should use CP/ports/esp32s2/esp-idf/export.sh not the GET_IDF alias created in the IDF setup guide which runs HOME/esp/esp-idf/export.sh Correct ?
@idle wharf I use the idf in the repo. The tools live outside it though.

#

@ionic elk I think 40mhz or so

ionic elk
#

so 40 baud?

#

I see 8M baud as the max in external_flash.h

manic glacierBOT
#

Assuming the order is well defined for evaluation of list elements something odd is going on here as monotonic_ns() is briefly jumping backwards:

Adafruit CircuitPython 5.3.1 on 2020-07-13; Adafruit CLUE nRF52840 Express with nRF52840
>>> import time
>>> good = not_as_good = 0
>>> while True:
...     t_t = [time.monotonic_ns(), time.monotonic_ns(), time.monotonic_ns(), time.monotonic_ns()]
...     if sorted(t_t) != t_t:
...         not_as_good += 1
...         print("OH NO", ...
#

Also tried on teensy4.1 -- same result


Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 6.0.0-alpha.3-165-g9256e6b37 on 2020-09-11; Teensy 4.1 with IMXRT1062DVJ6A
>>> import board
>>> board.SPI().try_lock()
True
>>> 
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Hello World!



Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 6.0.0-alpha.3-165-g92...
slender iron
#

@ionic elk that is the speed cap for a given port. the chips themselves can usually do 40ish iirc

#
ag -Q SPI_FLASH_MAX_BAUDRATE ../..
../../supervisor/shared/external_flash/spi_flash.c
151:    if (spi_flash_baudrate > SPI_FLASH_MAX_BAUDRATE) {
152:        spi_flash_baudrate = SPI_FLASH_MAX_BAUDRATE;

../../supervisor/shared/external_flash/external_flash.h
44:#ifndef SPI_FLASH_MAX_BAUDRATE
45:#define SPI_FLASH_MAX_BAUDRATE 8000000

../../ports/mimxrt10xx/mpconfigport.h
34:#define SPI_FLASH_MAX_BAUDRATE 24000000

../../ports/atmel-samd/mpconfigport.h
44:#define SPI_FLASH_MAX_BAUDRATE 8000000
79:#define SPI_FLASH_MAX_BAUDRATE 24000000```
manic glacierBOT
#

@jepler @tannewt Report from looking at this this morning. Delay obviously changes a lot based on the size of the incoming data. Measuring the duration of the memset with the DWT at 168MHz, these are the timings I got:

  • 3 byte flash setup read: 886ns delay vs 91ยตs read time (~1%)
  • 512 byte flash read: 73.6ยตs delay vs 3.2ms (~2.3%)

This is of course not variable with the speed of the SPI line, so it'll be a more significant delay compared to the actual transaction the faster the SPI ...

ionic elk
#

@slender iron observing it with DWT, I'm seeing about 3.2ms for a 512 byte flash transaction, which would imply a speed of about 160kB/s if you disregard overhead

slender iron
#

DWT? on what port

ionic elk
#

STM32

#

Data Watchpoint and Trace

slender iron
#

you are probably including the erase time

onyx hinge
#

a 512-byte memset() taking 3.2ms?

slender iron
#

that and writing 512 bytes is really reading 4k, erasing and then writing back 4k

ionic elk
#

No, this is just the actual SPI transaction itself for 512 bytes, occurring somewhere in the flash code.

slender iron
#

I'd suggest using a saleae to check SPI baudrate

ionic elk
#
        DWT->CYCCNT = 0;
        start = DWT->CYCCNT;
        memset(data, write_value, len);
        mem = DWT->CYCCNT;
        result = HAL_SPI_TransmitReceive(&self->handle, data, data, (uint16_t)len, HAL_MAX_DELAY);
        end = DWT->CYCCNT;
slender iron
#
  • or other logic analyzer
onyx hinge
#

lunchtime, I'll read back later

ionic elk
#

Well, the actual speed isn't too big a deal, unless you suspect that's way to slow and might be another issue. The end conclusion is that adding the memset adds about 1-2% of the read time

onyx hinge
#

If you're measuring just the TransmitReceive time of the SPI transaction, it should be about the bit rate divided by the number of bits (which is 8 times the number of bytes)

ionic elk
#

Backing up, this is all trying to figure out whether we should double the size of SPI_Read's write_value variable, so it can have an "invalid" state that implies we don't care about the value of the write line during a read. That lets us skip the memset and only do an SPI read instead of a transaction. I don't personally know enough to judge whether a 1% to 2% loss is worth putting in a change like that

onyx hinge
#

That number looks close to 1.28MHz, what bus rate are you looking for

manic glacierBOT
onyx hinge
#

a function parameter generally doesn't "cost" more if it's 32 bits than if it's 8 bits

#

(the first 4 parameters to a function are passed in registers, which are all 32 bits)

ionic elk
#

So (543700 - 12368) = 531332 clock cycles via DWT, x (1/168MHz) = 3.16ms, /512 bytes is 161.8 kB/s, right?

#

@onyx hinge my concern with the API thing is whether it's worth the time to change all the APIs and whether it's considered a breaking change

ionic elk
#

I can at least confirm that the SD card seems to be working?

manic glacierBOT
ionic elk
onyx hinge
#

adafruit_sdcard defaults to 1,320,000 bits per second SPI rate which is close to the time you are seeing in HAL_SPI_TransmitReceive (1.3MHz/8/512 = 3.15us)

manic glacierBOT
onyx hinge
ionic elk
#

Oh, sure, as a baud rate. 1.32M/8 ~= 160kB/s

#

We were just in different units

onyx hinge
#

.. so the SPI transfer is taking the expected length of time.

#

how long is the 512 byte memset() taking?

ionic elk
#

yes, thanks! Sorry I thought you were talking about bytes/s

onyx hinge
#

it is confusing and I could be clearer. I am just familiar with always operating in bits when talking about SPI rates so I didn't call it out as well as I could have.

ionic elk
#

So everything is fine in terms of SPI speed. The memset takes 73.6us

onyx hinge
#

ah I saw it go by but then couldn't find it here in discord

ionic elk
#

3 byte flash setup read: 886ns delay vs 91ยตs read time (~1%)
512 byte flash read: 73.6ยตs delay vs 3.2ms (~2.3%)

onyx hinge
#

Let's consider the 512 byte read, but at a variety of rates. We can predict how long the SPI transaction will take at different rates, and that the memset will take the same length of time in each case

manic glacierBOT
ionic elk
#

^ see above for actual DWT cycle numbers

manic glacierBOT
ionic elk
#

right exactly, this is a set delay

onyx hinge
#

at 8 MHz, 512 bytes would take 512us, so the overhead of 74us becomes 14%.

ionic elk
#

1Mbaud seems pretty standard, the BMP280 and several other sensors run off of it. What are some devices that go up to 8?

onyx hinge
ionic elk
#

14 percent is pretty gross, but will it matter for those applications?

onyx hinge
#

compared to not working at all it'll be awesome

slender iron
#

it's a good start

onyx hinge
#

24 clocks to memset 1 byte is slower than I expected.

ionic elk
#

Well, I was asking all this to see if the API change was justified. My impression is that it is.

slender iron
#

what API change?

onyx hinge
#

no API change, just implementing the write_value of SPI.readinto on STM32