#circuitpython-dev

1 messages · Page 36 of 1

brazen hatch
#
>>> scan(1)
{'Forthnet-5DbGR_EXT': ['Unknown', -75], 'KeyFalse': ['WPA', -46], 'COSMOTE-403528': ['Unknown', -86], 'WIND_2.4G_650701': ['Unknown', -81], 'Feline34': ['WPA', -78]}
>>>
lone axle
#

I used -j successfully for a while but stopped when I started having weird issues building and just haven't returned to using it. Though I have seen others report issues different from what I was experiencing

#

do you have to pass a number to scan?

brazen hatch
#

my scan function expected a self thingy, but it's unused, so passed junk

lone axle
#

is there a "most simple version" of wifi scanning somewhere?

brazen hatch
#

Ljinux.

# iwctl
[iwd]> station wifi scan
[iwd]> station wifi get-networks
lone axle
#

ah I think I deleted that (the self). but since you all are getting different results I'm paranoid that I messed it up

#

I mean even more basic

#

like the scan by itself in a basic wifi learn guide or something.

#

or docs for the wifi module perhaps?

lone axle
brazen hatch
#

ljinux

crimson ferry
brazen hatch
opaque kelp
#

Hi

I am using your library to connect VL53L1x to an ESP32

After connecting the sensor to the ESP32 I upload your library with no error message, but I can't get any measurements.

I am connecting the SDA to GPO21 and the SCL to GPO22 and of course the V5 and the GND

I can't figure out what is wrong. Do I have to declare the IC2 different in your library?

Can you please give me some advise

lone axle
#

I'm not familiar with it, but It looks interesting. I'll have to learn a bit more about it. For now I'm trying to eliminate as many layers and variables as I can.

This is very odd. With the scanning script that anecdata posted I am also seeing consistently just the one network that isn't mine.

crimson ferry
lone axle
#

Kind of random.. but I don't know beyond shots in the dark at this point. Could the DBG pin being connected to an FTDI cable somehow interrupt or influence the scan?

crimson ferry
#

@opaque kelp best to post your code, and the full text of any exceptions

lone axle
#

or a feather tripler, or neopixel featherwing? I'll try to remove those shortly.

brazen hatch
#

Let me try to load debug on my s3 tft too.

#

The other board is unaffected.

opaque kelp
#

@crimson ferry thank you

crimson ferry
#

it's conceivable something is interfering hardware-wise, but why it works in non-debug and not in debug with all other things equal is... odd

brazen hatch
#

Yea, but just on s2 tft?

crimson ferry
#

I'll build specifically for S2 TFT

lone axle
#

s2 tft is the only one I've tried so far. But I do have an s3 I could try albeing need to solder pins.

I do have 2 S2s as well so if I'm still geting weirdness eventually I'll get one in debug and one in normal at the same time to compare directly.

crimson ferry
#

oh -j 2 works, but not -j 8

#

no soldering needed just to load a debug build (and scan)

brazen hatch
brazen hatch
crimson ferry
#

but DEBUG...

brazen hatch
#

Something to do with DEBUG and the networks.

#

too little flash
ahhhhhh

lone axle
#

It's related specifically to the DBG pin being connected to FTDI

#

I closed the tio connection to the FTDI, the issue remained.... I unplugged the FTDI connection with the scan loop still running and now it sees more networks.

#

including the real ones that I am trying to use

brazen hatch
#

wot

#

Wait, how do we use that pin exactly? Is it not just a serial tx pin?

lone axle
#

Both FTDI and the Feather were plugged in to the same USB Hub. I'll try to move cables around and determine if the hub is part of the problem, or perhaps just not enough power on that USB controller or whatever (electricity also mostly magic to me still)

lone axle
#

If you can make it hard crash with everything set up you'll get an encoded stacktrace that you can decode using a tool in the core repo.

brazen hatch
#

I can reproduce it, by just hooking it up to my pi400's gpio.
It can do serial & jtag from it's gpio

brazen hatch
lone axle
#

it is bizarre that it is so good at finding the 1 network that isn't mine when all of that is plugged in.

brazen hatch
#
CIRCUITPY_ULAB = 0
CIRCUITPY_AUDIOBUSIO = 0
CIRCUITPY_AUDIOBUSIO_I2SOUT = 0
CIRCUITPY_AUDIOBUSIO_PDMIN = 0
CIRCUITPY_AUDIOCORE = 0
CIRCUITPY_AUDIOIO = 0
CIRCUITPY_AUDIOMIXER = 0
CIRCUITPY_AUDIOMP3 = 0
CIRCUITPY_PS2IO = 0
CIRCUITPY_ANALOGBUFIO = 0
CIRCUITPY_RGBMATRIX = 0

for s3 tft

lone axle
#

I think specifically the 3.3V connection is the problem. I've moved the FTDI usb to another port on a different part of the tower. At first I still had the same issue (only see the 1 network that isn't mine.

I unplugged the FTDI power <-> 3.3V connection and now I see the more full list including my networks.

#

Maybe I just never should have been connecting power on the FTDI to the feather? Tio seems to work without that to read data from the DBG pin.

crimson ferry
#

now my S2 TFT is hosed... I get the RGB bootloader screen, but drop a UF2 and can't get out of FTHRS2BOOT

lone axle
#

I have found myself in that scenario a few times, and a few more than I care to admit were copying wrong UF2. Triple check that the one you're copying is what you expect.

crimson ferry
#

yeah, I've done the same, but it's def an S2 TFT (not reverse), and the UF2 is right, I probably need to erase flash and start over

brazen hatch
#

even for rp2, power it via usb, and the only connect tx, rx, gnd

#

gnd is required cause there will be a voltage difference.

#

got debug on s3 tft, it works alright.
hopping onto pi400 now

lone axle
# brazen hatch Is it drawing too much current? Or is it providing power? The general idea is we...

Honestly I couldn't say for sure. I have only a very loose understanding of the electrical side of things. The software side is where I am more experienced.

The power pin can power the feather when I had it connected that way. i.e. I can have the ftdi plugged in with those 3 pins and the feathers main USB unplugged, but it will still be powered on.

That doesn't strike me as particularly "good" because AFAIK the 3v pins are meant to be outputs from the feather's perspective. But it hasn't seemed to cause any damage that I can tell so maybe it's okay?

brazen hatch
#

perhaps your ftdi dongle can’t provide the power required

lone axle
#

It doesn't seem necessary at least though. Now that I have the power pin disconnected, everything else appears to be working as intended (including the wifi scan)

brazen hatch
#

a tft feather alone draws 0.11 amps at 5V

lone axle
#

Thank you to both of you for helping me figure it out and trying out on your end. blinka_heart_circle

brazen hatch
lone axle
#

Neat. Is that like a USB power pass-through multi-meter ish thing?

brazen hatch
#

yes
it’s like 3€
can’t expect it to be accurate, but yea

#

it’s just very bulky

#

as to why debug does cause this, I have no idea still

lone axle
#

I definitely know the root technical cause. But I do think generally the power coming from the FTDI is "interrupting" it's ability to complete a good scan.

I don't know how the power circuit works or if it switches back and forth between the FTDI and the USB when I hotplug or unplug. The device kept running, so it can do this quick enough to stay alive if so.

I wouldn't be surprised if your guess about the FTDI not providing enough current is correct. So when it's driven by that source it can't complete a full successful scan for whatever reason.

Or if it doesn't really switch sources like that I could see it being the case that having power coming in from both the FTDI and the regular USB were "not playing nicely" together.

brazen hatch
#

having 2 ‘sources’ is a really bad thing
If there is even a slight voltage differential (3.30V vs 3.33V) it could mean a lot of heat and power loss.

lone axle
#

I'll unplug the red jumper from the FTDI so I don't forget. I haven't done debugging at this level frequently enough to recall the process fully each time. I should record a video showing the process even if just for myself to refer back to. Maybe that would help others too.

#

Whats the easiest / safest way to force a hardfault in the core? could I add divide by zero or some other such basic error somewhere to force one in order to capture for illustration purposes?

brazen hatch
tulip sleet
tulip sleet
lone axle
#

Thank you.

brazen hatch
#

Tried compiling picow on arch-latest

In file included from /home/bill88t/git/circuitpython/ports/raspberrypi/sdk/tools/pioasm/pio_disassembler.cpp:10:
/home/bill88t/git/circuitpython/ports/raspberrypi/sdk/tools/pioasm/pio_disassembler.h:16:25: error: ‘uint16_t’ was not declared in this scope
   16 | std::string disassemble(uint16_t inst, uint sideset_bits, bool sideset_opt);
      |                         ^~~~~~~~
/home/bill88t/git/circuitpython/ports/raspberrypi/sdk/tools/pioasm/pio_disassembler.h:1:1: note: ‘uint16_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
  +++ |+#include <cstdint>
    1 | /*
#

Am I doing something wrong, or do we have a gcc change?

#

I haven't touched picow in quite a while now.

crimson ferry
brazen hatch
#

Ah

brazen hatch
crimson ferry
#

yeah, but then I also can't do much -j either

brazen hatch
#

I should make a circuitpython-builder docker container.

#

That has the exact build-env premade, and only needs a repo bind.

orchid basinBOT
manic glacierBOT
modern wing
#

Good afternoon y'all -- happily lurking today.

tulip sleet
#

meeting starting shortly - just finished internal meeting

manic glacierBOT
#

Yes, I agree there must be some issues with vscode-circuitpython. But I am just curious why that serial monitor only works with verson 8.0.5.

I tried putty again but this time it stucks, displaying nothing at all and no responding to any keyboard input. I connected with correct COM port and BAUD rate 115200. There is some information on the top bar of the window.
20230516015810

lone axle
brazen hatch
#

300 boards wasn't even that long ago..

midnight ember
lone axle
turbid radish
#

Pasadena is a nice place

lone axle
#
Amazon Web Services

Introduction Customers ask how they can get started with AWS IoT using the devices and languages they are familiar with. To help address this need, AWS has published tutorials such as connecting a Raspberry Pi and creating a virtual device with Amazon EC2 in the AWS IoT Core Developer Guide. This blog walks you through […]

midnight ember
turbid radish
#

Twitter is better than Mastodon

#

for tagging

slender iron
#

gah, wrong input. should work next time I need to speak

brazen hatch
midnight ember
#

Woah that went up by 19 boards this week. Very nice!

gilded cradle
#

5 new ones last week and 14 this week

brazen hatch
#

ChatGPT == Spicy autocorrect
Do not forget that.

turbid radish
#

Bravo to Melissa on board updates

gilded cradle
#

No worries. @lone axle. I originally wrote the marquee and had a bug related to the dots sitting there for a while.

midnight ember
#

yey for more silly projects!

idle owl
#

This one is ultra silly.

midnight ember
#

the more ridiculous the better!

idle owl
# midnight ember the more ridiculous the better!

Basically, it's a 5.7" 7-color eink display on a board, that you put in a waterproof container where you can see the display, put it on a tombstone, and then code it so visitors can leave memes for you after you're dead. 🤣

midnight ember
#

that's not silly at all, that's amazing ❤️

ember iris
#

Oh I love that!

idle owl
#

That was to fix all the new Pylint and Black errors!

turbid radish
#

Yup

midnight ember
#

Non-blocking ht16k33 examples will be a welcome sight

#

Synthio ❤️

#

Did you ever figure out how to play the Enterprise game?

onyx hinge
#
  1. A tiny disco ball: Hidden under the yellow rectangle is a 2x2" disco ball, ready to bring the party to your Arduino projects. Watch as your microcontroller board lights up with sparkly reflections and groovy tunes.
  2. A secret compartment for snacks: Arduino knows that coding can be hungry work, so they've included a hidden compartment under the yellow rectangle to store your favorite snacks. Never worry about low energy levels during your programming sessions again!
  3. A miniature catapult: Who needs conventional ways to launch objects when you have an Arduino microcontroller board? Underneath that yellow rectangle lies a mini catapult, perfect for launching small projectiles across the room. Be careful where you aim!
  4. A built-in karaoke machine: Arduino understands the importance of combining coding with fun, so they've hidden a karaoke machine beneath the rectangle. Sing your heart out while your microcontroller board hums along to your favorite tunes.
  5. An embedded bubble blower: Get ready for some whimsical coding sessions! The yellow rectangle conceals a bubble blower that will fill your workspace with a flurry of bubbles every time your microcontroller board runs a program successfully.
  6. A teleportation module: Unleash the power of science fiction! Beneath that yellow rectangle lies a top-secret teleportation module that can instantly transport your microcontroller board to any location in the universe. Ready for some intergalactic coding adventures?
  7. A popcorn dispenser: No movie night is complete without popcorn, and Arduino knows it. Hidden under the yellow rectangle is a popcorn dispenser that pops a fresh batch of popcorn every time your microcontroller board completes an operation.
  8. A mini weather station: Get real-time weather updates right on your Arduino microcontroller board. Underneath that yellow rectangle is a hidden weather station that predicts everything from rainbows to snowstorms, all in a compact form factor.
  9. A built-in confetti cannon: Celebrate your coding victories in style! The yellow rectangle obscures a confetti cannon that explodes with colorful confetti whenever your microcontroller board successfully executes a program. Bring on the party vibes!
  10. A coffee-making module: Arduino understands the need for caffeine during long coding sessions. Concealed beneath the yellow rectangle is a coffee-making module that can brew your favorite java with just a few lines of code. Now you can stay energized while you code!
idle owl
#

I can't ever remember: Where do I get the build assets from a PR on GitHub?

onyx hinge
#

@idle owl find the "checks" tab on the PR, then click "build ci", then scroll down

midnight ember
#

Is there an issue on it with the code? I have a QT PY S2 can test with.

onyx hinge
#

@midnight ember seemed like the s2 was just less reliable, with intermittent socket errors that weren't seen on the s3

idle owl
midnight ember
#

ok socket errors are over my head, i can only confirm how it fails as a beta test.

onyx hinge
#

belated hug report for scott picking up and running with an idea I mentioned off-hand months ago (the json thing)

idle owl
#

Means I don't have to 😄

midnight ember
#

having another set of eyes never hurts.

idle owl
#

It involves a NeoPixel 5x5 LED BFF, but you can fill in the LED changes with prints so you know it's happening, and not actually put a BFF on it.

lone axle
#

I had to do some JSON streamed parsing in CPython for loading multi-gigabyte JSON files into a database recently.

idle owl
#

That wasn't what was failing anyway.

tulip sleet
#

was it multiple pings in quick succession?

idle owl
idle owl
midnight ember
#

yes, i don't have the 5x5 though, just give me a script to test and will do

onyx hinge
#

@tulip sleet I think we'd chased down and banished all the "starts pinging as often as possible" bugs and kattni was still seeing errors on the s2 that went away on the s3. to my knowledge, both of those boards have "ping too fast" problems, it's a general problem with the espressif ping implementation.

midnight ember
#

Nice work on adding all the new boards Melissa. 🎉

onyx hinge
#

however it occurs to me that since the "ping too often" problem is about resources in use, it could just be a RAM amount difference between S2 and S3?

#

idk

idle owl
#

Ping code works alone though.

slender iron
modern wing
#

Thanks!

errant grail
#

Thanks!

midnight ember
#

Thank you for hosting @tulip sleet

onyx hinge
#

should have called it ijklm, iterative json key loader module

slender iron
idle owl
#

Let me know if you have any questions, it's mostly commented though.

manic glacierBOT
#

I've managed to reproduce what I think may be the same error as this with a minimal HTTPServer test and capture the backtrace from it.

Here is the decoded backtrace:

❯ python tools/decode_backtrace.py adafruit_feather_esp32s2_tft
adafruit_feather_esp32s2_tft
? 0x4009a033:0x3ffdca00 0x4009d3bc:0x3ffdca20 0x3ffdca4d:0x3ffdca50 |<-CORRUPTED
0x4009a033: mp_obj_is_subclass_fast at /home/timc/repos/circuitpython/circuitpython/ports/espressif/../../py/objtype.c:1435
0x4009d3bc: mp_execu...
tulip sleet
#

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/1sH6HBDsm_YgHLivi139diXzgmZpUEelixI6saqFGOvA/edit?usp=sharing

brazen hatch
#

May I request the circuitpythonistas role?

manic glacierBOT
lone axle
brazen hatch
#

Thanks!

manic glacierBOT
orchid basinBOT
manic glacierBOT
midnight ember
#

@idle owl ```py
Adafruit CircuitPython 8.0.5 on 2023-03-31; Adafruit QT Py ESP32S2 with ESP32S2
Board ID:adafruit_qtpy_esp32s2

midnight ember
idle owl
#

You have to be running absolute latest CP

#

To not hardfault.

#

There's a fix for that at least.

#

Which should get you the same nonsense I was getting, but I am pretty sure what happened to you is exactly what was happening to me.

midnight ember
#

should i update to lastest and run it again or does this give you the info you need?

idle owl
#

I think this gives me what I need. There is definitely an issue that needs to be addressed.

brazen hatch
#

@onyx hinge Have you tested stopping the picowap since the sdk was updated?

onyx hinge
#

@brazen hatch no, I have been working on other areas like synthio

brazen hatch
#

Alright, I will check on it in the following days, thanks!

#

The code blob is left there, so it just has to be uncommented and tested.

onyx hinge
#

OK, cool!

#

appreciate it

orchid basinBOT
manic glacierBOT
#

I've managed to trigger this bug with this code

import displayio
import adafruit_displayio_sh1106
import time
import busio
import board

def setup():
    print("initialising i2c")
    i2c = busio.I2C(board.D8, board.D7)
    print("initialising bus")
    bus = displayio.I2CDisplay(i2c, device_address=0x3c)
    print("initialising display")
    disp = adafruit_displayio_sh1106.SH1106(bus, width=132,height=64)
    time.sleep(0.1)
    displayio.release_displays()
    i...
brazen hatch
#

The ap code still doesn't work, but micropy's does.
They moved the files, so I just have to find them.

manic glacierBOT
#

I've submitted a fix for this, and now my code works as expected:

code.py output:
loop 0
free: 140176
initialising i2c
initialising bus
initialising display
loop 1
free: 140144
initialising i2c
initialising bus
initialising display
loop 2
free: 140128
initialising i2c
initialising bus
initialising display
loop 3
free: 140112
initialising i2c
initialising bus
initialising display
loop 4
free: 140080
initialising i2c
initialising bus
initialising display
loop 5...
brazen hatch
#

bruh micropy's source is so convoluted.. I have been crawling it for the picowap code for 15 minutes.

manic glacierBOT
orchid basinBOT
#

Could we make a system to allow for name changes? Dan and I were talking about changing some older board names to include manufacturer. It'd be cool to redirect from the old name to the new and manages the download link based on version.

Not easily, but probably. The Liquid language that Jekyll uses generates static pages based on the info in the .md files. The pages that appear to be dynamic such as the unknown page and the installer are done purely with JavaScript. To have it deal with...

manic glacierBOT
manic glacierBOT
#

This switches from hard coded tremolo/vibrato, to allowing much more control via nestable LFOs.

The new LFO object's API is like so:

class LFO:
    """A low-frequency oscillator

    Every `rate` seconds, the output of the LFO cycles through its `waveform`.
    The output at any particular moment is ``waveform[idx] * scale + offset``.

    `rate`, `offset`, `scale`, and `once` can be changed at run-time.

    An LFO only updates if it is actually associated with a playing N...
orchid basinBOT
brazen hatch
#

MicroPython seems to have it figured out entirely, I can open and close the ap just fine in it, but I can't find the source file.

#

I am giving up for now, I will look at it later.

manic glacierBOT
#

Before this PR:

wifi.radio.start_ap() will fail with RuntimeError: Wifi is in station mode. if it immediately follows wifi.radio.stop_station(). about 10% of the time.

(re-verified the issue using current build)

With this PR:

Adafruit CircuitPython 8.1.0-beta.2-32-g3ff7fa5d8 on 2023-05-15; Raspberry Pi Pico W with rp2040

Example code from the issue has been running successfully for >125 iterations. LGTM, thanks!

#

I will use line numbers from the original source code
gc_never_free will crash the fourth time it is called.

  • First time it is called the permanent_pointers item of mp_state is set to null.
    The while block on line 1017 is skipped and next_block is allocated - a set of four pointers
    The if statement on line 1029 evaluates as true and line 1030 executes, correctly storing the address of next_block in permanent_pointers
    the pointer passed into the function is stored in in...
manic glacierBOT
#

For the RP2040, this sounds like a support problem. Could you open a thread in https://forums.adafruit.com/viewforum.php?f=60 ? Include the simplest program that causes the error -- it sounds like either the firmware on the AirLift is out of date or there is a wiring problem or a pin setup problem.

Also in the support thread we can discuss the Espressif issue: it turns out getting AirLift _bleio working on Espressif is not so easy.

manic glacierBOT
#

Before this PR:

wifi.radio.start_ap() will fail with RuntimeError: Wifi is in station mode. if it immediately follows wifi.radio.stop_station(). about 10% of the time.

(re-verified the issue using current build)

With this PR:
Adafruit CircuitPython 8.1.0-beta.2-32-g3ff7fa5d8 on 2023-05-15; Raspberry Pi Pico W with rp2040
Example code from the issue has been running successfully for >500 iterations. LGTM, thanks!

#

@dhalbert speeding up the requests does not seem to appreciably speed up the hard fault occurrence. After your comment I started this running again with only a 1 second interval (10x faster than before) I'm not sure if it's actually keeping at 1 request per second exact, but it's up to 4718 completed requests already and no hard fault. I'll try to let it keep running until it does to see if there is anything different that can be gleaned from it's backtrace

manic glacierBOT
manic glacierBOT
#

@bablokb just to chip in on this, the draft PR I raised for Yukon uses ATTRTUPLEs to achieve similar to the Keycodes idea @jepler suggested. https://github.com/ZodiusInfuser/circuitpython/blob/yukon/ports/raspberrypi/boards/pimoroni_yukon/pins.c

Here's the relevant parts if you wish to give it a try.

STATIC const qstr board_slot_fields[] = {
    MP_QSTR_ADC1_ADDR,
    MP_QSTR_ADC2_ADDR
};

STATIC MP_DEFINE_ATTRTUPLE(
    board_slot_obj,
    board_slot_fields,
    2,
    M...
manic glacierBOT
#

I left it running last night. It completed 8781 requests (at ~1 per sec) and then hard faulted sometime before the next one could be completed. Speeding up the requests does not seem to influence it to hard fault faster unfortunately.

The output on DBG pin and decoded backtrace are the same as before.

The decoded backtrace:

❯ python tools/decode_backtrace.py adafruit_feather_esp32s2_tft
adafruit_feather_esp32s2_tft
? 0x4009a033:0x3ffdca00 0x4009d3bc:0x3ffdca20 0x3ffdca4d:0x3ffdc...
manic glacierBOT
#

Enabling this is not simple, due to the way py/circuitpy_defns.mk. The Makefile logic there assumes that the port-specific implementation of a native module is in ports/*/common-hal/<themodule>. HCI _bleio is special-cased as being in devices/ble_hci/common-hal. But in Espressif, there is a native _bleio under ports. So the logic around SRC_PATTERN gets confused, and both sets of files get compiled, causing linking issues later.

SRC_PATTERN is also used to pick up `shared-bin...

#

It is unclear to me whether this is due to updating the ESP-IDF or due to some CircuitPython core change from 7.x.

I was thinking of trying to pick up the latest ESP-IDF v4.4 changes, because as usual there are wifi fixes (some of which are in non-open-source code). But it's somewhat painful to do that. And for CircuitPython 9.0.0, we are going to try to switch to ESP-IDF V5 anyway.

We could try instrumenting the socket code and the Python more thoroughly to narrow down where the proble...

brazen hatch
#

I am willing to have an esp board up 24/7 to test this.

#

I have way too many at this point.

#

And excluding h2 & c6, I have all the socs.

tulip sleet
onyx hinge
#

notices that CPU frequency doesn't reset on program exit
Hmm is that what we want?

#

@tulip sleet do you have an opinion if CPU frequency should reset to nominal when code.py exits?

tulip sleet
onyx hinge
#

in my quick test on rp2040, usb kept working

#
>>> microcontroller.cpu.frequency = 125000000
>>> t0 = time.monotonic_ns(); _=[mkfilter.brf(48000,4800,17,3600,27) for i in range(100)]; t1= time.monotonic_ns(); (t1-t0) / 1e9 / 100
0.0040625
>>> microcontroller.cpu.frequency = 180000000
>>> t0 = time.monotonic_ns(); _=[mkfilter.brf(48000,4800,17,3600,27) for i in range(100)]; t1= time.monotonic_ns(); (t1-t0) / 1e9 / 100
0.00282227
>>> microcontroller.cpu.frequency = 250000000
>>> t0 = time.monotonic_ns(); _=[mkfilter.brf(48000,4800,17,3600,27) for i in range(100)]; t1= time.monotonic_ns(); (t1-t0) / 1e9 / 100
0.00203125
```which was handy, as i wanted to benchmark a function at various clock speeds
#

I dunno about if it would affect enumeration, what I answered is different than what you asked.

tulip sleet
#

Making it sticky is not terrible, but it should be documented one way or the other. @slender iron might have a comment later, esp based on experience with other chips

onyx hinge
#

it does affect the frequency of a running PIO peripheral, I just tested that

tulip sleet
#

USB may be clocked by the host. But RP2040 USB host might end up being wrong

onyx hinge
#

yes there's a special "always 48MHz" clock in rp2040, clk_usb.

tulip sleet
onyx hinge
#

I think changing "cpu frequency" actually changes clk_sys.

#

and often a reason to change "cpu frequency" would be to clock pio faster so that's fine

#

I wonder if spi runs off clk_peri or clk_sys in CP

manic glacierBOT
slender iron
#

@onyx hinge @tulip sleet my assumption was that it'd be sticky

#

resetting it would be tricky with any spi or i2c for displays that stayed around

orchid basinBOT
manic glacierBOT
orchid basinBOT
ornate breach
#

I wonder if it could be modified to do MSC without taking up too much more space to free up some resources on the samd21 boards.

#

I know it doesn't solve RAM issues

slender iron
#

I doubt it. 8k is pretty small already

ornate breach
#

thought it was interesting at least. I'm making a samd11 board (not for circuitpython) and thought this was of maybe a little bit of interest.

slender iron
#

what are you doing with a samd11?

#

I think we've generally moved on from samd

ornate breach
#

I wanted to make a little pass through programmer, some really simple light control

#

tiny projects that don't do very much more than a single task

slender iron
#

👍 I've been eyeing the stm32g0 for that sort of thing

#

to program fpgas?

ornate breach
#

yeah

#

set some jumpers to swap between i2c/spi/jtag programming. might just keep it to spi and i2c

#

spi would have to be bitbanged on the samd11 though

#

well, not really but if I can't share ports.. anyway fun little project

slender iron
#

👍

tulip sleet
#

@slender iron @onyx hinge I wrote draft release notes for 8.1.0-rc.0. The only remaining 8.1.0 issues are the Esoressuf HTTP server crashes after a while. They are a regression from 7.x.x, not 8.0.x, and I think we could push them forward But they are mysterious.

tidal kiln
slender iron
manic glacierBOT
#

Do you folks have an intuition that #7459 and #7582 are the same issue?

It does seem possible to me that they are the same or related root cause.

I could be trying to read too much into it, but I noticed that some of the register dump values shown in the debug logs in that issue are similar (but not exact same) as some of the ones in my dumps. That could be an unimportant detail that I honed in on though.

It does sound like a similar time frame for reproduction and symptoms obser...

tulip sleet
#

@slender iron I can do the rc.0 NOW then. @onyx hinge do you have anything you want to get in before 8.1.0 final? Are there further synthio tweaks in the works?

manic glacierBOT
#

Issue

Users want to implement Mouse firmware with horizontal scrolling, and back and forward buttons, but the default Mouse HID Device has a report descriptor without them

Solution

Add a 4th default HID device. It's a Pointer with a similar report descriptor as the Mouse, with the addition of Panning, and Forward and Back

The 5th byte in a report is for the Panning value. The 6th byte has 1 bit for Forward, 1 bit for Back, and 6 padding bits.

I chose to implement as a new D...

slender iron
#

since it switches stuff to generic LFOs

manic glacierBOT
#

Hi, we want to keep the native set of devices minimal, so that the HID implementation will fit on the smallest processors. For instance, we had a gamepad device, but removed it.

Since you have figured out the report descriptor, you can use the custom HID device capabilities to define and your new device in boot.py. Have you seen https://learn.adafruit.com/customizing-usb-devices-in-circuitpython/hid-devices ?

onyx hinge
#

@tulip sleet yeah I'll still be making potentially incompatible changes but that's OK, we marked it experimental

tulip sleet
onyx hinge
tulip sleet
#

got it, we can always do an 8.1.1 or point synthio users to Absolute Newest

#

one thought I had about the stacked LFO's is that it's very flexible, but it also loses the named functionality of tremolo or vibrato (e.g. stacked LFO's is the assembly language of synths). A helper library might be convenient in the long run

manic glacierBOT
manic glacierBOT
#

hi @dhalbert, thanks for taking a look!

I did start out implementing a custom HID device in boot.py, and then decided to try contributing it back to circuitpython because I know others want horizontal scrolling. I also want to contribute a change to kmk firmware that involves horizontal scrolling. kmk currently doesn't depend on boot.py, and i was hoping to keep it that way.

I see what you mean about keeping the core minimal so it can fit on ...

manic glacierBOT
#

kmk currently doesn't depend on boot.py, and i was hoping to keep it that way.

The reason we added dynamic HID support is to allow more unusual devices, such as horizontal scrolling mice, absolute pointing devices, or particular gamepads. We'd like to keep the basic devices vanilla and small. There are many such devices that people have asked for.

kmk doesn't have to depend on boot.py. This could be an optional thing that could be tested for via some flag setting or similar (consi...

jaunty juniper
#

do we have example code to use the picodvi library with the DVI picowbell or the breakout ?

slender iron
jaunty juniper
#

ok

slender iron
#

not sure what board that is

jaunty juniper
#

ah interesting

midnight ember
#

640x480??

slender iron
#

1 bit

midnight ember
#

oh, crumbs

#

actually if i'm only using black & white then 1 bit would be ok?

jaunty juniper
#

the breakout uses different pin names than the library D0+, D0-, CK+, CK-, D2+, D2-, D1+, D1-

manic glacierBOT
slender iron
manic glacierBOT
#

The Feather RP2040 has two buttons.

The BOOTSEL used to enter the bootloader. To enter the bootloader, press and hold BOOTSEL and then power up the board (either by plugging it into USB or pressing RESET). The bootloader is used to install/update CircuitPython.

On Revision D and later of the Feather RP2040, the BOOTSEL button is connected to GPIO4 for use in your code. The revision letter is in a circle on the bottom of the board.

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 8\.1\.0\-rc\.0
orchid basinBOT
tulip sleet
#

The fomu CI builds have started failing because of an expired certificate:

ERROR: cannot verify static.dev.sifive.com's certificate, issued by ‘CN=Amazon RSA 2048 M02,O=Amazon,C=US’:
  Issued certificate has expired.
tulip sleet
onyx hinge
#

@proven garnet maybe you would be able to look into this (at a reasonable time of day) https://github.com/adafruit/Adafruit_CircuitPython_MIDI/pull/53

pre-commit has an error I hadn't seen before


Error: pylint (library code)....................................................Failed
- hook id: pylint
- exit code: 2

pylint: Command line or configuration file:1: UserWarning: Specifying exception names in the overgeneral-exceptions option without module name is deprecated and support for it will be removed in pylint 3.0. Use fully qualified name (maybe 'builtins.Exception' ?) instead.```
GitHub

For example,

from adafruit_midi.note_on import NoteOn
NoteOn(3)
NoteOn(note=3, velocity=127, channel=None)

proven garnet
#

@onyx hinge yes! I actually have a patch for this in review now.

onyx hinge
#

great, thank you.

proven garnet
#

It's new with the pylint update, I guess they want some changes to .pylintrc to be more specific about that parameter.

#

Interestingly, it only seems to be raised if other things went wrong, or I've seen it if there are tests for the repository that go through pylint

manic glacierBOT
manic glacierBOT
manic glacierBOT
orchid basinBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.5 on 2023-03-31; Raspberry Pi Pico with rp2040

Code/REPL

import usb_midi
import usb_cdc
import usb_hid
import storage

usb_cdc.disable()   # Disable both serial devices.
usb_midi.disable()  # Disable mini
usb_hid.enable((usb_hid.Device.KEYBOARD, usb_hid.Device.CONSUMER_CONTROL))   # Enable just KEYBOARD and CONSUMER CONTROL

Behavior

...

Description

I have a project using circuitpython ...

manic glacierBOT
manic glacierBOT
#

This could be based on the existing Arduino Nano 33 BLE definition, just with definitions for board.MICROPHONE_CLOCK and board.MICROPHONE_DATA which are connected to the PDM mic on the board. Probably something similar to the nRF52 Sense Feather since they are both similar ideas, and maybe a modified version of the guide could go with it. I've actually discussed this with an old account at https://github.com/adafruit/circuitpython-org/issues/410.

manic glacierBOT
#

Most of the 'stable' ports have some sort of hardware accelerated cryptography that implements one of these primatives:

  • The SAMD51 has the Integrity Check Monitor for SHA1, SHA224 and SHA256. The SAMD21 doesn't have any of this.
  • The ESP32-S2 has a SHA Accelerator and an HMAC Accelerator
  • The nRF52 has ARM's TrustZone CryptoCell 310 which has SHA and HMAC acceleration
  • And the STMF415xx/7xx has SHA1 and HMAC acceleration.
manic glacierBOT
#

When connect a linux host (raspbian rpi4) at boot, the device is detected however doesnt function as a keyboard. Removing the usb connection and replugging back in, the device works as expected.

Could you describe the problem in more detail? What errors do you see? Sometimes a delay of a few seconds in your code.py is needed when the board powers up before you try to use an HID device, because the host computer (RPi in this case) is still enumerating and setting up the presented USB de...

manic glacierBOT
manic glacierBOT
#

That’s fine, to best steer my efforts, what’s under active development. I’m
new to open source development and want to contribute.

Best regards

On Mon, May 15, 2023 at 21:42 Dan Halbert @.***> wrote:

@.**** requested changes on this pull request.

In ports/raspberrypi/common-hal/busio/I2C.c
https://github.com/adafruit/circuitpython/pull/7984#discussion_r1194510821
:

  •    // Create a temporary bitbangio.I2C object
    
  •    ...
    
orchid basinBOT
orchid basinBOT
orchid basinBOT
orchid basinBOT
orchid basinBOT
#

Thanks for adding the issue. We would need to look into static website generators. Jekyll is the generator and uses Ruby as the language and Liquid as the template engine. We are probably not taking advantage of all of its features since I don't know Ruby and my only experience with Liquid is from working on this site and documentation for Jekyll/Liquid isn't the best.

It would be nice to use something most people who would contribute to the site know better like Python as the language. Th...

manic glacierBOT
#

It's hard to say. Could be the same root cause. Likely to be some IDF change? I haven't seen a safemode in over a week with several eligible devices running projects, but other times they have been more frequent. I do reload and reset liberally in code.py when various exceptions happen, so that could be preventing some safemodes. I've also backed away from some of the more complex projects that were causing the most trouble. I'll try to set up a few dedicated devices with test code and DEBUG ...

orchid basinBOT
#

It might be useful to find all of the limitations and hard edges we run up against to make sure most of the requirements are met on a new static generator. What are the limitations with the current site with jekyll?

It would be nice to continue without using react or any javascript frameworks. cp.org is very fast as a static site and is still fairly simple for most any user to contribute to. It should work with javascript disabled right now (missing a few features, of course) and doesn't u...

manic glacierBOT
lone axle
#

For devices with a build-in SDCard onboard would it be possible to have them (attempt to) initialize and mount the SDCard inside the core the same way that builtin displays are initialized? So that user code could start interacting with with files in /sd/ without having initialize it

orchid basinBOT
#

It might be useful to find all of the limitations and hard edges we run up against to make sure most of the requirements are met on a new static generator.

Yep, definitely.

What are the limitations with the current site with jekyll?

With Liquid (Jekyll's template language), I'm having trouble when I try and do more complex things like display for instance, I was trying to modify the downloads page, which shows all the boards that are in the _data/files.json folder where the board...

slender iron
brazen hatch
#

Has anyone tested the STRAP_JTAG_SEL fuse of s3?
I kinda feel like burning it.

#

It would allow me to jtag using the pins on demand (gpio 3)

#

Or would the fact the pins are repurposed cause CP to error out?

idle owl
#

@lone axle The dynamic screenshot generator needs to be updated to include settings.toml I think. CP autogenerates it, but maybe only for boards with WiFi? So now I'm not certain how to make the screenshot generator know when to include it.

#

@slender iron Is settings.toml generated by CP for all boards or only WiFi boards

slender iron
#

CircuitPython itself doesn't generate it. cp.org installer does

idle owl
#

Oh. Do you know, then, if it's WiFi boards only?

slender iron
#

I think it is ESP only. so yes

idle owl
#

Ok. Got it. Thanks.

slender iron
idle owl
lone axle
# idle owl <@382939733107408897> The dynamic screenshot generator needs to be updated to in...

Okay, I'll try to tinker with it to get it to draw a settings.toml file>

As for the logic behind when it does draw it, I don't know if there will be a 100% perfect way to be sure. But keying in on wifi, or other certain library imports should get pretty close. I think this same idea was discussed at some point in the past for secrets.py, but I'm not sure if or what approach we ended up taking with that. I think some Learn projects include a "dummy" settings file in the repo and it will draw into the screenshot if you do that I believe.

idle owl
#

Well even a dirty not-100% way of doing it automatically would be nice.

#

Thank you!

lone axle
#

Is there a way to instruct the REPL not to show on the built-in display? For the InkyFrame that takes a few seconds to refresh() it might be nice to be able to tell it not to show the REPL output so that you can start executing statements without waiting on it to render.

#

Ah, sometimes when spamming ctrl C I'm quick enough to skip it actually.

#

It also does return and start allowing execution before it's fully finished as well, but does block for a few seconds before that.

manic glacierBOT
#

Currently on ESP32-S3, to debug the board, you have 3 options:

  • print spam
  • The board's built-in JTAG adapter. It comes with the downside that you can't use the usb com port for anything other than serial + jtag. It effectively becomes a esp32-c3 in that mode. CircuitPython doesn't use this mode but instead provides the CIRCUITPY drive.
  • The pins 39-42. This requires the espfuse STRAP_JTAG_SEL to be burned. The downside to this approach, is that you actually have to use an efuse, f...
slender iron
brazen hatch
# manic glacier

in other news, c3 is actually decent now.
It can also be debugged very easily.

#

it's the only esp board I can debug.

#

🥲

#

For anyone who needs it.
sudo openocd -f interface/esp_usb_jtag.cfg -f target/esp32c3.cfg

#

Doesn't matter the board, it will work automatically, no settings necessary.
Just make sure you are using openocd-esp32

manic glacierBOT
#

Tried adding a delay of 10seconds in code.py, but still same issue. SO, from power up, the boot process seems to run as per normal, just not functioning HID keyboard device. dmesg output from the boot process shows:

[    2.734495] usb 1-1.3: new full-speed USB device number 5 using xhci_hcd
[    2.881691] usb 1-1.3: New USB device found, idVendor=239a, idProduct=80f4, bcdDevice= 1.00
[    2.881714] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    2.881732] u...
manic glacierBOT
#

CircuitPython version

n/a

Code/REPL

make -C mpy-cross

Behavior

% make -C mpy-cross
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
mkdir -p build/genhdr
GEN build/genhdr/moduledefs.h
QSTR updated
Traceback (most recent call last):
File "/Users/tod/projects/adafruit/circuitpython-adafruit/mpy-cross/../py/maketranslationdata.py", line 30, in
import huffman
ModuleNotFoundError: No...

timber bay
#

Hello...
I am running into an issue attempting to fetch submodules on a fresh fetch of circuitpython from github

when running make fetch-submodules it will barf on this (with a list of files)

Please move or remove them before you switch branches.
Aborting
fatal: Unable to checkout '3fbadf9fb4e904fd8ed087642a41762b833ae0fe' in submodule path 'ports/silabs/gecko_sdk'
brazen hatch
#

git submodule deinit --all -f iirc and then run make fetch-submodules again.

devout jolt
brazen hatch
#

ah yea forgor git-lfs

#

that also was missing on my arch installs

#

CP has a lot of different types of dependencies.

#

passed some point we should have a script

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

This doesn't work (yet) on my inky frame.

I've verified via the printf below that the startup commands match what's being sent in my micropython branch (which does work). I even went so far as to partially properly implement the busy pin that's hooked up via a shift register. It only affects the send command, I hope to eventually be able to change the other busy checks to support the new callback structure to remove all the "dumb timeout" refresh blocks.

Another thing, this display tak...

manic glacierBOT
#

I've specifically changed the scope of this issue to focus on the newer Rev 2 version of the board since the existing definition incorporates the sensor pins in pins.c, as seen here:
https://github.com/adafruit/circuitpython/blob/f2bfced4079389c71cbdcf7d69e16d41f0e3dc98/ports/nrf/boards/arduino_nano_33_ble/pins.c#L51-L55
There are a few differences between the two revisions pin-wise, here is a list of them that I've picked up:

  • The LPS22's interrupt pin is now connected to the board at P0...
manic glacierBOT
manic glacierBOT
manic glacierBOT
brazen hatch
#

It's a good day when

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
espidf.IDFError: Requested resource not found
manic glacierBOT
brazen hatch
#

It works.

#

It detected it.

brazen hatch
#

Heeeeyyyyyy

#

Pins needed to be ordered low to high.

#

This stuff should be documented somewhere.

#

It was a pain to guess.

#

It works.
I saved an image.

manic glacierBOT
#

Yea, the only difference is setting the screen rotation 0 (this) vs 180 (adafruit_acep7in). I'm not convinced that it's the sequence.

I'm a SW guy and only occasionally HW. I don't have scopes which would be ideal. I can only thing to add some printf debugging to the SPI / fourwire classes to make sure the pin and their settings are as expected. Just comparing more things from my MP fork that works vs the CP that doesn't.

Other than that, I'm really not sure what else there is to check,...

brazen hatch
#

a = espcamera.Camera(data_pins=board.CAMERA_DATA, pixel_clock_pin=board.CAMERA_PCLK, vsync_pin=board.CAMERA_VSYNC, href_pin=board.CAMERA_HREF, i2c=board.CAMERA_SSCB_I2C(), external_clock_pin=board.CAMERA_XCLK, external_clock_frequency=20_000_000, powerdown_pin=None, reset_pin=board.CAMERA_RESET, pixel_format=espcamera.PixelFormat.JPEG, frame_size=espcamera.FrameSize.QXGA, jpeg_quality=2, framebuffer_count=1, grab_mode=espcamera.GrabMode.LATEST)

Is way too long.
Perhaps I should remove the CAMERA_ from the pins.
It's not like they are used for anything else or exposed.
It's a camera-specific board.

manic glacierBOT
brazen hatch
#

I have fully commented the port definition and it's almost done. It should serve as an example for future porters.

manic glacierBOT
#

Update port for Pimoroni InkyFrame 5.7".

Some notes:

  • fix frozen modules (remove unused module, add support for builtin hardware)
  • use standard pico-w board-LED as board.LED: having an additional LED is always useful (I use it for technical information)
  • configure enable-pin as DigitalInOut. This is to keep compatibility with the Badger2040W port and to how Pimoroni uses this pin in their MicroPython version
  • optimize parameters: refresh_time adds a useless wait after _...
brazen hatch
manic glacierBOT
brazen hatch
#

Like, just setting 2mb on the .mk should be enough to test it.

manic glacierBOT
#

The power button is attached to GPIO37 according to the schematic:
image
But cannot really be used.
It doesn't matter how I read it, be it analogio or digitalio, the value is always the same, no matter what I do.
GPIO37 is an input-only pin with no pulls available to it.

I will not include it in the board definition.

With that out of the way, the definition is complete.

brazen hatch
#

I don't get why the power pin is like that.
It's behind a diode that goes against it..
There is no backfeed into it.

idle owl
#

Double checking. You can't call a function before it's created in a Python program, right?

#

Before the loop.

#

Nope. You can not.

brazen hatch
#

Yea this ain't C.
It's supposed to be interpreted.

wraith crow
#

just curious have you tried pulling gpio37 high/low in code?

brazen hatch
#

it stays None in code

wraith crow
#

so you can't output a 1 or 0 on the pin?

brazen hatch
#

analogio does something 2800 no matter the status of the physical button

brazen hatch
#

Not that we want that, we just want to read it.

wraith crow
brazen hatch
#

I want to flip it just to see. But it's tiiiny.

#

Regular diodes are supposed to have no backfeed and it's not a Zener. It would have the Z instead of the I there.

#

I know very little about this stuff. A diode is like a one-way door in my eyes. A Zener diode is like a loose one-way door.

wraith crow
#

Yea, I assume the zener in the circuit is for over voltage protection but I can't see a use for the one on 37

brazen hatch
#

They have the same exact circuit on all timercamera, timercamera x and timer camera f
They wouldn't just copy-paste a mistake 3 times right?

wraith crow
#

lol

brazen hatch
#

None of the examples or doc explain.

wraith crow
#

if you really wanted to test the diode reversed you could just put a temporary jumper across it. Since the pin is input only, presumably it wouldn't push anything out the wrong way.

brazen hatch
#

I guess, but that wouldn't contribute anything to the definition regardless.

wraith crow
#

True

rugged spindle
#

regarding https://github.com/adafruit/circuitpython/pull/7256 - I have now received 4 of these boards. I cannot get esp-idf to work properly on Ubuntu - constantly moans about mismatching versions, so I can't compile it to test it out.
if anyone could make that board and let me have the files, it would be much appreciated as nothing else works on them properly

wraith crow
rugged spindle
#

yep 😦

wraith crow
#

I think I built an image a week or two ago, will that work or do you need the latest version of CP?

rugged spindle
#

that would be perfect

wraith crow
#

give me a few and I'll try and dig it up

rugged spindle
#

You, sir, are a gentleman and a scholar

wraith crow
#

Just remember that version of the board/build is not supported in anyway

rugged spindle
#

that's no problem. I can't currently use them for anything productive, so anything is better than nothing / throwing them away

wraith crow
rugged spindle
#

amazing. thank you

brazen hatch
#

I was thinking of pr'ing CONFIG_SPIRAM_IGNORE_NOTFOUND to permit the boards to use main.

rugged spindle
#

well, it loads and runs but it looks like these dodgy clones have another issue (which I saw somewhere) - every time the Wifi kicks in - it reboots 😄

#

but as its gone 23:30 here, that's a job for tomorrow

#

thanks for your help (as always)

manic glacierBOT
manic glacierBOT
thorny jay
#

While cleaning the sofa, I found a QT Py S2 that I had been searching for since a long time.
Well it is running 8.0.0-alpha.1-39-g4c20b3cb6 from 2022-07-06. So I guess it has been there since 10 months or so.
Maybe Adafruit should make the QTPy a bit bigger so that less are lost. 🤣

rugged spindle
#

introduce a Chunky Py?

ornate breach
manic glacierBOT
onyx hinge
#

oooh next person gets #8000 -- I hope it's a PR so we can celebrate

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.5 on 2023-03-31; ESP32-S3-DevKitC-1-N8R8 with ESP32S3
Board ID:espressif_esp323_devkitc_1_n8r8
UID:C7FD1A3EA8C9

Code/REPL

import board
import busio
spi = busio.SPI(board.IO36, board.IO35, board.IO37)
cs = board.IO40
print(“SPI initialized.”)

Behavior

Board resets to safe mode for reason: “Internal watchdog timer expired.”

Description

Also tested in 8.1.0-RC.0. I suspect that busio.SPI()...

#

SPI0/1: GPIO26-32 are usually used for SPI flash and PSRAM and not recommended for other uses. When using Octal Flash or Octal PSRAM or both, GPIO33~37 are connected to SPIIO4 ~ SPIIO7 and SPIDQS. Therefore, on boards embedded with ESP32-S3R8 / ESP32-S3R8V chip, GPIO33~37 are also not recommended for other uses.

https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-reference/peripherals/gpio.html

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Currently, I need to do this:

  1. call display.refresh()
  2. _clean_area()
  3. wait until refresh_time expires
  4. update areas
  5. return immediatly
  6. call time.sleep(until refresh is really finished)
  7. set board.ENABLE_DIO = 0 (shutdown and cut power)

During the wait-time after _clean_area (3) the display does nothing, it just wastes battery with a tight loop. (6) is necessary regardless of the value of refresh_time, since there is no wait after update are...

manic glacierBOT
#

hi
i have a programing esp8266-01.

c:/users/shedco/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.1.0-gcc10.3-e5f9fec/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\SHEDco\AppData\Local\Temp\arduino\cores\e086725d524362f7173c3f551fb5b43a\core.a(core_esp8266_main.cpp.o): in function __loop_end': C:\Users\SHEDco\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\cores\esp8266/core_esp8266_main.cpp:245: undefined r...

#

I don't think anything happens during (3) even when the refresh_time is 28 secs. The display flashes two times after sending the clean-area bytes (dimming all colors), but that is it. The real refresh flashes much more often and the display is still busy way after the refresh() method returns.

And I don't get the point of waiting half a minute after _clean_area, but not waiting that time after the real screen update. This does not make sense. And in all my testing I haven't seen any proble...

manic glacierBOT
#
  • Fixes #7994.

Two problems:

  • #5892 made pin reset set a pull-up, which is recommended by Espressif for minimal power draw (and prevents glitches on random pins). Needed to not set the pull-up to make touch waking work. Added a new capability in microcontroller/Pin.c to not reset just once. I was originally using never-reset to do this, but I can't always clear never-reset at the right time, so sometimes it sticks around and causes the pin to appear to be in use.
  • #6772 fixed touch o...
#

Tried to get ESP32 TouchAlarm to work while working on #8003. I cannot seem to set a threshold that works. A low threshold never triggers, a high threshold triggers all the time. There may be something wrong with the setup. I instrumented at the IDF raw values using TouchIn and added some comments about that as part of #8003.

TouchAlarm works fine on ESP32-S2 and ESP32-S3 after #8003.

#

I don't have hardware handy to double-check, but this may be a documentation issue instead. abs is only listed on the page for complex arrays. I tried np.abs and np.absolute, but I know I did not try calling it directly off my array. Since I don't have a debugger on CircuitPython I'm not able to use the normal method of dir(myarray) to discover what is available. np.abs is probably still worth having, but no...

#

OK, at the risk of sounding dumb, what is the syntax for the unary absolute value operator in numpy? (I am using 8.1.0-beta 2 to obtain analogbufio on the ESP32-S3)

I launched an interactive Circuit Python session and there is no abs function on the array:

Adafruit CircuitPython 8.1.0-beta.2 on 2023-04-26; Adafruit Feather ESP32S3 4MB Flash 2MB PSRAM with ESP32S3
>>> import ulab.numpy as np
>>> a = np.array([1,-2,3,-4])
>>> dir(a)
['__class__', 'copy', 'sort', 'byteswap', 'dtype...
#
MicroPython 8.1.0-beta.2-43-g4901bdceb7-dirty on 2023-05-18; linux version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>> import ulab.numpy as numpy
>>> abs(numpy.array([-1, 2, -3]))
array([1.0, 2.0, 3.0], dtype=float64)

It corresponds to the abs built-in function. In another post v923z referred to it as a "unary operator", but that reflects some implementation detail of micropython, it's not actually a unary operator like - is in a Python statement like x = -y.

brazen hatch
#

It's always nice seeing the empty artifacts page.

brazen hatch
#

linux version

#

Is this a parody build?

onyx hinge
#

@brazen hatch no that's just how the "ports/unix" build identifies itself. i often run it for quick testing that doesn't need hardware

brazen hatch
#

oh alrighty then, thanks for the info
I have never used it, cuz I always have a board on me.

manic glacierBOT
idle owl
#

Are there other ways to reload a board from code.py other then supervisor.reload() and microcontroller.reset() ?

#

I don't need to know what they are.

#

Simply whether there are others.

blissful pollen
#

I guess in theory you could wire an IO to reset and cause it to reset

#

upon triggering the IO I mean

#

The watchdog being set and triggering also resets the board

#

Those are more indirect ways though

brazen hatch
#

Crashing the board.

idle owl
#

For a project guide.

#

Not a CP development guide or docs

brazen hatch
idle owl
#

Yes, but the function does both

blissful pollen
#

I think so. I cannot think of any others

idle owl
#

Depending on this argument I'm describing right now

#

So I'm setting up the premise to explain the rest.

#

I understand they're not technically the same.

crimson ferry
#

deep sleep

#

hard reset (power cycle or reset button), soft reset (microcontroller.reset), supervisor.reload, deep sleep, safemode --> safemode.py

idle owl
#

Hmm ok I'll scrap the sentence.

brazen hatch
#

Wire 5V and GND to a relay and wire the control pin to a gpio.
harder reset

crimson ferry
#

arguably, supervisor.set_next_code_file(reload_on_*) ...technically a reload, but various triggers

brazen hatch
#

ah also forgor
autoreload

idle owl
#

This thing offers .reset() and .reload. There's three places it soft reloads, and one place it hard resets.

#

It's because there's WiFi and Adafruit IO in this code, and it's meant to be left unattended.

#

So it catches everything and does one of those two things.

#

It's kind of gross, but it works really well.

crimson ferry
#

that's a good strategy for a hands-off project

#

reload when that should solve the issue, reset when that's required

blissful pollen
#

I've had projects do that as well. Try to handle it and worse case reset, plus the watchdog to catch really weird things

brazen hatch
#

Why not always reset?

idle owl
#

The reload is faster.

#

less interruption.

#

That's why not always reset.

crimson ferry
#

...serial doesn't drop, sleep memory is retained

brazen hatch
#

Oh, didn't think of these.
I haven't played with alarm much.

crimson ferry
#

sleep memory is really handy for carrying data across reloads, and from boot.py to code.py

#

(grantd, you could also write a file in boot.py)

idle owl
#

Thanks folks. Definitely expanded my thoughts on what reloading and resetting encompasses.

crimson ferry
#

in some scenarios, I'll attempt multiple reloads before a reset, keeping a count of successive reloads in sleep memory, and if a threshold count is reached, reset

idle owl
#

Was pretty proud of figuring that out with minimal help.

brazen hatch
#

file writes will shorten the longevity of the flash though
I have somehow managed to not need such stuff, since my stuff basically catches all scenarios..
But sleep memory would be the best since it's ram
nvm is flash still

crimson ferry
#

right, avoiding flash / nvm writes

#

catches all scenarios

presumably that means reset in some cases?

brazen hatch
#

10 million different excepts
Every piece of hw in it's own class. Can be nuked at anytime.
The memory will be recorded in a not so distant future, so that in oom it will delete the biggest hogs (wannabe nohang).
Reset's are a last resort.

#

But they aren't part of the main code, so assuming something very bad happened, and it couldn't exec(), it would just dump and fall to the REPL.

lone axle
#

For some code like this:

vfs = storage.VfsFat(sd)

What function inside of the core is that calling? I looked inside of shared-bindings and shared-module for storage but I do not see any VfsFat function like this is calling.

brazen hatch
#

extmod vfs_fat

lone axle
#

fat_vfs_make_new() ?

onyx hinge
#

@lone axle I grepped for the qstr and found a couple of hits ... shared-bindings/storage/__init__.c: { MP_ROM_QSTR(MP_QSTR_VfsFat), MP_ROM_PTR(&mp_fat_vfs_type) }, so it's probably the VfsFat type. calling a type calls its make_new slot which is as you must have already found .make_new = fat_vfs_make_new, so yes

lone axle
#

Is there a place I can look to find out what properties are on an mp_obj_t? I think I've created one successfully but my code won't compile because the variable is unused. I'm hoping to just print out something that came from the mp_obj_t I created so that it won't count as unused and will continue the compilation

#

It seems that I can pass the mp_obj_t to mp_printf by itself actually. I assumed that wouldn't compile but it does:

mp_printf(&mp_plat_print, vfs);
manic glacierBOT
manic glacierBOT
#

The user led on the MIMXRT1060-EVKB is GPIO_AD_B0_08 not _09.

The commented code does not result in blinkenlights, while the uncomment code does.

def blink():
#led = digitalio.DigitalInOut(board.USER_LED)
led = digitalio.DigitalInOut(microcontroller.pin.GPIO_AD_B0_08)
led.direction = digitalio.Direction.OUTPUT

while True:
    led.value = True
    time.sleep(0.5)
    led.value = False
    time.sleep(0.5)
#

USER_LED/LED on MIMXRT1060-EVKB is on GPIO_AD_B0_08 not _09.

The following code works, where as if you use board.USER_LED, it does not.

def blink():
    #led = digitalio.DigitalInOut(board.USER_LED)
    led = digitalio.DigitalInOut(microcontroller.pin.GPIO_AD_B0_08)
    led.direction = digitalio.Direction.OUTPUT

    while True:
        led.value = True
        time.sleep(0.5)
        led.value = False
        time.sleep(0.5)

blissful pollen
manic glacierBOT
manic glacierBOT
#

It might be sensible to control whether or not _clear is called prior to _refresh. This way when the display does actually work, it doesn't take an unreasonably long time to display.

That is exactly what we are currently discussing in #7797. The _clear itself is not the problem, but the wait (for what?) after the clear. You have 8s in the constructor, I use 2s and that works fine.

You might also want to integrate the parts of my PR that deal with the frozen modules and the keys and th...

#

@tannewt Can you post some test-code that demonstrates the need for a refresh_time value of 28? All my tests show that 2 is enough, but I might not test every possible situation. And this really makes a difference from the user's side. A complete cycle (including connecting to an AP, fetching data from the net and updating the display) takes about 60s with my implementation and 90s with yours.

Another question: will you consider the changes from #7996 to EPaperDisplay.c? I.E. supporting a...

lone axle
blissful pollen
#

I have see using just something like (variable); to remove that warning. Obviously rarely something you do not want to have there long term.

lone axle
#

Interesting, that is a handy trick to know. Thank you. Yeah definitely no intention of leaving it that way. Just wanting to verify there is nothing completely wrong with the code I have so far.

blissful pollen
#

If it would help you for me to take a look at the code just let me know. Either here or if you're streaming I can pop on. Just woke up though, your results may vary

lone axle
#

I'll be taking a stab at finishing off what I started last night when I start up the stream in about 1hr 15min.

#

I am trying to proof of concept for initializing the SDCard and mounting it inside of board_init() in the core so that use code can imediately start accessing files inside of "/sd/"

lone axle
blissful pollen
lone axle
#

Nice! that one does look like it works

#

ty!

blissful pollen
#

Welcome

onyx hinge
lone axle
#

Is there any place to see prints that occur during board_init() It seems that the USB serial connection is up and running yet. By the time that tio sees the device I think those prints have already occured so I never see them anywhere.

Will the debug pin output those if I connect to it?

onyx hinge
#

some boards have a debug uart but I don't think mp_obj_print will be able to print to it. supervisor/serial.h:65:int console_uart_printf(const char *fmt, ...)...;

#

that's initially configured by serial_early_init

manic glacierBOT
#

@anecdata 's stuff is cool, I wish it was standard functionality, like came for free with circuitpython. (add a safemode.py that appends the reset reason to a file, the boot.py to catch errors and check reason for bootup, and a code.py with the 3lines printing boot reason plus something circuitpythony/hello-worldy)
It's linked from some general advice about programming for [long-term reliability on circuitpython here](http...

devout bolt
#

So, I built a Hackintosh but it cannot access any of my microcontrollers. Using a USB port build into the motherboard I can plug in an external SSD or a USB stick and they both show up in my Finder Locations But when I plug in any of my Circuit Python boards nothing gets mounted. I know the port is good and cable is good (it works on my MacBook).

Not sure where to start troubleshooting. Maybe some BIOS setting? I guess I don't understand the underlying architecture for a microcontroller (Pi Pico, Feather RP2040, QT-Py) or how they differ from something like a USB stick.

Any suggestions would be very awesome 🙂

random junco
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
meager shell
tulip sleet
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.1.0-rc.0 on 2023-05-17; Teensy 4.0 with IMXRT1062DVJ6A
Adafruit CircuitPython 8.0.5 on 2023-03-31; Raspberry Pi Pico W with rp2040

Code/REPL

# Import modules
import board
import busio
import displayio
import time
from adafruit_display_shapes.rect import Rect
from adafruit_display_shapes.line import Line	
from adafruit_st7789 import ST7789

# Pin definitions for Teensy 4.0
PinSPISCK=board.D13
PinSPIC...
manic glacierBOT
meager shell
manic glacierBOT
manic glacierBOT
sharp jacinth
#

can WSL be used to build CP?

manic glacierBOT
manic glacierBOT
#

Submit a PR to https://github.com/creationid/creators/blob/main/creations/wemos.md to document the creation ID you chose.

I see that the Lolin I2C connector is not the same :shrug: as QWIIC or STEMMA/QT. That is too bad. You (or was it someone else?) chose 5 and 6 for I2C, but the schematic shows 8 and 10 for the connector. Since the board does not label 5 and 6 for I2C, I'd suggest dropping the board.I2C() altogether, to force the user to specify the pins exactly. Or make board.I2C() ...

manic glacierBOT
manic glacierBOT
#

Implements alarm.sleep_memory on RP2040. Implementation taken from nRF. It's just a 256-byte block of RAM, since RP2040 does not power down RAM when sleeping.

Fixes #5081. That issue says other things must be done, including removing a watchdog that zeros out RAM. But I didn't do that and it still works?!

Test program, tested with fake deep sleep and with power just via a 5V adapter:

import alarm
import board
import os
import time

time.sleep(1)

u = board.UART()
u.bau...
brazen hatch
manic glacierBOT
#

CircuitPython version

8.0.5

Code/REPL

# https://github.com/gallaugher/disco-button/blob/main/demo_of_sd_mp3_play_break_with_sd.py
# note repo above also has mount_sd.py, but it's the standard one that's from Adafruit's learn guide
# Just a test of playing MP3 files when pushing a button

import board, time, microcontroller, mount_sd, digitalio, random

from audiopwmio import PWMAudioOut as AudioOut
from audiomp3 import MP3Decoder

from adafruit_deb...
#

CircuitPython version

Adafruit CircuitPython 8.1.0-rc.0 on 2023-05-17; Teensy 4.0 with IMXRT1062DVJ6A

Code/REPL

# UART setup:
UART=busio.UART(rx=board.D0, tx=board.D1, baudrate=250000, timeout=0, receiver_buffer_size=1024)

# Code line that causes the error:
byte=UART.read(1)

# Complete function where it's used:
def UARTReceive():
	"""
	Receive Message via UART
	return:		String/None - Message if present, otherwise None
	"""

	Message=[]
	
	b...
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Submit a PR to https://github.com/creationid/creators/blob/main/creations/wemos.md to document the creation ID you chose.

I see that the Lolin I2C connector is not the same shrug as QWIIC or STEMMA/QT. That is too bad. You (or was it someone else?) chose 5 and 6 for I2C, but the schematic shows 8 and 10 for the connector. Since the board does not label 5 and 6 for I2C, I'd suggest dropping the board.I2C() altogether, to force the user to specify the pins exactly. Or make `board.I2C...

manic glacierBOT
manic glacierBOT
lone sandalBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.1.0-rc.0 on 2023-05-17; LILYGO T-DISPLAY with rp2040
Board ID:lilygo_t_display_rp2040
UID:DE62309247682B26

I can't use board.BUTTON_L , and if I check with code below. I see :

board.BUTTON_L board.BUTTON_R board.GP6 , this mean it ref to the same pin GP6, right?

Code/REPL

import microcontroller
import board

board_pins = []
for pin in dir(microcontroller.pin):
    if isinstance(getattr(microcontrol...
turbid radish
#

@meager shell message @gilded cradle

digital shoreBOT
manic glacierBOT
random junco
willow totem
#

Okay, be gentle...
I've got permission from sensirion to use their name in my repo name and library name for the SEN5x air quality sensors driver. I want to use a stupid name that goes against convention, to maintain code compatibility across python + circuitpython. The library is imported as sensirion-i2c-sen5x with a dependency also imported from sensirion-i2c-driver which i've also ported and plan to release for the community bundle. What should my library name be when using cookiecutter, and moreover what should my Repo name be. The guide seems to warn against this heavily and say extra steps will be required, and then mention no more of the extra steps required to make it work, so please lay it on me, what's required if repo name and library name don't match. Also can I make it match (assuming circuitpython is auto-removed from the middle of the library name and it was something like sensirion_CircuitPython_i2c-sen5x)?

onyx hinge
#

@random junco so excited to have you return to hosting! preemptive hug report

slender iron
#

I hesitate to say sensiron because we usually treat the adafruit_ portion of our names as who is supporting the code

#

and that's not sensiron in this case

willow totem
#

they (the product manager of developer experience) were happy as long as the readme clearly denotes a fork, and want to bung a link on their github community libraries page and weekly makers social media. I've entered the company/author to me and copyright to them plus fork mention everywhere. I wanted to keep the name the same so if you're using the python version for basic datalogging and switch your code to CPY it all works out the box (using Circup). But I guess I'm responsible for maintenance

#

maybe it's too bigger issue

manic glacierBOT
#

Submit a PR to https://github.com/creationid/creators/blob/main/creations/wemos.md to document the creation ID you chose.
I see that the Lolin I2C connector is not the same shrug as QWIIC or STEMMA/QT. That is too bad. You (or was it someone else?) chose 5 and 6 for I2C, but the schematic shows 8 and 10 for the connector. Since the board does not label 5 and 6 for I2C, I'd suggest dropping the board.I2C() altogether, to force the user to specify the pins exactly. Or make `board.I2C...

sharp jacinth
#

Is there an easy way to get a build of CP for the SAMD21 QT PY that doesn't have safe mode, without going thru the build process?

#

I'm trying to minimize time to code execution

onyx hinge
#

@sharp jacinth that's the only way I know of.

crimson ferry
#

how much time does it take to do the safe mode check?

sharp jacinth
#

like a second I think?

#

Might be tolerable but I'm not sure

lone axle
#

Maybe that actions custom build utility? it would make the build in github actions container of you having to do it locally

modern wing
#

[happily lurking today, howdy y'all]

idle owl
#

Welcome back, Paul!

crimson ferry
lone axle
#
#
midnight ember
#

Way to go Tekktrik!

slender iron
#

@onyx hinge could be interesting to try to make this interface and power it with synthio: https://trianglecore.rocks/standalone/p/sound-objects-shruthi-xt-mutable-instruments

midnight ember
idle owl
#

FeatherWeather

onyx hinge
#

@slender iron that looks cool but it's pricey! wow

slender iron
midnight ember
slender iron
#

right, so mimic the interface but generate the audio from cp

midnight ember
#

From what I've seen so far of the synthio "experiment" it's wildly successful. Mind blowing stuff.

#

The different ways you can insert different color combinations is very important. Good stuff.

#

I've also noticed the S3 is much more stable lately, it's awesome.

slender iron
#

@devout jolt I'm also thinking about how to do a stemma qt "patch panel" board

#

so that you can detect where cables are plugged into

midnight ember
#

Any preview of the G0 board? I'll likely never use anything that advanced but seeing new custom board designs is cool.

#

Polyphony maddness ❤️

slender iron
#

it's very simple because the G0 is very easy to support

modern wing
#

Thanks!

gilded cradle
#

Thanks

midnight ember
#

Thank you for hosting Paul!

lone axle
#

Thanks for hosting Paul! Have a good day everyone.

ember iris
#

Thanks all! have a great week!

modern wing
#

Very smooth Paul, excellent job hosting 🙂

devout jolt
midnight ember
#

@slender iron oh I was wondering if you had a 3d render screenshot for a quick peek. I'd actually have to load up software and import it just to view it.

slender iron
#

I'm thinking they'd be trs cables like those used in synths

midnight ember
#

having screenshots of the board helps

random junco
#

@lone axle My recording is good, thanks for the backup

slender iron
midnight ember
#

Very cool @slender iron!

slender iron
#

most of the circuitry is standard stemma qt level shifting

midnight ember
#

cute little birdy

slender iron
#

looks better in enig. it is my chickadee tech logo 🙂

devout jolt
#

G0 programmable over StemmaQT? 🙂

slender iron
devout jolt
#

Sweet

midnight ember
#

I was going to ask about the stemma but I was like "nah there's no way he'd use stemma for that". That's amazing.

slender iron
#

the cheapest of the line is 50 cents. cm0 at 64mhz with 32k flash and 8k ram

#

and the C0 is a newer line with the same footprint and supposedly cheaper

devout jolt
#

Sounds like a good seesaw replacement

slender iron
#

I think limor is going attiny for now

#

this is my answer for folks who need multiprocessing in cp 🙂

midnight ember
#

seems a bit overkill for seesaw?

devout jolt
#

ATtinys do have very hardy GPIO. Good for butter finger people like myself

midnight ember
#

ahhh stm coprocessor sounds neat, i'm guessing you'll mostly use it for debugging uses though.

slender iron
#

I'm thinking seesaw-like but reprogrammable

devout jolt
#

Yah that sounds cool!

slender iron
#

software is the hard part

#

I was thinking it'd be handy for a synth control interface

midnight ember
#

yeah if the cost is about the same you can definitely get a lot more value out of a stm

#

yeah that's todbots realm i'm still trying to figure out asynchio basics. way over my head but sounds like you're happy with it.

slender iron
#

@devout jolt do you know if polling a bunch of inputs over i2c is too slow for sythy stuff?

#

my brain's been thinking about multimaster i2c where each control writes values to a central place when values change

#

rather than polling

midnight ember
#

depends on how many inputs and what kind of inputs. like any i2c device there isn't an infinite amount of bandwidth on a bus.

slender iron
#

ya, I just haven't done the math yet

empty salmon
# slender iron I think limor is going attiny for now

I've been using the new UPDI programmed ATtiny-blah for several projects and finally did my I2C client coding. Now I can build various "user interface hardware" and it will be easy to use in CircuitPython (or any other language).

devout jolt
midnight ember
#

also the MCU matters. my TR-Cowbell kind of struggles a little bit if you throw the kitchen sink at it because it's running on a pIco.

slender iron
#

the idea being that human hands can only change so much at once but polling has to check everything

midnight ember
#

this is true but you can also automate a lot more than a human can touch with envelopes

slender iron
midnight ember
#

I was getting the same behavior. Even with synchio the pico just doesn't have enough horsepower to do a bunch of things simultaneously without minor timing fluctuations.

#

and it was visibly present just watching the sequencer scroll.

empty salmon
#

The AVR Coding 101 materials are as close to bare metal ATtiny/AVR coding as I can get without writing machine code 😉

It's not CircuitPython but now with the I2C Client code and sample, I can make lots of I2C enabled "user interface" hardware that is easy to use with CircuitPython.

midnight ember
#

the iMX is where it's at for synthio stuff

#

really looking forward to diving into synthio on the imx.

#

i know there will be ram limitation but still, it's not a pico

slender iron
#

imx has variants with more ram

blissful pollen
#

The ram on the iMX is tight for synth stuff. I was actually looking at other chips with more ram

devout jolt
midnight ember
#

and someday maybe getting the phillips DSP stuff on there up and running

manic glacierBOT
empty salmon
blissful pollen
#

I've never looked at the Teensy I should

midnight ember
#

do some of the imx's allow for external ram?

midnight ember
#

not even sure if that's a thing, i know external qpsi is. would love to have a board that has upgradeable ram and flash

slender iron
#

1060 on the teensy has 1mb of sram

devout jolt
#

wow!

midnight ember
#

@devout jolt looking forward to hearing more about seeknobs. neradoc posted a link to an m5 stack i2c rotary encoder and potentiometer boards a while back. they looked really good for developing a large array of knobs quickly.

#

one thing about pcb design is once you make it your stuck with it. i2c chained banks of knobs isn't as constrained but it's still all on 1 bus. need more bandwidth, ram, cpu. always the predicament. concessions must be made with microcontrollers.

devout jolt
midnight ember
#

ahh that looks so cool!

#

beat me to it. oh wow there's a little carrier board. yeah definitely looking forward to seeing that one progress.

#

i was going to add rotary encoders on the TR-Cowbell but there are 16 of them and every rotary encoder is expensive. would end up costing a lot more. might make one for myself but there's no way i'll ever make something like that available as a giveaway. rotary encoders are expensive for some reason.

slender iron
#

@empty salmon why avr instead of arm on a cortex m0?

devout jolt
manic glacierBOT
#
[adafruit/circuitpython] New branch created: 8\.1\.x
manic glacierBOT
#
[adafruit/circuitpython] New tag created: 8\.1\.0
idle owl
#

Hooray!!!!! 🎉

#

Ok, so wait. Practically speaking, what happens when code using time.monotonic() runs too long? The shortest time interval in my code that is being tracked is 1 second. How long would the code have to run before something doesn't work right?

idle owl
#

I understand what's happening technically speaking. I simply don't quite grasp what it means practically speaking for my situation.

idle owl
#

I was considering adding a bit of code that resets the board every couple of days, if it has been up the entire time.

#

But forgot about that, and only remembered now.

random junco
#

Here is the notes document for next TUESDAY'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/1VcPOjquw3lEHudLutRlrpuA2AQNsrTsxyYjwu2nnvZY/edit?usp=sharing

manic glacierBOT
random junco
blissful pollen
idle owl
#

I thought it lost precision.

midnight ember
#

@idle owl I’m sure someone will correct me if I’m wrong. time.monotonic is basically seconds or at least the boards best attempt at seconds.

blissful pollen
#

Oh because of the decimals it may be a float. So as it gets larger you are right it does

idle owl
#

Yes I understand time.monotonic itself.

blissful pollen
#

Just not sure offhand at what point

idle owl
manic glacierBOT
idle owl
#

Or rather, I'm trying to find out what that loss of precision means for tracking 1 second intervals. It must fail at some point or start acting weird. But I'm not sure when or weird-how.

midnight ember
#

Ive never run a board long enough to know if it rolls over. Anyone have an idea how long that would take approximately?

slender iron
#

@tulip sleet knows at what rate the float's lose precision

idle owl
#

I know, but I didn't want to ping him directly.

tulip sleet
#

i am calculating it now

slender iron
#

it doesn't roll over, it just gets less and less resolution

idle owl
tulip sleet
#

about 50 days

idle owl
#

@tulip sleet Ok, and at 50 days, what happens?

manic glacierBOT
idle owl
#

Practically speaking.

midnight ember
#

Yes it will lose precision over time. For tracking time in particular it will show up as a time drift, which happens with most mechanical watches too. So a reset after a certain amount of time is probably a good idea.

tulip sleet
#

at 50 days is 2**32 ticks, which approximately is the point at which the granularity of time.monotonic() becomes > 1024 msecs

#

(about a second)

idle owl
#

Ah hmm.

#

Ok, so.....

tulip sleet
#

if you used monotonic_ns() it would not be an issue

idle owl
#

This code doesn't need to be super precise, except for the time change, which is Adafruit IO, not time.monotonic.

#

Min tracking time is 1 second, and that's for sending pings, which if it goes to 1.024 seconds isn't going to hurt anything...... oh wait. Except maybe the blink happening at the appropriate interval.

tulip sleet
#

after 100 days it will be 2 seconds

midnight ember
#

In theory, in practice Ive noticed a much more substantial drift than 1 second off after 50 days. I’ve noticed as much a couple minutes off per day, depends on the board perhaps? It’s been a while since i ran any RTC stuff.

idle owl
#

Uff ok

#

No.

tulip sleet
#

etc

idle owl
#

@tulip sleet Would you reload the board or switch to ns.

#

I already reload in places, so the import is already there.

#

Also, to clarify, soft reload resets time.monotonic() right? It doesn't require a hard reset?

#

(Though both are options in this code.)

tulip sleet
#

i think it depends on the board, but it doesn't reset time.monotonic()

#

at least for some boards

idle owl
#

soft reload doesn't?

#

interesting.

tulip sleet
#

right

idle owl
#

I did not know that. TIL.

#

So I can hard reset the board, or I can swap to ns

tulip sleet
#

the background ticking thing just keeps on ticking like Timex

midnight ember
#

I have not used ns.. maybe that was part of the problem? Was using regular monotonic i think.

idle owl
#

Which on some level is less readable in the code. 😕

#

Nanoseconds aren't standard in folks' brains.

#

Not in mine at least.

tulip sleet
#

could use ticks_diff from adafruit_ticks

#

that rolls over properly

idle owl
#

Nah... don't need another lib in the mix.

#

I've done the board reset thing before.

#

It adds two lines or something. It's not bad.

crimson ferry
#

how often do you update date / time? could just use RTC time

idle owl
#

Every time through the loop.

crimson ferry
#

I mean clock time from ADafruit IO

midnight ember
#

My feather weather has been running for about 3 days. It soft reloads during some usb events like opening file manager which touches usb. It does not hard reset the board. Only a hard reset will reset monotonic.

idle owl
#

Oh, every 5 minutes.

#

Otherwise I'd get rate limited.

crimson ferry
#

every time through the loop, you could just check the RTC seconds and see if it's more than the prior check

#

then do your 1-second task

idle owl
#

How do you even set the RTC time? How much more code does that add?

manic glacierBOT
midnight ember
#

Yeah microcontroller.reset like once a day should be plenty. If you intend to keep time with rtc you’ll need a method to update the clock like wifi or gps. Adafruit gps module is great way to pull time while being completely offline.

idle owl
crimson ferry
#
rtc = rtc.RTC()
rtc.datetime = ntp.datetime. # or w/e your source is
idle owl
crimson ferry
#

yup

idle owl
#

Interesting.

#

That changes a lot in this code though, doesn't it?

crimson ferry
#

sorry, not familiar with the example code, the addition would be setting the on-chip rtc

idle owl
#

I would be using rtc.tm_sec or something?

crimson ferry
#

right

midnight ember
#

I think adafruitio will pull epoch which will slot into RTC with almost no effort.

idle owl
midnight ember
#

I have some time examples in my github snippets you might find useful.

idle owl
#

Sure, link them if you can. I think I'm understanding how this change would work. I want to at least consider it.

midnight ember
#

Was designed to work with gps but if you feed it adafruitio epoch time instead should be good.

idle owl
#

I understand.

crimson ferry
#

yeah, sundial.tm_sec, or once the rtc is set, you can just check time.time()

#

(and compare to last stored, from the previous second)

idle owl
#

Ohhhhhhhh

#

so I can use the already existing time variable?

crimson ferry
#

yup, once rtc is set

idle owl
#

So not alone....

#

Still need RTC?

crimson ferry
#

then the time functions and properties use the rtc

idle owl
crimson ferry
#

it's an import, and a one-liner each loop to re-set the rtc from sundial time, but is is an added dependency

midnight ember
#

i dont know what happened to my rtc example. I lost it when resetting my github.

crimson ferry
idle owl
crimson ferry
#

hmmm... any board with wifi has it

idle owl
#

Ok

crimson ferry
#

samd51 has it

idle owl
#

I only need this board to work 😄

#

And it has it.

brazen hatch
#

So are we branching to 8.1.x and 9.0 now?
Or will there be a 8.2?

manic glacierBOT
orchid basinBOT
brazen hatch
#

btw, that thing takes amazing photos for how small it is

#

the only downside is it can fit about 4 full res photos onto itself.

manic glacierBOT
#

Another question: will you consider the changes from #7996 to EPaperDisplay.c? I.E. supporting a shiftregister pin as a busy pin? This would help since with a busy pin the value of refresh_time is ignored anyhow.

Supporting shift register would be ok but I doubt it buys you much time. My understanding is that the refresh sequence is fixed by the LUTs and will take the same amount of time each time. So, the busy pin will just get you a slightly more precise delay time.

slender iron
brazen hatch
#

Yea that's prolly for the best.

crimson ferry
#

@idle owl silly me, occurred to me that if all you need is roughly-one-second intervals, you don't have to mess with rtc, time.time() will give seconds, monotonic since last reset (or last set of rtc, if applicable)

#

(it just won't be the right clock time unless rtc is set)

brazen hatch
#

I have been monitoring it since I wait to push my own commits that expect mpy-cross for 8.1.0.

tulip sleet
idle owl
crimson ferry
#

time.time() won't do that, it's an int

idle owl
idle owl
#

🤦🏻‍♀️

jaunty juniper
#

it's also not available on small builds

#

(big int)

idle owl
#

QT Py ESP32-S3.

#

That's all I need

idle owl
#

Or what's the deal there....

crimson ferry
#

not in our lifetimes

#

or the lifetime of the solar system??

#

I dunno, it can get huge

idle owl
#

Fair enough.

jaunty juniper
#

only ticks_ms() loops back

idle owl
#

Also, oof, I'm getting espidf errors again here.

#

Trying things.

#

The ping is happening too fast. 😂 The timing error I found? I had it set to if timea - timeb > interval:, so if the interval was set to 1, it would trigger at 2 seconds.

#

Either I broke my time stuff and it's happening faster than 1 time per second, or I found the ping limitation, and it's present on ESP32-S3 too.