#circuitpython-dev

1 messages ยท Page 328 of 1

manic glacierBOT
#

Following the example of micropython we should be able to reset into the DFU bootloader from code: https://github.com/micropython/micropython/blob/0986675451edbdcbe31d90ddacf8f6dc3327a4ae/stmhal/modmachine.c#L197-L223

STATIC NORETURN mp_obj_t machine_bootloader(void) {
    pyb_usb_dev_deinit();
    storage_flush();

    HAL_RCC_DeInit();
    HAL_DeInit();

#if defined(MCU_SERIES_F7)
    // arm-none-eabi-gcc 4.9.0 does not correctly inline this
    // MSP function, so we write i...
thorny jay
#

@thorny jay Is this what you meant? https://github.com/boochow/micropython-raspberrypi
@lapis hemlock Yes, I tested that and that was a revelation for me (the I tested bcm64 and I started to love bare metal). That particular port of micropython was advertised on Adafruit blog and/or newsletter. [It also got me interested in some maker from japan, not that I understand anything they write, but some picture speak for themself.] I may have an ethical issue with Raspberry Pi and the fact you cannot run on that hardware without some binary blob (the GPU code?) and that mean it is not totally free/open. I may have similar issues with Expressif and the ESP, I am not up to date, but IFAIK there are openness or licence issue with the fact that you run under their operating system somehow. So I am very currious at Adafruit positioning on this topic.

manic glacierBOT
#

CopyQ NkqthX

I'm still not fully familiar/comfortable with the transitions among these states; the naming is a bit different in each port and for each type of managed resource and I'm never entirely confident the semantics are the same. (As a larger issue, it wouldn't hurt to document this for developers reference and to ensure consistency)

My question is whether the state transtion ...

onyx hinge
#

thanks dan

manic glacierBOT
#

OK, here is the issue the way I see it. If the two calls to common_hal_time_delay_ms(1) in common_hal_displayio_fourwire_reset() are replaced with mp_hal_delay_us(1000) then the SPI TFT displays on Clue and Feather work fine. However, an e-paper display on the Feather still does not work, due to the call to common_hal_time_delay_ms() in send_command_sequence(). The delay there looks like it might be for quite a long time (up to 500ms). Assuming that the e-paper displays need that delay, I can...

onyx hinge
#

with an alpha3-ish build on trinket m0, I'm seeing a problem where IF my code contains a sleep() call, then it's likely to NOT auto-reload. Does this ring a bell for anyone?

stuck elbow
#

what does it do instead?

onyx hinge
#

continues running until I hit ctrl-c

onyx hinge
#

actually it seems to eventually respond, it just takes quite awhile

crimson ferry
#

@onyx hinge I had noticed something similar on esp32s2, hadn't tied it to alpha-3... it seemed to me that in the past, ctrl-C would interrupt blocking processes (like sleep), but now they don't.

#

I see it most on wifi activity ...could be a completely separate thing

lapis hemlock
#

@lapis hemlock Yes, I tested that and that was a revelation for me
@thorny jay I definitely see your reasoning as to why the raspberry pi could be interesting, while I have a couple of misgivings. One is the current consumption, the second is that the chip itself is not accessible to mere mortals. I believe, it is sold exclusively to the raspberry foundation. Not that it would be too useful anyway, given that it is a BGA chip, so good luck with developing your own board.๐Ÿ˜‰ > So I am very currious at Adafruit positioning on this topic. @slender iron pointed out that this is not their priority.

lone axle
#

Is there some thing that needs to be done to "release" SCK? I'm winding up with ValueError: SCK in use that is resulting from the use of board.SPI()

#

it happens sometimes when my device resets due to saving new code. But doesn't happen every time.

manic glacierBOT
#

I have written a prototype implementation of what is being discussed here at cwalther:setnextcode (cwalther@f222a3f735f12f8fb630d700e408189cffc0669e). Not necessarily meant to be taken as-is (hence not a pull request yet), but just to have a basis for discussion. Maybe someone else is already working on it as well and we can combine our ideas. It covers the cases we need for pewpew-game/game-m4-menu#1, but maybe others have additio...

lone axle
#

My trouble is potentially related to the use of sdcardio. In my case I've got a display and sdcard both on SPI. After unplugging the sdcard I haven't had it happen again yet through many restarts.

stuck elbow
#

do you have a full traceback? there shouldn't be anything using SCK explicitly

lone axle
#
code.py output:
Traceback (most recent call last):
  File "code.py", line 30, in <module>
  File "/lib/adafruit_featherwing/keyboard_featherwing.py", line 60, in __init__
ValueError: SCK in use
#

this line in keyboard_featherwing.py is

spi = board.SPI()
onyx hinge
#

@lone axle when you construct the SPI bus for sdcardio, how do you construct it?

lone axle
#
sd_cs = board.D5
self._sdcard = None
try:
    self._sdcard = sdcardio.SDCard(spi, sd_cs)
    vfs = storage.VfsFat(self._sdcard)
    storage.mount(vfs, "/sd")
except OSError as error:
    print("No SD card found:", error)
onyx hinge
#

displayio and sdcard (or adafruit_sdcard) on a single bus should work, but (A) the SD card must be initialized first before any other SPI device according to the SD card standard (even though they have distinct chip select lines), and (B) for CircuitPython's purposes, it had better be the same SPI bus object.

#

@lone axle is spi the same object as spi = board.SPI() before?

lone axle
#

Yes, that is correct.

#

I do think display is done first, I will swap them

#

oh, and the touchscreen is using SPI as well it looks like

onyx hinge
#

The effect of not doing (A) is that the SD card enters an undefined state, that would not give a "ValueError: SCK in use".

#

the fact that a display object can be kept over from a previous "run" of circuitpython could be relevant and maybe there's a wrinkle of that I have not thought through.

lone axle
#

moving the sdcard intialization (code from above) to happen before the touchscreen and displayio initialization's seems be a bit worse in this case. On the sdcard failing I notice the error is different No SD card found: [Errno 11] EAGAIN and now even when the sdcard is not plugged in I am getting the SCK in use error on resets

#

The initialization order I used originally was: Touchscreen, display, sdcard

onyx hinge
#

Interesting. At this point you may want to do more than soft-reset your board, it's clearly gotten to an undesirable state and SOMETHING undesirable is being retained across soft-reset

lone axle
#

with the original order the sdcard error looks like this: No SD card found: no SD card

#

Yep I have been using the on/off switch on the featherwing once I get to that state to get back out of it

#

I will see what else I can figure out and then try to put together a more concise example that reproduces it.

onyx hinge
#

OK. It would also be useful to know if at the initialization stage adafruit_sdcard behaves any differently. I know there are bugs when getting past the initialization stage, e.g., when you use the OnDiskBitmap

#

There is an important thing needs to be considered that the MMC/SDC is initially NOT the SPI device. Some bus activity to access another SPI device can cause a bus conflict due to an accidental response of the MMC/SDC. Therefore the MMC/SDC should be initialized to put it into the SPI mode prior to access any other device attached to the same SPI bus. http://elm-chan.org/docs/mmc/mmc_e.html#spibus

#

this may only be seen the first time after power-on because (successfully) putting the SD card into SPI mode is maintained until power-off, there's no sequence to go back to SDIO mode.

#

otherwise, it may be stuck in an unusable state until powered off (including being ejected and re-inserted)

manic glacierBOT
#

Yes. I think the going concept here is that never_reset is actually a wholly separate option from reserved - it is possible to have an un-reserved pin that is not in never_reset. I suggested joining the two at one point, so that never_reset was strictly a subset of reserved, but I believe we decided against it (I don't fully remember the reason).

Conceptually, reserved is the idea that a pin/peripheral cannot be claimed twice within a single runtime. never_reset is the idea...

turbid radish
#

?Serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Region

us-west

Channel Categories

8

Text Channels

54

Voice Channels

6

Members

24994

Roles

35

turbid radish
#

?Serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Region

us-west

Channel Categories

8

Text Channels

54

Voice Channels

6

Members

24996

Roles

35

analog bridge
#

Anyone online with an esp32s2 board and a multimeter handy ?

crimson ferry
#

@analog bridge yes

analog bridge
#

Hi @crimson ferry, I need to confirm an issue I am having with internal pullup resistors

#

I am currently working on implementing deep sleep support for CPY blinka

crimson ferry
#

sounds like I may need my magnifying goggles for this one

analog bridge
#

What board do you have ?

crimson ferry
#

any... Saola, Cucumber, FeatherS2, or Bast

analog bridge
#

great.... this requires re-flashing of CPY

crimson ferry
#

ok, np

analog bridge
#

I can provide you .bin for Saola with deep sleep enabled along with my code.py

#

Give me a minute....... blinkacomputer

crimson ferry
#

wroom or wrover? I'll start getting ready

analog bridge
#

wrover will work

thorny jay
#

?Serverinfo
@turbid radish I am sure that if you try again, you will get 25000. ๐Ÿ™‚

turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Region

us-west

Channel Categories

8

Text Channels

54

Voice Channels

6

Members

24996

Roles

35

turbid radish
#

nope

thorny jay
#

Patience...

turbid radish
#

Maybe it only updates so often

#

Thank you for your efforts

crimson ferry
#

oh, so close

#

by Tuesday it will be

analog bridge
#

@crimson ferry on to running the tests

crimson ferry
#

ok, will take me a couple

turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Region

us-west

Channel Categories

8

Text Channels

54

Voice Channels

6

Members

24996

Roles

35

analog bridge
#

np, let me provide you some more info

crimson ferry
#

"writing..."

analog bridge
#

little disclaimer...... this code will put CPY in continuous loop and that is an expected behavior

crimson ferry
#

ok, ready, haven't loaded code.py yet (got a memory error with my prior code, that's new)

analog bridge
#

I need you to probe GPIO0 and check the pullup voltage you get.

crimson ferry
analog bridge
#

With code.py running. After you obtain the results just press the boot button when rgb led turns yellow to enter safe mode

crimson ferry
#

and do I need to keep both USB active?

analog bridge
#

USB is not a issue....

crimson ferry
#

OK, CIRCUITPY ejected when I loaded code.py

#

I have solid green on NeoPixel

analog bridge
#

Yup! it goes into sleep but keeps on resetting due to GPIO0 not being pulled up properly.

crimson ferry
#

ok, hang on,

analog bridge
#

On my board I get 1.36V on GPIO0 during sleep and I think it is below the digital threshold to be counted as a HIGH signal.

crimson ferry
#

I'm getting 2.73V

#

board is powered directly from Mac USB port

analog bridge
#

Does the board reset in a loop?

crimson ferry
#

yes, yellow, then green... voltage on GPIO0 rises during that time

#

actually it falls from 2.7 to 2.3, then rises to 3.3, then settles back at 2.7

#

I don't have a scope or LA

analog bridge
#

I get this issue on GPIO2,4 as well.

crimson ferry
#

I'll measure those across resets

analog bridge
#

First you need to update the pin in code.py by going into safe mode.

crimson ferry
#

how do I know it's in safe mode? it goes from yellow to back to green even when I RST during yellow

analog bridge
#

RST method doesn't work on the s2 you need to press boot button when yellow

crimson ferry
#

oh right, just found that one inadvertantly ๐Ÿ˜‰

#

OK, in safe mode now

#

did I need to be in safe mode for the GPIO0 measurements, or just after?

analog bridge
#

safe mode is just for changing pin numbers

crimson ferry
#

ah, ok

#

pulsing yellow... now what?

analog bridge
crimson ferry
#

ok...

#

I lost CIRCUITPY and haven't gotten it back, let me try a few things

#

I probably need to reflash then reload a changed code.py with the new pin

#

I can't get CIRCUITPY back, even with power cycle

analog bridge
#

no CIRCUITPY in safe mode ?

crimson ferry
#

no, it disappeared when I dropped code.py onto it the fist time and I haven't seen it since

#

give me a couple to reflash

analog bridge
#

that's odd...... I see CIRCUITPY when in safe mode (i.e. pulsing yellow)

crimson ferry
#

power cycle, safe mode, not safe mode, couldn't bring it back, reflashing now

#

what change should I make in code.py?

#

IO0?

#

to IO2

analog bridge
#

yes, in io_alarm.PinState() change IO0 to IO2

crimson ferry
#

one sec

turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Region

us-west

Channel Categories

8

Text Channels

54

Voice Channels

6

Members

24996

Roles

35

crimson ferry
#

@analog bridge sorry, fiddling with native USB to try to get that back

analog bridge
#

np....blinkacomputer ๐Ÿ‘

crimson ferry
#

I've tried everything I can think of - can't get native USB to show up, I'm going to reflash the previous .bin, remove code.py, then reflash today's .bin, will take a few minutes

#

on the bright side... I never noticed before that the write location updates ๐Ÿ™‚ Writing at 0x00050000... (42 %)

#

I only ever watched the %

analog bridge
#

what command are you using to flash the .bin ?

crimson ferry
#

esptool_3.0-dev.py --port /dev/tty.SLAB_USBtoUART --chip esp32s2 --baud 115200 write_flash 0 ~/pathto/firmware.bin is what I always use

#

I have CIRCUITPY back, with previous .bin

#

do you have diff params I should use, or continue with reflashing new firmware?

analog bridge
#

I see nothing strange

turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Region

us-west

Channel Categories

8

Text Channels

54

Voice Channels

6

Members

24995

Roles

35

solar whale
#

it's going the wrong way ๐Ÿ˜‰

turbid radish
#

fix it

crimson ferry
#

I could make a troll army of new accounts

turbid radish
#

it'll likely tick over tomorrow

solar whale
#

Thats called server discovery

turbid radish
#

That's off, too much spam

solar whale
#

I know - just commenting on the"troll army" -- glad it's off.

crimson ferry
#

@analog bridge OK, CIRCUITPY disappeared again when I renamed code.py (with IO2 now)

#

green and yellow alternating... not sure what thsi is

analog bridge
#

what does the multimeter have to say.....

crimson ferry
#

basically 0V

#

on IO2

#

board is continually resetting from the looks of debug USB, that's expected?

analog bridge
#

yes, but 0V on IO2 is not

crimson ferry
#

but IO2 voltage sticking to ~0V

#

oops, sorry, my bad... 1.455V

#

stable through the board resets

#

(I had ground in the wrong place on my breadboard)

analog bridge
#

is the safe mode working now?

crimson ferry
#

yes, pulsing yellow, and CIRCUITPY came back ๐Ÿ™‚

#

should I try IO0 again?

analog bridge
#

no need.... It probably has an external pullup, that is why the higher voltage reading

#

could test IO4 though....

crimson ferry
#

ok, one sec...

#

IO4 is 1.46V, stable throughout the resets

#

I'm going to do IO0 again, since it's a critical one and I don't have confidence the board was in the right state before

analog bridge
#

no need....

crimson ferry
#

ok

#

anything else I can do?

analog bridge
#

let's run the test for an IO that I am sure is working

#

pick any one of the gpio till IO20

crimson ferry
#

I'll do IO7, it's pretty general-purpose

#

from ~150mV in safe mode to 3.27V when code is running, but no green-yellow, and no indication of board resetting in debug USB (lost CIRCUITPY again)

analog bridge
#

that's good

#

the tests confirm that io 0, 2, 4 have something strange going on with them

crimson ferry
#

always good to know ๐Ÿ˜‰

analog bridge
#

Thanks @crimson ferry for all the testing blinkacomputer

crimson ferry
#

sure, np, it's all sitting here so just ping me if there's anything else I can do

analog bridge
#

nothing for now.... will meet you tomorrow in the CPY blinka meet

idle wharf
turbid radish
#

yes, but I can't force them to retweet

idle wharf
#

people in channel ๐Ÿ‘€

turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Region

us-west

Channel Categories

8

Text Channels

54

Voice Channels

6

Members

24993

Roles

35

turbid radish
#

loosing members now

#

lost 3

atomic summit
#

2 questions...

  1. Is there a way to enumerate board? I just need a way to go over every IO on a board, without having to know what the IO number or Board pin reference name is
  2. Is there a DigitalInOut all in 1 constructor like p = DigitalInOut( pin, direction.INPUT, pull=DOWN)
#

Right now I'm building a list of DigitalInOut and then setting each to be an Input

azure iron
#

Hey I'm wondering if Circuitpython is currently working (with plug-and-play USB) with the ESP32-S2 yet. I know it was being worked on but I can't find if it works yet.

thorny jay
#

@atomic summit dir(board) ?

crimson ferry
#

@atomic summit I do pretty much the same with for pin in dir(microcontroller.pin): if isinstance(getattr(microcontroller.pin, pin), microcontroller.Pin): for alias in dir(board): if getattr(board, alias) is getattr(microcontroller.pin, pin): to filter out non-pins (and unexposed pins)

#

@azure iron the latest unstable builds on https://circuitpython.org have basic esp32-s2 features, still very much in development

atomic summit
#

Ahh, ok, that's clever

#

Thanks @thorny jay & @crimson ferry

azure iron
#

@azure iron the latest unstable builds on https://circuitpython.org have basic esp32-s2 features, still very much in development
@crimson ferry thank you.

#

does this mean specifically the tinyusb integration, or do you mean circuitpython in general has limited feature control over the S2?

crimson ferry
azure iron
#

oh. this lsit doesn't include the original eSP32...

crimson ferry
#

original ESP32 is not supported in CircuitPython due to lack of native USB

atomic summit
#

Oh... hmm, so I can't write to to the FS from inside CPY due to readonly - but if I switch the boot.py out with one that allows it, and reboot, then I can, but I can't get if off again as I cant write to the FS from USB anymore ๐Ÿ˜ฆ

#

I can't use the "check IO" approach like in the learn guide

crimson ferry
#

safe mode?

atomic summit
#

Is there no way to do this from inside CPY?

crimson ferry
#

there's always nvm or sd ๐Ÿ˜‰

atomic summit
#

This is for a test jig

#

no SD card

#

and I cant read NVS from USB

crimson ferry
#

I don't think we have nvm yet either

#

ah

atomic summit
#

and no rshell... no pyboard that I can get working

#

so no raw_rpl

#

so no way I can find to have my test jig "talk to the DUT" without having to setup software serial on both sides.... but that assumes working IO... than I cant check without having tested the board first.

#

Also, I now cant revert this boot.py change... only way to fix it is to re-flash CPY on it ๐Ÿ˜ฆ

crimson ferry
atomic summit
#

I dont want to use safe mode

#

I need to test this board as a proper working board

crimson ferry
#

right, I just meant to get out of writable-mode

atomic summit
#

how do we get into safe mode again ?

crimson ferry
#

on esp32-s2 i think just hit boot after reset, while yellow

pastel skiff
#

@turbid radish Hi, you helped me with the circuit python day newsletter post and the subsequent notification when I was impacted by the fires and power outages in Calfornia, FYI I've rescheduled our event to 9/24 https://hackerlab.org/en/blog/read/1376035664/hacker-lab-is-celebrating-circuit-python-day--how-you-can-join

atomic summit
#

My APA shows nothing on my board during boot

#

I re-flashed it

#

still, there needs to be a better way of either

  1. getting in and out of readonly at runtime
  2. being able to talk to CPY from a host via pyboard or similar
#

I understand the dangers of enabling write from CPY when the board is writable from USB, but being able to write to the FS is fundamental part of python.

#

So the only way I can see this working is...

  1. copy a new boot.py that allows writing
  2. reset the DUT
  3. do my stuff, write my file
  4. write a new boot.py to the FS from inside CPY
#

Is #4 even possible?

#

or do I instead just delete the boot.py ?

crimson ferry
#

if not you could have a semaphore in a separate file or file/dir name, to indicate readonly or not

onyx hinge
atomic summit
#

@onyx hinge Yup, that show the bottleneck I'm referring to.

#

Plus I can't be constantly rebooting the DUT to get it in and out of readonly mode as that adds 5-6 seconds every reboot for the FS to come up so it can be re-mounted.

crimson ferry
#

darn, my next suggestion was going to be to boot with random readonly, code can detect mount state, and with a few reboots you can always get to one or the other ๐Ÿ˜‰

onyx hinge
#

to my knowledge that's the best procedure right now.

atomic summit
#

Ok, I'm going to need to re-make all of this in c++ and do all test jig code that way (YUK) and then do a final flash of CPY for shipping.

#

raw_repl is the ideal solution here

#

I can't use os.remove() to delete the boot.py after I'm done writing my file ๐Ÿ˜ฆ

crimson ferry
#

that's interesting... locked since it's executed presumably? (you could delete or change a semaphore file)

atomic summit
#

but that still requires a reboot to activate so I can then clear off all of the files and load shipping files

#

If I have to, then so be it... but it's really an ugly solution

idle wharf
#

@atomic summit your test process would be a great live stream

atomic summit
#

I've covered how I do it all on streams before...

idle wharf
#

I will have to check the back catalog then

atomic summit
#

I actually did one yesterday about it... but deleted it afterwards as it was full of dropped frames.

hearty forge
#

@atomic summit - is it possible to set up the flash with another partition that is not exposed to windows but can be written by cpy? (Apologies if this is not even vaguely possible!)

onyx hinge
#

I think it would be great to look into that for express-type boards with lots of storage

#

we can mount multiple FAT partitions inside circuitpython (that's how sd cards work) but only one can be exported over USB, and there's no code to subdivide/partition the built in storage yet. (instead, a dummy partition table is generated for the benefit of the PC it's plugged into, and the whole flash is treated as the single partition)

hearty forge
#

I can imagine that internal flash partitioning would be very useful. Can imagine situations where even a few 100k for data being extremely useful for test jigs/data loggers etc. Definitely for the future - lots of cool things becoming possible!

manic glacierBOT
#

Thanks, I appreciate all the comments.

I think that an object-based interface that has operator overloading is a fine idea for the hypothetical adafruit_ticks module coded in Python. As long as this object has some kind of "update"-like method that is called at least once per day, it can deal with overflows in whatever way is required.

An additional advantage of the Micropython API which only takes and returns ints is that it operates without allocations. This would not be true if a...

atomic summit
#

@hearty forge @onyx hinge I my case an extra small partition wont help if I cant get to it via USB. The purpose of me writing to the flash from inside CPY is to get the test results out - because I can't just talk to the board with raw_repl like I hoped.

#

Ok, I think I got it deleting the boot.py, so after a second reset it goes back to readonly again

slender iron
#

circuitpython does still have raw repl. I'm not sure why it doesn't work for you

#

tests on adafruit boards are usually done by flashing a bin and then flashing circuitpython

atomic summit
#

Hey @slender iron - I cant get pyboard.py or rshell to work... it connects, but then errors trying to initialise raw_repl

#

Sorry to bother you on a Sunday ๐Ÿ˜ฆ

#

Hmm, do you have a modified pyboard.py ? Looks like the responses pyboard is looking for are MP ones.. not what CPY dumps out. That could be why I can't get it working

raven canopy
#

@atomic summit the symlink in circuitpython's repo is tests/pyboard.py -> tools/cpboard.py. micropython's is tests/pyboard.py -> tools/pyboard.py.

atomic summit
#

Ahh, right, so you have a modded version. Makes sense, thanks @raven canopy !

#

Ok, cpboard imports some extra stuff. Where do I fins sh and shutil? they just pip installable ?

raven canopy
#

also, i gather you're using an ESP32-S2. you'll need to add the VID/PID to the lookup dict.

yes, sh is pip'able. shutil is in stdlib, iirc.

atomic summit
#

Thanks. Now failing at disk.copy("skip_if.py")

#

FYI - I'm using this on a rPI.

#

So I don't have the circuitpython repo on here and I'd like to keep t as lean and empty as possible.

#

right, that's in tests.

raven canopy
#

i haven't run the existing test suite against a board, so i prob won't be any help there.

atomic summit
#

Does the VID/PID lookup want the exact board name from ports/boards?

raven canopy
#

i don't think so. its just the key value that gets passed in.

atomic summit
#

sh.CommandNotFound: pmount

raven canopy
#

yep. you'll need to sudo apt install pmount and make sure to add your account to the plugdev group.

#

no docs that i know of. ๐Ÿ˜ฆ

atomic summit
#

make sure to add your account to the plugdev group.
The what to what? lolz

raven canopy
#

hehe. let me look up the command; i always forget it. basically, the user account needs permissions to plugdev group to access pmount without sudo.

atomic summit
#

oh, the user group on the rpi ?

raven canopy
#

yeah

atomic summit
#

it seems to be kinda working.. I'm able to call exec and I can see it has "run it" - but errors with a timeout

raven canopy
#

which line does the traceback point to? i think i know the cause of that...

atomic summit
#

well the exception is thrown on 442

#

but it's one of Python's During handling of the above exception, another exception occurred: gifts

#

last stacktrace before that was line 75

#

and I've not done anything with plugdev - but not sure this is related

raven canopy
#

@atomic summit what version of pyserial do you have installed? latest (3.4) should work. and are you calling exec inside a context block?

atomic summit
#

exec not in a context block no.

#

checking pyserial version now... hang on.

slender iron
#

sorry, I was just jumping on for a bit. will be around this week

atomic summit
#

already running 3.4

#

nps @slender iron !!

raven canopy
#

try inside a context then:

board = pyboard.CPboard....
with board:
  board.exec("import board")

without the context, it doesn't open the serial connection. rather, the context manager opens the serial connection. might be possible to also directly call board.open().

atomic summit
#

I don't think it's context-able"

#
AttributeError: __enter__```
#
    pyb = cboard.Pyboard( device, baudrate=serial_speed )
    with pyb:
        output = pyb.execfile(filename)
    return output```
#

and yes I called my rPI version cboard not cpboard

#

by accident... ๐Ÿ˜‰

#

all that said, I have my "add boot.py to make writeable, do stuff, delete boot.py" working...

raven canopy
#

ahh. sorry about that. you're using Pyboard. i've always used it one layer deeper with CPboard.

atomic summit
#

so I notice that a fresh flash of CPY firmware on a board has a code.py in the FS. how does one include code like that in in the firmware for inclusion in the FS?

#

Ok, I'll have a look at a level deeper.

#

if I can include my test stuff in the firmware, including the boot,.py that makes the FS writeable, then I only need to reboot once at the end.

raven canopy
atomic summit
#

thanks!

manic glacierBOT
turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Region

us-west

Channel Categories

8

Text Channels

54

Voice Channels

6

Members

25019

Roles

35

blissful palm
#

I just pulled from circuit python to update my local and tried rebuilding make BOARD=espressif_kaluga_1 and I get a bunch of esp-idf errors : starting with 'esp-idf/components/lwip/lwip/src/include/lwip/sockets.h:747:5: error: "LWIP_COMPAT_SOCKET_INET" is not defined, evaluates to 0 [-Werror=undef]'

#

and of course 'cc1: all warnings being treated as errors'

#

what am I missing, what changed..

lone axle
#

Just double checking, did you run these commands?

git submodule sync --quiet --recursive
git submodule update --init
blissful palm
#

yup

#

I just cloned a new CP. now I'm getting a different issue: -- Configuring done
-- Generating done
-- Build files have been written to: /home/awood/cp-alloy/circuitpython/ports/esp32s2/build-espressif_kaluga_1/esp-idf
QSTR updated
Traceback (most recent call last):
File "../../py/makeqstrdata.py", line 523, in <module>
encoding_table = compute_huffman_coding(translations, args.compression_filename)
File "../../py/makeqstrdata.py", line 241, in compute_huffman_coding
o = ord(atom)
TypeError: ord() expected a character, but string of length 0 found
../../py/py.mk:345: recipe for target 'build-espressif_kaluga_1/genhdr/qstrdefs.generated.h' failed

#

I cloned the new one in case i messed with something in the old one

#

It is 'main' branch I should be on right for esps2?

balmy stirrup
#

@blissful palm what ports dir are you in?

blissful palm
#

esp32s2

balmy stirrup
#

hmm

blissful palm
#

interesting if I go to CP top lever and issue : 'make -C mpy-cross' I get: File "../py/makeqstrdata.py", line 523, in <module>
encoding_table = compute_huffman_coding(translations, args.compression_filename)
File "../py/makeqstrdata.py", line 241, in compute_huffman_coding
o = ord(atom)
TypeError: ord() expected a character, but string of length 0 found
../py/py.mk:345: recipe for target 'build/genhdr/qstrdefs.generated.h' failed
make: *** [build/genhdr/qstrdefs.generated.h] Error 1
make: *** Deleting file 'build/genhdr/qstrdefs.generated.h'
make: Leaving directory '/home/awood/cp-alloy/circuitpython/mpy-cross'

#

so this isn't esp s2specific

#

I have some other issue

balmy stirrup
#

Worse case you can try to re-clone the repo.

blissful palm
#

I just did

balmy stirrup
blissful palm
#

Yeah I have that link open

#

I cannot get past 'make -C mpy-cross' right now

balmy stirrup
#

I am about to try that step myself.

#

I just pulled the repo and will let you know what happens on my side.

blissful palm
#

thanks

balmy stirrup
#

What OS are you on @blissful palm ?

#

I am building on a MAC.

blissful palm
#

I am on windows but I am doing this in WSL

balmy stirrup
#

ok cool.

blissful palm
#

Everything was building OK last week

balmy stirrup
#

I was just able to successfully run.
make -C mpy-cross

blissful palm
#

clearly there have been some changes or I getting something mixed up

supple gale
#

I generally do the following when making for the ESP32S2
git submodule update --init
git submodule update --init --recursive ports/esp32s2/esp-idf/
git submodule update --init lib/tinyusb/
then a git status to make sure everything looks good
cd ports/esp32s2

blissful palm
#

Let me try that @supple gale

supple gale
#

and a make clean to get the esp-idf up to speed

#

also depending on changes to the esp-idf i do another install.fish (or install.sh) depending

#

its like an incantation,

blissful palm
#

make clean at what level?

supple gale
#

at the ports/esp32s2 with the usual BOARD=

#

i will try later. But usually works.

#

I'm using windows WSL2 with a Ubuntu20.04 instance,

blissful palm
#

OK tried all of that @supple gale no joy same error : -- Configuring done
-- Generating done
-- Build files have been written to: /home/awood/cp-alloy/circuitpython/ports/esp32s2/build-espressif_kaluga_1/esp-idf
QSTR updated
Traceback (most recent call last):
File "../../py/makeqstrdata.py", line 523, in <module>
encoding_table = compute_huffman_coding(translations, args.compression_filename)
File "../../py/makeqstrdata.py", line 241, in compute_huffman_coding
o = ord(atom)
TypeError: ord() expected a character, but string of length 0 found
../../py/py.mk:345: recipe for target 'build-espressif_kaluga_1/genhdr/qstrdefs.generated.h' failed
make: *** [build-espressif_kaluga_1/genhdr/qstrdefs.generated.h] Error 1
make: *** Deleting file 'build-espressif_kaluga_1/genhdr/qstrdefs.generated.h'

#

it's weird

balmy stirrup
#

What specific ESP32 device do you have @blissful palm ?

supple gale
#

seems its a Kaluga

blissful palm
#

I have my own board and also a Kaluga

onyx hinge
#

Good morning @blissful palm -- I have recently been working in that script makeqstrdata.py and perhaps there are some other problems remaining. Can you please tell me what running the command locale in your terminal says? Pasting the first two lines of output should suffice.

supple gale
#

i will make for a Kaluga. make -C mpy-cross worked

balmy stirrup
#

oh ok

blissful palm
#

@onyx hinge : LANG=C.UTF-8
LANGUAGE=
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_PAPER="C.UTF-8"
LC_NAME="C.UTF-8"
LC_ADDRESS="C.UTF-8"
LC_TELEPHONE="C.UTF-8"
LC_MEASUREMENT="C.UTF-8"
LC_IDENTIFICATION="C.UTF-8"
LC_ALL=

onyx hinge
#

OK that looks good, not likely to be the problem. puzzled

balmy stirrup
#

It's weird as you re-cloned the repo you should be able to do the make -C mpy-cross without issue.

supple gale
#

yes

onyx hinge
#

Let's find out whether the problem is due to a recent change or not. In the top directory, please make -C mpy-cross clean, then git checkout 6.0.0-alpha.3, then make -C mpy-cross.

#

this will build 6.0.0-alpha.3 which is before my recent tinkering

balmy stirrup
#

Good call @onyx hinge

supple gale
#

i'm working off of tannewt esp_flash_sizes branch. so not really applicable here

blissful palm
#

ok that looks good : make: Entering directory '/home/awood/cp-alloy/circuitpython/mpy-cross'
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
QSTR updated
text data bss dec hex filename
210850 21048 976 232874 38daa mpy-cross
make: Leaving directory '/home/awood/cp-alloy/circuitpython/mpy-cross'

#

under build 6.0.0-alpha.3

onyx hinge
#

OK, at least we've established that it's a new problem.

#

what's your python3 --version?

blissful palm
#

Python 3.6.9

supple gale
#

It did build here off of tannewt branch, not sure where he is versus main

onyx hinge
#

I think most of us are using systems with Python 3.7 or newer, but we aren't intentionally incompatible with 3.6.

supple gale
#

3.8.2 here

onyx hinge
#

I don't use Windows so I don't have the ability to test with WSL/WSL2 systems

supple gale
#

it should generally be the same as Ubuntu or whatever instance the windows user is running

#

the only issue is flashing as that has to be done under windows

onyx hinge
#

tannewt's branch esp_flash_sizes is before the most recent changes to makeqstrdata.

blissful palm
#

Just checking for updates

onyx hinge
#

@blissful palm If there is some content in the file mpy-cross/build/genhdr/qstrdefs.generated.h after that error occurs, can you attach it for me to see?

blissful palm
#

Just apt-get updated etc.. no change on the python3 front

#

do you just want that file @narrow dirge E.?

onyx hinge
#

yeah if there's something useful I think that's where it'll be

blissful palm
#

How do you want me to get it to you?

onyx hinge
#

you can attach files on discord with the "+" button

blissful palm
onyx hinge
#

OK, I think that's the one from when you checked out the old version and built successfully. Can you git checkout main, then go through the make -C mpy-cross clean and make -C mpy-cross step again, then finally attach the file after you get the build error

blissful palm
#

Ah yes sorry my bad hold on

supple gale
#

i just did a pull from adafruit main and doing a build for the kaluga. This is different repo from previous
Worked

onyx hinge
#

absolutely no problem!

blissful palm
#

no file

supple gale
#

git describe --tags --dirty
6.0.0-alpha.3-339-g8eda9174b

onyx hinge
#

OK, cd mpy-cross, and then run manually at the terminal (hope you can cut & paste this!): python3 ../py/makeqstrdata.py --compression_filename build/genhdr/compression.generated.h --translation build/genhdr/en_US.mo build/genhdr/qstrdefs.preprocessed.h > build/genhdr/qstrdefs.generated.h

#

I think make tried to be helpful by deleting the output file, since it encountered an error creating the file.

blissful palm
#

hdr/compression.generated.h --translation build/genhdr/en_US.mo build/genhdr/qstrdefs.preprocessed.h > build/genhdr/qstrdefs.generated.h
Traceback (most recent call last):
File "../py/makeqstrdata.py", line 523, in <module>
encoding_table = compute_huffman_coding(translations, args.compression_filename)
File "../py/makeqstrdata.py", line 241, in compute_huffman_coding
o = ord(atom)
TypeError: ord() expected a character, but string of length 0 found

onyx hinge
#

oh hey if I install old Python3.5 I can reproduce this problem locally!

#

that's super helpful

blissful palm
#

hah !

balmy stirrup
#

Ah!

#

what ver of Py are you on @onyx hinge ?

onyx hinge
#

Works: Python 3.7.3 Fails: 3.5.3

#

we also know Fails: Python 3.6.9

balmy stirrup
#

works on 3.8.5 here

#

meaning the mpy-cross

supple gale
#

I have a Mac I could test later on. Although I have a feeling this will be resolved quite soon ๐Ÿ˜‰

onyx hinge
#

OK, I know what the problem is.

blissful palm
#

yay!

onyx hinge
#

do you want to hear about obscure things or just a change you can make to fix it?

blissful palm
#

both..

#

lol

onyx hinge
#

OK sure let's start with the fix

blissful palm
#

interested

onyx hinge
#
 
 class TextSplitter:
     def __init__(self, words):
         words.sort(key=lambda x: len(x), reverse=True)
         self.words = set(words)
-        self.pat = re.compile("|".join(re.escape(w) for w in words) + "|.", flags=re.DOTALL)
+        if words:
+            pat = "|".join(re.escape(w) for w in words) + "|."
+        else:
+            pat = "."
+        self.pat = re.compile(pat, flags=re.DOTALL)
 
     def iter_words(self, text):
         s = []
         words = self.words
         for m in self.pat.finditer(text):

#

You can make the following change in the script py/makeqstrdata.py. I'll pull request it soon

#

TextSplitter is used to help find frequent substrings in error messages, which improves compression. The first time it is used, "words" is an empty list, so the regular expression it generates is |. which is a regular expression that matches either "" (nothing, the empty string) or "." (any single character).

#

This regular expression doesn't really make much sense when you ask the question "what are all the matches in some other string". But, in Python 3.7 and newer, it turns out that the answer is: ... wait for it .... ```>>> [m.group(0) for m in re.finditer("|.", "hello")]
['', 'h', '', 'e', '', 'l', '', 'l', '', 'o', '']

#

there is an empty match alternating with a match of one character. This isn't exacty right, but it was close enough that the problem went unnoticed.

#

Python 3.5 says: ```>>> [m.group(0) for m in re.finditer("|.", "hello")]
['', '', '', '', '', '']

#

so it matches the empty string at 6 positions (before each letter of "hello", plus one more at the very end of "hello" just for good measure)

#

because it never gives a "non-empty" answer, some things go wrong and finally we encounter an error because we try to take the ord() of an empty string which is the exception you actually saw

blissful palm
#

lol, that's a good one..

balmy stirrup
#

How did you find this @onyx hinge?

blissful palm
#

make -C mpy-cross
make: Entering directory '/home/awood/cp-alloy/circuitpython/mpy-cross'
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
text data bss dec hex filename
205653 21512 976 228141 37b2d mpy-cross
make: Leaving directory '/home/awood/cp-alloy/circuitpython/mpy-cross'

onyx hinge
#

The fix is to take into account that words can be empty and just use the reguar expression "." in that case to match single characters. Whenever words is non-empty we do the same as before so that for example we might get the regular expression an|the|. , so that an and the are treated as words and every other thing is just treated as a single letter

blissful palm
#

Trying build now

onyx hinge
#

@balmy stirrup Once I had the 'bad' program locally I could see in the qstrdefs.generated.h file that a variable called words was empty, this is a debugging statement that I'd put in in the past .. from there it became a question of "why" and I was quickly able to run multiple times with additional debugging prints and trace it down

balmy stirrup
#

ahhhh

#

Great catch!

blissful palm
#

Nice Fix @onyx hinge

#

Thanks

#

hoping my build works now..

#

looking good..

balmy stirrup
#

@onyx hinge are you using the MP-LIB unittest or is there one in the CP repo? Just curious. I assume there is no PDB as well at this stage?

blissful palm
#

The build worked worked yehaaw, we are off again..

onyx hinge
#

Thank you all who helped diagnose this, and I'm glad you're back to being able to build, @blissful palm !

manic glacierBOT
#

Discord user Folknology encountered a problem building with Python 3.6.9, TypeError: ord() expected a character, but string of length 0 found.

I was able to reproduce the problem using Python3.5*, and discovered that the meaning of the regular expression "|." had changed in 3.7. Before,

>>> [m.group(0) for m in re.finditer("|.", "hello")]
['', '', '', '', '', '']

After:

>>> [m.group(0) for m in re.finditer("|.", "hello")]
['', 'h', '', 'e', '', 'l', '', 'l', '', 'o...
blissful palm
#

Thanks to everyone else also

manic glacierBOT
ionic elk
#

@onyx hinge want to talk about reserved and never_reset in the in-the-weeds today?

onyx hinge
#

@ionic elk not necessarily, but it's something I have to wrap my head around someday

balmy stirrup
#

Another question if I am building from source for the Bluefruit express which ports dir and make BOARD= should I use?

onyx hinge
#

which form factor? There are all these: circuitplayground_bluefruit feather_nrf52840_express metro_nrf52840_express

balmy stirrup
#

circuitplayground_bluefruit

onyx hinge
#

and ports/nrf

balmy stirrup
#

make BOARD=circuitplayground_bluefruit_express?

onyx hinge
#

nope, just circuitplayground_bluefruit, no express on that name

#

you can look at the subdirectories of ports/nrf/boards/ as a reminder

balmy stirrup
#

Ahh ok thanks again @onyx hinge Did you catch my question about unittest and PDB?

onyx hinge
#

no I didn't

balmy stirrup
#

Does CP take advantage of unittest from the MP-LIB or do you use your own in the CP repo? 2nd question - I would assume you have the same issue was MP regarding PDB to effectively get that to work as well?

onyx hinge
#

we don't use unittest in circuitpython, to my knowledge. and no, you can't use the python "pdb" debugger with circuitpython.

balmy stirrup
#

no worries

onyx hinge
#

for my "udecimal" library I used unittest (which is really just running a doctest) simply by running it in desktop python; this was fine as it's a helper type library, not a hardware type library. I also used the "run-tests" infrastructure from micropython/circuitpython to do a subset of the tests in the unix port of circuitpython. I "picked" doctest beacuse that's what the original implementation of Decimal in Python used.

balmy stirrup
#

Yea I would assume we can use the MP-LIB version of unittest.

#

I now have to try to get perms for my mac for the GCC compiler.

#

-different issue-

onyx hinge
#

Yeah I've only heard about how hard macos is making it to run software, I haven't directly experienced it. Sounds frustrating.

balmy stirrup
#

Yea so I figured it out so I wanted to share with anyone using MAC ->

onyx hinge
#

(there's not a way for brew to at least batch-prompt you to give the necessary permissions?)

balmy stirrup
#

Make sure you go into Developer Tools and check terminal.

#

Just in case anyone runs into it I wanted to share.

onyx hinge
#

maybe Microsoft will bring WSL2 to Mac

balmy stirrup
#

I think it will be necessary as the complications with the Catalina are extremely restricting.

#

Enabling terminal in Developer Tools seems to work (for now).

#

Its not a deal breaker can always create an Ubuntu VM and just use that so there are work arounds.

ionic elk
#

@slender iron did you make an issue for the port-status documentation project we discussed last week? I'd be interested in taking that on.

solar whale
#

Building CP on a Mac is not a problem once you go through getting the one time pain of enabling each of the tools it uses.

balmy stirrup
#

@solar whale I had to enable terminal in Developer Tools for it to work for me as I posted a pic above other than that no issues with CP just other microcontrollers.

#

I just wanted to share in case other MAC users were struggling.

solar whale
#

I'll look at that -- I don't recall doing that, but it may make it simpler.

#

I don't have it enabled, but it probably would have saved a lot of time!!

balmy stirrup
solar whale
#

Good to know!

balmy stirrup
#

That is what you will get with it NOT checked.

#

That is the fix.

solar whale
#

IIRD I had to manually enable every tool, gcc ...

balmy stirrup
#

No need to do that now.

solar whale
#

you can enable them after that error by going to the "secuirty" settings and allowing them -- one at time. Your way is much better

balmy stirrup
#

Thanks.

#

Is your Developer Tools Terminal checked @solar whale ?

solar whale
#

No -- it is not.

#

I was not aware of that setting. Nice to know about it.

balmy stirrup
#

Cool I hope it helps.

thorny jay
#

I am lurking (and did not even mention it in the doc)...

#

It seems that I have not done a lot this week.

#

I have watched some streaming, I had some conversation here, ...

#

I'll try to listen to it live, if there is an "in the weed" about Circuit Python natively compiled for Raspbian or Circuit Python bare metal on Pi hardware... I'll try to participate.

#

If someone discuss the gameduino 3X Dazzler I am also interested...

onyx hinge
#

<@&356864093652516868> Our weekly meeting is coming up in a bit less than 2 hours. If you'll be participating in the meeting, it's super helpful for you to add your notes to the document: https://docs.google.com/document/d/1lkj5xteD6rW1eqh9swbGeuidZTKsB3CtW2Lpgff1P3U/edit?usp=sharing -- if you don't have time to add your notes, please just add your name in alphabetical order in two spots so we know you're participating. If for some reason that's not possible, let me know (mention me) and I'll add you. If you're not in the document but in the chat, I'll assume you're lurking. Doing it this way seemed to work well on CircuitPython day, so let's try it again. See you in the voice channel at 2PM ET, I'll come earlier if possible if anyone wants to do mic checks. If you're NOT a circuitpythonista yet and want to participate, let me know and I'll add you so that you can speak in the voice channel.

balmy stirrup
#

I just confirmed that unitest.py does work with CP yay! If that was also not known we can take full advantage of it now from the MP-LIB repo -> https://github.com/micropython/micropython-lib/blob/master/unittest/unittest.py
code.py

def foo(param):
  param = param + '!'
  return param

test_code.py

import unittest
from code import foo

class TestCode(unittest.TestCase):
  def test_foo(self):
    # Calls
    result = foo('test')

    # Asserts
    self.assertEqual(result, 'test!')

REPL

import unittest
unittest.main('test_code')

test_foo (TestCode) ... ok
Ran 1 tests

OK
#

Apologize in advance if this is already known.

onyx hinge
#

nice!

balmy stirrup
#

Yea this is a big deal when working with larger projects.

#

I just successfully tested this on the latest alpha build that I just compiled on a CP Bluefruit.

#

Ill put this up on my GitHub soon so people can grab but its very simple and straightforward. I will do a small tutorial in there.

onyx hinge
#

if you write it up in a blog or even just a tweet, that sounds like good material for the Newsletter as well

balmy stirrup
#

Cool will do Jeff! I will send you a link to my GitHub repo for it.

#

@onyx hinge let me know if you want anything added or amended.

slender iron
#

@ionic elk I didn't. I forgot. Go ahead and make one

ember mirage
#

@lone axle I see you also have the edgeBadge I was wondering if you ever had issues with it being recognized by your computer then it's no longer able to connect. I've tried it on a PC and a mac, rest button, and turning it on and off again. I know it's getting power because I see the light blinking and it increases when i toggle the on and off switch. If so what did you do to fix this? I'm a software developer so I'm new to the debugging hardware lifestyle lol

onyx hinge
#

@balmy stirrup would you like us to add you as a Circuitpythonista? It would let you talk in the weekly meeting if you wanted to, mostly.

balmy stirrup
#

Yes I would love that!

onyx hinge
#

Enjoy being purple

balmy stirrup
#

woohoo

lone axle
#

@ember mirage do recall the last time the device worked? was it in Circuit Python mode?

#

I will be on the road here shortly but I can check back in a little later in the afternoon. My top guess is that it may just need Circuit Python loaded on it. There are many non-Circuit Python demos available for that device (tensorflow etc.) if you used one of those then you'd need to re-install Circuit Python by double clicking reset and dragging the Edge Badge Circuit Python UF2 file onto it.

#

If that doesn't work for you or you are 100% certain it already has Circuit Python but it's still not showing up. Then it'll require a bit more troubleshooting. On windows 7 (not sure if this affects Win10 or other platforms or not) I've had the OS just decide that "Unknown Device" was the correct driver for a Circuit Python device before and refuse to let it connect as anything else useful.

#

When I ran into that someone here pointed me to the Device Cleanup Utility on this page: https://www.uwe-sieber.de/misc_tools_e.html and I was able to use it to delete all of my Circuit Python known driver associations and ten re-plug the device to finally get it to recognize as the correct type.

analog bridge
#

make translate doesn't seem to translate strings being referenced from header files

onyx hinge
#

@analog bridge you are right. So far there weren't any. @slender iron might be able to shed some light on whether it's intentional that only .c files are inspected or whether we should fix it. the fix would be to add an additional -iname "*.h" to the top level Makefile's find $(TRANSLATE_SOURCES) -iname "*.c" -print | (LC_ALL=C sort) | xgettext -f- -L C -s --add-location=file --keyword=translate -o circuitpython.pot -p locale

onyx hinge
#

@lone axle will you be able to drop links in the channel during the meeting today?

slender iron
#

I can do links

analog bridge
#

@onyx hinge I tried implementing -iname "*.h" but no luck, maybe my implementation is wrong.

manic glacierBOT
onyx hinge
#

drat, wonder why that didn't make it work

slender iron
#

what does the use in .h look like?

onyx hinge
#

maybe this would be the right incantation? find $(TRANSLATE_SOURCES) -iname "*.[ch]" -print | (LC_ALL=C sort) | xgettext -f- -L C -s --add-location=file --keyword=translate -o circuitpython.pot -p locale

#

".c" -> ".[ch]" instead of introducing a second -iname .. or maybe it has to be -iname foo -or -iname bar

analog bridge
#

I came across this in safe_mode.c. Some safe mode messages are board specific and are being referenced from board specific config files.

slender iron
#

ah, right

#

maybe we need to preprocess the .c files before pulling out the text

onyx hinge
#

you can't exactly preprocess the file, because we need to see the translate() directives in all #if/#else branches

slender iron
#

true

#

could we manually add the strings?

onyx hinge
#

supervisor/shared/safe_mode.c: serial_write_compressed(translate(BOARD_USER_SAFE_MODE_ACTION)); so it's basically this, right?

analog bridge
#

we could but that might create inconsistency

onyx hinge
#

xgettext "sees" translate() but the content inside the translate() is not a literal string so it doesn't add anything

analog bridge
#

@onyx hinge yes that's the one, also there is one before the function #define FILE_AN_ISSUE translate("\nPlease file an issue with............/issues\n")

onyx hinge
#

if we had serial_write_compressed(board_user_safe_mode_action()) and then the board.c had compressed_string_t board_user_safe_mode_action(void) { return translate("...."); }

#

so that the message DOES get moved to a regular source file as translate("string literal")

#

I'm hanging out in the voice chat if anybody would like to do a mic check

analog bridge
#

that could work.....

onyx hinge
#

The meeting will be getting started in about 5 minutes

slender iron
#

goes to refill on water

manic glacierBOT
#

This PR implements the same fix for ESP3-S2 as was previously done for STM32 (PR: #3431, issue: #3176). Details are more or less the same as the previous fix, and while I did not test precise timings in this case we can probably assume the same small loss in transmission speed at higher SPI baudrates due to the memset() involved. Tested on Saola 1 Wrover compared to a control case where SD card was not working. [Test sketch](https://gist.github.com/hierophect/ef38920b27a9d0cf4770138525f7084...

turbid radish
#

Lurking

stuck elbow
#

lurking

#

I thought allergy and smoking cancel out

timber mango
#

lurking today

slender iron
#

@idle wharf @inland tusk lurking?

idle wharf
#

Yes, lurking

tidal kiln
#

lurking

balmy stirrup
#

lurking

idle wharf
#

I likely get pulled off into work stuff, but I enjoy listening in

slender iron
#

yup, sorry

turbid radish
#

@anne_engineer on Twitter

slender iron
turbid radish
#

anneb(at)adafruit(dot) com

gilded cradle
#

@onyx hinge it was a CircuitPython library, but included an example that only ran on CPython which is where you got your wires crossed.

balmy stirrup
#

Thanks!

slender iron
#

@analog bridge I added you to circuitpythonistas

analog bridge
#

text only today

slender iron
#

๐Ÿฑ

ionic elk
#

your cat sounds like a person pretending to be a cat

solar whale
#

She makes her presence known.

blissful pollen
#

the mustache magically appeared

slender iron
#

๐Ÿ‘

ionic elk
#

Am I on deck or Foamyguy?

onyx hinge
ionic elk
#

He's got an update too

slender iron
#

@ionic elk maybe the analog apis?

ionic elk
#

sure

crimson ferry
marble hornet
manic glacierBOT
#

I looked at this over the weekend just to give a try and since I don't know C, I didn't figure it out. I'll tell you what I tried in case its meaningful

I looked at common-hal/time.c and tried adding includes for RTC but that didn't change anything.

#include "shared-bindings/rtc/RTC.h"
#include "shared-bindings/time/__init__.h"

Like I said though, I don't know C and was just t...

analog bridge
#

๐Ÿ‘

#

Thanks

mental nexus
#

Thank all!

balmy stirrup
#

Thanks!

gilded cradle
#

Thanks

ionic elk
#

๐Ÿ‘

crimson ferry
#

(sorry @solar whale, didn't mean to mess you up, just meant... to also make the build available on the NINA releases page, as well as the guide)

solar whale
#

just FYI -- the "working" version still reports as 1.6.1 -- will be 1.7.0 when buildable.

analog bridge
#

@slender iron need to have a chat about deep sleep api..... maybe tomorrow ๐Ÿ™‚

slender iron
#

kk

marble hornet
#

Great job @onyx hinge

crimson ferry
#

@solar whale yeah, there are a number of places where the version number has to get changed unfortunately

#

it's in the README

solar whale
#

1.7.0 builds OK and works for WiFi, just not BLE

gilded cradle
#

I'm heading out. My connection has degraded where I can't even understand anything at the moment.

analog bridge
#

@ionic elk @slender iron TouchIO needs to configured for the s2 before I can implement touchpad wakeup

inland tusk
#

@onyx hinge I am interested in the CANio for cars is there a circuitpython board for the SAME 51 that will be coming up soon?

onyx hinge
#

@inland tusk Limor talked about it last night on Desk of LadyAda. She showed a prototype board in Feather form factor that has CAN support and a CAN transceiver with screw terminals.

#

Here is the notes document for next 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/11JULkBnDzsJVIfGiiqWPszEd7mb001P7qg-8LyucmcE/edit

#

@slender iron don't forget to set the previous document to read-only

slender iron
#

done

#

how does this sound for port status:

#

CircuitPython has a number of "ports" that are the core implementation for a variety of microcontroller families. Stability varies on a per-port basis. As of this release, atmel-samd and nrf are stable. cxd56, esp32s2, and stm are being actively improved but may be missing functionality and have bugs. litex and mimxrt10xx are in an alpha state and will have bugs and missing functionality.

#

@ionic elk for release notes โ˜๏ธ

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 6\.0\.0\-beta\.0
slender iron
#

@onyx hinge I'm in the amelia voice channel

manic glacierBOT
onyx hinge
#

@slender iron OK just joining now

atomic summit
#

I got my FeatherS2 test-jig working - using the flash, remount with write access, test, then remount without sequence. It's stable, but really slows down the test cycle.

#

Since I took this pic, I've managed to have a few more seconds off, but until I can get cpboard.py working for raw_repl, I'm going to keep using this.

idle wharf
#

That is very cool @atomic summit !

manic glacierBOT
#

I do not understand why disabling QSPI affects SPI at all. And yet, it
clearly does.
There are no pin conflicts that I have found, it just looks like some sort
of timing
issue or conflict on the nrf chip. The only issue with sleeping while
initializing an
SPI device is that it will end up calling qspi_disable(); it doesn't matter
how long or short
the sleep is.

On Mon, Sep 21, 2020 at 3:04 PM Scott Shawcroft notifications@github.com
wrote:

Is the sleep too short when qspi is disabled? I...

teal bear
#

when I try to out 17 bits into a 16 bit thing, it errors, good. struct.pack("H", 65536) OverflowError: value must fit in 2 byte(s)

#

gah.. not MP's it doesn't check...

manic glacierBOT
lone axle
#

@onyx hinge sorry to ghost on you there. I got pulled away into some day job things. Will be catching up on the meeting later on tonight.

ionic elk
#

@slender iron sorry I went out for a run and missed your message. Sounds good to me. What steps would you like to see for STM32 to enter the stable category?

slender iron
#

good question. I'd feel better about it based on how many people we see running it

#

I keep forgetting about the stm feather

ionic elk
#

it's missing rotaryio, rtc, and audioio compared to nrf

slender iron
#

we could make it stable. I don't really care about where it sits

ionic elk
#

How do STM32 numbers compare to the other boards on nrf and samd

slender iron
#

I haven't looked but I imagine its much less that the other two because its only on one board

ionic elk
#

I could try and do a big testing run before we mark it as stable. Get every featherwing and run it through the gamut

#

Make extra sure we don't have anything like the SD card thing still bumming around somewhere

#

how do you tell, as far as board stuff? Do you get any info from that from adafruit?

slender iron
#

I can look it up. but if you think its stable I can just edit the release notes

ionic elk
#

Hmm I'm waffling as to whether I'd say that now, it was a genuine question as to what you'd like to see done. But I don't have any more major bugs logged on github

slender iron
#

I think you are reading more into it than I gave thought

ionic elk
#

Lol

slender iron
#

my main goal was to highlight that stability varies and that esp is beta and imx/teensy is alpha

ionic elk
#

Yeah go ahead and mark that STM32 is stable then.

slender iron
#

should we only say stm32f4?

ionic elk
#

Yes. F7, H7 and F1 are all at different levels of completion

#

As of this release, atmel-samd, nrf, and stm32 for the F4 family are stable. cxd56, esp32s2, and other ST families are being actively improved but may be missing functionality and have bugs

#

Also, by the way, I have a friend who's currently trying to make a linux-capable featherwing using the H7

slender iron
#

CircuitPython has a number of "ports" that are the core implementation for a variety of microcontroller families. Stability varies on a per-port basis. As of this release, atmel-samd, nrf, stm for the F4 family are stable. cxd56, esp32s2, and stm for other chip families are being actively improved but may be missing functionality and have bugs. litex and mimxrt10xx are in an alpha state and will have bugs and missing functionality.

ionic elk
#

we'll see if he can do it, it's a LOT of routing and he has to squish both external flash and ram on there

slender iron
#

๐Ÿ™‚ sounds like the groboard (iirc)

ionic elk
#

oh nice, I'll send that to him

slender iron
#

it's a same a5 feather

#

the orangecrab also has external ram and flash

ionic elk
#

I also still want to try that circuitpython-without-the-python idea... all these stable APIs but no raw C interface ๐Ÿค”

slender iron
#

๐Ÿ™‚

#

the C functions that raise exceptions may give you trouble

ionic elk
#

right, I'd have to run some kind of project-wide replacement script

#

Or figure out something more clever

slender iron
#

ideally the C apis wouldn't raise exceptions

orchid basinBOT
manic glacierBOT
slender iron
#

goes for a walk while logs download

ionic elk
#

@slender iron for whenever you get back - microcontroller.cpu.temperature support was actually added by MicroDev

slender iron
#

is it wrong in the release notes?

#

not sure why you are telling me

manic glacierBOT
#

Resolves #3309

Tested successfully with PyPortal.

@jepler helped create this fix for me. It was mentioned that there may need to be a similar solution added for framebuff APIs perhaps, that would be needed for the neopixels matrices if I understood correctly.

I think I have the appropriate hardware to try to tackle that now but I will need a bit more guidance into where that fix is it within the code and whether the same strategy used here is applicable for it.

atomic summit
#

So what happens with IDF upstream changes now?

slender iron
#

@atomic summit my plan is to pull in upstream changes as needed

atomic summit
#

When are they brought in and how will they be tested etc?

#

So you'll just stay on top of them and see of any are needed or appropriate?

slender iron
#

no? if nothing is broken then there isn't a reason to update

atomic summit
#

Ahh, right, but there are often "improvements" in IDF updates... things that don't fix things, but are still worth including.

#

It's one of the things that often holds MP up, as if there isn't a "solution to a fix" to find... no one is looking at the IDF very often. And with the S2 so new, and still no official IDF release looming...

#

I guess for now, getting S2 support out is more important than getting it perfect.

slender iron
#

nothing is ever perfect

atomic summit
#

haha, you know what I mean ๐Ÿ™‚

slender iron
#

interacting with the IDF is still new for us

#

so if they add something we'd benefit from then we'd update

#

similar to micropython

atomic summit
#

Yeah sure, that's why I'm bringing it up. IDF also often gets regressions as well so it's a tough balancing act.

slender iron
#

I'd like to change the way we do includes so our warnings don't apply. that'll make it easier to update

slender iron
#

ok, beta 0 is completely released

manic glacierBOT
#

What I'm thinking--but haven't tested:

STATIC void _refresh_display(framebufferio_framebufferdisplay_obj_t* self) {
    self->framebuffer_protocol->get_bufinfo(self->framebuffer, &self->bufinfo);
    if(!self->bufinfo.buf) {
        return;
    }
    displayio_display_core_start_refresh(&self->core);
    const displayio_area_t* current_area = _get_refresh_areas(self);

This code in shared-modules/framebufferio/FramebufferDisplay.c needs to be changed so that it checks the...

manic glacierBOT
slender iron
#

@grim dagger how are you trying to test the display?

grim dagger
#

I put my new argument "column_and_page_addressing" everywhere it seemed to be needed.

#

Got a clean build

slender iron
#

Nice!

grim dagger
#

Built a new displayio driver... in another github repo. But when I try to set my quirk argument to true python is complaining that I'm passing too many arguments into super().init

#

super().init

#

Anyway... add a few _ in the above, can't convice discord to print them out.

#

I have been looking at the code and I can't see what I've missed in trying to pass the new argument

#

the circuitpython branch is 'origin/New_quirk_for_SH1107'

#

@slender iron Another question I have is how to make set_column_command and set_row_command to be equal to NO_COMMAND in the C code... I assumed I would just not pass them in the driver and commented them out.

slender iron
#

@grim dagger Iโ€™m on my phone so my ability to check things out is limited

grim dagger
#

End of the day for me, so no rush... I'm going to bed!

slender iron
#

You can us backticks to get things printed literally. Make a draft or and Iโ€™ll check it out tomorrow

#

Draft PR

grim dagger
#

How do you make a PR for the new driver? Or will it be sufficient to do it for my version of circuitpython?

manic glacierBOT
#

This change introduces a new quirk to support the FeatherWing SH1107 128x64 OLED display. A parameter, "column_and_page_addressing" when set to true in the driver will cause the displayio_display_core_set_region_to_update function to use the column lower, column higher and page set commands on the sh1107.

I wrote a new driver to test with: https://github.com/mdroberts1243/mdroberts1243_CircuitPython_DisplayIO_SH1107

Right now python is throwing an error that I'm sending too many keywor...

grim dagger
#

@slender iron The Draft PR throws an error in pre-commit: ##[error]The process '/opt/hostedtoolcache/Python/3.8.5/x64/bin/pre-commit' failed with exit code 1

slender iron
#

In the ci or with your commit? Itโ€™s ok if the ci is broken on your draft

grim dagger
#

@slender iron pre-commit / pre-commit (pull_request) Failing after 18s โ€” pre-commit . The builds are still in process. Many have passed. Anyway, I'm probably not familiar enough with the Adafruit setup to really know what it's complaing about ๐Ÿ˜ณ

slender iron
#

Itโ€™s usually trailing lines or spaces. Nothing major

#

Easily fixed right before we merge

grim dagger
#

@slender iron Ok. Thx. Hopefully you just need to scan my code changes to suggest my next step. I'm testing with the STM32F405 Feather and SH1107 FeatherWing. GN.

slender iron
#

Yup sounds like something in shared bindings. Thanks! Good night!

manic glacierBOT
#

time.time() crashes too, even after initializing RTC:

Adafruit CircuitPython 6.0.0-beta.0 on 2020-09-21; Saola 1 w/Wrover with ESP32S2
>>> import time
>>> import rtc
>>> rtc.RTC().datetime = time.localtime(946684800)
>>> time.time()

Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.

Core  0 register dump:
PC      : 0x4008e9e6  PS      : 0x00060930  A0      : 0x8008ea72  A1      : 0x3ffdd1e0  
A2      : 0x00000000  A3      : 0x00000...
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I justed tested again to make sure this wasn't my imagination: Adafruit CLUE board temperature with PWM audio.

That was 5.3.1 running:

Adafruit CircuitPython 5.3.1 on 2020-07-13; Adafruit CLUE nRF52840 Express with nRF52840
>>> from adafruit_clue import clue
>>> import time
>>> for _ in range(3):
...     clue.pixel[0] = 0x005500
...     clue.play_tone(2000, 5.0)
...     clue.pixel[0] = 0
...     time.sleep(15)
...     clue.pixe...
silver tapir
#

I hope this won't distract @slender iron... but this is so cool. It's running without an fpga, only with software on their processors (esp+k210) in their clone of micropython.
https://twitter.com/SipeedIO/status/1308353905034629120

MaixPy Code:

B A SELECT START UP DOWN LEFT RIGHT

1 2 4 8 16 32 64 128

state = 128 | 1

try:
nes.init(nes.INPUT)
nes.load("mario.nes")
while True:
nes.loop()
nes.input(state, 0, 0)
finally:
https://t.co/JK8tmD4aCT() https://t.co/p9hTRNwCQU

โ–ถ Play video
manic glacierBOT
manic glacierBOT
#

I can't remember if control-c would actually interrupt the serial output on 5.0.0. I just tried this with lists and ulab arrays on 5.3.1 and control-c cannot interrupt a variable inspection from REPL over USB serial console.

I suppose the memory constraints of these devices mean that the output will tend to complete in a reasonable amout of time for straightforward data structures.

#

Two calls to common_hal_delay_ms in common_hal_displayio_fourwire_reset() were changed to use common_hal_mcu_delay_us instead. This avoids a problem where qspi_disable was being called in the middle of the reset, which ended up disabling the SPI screen display on the Clue. This also fixes SPI TFT displays being used on other nrf52840 boards as well. It does not fix a similar issue with e-paper displays, which will need to be addressed separately.

onyx hinge
#

there are a LOT of messages on my car's canbus

slender iron
#

nice!

onyx hinge
#

looking for a reference now..

slender iron
#

I think that's where a library would really help

#

@timber bridge has hacked on cars I think

simple pulsar
slender iron
#

I assume getting a logic analyzer on it is the next step

#

looks like you dug down to where the exception would originate already

simple pulsar
#

Should someone test that combination too? I have a CLUE and a PMSsomething but it's the serial version not i2c.

slender iron
#

ya, I only have the uart version too

onyx hinge
#

@slender iron had a quick chat with Limor, sounds like I should switch to doing the low level for STM32F405 rather than diving into automobile diagnostics.

slender iron
#

kk, up to her

#

I can put a call out on twitter to find a reference if you haven't found one yet

onyx hinge
#

I have found some stuff, bookmarked for when I pick that part of things back up

slender iron
#

kk

#

breakfast time for me

onyx hinge
#

see ya

simple pulsar
analog bridge
#

@slender iron Up for a deep sleep api talk ?

tidal kiln
#

@simple pulsar i don't. and all the various AQI sensors are currently super out of stock.

manic glacierBOT
#

Done!

I also extened it to accept None or an empty string to reset to the default search order, which may be useful when a program that was itself started as an alternative next code wants to reboot into the standard code.py/main.py rather than itself using supervisor.reload() (such as https://github.com/python-ugame/circuitpython-stage/blob/9596a5904ed757e6fbffcf03e7aa77ae9ecf5223/pewpew_m4/ugame.py#L39), and may make it unnecessary to add a distinction between a reload from `supervis...

solar whale
#

Has anyone else noticed the esp32s2 being a bit "flaky" at the REPL -- I get occasional "syntax errors" on inout lines that if I just hit up arrow and enter, they work fine. Also some occasional issues for cut/paste. I can file issues, but just wanted to see if anyone else was seeing this. I am using "screen" on a Linux box to access the REPL.

manic glacierBOT
solar whale
#

the "flakyness" may only be after a cut/paste ....

manic glacierBOT
analog bridge
#

@slender iron Up for a deep sleep api talk ?
@slender iron In case you missed my message ^^

slender iron
#

@analog bridge I'm around now

#

and yup, I missed it because I was eating breakfast ๐Ÿ™‚

analog bridge
#

sorry to disturb your morning routine........ voice ? ๐Ÿ™‚

slender iron
#

sure ๐Ÿ™‚

slender iron
timber bridge
#

@onyx hinge what kind of car is that from?

analog bridge
onyx hinge
#

@timber bridge 2013 prius

slender iron
slender iron
analog bridge
#

Nice talk @slender iron ๐Ÿ‘

timber bridge
manic glacierBOT
#

@mdroberts1243 I don't see anything wrong with your code here or in your test library. That error can happen if the name of a kwarg doesn't match one in the parse table. Maybe a typo? Does it go away if you comment out the new kwarg? If so, maybe you don't have your code loaded on the device. You can do mp_printf(&mp_plat_print, "hello"); in your C code to print out to serial and confirm it is run.

grim dagger
#

@slender iron Commenting out the new kwarg stops the error message. None of my added debug statements are printing out. But the uf2 firmware file is copying over fine and I can see it on the CIRCUITPY disk with the correct date and time. Is there a special consideration with updating the firmware on the STM32F405 Feather? I got it running the first time this way.

slender iron
#

the uf2 file needs to go on a *BOOT drive, not CIRCUITPY

#

did the feather come with circuitpython on it?

#

you may need to use the DFU loader to load circuitpython. I don't know if UF2 is on there by default

grim dagger
#

@slender iron It might be because I switched over to my linux laptop for the circuitpython build... I originally used my windows laptop for the installation of the standard build on the Feather.

slender iron
#

@grim dagger did you figure it out?

onyx hinge
#

@grim dagger the stm32f405 feather is not set up by adafruit to use uf2, you need to use dfu-util to upload new firmware

grim dagger
#

@onyx hinge @slender iron Sorry... interrupted by day job ๐Ÿ˜‰ Yeah... just now realized. I had to go back to STM Cube Programmer on windows to get the .bin file transferred over. So I can see my debug print messages now, but I'm still having the same problem, too many kwargs, so I need to figure out where I've missed something in the declarations.

slender iron
#

hrm, everything looked ok to me

onyx hinge
#

is there another level of library in pure-python? is an option mis-spelled somewhere?

grim dagger
#

code.py output:
{'rotation': 90, 'height': 128, 'width': 64}
In Display.c shared-bindings
Traceback (most recent call last):
File "code.py", line 32, in <module>
File "mdroberts1243_displayio_sh1107.py", line 78, in init
TypeError: extra keyword arguments given

#

I do get into the shared-bindings Display.c and then the error is thrown.

manic glacierBOT
#

I have not determined the root cause of the qspi_disable interfering with
regular SPI
peripherals. We can't use common_hal_delay_ms() with a value less than 1 in
any
case. I'm not sure if it is the length of the delay causing the issue, or
something in the
SPI/QSPI subsystems that have some sort of dependency on each other. I do
know that
once the SPI display is initialized properly, subsequent calls to
qspi_disable() do not have any
effect on it.

On Tue, Sep 22, 2020 at 12:39 PM Scott Shaw...

onyx hinge
#

{ MP_QSTR_column_and_page_addressing, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} }, "extra" arguments also covers the "is spelled wrong" case. Make sure "column_and_page_addressing" is spelled consistently everywhere? Otherwise, I haven't spotted the problem yet.

grim dagger
#

I have checked and rechecked. Is there any weird limit like the length of an argument name?

onyx hinge
#

I am not aware of one but I couldn't rule it out

grim dagger
#

Where does mp_arg_parse_all live?

onyx hinge
#

py/argcheck.c, says a full text search (grep)

#

@grim dagger can you share your python code with me?

grim dagger
onyx hinge
#

I had picked up one of these boards but sadly I seem to have damaged it. It does not appear on the I2C bus when I i2c.scan() it.

#

I pressed on the edge of the display when inserting it and it fractured, I guess it's cutting a vital signal. boo.

slender iron
#

any idea if wifi nina actually works with multiple sockets?

onyx hinge
#

@grim dagger OK figured it out

grim dagger
#

@slender iron @onyx hinge O.k. guys I can proceed now. Found an extra comma in the definition of static const mp_arg_t allowed_args[] = {...} ๐Ÿ˜ฉ

slender iron
#

ah, that was it!? weird

onyx hinge
#

I don't think that was all

#

$36 = 0x8054b4a "columnโˆงpage_addressing"

#

There's magic in qstrs to represent some non-identifier characters. _and_ turns to the symbol โˆง.. I doubt we deliberately do this anywhere in CircuitPython.

grim dagger
#

I also changed the argument name to be cp_addressing

slender iron
#

haha, oh no

grim dagger
#

That was a hail mary, but left it that way.

onyx hinge
#

I'm not sure how to "escape" the _and_, do you know @slender iron ?

grim dagger
#

I can leave it as cp_addressing... shorter to type anyway.

#

But maybe open an issue for future frustrated programmers?

onyx hinge
#

we like things to have GOOD names though

crimson ferry
slender iron
#

no, I don't know how to escape it

#

@crimson ferry I'm trying to understand why nina is unhappy with new requests but not the old one

#

I find the lack of errors from nina frustrating

crimson ferry
#

DEBUG can be a firehose

slender iron
#

I tried to change requests so that if the second connect fails it will close opened sockets

#

and then try again

#

but it still doesn't work

crimson ferry
#

this is a newb question, but in the old days (last week) when we do import adafruit_esp32spi.adafruit_esp32spi_socket as socket and use socket as-is in requests.set_socket(socket... that doesn't allow for multiple instances?

slender iron
#

it should because it's the socket module level

#

like socketpool

crimson ferry
#

ah, ok

onyx hinge
#

@grim dagger congratulations for having the most interesting problem come up on your first contribution to the core! It's not always like this.

grim dagger
#

๐Ÿ˜ณ Some silly mistakes too

slender iron
#

๐Ÿ˜„

grim dagger
#

@onyx hinge @slender iron The display isn't rendering correctly so there's still work ahead...

manic glacierBOT
#

New contributor @mdroberts1243 encountered an interesting problem in which the argument they had named "column_underscore_and_page_addressing" simply couldn't be used; I discovered that internally this had been transformed into "column_underscoreโˆงpage_addressing", because QSTR makes ENTITY stand for the same thing as &ENTITY; does in HTML.

This might be nice for some things, but we don't want it here! I was unable to find a sensible way to "escape" and prevent this entity coding, so...

onyx hinge
#

@grim dagger did you see my note about maybe a stray write to the panel in your changes?

#

afk, I will get another of these displays ordered so I can help out if the problem goes on for another couple of days

slender iron
#

@atomic summit what are you writing to the internal flash from circuitpython?

#

is watching your test jig recap

atomic summit
#

@slender iron Yes, and it's a painful process ๐Ÿ˜ฆ

slender iron
#

I'm wondering why you need to do it

atomic summit
#

because I cant get cpboard.py to work to execute raw_repl

#

so I cant get my test results off my board

#

in MP, I execute my tests with pyboard and return the results...

#

I'd love to get that working in cpy.. and @raven canopy was trying to help me the other day, but so far no success.

#

I can see code is executing, but times out before I get results back.

slender iron
#

could you get the results off by connecting to serial as you run it?

#

connect to serial and then copy test code.py over

#

you could also add the IO## pin names into pins.c

balmy stirrup
#

There should be at minimum something coming off the serial port if the firmware compiled.

atomic summit
#

how do I get them off via serial? you mean via something like screen and capture the output?

balmy stirrup
#

Yes when you connect screen or Putty and you reboot the device what are you seeing?

slender iron
#

yup, pyserial is what I was thinking

atomic summit
#

ok, I'll look at pyserial - never used it directly before

slender iron
#

uf2 only has neopixel support ๐Ÿ˜•

atomic summit
#

What do you mean? no dotstar support ?

balmy stirrup
#

pip3 install pyserial
pip3 install pyparsing

#

That should cover you.

atomic summit
#

@balmy stirrup Yeah I have pyserial installed as esptool needs it

#

I'll check out pyparsing though

slender iron
#

ya, just for the bootloader status LED

atomic summit
#

ahh, bummer.

slender iron
#

shouldn't be too hard to add

balmy stirrup
#

@atomic summit are you getting any output in the serial monitor when booting?

atomic summit
#

Which serial monitor?

#

Ok, I'm running some code on my feathers2 that just prints "hello serial" 4 times a second

#

and running pyserial on my rpi doing a print(ser.readline()) forever

#

it's not getting any data

balmy stirrup
#

So I am assuming you do not get any active REPL?

atomic summit
#

well, the board auto runs whatever is in code.py

balmy stirrup
#

If you CTRL-C?

atomic summit
#

ow do I send ctlr-c ?

grim dagger
#

@grim dagger did you see my note about maybe a stray write to the panel in your changes?
@onyx hinge Thanks Jeff, nice catch that I cleaned up earlier!

atomic summit
#

shouldn't pyserial just grab whatever is being printed ?

balmy stirrup
#

@atomic summit can you use ampy to send a new code.py? You should be able to CTRL-C to drop to a REPL as I am assuming you have not disabled the REPL in main.c so it should work.

atomic summit
#

but that's all manual work

#

this is an automated test jig

balmy stirrup
#

ok

atomic summit
#

sure, I cant get into a repl if I am directly connected to the device

#

using screen etc.

#

i need to copy test code over to the DUT, and then read the results via serial

balmy stirrup
#

I understand now. Perhaps you can mod the code.py to something you are expecting and check the results.

atomic summit
#

check the results how, that's what this pyserial talk is all about.

#

I am already doing that, but I cant find any way to "read the results".... so right now I am writing them to the filesystem, so I can copy them off

#

Perhaps you can mod the code.py to something you are expecting and check the results.that is exactly what pyboard.py does... but also allows me to just inject code into the repl.

#

but I cant get that working either

balmy stirrup
#

The only thing I can guess is your are locked in some infinite loop. When I use pyboard.py if I am locked in some loop I will not get write access it is only when I am able to get a REPL and disconnect from screen or Putty am I able to send a new file over with pyboard ./pyboard.py --device <DEVICE> -f <file> : but it sounds like this is something I have not encountered sorry about that.

slender iron
#

it might be an issue with detecting that serial is connected

#

setting the dtr line or something

balmy stirrup
#

That is definitely a possibility @slender iron more than likely.

atomic summit
#

Ok, I got it working.

slender iron
#

nice!

atomic summit
#

so for some reason, copying a new code.py is not making the board restart with that new code. I have to reset it

balmy stirrup
#

That's what I thought.

#

Yes when you successfully copy then you reset.

#

./pyboard.py --device <DEVICE> -f <file> :

slender iron
#

call sync in linux too

#

there is a delay writing to the fs

atomic summit
#

No, I'm copying from the rpi via the mounted drive..

#

Oh, yeah, sync.. that would prob help.

#

doh

slender iron
#

though no led works

#

and for some reason my hub keeps disconnecting the device

#

we might not ask for the right amount of current

#

anyway, I gotta go run before I get too hungry

atomic summit
#

haha, enjoy food!

slender iron
#

byeeee!

balmy stirrup
#

Glad it is working @atomic summit!

atomic summit
#

thanks for the help Kevin

balmy stirrup
#

Pleasure!

atomic summit
#

w00p! Got it implemented and working!

#

About to find out what the new cycle time is...

#

Current time is approx 67secs

#

flashing takes 35s of that unfortunately

balmy stirrup
#

WOOHOO!

atomic summit
#

I'm expecting to only save 6-7 seconds...

balmy stirrup
#

It's something.

atomic summit
#

56.70s

#

so saved 11 seconds!

#

better than a kick in the teeth! plus is just a nicer process

#

and I am sure i can save extra time by tightening a few things up

#

52.3secs

#

#winning

grim dagger
#

Is there a way to disable/turn-off the console output temporarily on displayio?

balmy stirrup
grim dagger
#

Thanks Kevin. I'm trying to debug a new display so I want to simplify things as much as possible.

manic glacierBOT
slender iron
#

@crimson ferry I think I'm running up against the fact that esp32spi socket isn't a real socket

crimson ferry
#

not real?

slender iron
#

it's not a cpython socket

#

so its exception types don't match

crimson ferry
#

ohhh

slender iron
#

I think the alternating is that the socket is closed

#

which we should handle in requests

#

not sure why it's closed though

crimson ferry
#

is there a way to get the status of the socket to know if it needs closing? (TCP)

slender iron
#

unfortunately I don't think the cpython object has an is_closed

crimson ferry
#

PR the IDF ๐Ÿ˜‰

slender iron
#

well, I want to go based on cpython

crimson ferry
#

that does explain the alternation... fail, open new socket, success, rinse, repeat, run out after 20 iterations

slender iron
#

nina we can fix if need be

#

yup, for some reason it won't let us send a second time

#

when we try and make the second http request

#

and we don't close a socket after it fails

#

which we should

#

because it hides error detail

crimson ferry
#

and esp debug doesn't even help at that level

slender iron
#

ok, I see how I'm leaking sockets

#

I'm not handling send errors

crimson ferry
#

I don't think there was a check before

#

I need a bigger display... trying to read Requests, ESP32SPI, and NINA simultaneously

manic glacierBOT
manic glacierBOT
sleek swan
#

I just read about the circuitpython beta featuring wifi support for esp32-s2 is there like a guide to assemble them both ?

balmy stirrup
#

@sleek swan Off the top of my head there is a video where Scott works with the esp32-s2 which might help. https://www.youtube.com/watch?v=8WvLviAr8a0

Watch as Scott recaps the FPGA work he's been poking at, ESP32-S2 wifi scanning fixes and then adds string parsing to the new ipaddress module. Visit the Adafruit shop online - http://www.adafruit.com

Working native wifi branch is here: https://github.com/tannewt/circuitpyth...

โ–ถ Play video
sleek swan
#

cool thank you @balmy stirrup ๐Ÿ˜„

balmy stirrup
#

Welcome!

solar whale
manic glacierBOT
manic glacierBOT
manic glacierBOT
lunar crown
#

Can someone point me to a reference mapping the CircuitPython names to the Teensy 4.0 pins?

balmy stirrup
onyx hinge
#

graham: in our source tree, you can find the file ports/mimxrt10xx/boards/teensy40/pins.c -- it'll show the correspondence between the "pins" module and the "microcontroller.pin" names. Usually microcontroller.pin names match the microcontroller datasheet., while "pins" matches silkscreen

#

we prepend "D" to a digital pin, so pin.D0 should be what is silkscreened "0" or "D0", and "A0" would be what is silkscreened "A0"

old smelt
#

@onyx hinge - I see in the notes from the Monday call that you are close to wrapping the CAN I/O for SAME5X. Do you have any documentation or more info on that?

onyx hinge
old smelt
#

Thanks!

onyx hinge
#

hah and then I notice a typo in the docs ๐Ÿ˜›

lunar crown
#

@onyx hinge Thanks, i can figure it out from there. @balmy stirrup I specifically need the pin numbers assigned to the Digital IO pin assignments as named in CircuitPython. I think it might be the "Gray" colored pin numbers on the diagram you sent. Thanks.

slender iron
#

@lunar crown I think I went by the silkscreen or schematic

crimson ferry
lunar crown
#

@crimson ferry That is a sweet little utility. I might have to go back to the BGA ball then come forward on the schematic, but it should all be there.

manic glacierBOT
blissful palm
#

@slender iron just a gentle poke, I did a PR on you Picodes fork at the weekend in case you hadn't noticed it (I know your busy)..

granite juniper
prime flower
slender iron
#

@blissful palm thanks. I need to find where those emails go. will look today

#

@prime flower yup, I think so