One failure is due to the network, not the PR.
#circuitpython-dev
1 messages Β· Page 392 of 1
Hi everyone! Text only for me today.
hi @mental nexus nice to see you're able to join us even if it's in text-only form
me π
We've merged 91% of all our closed pull requests, which I think is also a REALLY good average compared to github projects at large.
The Hacktoberfest labeling did not work properly. Search for Good First Issue.
Because of the 8 days between meetings, the list of contributors may have been incomplete (it covers 7 days). Yesterday's report recognized: ajs256, EmergReanimator, and fgervais in addition to the ones in the report that Dan was reading.
Great looking GUI @errant grail
Windows 8.1 Mainstream support ended on January 9, 2018. Extended support until January 10, 2023
Here I am receiving Frankfurt signal. I am in distance from French equivalent but it is less documented. Might be in reach for the UK signal too... but not my time zone. π @onyx hinge
@thorny jay this kind of module can receive DCF77 if you place the proper crystal in it, but you need different software to understand the signal. https://www.universal-solder.ca/product/canaduino-dcf77-atomic-clock-receiver-module-77-5khz-for-europe/
TDF would need a different receiver, I think
Thansk
Thanks all!
Thanks Dan!π
Thanks Dan and all. Trying to listen from the new office Iβm in with almost no signal
Thanks, I was also checking the decryption of the meteo signal and how to build yourself an antenna for that frequency... also how to emit a pirate signal for a radio-controled clock (I have two of them). So far this has been theoretical knowledge, I have not invested into doing it yet. π
That was great, and I love your voice too!
I made a CLUE timecode something that HID type the timecode.
Not sure it was really a succesfull gadget, but it exist.
Interesting things, the TDF signal has two bits to signal whether today/tomorrow are public holidays. WWVB doesn't transmit that information.
It's a rabit hole! I have learned a lot.
it was kattni
I recommend this video: https://www.youtube.com/watch?v=6SHGAEhnsYk about time... this is how it started for me.
A remotely controlled, precise analog wall clock like that one from IKEA is a cool thing. Today we will build our own remote control for such analog and digital clocks. All we need is a Raspberry Pi and a few electronic components. And we will learn something about resonance frequencies, capacitors, and ferrite antennas. Letβs hack!
I am a proud...
I didn't really have a way to say it, I started with your document
I'm apparently up to 15 items "in progress" for hacktoberfest, my t-shirt is assured π
Well aren't you special π
Seriously, nicely done.
it's what happens when I shirk my reviewing duties
I've got the audio / discord screen recording configuration worked out successfully for recording a backup of the meeting this week. I will try to record a backup every week that I am present.
One more question and then it should be good. Thanks for your persistence.
Shouldn't this be done in set_alarms? Doing it in the constructor means it could get reset before the sleep.
@slender iron My recording is only me π¦ which is frustrating because I have a bunch of test recordings that worked fine. Some setting change happened. If you want to pass me your recording I will upload it and do the commenting, etc. I'm glad we had a backup, and I'll test it again next time.
@lone axle did you record today?
my recording has discord not in streamer mode at the start
My video is fine, I could substitute your audio track
I don't think it actually matters since this is a public server
what's the best way to share a 1.1GB file?
or I can just upload it
yes I do have a recording from today
Thanks. There could be some viable display widgets in there. Was also experimenting with βnormalizedβ cartesian and polar coordinates to try to achieve some independence from display pixel limitations β to support porting to various boards with integral displays.
@slender iron you could drop it in the adafruit google drive and share it; or @lone axle something similar -- thanks!
k, putting mine on google drive
@tidal kiln I have a question about the ATtiny8x7 breakout. If you're around. You may or may not know.
sure
Interesting, mine is only 84MB, but the video is fine
My backup copy is uploaded here: https://www.dropbox.com/s/sfren11a7wp0pkg/2021-10-12 13-03-00.mkv?dl=0 I started a few seconds early. I could try to cut the first few seconds out if it's helpful to use for something.
mine is a second or two early too
I noticed the top bar when it was discussed just before we began. I put it in but didn't know the best way to add purple background to it. I figured that out afterward though so future backup recordings will have the purple background and match visually the ones uploaded to youtube.
downloaded, thanks
that's mine, so good resolution, but much smaller. I don't think it's 900MB of missing audio
that is from VLC media info
Google Drive is a free way to keep your files backed up and easy to reach from any phone, tablet, or computer. Start with 15GB of Google storage β free.
just noticed that semver thinks 7.0.0-155-gf6681ef93 < 7.0.0-alpha.1, that makes the code that checks the mpy version in circup get it wrong on latest/local builds. We can simply change the cutoff in circup to 7.0.0-0 for example (who would fiddle with 7 pre alpha 1 ?) or ignore it until 7.0.1 which will also solve the issue for subsequent builds
@jaunty juniper How badly does getting it wrong break things? Aren't the mpys all the same for 7x builds?
If it'll be fixed later on its own, might as well wait if it's not terrible. But if it's really breaking things, probably worth the temp fix.
wait, I might be getting that wrong, let me check what version I'm using
among venvs and pyenvs
Here is the notes document for Mondayβs CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if youβll be attending the meeting - itβs super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and weβll read them off during the meeting. Hope to see you there! <@&356864093652516868>
https://docs.google.com/document/d/1GNNz8pJxypYCDj5toMMGoUZO56_Oiib-eYr4YLBjs4Q/edit?usp=sharing
Google Docs
CircuitPython Weekly for October 18, 2021 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates early. During the meeting, we go through them as a round robin sorted by username. If you canβt make the meeting and would still like to participate...
Cheers @tulip sleet!
this document is terrific! sorry for the misattribution
No apology needed. It's become a group effort. It's all of our baby now. π
And don't hesitate to use it moving forward. We all read off of it now that it's there. No reason to memorise any of it when it's available.
ah, ok yes the exact issue is with circup update complaining that the files have the wrong MPY format, but then installing the same (correct) version, so it's not a real issue ultimately
Hmm. That still sounds like it would be confusing though.
Or maybe not? I'm not looking right at it, you are.
it just gives you a bunch of:
WARNING: 'adafruit_hid': mpy format doesn't match the device's Circuitpython version. Updating is required.
Do you want to update? [y/N]:
yes or no, it will still work
Hmm.
What do you think? We don't want it to end up a bad experience for folks...
I guess if it works after yes, it's probably fine.
We could wait until someone else complains π
jepler@bert:~/src/zircup$ python3 -mcircup.__init__ update
Found device at /media/jepler/CIRCUITPY, running CircuitPython 7.0.0.
Found 1 module[s] needing update.
Please indicate which modules you wish to update:
'adafruit_progressbar' is a Major Version update and may contain breaking changes. Do you want to update? [y/N]: y
Updated adafruit_progressbar
jepler@bert:~/src/zircup$ python3 -mcircup.__init__ update
Found device at /media/jepler/CIRCUITPY, running CircuitPython 7.0.0.
Found 1 module[s] needing update.
Please indicate which modules you wish to update:
'adafruit_progressbar' is a Major Version update and may contain breaking changes. Do you want to update? [y/N]: y
Updated adafruit_progressbar
``` speaking of weird stuff with circup, it doesn't seem to upgrade adafruit_progressbar no matter how many times I say "yes"
Device version: None, Bundle version: None
Updated adafruit_progressbar
``` that's odd
it always assume it's a new version when the library doesn't have a version number
circup freeze will tell you the versions if finds
adafruit_hid==5.1.1
adafruit_progressbar==None
https://github.com/adafruit/Adafruit_CircuitPython_ProgressBar/blob/main/adafruit_progressbar/__init__.py oh is something missing here?
I'm trying to build CircuitPython for a custom STM32H742VIT6 based board by using the openmv_h7 board files as a reference. That board is based on the STM32H743 which simply has more features than the STM32H742. I copied/renamed the directory to my board name, and changed the pins.c file to match my pinout. I didn't change the processor name anywhere (might be a mistake), and I left the HSE value the same as I also use as 12MHz clock. It builds just fine, but after I program the chip it doesn't do anything. I have no issues compiling/deploying CircuitPyton for custom STM32F405, but this is my first time with an H7 device. Anyone have any suggestions on things I should try?
I've gotten USB PIDs from Espressif for use on the DevkitC. Just in case. VID is 0x303A //Espressif USB VID
0x7002 | ESP32-S3-DevKitC-1 - UF2 Bootloader
0x7003 | ESP32-S3-DevKitC-1 - CircuitPython
@heavy tendon it's usually best to use a debugger to see how far the code is getting
when a new chip isn't working
CircuitPython version
Adafruit CircuitPython 7.0.0 on 2021-09-20; Raspberry Pi Pico with rp2040
Code/REPL
# boot.py
import time
import usb_hid
print("booting...")
def find_device(devices, *, usage_page, usage):
"""Search through the provided list of devices to find the one with the matching usage_page and
usage."""
if hasattr(devices, "send_report"):
devices = [devices]
for device in devices:
if (
...
Here is a post that I found some times ago:
https://developer.apple.com/forums/thread/652700
This is also about absolute mouse positioning.
I also fiddled around with the HID descriptor but in my case the mouse movement under IOS always was relative regardless if I used relative or absolute in the descriptor.
But I will try again with the descriptor from bitboy85 mentioned above.
I will let report back.
How difficult is it to create a branch of CircuitPython with the HID device at position 0?
I'm currently writing a documentation for my upcoming DIY keyboard. The firmware is based on CircuitPython and is much easier to use than others like QMK. Not being able to emulate a boot keyboard is of course a big show stopper. For example: under macOS you can not login without a boot keyboard if your hard disk is encrypted and most users encrypt their HD.
See  # Report ID (11 decimal)
Do not put the Mouse class in boot.py. It will not be available when code.py runs. You need it to be in something you import from code.py directly or indirectly.
@dhalbert Thanks, just tried it but I get the same error as before (USB Busy).
The Mouse class is only in boot.py for testing purposes. I only want to see the mouse move one time right now.
@JaggerJo The devices are not set up until just before code.py runs. USB is not turned on at all in boot.py.
@dhalbert works. Thank you!
Thank you very much. I have never built CircuitPython myself. Therefore I would like to ask if you could build me a version for the Raspberry Pico?
With boot mode I simply mean: Boot the mac and try to login. A CircuitPython keyboard does not work at this point. It event does no work if the mac is in sleep mode and you try to wake it up with a CircuitPython keyboard. If you press a key in sleep mode, then the Mac does not wake up. But worse, the keyboard does not work after waking up. You ...
CircuitPython version
7.0.0 on Pi Pico with ESP32, connected as in http://helloraspberrypi.blogspot.com/2021/05/raspberry-pi-picocircuitpython_16.html
Code/REPL
As in http://helloraspberrypi.blogspot.com/2021/05/raspberry-pi-picocircuitpython_16.html
Behavior
Same error as in https://github.com/adafruit/nina-fw/issues/26 , despite newest nina-fw (1.7.4). After switching to CP 6.3.0 everything works as expected.
Description
No response
##...
Could you please describe a little bit in more detail what "works" ?
Are you simulating a mouse over USB or Bluetooth?
To what host do you connect your Mouse? Windows, Linux, MacOS, IOS?
Sure, I'm simulating a Mouse over USB.
Tried absolute positioning on a linux host.
Did not test it on windows/macOS yet.
Just for clarification the chip is working fine, and it programs just fine (using the DFU Bootloader). The Circuit Python build isn't working so either I missed something in modifying the board files for it or what I'm basing it on isn't working. My next step is to test out the OpenMV_H7 board to verify that works as I based the board files from that. If that works okay I'll pull out the debugger to see where the code is stopping on my board.
@tidal kiln I can't figure out how you highlighted multiple lines on GitHub to provide a permalink that highlights multiple lines. Did you edit the URL? Or is there some click and drag magic I'm missing.
in general, same as single line, the ... next to hightlight
Right but... I can't get it to recognise more than one line.
<SHIFT>-click to multi select
np
I've started on this. Difficulties so far include:
- [ ] f-string implementation is not quite compatible. In particular,
f"" f""concatenation is not supported. I think we should accept this minor regression - [ ] we should consider whether to revert our
make_newslot prototype to match upstream
In my WIP branch, make VARIANT=coverage test_full now passes, but all the ports are broken.
I did a bisect on this, and it turns out to be
- #5100
When PDMIn.record() happens, it now loops forever inside common_hal_audiobusio_pdmin_record_to_buffer().
@tannewt @DavePutz
common_hal_audiobusio_pdmin_record_to_buffer() uses the event system for handling incoming I2S data. I do not know yet why #5100 broke this, but one or the other is making some assumption about the event system setup that is not shared by the other. If you have an idea, I'd be very interested.
Board definition for Lolin S2-Pico, ESP32-S2FN4R2 based board.
4MB Flash, 2MB PSRAM
Onboard SSD1306 128x32 display, I2C connected.
Upstream uses a make_new signature of
typedef mp_obj_t (*mp_make_new_fun_t)(const mp_obj_type_t *type, size_t n_args,
size_t n_kw, const mp_obj_t *args);
while we have
typedef mp_obj_t (*mp_make_new_fun_t)(const mp_obj_type_t *type, size_t n_args,
const mp_obj_t *args, mp_map_t *kw_args);
I've completed the transition for one board (CircuitPlayground Express) and found the sum of the size of all the make_new functions in that build. Before, they summed...
@crude blaze fyi I'm working more on cp rpi. so check with me before you do
Loads OK on my board. All broken out pins look to be present.
Thanks for the review @evildave666 -- thanks for the new board @skieast !
I am on the track of something. Commenting out the !event_interrupt_active(event_channel) check loop below prevents the infinite loop. That test is probably being misled by the new use of the event system.
// Wait for the next buffer to fill
//uint32_t wait_counts = 0;
#ifdef SAMD21
#define MAX_WAIT_COUNTS 1000
#endif
#ifdef SAM_D5X_E5X
#define MAX_WAIT_COUNTS 6000
#endif
// If wait_counts exceeds th...
I would kind of like to revisit the decision not to make a board.I2C singleton for the Lolin S2 Mini. While the board does not explicitly show an i2c pair of pins explicitly on the silkscreen, it is designed to interoperate with the existing ecosystem of boards for the D1 Mini, for which there IS a standard for i2C on the pinheader (SCL D1 aka GPIO35 and SDA D2 aka GPIO33)
I also got "it working" on a ItsyBitsy nRF52840 as Bluetooth HID device.
But only on MAC OS !
(Did not test linux, but JaggerJo confirmed that it is working there)
Under Windows and under IOS absolute HID mouse reports do not seem to be accepted.
I contacted someone at Apple with a feature request to make it working also under IOS.
I tested some "Digitizer"-usage absolute positioning HID devices a long time ago, considering whether to include them in the standard devices we provided. I could not find a descriptor that would work on all three major operating systems, so I omitted it. At that time I did include a gamepad, but even it did not work on all three. That's why I dropped it when I added custom HID device capability.
@spiral elk in fact the schematic labels sda/scl https://www.wemos.cc/en/latest/_static/files/sch_s2_mini_v1.0.0.pdf
I'd be tempted to start with QEMU's tablet descriptor static const uint8_t qemu_tablet_hid_report_descriptor[] = {https://github.com/qemu/qemu/blob/e4f3ede95ce813d5705c65e1c0e1c80c70739ebb/hw/usb/dev-hid.c#L486
but perhaps you tried it
@tannewt there's a nice size savings to reverting to upstream's make_new signature ^^^ so I think we should follow them.
Can you give me an idea what to test for subclassing native types? #1472 is about displayio.Shape. I did test that class NeoPixel(adafruit_pixelbuf.PixelBuf) still works, which I think fits the bill. The brightness= and other kwargs are successfully handled when constructing the native object.
I've got this same issue, here's a simple example:
import alarm
import board
import time
from neopixel import NeoPixel
pixels = NeoPixel(board.NEOPIXEL, 4)
if alarm.wake_alarm is None:
pixels.fill((255, 0, 0))
else:
pixels.fill((0, 255, 0))
time.sleep(1)
pins = (board.BUTTON_A, board.BUTTON_D)
button_alarms = [alarm.pin.PinAlarm(pin=pin, value=False, pull=True) for pin in pins]
alarm.exit_and_deep_sleep_until_alarms(*button_alarms)
@slender iron if you have time for a video discussion I am trying to fix the PDMIn bug and noticing hundreds of thousands of calls to the evsys handler in a very short time. Very confusing
@tulip sleet I have a meeting in 10 but can chat after
π
@tidal kiln thanks for your testing and review on those PRs! Sorry for that erroneous PR. I thought I missed a step on that first PR and didn't look at it carefully.
no worries. many moving parts. it can be confusing.
@idle owl hey, do you know state of CP lib for VL53L1X? (PID 3967)
There isn't one? I thought we already had one. Oh. I see. 0X vs 1X. Maybe the VL53L0X lib works with it?
yah, it's the newerish one.
hmmm...not sure. mayb. product page says nothing w.r.t. CP.
I thought it replaced it? The PID is low for a new product.
I didn't realise it was different.
I was told to order one or two, so I'm assuming its guide is coming up. I'd obviously know at that point.
ok. maybe it's in work. also easy enough to check using 0x lib real quick...
True
doing that now...
Great
Adafruit CircuitPython 7.0.0 on 2021-09-20; Adafruit QT Py M0 with samd21e18
>>> import board
>>> import adafruit_vl53l0x
>>> vl = adafruit_vl53l0x.VL53L0X(board.I2C())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "adafruit_vl53l0x.py", line 153, in __init__
RuntimeError: Failed to find expected ID register values. Check wiring!
>>>
no free donuts here π¦
@tulip sleet I'm free now
ok, I'm in better shape, but still a couple q's
Ah fair enough.
So it'll need to be updated or a new lib.
@tidal kiln Do you have an APDS9960 handy? Can you check something if you do?
Hi,
We added the D17/Battery pin definition to the pins.c file.
Let me know if there are any problems with the pr, thanks in advance.
It's regarding this: https://forums.adafruit.com/viewtopic.php?f=60&t=184145
If they're right, then the guide is wrong. Not sure how it ever worked that way. There's a screenshot in the guide of it working.
@idle owl will take a look. handy enough if need to test.
Thanks. If it is wrong, can you get a screenshot of it done right and, if you don't want to update the guide, give it to me and I'll do it?
@idle owl it's wrong. you can blame me if you want π
https://github.com/adafruit/Adafruit_CircuitPython_APDS9960/pull/19
Hah nice
just so old it goes back to when we weren't using @property as regularly
Ah fair enough. So what makes more sense. Make it work like it used to or update the guide?
no need to test, just remove () and change verbiage to me property-esque
yah. just simple guide update.
or cheat. one sec....
I'll reply to the post.
Nice
{ MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO17) },
{ MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_GPIO17) },
LGTM! Thanks for the PR @leoli51. Just one suggestion, its up to you to implement it.
Hmm... for some reason https://github.com/adafruit/circuitpython/actions/runs/1342886040 doesn't exhibit the same behavior.
In that actions,
Run dorny/paths-filter@v2
Fetching list of changed files for PR#5465 from Github API
Invoking listFiles(pull_number: 5465, page: 1, per_page: 100)
Received 1 items
[modified] ports/raspberrypi/boards/melopero_shake_rp2040/pins.c
Invoking listFiles(pull_number: 5465, page: 2, per_page: 100)
Received 0 items
All changed files has been fetched from GitHub API
Detected 1 changed files
Results:
Filter changed = true
Matching files:
ports/raspberr...
@jepler Thanks for the explanation. I think switching back is the right way to go. I don't remember what didn't work.
cool! Yea will probably be at least a couple weeks before I have time to look into it again, will get in touch :)
Halp, pls.
How do I take this code and make it fade the LED down as well as up (which is what it does right now. Fades up, then turns off, fades up again.)py while True: pwm.duty_cycle = (pwm.duty_cycle + 256) % 65536 time.sleep(0.01)
I tried to do it the other day and went in circles, so I'm not even going to try today without some assistance.
The standard PWM fade up and down code doesn't work the same. Tried to adapt that too. Failed.
you'll probably want a second loop
or a trig function π
Closes: #5463
Minor incompatibility: String concatenation of f-strings is no longer permitted. It did not work properly before (or it had important caveats), but CP didn't detect the problem.
Needs a change in ulab
Testing performed so far:
- built & tested firmware on CPX
- built firmware for feather nrf52840 sense & adafruit feather rp2040
I'll fix up other ports & boards after CI. I know I missed some "make_new" cha...
Um... Essentials guide, PWM page. Hold on.
Uses a for loop.
Which I think might work
but I can't figure out the second half of the loop.
that should work. looks like basically a saw tooth.
It didn't when I tried it...
I can try it again. But I kind of like the simplicity of the current example.
error? or just nothing happened?
Nothing happened, or wait, maybe it flickered weirdly?
Not sure I remember now.
Flickering I think.
Or wait....
Ok when it "worked" it flickered, when it didn't work, it gave an OverflowError
I like to use a "step" variable and change its sign when the max or 0 is reached
that's a good idea too, flip step
I am unsure how to implement any of the suggestions so far, heh
or a for loop on (list(range(0,max,step)) + list(range(max,0,-step)))
but that's a little weird looking
STEP = 100
DELAY = 0.01
while True:
for dc in range(0, 65535, STEP):
led.duty_cycle = dc
time.sleep(DELAY)
for dc in range(65534, 0, -STEP):
led.duty_cycle = dc
time.sleep(DELAY)
STEP = 100
DELAY = 0.01
while True:
print("fade up")
for dc in range(0, 65535, STEP):
led.duty_cycle = dc
time.sleep(DELAY)
print("fade down")
for dc in range(65534, 0, -STEP):
led.duty_cycle = dc
time.sleep(DELAY)
get expected prints at least?
show()
llol. Apparently.
OK, so it goes through the range at step increments up, and then does the same but down?
That's good for me
could probably make the whole thing a single list comp if you wanted
can we join 2 iterators without unrolling them ?
itertools.chain?
you can also make your own:
def chain(first, second):
for item in first:
yield item
for item in second:
yield item
Thanks for the help all!
hmm can you use yield from there?
ah that works, it's an iterator, but multiple for in a comprehension is not the most comprehensible
iter = (item for a_range in (range(500000), range(800000)) for item in a_range)
for i in iter:
...
def chain(first, second):
yield from first
yield from second
def chain(*args):
for item in args:
yield from item
here is one for chaining any number of them
yeah, yield from is one of those things they added in python 3, which as we all know is no longer real python ;-)
@tidal kiln Mind looking at my wiring diagram? It's super simple but I'd appreciate a second opinion on it.
Now I have to wait N minutes for my screenshot to show up. Thanks, laptop. Sigh.
There it is.
well this didn't turn out as minimal or intuitive as I thought, but it's a pretty sinusoidal pulsing ;-)```STEP = math.pi / 100
DELAY = 0.01
led = pwmio.PWMOut(board.LED, frequency=5000, duty_cycle=0)
dc = 0
while True:
led.duty_cycle = int(65535 * (1 + math.sin(dc)) / 2)
dc = (dc + STEP) % (2 * math.pi)
time.sleep(DELAY)
@idle owl sure. you uploading here? or in a guide?
Oh here. I was waiting to hear back from you @tidal kiln
Is that easy to follow or should I use a jumper wire to the resistor?
I mean, that's literally how I wired it up on my board
But I don't want to make support issues
Ok thanks
@tidal kiln What range of resistor is good for LEDs? I used 220Ξ© but we usually recommend what, 220-1k or something?
I know I wrote that into a guide somewhere, but finding it will take ages I think.
i'd just call out 1k or something
Oh ok
Kitronik Ltd
This calculator works out the resistor value to accompany an LED by entering the battery voltage along with the LED forward voltage and typical current. Parameters for Kitronik LEDs can be picked from a list and the calculator even recommend a preferred resistor value complete with colour bands.
Should I update the diagram then?
LEDs come on fine with small amount of current
Ugh yeah, I know, but.... come on. Don't wanna do math.
no need to try and figure out r value for max
Ok, I'll change the diagram and text to go with it.
That made me seriously bust out thank you for that
pretty sure i've used 10k even and was good enough to see
You're entirely welcome π
you'd also need to consider max current source for the given chip - like what the attiny817 can put out on pin 12
LEDs typ max is like 20mA
which can be more than some MCUs can source
Right, my housemate started in on all of that when giving me a resistor to begin with
Then I Said "just give me 220"
another reason to just crank up the value
He was going to math it based on the type/size/color of LED, and the ATtiny output, etc....
Fair enough
Everything is updated.
if people really want to make brighter, can link to guide
there's an adafruit one also
Nah, this isn't about the LED really.
It's about seesaw PWM.
So...
not super concerned.
But when I show 220, I always say "you can use up to foo Ξ© resistor"
Because maybe I was told to ages ago? Or I made that up in my head and have been doing it for no reason.
@tidal kiln Sorry to keep bugging you, but can we talk EEPROM?
@gilded cradle do you have updates to code.cp.org pending? I think I'll wait to test until it's updated
@idle owl sure
So apparently the ATtiny has actual EEPROM. But the SAMD09 gets emulated EEPROM through the seesaw firmware. Is the idea here that the seesaw firmware gives you access to the ATtiny EEPROM space?
that'd be my guess
(To be clear, I have no idea what EEPROM even is, but I'm going based on comments in the example.)
it's non-volatile memory
Does that mean it persists?
yep. with power cycle.
Ok
it's general purpose
can just write/read stuff
it there again after reset and power cycles
Ok, and apparently on the ATtiny, full erase as well, but not the SAMD09.
?
SAMD09 EEPROM page: https://learn.adafruit.com/adafruit-seesaw-atsamd09-breakout/eeprom
Which I pinged Limor about because she had me mirror that in and it's not really relevant to ATtiny.
Not entirely anyway.
let me look at the attiny firmware. curious what it acutally does.
Ok thanks
looks like it ends up just using the core lib:
https://github.com/adafruit/Adafruit_seesawPeripheral/blob/46a0f7a8956c27ec4f075e4ffd0941ecb7661325/Adafruit_seesawPeripheral.h#L23
so, uses real EEPROM
yah, so the SAMD09 verbiage doesn't apply
Right, exactly.
Performing a chip erase will erase all data stored in the emulated EEPROM.
So is it fair to say "The seesaw firmware that ships with the ATtiny817 breakout provides access to the 128 byte EEPROM. This example reads from and writes to the EEPROM."
?
this comment is just because, for the SAMD, it's emulated in FLASH
^^ that looks OK
Ok great, thanks. Now I need to do a quick explainer on the code.
Seems like the prints kind of give away what it's doing
the firmware may limit access to 64 bytes though?
so the register values would be different also
Right....
@slender iron yeah. I'm still working on some more file operation stuff. I'll submit a PR after that and will focus on the device compatibility stuff after.
so that entire EEPROM page is kinda not right for it.
lol. Fair enough.
and the base address is prolly same 0x0D
But the I2C address change byte would be different.
it's bringing in the defines from the arduino lib:
https://github.com/adafruit/Adafruit_seesawPeripheral/blob/46a0f7a8956c27ec4f075e4ffd0941ecb7661325/Adafruit_seesawPeripheral.h#L10
Ah yeah
yes, the other address would change
Oh..... wait it's not a special addr based on... the size of the EEPROM
oh
ok
That doesn't entirely make sense to me.
ohhhhhh
Nevermind, I just parsed what you said.
This is for accessing EEPROM.
yah
This is for changing I2C address, regardless of EEPROM size.
That comment in the code is confusing then.
Also the EEPROM page says ```
0x3F
I2C Address
8 bits
Read/Write```
So... I'm back to confused
0x3F == 63, so the last byte of the 64, of the emulated SAMD EEPROM
it's def reading and setting the base address from the last byte:
https://github.com/adafruit/Adafruit_seesawPeripheral/blob/46a0f7a8956c27ec4f075e4ffd0941ecb7661325/Adafruit_seesawPeripheral.h#L184
Ok
earlier in same code:
#define EEPROM_I2C_ADDR (EEPROM.length()-1)
Ahhh
still not sure about the setting (writing) part though. i could be confused, so still looking...
Maybe you can't set the I2C address? It's stored there only?
No, comment says "change"
so presumably you could increment it or something
@idle owl i remain confused about this logic:
https://github.com/adafruit/Adafruit_seesawPeripheral/blob/46a0f7a8956c27ec4f075e4ffd0941ecb7661325/Adafruit_seesawPeripheral_receive.h#L172
That does not bode well for me understanding it.
not sure why it can't just be generic writing to whatever address
and the docs just cover the fact that the last entry has special meaning
Hmm.
i'm probably missing something though
can ask over in other chat when you get a response
I'm not fully sure what to even ask. π
Also, will likely not be around when I hear back. It's already 6pm here. Limor often replies at $TIME of the day.
it's the i2c address part that's confusing
I'll try to ask about it tomorrow then.
yah
made a note to do so.
@tidal kiln This EEPROM example doesn't run anyway.
This is for tomorrow for sure. Heh.
Thanks for all your help with this board. I seriously wouldn't have managed to get this far without your assistance.
Yes
I tweaked a couple of cosmetic things with it, but nothing crucial.
So I don't think I made it fail
It's failing on the write line.
Adafruit CircuitPython 7.0.0 on 2021-09-20; Adafruit QT Py M0 with samd21e18
>>> import board
>>> from adafruit_seesaw import seesaw
>>> ss = seesaw.Seesaw(board.I2C())
>>> ss.eeprom_read8(0)
255
>>> ss.eeprom_write8(0, 42)
>>> ss.eeprom_read8(0)
42
>>>
>>> val = ss.eeprom_read8(0)
>>> ss.eeprom_write8(0, val + 1)
>>> ss.eeprom_read8(0)
43
>>>
Same issue.
Was wondering if I had an older version of it somehow, which I knew I didn't, but was worth a try I guess.
@tidal kiln Are you around tomorrow?
>>> import seesaw_eeprom_test
Read 0xff from EEPROM address 0x02
Incremening value
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "seesaw_eeprom_test.py", line 22, in <module>
File "adafruit_seesaw/seesaw.py", line 437, in eeprom_write8
OverflowError: value must fit in 1 byte(s)
>>>
That!
it's because it was 0xFF to start
Oh hmm.
+1ing that made it not fit
So update it to -1 ?
For the purpose of the example?
Or... is it an underlying issue?
Right, but that won't help folks who are running the example themselves, will it?
correct. they'd hit same issue.
I don't have another one of these boards to run "fresh" if I write it manually.
Ok, then something has to change.
The example, or something...
the simulated in SAMD is probably int'd to all 0s
I'll add a variable at the beginning, that you set to +1 or -1 depending on board.
And increment by the variable
There are other examples with things that don't work by default on SAMD
pin assignments there, but still
or just some absolute value
instead of incrementing what was read
just write something and then read it back
or do the increment thing, but add some logic to check bounds
So write first, read, increment, read?
print("Incremening value")
ss.eeprom_write8(0x02, min(0xFF, val + 1))
That results in the same value.
code.py output:
Read 0xff from EEPROM address 0x02
Incrementing value
Second read 0xff from EEPROM address 0x02
Code runs though.
yah. expected. but confusing.
Right.
MY_VALUE = 42
#
# blah blah blah
#
print("Writing value")
ss.eeprom_write8(0x02, MY_VALUE)
val = ss.eeprom_read8(0x02)
print("Read 0x%02x from EEPROM address 0x02" % val)
Ah ok
the incrementing is cute, but not sure it's really necessary for the example
I'll try it tomorrow. It's getting late here.
yep
You around tomorrow?
only in am
Ah ok. I may miss you then. Which sucks for me because I have to tackle Arduino tomorrow for this guide. π
But good to know, so I don't bug you when you're out.
i'll be around, but got out-of-towners showing up at some point
I mean, you're 3 hours behind me, afaik, so we might have a bit of overlap, but I guarantee it won't be when I run into problems.
Ah nice.
Well, if I don't talk to you, have a lovely weekend!
Thanks again
Originally when the S2 Mini board was brought up, there was some discussion as to whether or not to include an I2C singleton for it, as there was no explicit marking for such on the silkscreen for the board.
However, the S2 Mini is designed to be pinheader compatible with the ecosystem of shields for the Lolin/Wemos D1 Mini, and that does have a standard for I2C (they produce at least 6 shield boards using this standard as well as a board that provides a qwiic-like connector for several di...
Since circuit python donβt have interrupts, how can I use encoders with it?
Does the countio module work for what you need? You may also find more help in the #help-with-circuitpython area
countio Thatβs somewhere I need to look into. Thanks!
@gilded pewter Isn't rotaryio designed to work with rotary encoders? It works very well for me...
Wow, For some reason I was not able to find these libraries. Thanks!
I was able to enable
but not
because that one requires a bytecode format change.
When a device (esp32-s2) goes into hardfault, are the pins in an unknown state? I'm trying to come up with a hardware watchdog that will hard reset the device if it goes into hardfault.
If it really does hardfault, say due to a memory error, then it will got into safe mode. Is that what you're trying to detect?
the pins usually all get reset to inputs
yes, the hardfaults are intermittent and I haven't narrowed them down yet, so I want to workaround it by resetting
We were talking in https://github.com/adafruit/circuitpython/issues/2694 about some ways to recover from safe mode, like have a safemode.py that runs only if you are in safe mode.
I can probably rig up some continuous output as a watchdog
THese devices may or may not be helpful. They could monitor a pin. https://www.adafruit.com/?q=tpl&sort=BestMatch
I have both, was looking at the TPL5111 earlier and I think that might do it, thanks!
safemode.py is a cool idea
rotaryio: Add the ability to set the divisor
At present, Adafruit's rotary encoders all move 1 quadrature cycle per detent, so we originally hard-coded division-by-4. However, other encoders exist, including ones without detents, ones with 2 detents per cycle, and others with 4 detents per cycle.
The new divisor property and constructor argument allows selecting a divisor of 1, 2, or 4; with the default of 4 giving backward compatibility....
CircuitPython version
Adafruit CircuitPython 7.0.0 on 2021-09-20; Raspberry Pi Pico with rp2040
Board ID:raspberry_pi_pico
boot.py output:
Write to Flash : False
Write to SD Card: True
boot.py Finis
Code/REPL
No erreo code given when it crashes. Must push reset or remove power.
Behavior
Crash without 'import microcontroller' even though not used.
Runs just fine with 'import microcontroller'
Description
I built an application that...
'''
IR Relay and translate by B.B.Blake 10/10/2021
'''
import board
import digitalio
from digitalio import DigitalInOut, Direction, Pull
import neopixel
import pulseio
import pwmio
import time
import microcontroller
#from microcontroller import pin
#test = pin.GPIO6
import adafruit_esp32spi
from adafruit_esp32spi import PWMOut
import adafruit_irremote
Pico = False
Itsy = False
bd = board.board_id
print("\f" + bd, end=" ")
if(bd == "adafruit_itsybitsy_rp2...
@onyx hinge could i ask you about the make_new signatures?
This kind of sig:
STATIC mp_obj_t bleio_adapter_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args)
is becoming
STATIC mp_obj_t bleio_adapter_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *pos_args)
But why is the last argument called pos_args? They are not the positional-only args, but the entire array of args, is that right? I would call it args but it conflicts with mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
@tulip sleet yeah that's more or less why I didn't rename the parameter: I didn't know what the new name should be
all_args ?
what does micropython call it in their similar make_new's
i would really like to call n_args -> n_pos_args, but that involves changing extmod stuff, etc.
extmod/modbluetooth.c:STATIC mp_obj_t bluetooth_uuid_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { yeah I guess all_args
often just args but probably they're not using kwargs at all there extmod/moduasyncio.c:STATIC mp_obj_t task_queue_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
oh, they are already using all_args sometimes? I just made that up
i like all_args, and we can change ours
OK I'll change them to all_args
thanks! I am at 225/412 files. I will keep going on this commit.
unfortunately this'll make a bunch of files appear as changed again
that's ok, I will just look over the latest commit by itself after I finish the current list from the current latest commit
i have not seen anything else to change yet; it looks really good. I really appreciate your doing this!!
happy to
I appreciate you looking over it
weird, none to change in port bindings?
oh there's one
weird is gnss module actually not enabled on cxd56? it doesn't look like it should build.
one more q. why is this no longer .exe ? It is a windows executable, I thought. Or is the .exe added later?
3d9af877215c9f904a7d64c3fa4da79e5780a818
windows/Makefile: Add .exe extension to executables name.
aha, thanks
seems that it automatically applied itself to our mpy-cross build
the build worked but actions didn't upload the artifact .. a non-fatal condition, but happily I noticed it as a warning
hmm, but is mpy's windows build mingw or MS's compiler?
weird that it applies
i am not complaining
the windows mpy-cross.exe is built on linux with mingw
but windows/Makefile came into the picture
I think the commit comment is wrong, it changed py/mkrules.mk
Terrific! I requested pos_args -> all_args in discord. I am all ready to approve after that commit.
@tulip sleet whoops, just pushed it
np, building locally for some smoke tests. I notice python has to be python3. For some reason I had it python2. sudo apt install python-is-python3 fixed it, but I should add it to the guide
@tulip sleet hmmm I saw that they did away with use of $(PYTHON3) across all the Makefiles/.mk files and just use $(PYTHON) now.
yes, I was surprised by that, but we can live with it. Maybe due to windows, which installs python3 as python
the top-level Makefile has Makefile:PYTHON = python3 but that's not used 'normally' while building CP
officially, you're supposed to invoke "python3", according to some PEP I can find if ya like. so it seems a bit wrong..
i wonder if we should force it somewhere
make PYTHON=python3 probably works too
diff --git a/py/mkenv.mk b/py/mkenv.mk
index 981187685..5e7ae6a02 100644
--- a/py/mkenv.mk
+++ b/py/mkenv.mk
@@ -2,6 +2,9 @@ ifneq ($(lastword a b),b)
$(error These Makefiles require make 3.81 or newer)
endif
+# Invoke the python3 interpreter by default when $(PYTHON) is called for.
+PYTHON ?= python3
+
# Set TOP to be the path to get from the current directory (where make was
# invoked) to the top of the tree. $(lastword $(MAKEFILE_LIST)) returns
# the name of this makefile relative to where make was invoked.
``` maybe?
i like that; i am trying to find the mpy pr where they changed it
i think maybe it was us that did that, before they did this: https://github.com/micropython/micropython/pull/4448
huh maybe we failed at taking that bit during a past merge? That's from 2019
so really we want ```patch
--- a/py/mkenv.mk
+++ b/py/mkenv.mk
@@ -46,10 +46,7 @@ CD = cd
CP = cp
FIND = find
MKDIR = mkdir
-PYTHON = python
-# Set default python interpreters
-PYTHON2 ?= $(which python2 || which python2.7)
-PYTHON3 ?= python3
+PYTHON = python3
RM = rm
RSYNC = rsync
SED = sed
there were some old scripts that were python2, at some point
GitHub
The file py.mk contained a mix of references to PYTHON and PYTHON3, and did not build on a fresh install of Ubuntu (under Windows LXSS). Converting all of these to PYTHON3 fixed the issue
I think the old PYTHON lines were not changed when the merge happened because they were otherwise identical
we have a lot of $(PYTHON3) uses in our makefiles right now
do you want to handle this right now or leave it for .. soon ?
we could change those back if we make a top-level change
well, it didn't actually build for me until I fixed my python-is-python2 problem (I normally have it as python3). I think I changed it temporarily while working on something else completely, and then forgot to change it back
we could change those back to PYTHON if you add your other fix above. I think that's OK. We can cancel the build that's running now.
oh wait you had /usr/bin/python -> python3 and it didn't work?
to save time
I have python-is-python3 installed and that was okay here
no no, I had this:
EN build-raspberry_pi_pico/genhdr/moduledefs.h
File "../../py/genlast.py", line 50
print(e, file=sys.stderr)
^
SyntaxError: invalid syntax
make: *** [../../py/mkrules.mk:100: build-raspberry_pi_pico/genhdr/qstr.split] Error 1
halbert@tuna:~/repos/jepler/circuitpython/ports/raspberrypi$ which python
/usr/bin/python
halbert@tuna:~/repos/jepler/circuitpython/ports/raspberrypi$ python
Python 2.7.18 (default, Mar 8 2021, 13:02:45)
[GCC 9.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Ubuntu does not come out of the box with a /usr/bin/python, I think
I was running some other build script (not us) that needed it
with this patch https://gist.github.com/5a7f83c284b0628b2bbd5b308abb09cc I can build circuitpython even with no "python" "python2" or "python2.7" program on the PATH.
/usr/bin/python3
/usr/bin/python3.9
jepler@bert:~/src/circuitpython/ports/raspberrypi$ make BOARD=adafruit_macropad_rp2040 -j9
I: Building for adafruit_macropad_rp2040 0
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
mkdir -p build-adafruit_macropad_rp2040/genhdr
text data bss dec hex filename
244 0 0 244 f4 build-adafruit_macropad_rp2040/boot2.elf
GEN build-adafruit_macropad_rp2040/genhdr/moduledefs.h
QSTR updated
720464 bytes used, 324016 bytes free in flash firmware space out of 1044480 bytes (1020.0kB).
15872 bytes used, 246272 bytes free in ram for stack and heap out of 262144 bytes (256.0kB).
Converting to uf2, output size: 1436672, start address: 0x10000000
Wrote 1436672 bytes to build-adafruit_macropad_rp2040/firmware.uf2
go ahead and push that, it's worth it
OK it's added to that PR
i canceled the previous action runs
thanks
i am going out for a walk and will approve and merge when I get back
Just a sanity check but there is not a current way to take say the LED glasses and use displayio on them as there is no driver like the RGBMatrix?
from adafruit_is31fl3741.adafruit_rgbmatrixqt import Adafruit_RGBMatrixQT ?
but I don't see a way to use displayio on it
CircuitPython version
Adafruit Circuit Python V7.0.0 Image from the website
Code/REPL
N/A
Behavior
N/A
Description
The STM32H743 Nucleo board doesn't seem to connect to via either the USB Serial or Mass Storage connection to the host using the Circuit Python 7.0.0 bin image off the website or an image built from the CircuitPython GitHub repository.
I verified the board works fine using the latest version of MicroPython.
I've also used...
That's right, they don't work with displayio
Copy-editing, and perhaps you don't need to shrink those two builds.
Thanks for simplifying the BAD transitions. I derived that table from first principles, before I actually coded the rest.
Maybe you can turn this back on now that #5463 is merged.
//| def __init__(self, pin_a: microcontroller.Pin, pin_b: microcontroller.Pin, divisor: int = 4) -> None:
Maybe you can turn this back on now that #5463 is merged.
I couldn't get the TPL5111 to do what I wanted, but a Trinket M0 as a watchdog co-processor did the trick, watching on an input-pullup for an ESP32-S2 output to transition from active-low to high-Z π
Just tested it on MacOS (Big Sur) and absolute mouse positioning works fine.
Update README in docs/ to reflect changes in package requirements. recommonmark is no longer used and has been replaced with myst-parser. Additionally there are other packages required, like isort and black. This change to the documentation covers all that and is future-proof for other changes to requirements that may happen.
Hi Dan,
I compiled your hid-boot-protocol branch and tested it with my keyboard but I'm sure I'm doing something wrong. Maybe you can help me. Here is the message in boot_out.txt:
Adafruit CircuitPython 5.0.0-alpha.0-11771-g13210d2cc-dirty on 2021-10-15; Raspberry Pi Pico with rp2040
Board ID:raspberry_pi_pico
boot.py output:
Traceback (most recent call last):
File "boot.py", line 41, in <module>
TypeError: extra keyword arguments given
Here is the code in line 41 in...
@akaenner Ah, sorry, I changed the name of the argument from boot_protocol to boot_device for clarity but didn't remember that. Use:
usb_hid.enable((usb_hid.Device.KEYBOARD,), boot_device=1 if not maintenance_mode else 0)
Thanks, rebased & re-enabled on those two boards. They're still within 100 bytes of full in the de_DE translation..
pip install -r requirements-doc.txt
Thanks for the PR @fraziern. One suggestion, I think the circuitpython/requirements-doc.txt is a more complete dependency file for docs, it is also used in CI.
Install the necessary packages, preferably in a virtualenv, in `circuitpython/`:
I can confirm this issue, V7.0.0 doesn't appear to function. V6.3.0 does:
soft reboot
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Hello World!
Code done running.
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 6.3.0 on 2021-06-01; NUCLEO STM32H743 with STM32H743
>>>
ok, here is the part of my boot.py which disables other devices and enables just the keyboard.
if not maintenance_mode:
storage.disable_usb_drive()
usb_cdc.disable()
usb_midi.disable()
usb_hid.enable((usb_hid.Device.KEYBOARD,), boot_device=1 if not maintenance_mode else 0)
The USB-Stick does not show up in the Finder an if I'm already logged in to the mac, the keyboard works.
But the keyboard still does not work when I try to login on a machine with an e...
MIDI should not be showing up; you are trying to turn it off in boot.py. Check your boot_out.txt to see if there are errors reported in boot.py, or perhaps the "maintenance_mode" switch is being checked in a backwards way.
Commit has been updated to incorporate changes. Thanks @microDev1
Also, if this PR is accepted, would you mind adding the hacktoberfest-accepted label to it please? Thanks!
Today I "stumbled" over this when trying to use an HID descriptor with a feature report...
Only after this test, I became aware of this issue here.
@dhalbert: once you figured out how to support feature reports "long term" in your C code, please check the code in
hid.py | HIDService | _init_devices(self) | line 645 and following.
There is a elif case missing for "tag == _MAIN_ITEM_TAG_FEATURE:"
Without this elif the code runs into an: raise RuntimeError("Unsupported main item in HID...
Thanks for the PR @fraziern. One suggestion, I think the circuitpython/requirements-doc.txt is a more complete dependency file for docs, it is also used in CI.
@ThomasAtBBTF I did a trial implementation of feature reports in https://github.com/dhalbert/circuitpython/tree/hid-boot-protocol, which I have not yet PR'd. If you have some non-BLE way of testing this, I would be very interested. I don't have a device in mind where I know the feature reports are used. The Surface Dial has one, but I am not sure how it's used, and it's hard to spy on the BLE HID traffic to see how.
I wonder why the Arduino watchdog timer library for samd51 messes with the USB peripheral ... https://github.com/adafruit/Adafruit_SleepyDog/blob/master/utility/WatchdogSAMD.cpp#L247
oh okay, it's disabling the USB peripheral's "run on standby" bit, wouldn't matter for CP.
The regex [\w-]+ matches [A-Za-z0-9_] and/or hyphen -.
The descriptor for a Braille Display I am having can also work on USB.
The code implementing this Display runs under Linux, but I think I can port it to CP.
(At least the important parts)
oh neat, I hadn't seen before that github will integrate failure messages from actions into a "compare" view. not sure what exactly allows it to do this.
There are "." characters too, such as
adafruit_magtag_2.9_grayscale
espressif_kaluga_1.3
The character class [^/] will match any character except "/", so there's no need to worry about a future board which chooses to embed a new character we didn't explicitly anticipate.
I forgot to import usb_cdc. Now the output from lsusb command for the Pico looks better:
Bus 020 Device 013: ID 239a:80f4
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x239a
idProduct 0x80f4
bcdDevice 1.00
iManufacturer ...
The wakeup problem is different than boot keyboard, and I need to work on that separately. If you plug in the RP2040 when the password prompt appears, does it still not work?
My Macs are not set up for this disk encryption, but there may be other boot-time choices (option-shift-whatever, etc.) that I can use to test without having to set one up for encryption. Do you know of some boot-time entry screens similar to the password request?
If you plug in the RP2040 when the password prompt appears, does it still not work?
No, this also does not work.
Do you know of some boot-time entry screens similar to the password request?
I don"t know how to reproduce this behaviour without an encrypted HD. But you can encrypt your HD at any time. It just takes some time to finish. See System Preferences > Security & Privacy > File Vault
https://wiki.friendlyarm.com/wiki/index.php/NanoPi_NEO3
PLS add example for adding new boards <3
It looks like the linked computer is a Linux single-board computer, so this guide may help you get started: https://learn.adafruit.com/adding-a-single-board-computer-to-platformdetect-for-blinka
@akaenner I have a simpler test of this, which is to start the Mac while holding down the "D" key, to get it into diagnostics mode. Then it lists the available wifi networks (wait for the spinning to stop), and an external keyboard's up and down arrow keys can go up and down the list of networks.
The "D" key is for Intel Macs. For M1 ("Apple silicon"), you just keep holding down the power button to get into a startup menu. https://support.apple.com/en-us/HT202731
Anyway, what I see on a...
This is to add Bread 2040 to the CircuitPython website. I believe everything is in order.
CircuitPython version
Adafruit CircuitPython 7.0.0 on 2021-09-20; Adafruit PyGamer with samd51j19
Code/REPL
import board
import displayio
import busio
_TFT_INIT = (
b"\x01\x80\x96" # SWRESET and Delay 150ms
b"\x11\x80\xff" # SLPOUT and Delay
b"\xb1\x03\x01\x2C\x2D" # _FRMCTR1
b"\xb2\x03\x01\x2C\x2D" # _FRMCTR2
b"\xb3\x06\x01\x2C\x2D\x01\x2C\x2D" # _FRMCTR3
b"\xb4\x01\x07" # _INVCTR line inversion
b"\xc0\x03\xa2\x02\x8...
I can confirm that 9eebb3dbabc64a8624e5b6ae41a18236c2e00d85 allows my half-cycle encoder to work properly, one increment per click, with divisor=2
[adafruit/circuitpython] Issue opened: #5477 Print read value from UART in a loop leads to crash bug
CircuitPython version
Adafruit CircuitPython 7.0.0 on 2021-09-20; Teensy 4.1 with IMXRT1062DVJ6A
Board ID:teensy41
Code/REPL
import busio
import board
ser = busio.UART(board.D20, board.D21, baudrate=115200)
for i in range(20):
print(ser.read(1))
Behavior
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
b'%'
b'\xbe'
b'\x1f'
Traceback (most recent call last):
File "cod...
Hi, please keep items in the features list limited to the items under: https://learn.adafruit.com/how-to-add-a-new-board-to-the-circuitpython-org-website/adding-to-downloads#header-3034486-5. This is used to generate a list of possible filters and the user won't see it otherwise. Even slight variations in spelling will cause multiple items to appear in the filter list.
You can move them to the description area and it will be fine. Thanks.
set this up but can't remember how
<@&356864093652516868> heads up! we'll be having the weekly meeting in about 20 minutes from now. Please add your notes to the document https://docs.google.com/document/d/1GNNz8pJxypYCDj5toMMGoUZO56_Oiib-eYr4YLBjs4Q/edit?usp=sharing and note if you're "(no mic)" or "(missing meeting)" so we can read your notes if necessary.
Google Docs
CircuitPython Weekly for October 18, 2021 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates early. During the meeting, we go through them as a round robin sorted by username. If you canβt make the meeting and would still like to participate...
Lurking today. Nothing to report.
Will check the recording, nothing to report.
Demonstrating PyDOS, a DOS like shell for microcontrollers running Micropython or Circuit Python, running on the Keyboard FeatherWing. The Keyboard FeatherWing with an RP2040 microcontroller board gives you a handheld device with much of the capability of an original IBM PC in the form factor of a Blackberry phone.
The Python and Basic code dem...
Melopero Electronics
Click below to download the getting started guide: GETTING STARTED GUIDE The Melopero Shake RP2040 is a powerful development board based on the Raspberry Pi RP2040 microcontroller, programmable in C/C++, MicroPython, CircuitPython and Arduino. The board features: 16Mbytes of FLASH Memory 3.7-4.2 LiPo battery charger (200mA charge curret) Battery...
Elmwood Electronics
We made Todbot's QTPy-knob: Simple USB knob w/ CircuitPython with a Adafruit QT Py, a NeoPixel Ring, a Rotary Encoder and some 3D-printed parts. It's glowy and useful! We modified the design so it would work with the Adafruit rotary encoder that we sell. For full details and instructions, go here: ElmwoodElectronics/qt
This week we chatted with Talley Lambert (@TalleyJLambert) who is a microscopist and Python enthusiast at Harvard Medical School. You can learn more about
i would like to use the _thread library from micropython please
Indeed.
lurking
I am here in the call. I can read my status report. I think lurking got pasted in the doc accidentally.
There is more info about Riskable's keyboard and switches in their Youtube here: https://www.youtube.com/channel/UCSsm4h2ccJMdR6bsAFyIu6A They've posted updates in the #show-and-tell channel as well, can find more pics and videos searching in that channel.
YouTube
A channel where I posted 3D printing related videos. If you want to chat with me about any of this stuff I'm riskable#4986 on Discord and @riskable:matrix.org on Matrix. You can support me via Patreon: https://www.patreon.com/riskable
ANO rotary encoder.
The magnet switches were featured on HaD as well: https://hackaday.com/2021/08/02/mag-lev-switches-are-the-future-of-clacking/
Demonstration of a configurable dual load cell scale utilizing a custom NAU7802 FeatherWing attached via Stemma to an Adafruit PyPortal. The scale is powered by CircuitPython. The test weight is uncalibrated.
@errant grail Been there with a fiberglass hazmat suit. Been a long time though. Had to deal with a deceased relative's attic, and we did it late at night, getting into the attic involved a hatchet... I was expecting someone to call the police because of how ridiculous it looked. But no one did. Not sure whom that says more about.
Yikes. A hatchet. Sounds like a scene from a nightmare movie.
Exactly. I was not looking forward to answering the door. π
@gilded cradle I figure we can vid chat later today or tomorrow, depending on what makes sense.
Sounds good
Another small one: The "older versions" listed in this section could be updated: https://learn.adafruit.com/welcome-to-circuitpython/frequently-asked-questions#i-have-to-continue-using-an-older-version-of-circuitpython-where-can-i-find-compatible-libraries-3039092-3
The PyCharm page could be updated with a set of best practices for using PyCharm. I'd be willing to work on that one if there is interest in keeping it.
great as is; the photo is a bit long in the tooth now
--- a missing topic: "How do I Learn Python?"
we are agnostic about this, but I think we should provide some pointers, perhaps to pages at Python.org, some books, online courses, etc. This question comes up frequently.
Frequently Asked Questions
maybe move this section down to above Troubleshooting? The first subsection about old library bundles is duplicative of something in Troubleshooting.
Installing CircuitPython
mention RPI-RP2 in the list of BOOT drive names
The CIRCUITPY Drive
The "renaming the drive" section could put on its own page and moved further down, since it takes a lot of space and is not that relevant to beginners.
Connecting to the Serial Console
Interacting with the Serial Console
Group these with the other Serial Console pages? See below.
CircuitPython Hardware
This is old and describes only some M0 boards. We could delete this, or make a separate guide. There is this page, but it's also out of date: https://learn.adafruit.com/how-to-choose-a-microcontroller/circuitpython-boards
Advanced Serial Console on Windows
Advanced Serial Console on Mac and Linux
Perhaps these could be grouped with the other Serial pages and some or all put under an expandable heading to reduce the size of the left sidebar
PyCharm and CircuitPython
Move this under "Creating and Editing Code"?
CircuitPython for ESP8266
I think we can remove this completely.
Troubleshooting
Include RP2040 "flash_nuke.uf2" info
---- a missing page: "CircuitPython Documentation"
Point to readthedocs for CircuitPython and the libraries, and explain that it's for reference. I have helped several people who were unaware of readthedocs, and this would help.```
Python. org has a ton of types of resources, videos, books, demos, etc
this is an interesting language reference for arduino: https://www.arduino.cc/reference/en/
The Arduino programming language Reference, organized into Functions, Variable and Constant, and Structure keywords.
Maintaining the freshness of all links forever will create exponential issues that will ultimately be unmanageable. It's time to rethink how to approach configuration management into the future. For example, can a bot be developed to map existing links throughout Adafruit publications/posts/documents to help content removal/freshness?
I'm working on an FAQ on reddit so I've been running through the beginner resources
Can do, I'll drop what I have in soon--I'm mostly aiming at referring to python.org's resources and mostly just explaining how to find a resource that fits the readers learning style
In the "Learn Python" section, you might want to flag how this is different than python--some things will use 3.10's pattern matching, which if someone relies on PatMa, they could be confused jumping to circuit python. That's a thing that's easy to address, it just needs to be highlighted in the "learning python" section as well
I didn't know those badges in the readme were linked for the longest time. Definitely like the idea of that being spelled out a little more in the readme.
Thanks!
When it comes to the reddit FAQ, the related questions I've highlighted are:
How do I install Python?
What version of Python should I use?
Which IDE should I use?
Book/Course/Tutorial/Video recommendations
Best way to learn python
@tulip sleet I started trying to enable (u)asyncio in circuitpython but found that we need select too, for the frozen-in parts
I'm wondering if it should be frozen in or be a library
(who has two thumbs and is bad at staying on task? this guy)
either way it seems select is a dependency, but we don't have it
The last two would be useful to us, I think.
The first three are already covered in the guide for CircuitPython-specific info.
Best way to learn python has a, "Everyone learns differently" explanation I haven't finished writing, the IDE I feel is pretty well fleshed out with options, and then a solid paragraph about how it's a tool not the key to success
the recommendations are things I'm not doing building out/explaining, but here's what I have thus far:
### Books
- [https://wiki.python.org/moin/PythonBooks](https://wiki.python.org/moin/PythonBooks)
### Courses
- Automate the Boring Stuff: [https://www.udemy.com/course/automate/](https://www.udemy.com/course/automate/)
### Podcasts
- [https://talkpython.fm/](https://talkpython.fm/)
- [https://www.pythonpodcast.com/](https://www.pythonpodcast.com/)
- [https://realpython.com/podcasts/rpp/](https://realpython.com/podcasts/rpp/)
### Tutorials
- [https://docs.python.org/3/tutorial/](https://docs.python.org/3/tutorial/)
### Videos
- [https://www.python.org/doc/av/](https://www.python.org/doc/av/)
- [https://www.reddit.com/r/learnpython/wiki/index#wiki_videos.2Flectures](https://www.reddit.com/r/learnpython/wiki/index#wiki_videos.2Flectures)```
Almost all of this was grabbed through the python.org resource section
Unrelated, the official Python tutorial really didn't work for me. Heh. It may have been updated since.
I might link to their stuff directly. And let folks go through it on their own.
My backup recording seems to have come out all good. If there turns out to be any issue with the main recording I can share the copy.
Cheers!
@idle owl I think the official tutorial is mostly aimed at programmers who already know similar languages
I think that's the best way to go about it. We're largely doing the same because we don't have staff to maintain an up to date list, and python.org and psf is better suited for it.
That was not made very clear. I realise that now, but did not at the time.
Fair enough!
in particular, they don't teach programming concepts
Right. They teach Python concepts.
In the end, my learning situation was partially unrelated to their tutorial - manipulating the physical world hooked me more than manipulating data ever could.
This should be in the list of resources as well--I might have it listed under a different topic in the FAQ
https://wiki.python.org/moin/BeginnersGuide/NonProgrammers
Yeah, that was my thought. Our list should be mostly a meta list
Added to my list.
I know you're on asyncio, but I might still tag you in for help with that page. But STAY ON ASYNC. π
Later this week though. Still need to get through this ATtiny guide.
roger; my async task is my highest priority task in my event loop π
but it's async, you never know which tasks get starved
@lone axle Ok, Adabot could do some of it, but not much of it. So, I figure at that point, if it's going to be scripted, there's no point in running Adabot on a tiny number of the libs, when you'd be running the script on all of them anyway. So, I'll write something up on the TestRepo, and we can look into whether we can script it manually at that point.
Here is the notes document for Mondayβs CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if youβll be attending the meeting - itβs super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and weβll read them off during the meeting. Hope to see you there! <@&356864093652516868>
https://docs.google.com/document/d/1DQ8EHH68msQwsLGN8UvH01C_hHFnvcaLBmJowbrsvBM/edit?usp=sharing
Google Docs
CircuitPython Weekly for October 25, 2021 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates early. During the meeting, we go through them as a round robin sorted by username. If you canβt make the meeting and would still like to participa...
@tidal kiln BTW, about the I2C address byte. I guess Dean implemented it, it was super kludgy, they took it out, and then never reimplemented it. Or at least that's what Limor vaguely remembers. The process was bonkers, involved writing a page or something, erasing everything, rewriting everything... I don't remember exactly, but she said it was Bad β’οΈ . That said, the ATtiny apparently supports it happily. That said, she told me to leave it out of the guide. So I don't know if this clears anything up for you or not, but you wanted me to ask about it.
@tulip sleet https://gist.github.com/25d231b30282b9d02d00d559c546c953 here's what I'd started with. when I ran into the select requirement my excitement waned.
Thanks! But that link is the name of a file instead of a file.
great, thanks
@idle owl thanks. i remain mildly confused. but that is ok.
-
Addresses #1136, but only for PC BIOS, not for Mac
-
Fixes #5197
-
A new optional argument,
boot_device, was added tousb_hid.enable()tells the host that a boot keyboard or mouse is available. -
All other devices should be disabled to ensure that the HID device is at interface number 0 if a
boot_deviceis specified. We check for that after boot.py finishes and go into safe mode if that is not true. -
Feature report support was added, but could not be well tested, since I don't ...
Same. Heh.
Sigh. I found my container of buttons recently, and now it's nowhere to be found. I have a button, but it's a bigger one, and I need a littler one. Bleh.
have you checked to see if you are doing the holding-the-lost-thing thing?
leave the room, come back, look in same spot you've already looked?
lol. Worth trying at this point.
I was going to do the order-it-from-Adafruit-and-find-it-after-clicking-submit thing.
I give up. Ordering it won't get it here in time, at this point. I'll have to deal with the bigger button. Which means a bigger breadboard. Which means bleh.
?serverinfo
I added select, so I could make asyncio importable. but the simplest thing I can do with it just freezes
import asyncio
async def f():
return 1
asyncio.run(f)
actually after a verrry long time it responds to ctrl-c, but it seemingly never becomes ready for use
@tidal kiln As per Limor's request, updated this page to work for both SAMD09 and ATtiny817. Not much to it I guess but let me know if there's anything needs changing. https://learn.adafruit.com/adafruit-seesaw-atsamd09-breakout/eeprom
On the SAMD09, are 64 bytes --> "there are"
Thank you
otherwise looks good. at least for now. can update as needed based on feedback, what seems confusing, etc.
can see people potentially accidentally writing to last byte and then getting unexpected behavior on next reset/power cycle
but that same issue's been there. nothing new.
This is the exact kind of mistakes I make in documentation
me too. and even worse.
I accidentally a verb every time
That came out of adapting it from other wording. π But yeah.
This all looks nice and clean to me! Thank you for getting what you have in. It'll be good for more folks to test it.
Hi, i am stuck with a project . I want to use uart in writing
Can someone can hello me with :
uart.write( ? )
@manic current Have you looked at readthedocs: https://circuitpython.readthedocs.io/en/latest/shared-bindings/busio/index.html#busio.UART
Thanks
@manic current neradoc also got some useful examples: https://github.com/Neradoc/circuitpython-sample-scripts/tree/main/serial
GitHub
A repository for example and small helper scripts. - circuitpython-sample-scripts/serial at main Β· Neradoc/circuitpython-sample-scripts
Thanks a lotπ
You can also ask on the #help-with-circuitpython channel
Testing performed: In the REPL, set the timeout to 16s and enable. Call feed() once every 1-2 seconds and it keeps running indefinitely. Stop calling it, and reset (into normal run mode) happens approximately 16s later.
The "reset reason" is unimplemented on samd51 so it's not possible to tell that a reset was a watchdog reset. I didn't investigate whether it was difficult to implement the reset reason.
I just wanted to tell that I'm also looking forward to a better HID support.
I'm on Windows and often after booting I need to un- and re-plug my Raspberry Pi Pico based keyboard first. Also, usage with the KVM switch is not robust (the KVM is built into my monitor).
Thanks for your work on this issue.
- Fixes #5458.
No longer assumes that PDMIn is the only code using the event system. Removed some stall checking, which does not seem to be necessary. The stall loop value was also too low and was not waiting long enough.
Tested with the sound-level meter code for CPX.
One set of suggestions to get rid of pet(). This simplifies things to feed().
void setup_wdt(watchdog_watchdogtimer_obj_t *self, int setting) {
common_hal_watchdog_feed(self); // Clear watchdog interval
void common_hal_watchdog_feed(watchdog_watchdogtimer_obj_t *self) {
WDT->CLEAR.reg = WDT_CLEAR_CLEAR_KEY;
}
@tulip sleet want me to review https://github.com/adafruit/circuitpython/pull/5453 or can you revisit it?
i have zero experience with the i.MX, which may have at least some overlap with this. I was just looking at the low-hanging fruit. There haven't been any commits since the initial round of comments.
@slender iron I can make structural comments easily. It is not structured the standard way. Lots of stuff in the board directories.
I just don't want it to languish
I can make lots of comments, then.
it'd be good to add some at least. maybe not all at once π
Yes π
FWIW, other ports configure the GPIO at this stage (in the _construct) as well: like the STM implementation.
@tannewt I thought claim_pin() was our method of protecting the pin prior to sleep, but if you'd like it another way just let me know.
@tidal kiln lol. This. ```Snapping Behavior
No one fully understands Eagle's snapping behavior when using the dimension tool. Just punch your way through it as best you can.```
happy to be wrong about that. would just like to know. π
I would add a note about the "move" point in a dimension object being the center of it, even if it ends up being one of the ones with a measurement outside the two indicator lines. I'm not sure where to add that.
It's really annoying to figure out how to shift the dim object if you don't know to click in the center.
You're not wrong. It's bonkers. I have to turn off layers sometimes to get what I want.
Hmm maybe should mention that in the snapping section.
I'll add a sentence there.
also, the goal isn't to make nice dimension diagram, like fab print
it's just for getting dimension info
so the dims can be a mess / unpretty etc.
it's for "what's dimension FOO on product BAR"?
Gotcha.
nice! thanks
w3rd
Thank you for starting a new port! I haven't looked at the implementation of the parts that have been implemeneted, but have instead commented on the structure, and which files are where. I'm going to mark this as a draft for now.
Please feel free to ask about how to structure and re-factor the port-specific files. If you can use some NXP repos as submodules only, that's great. The https://github.com/adafruit/samd-peripherals is an example of how to structure a wrapper layer to hide some d...
This is a regression. It would be good to merge or rebase on our main.
You can add your copyright to show that your worked significantly on the file.
The sole build failure looks like it is just a transient CI problem.
@gilded cradle Hey! Does tomorrow work for a vid chat with you? Trying to finish up a guide in time for tomorrow's noon deadline, so today kind of ended up not being good for me. I have a short appointment at 1:30, though I don't expect it to happen on time, but sometime after 1:45pmET, I can ping you and let you know when I'm available. We can coordinate that way, if that works for you.
CircuitPython version
Adafruit CircuitPython 7.0.0 on 2021-09-20; Raspberry Pi Pico with rp2040
Code/REPL
from keypad import Event
dir(Event)
Behavior
['__class__', '__name__', '__bases__', '__dict__', 'key_number', 'pressed', 'released']
Description
keypad.Event is missing implementations of members:
__hash__(); Callinghash()on akeypad.Eventyields the same integer, regardless of instance.timestamp; `AttributeErr...
Sure. Sounds good.
Great! I'll ping you tomorrow.
Looks like you have a boot.py file. Please attach its content in case it is relevant.
pretty sure timestamps are in latest build not 7.0.0 release - please try that?
Jepler,
Below is my boot.py file. The result is not used. The pin to determine what action to take is changed board to board to avoid conflict. I get the same results when I remove boot.py. Pin A3 is unused on the ItsyBitsy.
###########################################
"""CircuitPython Essentials Storage logging boot.py file"""
import board
from digitalio import DigitalInOut, Direction, Pull
import storage
For Feather M0/M4 Express, RPi Pico, etc.
switch = Digital...
The failing check is just a CI network glitch.
The code has evolved. below is the code as it stands now. Also the symptoms have changed on the ItsyBitsy only. If "import microcontroller" ((Line 13)) is not commented out the device crashes after 4 codes are transmitted ((Line 245)). No error codes given on REPL. A hard reset is required. There was an issue between .mpy and .py library files but that went away for no good reason.
((Problem with .py library files. Replaced with .mpy files. Things OK. Test again with .py, problem go...
Yes, timestamps were added posted 7.0.0. If you look at http://circuitpython.readthedocs.io/en/latest/, you'll see the doc for the "Absolute Newest" builds. If you look at http://circuitpython.readthedocs.io/en/, you'll see the doc for the latest stable release (which in this case does not include timestamps.
hash() was buggy, and I am fixing it. Thanks for spotting that.
- Fixes #5485.
This was kind of an amusing error. C lets you reference a delcaration in itself. That happened inadvertently.
E.g.,
void *x = &x;
Happy to have anyone review.
An excellent bug with an excellent fix. I know it's technically valid C but I'm still surprised there's not a diagnostic when it occurs!
Is there any board you're aware of that provides board.DISPLAY on an i2c-connection? Was looking for board.c code to crib but can only find SPI-connected examples.
I don't think so, I believe using SPI for a built-in display is a design choice that is so heavily favored for its stability and speed. I2C devices have the advantage of being flexible and using less pins, but if you're adding a permanent flex cable connection for it, SPI is faster and less prone to external interference from other devices.
also requires fewer components
When you say "crash", do you mean that it just hangs, as opposed to reseting into safe mode or throwing an exception?
Well, in this case I'd like to add support to an already existing board.
I found one other similar board, but it doesn't implement board.DISPLAY either.
It seems like this device got added to circuitpython.org but never did completed and merged into the circuitpython core: https://circuitpython.org/board/hiibot_iots2/ so there are no builds in S3 or github release page, and no way to build unless you go back and grab a branch from one of the PRs that are closed.
I noticed that one earlier today also and was going to mention it
I'm guessing this is the one you found: https://circuitpython.org/board/tinkeringtech_scoutmakes_azul/. That is the only one I saw that seems to have a built-in I2C display, but like you mentioned, it doesn't initialize it in board.c
Yeah, that was the one
I was planning on working on the Lolin S2 Pico, the display is the bog-standard 128x32 i2c ssd1306 oled, so the initialization data should be pretty easy, but no examples of the stuff necessary to set up an i2c-attachment in board.c
@tahunus So did you try upgrading the bootloader? Let us know if that fixes it.
Crash = No exception thrown, no safe mode, it stops responding to all REPL commands Ctrl-C, Ctrl-D, etc. After ~45 seconds it disconnects from my Windows 10 machine then I get an alert box with "USB device not recognized" when it tries to connect. Pushing RESET brings it back.
Bruce
@lone axle Did we upgrade your role in the Learn system, or do I need to add you manually to the Welcome to CP guide for you to update the PyCharm page?
I think my user was upgraded. I do have access to the Edit link in that guide so I should be able to add the new page I believe.
Ok, perfect. I wasn't sure, and wanted to make sure you weren't blocked on me.
@tidal kiln Guide format preference question when you're around. Absolutely no rush, I'll be at this update for the next week probably.
@idle owl π
Ah hey.
@tidal kiln Ok, so this page has a mix of FAQ elements, and regular header+text elements. Which one do you prefer? Which is to say, which one is better for the user experience? I'm going to make them all match, but wanted your opinion on which one to go with. https://learn.adafruit.com/welcome-to-circuitpython/frequently-asked-questions
I'm not sure the FAQ elements support code formatting in the question part.
They don't.
So I guess go with header+text for all of them?
I need code in the actual question though.
For a bunch of them.
"What is a MemoryError" has MemoryError in code formatting
etc.
oh, like inline
Yep
i think ok without the formatting, if you use the FAQ element
Hmm. Ok. Will be annoyed by that, but if you think that's a better option for that page, then I'll go with it.
Pinged Justin about making formatting possible, but I'm sure that's a long time out if it's possible.
i guess either way would work
I asked you for a reason, if you think FAQ is better, I'll run with that.
the main thing that's useful is to be able to directly link to a specific FAQ
which either can do
You can link to the header... yeah that
and it looks like they changed the default behavior for the FAQ element to be expanded, which is much better
before, it was hidden, and not obvious how to make it visibile
I saw that too, wondered if it was me
Like somehow it did it for me, didn't occur to me that it was a default change.
i'm assuming that's what happened. i was going to mention it at some point.
maybe see what justin says/thinks?
Yeah that's valid. He's not around at the moment. But I have plenty of guide to update in the meantime.
Anyone have/know of any examples of using the core adafruit-pixelbuf? Looking as I have an idea with the IS31 glasses/matrix and speed in pure python isnβt quite there. The pixelbuffer seems to be a similar use case
There aren't really any. My partner was looking into speeding things up with the LED glasses/matrix with regard to adafruit_pixelbuf but I don't know what angle she was coming from or how far she got. (She also wrote adafruit_pixelbuf.)
claim_pin() will prevent other use of the pin in later Python code but not prevent reset. This is ok for light sleep. For deep sleep, the peripherals and pins should be set in prepare_for_deep_sleep because that will occur after the reset.
Good refactor! Thank you!
I need someone who has never installed Mu Editor before to install Mu Editor and then answer a question for me.
I'll ask in one of the non-CP channels, heh, since this isn't the best place to look for that.
Thanks. I was trying with the python framebuffer modeling it after the pixel framebuffer and it worked okay until I tried to do like Arduino and make the buffer 3x and scale it down. Performance at that point took a large hit.
If PixelBuf and even a modified version for IS31 could hook to the native framebuffer like the RGB matrix that would be useful (maybe)
I think that's sort of what the idea was.
Modifying the driver I think to work better with things.
Cool thanks. If she has any ideas she wants to bounce off someone feel free to tell her to ping me.
For sure! I'm certain that will be appreciated as I'm only good for API concepts, not gritty coding help. I'll let her know.
@tulip sleet Do you have a machine amongst your many that has never had Mu installed on it? As in very never, not ages ago even.
what OS?
Windows or Mac, but I really don't care. I assume its behavior is the same across all OSs
So Linux is probably fine too
I think I may have a Windows instance that I recently redid.
Basically, install it, and run it, and tell me what the default startup behavior is. Does it default to CircuitPython? Or does it give you the window to pick your mode?
is a board plugged in or not?
Because mine are defaulting to CircuitPython now, and I'm not sure if that's default, or not
Not plugged in
But I tried both ways
and it defaulted to CP both ways
I could look at the code and see how it picks
The guide says "Pick your mode" etc, but I'm now wondering if that's not a step anymore unless you do it.
That would also work, lol
I hadn't considered that angle.
i will resurface with info π
Thank you!
@idle owl when Mu starts up, it restores settings from the previous session, including the mode. If there are no settings, which would happen the very first time, then it will pop up the mode selection dialog
Ok, thank you! I tried deleting everything I could find and it still defaulted to CP.
So there's still something somewhere.
I'll get a screenshot of the new Mode dialogue and leave that step in there.
I will try to find that file
CircuitPython version
Adafruit 7.0 latest, and master branch (yeah I compiled master).
esp32 wifi chip:
Firmware vers. bytearray(b'1.4.8\x00')
Code/REPL
import time
import board
import busio
from digitalio import DigitalInOut
import adafruit_requests as requests
import adafruit_esp32spi.adafruit_esp32spi_socket as socket
from adafruit_esp32spi import adafruit_esp32spi
import neopixel
from rainbowio import colorwheel
import gc
from secrets impo...
CircuitPython version
Adafruit Circuitpython 7.0 latest and master (yeah I compiled master branch)
Code/REPL
import time
import board
import busio
from digitalio import DigitalInOut
import adafruit_requests as requests
import adafruit_esp32spi.adafruit_esp32spi_socket as socket
from adafruit_esp32spi import adafruit_esp32spi
import neopixel
from rainbowio import colorwheel
import gc
from secrets import secrets
UDP_IN_ADDR="192.168.2.147"
UDP_I...
this library doesnt support dhcp static ip config - it looks like the esp32's nina firmware supports it? but you'd have to add the capability to the library or just tell your router to only use one IP address for the MAC.
@lone axle Opinion time. For the explicit callout of the documentation - does it need to be any more involved than this? ```
Documentation
API documentation for this library can be found on Read the Docs <https://circuitpython.readthedocs.io/projects/testrepo/en/latest/>_.```
I was considering adding more, but then thought maybe not.
That's in the README after the Usage Example.
I think that looks good.
Right on.
@lone axle Ok, that said, here's what I added and where. When you get to it, see if this is scriptable in some way. https://github.com/adafruit/Adafruit_CircuitPython_TestRepo/commit/a45bf8c2961f581ef301a6605edcb276bc775c13
Will poke around and try some things out when I have a chance next.
Thanks much!
I'm hoping because the contributing bit is pretty standard, that it'll be doable.
But I don't understand it, so I'm guessing here.
Anyway, whenever you get a chance is fine π
I think it should be doable. From the thought I have given to it so far I think the "hardest" part is knowing the right readthedocs link for each repo. But I believe the script should be able to grab it from the existing badge link. Thats going to be my first way to attempt it at least.
That was my thought too!
https://pypi.org/project/sphinx-autodoc-typehints/ this might be nice to try out
@gilded cradle Hey! Finally done dealing with the thing. Let me know when you're free for a vid chat.
Hmm. We suggest in the Welcome guide to create a new file, and then save it as code.py. But CP now creates a code.py. So now I'm wondering if we should instruct folks to open it instead of saving over it. Are there instances where CP doesn't generate the mostly empty code.py file on CIRCUITPY on install?
@tulip sleet Does CP always generate the Hello world! code.py on CIRCUITPY? Or are there situations where it doesn't... I feel like I've run into it not having a code.py, but maybe that's after some kind of catastrophic failure, and on restart, there's nothing on the drive at all.
I don't want to set folks up for failure here, but if there's already a code.py, this page isn't exactly right at the moment.
On the smallest boards it just makes a blank code.py. That saves a small amount of firmware space. If we had the room we could turn that off.
LIke Trinket M0, etc.
Oh, I guess I don't care about the contents. I'm more concerned with the presence of the file. But that's really good to know, I can make a note of it.
yes, it's always present, it's just empty sometimes
In just a bit. I'm responding to a review request, then I can.
Sounds good. Let me know.
Ok, I'm ready now
@tulip sleet SYN
Would like some input on a warning I'm putting on the current "CircuitPython Hardware" page which is full of M0 boards.
Other than Circuit Playground (which we DO recommend!), we do NOT recommend purchasing M0 (ATSAMD21) boards for use with CircuitPython projects. The information available on this page is still valid for the boards listed. However, the filesystem size and memory footprint make them of limited use with CircuitPython. is what I have so far.
It's getting nested under "Archive" and replaced with a mirror from a different guide anyway, but I still want a warning on the page.
BRB, almost forgot to eat before the meeting.
(back)
@idle owl hey, should cookiecutter be updated to add disable for consider-using-f-string?
Yes.
You up for the PR? You can tag me on it if so.
yep. working one right now. π
Perfect
Merged.
Where can I see the Python code for TileGrid? Looking at the gitrepo I can see TileGrid.h and .c, but not a .py. Is TileGrid.py only generated?
My goal is to look at how pixels are actually drawn after I set a value in a bitmap.
To find the fasted way to do it. Currently filling the screen on a pygamer takes a 3rd of a second, which seems very slow.
my phone just pinged me with the above. will reply after mtg
No worries, thanks.
@lone axle ^^
TileGrid is implemented in the core, so it is made up of C code that interrupts and executes the python code in your code.py file. So there is no TileGrid.py for the core, only TileGrid.c and TileGrid.h, probably some in shared-bindings and shared-module in the core. However...
(strangely github doesn't let me search through source in forked repos)
There is a python implementation of TileGrid inside of Blinka_Displayio. So you could look at it if you wanted here: https://github.com/adafruit/Adafruit_Blinka_Displayio/blob/main/displayio/tilegrid.py It is essentially a python implementation of the C code in the core. So it should have very similar / same behavior as the core, but it's not actually used on microcontrollers. Only RPi / other single board computers using Blinka.
is there an architecture doc somewhere that describes how displayio works? Basically I want to find the fastest way to update pixels in immediate mode (like HTML Canvas).
TileGrid and Rectangle and the other shapes seem to work by pre-drawing into a bitmap and rarely modifying them. Is the slow down from crossing the python -> C barrier? or is is number of pixels changed per frame (io limit)
This guide describes how it works from the user level: https://learn.adafruit.com/circuitpython-display-support-using-displayio but I'm not sure if that will have the information you're after.
I am probably not the best person to be able to say where the slow down (or potential improvements) could be though.
I can give some general advice perhaps on how to speed things up possibly. What are you trying to draw? something in particular?
@pallid creek For manipulating pixels in a Bitmap object I do think the functions in bitmaptools will be faster than using python code to access and change the pixels via square brackets. https://circuitpython.readthedocs.io/en/latest/shared-bindings/bitmaptools/index.html#
I've seen the user guide. I was hoping for something that explains how it works on the inside.
Oh, I hadn't seen bitmaptools. Taht looks interesting.
@slender iron @tulip sleet @onyx hinge I updated the internal who's-running-the-CP-Weekly-meeting calendar to include Dan, and to be corrected for the last couple and next couple of meetings. So it's up to date at the moment.
Those are implemented in C code so I would guess they are probably about as fast as it can get barring some substantial effeciency improvement in the logic of the code itself if one exists (not sure / guaruntee'd to be possible though)
my background is in graphics programming, so I'm happy to dig into the C code. Can C be used in user projects or does it have to be compiled into the core?
I don't believe there is a resource that details/documents how it works internally. The best way would probably be to read the C code inside the displayio module in the core. If you are comfortable poking around there you could figure it out.
I don't necessarily understand all of it myself. But probably good to start with Bitmap, Group, and TileGrid objects.
We don't have dynamic loading of native C code into a running CircuitPython -- if that's what you're thinking of.
displayio's original motivation was for low-memory display work, as typically found in, say, older game hardware
but it can also be used in a general way
It's possible there was a deep dive show with Scott that may have covered the internals in a bit more detail, I'm not sure though, and it would be video format not written documentation.
C code does have to be compiled into the core to use it.
yeah, that's what I meant. So I couldn't create a Canvas object that's like a Rectangle or other shape, but has methods for immediate mode drawing. I mean, I couldn't write it in C without recompliing all of CP and making my own install.
yeah, that makes sense. That's why it's so sprite focused.
thanks. I'll do some research and come back with what I find.
my end goal is to be able to create a vector game like Qix or Asteroids using the PyGamer.
Toddbot, a member of the community, recently made an asteroids game that runs on PyGamer if your interested in seeing an implementation of it. Can understand as well though if you're interested in building it "blind"
todbot π
whoops
@idle owl you could say "we no longer recommend" because there are now newer boards available at the same price points that have much more RAM and are faster
Hmm, alright. Let me rewrite it and ping you again.
@tulip sleet Other than Circuit Playground (which we DO recommend!), we no longer recommend purchasing M0 (ATSAMD21) boards for use with CircuitPython projects. There are now newer microcontrollers available at the same price-point that are faster and have more memory. The information available on this page is still valid for the boards listed.
Thanks for the assist!
@tulip sleet While I have you... You recommended having all serial console stuff nested under a single serial console page. Scott recommended an "Advanced Setup" page with a bunch of advanced pages under it. I'm now leaning towards nesting like-things under like-things, and not having the Advanced Setup page. I guess, first real question is - where would the Windows 7 and 8.1 Drivers page go?
The page exists, it's not nested yet.
it's "Installing CircuitPython", I think, since if you plug in a board before installing the drivers you will get errors on 7 and 8.1. It will still work, but you'll only have access to CIRCUITPY, not the repl
Oh right, good call. I should have thought of that.
well, you've never had to deal with that π fortunately
Valid point.
except helping people in workshops ... hmm
i think you pushed it out of your mind
I was like "No, sorry, you can follow along."
@tulip sleet BTW... I updated this page to not have QT Py on it (Swapped it for RP2040) and mirrored it in with the same title as the previous one. Better? π https://learn.adafruit.com/welcome-to-circuitpython/beginner-boards
That looks good. What about nRF52840? Do you think that should be included? It's kind of a basic choice. Could drop one of the M4's. Did you include the itsy kit as variety?
So.... "Advanced Serial Console on *" pages would go under "Connecting to the Serial Console"? I'm now rethinking this. I guess maybe an Advanced Setup page makes more sense. Otherwise people who click on "Connecting to" would also get the "Advance Serial" pages, and would try to do them, because apparently doing literally every page in a guide in order is a thing for some folks.
if it says at the top of the page, "you can ignore this unless..." maybe that would help. I'll look at the pages...
Limor dictated a lot of that guide. I believe she decided on that list. I asked to swap out the M0 for RP2040 today, which wasn't out when the guide was written. nRF was out, but opted not for the beginner page I guess. Except CPB.
i can understand, and the M4 boards show the form factors.
Right.
Some people don't read when it says "you don't need to do this."
