#circuitpython-dev

1 messages Β· Page 427 of 1

manic glacierBOT
slender iron
#

Lost my internet @onyx hinge

onyx hinge
#

@slender iron we can surely finish without you πŸ™‚

mental nexus
#

I've got a custom CP build running on the ESP32-S3 devkit N8R8, and I can't seem to access my IO41/42 for I2C SCL/SDA. Whenever I do busio.I2C(board.IO41, board.IO42), I get an error: ValueError: IO41 in use.

#

I have pullups on both pins, so that can't be the issue. Also, the same happens with a hard reset or with the push button reset.

manic glacierBOT
mental nexus
#

It's an older build. Here's boot.out:

Adafruit CircuitPython 5.3.0-1808-gfcde108d0-dirty on 2022-04-20; ESP32-S3-DevKitC-1-N8R8 with ESP32S3
Board ID:espressif_esp32s3_devkitc_1_n8r8
stuck elbow
manic glacierBOT
mental nexus
# stuck elbow do you have anything in board.c?
void board_init(void) {
Β  Β  // Debug UART
Β  Β  #ifdef DEBUG
Β  Β  common_hal_never_reset_pin(&pin_GPIO43);
Β  Β  common_hal_never_reset_pin(&pin_GPIO44);
Β  Β  #endif
}
#

My SCL and SDA are on GPIO41 and 42.

stuck elbow
#

are those somehow related to the debug uart? like, say, DTR or something?

#

(just making wild guesses here)

mental nexus
#

No idea, I didn't mess with this file.

manic glacierBOT
stuck elbow
#

you have debug enabled?

mental nexus
#

Hmm.. Not sure. Unfortunately I'm just getting back to this after setting it aside a couple months ago. Let me review the latest version of the board.c file for this board and see if I there are hints. Thanks for the suggestion on where to look.

manic glacierBOT
mental nexus
#

Thanks @stuck elbow !

daring pumice
#

Ok. I think this means that CPy is working on my board without fault? Bear in mind that the 6 flashes are repeating over and over - that never stops.

manic glacierBOT
daring pumice
#

My next question is whether or not I can include the code I've written in a .hex image and push it over to the board.

slender iron
#

continuous isn't working

#

it'd be much easier to debug with a debug uart at minimum

daring pumice
slender iron
#

any will work

daring pumice
#

Ok, so I'd just declare them as UART in pins.c?

slender iron
#

CIRCUITPY_DEBUG_UART_TX in mpconfigboard.h

daring pumice
#

something like #define CIRCUITPY_DEBUG_UART_TX (&pin_Px_y) ?

slender iron
#

ya, I suggest grepping for examples in the source

#

microbit_v2 uses it

daring pumice
#

Fair enough. Just to reiterate, I need this to work over Jlink - I don't have another interface here.

#

and it needs to be SWD

slender iron
#

that's not going to work

daring pumice
#

Can I do it over BLE?

slender iron
#

no. you need a UART for debugging at minimum. right now you are flying blind

daring pumice
#

Ok. I think my last option is to create a .hex image of my project with CPy and try to push it over to the board. I realize that's incredibly problematic, but it seems like the only path forward.

slender iron
#

you don't even know if CP is running ok

#

from the LEDs, it sounds like it isn't

daring pumice
#

That's not exactly true - I'm able to step through the code line by line over GBD, and x-reference it with the code in the clone of the git repo.

slender iron
#

try adding a break on reset_into_safe_mode

#

it'll all be easier once you have usb

daring pumice
slender iron
#

trying to do it early is costing both of us extra time

daring pumice
#

I understand - I don't want to take all of your time here, and I'm grateful for the support you've given me so far.

slender iron
#

@tulip sleet or @onyx hinge did you pick up an s3 box lite?

daring pumice
#

I guess the best question I can ask at this point is (again) for guidance on how to create a .hex image with my code included. Is there a set of instructions I can follow posted somewhere?

slender iron
#

no, there isn't. you are well off the beaten path

daring pumice
#

Fair enough. Thanks again.

slender iron
#

circuitpython isn't designed to work as an appliance

tulip sleet
slender iron
#

ya, I have that too. the lite is different enough to have a different board def

tulip sleet
#

should I get one? I though it was just without the dock

slender iron
#

nah. I can get one

#

I have a board def WIP that I was hoping one of you could finish

manic glacierBOT
#

I have a programmable power supply using I2C and a custom PMbus protocol (similar to SMBus). A Diligent Analog Discovery unit can produce the "repeated start" on the protocol analyzer, and the PSU responds as expected.

Below is a protocol capture of a GOOD read:
Start, 20 [ 10 | WR ], 00,
Restart, 21 [ 10 | RD ], F5 NAK, Stop

The circuitpython busio device can perform one of two options::

  1. write with stop=False, then readfrom_into
    Looks like this on the protocol anaylzer:
    Start...
onyx hinge
daring pumice
#

Is it possible to prevent attempts to enable USB in CP? I think this is what's causing my board to continually reset.

slender iron
#

set CIRCUITPY_USB to 0

daring pumice
#

@slender iron you're a champ.

daring pumice
manic glacierBOT
#

@hathach I tried this on Linux, macOS 12.4 (the latest), and Windows 10. I wrote a code.py that mounted the SD card file system, and then just looped to stay in code.py.

On Linux and macOS it worked OK. On macOS the SD card drive appeared quickly; on Linux it took a few seconds longer. Occasionally it would get hung up, but a reset fixed things.

On Windows, I had more trouble. Windows took a long time to show drives D, E, F, G, as long as 15 or 30 seconds. Drive D was CIRCUITPY. Trying ...

manic glacierBOT
#

@hathach I tried this on Linux, macOS 12.4 (the latest), and Windows 10. I wrote a code.py that mounted the SD card file system, and then just looped to stay in code.py.

On Linux and macOS it worked OK. On macOS the SD card drive appeared quickly; on Linux it took a few seconds longer. Occasionally it would get hung up, but a reset fixed things.

On Windows, I had more trouble. Windows took a long time to show drives D, E, F, G, as long as 15 or 30 seconds. Drive D was CIRCUITP...

timber mango
#

Hi everybody, I wonder if someone is interested in developped a library to play ogg vorbis or flac files on circuit python ?

manic glacierBOT
#

The bug is not in the adafruit_bus_device. The bug is some where in busio.SPI. I updated my code in the:

Not working esp32-2 repo
https://github.com/CTGControls/CTG_DPS_Python_Ad4116_Adafruit_MetroExpressEsp32S2

code.py

###OLD code
# _CTG_AD4116Class = CTG_AD4116Class

# _CTG_AD4116_ = CTG_AD4116_

# _CTG_AD4116_.startup(spiClk= 50000, CTG_AD4116= _CTG_AD4116Class)

###New code
_CTG_AD4116Class = CTG_AD4116ClassNoAdafruitBusDevice

_CTG_AD4116_ = CTG_AD4116_NoAdafrui...
manic glacierBOT
slender iron
#

@gilded cradle I'm around for two hours if you have time to debug the web workflow issue you are having

#

(I'm around off and on in the afternoon)

gilded cradle
slender iron
#

kk

#

want to video?

gilded cradle
#

Gonna grab my board

#

yeah

slender iron
#

can get you building ESP too

gilded cradle
#

I can't currently. I was going to work on spinning that up tomorrow

slender iron
#

I can walk you through it too

gilded cradle
#

ok, that'd be awesome

manic glacierBOT
slender iron
#

@stuck elbow @tulip sleet want to chat here

tulip sleet
#

yah sure, so could we point to an empty sequence of some kind?

slender iron
#

is does an address comparison

tulip sleet
#

but if not board.DISPLAY would do a truth-value test

#

so the idiom for testing would change

stuck elbow
#

using "is" correctly is really tricky

slender iron
#

mp_obj_is_true checks against == mp_const_none

#

if not board.DISPLAY is more flexible

tulip sleet
#

so instead of saying we set to None, we set to something else ... yes

slender iron
#

because we could add deinit to displays and then use that for true

#

setting it to something else means it prints that way

tulip sleet
#

so implement __bool__ for displays, then? I think

slender iron
#

that or for none

tulip sleet
#

False if deinited

#

i like that better, it's a non-working display

stuck elbow
#

either __bool__ or __nonzero__

#

I think the latter is the more pythonic one in this case

#

not sure if MP has it

slender iron
#

@tulip sleet adding deinit is probably more code

#

than making NoneType always false

stuck elbow
#

but it's not such hot code

slender iron
#

there is still a fast path for the None object

stuck elbow
#

I see, that would make sense

#

so just add __bool__ on None?

tulip sleet
#

that's a good point, it would fall through and still eventually be false

slender iron
#

right. it falls through now but the generic unary doesn't implement it

#

so copy the generic one and return false on bool

tulip sleet
#

it's still weird is None wouldn't work but it would print as None

slender iron
#

ya, I agree that's weird

stuck elbow
#

can we somehow raise an error if someone uses is with that fake None?

tulip sleet
#

if we added a deinit state, we'd need to check it in all the display calls at the beginning, as we do for busio objects, ec.

#

@onyx hinge ^

stuck elbow
#

another option is to have a NoDisplay object that is falsy

slender iron
tulip sleet
#

I think NoDisplay or deinited are the cleanest

onyx hinge
#

I think it'd be interesting to have a 'generic deinitialized object', it might actually allow removal of a lot of deinitialized checks. but I once prototyped it and didn't save any code size, which was my goal then.

If we do something for displayio it would be nice if we tried to make it generic enough that we could use it for other cases too, like when you deinitialize a DigitalIO it turns into this type...

#

PumpkinType

stuck elbow
#

we could make it a generic NoDevice, then use it for other things too

slender iron
#

a generic deinit object would change the type out from under you

stuck elbow
#

it's fine, python is not statically typed :D

#

None changes the type under you too

slender iron
#

for Displays yes

stuck elbow
#

you would then get errors like "A Display expected, but NoDevice found"

tulip sleet
#

NoDevice would respond to any method or attribute wit some exception, maybe RuntimeError, maybe OSError

#

maybe a NoDevice object has a single attribute that is the expected class

stuck elbow
#

raise OSError(418, "I am a teapot")

onyx hinge
#

Yeah I think you could make it say it's a <Deinitialized %q>. I should see if I still have that branch

slender iron
#

true

#

Sounds ok to me

onyx hinge
#

can't find it

stuck elbow
onyx hinge
#

No, when you deinitialize any object that works this way, its memory gets overwritten so that it's a <Deinitialized %q>

stuck elbow
#

so you don't reclaim the memory?

tulip sleet
#

you can just copy the old type into the first field, maybe you did that

#

you could zero out the rest of the object, and then copy the type

#

or could alloc a new one

slender iron
#

you can't alloc a new one because you don't control pointers/references to the object

stuck elbow
#

so it has to be smaller than the smallest device object

slender iron
#

I think it is safe to assume an object is the type pointer plus at least two bytes

#

and each object type would have to deinit itself

#

so it would be opt-in so to speak

stuck elbow
#

that's why we don't save on code size?

onyx hinge
#

deinited_unary_op should be changed so that use in a truthy context returns False

slender iron
#

lunchtime for me. the deinited object is interesting to me

onyx hinge
#

maybe I'll play with it for a bit while waiting on this other CI

tulip sleet
#

if someone could just summarize into the issue, that would be great; this is not an urgent fix, but is an interesting puzzle

manic glacierBOT
#

This is a PC (Fedora) with Blinka FT232H break out board via USB running python busio commands.
`
import board
import busio
i2c = busio.I2C(board.SCL, board.SDA, 500)
while not i2c.try_lock():
pass
device = 0x10
result1 = bytearray(1)
for itemcount, item in enumerate(commands):
if item[0]=='RD':
#i2c.writeto(device,bytes([item[1]]), stop=False)
#i2c.readfrom_into(device, result1)
i2c.writeto_then_readfrom(device,bytes([item[1]]),result1)
...

#

Using a list (or function) board.DISPLAYS does help with the problem, because the list would reside in RAM and thus the object pointer could actually be updated. It would also help with the rare boards that have more than one display.

There's still the problem of what if you write d = board.DISPLAYS[0]; displayio.release_displays() and later refer to d. It needs a way to be turned into a deinitialized display object.

I have an incomplete and non-working branch that introduces the De...

onyx hinge
#
>>> i, bool(i)
(<I2C>, True)
>>> i.unlock()
>>> i.deinit()
>>> i, bool(i)
(<DeinitedType>, False)
>>> i.unlock()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Object has been deinitialized and can no longer be used. Create a new object.
idle owl
#

@onyx hinge Hello. I am ready for the magic fix to resolve the destruction I unleashed on my CircuitPython fork. You mentioned it in passing, but not in a way that registered enough with me to recall it.

onyx hinge
idle owl
manic glacierBOT
#

Following on the previous discussion regarding interrupts, I am considering how to for improve display response to capacitive touchscreen events.

I am considering whether it is [useful, possible] to create an event queue for I2C interrupt events.

I don't know anything about interrupt handling in CircuitPython, or CircuitPython does event scheduling, so this is just a first attempt at proposing a behavior and stru...

main furnace
#

Can I disable the status line on CP8? RP2040 feather so I don't have WiFI.

jaunty juniper
#

you can hide the title group (though I think blinka and the status bar are not grouped together), and move the REPL group and reset the size of the console, but I think it's a little buggy right now, does something like that work ?

for pos in range(len(display.root_group) - 1):
    display.root_group[pos].hidden = True

tile_height = display.root_group[-1].tile_height
delta = display.height % tile_height

supervisor.reset_terminal(display.width, display.height)

display.root_group[-1].x = 0
display.root_group[-1].y = - delta
slender iron
#

so code running vs done vs error and USB status

main furnace
#

I'm using a 128x64 oled, I only have 4.5 lines of text.

jaunty juniper
slender iron
#

@jaunty juniper fine with me

#

@main furnace its meant to be useful πŸ™‚

#

but I understand it isn't now

orchid basinBOT
main furnace
#

0.2 of the screen is a bit much, but for now I can keep that node on CP7.

slender iron
#

it may not be too much code to underlay the serial portion under the title

#

but then the title would be hard to read

#

@main furnace you can actually set the title from your code

#

so you could use that space yourself

#

(in theory, I haven't tried it yet)

main furnace
#

How does that work?

slender iron
#

it uses the OSC escape code

#

so try print("\x1b]0;my new title\x1b\\")

#

the \x1b is the escape key code

main furnace
#

Okay I'll give it a try. Thanks.

jaunty juniper
#

awwww no microcontroller.cpu.temperature on ESP32S3 ! So much example code dies in agony !

slender iron
#

idf support it yet?

jaunty juniper
#

I assume not ? I think we have updated the IDF since the first S3 support was added ?

slender iron
#

it didn't when we added it

#

maybe it does now?

tulip sleet
#

@jaunty juniper @slender iron it is in ESP-IDF master but not 4.4.x

#

I checked on this recently and re-checked. master has many changes from 4.4. I wouldn't try to go there now.

slender iron
#

πŸ‘

tulip sleet
#

@onyx hinge I made little progress today on the ESP32 Thonny debugging. I think there may be some memory or heap error, but it's hard to tell. Adding logging creates Heisenbugs :/ . Tomorrow do you have time to get a brain dump about this, in case you want to work on it next week?

onyx hinge
#

@tulip sleet yes, before noon my time would be good

tulip sleet
#

got it, I'll ping you tomw morning, thanks

onyx hinge
#

OK!

orchid basinBOT
manic glacierBOT
orchid basinBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

The output of the debug console from the crash:

 I (30610) pp: pp rom version: e7ae62f
 I (30610) net80211: net80211 rom version: e7ae62f
 I (30620) wifi:wifi driver task: 3fce5928, prio:23, stack:3584, core=0
 I (45289) system_api: Base MAC address is not set
 I (45289) system_api: read default base MAC address from EFUSE
 I (45299) wifi:wifi firmware version: 84ed08c
 I (45299) wifi:wifi certification version: v7.0
 I (45309) wifi:config NVS flash: ...
#

LoadProhibited,

These CPU exceptions happen when an application attempts to read from an invalid memory location. The address which has been read is found in the EXCVADDR register in the register dump. If this address is close to zero, it usually means that the application has attempted to access a member of a structure, but the pointer to the structure is NULL.

manic glacierBOT
manic glacierBOT
#

Okay, so after looping back and looking at the https._free_sockets() module I realized that the proper way for the function to be called would be to use the response.close() method and adding that statement does prevent the crash which is at least a better option than calling the private _free_sockets() method.

#

I have a theory of the various keyboard descriptors discussed and the problem where the left Ctrl key seems to be pressed:

If the device sends reports prefixed with a 1-byte report ID of 0x01, the host is not expecting the prefixed report ID byte, and it interprets it as the modifiers field, and a modifiers field of 0x01 corresponds to the left Ctrl key. By calling usb_hid.enable((reference_keyboard,)...) with reference_keyboard having a report ID of 0, that causes ...

#
manic glacierBOT
manic glacierBOT
tulip sleet
#

@onyx hinge I am around for esp32 debrief pretty much any time today

onyx hinge
#

@tulip sleet OK, we're finishing entertaining guests soon and I'll ping you. maybe 30-45 minutes

onyx hinge
#

@tulip sleet OK guests are squared away until lunch time πŸ™‚

tulip sleet
#

ok, I am trying something; avail in a few minutes

onyx hinge
#

OK, I'll be around until 12 CT / 13 ET

#

@idle owl if/when you're around we can talk about undoing the changes in your fork of cirucitpython

tulip sleet
#

@onyx hinge ok, my experiment did not improve things, ready to talk. You can get latest from dhalbert/circuitpython, branch esp32

onyx hinge
#

OK I'm in one of the voice channels now

manic glacierBOT
idle owl
#

@onyx hinge Are you still available to fix my fork?

#

It's ok if not. Like I said, it's not crucial yet.

onyx hinge
#

@idle owl not really, we are leaving as soon as Ingrid finishes up her call which was supposed to be 28 minutes ago πŸ˜•

idle owl
#

Ok, no worries.

onyx hinge
#

the general idea is locally you get the adafruit main branch and then force-push that to your fork's main branch though

idle owl
#

Hmm ok.

#

I'll try to figure that out. πŸ™‚ Worst case, I guess I burn it to the ground and begin again.

onyx hinge
#

that's true!

manic glacierBOT
#

Many builds fail with internal compiler errors:


../../py/parsenum.c: In function 'mp_parse_num_decimal':
../../py/parsenum.c:256:21: internal compiler error: Illegal instruction
  256 |                     if (dec_val < DEC_VAL_MAX) {
      |                     ^~
0x1521b50 diagnostic_impl(rich_location*, diagnostic_metadata const*, int, char const*, __va_list_tag (*) [1], diagnostic_t)
	???:0
0x15227d6 internal_error(char const*, ...)
	???:0
0xb7838f crash_signal(int)
	???:...
manic glacierBOT
thorny jay
#

I found a disturbing behaviour of the web workflow. If you set the .env, you get an IP but things are not working yet (except ping), but if you restart the board, then things start to work.

tulip sleet
thorny jay
jaunty juniper
#

or would we want the web workflow to only be started on reset ?

thorny jay
# jaunty juniper or would we want the web workflow to only be started on reset ?

Might be an option, don't know what is more/less confusing, but if instruction to reset are present, that's fine. I think having the IP but not the rest could be useful as it will be visible on the "console" and you are likely to have the same IP at next restart, so it help potentially. Anyway at one time you will have to set that .env file one way or another... or is there a trick for that too??? Like a configuration access point for initial setup?

#

About trick, plugging your board in a charger to have the file system Read/Write from wifi is a great one.

#

My workflow will include that, first plug in a power-supply, do your change, then plug it in the host when it will be used.

jaunty juniper
#

that could take the same form as the BLE workflow, press reset at a certain point during boot to get the board in access point mode, though maybe that ends up being a lot of boot modes

thorny jay
#

I must admit I skipped the BLE workflow, mostly because I don't have an iPhone handy, and if felt required.

thorny jay
jaunty juniper
#

yup

idle owl
#

@wraith crow Oof, sorry, I thought I fixed that.

#

Hold on.

wraith crow
#

@idle owl lol, thanks, was scratching my head big time

#

@thorny jay Can you try, boot board, create .env, see the IP, try, while waiting... create file and write to file ie t = open('test.txt','w'), t.write('test')

thorny jay
#

I need to give a bit of context... I have a piece of code take an "image" and encode it as mouse movement for a Nintendo Switch. Today I need to plug my CP board on a PC, copy the "image", then plug in the Switch, and I need a "button" to activate mouse movement (to avoid mouse movement while connected to the PC). My goal is to be able to only connect to the CP board with WIFI, add the "image" then restart (maybe auto-restart) and do everything without having to plug/unplug the CP board. So right now I plan to use and abuse from the Wifi Workflow so that I don't even need to implement a web server or anything like that.

wraith crow
#

Okay, I was just suggesting the file I/O because I wanted to see if an issue I ran into was causing your issue. When I recreate your steps on my board it does seem to apply. Basically any flash file I/O was unblocking the stalled web workflow. To confirm that with your board if you have host write access to the CIRCUITPY drive, all you need to do is rename a file on the CIRCUITPY drive. I don't mean this as a solution to your requirements, as the issue would eventually be resolved, just curious if it's the cause of your current observation.

thorny jay
#

Wait, in my problem I don't even have the Web interface working before doing the first reset after creating the .env file. πŸ™‚

#

Do you think writing to a file would wake it up???

wraith crow
#

I do

#

Once you can ping it

manic glacierBOT
#

Initial support for plain ESP32, using Adafruit Feather ESP32 V2 as a starting point. Significant known problems. @tannewt suggested we go ahead and merge this, since there are many changes we'd like to incorporate even before ESP32 is debugged.

  • *DEBUG_UART* is now *CONSOLE_UART*, many places.
  • CIRCUITPY_CONSOLE_UART added to specify when the REPL console is done over UART.
  • Commented-out support in boards/adafruit_feather_esp32_v2/sdkconfig for separate ESP logging UART cha...
wraith crow
#

But only for one operation at a time, so you may need to do multiple file i/o depending on what you're trying to do over web workflow

thorny jay
#

OSError: [Errno 30] Read-only filesystem

#

I think my problem is not what I initially described...

wraith crow
#

The file i/o can occur from either REPL or the Host PC via the CIRCUITPY drive

thorny jay
#

The Web Workflow fail for me on my QT Py S2 but is a success on the Feather TFT S3.

wraith crow
#

I haven't gotten around to seeing if my S2 boards see the same issue, but I first saw it on an S3 board

thorny jay
#

For me: S3 = no problem ... S2 = sometime ping, never the web interface.

wraith crow
#

I you're getting the Read-only error from a board that's plugged into a host and has a CIRCUITPY drive mounted, you could try creating a file or renaming a file from the host computer and see if that releases the web workflow

thorny jay
#

While I would live to have a minimal hardware for my usecase, I can develop everything on my S3 and figure out later what is going on with that S2.

wraith crow
#

This is all still very alpha, I'm sure it will end up working on both the S2 and S3

thorny jay
#

Nope, creating a new file, writing to an existing file. It does not like me.

wraith crow
#

You did the file access after initiating the webflow request?

thorny jay
#

I have a browser on one side and using touch or creating file with Mu. But I don't think the browser was requesting anything at that time.

#

I am trying to clean completely the board... but now the FS is read-only and I cannot delete a leftover secrets.json or edit the .env ... now I need a way to "format" my CIRCUITPY.

wraith crow
#

I assume you're read-only from the HOST, if that's true, open the REPL you should then be able to rename the boot.py file by typing "import os" then os.rename('boot.py','boot.old') a reset after that should give your host read-write access

jaunty juniper
#

safe mode should always work

#

to be able to write from the web workflow, you only need to eject the drive, though I don't know if that works on windows

thorny jay
#

fsck to the rescue!

#

I was read only because of error on the filesystem. I tried the reset to factory default image, but it did not help. I failed at using esptool and the web serial also. Now I should be back to a clean QT Py S2. What a fight.

jaunty juniper
#

oh ok a corrupted drive

slender iron
#

ya, sorry for the bugs. I plan on going into bug hunt mode once I have websockets PRed

thorny jay
#

So the QT Py S2 is now clean, back with the latest version of CP. As soon as I set the .env it get an IP, but then whatever I do, I cannot get to the web interface. Only Ping is working for me. The good news is that I can play with the Web Workflow on my S3+TFT. So I know I can do it and I can try to experiment with the thing I had plan. Thank you for the help.

slender iron
#

I think you are right that you need to reset after writing .env

#

I'm not sure it checks after every auto-reload. I'll need to look at that

wraith crow
#

Doesn't the working ping mean that workflow has loaded?

slender iron
#

it means that its connected to the network but not that the webserver code is going

wraith crow
#

ah ok

slender iron
#

I'll need to look at all that

#

generally I've set .env once and not had to again

thorny jay
#

The other good news is that with the bits and pieces of documentation I found and a few PR exchange, I was able to figure out what to do to use the Web Workflow, without having to watch a YouTube video.

slender iron
#

so I've not tested that bit much

#

πŸ‘

#

I tried to document the rest api better

thorny jay
#

Yeah it need to be retested from scratch once the other bug are solved. That will be the first contact for a lot of user.

slender iron
#

yup yup

#

I am assuming that most folks will set the .env when they load CP

#

especially for C3 and ESP32

thorny jay
#

I would have been great if the .env file and the secret.py would have more or less the same syntax and key-value. Maybe secret.py will not be needed anymore and everybody will use getenv, and a compatibilty secret.py can be created for having the credential in only one place. (not sure my idea are clear here but there is a way to get rid of secret.py I believe).

slender iron
thorny jay
#

Unrelated: mdns or bonjour did not work for me, but it could be my OS despite installing avahi-daemon. It could also be my new wifi filtering multicast... too many variable for any serious troubleshooting... maybe I should start my Mac Mini. πŸ™‚

slender iron
#

you can test from the command line using dig

#

if you have two CP devices and can get the web workflow of one, the home page will try to do the mdns discovery for you too

wraith crow
#

New default secrets.py?

import os

secrets = {
'ssid' : os.getenv('CIRCUITPY_WIFI_SSID'),
'password' : os.getenv('CIRCUITPY_WIFI_PASSWORD'),
'aio_username' : "your-aio-username-here",
'aio_key' : 'your-aio-key-here',
'location' : 'New York, US'
}

slender iron
#

we should stop using secrets.py all together because it conflicts with a native CPython secrets module

wraith crow
#

πŸ™‚

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-alpha.1 on 2022-06-09; Adafruit ItsyBitsy M0 Express with samd21g18
Board ID:itsybitsy_m0_express

Same behaviour with

Adafruit CircuitPython 7.3.1 on 2022-06-22; Adafruit ItsyBitsy M0 Express with samd21g18
Board ID:itsybitsy_m0_express

Both are the German versions

Code/REPL

file code.py:
import test

file lib/test.py:
import time
import board
import digitalio
from audiocore import RawSamp...
thorny jay
slender iron
#

can you get the welcome page of one with the ip?

thorny jay
#

Yes I have both welcome page, but they show no other device.

slender iron
#

k, that must be the router then

thorny jay
#

Must be my super wifi blocking something. It is unify but brand new to me, and it is too simple for me (I was a cisco expert, that sexy web interface is disturbing to me). πŸ™‚

slender iron
#

I have a ubiquiti dream machine and its working ok

thorny jay
#

Some progress $ ping cpy-59d204.local PING cpy-59d204.local (192.168.192.72) 56(84) bytes of data. 64Β octets de 192.168.192.72 (192.168.192.72)Β : icmp_seq=1 ttl=255 temps=248Β ms

slender iron
#

nice!

#

was it a router setting?

thorny jay
#

In Network Setting there is Multicast DNS and I had to enable that.

#

I may have changed the default value thinking that I was smarter than Ubiquiti. πŸ™‚

slender iron
#

πŸ™‚

#

that's easy to find

manic glacierBOT
#

The Espressif ESP32-S3 Box Lite has a different non-touch enabled display compared to the ESP32-S3 Box. Using the ESP Box firmware on the ESP Box Lite produces an inverted backlight and for the brief flashes the display does show, the text is black on a white background and the display is rotated 90 degrees counter clockwise from what it should be. This PR adds a new board definition and fixes the ESP32-S3 Box Lite.

misty garnet
#

any particular reason there is no adafruit_bus_device for UART?

slender iron
#

usually uart is just one device

misty garnet
#

yeah, I was thinking that it would be useful for an enter/exit to open/close the port, but maybe that's a bit trivial

slender iron
#

I think you can use the UART object itself to auto-deinit

misty garnet
#

it looks like the UART exit will deinit, but that's not really what I was looking for

slender iron
#

what do you mean by close port?

misty garnet
#

hmm, good question, I could have sworn there was an open() and close() function but it appears I'm completely wrong

#

must be confusing it with the Serial class on the PC side of things

slender iron
#

Serial on iOS

spiral elk
wraith crow
#

@spiral elk Are you compiling the Lolin C3 Mini build yourself or downloading a binary UF2 file?

spiral elk
#

using the latest S3 build

#

Well, a July 5 one.

wraith crow
#

If I put a build with a tweak on github would you be interested in testing it out?

spiral elk
#

My build env is outdated so it'd take me a bit to update it

wraith crow
#

I'll do the compile, if you're intereseted, let me know if a .bin will work and I'll post the URL

manic glacierBOT
manic glacierBOT
spiral elk
#

C3 is bin only at the moment

#

And will probably always be so

#

No USB peripheral onboard

wraith crow
#

@spiral elk heh, I figured as much πŸ™‚

#

I'll probably have called it for the night so I'll check to see how you made out in the morning

jaunty juniper
#

oh nice

manic glacierBOT
wraith crow
#

@spiral elk The main difference in that version is that the code blocked mention in issue #6552 has been commented out.
https://github.com/adafruit/circuitpython/issues/6552
I really don't know if there are other impacts to Flash performance of running that version, but it's good to confirm the behavior. If you're interested you could update the issue with your results and I believe that will trigger notifications when progress is made.

GitHub

CircuitPython version Adafruit CircuitPython 8.0.0-alpha.1-27-g187f156ac-dirty on 2022-07-01; ESP32-S3-DevKitC-1-N8R2 with ESP32S3 Code/REPL No user code is run on the microcontroller before the be...

manic glacierBOT
#

A brief status summary:

The ESP32-S3 LCD peripheral is now proved to be working with CircuitPython. I've got it working with displayio and responding to touch inputs.

https://user-images.githubusercontent.com/33587466/178118126-bb2b849f-c304-4eee-9b3e-8ba48a1f7729.MOV

I pushed my first commit of CircuitPython incorporating the ESP32-S3 dotclockdisplay using the framebufferio.
I pushed my version of the ESP-IDF that has some updates to 1) prevent overwhelming the PSRAM DMA a...

languid whale
proven garnet
#

This might have already been discussed, but if the intention is to use dotenv with .env files for storing secrets, is the plan for repo READMEs to keep suggestion making virtual environments with python -m venv .env or is the name of the environment going to change to something else? If I understand correctly, .env and .env/ wouldn't conflict, but didn't know if asking users to the "edit .env" would cause any confusion.

jaunty juniper
#

oh yeah they would conflict

#

you can do python -m venv .venv

#

I can't figure out what the bot doesn't like πŸ€”

#

I personally find .env a problem for beginners, the Finder won't let you create a dot file, it's impossible to save a file as ".env" with TextEdit (.env.txt at best)

#

ah lol

#

there's a trick to see it from the Finder (cmd-shift-G + ".env" in the directory) but otherwise it's command line (with the "open" command allowing to edit with TexEdit for example). I have not tested if Mu is ok with any of that

proven garnet
#

I'll bring it up during In The Weeds then

manic glacierBOT
proven garnet
manic glacierBOT
wraith crow
#

Is the workflow file browser supposed to show the SD card rather than the internal flash if an SD card is mounted?

jaunty juniper
#

it shouldn't, that would defeat the purpose of editing code.py

wraith crow
#

If you mean, you wouldn't be able to modify the code.py file once an SD card was mounted, I'd have to agree. I would think there should at least be a way to toggle back to the internal, maybe there is and I'm just not seeing it yet.....

jaunty juniper
#

oh it should definitely not be showing the SD card

manic glacierBOT
slender iron
jaunty juniper
#

so we could list mounted sd cards

manic glacierBOT
#

Thanks! It wasn't clear to me where that dividing line was between mp_ types and native types (I've seen other headers in shared-bindings that use float, uint16_t, and uint8_t*), so I was assuming the related .c was where the official mapping occurred.

Are these other functions I've seen using an older philosophy or, in ...

slender iron
jaunty juniper
#

true

manic glacierBOT
lone sandalBOT
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-alpha.1-39-g4c20b3cb6-dirty on 2022-07-09; FeatherS2 with ESP32S2

Code/REPL

import adafruit_sdcard,storage,board,busio,digitalio
spi = busio.SPI(board.IO36, board.IO35, board.IO37)
sd = adafruit_sdcard.SDCard(spi, digitalio.DigitalInOut(board.IO33))
vfs = storage.VfsFat(sd)
storage.mount(vfs, '/sd')


http://xxx.xxx.xxx.xxx/fs/

storage.umount('/sd')

http://xxx.xxx.xxx.xxx/fs/

Behavior...

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-alpha.1-39-g4c20b3cb6-dirty on 2022-07-10; FeatherS2 with ESP32S2

Code/REPL

import board,busio
spi = busio.SPI(board.IO36, board.IO35, board.IO37)
from adafruit_bus_device import spi_device
t = spi_device.SPIDevice(spi,board.IO33,baudrate=250000, extra_clocks=8)

Behavior

Board crashes into same mode.

Description

No response

Additional information

It looks to me like this it t...

thorny jay
#

What do you think about the wifi banner that "print" on the REPL. In Mu it is a bit disturbing ]0;🐍 Wi-Fi: 192.168.192.72\? What is the plan for this? Should Mu be updated to understand those and display them as a banner, or it should be disabled on the serial interface?

jaunty juniper
#

maybe have it be just normal text without the escape sequence in the mean time

#

or ctrl-something shortcut to toggle it ? would that make sense ?

thorny jay
#

Could be the "Prompt".

#

But if you have access and plan to use the REPL, either you don't need to know the IP or you have another way to get that info (I don't know witch, but there should be an API to know the IP currently in use, not sure to do what, but just in case).

#

That web workflow is still very confusing to me. πŸ™‚

jaunty juniper
#

yeah wifi.radio.ipv4_address does give the IP

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

As of the excellent pull request above, RP2040 PulseIn has perfect 1us accuracy. Can my team safely rely on short pulses being detected in the future? Hoping it's not a matter of "the short pulse filter is coming back (non-optionally) when we figure out how to do it correctly". Noting that such a filter doesn't need to be in the PulseIn core and could be done in Python.

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-alpha.1 on 2022-06-09; Raspberry Pi Pico with rp2040

Code/REPL

import board
import busio
import time
import usb_cdc

#serial = usb_cdc.console
serial = busio.UART(board.GP0, board.GP1, receiver_buffer_size=128)
serial.timeout = 1

while True:
    n = serial.in_waiting
    if n > 0:
        data = serial.read(n)
        serial.write((str(n) + " ").encode("ascii"))
        serial.write(data)
  ...
manic glacierBOT
#

Currently it overwrites the oldest pulse lengths when full. In many cases, this means the result is invalid and needs to be discarded. For some uses, we could instead get something useful by decoding the beginning of the transmission. So I'm suggesting an option to make it pause when full instead of overwriting.

manic glacierBOT
digital shoreBOT
#
adafruit
Owner

adafruit#3230

Category Channels

8

Text Channels

61

Voice Channels

6

Members

34912

Roles

35

manic glacierBOT
jaunty juniper
#

oh @idle owl I kind of need a sanity check here, I was trying to use the Sparkle animation and it doesn't work properly, the "sparkle" doesn't stay up for the length of a frame (as per the speed parameter), it's erased as fast as the code can, and certainly doesn't match the gif in the guide. When I look at the code I see the problem, but it looks like it's been like that for 2 years.

idle owl
#

I can grab something and run it to check too before you dive in.

#

After meetings today though πŸ™‚

#

Because I've never had issues with it, but I also never updated the LED wall from my last office, so it was running older code the whole time. So I wouldn't have found bugs that way.

jaunty juniper
idle owl
#

No worries! Good catch on your part if it's broken. I'd rather verify it and move forward with a fix sooner rather than later, if it's been identified.

onyx hinge
#

<@&356864093652516868> The weekly meeting is in about 1 hour. We love hearing what's up with y'all so it's a great time to update the notes document: https://docs.google.com/document/d/1tiCKK3V9-X9_jgHTmTlEjDPfB_z7bjZTNu2kYtM7KBw/edit?usp=sharing -- see/hear you soon

thorny jay
idle owl
#

Thank you for the offer!

thorny jay
#

I'll make sure to listen to the recording. πŸ˜‚

manic glacierBOT
serene warren
#

Lurking. Trying to get back into the swing of things.

blissful pollen
#

Lurking too, my new job found out I exist (which is good) but harder to book lunch for the same time as the meeting

idle owl
#

It should be a Friday... looking now.

lone axle
idle owl
#

It is definitely a Friday.

inland tusk
#

It is a Friday for sure

lone axle
slender iron
#

ya, I need to watch that

#

I saw the screenshot

lone axle
#

It was super cool. I could see a possibility in the future where the web editor / console could prompt you with an easy button to install missing libraries when it detects the import errors

jaunty juniper
slender iron
#

I'm hoping melissa is going to unlock it for us by making it work with more than ble

random junco
#

Pycharm and VSCode will detect .env and .venv

proven garnet
#

I can manage patching that then to .venv

#

Adabot here I come!

idle owl
slender iron
#

πŸ‘ good idea!

lone axle
#

I think restream.io has tools to help with streaming out a video that has been cut together as well

serene warren
#

Some people are introverts (yes me) and not comfortable with live stuff but might be ok with a short reording

random junco
#

It could be a demo or just a "Happy CircuitPython Day" message might be cool, too

gilded cradle
#

Thanks

modern wing
#

Thanks for another great meeting!

[joined literally at the last minute due to other obligations -- but at least I kinda made it!]

serene warren
#

Thank you all for sharing your time

proven garnet
#

Sprints! super_love

#

Thanks!

mental nexus
#

Thanks everyone!

modern wing
idle owl
modern wing
#

Here's towards a healthier tomorrow!

lone axle
#

Thanks for driving the ship today @onyx hinge. Great to have you back around and into the swing of things.

onyx hinge
#

Thanks!

minor plume
#

I’m intrigued by the β€œsprints” idea for CircuitPython Day and would love to know more.

idle owl
minor plume
blissful pollen
#

I'll have to listen to the end of the meeting but if some stuff is coming for CP day and requires help or such I can see how work is / book time off. Not hard to convince me not to work a Friday πŸ™‚

manic glacierBOT
#

I confirmed this is resolved now in the 7.3.x branch. I made a build from that branch for Matrix Portal and tested with the reproducer code from above. It does now successfully complete the import and print the message.

Adafruit CircuitPython 7.3.1-2-g5098d0d10-dirty on 2022-07-11; Adafruit Matrix Portal M4 with samd51j19

code.py output:
Hello from asyncio on the MatrixPortal!
onyx hinge
#

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/1r0xVV98pjnzGh3ODbX7HxM_5_Tz8UaIbgFDG-5JZrAw/edit?usp=sharing

manic glacierBOT
#

I confirmed this does now raise the ConnectionError on 7.3.x branch.

I tested with a Feather Bluefruit Sense and CLUE devices both using builds made from 7.3.x branch.

Output on the device running the _client.py code is now:

Traceback (most recent call last):
  File "code.py", line 28, in <module>
  File "adafruit_ble/characteristics/float.py", line 46, in __get__
  File "adafruit_ble/characteristics/__init__.py", line 246, in __get__
  File "adafruit_ble/characteristics/...
idle owl
#

@slender iron I can walk Tekktrik through our RTD process if you want.

manic glacierBOT
slender iron
#

@idle owl thanks. I'm sure you know a more updated version than me

idle owl
#

At this point, almost certainly. πŸ™‚

manic glacierBOT
#

When I init the display, I allocate the FrameBuffer using m_malloc:

    esp_lcd_rgb_panel_config_t panel_config = {
        .fb = m_malloc(fb_size, true), // preallocate framebuffer in CircuitPython
        

when the code.py finishes, what happens to display objects and FrameBufferIO objects? What do I need to do to ensure that they β€œlive” through after code.py finishes? Also, is m_malloc the right thing to use? What do you mean to β€œmove” the FrameBuffer to supervis...

daring pumice
#

Question re: Custom Board based on the Feather Sense:

The board I've printed isn't supplying the right amount of power to the VBUS (it's giving 3.3V when it should be giving 5V).
I have a variable external power supply that I've used to compensate (bring the board's voltage up to the right level).
CPy boots at that point with no issue, but it still doesn't show up as a drive that I can access (i.e. can't see it as a drive, can't push my code over to it).

daring pumice
#

I'm sure I'm missing something. Does anyone have any ideas or guidance on how I could save this board?

slender iron
#

Generally a USB sniffer is useful when determining if anything is happening over USB.

manic glacierBOT
lone axle
#

As far as I can tell I am using the same version of sphinx 5.0.2 as what RTD built with. Anyone know of what else could account for the differences? Ultimately I was hoping to make the name and type have a space (or something else) between them. But was puzzled when I found that my local build doesn't look the same.

slender iron
#

maybe theme version?

idle owl
lone axle
#

checking on sphinx-rtd-theme now. I do think I had a different version

idle owl
#

Like I had indented lines not working right, and they only worked right with 1 space indent. 2 or more made them show up completely wrong. Took ages to figure that out, because Sphinx explicitly states, any number of spaces works fine.

lone axle
#

yep, sphinx-rtd-theme was the culprit. 0.4.3 is the version that I found an RTD build used. I was on 1.0 I'm at least matching the live one now so I can figure out how to tweak it.

#

And a whitespace tweak (remove a space) is also the fix to make it not get smashed together as well in this case. Thanks for point in the right direction to both of you.

manic glacierBOT
slender iron
#

@wraith crow what board are you seeing this issue on?

manic glacierBOT
wraith crow
#

I'm pretty sure it happened on an UM Feather S3, but I've been running through my S3 and S2 boards so it might have been an S2. I've noticed it at least twice but it's not very repeatable.

slender iron
#

kk. I suspect it is worse on C3 since it doesn't have USB to keep things moving

wraith crow
#

I'll try and test out a C3 later tonight then πŸ™‚

slender iron
#

just made the websocket PR ☝️

slender iron
#

@wraith crow does it hang until the status LED flashes?

#

which is every 5 seconds

wraith crow
#

The times it has happened I renamed or deleted a file from the flash and the workflow recovered, it was definitely hung for more than 5 seconds though

slender iron
#

how did you rename or delete?

#

through the web workflow?

wraith crow
#

No, the workflow isn't responding when it happens, either from the CIRCUITPY drive or from the serial REPL

slender iron
#

hrm, ok. so you change it over USB

wraith crow
#

yep

#

It looks like my FeatherS2 is in the hung state now, is there anything you want me to try?

slender iron
#

are you running a debug build?

#

are you using a web browser to access it?

#

viewing the network tab of the developer tools in the browser can help see what request is in flight

wraith crow
#

No, I don't think it's a debug build, yes I'm trying to access it from a browser

slender iron
#

did anything load or are you waiting for the html?

#

it'd be helpful if you could get debug output as it happens

wraith crow
slender iron
#

the debug info prints out what requests its gotten

#

do you have it open in other tabs?

#

I wonder if it is chrome

#

tries chrome

#

I did have issues where an old socket would block new ones but I thought I fixed that

wraith crow
#

I hooked up rx/tx and it looks like I am on a debug build, but the output gets mucked up after the cpu starts....

slender iron
#

hrm. maybe different speed?

#

I'm on S3 mostly

#

just saw weirdness chrome so I'm pulling that thread

wraith crow
#

Looks like a baud rate issue, but I've never seen it change in the middle like that

#

I'm going to delete a file from flash and see if it kicks the device loose

#

Yep, from the REPL I deleted a file from flash (boot_out.txt) and now the web workflow is responding

slender iron
#

huh! weird

wraith crow
#

The symptoms are exactly the same as what was happening when the code block I commented out was still in play, except that when the code block was there, performing flash I/O only allowed a single webflow transaction and you had to keep performing I/O to get anything done. Now when it locks up, one or two I/O unlock it and then it runs without issue.

slender iron
#

ah, the hook that runs the workflow is tick dependent

#

I didn't realize that from the function name

#

I haven't been doing USB transactions so I haven't really hit this

#

I wonder why ticks are on at the start

#

aka, why does it work for me

wraith crow
#

I was thinking it had something to do with the filesystem_dirty flag. I'm running on an old Windows 8 machine and I'm not always dismounting the CIRCUITPY drive cleanly

#

But that was a very uninformed guess πŸ™‚

slender iron
#

I think by commenting out the tick disable, you are leaving it on

#

and it calls the "background" task that does the http serving

#

but I'm not sure why it is on for me at all

wraith crow
#

I wasn't sure how it was working for anyone either, something else must turn the ticks on that wasn't in play in my setup

slender iron
#

I have an idea how to set it up to be driven by the sockets

#

but it isn't super simple unfortunately

#

ah! I'm on a board with a display

#

and displayio turns on ticks

wraith crow
#

Ah ha πŸ˜„

slender iron
#

turns off the display

wraith crow
#

Foamyguy likes display boardss as well, I was scratching my head watching his streams....

slender iron
#

haha

#

let me update the issue

#

we do too good of a job sleeping πŸ™‚

jaunty juniper
#

I tried that excuse with my boss once, it didn't go well

wraith crow
#

Sleep is good!

slender iron
#

πŸ™‚

#

ok, well I'm out of time today but should be able to fix this tomorrow

wraith crow
#

Hopefully I'll have a chance to play with your new PR tonight πŸ™‚

slender iron
#

do you want a patch so you don't need to do USB stuff?

wraith crow
#

I can throw my patch in after I get your PR

slender iron
#

somewhere in init you need an extra supervisor_enable_tick

wraith crow
#

It's working well enough for me to play tonight, it can wait πŸ™‚

slender iron
#

kk np

manic glacierBOT
#

The HTTP code is currently driven by a tick callback. On boards with displays this is works because ticks are on for display refresh. On boards without it, the code can't respond because we're asleep.

I think the fix is to add a select() based task that can wake CircuitPython when sockets are ready. We'll also need an eventfd to let the select task know to update the sockets it is waiting for.

midnight ember
#

Oh I got a mention for my bitmapsaver example in the meeting today. My first ever PR. Thanks for the mention. ❀️ Sorry for using the SD card @lone axle didn't mean for you dig out an SD card just to confirm it. I could have written it using SPI flash instead. It's cooler with the SD card example though, can log endless screenshots with SD. 😁

lone axle
midnight ember
#

oh no, well, made you want to print a new case. one of those circumstances where's it fine until it's not fine. i'm working on a 3D printed version with someone for a tft featherwing case. secret project. no SD card access though, just thought of that. :/

#

just seeing the PR comments now, yeah i completely assumed the 2.4" was drop in compatible. good call on the different driver. :/

manic glacierBOT
manic glacierBOT
tiny token
#

Not sure how to move forward with this, so I'll pose the question here. I've continued to tinker with the HTTPServer by @tulip sleet. In my fork I have two branches (Refactor & WSGI). The first one refactors the module in to a folder with class files, the second builds on that by adding support for the CGI and WSGI spec.

jaunty juniper
#

sounds good so far

tiny token
#

My goals. 1. allow the example code file to run unchanged 2. Keep HTTPServer simple so beginners can use it to quickly standup a web server on their boards. 3. Allow adventurous developers to use the WSGI pieces to create more advanced web apps.

#

Still a ways to go, in getting it cleaned up (docs, comments, etc.) but I've got it working fairly well so far. I've tested it on an ESP32S2 and examples work unchanged for both branches.

#

so besides the Docs, and comments. What else should I be looking at to make sure that these changes are acceptable? Is updating HTTPServer the best way to do this or should it be a separate module for the community bundle?

manic glacierBOT
manic glacierBOT
blissful pollen
# tiny token My goals. 1. allow the example code file to run unchanged 2. Keep HTTPServer ...

Two thoughts. One if you are free Monday's 2pm EST attend the weekly CP meeting held on discord and bring it up in the "in the weeds" section, where longer discussions on items just like that take place.
Two, you could create a draft PR or an issue (tagged with enhancement) and explain what you are trying to do and create discussion there.

Three (yes I know I said two) I think Dan is away right now but a lot of times here on Discord as a good place for discussion as well.

manic glacierBOT
wraith crow
#

@slender iron Heading to bed but wanted to say it was really cool seeing the REPL come over the Websocket. This is really exciting stuff, Thanks!!!

tiny token
#

Need to dig into this web socket stuff too, similar, I believe, just used for different purposes but maybe useful. Sigh!... So much to learn so little time.

manic glacierBOT
#

I rebuilt the PR with today's main branch and replaced the ESP_LOGE statements in websocket.c with mp_printf statements. When I throw a lot of output at the serial port the websocket disconnects (stops mirroring and the SEND and CTRL buttons go grey). Nothing shows up on the DEBUG console but on the USB console the following message shows up at the point the socket disconnects:

 short send on 57 err 31 len 62

This is one of the ESP_LOGE messages I replaced in order to get the PR to ...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#
manic glacierBOT
manic glacierBOT
#

I seem to be able to reproduce this by running a uPyBasic program, the wifi connection crashes whether I'm using the serial WebSocket or not. uPyBasic does a LOT of flash i/o so maybe that has something to do with it.

 W (60218) wifi:<ba-del>idx
 W (60218) wifi:<ba-add>idx:0 (ifx:0, 48:5d:36:d1:30:e0), tid:0, ssn:235, winSize:64
 I (67598) wifi:bcn_timout,ap_probe_send_start
 W (67598) CP wifi: event 21 0x15
 W (67618) wifi:<ba-del>idx
 W (68618) wifi:<ba-a...
#

Hmm, after hanging the wifi several times from uPyBasic, I just ran the program sucessfully without losing the WebSocket, not quite repeatable.... I am getting a few Warning messages on the DEBUG console but everything seems to be running fine this time.

 I (156658) wifi:bcn_timout,ap_probe_send_start
 W (156658) CP wifi: event 21 0x15
 W (159028) wifi:<ba-del>idx
 W (159028) wifi:<ba-add>idx:0 (ifx:0, 48:5d:36:d1:30:e0), tid:0, ssn:174, winSize:64
 W (209958) wifi:...
slender iron
#

@onyx hinge any ideas on how to make ulab smaller?

#

I think it's 100k+ on xtensa

onyx hinge
#

@slender iron not really! I had one idea but I looked and it was already done πŸ˜• πŸ™‚

#

there may be optional parts but we don't like turning off optional parts

#

afaik we configure for 2D which is the common case, but you might make sure of that

#

higher dimensions bring in more code

slender iron
#

my websocket build failed because the ulab update added 2k+. I'll look at what my options are

onyx hinge
#

yes it certainly got bigger

slender iron
#

only two boards are too small though

#

dan and I looked a bit when you were out and saw ulab is pretty big

#

should I make GIFIO depend on camera?

manic glacierBOT
#

Thanks @tannewt :smiley:

I marked this PR as a draft whilst I performed additional testing. This is now complete and this MR should be good to merge!

In addition to being able to flash my STM32F405 board I checked the family IDs for several other STM32F4 builds. For reference these were:

stm32f4_discovery - STM32F407: 0x6d0922fa
feather_stm32f405_express: 0x57755a57
pyboard_v11: 0x57755a57
sparkfun_stm32f405_micromod: 0x57755a57
sparkfun_stm32_thing_plus: 0x57755a57

slender iron
#

@wraith crow you may want to use a more sophisticated terminal emulator too. mine is very basic

wraith crow
#

what terminal emulator is that?

slender iron
#

it is my custom code. basically a <pre> tag πŸ™‚

#

only filters out the terminal title, backspace and clear line codes

wraith crow
#

I'm not sure I'm seeing exactly the performance you meant since I swapped the javascript method but it seems to work pretty well. Command recall (up arrow) would be nice but I can't really think of too much else. I'm seeing an occasional "Null" inserted, I think it's when I overwhelm the buffer or something, but it hasn't bothered me too much yet.

slender iron
#

I think up arrow requires me to track keypresses

#

you can do beforeinput on chrome. I just had to change how to connect it

#

(testing it now)

wraith crow
#

So on an older PC I'm picking up the network name of the device from my router (umfeathers2), I can ping that name and bring up the web workflow welcome page. When I go to one of the pages that needs authentication (umfeathers2/fs/ or umfeathers2/cp/serial/), the page isn't displayed and the DEBUG console comes up with a CP webserver: bad origin http://umfeathers2 message

slender iron
#

ah, that is because you used the DHCP hostname rather than the MDNS one

wraith crow
#

I don't think I have MDNS on Windows 8 :/

slender iron
#

we could make the hostname work too

#

but you can use the IP as well

wraith crow
#

Yep, the IP works fine

slender iron
#

there is an origin_ok function in web_workflow that does the check

wraith crow
#

What happens if you have multiple of the same type boards, does MDNS/DHCP enumerate them showhow?

slender iron
#

trying to prevent rogue http sites on the web from accessing it

#

MDNS should

#

I'm not sure about dhcp because the hostnames may be identical

#

the mdns ones use the mac address to be unique

wraith crow
#

I've seen DHCP devices with MAC addresses stuck on them, so maybe if it detects a collision it adds it

slender iron
#

Β―_(ツ)_/Β―

onyx hinge
#
 (inlined by) mp_obj_print_helper at /home/jepler/src/circuitpython/ports/espressif/../../py/obj.c:133
 (inlined by) mp_obj_print_helper at /home/jepler/src/circuitpython/ports/espressif/../../py/obj.c:114
fun_builtin_1_call at /home/jepler/src/circuitpython/ports/espressif/../../py/objfun.c:75
mp_call_function_n_kw at /home/jepler/src/circuitpython/ports/espressif/../../py/runtime.c:665
mp_execute_bytecode at /home/jepler/src/circuitpython/ports/espressif/../../py/vm.c:936
fun_bc_call at /home/jepler/src/circuitpython/ports/espressif/../../py/objfun.c:297 (discriminator 4)
mp_call_function_n_kw at /home/jepler/src/circuitpython/ports/espressif/../../py/runtime.c:665
mp_call_function_0 at /home/jepler/src/circuitpython/ports/espressif/../../py/runtime.c:638
parse_compile_execute at /home/jepler/src/circuitpython/ports/espressif/../../shared/runtime/pyexec.c:146
pyexec_friendly_repl at /home/jepler/src/circuitpython/ports/espressif/../../shared/runtime/pyexec.c:734
run_repl at /home/jepler/src/circuitpython/ports/espressif/../../main.c:823
 (inlined by) main at /home/jepler/src/circuitpython/ports/espressif/../../main.c:922
app_main at /home/jepler/src/circuitpython/ports/espressif/supervisor/port.c:410
main_task at /home/jepler/src/circuitpython/ports/espressif/build-adafruit_feather_esp32_v2/esp-idf/../../esp-idf/components/freertos/port/port_common.c:141
``` ooh you can get even more information of addr2line if you ask fori t
#

@slender iron do you think anyone is depending directly on the output format of ./tools/decode_backtrace.py ?

slender iron
#

no, I hope not

#

so change away!

onyx hinge
#

sadly, gdb disassembles mp_obj_get_type incorrectly. The faulting instruction is at +35. ``` 0x400dec50 <+28>: j 0x400dec5a <mp_obj_print_helper+38>
0x400dec53 <+31>: movltz a3, a0, a0
0x400dec56 <+34>: lsi f2, a5, 0x39c
0x400dec59 <+37>: .byte 0xff
0x400dec5a <+38>: l32i a8, a10, 16

manic glacierBOT
#

Another scenario that causes misbehavior:

>>> s = "x" * 999
>>> import gc
>>> gc.collect()
>>> s
'\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
slender iron
#

did you try and print out the pointer passed into get_type?

manic glacierBOT
#

And it doesn't affect just the repl, I a similar snippet in code.py via the repl and it misbehaves in yet a slightly different way:

>>> with open("/code.py", "wt") as c: c.write("print(dir())\ns='x'*999\nimport gc\ngc.collect();print(s)\n")
... 
55
>>> 
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
['__name__', '__file__']
Traceback (most recent call last):
  File "code.py", line 4, in <module>
NameError: name...
wraith crow
#

Is there an standard way to do case insensitive string compares when writing CircuitPy C code?

slender iron
#

not that I know of

wraith crow
#

kk πŸ™‚

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.3.1 on 1-12-2022; Matrix Portal M4

Code/REPL

# SPDX-FileCopyrightText: 2020 John Park for Adafruit Industries
#
# SPDX-License-Identifier: MIT

# Metro Matrix Clock
# Runs on Airlift Metro M4 with 64x32 RGB Matrix display & shield
import gc
import json
import time
import board
import displayio

from adafruit_display_text.bitmap_label import Label as BitmapLabel
from adafruit_display_text.label impo...
manic glacierBOT
#

hmm those calls create a new ondiskbitmap, which takes up memory, and you probably aren't seeing it freed later, possibly because of :

group[0] = displayio.TileGrid(CURRENT_BITMAP1 if BLINK else CURRENT_BITMAP2, pixel_shader=CURRENT_BITMAP1.pixel_shader)

you could load all 4 ondiskbitmaps at the beginning and then you can swap them in and out by hiding them. alternatively you may want to try popping them off the group so you can make sure they are gc'd - see the slideshow libr...

#

I threw a hack into _origin_ok to compare against the DHCP host name in addition to the mDNS host name. It's not real pretty but it seems to get the job done.

That being said, I'm not sure this test is actually doing what we're hoping it is. I don't think it's filtering out requests from rogue or outside sources. The origin variable isn't actually the origin of the request, it's the host name used in the request query, the destination maybe.

If an IP scanner was probing a LAN with these...

manic glacierBOT
#

The short answer is yes, using a boot.py file and the storage.remount method. You just need to understand that once you change the setting you will no longer have Write access via the CIRCUITPY drive and all changes will have to be done from the microcontroller either through REPL commands or CircuitPython code.

Please take a look at the following learning guide that covers the subject:
https://learn.adafruit.com/circuitpython-essentials/circuitpython-storage

bleak matrix
#

Hi. There is a build failure for a single board on the main branch. Although it appears unrelated to my change, is it possible for me to re-run this GitHub action?

import adabot.github_requests as github
ModuleNotFoundError: No module named 'adabot.github_requests'
Error: Process completed with exit code 1.
manic glacierBOT
#

I thought array assignment like that did affective clear the memory usage? Regardless, I don't think that's the issue. Similar permutations of this code can go for a long time:


5: Memory : 20624
6: Memory : 20320
6.1: Memory : 20240
7: Memory : 24528
8: Memory : 20880
9: Memory : 20784
10: Memory : 20704
5: Memory : 20624
6: Memory : 20320
6.1: Memory : 20240
7: Memory : 24528
8: Memory : 20880
9: Memory : 20784
10: Memory : 20704
5: Memory : 20624
6: Memory : 20320
...
manic glacierBOT
#

You're loading displayio.TileGrid(DEFAULT_BITMAP, pixel_shader=DEFAULT_BITMAP.pixel_shader) twice as 2 different variables, it'll work but seem seems unnecessary and redundant.

I think the issue might be stemming from not loading the pixel shader for CURRENT_BITMAP2. It might be trying to use bitmap1 pixel shader on bitmap2 or vice versa. Think of pixel shader as an alpha mask. It shouldn't crash if it's using the wrong pixel shader as long as the other image is loaded. A pixel shader is a...

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Category Channels

8

Text Channels

61

Voice Channels

6

Members

34924

Roles

35

jaunty juniper
#

In some Magtag learn guides, like this one:
https://learn.adafruit.com/magtag-weather/project-code
⁃ adafruit_minimqtt is missing from the project bundle
⁃ it is required for the adafruit_io library
⁃ the requirement is not spelled using the pypi formatting
⁃ that should not be an issue for pypi (it converts _ to - and ignores case)
Maybe that makes the project bundler miss that requirement ?

Actually that seems to affect every guide using adafruit_io (so any using portalbase)
Like that:
https://learn.adafruit.com/pyportal-weather-station/code-pyportal-with-circuitpython

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

This sequence doesn't involve gc.collect (nor is garbage implicitly collected) and still gives a nonsense result.

Adafruit CircuitPython 8.0.0-alpha.1-39-gafbaa2eb6-dirty on 2022-07-13; Adafruit Feather ESP32 V2 with ESP32
>>> import ulab
>>> u = ulab.numpy.ones((6400,))
>>> sum(u)
6.326e+22

It crashes at this point instead of returning to the repl:

? Backtrace:0x400d4198:0x3ffbf0400x400de76e:0x3ffbf060 0x400e0eed:0x3ffbf090 0x400e3495:0x3ffbf0b0 0x400e9d8a:0x3ffbf0d0 ...
manic glacierBOT
#

You're loading displayio.TileGrid(DEFAULT_BITMAP, pixel_shader=DEFAULT_BITMAP.pixel_shader) twice as 2 different variables, it'll work but seems redundant and doesn't have anything to do with the main issue in my opinion.

The reason I have two copies of the TIleGrid is I want the grid to populate IMMEDIATELY for a loading screen. To do that, I need it to load before all my labels and BEFORE that method that calculates the time. For this reason, I create the grid and populate the loading ...

manic glacierBOT
slender iron
#

will look shortly

bleak matrix
#

Thanks!

slender iron
#

np, thank you!

#

@sour lynx is there any way to get a callback from lwip?

manic glacierBOT
slender iron
#

@onyx hinge I'll look shortly

manic glacierBOT
#

See image. The position of the pixels change independent of each other. I was saying the count and color of pixels was the same between the images (more or less), I was NOT saying the bmps were identical or could be equal given some vertical or horizontal shift. All in all, using the same shader works, but is not necessary, as I showed in my adapted code

manic glacierBOT
onyx hinge
#

@slender iron a re-review would be awesome

proven garnet
#

@idle owl Did you ever write the guide about mpy files? It'd be really helpful for my understanding while reviewing a PR, but I can't seem to find it.

proven garnet
#

barbaraBless Thank

#

Oh it's in the welcome to CPY guide, excellent! I'll remember that. πŸ™‚

idle owl
manic glacierBOT
jaunty juniper
#

@idle owl I noticed adafruit minimqtt missing from the project bundles on learn for the portalbase libraries

#

but I don't have access to the bundler, so I don't know

idle owl
#

@jaunty juniper That PR will fix it, if that's the issue you were seeing.

#

@proven garnet Any reason not to merge that PR?

#

You're welcome to πŸ˜„

jaunty juniper
#

ok that's good then

manic glacierBOT
proven garnet
slender iron
#

@onyx hinge I'm waiting for a re-review from you too

onyx hinge
#

@slender iron oops, will do that now!

slender iron
#

thanks!

manic glacierBOT
onyx hinge
#

That's certainly an odd failure. python3: can't open file '/home/runner/work/circuitpython/circuitpython/ports/atmel-samd/../../tools/uf2/utils/uf2conv.py': [Errno 2] No such file or directory

idle owl
onyx hinge
#

seems the "get CP deps" step failed but didn't report the error in a way that GA understood as a failure

proven garnet
#

Also, @idle owl whenever you get a chance, could you take a look at this cookiecutter fix? It's for building MPY files for community libraries, which is currently broken (sometimes, PR should explain) https://github.com/adafruit/cookiecutter-adafruit-circuitpython/pull/186

GitHub

Fixes #185 where the workflow YAML files don't account for community packages with or without prefixes because it looked only for folders beginning with adafruit_. This required disabling the ...

#

Oh cool it has merge conflicts, I'll fix those

idle owl
proven garnet
#

You got it!

manic glacierBOT
#

A recent build failed. The original error seemed to be during ci_fetch_deps where a build message said

  fatal: reference is not a tree: 346c936e14c6ea3a8d3d65cb1fa46202dc92999d
  fatal: Unable to checkout '346c936e14c6ea3a8d3d65cb1fa46202dc92999d' in submodule path 'extmod/ulab'

(along with other problems), but this step didn't signal failure to github actions.

By adding the check= parameter, a failure of the subprocess will cause a CalledProcessError to be raised, which will...

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-alpha.1-30-g8814ee03f-dirty on 2022-07-03; Teensy 4.1 with IMXRT1062DVJ6A

Code/REPL

from pwmio import PWMOut
import board, time
p =  PWMOut(board.D2,duty_cycle=32000,frequency=5000,variable_frequency=True)
time.sleep(20)
p.frequency = 500
time.sleep(20)
p.duty_cycle = 0
p.deinit()
p =  PWMOut(board.D2,duty_cycle=32000,frequency=1000,variable_frequency=True)

Behavior

During the first and s...

proven garnet
#

@idle owl, @tulip sleet, @jaunty juniper - I was thinking about how to add __version__ info to the libraries, and it fits really well with pyproject.toml. I have an example in my CircuitPython_CSV library that I just converted to pyproject.toml. It uses the same sed command to populate the version as a hardcoded string instead of using setuptools-scm. That way, any changes to the library don't make it deviate from the tag name upon release (PyPI absolutely hates tag names like 1.2.4+dev.1234556 and won't do it) but this side steps the problem. Then in a future update, we could add __version__ to all the libraries that don't already have them and you could do this across the board:

>>> import libname
>>> libname.__version__
1.2.3
slender iron
#

@strong violet please ping me when you are around. I want to modify thonny to work with the set title stuff in CP 8 and would love some pointers

slender iron
#

@lone axle do you have simple editor html/js?

slender iron
#

do you want to integrate it into the web workflow or want me to?

lone axle
#

I will make sure it's pushed and get a link.

#

I can make a PR for it if that works?

slender iron
#

fine with me. you'll likely hit build size issue unfortunately

#

we'll have to decide how to make it fit

manic glacierBOT
slender iron
#

@onyx hinge I did the resolve

lone axle
slender iron
#

kk, I'll do other things πŸ™‚

onyx hinge
slender iron
#

np

#

easy fix

manic glacierBOT
onyx hinge
#

@slender iron maybe we can look at it together tomorrow, I enabled web workflow on esp32 v2 and it does get an IP address (I can see it in the repl), I can ping circuitpython.local but but I can't browse or curl http://circuitpython.local

slender iron
#

do you have a display?

#

otherwise you'll need 6591

#

(which I'm cleaning up now)

#

don't know how I missed all that debug stuff

onyx hinge
#

like displayio? no

slender iron
#

as-is in main you'll need ticks enabled

onyx hinge
#

I see, I think

slender iron
#

right now the call to the http server code is done from a ticks callback

#

which works with displays because displays enable ticks

onyx hinge
#

that branch will have a minor merge conflict with esp32 PR as well

slender iron
#

ok, I've got fixes for it now anyway

#

maybe I'll wait until the ESP32 PR is green and then merge

#

57 checks left

manic glacierBOT
#

Still hanging trying to load page. Control-D in REPL helps a little but sometimes results in the board freezing with this message on the USB port:

 Assertion 'num_triggered >= 0' failed, at file Socket.c:95

and the following on the DEBUG console:

 I (49499) gpio: GPIO[46]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0


 Backtrace:0x400A0FD9:0x3FFDAFD00x400A1C03:0x3FFDAFF0 0x400A0D59:0x3FFDB010 0x400A0E6B:0x3FFDB030 
 0x400B5056:0x3FFDB050

...

onyx hinge
manic glacierBOT
onyx hinge
#

I don't see any files once I get /fs to load. when there's no password configured, /fs and /serial both just give blank pages, not guidance. /serial does work in ff now that I configured the http password

#
>>> os.listdir('/')
['.fseventsd', '.metadata_never_index', '.Trashes', 'lib', 'boot_out.txt', 'adafruit_ahtx20.py', '.env', 'wifitest.py']
```files are seen in the repl
#

this is really slick @slender iron well done!

manic glacierBOT
#

I was able to get some very helpful debug output, narrowing down on the issue:

code.py output:
    Metro Minimal Clock
Time will be set for America/Chicago
0: Memory : 62752
1: Memory : 41376
#0 | 4642.45
Updating time...
--------------------------------------------------------------------------Even
2: Memory : 37888
2.2: Memory : 34464
2.3: Memory : 31040
3: Memory : 35680
3.1: Memory : 35712
Connecting to AP jgage_netgear
Getting time for timezone America/Chicago
Chec...
slender iron
#

@onyx hinge my intent was that fs/ wouldn't load at all without a password

manic glacierBOT
#

Don't know where to leave this. I'm a 40 veteren and have shipped two commercial dev platforms (Symantec C++, Visual Cafe (also originally Symantec). More relevant, I'm polyglot programmer of libraries going back to C/C++ standard libraries. I've also worked on OSes (3). I am a busy CTO but have been looking for something important to do for CP. Check out https://www.linkedin.com/in/richsadowsky/

and write to me at rich@waverleysoftware.com. That reaches me fastest

slender iron
#

1 more esp32 check...

jaunty juniper
#

oh @idle owl a note about learn guides: while responding to support questions, I noticed that there are a few featherwing guides that have list of pins like this:
https://learn.adafruit.com/adafruit-adalogger-featherwing/pinouts

The SDCS pin is the chip select line.
    On ESP8266, the SD CS pin is on GPIO 15
    On ESP32 it's GPIO 33
    On WICED it's GPIO PB5
    On the nRF52832 it's GPIO 11
    On Atmel M0, M4, 328p or 32u4 it's on GPIO 10
    On Teensy 3.x it's on GPIO 10

They should probably be updated for new boards like RP2040, ESP32Sx feathers, TFT and such (most of which use the same pinout as the M4, so maybe put that upfront) and mention the CP pin name (like board.D10 in this example) or something

idle owl
jaunty juniper
#

will do

manic glacierBOT
onyx hinge
slender iron
#

Ya, we can tweak it all. Just takes more firmware space. πŸ™‚

onyx hinge
#

yep

manic glacierBOT
#

I wrote a long detailed history of why I am qualified to do this. I will send it, but you can probably see it yourself. Also you probably know me as RichSad on Adafruit Discord.

reach me at rich@waverleysoftware.com is more efficient than the email this github is connected to.
My demographics:
Rich Sadowsky
Sturbridge, MA
https://www.linkedin.com/in/richsadowsky/
Full time job: Chief Technology Officer at WaverleySoftware.com. Waverley was the company that build many things for me at ...

pulsar bloom
#

cb@speedy:~/circuitpython/ports/espressif$ make BOARD=adafruit_feather_esp32s2_tft
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
Traceback (most recent call last):
File "../../tools/gen_web_workflow_static.py", line 7, in <module>
import minify_html
ModuleNotFoundError: No module named 'minify_html'

#

Trying to build the latest

manic glacierBOT
jaunty juniper
manic glacierBOT
pulsar bloom
#

Thanks, builds now!

manic glacierBOT
pulsar bloom
#

cool repl in one tab file browser in anotherπŸ˜€

manic glacierBOT
#

I rebuilt after @tannewt 's last force-push and getting the same results. I'm not sure it's of any value but I grabbed the debug output as I was testing and commented along the way. It turns out slowing the process down in order to record it apparently avoided the board crash. Once I decided I had enough, I went ahead and started pressing Ctrl-D in the Repl without waiting as long between reboots and before long hit the same num_triggered >= 0 from line 91 of socket.c crash again.

In any c...

manic glacierBOT
#
manic glacierBOT
warm stump
midnight ember
#

Was told by tannewt to post here for help in adding a flash chip definition for the nrf52840 feather bluefruit sense. https://github.com/adafruit/circuitpython/tree/9d5b04ebc49193afab8efba4fb31c33ac1c81f5d/ports/nrf/boards/feather_bluefruit_sense I'm going to attempt to drop in a bigger QSPI flash chip (16MB). https://www.digikey.com/en/products/detail/cypress-semiconductor-corp/S25FL128LAGMFM010/7322845 I checked the datasheet and far as I can tell it appears to be drop in compatible. It hasn't arrived from digikey yet and I'm pretty excited to get started before it arrives. I can do a PR but unsure where to start. Should I fork the main Adafruit/circuitpython or something deeper like /ports/nrf/boards? Where should my fork start? My experience with contributing on GIT is almost non-existent.

GitHub

CircuitPython - a Python implementation for teaching coding with microcontrollers - circuitpython/ports/nrf/boards/feather_bluefruit_sense at 9d5b04ebc49193afab8efba4fb31c33ac1c81f5d Β· adafruit/cir...

idle wharf
#

@midnight ember have you been through the building CP learn guide?

#

I don’t consider myself a developer and with the excellent docs from the CP team I’ve been able to make contributions, like adding new boards.

#

I am sure you can do it. Ask questions as you go. Community here is great!

midnight ember
#

first time i'm seeing that, probably because i don't do much with ESP... yet (I have 2 S3's on the way). thank you. πŸ™‚

idle wharf
#

There’s another learn guide on adding boards as well. You’re instinct is correct, copy a similar board and start with that.

midnight ember
#

documentation looks good, i've never worked with toml before. i forsee pip installs in my future.

#

current ones are much shorter S25FL216K.toml vs the one i'm getting S25FL128LAGMFM010

#

EXTERNAL_FLASH_DEVICES = "S25FL116K, S25FL216K, S25FL128LAGMFM010, GD25Q16C" no way, is it really going to be as easy as putting a comma and chip id? that's too easy, there's gotta be some catch.

midnight ember
#

created a fork of adafruit/circuitpython and it's showing me this message
Your main branch isn't protected
Protect this branch from force pushing, deletion, or require status checks before merging.

#

should i click on protect now or just ignore it?

#

i have no other contributors in my personal repo so don't think i have to worry about it, just double checking.

spiral elk
midnight ember
#

it's not there, i added that part to the line

spiral elk
#

Then you need to stare at datasheets and make new entries most likely

midnight ember
#

yep, prepared for that.. tomorrow. it's late.

#

or early, i haven't been to sleep yet. lots of research to do πŸ™‚

spiral elk
#

Often similar parts are fine, GD25Q16C also worked for me for GD25Q32 parts

#

i.e. the chinese pico clones with 4MB of flash.

manic glacierBOT
manic glacierBOT
radiant trench
#

@slender iron I was just watching Show and Tell. I've been looking for a way to get more involved in CircuitPython but I'm not much of a Python developer. That said I do have a lot of experience with CSS. Scott, would you at all be interested in letting me collaborate on the web workflow stuff you're doing by providing some super minimal CSS that you could include to jazz up the interface a little?

radiant trench
#

(btw by "Jazz it up" I mean, make it more readable and usable than the browser defaults) πŸ˜‰

manic glacierBOT
#

The pins C14 and C15 work both in the input and output direction with digitalio (on boards where there's no crystal at those pins).

But as described above, using those pins in keypad causes the entire keypad to not detect any events, even for all other pins.

What might be causing keypad to fail even if digitalio works? Does CircuitPython associate some additional properites/variables to pins, causing pins C14 and C15 to behave differently from other pins in the context of keypad?

manic glacierBOT
#

CircuitPython version

7.3.1 / 8.0

Code/REPL

python -m esptool --chip esp32c3 --port COM30 --baud 115200 --before default_reset --after hard_reset --no-stub write_flash 0x0 c:\temp\adafruit-circuitpython-adafruit_qtpy_esp32c3-en_US-7.3.1.bin

Behavior

After install and reboot, I get a welcome message in Thonny in the Shell output window exactly one time, but no interactive >> prompt in the shell. Also, no USB drive is mounted. (May also be a Thon...

manic glacierBOT
#

The QTPY ESP32-C3 has built-in USB-to-Serial, but not native USB - it cannot act as a keyboard or disk drive. Microcontroller's without native USB have not gotten much attention from CircuitPython up until now because they couldn't mount the CIRCUITPY drive. However, now that the BLE and Web workflow is starting to be available these chips may get more development attention.

Your issue is probably the same as #6220

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-alpha.1 on 2022-06-09; Raspberry Pi Pico with rp2040

Code/REPL

import array
import board
import rp2pio

program = array.array("H", [0x4001]) #in pins 1

sm = rp2pio.StateMachine(
	program,
	frequency=1_000_000,
	first_in_pin=board.GP1,
	auto_push=True,
)

Behavior

Traceback (most recent call last):
  File "code.py", line 10, in 
ValueError: init length must be 2-64

Desc...

slender iron
# radiant trench (btw by "Jazz it up" I mean, make it more readable and usable than the browser d...

I'd love help! The challenge is doing it without increasing the file sizes much. They are here: https://github.com/adafruit/circuitpython/tree/main/supervisor/shared/web_workflow/static Most should be workable from your desktop and communicating with a local device

GitHub

CircuitPython - a Python implementation for teaching coding with microcontrollers - circuitpython/supervisor/shared/web_workflow/static at main Β· adafruit/circuitpython

radiant trench
#

So I guess I can just do a pull request or something with my changes?

#

Don’t suppose it would be acceptable to assume the user has internet and pull the css from a cdn?

slender iron
#

my goal is to not assume internet however if it works ok without I think we could have a supplement css for online

#

ya, PR is great and I can help you get testing

#

right now the files are gzipped. html and js is minified using some python libraries

#

I'll be back in 20 or so. gotta change a diaper

manic glacierBOT
manic glacierBOT
#

I'm not sure where the changes to ulab and pew-pew-lcd submodules came from. Nor a bunch of the differences in the translations file.

It looks like it may have been mismerged. git merge won't update submodules so if you git add them your commit, they'll change back. You can probably git checkout these files and checkout the correct commit in the submodules and then git commit --amend to correct the merge commit. Happy to help more on Discord.

slender iron
#

@wraith crow you around?

wraith crow
#

Sort of, taking a break by the pool at the moment

slender iron
#

kk, what board are you testing on? I can make you a build with more debug prints

#

and you can try it when you have time

wraith crow
#

I've been using the unexpected maker feather us too but I also have an adafuit ESP 32s2 and an S3 dev kit

slender iron
#

kk

wraith crow
#

Um feather s2, 😁 voice transcription didn't get that very.well

slender iron
#

I understood πŸ™‚

#

πŸ₯— time for me

manic glacierBOT
onyx hinge
#

aha thonny can "show hidden files", I just didn't look in the correct place at first. There's a hamburger menu in the "open from circuitpython device" dialog, and that's where you can do it... and it seems to be remembered, at least in the session. yay, now I can edit .env easily.

jaunty juniper
#

how would I debug print an int ? I've been using serial_write like a savage

slender iron
onyx hinge
#

What is a 'station'? that is, what does start/stop station method on wifi.radio do? Is there a way to undo wifi.radio.connect without soft-resetting?

jaunty juniper
#

I wonder what they do too, I believe a station is the term for the "client" side that connects to an access point, Micropython has network.STA_IF and network.AP_IF

sta_if = network.WLAN(network.STA_IF)
if not sta_if.isconnected():
    sta_if.connect('<your SSID>', '<your key>')
#

I know of switching wifi.radio.enabled to force a disconnect I think ?

wraith crow
#

@slender iron So the behavior starts out the same, no DEBUG messages, nothing on Dev Tools Console, Network tab shows pending connection to 10.0.0.187
If I connect via the USB serial port, the Auto-reload message is waiting for me with a message to press any key to enter the REPL.
Pressing enter causes the following on the DEBUG console:

I (186319) CP socket: opened 57
I (186319) CP webserver: Request GET /
I (186319) CP webserver: Header Host 10.0.0.187
I (186319) CP webserver: Header Connection keep-alive
I (186319) CP webserver: Header DNT 1
I (186329) CP webserver: Header Upgrade-Insecure-Requests 1
I (186339) CP webserver: Header User-Agent Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KH
I (186349) CP webserver: Header Accept text/html,application/xhtml+xml,application/xml;q=0.9,image/avi
I (186359) CP webserver: Header Accept-Encoding gzip, deflate
I (186359) CP webserver: Header Accept-Language en-US,en;q=0.9

The browser displays the welcome screen with no fields filled in, Still nothing on the dev tools console, the network tab shows:

slender iron
#

The two pending are sockets waiting to be accepted

manic glacierBOT
#

What kind of quirk for example? How can this be fixed? Note that using pins C14 and C15 in keypad.KeyMatrix() stops keypad from working for other pins as well. So maybe keypad uses some variables/constants that are associated with pins C14 and C15 while setting up some global settings. What variables/constants are associated with pins?

What apart from never_reset_pin_number() (which I commented out [here](https://github.com/adafruit/circuitpython/blob/main/ports/stm/peripherals/stm...

wraith crow
#

Pressing Ctrl-D on the repl at that point kicks out the following DEBUG messages:

I (544469) CP socket: opened 58
I (544469) CP socket: closed 57
I (544469) CP webserver: Request GET /favicon.ico
I (544469) CP webserver: Header Host 10.0.0.187
I (544469) CP webserver: Header Connection keep-alive
I (544479) CP webserver: Header User-Agent Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KH
I (544489) CP webserver: Header DNT 1
I (544499) CP webserver: Header Accept image/avif,image/webp,image/apng,image/svg+xml,image/,/*;q=0.
I (544499) CP webserver: Header Referer http://10.0.0.187/
I (544509) CP webserver: Header Accept-Encoding gzip, deflate
I (544519) CP webserver: Header Accept-Language en-US,en;q=0.9

Still nothing on the dev tools console, the network tab shows the favicon.ico download complete, still pending on welcome.js

midnight ember
#

using a similar part won't work in my case because there's no 16MB chips listed for cypress in the nrf52/bluefruit sense. i don't think there are any boards for nrf52 with that sized chip. i know it exists for the teensy and some espressif boards. i can use another cypress chip as an example and resize the flash parameter hopefully.

wraith crow
#

Pressing Enter at the new REPL press any key prompt results in:

I (718779) CP socket: opened 57
I (718779) CP socket: closed 58
I (718779) CP webserver: Request GET /welcome.js
I (718779) CP webserver: Header Host 10.0.0.187
I (718779) CP webserver: Header Connection keep-alive
I (718789) CP webserver: Header User-Agent Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KH
I (718799) CP webserver: Header DNT 1
I (718799) CP webserver: Header Accept /
I (718809) CP webserver: Header Referer http://10.0.0.187/
I (718819) CP webserver: Header Accept-Encoding gzip, deflate
I (718819) CP webserver: Header Accept-Language en-US,en;q=0.9

and:

manic glacierBOT
slender iron
#

@wraith crow ok, seems like the select task isn't going

#

finds an S2

onyx hinge
#

Possibly a red herring but out of ESP32, -S2 and -S3 isn't S2 the one with just one core?

manic glacierBOT
#

CircuitPython version

main branch

Code/REPL

No code was run

Behavior

Did not run any code.

Description

I get an error when trying to install the requirements-dev.txt

Encountered error while trying to install package.
╰─> RPi.GPIO
ERROR: Couldn't install package: adafruit-circuitpython-typing

Logs below:

 Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
 Collecting adafruit-circuitpython-typin...
#

.. this makes reconnecting without a full reset not work. The user initiated wifi flag is now used to track whether import wifi needs to re-enable the wifi interface.

Because this works on other generations of the esp32 (c2, c3, etc), apply this behavior only to esp32.

After this change, it's possible to connect multiple times to wifi in different runs of code.py or the repl after soft rebooting.

Testing procedure: Connect with Thonny. Put wifi deets in .env on device (to open t...

#

The summary so far:

slender iron
#

@onyx hinge c3 is single too iirc. I was going that route too. S2 failed quickly in mdns code for me. So I’ll try and take a look at that once I’m back to my desk

onyx hinge
#

ah ok

slender iron
#

Ari has an eye doc appointment now so it’s a busy day

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-alpha.1-31-gc1b00442a on 2022-07-02; stm32f411ce-blackpill with STM32F411CE

Code/REPL

import board, keypad

key_matrix = keypad.KeyMatrix(
    row_pins=(board.A0, board.A1, board.A2, board.A5, board.A7, board.A8, board.B8, board.B9, board.C13, board.C14, board.C15, ),
    column_pins=(board.B14, board.B12, board.B10, board.B1, board.B0, board.A4, board.A3, ),
)

while True:
    event = key_matrix.ev...
tidal kiln
#

@onyx hinge fwiw. decent cheat sheet.

manic glacierBOT
#

Commenting out never_reset_pin_number(0, 10); claim_pin(0, 10); or only never_reset_pin_number(0, 10); at https://github.com/adafruit/circuitpython/blob/main/ports/stm/supervisor/usb.c#L125-L126 causes the device to appear as "Unknown USB Device (Device Descriptor Request Failed)" in Device Manager in Windows 10, without REPL connection, without CIRCUITPY drive.

Why is that? How does never_reset_pin_number(0, 10); affect things that happen at that pin before my code gets executed? ...

slender iron
#

is back

slender iron
#

love it when debug prints fix an issue

onyx hinge
#

huh I just noticed the IP address shows as blank ..

#

version.json has ip: ""

#

this probably happens if the terminal title is disabled

manic glacierBOT
#

Just another observation of the behavior on the S2 chips, If I'm patient, I am sometimes able to coax the serial terminal into working. Once it connects and starts mirroring the REPL it seems to keep working and doesn't suffer the any disconnects or web loading delays. Oddly, just using the serial terminal seems to allow the other web workflow pages to work on the lilygo ESP32-S2, but not on the UM Feathers2. I am using slightly different CP builds on those two devices, The UM is running Sco...

midnight ember
#

i don't see a way to easily append a bigger chip to mpconfigboard.h #define CIRCUITPY_INTERNAL_NVM_SIZE (4096) if i change that value then i'd have to create a new board, was hoping to avoid that and just get a bigger flash chip supported. am i going to have to make my own board to add a bigger flash chip and if so what should i name it?

jaunty juniper
#

hmmm the nvm size would be the size of the nvm, not the external flash (microcontroller.nvm)

midnight ember
#

oh oops. ok then this one #define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE)? trying to change the size of the spi flash. didn't realize nvm was different than external flash.

#

i'm guessing nvm is internal to the nrf52840 chip?

midnight ember
#
# Settings for the Cypress (was Spansion) S25FL128L 16MB SPI flash.
# Datasheet: https://www.infineon.com/dgdl/Infineon-S25FL256L_S25FL128L_256-MB_(32-MB)_128-MB_(16-MB)_3.0_V_FL-L_FLASH_MEMORY-DataSheet-v09_00-EN.pdf?fileId=8ac78c8c7d0d8da4017d0ed40e335224

total_size = 0x200000 # 2 MiB
start_up_time_us = 10000
memory_type = 0x40
capacity = 0x15
max_clock_speed_mhz = 133
6b_quad_read = true
32_qspi_write = true``` I've found and changed the max clock speed but the rest is a mystery to me. I don't understand the MiB conversion. Can't find anything mentioning startup time, no clue what the memory or capacity should be in hex.
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.3.1 on 2022-06-22; Seeed XIAO nRF52840 Sense with nRF52840

Code/REPL

import time
import array
import math
import board
import audiobusio


# Remove DC bias before computing RMS.
def mean(values):
    return sum(values) / len(values)


def normalized_rms(values):
    minbuf = int(mean(values))
    samples_sum = sum(
        float(sample - minbuf) * (sample - minbuf)
        for sample in values
...
dusk mauve
#

I haven't run an espressif port build in a few months on my dev box... Is there anything I need to do other than a git pull? Like does the esp-idf in the ports dir need to be updated or anything?

blissful pollen
#

you make need a make fetch-submodule (or similar I may have that wrong) as I think the IDF was updated at somepoint. And then to run the install.sh script again. I think that's what I had to do

dusk mauve