#circuitpython-dev
1 messages ยท Page 285 of 1
yw!
here it is @tulip sleet , @tidal kiln
very nice!
neat!
thanks, that's pybadge working with adafruit IO over mqtt using airlift featherwing
It's sad can't use the display, neopixel and airlift at the same time
is it SPI bus contention? are the display and the airlift sharing the same SPI bus?
I think it's airlift and neopixel
not sure, checking schematic
because I can surely do both display and airlift at the same time, it has to be neopixel right?
what goes wrong?
Maybe a shared pin, wait let me share that error
File "neopixel.py", line 91, in __init__
ValueError: D8 in use ```
i don't see that it's shared on the schematic.. hmm
tft and regular SPI bus are separate
What pins are SPI?
MOSI, MISO, SCK
are you using pybadger library?
@tidal kiln to use the display? Yes
and also creating a separate neopixel object?
bingo &^^
Ok lmao
pybadger lib does that for you
I feel good and bad ๐
(for the pybadge neopixels)
no worries. it happens a lot.
That it does.
@tulip sleet sorry for being a git dumb dumb, but I still want to totally nail down what I should do here:
- Should I make my own hierophect/uf2-stm32f fork and submit prs to the adafruit fork, or just clone the adafruit fork and submit directly?
- Say I want to make a commit/PR that changes the drive name to CPYBOOT, which the upstream repo won't want. Will that be skippable in what we send to them?
@ionic elk 1) the former, so we can review your changes ourselves, and them submit them upstream
- with the right PR's yes, but we try make it so we and they can stay in sync. Worst case there could be compile options.
@obsidian compass You seems to do PyBadge+Airlift and dealing with converting color in string to color for displayio... I did this and it is very similar:
https://gist.github.com/dglaude/cc9f7d596c7d976e9c331a9e00e43292
Err that is not for displayIO that is for the neopixel on board.
@obsidian compass I have another piece of code that does web color to color on PyPortal with this:
pyportal.set_background(eval("0x"+value.lstrip("#")))
I don't know if it is pythonic but it works for me.
@half sedge use int(value.lstrip("#"), 16)
@tulip sleet Perfect, thank you.
eval() has to compile and run the string you pass as Python code, which is quite expensive, and can also be unsafe (malicious code could be passed in)
yep, I was going to mention make sure you have a full understanding of what value could contain if you are going to pass it to eval.
@tulip sleet @slender iron Any ETA on the next CP release?
It is likely that I borrowed this code from... the internet!
not that I have planned. something you'd like released?
Thanks for sharing that @half sedge ๐
@slender iron We didn't include the updated Circuit Playground library in the last release. I wondered when it would next be released. Doesn't need its own release. Was simply curious whether there was anything planned. Not a big deal that there isn't.
@obsidian compass here is the repo for my PyPortal cheerlight code (without danh fix): https://github.com/dglaude/Fosdem20CircuitPython
Thanks, I am looking forward to get my hands on a PyPortal soon
kk, I don't know what @tulip sleet is thinking. he's been squashing bugs
Alright. Thanks.
@idle owl do you mean 4.x? I started a PR, but decided it was not urgent and we could wait for things to settle
@tulip sleet I meant 5.x. But I suppose 4.x as well. I agree with waiting. It was more of a curiosity. I have an updated version of the soundmeter code to PR, but I don't think it relies on the recent updates. So it should be fine with the current version.
@tidal kiln Are you tinkering with busio.SPI? Here are couple of my observations: On Feather M4 Express it currently takes a minimum of 30 us to do an I/O operation. The lock takes twice as long.
@gilded cradle do you know the future of displaying on LCD from Blinka?
Should we be able to use a supported I2C or SPI display, connect to a Pi and display on it from Python but with Blinka and CP library?
Are we going to miss DisplayIO?
The idea is to get that 240*240 on a Pi, write code and then move that to the Gizmo for CPX or CPB.
@bright aspen thanks. i'm not doing anything that low level though.
@tidal kiln I am kinda lost here finding the API exposed by pybadger library to control on-board neopixels, any idea?
I see a "pixels" property in lib code but not really sure how to use that one
that's the neopixel instance, so just access it and then use any neopixel API call on it
trying...
pybadger = PyBadger()
pybadger.pixels[0] = 0xFF0000
pybadger.pixels[1] = 0x00FF00
pybadger.pixels.fill(0xADAF00)
etc.
Yes, worked. Thank you!
@tulip sleet ok, current F405 bootloader pattern is it alternates on reset presses between circuitpython and the ARCADE-F4 drive. If I want to match the Atmel behavior, it seems changes will need to be made.
works great otherwise though.
@slender iron & @meager fog you might want to weigh in on this too? I've got a working UF2 bootloader for the Feather F405, but it will need changes to be in line with other feather boot behavior.
<@&356864093652516868> Here is the notes document for Mondayโs CircuitPython Weekly meeting. 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 Iโll read them off during the meeting. Hope to see you there! https://docs.google.com/document/d/16ssd4xtTLyBV_5dmoOSjXIWLtJrESWVIxJ5BIfoUfYA/edit
@half sedge pretty much everything I know about it is contained here: https://github.com/adafruit/Adafruit_Blinka/issues/109
Currently it's not there, but I like to see it added this year.
thanks @idle owl !
@ionic elk it'd be best if it worked the same way with a double tap to enter the bootloader
@slender iron Ok I'll look into making it do that. What about the drive name? Are you ok with our fork of the uf2 bootloader diverging from upstream so it can by FEATHERBOOT instead of ARCADE-F4?
@stuck elbow I'm recreating your snake game - is refresh_soon deprecated?
@ionic elk the boot drive name can be board-specific. We load the bootloaders on our boards at the factory so we'd choose that. Worst case is a compile-time option or two board defs. I'd rather not diverge if we don't have to
i got buy-in from the MS group that we would try to keep the uf2-samdx1 repos sync'd, and it would be good to do the same here
Ok that makes sense, you'd just go in and change the config for your local copy at the factory.
no sense worrying about that, good point
@ionic elk refresh_soon is removed in 5. you can omit it
@gilded cradle https://forums.adafruit.com/viewtopic.php?f=60&t=161551
Hmm, thanks @slender iron.
np, thank you
I opened an issue on github and let them know
thansk
Ya, I'd assume backlight.
Want to add DISPLAY here too?
I'd prefer if it was more like this. I think it will work if l_tim is a pointer rather than a copy. So it'd be mcu_tim_pin_obj_t *l_tim = &mcu_tim_pin_list[i]; and then l_tim-> instead of l_tim. below.
any ideas why build sizes would be 200 bytes different between my computer and github actions? It outputs the same version of gcc
@slender iron 200 bytes is a big difference. I observe small differences from build to build, though, even on the same system. I think it's down to the fact that (sigh) the lto linker involves random numbers for some reason (!?) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66305
two consecutive builds of metro_m0_express just now gave me: ```5396 bytes free in flash firmware space out of 253696 bytes (247.75kB).
5392 bytes free in flash firmware space out of 253696 bytes (247.75kB).
I think it's that github actions is creating a merge commit
oh, so it's not even building the same code as you? that could explain 200 bytes easily.
ya, believe so
the run is marked as 5e789b3 but in the output HEAD is now at e9860007d Merge 5e789b38504846982a8cd7fa447297a51efc8352 into eb0ef3726f7c5857bcb3b75910ee445767b2af89
@onyx hinge @slender iron Perhaps the 4-byte changes are related to a date/time string?
ok, now it is spot on for me
en us is off by 4
I'd believe linker randomness
@bright aspen I don't think we include the build date though the compiler may
@idle owl want me to merge this and tag a release?
https://github.com/adafruit/Adafruit_CircuitPython_Display_Text/pull/30
I think the version string is git commit
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
Font missing character: รผ 252
Font missing character: ร 220
Font missing character: ร 223
Font missing character: รถ 246
Font missing character: รค 228
0 bytes free in flash firmware space out of 237568 bytes (232.0kB).```
nailed it
its -4 on github actions ๐
did tinyusb get bigger?
gonna go for a run. will debug after
@tidal kiln Yes please
@tannewt I've made the board change, and it works for my builds, but I'm making note here of all boards that include content in board_init that isn't screen related. I don't own any of these, and they should probably get tested for any unexpected breakage.
- capablerobot_usbhub
- feather_mimxrt1011
- feather_mimxrt1062
- imxrt1010_evk
- arduino_nano_33_ble
capablerobot_usbhub is now empty. The three imx ones are super alpha and I don't think they will break. @dhalbert would be able to tell about the arduino nano.
@tulip sleet for the arduino nano 33 ble, do you know if these lines in board.c will cause breakage if included after the filesystem is inited?
// Errata Nano33BLE - I2C pullup is on SWO line, need to disable TRACE
// was being enabled by nrfx_clock_anomaly_132
CoreDebug->DEMCR = 0;
NRF_CLOCK->TRACECONFIG = 0;
// FIXME: bootloader enables interrupt on COMPARE[0], which we don't handle
// Disable it here to avoid getting stuck when OVERFLOW irq is triggered
nrf_rtc_event_disable(NRF_RTC1, NRF_RTC_INT_COMPARE0_MASK);
nrf_rtc_int_disable(NRF_RTC1, NRF_RTC_INT_COMPARE0_MASK);
@ionic elk does "bootloader" here mean the UF2 bootloader or the Arduino-supplied bootloader?
If you're referring to what I just posted I have no idea, that's nrf port code
I don't know if the softdevice uses NRF_RTC1 for anything
maybe I just copied that from the Arduino startup code forthe board
do you have one of those on hand? Scott had me move the board_init into main, after the filesystem, and this is the only board that could be affected by the change
everything else is either empty or won't have problems
I think you could delete the "FIXME: bootloader" lines. I copied those from the Arduino variant.cpp
they aren't relevant to the UF2 bootlaoder
I am more worried about moving board_init() to past the filesystem. On some boards it does some pretty low-level stuff
This isn't related to the bootloader stuff I was talking about earlier, by the way, it's the display thing
@slender iron I wrote this up and welcome thoughts, but like so many things it's not anywhere near the top of my todo list.
Improving memory usage for labels in displayio:
My idea is to introduce a type GlyphRow whose data fields are basically
uint16_t x, y;
mp_obj_t font;
mp_obj_str_t* content;The first glyph is drawn with its origin at (x,y). Subsequent glyphs have the
x coordinate adjusted by the width of the prior glyph.A row of pixels can be computed efficiently from left to right by just
iterating over the list of characters in the string. If it has to be
drawn from right to left, then you'd also need to keep an "end of string"
and a "total length" pointer (plus extra problems that arise from the memory
storage of unicode in circuitpython being utf-8; this complicates backwards
iteration). Drawing from top to bottom or bottom to top just mean using a
column of pixels at a time but are otherwise like RtL or LtR. I think all
these cases can arise from screen rotations.It doesn't matter whether the glyphs are in one Bitmap or not, they are
fetched from the font object by calling the get_glyph method. No auxiliary
storage is necessary for the string data itself.Multiline text would consist of multiple GlyphLines, and the responsibility
for laying them out would fall to a refined adafruit_display_text. In this
case we might want to allow for str to be qualified with a start and end, so
that there's no slicing of the overall string; or maybe YAGNI.Protocol-izing Group / TileGrid so that GlyphRow can be added is probably a
sensible step to take before introducing a third type that needs to implement
similar operations at the shared-module level.
I looked through every board in circuitpython and it's empty in every single one but this and the i.mx, which scott thought was fine
These are the only boards that had any content in the function:
- capablerobot_usbhub
- feather_mimxrt1011
- feather_mimxrt1062
- imxrt1010_evk
- arduino_nano_33_ble
scott emptied the capable robot one, the i.mxs he says should be ok, so it's really just this nano left.
@ionic elk, ok then
Big Hug to @idle owl for the MLX90640 learn guide and the use of my example. So proud. Also nice picture.
Thank you and thanks for the example!
I think this should be good to go now.
we have a smattering of https://www.adafruit.com/product/4500 if someone would like to pick one up
Do you feel like you just don't have a CLUE? Well, we can help with that - get a CLUE here at Adafruit by picking up this sensor-packed development board. We wanted to build some ...
@idle owl @slender iron having trouble setting readthedocs url properly: This is right: https://circuitpython.readthedocs.io/projects/ble_apple_media/en/latest/
This is wrong:
https://circuitpython.readthedocs.io/projects/adafruit-circuitpython-ble-heart-rate/en/latest/
adafruit-circuitpython- after projects/ is wrong, but I can't find where this is set (on RTD?, in a file?)
it's not the rtd slug
its in the subproject settings
aha
it can be hard to change because those settings tend to crash the server
yes, I am getting irregular 502's, but I did succeed in making it a subjproject
I've had better luck url hacking to avoid the giant list
snagged it; I"ll bookmark the edit URL as a sample; tnx
๐
I think you meant to remove this.
So close! I think you missed removing board_init from the stm32 port.
Weird, must have been a merge issue. Wasn't even on my local copy.
Oh no I got it mixed up with main on my manual fix whoops
@slender iron all set
k, looking
Yay! Looks great! Thank you!
@slender iron want me to merge or is there anything else we're waiting on?
k
The unit tests pass... ๐คทโโ Probably some edge cases in inheritance again. I wish we could exercise all the examples in learn!
Shop Bot indicates that two hours ago, it was in stock (11).
@serene warren There was no notification sent out. 17 were put in stock. There will be more in tomorrow. Keep an eye out here as well - sometimes we post here before that notification goes out.
I await with anticipation... Thank you @idle owl
You're welcome
@tulip sleet I did realize we should add a wait to limit the number of advertisements
@slender iron that's a good idea. I think what I'm seeing is that the event handlers have a param that is a stale object, either on the stack or in the heap. But I'm not sure that is the case. The event handler list gets reset sometimes but not all the time. Still trying to trace it. The stack traces I am seeing are weird
I might talk to you tomorrow about it
finally!...
redis-server.service loaded active running Advanced key-value store
rosie-rq-worker.service loaded active running RQ Worker For Rosie
note: if you're going to include systemd unit files in a distro package, please have them work out-of-the-box.
Maybe adding a shared library is the wrong idea. I just compiled our .cpp code with gcc -lstdc++ as a flag. Would it be possible to add -lstdc++ somewhere in the make file, perhaps in LIBS?
Yes, certainly, just add it to LIBS with +=, and see whether it works.
Might want to add that the only valid VT100 commands ( \x1b[K for clear to end of line and \x1bnnnD for move cursor left nnn spaces ) to the doc https://circuitpython.readthedocs.io/en/4.x/shared-bindings/terminalio/Terminal.html
I could not figure out how to put an issue for that into Github. I had to hunt around in the source code to find this out.
Would the circuitplayground library be expected to work as-is with the CPX+displayio firmware? I'm having some trouble importing it, but I'm not sure if it's really expected to work
@lone axle it is frozen in, so it doesn't need to be in your filesystem. Are you getting memory errors?
I got an error when I try to import it:
Adafruit CircuitPython 5.0.0-beta.4 on 2020-01-22; Adafruit CircuitPlayground Express with displayio with samd21g18
>>> from adafruit_circuitplayground import cp
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "adafruit_circuitplayground/__init__.py", line 29, in <module>
File "adafruit_circuitplayground/express.py", line 49, in <module>
File "adafruit_circuitplayground/circuit_playground_base.py", line 54, in <module>
ImportError: no module named 'gamepad'
but I did include the library in my lib folder
that is ok, lib/ comes after .frozen in sys.path
but i'll check this
ok, this is a problem; gamepad was added to the lib, is turned off in the build for space reasons. I'll make an issue.
gamepad is a native module
I ended up trying an older build as well:
Adafruit CircuitPython 5.0.0-alpha.5 on 2019-11-04; Adafruit CircuitPlayground Express with displayio with samd21g18
on that one I was able to import it without gamepad issue, but I did have to use a slightly different import
what is gamepad used for?
The CP library now needs gamepad, but this native module was turned off a while ago in the CPX crickit and displayio builds for space reasons. One hopes there is room to turn it back on.
I peeked for a second and it looked like it was holding the A and B buttons
self.gamepad = gamepad.GamePad(self._a, self._b)
try this - it's approximately beta 4 with gamepad included
This one works. Thank you ๐
What do folks think about this as a #circuitpython-dev2020 recap post? ```Wow, 2020 has seen CircuitPython growing even faster than 2019 already. We had many more #CircuitPython2020 responses than last year, 5.0.0 is just around the corner, we have over 200 libraries, over 100 boards and the website just got a face lift! Thank you to every one for helping make that happen.
With #CircuitPython2020 we asked you to post your vision for CircuitPython in 2020 and so many of you posted. Kattni, in particular, pointed out that we should do something similar throughout the year. It is a great idea! So, as you use and explore CircuitPython this year, post your thoughts about the future of CircuitPython with the #circuitpython2020 just as we requested earlier this month. We'll leave the email open and blog your posts as we see them. If you have a specific feature in mind or want to see what we're working on then check out the CircuitPython issues here.
Here is a list of all the posts so far:```
(with pictures and links of course)
OK so that code is now doing some timeout-like behaviour :-) but I need to do some thorough testing,
This lets us choose the color to be displayed when everything is transparent or there is nothing to display. Previously this would display the #ffff00, but we want to default to black, especially when a game doesn't use the whole screen.
Weird. The blurb from the bot transposed some of the hex color digits.
This fixes some apparent hangs when using adafruit_ble_heart_rate as a central. The problem was that on a soft reload, the old event handlers were still in effect (with stale pointers) and the connection was not reset. Tested with the sample HRM program.
vm_used_ble, which tracks whether any Python code (as opposed to supervisor) has done BLE operations, was not being set in a sufficient number of places. In particular, central-only BLE wasn't being detected.- Call `bonding_reset()...
bitbangio.OneWire uses no-interrupt microsecond-resolution timing delays for up to several hundred microseconds to implement the OneWire protocol. It calls common_hal_mcu_disable_interrupts() and common_hal_mcu_enable_interrupts(). As of PR #2562, these functions don't turn off all interrupts, but instead use the sd_ critical section functions to allow BLE interrupts to be serviced and avoid SD faults.
So this may break OneWire on nRF when BLE is in use.
Is the information at https://learn.adafruit.com/circuitpython-essentials/circuitpython-storage still valid for swicth the flash fs to writeable?
It was valid last time I tried, but that would have been back in the 3.X days.
4.x documentation for storage.remount: https://circuitpython.readthedocs.io/en/4.x/shared-bindings/storage/__init__.html
Ooooo nifty, disable_concurrent_write_protection
This is what I have in boot.py:
import digitalio
import storage
switch = digitalio.DigitalInOut(board.D9)
switch.direction = digitalio.Direction.INPUT
switch.pull = digitalio.Pull.UP
# If the switch is pressed CircuitPython can write to the drive
storage.remount('/', switch.value)
Seems either to not get run, or remount isn't working. In code it's always readonly.
Even on a power-on disconnected from USB (battery powered)
It does need to be a fresh power up, instead of the reset button iirc so it's good if you are using battery and unplugging / replugging. It might be worth trying to open a txt file and write something to it from inside boot.py and/or turn on or off the built-in LED (if you have one) to figure out if boot.py is running or not.
Yes. eject, disconnect USB, attach battery based power, and powerup.
I'm using a neopixel as a status indicator, currently it's color is set based on whether or not the fs is readonly. Always comes up readonly.
Have you confirmed somehow that switch.value is changing with your physical switch?
@umbral dagger have you verified the default state of the the pin? IIRC it will be True at power on if the button is not pressed.
I've run the same code (not the remount) in the REPL and it reads the pin as expected. So yes.
so are you pressing the button at power on or leaving it unpressed?
Pressing it in hopes of having a writeable fs ๐ฆ
waht MCU are you using?
Beyond that, I've put storage.remount('/', False) in boot.py with the same results.
SAMD51 (Feather M4 Express)
and what version of CP?
Adafruit CircuitPython 5.0.0-beta.4 on 2020-01-22; Adafruit Feather M4 Express with samd51j19
ok -- I'll try to reproduce
I just tried it and switch.value is defaulting to True and the drive remains writable by via CIRCUITPY
but grounding D9 -- it comes up as read-only via CIRCUITPY - switch.value is False
so it appears tp work as advertised.
In my case it is connected via USB ....
@umbral dagger I ran your original code ```import board
import digitalio
import storage
switch = digitalio.DigitalInOut(board.D9)
switch.direction = digitalio.Direction.INPUT
switch.pull = digitalio.Pull.UP
If the switch is pressed CircuitPython can write to the drive
storage.remount('/', switch.value)```
Hmmm... here's my code in code.py: try: with open(settings.LOG_FILE, 'w') as fp: # first, get rid of any previous log fp.write('Log\r\n') system.indicate(colours.RED) import file_handler logger.addHandler(file_handler.FileHandler(settings.LOG_FILE)) except OSError as e: system.indicate(colours.GREEN) print(e) print('Logging to serial')
It always throws [Errno 30] Read-only filesystem
with D9 grounded ```Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.0.0-beta.4-95-g0b761f60e on 2020-01-30; Adafruit Feather M4 Express with samd51j19
fp = open("junk.txt","w")
fp.write('test\r\n')
6
the did fp.close() opened D9 and rebooted ```jerryneedell@Ubuntu-Macmini:~/projects/feather_m4_express$ cat /media/jerryneedell/CIRCUITPY/junk.txt
test
are you sure your button is "normally open" ?? grasping at straws...
Yes. The button works fine, reading the button from the REPL works fine.
odd...
With the switch removed and D9 jumpered to ground it still behaves the same.
@slender iron I added print('D9: {0}'.format(switch.value)) but nothing different in boot_out.txt
I emptied boou_out.txt, booted on battery power, after that boot_out.txt contains: Adafruit CircuitPython 5.0.0-beta.4 on 2020-01-22; Adafruit Feather M4 Express w ith samd51j19 settings.py output:
its always been that way
What about all the wifi projects that use a settings.py that gets imported
which is what I'm doing
isn't it named secrets.py?
๐
renamed it to config.py and things are behaving better. Thanks.
Where's that documented?
settings is a pretty tempting filename for ... um ... well... settings
What about having it be an error to have multiple of competing files (boot.py/settings.py, code.py/main.py/...)
one spot is here: https://github.com/adafruit/circuitpython#behavior
I'd be ok removing settings.py as an option
This doesn't seem to work, since we can't use c++ syntax like #include <cmath> rather than #include "math.h" in our files. Any other recommendations of how to switch to g++, since g++ should be able to compile both c and c++ files, correct?
This is working great with the Heart Rate Trainer dual seven segment display project on Feather nRF52840. No more hangs and resets after saving code.py.
Looks great! I'm glad it's working better! Probably worth a new beta release.
Ok, this is ready for another look. I got some space back by tweaking a couple error messages.
@slender iron @ruby atlas just saw the review request, will hop on that now.
Why not use m_malloc here? You'd get the error message for free.
Not sure why this line is added.
thanks @onyx hinge
So that we can deinit the UART before throwing the error.
Ah, I thought I might need it. Will remove it.
Removed and merged in latest master.
You'll like need to modify the Reset_Handler as well for C++ because we don't do any of the C++ static initialization there.
It would appear there are a few more CLUE boards in inventory in the shop if anyone missed them yesterday and wants one. Probably going to go quick again though I would imagine.
Just a friendly note -- clue boards are back in stock ๐ 75 of them....wait, hold on....74. There. 74 are in stock ๐
@lone axle Beat me to it ๐
got mine! 70 left
Seriously, Clue is what got me to take a look at the Micro:Bit ecosystem. The original Micro:Bit, although perfectly appropriate for the target market, just didn't entice me -- but toss on BLE with a ridiculously sharp IPS screen? Why hello. ๐
I loved playing with the microbit, but I did always wish for it to work like the Circuit Python devices where we could put the py file directly onto it rather than having to compile to hex or whatever it was first.
there is a number of microbit-compatible boards
I have one with esp32 on it and 5x5 neopixel matrix somewhere in my drawer
bpi:bit
I nabbed the new octagon robotics chassis. Something about making a BLE Clue with micro:bit-compatible Crickit....
Nabbed a Clue a few minutes ago.๐
I built this and adapted a neopixel demo of my own to use it. It resulted in nearly doubling my framerate, according to time.monotonic, which is rather nice given that it's a fairly intensive on FP arithmetic. That means a LOT of performance improvement via this upgrade, nearly doubling my updates per second (18Hz -> 34Hz on a 96-pixel strip)
(the superseded neopixel release 4.1.0 did not work for me but---aside from the branch of code for parsing byte order as a tuple---it was not hard ...
Hi all. Iโm looking for something fun to show at a Kโ8 science fair tonight with multiple Circuit Playground Bluefruits. @idle owl, you mentioned a project using 4 CPBs. Ideas, anyone?
Some kind of multiplayer game, perhaps.
I just imagined playing the 'simon' color sequence game but with 4 CPBs that aren't even wired together. not helpful for getting something going for tonight though.
With part of it running on my Mac showing on a large monitor.
I made such a thing for Raspberry Pi with a nice webapp.
Kids played it at the same science fair last year and loved it. Iโm just learning BLE, so this may need to be simple if I am to program it in the next couple of hours.
@pearl notch Here are a few projects that are using multiple CPB's, not sure if any of them are specifically 4 though. https://learn.adafruit.com/hide-n-seek-bluefruit-ornament | https://learn.adafruit.com/circuit-playground-bluefruit-neopixel-animation-and-color-remote-control | https://learn.adafruit.com/circuit-playground-bluefruit-quick-draw-duo
Use Circuit Playground Bluefruit devices to create a colorful signal strength-based proximity detector!
Control NeoPixel colors and animation remotely over Bluetooth with the Circuit Playground Bluefruit!
Quick Draw Duo might be just the thing. Thanks!
@lone axle you beat me to the punch, I was about to share the quick draw link
@tulip sleet what that merged based on it passing Actions, or should I let someone with a board verify the added pins function as expected? I assume Rev C is what is going out as alpha?
@pearl notch the Bluefruit Playground iOS (and now Community Edition for Android) also provide a nice way to show off the board. Here is a learn guide for the iOS one (Android works basically the same) https://learn.adafruit.com/bluefruit-playground-app
Doesn't really involve multiple CPB devices though, it's 1 CPB "paired" with the phone at a time
Still, cool to show. Thanks!
I installed โableโ on the Mac, which talks to the examples programs on a CPB.
If you end up using the Android one, and run into any issues feel free to ping me in here. I made the Android one and am happy to help if you run into any trouble.
Excellent. Good to know you. Iโm running it on Android.
@onyx hinge right, rev c is alpha, and that PR will be reviewed by limor.
okie
Hah! Quick Draw Duo is awesome!
gamepad was added to implement adafruit_circuitplayground_base.were_pressed here: https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground/pull/51
looking forward to trying a clue on one of these https://www.adafruit.com/product/4442
@onyx hinge I have someone lined up to test the PR you merged.
I'll have them test it anyway. No worries.
@idle owl Thanks! I hope I didn't step on toes too hard.
@solar whale I was thinking of getting one of those myself, but I figured I'd run with Crickit first -- plus that buggy bolts onto the microbit, whereas the Crickit is more easily accessible.
@lone axle The VL53L0X PR was merged - please test it anyway once you have the hardware.
@onyx hinge It's on us, we should have commented on the PR.
@lone axle Moving forward, let's make sure we comment on PRs we have plans for.
@modern wing but itโs so cute ๐
@lone axle testing beats just looking at the code onscreen ๐ ๐
It is! @solar whale --- and inexpensive since it's all inclusive of the chassis, motors, wheels, etc.
@idle owl will do. I'll go through my list tonight and make comments on all of them indicating that I'll be testing soon.
Excellent.
Thanks!
@tidal kiln Do you have a minute to talk Micro:Bit/CLUE? I'm doing the pinouts and saw you did the initial guide of the Micro:Bit and thought you might be able to help.
@idle owl sure
@tidal kiln I don't know how to describe the pads. I kind of fudged my way through explaining the edge connector.
same with 3V and GND
You didn't get into it much, it was much more of a broad stroke deal
could just do same? or do you want more detail?
are you trying to document all the small ones as well?
Not yet.
Which is to say not unless Limor asks me to.
I'm unsure whether she wants that level of detail or "Micro:Bit compatible edge connector" is enough to get people started.
i'd think that would be enough
i probably borrow the more detailed pinout from somewhere:
https://learn.adafruit.com/bbc-micro-bit-lesson-number-0/edge-connector
but could make one for clue if needed
otherwise there's just the 5 big pads, which you can explain more simply
right.
I guess I wanted a little more than "Can be an input or an output"
but I don't know what they do beyond that.
Never did anything with micro:bit
i'd have to do some looking around to figure out the other functions for the pins, on clue
Eh. I'll deal with it then. I figured if you had some knowledge already, I'd take it
Limor usually fixes up the pinouts pages anyway, but I try to have something for her to work with
you're wanting something more like "0 - is digital 0, but is also SCL, PWM3, ADC12, LASER_ENABLE_123, etc." ?
Maybe? Except it's different for Arduino and CircuitPython I assume. Bleh. Not sure if there's a middle ground somewhere.
should be the same, maybe different nomenclature
but it all comes down to what the specific pin on the nRF can mux to
ah. cause "alpha"?
yeah., not sure to what extent.
me either. but possible if something gets rerouted.
That feeling when you run an upgrade command and it's doing way more than you expected it to and you're pretty sure your computer is going to explode on the other side. ๐คฆ
my SSL is broken. trying to fix it.
and now it's doing a million other things first.
....imagine the same upgrade anxiety, but on an enterprise-class NAS array. You know it shouldn't take that long.
And then it completes....and you give it a side-eye.... "Ok buddy, how'd you drop the ball? What went wrong?"
Yep. it removed something I was using. which means my dev environment is probably entirely borked right now.
:sigh:
ModuleNotFoundError: No module named 'pip'
I'm sorry, for what it's worth.
I found this on stack overflow: sudo apt-get install python3-pip
https://stackoverflow.com/questions/18363022/importerror-no-module-named-pip
OS: Mac OS X 10.7.5
Python Ver: 2.7.5
I have installed setuptools 1.0 with ez_setup.py from https://pypi.python.org/pypi/setuptools
Then I download pip.1.4.1 pkg from https://pypi.python.org/pypi...
Also Discord isn't sending messages very quickly.
Aaaaand it didn't just bork the env I was in. It's borked my entire machine.
I'm on mac.
And i think it just doubled my message.
And it's sending duplicate messages. Lovely.
FWIW, stolen from arduino nrf core for clue:
D0 is P0.04 (GPIO D0 / AIN2 / UART RX)
D1 is P0.05 (GPIO D1 / AIN3 / UART TX)
D2 is P0.03 (GPIO D2 / AIN4)
I haven't had Time Machine hooked up in a week. So I can't even restore.
A sense of dread is slowly setting in.
ok it looks like maybe pip still exists outside the venv.
I am now both dreading and confused.
It's like it upgraded things inside the venv maybe?.... I thought brew had nothing to do with envs though
venv [temporarily] changes environment variables, so that could have affected brew?
if its inside the venv, any "damage" should be confined there.
does brew have things like apt/pip's list or show? that's a good way to see how/where things are installed...
yeah brew list is a thing.
Do I have to modify the MakeFiles in the samd51 build chains? /circuitpython/ports/atmel-samd/asf4/samd51/gcc/Makefile
@raven canopy New venv is working. so I guess delete the other one and hope everything was contained.
is there a technical reason why CircuitPython_Register library never implemented SPI? I find the library super useful for I2C but don't know if @slender iron saw something that scared him away from finishing off the SPI side of things
smashing the old venv should be fine. but check that things are happy outside of the venvs...
@lime trellis It's on the list, we simply haven't gotten to it.
Limor plans to do it eventually.
I'm unaware of a technical reason, but that doesn't mean there isn't one.
@lime trellis Sounds great.
another question @idle owl. I have a handful of working-for-my-needs-but-likely-buggy circuitpython libraries on my github. Is there somewhere else I should list them so people can use them? I wouldn't say they're ready for primetime and I don't have the bandwidth to polish them right now
You're welcome to submit them to the community bundle, but they'll have to be cookiecuttered and pass CI and so on... Hmm. I'm not sure past that. Ooh. You could file an issue on the CircuitPython repo, add a list of links to it, and then close it. And you can always continue to update it even if it's closed.
Then people searching CircuitPython issues for whether a driver exists or if someone is making it, will find your list.
that's a good idea. maybe there should be a more general list of half-baked drivers that people could contribute to?
I'm thinking the same thing. But I'm not sure where it would go. Maybe a .md file on the community bundle.
Have to come up with a non-confusing name for the file/list though.
that'd work... then we could PR to to the .md. would that show up on the googles, though?
Eventually, I assume.
I've been following the adafruit nomenclature for my driver repo names. Are you thinking that might make them look too official?
I don't know of a way to force it, but I imagine if people search for it enough they'll find it.
As long as it doesn't say Adafruit_ on the beginning, you're welcome to call them CircuitPython_Foo.
cool cool. sounds good. I'll keep an eye out for that list on the community bundle
"works in progress" maybe?
yeah that's pretty clear
@lime trellis FWIW: I usually notice repos which are unpolished by a note at the top of their README file (sometimes they even have useful checkboxes on there for what's left for someone to pick up, I've contributed to one of those)
yeah good call- I do make sure to have something like this at the top:
I like the emoji
example that I was thinking about: https://github.com/tzapu/WiFiManager#wishlist
@lime trellis totally unrelated and more related to radio, but have you done any circuitpython work with the SX1262/SX1262?
@lime trellis PR away! https://github.com/adafruit/CircuitPython_Community_Bundle/blob/master/works_in_progress.md Also please tweak the wording if you have something better. I tossed that off rather quickly.
@prime flower LITERALLY what got me off on this library organization tangent. I have one sitting in my hand and I'm looking at the datasheet realizing it has the same command structure that I built for the SX1280
AH, sweet. Yeah, it uses a different iface from the SX127x
yeah unfortunately :/
ttn has a decent amount of discussions (https://www.thethingsnetwork.org/forum/t/sx1262-applications/28685/3) about it. I'm into the < footprint and < power draw
know of a CP driver? haha
I could probably look at semtech's reference code, but it's below low priority rn for me
What's higher priority would be doing an abstracted loramanager iface for circuitpython
yeah I met a guy with intimate knowledge of semtech die that told me its crazy they even sell the 127x given the performance of the 126x
loramanager(rfm9x) / loramanager(sx1280) then loramanager.send
that would be very handy
ping me when you get the sx1280 part and I'll see if I can help
I'll order one up from a tindie seller once CNY is over, havent seen a module yet but I haven't searched hard.
I gotchu! hang on lemme find the repo
I shoehorned it into the hoperf module footprint: https://github.com/maholli/sx1280-breakout
let me know if you want a bare board and I can see if I have any lying around. There's commercial modules as well, but with different footprints grrr
@lime trellis tag me on the PR please, so it doesn't get lost.
You're welcome
@raven canopy do community bundle PRs show up on my lib PRs list?
Do the Adafruit bundle PRs show up, for that matter?
oh sweet thanks maholli, bookmarked
community...hmm. let me look real quick. (i don't think so)
@raven canopy If not, can we make that happen?
can do all things... well, maybe most. ๐
Well, yeah...
community should be included. let me check list_repos() results real quick...
oh yeah. its not included.... search:Adafruit_CircuitPython isn't going to grab CircuitPython_Community. ๐คฆ
throw up an issue?
PR sent. Thanks again @idle owl . I'll be eagerly watching what people contribute
heh, of course I reviewed it. :-)
@slender iron hi - I am looking at increasing the number of connections, and did a bunch of experiments about the cost of increasing each parameter for sd_ble_cfg_set(). One thing you did is increase hvn_tx_queue_size from 1 to 10, which has a substantial effect on the amount of RAM per conenction (like 5kB). In looking for guidance about this, I see in DevZone that they don't recommend increasing this explicitly but instead increasing the GAP event_length. Do you remember anything about this?
yes, I thought i would not say that explicitly :)
i did write down what increasing each param costs in terms of bytes, and it will bein the comments
@lime trellis I don't know of any technical reason why you couldn't do spi registers
@tulip sleet I wanted to have multiple notifications buffered
if you find it could be tuned better then thats ok
๐
I also increased buffer sizes
you mean there or elsewhere?
I think in the init stuff
i think the implication is that changing the event length will change the hvn_tx_queue_size, but it's not clear
to the sd
yah, I"m in that routine.
did you see it go too slow
I was email back and forth with maureen from nxp/zephyr yesterday picking her brain about it
would love to get off the SD
one thing I'd like to add for the sensor stuff is an optional limit to the number of advertisements
you bet. They talk about increasing some #define in the SDK headers, but don't really explain what's going on. Anyway, each new connection is about 9kbytes, and adding extra roles costs about 600 to 1k bytes each depending on the role. if i reduce the hvn queue from 10 to 1, then each connection costs about 4k bytes instead of 9k bytes. So that's why I was asking.
i'll keep studying DevZone, etc.
I may have run into it when I was playing with stuff
maybe 2 would be best because it'd buy us time to queue a subsequent notification?
anyway, even with the currrent settings, we can fit 2 more connections in like 56-64kb (instead of the current 32kb for the sd)
how many are you going for?
i don't understand why the event length would affect the queue lenght, but i'll see how changing one and not the other affects the ram allocated
so we need to reserve 1 for workflow. Then we have stuff like HRM + cadence + speed (could be two devices) + talking to music service. That's 5 (4 in use for that, 1 reserved for workflow)
that's a lot, we could peel back one (use a combined cadence+speed sensor)
the music service is likely the same as workflow though
if there are a bunch of peripheral connections we'll be at the mercy of the centrals' scheduling
same connection? I didn't know whether they would be paralllel. and we wnat to bring the music service connection up and down during development, but leave the workflow connection up
I'd assume they are both on a phone
are we central or peripheral for music?
peripheral because the phone initiates
k, got it
just like current time service
so do you think 32kB more is too much? stack is currently 40kB, I think, which is a LOT
could prune that
i don't have a good intuition about this; ideally we set # of connections in boot.py
like you suggesetd, but I'm not gonna do that for 5.0.0
how much do we have total?
ya, and the imx rt 1011 is 128 with half as TCM
that is going to be tight for larger programs
yup
high speed but not much ram, not the ideal combo
yes, so 256kb -64kb for SD = 192kB - 40kB stack = 152kB heap + static RAM
maybe not so bad, and might be 60kB for SD, and stack could be 32kB or 24kB
ya, I think that's ok
i'll do a few more experiments
that was arbitrary, I assume
i'll see if they have a recommendation
also I don't know if central_role_count (currently 1) needs to be increased if you talk to multiple periphs or not. but that is only 600 bytes for each increment
ok, tnx for being a sounding board
my guess would be yes
seems like its all just config for static allocations of everything
each periph role increase is 1200-1800 bytes (it's not constant: a little weird); each central role increase is 650-1250. uuid table size is +16 bytes for each uuid (makes sense!) and attribute table size increases by 1k for each multiple of the default.
oh! I have something to run by you
I'm debating whether we should use service + characteristic for each sensor value
like the app does now
or do a top level service with varying characteristics + descriptors
hmmm...
the sig version is characteristics + descriptors
there are fewer objects and classes with fewer services
is it easy to determine if a characteristic is present now? If not i should be
you can do hasattr
could this be a single service with tons of characteristics, is this just for CPB or is it for sensor lab for many kinds of sensors
many types of sensors
right, could be a single service with lots of chars
could be bad if it's all in one library
but likely easier to use
and can use our 16 bit service uuid
yes, and maybe use some of the standard 16-bit uuids for various sensors
but suppose you have two, say accelerometers and want to read from both. how do you distinguish them and know their different characteristics?
i just mean if they match nicely
its not terrible now that I look at it
it depends a bit on whether we can to configure out of band or not
I'm not sure if using the standard buys us interoperability at all
i don't care about that, really, I just care about smaller uuids
I don't think that actually matters
probably not
still thinking how we handle duplicate characteristics; i'm not sure there are many real-life examples.
if you had a product with two accelerometers, you would have diff characteristic for each
bbq thermometers ๐
with multiple probes? I should look on the thermoworks webiste
is what I was thinking of
bbq therms are a win-win test. hardware works? you get yummy food as a reward! ๐
there are all sorts of DIY'd versions out there.
small victories are the best. i'm back to a working dev state on the RPi!
rosie-admin@ubuntu:~$ curl http://127.0.0.1:4812/status -w "%{http_code}\n"
[["Host","127.0.0.1:4812"],["User-Agent","curl/7.65.3"],["Accept","*/*"]]
401
rosie-admin@ubuntu:~$ curl -H "Authorization: Signature foobar" http://127.0.0.1:4812/status -w "%{http_code}\n"
{"busy":false,"job_count":0,"node_name":"ubuntu"}
200
rosie-admin@ubuntu:~$ curl -H "Authorization: Signature foobar" http://127.0.0.1:4812/run-test -X POST -w "%{http_code}\n"
{"message":"Endpoint requires valid json payload."}
406
Yes, and it would be nice to add CXX definitions and C++ rules to the py/*.mk files.
I would suggest that you find an existing mixed C and C++ program to emulate. There are many details: this will not be that easy without previous experinece. I'm wondering about the C++ you're trying to compile. Could you supply a pointer to it?
@slender iron btw these are various DevZone articles on the queue size:
https://devzone.nordicsemi.com/f/nordic-q-a/52372/correct-way-to-config-hvn_tx_queue_size
https://devzone.nordicsemi.com/f/nordic-q-a/35447/increase-hvn_tx_queue_size-to-maximize-throughput https://devzone.nordicsemi.com/f/nordic-q-a/34022/optimizing-throughput-with-multiple-central-links-and-1-peripheral-link
i don't necessarily expect you to read all those ๐
I turned on the connect event extension thing too
@fading solstice hey mrc - we're doing an audit of the adafruit github members and you're still on there. it seems you're takin' a break from reviews and PRs, so we're going to turn you into a 'external collaborator' for now, but the moment you want to come back as a member let us know and we can re-add you ๐
gamepad is needed for newer versions of the CP library, but had been omitted from the CPX displayio and crickit builds for space reasons. Added it back, and remove rtc from the crickit build to make space and to match that it's missing from the displayio build.
I did a simple smoke test on crickit CPX: imported the CP library and changed a pixel, and imported crickit and moved a servo.
@tulip sleet I'm struggling to build CP with custom boards since you implemented common.template.ld. I keep getting something like this:
collect2: error: ld returned 1 exit status
Similar to terminalio but without using it.
actually, it's more commonly this:
/usr/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/bin/ld:build-pycubedminiv01/common.ld:22: syntax error
collect2: error: ld returned 1 exit status
@lime trellis we are using the gcc 9 release; not sure if that would make a difference here. Make sure you are starting from a clean build. Could you upload the build-.../common.ld file here? That's the expanded template file
yes, upload that common.ld file and I'll take a look
the board files changed a lot for this PR, so try to make your board files match a similar board
mostly they got simpler
yep I have done matching to similar boards. I have this sneaky suspicion that I'm not using a valid CHIP_VARIANT. uploading common.ld now
@lime trellis The only thing different on that line from other similar files is the 0x00080000/2
that should be ok
is your code in a repo? I could try building it with the latest toolchain
not a public one. hmm let me zip and send it to you?
ok
@tulip sleet
I appreciate the help. meanwhile I'm going to compare the old .ld file I was using to the common.ld
thank you. I'm thrashing with it as well. Will keep you updated
@lime trellis it seems to dislike the /2 , which is defined in ports/atmel-samd/mpconfigport.h. I changed it to >> 1 and it worked (but it didn't fit). That was a guess for boards without external flash. You can define your own value for CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE in your mpconfigboard.h.
it's supposed to handle all C operators, not sure what the issue is
oh wow. I was chasing down an entirely different path ๐คฃ thanks for solving that!
@lime trellis, no, wait that didn't help; hold on
something is up here... I are you using some sort of regex for the common.template? I added a #define CALIBRATE_CRYSTALLESS and things started overflowing
it doesn't like / or << , but I changed it to (128*1024) and it worked
you mean it's reporting not enough space?
paste the error
it's reported <0 for everything
?
This was fixed on SAMD (I thought) in shared code. It relies on a flush that may make it fail on nRF.
common.template.ld uses Python Template to fill things in
Note, it's the Mac that crashes not the nRF52840.
what is your new mpconfigboard.h?
lots and lots of this:
./mpconfigport.h:184:6: note: in expansion of macro 'CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR'
(CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR - CIRCUITPY_FIRMWARE_START_ADDR)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./mpconfigport.h:211:5: note: in expansion of macro 'CIRCUITPY_FIRMWARE_SIZE'
#if CIRCUITPY_FIRMWARE_SIZE < 0
is the error
what size did you give for CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE?
those are sanity checks when one of the values is too big
leaving no room for the firmware
I took out that define to model other boards. this is the mpconfigboard.h:
#define MICROPY_HW_BOARD_NAME "PyCubedMini"
#define MICROPY_HW_MCU_NAME "samd51G19"
#define CIRCUITPY_MCU_FAMILY samd51
#define MICROPY_HW_NEOPIXEL (&pin_PB22)
#define MICROPY_PORT_A (PORT_PA24 | PORT_PA25)
#define MICROPY_PORT_B (0)
#define MICROPY_PORT_C (0)
#define MICROPY_PORT_D (0)
#define CALIBRATE_CRYSTALLESS 1
#define BOARD_HAS_CRYSTAL 0
// #define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - 0x0100000)
#define DEFAULT_I2C_BUS_SCL (&pin_PA16)
#define DEFAULT_I2C_BUS_SDA (&pin_PA17)
#define DEFAULT_SPI_BUS_SCK (&pin_PA09)
#define DEFAULT_SPI_BUS_MOSI (&pin_PA08)
#define DEFAULT_SPI_BUS_MISO (&pin_PA10)
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1
NVMCTRL_ROW_SIZE is not defined for SAMD51's. This is kind of a pathological case. I need to fix mpconfigport.h
from discord:
Maybe a multi-line Hello World example that does not use Label would make it clearer how terminal style text could work.
do this:
#define CALIBRATE_CRYSTALLESS (0)
#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (128*1024)
yep I did something similar and it just finished building
whew!!
do we need to define the NVMCTRL_ROW_SIZE based on internal vs external flash?
no, the calibrate crystalless stuff stores a calibration value in a bit of internal flash. on SAMD21, NVMCTRL_ROW_SIZE (minimum size that can be erased) is 256 bytes. On SAMD51, it's 8192 bytes, and it's not called that.
ooo gotcha. ha- what an edge case
I thought there were some other SAMD51 boards that don't have external flash, but there's something different in their builds that is not triggering this
yeah I have no issue building my board with external flash
yeah, kicksat-sprite should have the /2 problem, i don't see why it's different
I have a couple of other custom boards I haven't submitted PRs for that are working fine.
oh, maybe the LENGTH in that .ld line is negative after computation
or something like that
building kicksat-sprite now
The power of microcontrollers.
kicksat-sprite wont have the crystalless edge-case, though,
@lime trellis ok, the /2 problem IS due to gcc7 vs gcc9 toolchain. I mistakenly was using the gcc7 toolchain and hit the same bug as you. Switching to gcc9, and it works!
https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads ; unpack and put the .../bin directory on your PATH
ah-ha! will do. Thanks for the help Dan
๐
too bad that there's no native usb, could've been a nice CPY target ๐ https://www.nxp.com/products/wireless/bluetooth-low-energy/qn9090-30t-bluetooth-low-energy-mcu-with-armcortex-m4-cpu-energy-efficiency-analog-and-digital-peripherals-and-nfc-tag-option:QN9090-30?&tid=vanQN9090-30
good (belated) morning
@slender iron I think we all imagined that there would always be a pretty long interval between needing to load audio DMA buffers, but there's an exception! A wave file's last buffer can be arbitrarily short, so if you loop it the time between loading the DMA of the last buffer to the first looped buffer can be small. In fact, the looping audio sample for the light saber project is a worst case, with just 1 sample in its last buffer. The glitches MAY be more severe or at least more frequent in 5.0 than 4.1, probably due to background tasks only happening once per ms. Any quick thoughts before I go in my own direction to work on it? (I don't know what that direction is yet)
@onyx hinge ah! interesting! skip the last bit?
@slender iron i.e., if number of samples in last block is less than X, just drop it on the floor? That seems implementable. Do you think anybody would notice that the last 1.5ms of their sound isn't played? It could increase popping if it cuts off the last "taper to 0". I could pass down a new flag that says that the sample will be played in looping mode, and only do it when both these things are the case (short block and looping)
@onyx hinge an alternate fix for this is to tell people to make their looping samples be a multiple of block size. That would solve the problem for this project. The original sample could also be divided up into the largest equal-sized blocks that were possible (i.e. allow the DMA buffers be variable size), but that's a lot of code to solve a problem that might not be that important to solve
Is "make looping sounds a multiple of 512 samples" (** for simplicity, it could be 128 or 256 depending on details) something makers of audio will get? If so, I'm all for it + some documentation ๐
"... or use audiomixer"
Registers in DMAC CHANNEL[0]:
CHCTRLA: 0x00203B00 Channel n Control A
CHCTRLB: 0x00 Channel n Control B
CHPRILVL: 0x00 Channel n Priority Level
CHEVCTRL: 0x80 Channel n Event Control
CHINTENCLR: 0x00 Channel n Interrupt Enable Clear
CHINTENSET: 0x00 Channel n Interrupt Enable Set
CHINTFLAG: 0x02 Channel n Interrupt Flag Status and Clear
CHSTATUS: 0x00 Channel n Status
``` finally set this up, it's pretty neat. thanks @tulip sleet
can I write to a register this way, or do I have to do it via casting memory addresses?
i think I checked this and you can only look at registers
learning to make good looping samples is more work than most people realize, to avoid clicks etc. Once they have to learn that make them a certain length is just another editing step, so I don't think that's terrible. If we document "you can loop anything but if you want it to be smooth make it a multiple of this size", I think that's ok
in this case I think the wave files came directly from archive.org from a liberally licensed sample collection. it was designed to loop, but to be a particular number of samples wrong
(unless someone DID try to design it to be an exact number of samples, but was "off by 1" I suppose...!?)
I'm not sure I understand what can/can't be used here? Like how far down the rabbit hole are we going?
Wouldn't a multi-line example without using Label essentially just be a recreation of the code in Label._update_text() ?
@caternuson This stems from discussion over the memory usage of Label. There is a way to display text using a built-in font that uses much less RAM memory than Label does, by having a single TileGrid rather than a TileGrid for each character.
๐ฎ and then using the laser cutter at the hackspace. probably dropping back in to hack on WaveFile some more this afternoon.
@slender iron re
many types of sensors
right, could be a single service with lots of chars
could be bad if it's all in one library
but likely easier to use
and can use our 16 bit service uuid
You could monkey-patch the base service when importing more characteristics
This PR adds a build option to compile the Feather F405 for use with a UF2 bootloader, such as https://github.com/adafruit/uf2-stm32f. This setting can be enabled for other STM32 boards in the future, though it's not recommended to use a UF2 bootloader on any board without external flash. This PR also makes some minor style changes to the Makefile and removes some unused variables.
@tulip sleet ya, I'm not sure still. will finish up the advertising method first
@slender iron I could make a release today. I'm still fine-tuning the increased number of connections, but that's the last thing I know of
but maybe we should not release on Friday ๐ ?
I'm fine waiting
I don't know of anything super urgent
your fixes are nice and solid
my subclass fix may find some edge cases though
the only strong reason is if we want to release the HRM guide today
prob fine to wait; we can test the increased connections build against multiple sensors before we release it
๐
Do we have a UF2 bootloader for all supported boards? If we do, we should ship .bin or .hex files that include it and CircuitPython. The UF2s can then have CircuitPython-only.
Why internal FS? Doesn't the feather have an external SPI flash?
/* Define the top end of the stack. The stack is full descending so begins just
@slender iron @tulip sleet Fresh 5.x CP installs now have an empty lib folder and a "hello world" code.py? Or am I misremembering that.
they should
ok
but only if there was no CIRCUITPY beforehand. It won't add those files to an existing filesystem
or if you erase_filesystem()
Ok. Hmph. Kind of complicates explaining install, but I get it.
Thanks
meh. Glossing over that I guess.
Otherwise it's a lot of "if this is the first time, but only if cp wasn't already installed, but if it's already been installed, or if blah blah."
How do you put the UF2 bootloader onto the feather stm32f405?
@solar whale I assume the same way you load circuitpython without it
the bootloader that is used currently is in ROM
(iMX RT works the same way)
It does. This just defines an internal filesystem anyway as a default, the way micropython does. Wastes 48K of flash, but if the user cuts the external flash, it'll allow the board to work. Do you want it cut, or a third option added?
Ok. There is a make flash that calls gdb. I was wondering if a j-link or something was needed.
But It sounds like I can use dfu-util
ya, that would be my expectation
Thanks. I canโt try until next week anyway. On the road..
np ๐
@prime flower @meager fog is there a way to post data to an IO feed with a unique id in case it gets posted twice?
Is there a good image of the Blinka snake I can use for our Boston Circuitpython Meetup?
get a png. and use https://vectormagic.com/
Easily convert JPG, PNG, BMP, GIF bitmap images to SVG, EPS, PDF, AI, DXF vector images with real full-color tracing, online or using the desktop app!
@ionic elk here is the art pack that Phil shared a long time ago... https://www.dropbox.com/sh/l6tp9ym5nf8h5v9/AAB7r58OXyr0VA82eWsFLhJ0a/blinka?dl=0&subfolder_nav_tracking=1
holy crap that's actually really good lol
also, i can confirm that GIMP will open them if you don't have Illustrator available. ๐
Inkscape
btw, that blinka in that artpack has a lot of unnecessary nodes
Here is one that is a bit more optimized (but with a thicker outline, for a PCB)
@slender iron Each data point has a unique identifier. (https://io.adafruit.com/api/docs/#create-data)
whee, I think it's time to learn about touchscreen on circuitpython.
@slender iron But, you can only specify the 'value' metadata, not the 'identifier', I believe that's assigned on the server side...I'll ask justin
Increase number of connections and other parameters for BLE.
Figuring 5 connections: 1 for workflow (not yet in use)
Connecting to 3 sensors + 1 other connection as a possible maxed-out application
- Number of connections increased from 2 to 5.
- Max number of peripheral roles increased from 2 to 4.
- Max number of central roles increased from 1 to 4.
- Increase size of attribute table by factor of 5 from default (was factor of 3).
- Support to 75 128-bit UUIDs (was 32).
- Decreas...
ID is assigned by the server
@prime flower I'm thinking about having multiple listening nodes that could report the same broadcast message. I can do it by having two feeds for it now
it'd also be cool to report discontinuities in a graph
yes please! we have lots of RAM :)
@raven canopy Am I right in saying that all of those logo have been done by Phil? I remember an "Ask an Engineer" where he was talking with Guru from Pimoroni about logo, and I kind of remember Phil was the author of those logo. Is that right?
there is an in-house artist
hehe. i'm not at all qualified for that answer... ๐
So Phil is a fan of logo and did appreciate the one of Guru, but maybe not the author. Thanks.
He may have roughed it out or did some photoshopping on it, etc. The finals are done by the artist.
oh, wait are you talkign about logos or Logo language??
I have a question about old vs new BLE product and CircuitPython product. I am a bit confused. In the past there were BT product with serial interface and AT protocol that were maybe targeted to Arduino kind of board. I am talking about Bluefruit kind of product. And now we have those nRF52840 microprocessor at the center of some CP board.
Talking about Logos/graphics like the blinka.
logo: ok, I'm not misunderstanding
https://learn.adafruit.com/adafruit-pyportal/pyportal-circuitpython-setup huh is there a reason the guide calls for adafruit_cursorcontrol? On my pynt, importing it just errors, "No module named 'gamepadshift'".
So in the past there was Adafruit BLE friend, the UART version, the SPI version. And that was like Airlift to me.
there are some products that are basically BLE coprocessors you can talk to over serial or SPI. Then we had an nRF52832 Feather that has an Arduino library for doing BLE. But that chip does not have enough RAM or flash to support CPy adequately, and it doesn't have native USB
And there are all those serial encapsulation that were developped to control board, like to transmit button, color, ... (from your phone or from another board).
And that was "replicated" in CircuitPython.
right, we developed an ad hoc protocol over Nordic UART Service that's implemented in the Bluefruit app
So today, the recommendation would be to use nRF52840 if you want to do CircuitPython.
@slender iron for feature suggestions, post up over here as you think of them https://forums.adafruit.com/viewtopic.php?f=56&t=139746 and I'll file them on the IO feature tracker
I mean there is no point in going for a coprocessor.
@jeperl I think that may be a copy pasta bug
right, the '840 is hefty enough not to be used just as a co-processor. There are advantages to a co-processor, in terms of task scheduling and simplicity, but we were able to use the nRF libraries which hide the time-slicing going on underneath
@tulip sleet I'll enter a feedback
Thanks @tulip sleet I am not going to talk about Adafruit BLE Friend, and focus my little time to what can be done with the '840 as a core.
It is a bit assymetrical between the Wifi situation that now require a co-processor (while there was ESP32) and BLE that can be done with the '840.
tnx - the emphasis is on nRF52840 going forward
ESP32 was not a good target for CPy because it doesn't have native USB. It also has a difficult architecture, and it has taken a while for the doc and software to mature.
Next-gen ESP32 has native usb
I suggested in the CircuitPython2020 the use if Nina-FW to do BLE. It is the same fw used for wifi, but maybe that does not make sense from a developpement point of view.
i am not sure if it can be simultaneous wifi and BLE
No, it was said to me "not simultaniously".
it is also a cost q: SAMD51+ESP32 vs just the nRF52840
and board real-estate consideration
Yeah, sure.
I think the combo that I like is Feather '840 + Airlift. That could be the central node to connect BLE device to the internet...
nRF has a next-gen chip they just introduced: https://www.nordicsemi.com/Products/Low-power-short-range-wireless/nRF5340, but things are early for that. It is not super-fast like the new NXP chips
it uses Zephyr instead of the SoftDevice libraries the earlier chips use
Thank you all. I am going to continue focussing on what I know and structuring my talk.
@half sedge There is a standard serial protocol for BLE coprocessors called HCI. Several different mfrs implement it. Same general idea as Nina
I wonder if they're going to support LoRa next, the LoRa stack for Zephyr is good
but it's a 2.4GHz radio, do people do lora at 2.4G?
Ultra-long comms yeah, semtech has a chip for it https://www.semtech.com/products/wireless-rf/24-ghz-transceivers/sx1280
The SX1280 transceiver provides ultra-long range communication in the 2.4 GHz band with the linearity to withstand heavy interference.
@timber mango Hope FOSDEM is great! Thank you for speaking about our stuff there.
I just looked at the schedule and didn't realize it was this weekend
It's only 20 minutes. ๐ without any in between gap to connect the laptop and everything. So I most likely spend too much time on this. I prefer to manadge expectation. We will see later how good or bad it was. And I have 50 Blinka Stickers to distribute to anybody comming to me with any interest.
@stuck elbow I have a quick question for you if you're around.
@idle owl I am now
Hey. If there were to be a Circuit Playground like library for CLUE, would you want the were_pressed feature in it?
I suppose it would make sense to mimic the micro:bit libraries
Is that feature in the micro:bit libs?
class GridLabel(displayio.TileGrid):
def __init__(self, font, *, text=None, max_size=None, color=0xffffff,
width=None, height=None, **kwargs):
if not text and not max_size:
raise RuntimeError("Please provide a max size, or initial text")
cwidth, cheight = self.calc_size(text)
width = width or cwidth
height = height or cheight
self._width = width
self._height = height
self....
@idle owl I wonder if it would make sense to organize the library the same way too
@stuck elbow Same way as which, the micro:bit lib?
@tulip sleet do you know if this line in a debugger indicates some failure of TinyUSB? tud_cdc_n_connected (itf=itf@entry=0 '\000') at ../../lib/tinyusb/src/device/usbd.h:62
@ionic elk I don't know if entry=0 is a legitimate value or not, sorry.
There's a number of differences. And the main point of this lib is to expose all the sensor capabilities and such.
This PR adds support to the STM32F4 Discovery board (a bit confusingly named, possibly because it was the first Discovery?). This board runs an STM32F407VG board with 1MB of flash and 192K of SRAM, and has a nearly identical pin layout to the STM32F411 Discovery board (this board adds the PB11 pin to replace an NC pin). Requires #2568 for some linker stuff.
Todos for this PR:
- [ ] Need valid VID/PID (@tannewt/@ladyada)
- [ ] USB not currently working
I'm not sure what the USB issu...
@gentle bronze do you need to add something to TinyUSB for it to support the STM32F407? It's virtually identical to the F405. nvm you've got an example for it and everything. hmm.
@gilded cradle are you around? you build working CPy for CLUE, but master is not workign for me (display init problems)
Okay - how about a Friday afternoon Hug Report for the whole CP development gang?
I'm currently writing some Arduino code to control a SparkFun Tsunami Super WAV Trigger over and I'm surprised by how arduous I find the process of compiling and loading for every minor tweak!!
Where's my REPL?!!
Thanks for making life easy with CircuitPython!
@indigo wedge hihi i brought up a 1011 feather -USB works (ROM bootloader thingy) and JLink finds it
whats my next step ๐
CircuitPython running on clue with display support; PR soon
@meager fog Darn, my boards are coming Monday ๐ Depends how much time you have, if you wanna code that kinda works and you wanna tinker then I'd advice to try tinyuf2 https://github.com/arturo182/tinyuf2 otherwise the uf2 branch of tinyusb should just work but it's not pretty https://github.com/arturo182/tinyusb/tree/uf2 (build for feather_mimxrt1011). As for CPY, I haven't tested the Feathers with https://github.com/adafruit/circuitpython/pull/2532 merged so unsure if that works, you can always check out the tree just before that commit and that code should work, you need to make a new board definition for the board cause it uses different pins than my Feather. Or just wait for Monday and I'll do all when I get my boards ๐
@pastel panther is it safe to say this issue would apply to the LIS3MDL library as well? https://github.com/adafruit/Adafruit_CircuitPython_LIS2MDL/issues/2
This PR in an older lib had the good idea to add a compass example: https://github.com/adafruit/Adafruit_Python_LSM303/pull/4/files We should add similar code to this lib
@lone axle there would be one example and it would work with any magnetometer/accel combo
the exmaple would not live in this library - it would live in a guide
I see, Thank you.
UICR fix
At least some CLUE's have NRF_UICR->REGOUT0 set to all 1's, which when the chip is in "high voltage mode" will make the outputs be 1.8V instead of 3.3V. However the nRF module on the CLUE is not in high voltage mode, so this register is ignored.
Nevertheless, we had code to fix this to rewrite REGOUT0, but it wasn't working because the update to nrfx v2.0.0 forced us to use a new nvm writing API, which doesn't let you write to UICR because it out of bounds of regular fla...
@idle owl @trim elm @gray mantle et al here should be a working build for CLUE, same as PR above:
@tulip sleet It works! Thank you!
yay!
early to bed / early to rise / was meant for those old fashioned types / who don't use / CircuitPython
[h/t http://burma-shave.org/jingles/1943/early_to_bed]
maybe we can call it STM32F407 Discovery although its official name is only STM32F4 Discovery . TinyUSB does support f407, in fact this is one of the first board I used to tested with STM32 port, here is its BSP
https://github.com/hathach/tinyusb/tree/master/hw/bsp/stm32f407disco
However, F407 USB FS only has 4 pairs of endpoints, including control endpoints. Which means we can only have CDC ( 2 IN + 1 OUT) and MSC ( 1 IN + 1 OUT) only. Could you skip the hid, midi to see if that ...
Arduino can only afford up to 2,3 connections. I may need to improve the linker/heap memory to support more as well :)
I'm the newbie that made the request in Discord. I was looking for a complete working example/demo that would run as code.py and be included in the /examples folder of the libs. I guess this class is the first step towards that.
I am working on some example code for the TFT Gizmo. https://github.com/FoamyGuy/Gizmo_Thermometer_Example. If anyone is interested and has a moment to take a quick look and/or try it out, any feedback is welcome.
Updated version of gridlabel (there was at least one bug, hopefully fixed): https://gist.github.com/e7a159b28048dc8637f69db17caba5ea
A silly little demo that I ran on my pygamer: https://gist.github.com/4e17ebc6b3a6e762856d2338fdfb99d9
@gmeader Being new to something is an exciting time, enjoy it!
here's the DRAFT of the upcoming โPython for microcontrollersโ newsletter that ships out tuesday at 11am ET via adafruitdaily.com - please send any links, news, events and more via an issue/PR, or @ us or really any thing ๐ we'll get it added! https://github.com/adafruit/circuitpython-weekly-newsletter/blob/gh-pages/_drafts/2020-02-04-draft.md
Is there any way to wirelessly code onto a feather? Or does it have to all be done by connecting it to a computer
I suspect there are ways, even if one of them is just hooking a Bluetooth UART to the serial pins.
I'm not aware of anything standard in circuitpython for doing it. micropython can do it as part of its "web repl", I hear; but circuitpython doesn't presently have a web repl.
@onyx hinge @slender iron I saw something about dropping samples in looping audio. That can be awful to one of my projects. I want to create some pure tones, so if my buffer has to be a multiple of both the wavelength and 512 memory might seem very small. I did not catch the context, so maybe it doesn't really apply to me or I can avoid the problem.
Oh, that use case does not read from a file.
Images automagically compressed by Calibre's image-actions โจ
Compression reduced images by 44%, saving 3.20 MB
| Filename | Before | After | Improvement |
|---|---|---|---|
assets/images/boards/large/clue_nrf52840_express.jpg |
323.71 KB | 96.22 KB | -70.3% |
assets/images/boards/large/feather_bluefruit_sense.jpg |
260.22 KB | 137.83 KB | -47.0% |
| `assets/images/boards/large/imxrt1010_evk.jp... |
trying to port the Blinka implementation for the MCP2221A, i think i've spotted a substantial bug but don't really know how to exercise it from python: https://github.com/adafruit/Adafruit_Blinka/blob/master/src/adafruit_blinka/microcontroller/mcp2221/mcp2221.py
theres no way _i2c_write can send more than 60 bytes, and also it doesnt support repeated-start
(even though it is attempting to be able to send more than 60 bytes)
The 32-bit signed integer value used when converting seconds-since-epoch to structured time using time.localtime() causes a date limit of 2038-01-19 03:14:07 before overflowing.
Adafruit CircuitPython 5.0.0-beta.4 on 2020-01-22; Adafruit Pybadge with samd51j19
>>>
>>> # test an integer value of 2^^31 (maximum 32-bit signed integer +1)
>>> mk = int(math.pow(2, 31))
>>> time.localtime(mk)
Traceback (most recent call last):
File "", line 1, in
OverflowError: overflow con...
@short phoenix @onyx hinge @slender iron developed initial strawman support for editing over BLE in the current version of CircuitPython, and started a very simple app. We have plans to flesh that out in the future.
The demo part of my presentation went wrong. I could not connect my laptop to the projection system. And I had to start without my slide.
But I had a lot of positive feedback.
@half sedge at fosdem?
@stuck elbow yes IoT track. There was someone from Samsung doing Augmented reality with MicroPython...
But the demo failed due to WiFi issue...
that's why I'm a huge fan of cables :P
@wanton fiber curious about MCP2221A bug you mention in Blinka. please ping me when you can. thanks.
Folks from CircuitPython's day, Delhi used CPX board to make a USB Rubber Ducky type keystroke injector which can parse basic ducky scripts : https://www.hackster.io/p5g41tmlx/rubber-python-f0d023
@half sedge Glad to hear you received a lot of positive feedback! It's good that you persevered through the technical difficulties.
@tulip sleet keep me updated then on that app!
Not being as good with RGB hex as I am with tuples, I'm wondering why display_text and ostensibly displayio accept only hex. And whether there's a reason for it, or an easy way to make it take tuples as well.
It apparently also takes byte arrays. This helps me even less. ๐
what do you consider a tuple? its a trivial exercise to break apart an RGB value (expressed in hex if you choose) to a format of your choice. it would be my pleasure to assist, seeing as im using a board with your name on it at this very instant
or is this a rhetorical complaint
๐
@idle owl It would be nice if more knowledge about neopixel would carry over to displayio Palette. but I think that you can use bytes() with a tuple to get something that you and Palette will both understand
Oi, giant emoji
b'\xff\xff\xff'
It was not a rhetorical complaint. ๐
@wanton fiber Nice about the board.
@onyx hinge Odd but interesting.
I'm trying to add some things to a library and I do not expect a majority of those who will use it to be familiar with hex colors.
But at the moment, that or byte arrays is the only option.
The change would have to go into Palette though as far as I can tell.
So into core CircuitPython.
as display_text uses palette to set the color of the text.
is it at least 24-bit RGB encoding? 1-byte R, G, B components?
(as opposed to 16-bit 565)
The value argument represents a color, and can be from 0x000000 to 0xFFFFFF (to represent an RGB value). Value can be an int, bytes (3 bytes (RGB) or 4 bytes (RGB + pad byte)), or bytearray.```
I'm not sure of the answer to that question.
yeah, 24-bit encoding, is the simpler (more accessible) of the two at least
each component R, G, and B is represented with an entire byte (0x00 - 0xFF) packed together RRGGBB
@idle owl yes I also think a change in core would be necessary to accept a tuple directly.
Which is way outside my wheelhouse.
and also introduces a dependency for your guide
The other dependency is already merged. ๐
would you feel introducing but not explaining a function to convert (r,g,b) to the hex value?
And it wouldn't be the first time I've had code that relied on other things.
Bleh. I guess I'd rather tell people to go google hex colors.
The point is to keep this code super simple.
there are some very nice lists of hex colors
It's funny how different people run into the same thing at nearly the same time, I tried to use the "color wheel" effect on a displayio palette just yesterday
thats a fun function to learn how it works ๐
very clever
and equally maddening when it doesnt work
This makes Palette more similar to pixelbuf, and lets e.g., the unmodified "wheel" function be used to set pixel values.
Testing performed: I adapted an existing demo (pygamer) of mine to directly use wheel() tuples instead of converting them to 24-bit integers, and it worked.
@idle owl ^^ we can do it in the core with just 2 lines and a little punctuation
so this works for me now label.palette[1] = wheel(w)
afk, it's nice enough out for a walk (60F according to the computer!)
@idle owl @onyx hinge About color and palette representation, there is the format expected by displayio and all the format supported by FancyLED.
I have not investigated, but it would be great to make be compatible.
I wanted to build a palette gradiant for displayio using FancyLED. Is that what you are working on?
Thank you for adding this! @jepler If you'd like another test, please provide me with a test build for CLUE and I will do so.
There was one presentation at Fosdem'20 that might be interesting for adafruit: https://fosdem.org/2020/schedule/event/iottinygo/
The demo were impressive and used a lot of Adafruit board, but with running Go code compiled with tinygo.
I remember: (1) a PyBadge (2) a PyPortal (3) a ItsyBitsyM4 into a LED cube ... That last one was impressive because it was driving a lot of LED without a FPGA.
@idle owl I'll fix the PR so it builds, and then there will be one attached to the "checks" in about 20-25 minutes
@onyx hinge Oh right! I forgot about the artifacts. Excellent.
Thank you for adding this! @jepler If you'd like another test, please provide me with a test build for CLUE and I will do so.
I think this format is different than what FancyLED uses, which seems to be a custom type with red, green, and blue float values. This works with tuples of integers that are in the range 0..255.
a CRGB.pack() value should be what DisplayIO needs though
@idle owl https://github.com/adafruit/circuitpython/actions/runs/34002989 is slow to show the build artifacts so I'll attach what I built locally.
@onyx hinge Works!
Tested successfully on CLUE with display_text. Thanks for adding this!
@idle owl yay, thanks for checking. seems to make pewpewm4 not fit, though, so it'll need further finesseing
finessing ?
Apparently. :/
Tested successfully on CLUE with display_text. Thanks for adding this!
apparently "finessing". thanks english ๐
I'd look at lines 12-13 of secrets.py.
Line 8 is about the Pyportal and I have copied and recopied the files.
I copied line 13 right out of the guide with the name issued by referenced OpenWeatherMap site. I even backed up to the original New York, US.
How do I "look" at an MPY file?
Hopefully it exists somewhere as a .py file and you can look at that. Github for CircuitPython libraries, for example.
How should the SD card be formatted? In the Weather Guide
Normally secrets py will be a file you edit yourself. It needs to be filled with info about your WiFi and adafruit io accounts (and maybe other things depending on the project)
Thank you @onyx hinge . I think I have a handle on the secrets file. It worked earlier to log me through my network and all (even initially had the weather for New York, US albeit in a small window on the Titano). It was when I downloaded the new Code.py (295 lines) and ran it that things went south. I'm sure it's on my end, no one else seems to be having issues.
@slender iron I wrote draft release notes for the next beta so we could release it quickly when we decide we're ready.
Hi Guys, sorry to reopen this topic. Is there a circuitpython module that includes this low power feature? I will either be using the Adafruit STM32F405 EXPRESS or the Adafruit M0 Express board and would like to be able to run off the battery supply if possible. Apologies if @crowecawcaw's code is the answer, I am relatively new to circuitpython, and not experienced enough to implement it if it is.
@NAPtime2 Not yet, but it's high on our agenda for doing after the 5.0.0 release, which is now in beta.
I investigated "shoco" and "smaz" as possible alternatives to huffman encoding of translated strings. Both would add complication to the build process, and (without actually integrating them) it doesn't look as though they would have a memory size savings. "smaz" is tuned only for english and never released its compression catalog making script. "shoco" does have a script that will tune it for your input corpus, but (code + tables) size seems to be clearly bigger than huffman.
e.g., // 10431 bytes worth of translations compressed from huffman, vs 16907 bytes just for the same corpus compressed by "shoco"
Good research, but pretty much the expected (if not hoped-for) outcome.
Excellent. Any idea of a rough timeframe?
Not really, but sooner rather than later. We generally avoid schedules, to the disappointment of many. :slightly_smiling_face: 5.0.0 will be done when it's done, but we're approaching done.
@onyx hinge take a look at how jimmo is doing it for micropython: https://github.com/micropython/micropython/pull/5168
Hey all, just a reminder that the meeting is tomorrow, Monday, as usual at 11am Pacific / 2pm Eastern here in the Discord voice channel. Notes doc is here and in a pinned message. We have another US holiday two weeks from tomorrow so expect it to be shifted then as well. <@&356864093652516868> https://docs.google.com/document/d/16ssd4xtTLyBV_5dmoOSjXIWLtJrESWVIxJ5BIfoUfYA/edit
Fixes registration for QSPI, I2C and SPI.
hi i think you have to rebase and update all the submodules so your PR is just code?
also please check https://github.com/adafruit/circuitpython/pull/2572 - it may speed up your display
Crap I did that wrong.
Sorry about that last PR, I went into a recursive loop. Started fresh with a new branch instead.
Interesting, how exactly it's happening? I'm curious and willing to reproduce .
@slender iron thanks for the link. I independently came up with a dictionary scheme. Mine just uses the 32 most common digrams (best result out of several values I tested on zh_Latn_pinyin) and gets back ~400 bytes flash. I could get it to PR status this week, or I could hold on to it for when we "really need it". let me know what you think
interesting, it seems that on nRF when a pin is configured as a PWM output but it's not actively being DMA'd, it is left floating rather than being driven with the last PWM duty cycle.
@hathach Thanks for the info - this build is already only using CDC and MSC as per mpconfigboard.mk, so I don't believe that's it.
One of the lines returned by the debugger is this:
tud_cdc_n_connected (itf=itf@entry=0 '\000') at ../../lib/tinyusb/src/device/usbd.h:62. Wondering if that 0 parameter is problematic?
Closing this because it was really an issue with the Vishay parts needing stronger pullups on their boards (4.7k vs typical 10k). Those breakouts have been revised to include more suitable resistors.
We've fixed a number of bugs related to internal filesystem stuff on nRF52840, so closing this. Let's open a new one if the problem reappears.
@idle owl I don't have eagle here, can you make me a pdf or png schematic of the pam8302a breakout board? https://github.com/adafruit/Adafruit-PAM8302-Mono-Amplifier-PCB
@onyx hinge Yep.
I appreciate it!
following up, with WebSerial now included, this is not important - we can use the every day repl in a browser! it would be nice to have webusb eventually but i don care too much anymore :)
@onyx hinge Good?
yes thank you!
These common_hal routines are not actually called anywhere, so it's only a latent bug. Will fix as part of SPIM3 implementation.
@tulip sleet We did this in the Circuit Playground library for touch: python def _touch(self, i): if not isinstance(self._touches[i], touchio.TouchIn): # First time referenced. Get the pin from the slot for this touch # and replace it with a TouchIn object for the pin. self._touches[i] = touchio.TouchIn(self._touches[i]) self._touches[i].threshold += self._touch_threshold_adjustment return self._touches[i].value
With the list of touch pins in init. Comment in init says it saves a little on RAM. Is there any point in doing it this way in a lib strictly meant for a nRF MCU?
Or should I handle each touch pin in its own method?
There are three.
you still have to not init them in advance, because you'll grab the pins otherwise. But no, not necessary for nRF
Right, init them when they are called.
Is there any reason not to do it that way on nRF?
no, and it makes it easier to understand if the libraries copy each other's styles.
Ok.
in the long run, there might even be a base class that's common to CP and CLUE
Names will be different.
For the touch pins.
There is some crossover though.
Not, I think, enough to justify that though.
But depends on where things go I guess.
Huzzah!
On Mon, Feb 3, 2020, 9:25 AM ladyada notifications@github.com wrote:
following up, with WebSerial now included, this is not important - we can
use the every day repl in a browser! it would be nice to have webusb
eventually but i don care too much anymore :)โ
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://github.com/adafruit/circuitpython/issues/605?email_source=notifications&email_token=AAB5I44YWSWYVURRT4RHCM...
yeah. I would say copy/pasting the code is fine, though, because it's already been debugged
afk until the meeting
@onyx hinge kicad can import eagle files
@iayanpahwa Plug in a nRF52840 running CircuitPython so that it shows up as CIRCUITPY and then sleep the computer, wait 5-10 minutes, open the computer and it should work. Sleep it again and wait another 5-10 minutes and try to wake the computer. It should start up and say that it crashed waiting for a SCSI time out.
@slender iron I'll try that next time
@theacodes Is this still on your radar for for 5.0.0 or should we move it to the 5.x.x or Long Term milestones? Thanks.
Is there a resource to get started with WebSerial? Can't find anything in Learn guides or Adafruit Github.
I still want to do this, I've just been busy with Sol's manufacturing plan.
Will loop back to it soon.
On Mon, Feb 3, 2020, 9:49 AM Dan Halbert notifications@github.com wrote:
@theacodes https://github.com/theacodes Is this still on your radar for
for 5.0.0 or should we move it to the 5.x.x or Long Term milestones? Thanks.โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/adafruit/circuitpython/issues/2...
@crimson ferry I'm not sure if they've published any yet. There is a decent intro here though: https://codelabs.developers.google.com/codelabs/web-serial/#0
They are using a microbit with espruino firmware to demo it, but should apply to Cicruit Python devices as well I believe
I don't think so
nice
Passed! ๐ฎ Thanks for adding this! Tested on CLUE.
I'm coming down with something this morning so I don't think I can make the meeting ๐คข but I've added my hug reports/status updates for text only
Hopefully will be back up at full speed tomorrow
feel better @ionic elk !
@tulip sleet I'd like this to go in to the beta if possible as well: https://github.com/adafruit/circuitpython/pull/2574
I'll use it in the CLUE lib if it goes in.
Could you test that these builds actually work? Try a simple I2C example or something. I found that setting inline limit below 35 or so can produce broken code.
I'm ok merging this in but I want to note why I didn't support tuples. I only supported ints because it's easy to provide a conversion library in Python and having only one type of input keeps the code slimmest. Ints are a better single thing to support because tuples cause at least one more allocation.
tested with rev A PCBs
lurking, just a general hug for all the great people doing great work