#circuitpython-dev
1 messages ยท Page 254 of 1
pid is product id
we may have one for vid but generally someone should provide both
ok
anyone got a doc string example for marking a function deprecated? or is this even useful?
http://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-deprecated
yes, not necessarily that they are good, just that they are the shortest path to a new state.
The term that was common ~30-40 years ago is "syntax-directed editing". A websearch on that will net you a lot
(I remembered the jargon just now.)
kk
I hate it when there is an online form wanting a number without spaces, and it's limited to the number of characters that that number has -- but I'm copy-pasting a number with spaces, and want to remove the spaces afterwards, but then the number is truncated
I guess it's an example of a path to the correct input leading through incorrect
@slender iron https://pdfs.semanticscholar.org/7bb9/2671bc99242411d0404da2041f8f25c8e6a5.pdf?_ga=2.165740087.807605372.1563228293-1065131381.1563228293 1982 PhD Thesis Syntax-directed editing: towards integrated programming environments
^this is an early work -- lots more after this
A structure editor, also structured editor or projectional editor, is any document editor that is cognizant of the documentโs underlying structure. Structure editors can be used to edit hierarchical or marked up text, computer programs, diagrams, chemical formulas, and any ...
https://core.ac.uk/download/pdf/9839511.pdf The Larch Environment - Python programs as visual, interactive literature 2013
haha, have that pdf open now
They should be shared. Is the trouble with RawSample and WaveFile being in audioio that AudioOut is there as well and can't be implemented?
my theory is the balance between text and structure editing shifts when a keyboard is replaced by a touch screen
I would say that the preferred way of expressing the structure changes then
it's pretty difficult to express advanced ideas like structure with point-and-grunt communication
there was a lot of work on using gestures on a screen with a stylus in the early '90s. Whole companies came and went: https://en.wikipedia.org/wiki/GO_Corp.
I did some of this, trying to make a free-form spreadsheet where you could drag cells around, on a stylus-sensitive screen. (cap touch with fingers didn't work all that well).
touch was actually kind of a step back from gestures. The GO UI had a whole bunch of gestures (circles, x's, etc.) to indicate various operations
"pen-based" was the name for stylus-based
right
there was even a whole "alphabet" optimized for "typing" using a stylus
you would draw one simplified letter at a time on the whole screen, and it would be treated as a keypress
Palm Pilot input alphabet
@stuck elbow this discussion was provoked by an internal team meeting about tablet/phone workflow for CircuitPython
do you think the current text based editors for phones are the best option?
almost for sure not the best, but it heavily depends on what the goals are
if the goal is to get to the blinking LED as easily as possible, then a button labeled "make the LED blink" is "the best"
if the goal is to teach a text-based programming language, then probably entering text becomes inevitable at some point
@stuck elbow did you try TouchDevelop ever? We're not setting it up as a shining example, but it was an attempt to make program creation/editing easier on a touchscreen
@tulip sleet I did not. I had a brief encounter with Click And Play back when it was all new and shiny, and that's pretty much all.
looks up click and play
@slender iron The initial thing you told me about simply getting a REPL on the board, that's enough to submit a board? (with the .travis.yml file)
no, they should update the pins too
I think it was https://www.mobygames.com/game/win3x/klik-play
ok. I'm struggling with guide structure.
repl is just the minimum for testing
@tidal kiln heya you'll reply to https://forums.adafruit.com/viewtopic.php?f=19&t=153594 ?
@tannewt I think I understand how to share the implementation, it's just a detail I didn't anticipate in estimating because I hadn't read the previous discussion on this issue. My mistake, and not a big deal.
Automated website update for release 4.1.0-rc.0 by AdaBot.
New boards:
- datum_light
- datum_imu
- datum_weather
- pyruler
- datum_distance
This is super exciting! I like the simplifications you've done and the move to common hal. A number of small questions I have for now. I'm excited for the world where a scan reveals all of the circuitpython powered devices I have going around me.
Should this file be deleted all together?
I'd remove the numbers here. Having them leaks their value into the API. If you want them documented then I'd add rST below in the locals dict so they appear like the HID values do here: https://circuitpython.readthedocs.io/projects/hid/en/latest/api.html#adafruit-hid-consumer-control-code-consumercontrolcode
Aren't the scanned entries remote? Wouldn't they advertise as 'MyPeripheral'?
yay it's a sine wave (PWM in yellow, scope-based low pass filter in purple)
.. I'm not exactly impressed by the math function on this rigol
yay! means i might be able to test my PDMIn struggle on-board... before i invariably hand it off to someone else. DSP is... :brain_hurts:
keep the faith @raven canopy ! I BEELEEEB
I thnk PWM out is the easy part!
@raven canopy I was thinking we should do the mixer changes in 5 as well
ugh I don't want to think about mixer
yep. when i read your in-the-weeds "release 5.x" earlier, i internally let out a little scream. ๐
meh, we can always do it as 6
will all samples have to be at the same sample rate and depth for the mixer, or will it do everything such as audio resampling? actually .. if that were not in my hands, it might be better
we have more numbers available ๐
well, i mean from what i remember, what dean had was working at minimum. just needed to be freshened/de-conflicted.
@onyx hinge I don't remember but I'd expect your output to only get one thing to worry about
ya, I can pick it up before 5 stable too
it'll be a couple months at least before we think about stable I think
OK, I think I'm to the point of needing to tackle playing real in-memory samples, not a hard coded sine wave.
hopefully it shouldn't matter to you where you are playing from
@gilded cradle can we just wait for the 4.0.0-rc.0 merge instead of an empty commit
I'm just waiting on the last travis job
Ok, Ill close.
I can poke the site if needed. you don't need to worry about it
783 assets
woohoo! and also. ouch! ๐
Lotsa boards
I think there's a piece I'm missing when it comes to how the actual audio driver treats in-memory and from-sd samples "the same"
continues reading the source
@onyx hinge nrfx is cryptic at times. i did find the Thingy52 repo a bit helpful for how Nordic uses their own SDK (though it doesn't use nrfx).
https://github.com/NordicSemiconductor/Nordic-Thingy52-FW
@slender iron ah that's one way to do polymorphism! (very expedient)
ya, and the compiler can tell what is happening whereas it can't with function pointers
ya, optimization in general
I do too much C++ by day, the old ways are forgotten
I hear the kids love it
I like the idea of being more explicit with memory
micropython's internals make use of heavy casting though
see above: expedient
might as well wait 5 years and you'll be able to run full python 3.8 on a mote of dust
I mean, not quite, but .. the argument for things less than a full linux keep dwindling. (except boot time, perhaps -- but if pid1 is python...)
I'm in the camp of no linux for simplicity
my tune may change when folks want security though
agrees as he struggles with RosiePi on the RPi ๐
back on the topic of audio, is it the case that the audiosample dictates how big one "chunk" of the sample is? Is there a maximum?
I see that "buffer_length" is acting like an out parameter of audiosample_get_buffer
ya, I believe so
so if I need to consume a different number of samples at a time, that's up to me to track
see you
Hi All,
I noticed on my ItsyBitsy M4 (SAMD21G19A) that CircuitPython seems to allow a huge number of non-compliant combinations for I2C and UART configurations for SAMD51.
I was just wondering if the datasheet for the SAMD51 is wrong or CircuitPython.
EG: D3 (PB23) and MOSI (PB22) is said to be supported uart but really you cannot use the TX pin. (not on PAD[0])
EG: MOSI (PA00) and SCK (PA01) is said to be a valid I2C connection but doesn't work at all. (Not supported by SAMD51 - see datasheet).
Thanks!
According to the datasheet:
UART information found from Forum: https://forum.arduino.cc/index.php?topic=499665.msg3434452#msg3434452
Floating Point Unit support - Page 2
@craggy galleon do you think you could file a bug on github for this?
Sure!
As per Discord Chat.
Hi,
I noticed on my ItsyBitsy M4 (SAMD21G19A) that CircuitPython seems to allow a huge number of non-compliant combinations for I2C and UART configurations for SAMD51.
I was just wondering if the datasheet for the SAMD51 is wrong or CircuitPython.
EG: D3 (PB23) and MOSI (PB22) is said to be supported uart but really you cannot use the TX pin. (not on PAD[0])
EG: MOSI (PA00) and SCK (PA01) is said to be a valid I2C connection but doesn't work at all. (No...
Changed my mind. It has support for REPL over BLE, so let's just leave it for now, for reference. It may get replaced or revised later -- I'm not sure yet.
Assume CircuitPython is wrong. UART was just fixed in #1989. Please file a fix for I2C if you have time. Let me know if you have questions about it.
@slender iron The .travis.yml file that needs to be updated with the board name to auto-build is in the circuitpython root directory, correct? (Basically verifying that I'm not wrong on this one.)
yup!
thanks
@slender iron Another q, sorry. The info in .travis.yml is used to tell Travis to build the firmware files. What else? Something to do with circuitpython.org?
it's what to build and everything built gets released and pushed to s3
oh ok
@umbral dagger ok why dont you try to make a bitmap -creator- library
we have one that parses and loads BMP files
please make one that will save a displayio bitmap to disk as a 24-bit BMP
OK.
I documented the constants (without values) using the data:: rST marker. Took a while to find it.
Right, that's better. Other objects return tuple-ized lists. I forgot to do so here.
Changed to service_uuids_whitelist. Good point and whitelist is the standard BLE nomenclature.
It's plausible you would reconnect to a device whose address was already known due to a previous scan.
In the Apple API, when a scanner gets an advertisement, it calls a callback and passes a CBPeripheral object, (along with rssi and the raw advertisement data). I might call that a RemotePeripheral based on my naming standards. Discovery is done by calling functions on the CBPeripheral. Then you connect to it. I hide all that and just do discovery during the connection attempt. I mi...
scan() does return the entries. Do you mean why allow them to be fetched through an attribute too? Interesting question: there's no reason to make them fetchable later. I'll remove the attribute.
I mean I'll just have the common_hal scan routine return them. I think this was left over from the old code.
@umbral dagger ok back - yeah do you know where to find the BMP format
yeah also we have arduino code
@slender iron So if a new board is submitted, the assets will be generated and put on S3, but until we do a release, it's not released on GitHub?
@tulip sleet You can probably answer this ^^
I figured. Thanks.
@tulip sleet the assets are built for S3 every time we.... ok I don't know. When are the assets built for S3?
on merging PRs?
Right, whenever there's a commit to the adafruit/circuitpython repo, which basically happens only on PR merges.
ok
@slender iron mod of NUS to do a paired connection: not so hard: https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/support-pairing-on-nus-profile-for-central-and-per
Also of interest: hhttps://devzone.nordicsemi.com/f/nordic-q-a/7987/modifying-nus---make-it-bond-with-smart-phones. I like this quote from there: _Pair means encrypt the link, and bond is storing the key so next time the link can be re-encrypted. If the device is not bonded, you won't see it in the Bluetooth setting. _
@gilded cradle I'm including a final line on my guide about "look for a guide coming soon on adding your board to circuitpython.org/downloads". If you could make a note to update my guide with a link to your guide, or to remind me to do that, that would be great, since I have no idea when you'll get to that guide.
Sure thing @idle owl
We talked about this on video chat. The NUS UART is inadequate for REPL use in, say, a classroom situation, because there is no pairing/bonding.
But see some relatively simple changes to NUS that support pairing: https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/support-pairing-on-nus-profile-for-central-and-per.
The data value is not saved between start_advertising() calls, so you have to supply it each time. The scan_response() is sent in response to a query for further data from the Central.
@tulip sleet Do you have a minute to explain something?
sure
Ok, so this part of this file ensures that different types of firmware are built for boards that don't have a UF2 bootloader. https://github.com/adafruit/circuitpython/blob/master/tools/build_board_info.py#L28 but some say BIN and some say BIN_UF2. For the guide should I assume people know how to fill that in for their non-UF2 board, or can you explain the options and what they mean so I can explain it?
Some say HEX but the guide is assuming SAMD boards, so eh
BIN means build only a BIN, BIN_UF2 means build both (some boards were originally sold without UF2 bootloader, but now are shipped with UF2), and HEX means build only a HEX
are there any other options than those three?
no, it was done ad hoc, because those were the choices we needed to support the boards
Ok thanks
@idle owl I just did a quick sanity check, the SAMD programming guide uses .bin so we'd want to fwd people who want to flash their boards with their new firmware they just built over here: https://learn.adafruit.com/how-to-program-samd-bootloaders/programming-the-bootloader-with-atmel-studio
I'm not discussing that.
This is how to add your board, not what to do once you've done it
Ok
It's already complicated enough without adding more tangents to it.
Presumably if they designed the board, they know how to flash it.
There's nothing available that just validates something as an iterable, as far as I can tell. You have to use mp_getiter(), which sets up an iterator, and which might allocate storage. No matter what, somebody needs to call mp_getiter(), and that will throw the right exception if it's not an iterable. It was just a comment to remind the reader.
Interestingly there's a similar comment in the VM:
https://github.com/adafruit/circuitpython/blob/d12e1a8d74ebb8d5d32ab0de47d3097e80c5d4fd/py/...
Thanks! It's much easier to do the parsing in Python, so a minimal implementation here is fine.
I removed the attribute that returns the saved list, so now the caller of scan() has exclusive ownership of the list. So it doesn't need to be immutable: the caller is free to change it. But I'll change the doc to say it just returns an iterable, since it's better to be general: other implementations might not return a list.
So I'm trying to understand the PyGamer design... it looks like 7416 shift register replaces 4 input pins (with pullup/downs) with two output pins and an input pin. Was there originally a thought that this would handle more buttons? Or are we really out of input pins on the SAMD51 at this point?
Also, it looks like @meager fog intentionally exposed the PCC lines through the Featherwing interface.... are we planning on a camera/video input? (cool!)
I changed this and other print routines to print something like <Descriptor with unregistered UUID> when the UUID is not registered. The <TypeName with maybe other stuff> syntax is how repr() looks for routines without a descriptor call (no constructor print available).
https://docs.python.org/3/library/functions.html#repr says:
... For many types, this function makes an attempt to return a string that would yield an object with the same value when passed to eval(), otherwise the ...
No worries @tannewt . I'll give it a test run in the next version bump of CircuitPython and report back.
Hi, I'm seeing a weird issue I'm not able to debug. I am initializting my LCD in a module ugame.py, which works fine if it is is the lib/ folder as a .py, but if I compile it in circuitpython with FROZEN_MPY_DIRS, it seems to be running fine (seeing print()s etc.) but it doesn't initialize the display. I tried adding delays in various places too, but nothing seems to work. It's using busio.SPI
any idea on how to go bout debugging this? Link to the file https://gist.github.com/ntavish/366bb64a53b6239eb5f6675d0d467585
did you do a make clean after modifying it? the frozen libs are not update automatically
I did, checked the build directory contents also
I'll try again just in case I missed it earlier
do you have a logic analyzer to look at the spi traffic?
I assume it's a custom board?
by the way, you probably want to use a gamepad module for that button handling
oh okay, thanks, I'll take a look at that module
you can see how the ugame.py for the actual ugame10 does it
I didn't try connecting a logic analyzer yet, don't have it with me, but I can get it
okay, I'll take a look.
also, if it's a custom board, you might want to do the initialization in board.c instead, and just use board.DISPLAY
also how ugame10 does it
it's like a shield for a base board, so the display is optional if I want to keep a single 'board' in circuitpython
unless there is a way to have it optinally initialize it from board.c
then I think you want https://github.com/python-ugame/circuitpython-stage/tree/master/itsybitsy_m4_express or https://github.com/python-ugame/circuitpython-stage/tree/master/feather_m4_minitft_featherwing
yeah this is what I was doing, and it works if just put the two python files in lib/, just not when they are frozen
maybe something is resetting the display afterwards?
I'm connecting saleae to the display pins, thanks for the help. also thanks for the library ๐
Hey! Is there any way to set larger font size and display it on SSD1306 OLED ?? SSD1306 library don't support other fonts and sizes. Is there another easy way to do this?
you can draw the letters yourself
@stuck elbow So I guess there is no easy way just to set larger font size ๐
"easy" is relative
I give up for now, not seeing any difference, but there must be
@cerulean pawn could you point to the main program?
@tulip sleet I'm running the ball example, https://gist.github.com/ntavish/3046bc7205de7cdaf0613676ffc7ddc1
@cerulean pawn might be something being gc'd when it's not supposed to. I'd strip this down to an import that just creates the display, and a code.py that just displays something on it (like an increasing count).. Remove the Stage stuff. Then start adding things back.
The esp32 spi web server stuff tested on HW! https://twitter.com/arturo182/status/1151491502478168064?s=19
Testing a PR by Mathew Costi adding web server capabilities to the esp32 coprocessor in @CircuitPython. Good stuff! https://t.co/22MKrQFV3y
@tulip sleet yeah, I'll try that tomorrow, time to head out, thanks
thanks for the testing it @indigo wedge , I'm excited to get it in there for everyone to start using ๐
@empty hazel we'll have font support for the OLED displays in the next couple weeks
@umbral dagger p0ng - checkn in
@meager fog Working away... no blockers
@tulip sleet did the new compiler make the code size smaller? I'm out of space on m0 express with pinyin
kinda crazy it's 4k extra bytes
vs english
When I tried gcc8 earlier, it only saved a few hundred bytes, but maybe that's enough. I can try it now.
@slender iron Metro M0 pinyin: latest arm release has 1624 bytes free vs 1172 bytes free with 7.3.1 release
build seemed noticeably slower: I will time it
I'm 900 or so over...
.text.common_hal_pulseio_pwmout_construct
0x00000000000088bc 0x300
that always gets me
gcc7.3.1 build:
real 0m37.314s
user 1m3.694s
sys 0m7.902s
gcc 8 build:
real 1m43.808s
user 3m0.779s
sys 0m8.552s
ugh
yikes
.text.common_hal_busio_spi_construct
0x000000000000fc6c 0x294 /var/folders/b3/mq4ptm_52ggbz4k_ghvkmnzw0000gn/T//ccWbrwHO.lto.o
.text.common_hal_busio_i2c_construct.constprop.184
0x000000000001003c 0x2d8 /var/folders/b3/mq4ptm_52ggbz4k_ghvkmnzw0000gn/T//ccWbrwHO.lto.o
is it just the pin finding that is so big?
gpio_set_pin_direction(clock->number, GPIO_DIRECTION_OUT);
gpio_set_pin_pull_mode(clock->number, GPIO_PULL_OFF);
gpio_set_pin_function(clock->number, clock_pinmux);
claim_pin(clock);
self->clock_pin = clock->number;
if (mosi_none) {
self->MOSI_pin = NO_PIN;
} else {
gpio_set_pin_direction(mosi->number, GPIO_DIRECTION_OUT);
gpio_set_pin_pull_mode(mosi->number, GPIO_PULL_OFF);
gpio_set_pin_function(mosi->number, mosi_pinmux);
self->MOSI_pin = mosi->number;
claim_pin(mosi);
}
if (miso_none) {
self->MISO_pin = NO_PIN;
} else {
gpio_set_pin_direction(miso->number, GPIO_DIRECTION_IN);
gpio_set_pin_pull_mode(miso->number, GPIO_PULL_OFF);
gpio_set_pin_function(miso->number, miso_pinmux);
self->MISO_pin = miso->number;
claim_pin(miso);
}
spi_m_sync_enable(&self->spi_desc);
}
could refactor that somewhat
migt not save very much
My display code isn't exactly slim:
.text.displayio_group_fill_area
0x0000000000013e60 0x6a8 /var/folders/b3/mq4ptm_52ggbz4k_ghvkmnzw0000gn/T//ccWbrwHO.lto.o
could turn off samd module on M0 boards
that has a lot more uses than samd
true
we could turn off certain modules only on large languages, but that's not really great
could turn frequencyio off in m0
pixelbuf is an optimization, not basic functionality, so it could be off for large languages
@slender iron are crystals separate from the chip? So would I say "if your board has a crystal" or "if the chip on your board has a crystal"?
separate
thank you
samd and/or frequencyio
@umbral dagger would having an email reminder for the nitely review behelpful
@umbral dagger they were super helpful
lol ok thankx
Ok in mpconfigboard.h you update the HW_MCU_NAME to match the chip, but in this case it's "samd21e18" and then the CHIP_VARIANT in mpconfigboard.mk is the full SAMD21E18A so is the MCU_NAME the chip name lower-case without the extra bit on the end every time and the VARIANT is it including the last letter?
@idle owl I think one might just be for printing (the lower case one), so it might not matter. I'll look it up.
Ok thank you
@idle owl yes HW_MCU_NAME is just used in various version strings. whereas CHIP_VARIANT affects the compilation. probably the missing suffix could be considered a minor naming bug
Ok
Ah ok, thanks
@slender iron FrequencyIO is 2420 bytes
samd was 16 bytes (!) obviously there's some compilation weirdness there, but it appears quite small
that seems suspect
I think maybe the module is still being compiled or something, so the dictionaries may still be there
271 tcc->PER.bit.PER = top;
0x00008b0e <+594>: ldr r0, [r3, #64] ; 0x40
0x00008b10 <+596>: lsls r4, r4, #8
0x00008b12 <+598>: lsrs r0, r0, #24
0x00008b14 <+600>: lsrs r4, r4, #8
0x00008b16 <+602>: lsls r0, r0, #24
0x00008b18 <+604>: orrs r4, r0
0x00008b1a <+606>: str r4, [r3, #64] ; 0x40
interesting how this expands out
@slender iron they're just two-byte instructions
@tulip sleet When you have a few minutes, can you assist me with some structure decisions for this guide? I'm at a point where it's one giant page and I think I know where to split it, but having done this once already and thinking I did it wrong and reverting, I'd rather have someone else who knows the process take a look first and tell me if I'm totally off on that idea.
something is weird here: CIRCUITPY_FREQUENCYIO is supposed to be off, but seems to be on: see ports/atmel-samd/mpconfigport.mk
I would like to make BUILD_192KB, BUILD_256KB, and BUILD_FULL, but hadn't gone around to that yet
I want a barebones one as well for porting
that's fine, just something more than SMALL and LARGE, which were not great choices
frequencyio could be an include order issue
BUILD_MINIMAL
ports/atmel-samd/mpconfigport.mk has a typo
'FRQ'
yup ๐ perfect
1528 bytes free in flash out of 253696 bytes ( 247.75 kb ). for pinyin now
๐
:forehead_slap:
yup ๐
makes grabby hands towards free code space
That all also highlights something I need to address in the dynamic support matrix for RTD. I don't handle port-wide settings.
Nice work guys ๐
Also enhances Palette to make entries readable.
Hi @raven canopy , I was wondering if you could give me a hand or ideas on how to solve the issue 1886, I left some comments on there on how I was getting started to try to solve it 
@granite crow I'll peek closer at it tonight. I've seen the comments flow through, and a few ideas come to mind. I think you're on a good path so far!
Sounds nice to me, I will be also thinking about it
nrf audio mini progress report: since my last landmark (playing a hard coded sine wave) I have completed most of the structure to use sample objects, loop, and double buffer (so to speak). However, no sound comes out. Entering debugging mode. What would I even do without j-link!
surprise: by turning OFF optimization, I get a diagnostic and my build stops. ugh. ```../../shared-module/displayio/TileGrid.c: In function 'displayio_tilegrid_get_refresh_areas':
../../shared-module/displayio/TileGrid.c:452:52: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
if (displayio_area_size(&self->dirty_area) <= 2 * self->pixel_width * self->pixel_height) {
^~
cc1: all warnings being treated as errors
by writing "2u" that error goes away. curious.
87 audiosample_get_buffer(self->sample, false, 0,
88 &buffer, &buffer_length);
``` get_buffer_result is GET_BUFFER_DONE which seems right, but buffer is NULL and buffer_length is 0, so playback stops
@solar whale just released an updated Adafruit IO CircuitPython...with a MQTT class ๐
I have been learning a little bit about MQTT because of Sonoff-Tasmota. Do you have an application in mind for it @prime flower ?
OK, a missing audiosample_reset_buffer call explains that, now I get buffer_length 256
@onyx hinge Plenty of examples (for now). I'm moving over a buncha Adafruit IO Arduino MQTT examples to CircuitPython's MiniMQTT
Checking out Sonoff-Tasmota
Sonoff are wifi relays and tasmota is an open source firmware for them
Many of the sonoff models are pretty easy to flash with pogo headers
I like the admin side of it ๐ (https://github.com/reloxx13/TasmoAdmin)
maaaybe possible with the new work being performed on the ESP32SPI Server PRs
@onyx hinge I made that exact same fix 2 -> 2U when doing some BLE stuff. It's in my PR that is in review state.
it's some odd optimization thing that only shows up on the nrf builds
2u is correct, the compiler should have caught this in all cases
After some mental walking through the problem, I don't think tools/build_release_files.py is a good home for this.
Since the Travis jobs run as a matrix, and build_release_files only gets a limited set of board names, it would be difficult (but not impossible) to keep track of what matches the condition of board not built, but exists. (Further explanation if you don't understand the .travis.yml. Each line under env: is an environment variable, and forces a separate matrix job. Th...
@tulip sleet do you think it's likely to be merged soon, or would a pull request with just that change be useful?
should be merged in the next day or two
Great, I won't sweat it then
How about creating a #define like NO_BRIGHTNESS_COMMAND or similar, so you don't have to mention it in the comments for every common_hal_displayio_display_construct() ?
Great! I think all my suggestions were just for clarity.
For want of an E, the bytes were lost. https://en.wikipedia.org/wiki/For_Want_of_a_Nail
If you don't add NO_BRIGHTNESS_COMMAND, then this should be <= 0xff.
Does anyone know if I can run CircuitPython on a Particle Argon, and access the Particle Cloud and related functions like publishing variables and events?
from my understanding: no. this is because installing cp can (depending) wipe out not only the particle software but some of their burned in info, etc. and you might get better answers in #help-with-circuitpython
@gaunt bay
Got it, thanks!
i would use a particle and another board together and write a lib on the particle to turn it into an spi or serial peripheral fora cp device.
if it is really necessary
yay it's not right yet but I'm getting sound that I can tell is intended to be the .wav file I'm using for testing
@cerulean pawn https://github.com/jepler/circuitpython/tree/nrf-pwm-audio If you are interested, you can check out the current state of this. Basically, it can play a single sample, with what sound like clipping artifacts, and then you need to reset the board because it never realizes it has reached the "stopped" state.
I am playing on a particle xenon using pin D4 for audio output. if you want to experiment with unfinished code, I would be happy to hear whether you can also play a sound once. besides changing the pin to use, my code is pretty much the basic CP audioio code.
.. I'm out for the evening, more updates tomorrow afternoon/evening US central time
Hi @sommersoft, thanks for the explanation, now the problem to solve and the solution you're proposing are clear to me, i just have one question. Does the result of the search pattern TRAVIS\_BOARDS\=\"(.+)\" the same as if i get the boards using os.environ["TRAVIS_BOARDS"]`?
I'm not very familiar with regex, but if it's necessary i can take a look at it.
Meanwhile, what do you think it should be a good name for the new script? I think check_all_boards_are_being_built.py is a long one...
@gaunt bay please donโt post the same question in multiple channels. I replied in #general-tech
@onyx hinge oh nice. I'll try it and let you know what I see. I'm gonna be trying it on https://docs.electronut.in/blip/
@tannewt
Following up on this.
Does CPY support software I2C? We have got I2C working on PA08/PA09 but the datasheet clearly says that only:
PA16/17
PA12/13
PA22/23
Any ideas?
Open question to anyone who can answer it above. I am interested why I2C on 'non-i2c' pins works
CircuitPython does support software i2c, but you have to explicitly use bitbangio instead of busio.
Follow up Question: How come busio works on the pins mentioned before PA08/PA09 when datasheet says it shouldn't for SAMD51G19A?
Maybe it only seems like it works, and there are some weird corner cases or rare hardware errors that we can't see, so the datasheet says they are not supported? Or maybe the datasheet lies?
I have seen before on the SAMD21 that some pins were excluded from I2C even though they worked. In that case it was because of under-spec current sinking on those pins. The I2C pins had higher current capability than most of the other pins In practice the under-spec work fine. The might be flaky on very long runs, but we have never seen that.
However, on the SAMD51, PA08 and PA09 are supposed to have higher sink ability: Quoting from the datasheet: _3. These pins are High Sink pins and hav...
So based on your above comment @dhalbert it is likely that in most cases they will work (as they appear to be working for me both in CircuitPython and Arduino) but could experience issues.
I understand what you are saying about how much power they can sink and the different supplies. I just found it strange that they (1) worked and (2) datasheet said otherwise.
I have the same case on PA00 / PA01 --> working I2C even though they are not in datasheet.
The only reason I even trie...
@wallarug Yes, the datasheet is saying in an opaque way you shouldn't, as opposed to you can't, or "we don't guarantee it".
AND, I found a previous discussion of this exact issue: https://forums.adafruit.com/viewtopic.php?f=63&t=139056
Great information! Thanks @dhalbert .
There are no issues with I2C and CircuitPython (in fact - it is good that you can use more combinations).
I would still like to keep this issue open so that I can test the UART pins thing mentioned at the top by @tannewt and report back when I run my next build.
Thank you everyone! ๐ฏ
@cerulean pawn either you work with Mahesh or you are more fortunate than me. I've been waiting for the Blip to come out. Crowd Supply still has it pre-order.
Looks good to me! Thank you for your hard work on this.
<@&356864093652516868> master is now 5.0.0 WIP with โฌ
yabba dabba do!
Woot!
how the time flies
๐
time flies with time.monotonic()
Why it seems like just yesterday we were putting the polish on 3.0.
They grow up so fast! ๐ญ
Automated website update for release 5.0.0-alpha.0 by AdaBot.
and i 'member when people made kombucha brewers with a trinket and CP 1.x beta
@steep mantle haha, yeah I work at electronut labs
@tulip sleet I just tried the ble_demo_cental taht I used af ew days ago with 5.0 alpha and I get ```Auto-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.0.0-alpha.0 on 2019-07-18; PCA10059 nRF52840 Dongle with nRF52840
import ble_demo_central
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "ble_demo_central.py", line 35, in <module>
File "adafruit_ble/uart_client.py", line 73, in connect
TypeError: extra keyword arguments given
yes, the PR for the BLE library isn't done yet, so it will not match. You can get the latest dhalbert/Adafruit_CircuitPython_BLE and I think it will be OK.
ok -- thanks -- no rush -- juat wanted to be sure I had not done something wrong.
oops, but not on master, on the branch python-advertisement-data
you can wait too, should be done soon
service_uuids is now service_uuids_whitelist
I can wait for you you to finsish -- I have lots of other things to do ๐
that's fine - thanks for testing!
np !
OK, back to pwm audio. The current sub-task: when playing a non-looping sample, correctly return the AudioOut object to non-playing status at completion.
(hi all)
@onyx hinge Is the code you are adding applicable to any board with pwm capabilities?
@simple pulsar It is pretty specific to the nrf52840
I was just curious. I've done a bit of audio work (from an application point of view) in past. I had put in https://github.com/adafruit/circuitpython/issues/1623 but I suspect that's more core functionality and might mean things need a bit of rearranging although I've not looked closely at that code
That would be a nice addition
hmmm, looping works except 50% of the time when it doesn't.
or, rather, .stop() doesn't work 50% of the time, .. maybe
That could be useful
It will only be usable by lucky users. It could be used to determine how lucky people are.
OK, looping and stopping work now!
I need to figure out if the clipping problem is my code, or it's feeding an inappropriate (digital) signal to the audio amplifier.
hmm but RawSamples don't loop(?)
This fixes the bug that bitmap changes do not cause screen updates
and optimizes the refresh when the bitmap is simply shown on the
screen. If the bitmap is used in tiles, then changing it will
cause all TileGrids using it to do a full refresh.
Fixes #1981
Just one question about the algorithm.
Is it ok if .x2 or .y2 are out of bounds with respect to the bitmap? You don't do a min(x +1, size_x) kind of range limiting.
pause and resume. hm. I don't think you can interrupt a PWM sequence in the middle, unless you just want to disable the PWM instance entirely
no, I can send STOP whenever I want, but I can only START from the top of a sequence
and there's no way to see where in the sequence you are
@slender iron @meager fog Is this nrf pwm audio targeted at 4.1 or at 5.0 ?
i would guess 5.x
though, i guess SemVer rules would allow for 4.2... backs away from keyboard
whee, branch updated. WIP history cleaned up. Realized I didn't test with any 8-bit samples. Will fire off a pull request yet this evening, I hope, though I expect to have changes requested.
This implements AudioOut, with known caveats:
- pause/resume are not implemented
- at best, the sample fidelity is 8 bits
- on my test system, certain "loud" samples sound like they are clipping
- on my test system, samples not "centered" at mid-scale sound distorted (so the "sine wave RawSample" example doesn't work properly)
- Scott requested that this be called "pwmaudioio", but it's still living at "audioio".
Testing performed:
My test system is a Particle Xenon with a PAM...
stupid idea: how hard would it be to log errors to a file?
(for all those people who can't use the serial)
I've noticed that for CircuitPython the is a quite limited number of displays supported.
Please consider to use/convert to CircuitPython U8G2 library from https://github.com/olikraus/u8g2 It's just awesome.
@stuck elbow we already do that for boot_out.txt; the mechanism is there; so we'd just need a call to enable it
that could be a nice workaround for when the serial is not working
just the lat exception, so that it doesn't grow indefinitely
We could just give a max size for the file, and maybe wrap around if we overflow.
need to have a fence marker in the file, or use two files
Build failed, just looks like make translate needed.
that gets complicated fast, and then you would have to parse it too
I think just writing the version line (like now) and then the last traceback would work very well and be relatively simple
in nrfx_config.h, there are two #ifdefs, #ifdef NRFX_TIMER3 and ifdef NRFX_TIMER4, shouldn't they be #ifdef NRF_TIMER3 and #ifdef NRF_TIMER4, which will come from nrf52840.h?
Hi,
Had to delete my old comment because i didn't read properly your reply, so all my questions are now answered.
Still a draft and my python isn't perfect so let me know if i'm doing something silly.
Here's what i print on the console so far (so the script is opening the travis.yml file and finding all the lines with TRAVIS_BOARDS in it, it's skipping 2 lines :-1: ):
TRAVIS_BOARDS found
- TRAVIS_TESTS="unix docs translations website" TRAVIS_BOARDS="circuitplayground_express mini_sam_m4 grandcentral_m4_express capablerobot_usbhub pygamer pca10056 pca10059 feather_nrf52840_express maker...
@cerulean pawn OOPS, yes, I will fix this in my next BLE PR, or you could submit a separate PR.
Thanks for spotting that!
The model of that library is completely different from our model. In CircuitPython we use Python files to store init sequences while u8g2 uses C. Using u8g2 would bloat our binaries code size a ton.
We could use it as a reference for creating community drivers for all of the different chips though.
Hi, what version of python runs on Travis? I'm trying to unpack a dict_keys into a list and i think i require python >= 3.5
it depends on which linux version your build is on, but you can choose the python version: https://docs.travis-ci.com/user/languages/python/
@granite crow for the core repo's Travis, it runs version 3.5.
Thanks @tulip sleet and @raven canopy ๐
@raven canopy I got the script almost done, i'm now trying to figure out how to know if all the boards listed in TRAVIS_BOARDS are in the boards listed by build_board-info.get_board_mapping()
So if a board isn't in TRAVIS_BOARDS but is in the board_mapping travis will fail (i guess)
You'll probably have to raise an exception, or use a non-zero sys.exit(). Either way works for forcing Travis to fail. But I would be sure to have print out a list of the missing boards.
Sounds nice
The range limiting is done in shared-bindings so it'll be fine here.
Ok, @dhalbert. It should be ready for re-review and pass Travis ๐ค .
Any recomendation on how to compare both board lists? Do i need to get fancy searching?
Great! These changes will be in 5.x releases.
Output of the script:
Boards missing in TRAVIS_BOARDS:
datalore_ip_m4
pewpew13
trinket_m0_haxpress
cp32-m4
gemma_m0_pycon2018
circuitplayground_express_digikey_pycon2019
circuitplayground_express_4h
feather_m0_supersized
I'd be happy to merge this early with bugs but would like it to be in it's own module and class rather than AudioOut. At some point I'd like PWM AudioOut on SAMDs as well for pin flexibility.
Why does SPI Device not have a deinit() property? Is it because it's meant to be used with a context manager?
Another fantastic speedup!
Is this going to be 4.1.0-rc.1, since it was merged into 4.1.x?
@meager fog I need an empty repo: Adafruit_CircuitPython_BitmapSaver is my name suggestion.
@prime flower yep
Looks good! In addition to the change marked, could you go ahead and add the command to run the script to .travis.yml so we can see how Travis treats it?
This can actually be compressed, since if everything is fine the script will exit with code 0 anyway.
if missing_boards:
print('Boards missing in TRAVIS_BOARDS:')
for board in missing_boards:
print(board)
sys.exit(1)
@umbral dagger still need the repo?
@slender iron No, @meager fog hooked me up
kk
Looks good! In addition to the change marked, could you go ahead and add the command to run the script to
.travis.ymlso we can see how Travis treats it?
Done, let me know if i did something wrong :)
Nah, I just removed the return. We know it'll pass since we're providing the colorspace and we don't handle transparency.
I waited until the build finished just to make sure. It works! Well done! ๐

I would move this into the before_script: section. Line 73 will work fine, so that we fail fast before downloading any toolchains and building all of the boards.
- sudo dpkg --add-architecture i386
# Check if there's any board missing in TRAVIS_BOARDS
- cd tools && python3 -u travis_new_boards_check.py
- cd ..
Added a check to the setter in shared-bindings. This value isn't actually used to set the brightness. It is only returned to indicate brightness isn't controllable.
Are there any plans to add the strftime method to the time module supported by CP? https://docs.python.org/3/library/time.html#time.strftime
Atleast on the version of CP i'm running, doesn't seem to be implemented yet.
@graceful heart no plans that I know of. string formatting routines can be pretty large so I'd hesitate to add it
yeah, I figured that was the case.
ok, thanks. Was asking because a formatted Date header is usually a required header for origin servers to send back https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.18
But section 14.18.1 says it's ok to leave it out if the server simply cannot provide a time. It's... close enough to true.
it also wouldn't be a ton of effort to convert the time struct to the format required by the header.
wait a second..... my itsy bitsy is reporting the current time is January 1, 2000.
ok, I guess that just means i don't have an RTC. does that mean the time is relative to boot up? @slender iron
ya, it is boot relative. you should be able to set it though
I guess if you made an API call to an RTC service you could set it that way lol.
@raven canopy I did make an alpha release of Adafruit_CircuitPython_BLE a few hours ago, but after the cron job time. Its tag is of the form that should be ignored by the bundle releaser.
@jepler, there are merge conflicts, so it won't run a build until they're resolved.
Automated website update for release 4.1.0-rc.1 by AdaBot.
@tulip sleet roger dodger. i'll run a test tonight or in the morning.
i'm wading through systemd. i'll need to search for oxygen soon... ๐
Hm, as @slender iron requests, I am trying to move the nrf's audio to a new audiopwmio module (to track with the exising audiobusio package). What's the appropriate way to let the Sample classes that live in audioio on boards with DACs appear in audiopwmio for nrf?
Doh! I gave you bad advice. I forgot that the sh module is needed, and this placement runs before pip3 sh. So anywhere between line 83 and line 93 should do fine. We'll just have to accept downloading gcc.
I did figure out one thing, though -- running the amplifier from +3.3V is bad, running from VUSB is good. Must not be enough current available from the regularot.
it sounds much better after that switch
something else is the problem with RawSamples though
this is not a PWM'd sinewave
another great episode of embeddedfm this week https://embedded.fm/episodes/295
I've updated the branch, and revised the description of the patch to reflect progress since I filed it. @tannewt
@graceful heart I've been using server headers to keep clock time on my CircuitPython devices, along with seconds-tracking using time.monotonic_ns(). Good enough for TOD until some kind of async comes along.
@crimson ferry oh that's clever! Unfortunately for me, the CircuitPython device is acting as the server handling incoming requests, and It doesn't look like Date is a header that is typically sent with Requests
Hey all, looking to read a binary file that has both fixed structure and null-terminated strings. The struct module is (frikkin) magic, but doesn't have a way to read a string. Any ideas? Should I just read bytes one at a time into a buffer that I pre-allocate and then convert the bytearray to a String? That has a problem that the buffer needs to be big enough to hold the whole string... or I can use String concatenation which I'm sure will waste memory and time
@tough flax How big can the string be at most, in the binary format?
@tulip sleet "stable libraries ONLY" bundle update seems to work as expected:
commit 83241291ac8fa257320dc88927fa1fc266d44528 (HEAD -> master)
Author: sommersoft <sommersoft@github.com>
Date: Sat Jul 20 08:10:58 2019 -0500
Automated update by Adabot (adafruit/adabot@1939062)
Updating https://github.com/adafruit/Adafruit_CircuitPython_TinyLoRa to 2.0.0 from 1.0.8:
> Merge pull request adafruit/Adafruit_CircuitPython_TinyLoRa#22 from brentru/add-rst-on-init
we'll see if prod agrees.
Question/advice: I have a slight, non-breaking, tweak to displayio.Palette that I need out asap. What should I PR against?
against?
what branch I guess. I don't want to have to wait for 5.0.
I'd say the placement is good in the Travis. That's my opinion though, and easily overruled. ๐
Found one last thing, and then I'll approve. I won't merge though, as I'd like @tannewt to weigh in on it, and I have an open question:
- Are there any boards that actually should be ignored? Like say
trinket_m0_haxpress?
I'm late in catching this. There are a few aliased boards returned by get_board_mapping(), which are not actual buildable boards:
gemma_m0_pycon2018
circuitplayground_express_4h
circuitplayground_express_digikey_pycon2019
I drummed up a list comprehension that takes care of not including any aliases:
info_boards = [board for board in boards_info_json.keys() if not boards_info_json[board].get("alias", False)]
Thanks for catching it, I don't know a lot of python but at the end info_boards will be a list? Because previously it was a dict_key and one line after I turned it into a list, with this new approach, i can remove the info_boards = list(info_boards)
About the boards to ignore, i think we can make a list of boards to ignore and remove them from the missing_boards list after missing_boards = list(set(info_boards) - set(travis_boards)).
I will be away from the keyboard for a couple of days, can you do the lasts fixes?
I will be away from the keyboard for a couple of days, can you do the lasts fixes?
I should be able to handle it. Just a matter of git cooperating. ๐
Yeah, it'll result in a list. List comprehensions are basically the same as this:
>>> foo = [] # or 'list()'
>>> bar = [1, 2, 3]
>>> for item in bar:
foo.append(item)
>>> foo
[1, 2, 3]
>>> [item for item in bar]
[1, 2, 3]
>>>
@alpine shore probably 100 bytes or so
100 bytes should not be an issue even on M0
@umbral dagger you could submit against 4.1.x. We are trying to get the release candidate out soon. 5.0 will have an alpha release also very soon, and itโs quite close to 4.1, do it should be quite stable. That would be against master
@tulip sleet no I meant each string
The whole file is like 4K. But Iโm just looking for an efficient way to read a null terminated string from a binary file
I have it working but itโs joining each char together
Seems messy
So, I have a memory/processing time choice (on a Trinket M0 no less). I have a 24x24 cell membrane that I need to read press/releases from and them map them to keystrokes. I think I have two options but am looking for more or recommendations. I can pre-calculate each cell's action (w/references into a table) and then easily lookup each press/release and figure out which HID messages to send. OR I can walk through the list of cells and check for intersections (all of the cells are rectangular) and then process the changes.
On an M4, I'd just eat the memory and go with the faster lookups, but it doesn't seem like there's an efficient structure in Python for a 2D grid. I'm using nested lists and they seem slow and wasteful.
Any ideas?
if the size is fixed, you can use tuples instead
they are less wasteful
not sure what you mean by "cell's action" โ how would such a calculation look like?
When a cell is pressed, it might trigger a keypress or mouse movement. So, when the config file (overlay) is loaded, I can either keep track of all the regions that are assigned different keys, or I can build the grid that has each cell assigned an action ("Letter A" or "Mouse Left"). Then Press/Release of that cell triggers that event
It's a big keyboard
with programmable areas for the keys
I'm not sure I understand the difference then
in both cases you have to somehow store what each key does, no?
They're not keys... under that piece of paper (which has an 8x12 layout) is a 24x24 grid of cells under a membrane
So I have a choice: store what each CELL does, and lookup quickly
Or store what each defined AREA does and do an x/y lookup on each on for each press
One will use more memory, one is slower
I'm looking for guidance on choosing or another option in Python I don't know of (I'm not a Python guy, right @turbid radish ?)
@tough flax i think to @stuck elbow's point, the memory footprint is going to be similar. right? if the LUT won't fit on the internal flash, i think a FRAM chip is a good candidate. SPI version in the store is 8K, and I2C is 32K, iirc.
i get that doing it by AREA is smaller chunks, which helps when the stack is fragmented. unless AREA also allows to do some slick bit-shifting type stuff that can't be done with CELL?
downside to FRAM LUT: updating would not be as easy as putting on a new UF2.
so each of those "keys" is actually 6 cells? Left/Right x Top/Center/Bottom?
On this overlays thatโs about right. But each will be different. But yes, top left, width, height
Perhaps a bytearray where I do the row/column math myself?
Hereโs another standard overlay. But you can make your own
I think you would be best off by having a bytearray (or a byte string) of 576 bytes, each telling the function of the 24 * y + x cell
because if you try to store it by areas, it's 4 bytes per area, at the least, and you can have like 100 areas easily
hmm, defining by region sounds easier for defining maps but it's a bit more computationally intensive.
the difference is negligible
hmm, if bitstruct works in CP it might save you some RAM
Ok, it sounds like the bytearray's the same thing I posted above (unless I'm misreading you). I think I'll go that way for now.
a single byterarray is going to have much smaller overhead than a list of lists of arbitrary python objects
Hi all. We have our regular community CircuitPython meeting on Monday at 11am Pacific / 2pm Eastern here on discord in the CircuitPython voice channel. All are welcome to attend. We have a notes doc you can put notes into ahead of time here: https://docs.google.com/document/d/1IITBngDCVEm7zNwnyD_nIUzhZPXSMc4pqRJzFyf0zDs/edit?usp=sharing Hope to see you there! <@&356864093652516868>
This will return RGB565 instead of RGB888 like it is set which is inconsistent. Please use #1998 instead which stores the RGB888 and returns it. It will only be available in 5.x but we'll have a beta available shortly for it.
Good morning! I've got a little problem... I'm trying to work with the AdaFruit FancyLED package. After copying the adafruit_fancyled dir into place (in CIRCUITPY/lib), I'm getting an error when running simple examples: ```Traceback (most recent call last):
File "code.py", line 195, in <module>
File "code.py", line 140, in main
File "adafruit_fancyled/fastled_helpers.py", line 111, in loadDynamicGradientPalette
AttributeError: 'module' object has no attribute 'CRGB'
Based on the PY code, I can't see anything obvious. The CRGB class is clearly defined in adafruit_fancyled.py.
CircuitPython 3? 4.0? 4.1?
4.0.
4.x.x is the bundle I downloaded and installed. Don't know how to check 4.0 vs 4.1
The bundle is the libraries. Probably the same for 4.0 and 4.1. There was a .uf2 file that's the actual CircuitPython interpreter and firmware. That's different between 4.0 and 4.1
@charred forge to check your CircuitPython Version you can either look at the contents of the boot_out.txt file on the CIRCUITPY drive or easier, just connect to the REPL and the Version is printed every time the REPL starts (if you have a code.py or main.py running halt it with Control C then press enter to go to the REPL)
Adafruit CircuitPython 4.0.2 on 2019-06-27; Adafruit CircuitPlayground Express with samd21g18
any plans on CP support for ESP32 Huzzahz feather? Silly me just "assumed" that CP was on it since adafruit sold it ๐
I'd imagine it is challanging because it is dualcore.. but what if one core was dedicated to the BLE/wireless processing and one core was dedicated to everhting else.. kind of like having a built in airlift.
@swift arrow the esp32 lacks native USB so it cannot use the .uf2 bootloader or have it File sustem mounts as a USB drive (CIRCUITPY). The same was true of the ESP9266 and the nrf52832 so support was dropped for them. There are rumors of a new ESP32 chip with native USB so if it materializes, it may be supported.... BTW MicroPython does support the ESP32.
but my computer connects to my Huzzahz ESP32 with USB.. and loaded usb drivers for it
or is that not "native"
if micropython supports it and our CP is a fork/built off of micropython, shouldn't we support it ๐
not trying to be a PITA.. I fear it just comes naturally..
It's interesting because the product page on adafruit makes it sound like the ESP32is the up coming chip and is going places.. but it really hasn't. Whch is a shame given it's speed and RAM.. 520KB.. that would be so sweeeeet for CP.
The USB connection to the ESP32 uses a CP2104 USB to UART bridge. the ESP32 does not support USB itself.
The Micropython support does not have a USB mounted filesystem. You have to use a special tool (ampy) to load files to the ESP32 -- not bad, just different.
I'm not going to try to convince you it should not be supported, I'm just letting you know why it is not. This has been discussed several times in the past.
thanks @solar whale . It helps to understand the why of things
hmm latest version broke my UART SD logger
File "adafruit_sdcard.py", line 113, in __init__ File "adafruit_sdcard.py", line 145, in _init_card File "adafruit_sdcard.py", line 236, in _cmd OverflowError: value must fit in 1 byte(s)
never mind.... I needed to update Libs
i updated "adafruit_sdcard.py" and it is working like before
Hi everyone. Did some more work on the ESP32 Server PR. Did some re-working so the main piece of functionality we're adding is a WSGI compatible server implementation for the ESP32 over SPI. https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI/pull/59
This allows us in the future to write a separate CP library that is a WSGI web application framework. This way, as more wifi boards comes out that support server functionality, we can write a WSGI server for it and re-use the WSGI web app framework lib.
If anyone has some free time, would appreciate some feedback ๐
This is still a work in progress, but opening it up for early feedback and suggestions.
Core Library additions
Adds Server creation methods to esp32spi.py
Instantiates a server on the esp32 on th...
Just a short whine.... I'm slowly dying trying to use CP on the Trinket M0 :-(
Future projects will use the Itsy M4 or Arduino... its just SOO tight on Mem.
@tough flax Even the M0 express boards are tough to use. It's nice that the M4s are available.
More than anything, I wish it was more predictable. More and more, I get through testing and its fine and then with zero change to code, it runs out of memory when connected to another machine (or even mine). When you get close, it seems very strange. And I don't understand why gc.collect() should stop it from running out of memory. Certainly when it runs out it tries to collect, right?
I have not been able to make sense of it either. Perhaps someone more Python proficient can comment.
Making a guess, but I'd say the GC is removing references to the memory locations, but not compressing used memory back into contiguous blocks. That's wild speculation; I'd have to go prowl through the interpreter code to know for sure.
I think of the M0 as a stepping stone in the development of CircuitPython..
Sidebar: I built a high-power rocket controller out of a Feather M4 and I still couldn't get all the code to fit. I haven't revisited, but I suspect I'll have to write C++ and cross-compile.
Yeah, it's a lot. Status lights (NeoPixels), barometric pressure, accelerometers, etc.
I'm looking at gc.c and I think what's happening is that it goes through the allocation table and if memory can be freed it's added to the finalizer table (FTB). I'm still digging through it, but it seems like if you're driving right to the edge the GC will actually run out of memory populating the FTB. In the Unix world, this would cause a kernel panic.
@drowsy geyser The other question is how memory allocated by CircuitPython works during execution of the CircuitPython program. That's unlikely to be relocatable. There was a way of looking at memory layout but it (micropython.mem_info(1)) was removed from CP to - wait for it - save memory!
Hmmm. I'll have to keep digging....
BTW, I've been building up a list of factors that affect memory in fourth post on: https://forums.adafruit.com/viewtopic.php?f=60&t=148334 - the biggest surprise for me was import order is very important. I just edited it a little to highlight the two examples of libraries where style of usage can affect memory use, audio and neopixels
CP's gc doesn't do relocation, because it uses a conservative algorithm for detecting pointers, so it's never sure if something really is a pointer
but it does keep the "long lived" and "short lived" objects separately, which is an improvement compared to MicroPython
@slender iron @tulip sleet I've got a CircuitPython hang that I've seen on 4.1.0 rc0 and rc1 if I leave some code running. Takes about ten minutes on a PyGamer to hang, it's not predictable but will do it on about one in four executions. The serial connection becomes disconnected but probably with no close and the CIRCUITPY becomes inaccessible. I left the PyGamer screen illuminated and that's almost same printed line as I see on serial out. I say almost because I get one extra line on the USB serial rather than screen which surprises me a little. If I reset it doesn't do that safe mode thing. I tried 4.0.2 and it didn't seem to do it but because this occurs infrequently I can't say for sure whether 4.0.2 is ok or not. I think this needs some debugging stuff I don't have to catch what it's doing...?
Is there value in having this on for all the M4 (and bigger) boards?
@simple pulsar Could you file an issue with the code in question? Also say what the host system is. Thanks!
finally slayed this Ansible dragon!!
rosie@rosiepi:~ $ sudo journalctl --since="16:03:00"
-- Logs begin at Thu 2016-11-03 12:16:42 CDT, end at Sun 2019-07-21 16:04:14 CDT. --
Jul 21 16:03:39 rosiepi systemd[5338]: Reloading.
Jul 21 16:03:43 rosiepi systemd[5338]: Started RosieApp as systemd Service.
Jul 21 16:03:46 rosiepi rerun[23366]: [2019-07-21 16:03:46] INFO WEBrick 1.3.1
Jul 21 16:03:46 rosiepi rerun[23366]: [2019-07-21 16:03:46] INFO ruby 2.3.3 (2016-11-21) [arm-linux-gnu
Jul 21 16:03:46 rosiepi rerun[23366]: == Sinatra (v2.0.4) has taken the stage on 3000 for development wi
Jul 21 16:03:46 rosiepi rerun[23366]: [2019-07-21 16:03:46] INFO WEBrick::HTTPServer#start: pid=23368 p
Jul 21 16:04:07 rosiepi rerun[23366]: 2019-07-21 16:04:07 - RuntimeError - Invalid JSON (A JSON text mus
Jul 21 16:04:07 rosiepi rerun[23366]: 192.168.0.19 - - [21/Jul/2019:16:04:07 CDT] "GET /event_handler HT
Jul 21 16:04:07 rosiepi rerun[23366]: - -> /event_handler
Jul 21 16:04:07 rosiepi rerun[23366]: 192.168.0.19 - - [21/Jul/2019:16:04:07 -0500] "GET /__sinatra__/50
Jul 21 16:04:07 rosiepi rerun[23366]: 192.168.0.19 - - [21/Jul/2019:16:04:07 CDT] "GET /__sinatra__/500.
Jul 21 16:04:07 rosiepi rerun[23366]: http://192.168.0.20:3000/event_handler -> /__sinatra__/500.png
I've experimented with ansible. I think it's pretty cool
it is. glad i already understood YAML (thanks Travis!). but the docs are...difficult at times. like all docs. why is documentation so challenging? ๐
oh, and this may be the better terminal result to outline the Ansible result:
PLAY RECAP ***********************************************************************************************************
localhost : ok=32 changed=6 unreachable=0 failed=0 skipped=4 rescued=1 ignored=0
Ansible is good for orchestration, less so for configuration management. Ansible can do something like configuration management with extra pieces, but Iโm probably heading back to puppet for the long term.
i wanted a pull system, and Puppet turned me off a little with the whole agent-master piece. ansible-pull allowed me to just have a github repo, install ansible on the target (an RPi), and run it. Puppet does look pretty useful though. and i imagine the linting/dry-runs are better since they wrote their own syntax. my yaml linter experience has been...saddening (ansible & travis).
@tough flax The ItsyBitsy M4 is really pretty nice.. and so tiny
It's cool to me because it has one 5v logic pin... which is great for Neopixels.
Yes, all good, but on some of these Iโm making 100 or so. So the trinket was cost effective
that adds up quick when you use 100 or so
Yeah, YAML isn't doing much for some of my coworkers. I've done more Ansible role development than anyone in the group, but for what we need, knowing that systems are in "compliance" is more valuable than being able to fire off one-off playbooks.
YAML is a bit too "forgiving" been using that with Salt, and it's been an issue a few times.
Wr're moving to Puppet for configruation management.
very psyched about this https://twitter.com/at_makers/status/1153075894749138945?s=21
Awesome update for the IntelliKeys Keyboard. Thanks to @ATIAorg's Caroline Van Howe, all the IntelliTools alums, ,@wernedat and the folks at @adafruit for all the help!
https://t.co/knDtcWfuKh https://t.co/wzVWyt0ynC
hi, just wondering ... for custom REST or websocket or mqtt connections ... is there any way to have an encrypted connection? all links I could find for circuitpython don't talk about it at all.
micropython does in theory support it, but not on esp32 or something
(but I could use esp8266 with circuitpython maybe, if it would support secure connections)
Websocket should support TLS?
@tough flax running collect before running out of space changes where the things after it are located and it cascades through the rest of the program's lifetime. running out of memory is a fragmentation game rather than actually a byte issue.
I've never found it that useful myself. Have you found it useful? Check out this stream of my memory debugging process: https://youtu.be/baa5ILZTRkQ
Not really! It was the first thing I found to look at memory but it raised more questions than it answered.
There was a discussion on discord (@ATMakersBill @deshipu @jerryneedell @hukuzatuna) recently about memory woes and how the programmer has little idea they are near the limit and very small changes or even deployments can cause the fatal MemoryError.
For posterity, here's what was coming out when I was looking at how memory was used as I ran bits of a program (on 3.0.2 on CPX):...
I've got a CircuitPython hang that I've seen on 4.1.0 rc0 and rc1 if I leave some code running. Takes about ten minutes on a PyGamer to hang, it's not predictable but will do it on about one in four executions. The serial connection (Windows 8.1 desktop) becomes disconnected but probably with no close (tapping a key in terminal window makes it realise the PyGamer's gone away) and the CIRCUITPY becomes inaccessible. I left the PyGamer screen illuminated and that's almost same printed l...
@tannewt, Does this still need fixing?
Should be NRF_TIMER3 and NRF_TIMER4
Powered on PyGamer today, left same code running for 2 mins, then copied a file off and that triggered a restart. That hung within about 10 mins too. Same serial output, the last line is only on the serial over USB not the PyGamer screen. My printed line of text per loop is a touch longer than the PyGamer screen width so each line wraps onto a new screen line.
@slender iron (and @tulip sleet I suppose): does that answer imply that there is no indirection in the addresses? I mean thereโs no way to move an item on the heap?
If so I get it, but if there is, shouldnโt the collect also defragment when memory is critically low?
@tough flax Writing a compacting (defragmenting) gc is hard, and is really hard right now because the gc in MicroPython/CircuitPython is not "precise". Some discussion here: https://github.com/micropython/micropython/issues/3792#issuecomment-393734390 and in the surrounding thread. The "long-lived" stuff we added allocates storage for objects that are probably permanent (compiled code) in one space, and allocates temp objects in another. That was a step toward less fragmentation, but not a general solution.
The problem is knowing what to move, what points to the object that's moving, and when it's safe to move. There's data on the stack that can be mistaken for an object pointer, but it isn't. If we mess with that data thinking it's a pointer, but it's not, we'll damage the data.
@fathom patio MiniMQTT supports SSL/TLS by default
@tulip sleet yeah thatโs what I meant about the indirection. One way other gc languages solve this is to have an allocation table that indirects each heap access. So if youโre reading someObj.value and someObj was allocated dynamically, youโd go to the table to get the current location of someObj before indirecting to .value.
It adds overhead to every memory access
and uses up ram
But solves the frag issue
https://github.com/micropython/micropython/issues?utf8=โ&q=is%3Aissue+is%3Aopen+compacting there was some discussion: see first issue in that list
will be afk in a few mins
Yes, I get the issues. I was just asking if it did it
we wish it did, but sadly, it doesn't ๐
And... it wastes memory. But in a way that probably gives more usable ram in the long term
we tend to leave core stuff to MPy so we can continue to pull from upstream
The more Iโm reading about men in cp; the more I think string processing is my problem
Reading configuration files, splitting, parsing, etc. all will allocate lots and thatโs evil here
it might help to make sure that once you know, say, that a variable holding a string is not being used, that you set it to None or something so that it's obvious it's garbage. ... ok, gotta go
@tough flax Hi bill - I had a few interesting ideas last night regarding the PyPortal ALS and wireless connectivity. Can PM or move to a diff channel if you'd like since it's too off topic for here
@tough flax yes, anything that allocates and free a bunch will make fragmentation worse
I think Iโm going to go to a python configuration file. No json and no .ini file. This is a bummer because Iโd like the same format in our Arduino projects
But oh well
we could improve the libraries to allocate less probably
For completeness, I did one without anything attached to the feather connector. Second run hung after 20 mins.
@slender iron We could also hack the GC code (looking at gc.c) to relocate blocks to contiguous memory, and maybe auto-trigger collect() after last object reference is removed? Obviously don't know enough yet, so perhaps speaking out of the wrong end of my body. Regardless, such a scheme would need to be opt-in because of the obvious performance hit.
for 1) when would you know to long live the memory and 2) we don't store ref counts so how will you know when the last reference is removed
Uh, yeah, good points. I was thinking back to the days on UNIX when the gc calls were added by the compiler on free().
๐ it's tricky but I'm open to ideas
Well, before I provide any more unsubstantiated wild speculation ๐ I'll finish groveling through the GC implementation.
it would be nice to be able to make audioio use a pre-allocated buffer, instead of allocating one every time you call play
this time you could allocate it at the beginning when there is still space, and re-use it
@stuck elbow audioio uses the array.array (without copying) you give RawSample if it's an "H" for dac output: https://forums.adafruit.com/viewtopic.php?f=60&t=150894
But I suppose that's only for one particular length sample so you can't really change it later without making a new array.array
@drowsy geyser I recommend watching the stream I did too
Live stream of @tannewt debugging memory issues in CircuitPython. Visit the Adafruit shop online - http://www.adafruit.com ----------------------------------...
@simple pulsar that's for raw samples, for wav playback it allocates internal buffers
@simple pulsar see https://github.com/adafruit/circuitpython/blob/master/shared-module/audioio/WaveFile.c#L114-L124
it makes games on ยตgame crash randomly too
Oh, do they get reallocated when you play a new wav file then?
@slender iron Yes!!!! I forgot about that one! I'll go back and watch (when I'm not at work).
Oh, we have a weekly call in 1/2 hour, yes?
BTW, is there any kind of watchdog reset in CP?
I'll be text-only for the CircuitPython weekly chat.
Ah, ok. Thanks!
@drowsy geyser I'm assuming there is one this week, but it's very far from up to me. ๐
@slender iron and @gilded cradle are probably people who can answer that question, maybe?
I assume there will be some comment in here, so I'll just chill for now. ๐
Yep, as far as I'm aware the meeting should still be happening.
This PR adds rudimentary support for the STM32F4 series. Supported features are REPL access over UART, and Microcontroller, Board and DigitalIO object support. Specify USB=FALSE when building.
Also includes minor additions to Main.c and supervisor files to add preprocessor exclusion of optional modules for early stage ports, and fixes a potential bug in the nrf port.
I'll be listening / text only
ditto
Same.
me2 ๐
@stuck elbow your mic is on ๐ค
Lurking
Audio is good.
Lurking today too, since I'm in the open office space, ostensibly "working."
lurking
Lurking
@slender iron I could, is there a link to the doc?
@drowsy geyser haha same ๐
PyOhio is July 27-28, 2019 in Columbus, Ohio! Kattni Rembor will be the opening keynote speaker!
https://www.pyohio.org/2019/
A speedier CircuitPython gets 10 out of 10 in the latest issue of HackSpace Magazine
https://hackspace.raspberrypi.org/features/circuitpython-4-1-0-review
Status and hug reports added to the doc.
295 - In the key of lime - Embedded.fm podcast -
https://embedded.fm/episodes/295
8/8/2019 is CircuitPython day!
Getting started programming microcontrollers with CircuitPython by NYC Resistor - August 3, 2019.
CircuitPython Day with the India Linux Users Group Delhi (ILUGD) at the Delhi Technical University for Women - August 4, 2019
https://twitter.com/ilugdelhi/status/1153305958690328576
Empowering developers by embedding Python
https://talkpython.fm/episodes/show/221/empowering-developers-by-embedding-python
My audio isn't working at all, but I updated the doc and will watch the recording later.
How to Add a New Board to CircuitPython
https://learn.adafruit.com/how-to-add-a-new-board-to-circuitpython
ok, @minor plume I'll read it off. thanks!
Scott Hanselman visits Adafruit!
https://youtu.be/nsnzgqR8-VI
THE HANSELMINUTES PODCAST Fresh Tech Talk from Fresh Faces https://www.hanselminutes.com/ Visit Scott's site, Twitter, Instagram: https://www.hanselman.com/ ...
It's a really good video
I have my mike working
๐
Lurking. Loving rc1,
no ๐ฟ !
Finished this yesterday. Future: add custom CPy board.
aww. but i like "chipmunk cater"... ๐ฆ hehe
Wii Nunchuk Library:
ttps://github.com/adafruit/Adafruit_CircuitPython_Nunchuk
<lurk mode again>
(you can just say "Phil" ๐ )
๐
@onyx hinge trying to run your audiopwmio code, but as soon as I enable the audio amp IC, it shuts down the system :/ something wrong in the schematic I guess
I really liked the style of the dragon done here https://www.thingiverse.com/thing:570345 by muzz64 and thought I would try my hand at making it flexi with both wings attaching with only pressure. The wings attached for me great and are very hard to take back out. I'm sure re...
unlurking
@errant grail If you have a spare 5 mins, I'd be interested if your Feather M4 board on its own exhibits the same strangeness I see with its analogue out (I used A0, A1 does the same) trying to make a high frequency square wave: https://forums.adafruit.com/viewtopic.php?f=24&t=153707
@simple pulsar will do. heading into the studio now and will report back.
Thanks team!
thanks all!
Thanks!
Thanks! cya.
@errant grail I have a custom board I'm trying it on, turning on the amp for the first time just now
@umbral dagger @slender iron im in meetin's for rest o day so please chatter together about the displayio screenshottin'
kk
Have a great week, all ๐
@umbral dagger if you are up for it you could try hooking python to fill_area
basically like this: https://github.com/adafruit/circuitpython/blob/master/shared-module/displayio/__init__.c#L66
BTW, is there any kind of watchdog reset in CP?
Nope, nothing that would cause that. There has been an issue of microcontroller fuses being set by accident that enable the watchdog timer, but that has a max of 32 seconds.
I was thinking more of something that might save the situation and give a form of auto recovery.
@simple pulsar Yes, using CPy 4.1.0rc1 on the Feather M4 Express, there's an 8-step staircase from 0 to max value under all conditions I've observed, both one-shot and continuous.
The stairsteps are a fixed artifact regardless of the value selected. Always 1/8th of the maximum, about 5us per step. No artifacts on the trailing edge (from max to 0). Trailing edge fall time is about 3us.
@simple pulsar Does that answer your question?
@raven canopy where is the total library count put?
@errant grail Very helpful, still puzzling what causes it. Perhaps it's a hybrid DAC with 3+9 bits but I'm hoping there's a fix to get a consistent, faster rise
It's confusing since the value change from max to min doesn't have a similar artifact.
Indeed
I wonder how CPy handles the normalization of the 16-bit value into the 12-bit DAC value. Haven't had the time or skillset to look under the covers yet.
The chip supports a 16-bit dithering scheme, too.
It has some filtering too and a current mode
Do you mind if I add your images to forum post?
Is there a lightweight/practical way to put a query into Microchip to ask if that's expected DAC behaviour on SAMD51? They might quickly say "yes, that's what it does" or "you want to change X to get it to behave normally".
16-bit dithering can be combined with Interpolation, as well. I'm getting above my pay grade with this...
Oh, I did wonder if 0 is a special optimisation in some way (grasping for an explanation of fall slew being ok) but didn't try other values for low of square wave.
Same here. Just cycled between 0 and a variable value up to 65535.
I'll try 4096 61440 later on
Could it be in the MicroPython source, perhaps?
Anyway, nice catch. I noticed the artifact when playing around with X-Y plots on the o-scope, but thought it was something related to signal noise.
... or issues with getting X-Y to work on a digital scope.
I have an outboard 12-bit dual DAC that I'll test tonight when back in the studio. It uses an "ancient" driver that pipelines raw 12-bit values to the DAC via I2C.
May not prove anything, but will at least give me a baseline perspective.
I believe the faint dots that jump around off the image on this x-y output is due to DAC: https://www.youtube.com/watch?v=kueA8iqVjBc
An Adafruit PyGamer board running CircuitPython 4.1 generates a spinning vector image and outputs this via the two onboard DACs to a Hameg oscilloscope in x-...
YouTube video includes dead link https://learn.adafruit.com/dac-oscilloscope-images/ to how-to page
^ nicely done. Can't beat X-Y on an analog o-scope.
@main meteor thanks, it's awaiting publishing, that video is currently unlisted
@slender iron about that idea of yours for disabling memory allocation -- how hard do you think it would be to be able to "sandbox" a fragment of code to a pre-allocated fragment of memory?
@slender iron so that it can allocate, but only inside that buffer you give it
I guess MicroPython does something like that with that emergency exception buffer for interrupts
@stuck elbow I think that'd be tougher than turning them all off
for sure
kk, I'm open to adding more useful memory debug info but I don't think mem_info is it. Maybe a histogram of free space length?
@slender iron sorry, didn't see the ping. total count is here: https://github.com/adafruit/Adafruit_CircuitPython_Bundle/blob/master/circuitpython_library_list.md
166 currently
kk perfect
thanks @raven canopy
@tulip sleet @ionic elk I think I usually grab the pip install line out of travis
I use brew to install python3 and then create a virtual env to install into
I used the travis install line but it hasn't added anything to the path. I don't have a virtual environment.
did you install python through brew?
yes
what is your $PATH?
did it output any info about other commands to run?
/Library/Frameworks/Python.framework/Versions/3.5/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/texbin:/opt/X11/bin:/usr/local/CrossPack-AVR/bin:/usr/local/bin:/usr/local/bin
if you try uninstalling something, like Sphinx, it will ask you to confirm the removal of files, and it will give their paths, so that's a sneaky way of finding what it put where. There's probably some pip info command to do that too
pip uninstall Sphinx, and then answer n
/usr/local/bin is very popular in your path
@slender iron is pip for python 2 on Mac?
@tulip sleet yeah, I haven't swept it in a while
maybe
try pip3 instead
I did install with pip3. I'll try the uninstall trick
you can reinstall python with brew to see if there is anything else you need to do for it
@cerulean pawn oh no!
@slender iron are you familiar with the bash clinging to old paths after a brew uninstall? -bash: /usr/local/opt/sphinx-doc/bin/sphinx-build: No such file or directory
@ionic elk, have you closed all bash instances, and started a new one? i imagine mac-bash works the same that the $PATH isn't updated on the fly...
@raven canopy EYYY I didn't know that! I guess I haven't done enough $PATH shenanigans.
$PATH shenanigans are the most funnest. /s
I don't think it is an issue if mp_arg_parse_all is used. I do believe there are issues within shared-bindings still. It should be easy to check, try passing a kwarg that has a weird name should error out.
I glanced at a few APIs and didn't see any issues. Fuzzing might be the easiest way to find these issues.
Unfortunately, I'm now having another issue: ImportError: cannot import name 'TYPE_CHECKING'. My python 3 install is up to date so it shouldn't be having this issue. Do I need to manually specify for Sphinx to use python 3?
ah, I always open a new terminal after updating PATH
@slender iron do you still have the old default of python 2.7 on your mac? Or have you moved everything over to python 3 now?
Apparently I have python3 on my mac that has not been installed with homebrew. That's fun.
ya, it's tricky to have everything jive together
I'm not even sure how to update it?
It's 3.5.0, so that might be causing the issue with type_checking
is pyenv available for mac? i recently used it, and it does help with the multiple version stuff... looking for mac-ability
@kevinjwalters Do you have a jlink? We could get you one. Just email me.
pyenv has a homebrew: https://github.com/pyenv/pyenv
probably not worth it if you won't spend much time in Python land though
I see, I must have actually used the python downloadable installer way back. I've actually got an app for it in Applications.
Has anyone had that on their machine before? I'm concerned that just trashing it from the applications folder will cause some issues
i have no Mac experience. cannot assist. ๐ฆ
@ionic elk I think that delete it from applications is the way to go
Had to also delete the Library/Framework files but now I think I'm set! It's returning the proper homebrew version
OK, finally working. thanks for the help @raven canopy + @slender iron
great! nice job
๐ yw
@prime flower next time you change the tinylora constructor I'd recommend using kwargs for the pins. kwargs make it easier to add args without breaking the api
The "approved way" to remove the app is to open the Launcher, press and hold the app icon, and then press the little X when everything starts jiggling. Then you can re-install.
But hey, if it's workin'... ๐
@slender iron Good idea - will do for the next library I write/going fwd.
or the next time you need to break the api ๐
after an hour+, i'm thinking that trying a 64bit kernel/os on the RPi will be easier than trying to build gcc-arm-embedded from source. ๐
are you trying to compile it on the pi?
yep
i knew it was going to be a slog. all of the previous "cheats" are void though, since they're like 5 years old.
How to build GCC 9 as a cross compiler for Raspberry Pi
๐ค this is why we do this right? because of all the fun thought exercises. hehe. ๐ฝ time...
I don't think this needs to be converted to a list. The for loop below should still be able to loop over a set.
Thank you for doing this!
I think we should either add the boards to travis if we want to keep them on the downloads page or delete the board def if they aren't worth it. I'd choose to just add them for now. We'll need to speed up the build regardless of whether we build these four extra boards.
Also, did someone manually stop the last test job? I'd hope that the rest of the build continues if this test fails. It's important to find as many failures in a single build since they take so ...
if missing_boards:
Empty lists and empty sets are False by default so the check can be simplified.
Would you mind moving stm32cube to a submodule? It's a ton of files and makes it hard to know what to review. Here is an empty repo you can use: https://github.com/adafruit/stm32f4
It's great to support so many kinds of displays now!
6797ec6 Add support for grayscale displays that are < 8... - tannewt
e4611b6 Update translations - tannewt
cdfc169 Correct typo in line meant to turn off frequenc... - tannewt
b9b9ef2 Turn off bitbanging on Hallowing to save code s... - tannewt
1d1b870 Review feedback including NO_BRIGHTNESS_COMMAND... - tannewt
Isn't this file autogenerated? Should it be in .gitignore?
Sorry it took so long for us to review this. Here is some food for thought.
Kinda feels like we need a better way to describe classes of boards and their support.
For local (or both?) could you go one step further and have conf.py generate the json?
I'm not sure I like the negation of this because it's now unpleasant.
Regardless of the negation, the listing would be simplified by combining a set of boards into a standard group that could be listed below the table.
@tannewt we should make a folk from this repo https://github.com/micropython/stm32lib which is used by micropython. This will make thing easier to merge/push to micropython.
Hi, there's a sys.exit(1) in case of any missing boards, if it's more convenient we can only print the missing board and let the tests continue. May @sommersoft or me continue with the fixes?
I'm not sure I like the negation of this because it's now unpleasant.
I do not disagree at all.
the listing would be simplified by combining a set of boards into a standard group that could be listed below the table.
I remembered that Dan had mentioned several moons ago that he wanted to get away from a Cartesian type map, as well as move towards a exclusion based system. Its just difficult with rST/Jinja to do non-table-Cartesian (for me, at least).
Grouping shouldn't be diffic...
Definitely doable. That would actually allow dropping use of a file altogether. Wish I would have thought about that... ๐
Also, did someone manually stop the last test job? I'd hope that the rest of the build continues if this test fails. It's important to find as many failures in a single build since they take so long.
That's on me. I recommended that this be placed in the before_script section. Ironically, for the same reason that builds take so long. Ostensibly, after this initially merged, the only time a board will be missing from TRAVIS_BOARDS is when one is added. I felt its better to fail fast o...
I was having some trouble playing wav files converted using ffmpeg, turns out it adds some extra RIFF fields by default, needed to add flag '-flags +bitexact' to the commandline like ffmpeg -i input.wav -flags +bitexact -ac 1 -acodec pcm_s16le -ar 22050 output.wav, maybe it can be documented somewhere on https://learn.adafruit.com/circuitpython-essentials/circuitpython-audio-out ? without this, it results in ValueError: Data chunk must follow fmt chunk
that's why I always use sox instead
I only use sox where I go outside on cold days during the winter.
just remember to remove the presents
@slender iron I'm looking into the fill_area code... the use/purpose isn't completely clear.
@slender iron Also, screenshots. I got the impression you have been giving that some thought?
@umbral dagger fill_area is what computes pixel values for a portion of the screen
aka, screenshots
@slender iron OK, so it'd be used to generate a screenshot
got it.
It all makes sense now
right, so if you call that with a buffer it'll fill it in with packed pixels in the display's format
I was thinking of it as going the other way (filling an area with a color) and trying to get it to make sense.
Cool.. time to charge forward.
It could maybe be named better?
"extract_area" ?
Off to a dr appt and lunch now. But I'll dive in when I get home.
Who takes on creating the new branch? I don't see that as an option for my PR.
I originally avoided the micropython stm32lib repo as it is 2 years old. However, I didn't run a comparison, and there may simply be no changes to the HAL/LLs since 2017. I'll check compatibility and swap over if there are no problems.
In the meantime @tannewt if you add me as a contributor on that empty repo I'll move everything over.
I'm seeing new files like hal_exti.c which are from 2018, which micropython does not include in their repo. Do you still want me to fork that, or should we just stay separate?
@onyx hinge ping me when you are around and let's brainstorm on the nrf pwm pr. I'd like to get the naming settled before merging. I think we'll want to split AudioOut from audioio too so it matches audiobusio. Maybe @simple pulsar has naming/restructuring ideas too.
@ionic elk the micropython stm32lib does look good
@slender iron I tested it just now and it's got a lot of missing/out of date files
we can fork and update it
it's already together in one place
oh, wait
st is moving stuff to github
isn't that nice
so I say, use the repo I just made and we'll switch to a fork of STs repo when it's out
@hathach I agree with @hierophect and would prefer to use newer STM32Cube APIs. I doubt we'll ever push our STM code back upstream.
It looks like ST is starting to make repos for the code so we should switch over to a fork of theirs when it's available. More info here: https://github.com/STMicroelectronics/STM32Cube_MCU_Overall_Offer
Also, these changes should go straight to master. It's okay to have partial support on master. Using multiple branches for ongoing work makes it hard for t...
@ionic elk which nucleo boards were you trying? don't some of them have usb plugs for the native usb?
hey @slender iron I'm trying to bring up a new board; got the uf2-samd bootloader flashed apparently successfully (jlink didn't compain) however double tapping reset does not cause a BOOT drive to show up. Instead when I give a double reset I get this in dmesg:
795376.971824 AppleUSB20XHCIPort@03100000: AppleUSBHostPort::disconnect: persistent enumeration failures
what kind of board is it?
It's a custom board, most similar to an itsybitsy m4
ok, so samd51
ya
does it have any status leds?
no ๐
it has wiring for a dotstar but I haven't hooked one up yet as it's on a header
try using gdb to see where it is in the bootloader
will DEBUG=1 build it with symbols?
apparently yes
@slender iron
Program received signal SIGTRAP, Trace/breakpoint trap.
0x000015b4 in main () at src/main.c:209
209 led_tick_step = 1;
Using an Adafruit Ethernet FeatherWing with a Feather M4 Express, without an ethernet cable attached causes the REPL to become non-responsive. The second time, after resetting the board, it caused a crash and the repl printed that it crashed into the HardFault_Handler.
The feather is currently unable to switch back into CircuitPython, only the bootloader.
Code:
import board
import busio
import wiznet
import socket
import time
spi = busio.SPI(clock=board.SCK, MOSI=board.MOS...
@pastel panther if it looks like it's working and usb is having issues I'd check the soldering of the usb
hm, ok
you could use a beagle to see what's happening if you have one
I do not
@slender iron whern you say "it's working" you mean the bootloader? Does the fact that I'm seeing enumeration issues on the computer narrow down anything?
ya, I mean the bootloader for its working
you could set a pin as a bootloader led and use a scope to see what it's doing
what would that tell me? That I couldn't theoretically see from stepping through with gdb?
@slender iron The Nucleo 144 board layout does have a separate USB port. However, it doesn't allow the board to be powered off of it, requiring external power either through VIN or the STLink USB (to be fair, so does the DIS_F411, which is equally irritating). I also couldn't get any of the baseline CubeMX USB stuff working for it as a control, and it has none of the extra features of the DIS_F412, so I just dropped it for now. Figured we could revisit later
The 144 board layout only supports the F412 and up, too. The Discoveries are just way more capable for those boards, for a fairly comparable cost.
@ionic elk ok cool. I just picked up a couple nucleo's as well. excited for the progress you are making ๐
@pastel panther similar but you don't need to break with gdb
this can be the adafruit fork right? I added you as a collab and you can push directly.
I'd suggest renaming these board folders to something like "stm32f411e_discovery" so that it's clearer what board it is exactly. Having stm32 in the name helps make it clearer that it's an ST board when looking through the full list of artifacts.
I wouldn't do this because it'll make it easier to not commit important tinyusb changes.
Making progress! Looks like there are a number of files leftover from the nrf port in common-hal and peripherals that should be removed. Simplifying this new directory will make a good baseline for a skeleton port that other ports can start with.
@slender iron is there info somewhere on what the led behavior would be? My wiring seems fine, as far as I can tell. There is continuity from the cable to the pins ๐คท
fast fade means its alive but unable to connect to host
@slender iron @simple pulsar I'm home just briefly but I should be back around 8PM US central time for at least an hour or more.
kk, np @onyx hinge
I feel like with some suggestions and feedback I can get back on track with nrf-pwm-audio. It looks like I need to
- factor out the sample part of audioio so that it can be shared
- this might just be arranging to build Mixer.c, RawSample.c and WaveFile.c either when AUDIOIO or AUDIOPWMIO is enabled
- and then making them appear in the globals of both modules
- but would it be better to rename it to make the sharing clearer? -- _audiocommon?
- copy
shared-{bindings,hal}/audioio/{__init__,AudioOut}.[ch]to audiopwmio - rename a bunch of symbols, header guards, etc
- rename nrf's audioio to audiopwmio
- supporting makefile stuff, which (aside from the code sharing) should be straightforward
I did start this and got bogged down in exactly how the makefiles select source files to include; but I do have substantial experience with GNU make and will be able to understand it once I take the time.
If you think this sounds like what you envisioned, that's great. If not, please point me in the right direction.
ya, that's the right track. we'll want the common or core audio bit to be public api (no _). I can help with the makefile stuff too
So ultimately, on nrf, you want this line to work:from audiopwmio import RawSample, AudioOut
but on samd it's from audioio import RawSample, AudioOut
and maybe in some future board, both lines would work, and get you two different sets of independent audio functionality?
and in that case audioio.RawSample is audiopwmio.RawSample
Is it OK to continue organizing all this work as a single pull request?
(right now my hack gets you the first two things, but it does NOT chart a clear path to having both at the same time; in fact, it creates barriers)
@onyx hinge @slender iron My perspective here would only be that of a user of the python apis as I've only looked at bits of the c code and don't have a good grasp of exactly how they all work together.
BTW, does the nrf hardware have the DMAC feature (like SAMD have) to be able to write data continuously "in the background" to the chosen D pin?
@onyx hinge RawSample should live in a module different from AudioOut
@simple pulsar I am happy to hear your perspective. Yes, audio plays in the background, same as on SAMD
(nrf calls the feature "easydma" but I'm not sure whether it's actually easy)
Oh, very cool.
hi @onyx hinge, I tested a bit with your branch, quality wasn't so great with my audio circuitry, but I am getting sound but possibly wrong sampling rate? I'll try getting pure sine wave to compare tomorrow maybe.
@cerulean pawn what is the original sample rate of your audio file? Do you think it's a little wrong, or extremely wrong (such as twice as fast / twice as slow)?
@onyx hinge Are you familar with Soulsby Synths? I believe that is purely PWM output on humble arduino-esque hardware
I did some simple testing where I started playing my wav file at around the same time with vlc and on my feather, and it seemed "close-ish" to me
22050Hz, a little wrong maybe, but that's just by hearing a not so good speaker
I think he has an analogue filter to give it a thorough clean though
@slender iron OK if you want it in a new module that doesn't exist yet, what should the module with RawSample, WavFile, and Mixer be called?
might not actually be wrong, that's why I said I'll test with a sine
@onyx hinge that's the question. audiocore or audiocommon maybe?