#circuitpython-dev
1 messages · Page 258 of 1
It's working well enough that I can tell whether I recorded "eeeeee" or "aaaaaa" sound of my voice
samd you need to setup the whole i2s kit
ok it just pipes back the sample for you then?
but the audio level is low
oh thats normal
you need to boost the gain
its not going to be 3.3Vpp 😄
its like 0.5Vpp
PWM audio out too
you should get like +- 1000 value
PWM output you can easily measure to see whats up
eg pwm out a triangle wave, see the wave output
it did seem a tad quiet
but only like 50%
in a "quiet" room I am getting a variation of ~1600
if that
and when I make a loud noise with my voice I get a variation of ~5000
mm in a quiet room there should not be much variation at all
how are you setting the decimation
or is that done for u too
I think that's the RATIO register
can you plot the output with mu or other plotter
sure, let me see what I can do
hm this machine doesn't have mu yet
I can install it rq
are you running this within circuitpy
also i have the fresh new CPB - i could test it 🙂
🤤
so here's a question for you. If I hook the DATA pin to GND instead of to the mic, shouldn't I get an unchanging sample value, because it will always read 0 bits in?
no, that does not happen 😕
what numbers is it givin ya
well thats interesting
yeah i recommend getting the plotter going
so you can see in realtime
note different horizontal (time) scale
so there's still some sort of transient going on(?) but there is an audio signal on top of it
yeah DC offset changes, thats not unusual
it looks ok actually
please try mu - that way you can get realtime plotz
then get an audio generater website up
and sweep some tones
while you check the plotter
you think that's from the mic, or from the nrf?
(samd peripheral does nothing)
if you are tying DAT to GND, and you get that blue curve, its either a wiring issue, or someting in the nrf
its not bad tho
I am "enabling" and "disabling" the NRF periph each time mic.record is called, perhaps that's a mistake
could try without
samd does nothing for you, so we track the DC change by hand - the nrf might be trying to 'help' you
let me see, I did that because I didn't want it to DMA somewhere unexpectedly, but I can just allocate a 4 byte static buffer
the schematics for both the trinket_m0 and the PyRuler show a JP3 and JP4 header -- They don't seem to be on the actual boards -- what are they?
those are the side pads
doh!
@onyx hinge if/when you want, if you build me a CPX UF2
i can try some of the existing demos we have
😳
@meager fog oh that reminds me, I think I found a bug where RawSamples always loop on nrf. 😦
theres a lotta lil bugs in nrf
we'll squish them over the next few months - i still get some hardfaults
OK, I'll look.
but yeah - you'll need to boost the gain
for now, I guess I'm reassured that the audio levels are not unexpected and I have a direction to try to work on the transient / dc offset problem
there is a register for gain setting, but no way for the user to set it through the current Python API. Would you want a static value chosen to suit the CPB / this breakout?
or do we need to go full AGC or extend the API?
okay, I may just hard-code a non-default AGC value for myself for now
I appreciate you taking the time to make sure I wasn't completely off track
OK, well, I pushed what I currently have -- very incomplete -- to https://github.com/jepler/circuitpython branch nrf-pdm-audioin
if the board def was merged, I could build you a firmware for cbp(le) but I think it's quite premature at this point
great, I may have a few more updates for the monday meeting, otherwise I'll be putting in little bits of time every evening this week and then another block next weekend
gr8, check out the existing pdmin demos
ill say they're minimal, the '21 wasnt fast enough to do much
It looks like just continuously recording is not possible with the API
the 840 isnt much faster, but you don't have to decimate so i think we have more process time, also its an m4
soooo maybe
yeah there was no chance of that so we didnt add it
nods
not sure what you would do with the data anyway
doing arithmetic on every sample from python is not going to get you much, no darth vader voice for you
yah its for sound sensing, not sound recording
dunno why the '840 has so much flash/ram but anemic on speed
OK, yes, when I leave the peripheral active the whole time then I get a variation of 75 for a quiet room, and ~600 for me saying "eeee" from 2' away
4000 from me saying it from 2" away
I have been unable to update a class's instance by changing it's _ dict _ attr is this bug or space saving measure?
@marble hornet the latter, I think
ex:```class oneoff_module():
def __init__(self, file_path):
namespace = {}
exec(open(file_path, 'r').read(), namespace)
print(namespace)
print(self.__dict__)
self.__dict__['v'] = 5
self.__dict__.update(namespace)
print(self.__dict__)
x = oneoff_module('foopy.py')
print(x.v)```
prints 5 in cpython but not cirpython
@onyx hinge any suggestions to get around it?
I assume this is the error you get instead? AttributeError: 'dyno' object has no attribute 'v' (except your class name is different)
def __init__(self):
setattr(self, 'v'), 5)
print(self.v)
x = dyno()
print(x.v)
``` this works for me, prints 5
hrmm, okay, so: for name in namespace: setattr(name, namespace[name])?
which is similar to has has been posted a few days ago
thsi is the kind of thing that MicroPython does to save time and space, similar to http://docs.micropython.org/en/latest/genrst/core_language.html#user-defined-attributes-for-functions-are-not-supported
cu
i think this also works if a bit odd, my one concern would be that classes can be long lived and the b=goal is to make a destructible object.
class app_module():
exec(open(path, 'r').read())
return app_module```
tested it seems to work i can access attrs
@tulip sleet thoughts?
I haven't looked at this in detail: are you still trying to re-import modules?
are you doing this for workflow reasons or because your program wants to pull in new code and throw out old code?
yes, i want to keep stuff in memory until i need something new and am out of memory
then get rid of old stuff
I would just say that in general Python and the MicroPython VM does not try to make this easy. It may seem to work, but there are dangers about trying to throw out existing classes, and we haven't tried to make sure that it cleans up properly.
@marble hornet I would really recommend doing a soft restart instead, maybe saving some state that you need in the nvm
then you are guaranteed things are in a clean state
doesn't matter, really. microcontroller.nvm will be easier because you don't have to make the filesystem R/W. Just don't write to it excessively. Maybe check to see if it's already in the state you want before writing: don't update continuously
kk
I know it's fun to try to mess around with Python's low-level language mechanisms, but what MicroPython (and therefore us) do is not that well-defined, and isn't meant to follow the CPython semantics or even necessarily be the same from release to release. The import code and the gc code weren't written with unloading modules in mind. I'm sorry if you've spent a lot of time on this.
i haven't spent an inordinate amount of time,i guess i;m just looking for a way to memory (ish) manage in a language that does that for you
thank you for the advice
I don't know if I know enough to answer but we can try
so i'm making a new module but wants data to persist through reloads
however i know modules have an init file, is that called on every reload or on every bootup?
a python module?
yes,
I'm not sure
kk, thank you anyways!
I think maybe the init file is loaded on import
kk
but yeah I'm no expert, I just have a recursive grep tool that let me search for where mp_obj_t is defined 😅
Hello everyone, I recently ordered a pyPortal. Just wondering if there is any way to implement threading.?
micropython has a rudimentary threading, you might be able to get that working. however it was disabled in cirpython 1st to save space and secondly to keep it simpler for beginner makers, and advanced makers too
@high oracle i do not know if it just needs to be turned back on or it was removed manually form the source code
@T@marble hornet I went to the github repo, but was unable to find any preprocessor for that
This will cause the hardfault_handler to be called
import time
x = time.time()
x = x*1.0
y = time.localtime(x)
@high oracle let's switch to #help-with-circuitpython
@exotic pumice do you remember where modules are added to a macro so they can be accessed by name and such
?
not sure what you mean
I can confirm this on the following software/hardware combination: Adafruit CircuitPython 5.0.0-alpha.0-189-g85d739847-dirty on 2019-08-17; Adafruit PyPortal with samd51j20
time.localtime(1.0) seems to be enough to cause the fault.
Thanks @pastel panther... I'll connect with @prime flower regarding AWS...👌
It turns out mp_obj_int_get_checked is not appropriate to call when
the argument is not of int or long type--the "checked" refers to guarding
against overflow/underflow, not type checking.
For compatibility with CPython, handle float arguments.
Closes: #2069
Testing performed: time.localtime(time.time()), time.localtime(), time(1.0*time.time())
- Generalize the nRF "charge up pin" touchio implementation so it can be used by all ports, and move it to
shared-module/touchio. - Turn on generic
touchiofor SAMD51. Now all CircuitPython ports havetouchio. - Add
CIRCUITPY_TOUCHIO_USE_NATIVEflag to indicate whether to usecommon-hal/touchioorshared-module/touchio. Because SAMD21 has a native implementation, but SAMD51 does not, it was difficult to do this automatically, using, say, weak references. The lists of source dire...
Thanks for the fix! Can you just always use { } even for one-line if's?
whee, with a few tweaks, the sound meter demo works on nrf
I'v traced through the execution of the with the J-Link and I just don't see what is going wrong. It appears to be attempting to set the color, but the writes are having no apparent effect. The face that it works on the Trinket_M0 but not on the PyRuler makes me wonder if the problem is related to the extra pin definitions on the PyRuler. Is something causing a conflict with the initialization or execution of the writes to the SPI bus at this stage. It works later in the REPL, but not doing t...
Automated Libraries update for 18-Aug-19
@marble hornet @exotic pumice init.c is used to store module level functions rather than those associated with a class within a module which end up in a file with the class name.
I tested this and it works with the RGB BLE example (server and client: two boards). I am seeing about 42KB of extra space.
It's possible the -flto-partition=none is the key, but I don't know. If it stops working again we can always turn it off again.
Thanks for being persistent about experimenting about this.
I will look at the build times and re-balance the Travis jobs after this finishes, and then submit a PR for that. @tannewt is working on GitHub actions to use for CI instead of Travis, but until that is done we could increase the number of jobs to 6 or 7 for now.
Oh I thought we were talking __init__ in Python
This PR adds support for nrf boards that don't have an external crystal.
This was tested using a modified version of ble_demo_periph example from Adafruit_CircuitPython_BLE
on a custom board without an external crystal and on a Particle Xenon (which has an external crystal).
Hi, I'm looking to use the Feather M4 Express and Ethernet FeatherWing as a way to collect I2C sensor data with Prometheus and threw together a very small HTTP server for that purpose. It works pretty well with light traffic, but if the socket.accept waits too long for an incoming request, the board seems to fall off the network and my code soft-reboots without raising an err...
First try: group by category. Ten jobs, which seems like too many, but let's see how long each one takes to run.
I do have one substantive change request, based on a quick scan of the datasheet. (If you found that following the datasheet didn't work, then a comment to that effect would be very helpful)
There are some tiny style items I've also noted. If you could add an additional commit to address them, that would be great.
Indentation seems slightly unusual here, consider reindenting.
hmmm, https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s140.api.v6.1.1%2Fstructnrf__clock__lf__cfg__t.html states that accuracy "Must be 0 if source is not NRF_CLOCK_LF_SRC_RC."
I would have written 'return BOARD_HAS_CRYSTAL;', so that any nonzero value is interpreted as TRUE.
Also, it's probably a bug if BOARD_HAS_CRYSTAL is not defined for some boards, so maybe just use BOARD_HAS_CRYSTAL directly, not via #ifdef
This is actually copied from the SAMD port. I thought it would be best to follow existing code.
I can change this and i think the same change should be done for the SAMD port.
I have gemma_m0 that I can now connect to my J-Link, but as in #2064 I am not seeing any obvious reason for the strange behavior. The values sent to the LED appear to be as expected, but the LED is not responding as expected.
Let me know if you have some particular section of code you'd like to see details from.
I don't see that accuracy needs to be 0 i only see that rc_ctiv and rc_temp_ctiv need to be 0.
Anyway the source in this case is NRF_CLOCK_LF_SRC_RC so this is legal. This specific config is also being used in the Adafruit nrf52 bootloader and according to the documentation these are the recommended values for this configuration.
Could you please elaborate.
It seems okay in my editor.
im impressed it works cause we haven't done any ethernet projects yet :D @nickzoic added it so will know the most. we're mostly supporting networking with esp32spi https://github.com/ladyada/Adafruit_CircuitPython_ESP32SPI
I think I'd like to remove trinket_m0_haxpress, feather_m0_supersized, and feather_radiofruit_zigbee from regular builds. @dastels, comments on the first two? @ladyada zigbee board is not a product?
@dhalbert will the still be available for manual build. That is, will the board definitions remain in the repo?
@jerryneedell Yes, I just am not sure there are many physical instances of these in the real world. Do you have some?
I have a feather_m0_supersized, but I'm fine with it not be part of the build process. As long as I can build it myself.
Also, if you want to stop maintaining it completely, that is OK with me - Jus t so I know to keep what I need to build it locally in the future.
@solar whale I am trying to reproduce the Gemma M0 and PyRuler problems. I don't have a PyRuler, but a Trinket with a PyRuler build doesn't act odd on my Macbook. The Gemma also seems OK. I am using a simple USB-C to USB-micro cable: no hubs or anything.
are you using some kind of hub?
regular MacBook with a single USB-C port, running 10.14.4
I can't reproduce this with a couple of Gemma M0's with latest master. Looks the same on MacOS or Linux. I tried an older Gemma M0 and a PyCon 2018 one, which has a dimmer DotStar (the mfr changed them), but they are still just pulsing green
Is this strangeness on only MacOS or do you see it on Linux or Windows?
Is there an interposed hub or similar thing interposed between the board and the Mac? Have you tried a straight connection?
So far, this supports only 16kHz and 16-bit samples with a fixed gain. This is enough to support the basic functionality of e.g., sensing ambient sound levels. Stereo support is coded but untested.
Testing performed:
- all tests performed on Particle Xenon with PDM Mic Breakout
- recorded and played back short samples (using PWM Audio Out)
- adapted the "playground sound meter" program (using a NeoPixel stick board)
Additionally, @ladyada reports "tested this and it works great ...
@onyx hinge so no filtering needed at all, huh? Very nice peripheral.
@tulip sleet yeah there's no hard math required
there would be if sample rates besides 16kHz were required, perhaps
I am out for dinner but will merge this after the build complete successfully. Thanks!
cool, thanks for the swift attention!
:( failed, do make translate and re-push
I'm confused by your statement - NRF does include both heap and ram end. They seem like fairly standard and useful variables to include even if they are not currently used. But I can remove these if they're truly not needed.
CircuitPython community meeting tomorrow at 11am Pacific / 2pm Eastern here in the Discord voice chat. All are welcome to attend. The notes doc is here: https://docs.google.com/document/d/16nsp4_ess3BlQQjJ75LQ1ImaGmmtdklNQmK_OJgWF2I/edit?usp=sharing <@&356864093652516868>
I don't have one of the esp32 wifi wings on hand right now, but will look into picking one up, at least for testing. Are they strictly wifi, or is it possible to solder on an rj45 port? Not sure all the final locations for these sensors will have strong wifi signal, and I was hoping to use PoE splitters to power the boards from a single switch.
Not sure if this is related, but on some further testing, excessive load seems to also confuse the socket after a while. Something like this:
...
Agreed, see replies to Scotts comments below
the esp's are def just wifi
For now, I've changed the flag here and in the mpboardconfig to USB_CDC_AND_MSC_ONLY so it's more descriptive of what this actually does. I think it's worth exploring whether we want to go more modular than that in the future.
I thought it was more complicated than just a module. Wasn't even enabled anyway! Removed.
I ran into some issues trying to switch between transparent and colored fills for some buttons I was using in a recent project.
Once a shape is created with either fill=<SOME_COLOR> or fill=None, the shape will act as either a filled OR transparent shape and cannot be changed.
The issue appears to be related to the Palette core module in displayio, and the symptoms show up in Adafruit_Display_Shapes as well as Adafruit_Display_Buttons.
It seems like the intent is to allow shape...
The following seems to suggest that the time.time() function passes time faster than time.monotonic
import time
sleeptime = 300
monotime = time.monotonic()
clocktime = time.time()
print('starting %ds wait' % sleeptime)
time.sleep(sleeptime)
monotime2 = time.monotonic()
clocktime2 = time.time()
monoElasped = monotime2 - monotime
clockElasped = clocktime2 - clocktime
print('Mono elasped %f\nClock elasped %d\n' % (monoElasped, clockElasped...
Wait, actually, the initial attempts to change the fill color when the shape is transparent should work, as well. Not sure what I was thinking there. It's the same function call. Sigh...
time.monotonic() counts 1ms clock ticks but due to interrupt handling it can miss some. time.time() uses the on-chip real-time clock (RTC). We are going to make everything use the RTC, so we can do real processor sleep, at lower power, but we haven't done that yet.
Same issue as #876.
Thanks that makes sense. So then it is probably a coincidence that for my PyPortal the time.monotonic() seems to keep almost perfect time with respect to the atomic clock and time.time() runs quite fast.
It's some kind of problem with the way I'm using the nrf's PWM module. It may also affect short WaveFiles; I haven't fully characterized it yet. If I don't get it solved soon, I'll add a reproducer script here in case somebody else wants to take a crack at it.
I read the infocenter information wrong, thanks for correcting me.
In the view here in github, ".source" is directly below "clock_config" on the previous line, I would expect it to be further indented. (however, in this view, the line I'm talking about is cut off)
The SAMD51 chip has a bug: the main clock that we're using (DFLL48M) cannot be locked to the crystal oscillator on the board. So the accuracy you're seeing is probably accidental.
@tannewt the build time for the first subjob went to 1.5 hours after I accepted the -flto merge for nRF52. I rearranged things to this. Would you be willing to accept this for now to get the jobs more balanced again (and shorter) for now until GitHub actions is working? Here's the latest build: https://travis-ci.com/adafruit/circuitpython/builds/123654081. There's a short test-only job, a shorter nRF job, and the 5 others are similar to before. So not just 5 like before, but still some empt...
My apologies -- apparently this sia HW issue with a single Gemma_M0 -- I just tried a another one an it works normally. Closing...
@jerryneedell Did you have another Gemma to test, or are you just going by my tests? It's possible there's something weird with the host USB timing or some such.
@dhalbert I assume you are referring to the initial enumeration issue and not the magenta LED. I see taht on a Linux system. Do you see the same behavior? Should that be a separate issue?
I tried it on another Gemma_m0 and behaves normally.
@jerryneedell I don't have a PyRuler (yet), and my indirect testing with the Trinket M0 hasn't been able to reproduce this. Do you see enumeration issues or just the color issue? If you and @siddacious both see the magenta issue, that's odd, but I'll have to wait and see how to reproduce it.
This behavior is very different from the issue on the PyRuler as well. The faulty gemma m0 flashes wildly for some time then pulses for awhile then flashes again.... If I can reproduce it, I'll re-open this.
OK -- I have not been able to reproduce it on a Trinket either -- even with the same build.
also trinket build does the same magenta on the PyRuler.
@tulip sleet thanks for looking into the dotstar issues -- I'm ok with closing the gemma and looking more into the PyRuler -- but now -- I'm off to bed! Goodnight.💤
Maybe @siddacious can put a Saleae on the DotStar data and clock.
It's certainly weird. I'd expect more trouble with NeoPixels than DotStars.
@solar whale thank you as well! good night!
Great, thank you! Will merge after Travis is happy.
aargh, conflicts, you'll have to merge from upstream, then make translate
I'll check back on this in the morning.
I have a sales but how can I get at those signals?
very careful tack soldering, I think, or looking at the board and scraping away solder mask from vias.
Bleh, still says "missing message ID". The .po files are very re-ordered: maybe the merge didn't work out that well. Also, what version of xgettext are you using? Mine is:
$ xgettext --version
xgettext (GNU gettext-tools) 0.19.8.1
...
Maybe take the content of `locale/*` wholesale from upstream, and then do
make translate
make check-translate
since it's `check-translate` that's failing.
@tannewt Maybe we should make `make check-translate` be part of what...
hmmm -- looking closely at th malfunctioning Gemma_m0 I can see that the green LED in the DotStar is actually pulsing as expected, but the blue is on steady and the red intermittently starts to flash on/f very quickly. It does look like a HW issue with this board/dotstar. I tried pressing on it, but no change. If I get brave, I may try replacing it. For now, I'll move onto other problems ....
I'm on debian stretch x86_64. ```
jepler@babs:~$ xgettext --version
xgettext (GNU gettext-tools) 0.19.8.1
$ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
@jepler if you are willing to review this now we can speed up the builds before @tannewt wakes up :)
I semi-manually checked that the list of boards is the same "before" and "after", and didn't spot any differences.
@tulip sleet I am at a loss for the "make check-translate" problem, it passes locally. 😦 clearly something different between my dev environment and travis.
and I have to go AFK until the meeting
np - i'll clone your repo and try to reproduce
@tulip sleet I was not advocating keeping the feather_m0_supersized in the build list. Certainly not for my benefit.
no, i understand - you're perfectly capable of building your own 🙂
why are you awake?
I ask myself that question.
sleep is overrated 😉
it is actually severely underrated
I'm with @stuck elbow on that one.
💤
@stuck elbow "why are you awake?" who do you mean ?
Jerry and I are on Eastern time; it's 1017.
The day is half over ....
My dog usually has me up at 5.... best part of the day!
@jepler Cloned your repo, did a make translate and make check-translate locally, and then pushed (permissions are set up for me to push to your repo for the PR). It passed the translate test!
Anything before 6:00am is yesterday.
My heart doesn't even start beating until 9AM.
@tulip sleet ahh, for some reason I thought you are in Seattle or Portland
@stuck elbow no, I am near Boston. Scott is Seattle. But sometimes I stay up too late 🙂
OK, looks good - thank you! I'll push a change to fix the merge conflicts.
The indented XXX_MODULE entries in py/circuitpy_mpconfig.h were meant to show prerequisites, e.g. FONTIO_MODULE and TERMINAL_MODULE depend on DISPLAYIO_MODULE.
@tulip sleet by the way, I don't suppose you had any time to look at that audiocore buffer PR?
i did look at it, but wanted to check with Scott about the backwards compatibility aspect.
no, wait, wrong PR, hold on
ah, ok, looks good, I'll approve and merge. was waiting for the doc addition and I missed the email that it arrived
@tulip sleet thanks, I forgot about it, that's why it took so long
OK, looks good - thank you! I'll push a change to fix the merge conflicts.
The indented XXX_MODULE entries in py/circuitpy_mpconfig.h were meant to show prerequisites, e.g. FONTIO_MODULE and TERMINAL_MODULE depend on DISPLAYIO_MODULE.
I’ll be late if on at all for today’s meeting. If I miss it, have a good week!
@solar whale Thanks for letting us know
I updated the meeting notes doc, but I don't think I'll be able to join today. 😦 I have a ridiculous week of non-stop work meetings this week.
something weird about tinyusb update; investigating; don't merge yet
Ouch, I obviously made a mistake in my git use. Do you want me to re-roll this whole PR to also get rid of the "reorder and reindent" part? @dhalbert
@minor plume Thanks for adding to the notes!
<@&356864093652516868> Meeting in ~10 minutes. Everyone is welcome! Here's the notes doc. Please add your hug reports and status updates even if you'll be present in the meeting, it's super helpful! Thanks! https://docs.google.com/document/d/16nsp4_ess3BlQQjJ75LQ1ImaGmmtdklNQmK_OJgWF2I/edit?usp=sharing
oops sorry for the chewing sounds'
** lurking** but group hug!
lurking
grabbing water and will be back
we need a group video "show and tell your pet"
Hug report, @onyx hinge audio stuff with nrf...
happy to
CircuitPython day is not quite over, YET! Here are some CircuitPython cupcakes from the Lamba Labs Beirut Hackerspace
https://www.instagram.com/p/B1Os82ADp9B/?igshid=jcb7cwkdsryp
Latest newsletter is in DRAFT, please add an issue with any updates and more, and/or for next week too!
https://github.com/adafruit/circuitpython-weekly-newsletter/blob/gh-pages/_drafts/2019-08-20-draft.md
New feature: Bryan, Dan, and Melissa!
Consumers Should Immediately... Python the Circuit
http://www.extrasleepy.com/#/recalled/
<lurking today>
Python powered art: CompuCanvas
https://youtu.be/4BkDwmhM_Gc?t=1114
Multistreaming with https://restream.io/ Visit the Adafruit shop online - http://www.adafruit.com ----------------------------------------- LIVE CHAT IS HERE...
CircuitPython book!
https://twitter.com/AoyamaProd/status/1161419847781142529
"Limitless hue of the spectral color represents the infinite possibilities by multiplying the programmatic necessity by the creativity of the CPX users. I would be happy if my artwork visualizes the multiplicity of the possibility of CPX."
Stickers all month:
https://www.adafruit.com/free
Adafruit Industries, Unique & fun DIY electronics and kits : Free - Tools Gift Certificates Arduino Cables Sensors LEDs Books Breakout Boards Power EL Wire/Tape/Panel Components & Parts LCDs & Displays Wearables Prototyping Raspberry Pi Wireless Young Engineers 3D printing Ne...
Circuit Playground Bluefruit - Bluetooth Low Energy, ahead of schedule!
https://www.adafruit.com/product/4333
https://youtu.be/FzYq9_8j-Bg
https://youtu.be/sS5JoHFpvw8
Circuit Playground Bluefruit is our third board in the Circuit Playground series, another step towards a perfect introduction to electronics and programming. We've taken the popular ...
More testing! https://www.adafruit.com/product/4333 #Bluetooth #NYC #adafruit Visit the Adafruit shop online - http://www.adafruit.com ----------------------...
More testing! https://www.adafruit.com/product/4333 #Bluetooth #NYC #adafruit Visit the Adafruit shop online - http://www.adafruit.com ----------------------...
face tat? dan - go for it!
@fluid helm Are you lurking or do you plan to give hug reports and status updates?
Text today! I posted in the wrong channel 😬 @idle owl
@fluid helm No worries! We'll read it off when we get to you. Feel free to post it early if you'd like.
arghm @onyx hinge and @tulip sleet, not Scott, though of course I appreciate Scott's reviews too
My hug report this week goes to the team working on the Circuit Playground Express BLE version. It’s going to open up a whole new way to interact with the Circuit Playground and CircuitPython.
too quick
https://www.humblebundle.com/books/python-programming-no-starch-books Might be handy for some peeps
swoons
This week I’ve been working on an offline version of EduBlocks as it’s been heavily requested by multiple people. For now, I’ve only got it working on Linux + Raspberry Pi & Hopefully Windows + Mac when I learn how to do installers for them. It’ll include offline support for CircuitPython so you can code your CircuitPython compatible devices in block format without having internet.
Awesome
No worries!
@fluid helm I really like https://c-command.com/dropdmg/
DropDMG lets you create and convert Mac .dmg files and archives with a simple drag and drop. Automate via AppleScript or shell. Download our free trial here.
It lets you do custom PNG backgrounds too
Oh handy! Many thanks
thank you
Dropping off.
Talk by Kate Temkin & Mikaela Szekely Working with USB designs is often more difficult than it should be. Whether creating USB hardware/software, reverse eng...
@dhalbert I'll see what I can do once I'm done with this MSA301 driver
@onyx hinge did you update tinyusb in circuitpython without a PR>
has anyone made circuitpython guitar pedals yet? is it possible?
I'm looking at arduino ones but I don't think the person I want to build it for could handle all the arduino setup
oh wait I forgot you can uf2 an arduino project
hmm
now to find out if electrosmash's pedalshield is compatible with a metro
@onyx hinge nvm, I see 2067
I'm so confused -- I have second PyRuler (I order too much stuff) -- it behaves differently.
started magenta - then goes white then steady blue while code.py is running and when in REPL (this is with factory code CP 4.1.0rc-1)
The other pyruler is just magenta all the time....sigh
@slender iron the displayio.release_displays() is to keep it from creating multiple instances of the same display..? I don't remember exactly what you said about why it needs to be included.
Hi, I am facing a weird problem with CircuitPython 4.1 running on Metro M0 board . I've interfaced a rotary encoder and the sample code was running fine till a few minutes back and I was able to record change in position by printing current position on serial console. Now it's like hanging, missing values. Looks like it's continously spitting out values on console as I can see the tx led glowing solid. What could possibly be wrong here? - Checked the sensor and wiring, nothing wrong there!
This is happening ocassionally , seems like something else is going on in the background and I cannot register change in values during that instant
@exotic pumice If there aren't CircuitPython pedals yet, there probably will be soon. SparkFun makes a handy pedal protoboard to hook up input, output, battery, and switch easily. https://www.sparkfun.com/products/13124
They're currently out of stock on the matching enclosure https://www.sparkfun.com/products/13967 but say more are on the way.
I was looking at electrosmash's pedalshields but those are only for atmegas 😦
I might design my own at some point but no time soon
@idle owl ya, it's because displays are NOT automatically reset like everything else
@obsidian compass it uses interrupts, but if there are higher prio things going on, it may miss some, or if you are running out of RAM and it's garbage collecting a lot
OK, all set. The tinyusb commit was your change commit to tinyusb with the MIDI fix, but not the merge commit to the tinyusb repo that merged that in to the tip of master. That included a bunch of new changes to tinyusb: we'll have to update some code to handle those. I'll do another PR for that.
thanks @tulip sleet , diggin deeper.
Thank you for doing this! A couple questions:
- Can you verify the existence of the resistor and error if it's not attached?
- What happens when we add native touch support? Is it ok to leave the resistor on? Should we name this differently so it's clear that it's a separate implementation?
@exotic pumice seems like there may be a few missing pieces for doing real time audio manipulation in CP (you can't sample continuously from an audio source, for example, at least if PDMIn is any example), and the amount of calculation you can potentially do per sample would be very limited even if you could do it...
nod to that, uf2 bootloading is pretty sweet
it really helps the nontechnical folks
I want a guitar pedal you can drag and drop new effects to
I think I need a little tutorial on how to filter GitHub emails in Gmail so they don't go to my inbox
lol
Screenshot (Aug 19, 2019 16:58:54)
I've been playing around with the PyRuler as I received it as part of my order a week ago. Right from the beginning I have seen only the Dotstar as a magenta light. At no time have I seen this change when plugged in or when functioning. I did alter the code as recommended to enable the keyboard by setting it True. What also happens is that I don't get the correct characters for the ohm and pi touch pads, but I do get the mu, µ, character and the DigiKey url. For ohm I get Û, and for pi I get ...
- Can you verify the existence of the resistor and error if it's not attached?
Yes, it turns out I can detect that. I have a change to throw an exception and will push that later after resolving the discussion below.
- What happens when we add native touch support? Is it ok to leave the resistor on? Should we name this differently so it's clear that it's a separate implementation?
I tested on a SAMD21 with native touchio and it still works even with a 1M resistor.
I don't...
FIY, I've been working on my CircuitPython Braille for CircuitPlayground and it is now working well enough for anyone to learn how to type braille using a Playground express.
Thanks again to @tulip sleet who help and suggested ways of cleaning the code and how to debounce it.
Depending on the cpx switch it will either print to REPL (notice, mu-editor still prints weirdly with unicode) or work as an HID input device.
Any bugs, comments, PRs, all welcome.
heya @tulip sleet I was asked a few times which CPython version CP is closest to and wasn't sure beyond 3.X. Do you know?
3.5
3.4 is what MicroPython was trying to be compatible with
ah, sorry
i'll double-check
they do have some features from 3.5
right, and are thinking of adding more
like the spaces for zero separator in number literals
Excellent, thanks guys
re: @obsidian compass 's question above... are there other core modules (e.g., gamepad, rotaryio) that interrupt and buffer their inputs (that could potentially be repurposed for other interrupt uses (e.g., maybe a PWM out could be routed to pulseio for counting time)? Also, is there a list of the priorities that supersede interrupts used in the core modules?
@crimson ferry PulseIn is one
Thanks. I'm wanting to simulate a timer-based interrupt. That looks promising.
@obsidian compass if you continue to have trouble, could you file an issue at https://github.com/adafruit/circuitpython/issues and include your whole program? I looked at the interrupt handler, and there's not much that should go wrong or be non-interruptible with it, so I'd want to try it too.
Update tinyusb to current tip of master. Current version is a PR commit but not the resulting merge. @hathach recently updated tinyusb from the develop branch.
In the latest version, lib/tinyusb/src/portable/nordic/nrf5x/hal_nrf5x.c was merged with lib/tinyusb/src/portable/nordic/nrf5x/dcd_nrf5x.c, so a mentioned of hal_nrf5x.c was removed from ports/nrf/Makefile.
Tested on nRF52840, Metro M0, and Metro M4. CIRCUITPY and REPL work. HID keyboard tested on all three.
finally gets to in-the-weeds: before Dan mentioned it, i was thinking about pinning library versions to circuitpython. i wouldn't use separate branches though, from a maintenance nightmare standpoint.
maybe a living file in the library's repo that points to the latest release tags for each supported cirpy version.
the tricky part is how to do this in a non-manual way. best i can think of right now is having a version flag in PR notes. cumbersome however you approach it. bundling the versions in circuitpython-build-tools shouldn't be much of an issue, though.
What is the frequency of the external crystal?
Why aren't uses of TouchIn interchangeable? Is the API different?
What do you all think about a 6.x branch that holds backwards compatibility breaks? Basically a holding area until master is 6.x
Did the modified version work? I was about to suggest that.
Looks like make_opaque and make_transparent don't trigger a refresh on their own: https://github.com/adafruit/circuitpython/blob/master/shared-module/displayio/Palette.c#L36
Why aren't uses of TouchIn interchangeable? Is the API different?
They are interchangeable. I was responding to Should we name this differently so it's clear that it's a separate implementation? and saying we shouldn't name them differently. Or did you just mean .c/.h filenames.
Ah right. I misread it. All good from me if the native touch works when the resistor is there if we ever "upgrade" the implementation.
pinyin...sooo close 😦
Build metro_m0_express for zh_Latn_pinyin took 18.74s and failed
-4 bytes free in flash out of 253696 bytes ( 247.75 kb ).
itsy m0 overshot by quite a few more though.
haha, I've been there
is your git version dirty?
I think that'll add -dirty to the version that's stored in the bin
that's from my travis. not sure i'll get through the new 8 subjob build though; my fork is still stuck on .org...
ah, bummer 🙂
Ok, no worries from me. Just add a TODO here and maybe an issue to match. That way we can track it.
I don't think it's an issue either. It'd only be troublesome if an interrupt grabbed the I2C bus which I don't believe happens.
I'd suggest deleting it and only adding it when needed.
Can you test this on a SAMD21 and SAMD51? I feel like I tried it and it didn't work.
@meager fog Yup. All set for whatever you have in mind.
ok so the pi4 is a red herring, you wont be using it
(yet)
ok @slender iron what does @umbral dagger need to do to get the bitmap capture PR good for mergin'
I haven't looked at the newer commit (but will look now)
usually I only see if the author asks for another look
deshipu's should be addressed too. as is, it won't very that the object is actually an array
@slender iron K. I'll dig into that tomorrow
k thanks!
@umbral dagger ok please do that and then tag scott/deshipu for review
will add more comments tonight too
Update:
- Complain if no pullup.
- Complain if pin in use. Missed this before, found it during testing.
@umbral dagger ok tomorrow after you fix the PR i will give you the NEXT PROJECT
@meager fog You really know how to slow roll these things
i wanna get stuff complete before moving on, so we can build on successes 🙂
//| Extract the pixels from a single row
Thanks for the simplification of the API! I added a couple of comments to further simplify the implementation too.
I'd remove both MP_ARG_KW_ONLYs and make them required positional arguments.
Please do this check before fill_area and then pass the given buffer straight into fill_area. That will simplify this implementation further.
Fixes #1306. Also possible that this address #1260 & #1305.
Tested with:
- WaveFile: 8bit (unsigned) & 16bit (signed)
- RawSample: 8 & 16 bit (signed & unsigned)
ItsyBitsy M0 Express (-360 bytes) & Metro M0 Express (-4 bytes) are failing Pinyin builds on my Travis. Open to suggestions on how to handle those.
I made some changes to the code as suggested by a post from saddacious in the Adafruit forms and now the characters for ohm, mu and pi display properly on my Mac. The characters still do not display properly for Windows 10 PC. Also the dotstar on the PyRuler remains magenta when plugged in to either the Windows 10 PC or my Mac. I also removed a few of the unused files that were originally installed as space is very tight once the code changes were made.
no opinion, shared naming is fine by me
@tulip sleet thanks alot for the info. I’m not facing the same issue anymore. Seems like when you print on serial console continuously (w/o delay) the RAM usage of mu-editor sky rockets which then in turn hangs the IDE and not the controller, So output was not displaying on the console even though the board was sending it out (verified using screen). Though I’m still not sure how the board was re-setting automatically after certain time yet? If I encounter that problem again, I’ll open an issue with steps to reproduce. For now it’s working fine. 😃
@crimson ferry I was using rotaryio, usb_midi, adafruit_midi
I am now seeing very similar behavior to #2037 on my second PyRuler.
with no code.py program, on boot, the dotstar flashes magenta very rapidly. think the blue led is steadily on and the red is flashing so it looks magenta -- once in REPL it remains steady blue.
On the first PyRuler discussed above, the LED is steady magenta all the time.
Would you prefer to move the DotStart issues to a separate issue -- possibly re-open #2037 with a new name?
@dhalbert thanks for cleaning up my mess! I wish I knew at what step I made a mistake. When I "make translate" at the tip of master, no errors, no grand reordering, and "check-translate" passes, so usually it works as expected. I must have made a mistake due to being in a hurry.
I'm not sure what happened, but I think the simplest explanation is just that make translate didn't get done after the merge. No worries!
No, the modified version does not work, either.
Did you mean for this to be commented out?
Don't need this - we'll never do a port without floats.
Doh! I meant to go back and fix those, as they were causing build errors (implicit declaration).
In short: I don't currently understand it enough to accomplish it. These were originally done by DeanM, but only the 16 bit signed funcs were complete. The rest were mostly stubs/initial.
@slender iron OK, I pushed some changes. Let me know if that's what you were thinking. It seems to work, but there might be something off.. I'm going to test/push it harder.
@slender iron OK.. after more testing, it seems to work fine.
ok, thanks @umbral dagger will look in the next hour
@prime flower please always release as semver (x.x.x) no v
having a consistent version format makes it possible to automate checks
@slender iron Ok, will remove the v. going fwd.
OK, looking at this in more detail, the saturated builtins are only available on M4, not M0. There's a lot of stuff online about how to implement unsigned and signed saturated arithmetic. This is good (original web page is blank at the moment): https://webcache.googleusercontent.com/search?q=cache:bSrCZnMkEfkJ:https://locklessinc.com/articles/sat_arithmetic/+&cd=3&hl=en&ct=clnk&gl=us
There are a few example libraries in github but mostly in C++, unfortunately. The code here could maybe be ...
i srsly doubt this would fit in m0 anyways, lets have it for m4 only!
Looking better! Just one more re-arrangement.
Do this above where you have the array cast before the typecode check otherwise you are testing against memory that may not be what you think it is.
@umbral dagger back to you. just one suggestion to remove the array object cast
@slender iron OK. Testing that now
Kk, please add a comment saying that and then it's all good from me. Thanks!
Why is there a TinyUSB change here?
@slender iron I was an assumption and should be more general?
@slender iron Also, just moved the mp_get_buffer_raise call earlier
@tidal kiln Do you have a minute? I think you can help me with something.
sure. what up?
I'm writing a guide using displayio and associated things, and I am not sure how to describe this section of the code. python clock = label.Label(font, text=time_display) date = label.Label(font, text=date_display) text = label.Label(font, text=text_display)
I get what it's doing
but I don't know the correct terminology.
like creating an instance of label which needs the font and text to display?
Feels like picking random words.
yep. that's pretty much it.
imagine wanting those text labels at 3 different locations on the screen
so you need 3 separate labels
so you can set position for each
and show/hide also if you want
different fonts for each, etc
Ah yah I did the different position thing for each of them
are you getting that from an existing example?
I wrote the example. It exists yes
Redoing the MicroPython OLED watch in CircuitPython using displayio
there's probably a lot of that going on in the various PyPortal code in the Learn repo
if you want some other examples to look at
4 separate labels so position could be set
same here
Examples weren't the issue, the code is already written, but I couldn't figure out good wording to describe it.
creating an instance of label which needs the font and text to display
that seems fine
right on, thanks
the key being that it's only needed if you want separate text items
want to ping me when you have a draft page? i can take a look
@tidal kiln Sure. It'll be on hold for a bit anyway because it's waiting on 5.x CP release and bundle creation. But I intend to finish the page today.
sure np. when evs.
thanks!
@idle owl Are you covering what these really do? •displayio.release_displays() •refresh_soon() •wait_for_frame() 🙂 Maybe it's covered elsewhere, but they've baffled me (and many others I think) since the dawn of displayio
I quickly explained release, but my code doesn't use the others so they're not covered in this guide.
@crimson ferry i glossed over those in the displayio guide. always meant to cycle back and add info on those in. still intend to at some point.
Sounds good, thanks, @tidal kiln !
(i was confused too) 🙂
@crimson ferry @tidal kiln refresh_soon and wait_for_frame are being removed in my next PR in favor of refresh
What does it actually do? When to use it, and when not to?
refresh will only be needed if you want to control when the display is refreshed
- for tfts and oleds
epaperdisplays will require you to call refresh because they are only updateable every few minutes
TFTs get refreshed on some interval if content changes, so refresh() would be an attempt to accelerate that?
no, the interval is fixed by the init code
the trick is syncing your python code to the display
I'm adding auto_refresh which will work like it does now
which is every interval, update what has changed
that suffers from showing intermediate updates though
so if you want to control it yourself then you do auto_refresh = False and then call refresh yourself
Ah, nice, that makes sense. Thanks!
(sounds very much like auto_write in neopixel)
ya similar
refresh has kwargs to track how you are doing keeping up with the screen refresh though
target_fps and minimum_fps
and if you call refresh too slow for your target it'll skip the real refresh
to try and catch up
is testing this today
(sounds like a fancier auto_write) 🙂
neopixels don't have a separate refresh clock to worry about 🙂
@tidal kiln Do you mind reviewing? https://github.com/adafruit/Adafruit_Learning_System_Guides/pull/805 couple of tiny changes.
looking.....
@tannewt ok, should be all set now
Discovered this while reading the code while supporting a discord user.
The one time I want my code to fail pylint hard, and I get one error.
Ooh wait, I think I nailed it. It's cascade failing! 🎉
Um, yay?
😄 yay indeed
Writing a guide on using pylint. Needed a program to fail in a particular way.
See also #1880 ... exceptions could be a lot better on 'socket', 'network' and 'wiznet' libraries, we just have to decide what to standardize on ...
Yeah, I was waiting on Scott's final feedback.
@umbral dagger better if you say something like "@slender iron this is ready for another review"
Gotcha
its good to be explicit, people can't read your mind - they dont know if you have more pushes coming or not
nods
scott and i are 'reviewers' on approx 40 PR's at any time
ya, I don't get emails without a message of some sort
think about how to make reviewer's lives easy so they'll be excited to review 😉
I'll take a look tomorrow. in epaper land now
just saw that epaper photo on twitter. looks great
if it's only for m4, you can just use the builtins and not bother to figure out other implementations. Just throw a compile #error for now or something like that.
Seems dict sort order appears to be "off" in circuitpython 4.1, or I'm incorrect about how dicts are ordered.
CircuitPython
cpython
dict ordering is random
I guess I could use an ordered dict, but I wonder why it stays in the same order in CPython?
CPython dicts were naturally ordered kinda by accidnet, and now they've decided to make that a feature
I'd call it undefined behaviour
MicroPython is not adopting this, at least for now
Huh, interesting...
implementation detail = UB imo
it's not a bug it's a feature
The only M0 builds that include this are express boards with audiocore turned on (via audioio).
As of now, there are 5 build failures; all 5 only fail the Pinyin translated versions. I used a Feather M0 Express during dev/testing. The en_US build currently has 4168 bytes free in flash (in my env).
If not including MixerVoice on M0 is really how we want to proceed, it will require maintaining the current Mixer only code for M0, and the Mixer+MixerVoice for the M4 (using `#if...
With the introduction of writeto_then_readfrom into busio.I2C in 5.x. The stop kwarg is no longer needed. In fact, using it is likely the wrong thing to do since it is unsupported with Blinka.
sorry for the emails circuitpython librarians
I'm not a circuitpython librarian but I'm having fun checking out all the cool sensors you're forking 🙂
especially that fm transmitter looks cool
@tannewt added the comments. Can you please take another look?
Need some help, please: What's the default I2C clock speed for adafruit_bus_device.i2c_device? According to the documentation, it isn't called out as a settable option. Couldn't find anything in the bus_device code in the repo either. Is there a way to confirm the clock speed that the library uses?
Excellent suggestion. I'll grab my o'scope.
It's 300kHz on the M4 Express. Thanks for the suggestion and quick response, @exotic pumice
yw
If anyone from here is at CCCamp right now, I have 4 Blinka stickers I can give away, one per person 🙂
@errant grail it's supposed to be 400 kHz, though the setting granularity may be coarse. https://circuitpython.readthedocs.io/en/4.x/shared-bindings/busio/I2C.html
@tulip sleet Thanks. bus_device inherits it from busio's default. Should have known that. Is there a reason that the UI for bus_device.I2CDevice doesn't allow setting it similar to bus_device.SPIDevice's baud rate parameter?
@errant grail the I2C frequency cannot be changed after the busio.I2C object is created, unlike SPI. For SPI, there's a configure() call that can change it at any time.
So if you just create an I2C object at the right frequency and pass it to bus device, that would do it
Super! Thank you for the explanation. I wanted to test different devices on the bus that may have clock sensitivity and still use bus_device's abstracted management scheme.
as to why you can't change the I2C frequency later, it may have to do with the HAL libraries we're using not providing that, or something like that
Ah. I'm trying to imagine a scenario where I might need to dynamically adjust the clock speed except for testing.
adjusting for cable length/interference? that's a stretch.😏
@river quest Not sure best place for this, but... Wondering if you've had any success updating a UF2 in iOS 13 using a lightning-to-USB adapter?
With Trinket M0, iPhone XS (iOS 13 latest public beta), and the standard Camera Adapter (MD821AM/A), I get a "Cannot Use Accessory: Trinket M0: This accessory requires too much power" as TRINKETBOOT even though CIRCUITPY behaves nicely. Could be some difference in CP?
With powered USB 3 Camera Adapter (mk0w2am/a), I first get "The Operation Can't Be Completed. The file "adafruit-circuitpython-trinket_m0-en_US-4.1.0.uf2" couldn't be opened. Trying to look at TRINKETBOOT contents again yields "Content Unavailable: The folder could not be displayed because the connection to the server timed out. Try Again" and Try Again then works. But thereafter TRINKETBOOT is grayed out and can't be selected for a Move to Folder.
haven't tried it yet
but....yeah thats a good thing to try! did you get it working with CP code.py editing?
Yeah, that's working great!
It’s so cool to open up cirpy code on an iPad and have it run!
@crimson ferry ok we'll look at UF2s next...no idea yet
if (bufinfo.typecode != BYTEARRAY_TYPECODE) {
Please get the first CI job green by fixing the test unix build. Once it's down to the itsy m0 build and space then I'll fix it for you.
@meager fog have no idea what to do about the out of flash failure on itsybitsy_m0_express for zh_Latn_pinyin
right, scott will fix that
right now its not getting past test
start with the first set of errors at the top
What I just pushed should fix that
ok!
you can watch it here https://travis-ci.com/adafruit/circuitpython
@umbral dagger it still failed https://travis-ci.com/adafruit/circuitpython/jobs/227153404
I snag the commands travis is running to test locally
(make -C ports/unix deplibs -j2 && make -C ports/unix -j2 && make -C ports/unix coverage -j2)) ; S=$? ; echo $S > status ; (exit $S)
ya, this bit make -C ports/unix deplibs -j2 && make -C ports/unix -j2 && make -C ports/unix coverage -j2
I canceled the job to save cycles
OK, this should do it
Related to previous PR
@slender iron OK.. I ran make translate and pushed again.
👍 looking at the itsy m0 build now
@umbral dagger to make room in the itsy m0 let's turn i2cslave and rtc off: ```
CIRCUITPY_I2CSLAVE = 0
CIRCUITPY_RTC = 0
in the mpconfigboard.mk
OK, added and pushed
OK.. that might/should do it
@umbral dagger boards aren't building because the objarray.h include is gone
Ah.. I stripped it down too far
and my suggested change hasn't been done
which?
I hadn't caught that
you shouldn't need the array cast at all then actually
since you can get all of the info out of bufinfo
ok... once more
Welcome @crimson ferry to the CircuitPythonistas!
👋 @crimson ferry
Welcome @crimson ferry!
👋 hi everyone, thanks. I'll put this out there too... I'm always happy to test bugs and builds (especially esp32 & displays), have a reasonable inventory. Just ping me and I can usually reply pretty quickly.
is it because Adafruit_CircuitPython_BLE is a "pre-release" that not all the files are getting in the bundle?
@tidal kiln the pre-release libraries don't get put in the bundle; you have to get them manually. We put in a check for library version numbers that have a - in them, and ignore those
the last release that is not a pre-release is going in the bundle
it's compatible with 4.x
ok. i'll grab manually. thanks. just wanted to make sure something wasn't broken.
@slender iron OK, all passed that time
anyone have a mo to help me fix adding a module to cp?
i have made folders and init.c and init.h in shared-module and shared-bindings for a module called capsule.
In circuitpy_mpconfig.h, I added "CAPSULE_MODULE" to MICROPY_PORT_BUILTIN_MODULES_STRONG_LINKS and tried adding a #if micropy_py_XXX but i'm seem to not be adding the #if correctly. here the the error: ```QSTR updated
In file included from ../../py/objmodule.h:29:0,
from ../../py/objmodule.c:31:
../../py/circuitpy_mpconfig.h:555:68: error: 'mp_module_capsule' undeclared here (not in a function); did you mean 'mp_module_machine'?
#define CAPSULE_MODULE { MP_ROM_QSTR(MP_QSTR_capsule), MP_ROM_PTR(&mp_module_capsule) },
^
../../py/obj.h:246:24: note: in definition of macro 'MP_ROM_PTR'
#define MP_ROM_PTR(p) (p)
^
i have just also tried just #define CAPSULE_MODULE { MP_ROM_QSTR(MP_QSTR_capsule), MP_ROM_PTR(&mp_module_capsule) }, in the #if section
@marble hornet is this affecting a bord which DOES have "capsule" or which DOESN'T?
@onyx hinge what do you mean? i have not added a #define to the board, rather directly above it in mpconfig.h
since i;m only compiling for one board rn
Looks like usually next to the #define for the module is an extern declaration for the related symbol, like ```#if CIRCUITPY_UHEAP
extern const struct _mp_obj_module_t uheap_module;
#define UHEAP_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_uheap),(mp_obj_t)&uheap_module },
#else
#define UHEAP_MODULE
#endif
i'll give it a shot
@onyx hinge so i tried it, and moved CIRCUITPY_CAPSULE = 1 into the board's .mk and am now getting a bunch of: ```
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
rm -rf build-itsybitsy_m4_express
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
GEN build-itsybitsy_m4_express/genhdr/moduledefs.h
In file included from ./mpconfigport.h:79:0,
from ../../py/mpconfig.h:45,
from ../../py/emitnx64.c:3:
../../py/circuitpy_mpconfig.h:554:5: error: "CIRCUITPY_CAPSULE" is not defined, evaluates to 0 [-Werror=undef]
#if CIRCUITPY_CAPSULE
^~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
In file included from ./mpconfigport.h:79:0,
from ../../py/mpconfig.h:45,
from ../../py/emitnx86.c:3:
../../py/circuitpy_mpconfig.h:554:5: error: "CIRCUITPY_CAPSULE" is not defined, evaluates to 0 [-Werror=undef]
#if CIRCUITPY_CAPSULE
^~~~~~~~~~~~~~~~~
i think i am not declaring CIRCUITPY_CAPSULE properly?
extern const struct _mp_obj_module_t capsule_module;
#define CAPSULE_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_capsule),(mp_obj_t)&capsule_module },
#else
#define CAPSULE_MODULE
#endif```
@marble hornet There are a surprising number of things you have to do to make a new module work, and if you miss one it just won't work. 6b44e40ee8dba415213468afe14f7202b42ec429 is a recent commit which does add a whole new module, it might be helpful to refer to
for this current error my first guess is that a block in py/circuitpy_mpconfig.mk is missing. In this case, audiocore is a bad example, and I'd follow bleio: ``` ifndef CIRCUITPY_BLEIO
CIRCUITPY_BLEIO = 0
endif
CFLAGS += -DCIRCUITPY_BLEIO=$(CIRCUITPY_BLEIO)
this turns the define in the board's mk into a C preprocessor macro that expands to either 0 or 1, but zero by default
easier to view commit on web if you prefer: https://github.com/adafruit/circuitpython/commit/6b44e40ee8dba415213468afe14f7202b42ec429
thank you, i'll go over the commit
Do we envision that CPB support will live in the same adafruit_circuitplayground package? New sub-module bluefruit? Hopefully sharing as much content as possible with the existing adafruit_circuitpython.express?
.. is there a start on this even?
[itching to have time to actually play with CPB, but not before the weekend!]
'night!
night! thank you it's compiling (even if not importable )
- Circuit Playground Bluefruit does not have a 32kHz crystal on board. This is quite unusual, and the nRF clock code assumed there would be one. Caused BLE failures and other timing-related issues.
- There is not a status neopixel on this board, as with CPX: first neopixel was getting reset with status colors.
- Fixed typo in an unrelated error string.
Thanks @ladyada and @hathach.
@bmeisels and @jepler Apologies: I encountered exactly the same issue with the Circuit Playground Bluefruit and didn't realize there was a PR approved 9 hours beforehand. I wrote essentially the same PR, but with just #if and no inline routine. This is more the style we use now. Also fixed a couple of other things at the same time.
Note that mpconfigboard.h is already included via the other includes.
the comment seem to contradict the value
Hi @tulip sleet
Regarding PR 2083
I am interested to understand why you prefer this style? Do you think it is clearer?
I did look through the compiled assembly during my PR and saw that the inline function is optimized away, so I don't think this change effects the binary in any way.
One way or another I think that the code in the SAMD port which handles the clock source should be using the same style as the Nrf (whichever style is chosen).
@stuck elbow when you have a chance check out my epd branch. I just got celeste going on the pybadge with the new refresh api and it's awesome
after you load all the assets do display.auto_refresh = False and then display.refresh(target_frames_per_second=30)
should be able to get it PRed tomorrow
@slender iron roger
okay, so i have added the new module but the example in extending circuitpython only has adding classes and i have been unable to get a function in the shared module init.c to link to the module's globals.
the function:
return 7;
}```
and the adding into user facing code:
```STATIC const mp_rom_map_elem_t capsule_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_capsule) },
{ MP_ROM_QSTR(MP_QSTR_load), MP_ROM_QSTR(MP_QSTR_load) }
};
STATIC MP_DEFINE_CONST_DICT(capsule_module_globals, capsule_module_globals_table);
const mp_obj_module_t capsule_module = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t*)&capsule_module_globals
};
i have also tried capsule_load in the rom_map_elem_t
rn, in python, s variable will show up but it only links to a string
how would one tell it to use a specific funtion
Added some #pragma message () temporarily to check that the correct #if BOARD_HAS_32KHZ_CRYSTAL conditional arms were being used.
I should not try to complete a PR after midnight.
@subtle sun It will be optimized away, but I'd prefer the #if so it's clear it's a compile-time option. I can change the atmel-samd check too. In general we try to use the preprocessor flags directly rather than make an inline that is optimized away.
i wanted to put you as a reviewer but was unable to, so I just tagged you.
I changed the name of the flag to specify which crystal. on the Circuit Playground Bluefruit, there is a visible onboard crystal, but it's the 32MHz crystal. Usually that crystal is hidden inside the '840 module
i am sorry I didn't pay attention to the PR when it first came out, since it would have saved a couple of hours of debugging :). i thought it was for something else, for some reason.
also we try to use #if rather than #ifdef checking now to catch missing preprocessor definitions. Unfortunately in the nrf port turning on a warning for that causes fatal warnings in the nrfx library
... looking at the atmel-samd port, I see you copied that style. That's in a separate samd-peripherals repo, so I won't try to clean that up now -- it's a bit involved
thank you for your work on this
and @onyx hinge thank you again for your help last night, it got me so much closer
@tulip sleet no problem. It was more of a general question for future work I am planning to upstream.
we appreciate your contributions!
@marble hornet happy to hear it
@marble hornet I won't be around much today to help with your problem including functions, 😕
If I had to guess, maybe you are missing the part where you declare/define the "function object", or else you're missing an accompanying extern declaration.
Here's a C function followed by the definition of its related function object: STATIC mp_obj_t time_monotonic(void) { uint64_t time64 = common_hal_time_monotonic(); // 4294967296 = 2^32 return mp_obj_new_float(((uint32_t) (time64 >> 32) * 4294967296.0f + (uint32_t) (time64 & 0xffffffff)) / 1000.0f); } MP_DEFINE_CONST_FUN_OBJ_0(time_monotonic_obj, time_monotonic);
then way down below, time_monotonic_obj is in the globals: STATIC const mp_rom_map_elem_t time_module_globals_table[] = {... { MP_ROM_QSTR(MP_QSTR_monotonic), MP_ROM_PTR(&time_monotonic_obj) },... };
as far as creating the proper declaration, in case the MP_DEFINE and the module globals have to be in different source files, it looks like there are macros like MP_DECLARE_CONST_FUN_OBJ_0
0 of course means the function takes no arguments
there are also variants for 1/2/3/variable/keywords arguments
@subtle sun I added you as a collaborator so you can review changes. also added you to circuitpythonistas
@slender iron I'll merge the CPBlue clock fix unless you want to review it also
nope, other reviewers are enough 🙂
interesting to see all of the hal/freertos files brought in
@slender iron if an entire module can be made in the shared bindings what part of it should i put in the shared modules?
the part that does the work, see for example bitbangio
@slender iron Thanks
@marble hornet another way to put it is that shared-bindings should only do argument validation and conversion to C
Looks good to me! Just needs a translation merge.
Please call out to a shared_module construct method here.
Do we want to leave these two functions in for backwards compatibility? They can make the equivalent MixerVoice calls.
Thank you so much for picking this PR up! Please let us know if you'd like to hand it off. Otherwise, thanks again!
We can remove these. This lifecycle management doesn't make sense because no hardware is used directly.
Other than for support of WPA Enterprise, is there any reason to upgrade the ESP32NINA Firmware on the various boards? that is, if WPA Enterprise is not needed, is there any reason to upgrade from the delivered NINA v1.2? Does 1.3 add anything other than WPA Enterprise?
Looks good to me! Just needs a translation merge.
Ok, I've done as @deshipu asked. writeto_then_readfrom is added and stop is documented as deprecated. Once 5.x is stable we can remove the stop= kwarg.
Please take another look.
@slender iron re all write_from_read_info PR's. I missed some of the discussion last night. Are we going to test all of these on hardware? I remember hearing about using kattni's stock of everything, though I have some of these too. And we should test a newer library that uses adafruit_register with its changes as well.
As for the ePapers, do you want someone to test those too? Not sure if who has what. I have none.
but i also have ble hid to work on, which would take higher prio maybe than hw testing
I think kattni will do the stop= testing and hopefully @gilded cradle is game for helping with ePaper. I've tested all the ePaper's myself too
I'm thinking I'll add clang-format actions to github ci too
@slender iron if you can get it working now in a basic way and PR that (before adding clang-format), that would be great. If you do a test clang-format it would be interesting to know how much churn that is. We'd only want to do shared-bindings/ shared-module/, and our ports, I assume
I'd do it all. we'd just need to run it over micropython before we merge it in
and ya, I'll do them separately
but I'm seeing too many folks care about formatting
does it do stuff like adding brackets on single statement if-then's?
I think it's time to set it up. should hopefully be able to have it auto-format PRs after a review
ya, think so
(╯°□°)╯︵ ┻━┻
Pylint 1.9.2 requires Python 3.6.x to work. And "downgrading" Python is straight up black magic.
Have to redo all my screenshots because the output differs ever so slightly, and I didn't notice. Managed to get it working at least but now I have to document the Python requirement.
At least I was told to assume people using this guide can handle their own Python installs. But even I had to have help to get it going right.
@slender iron, sure I can help. I think I have have most of the eInks (no Pimoroni ones though).
@slender iron @tulip sleet Yep, the stop= testing is up after this guide is finished.
@solar whale Nope, it adds enterprise. Eventually we'll expose more functions from there as-needed, though. (I just exposed it's getTime a few minutes ago)
@prime flower Thanks for confirming. It's kind of a pain to upgrade - especially on some of the new newer boards so I was hoping to not have to bother. I don't need Enterprise at this point. Nice to see all the new support in ESP32SPI and other libs.. Great work!
Ive used both -- passthru when I can --
@slender iron ok travis is finally happy:https://github.com/adafruit/circuitpython/pull/2071 (touchin) tnx
@solar whale I recommend using the arduino passthrough sketch and ESPTool, it's much faster and less of a pain
also more reliable for reading chip info ive found
I have not looked at it lately - do you need to jumper any of the pins on an airlift featherwing to use the passthru? can you use passthru for the featherwing?
ah -- yes you can -- found it https://learn.adafruit.com/adafruit-metro-m4-express-airlift-wifi/updating-esp32-firmware#turn-your-pyportal-or-metro-m4-airlift-into-a-usb-serial-converter-26-2
🙂
do you need to jumper gpio0 to use the passthru for the featherwing?
@solar whale they're connected on the Metro M4, but the FeatherWing has pins which need soldering
just gpio0 thought for passthrough, right -- don't need rx/tx do you?
You need all three
ah -- ok -- good to know 😉
I was just looking at the .ino and did not see uart pins being used.
OK -- I need to go back and review- been too long.... I'll try when I get a chance.
ah -- this does it https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/master/Adafruit_ESP32_Arduino_Demos/SerialESPPassthrough/SerialESPPassthrough.ino#L28
cobwebs grow too fast 🕷
If I wanted to make a jig to connect the swd pads of a circuitplayground with pogo pins, which style of pin do I want? "needle head"? https://www.adafruit.com/product/2430 also, I haven't looked yet -- are they at the same locations on CPX and CPB?
@onyx hinge they are not in the same place; have you seen this? https://learn.adafruit.com/how-to-make-a-pogo-pin-test-jig
I think we tend to use these more: https://www.adafruit.com/product/394
@solar whale Other than versioning and build cleanup, looks like Enterprise is the main feature post-1.2.2 https://github.com/adafruit/nina-fw/blob/master/CHANGELOG
@slender iron Did you fork everything for those PRs? Trying to figure out what Git fu I need to dust off to test this stuff.
@tulip sleet thanks for the pointers. not sure how soon I'll get motivated, but I feel like making a pogo pin rig is something I should do someday
If i am debugging, I usually just solder three header pins onto the pads, tipped back a bit, or jumpers. It makes the bottom of the board lumpy but it's not terrible
This is a bit sloppier than usual
I'd be lucky to do half as well
put some solder on a pad, hold it with needlenose, tack it, adjust position, then tack the others
@slender iron, for the eInks, does it require me to build CP5 or should they work with 4.1.0?
Ok, I'll wait then
@idle owl I worked within the bundle actually
@onyx hinge @tulip sleet I was considering making an oshpark flex pcb to hold an swd connector
@idle owl oh, ya I did. but I didn't clone them individually. I just add my fork as a remote within the bundle's submodule
For testing bus_device do I need to load one of the updated libraries or will it work with a current lib? I'm a little confused on testing that one. I understand the updated bus_device is necessary for the updates libs, but is the opposite true?
Ok
hub clone adafruit/circuitpython instead of git clone https://github.com/adafruit/circuitpython and similar for hub remote add ,etc.
saves brain cycles
the only things that the bus device will break are uses of write_then_readinto that don't set stop
Ok. Then I'll test it with a project currently hooked up and if it runs, merge it.
@tulip sleet hub fetch tannewt within the bundle's libs was handy
Then start on the libs.
@slender iron Since that's an API breaker, it's a whole version number right?
on bus_device
yes please
Released.
@onyx hinge There's example SWD wiring for most of the boards over at https://learn.adafruit.com/how-to-program-samd-bootloaders
@slender iron FRAM and LidarLite?
I don't have the hardware for the latter.
I'll ping Limor see if she wants me to order it or have someone else test it.
@idle owl curious what (if any) is game plan for all the i2c related PR's? need help?
@tidal kiln YES. Yes I do need help. Plan was to get bus_device merged first and then start down the list. There are a few discontinued ones that I might be the only one with, so I'd do those, but help would be incredibly appreciated.
looks like that was just done...like 35 minutes ago..
@idle owl for multiple CPython version black magic, I found this helpful when Travis forced me to use 3.5: https://github.com/pyenv/pyenv
@tidal kiln So basically, grab the new bus_device and test whatever you can is the plan. I think we should comment on the PR if we're starting to test it so we're not doubling up work, and then approve as applicable etc.
@raven canopy Couldn't do venv, wasn't using it in the guide. 😕
Otherwise yes, a thousand times, yes.
not venv though. pyenv lets you install and manage multiple versions of Python.
at work? 😉
Unacceptable.
they might disagree. hehe
@idle owl good idea - commenting in PR before starting testing, will do that...i'll do what i can..i currently have an ADS1115 setup, so can check that, etc.
Thank you very much.
looks like scott did a good job mentioning this issue in each PR, so looks like a good place to go for a list:
https://github.com/adafruit/circuitpython/issues/2082
get that all purple
@idle owl also do a version/bump release if merged?
Yes please.
@tidal kiln I'm going to comment on that issue on the plan, comment on a PR if you're testing it, and then follow through with merging/bumping etc
We're looking for any assistance in testing all of the outstanding library PRs associated with this issue!
If you have any of these sensors and would like to help out, please grab something like a Feather M4 Express and do the following:
- Update to the latest Adafruit CircuitPython BusDevice release (4.0.0, released 22 August 2019)
- Find the PR for the sensor you'd like to test.
- Comment on the PR that you are going to test the PR. (This will avoid any duplicate work!)
- Test...
@idle owl want to add some suggested boiler plate for release?
tag version = patch++
release title = I2C Update
description = Update for removal of stop kwarg. (more info)
anyone have the link to the firmware for the new bluefruit?
ahh nice
okay: so i'm trying to have a fun_0 return a string (see below) but I am getting a ../../shared-bindings/capsule/__init__.c:25:12: error: incompatible types when returning type 'mp_obj_str_t {aka struct _mp_obj_str_t}' but 'mp_obj_t {aka void *}' was expected return capsule_msg; ^~~~~~~~~~~
error message when i use the below code
MP_DEFINE_STR_OBJ(capsule_msg, "It's not pining");
STATIC mp_obj_t capsule_unload(void) {
return capsule_msg;
}
MP_DEFINE_CONST_FUN_OBJ_0(capsule_unload_obj, capsule_unload);```
but if i change the return type of `capsule_unload` to `mp_obj_str_t` i get a different error saying it is an incompatible pointer type for MP_DEFINE_CONST_FUN_OBJ_0.
```In file included from ../../shared-bindings/capsule/__init__.c:3:0:
../../shared-bindings/capsule/__init__.c:30:47: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
MP_DEFINE_CONST_FUN_OBJ_0(capsule_unload_obj, capsule_unload);
^```
I have to assume this is a common issue. but i tried googling the answer i didn;t find an answer i could apply to this situation
if you have to return a var of the type specified at the top of he function but you need to use a mp_obj_t for functions then how can you return a string or not mp_obj_t?
maybe casting
mp_obj_t means void * which basically means any type
as I understand it
Hmmm. The latest version of RPi.GPIO (0.7.0) claims to be updated for Pi4B. What's really annoying is that the bug appears to be in the Cython binary. So it's probably not your fault at all, but I can't fix it. You're requiring this other library RPi.GPIO and it's failing. I'm a developer and happy to help.
eh@pi4 ~/eyelert $ python3 leds.py
Traceback (most recent call last):
File "leds.py", line 29, in <module>
pixel_order=ORDER)
File "/usr/local/lib/python3.7/dist-packages/...
@exotic pumice i gave it a shot but c didn't like it. would it be better describe what i'm trying to do instead of how i'm trying to do it?
maybe
though I've never seen C complain about a cast
return (mp_obj_t) capsule_msgor somesuch
It doesn't make a lot of sense to cast a string to a function pointer, so I can imagine the compiler giving you grief about it.
it's a void pointer not a function pointer
and C doesn't really give a crap about most things
If it's a void pointer, you should be able to cast things to it.
However, "didn't like it" doesn't tell us much.
Apologies that I didn’t add in the message.
I am trying to make a module that will save a string between reloads
C.load(“it’s not pining”)```
And after a reload:
```import capsule as c
C.unload()#it’s not pining```
*typing on iPad: odd caps
my though is to make a char array of the length of the string and store the raw bytes in it then free in on the next load
granted the above code will not do that
@wallarug Any update? Still need this open?
Fixed by #2000 . Thanks @jepler
With the display speedups I think we can close this. There is certainly more work to do for audio and potentially collisions but we should have specific issues for those as needed.
This is done. Displays now refresh automatically.
We've been doing this and can formalize with AdaBot if we like.
hiya, we no longer support the esp8266 as of 4.x - please check out micropython for esp8266 support! :)
hiya, we no longer support the esp8266 as of 4.x - please check out micropython for esp8266 support! thank you :)
hiya, looks like you figured it out & we no longer support the esp8266 as of 4.x - please check out micropython for esp8266 support! thank you :)
This PR reworks the display refresh mechanics by replacing wait_for_refresh and refresh_soon with refresh. refresh is required for ePaper and not required for regular displays when auto_refresh is True. auto_refresh can be set during execution to prevent intermediate screen updates. This fixes #1691. 4.x code that calls wait_for_refresh and refresh_soon can have it removed for nearly identical behavior. (wait_for_refresh may have caused a slight delay that could be replaced ...
@tannewt i think you fixed this issue in
https://github.com/adafruit/circuitpython/pull/1989
@arofarn - please try again if you can, will close this issue from lack of activity
Hey Scott,
Happy to have this one closed off. I'm going to PR some changes this weekend for the other issue.
It will be good to have a curated list of CircuitPython talks from different speakers around the world, delivered during any conference, meetup or any other event.
Yes it does. Not surprising since it appears to be a design issue on the Xenon.
I think Mu may need an update to handle this.
Thanks for this massive amount of work!
I'm not sure what "the current frame rate is below the minimum frame rate" means? Is this a validation check, or is it dynamic (things are going too slow between calls to refresh)? If the latter, then any call to refresh() could potentially throw an exception, which in many cases one would just want to catch and ignore (especially when debugging or when not an experienced programmer). Maybe better to return a status value (like the boolean refreshed/not refreshed, or a tri-state value: refr...
Can you return False if a refresh didn't happen and True if it did? That will give a hint to the caller about whether it should speed things up on its side (like dropping some calculations, etc.).
@sajattack#7799 yes. My reasons for not using it is that it will have a limited number of write cycles and it won't be blank on boot up
@tulip sleet just got the ble_periph demo runnig on my CPB -- woohoo! -- central on a pca10059
I have both android and IOS devices so I'll be happy to try to break it whenver you want 😉
but now time for some yard work ....
@solar whale Thank you for taking care of those PRs!
