#circuitpython-dev
1 messages · Page 308 of 1
yeah
I think the learn guide needs a little updating then. 😉
I'm not seeing where it shows the wrong folder. It says to look in src/adafruit_blinka/microcontroller rather than src/microcontroller.
Hmmmm, I do not know where I got the other path from then. Anyway, it does not matter now that I have the correct path. 🙂
🙂
Am I correct in that there isn't a board with built in wifi that is 'built for circuitpython'?
@charred flare, look for the airlift boards if you want to use WiFi.
Yeah I have one of those now. Just checking to make sure there wasn't an all-in-one board that I missed. 🙂
Ah, ok. Yeah, the Metro M4 Airlift is probably the closest thing though the Particle boards may also be capable.
You can also go to https://circuitpython.org/downloads, click the advanced search options, and choose Wifi.
Thanks. Yeah it's not a big deal, I can keep using the airlift stuff.
Now on to the more complicated question. Has anyone tried to connect several boards together over SPI or I2C or something to create a "multithreaded" device? I've got some things I don't want to pause while other things like getting data over wifi are working.
@charred flare Ah, do you want to have other micro boards be slaves to a single master?
Yeah
@charred flare i believe some have. iirc, this is why i2cslave came about: https://circuitpython.readthedocs.io/en/latest/autoapi/i2cslave/index.html
I read only the pyboard can use that, currently? or was that an old article?
according to the support matrix, 31 boards have the module available.
Eek, maybe that was an old article then, lol
well, i don't have empirical evidence that it works. just that the package is available. 😄
@gilded cradle Quoted from the add board file section of the learn guide - "The board file is much easier than the chip file. It basically involves loading the chip file and just mapping the chip pins to the physical pins on the board." I thought the chip file already did that.
It's kind of a pass through really. You define your pins in the chip/pins file and then the board files just defines what pins are available for that board. For instance, if you had an old raspberry pi with 26 pins, then it would have fewer than one with 40 pins even though they use the same chip file.
@charred flare Basically, you have to initialize the slave micro as an I2C slave, and give it an address. Then, you can do whatever you want to do with it. 😉
@raven canopy Sadly neither my nRF52840 or the little Trinkets I wanted to do the secondary tasks seem to support it. :-/
I'm thinking that since all the secondary tasks are "canned" and won't change, maybe I can use normal digital I/0 as sort of binary code as to what I want it to do.
If D5 = high and D6 =low - do this, etc. Hmm.
😦
@raven canopy The underlying micro chip should be able to support either I2C master or I2C slave. I guess I will have to look at the datasheets to find out for sure.
Yeah I'm like 2 weeks into teaching myself CP so that much goes over my head for now, lol
@gilded cradle Oh, OK. For a moment there, I thought I was confused. 😉
The src/adafruit_blinka/microcontroller dir should have been named "chip."
i suspect the decision was to mimic the original semantics as a MicroPython compat layer, and keep the shared code agnostic.
Ahhhh, got it.
@gilded cradle If I do something like D4 = KSI2 in the board file (KSI2 = Pin(17) in the chip file) would that allow that pin to be accessed as D4 from Circuitpython/Blinka?
yes
Cool! 😉
I think it's more like D4 = pin.KS12 though
Well, you got what I am going for. 😉
Nice
Doing this will require a bit more work by me, but I think it is well worth the effort.
Yeah
The SPI bus can certainly handle it, and the Feather M4 has native support for multiple displays if you're using the Adruino env. I'd just prefer to use the CP environment. Maybe there is an issue for the kind of system/debug info that CP will render on the display if the there is ambiguity about which one to use, not sure. I can recompile if that's all it takes -- just hoping I can use 4 displays on the m4 hardware spi bus.
The new modules folder made me think it was for Python modules (cause we have extmod and shared-modules) not for HW modules, slightly confusing 😅
It might be nice :-) to just say that these magic number [2] and 32 are just there to create a set or bitmap.
Since it is static ( to this file ) it's probably O.K. to use the idioms/pattern to create a 64-bit map -
( how do others do this in an abstract yet efficient way )
I'd like to ask for USB PID for the Fluff M0 board, documented at https://hackaday.io/project/171381-fluff-m0 please.
@jepler mentioned this would be a useful improvement in #2936
Tested on an itsybitsy m4 express
@slender iron ping
Just sat down for dinner. How’s your schedule look the next four hours?
I'll be sitting right here. Though lunch may arrive at some point. Enjoy dinner.
It's used for printing out stack unwinding. For example, in Rust, if you discard this section it can't print a line number and function name when you panic!().
If Circuit Python wants to start printing stack unwinding information for C or C++ modules, then this data should be saved. Otherwise, it should be safe to discard.
I've implemented the new API. Additionally, it now boots into safe mode if it's connected to USB and is reset due to a watchdog timeout.
I will work to disentangle the watchdog exception stuff from the vm.
@half geyser you around?
@slender iron yep
This patchset got big. But it was refactored twice. It contains the following features:
- The watchdog is a singleton under
microcontroller - Setting
microcontroller.watchdog.mode = watchdog.WatchDogMode.RAISEworks - If
watchdog.WatchDogMode.RESETcauses a reset, and the board is plugged in to USB, then it enters safe mode - When the watchdog timer hits, it calls
reset_cpu() - Calling
microcontroller.reset()now goes throughreset_cpu() - The number of system ticks is sa...
Yay! With that patch, nrf now [mostly] keeps its clock across resets.
woohoo! ```Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.4.0-beta.0-291-geea01c32b-dirty on 2020-05-22; Saola 1 w/Wrover with ESP32S2
help('modules')
main digitalio micropython supervisor
array gc os sys
board io random time
builtins math storage usb_hid
collections microcontroller struct usb_midi
Plus any modules on the filesystem
@solar whale Congratulations!
@tulip sleet I spoke with @slender iron yesterday, and he mentioned you might be able to help to merge the watchdog stuff. The only platforms that are failing are pca10100 (which is overflowing flash), and xtensa (which isn't building at all for some reason?). Should I just disable it for pca10100, or adjust the flash size?
minor change to allow setting PORT when using make flash if
left default as /dev/tty.SLAB_USBtuUART
but others can use
make BOARD=espressif_saola_1_wrover PORT=/dev/ttyUSB1 flash
fell free to close if you don't want this at this time.
@dunkmann00 Thank you, that was quick!
This is a bit more complicated, I feel like I should actually test it. But don't let me stop any other reviewer from giving it a go.
not sure what to do about the check failures -- please advise...
Is this something I need to fix or just the way it is with this build at this time.
@half geyser I'll take a look!
This is a strong start, thank you! I did turn up a problem in my testing. If you get stuck trying to rectify it, please let me know and I can dig into it too!
I created a program which compares the behavior of slicing lists to the behavior of slicing pixelbufs. For lists of length 1 to 4, starts and ends from -len to +len inclusive, and strides of -3, -2, -1, 1, 2, and 3, the results of slicing pixelbufs match the results of slicing lists.
import _pixelbuf
for num in range(1,...
Our coding style wants spaces: } else {.
Here's the program, make sure to rename it to "pbs.py", getting rid of the ".txt" extension! (GUI tools can make this tricky)
Should I open an issue for this on an esp32s2 -- or is it just not expected to work at this time ... after flashing, it boots -- I see CIRCUITPY and REPL works, but if I try ls /media/jeerry/CIRCUITPY`` it gets very upset jerryneedell@solar whaleeedell-ubuntu-macmini:~$ ls /media/jerryneedell/CIRCUITPY/
ls: cannot access '/media/jerryneedell/CIRCUITPY/ FSEV.EN~': Input/output error
ls: cannot access '/media/jerryneedell/CIRCUITPY/ '$'\001''.': No such file or directory
ls: cannot access '/media/jerryneedell/CIRCUITPY/e.DA~': Input/output error
ls: cannot access '/media/jerryneedell/CIRCUITPY/ TRAS.HE~': Input/output error
ls: cannot access '/media/jerryneedell/CIRCUITPY/äI'$'\002''.Be': Input/output error
ls: cannot access '/media/jerryneedell/CIRCUITPY/äI.A.': No such file or directory
ls: cannot access '/media/jerryneedell/CIRCUITPY/ .TRA': Input/output error
ls: cannot access '/media/jerryneedell/CIRCUITPY/äi'$'\003''.boo': Input/output error
''$'\001' ' '$'\001''.' äI.äI boot_out.txt 'EN~1 '$'\020' n.MET
''$'\b' 'ä-²?.'$'\001' äI.äI ''$'\001''.cir' FSEV.EN~ .TRA
''$'\030' a.e 'äI'$'\002''.Be' DA~1 HE~1 TRAS.HE~
' '$'\020' 'äI'$'\004' 'äi'$'\003''.boo' e. lib 'TXT '$'\030''.äI'
' '$'\020\b' äI.A. äI.LIB e. 'l-ⁿ?.'$'\001' 'UITPY '$'\b'
'[' 'äi.äi'$'\004' a.n e.DA~ n 'Y '$'\b'
jerryneedell@solar whaleeedell-ubuntu-macmini:~$
dmesg shows ```[273479.668050] sd 7:0:0:0: [sdc] 4097 512-byte logical blocks: (2.10 MB/2.00 MiB)
[273479.697795] sd 7:0:0:0: [sdc] Write Protect is off
[273479.697802] sd 7:0:0:0: [sdc] Mode Sense: 03 00 00 00
[273479.727778] sd 7:0:0:0: [sdc] No Caching mode page found
[273479.727789] sd 7:0:0:0: [sdc] Assuming drive cache: write through
[273479.947858] sdc: sdc1
[273480.117956] sd 7:0:0:0: [sdc] Attached SCSI removable disk
[273483.087851] FAT-fs (sdc1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[273483.367782] FAT-fs (sdc1): error, corrupted directory (invalid entries)
[273483.367788] FAT-fs (sdc1): Filesystem has been set read-only
[273483.368366] FAT-fs (sdc1): error, fat_get_cluster: invalid cluster chain (i_pos 0)
[273486.459292] FAT-fs (sdc1): error, fat_get_cluster: invalid cluster chain (i_pos 0)
[273486.460088] FAT-fs (sdc1): error, fat_get_cluster: invalid cluster chain (i_pos 0)
[273486.460179] FAT-fs (sdc1): error, fat_get_cluster: invalid cluster chain (i_pos 0)
[273486.460318] FAT-fs (sdc1): error, fat_get_cluster: invalid cluster chain (i_pos 0)
[273486.460542] FAT-fs (sdc1): error, corrupted directory (invalid entries)
[273486.460677] FAT-fs (sdc1): error, corrupted directory (invalid entries)
jerryneedell@jerryneedell-ubuntu-macmini:~$ ls /media/jerryneedell/CIRCUITPY/
@solar whale does formatting the filesystem from within circuitpython fix it? I don't know whether @slender iron wants bugs about esp32s2 filed yet or not, since it's so early. I personally favor bug filing though
it looks OK from REPL ```uto-reload is on. Simply save files over USB to run them or enter REPL to disable.
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.4.0-beta.0-291-geea01c32b-dirty on 2020-05-22; Saola 1 w/Wrover with ESP32S2
import os
os.listdir()
['.fseventsd', '.metadata_never_index', '.Trashes', 'lib', 'boot_out.txt']
oh interesting
thid is on Linux -- I think he uses Mac so may be related -- I'll wait on issue.
Either way I bet you won't be the only one to encounter this
Hi, could you limit the features to those in this guide?
https://learn.adafruit.com/how-to-add-a-new-board-to-the-circuitpython-org-website/adding-to-downloads? The list should only be limited to these 10 items and spelled exactly the same:
- Speaker
- Solder-Free Alligator Clip
- Feather-Compatible
- Battery Charging
- Display
- Wi-Fi
- Bluetooth/BTLE
- Robotics
- LoRa/Radio
- GPS
So for instance BlueTooth 5 (nRF52840) whould be changed to Bluetooth/BTLE and thing like `D...
@barawn can you share a bin file for that.
I just see one change to make, but looks good. Thanks.
@slender iron as noted a few posts above, I am having issues with esp32s2 CIRCUITPY drive on my Linux box. Do you want Issues filed or is it not expected to be working yet?
While tannewt's circle is green, I think he was planning a 4-day weekend...
ah -- thanks -- I'll do some more testing and file an issue if I can't resolve it.
hmm -- it shows up fine on my Mac --- I'll file an issue after some more testing.
Hi @gilded cradle - still learning the details of this process. So, if I remove that line from the .md file, then I can just push to my branch again? Is that right?
yes and it will update the PR
Sweet. Ok. I have a slightly cleaner set of images, too. Might as well update those at the same time.
yeah
Can they be sized so they are a 13:10 ratio like the other images while you're at it?
Sure.
Thanks, that would be awesome
Feel free to close if it is too early for issues on this - I just wanted to give you a heads up.
Using Ubuntu 20.04 -- when I plug in the esp32s2 its boots and CIRCUITPY mounts -- REPL works
But if I try to access the CIRCUTPY drive -- Linux cannot read it.
it gets very upset ``` jerryneedell@jerryn#2399eedell-ubuntu-macmini:~$ ls /media/jerryneedell/CIRCUITPY/
ls: cannot access '/media/jerryneedell/CIRCUITPY/ FSEV.EN~': Input/output error
ls: cannot access '/media/jerrynee...
@tannewt yes that's much prettier, and good points about the implicit conversion. Nice solution!
@gilded cradle - just to be clear, remove this line, right? +download_instructions: "BLINKA ONLY - url"
Yeah @old smelt . You can remove the comments right below it too.
@tannewt all set, thanks for the suggestion
Thank you!
It takes several minutes for the site to be regenerated, but it's merged in now. Thanks
Cool. This has been a great exercise. Thanks for your help.
Easier caught than taught, as they say.
You're welcome. Thanks for submitting a PR and making the requested changes right away.
It's hosted on github pages and runs with jekyll and uses JavaScript for a lot of the magic.
Ah, yes. I have seen some of those words before. 🙂
magic describes it pretty well 😉
Fluff M0 VID 0x239A PID 0x00AF # bootloader
PID 0x80AF # arduino
PID 0x80B0 # circuitpython
@jepler I started to look into this, but I think your test program fails in some scenarios if you try to set the list as well.
I just changed line 29 from:
a[start:end:stride] = x
to:
l[start:end:stride] = x
and I'm getting a NotImplementedError:
I'll try to understand this better, but what do you think about the list error?
@gilded cradle How do I get to the code in your PR without merging it? I am new to this.
You can add a remote, fetch, then pull. See this guide for some good info about the specifics: https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github
You may want to create a branch off your repo first
That guide is outstanding. Just ran through it twice to do PR's. Kudos to @idle owl.
@gilded cradle I may not get to this today. I am having some trouble with my left eye. I will figure this out as soon as I can.
No worries @timber mango.
@old smelt Thanks! Glad to hear it.
To get pca10100 to build (it's overflowing), change the options list in mpconfigboard.mk to this:
CIRCUITPY_AUDIOMP3 = 0
CIRCUITPY_BITBANGIO = 0
CIRCUITPY_BUSIO = 1
CIRCUITPY_COUNTIO = 0
CIRCUITPY_DISPLAYIO = 0
CIRCUITPY_FRAMEBUFFERIO = 0
CIRCUITPY_FREQUENCYIO = 0
CIRCUITPY_I2CSLAVE = 0
CIRCUITPY_NEOPIXEL_WRITE = 0
CIRCUITPY_NVM = 0
CIRCUITPY_PIXELBUF = 0
CIRCUITPY_RGBMATRIX = 0
CIRCUITPY_ROTARYIO = 0
CIRCUITPY_RTC = 1
CIRCUITPY_TOUCHIO = 0
CIRCUITPY_ULAB = 0
SUPERO...
By the way, it appears from the nRF52833 errata and datsheet that it does not suffer from the nRF52840 SPIM3 hardware bug. I'm not sure if you're avoiding SPIM3 for simmel or not, but we should not need to allocate the special 8KB SPIM3 RAM buffer on any nRF52833 board and also not include the special case handling of SPIM3.
@idle owl @old smelt have you ever tried git pull-request by the way? 🙂 https://github.com/mergifyio/git-pull-request
I think I've found why setting the list failed! It seems Circuitpython (and Micropython) doesn't support setting a slice when the step != 1
mp_seq_get_fast_slice_indexes return true when step equals 1 and 0 otherwise.
Ok, I fixed the problem with setting slices in pixebuf. It should work now.
Fixed a typo and modified the features list a bit in the _board .md file.
Thank you, and good catch as to the reason those slices were failing.
It looks like github actions had a little trouble on the commit, so I requested the jobs to run again. After that it should be fine to merge.
@gilded cradle Is it possible to merge a remote branch into a specific local branch? I would like to merge your branch udoo_bolt into my local branch add_udoo_bolt_detect.
Yeah, go here (https://github.com/geekguy-wy/Adafruit_Python_PlatformDetect/pull/1) and approve/merge
Ok, it automatically updated the PR. After it passes, I'll merge. Thanks
Okay, and should I file an issue about setting lists with slices where the step is not 1?
I might not have been clear in my responses, but that is a separate issue that I did not fix.
OK, it is merged. Now you can do your stuff. 🙂
Yep, thanks
I have a decent start on the changes to Adafruit_Blinka, but can not seem to find information on the GPIOs. I have both I2C and the single SPI port.
Awesome
Should I try going with what I have so I can see if I am on the right track?
I have been working on displayio for Blinka. Here it is running an existing example script.
Nice!
Thanks
No, I think it's deliberately missing on lists. I wouldn't recommend filing an issue.
I have progress. I can import busio, but it does not find board.
Did you add your board to busio? See the section: Add your board to busio.py in https://learn.adafruit.com/adding-a-single-board-computer-to-blinka/getting-i2c-working
Ooooops! I did not finish the tutorial!
@gilded cradle are there supposed to be snowflakes or are there still some bugs to chase?
(either way excellent progress wow)
Thank you, and good catch as to the reason those slices were failing.
It looks like github actions had a little trouble on the commit, so I requested the jobs to run again. After that it should be fine to merge.
Okay, sounds good. And sorry but I pushed another commit. This makes the set_pixels function slightly simpler.
@onyx hinge still bugs to chase. It's an off by one issue.
you'll get there
Earlier today all the letters were stacked on top of each other
I got most of it worked out, but there's still one artifact left.
@dhalbert Thanks for the heads-up! I am indeed disabling SPIM3 because the 8 kB penalty is pretty hefty on this 128 kB part. I'll need to do some special casing to only enable the workaround for NRF52840 parts. I'll do that in a separate patch.
I've made the adjustments you requested, and it's building now.
As noted by @dhalbert in https://github.com/adafruit/circuitpython/pull/2933#issuecomment-632859678, the new nRF52833 part does not suffer from the same DMA bug that requires the nRF52840 port to dedicate 8 kB of RAM to SPIM3.
Currently, the one nRF52833 port (Simmel) disables SPIM3, which means it does not have access to the sole fast SPI bus in the system.
The SPIM3 DMA workaround should be special-cased so that it does not get enabled on parts that are not nRF52840.
I'm mostly creating this issue so that I don't forget about it!
I discovered an issue where the Bluetooth system couldn't be re-initialzied after the hardware watchdog was set, due to the hardware watchdog timer using IRQ priority 1.
One use case I haven’t seen expressed is that of having real-time counter displays being asynchronously driven while other things are going on, and being able to stop/start/reset those counters. I was going to do a project that needed those about 6 months ago, and gave up on CircuitPython.
@gilded cradle <ping>
@gilded cradle I have no libgpiod library and there seems to be something wrong with my gpiod library. I think this is almost working.
Very interesting --
If I flash the board with CP on the linux box - I am not able to access the CIRCUITPY drive as above BUT if I then plug it into my Mac I can access it fine and then if I go back to the Linux box it also works normally - I can read/write to the CIRCUITPY drive.
summary
flash CP to board on linux -- CIRCUITPY not readable
plug into Mac -- CIRCUITPY OK
plug back into Line -- CIRCUITPY OK
It seems that Github doesn't provide any interface for manually managing the "cache". This is a problem, because something is wrong in the cache, and all our builds are failing.
We were seeing actions failures where the cache would be restored
"successfully" but then "Install CircuitPython deps" would fail:
# Step "Fetch IDF tool cache"
Cache Size: ~247 MB (259277989 B)
/bin/tar -xz -f /home/runner/work/_temp/a990f24d-c365-4685-b739-10e052812c81/cache.tgz -C /home/runner/work/circuitpython/circuitpython/.idf_tools
Cache restored from key: Linux-idf-tools-731ed12bcdfbfa8b5dd37e03703992271b3ce85dd629e45130f80f43b84ce3a8
...
# Step "Inst...
I have not seen this on Raspbian Buster or Ubuntu 18.04.
@geekguy-wy with an esp32-s2?
Oh, no, not with that one, which I do not have, sorry.
hmm -- a bit more information - Once the File system has been "fixed" by plugging it into the Mac, I am able to refresh CP to the board and the FS (CIRCUITPY) is still accessible on the Linux (and a Raspberry Pi) however, if i erase the flash then refash CP, it is back to the bad state that cannot be accessed on the Linux box (or raspberry Pi) but can be "fixed" but plugging it into the Mac.
I hope that makes sense...
I think this makes some sense since if I recall correctly flashing C...
Oh, no, not with that one, which I do not have, sorry.
no problem -- that makes me feel better -- I think ;-)
I should have read the title of the issue more closely. 😉
@gilded cradle Here is the traceback I get when I do import board now.
@tannewt this build fails on several resource-constained builds, such as pyruler, because the added translations cause us to overflow flash.
Build pyruler for de_DE took 10.34s and failed
make: Entering directory '/home/runner/work/circuitpython/circuitpython/ports/atmel-samd'
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
188360 bytes used, -200 bytes free in flash firmware space out of 188160 bytes (183.75kB).
8980 bytes ...
What's the process for installing CP onto ESP32-S2 (no circuitpython.org build yet)?
We have several translations which only fit on resource-constrained boards due to being incomplete. With contributions on weblate, some builds no longer fit.
Rather than rendering ourselves unable to accept updated weblate translations, this change allows specific boards to be switched to monolingual. It also adds the boards which are failing in the latest
weblate PR due to space to the list. (#2942)
Hey, quick question. I bought a raspberry pi to play around with multiple threads and use blinka to do the circuitpyhon-y stuff. That's doable, right? I'm not limited to what's in the blinka library but can use all the normal python functions, etc?
yep. when you use blinka, you're running normal python.
blinka is like a shim that let's you use CircuitPython libraries on platforms that aren't running the CircuitPython firmware
so you could, for example, use Blinka to get data from a sensor and then use that data in SciPy, etc.
@crimson ferry You can grab it from the s3 bucket at https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/ then flash it to address 0x0 with esptool
@kind river Cool, thanks!
Thanks @tidal kiln I thought about that only after I bought a Pi Zero W, lol.
Which makes me wonder, aside from native battery support, what then are the differences between the Pi boards and the microcontroller boards that run CP/Arduino? I guess what are the downsides of just using Pi's? Faster clock speeds, storage space, ample I/O, etc. (not counting specialized boards with unique sensors/coms)
attack surface? — a Pi has to have a whole operating system behind it, it gets "interesting" fast if too much stuff is running behind the scenes
That makes sense. Hmm. Well I guess I'll find out! lol
@kind river Does Failed to autodetect chip type ring a bell? I thought esptool 2.8 would fix that
espfuse works fine
I used --chip esp32s2
weird, even with esptool.py v2.8, I get esptool: error: argument --chip/-c: invalid choice: 'esp32s2' (choose from 'auto', 'esp8266', 'esp32')
You need a newer version then. I used the most recent one from github
It was version v3.0
I don't have pin wake yet. Now it is simply that the CPU will sleep when
time.sleep()is called. I do intend on adding pin wake soon after.
any progress on the pin wake? Looking at battery powered SAMD51 ...
@charred flare trade off is mainly with general complexity. with a pi, you have a full linux computer to bring up, maintain, etc. that's a lot to take on for someone who's just beginning and wants to blink an LED. with MCU's running CP, it's much more just plug and play. no need to worry about network configuration, SSHing, tweaking HDMI output....
Yeah that's all true. I suppose I'll find out. I'm wanting to do more complex lighting effects than the micros can handle, I'm finding. I'm hoping the faster clock speed and multithreading will let me get there. I'm mostly just poking around and learning what I can for the time being. 🙂
I posted about this here CircuitPython program prevents drive from mounting and mentioned on discord, but am not sure that the right developers have seen it.
Warning- before anyone tries this please make sure that you have a backup of your CIRCUITPY drive, and you know how to run a flash eraser specific to your CircuitPython board. e.g. https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51/troubleshooting
I am usi...
if you're comfortable using a pi, then totally fine to use
there are a couple of other use cases, like neopixels, that end up being trickier on a Pi.
@kind river 2.8 is the most recent release I see on https://github.com/espressif/esptool/ I suppose I should figure out how to build it from some recent commit...
Oh, I found it, duh it's Python so easy peasy 🙂
@tidal kiln I'm not comfortable with using a Pi - I've never used one, lol. (but I never used CP/Python up until a couple weeks ago) I hope neopixels aren't tricker! That's what I need, lol. Why do you say that?
neopixels have a very tight timing requirement on their data stream
for a Pi, that's tricky, since it's running a full OS
for an MCU, that's pretty easy, since it just does the one thing
Oh right, I do recall reading something about that
but it is possible on a Pi, just takes some more effort:
https://learn.adafruit.com/neopixels-on-raspberry-pi
Hmm. I wonder how to best go about both driving neos AND doing other work in the background
Thanks, I'll read through that
@charred flare Run a Raspberry Pi and use a Circuitpython board as a slave to it. 🙂
yep. also checkout fadecandy.
I was just thinking about that but how do I not have to pause what I'm doing while I give it new instructions?
And the slightly bigger technical issue I'm running into is driving two strings with the same micro. I have to do one iteration on one and then one iteration on the other, etc.
I've never heard of fadecandy! I need to read more about it.
Try doing a slow double-click. There is a 700ms interval when the on-board DotStar is yellow. If you click during that time, CircuitPython will restart in safe mode and will not run code.py. 700ms is too short for you to see it and react in time, but try a slow double-click and you may hit it.
Of course, we need to figure out what's wrong here in any case.
To @timber mango's point — I'm seriously considering using my Feather M4 as a usb slave for a NUC, simply because the two things I need (simple IR command executor; web app) are different types of load altogether…
@onyx hinge You can ask GitHub for new features as you may already know. There's a random guy who tracks them in public too. For a different matter, I put one into his repo with GH's ticket number for public tracking/comment. https://github.com/isaacs/github/issues/1683 Tactics may be different for paying customers.
Is there a trick to get CP running on the ESP32-S2? Flashing seems to go fine (first file), and when I connect a screen and hit RST, I get seemingly good boot output (second file). But no REPL or CIRCUITPY. Same behavior WROVER and WROOM (different .bins). Latest macOS.
(second file)
Hello! Many people call exit() or quit() at the regular Python prompt rather than Ctrl-D or other key combos on other operating systems. The CircuitPython REPL (as seen from the Mu editor) doesn’t have exit or quit. (I also tried import site to have them added but could not import.)
IMO it is easier to document calling a function than a shortcut that may be unfamiliar, changes between platforms (I think macs don’t have Ctrl), can be confused with Ctrl-C or Ctrl-Z.
(Redirected he...
For reference, I have now found a rejected feature request from upstream: https://github.com/micropython/micropython/issues/893#issuecomment-58062897
But maybe Adafruit wants to make a different decision for their version :slightly_smiling_face:
@crimson ferry The built in USB on the dev boards is via a USB serial chip. The native USB is on pins 19(D-) and 20(D+).
That's a great tip - I had no idea that there was a safe mode, but do see it on Troubleshooting now that you mention it. It did allow me to mount CIRCUITPY and recover.
@kind river Boom, in business, thank you!
You're welcome, I'm also currently playing with my ESP32-S2
@kind river or @crimson ferry are you using Linux? I have run into an issue with the esp32s2 file system on Linux.
macOS, saw your issue
@kind river What board are you using ?
ESP32S2 gc.mem_free() shows <64k, should be much more? (something approaching 320k)
same here
@solar whale I'm having the same issue. fsck sees a bunch of junk files/folders. Windows seems able to ignore the junk and open it correctlly, but doesn;t fix it for linux.
@kind river thanks for confirming ... plugging it onto a Mac is like a magic fix 😉
@idle wharf I'm just using the saola dev board
I ordered mine Thursday night, didn't expect them until Tuesday, but they showed up today 🙂
Yeah, Digikey shipping has been surprisingly fast for me
Digikey was out (they're fast for me too), I got these from Mouser
Yay! It was delivered 4 days early from DigiKey... USPS for the win!
TinyPico (esp32) | Espressif WROVER R1 (esp32-s2) | Circuit playground bluefruit (nrf52840)
TinyPICO is nice for small footprint. The Bitsy Add-On ESP32 can actually be used as an Arduino device too if you only need a couple of pins 😉
There's a 19x slowdown reported in https://forums.adafruit.com/viewtopic.php?f=58&t=165699 for 5.4.0-beta.0. The code is in the post so that might be useful as a test case for any changes here.
Where would it exit to? There is no underlying operating system, CircuitPython is the only thing running.
NotImplementedError: byte code not implemented ...I suppose that's expected for a new processor family
Based on a local build this appears to allow #2942 to fit.
Maybe supervisor.reload() is what you are looking for, similar to CTRL-D?
https://circuitpython.readthedocs.io/en/3.x/shared-bindings/supervisor/__init__.html
@stuck elbow There's a question in the forums about stage and ugame on the CLUE. I've not used these but I just read the guide and spotted your name on it. If you have a moment you might take a glance at https://forums.adafruit.com/viewtopic.php?f=65&t=165597 to see if you can help.
@simple pulsar thanks, looking
@dhalbert was involved in this one but to bring things together there's a very interesting case in https://forums.adafruit.com/viewtopic.php?f=60&t=165589 of some simple, killer code. From the description and analysis so far it sounds like an atypical, very lengthy operation in the interpreter seems likely to be the cause of USB problems due to starvation. Might be worth some brainstorming to work out if there are any other things that can cause this.
The original poster of https://forums.adafruit.com/viewtopic.php?f=60&t=165589, @derhexenmesiter,, has described the problem in #2949.
Uh-oh, is my flash damaged? Things were basically working, then the dreaded Guru Meditation Error after power cycles, reflashing.
Ah, erase_flash fixes it
@gilded cradle Is there another version of the gpiod library that works with Blinka? The version on PyPi does not work and has no Chip attribute.
Just as a point of info; I tested the sample script on a PyPortal (also an SAMD51; I don't have a ItsyBitsy M4 Express) running CP 5.3.0 on a Windows 10 machine; and saw no issues with accessing CIRCUITPY while the loop was running.
@timber mango look at how I did the Rock Pi S. I had the same issue and made a special sysFS gpio pin class that should work on any linux board.
There's no section in the guide on using it because it's pretty new though
@DavePutz - can you try that, but reboot the board so that the code runs during startup?
Yes, that is how I ran my test. I see the 'looping' messages on the screen, and CIRCUITPY is mounted and accessible.
@DavePutz - ok thanks, just wanted to make sure. On 5/20 "geekguy" tried this on an ItsyBitsy M4, and said "I just tried your code on my ItsyBitsy M4 and it froze the board up. I can not connect to the REPL." Sounds like good news that the PyPortal doesn't have this issue, and it also uses an M4.
Hey, @tidal kiln or anyone. Is the fadecandy board able to continue to drive neos on its own while the micro/MCU does other things? Like keep running the same loop until it is told to do otherwise? Didn't see anything in the docs that it could but would be super cool if that was the case.
I would check whether it has to do with the operating system, since @DavePutz 's test was on Windows, but @derhexenmeister found the problem on MacOS.
@topaz quest @idle owl - Sorry I missed this on Friday. I am not familiar with that, but it's funny you mention it. Because, as I was riding my bike Friday after work, I started wondering if this exact kind of thing was possible.
Personally, I would be happy with being compatible with how micro python does threads, and then add higher-level constructs afterwards. That way those who need asynchronous threads can do it, even if they are hairy monstrosities and not elegant beauties. Some of the proposals look really nice, but are useless if they are not available.
The Xenon build presented a difference device which appeared as a USB Drive, which is the clue I needed to trace the issue. 100% Windows trying to be clever but failing.
I don't use a Particle Xenon as I use the NRF52_DevKit seems silly to buy another version of the same thing.
So if someone does not see a CIRCUITPY drive they need to look in Device Manager -> Disk Drives; if they do not see an Argon/Boron/Xenon drive they need to check ->Ports (COM &LPT) to see if they have A...
Could anyone familiar with ulab and displayio offer some advice? Essentially I'd like to use some numpy code to rotate a displayio ondisk bitmap and I have a feeling there should be an easier solution to the one I have planned!
@gilded cradle OK. I notice that there seems to be a Pin class in two files within generic_linux. If these are identical, would it be better to put Pin somewhere separate where it can be imported by both rather than have it in two different places?
Ideally I'd like to load an ondisk bitmap to a numpy array, transform it, then convert it to a bmp for displayio to write to the screen
If you flip and transpose the containing TileGrid, does the bitmap stay the same?
d'oh, guess so... no effect on the .bmp
When working on a system which doesn't support time.monotonic_ns() is there some accepted practice to guarantee that a program can measure short 1-100 ms delays with time.monotonic() or is there an alternative? Is there some way for the program to reset the timebase at a convenient place? I looked at adafruit_hcsr04.py (ultrasonic sensor) and it doesn't do anything special. So I believe that it will fail after an extended run. With single precision floating point 1 [day] + 10 [ms] = 1 [day] if everything is expressed in seconds.
Works for 90° increments (human error earlier), I suspect @bleak tiger you want arbitrary angles?
I just tried on a Dell Precision 5530 running Windows 10 Pro (10.0.18363) and it complained "USB device not recognized". CIRCUITPY did not mount, and the virtual com port (USB) was not available.
@gilded cradle That generic_linux.sysfs_pin.Pin works fine. Thank you for that - I will know next time if I have this problem. UDOO does have a few more boards I would like to add in time and when money permits.
@derhexenmeister I think it's unlikely this has anything to do with it, but what is the version of the bootlloader? (See INFO_UF2.TXT after double-clicking.)
@TonyLHansen you can already use the "meanwhile" library (https://github.com/deshipu/meanwhile) — it implements a simple async reactor mostly compatible with how the big Python async functions work. The only downside of it is that in the absence of internal mechanisms it works by polling, but that shouldn't be a problem for things like counters.
Threads are rather hard to implement on small microcontrollers with very limited memory, and they are very counter-intuitive to program (it's very...
@gilded cradle The GPIO on the UDOO Bolt seem to be made of two pins, one input and one output. I am looking closer at this now. Also, I forgot there are two versions of the UDOO Bolt and have made necessary adjustments in Platformdetect with PR #83 - tests OK for V8. They both have the same peripherals as far as I know.
@bleak tiger If you don't need arbitrary angles you could just pre-generate different bitmaps with the angles you need?
that's how most games did this kind of thing historically, before we had those ridiculous graphics cards with more processing power then the CPUs
flip and transpose TileGrid is slower than precomputing, but there's probably a practical limit of open OnDiskBitmaps ...only one at a time just incurs the usual overhead
I believe that I have the latest version (there was a recent recommendation on the forum):
UF2 Bootloader v3.9.0 SFHWRO
Model: ItsyBitsy M4 Express
Board-ID: SAMD51G19A-Itsy-v0
Maybe it's my inexperience with this build system. Able to build for STM32F746GZ and SAMD21G18A however after building flashing HEX/BIN or UF2 in bootloader mode and the device does not show up as usb device. On both windows and unix the device will show up after about 5 mins, and in windows it fails with USB descriptor error.
Is it a clock error or something? Cause if I load the build output on the board it does run after loading the UF2 file. The problem is that it does not show up as a...
Is this for a custom board of yours, or for existing board definitions?
Well the Nucleo 746ZG board is the same.
The SAMD21G18 is custom, but set up just as Arduino Zero (the UF2 bootloader was sent to it as Arduino Zero and shows up as 'ZEROBOOT'
Could you try compiling your SAMD21 firmware as crystalless as a test? That would let us rule out clock problems, I think.
PixelBuf does not coerce RGB tuples to RGBW, like it does with integers. This makes it difficult to switch between RGB and RGBW devices.
Fixes #2953 by coercing RGB tuples to RGBW values, just like assigning an int to an RGBW value does.
Thanks for your help! I got it to work by adding
#define CALIBRATE_CRYSTALLESS 1
or
#define BOARD_HAS_CRYSTAL 0
in my myconfigboad.h, I have a 32.768 crystal connected so both options work.
Can you tell me where I will be able to see a list of all options available, both for the myconfigboard.h and the mpconfigboard.mk?
unfortunately that solution does not work for the STM32F746ZG target, it doesn't show up as USB
@gilded cradle I am ready to start testing digitalio and i2c in a real circuit now. 😉 🙂 🙂 Unfortunately, i2c will not be usable except as root in the vanila setup. 😦 I am not quite ready to dig into how to write udev rules.
The Ubuntu folks seem to believe they must protect us from ourselves, when these are OUR computers. I have had one or two run-ins with them about stuff like this.
The first thing I do after installing any Ubuntu derived system is to set a password for root. 🙂
It would exit in the same way that Ctrl-D exits, i.e. terminate the process.
This is desirable behaviour for Mu editor: the same pane switches from attached device stdout and REPL. People can run a script, see its output, click to open a REPL, look at things, Ctrl-D to go back to stdout, edit code and save to see new output.
Is it possible to get the current time without using additional memory? Or, alternately, is the fact that (on nrf at least) getting the current time creates a new object?
The HiiBot BlueFi is a microbit-compatible single board computer, but has enhanced computing ability, and connectivity. BlueFi uses Nordic nRF52840 (64MHz Cortex M4F, 1MB Flash and 256KB SRAM) as main processor, ESP32 (160MHz dual CPU, 4MB Flash and 520KB SRAM) as a co-processor.
Thanks for the suggestions, I do need arbitrary angles though. The up side is it doesn’t need to be at all fast, the eink will update only twice a day.
The image I’m using is fairly large so I don’t think separate bit maps are possible
@bleak tiger I missed what it is you're trying to do, and what you need the angles for, but for i2c, if you do ls -l /dev/i2c* does it show they're owned by the i2c group? Because if so, you could just add yourself to that group. That's how I do it for Fomu development, and I suspect that comes from Debian. Ubuntu probably does something similar.
Sorry, that should have been @timber mango .
I'm interested in what @bleak tiger needs angles for, though!
What is the current status of this?
After skimming over the long discussion here, it seems like there was a sample implementation at #1415, but it won't be merged, and there's been a lengthy discussion comparing different approaches.
@bmeisels and I are working on an app framework for the AramCon Badge 2020, and some kind of async I/O will be super useful for us. Right now we're looking at the implementation from @deshipu, but we'd l...
No worries @half geyser! The context is I'm building an eink based Moon Phase display that uses data downloaded from a cool NASA blog post. I've got the phases working by drawing a sprite of the dark portion of the moon over a full moon bmp.
The next step is to have the moon bmp and sprite rotate gradually over the lunar month. The north pole cycles 23.5 degrees to the left and right over the month from earths point of view.
I showed the project as work in progress on JP's show if anyone would like to get a more visual take on it! https://youtu.be/OwMp4jiPk2c?t=1254
To show and share a project at 2:30pm Pacific / 5:30pm Eastern today, view the chat or in discord https://adafru.it/discord and look for the JOIN link to join. For best results, be on a wired network connection and use a headset and microphone.
Another similar discussion on the intricacies of PWM: "All timers for this pin are in use" after initing/deiniting
I looked closely at
@deshipu, thank you for the response.
@TonyLHansen you can already use the "meanwhile" library (https://github.com/deshipu/meanwhile) — it implements a simple async reactor mostly compatible with how the big Python async functions work. The only downside of it is that in the absence of internal mechanisms it works by polling, but that shouldn't be a problem for things like counters.
While "meanwhile" looks like it can handle simple counters, I don't see any way t...
@half geyser The /dev/i2c* devices are all root.root unfortunately. This is Ubuntu MATE 18.04.
I had a side discussion with @jepler about this. These choices look good. I think we could parameterize the atmel-samd builds later to be 192kB builds, 256kB builds, and full builds to shorten the tweaks needed for each SAMD21 board.
fix #2912 and/or other "slow responses" with USB after low power PR. It is basically the same as #2868 for nRF. There is lots of discussion there, I will sum it up here. Following is the racing.
- USB Interrupt handler is complete and submitted to the event queue of TinyUSB task
- WFI happens
- Since
tud_task()isn't called yet to response, there is no more USB event. CPU has a good full sleep ofNseconds. - WFI end, tud_task() is called to handle usb events
It is the racin...
Revisiting this because I noticed the support matrix said that pyruler had several modules it obviously didn't, such as the recently added vectorio.
It is less error-prone because we can use the final values instead of re-coding the Makefile logic in python. The only things we need to do are invoke make in "print-database" mode, then chase any indirect references like CIRCUITPY_VECTORIO = $(CIRCUITPY_DISPLAYIO)
It does take longer, about 45s on my laptop.
Fits now, thanks @dhalbert for reviewing the PR to disable some modules.
@timber mango using blinka as root is fine. I’ve had to do that for certain boards. I’m glad the sysfs gpio class worked for you.
I also added esp32s2 and litex ports to the matrix
@gilded cradle It worked great! I wish Linux OS makers would let I2C be usable by non-priv users. I can not see any reason not to. Testing with real circuits today! 🙂 😉
@onyx hinge i like the approach to support_matrix using the make output; much cleaner. however, i'm not confident that it will run on ReadTheDocs, since it requires the toolchain to be available...
i somehow, still haven't setup a personal RTD to test, so its just conjecture at this point. 🤣
oh ugh hmm
i mean, we could python-ize the toolchain setup, and then run it from conf.py like make stubs.
maybe?
docs@e690e6e0a50b:/$ which make
/usr/bin/make
does make -C [...] -qp negate the need for the rest (arm-none-eabi-gcc, etc)?
It should. "-q" means make never invokes any commands
ahh. k.
and -p means "print database", which dumps a LOT of stuff, but including every make variable setting
CIRCUITPY_FREQUENCYIO = $(CIRCUITPY_FULL_BUILD)
CIRCUITPY_ANALOGIO = 1
does rtd run as python2 or python3 @raven canopy ?
python3.7 -mvirtualenv /home/docs/checkouts/readthedocs.org/user_builds/circuitpython/envs/latest
from the last build.
ahah got it
from what I can tell it'll succeed but there's always room to be mistaken
yep. you've assuaged my fear. being make illiterate was the cause. 😄
happy to give more explanation. Should I mention it on the PR too, just for the record?
wouldn't hurt i guess, but not a requirement. i could've google-fu'd better. hehe
initial comment updated
make is available on readthedocs and I built the docs including the support matrix successfully inside docker readthedocs/build:latest with virtualenv --python=python3 /tmp/venv && . /tmp/venv/bin/activate && pip install -r docs/requirements.txt && sphinx-build -E -W -b html . rtd_build/html
@onyx hinge looks like we'll need submodules, but I don't see them being available in RTD.
Traceback (most recent call last):
File "/home/sommersoft/.pyenv/versions/3.7.4/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/home/sommersoft/.pyenv/versions/3.7.4/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/sommersoft/Dev/circuitpython_current/docs/shared_bindings_matrix.py", line 158, in <module>
print(json.dumps(support_matrix_by_board(), indent=2))
File "/home/sommersoft/Dev/circuitpython_current/docs/shared_bindings_matrix.py", line 138, in support_matrix_by_board
settings = get_settings_from_makefile(f'ports/{port}', entry.name)
File "/home/sommersoft/Dev/circuitpython_current/docs/shared_bindings_matrix.py", line 105, in get_settings_from_makefile
raise RuntimeError(f"Invoking '{contents.args}' exited with {contents.returncode}: {contents.stderr}")
RuntimeError: Invoking '['make', '-C', 'ports/atmel-samd', 'BOARD=capablerobot_usbhub', '-qp']' exited with 2: make: *** No rule to make target 'extmod/ulab/code/compare.c', needed by 'build-capablerobot_usbhub/genhdr/qstr.i.last'. Stop.
this is RTD clone incantation:
[rtd-command-info] start-time: 2020-05-25T14:56:30.733175Z, end-time: 2020-05-25T14:56:44.348788Z, duration: 13, exit-code: 0
git clone --no-single-branch --depth 50 https://github.com/adafruit/circuitpython .
Cloning into '.'...
[rtd-command-info] start-time: 2020-05-25T14:56:44.925230Z, end-time: 2020-05-25T14:56:45.511622Z, duration: 0, exit-code: 0
git checkout --force origin/master
Note: checking out 'origin/master'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
HEAD is now at 6356e0c2f Merge pull request #2942 from weblate/weblate-circuitpython-master
[rtd-command-info] start-time: 2020-05-25T14:56:45.803865Z, end-time: 2020-05-25T14:56:46.046473Z, duration: 0, exit-code: 0
git clean -d -f -f
hmmm okay
sorry for the walls of text
i really want this to work though. its soooo much cleaner.
since y've got it all set up ... what if you change it to make ... -qp print-CC
if that works I can tell you what it even does
well, no errors. result seems accurate.
I had a question about checksumming/hashing files in CP. https://forums.adafruit.com/viewtopic.php?f=58&t=165721 I did stick it in the wrong forum by mistake so if anyone has forum superpowers... It also mentions an extremely rare issue I see with code.py failing to run due to a bogus SyntaxErrror
jeff, looks like we could also force submodules: https://docs.readthedocs.io/en/stable/config-file/v2.html#submodules
hmmmmm we'll need submodules someday soon anyway, if we move the pyi file for ulab into the submodule
does running the docker locally not go through the git clone step? i would guess it does, but couldn't find it in their repo (the git clone).
I noticed there is a camera interface on the ESP32-S2 and I was curious about what capabilities it might offer in the future. I did a little research comparing it to the Raspberry Pi's port and wrote up a little summary gist.
https://gist.github.com/askpatrickw/0179d09e74d5f2a4347d5666ea937c4d
If I made errors feel free to let me know. I only know what I read this morning and that doesn't mean I understood it all. 😉
I had a question about checksumming/hashing files in CP. https://forums.adafruit.com/viewtopic.php?f=58&t=165721 I did stick it in the wrong forum by mistake so if anyone has forum superpowers... It also mentions an extremely rare issue I see with
code.pyfailing to run due to a bogusSyntaxErrror
@simple pulsar moved to circuitpython
@solar whale @crimson ferry heap is just 64k because it's currently statically allocated. It can be adjusted later and we'll need to determine how to play nice with FreeRTOS wrt memory too.
@gilded cradle I seem to have hit a snag when it comes to GPIO numbers. In my board file, I have stuff like D13 = pin.KSO0 but it appears that I need GPIO numbers somewhere. In my chip file, I have GPIO_40 = Pin(13). I think I must have things backwards because I think my Blinka is taking 13 as the GPIO number which is not correct. I want D13 to show up as the board pin number when I import board. How do I fix this?
Maybe try D13 = pin.GPIO_40 in your board file.
OK, I can try that. I patterned my files after the rockchip files.
Yeah, you gotta start somewhere and then make changes as necessary.
I see that. It seems like there should be a pattern to this though.
That did not work, so I will take a break now and maybe try again later. I think I know what it wants now.
@gilded cradle I really do not know what format these files are supposed to be in. I have tried two different types and neither has worked. According to how others are setup, one of these should work.
Want to start a PR so I can see what you have so far?
@TonyLHansen
There are no threads. This is cooperative multiprocessing — the tasks suspend their execution and let other tasks run explicitly, by yielding the control back to the main loop. The tasks don't have to know about each other's details, I'm not sure what you mean here.
I'm also not sure what kind of primitives you require. Maybe you could give me a simple example of the kind of a program you wanted to write with those counters, and I can show you how this can be done with that...
I guess so, but what I have now is kind of a mess. Let me get it setup.
@gilded cradle PR #296
It is probably something real simple that I am missing. That is how it usually goes when I get stuck on something.
this can't be good
knowing nothing about what you are doing I'd have to agree 🙂
It seems I'm somehow corrupting my flash storage by running code.py in Normal run mode
In my case, I am adding a new board, the UDOO Bolt, to Blinka so Circuitpython stuff can be used on it. I think I am at that 10% left point that takes 90% of the time.
@crimson ferry That should not be possible. Is this an ESP32-S2?
Yes, ESP32-S2. So unanticipated results are fully expected 😉
Yes, that is why I asked. 😉
While I was testing out the code for #2931 and found some issues with how time.sleep() is working for the ESP32S2.
- Float values passed seem to be rounded up to the nearest integer.
- Passing a small float value like
0.001causes a board to crash on boot (serial output below). Since the board no longer mounts because of that, only solution I was able to find to get a board working again was to runidf.py erase_flashthen reflash CP.
Hardware tested on:
- Espressif Saola Wrove...
I just submitted a 'bug' (change request) to see if the Ubuntu MATE folks will add groups 'gpio,' 'i2c,' and 'spi' with read/write access to allow unpriv users to use this hardware. One should not have to have the root password in order to access these.
@timber mango Do you have the i2c-tools package installed by any chance?
FYI -- I have noticed the issue 1) with time.sleep()
I was trying a simple "blinky" -- using time.sleep(.25) as the delay between blinks appears to blink at the same rates as if I use time.sleep(1.0).
using saola_wrover
I ask because that's what installs the i2c group and the udev rules that allow you to access i2c devices: https://packages.ubuntu.com/groovy/i2c-tools
Sorry, I didn't have time to look into this properly, I will make a new pull request when I figure this out.
Do you have the
i2c-toolspackage installed by any chance?
@half geyser I did not have it installed, but I do now and have unpriv access to i2c. I need the same for gpio too.
@gilded cradle I believe I figured out what is happening. In sysfs_pin (line 138), the pin id is being taken from the board file as 13. I am trying to use D13. I am just not sure how to fix this.
Looks great to me overall! Much cleaner approach than my initial parsing one. Runs in <28 seconds on my system. :smile:
One minor suggestion from me.
Thanks for this @jepler!
Nothing wrong here, really. But, when I was testing, I had to change up the call to figure out what exactly was breaking. Using subprocess.run allows for some better error messaging, which I think would prove handy since this is largely machine-run.
This was my local version:
contents = subprocess.run(
["make", "-C", port_dir, f"BOARD={board_name}", "-qp", "print-CC"],
encoding="utf-8",
errors="replace",
stdout=subprocess.PIPE,
stderr=s...
Is there some secret to avoiding translations merge conflicts? It's driving me nuts
Feels like I need a half a dozen translation merges on any PR that takes a while in the review stages
I don't understand why the changes are causing merge issues - these seem like they should just be superseded by master?
<<<<<<< mimxrt-uart-oneway
"POT-Creation-Date: 2020-05-21 11:18-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
=======
"POT-Creation-Date: 2020-05-19 15:01+0800\n"
"PO-Revision-Date: 2020-05-24 03:22+0000\n"
"Last-Translator: someperson <someperson@gmail.com>\n"
>>>>>>> master
@ionic elk I usually put translations last as part of a pull request, and make it its own commit. That way I can rebase prior to making a PR, and re-do make translate
So you rebase every single PR?
Oftentimes. I also tend to do a rebase -i HEAD~5 or so and drop the commit with the make translate in it and then re-add it.
If you add the make translate step as a separate commit, it's easy to drop it via git rebase -i and add it in later.
Seems like it'd make sense to not even run make translate until after you rebase and get it up on github, in that case
But I still don't think that'd help with PRs that take a week or so to pass review - as long as you've run make translate once, you'll need to update it every time someone edits the master ones or CI will fail.
Can someone post a link to the notes doc for today's call?
Well, rebasing is probably as good as you can do.
@old smelt it's in pinned
It is always pinned.
I thought so, too. But my pinned list was empty.
Weird.
Oh - maybe I was in the wrong channel?
Thanks!
🙂
Good suggestion, thanks.
I actually had the list-style invocation at first, but it failed for me. If it works now I'll add it to the PR.
@tulip sleet Could I bug you for a sec on a C question?
aaand just like that I figure it out. 30 minutes being unable to find the answer, and as soon as I ask for help I figure it out in the next minute. 😑
@ionic elk 😆
btw, for make translate, I merge from upstream whenever there are new translations upstream, and then make translate. I don't bother to rebase.
is there an easy way to check whether upstream had a translation update?
I mean I should still probably just run a merge before ever running make translate but still
if you just look for the PR's since your last push, they are usually clearly labeled as translation updates. Or, a new module wll have new messages.
My usual "technique" is just to notice the failure, be annoyed, and then pull, merge, make translate, and re-push
i googled it and it's not a complimentary term
"anoid" is not complimentary. "Noid" is some pizza character i am not familiar with.
@tulip sleet Yes, it is complimentary within my context. Google does not know what it is saying. A noid = A nerd. 🤓 😉
PUN
@tulip sleet is there a process for "taking over" a community submitted PR? There's one that came in for the i.MX 1050 that hasn't been updated in two weeks, but it'd actually be really great to have that SoC
Just needs a couple tweaks
@ionic elk the submitter may or may not have given permission for PR reviewers to push changes to the original branch on their repo. If so, you can just do that. https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/committing-changes-to-a-pull-request-branch-created-from-a-fork
Yes, 0.0020 is a typo, should be 0.020: https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s140.api.v6.1.1%2Fmodules.html
@omsai I pushed a new version that completes the QSTR stuff. Unfortunately, the next step is evolving the dynamic linkerscript generation that SAMD does.
@ionic elk I added a make merge-translate in my pending PR: https://github.com/adafruit/circuitpython/pull/2931/files#diff-b67911656ef5d18c4ae36cb6741b7965R213
it's not meant to work with a rebase though
just plain merges
Nice!
That's a seriously smiley photo
Identifying a common API for reference voltages is harder. Trying not to have "device-specific modules" for enhancing functionality of modules like ADC and DAC has led to us having only pretty basic functionality. I thought that this would help with some MP3 playback problems (which it turns out not to) and I have no idea how to extend this to encompass multiple ports, so I guess we can just close this up. I'll try to find time to see whether the enum factoring I started here actually give...
@lucid solar vacation in thailand 🙂
@slender iron can you think of any other enumerated-ish types in CircuitPython? pin direction and pin pulls. There are probably others I'm not thinking of
those two and uart parity
Core enumerated types: Pin direction and pull. UART parity.
Can we save code size or improve code quality by using some common code for enumerations?
Common code looks something like this (from #2939)
typedef struct {
mp_obj_base_t base;
int16_t value;
int16_t name;
} cp_enum_obj_t;
#define MAKE_ENUM_VALUE(type, prefix, name, value) \
const cp_enum_obj_t prefix ## name ## _obj = { \
{ &type }, value, MP_QSTR_ ## name, \
}
#define MAKE_ENUM_MAP_ENTR...
by using the maxim reference code, i built a rough circuitpython class, @tammymakesthings, which i can send to you if you're interested
This should probably be a separate PR, but in all the other ports this is a mp_raise_ValueError(translate("Invalid pins"));, it matters because it breaks, for example, this code: https://learn.adafruit.com/circuitpython-essentials/circuitpython-uart-serial#wheres-my-uart-2985036-14
Good afternoon all you wonderful folks -- will there be a separate youtube/streaming link for text-only/lurkers?
[happily lurking today]
@modern wing what time is jp's make code stream?
I believe in an hour from now.
hopefully we can fit everyone in the discord channel
I don't want to risk messing him up
our regular monday time should be ok for me to stream
need to sort it out for kattni too
Yeah there are some hurdles to pass. Can the voice people exceed 25 or does turning on video at all limit us ?
I think you're correct @onyx hinge
If you're lurking, please let us know in here or add it to the notes doc
I'll be taking notes today
lurking
I swear my neighbors think I'm crazy for "talking to myself" all day [conference calls on headphones, etc].
If needed, I can bounce and watch at a later time.
seems to toggle to whoever is speaking
lurking
lurking today
restarting discord real quick, I don't seem to have the video button
Hmm, I just upgraded to arm none eabi gcc 10.1 and CPY for mimxrt doesn't build , lots of "multiple definition of" errors. Downgraded to 9.3 for now
@indigo wedge did ARM release an official toolchain? If so, we'll probably look into it soon
@indigo wedge micropython is having trouble with gcc10 also; weshould probably wait. memset was optimizing to calling itself
That's fun, in linuxcnc we had problems with sincos() being optimized into a call to itself
-fno-builtin-XXX FTW
Here is the final release of the newsletter: https://www.adafruitdaily.com/2020/05/26/virtually-maker-faire-hackspace-magazine-and-more-python-adafruit-circuitpython-circuitpython-micropython-thepsf/
(2nd is direct link to adafruit's section)
Full Video: https://www.pscp.tv/Microsoft/1OyKAYWPRrWKb?t=29m19s
Credits: Microsoft, OpenAI
(it's wild, even if it's just a demo)
Adafruit has started shipping regular (non-emergency) orders after priority orders are filled.
If you have been waiting to order, read Adafruit's announcement and FAQ and then Shop Adafruit. https://www.adafruit.com/opensafely
Adafruit Industries, Unique & fun DIY electronics and kits : - Tools Gift Certificates Arduino Cables Sensors LEDs Books Breakout Boards Power EL Wire/Tape/Panel Components & Parts LCDs & Displays Wearables Prototyping Raspberry Pi Wireless Young Engineers 3D printing NeoPixe...
Who's going to write the first draft of the Dr. Seuss parody "Fox in Nox?"
Many of those new contributors are contributing translations of CircuitPython, which is great
we have 4 languages at 100% now !
The stats are for the last 7 days...but it was 8 days since the last meeting 😛 My PR was 8 days ago... 😛
🎉
congrats @ruby atlas
🎉
Yay!
@slender iron timecode
oh you got it, it was just laggy
👍
unrelated: new GitHub feature preview is quite nice (just noticed/enabled it). https://gist.github.com/broccolini/2245234ac3a4936049e8ffc13f376986
lol. sorry!
lurking for hug rreports
Thanks @inland tusk
It was Andon 🙂
@raven canopy I really like that design.
its nice. look for the blue dot in your profile menu (upper right).
Fun to SEE people, sometimes people look different to how you imagine 🙂
@raven canopy says there are no new feature releases for me 😦
text only for now
Don't get us wrong, most people coming in are still good additions to the community
indeed
It's simply that with visibility, comes spammers and bots.
@solar whale you may need to mute
got work call. real quick. lurking..
We're 63 people shy of 20,000 -- and only a tiny percentage over the past three years have caused any issues. It's an excellent community that does some absolutely amazing things.
I'm thankful that we have the tools and the team to assist in handling these challenges 🙂
I am goinng to lurk
back online
@old smelt is the FPGA bitstream for the Evo M51 going to be open source?
I use a Makefile to do the copying with rsync, but that's pretty linux-centric way to approach it.
back
(there's no keystroke to turn video on/off is there?)
@onyx hinge - probably not out of the gate.
The top-level Verilog source will be available so that people can create their own logic blocks and stitch them into the design. All of the functionality for the FPGA will be there, but the top-level will contain some QXP files - which are pre-compiled blocks. By that measure, it's not entirely open-source.
Have to kick off a 2:00 call. Thanks all. Have a great week!
thanks @old smelt !
That camera is for the birds 🐦
@old smelt thanks for clarifying. Finding that middle way can be hard, especially if there are IP blocks involved.
So they don't give a hoot?
😂
(I removed my item from In the Weeds)
would love to see someone speed up our builds with docker (installing dependencies is a drag)
pirate puns arrrrr
Thanks everyone
👋
Indeed 🙂
👋
Before covid, it was hard to find these premium chairs to "test drive" -- now, it's virtually impossible.
I'm still rocking the Ikea high back chair I have, only because it's...well, what I have. 😕
As we're sharing chairs... https://www.ikea.com/se/sv/p/millberget-skrivbordsstol-kimstad-vit-20339415/ in my office. So comfy!
There do not seem to be any chairs that fit shorter people comfortably.
Best monitor arm I've found is an ergotron. They're not cheap, but they're the easiest to use and move.
Normally though, this is my chair... https://www.emhome.se/images/thumbs/0008877_12191666-870f-416a-aa94-6f825d28bbac.jpg.jpeg
Oh, I have one of those. It's where I put my clean laundry before folding it 😉
I sit with my feet up...it's really comfy and I get no pain.
Northern NJ here -- still under a lockdown that folks are beginning to ignore.
Sweden...no official lockdown, most people are being sensible though. Different mentality to the UK for example where my parents live and my parents have been in near total lockdown since the start.
I am afraid I have zero sympathy for those who ignore lockdown rules.
Best monitor arm I've found is an ergotron. They're not cheap, but they're the easiest to use and move.
@modern wing those can be found cheaper under the AmazonBasics brand — if it looks like an Ergotron, with AmazonBasics branding, it is one. They ship from the factory.
Hmm, I'll have to check that out -- thanks for the heads up @topaz quest
np! (I got one of those myself and I can confirm Ergotrons are the best :D)
I've had a few various arms through the years, and the best was a double panel ergotron. Absolutely night and day difference between the budget brands.
yeah I bought a budget one once, and it was a terrible experience 😦 rated for my monitor weight didn't actually keep my monitor up — the single-arm ABbyE is still my favourite — might get the double if WFH becomes semi-permanent
If amazonbasics is rebranding them -- even a 75% version is still massively better than others.
@gilded cradle Did you have a chance to look at my PR yet?
Ciao.
Later all.
Have a good week!
@timber mango I took a quick look at it. What is the problem you're having with it exactly? It could be the 13 you're passing to Pin() isn't correct. I'll have to take a look at my notes after lunch, but I kind of remember something that tells you how to convert the microprocessor pin number to gpio pin.
This looks good! Just needs to fix the translation merge conflicts.
The pin number is correct.```DEBUG: pin.id = 13
OSError: [Errno 22] Invalid argument
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/adafruit_blinka/microcontroller/generic_linux/sysfs_pin.py", line 136, in _open
f_export.write("{:d}\n".format(self.id))
OSError: [Errno 22] Invalid argument
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./led.py", line 6, in <module>
led = DigitalInOut(board.D13)
File "/usr/local/lib/python3.6/dist-packages/digitalio.py", line 103, in init
self.direction = Direction.INPUT
File "/usr/local/lib/python3.6/dist-packages/digitalio.py", line 129, in direction
self._pin.init(mode=Pin.IN)
File "/usr/local/lib/python3.6/dist-packages/adafruit_blinka/microcontroller/generic_linux/sysfs_pin.py", line 90, in init
self._open(self.IN)
File "/usr/local/lib/python3.6/dist-packages/adafruit_blinka/microcontroller/generic_linux/sysfs_pin.py", line 139, in _open
raise GPIOError(e.errno, "Exporting GPIO: " + e.strerror + " id = " + debug)
adafruit_blinka.microcontroller.generic_linux.sysfs_pin.GPIOError: [Errno 22] Exporting GPIO: Invalid argument id = 13```I had to add some debug prints so I could find out what pin ID was being passed.
Clearly, '13' is wrong. It is GPIO_40.
@onyx hinge ok to merge PR #2957?
Pin(13) = GPIO_40
@gilded cradle I do not get how to connect the board file with the chip pin file though. One error points in one direction and another error points elsewhere.
@tulip sleet can you take a look to https://github.com/adafruit/Adafruit_Community_Code_of_Conduct/pull/5 and https://github.com/adafruit/Adafruit_CircuitPython_TestRepo/pull/34 ?
I won't be able to send more pull request for the rest of this week until I straighten up paperwork for new dayjob, so no urgency 🙂
This includes the SPDX tags for copyright and license on the Code of Conduct itself, and the pre-config configuration and GitHub action that ensures files are also formatted correctly.
As pointed out by @tannewt in
adafruit/cookiecutter-adafruit-circuitpython#75,
the CoC is derived off the Contributor Covenant, and is also released as
CC-BY-4.0 (see https://github.com/adafruit/Ad...
@tulip sleet thanks for the librarians reference, didn't know about that, will use it for the other pull request 🙂
aaah I can't assign reviewers myself: https://stackoverflow.com/questions/32262295/adding-a-reviewer-to-a-github-pull-request
@topaz quest bleh, ok, we will just have to keep more of a watch out for open PR's. I don't always notice these. We should make periodic passes through the PR's and assign reviewers.
yeah I was also surprised I can't assign it 😦 I guess there's space for an auto-assigner bot of sorts
so, who can take a look at https://github.com/adafruit/Adafruit_CircuitPython_IRRemote/pull/38 while I'm selling around PRs? 😄
that looks good on its face. modifying the incoming arguments is ... not a good idea :/
@onyx hinge ok to merge PR #2957?
@tulip sleet i meant to tag @slender iron on that one after I approved. was going to ask if the ninja work was going to nullify usingmakeoutput...
@raven canopy ya, I'd like to use toml + py for it in the future. it's long term though. make improvements are still welcome
k. figured that would be the case, but didn't want to assume. i'll merge it then.
kk, thanks!
@tulip sleet since it seems to that you folks like pull request automatic lifecycle as much as me 🙂 has anyone considered mergify.io yet?
I've been using for some of my repos that invite most contributions: https://flameeyes.blog/2020/03/19/success-story-mergify/
Thanks @raven canopy .. with the ninja build we'll have to revisit but it should still be doable in some fashion
@topaz quest mergify looks interesting. I have not heard about it. Tagging @slender iron too.
I don't think we want to turn off RTC because we now use it for timekeeping and making it available to Python would be handy.
Another approach we can use on some of these boards is to "IGNORE" more pins that aren't broken out. I saved a few hundred bytes on a SAMD board by adding them.
looks
@tannewt Are there more cases here when we wouldn't want to go into WFI? Other pending tasks? This relates to trying to redo the background task stuff to add flags to indicate pending work.
But I think this is a good change for now to get things working better.
mergify looks cool! Rust has a similar bot for auto-merging
What is WFI? Wake From Interrupt? Oh, I see Wait For Interrupt in other ticket.
yep
I'm open to supporting one but not both so that docs are clearer. Perhaps we should create a site module and only auto-import it into the REPL. @merwok are you interested in adding it? I'm happy to give guidance on how to do it.
@ArmstrongSubero I recommend joining the Adafruit Discord. It's easier to give support there. URL to join is https://adafru.it/discord
@timber mango, keep in mind there are 3 different pin numbers. There's the physical pin number of the 40-pin GPIO header, the physical pin number of the microprocessor chip itself, and the virtual pin number that the operating system sees. The chip file is meant to map the virtual pin number to match the physical pin of the microprocessor and the board file maps that pin to the physical pin of the GPIO header on the board. At a guess, perhaps try using Pin(40) instead of Pin(13) in case the virtual pin matches the physical microprocessor pin.
So, I'm not really surprised that you're confused, because it is a little confusing.
@AndrewR-L I think I am waiting on some more input from you, is that right? Do you want some more specific answers from me?
Also, doc for these functions in CPython is here: https://docs.python.org/3/library/constants.html?highlight=exit#exit
I don't want to do this because it adds another piece of functionality that is board-specific.
At least with disabling more modules we already have a way to find what is available. Language support is a separate precedence.
@tannewt The only build failures here are ESP32S2; is this fixed now?
@xobs Assuming ESP32S2 failures are a red herring, this just needs a merge from upstream and make translate to work, and then it should be fine.
Sync the exception type with samd https://github.com/adafruit/circuitpython/blob/master/ports/atmel-samd/common-hal/busio/I2C.c#L76 and nrf https://github.com/adafruit/circuitpython/blob/master/ports/nrf/common-hal/busio/I2C.c#L101
It's important to have it synced because of example code like this: https://learn.adafruit.com/circuitpython-essentials/circuitpython-i2c#wheres-my-i2c-2985160-17
@dhalbert Please take another look. CI is green.
@gilded cradle I know about there being three different pin numbers. If I need CPU pin numbers for the chip pin file there is a problem because I do not have access to that information. Making that change got the same error. So, the virtual pin would be 40 in that example, so GPIO_40? I am already using that form in the chip file.
This is really making my brain yell for help! 😖
Why add one and not the other? The Python stdlib has had both for ages, I suppose to be compatible with expectations from other systems, or people’s intuition.
I’m interested in making a PR. Just tell me where site.py should be added in the source!
@barawn Feel free to mention me on anything pending that still needs to be reviewed. I can provide a USB VID and PID too. So, feel free to make a PR and we can sort things out there.
@timber mango, you're going to need to figure out which sysfs pin goes to which gpio. Perhaps you can do some reading up on how sysfs works. It's really hard for me to know what is what because I don't have an UDOO bolt and there seems to be very little documentation available. I can only guess at this point. You're going to need to experiment with lighting up an LED and then you can be sure you have the correct pin number.
Generally it's better to check of a key using in rather than adding another except.
Are you still working on this or onto other things?
Due to having very little documentation, the UDOO seems to be on the more advanced side for adding, so it's a tough board to learn on.
Also, I didn't see anything obvious as to why the code you submitted didn't work.
@gilded cradle I already know what the sysfs pin numbers are - they are the GPIO numbers which are used by the OS to access the pin. So, GPIO_40 matches physical pin 13 on the UDOO Bolt connector. The OS uses that number to export the pin and make it available for use.
Ok, good. Can you get it to turn on an LED?
@gilded cradle What I do not know is which pin numbering is used in which file. No, I can not light an LED yet because I am still getting errors.
I mean can you get it to light up using the command line?
I do not know about that. I will have to try from the command line. I remember some of how that works...
👍
What is the current status of this?
After skimming over the long discussion here, it seems like there was a sample implementation at #1415, but it won't be merged, and there's been a lengthy discussion comparing different approaches.
@bmeisels and I are working on an app framework for the AramCon Badge 2020, and some kind of async I/O will be super useful for us. Right now we're looking at the implementation from @deshipu, b...
@VR-AntHill Nope. I've moved onto ESP32S2 support. Only the nRF52 is getting more refined lower power thanks to @xobs.
Thank you for the fix! We should make sure and update other ports too.
This looks good! Just needs a translation update and the merge should bring in a fix for the esp build failure too.
Here's a tricky one. What should getrandbits(31) and getrandbits(32) do on the small boards without "long int" support? Here's s a GEMMA M0 running 5.0.0: ```>>> maybeok = random.getrandbits(32)
maybeok = random.getrandbits(32)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: small int overflow
maybeok = random.getrandbits(32)
maybeok = random.getrandbits(32)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: small int overflow
``` 32 seems to be the max. Is this something that could benefit from a note in thegetrandbitsdocs?
We're using the Feather M4. I'll look at doing the recompile -- will that work w/ the latest cp v5.3? I noticed some folks were using two displays per bus -- do you know if we could have 4 displays on the primary SPI bus?
Ya, that setting should work in 5.3.0. I believe folks tested up to 6 on the same bus so 4 should be ok. Note, you'll drop framerate because you can only compute and send so many pixels.
We can have more than one device on an SPI bus. Why are SPI displays treated d...
Oh, and @arturo182's suggesting of raising ValueError is good too. Please do that as well.
Bonus points is it actually adds enum support to CircuitPython: https://docs.python.org/3/library/enum.html
@gilded cradle I did not see anything obvious that would point to why my code is not working either. That is exactly what really BUGS me about this. I know there has to be a defined way this whole thing works. It looks like I am going to have to go into reverse engineering mode to figure this out. When I do figure it out, you can be guaranteed this is going to be well documented. 🙂 😉
disabled UART due to a boot bug with Ubuntu and the Pimoroni FanShim. soft-reset-into-bootloader issue: gone. 😑
now to verify...
nope. must've been an update to something. oh well...won't look the gift horse in the mouth. at least i can move forward again. :phew:
No, I have just aquired a FanShim. Hopefully I don't run Ubuntu on my Pi4. Should I? It already boot from SSD and that is a big bonus for me.
Raspbian is fine. I'm using Ubuntu for a specific reason; to avoid compiling GNU Arm compiler for Raspbian, when i can just grab the aarch64 binary from them.
my soft-reset-into-bootloader issues shouldn't affect many; double tap into the bootloader was unaffected.
A couple minor API suggestions and a request to refactor shared-bindings/common-hal. Thank you so much for doing this! It's looking really good.
These docs and the argument parsing should be in shared-bindings so that the API is shared amongst all ports. The port specific code should be called via a common_hal_ routine.
This all should be in shared-bindings as well.
I wonder if we want this to be available in watchdog so people can try to catch it with except. What do you think?
After months of not booting a Pi (because of CircuitPython)... I just restarted. Maybe it is time to try Blinka.
Not that I can think of immediately. We should rethink it with the background work.
@tannewt The only build failures here are ESP32S2; is this fixed now?
Ya, ESP32S2 should be happy again thanks to Jeff.
@xobs Assuming ESP32S2 failures are a red herring, this just needs a merge from upstream and
make translateto work, and then it should be fine.
Why add one and not the other? The Python stdlib has had both for ages, I suppose to be compatible with expectations from other systems, or people’s intuition.
Generally it's better only have one way to do something. In this case I guess both are ok since it's meant to make it easy to escape the REPL.
I’m interested in making a PR. Just tell me where
site.pyshould be added in the source!
Unfortunately, I don't think it's that easy. We'll need to add a site module to shared-b...
A whole new module is going to use up more flash. I was thinking that just adding some global functions which point to the same thing might take less.
@tannewt I'm currently working on other stuff but I'm planning on circling back to this when I'm done with that stuff
@gilded cradle I do know now that the chip pin.py does not map virtual pins (GPIO) to microprocessor pins. The pin_id is being taken from the chip pin file Pin(xx), so pin_id would be xx. I still have no idea how the board file maps into the pin file. I can not believe this can be so difficult or confusing! So far, none of the existing boards seems to match how I need to do things for the UDOO Bolt. 😕 I am going to crack this nut... 
All the board file does is say that you want for instance D13 to point to whatever you named the pin in the chip file, in your case GPIO_40. The reason there are 2 files is because different boards can implement the same chip different ways. The issue is we don't know what xx is supposed to be.
That is pretty much it, in a nutshell. I do know for sure now that the pin_id in sysfs_pin is whatever xx is, so I have gained a bit of knowledge there. Each bit of knowledge brings me that much closer to cracking the nut. 🥜 Tomorrow, I will be diving in to sysfs_pin to find out exactly how the pin_id is being used. That should give me some clue as to what xx has to be.
Hi I am trying to use the adafruit hat for raspberry pi to control a stepper motor and it works but it is quite slow https://www.adafruit.com/product/2348. What ways are there to increase the speed? Thanks!
@cedar ether What library are you using?
@cedar ether I've not used these. I was just curious as I built something with stepper motors over 30 years ago. I don't think mine went particularly fast but it's a long time ago.
What rpm do you get? The ones I used were rated at 130 step/s max pull-in rate with a 7.5 degree step. Oddly, they were the slowest of the four in the data sheet. That's 162.5 rpm.
Haven't measured it, but seems less than that, around 60 rpm I'd say
Is that without any time delays in the loop?
@cedar ether I see some double step functionality too in the library. What stepper motors are you using?
@cedar ether If no one is around here I'd post to the Adafruit forums including the stepper motor models, the code you are using and anything you've tried and if there's any juddering. I've just glanced at my 80s BBC Basic program and I have pauses in that between the steps and those reduce over time to accelerate it. I don't know if that's because it was missing steps or just traction / torque related.
@simple pulsar Yes, I am using the double step function, but it's still slow.. The motor used is the https://www.adafruit.com/product/324 NEMA-17 also used in the tutorial
What if you changed the conditional that checks for Ctrl-D to also check for if the user types quit()?
i.e.:
} else if (ret == CHAR_CTRL_D || (strcmp(vstr_str(&line),"quit()") == 0)) {
This now works:
import microcontroller
import watchdog
import time
wdt = microcontroller.watchdog
wdt.timeout = 5
while True:
wdt.mode = watchdog.WatchDogMode.RAISE
print("Starting loop -- should exit after five seconds")
try:
while True:
time.sleep(10)
# pass # This also works for a spinloop
except watchdog.WatchDogTimeout as e:
print("Watchdog Expired (PASS)")
except Exception as e:
print("O...
ESP32-S2 digitalio seems to be working well. Beware pins with weak internal or Soala-external pull-ups or pull-downs, or otherwise in-use, e.g. pins 0, 18, 19, 20, 26, 43, 44, 45, 46:
>>> p26 = DigitalInOut(board.IO26)
>>> p26.direction = Direction.INPUT
>>> p26.pull = Pull.DOWN
>>> p26.value
True
I've moved most everything into shared-bindings, rebased on current master, and exposed the exception under the watchdog module. Additionally, most checks now are performed inside shared-bindings with the exception of some platform-specific range checks.
@cedar ether The demo videos of that show it going a similar rate to what you describe. The data sheet isn't very detailed. I have an ancient data sheet which is not specific to that stepper but has a lot of detail on how they work. I can post that if you stick the question in the Adafruit forum. Perhaps gearing / gearbox is appropriate for your project?
@dhalbert this has a duplicate VID/PID, please assign a new one and update the files
We should add a CI check for USB VID/PID validity. It's a common issue with new board PRs
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/1LccVESiE1uFUrLv87Tp923LgrxHQgldFc26DX2QiAjo/edit?usp=sharing
@sour lynx you around?
@slender iron and @indigo wedge I'm sorry I've been a bit absent over the last week or so. I've been having an issue with my home/Covid office where it gets to be crazy hot at about 12pm or so and stays that way until the evening. I've been trying to compensate by working a stint starting at 6pm, but it hasn't been going so great.
Just got a giant honking fan today which should hopefully alleviate the issue until I get back to Artisans Asylum in June.
@ionic elk totally understand, that's how my office is in the summer too
10pm is a tempting time to work in that case
Anyone seen this with ESP? W (96422) CircuitPython I2C: scl 35 sda 34 W (96422) CircuitPython I2C: param config 0x3ffda940 1 2 E (96432) i2c: mode 0x3ffda940 1073588481 2 E (96432) i2c: ../../esp-idf/components/driver/i2c.c:597 (i2c_param_config):i2c mode error W (96442) CircuitPython I2C: error 258 1 2
My issue so far has been it conflicts with my dinner-making duties 😆
basically a struct value changes in the call but is ok from the caller
@ionic elk on stm32f405 feather you haven't figured out any way to do all the board-resetty things that pressing the physical reset button does, via j-link, have you?
mon reset
what if I told you that was leaving ... something ... in a state that's different than pressing reset?
🤷♂️
hah
what kind of thing?
reset button can leave some things in the same state
usually the datasheet points it out
We had issues with the low power domain, if you recall. I think that has different power/reset rules
I'm working on SDIO. On the first run it fails (some HAL routine is returning an error code), but after I "mon reset" it erroneously reads back a block of all zeros instead of the actual SD card content
can you reset the individual peripheral before init?
@onyx hinge I don't find it super helpful to chase those errors before you deal with the "first" one
You often uncover what the cause is by fixing the first (HAL) issue
Otherwise you have multiple errors that can kind of masquerade as each other and it leads you in wrong directions.
right, which is why it's such a pain in my workflow, because pressing reset confuses the jlink gdb server, so I have to restart it, ...
and all this is assuming I correctly fixed the HAL_Delay problem which is where I was stuck the last time. HAL_Delay, which may be using SysTick by default?? was never finishing. so I added: ```+void HAL_Delay(uint32_t delay) {
- if (delay > 1000) {
-
mp_hal_delay_ms(delay / 1000); -
delay %= 1000; - }
- mp_hal_delay_us(delay);
in supervisor/port.c, not knowing the right place for it
@tannewt Ok, just about to start on this
I wonder if I also need to do something about HAL_GetTick, it seems to be used in timing but it does not count up consistently (since lower-power?)
uint32_t tickstart = HAL_GetTick();
Woof good thing this fan seems to be working because there are a LOT OF BUGS TO FIX TODAY
DANG
@ionic elk When I heard about your third floor attic office earlier, I wondered about the summer 
Well, the room right below me has AC, and luckily this huge chonk fan I just got is circulating the air pretty well
We'll see how it combats the early afternoon heat
Donated a PID set for HiiBot BlueFi.
@tulip sleet poking you again about this, can we just get rid of POT-Creation-Date:? Manually editing every file in locale/ for one timestamp sucks
@tannewt should be all set
@ionic elk do git merge and then run make merge-translate. it was committed yesterday
Oh that's right you added the merge-translate thing I totally forgot
darn it I already fixed it I should have tested that
@slender iron any chance you could clear that PR? It'd let me merge in a nice clean version of Master for my busio cleanup branch
what do you mean by clear?
I can't look right now. it's breakfast time for me and the cats
was just up early for a zephyr meeting
@slender iron just meant "approve". Don't worry about it if you're busy, I'll manually merge everything in. Anything interesting at the Zephyr meeting?
This PR issues a general cleanup of the BusIO module to account for recent changes to the pin claiming structure, and issues fixes to a number of bugs and other minor feature requests. All changes are being stress-tested across I2C, SPI, UART, and DigitalIO to hit a baseline level of guaranteed functionality.
It is not currently ready for merge as I'm still tangling with a number of serious issues during testing, including an ugly startup hang, but I'm opening it up to style review and ot...
This one isn't too difficult, but its going to require either some additional metadata or cleaning up prior to implementation:
Duplicate found:
Boards: stm32f411ce_blackpill, thunderpack
VID:PID: 0x239A:0x806A
Duplicate found:
Boards: meowbit_v121, feather_stm32f405_express
VID:PID: 0x239A:0x805A
Duplicate found:
Boards: makerdiary_nrf52840_mdk, feather_nrf52840_express, makerdiary_nrf52840_mdk_usb_dongle,
TG-Watch02A, pca...
Or, are you looking for more than just duplicates?
The failed build is just a GitHub hiccup. Merging anyway.
@BradChan Please note this new set of USB PIDs for this board:
HiiBot BlueFi VID 0x239A PID 0x00B1 # bootloader
PID 0x80B1 # arduino
PID 0x80B2 # circuitpython
That's what I was thinking.
Looks like we'll need a whitelist as well. Some of them look legit (such as pycubed and pycubed_mram.) Others will need to be fixed.
@dunkmann00 That's a great idea! I'm not used to REPL land where we have each line. :-)
Thank you! This is a great start.
Please let me know when the UART changes are excluded from this diff and I'll take a look. Thanks!
I had a few final tweaks I had hoped to push to the branch but it doesn't look like maintainer edits were allowed. Instead, I've made a PR to this PR's branch: https://github.com/simmel-project/circuitpython/pull/1
quit ( ) won't work, etc. It does work in CPython.
Why does this resolve #2478? :sweat_smile:
I didn't mean to be curt. In CPython, sys.exit() raises SystemExit and quits. It appears that exit() and quit() are just aliases for sys.exit() via the site module. You can change them if you want.
So I would suggest we either provide the site module, or we just make the builtin functions exit() and quit() be aliases for sys.exit().
Note that sys.exit() is not working right in CircuitPython right now. It just goes on to the next REPL line.
Hi Guys,
it looks like i can find the answer for my problem here:) on esp8266-12e i'm using TFT module via HSPI however i'm using unidirectional communication thus MISO (GPIO12 aka D6) is not connected to TFT. The problem is i need to use GPIO12 to control TFT LED pin responsible for backlight control - thus one is out of SPI protocol, just set H to turn the backlit on, L to turn it off).
Initially i thought i damaged PGIO12 as even if i set its mode to OUTPUT (yes, i'm using Arduino IDE) ...
it looks like i found solution: first i've initiated SPI and after that i've set GPIO mode to OUPUT. Now i can control this pin as normal and TFT works as normal as well:)
Anyone seen this with ESP?
W (96422) CircuitPython I2C: scl 35 sda 34 W (96422) CircuitPython I2C: param config 0x3ffda940 1 2 E (96432) i2c: mode 0x3ffda940 1073588481 2 E (96432) i2c: ../../esp-idf/components/driver/i2c.c:597 (i2c_param_config):i2c mode error W (96442) CircuitPython I2C: error 258 1 2
@slender iron do you have a link to the code for this?
@sour lynx yup! 1 sec
https://github.com/tannewt/circuitpython/blob/esp32s2_busio/ports/esp32s2/common-hal/busio/I2C.c#L96
very weird the mode check in the idf fails when not printing 4 params before i2c_param_config
idf change is
+
+ //ESP_EARLY_LOGE(I2C_TAG, "mode %p %p %x %d", i2c_conf, &(i2c_conf->mode), i2c_conf->mode, I2C_MODE_MAX);
I2C_CHECK(i2c_conf->mode < I2C_MODE_MAX, I2C_MODE_ERR_STR, ESP_ERR_INVALID_ARG);
+ //ESP_EARLY_LOGE(I2C_TAG, "mode ok");
in components/driver/i2c.c
I couldn't figure out how to see the I2C_CHECK message so I switched it to EARLY_LOGE as well
Does the check pass when you un-comment ESP_EARLY_LOGE and fail otherwise?
mode 0x3ffda940 1073588481 2 seems to not match "mode %p %p %x %d"...
I can only get the check to pass if the log before i2c_param_config has four values printed
ESP_EARLY_LOGW(TAG, "param config %p %d %d", &i2c_conf, i2c_conf.mode, I2C_MODE_MAX); this one?
(I haven't tried more)
ya, that one
ESP_EARLY_LOGW(TAG, "param config %p %p %d %d", 0, 0, 0, 0); causes it to work
more specifically, it passes the check
W (1511) CircuitPython I2C: param config 0x00000000 0x00000000 0 0
E (1521) i2c: mode 0x3ffda930 0x3ffda930 1 2
E (1521) i2c: mode ok
W (1521) CircuitPython I2C: param config I2C done
W (1531) CircuitPython I2C: create I2C done
ESP_EARLY_LOGE(I2C_TAG, "mode %p %p %x %d", i2c_conf, &(i2c_conf->mode), i2c_conf->mode, I2C_MODE_MAX);
that's the idf print
with three params in the first print:
W (1511) CircuitPython I2C: param config 0x00000000 0 0
E (1521) i2c: mode 0x3ffda940 0x3ffda940 3ffda901 2
E (1521) i2c: ../../esp-idf/components/driver/i2c.c:597 (i2c_param_config):i2c mode error
W (1531) CircuitPython I2C: error 258 0x3ffda940 1 2
Do you have the .elf file for the failing case? If yes, can you send it to me, please?
(i can try to build myself, but will need to set up the environment — i haven't quite gotten it to work last time)
@arturo182 Haven't found issues so far. Waiting on really stress testing it again until after I solve the other bugs but I'd like to include it as a part of this cleanup. I'd like to get rid of any issue that's just "I haven't checked this 100% yet" and replace it with real bugs if necessary.
You aren't compiling uPy code with fshort-enums, by chance?
I thought about that. I believe I'm only passing it to the linker
will double check
Interesting, i thought it is a code generation option, and shouldn't do anything useful at link time...
ya, that's what I was thinking
I think we have it there for lto
¯_(ツ)_/¯
we have cruft
-Werror -Wall -mlongcalls -std=gnu11 -Wl,--gc-sections -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D____ -ffunction-sections -fdata-sections -fshort-enums
ah, it is there
@sour lynx looks like that is the issue
Ah I see, makes sense, was just confused how busio cleanup was resolving AnalogIn testing, but now I get that this is more of a general cleanup :)
how do I enable the check error messages?
better question is, how have you disabled them? 🙂 They expand to ESP_LOGE, which internally calls vprintf, i.e. prints to stdout.
If you printf something, do you see the output?
😄
perhaps it's going out the cdc connection
on native usb
I'm trying printf now
I've noticed that somehow you already had log output over USB in your previous livestream! Although now I can't find the code in your branch which would implement the redirection...
ya, I'm not sure how that happened
yup, it's going out USB CDC
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
hello from printfE (26100) i2c: i2c driver install error
Traceback (most recent call last):
File "code.py", line 3, in <module>
OSError: [Errno 5] Input/output error
btw, I recommend not running any tasks at configMAX_PRIORITIES - 1 (https://github.com/tannewt/circuitpython/blob/3621fc08bd46107ac5b5d3ea6d1e9055e73cd957/ports/esp32s2/supervisor/usb.c#L76) — all the task code at this priority needs to be placed into internal IRAM.
Suggest lowering USB task priority to something like 5 (lower than esp_timer, which you use for ticks)
I snagged that from here: https://github.com/hathach/tinyusb/blob/master/examples/device/cdc_msc_freertos/src/main.c#L93
should probably update there too
yup, it's going out USB CDC
do you have a pointer, where is the redirection implemented?
just curious
I don't know
trying to find it
I usually use mp_printf
I don't know the std c lib stuff that well
I see, okay, will clone the repo and see
I'm looking too 🙂
looks like lib/utils/printf.c
yup, turning off MICROPY_USE_INTERNAL_PRINTF made it go out the UART
👍
thanks for the help @sour lynx !
You can also redirect stdout to some other place using fwopen, e.g. to USB or network (if you keep the printf provided in IDF / newlib)
np, you are welcome 🙂
kk, should be using the IDF's copy now
gotta rework the build stuff a bit for it but that's no biggie
then I can debug the i2c driver install issue
@slender iron where is mcu_pin_globals actually populated?
@ionic elk for what port?
mimxrt
I'm getting real weird GDB behavior. It's jumping from reset_all_pins to completely different functions without intermediate steps
I'm wondering if ((mcu_pin_obj_t*)(mcu_pin_globals.map.table[i].value)) is allowing program memory to be overwritten without causing a hardfault somehow
Two usual reasons for that: loaded elf doesnt match device, or the stack is smashed
it should be stored in flash so it won't be easy to overwrite
I really don't know what's up then
I'm going to go back to my pin tables in Pins.h rather than trying to use the microcontroller table and see if that fixes it
I've also "solved" gdb weirdness problems by re-powering the device and jlink and restarting gdb, but whether that was fixing an actual problem or not I don't know
I'll try a hard reset with reworked pins.
what a waste of time though jeeze, I should have stress tested that mcu_pin_globals thing more, I thought it might have sketchy problems.
Also, github isn't overwriting my https://github.com/adafruit/circuitpython/pull/2964 commits?
@onyx hinge i've had weird issues with jlink, gdb that were "solved" that way too.
Hmm, there is no CircuitPython in https://pypi.org/pypi?%3Aaction=list_classifiers
@split ocean I'm trying to follow your latest tutorial for Lars the sloth using a Feather nRF52840 Express board but i get a library error at audioio. Any ideas?
@next holly great, please let me know if any questions or issues arrise.
@stark wagon on nRF you have to use audiopwmio. It's similar to audioio, in general, but the quality is not as good
let me find you a link real quick..
@split ocean OK, does that still work with MP3 or do I need to convert to WAV?
Has there much use of adafruit_ble for sending Advertisements between Adafruit boards? I am seeing a bug where the data does not appear to arrive intact for custom Advertisement with multiple manufacturers' values. It feels more likely to be my code but I'm starting to wonder...
@split ocean Don't worry, sorted it now. Changed import audioio to audiopwmio and updated the speaker declaration accordingly. MP3's work perfect. Only noticeable issue is a click sound at the end of each clip but I assume that is to do with using PWM rather than Audioio library. Thanks for a great tutorial, I plan to make a suitably creepy toy that reacts when it is picked up, maybe adding eyes that glow when the audio is playing.
@onyx hinge Sorry only just noticed you were the one who replied not John. Bad form on my part, not paying attention. Thank you for the assist. As I said it works great. Sorry again.
Great, glad we could help!
Fixes #2962
I added in my assumptions for ignore-able, whitelisted boards.
I imagine this will sit open a while, during any VID/PID reassignment. I'm more than happy to update mpconfigboard.mk entries here, or just defer it all to merge in changes prior to merging this one.
Example Actions run: https://github.com/sommersoft/circuitpython/runs/714747984?check_suite_focus=true#step:22:1
(JP is the good looking one)
haha! i linked an example actions run with that PR. when, the PR will have its own example. 🤦
Hmm, I think my custom Advertisements are getting constructed with default values and not by the received data over BLE. [Added later]: mystery over, details in https://github.com/adafruit/Adafruit_CircuitPython_BLE/issues/79#issuecomment-634990957
@ionic elk @slender iron The font topic we've been discussing, I've found some ICs that contain fonts. I think they're worth looking at for inspiration etc. Their site is only in Chinese, but google translate helps! http://genitop.com/Products/index.html# I've ordered 5 different ones to test out...will come back with my results after they arrive. http://genitop.com/admin/upload/20151016114411917.pdf This is one that's particularly interesting.
are they cheaper than a spi flash chip?
@slender iron https://lcsc.com/product-detail/_Gotop-GT32L24A180_C126770.html this one also has 8M flash. it's crazy cheap!
Gotop Gotop GT32L24A180 US$0.71 LCSC electronic components online Embedded Peripheral ICs Font chips leaded datasheet+inventory and pricing
Ok...8M flash is about half that cost...but still...nice it includes the fonts.
@gilded cradle Now, I know what sysfs is looking for, and it makes sense. I believe it wants Pin(40) in the chip file, because it is trying to open GPIO40 which is correct for sysfs. I will try a chip file that has all GPIO numbers in Pin(xx) and see how that goes. Each bit of knowledge...
The bad news is that I may have to build a new kernel in order to enable sysfs. 😦 This is not desirable. I am exploring the new way to access stuff that replaces sysfs now.
@gilded cradle The sysfs stuff is not working at all. This is not good. I am doing the right things, but it is just not working for sysfs. 😦 This is pretty much going to stop this project for now, at least until I can get some answers from UDOO. I believe they do not have sysfs enabled in the current Bolt kernel because it is being deprecated. I have not been able to find good documentation on the new way to access pins, but will continue to look. I will crack this nut.
Hmm, that's not good, but makes sense.
Just out of curiosity, what do you get if you type ls /dev/gpio*?
I did figure out how to make the gpio stuff accessible by unprivileged users. Yes, not good but does make sense. Unfortunately, that is making my job much more difficult.crw------- 1 root root 254, 0 May 27 17:17 /dev/gpiochip0
That's good. That means libgpiod or periphery should work.
I am going to try periphery and see what happens.
What do you get if you type sudo apt-cache search gpiod?
I needed some custom udev rules, which I pieced together from various bits I found through googling. I added missing information to make them complete. apt gpiod is installed, but I have not figured out how to use it yet, due to very little or bad documentation. It is a minor miracle that I have been able to get this far. I have had to piece together a lot of little bits of information.
Ok, this URL might be helpful: https://www.beyondlogic.org/an-introduction-to-chardev-gpio-and-libgpiod-on-the-raspberry-pi/
Thank you. I will take a look. I am gaining a lot of good knowledge about this stuff. 🙂 I am thankful for a good analytical brain! 😉
🙂
I figure this should be good for a tutorial at some point.
Is Github broken? I can not clone any of my repos now.
I just added a brand new ssh key.
I remember this from MixerVoice work, and having to change them. Thanks for fixing them!
"Merge pull request #2005 931 from tannewt/esp32s2_digitalio"
I noticed that instead of being quasi-complete as they were a few days ago, these translations were back in the range of 2/3 complete.
Inspecting the git history, I saw that they were unexpectedly changed in the merge commit 357467022. This is easiest to see if you git diff 357467022^ 357467022 -- locale, you can see that e.g., this message translation is removed accidentally:
#: shared-bindings/rgbmatrix/RGBMatrix....
@tannewt can you take a look please?
Thanks, I merged the PR.
simmel-project is an organization and not a user, and apparently you can't allow maintainer edits if it's an organization: https://github.com/isaacs/github/issues/1681
In Discord Discovery, I looked for science and technology servers, but Adafruit did not come up.
It's in Explore Public Servers in the Discord app, under Education.
Ahhhh, OK. I still think it should show up as a tech selection too.
I do not understand why I am getting authentication errors when I try cloning a repo, even if it is in my account. I just added a new ssh key for myself.
i have an issue with pyttsx3 in python anyone can help me?
Hey,
Is there a way to get the raw advertisement bytes when BLE scanning?
entry.advertisement_bytes doesn't seem to be available when using Adafruit_CircuitPython_BLE.
FYI - On recent attempts, when re-flashing CP to the board, the FS becomes inaccessible from Linux. ( as noted above -- it seemed like I was able to access it on some previous occasion)
When I plug it into the Mac it is recovered and the files on the CIRCUITPY drive are once again available to Linux, that is, the FS is not corrupted or erased, but I do have to go through the step of plugging it into the Mac before I can use it.
latest try with ```
Press any key to enter the REPL. Use CT...
@rose dust You can turn any Advertisement into bytearray with bytes(ad) - I'd imagine under the covers it is reconstructing it from the parsed data... things like field order could be different from how it arrived.
Length was stored as a 16-bit number always. Most translations have a max length far less. For example, US English translation lengths always fit in just 8 bits. probably all languages fit in 9 bits.
(in fact, all language string lengths presently fit in 8 bits)
This also has the side effect of reducing the alignment of compressed_string_t from 2 bytes to 1. So on average I estimate 1.5 bytes were saved per string.
Because the length of the string now counts against the compressed ...
@lucid solar I've had that experience with a number of chips. "Wow this IC is awesome and does this super cool specialized thing" followed shortly by "gosh darn it it's more expensive than an IC/FPGA/SPIFlash I could easily emulate it on"
@rose dust @simple pulsar is correct, the advertisement gets reconstructed. But you can see all the components at Advertisement.data_dict, in dictionary form, which is probably more convenient anyway.
I am currently re-implementing _bleio for use on host computers (MacOS, Linux, Windows), and the underlying BLE libraries don't return the raw advertisement. In fact they discard some parts of it, unfortunately, and I can't recover an equvalent advertisement
Very clever.
I think some explanatory comments in the C and Python code would probably be helpful to explain the underlying format.
Is anyone else having trouble with Github authentication when trying to clone repos??
@timber mango could you paste the message? Do you have 2FA turned on?
I do not have 2FA on. ```$ git clone git@github.com:hybotics/Adafruit_CircuitPython_RFM69.git
Cloning into 'Adafruit_CircuitPython_RFM69'...
sign_and_send_pubkey: signing failed: agent refused operation
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.```
I have never seen that "signing failed" error before.
@timber mango try git clone https://github.com/hybotics/Adafruit_CircuitPython_RFM69.git
I just cloned it here.
@timber mango https access is to be preferred
Oh!
i never use ssh anymore. have been use https access for years
I do too and do not understand how I did not have https.
Hey @slender iron I flashed my esp32 s2 wroom saola with the master branch and it appears to boot, but I cannot enter antything in ther terminal.
Is this expected? I tried on Pop!OS. I can plug it into my mac or windows if this isn't expected towork yet.
@patent elbow the REPL and CIRCUITPY drive are on the different Pins (GIPO 19 is D-, GPIO 20 is D+ ) you need a separate USB connection for it.
Ahhh... 🙂
I guess my USB breakout board from SparkFun needs to be soldered up.
Thanks.
If you are using Linux - note that I have run into an issue accessing the CIRCUITPY drive -- simple workaround if you have a Mac -- just plug it in once after flashing on Linux. see https://github.com/adafruit/circuitpython/issues/2944
I do have a few macs, yes. I'm professionally an iOS app developer. I seem to only have a USB-C breakout. Do you know if I can ignored CC1 and CC2 on the breakout? Just connect D+, D-, GND and Power?
sorry -- outside my "comfort zone" 😉 Hope someone else can comment.
No worries. I'll keep googling. Trying to be lazy. 🙂
@slender iron could clarify when he is on
I am using one of these https://www.adafruit.com/product/1833 or this https://www.adafruit.com/product/4448
Nice. Both look good, just trying to do it with what I have. I might just hook it up and leave CC1 and CC2 floating. What's the worst that could happen? 🙂
Or I could destroy a USB cable and crimp ends on it.
Well, it popped up as a drive, but it says the contents cannot be displayed.
And I can see the contents on my mac. 🙂
So, just to confirm, it seems like CC1 and CC2 are only needed for power delivery in USB-C.
I can also confirm this is happening with my esp32 soala s2.
Once you see it on your Mac -- go back to Linux and it should show up OK
I can read/write to it on my Linux box after just plugging it into the Mac once.
Yep, it shows up on the linux box fine after that. So strange.
My mac also decided that it was some sort of Keyboard. I told it no.
agreed -- yes - I see that as well
Once it has been anointed by the Mac -- it works fine via Linux.
Well, now that I'm set up, hopefully I can contribute something starting this weekend. I cleared it with my company that I'm allowed to contribute to open source projects. It's been a while since I've written C, but I write C++ daily. I'm still a bit of a hardware noob too.
@indigo wedge Found the issue. I moved reset pin protections to board_init, thinking they were safe there because board init is before reset_port in main(), but there's actually a second reset_port in port_init. So the flash pins were getting reset again - and man, when they get reset it is weird, the debugger gets completely baffled and your code just jumps to random functions addresses for hundreds of steps before failing.
Fix is coming in with my PR but you can solve it locally by just commenting out reset_port in port_init
yes that's what i've done for now 😄
I added some comments about how the string is stored that way, and why.
@solar whale @patent elbow I found some issues with the flash writing code yesterday. I really need to factor out the caching from the external flash stuff. I think I have a temporary fix in my busio branch. Unfortunately, I have a concurrency issue still where I get "unsupported byte code" but if I add printfs it goes away.
I was trying to use the sht31-d library with the new I2C work
I made a saola to feather adapter: https://oshpark.com/shared_projects/z8Tvg3NQ
it's untested now
should come by monday
Awesome! Can’t wait.
you can follow along with my esp32s2_busio branch
@slender iron is there an easy-ish way to tell what is working-ish in a port by looking at the port's directory in the CP repo?
generally it's what modules are enabled
but with me turning on busio SPI and UART are just stubbed out
@pastel panther maybe you want the support matrix in the docs? recently with more accuracy https://circuitpython.readthedocs.io/en/latest/shared-bindings/support_matrix.html
and it doesn't cover things like accurate sleep timing and filesystem reliability
Is there a list of bugs for esp32 s2 stuff to start looking at, or just general testing and familiarization the best way to start contributing?
esp bugs are here: https://github.com/adafruit/circuitpython/issues?q=is%3Aissue+is%3Aopen+label%3Aesp32s2
Sounds good. Bookmarked.
there are definitely more bugs than those listed 🙂
@slender iron okay to remove the esp8266 label on circuitpython github? I just removed the 1 straggling issue tagged with it
Thanks both. I just wanted a way to sanity check if a port is in a good enough state to make a board that uses it. Danke!
ya, I think you can disable it
@pastel panther I think that's potentially a different interesting question because it's a matter of pinout confidence
🤔
@pastel panther what would be the worst case of an incorrect pinout, assuming I check pin capabilities against the DS while making the board?
are you going to use a module?
the s2 has a full pin matrix for i2c, spi and uart
the high speed stuff is a bit pickier
(there are actually two muxes for pins)
no, a bare chip. I'm thinking about making a pro-micro pinout imxrt106x
oh, you aren't talking s2 🙂
no, I just happened to jump into the convo with something seemingly related :0
🙂
tries to remember the imx pin muxing
imx is a bit trickier because it requires external flash
ya, I imagine I'll remix one of @indigo wedge 's boards
ya, that's the safest bet, remix an existing one
and make sure to read the layout guidelines doc
right
@k0d what was the error you are seeing? I think I'm seeing an issue with a regular .py library. I'm getting:
NotImplementedError: byte code not implemented
Yeah, that's exactly the error, I saw you had that on the Show&Tell.
@lucid solar it goes away if I printf every malloc...
I don’t feel like that’s very sustainable. 😉
That’s why I feel like I have a chance to be able to contribute. 😄
@balmy sail 👋
aha yes! theres too many buttons on this thing for me;)
so im guessing that i need to first have a look at basic spi coms, and then look at how the adxl34x works with it? do you have any resources that would be a good place to start? @pastel panther
yes, indeed I do, one moment please... 👀
@balmy sail so here is a library that uses SPI, written by some handsome gentleman 🙄
https://github.com/adafruit/Adafruit_CircuitPython_MAX31856/blob/master/adafruit_max31856.py
haha cheers
This one is SPI-only so we'll have to do things a bit differently for the 34x so we can support both SPI and I2C, however it's a decent example of how SPI is used
would it be easier to start with a library thats just for spi for simplicity? then combine them?
also, there is this library that i found https://github.com/nagimov/adxl345spi
ya, I would do something like:
- fork the existing lib
- copy the existing adafruit_adxl34x.py to something like
adafruit_adxl34x_spi.py - replace the I2C specific parts with SPI parts
- test, test, test
- refactor to join the two
sounds like a plan