#circuitpython-dev
1 messages · Page 294 of 1
I've built some systems powered by energy harvesting, became quite fond of TI's MSP430FR line, which is quite power efficient and has non-volatile RAM available.
@slender iron how low are you aiming with sleep? In comparison to the Pyboard-micropython sleep stats of 300uA stop and 30uA standby?
Thanks! And thanks for your patience while I missed the notification for 2 days.
I'm going to assume these "cancelled checks" are nothing to worry about.
@ionic elk first pass just idling the cpu
Doing proper low power is going to be hard work without some os-type abstractions...which doesn't mean we shouldn't do it, just w me shouldn't underestimate it.
(I have my nrf52 up now, but distracted into solidifying the blackmagic probe support for it just at the moment)
@fallen anvil what do you mean by proper
Clock speed manipulation, clock feed switching to perhiperals, switchable pull-ups, power on/off to individual perhiperals etc.
It's most easily done with a sane set of abstractions that we can plug into.
Switching off lumps of ram and/or flash.
You can get really obsessive about this stuff, and it's great fun hunting for that last 10uA :-)
I can't remember the name of the blog now (and he since stopped doing it) but there was a fellow who was doing things like getting his AVR-based sensor nodes to run for a year on single cell batteries. Pretty amazing stuff to me.
oh nice, looks like he's blogging again even
I mean, all I really need is a WFI state for circuitpython, that puts the MCU in Standby mode. It's easily the module I've been most asked about by other people I know using Circuitpython too, though that's anecdotal of course.
Right now people have to do it by including an external hardware reset system, and lose all their RAM. Whereas if you use Arduino or Mbed or Zephyr or whatever, you just call "sleep()" and that's it, you can run for 6 months without needing a battery change.
@slender iron Do you remember why you did this https://github.com/adafruit/cookiecutter-adafruit-circuitpython/pull/12 ?
Been a while.
@fallen anvil I don't want to turn any ram off because I want to remember where we are. We're pretty good about clock gating though.
@ionic elk I'm skeptical about 6 months for what I'm looking at
@idle owl I removed todo from the list because I add them for later
@slender iron ok.
@solar whale Does it hang if you're in debug mode, too?
yes - here ```
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.0.0-alpha.4-127-g22b7050c4 on 2019-10-03; Adafruit Feather M4 Express with samd51j19
import old
- Initializing DHCP
*** Get socket
Allocated socket #0:68
*** Connecting: Socket# 0, conn_mode: 2
*** Opening socket 0
w5k socket begin, protocol=2, port=67 - socket_available called with protocol 2
Bytes avail. on sock: 308
* Processing 8 bytes of data - UDP Bytes Remaining: 300
Bytes avail. on sock: 300
* Processing 300 bytes of data - socket_available called with protocol 2
- socket_available called with protocol 2
- socket_available called with protocol 2
Bytes avail. on sock: 308
* Processing 8 bytes of data - UDP Bytes Remaining: 300
Bytes avail. on sock: 300
* Processing 300 bytes of data
*** Closing socket #0 - Found DHCP server - setting configuration...
DHCP Assigned IP: 192.168.2.32 - Get host by name
*** Get socket
Allocated socket #0:17176
*** Connecting: Socket# 0, conn_mode: 2
*** Opening socket 0
w5k socket begin, protocol=2, port=53
That's from the latest PR?
no -- that is current master
I'll do latest PR now
ooh -- debug onlatest pr works!!!
I separated a lot of the lower-level socket driver on latest PR after seeing your output
ah -- it is working now.... even without debug
I must have goofed on first try of the latest PR
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.0.0-alpha.4-127-g22b7050c4 on 2019-10-03; Adafruit Feather M4 Express with samd51j19
>>>
>>>
>>> import nodebug
Wiznet5k WebClient Test
Chip Version: w5500
MAC Address: ['0xde', '0xad', '0xbe', '0xef', '0xfe', '0xed']
My IP address is: 192.168.2.32
IP lookup adafruit.com: 104.20.39.240
Fetching text from http://wifitest.adafruit.com/testwifi/index.html
----------------------------------------
This is a test of Adafruit WiFi!
If you can read this, its working :)
----------------------------------------
Fetching json from http://api.coindesk.com/v1/bpi/currentprice/USD.json
----------------------------------------
{'time': {'updated': 'Mar 5, 2020 21:48:00 UTC', 'updatedISO': '2020-03-05T21:48:00+00:00', 'updateduk': 'Mar 5, 2020 at 21:48 GMT'}, 'disclaimer': 'This data was produced from the CoinDesk Bitcoin Price Index (USD). Non-USD currency data converted using hourly conversion rate from openexchangerates.org', 'bpi': {'USD': {'code': 'USD', 'description': 'United States Dollar', 'rate_float': 9125.52, 'rate': '9,125.5233'}}}
----------------------------------------
Done!
whoo
@solar whale I don't know why your tags aren't up to date (alpha.4)
Not sure what happened. All good now after re-cloning.
Ooh just saw that. Will need to recheck . That may be an build before reclone... thanks for noticing @tulip sleet I’m AFK for the evening. Will investigate tomorrow.
Ah those say 2019-10-03. I’ll update tomorrow
If I had extra sensors, I would be very tempted to solder my sensors to a proto-board. I am very tired of having stuff not work that I know works.
Dodgy connections can really make things less fun. There are some nice temporary connectors out there that work well.
I replied on #help-with-robotics.
all the wiznets are de:ad:be:ef:fe:ed MAC addresses? That's .. not great. Having more than one on a single network would cause interesting problems.
can circuitpython generate a MAC address from the 2^47 LAAs and its own unique ID?
I still don't want multiple versions for a single board. Multiple versions are a long term support burden that I'm not willing to commit to. So, my preference would be to always freeze these two libraries and bus device in because both chips are on the board.
I agree, if we should have only one board it's the best fit
There is no need to freeze the binascii library in because the built in version can be enabled with
MICROPY_PY_UBINASCIIand will definitely be smaller and faster.
...
@tulip sleet much better now - those were just older MCUs I had not updated ```
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.0.0-15-ge98991fd7 on 2020-03-03; Adafruit Feather nRF52840 Express with nRF52840
and Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.0.0-15-ge98991fd7 on 2020-03-03; Adafruit Feather M4 Express with samd51j19
@solar whale great! I thought it was perhaps some weird github tag pulling issue.
I'm still a bit confused, but I'll keep an eye on it -- since the dates were also old, I think those wer just boards I pulled out without updating.
I think that unless you "git fetch --tags" you can miss getting tags. You can also control this with the gitconfig variable remotes.<name>.fetch. I think I understand the specific circumstance in which you can miss getting tags, but I'm not sure I can describe it accurately...
also fetched; the effect is to fetch tags that point at branches that
you are interested in. This default behavior can be changed by using
the --tags or --no-tags options or by configuring remote.<name>.tagOpt.
By using a refspec that fetches tags explicitly, you can fetch tags
that do not point into branches you are interested in as well.
but basically I think that if revision AABBCCDD gets tagged after you fetched AABBCCDD into your local repository, you may not get the tag fetched
because then that revision is not "the [history] being fetched"
i rarely fetch tags explicitly; they just show up. It does not seem to be a problem. But I am running the latest git from an Ubuntu PPA. I regularly do:
git fetch adafruit # upstream
git checkout master
git merge adafruit/master
git push
git pull --prune # remove deleted PR branches
You probably do this too.
@onyx hinge no, they have a sticker which comes with them w/their HMAC. that's a default
compute a locally administered address from the CPU's unique identifier using hashlib: https://gist.github.com/237a7de0e8f705a87593586aa5647fb6
I am running into issues with PR #2666, which is repeatedly failing due to "reference is not a tree" errors, even after merging from upstream. This is discussed in https://github.com/actions/checkout/issues/23, which seems to indicate that we should upgrade to checkout@v2. I will try that in #2666.
Oh blah, 'with: submodules is not supported in checkout@v2 yet. It's just being tested now: https://github.com/actions/checkout/issues/176. Reverting try in #2666 (which maybe just might fix my own build problems).
We should try this again after https://github.com/actions/checkout/issues/176 suceeds.
The churn of trying checkout@v2 (see #2683( and then reverting it fixed the build problems.
Has anyone had problems with a script not being able to get a lock on the I2C bus?
@tulip sleet Actions really doesn't like that PR. 😣
i know, right 😦 i'm going to sleep on it
Now I am getting a "ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE." errors on a few random builds, perhaps because of VM problems??
Looks like the adafruit_pypixelbuf.mpy available in the 5.x.x library downalod from circuitpython.org still requires re:
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
main.py output:
Traceback (most recent call last):
File "main.py", line 4, in <module>
File "/lib/pixelbuf_neopixel.py", line 38, in <module>
File "adafruit_pypixelbuf.py", line 32, in <module>
ImportError: no module named 're'
@paulmand3l You're right, we forgot to do a release after fixing the re issue. I jus made https://github.com/adafruit/Adafruit_CircuitPython_Pypixelbuf/releases/tag/1.0.3, which has the re fix.
Note also that checkout@v2 by default does a --depth 1 clone, which doesn't work for us, because we use the nearest tag for version information.
To do a full clone, you do:
with:
fetch-depth: 0
Alternatively, to make sure all the tags are fetched, see https://github.com/actions/checkout/blob/master/README.md#fetch-all-tags. I think that might work and still avoid fetching some of the history.
I spent some time researching whether one could do a shallow clone and then ...
It really drives me nuts that often the pages that Google returns for circuitpython documentation are for some random old version like 2.x or 3.x. There's got to be some way of dealing with that, right? I figure this must be something that happens on a lot of documentation sites.
@onyx hinge Jeff, is it possible to locally (i.e., on my computer) test ulab against circuitpython? I have cloned from https://github.com/adafruit/circuitpython, but I couldn't find my code, so I presume, this won't work out of the box, right?
@lapis hemlock yes it should be possible! the ulab code is in extmod/ulab and it may not be there until you run the "git submodule update --init" step. I know there is a guide about building circuitpython, let me see if I can find it.
@onyx hinge Thanks! I hadn't executed submodule update, so no wonder that I didn't find anything😊
@onyx hinge Well, I have succeeded, thanks again. However, it could be beneficial to extend https://learn.adafruit.com/building-circuitpython/introduction with a short section on compiling for unix. Beginners will be tripped by the absence of it. I would write it up myself, but I couldn't find the source of the page.
@ionic elk ive noticed that too. I don't know much about it, i wonder if robots.txt file could be used somehow to limit google to latest
Or maybe the noindex meta tag. https://support.google.com/webmasters/answer/93710. Not sure how customizable readthedocs pages are
@lone axle @ionic elk readthedocs supports custom robots.txt and (I think) sitemap.xml files, so we could excluded unsupported versions
i tend to use the rtd search box, but it's slow
Ooh nice
I wonder if that would impact search rankings... It'd be nice if a popular page from a previous version would still boost the pages of new versions
Do the readthedocs pages get made from the docs folder in the repos? Or is that seperate?
yes, rtd is made from the docs folder
I left a CLUE running some code with a lot of printing to the USB. I just noticed the output froze on a terminal window. It did respond to a control-C but now is ignoring me. That CLUE still has 5.0.0-beta.5 on it. Has anything like this been seen? The drive over USB was still working, btw. I'll update it to 5.0.0 and see if I can make it do it again.
@simple pulsar were you using the onboard devices (besides the screen)?
It was plotting some values probably from a sensor, e.g. i2c
we have seen one or more i2c devices hang up. the device pulls SDA low and stays there, which hangs the whole bus, and any I2C operation in progress. it needs a power cycle to clear. We have an issue and proposed fix: https://github.com/adafruit/circuitpython/issues/2635. This has happened on CPX as well, but it's much rarer. We didn't add the fix to 5.0.0 because we'll need to do thorough testing.
The plotting was still running, just the USB output appeared to have stopped mid line on terminal window. If I saw something like that I'd normally suspect the terminal program as being just as likely the problem
But to my surprise it took control-c input
ah, that is different, what host computer OS was this?
In fact it still works
I've got unidirectional serial over USB
This is PuTTY on my trusty windows 8.1 desktop
that doesn't ring a bell. did Windows go to sleep at some point?
It would have screen saved (power). Nothing bad would happen on a proper o/s with that event...
I also can't type on REPL, I just can do control-C
But this is 5.0.0 beta 5. I can upgrade and see if I can reproduce.
Yeah, I can force a reload still by copying files onto the driver, and I can do control-c but not much else. It's a bit like messing up ones stty settings. All very odd.
@ionic elk @tulip sleet I've updated RTD to default to version 5.0.x
@slender iron nice, ty!
we could robots.txt out the anything earlier than 4.x (or even 5.0.x)
hmmm yeah top result for Circuitpython PulseIn on my machine (incognito) is still 2.x docs
might take time to propagate though
this doc mentions a "hidden" state that would remove versions from a sitemap
@tulip sleet It actually stopped output on the second text arg in a print statement - that's an indicator that the bug is less likely to be the terminal side of things. I'll update everything and stick it on a windows 10 machine and leave it running for a few hours later on to see what happens.
tnx!
One minor improvement. Good otherwise. Is the CI simply busted now?
There is no need to freeze the binascii library in because the built in version can be enabled with
MICROPY_PY_UBINASCIIand will definitely be smaller and faster.I don't know about it, if it exists, is smaller and faster, why isn't it already enabled ?
Because it still takes up space. For builds that don't use it, it is smaller to omit it. In this case we should enable it instead of freezing in the Python version since we want it.
Rotaryio, usb_hid and usb_midi co...
@tulip sleet I just finished up the changes to nrf52 and Uwe has pushed them as a PR into https://github.com/blacksphere/blackmagic/pull/601 ...looking for testers if you fancy giving it a shot. No warranty.
@fallen anvil thanks, I will try! I'm debugging a SAMD51 problem at the moment 🙂
No prob. It will probably change reasonably quickly as it solidifies but I'm seeing about 32K/sec of flash speed at the moment
Minor doc update to add two new sensor values. This came up in discussion here:
https://github.com/adafruit/Adafruit_CircuitPython_APDS9960/issues/18
These are just my initial guesses at good entries. If we want something different, can discuss.
FYI -- for my first try of an SPI device on a Teensy4.0 - running rfm69 radio-- no problems so far -- working very well.
Hi All - this has the potential to be a an "in the weeds" kind of topic, but it's the right time to ask, I think.
We are getting ready to start customizing a CP build for our SAMD51+FPGA board, and part of what we need to do includes adding code that affects changes to the FPGA I/O and fabric as part of the standard things you'd do in your code like defining Digital In/Out, etc. We have this working for Arduino and I really want to see it supported with CircuitPython, as well, if possible.
We are using a secondary I2C between the SAMD and MAX 10 as the configuration bus. Can CircuitPython support this kind of architecture, as well?
@toxic pasture is our lead software developer on this and may chime in on this thread, as well. He's new to both CircuitPython as well as the CP community. But he's heard a lot about it from me over the last year+ 🙂
I took over ownership of the micropython-adafruit-ht16k33 library from Adafruit , and am now the maintainer for it. How do I delete a branch from my local repo?
hmm bytearray doesn't have decode and can't be used with join.
git branch -d
bytes( nvm.... that ^^
@timber mango local = on your local computer? or in your github account?
i think this covers both:
https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github/keeping-branches-trimmed
@tidal kiln Yes, local on my computer.
ok, the command line thing above then. but checkout that guide i linked. it also shows how to delete the branch in your github repo.
Thank you!
I am reading that now.
I found out what has been causing at least some of the problems with my circuit. One side of my doubler is bad and I do not know if I can fix it.
@indigo wedge @fallen anvil with ulab merged, y'all could add to imx builds - would be a good match i think 🙂
@tannewt do we need to merge this somewhere besides master to ensure it goes in 5.1.0?
@tulip sleet 5.0.0 survived 70 minutes of spitting data down serial line on Win10, I'll leave it going for longer tomorrow just to give it a thorough test.
It also survived being left on Sol's prototype board all night without crashing.
part of my accidental burn in testing.
There's no 5.1.x branch yet, so no problem just merging to master.
@old smelt @toxic pasture Neat! Feel free to mention me if you have questions!
@gilded cradle https://forums.adafruit.com/viewtopic.php?f=60&t=163160
@prime flower https://forums.adafruit.com/viewtopic.php?f=60&t=162631
Is board.I2C() supposed to work?
yes
I was just using board.I2C() on clue https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/master/ulab_Crunch_Numbers_Fast/cluepulse.py#L67
@jepler Please take a look at this. I've only redone the nRF port so far and would like high level feedback before I do the others. The only remaining work for nRF is to get PulseIn working again which uses the monotonic clock for pulse timing.
@slender iron ooh I will take a look. may be monday though.
no problem @onyx hinge ! I'm done for the weekend too
I do have a test sensor going to see how much things improve
what HW are you using for current measurement? Or are you just looking at operating time?
I gave the patch a scan and nothing bad jumps out at me.
@onyx hinge I bought a https://www.joulescope.com/ . I'm doing operating time for a sensor I have going
Joulescope is the most affordable and easy-to-use precision DC energy analyzer. Joulescope measures current and voltage, then computes power and energy. Use Joulescope to optimize energy consumption and battery life during product development. Great for reducing microcontrolle...
@tulip sleet Is there an equivalent to the "update-bootloader" for the nRF52840? or do all bootloader updates require a J-Link. In particular, I was wondering if i had to attach a J-Link to my Bluefruit_Sense.
@solar whale The README implies that one can create a .uf2, which I tried, but it didn't seem to work. I need to ask Thach. However, you can use adafruit-nrfutil to do a DFU update: you don't need a J-Link. Using the downloaded zip, do:
adafruit-nrfutil --verbose dfu serial --package Downloads/feather_nrf52840_sense_bootloader-0.3.1_s140_6.1.1.zip -b 115200 --singlebank --touch 1200 -p /dev/ttyACM0
or if you have a clone of the repo:
make BOARD=feather_nrf52840_sense dfu-flash SERIAL=/dev/ttyACM0
@tulip sleet thanks -- dfu-flash worked fine -- been too long since I did that! I now have a FTHRSNSBOOT! and a RED LED
@solar whale I just asked Thach: he says it is not yet implemented
Thanks -- I was not looking forward to tacking wires to the swd pads
I totally forgot about dfu-flash
i had to rediscover it too, i went through the same process
even though i saw it in the readme - just forgot how it worked!
i extracted the first command above from the Makefile
At the other end of the spectrum it's interesting to see there's already awareness that as CircuitPython starts running on faster processors then other assumptions can breakdown, e.g. switch debounce requirements: https://learn.adafruit.com/make-it-switch/debouncing#circuitpython-6-9
In git, what does "rebase" mean? I am confused.
@gilded cradle Why? python if isinstance(bitmask, (tuple, list)): bitmask = bitmask[0] << 8 | bitmask[1]
Looks like it assembles a list of bitmask pieces (presumably bytes) into a single (16-bit?) quantity?
@timber mango think of rebase as re-writing the history. it will make the target worktree reflect the exact history of commits as the base/source.
I noticed one occasion where leaving an Adafruit CLUE running 5.0.0 beta 5 with some very verbose output to stdout for over an hour caused the terminal output to stop. I've just reproduced this with the same application/library code on 5.0.0 but it took approximately 130 minutes to do it.
- 5.0.0 beta 5 with PuTTY 0.70 on Windows 8.1
- 5.0.0 with PuTTY 0.73 on Windows 10
The application is reading analogue values from P0-P2 and graphing them. It does not have the serial console active ...
@raven canopy OK. So, I should just do a git rebase in the repo then?
why are you rebasing? not being combative; just want to make sure its the right tool for the right job 😄
@main meteor I understand what it does. 🙂 I just do not understand the reason for the change (in a PR).
@raven canopy It is a change requested to one of my PRs.
@timber mango link? rebasing is a drastic measure
@prime flower I'd been regression testing the wiznet5k commits up to a point after it was working for me, but now I consistently get the ValueError: bytes out of range on the release. Should I open a new issue on the library with debug dump? update: nevermind (maybe?) It only happens when the Airlift is plugged in also, but the wiznet5k simpletest fails (no CP to init or use the Airlift - I do have the eth CS pin changed to board.A5) update2: yeah I think nevermind, I disconnected everything and did a full power cycle and now it's not happening, maybe the Airlift board was in a state.
@raven canopy https://github.com/adafruit/Adafruit_CircuitPython_HT16K33/pull/63#pullrequestreview-360000848
@timber mango i would ask for some clarification. i'm not seeing why a rebase would be needed. there are no conflicts, but it could just be asking to pull in merged changes that occurred after the PR was opened. a simple pull upstream master would fix that...
assumes your remotes were added as upstream
@raven canopy If I remember correctly, I did add the remotes as upstream. That is how I was taught. 🙂
one of those "unwritten" standards, i presume. 😄
I do not know. Maybe it is the way my mentor was taught and passed down.
I need to understand what something does and why I should use it before I go using it on something. 😉
@raven canopy If a mentor can not patiently answer all of my "How?," "What?," and "Why?" questions, then they are not the mentor for me. I ask a LOT of questions to get good understanding of something.
if someone is asking for a change in your PR, there are usually two reasons:
- they are requesting a change in your code. Just make the change, commit and push again.
- Your PR has merge conflicts with upstream. In that case, fetch from upstream, merge from upstream into your PR branch, fix the merge conflicts, and then re-push.
we basically never use rebase, because it's too easy to make a mistake
you can use rebase in your local repo to mash together multiple commits into one, but i would basically say never rebase if you have pushed to a repo other than your own, or anyone has pulled/cloned your repo
and that is totally fair, when context and situations allow. 😉 i too am a why does this work person. my childhood was filled with broken gifts, because i was more interested in the what, how, why. hehe
yeah, i think the "rebase" in the context of that change request is more along "bring to current".
that is the point of @raven canopy saying it rewrites history; if other people have the old history, then you will mess them up by rebasing
@tulip sleet 1) I may ask questions about said code changes and possibly why it should be done, especially if this is something new to me. 2) I work to resolve such conflicts on my own first and then ask questions if I do not understand something. I asked about rebasing because it seemed like it was a major operation and I did not understand what it did and why. 😉
can you point to the specific request?
@tulip sleet Yes, now I understand rebasing much better because of @raven canopy's explanation.
I am an old dog, but I can learn new tricks. 😉
@tulip sleet I already pointed @raven canopy to it, but it is at https://github.com/adafruit/Adafruit_CircuitPython_HT16K33/pull/63#pullrequestreview-360000848
Now, where did I put my long shoe horn? 🤪 😎
in that case, it is because there's an excessive number of commits. You can squash all those into one or a few, and then push -f to the PR. That will rewrite history but since it's only your PR that's affected, it's not going to mess someone else up.
@tulip sleet I did have quite a few small commits. Now, I am starting to really understand this. I have not done a lot of these things before, so a lot of this is very new to me. I have never tried contributing to an Open Source project before, especially not one this major.
some people like very "sanitary" commits and they go to great lengths to do that. Several commits is fine, but a lot may be worth squashing. I once went to a talk about git with a significant section on rebase, and the presenter managed to mess up a simple example, which just reinforced my inclination to avoid it in most cases.
@tulip sleet By "sanitary," do you mean one commit handles just one thing and one thing only?
no, just that some people like to minimize the number of commits
Ah, OK.
messy vs "clean"
Got it. 😉
I am usually messy when I start out with something new, but I make great effort to graduate more towards clean.
I have done many different things in many different computer languages over the years, starting out when I was in 7th grade.
That includes APL, FORTRAN, BASIC (several dialects including DEC's Basic-Plus), Python, Pascal (including Apple USCD Pascal), C, and some C++. I have also dabbled in Go, Elixir, and other languages.
@tulip sleet @raven canopy Thank you for your great explanations. They have helped a LOT in my undertanding of rebasing as well as given me insights into how the "Circuitpython Gang" works. 😉 🙂
you're welcome!
😃 😉
Exactly as @main meteor said. That way you can pass 2 8-bit masks instead of a giant 16 bit one. It just gives you options.
If all bitmasks are 16-bit what effect will that have?
We can not assume that somebody wants to use 8-bit masks.
Just because some masks might be only 8-bit values, that does not mean it is an 8-bit mask.
The upper 8-bits might just happen to be all 0's.
Code is here, both files needed, strip the .txt off. once it starts graphing click left button until Pad appears for same output I left it running with.
code.py.txt
plot_source.py.txt
@timber mango, is that preventing you from making some kind of change? If we were to remove it, that would be a potential code breaking change.
I do not understand. I am just trying to accomplish a goal.
You could pass either a 16-bit mask as an number or you can pass 2 8-bit masks inside a list or a tuple and either should work fine.
Take a look at https://github.com/adafruit/Adafruit_CircuitPython_HT16K33/blob/master/examples/ht16k33_segments_simpletest.py for an example.
@gilded cradle I do not understand how that applies to what I am doing with the 14-segment animations, which only reside within one demo script.
I am hesitant to mix 8-bit and 16-bit processing techniques.
Just to make sure we're talking about the same things, you are you referring to https://github.com/adafruit/Adafruit_CircuitPython_HT16K33/blob/master/adafruit_ht16k33/segments.py#L270, correct?
Yes, this is what I started out asking questions about.
Assuming you're not trying to modify set_digit_raw(), you should just be able to use 16-bit numbers and you should be fine.
Other users may prefer using 8-bit numbers and they have that option as well.
I am not modifying any part of the library for this. My code only uses set_digit_raw() to do what it does.
Just don't pass 2 16-bit numbers in a list or tuple to that function and you should be fine 😉
Then they should use only 8-bit numbers all the way through. What do you mean by "two 16-bit numbers?"
I mean don't pass something like [0xFFFF, 0xFFFF] or you may get unexpected results.
It allows 16-bit numbers because I needed some compatibility with https://github.com/adafruit/Adafruit_Python_LED_Backpack
That may better answer your "why".
My code uses only 16-bit bitmasks, and set_digit_raw() does not seem to mind at all.
Correct, it just ignores that snippet of code if you pass in 16-bit.
Ignores what snippet of code?
If you happen to pass in 8-bit, it converts it to 16-bit and continues processing as normal.
This snippet:
if isinstance(bitmask, (tuple, list)):
bitmask = bitmask[0] << 8 | bitmask[1]
I guess I don't understand what problem you are having with it.
An 8-bit value is also a 16-bit value, and a 32-bit value, and a 64-bit value. What happens if bitmask and bitmask[0] are both full 16-bit values (> 255)?
"undefined behaviour" !
Hmm, ok. Perhaps we should be adding & 0xFF and not assuming they are 8-bit.
That makes more sense @timber mango
Are you not then just taking the lower 8-bits of a 16-bit value and ignoring the rest?
correct
This is not correct behavior then.
Right, would you like to open an issue on github?
For what?
For pointing out that if you pass numbers > 255 then you get unexpected results.
Isn't there a type difference here, e.g. the user passes 123 (an int) or (0,123) (a tuple)
Yes, but if they pass a tuple or list with ints > 255 then it doesn't work right.
@gilded cradle There is no unexpected result with my code. All bitmasks are 16-bit.
Right your code is fine.
I'm just saying the code inside of set_digit_raw could be improved.
It is working perfectly with everything I have thrown at it.
I'll make a small revision later, but it won't break or change anything that currently works.
Revision to set_digit_raw()?
We will have to wait and see what happens then. How exactly did you intend for it to work? Maybe it is working perfectly as is and requires no revision.
@gilded cradle As of now, I believe set_digit_raw() will work with any length of bitmask, including 8-bit, 16-bit, 32-bit and 64-bit, or above. Will this still be the case after you make your revison?
It actually won't work correctly now in certain instances. Let's say fo instance you pass in 2 16-bit or 32-bit numbers. It would left shift the first number over by 8 bits (leaving a 24-bit or 40-bit number) and bit-wise OR everything with the result also being 24 or 40 bits. After that, everything is masked off, so the lower 8-bits would be fine, but the upper 8-bits would be the bitwise OR result of the lower 8 bits of the first number and the upper 8 bits of the second number, which is where you would see unexpected results. My revision would just mask things so that it only used the lower 8 bits of each number passed in a tuple or list. If you pass the number outside a tuple or list such as with your animation code, then you wouldn't see any change.
set_digit_raw() needs to work equally well with all lengths of bitmasks. It has worked perfectly well with all the 16-bit bitmasks I have passed to it. If there are edge cases where this would not be true, then maybe it should be revised to work in ALL cases.
You can not throw away 8 or more bits of data and call it good.
My problem is here: "My revision would just mask things so that it only used the lower 8 bits of each number passed in a tuple or list."
The thing is, that hardware only works with 1 16-bit number and so if you wanted to pass 32-bit numbers, it still has to do something with them to make it work on the hardware. I already have added the revision, which you can see here: https://github.com/adafruit/Adafruit_CircuitPython_HT16K33/blob/master/adafruit_ht16k33/segments.py#L271
@gilded cradle hardware we currently have might work only with 16-bit values, but I assure you that future hardware will work with 32-bit and even 64-bit values. Then, your revision will just chop off the high 8 bits of my 16-bit bitmasks and throw it away.
I just forked and renamed a copy of the Adafruit_Circuitpython_HT16K33 library for my own use under my main Github account.
Hi, the only reason my change would break your code is if you were relying on erroneous behavior to get a specific set of results. However, the way you have described it, you weren't doing that, so your code should continue to run fine.
@gilded cradle I will just have to disagree for now and leave it for later until I can do my own tests with both your version and mine.
Sounds good. 🙂
That reminds me, two of my PRs are still waiting for action. 🙂
Yes, I commented on both earlier.
One still says "Please rebase" and I did not see a comment on the other. I will look again.
We already talked about the rebase thing.
You should be able to pull in any changes from the adafruit master and it will remove code that you submitted in another pr and was already merged.
I have what I need in my own version of the library. I will wait for you to merge your revision before trying my stuff with it.
I already did all the pushing and pulling I needed to do. 😉
I have much interest in the HT16K33 library because I now own and maintain the micropython version of. 😉
I've hacked up the Arduino version to add keypad support and two digits per slot.
Hi @timber mango, my revision was already merged a little earlier, so you can test whenever you want.
I noticed that. I just backed that revision out of my library copy. 😉
Why do I have to keep logging into Github to push something from my geekguy_wy (Adafruit stuff) account?
I'm not sure. Maybe try something like this? https://stackoverflow.com/questions/35942754/how-to-save-username-and-password-in-git
You can install an ssh key and configure your ssh client to use it to authenticate.
I already have an ssh key and have set it into my github account.
I have two github accounts, one for just my stuff, and one for the stuff I do for Adafruit.
Can different github accounts have different ssh configurations on the same computer?
Also two separate users on my computer.
I have never had to use any of those methods for my main github account.
Good question. I've only ever used 1 github account per computer. Maybe look into enabling multiple credentials.
I need to keep everything separated and isolated from each other due to um, issues.
Maybe 2 different git clients or something like a virtual environment perhaps?
Something is messed up with my geekguy_wy account because I can not authenticate so I can push now. 😦 I just set a brand new ssh key to my geekguy_wy github account.
Anyway my head is really wonky and I need my walker just to stay standing now, and my asthma is kicking up thanks to inconsiderate smokers throwing their butts all over. I am going to lay down for awhile.
Yes, you can have different github setups.
Here are some example stanzas from my ~/.ssh/config file: ```
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa
Host github-tst
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_tst
IdentitiesOnly yes
They're both at github.com, but I refer to the github-tst one when I want to use my tst identity there.
There's a useful writeup here https://mherman.org/blog/managing-multiple-github-accounts/
Smokers can strongly impact my ability to think usefully too.
@timber mango I use libsecret as a credential helper on Ubuntu, but I only have one account. I never use ssh, only https access. https://stackoverflow.com/questions/36585496/error-when-using-git-credential-helper-with-gnome-keyring-as-sudo/40312117#40312117
l = [[]]
l0 = l[0]
print("l[0]", id(l[0]))
print(l0, id(l0))
Adafruit CircuitPython 3.1.2 on 2019-01-07; Adafruit Metro M0 Express with samd21g18
>>> from nested import *
l[0] 536876704
[] 536876704
>>> id(l[0])
536876704
>>> id(l0)
536896144 # should not be different from id(l[0])
>>>
In CircuitPython 2.x, MicroPython, and CPython the id() values are the same in the REPL. My guess is that this has to do with making an object long-live...
Hi folks, Is there a way on the NRF52840 Feather Sense to disable the radio in CP? I'm using an AirLift wing and don't really want the BLE to interfere. On a side note, I'd love any thoughts on this forum post about using the Solar Charger for a Feather setup https://forums.adafruit.com/viewtopic.php?f=57&t=162827&p=800794#p800925
@tough flax maybe it's _bleio.adapter.enabled = False ? https://circuitpython.readthedocs.io/en/5.0.x/shared-bindings/_bleio/Adapter.html#_bleio.Adapter.enabled
.. calls sd_softdevice_disable() and also resets USB for some reason.
hathach did it so I'm sure it's right and needed, but something to be aware of!
Ok, it's a good place to start - thanks
@tough flax The softdevice doesn't get enabled unless you import _bleio, and it won't use the radio spontaneously. It used to advertise its file editing service, but we turned that off. That is a recent fix, so use 5.0.0.
Ok - sounds like a plan... Anyone have experience w/using both BLE and WiFi in a tight space? I wouldn't have worried, but recently had a BLE keyboard make my iPhone's WiFi go flaky
@tulip sleet Why is it called _bleio instead of just bleio? Typically, things that start with an underscore are for internal use only and not to be called directly.
there's some explanation in the intro paragraph here:
https://circuitpython.readthedocs.io/en/5.0.x/shared-bindings/_bleio/__init__.html#module-_bleio
Now, I am getting fatal: unable to access 'https://github.com/adafruit/Adafruit_CircuitPython_HT16K33.git/': The requested URL returned error: 403 when I try to git push adafruit.
looks like you are trying to push to the adafruit repo, you should push to your fork
then make a pull request to submit the changes back to the adafruit repo
@gilded cradle I just pushed a commit to switch from int() to round() for PR #65 on HT16K33.
@tough flax What make/model of keyboard is it? (I am unlikely to have any useful info. on this btw!)
This one Logitech Bluetooth Multi-Device Keyboard K480 - Black - works with Windows and Mac Computers, Android and iOS Tablets and Smartphones https://www.amazon.com/dp/B00MUTWLW4/ref=cm_sw_r_cp_api_i_hQezEb31SPW39
@tidal kiln Thank you!
Eeeek, my computer does not like my PyGamer at all. It reboots when I plug the PyGamer in. It will go into a boot loop with the PyGamer plugged in. This is not good.
https://docs.scipy.org/doc/scipy/reference/generated/scipy.misc.face.html#scipy.misc.face possibly the most miscellaneous function I've ever heard of
Get a 1024 x 768, color image of a raccoon face.
@tough flax I like this one much better, but then I would need a Bluetooth trackball too. https://www.amazon.com/dp/B01LZTBKBG/ref=twister_B01MF90P5X?_encoding=UTF8&psc=1
numpy doesn't seem to have anything for image scaling, and scipy's is over-powered (order 5 splines!?) https://docs.scipy.org/doc/scipy-1.2.0/reference/generated/scipy.ndimage.zoom.html#scipy.ndimage.zoom
I wonder what would work best in ulab; or maybe Pillow is better inspiration for image operations? I think the first use case is scaling and resampling thermal camera images, 8x8 or 32x?? size and single component.
@onyx hinge The GIMP has a nice image scaler.
NRF52840 Express is the right build for the new NRF52 Sense?
Or would it be the Clue? I'm going to try the Express
@tough flax there is a feather_bluefruit_sense build
It has some extra pins defined https://github.com/adafruit/circuitpython/blob/master/ports/nrf/boards/feather_bluefruit_sense/pins.c#L48
Just found it a bit ago... My code worked with both. And my project is frikkin working 🙂 BTW, thanks for trying on the Solar question.... still not sure of the right answer
@onyx hinge If you find any easy CP way to let's say "double the resolution" of an image... I would love to get a nicer image from thermal sensor. Raw resolution is 32x24.
<@&356864093652516868> note that most of the US switched to Daylight Saving Time today. This moves the meeting 1 hour earlier in UTC time, so be aware of this if your local time follows a different rule.
oh no
Im looking to do some signal analysis - like peak detection - on circuitPy - and looking at libraries like: https://github.com/zmzhang/libPeak - but often these require scipy or numpy. Im assuming there is no scipy on circuitpy but if anyone has any tuts or suggestions I'm all ears.
@analog valve take a look a pulseio
also, there is some work ongoing for getting FFT libraries working
ok - Im guessing you mean https://circuitpython.readthedocs.io/en/latest/shared-bindings/pulseio/__init__.html right?
yes
yes
@stuck elbow thanks 🙂
@analog valve also see https://github.com/adafruit/circuitpython/issues/1429
oooh ulab . Nice. : https://micropython-ulab.readthedocs.io/en/latest/
note that this is new and ongoing work, so expect surprises
for sure.
Should we close this with the merge of ulab, or leave it open but retitle to say it's about enhancements to the audio pipeline?
@stuck elbow yeah, the time change is another of these disruptive changes that us american types don't think of mentioning in advance. Hopefully we get a partially automated meeting calendar soon. My prototype calls out standard/daylight (winter/summer) time changes, but as we don't have that yet ideally we would have done it in the pinned mention last week.
My Raspberry Pi 4 is having power issues. 😦 I can not plug my PyGamer in and work with it, because the Pi goes into a boot loop. 😦
@jepler Either is fine with me. Either retitling, or if you think parts of this are not relevant, then a new issue is fine too, with a pointer back to here.
@timber mango USB-C prob?
How many Amps is the adaptor that's powering it? Raspi4 is quite power hungry I think
The official adapter is 3A, but on rpi website: "* A good quality 2.5A power supply can be used if downstream USB peripherals consume less than 500mA in total."
I have my Raspberry Pi 4 powered from an Adafruit 5V@4A power brick. I am still getting under voltage warnings and I do not know why.
If you have a powered hub maybe that could allow you to plug in the PyGamer and not have it steal enough power to make the Pi sad.
Yes, that would probably work. I do not have a USB hub though.
Has there been any changes to the VL53L0X library within the last two months or so?
Yes.
Feb 3rd there was a new release that added functionality to support multiple sensors: https://github.com/adafruit/Adafruit_CircuitPython_VL53L0X/releases
There are a LOT of libraries missing from the 0307 bundle... There are just 28 libraries in this bundle.
I downloaded a copy earlier today and I'm seeing 220 items in the lib dir
There are 29 in the bundle I downloaded today.
Oh, wait, never mind, my mistake. I was looking at the wrong lib directory.
At any rate, my three sensors will not read beyond about 350mm no matter what I do.
I have no idea what I am doing wrong.
What kind of surface is it pointed at? When I was messing with those a bit I noticed that some surfaces were much better at reflecting and were able to get further distances read more consistently.
What timeout are you using?
200000
I mean 200ms.
I am using all different kinds of surfaces.
if (USE_VL53L0X):
vl53l0x = adafruit_vl53l0x.VL53L0X(tca9548a[1])
vl53l0x.measurement_timing_budget = 200000```
I have used these a lot and never had them act this way. I have always been able to get distance readings up to around 1200mm.
I assume not, but just in case are you 100% certain the breakout you have is not the VL6180X? That one's got a shorter max distance.
I know. These are all VL53l0X.
Is anyone aware of a fast way of clearing a displayio Bitmap? I'd like to set it all to 0 which is my transparent colour but it's very slow to set all pixels in CP to this. I tried slices of 0 but got a NotImplementedError: Slices not supported
depending on what you are trying to do sometimes you can use this trick to speed it up a bit: Instead of having a full size bmp changing all pixels one at a time, make a much smaller bmp and then add it to a Group with a scaling factor big enough to make it fit full size. Then when you go to change it there are way fewer pixels to change so visually it appears faster.
I've got a 200x201 bitmap for plotting data and in some cases want to clear it and others clear it to redraw data as a method of scrolling.
I might end up "undrawing the data"
Ah, if you need single pixel resolution to draw other things I don't think the scaling trick can work, though it's still very new to me DavidGlaude taught me how to use it a few days ago.
Erasing only the pixels that have been drawn on does sound like a good way to improve drawing speed to me.
Yeah, python is taking 2.3 seconds to clear that Bitmap pixel by pixel so I think I'll try out the undraw.
Why not delete the bitmap and re-create a new one?
n/m, silly suggestion, I see what you're wanting
if you have idle time in your loop, maybe create a new layer in idle time, before needing it, then slide it in when you're ready to draw new elements? Or use a TileGrid that gets repeated over the bitmap?
@crimson ferry Already tried that. It ran out of memory. It's also a bit messy to re-insert it into the group.
It felt like the CLUE had loads of memory but turns out I'm now near the limit unfortunately! I'll look through my code later to see if I can clean it up wrt memory usage but I doubt I can claw much back.
I've been using a 200x201 size Bitmap in CP 5.0.0. At the moment this can only be manipulated by setting individual pixels. This is taking 2.3 seconds on an Adafruit CLUE to assign 0 (the transparent colour from my pallete) to each pixel.
I thought I'd try assigning a full size zero array.array but I ran out of memory. I then tried a row by row approach using slices and got NotImplementedError: Slices not supported.
I could do with a fill() method (implemented in C) a bit like the n...
50k disppears when I bring in the clue mega-object ```Adafruit CircuitPython 5.0.0 on 2020-03-02; Adafruit CLUE nRF52840 Express with nRF52840
import gc
gc.collect() ; print(gc.mem_free())
144736
from adafruit_clue import clue
gc.collect() ; print(gc.mem_free())
92224
that's what you get with those all-singing-all-dancing libraries
you can always make your own that only has the things you use
Hi! Did someone manage to connect CLUE and micro:bit? I know that micro:bit's radio isn't implemented in Circuitpython. I tried to establish Bluetooth UART connection by using available examples but I was unsuccessful. Code for micro:bit was OK, I tested it with nRF Connect. I'm new to Circuitpython so I'm probably doing something wrong. If you have working code can you share it? Thanks.
@arturo182:
Oh! I am back, I have got to the grip with it at last. Managed to flash my board with various firmware using:
1.) NXP MCUXxpressoStudio
2.) Keil ULINK2
3.) JTAG (bought on eBay from China)
Also managed to build those firmware on my Ubuntu Linux box.
I had work on it with MicroPython+Zephyr-OS (Problems with RAM ==> 128kb) but I am thinkering with the 128 Mb QSPI Flash to get it to work with this. I will do Thread-OS and openMV later.
Alas the EVK board is now $39.50 ...
sure - please implement and submit a PR :)
If I inspect a huge array in REPL with the serial console output active on the LCD but control-C the output half way through then the serial console over USB continues to work fine as expected but the LCD screen freezes and no longer updates.
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.0.0 on 2020-03-02; Adafruit CLUE nRF52840 Express with nRF52840
>>>
>>>
>>>
>>>
>>> bigarray = [12345] * 10000
>>> bigarray # press control-c after a second ...
PSA: another round of library patches is starting, to update .pylintrc. again, open PR conflicts should be minimal.
patches complete...
@spice bolt uart should be possible. radio won't work because circuitpython uses ble to implement the radio module while micro:bit takes over the whole radio
anyone know off the top of their heads if its possible to turn off circuitpython's serial port echoing?
Another example of a CLUE in forums being discussed with @caternuson: Adafruit Forums: clue_display_sensor_data.py not working. Reading from the accelerometer (LSM6DS33) could be implicated. Same RunTimeError after the problem:
code.py output:
Traceback (most recent call last):
File "code.py", line 3, in <module>
File...
Why does the stack trace show _read_register twice??
File "adafruit_lis3dh.py", line 328, in _read_register File "adafruit_lis3dh.py", line 327, in _read_register
If that's from this code,
- https://github.com/adafruit/Adafruit_CircuitPython_LIS3DH/blob/master/adafruit_lis3dh.py#L323-L328
- https://github.com/adafruit/Adafruit_CircuitPython_LIS3DH/blob/91fbe68b7841c628398fb8dfa409914a3689381a/adafruit_lis3dh.py#L323-L328 (link to a specific commit)
the `r...
@ivory yew To USB or other?
@ivory yew Usually it is the application or script that handles whether characters are echoed down a UART (serial port). If you are using a script you got somewhere else, look in it for lines that are sending received characters back down the port. Comment those out and you have turned off serial echoing. 🙂
I've taken a shot at updating #2054:
- rebased on master
- make the code optional so we can disable it on small targets (code may still grow ~20 bytes?)
- Fix the edge case concatenation so it's a parse-time error
- update locales
- update some tests
- remove unintended updates of some submodules
@ivory yew do you just want to turn off the echo or the whole thing?
On a vaguely-related topic, is there any difference between print() and print to stderr in CP, e.g. print("Boo!", file=sys.stderr)
She just wants to turn off the echo.
@ivory yew Usually it is the application or script that handles whether characters are echoed down a UART (serial port). If you are using a script you got somewhere else, look in it for lines that are sending received characters back down the port. Comment those lines out and you have turned off serial echoing. 🙂
@slender iron I forgot to ask if she was using a script or an application.
I wish I had better lighting here. Then maybe I could see my solder joints better.
Script. It's mine. I'm talking to it from Web serial and from pyserial. Both echo back the message I send.
there is a repl mode that doesn't echo
@ivory yew Are you sure pyserial is echoing?
it's circuitpython that is echoing I think
Ahhhhhh.
@slender iron In my opinion, Circuitpython should not be doing stuff like echoing.
if it didn't echo you wouldn't know you are typing things in
That is different. I am talking about in scripts.
that is how input() works in cpython for the same reason
input() is designed to talke user input though, so it should echo.
right, when is it echoing and shouldn't?
That is a question for @ivory yew.
I have never had any problems with echoing when writing scripts that use the serial port (pyserial).
I do not know about the UART stuff though because I have not used that yet.
It is probably a setting in WebSerial.
I'm using input (), afaik that's the only way to get data from USB serial.
you can also read from sys.stdin but it'll still echo
I figured as much
It's not that big of a deal- I can ignore the echo in my scripts, but it's just annoying enough to ask about. 🙂
it is dependent on dynamic usb descriptors (which would be really nice)
I would love dynamic USB descriptors
need a link to the issue?
Nah
kk
@slender iron Does sys.stdin read allow 8bit, e.g. ignores control-C as an interrupt?
@ivory yew I open the port as a file and use file.readline() or file.read().
No echoes there. 😉
@simple pulsar it still respects control-c
which is why a second cdc connection would be nice
If I control-c time.sleep() on 5.0.0 on a CLUE then subsequent time.sleep() return immediately regardless of value. Is that a known bug?
@ivory yew ```python
SERIAL_PORT = "/dev/ttyACM0"
feather = serial.Serial(SERIAL_PORT)
print()
print("Using port {0}".format(feather.name))
decLine = ""
try:
line = feather.readline()
decLine = line.decode("ASCII")
while (decLine != "\n"):
print(decLine.strip())
if ('Started' in decLine):
st.write(decLine)
elif decLine[0] == '"':
if decLine.find('"C"'):
chc.write(decLine)
else:
csv.write(decLine)
elif (decLine[0] == '{'):
if decLine.find('"C"'):
chj.write(decLine)
else:
json.write(decLine)
line = feather.readline()
decLine = line.decode("ASCII")
finally:
closeFiles()```
Where can I find the repo of the learn guide texts? I noticed a typo and wanted to create a pull request to fix it but I only see a repo for the example code, not the text itself.
That is code I use to split a data file into several different files based on content.
Oh
Reread what you said. There isn't a repo.
It's an internal system that hosts the Learn guides. They're not on GitHub.
The only thing to do is submit feedback through the form link on the guide page or email support@adafruit.com
Maybe there could be a #feedback-on-guides channel or something similar.
A #help-with-guides maybe?
I would think we'd want them to go into one of the existing #help-with channels that matches what they are working on most closely.
Not necessarily.
@idle owl OK, thanks.
<@&356864093652516868> Meeting in ~15 minutes. Here's the notes doc - please put your Hug Reports and Status updates in even if you'll be attending, it's super helpful! Thanks! https://docs.google.com/document/d/1kB6iS2NCVJH3PPK1s7JlGY7L57boeBb2KYHyZr4-aaY/edit#
There should be a common place Adafruit people can go to in order to get feedback on learn guides.
@timber mango We already have a system in place to deal with feedback. Adding another place to look would add a lot of work to everyone involved with guides.
Sending email or using the forums?
Sending email or using the feedback link located in the lower left corner of every guide page.
Will probably miss the meeting again. Group hug to all. 💜
@ivory yew Added to the notes 🙂
@timber mango The feedback thing on the page has some logging and reporting, those two aspects aren't obvious to the user.
Online Meeting - check, avoiding others (reduce the chance spreading disease) - Check. Typical day in the life of an ISTJ 🙂 hey y'll.
Oops, I put an issue in the wrong area. Can someone with super powers move https://github.com/adafruit/Adafruit_CircuitPython_LSM6DS/issues/10 over to adafruit/circuitpython, please?
Hello all you awesome folks -- happily lurking today 🙂
Lurking
Just lurking today. I am not well.
Loud and clear Jeff
loud? or too loud?
Sounded good and clear.
What @serene warren said 🙂
🎉
Yes
There goes our chance at a CircuitPython Chipmunk music album.
time.sleep() seems to misbehave if it is control-c'd in REPL:
Adafruit CircuitPython 5.0.0 on 2020-03-02; Adafruit CLUE nRF52840 Express with nRF52840
>>>
>>>
>>> import board, time
>>> board.DISPLAY.auto_refresh = False # can affect timing
>>> time.sleep(3)
>>> time.sleep(3)
>>> time.sleep(10) # control-c after a few seconds
>>> time.sleep(1)
>>> time.sleep(10)
>>> time.sleep(100) # last three returned immediately
>>> t1=time.monotonic() ; time.sleep(100) ; print(time....
@modern wing Maybe we could go for a Circuitpython Chiptunes album.
Lurking while eating lunch. 🍔
lurking today
Being first isn't always being best, like in pancakes.
Or spaghetti. It is often better the second day.
in my experience, the skillet always gets too hot after a while so they all start burning. haha
SOME people can apply rational to anything 🙂
lurking
I have a big griddle for pancakes - it goes across two burners.
lurkitty lurkitty lurk
lurking some of the time
"The awesome power of CircuitPython" Empowering makers to make businesses
https://blog.adafruit.com/2020/03/07/the-awesome-power-of-circuitpython-empowering-makers-to-make-businesses-arturo182-adafruit-tindie-circuitpython-circuitpython-oshw-opensource/
lurking
FreedomWing Droning with Chris Young
https://youtu.be/PsJyHwTlHrg
Lori and Bill headed to Indy to fly a drone with Chris... we wrap up the day here :-)
Open Hardware Summit is online only
https://www.oshwa.org/2020/03/08/the-2020-open-hardware-summit-is-going-virtual/
Find your way home a CircuitPython GPS Locator - The CLUE finder
https://back7.co/home/weekend-project-find-your-way-home-with-this-circuit-python-gps-locator
ulab: Crunch Numbers fast in CircuitPython
https://learn.adafruit.com/ulab-crunch-numbers-fast-with-circuitpython?view=all
IoT Design Week with Microchip's "Wizard of Make" Bob Martin and Adafruit. We'll be on 6pm to 7pm ET on Tuesday March 10th, 2020 (video). Expect to see a lot of CircuitPython!
https://youtu.be/fu37Uf-CXNE
Day 2 - Machine Learning and Artificial Intelligence – Afternoon with Guests from Adafruit
Register for IoT Design Week at www.microchip.com/IoT-Design-Week
Join us for a special afternoon session to talk about artificial intelligence with Adafruit.
Cloud
https://io.adaf...
EYE on NPI – Espressif ESP32-S2 SoC
https://youtu.be/4F25y-P8krM
https://www.digikey.com/product-detail/en/espressif-systems/ESP32-S2/1965-ESP32-S2CT-ND/11613159
We are kicking off "EYE on NPI" with the Espressif ESP32-S2 SoC (video). What is EYE on NPI? The acronym NPI stands for New Product Introduction and sometimes you'll also see NPD (New Product Development). EYE on NPI will showcase, spotlight, and discuss the latest new product...
Order today, ships today. ESP32-S2 – Transceiver Module from Espressif Systems. Pricing and Availability on millions of electronic components from Digi-Key Electronics.
thanks everyone for building a solid and stable community and company like adafruit, there is a lot of uncertainty ahead however, we'll get through this together (we'll be keeping everyone updated as things evolve)
Rock on Adafruit!
@slender iron I closed the zero-issue 4.x and 5.0.0 milestones just now; thanks for noticing!
thanks!
no
I don't hear
sorry
nope
Group hug to you all today for all your work & support
group hug for 5.0.0!!
Any time @onyx hinge
@onyx hinge doesn't need to be thorough. just want to make sure I'm going the right direction
@solar whale any idea if the nrf24l01 will talk to the micro:bit?
@solar whale sounds like a good plan 🙂
@slender iron I tried to make it work, I failed miserably
in theory the protocol is supposed to be the same, in practice it was either bad quality of the Chinese modules I had, or some subtle difference in the modulation
kk, good to know
not sure about the microbit -- sound unlikely given @stuck elbow comment, but I'll look as well
not worth too much time
I didn't have an SDR at the time to see what's wrong, but it basically only received one in 10 000 messages, and that was mangled
I wonder if something like an SDR would be helpful to sniff the traffic of two microbits talking to each other...
someone who knows what they are doing and has an SDR could probably figure it out in 10 minutes
@wraith tiger totally, but it's 2.4GHz
I didn't know about the daytime saving, so I am late, therefore, only lurking.
I don't know radio well enough
@wraith tiger the cheap SDRs don't go that high
@lapis hemlock sorry about that! we're in status updates if you want to jump in
I have been working on internals, so not too much to report.
OK. I am listening.
@cursive condor do you want to try your mic again or shall I read your notes?
cool, thanks!
I do not see anything else I can work on right now outside of the HT16K33 library.
@lapis hemlock do you want to give any status updates?
Hm, I don't know.
I was on submarines for the better part of 12 years. Cabin fever is a way of life for me. 🙂 stay healthy Scott.
I did the tutorials for Offworld Trading Company (free on Epic Games) this weekend and the current oil pricing situation reminded me of it. 🙂
I need to put something a little beefier than a piezo buzzer on my robot for sound. There is not much room to add new stuff though.
good idea (clue + cricket) @tiny oriole
Adafruit has a little speaker, but it's out of stock at the moment: https://www.adafruit.com/product/1891
@slender iron Can CLUE use the existing CRICKIT for micro:bit?
should be able but I'm not sure how much it's been tested
DST should be slapped in oblivion!
We are still normal time in Germany
I've done that before
ya, they moved it for some reason
Yeah, the US goes on Daylight saving two weeks earlier and off two weeks later.
more time to get lower power for the badge 🙂
I think DST change was an energy saving measure too!
2020 Open Hardware Summit Swag Bag Form
https://docs.google.com/forms/d/e/1FAIpQLScs3Oka2BygOXL_TCXHCwuHaX-eajIkR82EtMtc8LaL_MTWnw/viewform
It's unfortunate the in-person conference had to be changed, but it's a smart decision given the situation, and we all support you for it.
Let us know how we can help -- other than enjoying the conference in any form it might take 
"All attendees who purchased a ticket will receive a full schwag bag who wants one! If you would like a complimentary schwag bag as a sponsor please complete this form by March 16"
@slender iron The Raspberry Pi 8.0 MP Camera would be a great first camera for machine vision, etc. That is what I am using on my Jetson Nano. 😉
I think it was probably posted here already but here is the latest from us (OSHWA) about the Summit:
https://2020.oshwa.org/2020/03/08/the-2020-open-hardware-summit-is-going-virtual/
belated hug report to @pastel panther for joing our OHSummit wrist badge team and helping with CircuitPython apps, and hug to Nate and team at SparkFun for finishing production and testing the badges
(I'll add to notes)
@fierce girder I've been following events here on the discord and the website, but I didn't get any email notification.
For those not closely following social media, are you able to send an update via Eventbrite to those who purchased a ticket?
thanks Drew 🙂 Glad to help
I'll check. We decided on a call about this time yesterday to cancel the physical event, we just sent out more information to the sponsors, we should hopefully be getting more information out today
@stuck elbow I just found this: https://www.rtl-sdr.com/tag/2-4-ghz/
cool
I'm not following all of this but if it's not obvious the first F in FFT is for fast so a fast FFT might be confusing.
faster fast fourier transform
faster^2
extra. fast fourier transform
ludicrous speed!
fast and furious fourier transform (but get the legal dept. ready for that one)
We've gone to plaid!
Freakin' Fast Thingamajigger
There's been some interest in fourier/frequency stuff in the past although this was on the more humble processors: https://forums.adafruit.com/viewtopic.php?f=58&t=144339 and https://forums.adafruit.com/viewtopic.php?f=60&t=130944
Late phone keyboard example. 😄
def foo (
bar,
baz=foobar
):
👍
at least they didn't put the comma in the wrong spot
Europe catches up in two weeks...
bar
, baz=foobar
):
Thanks to all for the participation.
Thank you all!
👋
👋
@slender iron silly me, of course I have a teensy!!
Dropping off. Thanks all!
I'm gonna drop off too
dropping off as well
thanks everyone
Once we get to re-entrant....it gets real difficult.
uh oh -- dog has given an ultimatum -- time for a walk -- Have a great week all! 🦮
Maybe the API dumps memory to flash for the suspend?
The APIs of Mbed OS: platform, drivers, RTOS, connectivity, security and storage
🐱
signing off
@half sedge for your image interpolation from a thermal sensor, are you making one of these https://www.youtube.com/watch?v=UgNlO19ov64 ?
Smart helmets featuring infrared temperature detector and code-read cameras were adapted in China to spot fever people in crowds accurately as a method to control the novel #coronavirus epidemic.
stm32l15x and stm32l16x have up to 80k ram
The only delta we were carrying was in the README.
As discussed in the discord meeting, subsequently to doing this we will archive the circuitpython-ulab repo, it is not needed.
stm32l4x tops out at 320k ram
right
L5 seems security focused
ya
do we have any security ambitions long term?
Makes sense. I just ask because security seems to be a parallel feature for a lot of ST stuff.
Usually they have an extra mirror version of the chip with hash/crypto
@onyx hinge Jeff, a lot of modules declare functions (MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN), but some don't. Are these remnants of older code, or does CP require them? If so, why is this requirement not universal?
@lapis hemlock I don't know!
I'd only expect the declaration if the functions are used elsewhere
micropython leaves assembling the module itself to a port usually so it'd need to be declared then
@slender iron @narrow dirge But functions are parts of modules, and in this sense, local. (I am talking about functions that are python-facing, and not internal.)
I think I was mistaken: all functions are declared, so that would confirm Scott's reasoning.
Although, linalg doesn't do that: https://github.com/v923z/micropython-ulab/blob/master/code/linalg.h
>>> import ulab, ulab.numerical; ulab.numerical.sum(ulab.ones(10))
10.0
Does linalg work? I think it doesn't, and the reason for that is the missing declaration.
>>> import ulab, ulab.numerical; ulab.numerical.sum(ulab.ones(10)) 10.0
@onyx hinge You have one more port to test, right?
@lapis hemlock yes I can't find the stm32 feather board. It's vexing me.
I found an unopened one but I know I have one with headers soldered already
I have tested it on the pyboard. I don't know, whether that counts.
I'll fix the linalg stuff.
re: my status update, I posted over in #ohsummit20 , but you were registered for the event, you get an email by end of today and a form to fill out to get the goodie bag shipped to you.
@onyx hinge do people need det. Someone has told me that the determinant always pops up in proofs, but no-one actually uses (computes) it.
in what way would linalg "not work"? Missing declarations is usually a compile time error, and the software does build last I checked
in what way would linalg "not work"? Missing declarations is usually a compile time error, and the software does build last I checked
@onyx hinge I couldn't call functions from the module. However, in the meantime, I have patched it, and pushed the code to thespectrumbranch. You can merge it, if you think it is OK.
On the other hand, if I comment out the declarations now, and compile the firmware, the module works as expected. Perhaps, we don't need the declarations after all. Go figure!
I ran make clean before compiling, by the way😀
hm spresense port is not pleased. arm-none-eabi-ld: build-spresense/libmpy.a(objmodule.o):(.rodata.mp_builtin_module_table+0xe4): undefined reference to `ulab_user_cmodule'
I am going to log off for today.👋
see you
>>> import ulab, ulab.numerical; ulab.numerical.sum(ulab.ones(10))
10.0
>>> import ulab, ulab.numerical; ulab.numerical.sum(ulab.ones(10))
10.0
okay I think that's the lot
testing performed on stm32 feather, spresense, teensy 4.0:
>>> import ulab, ulab.numerical; ulab.numerical.sum(ulab.ones(10))
10.0
@onyx hinge which PR would make sense to merge first? Does it matter?
@tulip sleet I think they're independent
i will wait for the multiboard one first, because it's less likely to cause issues for forks later. So I'll wait for that one before merging.
i'm just thinking about the issues we had with some tinyusb updates with sub-submodules, which may not be an issue here, but...
awww yeah! this is rad - great for doing faster number/array/fft/convolution crunchin' on circuitpython :) taggin @paulstoffregen & @arturo182 to check out the new builds under the Actions->artifacts
https://github.com/adafruit/circuitpython/actions/runs/52529321
yeah this will need "submodule sync" or may even make some existing clones not work right without individual attention. frustrating, and maybe enough reason to keep our own fork of ulab(?)
huh puzzled by this test failure on the f-strings PR I revived. can't make it happen here.
For displayio is there any reason why refresh(minimum_frames_per_second=0) would not refresh the screen? I've got a bug somewhere where bitmaps don't update. Trivial code works but the real code doesn't 😦 Does that code attempt to check that a refresh is actually needed based on changed data?
I think this is going in a good direction. I didn't do a detailed review, but @tannewt let me know in the chat that he's just looking for high level review at this point.
once the CI run is done I will add an additional commit to disable ulab on specific boards where there is not enough code space available.
I may pop back in to look at the PR status but stepping away for now
is there a recording of today's meeting? 🙂
SMALL_BUILD vs FULL_BUILD may not be enough. I was thinking of 192kb_build, 256kb_build, full_build
@indigo wedge https://www.youtube.com/watch?v=1ROWGltWufo
Notes document can be found here: https://github.com/adafruit/adafruit-circuitpython-weekly-meeting/blob/master/2020/2020-03-09.md
Visit the Adafruit shop online - http://www.adafruit.com
LIVE CHAT IS HERE! http://adafru.it/discord...
What are they asking for with "Enter a valid origin, including the https, http, or chrome-extension prefix?" I am signing up to try WebSerial.
@tulip sleet i was wondering if any movement has been made on that. been on the lookout for the PR. with the STMs out in the wild, i'd like to get the support matrix updated. 😄
My "no updates" issue with displayio refresh goes away if I do a refresh(target_frames_per_second=1, minimum_frames_per_second=0) - the default rate of 60 appears to stop this manual refresh from ever working with what I'm doing.
I can take a closer look at this tomorrow morning
@raven canopy if @onyx hinge doesn't need to do it, I can still do it separately. But it's because STM32 doesn't use those _BUILD options, right?
I don't know how my PR will affect the feature matrix. @raven canopy leave me more information on the PR if I should do something.
I have been trying to do a manual refesh and cannot find a combination that works on 5.0.0. I've got some code that takes between 10-30ms roughly to do some stuff and update the Bitmap/etc and I'd then like to update LCD. There's no point updating it at 60Hz (16.667ms) as that'll end up drawing half an update some of the time.
If I just run self._output.refresh(minimum_frames_per_second=0) then the first one returns True and updates the screen and nothing after that updates the screen ...
I used Teensy Loader to load the CP .hex and that worked just fine. There's also a .UF2 on circuitpython.org ...is there a workflow for that?
Also, in the intro video, ladyada has a Teensy-to-Feather adapter... is that custom, or does the one in the shop work with 4.0? (pinouts look similar, at least on the long sides)
Thanks for doing this! Looks good!
Thanks @jepler and @hierophect for the high level review. I've gotta propagate the changes to other ports and just wanted to make sure I was heading the right direction.
I think the correct thing would be to have the later id of l[0] be 536896144. I don't mind that the ids themselves change after import but we should create two separate objects.
I do agree that this is a long lived issue because we assume that only one reference of module variable exist. (We recurse from the module dict down and don't look elsewhere for references.)
I don't think this is urgent and would argue for it to be "Long Term" because there is a simple and easy workaround: Jus...
What do I enter for "Web origin" (Error: Enter a valid origin, including the https, http, or chrome-extension prefix.)
@kevinjwalters I don't think we need to reopen this. It sounds like you want target_frames_per_second=30 when your frames take up to 30ms to compute.
To reiterate how it works:
minimum_frames_per_seconddictates when refresh will raise an exception for being called too infrequently.0turns it off entirely. It doesn't impact whether a refresh actually occurs.target_frames_per_seconddictates two things:- If the time between the last refresh call and this one was greater...
@tannewt Assuming you mean 33.3333ms? I can't exactly predict the time between frames so I'm not sure if that will always work, e.g. I think I'm back to no refreshes if it takes 35ms? Also, I'd like to do some useful processing in the application rather than have refresh() pause until a fixed time duration before returning.
@crimson ferry I don't think the UF2 bootloader for imx rt is as mature as CircuitPython is. You can find it here though: https://github.com/arturo182/tinyuf2
Thanks!
@tannewt Assuming you mean 1000/30=33.3333ms? I can't exactly predict the time between frames so I'm not sure if that will always work, e.g. I think I'm back to no refreshes if it takes 35ms? As discussed previously, CP isn't predictable on timing. This seems like a needless risk?
Also, I'd like to do some useful processing in the application rather than have refresh() pause until a fixed time duration before returning.
Yes, correct. You'll be fine if it's only over the frame rate...
Frustrating power problem (separate from the solar stuff)...
When my battery dies down, my NRF52840 Sense goes into safe mode
When power is applied, it doesn't reset
I have a measurement on VBAT, so I can tell when it's low... but I can't figure out what to do at that point....
I would prefer it just die
Is there a recommended approach here?
@tough flax So, you want the nrf52840 Sense board to turn itself off, right?
Until power is restored
Yes, I know. Hmmmm.
And then I want it to start up 🙂
If the battery dies completely I'm fine
but it doesn't... once in safe mode, it doesn't drain fast enough to kill the battery
If it shuts itself off, there would not be any way for it to turn itself back on.
So, I didn't want to get into the solar part, but it's kind of key - the sun will come up!
If the battery doesn't make it through the night, I'd still like it to resurrect in the morning
Oh, yes, there is that. How about if it just goes into a very low power mode until it is charged up again?
@tough flax Could you file an issue? We could probably make the brownout detector not go into safe mode, optionally.
Sure
@tulip sleet Why do we even have a safe mode? It has only managed to irritate me.
i'm not sure if it's going into safe mode on power down or power up. Is that happening when you apply power again with USB or a fresh battery, or is it with the solar cell rechargingthe battery.
so bad things won't happen like scrambling your files
It looks like his device is going into safe mode when the battery voltage goes too low.
I hate safe mode. It is always causing me irritation and stress.
While I'm not to trying to solve a solar-specific problem here, I have hit a problem on a solar project that seems like it would be an issue in other settings.
When my nrf52840 Sense feather's battery drains down, CP goes into Safe Mode. In that mode it doesn't draw much power, so the battery never completely dies (I mean it will but very slowly).
While in this mode, if the power is restored (i.e. the sun comes up & starts charging the battery), the feather never resets... even though ...
Yes it is going into safe mode on the way down... that said, it might have flickered and try to restart - no way for me to tell really
Perhaps it browns out due to higher current draw due to radio transmission, goes into safe mode, and then the radio is off (because code.py is not running). So it never powers down completely. If the battery were completely drained it would do a hard power-on reset and would not be in safe mode. We don't remember safe mode in flash or anything like that.
@tulip sleet When I have to deal with safe mode, it seems to be when I have pulled the USB cable out without ejecting the board properly. That really annoys me because it will not come out of safe mode gracefully after that.
Right @tulip sleet - that's what I wrote up in the issue 🙂
It seems to be responding to a sudden loss of power in my case and low power in @tough flax's case.
I liked the solution I suggested - but I don't know if we actually have code running in safe mode that could check for power restoration
nope, nothing is running in safe mode that would do that. We do have microprocessor.voltage, which measures the core voltage. You could check that periodically and if it's noticeably lower than 3.3v, stop what you're doing. The brownout voltage is 2.7-2.8v. But that doesn't solve the problem of hitting the brownout voltage. So I'm thinking about what to do in that case. Safe mode could check in the background about whether the voltage is back up to close to 3.3v, and that point do a hard reset.
there are several uses for safe mode. One is when there's an unexpected system error, another is brownout. All the reasons:
BROWNOUT,
HARD_CRASH,
USER_SAFE_MODE,
HEAP_OVERWRITTEN,
MANUAL_SAFE_MODE,
MICROPY_NLR_JUMP_FAIL,
MICROPY_FATAL_ERROR,
GC_ALLOC_OUTSIDE_VM,
PROGRAMMATIC_SAFE_MODE,
NORDIC_SOFT_DEVICE_ASSERT,
FLASH_WRITE_FAIL,
MEM_MANAGE,
most of these are "something really bad happened in the code", only brownout and user-requested safe mode are really not a code error
Thinking about this, perhaps we can add some hysteresis to the process, and not go into safe mode on a brownout. Instead, if we get a brownout interrupt, we should wait for some period of time and check the voltage again. If the voltage is normal (3.3v) we can pretend that it was like a hard reset. If the voltage is still low, then we can loop and check again after some period of time. Eventually either the battery will drain completely, or the power will be restored to normal.
This mode m...
frustrating: https://github.com/actions/checkout/issues/23 checkout v1 is buggy and won't be fixed, checkout v2 doesn't support submodules https://github.com/actions/checkout/issues/81 -- catch 22.
I'm sorry if this is not the right place for this issue, but it's where it looked most appropriate to me. When re-triggering a workflow for the PR #620 in the Jaeger Operator, the c...
@onyx hinge checkout@v2 is going to support submodules: https://github.com/actions/checkout/issues/176. I talked about it here https://github.com/adafruit/circuitpython/issues/2683,
that would be nice
it sounds like it might be soon. There are other issues as i mentioned: we have to override the shallow checkout they do by default
@tulip sleet @onyx hinge i didn't realize the 192k_BUILD talk was related to the ulab expansion PR. nothing i mentioned hinges on that. i just immediately jumped to thinking about this: https://github.com/adafruit/circuitpython/pull/2598#issuecomment-584233422 sorry for confusion. 😄
@raven canopy well, it makes sense to have a more board-family category for medium-sized boards, so we don't have to mark every M0 board as not being capable of ulab (assuming that's necessary), so good idea to bring it up
agree, 100%.
Anyone else happen to be around and doing anything with GitHub getting super slow speeds?
Trying to clone and getting ~30KiB/s or less. Everything else on the internet seems normal speed
I was cloning the RASA examples and it took forever, and they aren't that big.
Ah, this repo is 30mb, just noticed some photos in the docs folder. But even for that the current speed seems like snails pace.
@lone axle I have been using Github, but I would not notice if it was slow or fast. I have to depend on my phone for internet access. 😦
My configurable script has grown to 959 lines, with 31 lines of comments at the very beginning and few other comments.
There are probably more blank lines than most people would use though. 😉 🙂
It looks like it's only M0 boards that failed, so I re-disabled this on them, I'll check back again later.
Greetings!
good morning!
I have my configurable sensor script running. The current temperature is 72.2°F (22.3°C), with a relative humidity of 46.3%.
finally the PewPew M4 is on sale
congrats @stuck elbow
so ulab is available in S3 builds ?
as soon as the PR builds finish
This extends it to stm32, sprsense, and imxrt
It has been in samd51 and nrf builds for some time
doesn't fit on M0 builds, so not on M0
And there may be non-express builds that disabled it to.
M0 doesn't have fpu anyway, I think
I downloaded yesterday's build for monster M4sk (samd51j19) and it was not available... or did I make a mistake somewhere ?
I did a mistake I guess
yeah nevermind, i didn't copy the latest downloaded .uf2 file.
np, there are a ton of files. My Downloads folder is filled with various builds 🙂
so I will try to speedup my last fractal drawing
naive implementation : 51 s
optimised without ulab : 25.8 s
and another question : is float single precision or double ? in the doc they said it depends... how can I check that ?
it's single precision
I just confirmed this
the M4 boards have hw single precision. We use an encoded version that is only 30 bits, so it has 2 bits less mantissa precision than single-precision fp
the lower two bits distinguish pointers, ints and floats
(actually ints are 31 bits, and then if not int, 2 bits are used to distinguish the others)
thanks a lot. It's an arduino limitation, or is it a circuitpython choice ? (BTW I understand it's memory savy)
It's a circuitpython choice. MicroPython provides a number of choices for object representation. We could have encoded floats, 32 or 64-bit boxed floats (requires memory allocation), and single vs double precision. We chose the most memory efficient
The hw only supports single. If we had double, it would have to be software fp, which is slower
and also requires the double fp library to be included, which is quite large. We went to some effort to remove all inadvertant double precision operations from the code, which saved several thousand bytes (we had some by accident due to implicit conversions).
@onyx hinge yes, I've read about optimising mandelbrots, but it seems numpy is not faster than naive implementation
I'll give it a try, it take a few minutes to draw 240x240 ... but the main limitation I saw with that was the single precision float that limit the XRADIUS value
but today I have another fractal to play with : quasicristal : for each pixel it compute a square root, + a for loop with a cos() and a sin() in it.
I hate safe mode. It is always causing me irritation and stress.
@timber mango Please be aware that some of us worked on features you hate. Safe mode is there for a very good reason. It's there so that if the user code causes something very bad to happen, you can still access your code to change it (by not running the very bad user code.) If you are accidentally in safe mode simply hit reset and you'll start up normally.
@tulip sleet thank you very much for the explanations. I'm diving deeper and loving that 🙂
@slender iron I understand why safe mode is there, and it should be there. I was just expressing some frustration I have when my boards go into safe mode. In quite a few cases, just resetting the board does not bring the board up normally. Sometimes, I have to blitz the file system and reload the board (after I back it up), and even then the board will not come up properly. This all happens when I have not even changed the code and it was just running perfectly before going into safe mode.
Those sound like bugs. If you can reproduce them please file issues about it. But please beware of the words you use to describe your frustration. Words like "hate" kill the desire to work on something open source for me and others.
@slender iron I apologize for using the word hate when describing my frustration. That was not appropriate. 🙂 😉
Thanks! I appreciate you using CircuitPython and letting us know what it isn't working well.
I love Circuitpython and I only want to help make it better. That is why I am here. I just wish I could work on more stuff, but I do not have many of the necessary sensors and boards to test my work. I refuse to work on something that I can not test. 😉
@slender iron Here's an odd one. https://learn.adafruit.com/zelda-master-sword/software is running on CircuitPython 5.0.0. I can't figure out why. It should be requiring audiocore but I'm print debugging it and it's getting past audioio.WaveFile. I still haven't dug up a speaker so I'm not sure if it's playing the audio or not, but the code sure thinks it is. Is there something in place to deal with backwards compatibility that I don't know about? Or is this as odd as it seems.
looks
it should be changed for the future when we turn audioio_compat off
Fair enough. That's mildly confusing. I'll update it then.
Ya, I agree but some folks want backwards compatibility for a bit.
I've run into this before too. Would be nice to have.
Just curious - how are you currently doing your fill? It's slightly more efficient to set via straight index vs. (x, y) tuple. But neither of these totaled up to 2.3 secs.
TEST CODE
import time
import displayio
WIDTH = 200
HEIGHT = 201
COLORS = 255
bitmap = displayio.Bitmap(WIDTH, HEIGHT, COLORS)
start = time.monotonic()
for p in range(WIDTH*HEIGHT):
bitmap[p] = 0
delta1 = time.monotonic() - start
...
Thanks for looking into it for me
np 🙂
Also makes it difficult to test to ensure that you're using audiocore properly. I understand needing the compatibility though.
I agree. It'll make it easier when we release a 6.x pre-release and turn it off
Noted. Thanks.
(so don't worry too much until then)
Right.
@indigo wedge I have been thinking about Serpente. It seems like this would be an ideal board to use in creating custom HID keyboards and controllers. It could be used to remap controller buttons into anything you want to send to a computer. If it had wireless, such as Bluetooth, any Bluetooth compatible controller could be paired with it and remapped. Actually, any Bluetooth compatible keyboard could also be paired and remapped. 🙂 😉
yes, it works great for HID 🙂 https://i.imgur.com/usonr43.gif
for BLE there's no way i could price-match the official nRF dongle https://www.digikey.com/product-detail/en/nordic-semiconductor-asa/NRF52840-DONGLE/1490-1073-ND/9491124
Order today, ships today. NRF52840-DONGLE – - Transceiver; Bluetooth® 5 For Use With nRF52840 from Nordic Semiconductor ASA. Pricing and Availability on millions of electronic components from Digi-Key Electronics.
@indigo wedge That is too bad. I have one of the Bluefruit SPI Friends here. Maybe I can connect that to one of my M0 or M4 boards and try some of this stuff out. The ItsyBitsy M4 would be ideal for this if I can make it work.
@indigo wedge what kind of monitor is that
my laptop monitor
gotcha looks kinda transflective or reflective in your gif so I thought it might have been something unusual.
What micro are people using for custom keyboards?
there is a "make your own keyboard" example out there somewhere based on the Atmega32u4.
samd21 recently
I made 2 with atmega32u4 as well
I want to try samd11 or samd9 one of these days
i have yet to make a full keyboard that functions as a keyboard though. everything ive made thus far is more of a controller device for android that happens to send its messages as keyboard keystrokes.
https://hackaday.io/project/167912 <-- this is the one I made with the samd21
it even runs circuitpython
(though I did make a custom build to make the capslock work)
I am going to have to use my tablet for awhile so my Raspberry Pi 4 can cool down. Even with it being in the heat sink case, it can not run 24/7 without overheating. I will have to start shutting it down when I am done using it for at least 30 minutes. Unfortunately, this does not happen often.
@arctic violet I used kmk and an nrf52840 itsy bitsy in my custom keyboard https://github.com/KMKfw/kmk_firmware/ https://www.thingiverse.com/thing:4129809
Clackety Keyboards Powered by Python. Contribute to KMKfw/kmk_firmware development by creating an account on GitHub.
kmk is perhaps over-engineered but it works great
I just connected my Bluefruit BLE SPI Friend to a Feather M0 RFM69 board. There is also am LSM303DLHC breakout and a NXP FXAS/FXOS IMU connected. All I need now is a WiFi FeatherWing...
Thanks for dusting this off! Thanks to @klardotsh for the original PR. I know everyone will be excited for the f-string future! @brettcannon asked me about this at PyCon last year.
So far, I am not able to load CircuitPython on to either of my Feather M0 RFM69HCW boards. The command I am using is: bossac -p /dev/TTYACM0 -e -W -v --offset 0x2000 -R adafruit-circuitpython-feather_m0_rfm69-en_US-5.0.0.bin. Help please.
@tulip sleet The Feather Sense bootloaders are getting updated correct?
@idle owl limor knows to update the testers
@tulip sleet What will the bootloader be called?
@timber mango it's -e -W -v etc. Not sure about the extra spaces you have there
Trying to do the guide for it. I can rename the bootloader for screenshots but I need to know what to name it to.
FTHRSNSBOOT
thanks
you can update the bootloader yourself if you have adafruit-nrfutil installed
I don't know if I do. Probably don't. What does that gain me other than the proper name?
the red led will work in the bootloader
oh right
yay thanks for the PR merges @tulip sleet @slender iron
@tulip sleet Please look again. I have removed the annoying extra spaces. 🙂 😉 I do not know where they came from.
Downloaded.
then
adafruit-nrfutil --verbose dfu serial --package Downloads/feather_nrf52840_sense_bootloader-0.3.1_s140_6.1.1.zip -b 115200 --singlebank --touch 1200 -p /dev/ttyACM0
except change /dev/ttyACM0 to the right MacOS device
@timber mango what's the error
@timber mango /dev/TTYACM0 should be/dev/ttyACM0 maybe?
@tulip sleet It says No device found on /dev/ttyACM0 The port is correct. I am on a Raspberry Pi 4 running Raspbian Buster.
what does dmesg show after putting the board in bootloader mode?
@slender iron Looking at protomatter, it has the following structure that I need to fill out: ```typedef struct {
volatile uint32_t *setReg; // GPIO bit set register
volatile uint32_t *clearReg; // GPIO bit clear register
uint32_t bit; // GPIO bitmask
uint8_t pin; // Some identifier, e.g. Arduino pin #
} _PM_pin;
Is there something like this in the HAL already, or is it a whole new way of thinking about pins that circuitpy didn't do yet?
@onyx hinge I think neopixel in some places uses the set/clear pattern
@slender iron good thinking, I'll check that!
bit and pin are probably like the parallel bus
but that's in architecture-dependent code, there's not a "common neopixel implementation" is there?
I'm thinking of samd
basically the first two are the addresses for the set and clear registers. their location is usually derived from the over pin number
yeah, this is samd only to start with
@tulip sleet Drats! I did not put it into bootloader mode before I ran bossac. 🙃 😎
I was entertaining the idea that maybe mp_hal_pin_xxx could get a new sibling function to return this information
i.e., the platform dependent part would just be "fill this structure", oh and timers 😕
sounds like you may be getting ahead of yourself a bit. I'd suggest just hacking it up for samd
will do, thanks
lol ... using ulab, my first test working well take 10 sec. (for the record naive = 50 sec, optimised without ulab : 26 sec)
and that's for a not so complex pattern. with ulab, it's always around 10 sec, whatever the complexity of the pattern. impressing.
I don't know enough about Safe Mode... is there any code running? Is there a chance to put a config setting where if SafeMode is activated by a brownout (vs. other issues) it continue to watch for power to come back to a reasonable level and if so reset the board? In that scenario one of two things would happen:
Safe mode runs all of the CircuitPython supervisor to give USB access to the filesystem but it doesn't run boot.py or code.py because it assumes something in the user code is fat...
Drats again! There is not enough storage on the Feather M0 RFM69HCW board to load all the libraries I need. 😦 On to Plan B! I will exchange my ItsyBitsy M4 Express for the RFM69 board and add an RFM69 breakout board. 😉 🙂
Apparently the Radio library was never moved to Actions?
Issue filed.
@tulip sleet I'm not sure why the Radio library wasn't failing before. I don't know how to fix that error. It's not a typical Sphinx error, it's related to struct apparently?
i think it thinks _ADAFRUIT_COMPANY_ID is not an integer
is the mock for micropython.const not working right?
I didn't do micropython.const in the mock, only micropython
i'll try that
That did not work. Same failure
The mock for micropython is working because it fails on finding micropython without it.
@onyx hinge Jeff, whenever you have a chance, please, look at https://github.com/v923z/micropython-ulab/pull/59, and if it's OK, go ahead with the merge. Thanks!
@tulip sleet There used to be an issue in MicroPython with const() not working with struct because it wasn't maintaining the const value, but it was REPL related and appears to have been resolved. So I don't think that's it.... I'm not sure what to do here.
@lapis hemlock so far I've learned it's beyond my shaky memory of math in university
@onyx hinge I am pretty sure the implementation is OK, the question was really about structuring. But it reminds me, I should probably provide a test function. I will try to pull that off today.
I have tested it with a couple of odd-looking matrices, and all returned the results that I got in numpy. Hence my confidence🙂
You can also merge the re-location of the spectrum function. Re-naming is still on the table, if you want to.
Besides, implementation of isolated functions is relatively safe: if it is wrong, it won't mess up the rest of the code, and someone will complain sooner or later. I don't mean to say that I want to put faulty code out there, but we shouldn't lose too much hair over the issue.
@idle owl working on this
@tulip sleet Ok.
ok, rename is what we agreed on in the meeting so merged that too
taking a break, concentration's running low 💤
I meant, if you want to name the function spectrogram, or whatever it was in scipy.signal.
oh that part .. if it's compatible-ish with spectrogram then that's probably preferable?
It's fine with me. I can fix that.
thanks!
@idle owl suppose you just add Adafruit-Blinka to requirements.txt
and remove micropython from autodoc_mock_imports
blinka should provide micropython
No module named 'micropython'```
@slender iron is it transitive, if adafruit-circuitpython-ble is in requirements.txt, would that pull in adafruit-blinka (which is in adafruit-circuitpython-ble's requirements.txt)
so then micropython should not be in mock_imports
adafruit-blinka isn't in adafruit-circuitpython-ble's requirements iirc
ah, nvm
looks like it is
yah
Travis CI enables your team to test and ship your apps with confidence. Easily sync your projects with Travis CI and you'll be testing your code in minutes.
thanks
Failing locally the same way, even with Adafruit-Blinka in requirements.txt
or rather
if micropython is automocked.
it fails that way.
otherwise it fails on micropython.
right. did you install adafruit-blinka locally?
this is working for me:
halbert@salmonx:~/repos/kattni/Adafruit_CircuitPython_Radio$ sphinx-build docs ~/temp
Running Sphinx v2.4.4
loading intersphinx inventory from https://docs.python.org/3.4/objects.inv...
loading intersphinx inventory from https://circuitpython.readthedocs.io/en/latest/objects.inv...
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 3 source files that are out of date
updating environment: [new config] 3 added, 0 changed, 0 removed
reading sources... [100%] index
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] index
generating indices... genindex py-modindexdone
writing additional pages... searchdone
copying static files... ... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded.
The HTML pages are in ../../../temp.
halbert@salmonx:~/repos/kattni/Adafruit_CircuitPython_Radio$ git status
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
sphinx-build doesn't automatically install the packages for requirements.txt. the build does it separately
no wait, it's not your PR branch
@slender iron fair enough.
ok, i get the error in your branch
I removed 'micropython' from autodoc_mock_imports and it works for me
can you remove that and push again?
i had an old pull
👍 thanks!
unrelated: is it useful for me to use compare functionality in a timer for pulsein rather than just reading the timer value in an interrupt?
using compare requires tracking how many slots are being used
@slender iron got a sec to chat about half duplex uart? I've been working with a friend to get a certain brand of servos we really like, the Dynamixels, supported in Circuitpython. He was talking to the host company today and they might be interested in assisting.
sure
It's a one line protocol so it would make the most sense to use the native half-duplex uart driver on STM32. I've got an example implementation already but I was wondering if that's also something that's supported on NRF/Atmel etc?
by half-duplex you mean transmit only right?
No, both transmit and receive on the same line.
ah, hrm
It'd require a change to the API to make one of the pins optional and the other used as both transmit and receive.
As in the user manually attaches both pins to one line?
no, as in you pass in the same pin object to both tx and rx parameters
Oh that makes sense.
That'd be cleaner for sure
Here's the family of motors btw: http://www.robotis.us/dynamixel/
The DYNAMIXEL all-in-one smart actuator system is a fully integrated DC Motor + Reduction Gearhead + Controller + Driver + Network, all in one modular actuator. Programmable and networkable, the DYNAMIXEL can also be daisy chained for superior design and modularity.
there is that guy on the micropython irc channel who uses those servos with his micropython boards
he provided the patches for micropython for the half-duplex uart, if I remember correctly
Would it be OK if I still support it on STM32? Half duplex uart is a native peripheral feature for me.
(or maybe he's just writing to the registers directly to configure the UART, I don't remember)
there is also a trick with connecting both pins with some resistors or transistors, but that's fugly
Looks like on the NRF52 and SAMD51 you need a physical component with a diode
They don't support it out of the box
@ionic elk I'm ok having it in the port but I'm not sure it's worth doing on Adafruit time.
Dave Hylands was the guy
This demonstrates some code running on MicroPython controlling AX-12A servos.
The code can be found here: https://github.com/dhylands/bioloid3
ah, dave is awesome!
there is a link https://github.com/dhylands/bioloid3
@slender iron would be sponsored by Robotis if it happens 🙂
@ionic elk perfect! I'd love to see others sponsoring circuitpython dev
"A special half-duplex mode on the STM32F4 processor is utilized to allow bi-directional communications."
Or I'd just do it with my buddy, the AX-12 series is awesome and I really, really want there to be more exposure for it
🙂
I think for me H7/F7 is more important do to wider board support that comes with it
@stuck elbow yeah half duplex is a native part of the peripheral, there's no hacks needed for stm32
@slender iron yeah it's up next! wrapping up PulseIn right now, almost done. Been putting together the pin profile for the H743 in the meantime as well
https://github.com/dhylands/bioloid3/blob/master/stm_uart_port.py#L27 <-- this is the magic command he uses to set the UART mode
Another Frankencircuit from yours truly! This one stars a Bluetooth BLE SPI Friend breakout and an RFM69HCW Radiofruit breakout. Supporting cast is an LSM303 and a Precision NXP Fxas/Fxos 9-DOF IMU. Now that I have the circuit, it is time to hack up some Frankensoftware to go with it! 🙂 😉
I think this is going in a good direction. I didn't do a detailed review, but @tannewt let me know in the chat that he's just looking for high level review at this point.
@timber mango what all is that going to do
@arctic violet It is, after I get software written for it, going to be a node in an RFM69 MESH radio network that also has Bluetooth BLE for fun remote control stuff.
I've got more groups and stuff although I wasn't updating any other stuff. Do you know how displayio should work in that case, does it only send what's changed to the screen? At some point I also had a same size Bitmap underneath it the 200x201.
I did some tests away from Bitmap and noted that for elem in a looked faster than for elem_idx in range(len(a)) but I'd already moved onto an undrawing approach in code so didn't bother timing that for Bitmap as I wanted something ideally...
OK, I have a very important question...Do all of the Adafruit BLE libraries work ONLY with the nRF52840 boards?? You really want to say NO to this, right?? 🙂 OK, now give me the REAL answer, even if I might not like it.. 😉
all CircuitPython "Adafruit_CircuitPython_BLE*" are nrf52840 only. https://github.com/adafruit/Adafruit_CircuitPython_BluefruitSPI is for the Friends
it's possible it will work with other chips in the future
when other ble chips are supported
@tulip sleet To get all the newest BLE goodness I have been reading about, I will have to swap my ItsyBitsy M4 Express and Bluefruit LE SPI Friend for a Feather nRF52840 Sense, Feather nRF52840 Express, or an ItsyBitsy nRF52840 Express - Bluetooth LE. I will just do what I can with what I have.
I believe I have successfully created my first BluefruitSPI device. Well, I did not get any errors on my instantiations.
@lone axle Ha ha! 😛 Now, I have to do something with the device I just created. That is a project for tomorrow.
I have been working on a small integrated circuitpython running "not-dumb" watch and would like to integrate it into the circuitpython framework before I make duplicates to distribute for alpha/beta testing as well as have any improvements available on master for power optimizations.
@tannewt I agree it should be ling term. I think very few people will find this bug and the temporary fix is quite easy.
It could be that I am miss-interpreting "the correct thing would be to have the later id of l[0] be 536896144" but I think that the object shouldn't be made into a separate copy after import. I think that would be perfectly acceptable for immutable objects like ints, strs, tuples, etc but mutable objects should not be duplicated. I think when the list is edited in ...
meta importers and other CPython extensibilities aside
Hi folks! The interns at Microsoft are working on VS Code extensions around CircuitPython and MicroPython. If you're interested and could take a few moments to fill out their very brief survey they'd really appreciate it.
Link and more details at: https://twitter.com/nnja/status/1237483172872372224
Are you interested in Python on microcontrollers & embedded devices?
Please help the interns at @MSFTGarage with research by taking a brief survey!
@lapis hemlock : I'm experimenting with ulab since yesterday... it's amazing. I have a few questions (maybe someone else can answer too)
I can't find atan2() function so I use atan = ulab.array([math.atan2(y, row[i]) for i in range(width)]) with row being a ulab.array and y an int. is there a faster way to do it ?
and what is the better way to convert a float array to an int array ?
I don't think there's atan2() and I don't know about conversion to integer. In the fft example in the guide, I did this when setting bitmap elements from a float array: for x in range(min(bitmap.width, len(data))): bitmap[x+offset, y] = int(data[x])
v923z has been receptive to ideas, if you are on github you can file issues on https://github.com/v923z/micropython-ulab/ about things you perceive as missing features.
yup it's my current solution. and yes I'll post there for a few things when I sort out everything in my head 🙂
Thanks!
this is quite faster : atan = ulab.array([math.atan2(y, i) for i in row]) for example...
BTW, no implication here that this is guaranateed to be (up)time related, could be volume or flow control or something else...
but maybe there is a more efficient way to apply a function to every members of an array...
@cursive condor Do you mean in general or ulab.array specific?
ulab.array
this last one take around 0.00524089 secs. to compare z = z + ulab.vector.cos(ulab.vector.sin(atan + (i * rot)) * dist) take only 0.00272972 secs (with z, atan, rot and dist being ulab.array, and i being an int)
I am following this guide: https://learn.adafruit.com/introducing-the-adafruit-bluefruit-spi-breakout/introduction which starts out showing examples for the Bluefruit LE SPI Friend, but on the software page for Arduino, it is talks about installing the Adafruit_BluefruitLE_nRF51 library. Does this library work with the SPI Friend, or is this an error?
It also talks about a MODE Switch and a MODE Pin. I do not see either of these on my Bluefruit SPI Friend. Should I be seeing these?
@timber mango they are on the UART Friend not the SPI Friend -- you should not need them. The software handles it.
The guide does not specify this anywhere. At least, I did not see it anywhere in the guide.
But it also does not refer to them in any of the instructions for the SPI friend -- apparently some of it is used for both.