#circuitpython-dev
1 messages ยท Page 263 of 1
Got it, thanks!
diode.zone
Hanselminutes Technology Podcast โ Learning CircuitPython with Scott Shawcroft:
https://www.hanselminutes.com/701/learning-circuitpython-with-scott-shawcroft
The Adafruit Discord community, where we do all our CircuitPython development in the open, reached over 14,028 humans, thank you~
https://adafru.it/discord
Call for Proposals for PyCon 2020 is open!
https://pycon.blogspot.com/2019/09/call-for-proposals-for-pycon-2020-is.html
The time is upon us again! PyCon 2020โs Call for Proposals has officially opened for talks, tutorials, posters, education summit, and charl...
CircuitPython.org updates
We're always updating CircuitPython and the libraries. We've had CircuitPython 4.0.1 stable out for a while, and recently released 5.0.0-alpha.2 which means it's time for a new CircuitPython Library Bundle! The 4.x and 5.x bundles are now available for download at circuitpython.org/libraries. We've stopped supporting the 2.x and 3.x bundles, but you can always get access to the final builds on GitHub.
CircuitPython snakes its way to the STM32:
https://youtu.be/xA8q0Xs22-E
(should have a few boards on .org later today too)...
CircuitPython snakes its way to the STM32! Here's a preview of us testing analog input on ST32F4 port of CircuitPython using Mu. Did you know we're working o...
Python on Hardware Community Showcase at PyConUK:
https://twitter.com/carlosperate/status/1173171478185074689
** lurking **
CPX pinouts for the upcoming CircuitPython book in Japan - AND check out this great video that promos the book!
https://twitter.com/AoyamaProd/status/1172459088724185088
https://twitter.com/AoyamaProd/status/1173554917803380737
Creared the video showcasing my CPX and CircuitPython book (in Japanese). To be released in 22-Sep in Tech book fest 7 in Tokyo.
If you are in Tokyo, please come visit!
https://t.co/OHZPdwdaMf https://t.co/1XcZbjcKrr
Have anything to add?
https://github.com/adafruit/circuitpython-weekly-newsletter/blob/gh-pages/_drafts/2019-09-17-draft.md
the details of what's in 5.0.alpha.4 are listed on the releases page
CircuitPython - a Python implementation for teaching coding with microcontrollers - adafruit/circuitpython
I downloaded alpha-4 and already put it on a dozen devices... no problems! ๐
Me too. Well, once...
Group hug to the team and community this week. Amazing progress!
@nimble narwhal should have mute button here
@slender iron - can you paste a link to the code formatter you mentioned? Is it on pypi.org?
pyright
thanks!
in microsoft on github
Think they covered that on Python Bytes, but I always forget which episode talked about which packages.
it wouldn't be on pypi because it's written in typescript
good for react native
Nothing major to report CircuitPython-wise. Been heads down in the studio tracking some new songs. Trying to wrap up the album this week, working out the duplicating, packaging, and licensing challenges.
My AD9833 Precision Waveform Generator FeatherWing (with CircuitPython drivers) generated some interest. To support a low-power version of the AD9833 that he had on-hand, a maker customized the PCB and ordered some OSH Park boards. Seeing his different perspective gave me some useful ideas. Hoorah for open source!
Oh and used my SMD microscope to tune harmonicas.
you can tune harmonicas?
Oh yeah.
I've only ever had the cheapie kids' ones
I use miniature chisels and files to adjust individual reeds.
I'll stay through the rest of status reports but I'm going to bail before "in the weeds"
whoo got the signature fixed!
@idle owl do you want me to try to do https://github.com/adafruit/circuitpython/issues/2150 this week ? It might be really simple, or it might not :p
@stuck elbow want to do hug reports and status updates after I read sommersoft's status update?
@slender iron sure, sorry for being late
kk, np
@onyx hinge We think it should be simple as well, but we're not sure where the simple fix goes. If you can sort it out, that would be amazing.
@idle owl I'll see what I can do. If nothing happens by Wednesday, send for reinforcements
@onyx hinge Ping me at some point and I'll explain in more detail what we discussed about it.
yep. theres an issue in blinka for it.
in the weeds!
- debugging bootloader+firmware how to?
I've used the PyBadge as a MIDI sniffer.
It will become the UI for my precision wave generator wing, too.
thanks, all !
Thanks!
show and tell!
We merged the Serpente support into CP with the Trinket PID, which I didn't realize was a problem. Let's fix it here and in the uf2 bootloader :)
Thank you!
Fixed link in readme
Arturo Serpente VID 0x239A PID 0x0057 # bootloader
PID 0x8057 # arduino
PID 0x8058 # circuitpython
@slender iron You done doing PRs for today? Wondering if you can follow up on https://github.com/adafruit/Adafruit_CircuitPython_SimpleIO/pull/46 so I can get it tested and merged.
@idle owl nope, I'll look now
Thanks!
@idle owl merged
Thank you!
@jpecor Let's chat for an hour or so sometime this week. We can talk displayio and git. What times work for you this week? (Feel free to DM on Discord your reply.)
Please update the peripherals submodule to the merge commit for the corresponding PR. Thanks!
Thank you @darkmusic
@ladyada your analog testing sketch gives me flash corruption so extreme it actually disables the debug program on my mac and I have to erase on the official ST utility on windows to enable the chip for use again ๐ฒ
Hopefully won't be too long to a fix but without a debugger it could be tricky.
Has anybody here encountered flash corruption on an ST chip before?
hmm thats interesting, it didnt get me flash corruption on win10 but it definitely has very slow flash writes
@idle owl I don't have time to test it, but I found a reason based on the datasheet that the ADC on nRF would read about 9% low. I will toss it in a pull request before I head out for the evening.
@onyx hinge Ok, if you want to toss me a build, I'll test it tomorrow during the day.
@idle owl I think the build will become available from github automatically, if you click through to the build from the PR
Oh right!
Datasheet reading explains one reason why readings might have been 10% low.
based on what you said and what I understand, this would increase a reading of 3.0V to 3.27V (3.0 * 3.6 / 3.3). That's still not quite the level that you mentioned as "high" voltage..
the number "3.6" in the source could be changed to a slightly higher number like 3.65 if it's specifically important to reach 3.29V
and there are other options such as (VDD/4) as the reference and (1/4) as the gain. I think in theory using internal reference and (1/6) as the gain gives more accurate voltage measurements, since internal reference varies less than VDD
anyway, going AFK. Will read back here or on the PR for your findings! thanks as always for finding these issues and writing them up clearly
thanks - there does not seem to be a way to use plain 3.3V (VDD) right? it must be 3.6?
Failure with adafruit-circuitpython-circuitplayground_express-en_US-5.0.0-alpha.4.uf2 and latest 5.x-mpy bundle: ```import board, busio, digitalio
from adafruit_mcp230xx.mcp23008 import MCP23008
i2c = busio.I2C(board.SCL, board.SDA)
mcp = MCP23008(i2c)
pin0 = mcp.get_pin(0)
pin0.direction = digitalio.Direction.OUTPUT
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "adafruit_mcp230xx/digital_inout.py", line 112, in direction
File "adafruit_mcp230xx/mcp23008.py", line 76, in iodir
File "adafruit_mcp230xx/mcp230xx.py", line 74, in _read_u8
File "adafruit_mcp230xx/mcp230xx.py", line 73, in _read_u8
File "adafruit_bus_device/i2c_device.py", line 147, in write_then_readinto
TypeError: extra keyword arguments given
It looks like the i2c_device module baked into circuitpython is out of date. If I save the current file from GitHub and change mcp23008 to use the local copy instead, it's fine. (Line 147 in the current i2c_device.py is a comment, not a function call.)
"local" whatever... The one in my /lib folder, not the baked-in one.
ADDED: Using i2c_device.mpy from the adafrult_bus_device folder in the library bundle (the a la carte version for non-Express boards) also fixes the problem. No TypeError with it.
@ladyada, there is an option to use a VCC/4 reference and a 1/4 prescaler, instead of a 0.6V reference and 1/6 prescaler as it does now. I can do some testing with both, but how to decide which is preferable?
prior is better - eventually having this be adjustable (reference) would be ideal cause you can get absolute voltages but for now, VCC/4 + 4x matches every other chip :)
OK, now it will be vcc-referenced. Gives a nice consistent 65520 counts (0xfff0) when VCC is connected to an analog in or my little trimmer resistor is turned all the way to one end of its travel.
'night all!
This looks good. I didn't spot any typos and the images have the widths according to the instructions in README
The user experience arriving at these board pages is arguably worse than not having the pages at all.
An alternative would be to have a standard way of marking boards as "only supported by older versions of CP" and providing more direct links to the last supported release.
Spurious CI failures: Cloning into '/home/runner/work/circuitpython/circuitpython/tools/python-semver'... ##[error]fatal: could not read Username for 'https://github.com': terminal prompts disabled ##[error]fatal: clone of 'https://github.com/k-bx/python-semver.git' into submodule path '/home/runner/work/circuitpython/circuitpython/tools/python-semver' failed
and rerunning it manually gave me a different, quicker error ๐ฆ
CI says, "On guard!" โ
@indigo wedge looks like a cute/neat little board!
can some of the pins do touch?
that only requires that the pins can be used as analog in, right?
all 6 can be used as analog in
On M0 I'm not sure tbh
touch requires they be on a Y line to the PTC
@ionic elk at least on samd crystal pins aren't gpio. the swd pins can be
PA04 .. PA07 are on "Y" lines, but GPIO4/5 are not (they are on "X" lines)
OK, that's good to know!
Doesn't an ST Link work as a debugger? What am I missing?
On Mon, Sep 16, 2019 at 2:44 PM ladyada notifications@github.com wrote:
hmm thats interesting, it didnt get me flash corruption on win10 but it
definitely has very slow flash writesโ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/adafruit/circuitpython/pull/2143?email_source=notifications&email_token=AAAM3KMVGMOFLNW4S24RHKLQJ7437A5CNFSM4IVNW2K2YY...
@tannewt things have been a bit inconsistent, but my texane/stlink program which launches the gdb server does not recognize the flash of the F412 as valid, and cannot load binaries. The F411 was having the same issue, but I was actually able to fix it by erasing it with the windows utility (no luck doing the same for the F412). Latest Analogio code will irrecoverably crash mu (computer must be restarted), and corrupt the flash, making both boards un-debuggable as well as unwritable. Can't get...
Ok, ping me tomorrow morning if you haven't gotten out by the end of today.
I think I should be. While I reset-protected pins that seemed obviously critical like crystal pins and debugging, I think I must have missed something else that was system critical. My suspicion is that GPIO resets on some pins might even persist past a flash erase. I'm going to invert the never reset process to exclude all pins that aren't directly broken out by the board, and see if that helps.
For supporting the TFT Gizmo
The latest commit should fix all issues, hopefully. @ladyada, I've attached a binary if you'd like to try it out again, or alternatively you could try grabbing the binary out of the CI as Scott's been promoting.
firmware.bin.zip
@onyx hinge heya i think removing the boards didnt really remove em?
like - we now get Uknownn Boards https://circuitpython.org/downloads
CircuitPython Organization
@meager fog @onyx hinge i'm fairly certain its because they are still listed in _data/files.json, which downloads.html uses to build the list. https://github.com/adafruit/circuitpython-org/blob/master/downloads.html#L56
probably will require a change to the release updater in the core repo.
actually, may just need to remove them in the circuitpython-org repo's version. the release updater just doesn't touch them.
@gilded cradle Do you want to do the releases if I merge your PRs?
Yep
Right on.
Thanks @idle owl
@gilded cradle You're welcome
tested! this has fixed the digitalio AND analogin stuff - can now digitalio and have LEDs toggle, and analog in works independantly on A0-A5
nice job! want me to merge or you have things you still want to do with it?
I'm fine with a merge if you are! It'll get one more thing off my list :)
ok i kicked github CI - might hve to do it again, its being hang-y once it passes ill merge
@meager fog ouch, I'm sorry about the consequences of my PR. I wasn't aware of any way to test locally, so just did it blindly..
so now I've figured that out and will add it to the readme
Pull request #286 was incomplete, it left "unknown" boards in the list. This finishes removing Feather Huzzah and Feather nRF52832 from the index of boards.
Testing performed: Built locally and looked at the "downloads" page
The minisam.cc URL redirects to a 404'd page at minifigboards.com.
The new URL is the new order page on minifigboards.com.
Testing performed: built locally and clicked the link
Thanks @jepler! Especially for the local test procedures...those are super handy.
and poof! they're gone. ๐
thanks @raven canopy
I've used jekyll before so I could do it once I actually THOUGHT things through instead of firing off untested PRs .. but it should help someone else as well!
i'm jekyll illiterate, but i have experience with ruby and bundler. the latter which has driven me insane with ansible...
but, package management isn't easy. which is why nobody gets it perfect. ๐
I would not be comfortable PROGRAMMING ruby, but like so many languages they have made the setup process pretty painless if you start with a working linux system. I assume on mac too.
like most of my programming skill, its code-by-reference. the manual is always open...
hmmm
and this next one might need it. I was running a link checker over the generated site, and there are a bunch of bad links on the https://circuitpython.org/libraries/contributing page -- all the ones that say "(### days)"
CircuitPython Organization
ahh. no, i see what @onyx hinge is saying. the link includes the (nnn days):
https://github.com/adafruit/Adafruit_CircuitPython_TLC59711 (194 days)
right
Oh.
I am trying to fix it...!
womp, womp.
@hierophect can you do like a fake push with a whitespace change? i cant seem to restart CI
<li><a href="{{ issue | split: " " | first }}">{{ issue }}</a></li> clear as mud
.. by splitting the issue text at the first space, so that the URL doesn't include that part.
Some (a lot of ?) boards don't have 4.1.0 uf2s```- ./_site/board/datalore_ip_m4/index.html
- External link https://github.com/adafruit/circuitpython/releases/download/4.1.0/adafruit-circuitpython-datalore_ip_m4-en_US-4.1.0.uf2 failed: 404 No error
the site for the "datum" modules may just be down. and yeah, it's a small number of boards maybe not supported in 4.x, that have 404'd uf2 links
besides that the others seem to be false positives due to how links work in jekyll I think - -the link checker thinks e.g., every link to /blinka is 404 because it's /blinka.html
but it must be some kind of bug that those boards are listed in _data/files.json as having working 4.1.0 links...?
not sure how that file is updated, I guess via adabot?
if I manually removed them, would adabot put them back like a jerk?
39 228 1450
``` hm the datalore_ip_m4 is "in" 4.1.0 source tree
yeah, datalore doesn't show up in the assets until 5.0-alpha.1. _data/files.json is updated by build_board_info.py in the core.
is this a case where the board was incorrectly added, like not listed in travis.yml?
yeah it is missing in travis.yml of 4.1.0
so .. I guess the resolution would be a 4.1.x bugfix to add them to travis.yml. @slender iron ?
and do 4.1.1 or 4.2
if a new release was done, i'd suppose 4.1.1.
if you removed it from files.json, it looks like any subsequent (unstable) release will just assume it has a previous build and re-insert it: https://github.com/adafruit/circuitpython/blob/master/tools/build_board_info.py#L238
While reviewing broken links on circuitpython.org, I noticed that some board uf2 files are missing, but are linked from cp.o. This seems to be because the boards were not listed in .travis.yml.
Testing done: None, need to look at the results of travis build
OK I went ahead and tossed in a PR for that. and .. I wasn't going to work on CP tonight or this week. oops
fwiw I did bundle add html-proofer (which is wrong, because it tries to configure them as permanent parts of the circuitpython-org build) and then bundle exec htmlproofer ./_site --assume-extension after building the site
hehe. its hard to stay away.
it pretty quickly turned up some good issues to work on ๐
since I don't know the right way to add it for sure, I'm not going to add it to README.md right this second.
it might be harmless to do the bundle add, I am just not confident
htmlproofer diagnosed this problem:
- ./_site/404/index.html
* External link http://localhost:4000/feed.xml failed: 404 No error
'night!
Note for next time, if you see the "not a tree warning" the best thing to do is merge in the latest master and push it. It only happens if something else has been merged into master since the start of the initial CI run. This is why it happens even on the first run if master changes.
Where is it read and used? Will you use it for something later? Why does each additional set of pins need an index? All I can see here is that you are storing an arbitrary number for no reason.
I get what you're saying now. I was thinking along the lines of a unique identifier available for iteration, but since I'm using an array of peripherals for indexing it isn't actually necessary. I think uniqueness would be established by an alt-function listing anyway. I'll get rid of it.
@ionic elk let me know if/as you want more f412 testing
lets also set up a place for test suite code
Looks like the builds don't fit. We must have fixed that on master already. Here is one commit that does: https://github.com/adafruit/circuitpython/commit/c61c874a6d42d2bf620dba3f93aaca2d61aeb9d1#diff-b3fbacd539ac0ce00ddaf0ca5db3895b
Please remove the above because it is untested.
One request but looks good otherwise!
Feel free to wait until the CI finishes to know if there are any other last fixes needed.
@hierophect please fix above deletion request - WE ARE SO CLOSE :)
Something like this?
#ifdef I2C3
I2C_TypeDef * I2Cbanks[3] = {I2C1, I2C2, I2C3};
#elif I2C1
I2C_TypeDef * I2Cbanks[1] = {I2C1};
#endif
for(uint i=0; i<(sizeof(mcu_i2c_list)/sizeof(*mcu_i2c_list));i++) {
if (mcu_i2c_list[i]->sda_pin == sda) {
for(uint j=0; j<(sizeof(mcu_i2c_list)/sizeof(*mcu_i2c_list));j++) {
if (mcu_i2c_list[i]->scl_pin == scl) {
if(mcu_i2c_list[i]->i2c_index == mcu_i2c_list[i]->i2c_...
Actually that lookup table needs to be way, way uglier. There's no indication other than manually counting for how many indexes of a peripheral there are, and they can skip units. I don't think a lookup is the right option here.
I could do it with a set size lookup like this, I guess
I2C_TypeDef * I2Cbanks[3] =
{
#ifdef I2C1
I2C1,
#else
NULL,
#endif
#ifdef I2C2
I2C2,
#else
NULL,
#endif
#ifdef I2C3
I2C3
#else
NULL
#endif
};
@meager fog what kind of place are you thinking for the file sharing?
Github comments seems pretty straightforward and keeps the files in sync with the conversation, but I'm happy to swap if something else would be better.
Okay, I don't anticipate having time to work on getting the builds to work, any suggestions if there's another way to fix the 404s on the circuitpython website?
@slender iron do you know what might be the difference between pyb_i2c.c and just i2c.c in micropython? They're two complete I2C implementations, one that uses the HAL and one that's completely register based, respectively.
machine?
it's a name of the module in MicroPython that has all the hardware interfaces
So in the typical use of micropython, which would get used? the port specific module, or the machine?
Would the user pick?
this is an excellent question, and one of the main reasons why CircuitPython changed it
you see, the answer is "it depends"
blegh
@ionic elk github issues get closed, this isnt really an issue, its a test suite
@ionic elk please add them here, you can create a todo https://3.basecamp.com/3732686/buckets/4356693/todolists/2033789829
this doenst have a build yet but will!
Yeah, I made an educated guess as to what it will be called. :)
@meager fog sorry but I'm still not sure what you mean! Do you want me to post binaries in an entry on my todo list, or make a whole new todo list for STM32 binaries that need testing?
Companion to #269.
- Updates adabot to remove the Travis specific functions that limited updates to a single day in the week, and allows Travis environment to use the
-ooutput file flag. - Updates
travis.ymlto upload artifacts (libraries.json generated from adabot) to the AWS S3 bucket. Location should beadabot/web/. AWSARTIFACT_environment variables have been added to Travis.
๐ค looks like some automated firmware downloading has occurred. all but 2 boards have at least 12 downloads of 5.alpha.4. (saw it on adabot's run, and verified in github api)
it all occurred in the last day. interesting...
realizes it could be considered "interesting" that i can type up github api calls from memory. ๐ฌ hehe
in other news: Blinka has 46,170 total downloads from PyPI. ๐
wait I can make a number go up!!!
Is there a way to have a WiFi gamepad talk directly to a Metro Airlift using Circuit Python?
Thanks
@raven canopy automated b/c the distribution is too smooth (regardless of board popularity)?
@crimson ferry yeah, that's what nudged me into thinking that.
Quick question: What is the VREF used for AnalogIn? I am having a bit of a calculation issue and not sure if VREF is set to 3v3 or not. Is it set to internal by default or one of the external PA03 or something?
I need to read a 5V voltage from my circuit. I already have a 10k voltage divider but keep getting incorrect values. I keep getting around 8000 instead of higher ones. For 3v3 I get 32,000. Something appears to be going astray behind the scenes
After a bit of investigation, what is happening is that the analog in value is overflowing. I don't understand why this is happening for values like 5v. If someone could explain how I can read in a 0-5v range with circuitpyrhon that would be very helpful :)
@craggy galleon Is your setup essentially like this ("Meauring Battery" section)? https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51/power-management
What's the intended parameter order of busio.I2C()? This tutorial https://learn.adafruit.com/circuitpython-basics-i2c-and-spi/i2c-devices says it's SCL,SDA, but I can't get it to work unless it's the opposite.
This is for the 411
I don't see the order on the common-hal level of course, just the sda and scl pins. Which is why I'm puzzled.
double check your pin defs
I wouldn't worry about it because they are really obscure boards.
Looks good! Will sit on the merge until after another PR run is finished.
A couple more comments and an off by one error.
You need a NULL here for index 0 or do a -1 below when you index in.
Please name each of these for the pin they match up to.
Mixed should be fine. In SAMD since we track options per pin, we have three sercom slots ordered by their AF number.
@ionic elk I spotted an off by one error โ
Sorry, I guess I really shouldn't push unless I'm finished with an approach, so you aren't needlessly reviewing WIP code. My new system reworks most of this.
Known issue: plugging in the wrong pins will correctly result in an "Invalid I2C pin selection" error, but after fixing them, future saves all result in a "[Errno 5] Input/output error" until the board is reset.
@slender iron This is getting into the python end a bit, so I have to ask: does something like busio_i2c_obj_t automatically go away when a circuitpy drive is overwritten? I don't see that either existing port actually calls any module's common_hal_deinit in port.c so I assumed it was done at a higher level.
I ask because I've got some kind of conflict that's making the ST's I2C hal write function fail if you save the same code twice, and no amount of hardware-level resets is making it go away. Something is persisting past a soft reboot, and I'm not sure what it could be.
the memory itself does get freed because the heap is reset
typically peripherals are reset in bulk by the port in supervisor/port.c https://github.com/adafruit/circuitpython/blob/master/ports/atmel-samd/supervisor/port.c#L207
It's an ST HAL bug. yayyyyy
@ionic elk when you are not neck-deep in i2c peripheral lemme know
@ionic elk whew!
good work
so i designed this F405 feather
it works with micropython
how big of a project is 'F405 support
Not big I can start now
ok so i should be able to create I2C peripherals on any valid pins?
@ladyada yes. I recommend starting with PB08 SCL, PB09 SDA just so we're synced up
@ionic elk im into that
@meager fog also, did you want me to make a new todo list for the testing binaries?
I wasn't sure what you meant
on basecamp
I'll post my big megascript
not yet
Not sure! Haven't looked yet.
I'm not sure why a pin addition for the HalloWing M4 would cause a bunch of other boards to fail, but I queued for a restart.
squints at samd and nrf ports
os doesn't seem like a lot of code but I'll have to get up to speed on the vocab
both common-hals in each port have an init
i was testing some libraries and they import os and fail ๐
kk
and it seems like either its "really hard" or "really easy" to add os
see if it works. I think it's excluded by the restricted port define
id like to test some of the more bizarre i2c chips
looks relatively simple https://github.com/adafruit/circuitpython/blob/master/ports/atmel-samd/common-hal/os/__init__.c
can start by stubbing out random
lunch
yeah what i need is os.stat
k
HMMM yes that would be nice
I'm going to make a new PR for this
keep it distinct from the current I2C stuff
Do you have a DRV2605 on hand? You could use that in the meantime
import time
import board
import busio
i2c = busio.I2C(board.PB10, board.PB09) # SCL, SDA
print("Init")
i2c.try_lock()
print("Lock")
i2c.writeto(0x5a, bytes([0x00]),stop=False)
print("Write")
result = bytearray(2)
i2c.readfrom_into(0x5a,result)
print("Read")
print(result)
i2c.writeto(0x5a, bytes([0x01,0x00]), stop=True)
i2c.writeto(0x5a, bytes([0x02,0x00]), stop=True)
i2c.writeto(0x5a, bytes([0x04,0x01]), stop=True)
i2c.writeto(0x5a, bytes([0x0C,0x01]), stop=True)
while True:
print("Click")
i2c.writeto(0x5a, bytes([0x0C,0x01]), stop=True)
time.sleep(1)
yaah thats why was like "hey we alredy wrote this code" ๐
in our drv driver
you should be able to drag over the mpy
This PR adds extremely basic OS support to assist with libraries.
woopz i think this got mixed with another i2c PR? if its easier we can wait till i test the other open PR so it can be merged
Is there any support for Circuitpython for the ESP32 feather?
@ladyada It's a direct branch of my existing PR, since I need that code to test I2C libraries
@brazen cedar nope! micropython is your go-to for ESP32 ๐
@ionic elk can you give my lazy butt a bin
oh that was magick ๐
thanks @meager fog!
@slender iron Does this code tie in anywhere else? As in, can I simply add it to an existing library that doesn't have it and it will work? I don't see somewhere for it to tie in elsewhere, but maybe I'm missing something. __version__ = "0.0.0-auto.0" __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_MAX31865.git"
You just need to add it and ensure that circuitpython-build-tools builds the library. It does the substitution
if the lib is in the bundle, it's being built, right?
These are all older libs that were pre-cookiecutter
This one seems to have everything else that cookiecutter adds, except that, so I don't want to redo the entire thing if it's not necessary
@meager fog it's working for me
@ionic elk im having that mysterious no-enumeration thing again ๐ฆ
i tried programming thru stm32cube as well
wait now its coming up
i guess i guilt-tripped it
Sometimes you have to wait
If it re-writes the flash, it takes a long time
My command line tool always erases the whole flash, but gdb-load doesn't and there's a big difference between the two. the MBED load system might be closer to the first.
Added a few more pins to address the other Learn Guide issue
tested, this is good!
>>> import os
>>> os.stat("foo")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 2] No such file/directory
>>> os.stat("boot_out.txt")
(32768, 0, 0, 0, 0, 0, 108, 1480810702, 1480810702, 1480810702)
>>> dir(os)
['__class__', '__name__', 'chdir', 'getcwd', 'listdir', 'mkdir', 'remove', 'rename', 'rmdir', 'sep', 'stat', 'statvfs', 'sync', 'uname', 'unlink', 'urandom']
>>> os.mkdir("test")
Traceback (most recent cal...
Let's make sure we merge the original first!
@crimson ferry Yes that is the same set up. So when vbatery is greater than 5v I get the overflow issue.
@craggy galleon if you're dividing 5v in half with the divider, you should be well within the 3.3v max ref. Check both of your resistors separately and make sure they match? Or post circuit and code (maybe better in #help-with-circuitpython )
Ok. Will do.
@ionic elk which pads are PB09/08?
i can get the schem - wish these were labeled tho
ok looked up the schem, the 'arduino header i2c' pins are i2c = busio.I2C(board.PB10, board.PB09) # SCL, SDA
ok tested I2C with an MCP9808 and our library - can i2c scan and read the sensor just fine, used both
i2c = busio.I2C(board.PB08, board.PB09)
and
i2c = busio.I2C(board.PB10, board.PB09)
successfully. tried other 'bad' combos and they wouldnt initialize (correct!) so i think this is good to go for now and we'll keep finding bugs :)
test with sensor approval - not code approval :)
reminder so we don't forget!
like os this one is easy to enable and will let us use libraries for testing i2c, spi, etc :)
I'm not sure why it's failing checks. It seems kinda random.
STM32 boards will sometimes soft reboot 1-5 seconds after being written to flash. I'd like input on whether anyone else experiences this error to rule out mac-related USB issues and the like.
this happens on mac's cause they write cruft to the disk - it doesnt happen on windows or linux
closin cause thats how macos is :)
Oh. Should I close issue then?
@meager fog note that I added in some "SDA" and "SCL" labels for the pins in the usual arduino location for I2C.
F411 users will have to look up combinations but F412 people can just pretend they're on Arduino as far as pin features go, same as the metros.
@ionic elk sure
@ionic elk do you need another review from @slender iron on the periphral PR
It disables function inlining and disables ipa-sra. However, some inlining (specifically, I think this means inlining atomics and functions explicitly marked as inline) still occurs. I could add -fno-inline if you think it would be preferable.
-finline [enabled]
-finline-atomics [enabled]
-finline-functions [disabled]
-finline-functions-called-once [disabled]...
(with modern debug information, gdb can show full tracebacks even involving inlined functions)
It's not much to look at, but we got circuitpython's REPL displaying on a Commodore 64 via the USER (serial) port.
then it turned out (A) the line editing didn't work and (B) neither my C64-owning friend nor I could come up with anything useful to do
Can anyone tell me if I can get a version of circuitpython for the M0 adatalogger that has the audioio and audiobusio modules? It seems to have been left out of the build of circuitpython for this board.
@onyx hinge awesome!
@obsidian dome you can build one yourself. it's left out because the flash is taken up by the filesystem
If I interpret this right, there is an additional module in the build for the adatalogger to enable reading the SDCard filesystem which took up space, so we left off the audioio? I don't see any extra modules (using help("modules") to look) on the adatalogger in question. What module is this?
@obsidian dome SDCard access is handled by a separate library adafruit_sdcard. The problem is, I think, that since the is no SPI flash on the adalogger, the CircuitPython Filesystem is in the on-board flash and reduces the space for additional modules like audioio.
core module support matrix: https://circuitpython.readthedocs.io/en/4.x/shared-bindings/ (5.x: https://circuitpython.readthedocs.io/en/latest/shared-bindings/support_matrix.html)
@slender iron Since this seems to be a recurring theme in my life, could audioio become a "loadable" library? Alternatively, which modules would be "candidates" for exclusion to make space for the audioio and audiobusio modules?
@obsidian dome we could potentially make things loadable with the new native module work damien has done but it's a ton of work
audio is tricky because stuff has to happen in the background
I gather there really isn't room for audioio in the on-board flash on these chips. Could I load part of CircuitPython from the SDcard?
or maybe all of circuitPython?
we can't fit audioio and the filesystem within the 256k flash
you'll have a much better experience on an samd51
When you say "filesystem", is this something that could be on the SDCard?
@onyx hinge i love how useless it is!!
@onyx hinge that is super cool, nice work
CircuitPython snakes its way to the Commodore 64 (news from 1982, alt universe)
great blog title
@obsidian dome circuitpython can't only have an sd card filesystem currently
thanks.
@meager fog whatever you feel is best practice. @slender iron might want to look at it as it contains a number of code style decisions.
@meager fog also, all these tiny STM32 dev boards have reminded me I was close to finishing a pretty enormous tutorial on setting up STM32s with the Black Magic probe/stlinkV2 earlier this summer. Is that something that might be appropriate for Learn?
I'm almost certain this is related to the message on my git status:
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
(commit or discard the untracked or modified content in submodules)
modified: lib/tinyusb (untracked content)
no changes added to commit (use "git add" and/or "git commit -a")
But I can't seem to figure out how to get that to go away, what i...
@ionic elk please comment on PRs that are ready for my re-review otherwise they won't make it to my inbox
@slender iron you got it
Ok, never mind, I figured out how to fix that. Still can't figure out the build errors.
Note that TRNG is supported on the F412 and the F405, but doesn't exist on the F411. Is that significant for this case? Should I just pass in a pseudorandom number for the F411?
Which errata is it in? I don't see it in: ES0182 Rev 10
Check here to see if the pins are already in use too. You can test it by constructing the same bus twice. The second time should fail with pin in use.
Looking pretty good overall. I think there is a bit more work to do around pin in use tracking and one suggestion on the i2c pin structure.
You likely need a bulk reset here once you actually track pin usage.
On the 411 just return false like the SAMD21 does. The actual random module already does pseudorandom and uses this as the seed if it can.
Glad I asked. Sounds good.
I'd suggest rebasing the os and struct commits onto master for this PR. That way this PR doesn't depend on the other and we can review and merge in parallel. Let me know if you need help with git. It's got a steep learning curve.
The error is actually not listed in the F4 errata, but follows the exact pattern of the "I2C analog filter may provide wrong value" error listed in the F10xx erratas here (2.14.7) and [here](https://www.st.com/content/ccc/resource/technical/document/errata_sheet/7d/02/75/64/17/fc/4d/fd/CD00190234.pdf/files/CD00190234....
Sure, just wanted to show the alternative as an option, if you felt it'd be better done this way.
@tannewt I'd be happy to rebase, but since there are no modules I'm aware of that can even make use of OS and Struct without I2C being available, it'd make this hard to test independently, which is why I had it as a branch. I can probably fix your comments on I2C pretty quickly, do you still want me to move it?
These build errors are your fault. GitHub CI is unreliable. :-/
The original failures could probably be solved by moving us off of "use" statements since they appear to require a download.
The rerun fails because master has had a commit merged and the rerun isn't exactly the same as the original. The workaround for this is to merge master into the PR branch and push the merge commit to trigger a new build.
Macs would get grumpy looking for FROZEN_MPY_DIR if it didn't exist. Closes #2139, thanks for the suggestion @jepler.
I'm happy to merge this even though the CI hasn't passed successfully. It's small enough it should be fine. Thanks!
341428b Added SPEAKER pin to HalloWing M4 for code comp... - makermelissa
b7598f7 Merge branch 'master' of https://github.com/ada... - makermelissa
9a74bf9 Added TFT pins to HalloWing M4 for code compati... - makermelissa
67c35bb Merge pull request #2166 from makermelissa/master - makermelissa
You can test os and struct yourself with a test script like what @ladyada did above. Please do move it and make any PRs you do in the future independent so we can have multiple review cycles going.
Isn't this already done at the application level? I get this behavior by default, and neither the samd or nrf ports have claimed pin checking. Or did you mean checking the I2C peripherals themselves? That's a good idea, since trying to initialize the same peripheral twice will cause IO errors on writing, but I'm not sure how to present that to the user given how we've abstracted the device away.
Again, I'm not sure what you mean by this, as pin resets are handled by reset_all_pins.
@ionic elk hiya when you split your PR for adding struct into a new mini-PR let me know
and ill test/review it!
I just folded it into OS and renamed it, since it was just one line of code
^typo
There's no HAL component so I just added it in
@ionic elk i think what @slender iron was saying is dont hvae it based on the I2C PR at all
have it be totally separate
just the os/struct enabling
that way its minial, easy to test and approve/merge
lil bite sized PRs
Oh, right, the rebase. I don't understand how we can test it without I2C though
i can totally test it
Are there libraries that will work without it?
just import os and use stat or listdir
or struct, and do some struct pack/unpackin'
those are not interdependant on I2C periphearl ๐
Ok, I can rebase it, I don't think there should be any problems...
Yup! You are right. The pins are checked here: https://github.com/adafruit/circuitpython/blob/master/shared-bindings/busio/I2C.c#L78
Checking the peripherals would be good too. Looks like SAMD will do "Invalid pins" but something like "Hardware in use" is probably better.
Also make sure that after you deinit you can recreate a new bus with the same pins. deinit should have freed them.
this is a good one to do it with cause they should be small and as mentioned, dont interfere with others!
like the diff should be an easy-on-the-eyes 20 lines or so (not sure the exact num but yknow what i mean, not 400 ๐
No worries. Let's make sure and resolve these questions in the draft phase. Just drop a comment on the PR with a mention for me and we can decide.
This is fine. Just wondering.
Whoop good point on the deinit I think I forgot that
The reason I2C peripherals are not reset here is because it's brute forced in the init code, as noted! I didn't feel like there was much point in doing it twice. If/when I do the peripheral rework I can either fill this with useful stuff or just delete it. Only nrf also has a function like this, I think.
@tulip sleet here are my current bleio changes: https://github.com/adafruit/circuitpython/compare/master...tannewt:bleio_tweaks
I2C currently has problems resetting after a soft reboot, such as after a write to disk. The error is actually not listed in the F4 errata, but follows the exact pattern of the "I2C analog filter may provide wrong value" error listed in the F10xx erratas here (2.14.7) and [here](https://www.st.com/content/ccc/resource...
Ok, please add a link to the issue in the comment then it's fine. Thanks
You'll want to do it on reset if you use the peripheral state to determine if it's already in use like samd does. I think it's still good to reset because it'll stop anything from happening after Python code finishes. There can be a big gap between python vm finishing and then rerunning again and the hardware should be in a known state during that time.
<@&356864093652516868> Here is the notes doc for Monday's CircuitPython Weekly meeting. Everyone is welcome and encouraged to attend! Please add your hug reports and status updates before the meeting even if you'll be attending. It's super helpful! If you are missing the meeting, you can also add your updates and I'll read them off during the meeting. Hope to see you there! https://docs.google.com/document/d/1ZuSsOya1vLgXYDaaJwe3MtVvpTgwkijae6DlWr7e4ag/edit
Posting the link early this week because I won't be around much until late Sunday. You don't need to add updates immediately.
test with sensor approval - not code approval :)
All issues should be resolved this push. Testing bin:
firmware.bin.zip
.
Ok, I thought the rebase was going to be simple but it's turning out to be a huge pain, so I'm just going to go ahead and delete/recreate this.
Changes look good. Thanks! @ladyada feel free to merge once you are happy.
This PR adds rudimentary OS and Struct support, to enable more libraries for use. Does not yet integrate TRNG, see #2168.
@meager fog getting started on F405 support now. If you've got pinout information for the feather I'll take it.
@ionic elk hiya back
im reviewing the i2c stuff now
had to get some other folks goin
here's the files!
do you have a F405 or F407 devboard?
@meager fog I've got a Pyboard!
f1's are too small, yeah
maybe at some point
but tough
@ionic elk ok thats perfect
@exotic pumice they don't have enough memory but I think it'd be hilarious to do one with external ram and a lot of caching
also @meager fog any thoughts on the stm32 tutorial?
tested, seems to be working well for me! we'll do more thorough testing as we add library support, of ocusre :)
ok i just merged i2c
yay
which tutorial?
which tutorial?
which tutorial?
woops
discord hiccup
oi my messages are not coming thru
I can see them
I see your messages @meager fog
lol yeah dunnow hat happened, i sent one message but it transmitted it 4 times and was greyed out text
anywho! ๐
weird!
Anyway I wrote this huge tutorial on getting the stm32 set up with hardware, HAL/rtoses, BMP and STlink debugging, and IDE integration
late last spring
wow ok
Was originally for somebody else, never published it
oooh
Was wondering if you'd like it for learn
ok
sure - next week mike will be back
if ya can hold tight for a few days, mike's the learn guide guide
like i have to write a guide on how to DFU fresh stm32 boards cause it is SUPER UNCLEAR
but once you know, its a great thing
ok
ok lets chat next week when mike's back
And be helpful
Super, ty
testing struct
tested struct with
https://www.journaldev.com/17401/python-struct-pack-unpack
with success
import struct
var = struct.pack('hhl', 5, 10, 15)
print(var)
print(struct.unpack('hhl', var))
@ionic elk ok lil typo - if ya fix and give me the firmwarebin ill retest
(os was not included)
@meager fog whoops fixed
@ionic elk word
@ionic elk ok smooth sailin'
@ionic elk i think CI is stuck, @slender iron does it sometimes take 10 minutes for github CI to spin up?
it may if other jobs are running
https://github.com/adafruit/circuitpython/actions seems to be the page similar to the dashboard
ooh ok thanks - i was looking for a global dash ... this is the right thing
ok its still workin on th last one okidoke
the '27 minutes ago' build is still going even though its timer isn't counting up
yeah its 3/4 done
(hi!)
I do think it is making progress
yeah i have to learn what words it says mean
indeed
"correct typo" looks like it just started actually building
@meager fog so much weird stuff with the M4 DAC
for audio rate and mono it's just fine
yep
right up until you pointed me at those reports of weirdness in Arduino I was ready to chalk it up to bugs in CP that just weren't fully identified yet
yah
but .. something in the errata would be nice
wanna open a ticket with atmel?
"if it's this broken, how is there no erratum about it"
I've never done anything like that before!
how far do you boil it down so that it's independent of an environment like CP/Arduino before you do something like that?
(It won't happen for at least 3 weeks if it's on my plate)
you basically tell them what you're doin'
and see what they say
this probably isnt the first theyve heard of it
dan can help ya - he's doing one
@ionic elk ok while we wait for these PR to bake
you are gonna start poking at 405/407?
I will remember to ask him about it then
@meager fog I'm writing pin defs for the Pyboard
probably going to head out soon though I'm visiting my folks over the weekend
It'll be first on the list monday
have a good weekend @ionic elk
ty!
@ionic elk all good, thanx! ill merge when travis is done
@ionic elk done!
It's safe to delete old forked-for-PR repos under my github user, right? No reason to keep them, I assume.
@crimson ferry if the PR's have been merged, then all the info you would need has been merged. But you don't need to re-fork for a new PR, if that's what you're doing. Just delete the merged-PR branch, bring the fork up to date with git fetch and git checkout master; git merge upstream/master, and start a new branch.
OK, thanks. I think I skipped the step to make a branch, so it's just master. But I think no harm starting over clean.
I'll get this process down eventually ๐
@crimson ferry, yes, always make a branch for the PR, so that your version of master is not different than upstream
I have a CPX and the TFT gizmo. I put CircuitPython 5.0 alpha 4 on the CPX, but no libraries (yet). does anyone know how to get something showing on the gizmo screen? CP REPL would be fine. just looking for signs of life from the gizmo.
@strange cargo try the CPX build that includes displayio: https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/circuitplayground_express_displayio/
thanks! I'll try that...
@strange cargo I am guessing - have been away for more than a week
@tulip sleet, I loaded the latest build from there. after reset I can connect to the REPL, but I don't see anything on the TFT
@strange cargo the PR is here: https://github.com/adafruit/circuitpython/pull/2163/files . It looks like it does not define a default display, so you'll need to use the display as a regular off-board display. Checking to see what kind of display...
@strange cargo I'm pretty sure it's this driver: https://github.com/adafruit/Adafruit_CircuitPython_ST7789. Just use set it up like the breakout version: https://www.adafruit.com/product/3787
double-check the pins
thanks! I'll read through this stuff and try...
Received my Circuit Playground Bluefruit (alpha). I'm not much of a developer, but I got it with the hope I can contribute to testing. So I installed 5.0.0 a4 firmware and adafruit_ble library on 9/18. Getting the messages that @mytechnotalent got about "no module named 'bleio'". Tonight I loaded latest build (alpha.4-72g7f1bc48a8 and 9/20 20:38 library. No change. Same error for uart and beacon library examples. I will also be testing examples on feather nrf52840 as a check.
@void trench you need to use the alpha BLE library as well https://github.com/adafruit/Adafruit_CircuitPython_BLE/releases. It is not in the โbundleโ
@jerryn, many thanks! That got the eddystone beacon example working. But the UARTServer example is no joy. ImportError: cannot import name UARTServer So I can play with the beacons for a while. Double-checked the spelling on UARTServer...
@tidal kiln wow pyftdi on windows is a total mess
๐ฆ
linux and mac seem pretty smooth
i think i can get it working BUT
libusb 1.0.22 has memory access issues
rather pyusb does, and it seems abandoned
looks like even that other one (ftdi1) needed libusb
and same rough process for setup on windows:
https://learn.adafruit.com/adafruit-ft232h-breakout/windows-setup
CircuitPython demo - NeoPixel RGBW
from adafruit_circuitplayground.express import cpx
import time
import board
import simpleio
import adafruit_nunchuk
nc = adafruit_nunchuk.Nunchuk(board.I2C())
while True:
x, y = nc.joystick
ax, ay, az = nc.acceleration
r = simpleio.map_range(x, 3, 253, 0, 255)
a = simpleio.map_range(ax, 302, 512, 0, 255)
print("joystick = {}, {}".format(x, y))
print("acc = {}, {}, {}".format(ax, ay, az))
cpx.pixels.fill((x, y, ax))
@tidal kiln ok i figurd it out - that PR actually solves it
so...somehow we gotta tell them to install that branch
btw C8 and C9 arent in board - i thought they'd work?
there's LEDs attached, so it'd be nice
@karmic notch see here for how to mark up code blocks:
https://support.discordapp.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline-
@truewen you'll get more help there for sure!
hmm i wonder why i put LEDs on them then
or at least not via the python module
@tidal kiln word digitalio is tested
did you want to add i2c scanning later
i could merge it without
doing it now....looks easy
i can probably push scan here in a sec
4.127330 0.890584 9.346344
4.141694 0.904948 9.566596
4.098602 0.852279 9.470834
4.127330 0.933677 9.576172
4.108178 0.871432 9.571384
4.117754 0.919312 9.456470
5.846253 -2.700480 8.953721
6.669804 -5.851041 15.537339```
๐
scan pushed. it was a one liner.
>>> import board
>>> i2c = board.I2C()
>>> i2c.scan()
[38]
@void trench Which UARTServer example are you using?
@tidal kiln i2c seems a touch slow
@void trench should be from adafruit_ble.uart_server import UARTServer
i think it's all the overhead with the ft232h
see the examples in the pre-release: https://github.com/adafruit/Adafruit_CircuitPython_BLE/tree/2.0.1-alpha.2/examples. But if there's an error, let me know or file an issue; thanks!
@tidal kiln the ft232h is pretty fast. i do notice each byte is sent one at a time
like there's pretty big delays
dunno if you have control over that
e.g. can you send i2c buffer all at once
let me at least get scan checked and then we can merge
the call at least passes the whole buffer:
https://github.com/caternuson/Adafruit_Blinka/blob/36a01e28d2d265cdb1e96158b84c1cf35faf7d20/src/adafruit_blinka/microcontroller/ft232h/i2c.py#L18
k i believe ya
how about SPI - what did you test with?
C:\Users\ladyada\Dropbox (Personal)\micropython\ft232h>python scany.py
I2C addresses found: ['0x26', '0x3d']
@tidal kiln can you make one more req.txt change
sysv_ipc; sys_platform == 'linux'
otherwise it wouldnt install on win
ok mergin'
keen
@tidal kiln ok guide next week?
i can do the windows part
you can do mac/linux
since its basically same other than the brew command
@tulip sleet ^ you may want to try this out
yep. might need to bug sid for mac stuff. but otherwise can get the guide started.
ok did the release
i think only thing he had to do was brew install libusb you can use the screenshots
i2c being slow is a litle sad but we just have to tell people - hey this is good for sensors, not high speed oled updates
it def works, just is sluggish
@meager fog ok, I see, didn't realize what you were working on. Will take a look and I'll order one.
i think i saw a blurb about that in one the app notes? maybe? but if it's something that can be improved, we can PR it when we figure it out.
@danh, Got it. I see the mpy file is now uart_server.mpy instead of uart.mpy. I had been running the example from the bundle. oopsy. Note, however, that I was also referring to the Usage Example on the github.com/adafruit/Adafruit_CircuitPython_BLE README page, which is incorrect, as it has "from adafruit_ble.uart import UARTServer" as the first line of the code. Different from what's in the example in the download...
@void trench Thanks! I will fix the README; I missed that in the doc updates.
@danh: Thanks! Glad to give you more work! ๐
@tidal kiln spi on the other hand, is veyr fast
i can draw to a TFT at 30mhz and its nearly contiguous data
Could the SD Breakout + tutorial be updated to reflect wiring to Raspi to include schematic and appropriate code for CircuitPython for SPI and I2C
Correct the directory creation from #293.
Travis reference: https://travis-ci.com/adafruit/circuitpython-org/jobs/237604885#L242
@ladyada can you reevaluate this to see if #2080 fixes it? The mixing is now halved per sample to avoid "ring modulation", in addition to the previous hard clipping.
๐ @true surge. Welcome!
@tidal kiln fyi gpio blinky is ~500Hz and not stable, so can't be used to bitbang various protocols
hiya you shouldnt be using an SD card breakout for raspberry pi, use a USB to SD card adapter instead. where is this guide? we'll add a note
there is a "bitbang" mode for the ft232h - but didn't really dig in to that too much
but guessing that'd be what you'd want to use to bitbang random protos?
@tidal kiln yeah im ok with it, just need to document
jus' lettin you know i did some scope measurements ๐
cool. thanks.
like you wouldnt be able to use this with servo, DHT, HC-04
er, sonar
its really for basic LED on/off and buttons
yep. for the first iteration, wasn't thinking much beyond LED/button stuff.
can look into that and also i2c/spi speed
i was gonna briefly look at SPI cause with th eold technique it is possible to send 16KB in one chunk
that would let you do neopixels
there's a mystery parameter
yah. there are a few of those sprinkled in that module.
we could compare the speed without previous library
to see if it really is slower - if it isnt then we're fine as is ๐
compare pyftdi to ftdi1?
ok, i can check that out. and just any way to improve it beyond current. etc.
sry - gotta run now ๐ฆ
put any good info in basecamp and i'll check it out
It's in the LEARN link for the breakout if one is to purchase it if I recall. Not near my computer. I opted for this to log weather sensor data on loss of internet connectivity and/or utility power. Im already using PowerBoost1000c and INA219 as UPS setup. Will take a look at what you are suggesting.
Wayne Wells
On Sat, Sep 21, 2019 at 12:44 PM -0400, "ladyada" notifications@github.com wrote:
hiya you shouldnt be using an SD card breakout for raspberry pi, use a USB t...
when you are at your computer please give us the exact link you're referring to
thanx!
@tidal kiln will do!
Hi! I'm trying to get the TFT Gizmo working with a CPX. Dan pointed me to this guide yesterday:
... I was entering the code there line by line in the REPL. I get an error on the line like this:
oops. I mean this:
display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D9)
on that line I'm getting: ValueError: A1 in use
... maybe the values for tft_cs and tft_dc need to be different on CPX?
Here it is. Not so much that it says you can use with a Pi, as much as it doesnโt say you cant. As a newbie I saw the CircuitPython comments and assumed it would work,
http://learn.adafruit.com/adafruit-micro-sd-breakout-board-card-tutorial
From: ladyada notifications@github.com
Sent: Saturday, September 21, 2019 1:02 PM
To: adafruit/circuitpython circuitpython@noreply.github.com
Cc: ankonaskiff17 ankonaskiff17@twc.com; Author author@noreply.github.com
Subject: Re: [adafruit/...
Also, do you have a part number for item you say should use? Canโt find and needs to be wired in to a proto board.
From: ladyada notifications@github.com
Sent: Saturday, September 21, 2019 12:44 PM
To: adafruit/circuitpython circuitpython@noreply.github.com
Cc: ankonaskiff17 ankonaskiff17@twc.com; Author author@noreply.github.com
Subject: Re: [adafruit/circuitpython] SD Card Breakout + for Raspberry Pi (#2174)
hiya you shouldnt be using an SD card breakout for raspberry pi, ...
Think I overthought that deal. Just put a usb flash drive in open usb port should cover it??
From: ladyada notifications@github.com
Sent: Saturday, September 21, 2019 1:02 PM
To: adafruit/circuitpython circuitpython@noreply.github.com
Cc: ankonaskiff17 ankonaskiff17@twc.com; Author author@noreply.github.com
Subject: Re: [adafruit/circuitpython] SD Card Breakout + for Raspberry Pi (#2174)
when you are at your computer please give us the exact link you're referr...
@strange cargo One or both of those pins are probably different. Looks like on the Gizmo, they're in the lower right on the TFT side: https://www.adafruit.com/product/4367 which looks to align with A6/RX and A7/TX on the CPX side?
Extend and expand your Circuit Playground projects with a bolt on TFT Gizmo that lets you add a lovely color display in a sturdy and reliable fashion. This PCB looks just like a round TFT ...
@crimson ferry, thanks! that makes sense. CS on the Gizmo is connected to A6 on CPX and DC is connected to A7.... I tried that and I got another error, but I think it's because of the reset parameter.
the line from the guide is: display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D9)
and with that I was getting "ValueError: A2 in use" but it looks like D9=A2 on CPX.
I tried just taking that parameter out, and the call completes without errors, but when I do the next line I still don't see anything on the screen (was expecting to see the REPL).
I am trying to measure a 1 second pulse. I created a script that outputs a PWM on Pin 13 with 500 pulse width. I have it jumpered to pin 8 on a Metro Express M4. I'm not sure I understand max length and the value in pulses[1]. Is the Value in Millisecond? Many of the values are 65535 (Rollover). Can I get assistance on how this works. Thanks in advance.
import time
import board
import pulseio
from digitalio import DigitalInOut, Direction, Pull
led13 = pulseio.PWMOut(board.D13, frequency=1, duty_cycle=500)
pulses = pulseio.PulseIn(board.D8, maxlen=2000, idle_state=False)
while True:
time.sleep(2)
print(len(pulses))
print(pulses[0])
# Clear the rest
pulses.clear()
@strange cargo You'd probably only very briefly see the REPL, if at all, the display.show(splash) line would almost immediately kick the display into displayio and the later appends should then start showing up. Are you doing this line-by-line in the REPL, or as code.py loaded on the CPX? I don't have a CPX or one of those displays, maybe someone else can take a look over on #help-with-circuitpython if you continue to have trouble. Gizmo TFT is so new there's not a Learn guide yet, and I'm not sure if there are any special tricks for it.
@crimson ferry, yes I was typing the example line by line in the REPL. one thing I have learned for sure is that it doesn't work to use nylon screws to connect the gizmo to the CPX. since I switched from nylon screws to the (provided) metal ones, I have started to see signs of life: the TFT backlight turns on when I do the line display_bus = displayio.FourWire(...)
but I still don't see REPL. I continued through the part of example that draws a green background, but didn't see that either. I think you are right, I should wait for the learn guide. but it's been fun playing around with...
@slender iron what do you use to dump all memory in gdb?
ill defer to @jepler to try this out since he'll have the setup for it - a clipped sine wave should not cause static, just sound clipped :)
@danh, I've been able to get the eddystone beacon example to work (sort of) on the Circuit Playground Express Bluefruit, and also the following iBeacon:
from adafruit_ble.beacon import LocationBeacon
import _bleio
ย
company_id = 0x004c
my_uuid = _bleio.UUID('8ce075a8-4fc7-11e8-9c2d-fa7ae01bbebc')
major = 23137
minor = 1
rssi = -60
beacon = LocationBeacon(company_id, my_uuid, major, minor, rssi)
beacon.start(0.5)
ย
However, both beacons seem to be "once and done". When I reset the CPXB, I receive the beacon advertisement packet only once, regardless off any interval parameter I put on the beacon.start() method call.
I have also been able to interactively do the UARTServer example from the youtube video with the ras pi and nrf52840 express feather, using the REPL on the CPXB. I will try all this on the feather, but I expect the same results...
Is there a way to add extra "default uart" or i2c devices into CircuitPython firmware so that you could have the following situation:
import board
uart = board.UART()
uart1 = board.UART1()
Thank you. With the proliferation of microprocessors and single board computers it can be quite a challenge to sort out what does and doesnโt work with each other.
From: ladyada notifications@github.com
Sent: Saturday, September 21, 2019 8:40 PM
To: adafruit/circuitpython circuitpython@noreply.github.com
Cc: ankonaskiff17 ankonaskiff17@twc.com; Author author@noreply.github.com
Subject: Re: [adafruit/circuitpython] SD Card Breakout + for Raspberry Pi (#2174)
we added a page h...
Is there a way for me to enable CircuitPython syntax check in other editors than Mu or can only you (Adafruit) do that? Like telling it where to look for parseable built-in libraries, or some sort of python/cpython to circuitpython grammar diff? For instance, could I drop these https://github.com/adafruit/Adafruit_Blinka/tree/master/src into a folder and point to it, would that work? Specifically I'm looking for ways to make Visual Studio Code more useful.
@timber mango I think that people have made stubs โ python files with empty functions in them โ to get that to work for them
@exotic pumice iirc the gdb dump command
@timber mango we have a make stubs command in circuitpython that will create stubs for the C modules. it doesn't include comments yet though
once it does we can package it on pypi and then for an editor, you would need to install it
@craggy galleon The extra name is easy. You'd also need to plumb together a second set of init code and macros to define the pins. definitely doable
@karmic rune wow, I'm surprised our docs don't have a unit on pulse length! Looks like it is in microseconds: https://github.com/adafruit/circuitpython/blob/master/ports/atmel-samd/common-hal/pulseio/PulseIn.c#L84 How accurate are you trying measure your pulse?
@karmic rune would you mind making a PR so update our docs? They are in https://github.com/adafruit/circuitpython/blob/master/shared-bindings/pulseio/PulseIn.c#L48
Accuracy not that big of an issue. It is an electric meter for solar. It is more of question can pulsein do long pulses (1-2 Second). I'll be happy to do PR and even supply some documentation and/or examples if the will help.
Im unsure if Circuit python is the right tool for this . I may want to use a Trinket as a coprocessor using Arduino and interrupts. & Air lift M4 for Web-server.
for 1-2 second long pulses you could probably poll the pin just fine
pulsein is 16-bit so after 65,536us it will overflow
My current Raspberry PI has been using polling successfully for many years. I'm trying to tech refresh to more a embedded solution. I'll try to come up with a loop that gives polling adequate polling time. If not I'll try a trinket polling and send data on request from M4 Airlift. (Why write Software when you can throw Hardware at it ๐ )
ya, I'd just poll it too. PulseIn was designed for infrared pulses and DHT. One we basically can't measure with polling
@slender iron Thanks. I look fwd to vscode support, but obviously it's not essential. Rrrrrrreally looking fwd to stm32f407vg support ๐
ya, I'll likely do some work on the stubs shortly because Glider will likely use them. I think 407 support is on @ionic elk 's short list
Cheers!
@slender iron Thanks for the link to the source. Source show unit is in microsecond. And as @meager fog pointed out it is a INT that would rollover at 65535.
@timber mango '407 initial support will be rolling out starting in a week or two
@meager fog ๐
If I get some reasonable quality example code how to I submit it for inclusion with your examples and/or the learning portal? This may motivate me to do a good job on it.
posting it on the forum is usually the first step. lotsa folks will see it there
Cool. Thanks for your help.
@tough flax I have the XAC_COMPATIBLE_GAMEPAD working on Windows, but not Linux or XAC. I put in some try-``exceptcatches and it is fialing on thegp.reset_all()`. This is true even if I make the gamepad the sole HID device and HID the sole USB device.
There is some work going on in TinyUSB to fix some USB and USB/HID issues, but I'm not sure it's related to this or not. Inquiring about that.
@tulip sleet are you using just one joystick and 8 buttons?
yes, exact same HID descriptor as the pdp
you got it to work in CPy 3.x, if I remember right, before the switchover to tinyusb?
It was 4.x I think. I sent you a uf2
it's based on your fork, right? I can rebuild that
My fork didnโt work because of the build instructions
Load the uf2 and check the version
still looking for the .uf2 in DM's, but this is interesting from our DM's:
ATMakersBill04/20/2019
Yeah, I got both working as joysticks/gamepads on Windows 10
3.x and 4.x
No complaints and it "just worked"
plugged into the XAC and no joy
Finally dumbed it down to a single HID descriptor
with exactly the specs of their joystick
and it worked on 3.x
that is why I'm suspicious of tinyusb here
thanks!, I will wait to hear from Thach
๐
hey @plucky flint, are you doing pyweek?
@stuck elbow yup, but not quite yet. Today is for improving circup with .mpy support.
You?
I think I will have to skip this time again
Perhaps next time... ๐
yeah, there is always going to be a next time
How often are people dealing with BGA parts when it comes to STM32 development boards? I don't think I've ever actually seen one in person. Trying to determine how high priority it is to add a more complete package management system that accounts for really high pin count MCUs like that.
@plucky flint I have some ideas for enhancements to circp. What's the best way to coordinate those before I start working on them, so I don't end up accidentally duplicating effort?
@idle owl @tulip sleet would it be worth adding a note to this guide https://learn.adafruit.com/adafruit-circuit-playground-bluefruit/circuitpython indicating that you have to use the alpha version of the Adafruit_CircuitPython_BLE library https://github.com/adafruit/Adafruit_CircuitPython_BLE/releases. and not the older version in the Bundle. Issues with this came up several times last week in the forums and on discord.
@minor plume suggest issues at the GitHub repository..? See: https://github.com/ntoll/circup/ Don't hesitate to suggest things..! ๐
(sorry, had my head in code)
circup now works with mpy modules... but I've broken a bunch of unit tests... ๐ Need to fix /update those.
@craggy galleon did you figure out a final resolution on your 5v analog in saturation question? which board? i have a similar/related issue on pyportal, reading divided battery voltage onto analog in on D3 or D4 connector; in my case Vref seems to change if the PyPortal is powered over USB vs by pushing power into the D3 / D4 connector from a PowerBoost1000 (as recommended by the Portable PyPortal guide). note that the "Vcc" line at D3 / D4 sits at 3.3 v when powered by USB, but gets 5v when powered by PowerBoost. the a/d reads differently in the 2 situations.
@minor plume open an issue on github is best!
@ionic elk hihi i think its inevitable people will use high pin count chips. good news is those chips will also have a ton of flash/ram
the pin system ya got should be flexible to 'near infinite' pins - what would be keeping us from having a 100-pin table?
@solar whale @idle owl thanks, Jerry, I added info about the pre-releases to another green info box.
@tulip sleet @solar whale maybe it's also worth it to provide pre-release libraries in the bundle? https://github.com/adafruit/circuitpython-build-tools/issues/49
This PR adds the pin and peripheral definitions, linker file, and compilation changes to support the STM32F405.
On my pyboard V1.1, the program currently derails in memory at startup to the CCRAM region and does not reach main. I'd appreciate help locating this issue or replicating it on other F405 devices, particularly if this sounds like a bootloader-related issue to someone more familiar with micropython (I've erased the chip, so this shouldn't be it, right?). I've noticed there is a l...
I'm OK either way -- the main issue is how to deal with breaking API's -- In the case oF BLE, I'm not sure it matters too much since the 5.x support add so much, folks will just have to move to it anyway.
Sorry, this was supposed to be a draft but I misclicked, and github doesn't support moving back to draft status. Hopefully we can get over the issue quickly. @tannewt if you want me to recreate this as a draft just let me know.
No problem with it being not a draft. Just ping me when you want a review.
lurking today
lurking today also
Lurking as I catch up on all I missed while gone
lurking today (while opening my latest Adafruit shipment)
Lurking this week
lurking
I missed the link to the doc
hmmm.... not hearing anything. ๐ Refreshing. ๐
I had to restart the app too
hug report in advance for @plucky flint ! check this out folks if you have not! https://learn.adafruit.com/keep-your-circuitpython-libraries-on-devices-up-to-date-with-circup?view=all
๐ค
Program CircuitPython devices with iPhone & iOS 13
https://blog.adafruit.com/2019/09/19/program-circuitpython-devices-with-iphone-ios-13/
If anyone tries this out and finds issues, let us know.
CircuitPython snakes its way to FT232H, we now we have CircuitPython Blinka support, so you can control sensors, oleds, buttons, LEDs and more all via FT232H! All thanks to Carter who fearlessly took on this code support โ weโll start writing up a guide in the next week or two
https://youtu.be/rriKd9jkdJQ
The FT232H is a handy USB to gpio/i2c/spi breakout board we've stocked for a long time. It is used by lots of folks as a hardware interfacing bridge. For a l...
CircuitPython slithers its way to Halloween! HackSpace issue 23!
- Send data with If This Then That โ Control almost anything with CircuitPython
- Motorized wing, making your cosplay move
https://hackspace.raspberrypi.org/issues/23
https://magazines-static.raspberrypi.org/issues/full_pdfs/000/000/134/original/HackSpaceMagazine23.pdf?1568741893
anybody have a link for the doc?
CircuitPython and Mu book! Shirts, books and more!
https://techbookfest.org/event/tbf07/circle/5645284751179776
thanks!
Introduction to CircuitPython class in Canton, CT
https://www.nextgensmartypants.com/product/circuit-python-shop/
Lurking for now
Coming up...
CircuitPython in space video with Max Holiday!
https://www.notion.so/PyCubed-4cbfac7e9b684852a2ab2193bd485c4d
@tannewt you can probably go ahead and check things out now, most of it is just pin additions and there are no compilation issues - maybe you can spot what's plopping me in CCRAM
@slender iron I got you on notes
thanks!
@slender iron are you still getting timecodes?
I can. I am still recording. Not sure if kattni is now too
Thank you to the whole CircuitPython community while I was out
@slender iron I'm not, I'm unconvinced it won't fail again. There appears to vid from the beginning, but I'm not sure if it was successful.
kk
Un-lurking
@pearl notch 's CircuitPython Community Members Directory:
https://docs.google.com/spreadsheets/d/1NWwiUuQnam_abdv02ugLxz9uFrvhtMfy8U306HJ4_qU/edit
The FT323H was really all @tidal kiln, @pastel panther, and @meager fog.
@gilded cradle you pretty much are Blinka now so.... ๐
Sound has gone. ๐ฆ
link to your blog would be awesome
Sorry @slender iron didn't catch what you said. Sound broke.
@pastel panther absolutely ๐
Folks, I'm going to have to step away (I have another meeting in 5mins). Great to hear all your progress and keep up the good work. ๐
ciao ciao
has anyone else lost audio?
you can with the gamepad library
but you can only do anything with it once the control returns to your program
we can read it out
reloading discord seems to have fixed it, nvm
kk
๐ฒ ๐ฒ ๐ฒ IN THE WEEEEEEDS ๐ฒ ๐ฒ ๐ฒ
asm("bkpt");
start_tone is working great!
Bye
Thanks Kattni & Scott
Thanks!
@slender iron the plot thickens - you remember how STM32 has that one 64KB sector of memory between the 16 and 128K ones? Well, micropython uses the CCRAM as a buffer for it.
ya, weird. I'd use CCRAM for the heap
Have a great week, all! Have to go for awhile ๐
@slender iron what was the url for the editor app? I didnโt quite catch it during the meeting
Iโm getting interesting differences in computing intervals between using time.monotonic() and time.sleep(). Known issue? Perhaps Iโll code an example to reproduce the problem.
@pearl notch Yes, there are cases where it seems to miss the timekeeping interrupts. There are some issues on this. We need to rework the time-keeping and clocks
Switching from time.time() to time.monotonic() allowed my code to work, but only with time.monotonic() + 0.25, and not with โฆ + 0.2.
I know 0.2 is a special number in FP
0.25 can be represented exactly, 0.2 cannot
Is that a factor in the known issues?
@slender iron https://www.quora.com/What-is-circuitpython
CircuitPython is a full Python compiler and runtime that runs on the microcontroller hardware. The user is presented with an interactive prompt (the REPL) to execute supported commands immediately. Included are a selection of core Python libraries...
@slender iron Let me know when you have a video URL, thanks
No worries. I have everything else queued up.
ugh, export failed
@meager fog do you have any other F405 boards on hand besides the pyboard? I'd love a second test/opinion on these port problems I'm having.
@ionic elk I can help
I have f4 discovery
@idle owl my chunk of video and time codes starts at 8:53
uploading to youtube now
Thanks so much
