#circuitpython-dev
1 messages ยท Page 266 of 1
@meager fog sure thing. Are you still getting that I2C display error? rigging that up now
@ionic elk yah i have moved on to test other sensors
oh darn it I don't have an I2C one, just the SPI version. And the little one doesn't have the I2C jumpers
@ionic elk ok plz get....
A Feather board without ambition is a Feather board without FeatherWings! This is theย NeoPixel FeatherWing, aย 4x8 RGB LED Add-on For All Feather Boards!ย Using ourย Feather ...
yeah thats a good range
one of each, then you can test i2c/spi very well
You want me to stick to 1 or 2? With 2 I can have a parallel control with a SAMD. But either is fine
I'll stick to 1 that's a lot of boards
Is anyone else playing with the Serpente CircuitPython boards?
@timber mango got an inquiry?
Mine don't seem to be functioning like other CP boards I've used in the past. The serial port isn't responding, and the reset button doesn't respond either, but they show up as drives OK in Windows 10
how are you trying to connect via serial? Mu? Terminal?
serial, the port shows up, but nothing comes across
Putty with 9600 baud to be specific
I haven't actually tried Putty for Cp stuff.. imma try
Wait
What's it called when you try several times before asking for help, then it starts working?
Serial is responding ๐
haha walkiing the duck? or something
Next time, try Ctrl+D or C ... maybe it was running some code? with no output
It's my sample code so it's likely all me ๐
@meager fog you know what? I bet it's a timeout error
All hal functions have timeouts. If it takes a super duper long time, maybe it exceeded my timeout value
I'm going to throw in a cheap cheaty fix for it, could you try the I2C one again and let me know if it works?
Also, I'm sorry to ask this but could you throw in another feather in the RMA if you have one? I didn't have those stacking headers for the existing one, and I won't be able to plug in any of those nice wings ๐
Yep I just put one in, can you pop the F405 in there?
its an assembled f405 feather
you and PT are forwarded
gr8
Commit with my I2C fix is also live in branch
Let me know if it fixes the problem. Otherwise I'll probably revert it to avoid breaking anything else accidentally
ok one moment
im testing airlift which is intense
ok there's also some max-buffer issue in SPI
code.py output:
ESP32 SPI webclient test
ESP32 found and in idle mode
Firmware vers. bytearray(b'1.2.2\x00')
MAC addr: ['0xa0', '0x7c', '0x12', '0x12', '0xcf', '0xa4']
Adafruit RSSI: -53
Adafruit RSSI: -58
embedded RSSI: -63
consulatewireless RSSI: -64
Consulate Guest RSSI: -64
Adafruit RSSI: -65
Consulate Guest RSSI: -66
consulatewireless RSSI: -67
consulatewireless RSSI: -72
Consulate Guest RSSI: -72
Connecting to AP...
Connected to Adafruit RSSI: -58
My IP address is 10.0.1.191
IP lookup adafruit.com: 104.20.38.240
Ping google.com: 10 ms
Fetching text from http://wifitest.adafruit.com/testwifi/index.html
----------------------------------------
This is a test of Adafruit WiFi!
If you can read this, its working :)
so that can't be it
but...
----------------------------------------
Fetching json from http://api.coindesk.com/v1/bpi/currentprice/USD.json
Traceback (most recent call last):
File "code.py", line 54, in <module>
File "/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/helpers/requests/adafruit_requests.py", line 270, in get
File "/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/helpers/requests/adafruit_requests.py", line 236, in request
File "/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/helpers/requests/adafruit_requests.py", line 220, in request
File "/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/drivers/esp32spi/adafruit_esp32spi/adafruit_esp32spi_socket.py", line 106, in readline
File "/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/drivers/esp32spi/adafruit_esp32spi/adafruit_esp32spi.py", line 679, in socket_read
File "/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/drivers/esp32spi/adafruit_esp32spi/adafruit_esp32spi.py", line 315, in _send_command_get_response
File "/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/drivers/esp32spi/adafruit_esp32spi/adafruit_esp32spi.py", line 304, in _wait_response_cmd
File "/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/drivers/esp32spi/adafruit_esp32spi/adafruit_esp32spi.py", line 302, in _wait_response_cmd
File "/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/drivers/esp32spi/adafruit_esp32spi/adafruit_esp32spi.py", line 254, in _read_bytes
OSError: [Errno 5] Input/output error```
so like, when we fetch a big-ass file, it fails ๐
we need to split up the SPI transactions, so when we request like, 1024 bytes
it will chunk em into smaller bits
still, very impressive it got that far ๐
Is that something the other ports can do?
i dont know for sure but i assume so
there's usually a limit to how much a HAL can transfer in i2c/spi
for example the ft232h can only do max 16KB
that's a question scott/dan can help with more
I'm not using DMA for my current implementation
its possible it could do more with that
that makes it easier
try transmitting/receiving larger and larger buffers
until you hit the ioerror
I'll make a project out ofit
ok for now im ok with merging what we got
and make an issue to investigate - you can test the i2c buffer stuff with the OLED, and the spi buffer stuff you'll hit with the airlift
I'll make it a new issue
nice!
yeah that
featherwings make it easy to test, at least. pop em on
It's my first time using them, definitely looking forward to the handyness
Still want to make an Omnitester with Circuitpython with my crosspoint switch, but it's a bit slow going
once travis is running ok we can approve & merge!
A board that'd let me plug any breakout in and test it
intense!
ok i gotta get ready for shows
much success, we can now really test those peripherals
good work today!
Thanks! Did you get a chance to run that last I2C test before you head out?
oooh is travis no good
it only generates files on success
I don't know what it's deal is it's griping about a file I made no changes to ๐
Anyway we can put it off to tomorrow or whenever I know show and tell is coming up
i think when you added the new SPI chip
maybe some entry is missing from the table
so its included but then causes some parsing error
yep just fixed it
@ionic elk ok we can check later
AWS administration is way more involved than i imagined... ๐ฌ
@raven canopy depends what you're doing, but... ya...it is. "cloud" is not the magic panacea of simplicity that people claim it is.
hehe. i just wanted an S3 bucket to test deployments on, instead of just "pushing to prod".
though i will say, Azure isn't that much easier in the little experience i have there too.
StringCar M0 Express: It's alive and running CircuitPython 5.0.0-alpha.4-127-g25232cc5b with just two PCB bodges. I'll submit it as a CircuitPython board after the revised PCB is tested.
(A scrap from the Blinka sticker was used to diffuse the 5050 DotStar.)
That's a nice tip @errant grail !
@ionic elk the SSD1306 / I2C issue is now fixed, good debugigng!
this passes test in that SPI flash works very well, also a bug in I2C was fixed
@tannewt please review for style at your convenience
@ionic elk i dont see issues you've made for the bugs we've found today
please put in bug/issues asap when we find them because otherwise they can be forgotten
I will first thing tomorrow, sorry! I have them all down on various post-its, I'll make sure they all go up
As a follow-up, I realized that the tutorial I was following was for storing information to the SAMD51 memory and not the the flash chip.
Digression:
However, I tried to erase and re-flash the original firmware for the SAMD51 (itself) and the same issue still persisted. I can see the board as a mass storage device and upload Arduino code to it. However, after I upload ...
We need to be able to choose which files to freeze and which to skip for a given frozen module. First use case: A bluefruit.py will be added to the CPX library, but there's no reason to freeze it on the CPX, since that board doesn't have BLE capability.
Originally I thought we might notate in a particular file whether it should be frozen or not for a particular board. However, it's probably easier to include some value in mpconfiboard.mk that specifies which files to skip (or include) ...
@tannewt
- Good catch... I guess my brain is still on vacation. I probably should update the quad SPI setting for the flash chip to
.supports_qspi = true, \as well. - I'll try lowering the speed; however, I thought these settings were specific for the chip and that was going to be limited by the baud rate setting in the mpconfigboard header file anyways.
- Thanks, that ...
@ladyada
- Thanks... I'll double check it with @tannewt's suggestions.
- @edspark helped walk me through your process, but didn't really have an answer for those specific questions.
- Is this Arduino example the only way to test the flash chip through CircuitPython?
- I finally got the fatfs_circuitpython example to compile with our board (we don't use QSPI), but I am...
This fixes the S3 deployment, as it wasn't finding the generated web/libraries.json.
The ls web/* step in the artifact deployment was searching for adabot/web/* since Travis changes the directory to run adabot.
I have tested this on a personal repo: https://travis-ci.org/sommersoft/aws_s3_testing/jobs/592865104
Lastly, this was so simple, it deserves a ๐คฆโโ.
you're really close!
it looks like the flash memory wired as plain-SPI not QSPI, that's OK, you can use the SPI Flash setup like from the feather m0 express
https://github.com/adafruit/circuitpython/tree/master/ports/atmel-samd/boards/feather_m0_express
SPIFlash arduino library should work, if you have to have the SPI peripheral set up for use, which depends on your board definition. but if you pick the right SPI port and the right CS pin, then you should be able to read the JEDEC ID, at...
Two options available:
- relative numbering (USB_RELATIVE_EP_NUM = 1) - default
- absolute numbering (USB_RELATIVE_EP_NUM = 0) - new!
Strawman example:
# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground
FROZEN_MPY_DIRS_EXCLUDE += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground/adafruit_circuitplayground/bluefruit.py
...
Hi. Iโve got about 100 CPXbfs enroute and hope to start intro exercises with new-to-code uni students. Where is the best place to share issues with CircuitPython 5a4? Will an express lib be available? When I include from adafruit_circuitplayground.express import cpx I get an error โhome/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/drivers/circuitplayground/adafruit_circuitplayground/express.py", line 53, in <module>
ImportError: no module named 'audioio'โ. Was going to use Bluetooth so I have been assuming sticking with v5 makes sense, but advice is appreciated. Thx
@broken hedge I think the adafruit_circuitplayground.express library doesn't have support for the bluefruit boards yet
Shoot I forgot I reverted this! It was 500 when testing. Let me put it back, maybe that'll solve the SPI halt you were encountering.
For certain very large files or data transfers, SPI and I2C on the STM32 have been found to return an input/output error.
This may be related to the timeout value provided by the HAL. Might be fixed by #2186, which increases timeout values for both modules. If it persists past that, it's likely related to invisible HAL values and will require more investigation.
The MINIMAL_BUILD flag currently removes a number of modules by default that are not HAL dependent. These include OS, Struct, Storage, and potentially others. Modules that aren't dependent on a common-hal component should be sorted out and not excluded via MINIMAL_BUILD, which will be less confusing for new port builds and remove unnecessary restrictions on ongoing ports like the STM32.
STM32 dev boards don't currently work with commands like board.I2C(), which rely on default pin definitions. This should be added, particularly for feathers and boards with Arduino-style headers such as the F412.
For boards like the F411, which do not have SPI or QSPI flash available, the internal filesystem is currently very slow, since the flash library as written does not contain a cache and writes inefficiently. Additionally, boards with dedicated CCRAM like the F405 should use it to enable use of larger 64KB flash sectors for the filesystem, and even boards without it can make use of at least a 16KB chunk of larger sectors to free up more filesystem space.
The Microcontroller module currently has several empty functions, which for one reason or other are unusually complicated to implement via the STM32 HAL. These functions should either be completed properly or filled with more appropriate placeholders.
Current implementation of the STM32 has too much overlap of features that are related to a specific MCU package (such as pin definitions, available peripherals, etc) vs a specific development boards (Status LEDs, clock settings, debugging availability).
All features that are directly related to the board should be sorted to the board module, leaving only MCU-specific features in the peripherals directory. Additionally, a better package/pin sorting system should be implemented in the Micro...
@meager fog if you have a minute today, you could check out my commit to #2186 and see if it solves the SPI data cap issue
To be added:
- PYB LR Nano V2 [F411]
- F411 "Blackpill", generic [F411]
- Meowbit [F401]
@ionic elk will do!
i got the feather working with micropython last nite, was fun!
today will try arduino
@ionic elk solved!
----------------------------------------
{'time': {'updated': 'Oct 3, 2019 16:32:00 UTC', 'updatedISO': '2019-10-03T16:32:00+00:00', 'updateduk': 'Oct 3, 2019 at 17:32 BST'}, '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': 8177.78, 'rate': '8,177.7767'}}}
----------------------------------------
Done!```
is that the SPI block?
Yay!
ill try an eink next
Ok yeah so it sounds like it was just the timeout triggering on really big transfers
I took it up from like 2ms to 500 so that should cover everything... right?
No 1 second long single I2C transfers I should be worrying about?
500ms is plenty for now
lets see, if we have 100khz that would be...
10 kbps
5KB - yeah i think thats ok
is there a way to know if it was a timeout from the HAL
or a general failure?
tested with lots of things! works well
@ionic elk ok with that PR done, whats next?
Cleanup or UART/DAC?
I put up a bunch of issues this morning
Some higher priority than others
ok lets look!
alright dont forget to add an issue for the missing 'random' module
thats not os.random its different
Ohhh
Is random HAL dependent? Does it fall under #2191?
That's fine. Let me do that one right now, I think this is a pretty high priority/low effort issue
okidoke
For the others, anything in particular you'd like me to tackle right now, or should I just skip right to UART?
And do them after DAC?
@ionic elk nah skip em, go to UART
Sounds good, I'll get right to work then.
add an issue to remind yourself to add the default I2C/SPI/UART busses
so you can call board.I2C()
yeh it's up there
there's RX/TX uart pins
nah not necessary
might as well wait till uart is done
then do it after, so its easy to test completely
reasonable
uart will likely be a fairly straightforward peripheral
here's hoping, I said that about I2C, and then I ran into the eratta x_x
@meager fog should I wait on @slender iron to submit the SPI PR or do it now?
@tidal kiln ok when ya hav ea moment lets archive that max library
and then i hvae a QUEST
@ionic elk leave the PR as is - when he's available he'll review it. you can work on UART in a separate branch/PR
yay
@meager fog ok. gotta go deal with a water/house thing. want me to ping you later?
w0rd
its optional side quest but i think fun
@prime flower https://forums.adafruit.com/viewtopic.php?f=60&t=157080
@slender iron Thx, replying after lunch. I know the issue, libs arent up to date (new version of mmqt needs to match up with latest esp32spi)...shouldnt have broke though
@hierophect Note the change in 463415a. Now tinyusb distinguishes which STM32 USB device to support based on the origin (IP) of the USB device. In this case, synopsys.
@idle owl , @slender iron , @errant grail Hi again. I added some timings to the note playing code and discovered that, as I originally thoughtโthough as a result of a faulty reading of the codeโa new sample is generated for each pair of start_tone/stop_tone. Take a look: ```
def stop_tone(self):
โฎ
self._sample = None
Without regenerating, things are much faster.
Generate sample: 0.092773 Start (including generating): 0.0947266 Stop:0.0107422
Start: 0.000976563 Stop:0.0332031
Start: 0.000976563 Stop:0.0458984
Perhaps I should create an issue for this, where I can document everything in one place, and get advice.
Why don't we make a separate library instead? I don't like the possibility of having to explain that only part of a library is available.
i'll vote for separate library!
I don't understand why we'd ever be explaining that only part of the library is available - the things added to the bluefruit module will not work on the CPX anyway. None of the current example code will change. I wanted to keep it together because we designed this library to be expandable and I want to use it that way. The naming convention makes sense. I feel a separate library could prove to be confusing if/when someone tries to use this library on the CPB since it is named Adafruit_Circ...
is bluetooth.py hardware dependant? if its all within the nrf52 chip, there's no need to tack it onto the circuitplayground library, cause it would be usable with the feather/metro/etc?
Did you get this working? If not, we shouldn't add it.
Overall, it looks good. Just a couple minor things.
Use HAL_MAX_DELAY here to disable the timeout altogether. https://github.com/adafruit/stm32f4/blob/89a356f0b44883d55c45a5d22940777a44a2b881/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c#L990 The SPI slave has no way of slowing down the transaction so we don't need to worry about timing out.
return result == HAL_OK;
No need for the ternaries here and below because the equality comparison returns a bool already.
I worry that having a general mechanism to do it will lead to us using it for other libraries.
Do we have the bluefruit library sketched out yet? Do we know it won't fit in the CPX?
Great new on the XAC support changes! Thanks @tulip sleet and @slender iron!
It's for the F412. I don't expect issues but it isn't connected to an SPI line, so it can't use the regular module. I'll save it for later.
tested with lots of things! works well
@slender iron we need to have pulseio for stm before we can enable displayio rite?
I was thinking about a library kind of like the Crickit library, not necessarily Circuit-Playground dependent, so yes, it could be separate. But a CPB-dependent library could know about the accelerometer, etc. (but maybe it shouldn't).
This is probably not the place to discuss the library. I opened this issue on a mistaken assumption about a decision, so I think I'll close it for now.
all good - lets chat on monday!
@meager fog ya, for backlight I think
@pearl notch interesting! Ya, an issue would be good
Listen to the before and after
I'd call this USB_RENUMBER_ENDPOINTS and if it's 0 for off then make sure the descriptor generator errors out if an endpoint number it uses is not provided. (I mention this on the other PR too.)
Looks really good! I like how it can simplify SAMD21 MSC too. One naming suggestion and a couple of other suggestions on the other PR.
Thatโ s a simple, compatible change to stop_tone, adding a clear_sample keyword parameter:
def stop_tone(self, clear_sample=True):
if self._sample is not None and self._sample.playing:
self._sample.stop()
if clear_sample:
self._sample.deinit()
self._sample = None
But perhaps the sample never needs to be cleared. Iโll create an issue.
I'm thinking that if any of these values are set, then USB_RELATIVE_EP_NUM should be 0, since join_interfaces() is either going to renumber interfaces or it isn't. So I don't think you need a separate --relative_ep_num argument.
I think ideally the validation in the scripts would do the following: if any *_EP_NUM_* is set, then it should be the case that all used EP_NUM values should be set, and it should be an error if they're not. Since not all devices might be enabled, you do...
Note that if you format the filesystem with Arduino, it may not set the fslabel to CIRCUITPY like the formatter in CircuitPython will. It should still show up though I think.
One thing to try is from the REPL do:
import os
os.listdir()
That will tell you if CircuitPython sees the flash but the USB isn't happy.
You can also try formatting the flash from CircuitPython with these instructions: https://learn.adafruit.com/welcome-to-circuitpython/troubleshooting#easiest-way-use-...
I want it to be a Bluefruit library like the CPX lib but for CPB where it makes getting started with CPB super simple in the exact same way CPX lib does for CPX. I want that experience for the CPB. It's only sketched out in my head so far.
Thanks! Looks good on my end.
ok! i think we're all in agreement - we'll work together to figure out what the library will be!
I thought about that too but it is actually useful to provide the relative ep number before join_interfaces renumbers every because it preserves the relationship. That's why the special case for SAMD21 can be removed.
I agree that without renumbering we should validate that all endpoints used were provided.
The following modules have no unique HAL component capable of disrupting the build process of a very early stage port.
- math
- random
- storage
- struct
- supervisor
- time
- usb HID
- usb MIDI
Thus, there is never any reason to not include them, even when the MINIMAL_BUILD flag is set. This PR adds an ALWAYS_BUILD flag, which is set unless instructed otherwise, to identify these modules.
5a2f820 Implement SPI flash settings, bugfix for SPI pi... - hierophect
9aa6d21 Add some definitions for when F412 can be imple... - hierophect
86305bf Make all errors value errors - hierophect
5a61948 Timeout fix for I2C device testing - hierophect
8a4bbae Fix typo causing parsing error - hierophect
@ionic elk ๐ ok how is UART looking
I've gotten my control setup done, and then took a quick diversion to get that random PR up
Moving on to reading the HAL docs now
@ionic elk kool thanx
@meager fog ping. ok. im back.
@tidal kiln hihi ok i archived the max31855 repo so thats done
quest is - make a subclass or new class of https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel/blob/master/neopixel.py that uses an SPI port to send neopixel data, instead of neopixel_write
so if you have, say, an FT232H, you can control neopixels with it
side quest accepted
first thing you have to verify is that bytes are sent in perfect sequence
start with making a simple SPI writing test that writes 3 bytes, look at the clock pin, it should be a contiguous square wave
for the neopixel timing requirements
@tidal kiln yes
@meager fog ok. added a basecamp. so can add progress updates there, etc.
@tidal kiln nice!
and thanks for doing the housekeeping on the old MAX repo
@tidal kiln yep! next is LSM303
but ya can take a break to do this more-fun-hacking quest ๐
@tidal kiln do you have an LSM303 sensor? if not plz order
yep. have a PID1120.
I havenโt yet clearly explained what Iโve done, but perhaps some of @slender iron , @idle owl , @tulip sleet , and @errant grail will take an early look. https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground/pull/71
@meager fog should I be using ST's UART or USART drivers for the module? They're distinct on the F4. USART is a superset with the synchronous option but is higher power than the UART.
@ionic elk higher power is ok
New GitHub review feature. ๐ GitHub!
Hopefully multi-line suggestions is soon to follow ๐
To reproduce in Chrome, adjust your language config:

I originally had them be D prefixes (but P could work), but it just looked wrong. I'm happy to make that change though, as it simplifies the code.
it's odd to click in here and see recent activity be mine...
@sly falcon I'll be afk again this w/e, but Discord mention will get my attention ๐
@crimson ferry sounds good. I didn't have time this week to do more than read some code...I'm planning on actually doing some coding this weekend ๐ค hope you have a good weekend!
@sly falcon Thanks. You too. I'll be around more after this one for awhile.
Back on the CPX audio fun: A square wave requires just two points per sample (vs. 100 currently used for the sine wave), and itโs much louder. @idle owl, did you consider other waveforms than sine?
@pearl notch doesnt sound as nice ๐
actually I like square wave sound more, it's more like computer games
I have added validation which checks if the addresses of used endpoints are different from 0.
Thank you for your feedback! I have added changes according to your suggestions.
.Trashes, created when a filesystem is initialized, should be a directory, not a file. See https://github.com/hathach/tinyusb/issues/182#issuecomment-538320398.
OK, further research. We deliberately made .Trashes a file, not a directory, because for MacOS, that prevents a "trash can" from being created on the filesystem with deleted files. It works to do that on MacOS, but apparently iOS is not acting properly. So we could report this to Apple.
General mobile menu clean up as well.
Sorry, I know this is quite old now, but do you have an example link you can provide?
Hi @meager fog. Are you speaking generally, about the sound of square waves vs. sine waves, or after hearing the sound from this program running on a CPX? I can see the sine and square waves on ground and A0 on the oscilloscope (thanks @errant grail , for that suggestion), but when I record the sound coming from the speaker and look at that wav file in Audacity, the waveforms look very different. I assume itโs because of resonance or something.
@pearl notch In my experience, square waves are harmonically rich and can pierce through the spectral bandwidth limitations of some speakers. Depending on the output device, the fundamental musical tone of a square wave can occasionally be obscured, depending on frequency. A triangle or sawtooth waveform may be a way to compromise, preserving more of the root tone (that a sine wave naturally produces) while maintaining enough harmonic content to help with listenability.
Interesting, @errant grail , thanks!
@tulip sleet I realized that scan() should return an iterator in the shower this morning
that way you can read results as they come in
@ionic elk hihi lemme know if yr workin today and how UART is going
@meager fog workin, punchin in pin defines and excessive macro ifdefs
@ionic elk okidoke!
let me know when you want me to test a PR and ill toss it onto my feather
@slender iron I'm getting weird non-ascii stuff in my terminal instead of my messages. It didn't happen with the atmel feather. Do you have any ideas what that could be? Stuff like "hัช(Ajm&--hัช(Ajm"
is that over usb or uart?
UART
with uart it's likely a baudrate mismatch
that's what I thought but everything is lined up
I tried moving it to ASCII, but I just get different garbage
what is producing the uart data?
It's the HAL_UART_Transmit() function, which transmits an array of uint8_t, running on the F405
It produces the same characters if I pass in a b"string" in my python code, or if I declare a const char array "string" in c right before the transmit function and pass that instead. So at least it's consistent.
and then you read it back in on rx?
I'm reading it with an ft232. But that's a good idea, I should try a linked transfer and see what that looks like
oh, hmmm. We don't have a uart transfer function
maybe the transmit is the incorrect baudrate
a logic analyzer can usually guess the baudrate
Yeah I can try that next
I notice the UART management is very different from the I2C and SPI systems across both ports. NRF uses interrupts, and atmel also seems to have an unusual buffering system.
Whereas ST just handles it the exact same way as the other two. So I'm struggling a little bit to make it fit, because there's no way of knowing in ST land how many characters you received, for instance.
I might have to go LL again for this one
that seems weird it doesn't tell you character count
what function are you using for it?
HAL_UART_Transmit()
just to get things up and running - there are IRQ and DMA options as well, as with all STM32 peripherals
Seems that micropython goes the raw register route, and just cycles waits on the TXEmpty and RXNotEmpty flags to read things one at a time.
Thanks for doing this! Just a couple questions and then it should be good to go.
Doesn't this rely on the OS stub at least?
How do these work if USB isn't available?
ah, and always reads the full length?
I thought these didn't interrupt compilation, but on double checking it seems I messed up my macro test and they do halt things. I'll remove them.
@ionic elk you can always read one byte at a time
That's true, I could have a blocking loop for it. That won't play nice with reading from itself, though I guess that's not a huge priority
write blocks anyway
So if I tried to write to myself, it would never complete, right? Because the write would be waiting on read? (I can read through the whole documentation of it again, just trying to get a sense)
I should just look at the HAL transmit_recieve function, see how that does it
I wouldn't worry about it. in practice you'll never do that
whether it works depends on the implementation and if it buffers the read
first time i've even looked at STM HAL: can you not access the UART_HandleTypeDef->RxXferSize/Count? https://github.com/adafruit/stm32f4/blob/master/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h#L141
We could think about adding a true default OS stub, though, since it's so simple
nope. nevermind. it just returns the status.
@tannewt I revised my test which was missing several module dependancies. USB HID and MIDI are out, but Storage and Random only rely on stub-level implementations of Microcontroller and OS (they use functions that use only CMSIS or don't suffer from being empty/returning 0). Should we consider these stubs a part of the "base build" of Circuitpython? Or should I exclude them?
Do you wait for the tx buffer to clear? Don't know how big it is, may e 1 byte? This definitely works on STM32F407:
Yeah checking the flags is no problem. I'll simply have to loop and increment how many bytes have been read.
If we are using the new CPX bluefruit with CP 5.0 Alpha 4.. can we use the libraries from https://circuitpython.org/libraries for CP 5? or do we still need to pull the Adafruit_CircuitPython_Ble from https://github.com/adafruit/Adafruit_Circuitpython_ble?
@swift arrow For the BLE lib right now, you want the pre-release which is only available at the link you included.
@slender iron I started pulling the thread on moving vfs from extmod, and it continues to unravel, because most of the file reading/writing code in various native modules is oofatfs-specific. Looks like I really should make all that code be filesystem-agnostic, so I'll start to do that. If you have any comments let me know.
OnDiskBitmap and AudioFile and main.c are using oofats calls, but probably should be using stream objects, to generalize the reads.
@gilded cradle we're were both ๐ like a hawk i'm sure. this is a good sign:
creating circup-0.0.3/circup.egg-info
copying files to circup-0.0.3...
copying CHANGES.rst -> circup-0.0.3
copying MANIFEST.in -> circup-0.0.3
copying README.rst -> circup-0.0.3
copying circup.py -> circup-0.0.3
copying setup.py -> circup-0.0.3
๐ค
It worked
๐
@idle owl I got it working. I am doing the Blog tie thing from John Gallaugher.. except only using the CPX bluefruit's Neopixels. It's very cool.. I have gotten it to lock up, so I'm curious if that happens to others.
Traceback (most recent call last):
File "code.py", line 241, in <module>
File "/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/helpers/bluefruitconnect/adafruit_bluefruit_connect/packet.py", line 128, in from_stream
File "/home/travis/build/adafruit/Adafruit_CircuitPython_Bundle/libraries/helpers/bluefruitconnect/adafruit_bluefruit_connect/packet.py", line 89, in from_bytes
ValueError: Bad checksum
That is from https://pastebin.com/KEfHiqW3 running on my CPX Bluefruit Alpha.. with CP5 Alpha 4 (from today) and a mix of the CP lib for 5.x and the adafruit_bluefruit_ble from github.
@swift arrow /home/travis/build/adafruit has me rather confused... leads me to believe that its due to how the bundle is being created. looking at the code though, nothing is jumping out at me that would cause a namespace to look like that. i'll dig more over the weekend (but i have no hardware to test with)
@raven canopy it's the adafruit_circuitpython_ble that we have to get from outside the regular lib bundle.
right. but it runs through the same bundler script as the "big bundle" when its released. all of which happens on TravisCI.
ah
I have not looked at the source.. but what if it did get a bad packet.. should it error out or just drop it and wait for the next?
since it is in a library.. there is nothing a user can do
it may have to do with the fact the library is labelled as a "pre-release", which is handled a little differently.
looking at the code, it does in fact raise the exception if the packet checksum fails: https://github.com/adafruit/Adafruit_CircuitPython_BluefruitConnect/blob/master/adafruit_bluefruit_connect/packet.py#L89
if a bad packet was to come in
on the user side, you could wrap it in a try and catch the ValueError.
hmmm.. maybe I will "try" and modify the test code I am using to use a try.. and see if that helps
try:
packet = Packet.from_stream(uart_server)
except ValueError:
continue # or pass or however you want to handle it
gotta run. ๐ฅ time...
thanks for the ideas!
so far so good.. just had to change one part of the code.
if this keeps working I'll let John know for his guide that is on the Adafruit Blog
will that new I2C security chip be able to store secrets.py for wifi logins?
Hi there
I'm having a similar issue. I have connected the RFM96W according to the tutorial here: https://learn.adafruit.com/lora-and-lorawan-radio-for-raspberry-pi/raspberry-pi-wiring. I have two of these modules, one of them is detected but one of them keeps spitting out this error. Is it possible that the module is broken? How can I test if the module is actually broken? Could it be another issue? Your help would be appreciated. Thanks.
are you using the rfm96w breakout? https://www.adafruit.com/product/3073
Since one works, it is likely not a driver or CP issue.
First, have you checked the solder connections?
Also what pins are you using for Chip Select --when you swap modules are you using the same connections for both or is it on two different Raspberry Pi's
Alos - since this is probably not a CP issue and may be a hardware problem I suggest that you post this on the Forum at https://forums.adafruit.com/viewforum.php?f=57 -- we can continue there and include the Adafruit Support folks.
GitHub actions now allows for proper triggering off of release types: https://help.github.com/en/articles/events-that-trigger-workflows#release-event-release
Hi jerryneedell
Thanks for the response. No I'm not using the rfm96w breakout, I'm using the chip as it is. I have checked the connections. I am using CE1 for chip select; it's two different raspberry pi's and I use the sane connections I used on the other pi.
Can you swap the module with the working one on the other Pi?
You may want to post this to the discord channel for radio discussion, https://adafru.it/discord then go to the #help-with-radio channel
@upbeat plover maybe, but it wouldn't gain you much because you'd still have to read it into python and send it to the esp in the clear. If your WiFi is a complicated enterprise setup that uses certificates you could probably extend the ESP firmware to request that python ask the security chip to do the certificate authentication magic, but ain't nobody got time fo that.
Trying 50 different volume levels now, with the square waveform. The waveformโs amplitude keeps increasing, but the measured volume caps around 50%. Why? https://youtu.be/1hEdERoDkVY @errant grail
Even though the waveformโs amplitude increases, the measured volume stops increasing halfway. Why?
you're probably hitting the mechanical limits of the buzzer. It's probably incapable of moving any more air
Thanks, @quasi fjord . An experiment comes to mind: try again in warmer air, or helium.
Iโm hoping that Monday we can get into the weeds with this: https://www.youtube.com/watch?v=j1VUJFcSD30
Iโve been enhancing the sound generation features of Adafruitโs CircuitPython library for Circuit Playground Express. Here I am trying to find what sounds go...
@pearl notch Interesting experiment but not too surprising given the increased spectral energy of the square wave as compared to sine and triangle waveforms.
@swift arrow thanks for improving the Python tie with the try. Just merged. I was noticing too many presses from Bluefruit crashed things. This is helpful. Cheers!
@raven canopy and I were discussing if it was an issue with the library and he was just like "why not try a try" ๐
I learn a lot hanging around here. That is a great project/Guide you made. Kudo's!
I changed it to just use the neopixels on the CPX Bluefruit as I really wanted to learn about BLE. Very cool stuff
<@&356864093652516868> Here is the notes document for Mondayโs CircuitPython Weekly meeting. Everyone is encouraged to attend! Please add your hug reports and status updates even if youโll be attending the meeting - itโs super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and Iโll read them off during the meeting. Hope to see you there! https://docs.google.com/document/d/1suvCpQSY2tuw4wjyZ9G-BFId2iovcZSiA07r3W7gmrs/edit
which microcontroller supports cicruitpython and has the capability of wireless programming like ble?
nrf52840 has ble
@slender iron I've managed to make subclassing mostly work for pixelbuf. The one thing left is figuring out how to call a python override from the native class? I've tried mp_load_method then mp_call_method* and mp_call_function_1 but feel like mp_load_method is the wrong thing here. I'm spending some time in the debugger hoping to figure out the right calling convention ๐
@ruby atlas I've not done it before myself. I think it's something like that
@slender iron any tips for debugging what object instance self_in refers to in gdb? ๐
@ruby atlas i've used display pointing at the object struct indexes...
@raven canopy what file should I look at? (I'm working on making _pixelbuf subclassable, and i'm having issues calling the python show() method from the native PixelBuf class. Specifically, from non-subclassed methods on the native, I'm trying to call the .show() during auto_write=True)
my best guess would be pixelbuf_pixelbuf_type. so with an instance of pixelbuf created, and the board halted, i'd try:
display pixelbuf_pixelbuf_type[0]->auto_write
gdb will save the display entry, and auto show it on every break. (iirc, this is automatic..)
can u upload code through bluetooth for nrf52840?
@gilded pewter do you mean upload a file (code.py)?
yes? (just to know i never worked with circuit python)
for some ble controller, u can upload code through arduino sketch without wire, some thing like that
i was more trying to get to a clearer question, as i am not all that up-to-date on the BLE stuff.
i think your arduino reference would be more of an over-the-air firmware update. i'm almost 100% sure we can't do that (yet). there is a mobile app under development to remotely update the program to run (code.py or main.py).
@raven canopy i'll try display. i'm used to using print
@gilded pewter yes, code.py or main.py. i don't think there is a current way to update either over BLE. i'm not seeing anything on either of these guides:
https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather/overview
https://learn.adafruit.com/circuitpython-nrf52840
@ruby atlas print would probably work too... ๐คท
@raven canopy 4: *self = {base = {type = 0x3fa7c <pixelbuf_pixelbuf_type>}, pixels = 32, bytes = 96, pixel_step = 3, byteorder = { bpp = 3 '\003', byteorder = {r = 2 '\002', g = 1 '\001', b = 0 '\000', w = 0 '\000'}, has_white = false, is_dotstar = false, order = 0x376}, bytearray = 0x20002cd0, rawbytearray = 0x20002d00, brightness = 0.049999997, two_buffers = true, offset = 0, rawbuf = 0x20002e70 "", buf = 0x20002e10 "", write_function = 0x0, write_function_args = 0x0, auto_write = true} now the question is - is that the subclass or is that the native? ๐ Or are they the same?
llol
@idle owl can attest to the llol
at least i no longer feel bad about poking around in the dark here
thought: i don't expect it to work, but maybe just try print pixelbuf_pixelbuf_type without the index? it might just print the whole kit-n-kaboodle.
and yeah, if Scott hasn't seen it...i definitely haven't. ๐
I think I'm going to need to set breakpoints within the bytecode executor...
#1 0x0002293a in pixelbuf_pixelbuf_subscr (self_in=0x20002ef0, index_in=<optimized out>, value=0x20002d50)
at ../../shared-bindings/_pixelbuf/PixelBuf.c:430
#2 0x00015778 in mp_obj_subscr (base=0x20002ef0, index=<optimized out>, value=0x20002d50) at ../../py/obj.c:493
#3 0x0002688a in instance_subscr (self_in=0x20002c20, index=0x20002d60, value=0x20002d50) at ../../py/objtype.c:853
#4 0x00015778 in mp_obj_subscr (base=0x20002c20, index=<optimized out>, value=0x20002d50) at ../../py/obj.c:493
#5 0x00035ae8 in mp_execute_bytecode (code_state=code_state@entry=0x2002fe88, inject_exc=<optimized out>, inject_exc@entry=0x0)
at ../../py/vm.c:467
#6 0x00036d28 in fun_bc_call (self_in=0x20029980, n_args=<optimized out>, n_kw=1, args=0x0) at ../../py/objfun.c:284
...```
I feel like self_in=0x20002c20 might be what I want, not self_in=0x20002ef0 but not sure yet
need a good canary...
well, it might help. Balmer thought so.. ๐ป
@idle owl still on vaycay, will miss a couple more weekly meetings. Hug reports to all!
@onyx hinge Sounds good! Keep having an amazing time!
@ruby atlas the first member of all object instances should be a pointer to the type
if it says pixelbuf then it's native already
@gilded pewter Updating over ble is not currently possible but I'm working on adding it alongside some refactoring
@slender iron hmm... i'm actually trying to call a non-native subclass method from the native method. When I invoke a helper (see below) from pixelbuf_pixelbuf_subscr (on the native), it seems to call the native method, not the python subclass method.
mp_obj_t call_show(mp_obj_t self_in) {
mp_obj_t dest[2];
mp_load_method(self_in, MP_QSTR_show, dest);
return mp_call_method_n_kw(0, 0, dest);
}
specifically, what I wanted to be able to do is have
class NeoPixel(_pixelbuf.PixelBuf):
def show(self):
neopixel_write(self.pin, self.buf)
as the glue to write pixels in neopixel.py
@slender iron sounds good.. please give update when u guys are done!!
I have seen some companies doing with at command
Can CircuitPython be used to generate a 2MHz toggling IO on a SAMD21 (aka Trinket M0)?... I've used the simpleio.tone library to generate kilohertz signals. Is there a library for MHz outputs?
@umbral abyss 2MHz is about the max i ever got out of the M0 using pulseio.PWMOut
I don't think 2MHz is unreasonable, because the hard work is done by the TCC module not python anyway
@ruby atlas seems like that should work to me. I'd expect self in to have the subclass type.
@gilded pewter I'd suggest following the circuitpython release notes. my plan is to have a custom ble service for circuitpython that enables it
@slender iron i'll spend more time in the debugger tomorrow evening ๐ Unfortunately, i'm pretty sure I won't make tomorrow's weekly.
kk, feel free to add notes though! I'm excited to hear how things are coming along
I don't think this should happen. We have a check that all boards are included in the CI config and the releases have been reliable in getting all of the files posted.
@gingle have you made any progress on this? I'm very interested in getting this going.
@tulip sleet the new tinyusb/dcd update has broken usb for the F412 - was there a piece of upkeep I was supposed to do but missed?
@idle owl @slender iron alas (again!), the combination of my son, Tae Kwon Do and my ability to drive him places has misaligned so I won't be able to make today's meeting. However, I've added stuff to the doc linked to above. Thanks!
Sadly, this has broken USB on the STM32F412, by excessively restricting the FS endpoints. There are 6 FS endpoints on the F412, should be enough to support all circuitpython devices. Specific error:
0x0804a8aa in dcd_edpt_open (rhport=0 '\000', desc_edpt=0x8068862 <usb_desc_cfg+194>) at ../../lib/tinyusb/src/portable/st/synopsys/dcd_synopsys.c:273
273 TU_ASSERT(epnum < EP_MAX);
I believe this is caused by the ST definition for this including endpoint zero, but this assert does not take that into account when counting.
Confirmed. Could you loop me in as a reviewer next time you push an ST update? I'd like to help out with testing to help prevent issues like this. I didn't realize from the mention that this changed anything other than file names.
^it isn't the ST definition, my bad
does have something to do with endpoint count though.
@hierophect Sorry about this. Is this due to the OUT endpoint for HID? I thought this would not be an issue because it's the OUT half of an endpoint pair.
@dhalbert if you gave it a different index, probably - that would be similar to the doubled CDC index causing the same issue in the past.
@dhalbert My fix at the moment, by the way, is simply increasing the number of endpoints allowed by 1, and everything is working fine.
I added a note explaining that I2S is not available to the Pinouts section in the Learn Guide for the board.
@plucky flint No worries! Thanks for adding updates to the notes!
@tulip sleet how would I go about making the autogen of the usb descriptor a prerequisite for make? Having to make clean and recompile everything just to get the usb descriptor seems like it ought to be fixed, but I'm not sure how python stuff is triggered via the makefile.
@ionic elk it already is, but maybe there are some missing dependencies (like, it should be dependent on the script)
i'll look
@ionic elk it's in supervisor/supervisor.mk
does make just not recognize changes to it because it's a py file?
the depedencies look ok; are you saying it doesn't get rebuilt properly if you change the script?
# autogen_usb_descriptor.intermediate: ../../tools/gen_usb_descriptor.py Makefile | $(HEADER_BUILD)
does it have to do with the .intermediate? I'm not sure what that does
also, I found the usb issue - Audio is taking 2 endpoint slots
I was under the impression it was supposed to take 1
and that only CDC was supposed to take 2
there is some weirdness i had to add re intermediate; I don't remember why I did that
i'll try to reconstruct why it's the way it is
@tulip sleet sorry, on the USB-audio issue or the regen issue?
| $(HEADER_BUILD) means it's an "order-only" prerequisite
Gotcha. Would I just activate that via an ENV flag HEADER_BUILD=1?
@slender iron did the MIDI stuff; usb-audio needs two endpoints for MIDI
Oh. Well crap then yeah we can't support that on basically any ST chip
well, if someone needs it they can drop HID
I don't remember
i think you saw the same two-endpoint thing with all the USB-to-MIDI adapters you tried?
i have an elderly USB MIDI device I can extract the desciptor from, but I'm not sure we'll discover anything we don't already know.
I don't know what's up in the python, I only see a single endpoint address described
@ionic elk yeah, that's why I put in the compile-time choice, and we would like to have a run-time choice
of HID devices
And the debugger is slightly weird about it. It doesn't increment through them the way it does with CDC, the assert for the endpoint pops up only once, but it's at 2 already
@tulip sleet oh sure I meant that I don't see how audio is taking 2 endpoints
I don't see the descriptor for the second one, unless it runs it twice?
there's an audio midi interface and an audio control interface; you need both. this is vaguely like why CDC needs two
Ok. I feel weird that I didn't pick that up when we talked about this before, I could have sworn it was only CDC that needed 2. Did this only come up recently?
But in any case, mystery solved, etc.
it was old man MIDI all along
yeah, I just plugged in my ancient MIDI USB dongle, and it asks for two interfaces, according to wireshark
@gilded cradle Have a minute to test my audio setup with me for the meeting?
Ok, so the official baseline for Circuitpython's endpoints is 7 including control. To clarify, this will exclude all STM32 chips except the F446/69/79
Sure @idle owl
@gentle bronze I notice that tusb is capping out for the F405 at 4 endpoints, which implies it's stuck in FS mode and not touching HS, which has 6 endpoints - is this changeable by a setting?
@ionic elk I think we don't have to say that's the "baseline". We have been able to have MIDI in the past due to lotsa endpoints. We can say in the doc (and set in the makefiles) that MIDI is not included in the STM builds by default.
i thought F405 had no PHY for the HS endpoints
i think hathach tried some tricks on that, but failed to get it to work
We might have covered that and I forgot. What's the PHY? I don't think I ever asked.
the electrical driver circuit that you'd connect the socket to
Oh so as in "Physical"?
right
Weird, why even have the HS at all then? In any case, not a big deal.
@ionic elk hs usb on f405 has more endpoints, but require external PHY to operate at highspeed mode.
it has data lines, but they need some circuitry to actually talk to a USB cable
Ah, gotcha. So it's an additional circuitry thing
Though many people mentions that it is possible to have the hs usb work with builtin PHY (full speed), but I failed when giving a try
why they left it off, I dunno, since it's a pain otherwise. It might have been a chip design issue
i certainly wouldn't set out to spec a chip that needed off-chip PHY
It probably need external rc or something but I am not sure. I am not an hw expert ๐
Well, if you have the time @gentle bronze it might be a nice feature, since it'll let us get HID on there alongside CDC and MSC. But it's not too big a deal.
I can look into the guts as well
I tried but I really need an board that physically work first though.
Some Discovery boards might support the PHY, I'll look into that
This probably occurs on the F407 and F427 too, so I'm sure it's not the first time anyone's run into it.
the pyboard has this problem, and there are ways to specify which combo of HID devices
@ionic elk I will check to see if there is any dev board that we can test with the hs core
Though it is up to @meager fog to decide on the pcb hw
@gingle have you made any progress on this? I'm very interested in getting this going.
Not for now. I have been sidetracked for awhile.
Good afternoon all you wonderful people! I'll be lurking today, nothing to share other than a desire to listen in and catch up on what's going on. ๐
If anybody else is lurking please let me know so I can update it in the meeting notes. Thanks!
@gilded cradle have the notes link handy? need to add mine
or feel free to put it in the docs yourself. ๐
It's pinned
Loud and clear @idle owl
good evening
i'll be a couple mins late but there in a few mins
@river quest No worries
๐ต
"no one listens to my lyrics, they just want to see me dance"
Former high school & college musician here -- did bass clarinet & bari sax (along with other clarinets and saxes) in concert, ensembles, musicals, etc. Some of the most fun I've had.
lurking
Lurking
๐ @gilded cradle
^ "You're never more than a half-step away from the right note."
@errant grail And if you are, call it "jazz" ๐
hi
I'm gonna lurk as well.
yay!!
Also, hi!
๐
Lurking
hi @ivory yew !
Hi Thea!
added the post in our newsletter, great work! Lessons learned from building a custom CircuitPython board by Thea Flowers
https://blog.thea.codes/lessons-learned-from-building-a-circuitpython-board/
DRAFT here - https://github.com/adafruit/circuitpython-weekly-newsletter/blob/gh-pages/_drafts/2019-10-08-draft.md
Oh rad. ๐ Thank you so much.
stories about cats are good too
Equal Dog and other pets lovers too
Happy Ada Lovelace Day! TOMORROW!
Ada Lovelace Day (ALD) is October 8, 2019, it is an international celebration of the achievements of women in science, technology, engineering and maths (STEM). It aims to increase the profile of women in STEM and, in doing so, create new role models who will encourage more girls into STEM careers and support women already working in STEM - findingada.com.
Thank you Mitsuharu Aoyama, CircuitPython book is out
https://ameblo.jp/steamtokyo/
STEAM Tokyoใใใฎใใญใฐใงใใๆ่ฟใฎ่จไบใฏใๆ่กๆธๅ ธ7ใซๅๅบๅฑใใพใใ๏ผ๏ผ็ปๅใใ๏ผใใงใใ
Would love if Adafruit carried the shirt
Lessons learned from building a custom CircuitPython board by Thea Flowers
https://blog.thea.codes/lessons-learned-from-building-a-circuitpython-board/
I did too
CircuitPython slithers onto a new board, but this board looks a bit familiar!
https://bigl.es/microcontroller-monday-serpente/
EuroPython 2019 videos posted
https://www.youtube.com/user/PythonItalia/videos
Talks include: Radomir Dopieralski โ Game Development with CircuitPython, Nicholas Tollervey โ Tools of the Trade: The Making of a Code Editor, Florian Wahl โ Building logistics applications with MicroPython and ESP32 MCUs, and Ben Nuttall โ Astro Pi: Python on the International Space Station.
Open-source hardware month is here!
https://ohm.oshwa.org/
https://blog.adafruit.com/?s=%23ohm2019
Have an open-source hardware (or software) success story? A person, company, or project to celebrate? An open-source challenge? Email opensource@adafruit.com, we'll be looking for, and using the tag #OHM2019 online as well!
All this and more, shipping out Tues AM!
https://github.com/adafruit/circuitpython-weekly-newsletter/blob/gh-pages/_drafts/2019-10-08-draft.md
๐ฐ ๐
thankya!
alpha worked really well for my project. ๐คท I'm almost sad I haven't found bugs.
Reminder: Our community directory: https://docs.google.com/spreadsheets/d/1NWwiUuQnam_abdv02ugLxz9uFrvhtMfy8U306HJ4_qU/edit
We're currently using the mbedTLS implementation of the TLS and SSL protocols on the ESP32 Co-Processor/AirLifts by communicating with an ESP32 running nina-fw from CircuitPython. While this solution is stable, a native CircuitPython SSL/TLS library would be faster, remove the hardware dependency for an ESP32 and allow for different transports (not just wifi).
Some embedded ssl/tls implementations:
BearSSL: https://bearssl.org
AxTLS: http://axtls.so...
Amazing how many accomplishments people have.
It's a side effect of gathering a group of talented, caring people and setting them loose on a worthwhile project ๐
oh yah. thanks for testing neopixel spi @gilded cradle
yw
now, breathe.... thanks for speaking for all us no-shows/no-mics, @idle owl!
The BLE work sounds fun
@pearl notch I've seen the bubblesort dance video during a lecture, it stuck with me ๐
yes
No
Hang on bad discord
no
I can't
yes! that'd be cool
SysTick is already highest priority on the NVIC, iirc.
Yes, an external speaker sounds quite nice.
Live stream of @tannewt debugging memory issues in CircuitPython. Visit the Adafruit shop online - http://www.adafruit.com ----------------------------------...
Right, but pewpew13 isn't a defined board.
what does it compile?
I see, should I make a PR for removing it?
I'm fine with just one version
and it takes up resources
thanks
๐ thanks everyone!
Thanks!
Thanks everyone
Thanks! So long.
Thanks!
cheers !
@pearl notch Can you hop back in for a moment
One sec
๐ฅ ?
@pearl notch I can type it out, it's not a huge deal.
Created at Sapientia University, Tirgu Mures (Marosvรกsรกrhely), Romania. Directed by Kรกtai Zoltรกn and Tรณth Lรกszlรณ. In cooperation with "Maros Mลฑvรฉszegyรผttes",...
I'm gonna drop -- ya'll have a nice one, thanks again. Stay safe @slender iron
@gilded cradle Thank you again for taking notes!
@modern wing it's 8 blocks away and lots of fire folks are on it
Done. Thanks.
@pearl notch Thanks so much for doing that!
Quality. ๐
I've tried modifying the code for playing wav files, but notice on the fifth button press things seem to crash, with a buzzing sound from the speaker & the sound playing continuously. Sprinkling in print statements shows it hits audio.play(wave) before choking, so maybe this a bug in the current libs? Ctrl-C stops in the while audio.playing: loop. Here's a GitHub repo that has the short file (detects a button A press as well as A1 cap touch), and plays two sounds based on the current CPXb tut...
@idle owl I though cirpy gfx development was ceased when displayio was released?
@marble hornet What is the context you're referring to
The recent issues filed on the gfx repo
I'll need to look into it, but you may be right. In which case we need to at least update the README to reflect that, or deprecate the library.
@slender iron The Adafruit_CircuitPython_GFX lib - is that deprecated by displayio?
@jepler this is a good one for ya when you return!
it won't be deprecated until blinka has displayio as well
@slender iron Ok thanks.
@slender iron re the BLE scanning iterator: I think it might be good to have a timeout specified so that if no advertisement is received within the timeout, it either terminates, or it returns None. It also doesn't necessarily have to be a real iterator (though that's elegant): it could be a function that takes a timeout value (optional) and returns either the next scan entry or None.
ya, it's still possible to provide the timeout when starting the scanning
3 BLE CPX's on the way! (Yay! AT w/iOS just got lots simpler!)
it'll just return STOP_ITERATION in that case
@slender iron I thought I could figure this out from the other ports but I guess I'm stumped. What exactly is the expected behavior of busio_uart_read? I thought it was to attempt to read anything off the UART line and return 0 if it didn't find anything. But it's causing all kinds of weird behavior even when returning 0. How do I get it to just be inert if there's nothing on the UART line to read?
lemme look
Thanks for doing this!
@jwcooper is this ready to merge now that libraries.json is updating?
@ionic elk https://github.com/adafruit/circuitpython/blob/master/ports/atmel-samd/common-hal/busio/UART.c#L306
what is the behavior you are seeing?
It's constantly acting as though empty material has been sent,
so a lot of spaces, etc
is that the expected behavior, though? It should just ignore the return if it has that error attached, right?
are you returning MP_STREAM_ERROR?
Alright, https://circuitpython.org/libraries/contributing is now updating daily! We now have a central place for keeping up with everything Library related. Thanks again to @raven canopy and Justin for all the great work on this!
CircuitPython Organization
I am unreasonably excited about this.
@dhalbert please re-review and merge if it looks ok. Thanks!
Could you add the specific endpoint names here? We don't need to save space. E.g. "CDC Endpoint address must not be 0".
Not too important, but a nice style for boolean argparse arguments is given here: https://stackoverflow.com/a/15008806/142996
I should be able to look at this someone next week
I bet all my tests construct the audio object just once...
@ivory yew great blog post and welcome to the discord community!
Thank you. :3
MP_STREAM_ERROR is not 0 though, it's -1 (but as unsigned)
http://media.unpythonic.net/emergent-files/sandbox/report-3d3d49.html#LN954 hm clang's static analysis says there's a null pointer dereference here, and I can't see the flaw in its logic. That assignment must not be reached (much) in practice?
I think it would be reached after 4 never-free objects were listed, but it looks like only displayio is using this feature, so it doesn't happen in practice
The full report from scan-build-7 is here: http://media.unpythonic.net/emergent-files/sandbox/report-3d3d49.html#LN954
Basically, in the case where the first block of 3 "never free" objects is filled, the code needs to allocate a new block and hook it into the linked list that goes via the [0] index of each block. The logic to chain the blocks together erroneously tries to use current_reference_block[0] but current_reference_block is guaranteed to be NULL at this point, by the cond...
OK now it won't be forgotten
By invoking scan-build make in ports/unix, a number of diagnostics are found. This fixes several of the trivial ones.
hm except a number of tests fail.
๐
wait, they fail at adafruit master as well
pass micropython/viper_binop_multi_comp.py
b"(<class 'ZeroDivisionError'>, ZeroDivisionError('division by zero'))\n(<class 'ZeroDivisionError'>, ZeroDivisionError('division by zero'))\n(None, None)\n"
### Actual
b"(<class 'ZeroDivisionError'>, ZeroDivisionError('division by zero',))\n(<class 'ZeroDivisionError'>, ZeroDivisionError('division by zero',))\n(None, None)\n"
FAIL misc/sys_exc_info.py
``` this ring any bells?
the difference is an extra comma in the repr of ZeroDIvisionError, I think
oh it's a python3 incompatibility
3.7: ```>>> ZeroDivisionError("test")
ZeroDivisionError('test')
3.5: ```>>> ZeroDivisionError("test")
ZeroDivisionError('test',)
pyenv to the rescue... ๐
look! i'm on a train. well, my words are... ๐
too bad that the station where I decided to stage my photo was kinda ugly
i still haven't been to Japan. def need to get there some day.
I recomend it for anyone who enjoys travel, it has been pretty amazing. there are streets clogged by western and chinese tourists, but there are also neighborhoods that look exactly like what you see in 20th/21st century movies and anime. I'm even learning enough to appreciate the shrines and temples.
and you can absolutely do it without more japanese than "please/thank you/excuse me/1/2/3"
and did I mention the food?
Japanese presentation of anything is always so appealing.
In an American restaurant, all the plates would be the same boring style. Here, you get 9 things in 9 bowls that don't match and it's beautiful
train's arriving soon, ttyl!
๐
and coincidently, i just hit a Python 3.7 syntax error with something. async is now a keyword, so using it as a function kwarg is apparently frowned upon.
@ionic elk I will order a couple of stm32f7 board with USB HS to test with, couldn't find an f4 discovery board with HS USB. I will update its status in this github issue https://github.com/hathach/tinyusb/issues/198
I'm running into an error building ports/unix
../../py/sequence.c: In function โmp_seq_multiply_lenโ: ../../py/sequence.c:40:5: error: implicit declaration of function โ__builtin_mul_overflowโ [-Werror=implicit-function-declaration] if (__builtin_mul_overflow(item_sz, len, &new_len)) {
@timber mango first guess would be gcc version incompatibility. What compiler are you using?
@onyx hinge clang version 3.4.2 under centos 7.7
I was able to compile micropython with it but not circuitpython.
The way to disable and enable endpoint renumbering has been changed. Now instead of using '--renumber-endpoint 1' or '--renumber-endpoint 0' we can use the '--no-renumber_endpoint' argument to disable renumbering. By default, endpoints are renumbered without providing this argument.
@timber mango it's possible that circuitpython is using gcc extensions not in clang, but I don't know the specifics about __builtin_mul_overflow. patches to build on more compilers would make great pull requessts.
@timber mango I ran into that using GCC but not a super recent version. Looks like __builtin_mul_overflow() premiered with GCC 5 and is also reported to be in newer Clang releases. Wikipedia says 9.0.0 is the current stable so updating probably fixes it. Or you can do what I did, because I'm naughty, and make this change in circuitpython/py/sequence.c:// Detect when a multiply causes an overflow. size_t mp_seq_multiply_len(size_t item_sz, size_t len) { #if 0 size_t new_len; if (__builtin_mul_overflow(item_sz, len, &new_len)) { mp_raise_msg(&mp_type_OverflowError, translate("small int overflow")); } return new_len; #endif return item_sz * len; }
So, the STM32F405 has "Two USB OTG Ports" - will they be exposed on the Feather? I'd love to have a way to make [WIERDUSB]->HID adapters without the hacks https://www.adafruit.com/product/4382
@tulip sleet I assume it is expected the the Bootlader File system is not visible to an IOS13 (ipad pro) but the CIRCUITPY drive is. Is that correct? see this forum question https://forums.adafruit.com/viewtopic.php?f=58&t=157270&p=775429#p775429
We've seen ...BOOT visible - gotta go out in a minute but I believe it's visible. There are issues with the .Trashes file on iOS. We use a .Trashes file (not dir) to suppress having a trash can on iOS, but it's confusing iOS.
OK -- I have to go as well -- will try again later
CircuitPython 5 poster added to the "poster pole" near my desk at Adafruit HQ.
We're going to need a larger ceiling...
@solar whale there is an issue with the USB descriptor asking for too much power, we need to fix the bootloader
@tulip sleet @slender iron could I talk to one of you about UART on a call today? I've got a basic UART system working ok, but the existing port code makes it seem like a LOT more is going to be required. Would like to go over priorities.
@errant grail mind replying with a uart midi example here: https://forums.adafruit.com/viewtopic.php?f=60&t=157287 ? We should add one to the examples directory of the library
@ionic elk I can chat in 10 minutes or so
@ionic elk i'm also avail
Ok let me chat with @slender iron first if that's ok Dan, your code is a lot more complex due to the IRQ and buffer structure.
np
@dhalbert Do you know if creating .Trashes as a file instead of a directory is an official solution from Apple or a hack/workaround?
@ionic elk ok, at my desk
Ok I'm around, should we just do the discord call thing?
or actually let's just hop in circuitpython
๐
@CollinCunningham The technique appears multiple places, but nothing official that I can find. It does not appear to be documented, but then, Apple doesn't document a lot of stuff. I did some websearches on site:apple.com and could only find mentions in discussions.apple.com
@tulip sleet Ok chatted with Scott and it looks like we definitely should talk! Can you hop in CircuitPython?
(chat channel)
@wind trellis That was my temporary fix as well.
@swift arrow voice channel in the list on the left
this is not a meeting chat ; we are talking development
@gilded cradle Blinka question. Do you know if we have the following working yet: USB HID, pulseio, analogio. (I know we don't have displayio yet)
The 'better' fix to compile circuitpython's port/unix on Centos 7.7 turned out simply using a newer compiler the the default.
yum install centos-release-scl yum install devtoolset-8 scl enable devtoolset-8 -- bash source /opt/rh/devtoolset-8/enable
And compile as usual.
@idle owl, sorry. Discord didn't ping me. I think pulseio is present for some boards, but I don't think the other stuff is working yet.
Ok, I'll call it a no across the board for now.
Ok then
I went through the PyPI spreadsheet from that project, and there are a few libs that are marked as on hold waiting on Blinka support for the things I listed, so I wanted to check whether it was worth adding them yet. It is not if it isn't consistently supported.
Yeah, the main problem is that so many boards/os combos support things differently.
Understandable
Just getting the basics like I2C/SPI, and UART working can be a challenge, so we've had to mark some boards as not supporting it if the steps to get it working were way too complicated for the average user.
Ah. That makes sense.
@tidal kiln just hooked up an ft232h to my Linux box and tried "blinka"
So far just blinking and LED and read from an adt7410 temperature sensor. Works great!!
@slender iron I replied to the forum post a few minutes ago: https://forums.adafruit.com/viewtopic.php?f=60&t=157287&p=775506#p775506
I was wondering if it is possible to connect an external SPI Flash module (I was looking at one that uses the Winbond W25Q64) and communicate with it in CircuitPython and over USB? In particular I was looking to do this with the ItsyBitsy M0 Express.
I am new to CircuitPython but have been trying to pour over the docs and repo to see what I can find. I found this issue #1764 which is similar, but it seems that it is still on the 'long term' milestones list.
I would gladly try to take th...
That is not currently possible. You can mount an external file system (easiest to do currently with an SD card) to be visible to your code, but it won't be accessible over USB to your computer.
I suppose the easiest way that would work out of the box is to use an SD card, and use an external SD card adapter to put the files on it.
You could also probably replace the flash chip on your ItsyBitsy with a bigger one (most of them have the same pin-out), but I'm not entirely sure what sizes are ...
I would echo what @deshipu said, and also note that the NeoTrellis M4 and the PyPortal boards already come with an 8MB flash chip. But the SD card would be the easiest solution in the long run, and you'd be able to have many more sound files than would fit on 8MB.
thanks @errant grail !
@prime flower Is there an "official" place to grab the 1.4.0 version of the nina firmware?
In fact, I don't see it in the nina-fw repository to build.
ah -- found it PR-11 -- not yet merged -- I'll try to test this tomorrow.
I tried reproducing this with the Unix port, but it seems to be working as expected. Is this still an issue?
Thank you both for your quick responses!
I understand what you are saying, the SD card option did seem the most straight forward approach. I was trying to keep the price of the project down as much as possible and wanted to put it in an enclosure. For those reasons I was leaning away from an SD card. I also don't think I personally would be able to replace the flash chip on the ItsyBitsy since it is physically smaller than on some of the other express boards.
So even though this functio...
The CIRCUITPY filesystem that is exposed via USB is a single FAT filesystem. The USB mass-storage mechanism ("MSC") exposes a block-oriented low-level view of a single disk (and therefore a single filesystem, or at best multiple filesystems on a single block-oriented device). USB MSC cannot present a unified view of all the mounted filesystems, unless it somehow pretended it was one disk, which would be very tricky.
It would be nice if the USB interface were file-oriented, instead of block...
Okay, so it can't appear as one unified filesystem, but would it be possible to expose them as two separate disks? So it would appear as something like CIRCUITPY and CIRCUITPY2?
@solar whale it will be merged tomorrow, binary will be released under Releases for now until we have a travis script to build it
not sure how many nina-fw build's we'll actively be releasing so that's where they'll be for now
working so far -- have not tried new stuff, just making sure nothing broken....
I checked a bunch of pre-existing tests, but please break things if you can ๐
The diagnostic from clang scan-build was that in the memcpy statement, kw_args->table dereferenced null pointer kw_args. If kw_args is null, then n_kw is 0. By guarding it with the added if statement, the problem is resolved and the NULL pointer is not dereferenced at runtime.
(and if n_kw is 0 then there's nothing to copy anyway)
I could use some feedback on my project was thinking of going with the SAMD51 But anyone else have any thoughts. Does anyone know if circuit python would work with this. I have no experience with it
Open Power Product Showcase. https://hackaday.io/project/164913-open-power - - - - - - - - - - - - - - - - - - - - - - - - - - - Track: Blue โ Declan DP [AL+...
Okay, so it can't appear as one unified filesystem, but would it be possible to expose them as two separate disks? So it would appear as something like CIRCUITPY and CIRCUITPY2?
Yes, but then it needs to be another MSC device, using another USBendpoint (two endpoints are needed on SAMD21, due to some kind of bug).
Gotcha, I didn't realize all of those endpoints are set even when not in use.
I have another idea for how I can at least "expand" my flash storage. If I connect the SPI Module (Winbond W25Q64 or W25Q128 if I want 16MB) to the board and then modify the Itsy Bitsy's mpconfigboard.h to use the external flash module rather than the onboard flash, I should be able to use the external module just like the onboard flash is normally used. In this case the onboard flash would not be used by CP bu...
@tidal kiln hiya not sure if yr around, i was just testing my USB C FT232H and all is good - was gonna try neopixels next
Add support for Spresense. It is a compact development board based on Sonyโs power-efficient multicore microcontroller CXD5602. This port uses the built and exported NuttX SDK.
Supported features:
- analogio
- board
- busio
- digitalio
- microcontroller
- os
- pulseio
- rtc
- supervisor
- time
Unsupported features:
- audioio
- audiobusio
- i2cslave
- rotaryio
- touchio
- gamepad
- neopixel_write
- nvm
- displayio
- freqencyio
Refer to [developer.sony.com/devel...
@torpid osprey does it have an USB port?
Seems like the latest prototype schematic shows the USB data pins as no connects
#almostontopic spotted some Python being used to set up an art exhibit at the 21st Century Museum of Contemporary Art in Kanazawa Japan
@stuck elbow Yes it is on the bottom though
as long as you can connect your computer to the usb, you should be able to run circuitpython on it
Does anyone have an ili3940 screen that would be willing to test an example from the circuitpython_gfx library?
sorry, I meant ili9341
@trim elm did you find one?
@prime flower no
@prime flower Just FYI -- I seem to get fewer "failed to find SSID" errors with IDF3.3 than with 3.2. I often have seen those when connection to my AP -- When I build nina 1.4 with 3.3 I just accepted all the default changes to the sdconfig. seems to be working well. Not a big deal and no reson to rush to 3.3, but it does seem to help with that one issue I have seen.
@prime flower do you have an example of how to use the new certificate feature in 1.4 ?
@solar whale I do in MiniMQTT
Didnt release yet but it's merged, you'll need latest ESP32SPI. I'm assembling an AWS IoT library the next two days for CircuitPython
How are you building nina with 3.3, btw?
great -- thanks -- I'll take a look
just downloaded the IDF 3.3 (as the repo says but use 3.3 instead of 3.2) and did make clean/make firmware -- accept all the default changes to sdconfig.
I may have been building nina-fw 1.4 with 3.3 in that case...
as here -- jsut used 3.3 where it says 3.2 https://github.com/adafruit/nina-fw
Yeah, I have been. I'm going to release fw 1.4 with ESP-IDF 3.3
cool!
We're not "shipping" (as in physically shipping from the factory) fw 1.3.1, so I'll release 1.4 for those who want it and see if people hit issues with 3.3. I noticed the increase in AP-connection-stability as well
I have it running on sevreal boards -- Airlift breakout, airlif featherwing, Airlift shield , metro_m4_airlift and a huzzah esp32.
I do want to add pre-shared-keys (PSK) to WiFiClientSSL, though.
Mosquitto uses it, but it seems that's one of the only brokers so far. Most commercial IoT brokers use a root CA cert and device cert/key pair.
I have to do some reading re:certs -- all a black box to me.... looking forward to learning....
It's a black box I've been trying to make more transparent ๐
I have to go off for a while - more time to play later...
@trim elm I have a tft featherwing (ili9341) and can do some testing this afternoon.
@solar whale cool. thanks for trying out ft232h.
@solar whale Going to do a fresh install of esp-idf 3.3 so I can get these instructions correct for everyone ๐
@prime flower I'd like the NINA pin read changes we're working on to use 3.3 as well. I haven't built NINA before, can beta test the new instructions.
@crimson ferry I'm about to PR a 3.3. sdkconfig and readme update.
running tests to ensure I dont break things first, one of the new sdkconfig options will free up 10k of IRAM which is great for us.
@crimson ferry I'll have build instructions in the PR, I've made it easier with the makefile that's currently within master (make firmware, make load-passthrough, make load-nina, make load-circuitpython), keep in mind you'll need a UF2 for the USB/Serial passthrough and CircuitPython UF2
Ah yes, I used to have some standalone ESP32s wired up as Airlifts, but they've all been repurposed now (I'm setting up an array of wi-fi station probe request detectors to triangulate on where some unknown probe requests are coming from ๐
@crimson ferry @solar whale ๐
https://github.com/adafruit/nina-fw/pull/13
Updated and tested build documentation in README.md
Updated sdkconfig to reflect my ESP-IDF 3.3 build configuration, so someone building this firmware do not need to run make menuconfig
Hardware C...
๐
@prime flower Process question... The version shows 1.4.0 in CommandHandler.cpp, but I didn't see CommandHandler.cpp in the files changed. Should we update version number when code or build changes, since either will result in a unique binary whose version can be queried by CircuitPython? Or does the build process change that version number in CommandHandler.cpp?
@crimson ferry Commandhandler changed from 1.3.1 to 1.4.0.. (https://github.com/adafruit/nina-fw/commits/master/main/CommandHandler.cpp)
Do you have the latest master?
I manually set the version number in CommandHandler.cpp and Partitions.csv before bumping the version
I'm referring to this: https://github.com/adafruit/nina-fw/pull/13/files build process changed (new unique binary) but same 1.4.0 version as yesterday's cert stuff.
Updated and tested build documentation in README.md
Updated sdkconfig to reflect my ESP-IDF 3.3 build configuration, so someone building this firmware do not need to run make menuconfig
Hardware C...
Maybe I'm mising something, I'm a bit of a n00b still at github.
I didn't update to 1.4.1 or something similar since no code changed, just the build environment
Right, that's my point... even a build change will result in a unique binary (different hash), and could affect functionality, even if no core code changes... shouldn't it deserve a new version number?
It should, I didn't release a binary of 1.4.0 yet, though
ah, gotcha
You are correct, I just didnt want to release firmware (it's manual rn for nina-fw) until I had a binary built with 3.3 for the wifi patches
cool, much ado about nothing... thanks!
@sly falcon @crimson ferry We'll release nina-fw binaries on the Releases page for now, I've pointed the upgrading guide to this page -> https://github.com/adafruit/nina-fw/releases/latest
Cool! Would it make sense to put the shipping binary there too? (1.2.2, I think)
@prime flower If I read all of that right, there are three procedures to upgrade NINA firmware... one for all-in-ones (e.g., *passthru.UF2 on PyPortal), second using SerialESPPassthrough.ino and esptool onto a separate Airlift co-processor board, and third (implicitly) using esptool directly on a standalone ESP32 board like ESP32 Huzzah Feather or ESP32 Huzzah Breakout.
@hexed pawn Thank you for writing a driver for the MCP9600. It is my understanding the updated board will be in the store this week. Until then, I can work with you to get a PR in for the driver. You'll submit it to this GitHub repo: https://github.com/adafruit/Adafruit_CircuitPython_MCP9600 There are step to follow to get it set up for a PR involving using a tool called cookiecutter to create the base set of files we include, and then you'll have to go through and update those files. We have a guide that covers a lot of it, but I am also available to discuss it if you run into issues or if you learn better that way. Let me know when you're around and ready, and I can point you to the right places to get started.
@prime flower How are the separate co-processor boards wired differently to the all-in-ones such that the *passthru.UF2 process wouldn't work?
@ionic elk hiya are ya hackin today
@meager fog hiya I'm hacking away
Just about done with DAC, had to put UART on hold until I get the GPS
@crimson ferry the passthrough process works, with those too - the uf2 file can be obtained by loading the Serialpassthrough ino file via arduino onto the board, then double clicking RESET to launch into BOOT. Then use that CURRENT.UF2
@prime flower Nice job on the new commit/release -- just built and loaded to an Airlift shield - on a GCM4 - no problems.
The all-in-one-boards have fixed pinouts, compared to how someone might wire up a shield or wing so it's easier to provide a Uf2 for them.
catalina hates arm gcc ๐ฆ
@solar whale thanks!
@slender iron glad I waited ....
was going to try it later today -- I have a spare system to test on -- it has catalina on it now but I need to do a full install of the build tools -- will give it a try later today or tomorrow,
@prime flower serailpassthrough.ino worked fine on the GCM4
@prime flower Pin differences could be a bear, but I was just thinking that someone who does CP but not Arduino may want to easily update their Airlift FeatherWing on a Feather M4, or their Bitsy Add-On.
just had to set pins
Yeah, I have a UF2 for the FeatherWing that I reuse during building nina-fw (see the Makefile in nina-fw for how it's used)
Since those pinouts are fixed for the wings, I wonder if there could be standard UF2s for those, so CP people don't have to install and learn Arduino.
There could be, I'll a TODO. The shield gets reused btween diff form factors (uno/gc)
some people use the wings with female-to-male headers, to breadboard
True, there are tons of variations. Before all the airlift stuff, I had a Feather M4 + Feather ESP32. I don't recomment it.
You can use miniesptool, the guide doesnt list it bc it's a lot slower than esptool
Nice! Speed probably less of an issue for someone who doesn't have an Arduino env.
@tidal kiln This is probably a dumb question, but will this work with RPi 4? https://www.adafruit.com/product/2028
yep. should. header pins are common on all pis.
Ok thanks.
except for some very early ones, but doubt you'll ever run into those, they're rare, museum pieces
Right. We still sell the tinier version of that too.
I have one of those, only a little burned
(I didn't understand why using 5V signal on a 3.3V device is bad back then)
Now you know!
it worked fine for a year!
"tinier" = for the 2x13 header?
Yah.. I thought it was shorter.
yep. even those pins are common.
the newer models with 2x20 header simply added additional pins
Ah. explains the "downgrade cable".
but there are some super early revs where a few pins on the 2x13 changed
Do you mind testing it with Blinka and a fritzing diagram I did?
I don't have a Pi set up here yet. Ordering it now, but would rather not wait.
yep. have 006 and 007.
Updating the 006 guide with CircuitPython/Python usage.
are you putting together a Pi set up for general testing?
I will be, yes.
Well to continue the PyPI project we started and never finished.
Which means testing sensors on Pi with Blinka.
@tidal kiln
This PR adds dual channel DAC support to STM32 boards that support the feature, such as the STM32F405 found on the Pyboard and Feather F405. Both channels can be used simultaneously.
@tannewt let me know if you'd like me to add a struct in here that tracks whether each channel is on, and de-inits the clock if both are turned off. I haven't seen a lot of meta-level tracking of what features are on or off on the common-hal layer so I wanted to check if you thought that was a good idea style...
the t cobbler is good. and then also get one of these:
https://www.adafruit.com/product/942
makes for a nice tidy pi testing setup
ahhhhh ok
@meager fog DAC PR ready to test as soon as CI is done
@tidal kiln Kind of like the plate like that for the Metros?
No. Simply tested in general.
Can you still mount a Pi 4 on that plate? Have you tried?
yep. they also standardized the mounting hole pattern. somewhere around B+?
Ah nice ok
what's the code to test with TMP006?
or hold on
Here's the guide page: https://learn.adafruit.com/infrared-thermopile-sensor-breakout/python-circuitpython?preview_token=pMqVehZfPPzrMDYA2gHjFA
I made the REPL test simpler
But the simpletest.py is probably best
@ionic elk nice, the 405 has 2 dacs
@ionic elk did you get storage included as a module?
Yes, I sorted out all the modules that should be included with every board last week
awesome! plz ping me whe its ready to test
im gonna send the feather 405 out for fab soon
did you find anything you want fixed/adjusted?
I don't think I have any input besides moving the SWD header slightly. It's pretty nice the way it is
@idle owl sorta worked. got a few random i2c comm errors on temperature read:
OSError: [Errno 121] Remote I/O error
investigating...
yay. must've just been wiring and/or breadboard.
re-did the setup and it's working fine now
pi@raspberrypi:~ $ python3 tmp006_simpletest.py
Object temperature: 26.025*C / 78.845*F
Object temperature: 26.139*C / 79.051*F
Object temperature: 26.390*C / 79.502*F
Object temperature: 26.958*C / 80.524*F
and via REPL:
pi@raspberrypi:~ $ python3
Python 3.7.3 (default, Apr 3 2019, 05:39:12)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import board
>>> import busio
>>> import adafruit_tmp006
>>> i2c = busio.I2C(board.SCL, board.SDA)
>>> sensor = adafruit_tmp006.TMP006(i2c)
>>> sensor.temperature
26.47104378525455
>>> sensor.temperature
26.402765856877352
>>> sensor.temperature
26.266072340923756
>>> sensor.temperature
26.2762707720172
>>> sensor.temperature
26.25347433579782
>>> sensor.temperature
26.116588253247926
>>> sensor.temperature
26.207866122041878
@idle owl โฌ
@tidal kiln Thank you so much!
np
@ladyada builds are failing due to obnoxious include issue with other ports, but they shouldn't prevent testing, so here's a binary.
firmware.bin.zip
@meager fog give that attached binary a shot when you have a minute.
@ionic elk will do, gotta get a TFT going ๐
Ok, so the build is failing because the ST hal doesn't include empty defines for boards that don't support the DAC, like the F412 and F411. However, since there's no way to exclude the Analogio module specifically without also excluding analogin, I'm forced to add ugly #if defined(HAS_DAC) statements around everything.
If there's a more elegant way to not included the entire incompatible AnalogOut module, please let me know.
i know that nrf52 has analogin but not analogout (it uses PWM out instead) so check that out!
@ladyada well, in the NRF case, there's no files to include at all. For the Atmel case, it seems like you can have the DAC not be "available" on some chips, but the macros and structs are still defined, they just don't do anything. So I think this is the first time this has come up.
The problem is that "stm32f4" is kind of not sufficiently fine-grained. We do have similar #if or #ifdef stuff to differentiate between SAMD21 and SAMD51 in the atmel-samd common-hal. So this is not unprecedented.
If you want to make it a little neater you could do something like:
#ifdef HAS_DAC
void common_hal_analogio_analogout_construct(analogio_analogout_obj_t* self,
const mcu_pin_obj_t *pin) {
// regular impl
}
#else
void common_hal_analogio_analogout...
Thanks @idle owl I'll look at the learning guide and let you know if I get stuck along the way.
@hexed pawn Do you need the link? Also let me take a look at it quickly and make sure there aren't any caveats. It has been updated piecemeal along the way but we may have missed something.
@hexed pawn This is the most important page at the moment for you and it appears to be updated. https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/creating-a-library
Heh I was just looking for this guide myself.
@dhalbert I can make HAS_DAC 1 or 0, I agree that's more clear.
I guess there's nothing particularly wrong or unusual about having to use the preprocessor to reformat the file into a stub, but it just seems like this is something that ought to be handled further up the chain. Not exactly a high priority though.
@ionic elk ok i am floating back to this now
so
should i wait for a new bin
or use the one u attached
okidoke
@ionic elk hmm testing ...
isnt working?
oh wait no it is
ignore me
lol
@ionic elk tested!
from analogio import AnalogOut
analog0 = AnalogOut(board.A0)
analog1 = AnalogOut(board.A1)
while True:
# Count up from 0 to 65535, with 64 increment
# which ends up corresponding to the DAC's 10-bit range
for i in range(0, 65535, 64):
analog0.value = i
analog1.value = 65535-i
Welcome @ivory yew and @swift arrow to CircuitPythonistas! We're super happy to have you!
lol @ivory yew that's awesome
I'm just super stoked that it comes with a purple username.
Right?
@tidal kiln and @ivory yew it worked!!!! my new PR worked in one try!
So much time and energy wasted doing it the wrong way.. gitdesktop for the win!