#circuitpython-dev
1 messages Β· Page 189 of 1
@onyx hinge i think this is where you may want to look: https://github.com/adafruit/samd-peripherals/blob/master/samd/clocks.c#L61
as well as reset_clocks() below it.
thanks everyone!!! keep making Mondays awesome! π
Ctrl-C raises an interrupt in 2.x and 3.0.0, so this is something that has changed in master only recently.
Adafruit CircuitPython 2.3.1 on 2018-05-07; Adafruit Metro M0 Express with samd21g18
>>> import time
>>> time.sleep(10)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyboardInterrupt:
>>>
Adafruit CircuitPython 3.0.0 on 2018-07-09; Adafruit Metro M0 Express with samd21g18
>>> import time
>>> time.sleep(10)
Traceback (most recent ca...
Thanks!
π
thanx everyone for "making it" π
how many candles though???
All.
"By the grace of all the candles!!" π
Scooby Doo font?
off to "toil"; island life is rough. π later taters! π
we dont have a driver for this in arduino - it isnt really drivery cause you only send two bytes. but we could driverify if you think its necessary
I think it would make sense to wrap the original i2c object into a class that will automatically switch between the multiplexed buses when you try to use it (when you acquire the lock). This way it would be practically transparent to all other drivers.
Ok, I see that the pending exception isn't stuck either on a 3.x I have. The next time.sleep works just fine.
Bye!
anyone know if this https://circuitpython.readthedocs.io/en/latest/shared-bindings/pulseio/PWMOut.html is all you need for PWM? It's sending the frequency but the pin is low.
ok never-mind, i figured it out. The level shifter isn't working
How would you setup the association of the connected devices with their channels?
you'd have it generate a special I2C device-like object that would sneak in the commands for ya
So the Ctrl-C problem is of recent origin: #1092
Back to flash overflow. The Hallowing builds now, but these don't:
circuit_playground_express
region `FLASH' overflowed by 320 bytes
circuit_playground_express_crickit
region `FLASH' overflowed by 984 bytes
feather_m0_express_crickit
region `FLASH' overflowed by 556 bytes
@tannewt suggested a SPECIALTY_BOARD macro to turn off i2cslave #if BOARD_FLASH_SIZE > 192000.
@dhalbert suggested a ```CIRCUITPY_I2CSLA...
One question is whether someone who needs I2C slave is savvy enough to know how to do builds. Are you thinking of an SPI slave also?
If we turn it on in general, I'd turn it on for the general purpose Express boards and all M4 boards (but I know it's not implemented there yet). Leave it off for the non-express boards and turn it off for CPX and the *_crickit builds, since they have a lot of frozen code and their users are less likely to need this feature. So it would be #ifdef-guarded an...
<@&356864093652516868> Here is the recording from today's meeting. Thanks! https://youtu.be/kqatrTdt_lY
Notes with time codes are available here: https://gist.github.com/tannewt/941375d5452510e3263502e3650b2391 Thanks to @kattni for taking notes! Join here for ...
The drivers all take in an I2C object and then use adafruit_bus_device.i2c_device internally. So we can't pass in a different I2CDevice. I think I see what @deshipu is saying - derive from I2C and override try_lock() to sneak in the channel switching commands. That would get called each time the driver uses a context manager for I2CDevice, here:
https://github.com/adafruit/Adafruit_CircuitPython_BusDevice/blob/master/adafruit_bus_device/i2c_device.py#L105
Are you thinking of an SPI slave also?
No.
The reason I'm doing I2CSlave is so I can emulate an RTC (ds1307) and PMIC (axp209) for use with a Raspberry Pi. The Pi lacks a clock and a power controller.
It will also give the Pi access to an ADC (which it doesn't have) that I might use with a light sensor to control display brightness.
I do this far too often:
# make BOARD=circuitpython_express
Makefile:9: *** Invalid BOARD specified. Stop.
Maybe we need a CyPyX board that's shaped like Blinka.
With more LEDs π
@ruby atlas have you seen the one @stuck elbow made?
not sure if this is latest or not...
https://hackaday.io/project/27579-blinka
I was thinking a lot larger - bigger even than the CPX.
I have the svg files if you want to give it a go
@raven canopy We have an update to .pylintrc we need deployed globally. Ping me when you're around.
Is this good place for me to ask a couple of questions about Circuit Python?
@ruby oyster It's the perfect place to ask
Yay!
Thanks! I'm having a hard time working out the status of low-power sleep. I'm working on a battery-powered WiFi data logger based on the Feather HUZZAH 8266. It's draining power pretty quickly, and I started thinking that time.sleep may be spinning the CPU. The Circuit Python source seems to indicate that it is, but I was having a hard time following it.
Do you know if time.sleep() currently goes into a power-saving mode? I got down to https://github.com/adafruit/circuitpython/blob/master/ports/esp8266/esp_mphal.c#L49 , and never saw it schedule an interrupt based on the time, so I'm guessing that it's just spinning the CPU. Some forum posts seemed to indicate that it's on the roadmap (at least for the SAMD ports) but not there. But things move fast, so I may have missed something.
A parallel question: is there a way on Cortex M0 or M4 based boards to inhibit the CIRCUITPY drive based on logic? In other words, (for instance) it doesn't show up unless the user is holding down a GPIO button while resetting, or until they issue a particular command on the serial REPL, or something like that?
@ruby oyster Someone with a better knowledge of the actual code of Circuit Python would be better able to answer these, but as far as I'm aware, there's no low-power sleep included in the time.sleep() function.
Additionally, I seem to remember the CIRCUITPY drive having to be visible for some reason or another. I'm not 100% sure on that, but currently there's no way to really hide it
Gotcha, thanks. I might try setting a timer interrupt and sleeping the CPU (I can't find the API for that right now, but I've got it in one of these browser tabs).
Are MicroPython and CircuitPython working towards convergence?
Sorry if that's a sore topic; I just don't know why they forked.
I couldn't tell you the exact reasons, but MP and CP in general forked for different design visions.
Adafruit wants CP to be beginner friendly. To that end, they've done significant overhauling of how MP originally did things.
In the same vein, there's zero animosity between the two.
CP will occasionally take new things from MP, and MP will occasionally take things from CP.
As far as I'm aware there are no plans for convergence.
But, that said, there have been some efforts that I recall of people trying to make libraries for one work on the other and vice versa
Ok. These days, I often tend to look at the MP docs and source while working on CP programs, and wanted to make sure that's not likely to bite me with API divergence at some point. For instance, the ESP8266 networking API seems to work the same, but is only documented in MP (and the CP docs at https://circuitpython.readthedocs.io/en/latest/ports/esp8266/README.html point me to the MP docs). I'm glad to hear there's cooperation between the projects.
Thanks for your help!
The only reason ESP8266 is supported at all is because it was supported on MP. Similarly, the only reason it's wifi works is due to MP
@ruby oyster One of our community members, @bronze geyser, has been working on something similar.
@idle owl Similar to what? Sorry, the topics have diverged a bit.
Apologies. The sleep/interrupt bit. https://github.com/BitKnitting/wakey_circuitpython/wiki
Ah, gotcha. Yeah, I saw that in the channel pins after I asked the question. π
I don't know if that fits what you're looking for or not, or if it'll give you a way to get started, but it's out there π
Thanks! That's for the SAMD ports, and I'm actually focused on power only for the 8266 port at the moment. I had assumed that since the 8266 ports are based on RTOS, that they wouldn't work well with the interrupt management designed for the SAMD ports, but I don't know enough of the internals to speak to that. I'll look at it more closely!
For the project I'm working on, I ended up using a few different designs for the probes: one uses a micro breadboard with a Trinket M0 plus sensors and a display, another uses a Feather M0 Express with sensors on the protoboard space on the board but no display, and the third one is based on the 8266 and is the only one that can operate without a USB connection. (This is for real-time reporting, so it needs either a USB connection or networking.) I used Circuit Python so that my friends can tinker with the code easily.
If there's a place for it, I'd be happy to do a little writeup on the project, design, and implementation experience; would that be a good post for the community?
@ruby oyster They post those sorts of things on the blog quite often!
Ok. I'll probably do a writeup on hackaday.io sometime soon then.
Thanks again for all your help!
@ruby oyster Keep us posted!
I2S Breakout Test: Just completed the I2S test using the I2S Stereo Decoder - UDA1334A Breakout, CPy 3.0.0, and a Feather M0 Express using a modified version of the learning guide's example code. Confirmed that via AudioOut, the input values are indeed signed with a min of -32767 and a max of +32767 around a baseline of 0. The data simply wraps if the value goes outside of that range rather than clipping (as it should). Playing all zeros (the baseline) through a RawSample array pr...
@idle owl π
@raven canopy Hey π
We want to add under [TYPECHECK] to ignored-modules: . We need to add board. I'm going to upload an updated copy of .pylintrc so you can see it
The new PyPi setup is causing pylint to load the board settings from Adafruit Blinka which doesn't have the normal CircuitPython pins in it, so it thinks a lot of pins don't exist. We add that there and it resolves the issue.
I'm adding it as I go to the ones that require it simply to move my process along, but we'd like to add it globally.
k. you can create the patch file for pylintrc in any local repo using git format-patch -1 (that's a dash one). -n will use the n last commits for the patch file. you can also set an output location filename using -o <path/filename>. you can also use a commit SHA, which I think is just appended after any flags.
You're stretching my brain capabilities for the night π
i blame PyPI. π
The commits are all mushed together with PyPi setup
as in a single commit for all of it, unfortunately
ahh...that might make things a little hairy. probably best to do it on a fresh one, then create the patch file on that one.
with this upcoming PR, i'm going to expand on the patch script usage. it's "light" at the moment.
Well if you're feeling sassy, feel free to deploy the updated pylintrc somewhere in there.
π i might be able to pull that off.
Either way I'm off for the night. Hopefully my brain will recongeal for another day in PyPiland. π
π€ "Never let 'em see you sweat" - Someone
Hi (this is my first message here so nice to meet you), is anybody already working on the internalization for Spanish? i would like to help if possible.
Anybody know if there's something like numpy's random.choice function that'll work in CircuitPython?
(I had a look at the circuit python's readthedocs.io page, and didn't see anything relating to numpy.)
@granite crow Hey Carl0s!
Happy first message!
o/ @opaque thicket
So I'm just curious - no affiliation with Adafruit, but what do you mean by "internalization" for Spanish?
So i'm listening today's weekly recording and heard about a request for help to translate strings in Circuitpython.
Oh nice!
I think so, but i don't know if there's a lot of people from latinoamerica.
Ah! My bad. Please add the comment above then it should be good to go. Thanks!
I'd have the TCA9548A take in a busio.I2C-like object and have a channel list of busio.I2C-like objects. That way I2CDevice will never know the difference.
@dhalbert I wonder if its worth adding a grep over the map file to ensure its not added again. Thanks for catching it!
@notro I'm fine with CIRCUITPY_I2CSLAVE.
If I've got multiple audio samples I want to play on my itsy bitsy, and I want to cycle through them all one-after-the-other, do I need to manage their playback, or does circuitpython manage that automatically?
i.e. If I have audio playing, do I need to force my program to wait on executing the next line until the sample's completed?
Hi,
My name is Carlos and i will be working on the internationalization of strings for the Spanish language, this is my first contribution so bear with me, any help is welcome!
First of all, my apologies if I'm not supposed to post this here, but I understand that https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/i2c-sensors-and-devices is suggesting me to open an issue if a library isn't up on PyPI.
So I'm trying to connect a SHT31-D temperature and humidity sensor to a Raspberry Pi 3 model B+ and I can't find the Adafruit_CircuitPython_SHT31D library https://github.com/adafruit/Adafruit_CircuitPython_SHT31D on PyPI.
I would be grateful if you cou...
We're working on getting all the libraries into PyPi right now. This one
will be added soon.
On Tue, Aug 7, 2018, 08:25 SpitfireMk notifications@github.com wrote:
First of all, my apologies if I'm not supposed to post this here, but I
understand that
https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/i2c-sensors-and-devices
is suggesting me to open an issue if a library isn't up on PyPI.So I'm trying to connect a SHT31-D temperature and humidity sensor to a
Raspb...
@granite crow No one's working on it yet! That's where we wanted to start but we hadn't found a native speaker yet to help.
@opaque thicket I don't know what random.choice does. So I'm not sure if there's an equivalent. We do have random though I'm also not sure of the scope of it.
@opaque thicket CP's random has choice:
Adafruit CircuitPython 3.0.0 on 2018-07-09; Adafruit CircuitPlayground Express with samd21g18
>>> import random
>>> dir(random)
['__name__', 'seed', 'getrandbits', 'randrange', 'randint', 'choice', 'random', 'uniform']
>>> colors = ["red", "green", "blue"]
>>> random.choice(colors)
'green'
>>>
Thanks @tidal kiln
@opaque thicket audioio.AudioOut.play() is non blocking:
https://circuitpython.readthedocs.io/en/3.x/shared-bindings/audioio/AudioOut.html#audioio.AudioOut.play
so you will need to manage waiting in your code, for that, you probably want to use playing:
https://circuitpython.readthedocs.io/en/3.x/shared-bindings/audioio/AudioOut.html#audioio.AudioOut.playing
Something more like this?
import board, busio
import some_i2c_sensor
import adafruit_tca9548A
i2c = busio.I2C(board.SCL, board.SDA)
tca = adafruit_tca9548A.TCA9548A(i2c)
# still not sure of best way to provide per channel access
# sensor1 = some_i2c_sensor.Sensor(tca[0])
# sensor1 = some_i2c_sensor.Sensor(tca.chan[0])
# or...?
sensor1 = some_i2c_sensor.Sensor(tca.chan0)
sensor2 = some_i2c_sensor.Sensor(tca.chan1)
sensor3 = some_i2c_sensor.Sensor(tca.chan2)
Hmm. So this repo https://github.com/adafruit/Adafruit_CircuitPython_SHT31D includes the D in the name, however the driver file itself https://github.com/adafruit/Adafruit_CircuitPython_SHT31D/blob/master/adafruit_sht31.py does not. Worth renaming? No screenshots will be affected, only a few code snippets and the example.
It confused me because the folder in the lib bundle for it is sht31 but most other references to it have the d/D on the end.
looks like the decoder ring for the product part number goes something like:
SHT3x-yyy-c
x: 0=low-cost, 1=standard, 5=high-end
yyy: ARP=analog, DIS=digital
c: B=bare, F=filter membrane, P=protective cover
PID2857 looks like it uses a SHT31-DIS-F
a driver doesn't care about x or c , and DIS would be the only option you'd even write a driver for in the first place
if we wanted to generlize it, maybe call it sht3x? but i'd say just go with sht31d to match product description.
@idle owl ^^ my 2 cents
@slender iron Opinion on renaming the driver file in SHT31D?
renaming is fine with me @idle owl . just do a major version bump since it'll break code
Exactly. That was the plan. Thanks
Hey all, why does this code i run in boot.py crash CircuitPython and send it to safe mode on my adalogger? ```import os
if 'storage' not in os.listdir('/'):
os.mkdir('storage')
if 'work-areas' not in os.listdir('/storage'):
os.mkdir('/storage/work-areas') ```
ok this fails , this is why os.mkdir('storage')
is there a documented example on how to write to the SD card?
yep! of course there is .. this is adafruit after all https://learn.adafruit.com/micropython-hardware-sd-cards?view=all
thanks @rotund basin !!
There's also this, @rotund basin: https://learn.adafruit.com/data-logging-with-feather-and-circuitpython/circuitpython-code
There's more to that example, but it might help anyway.
thank you much @idle owl !!
@tidal kiln The class in the driver is called SHT31. Should I add the D to that as well?
I don't know what else that changes in the driver though. If it changes anything. Like does this come from the class name or an internal default address: python def __init__(self, i2c_bus, address=SHT31_DEFAULT_ADDR):
i'd say so. sounds like you got OK to break things. so go ahead, makes it more consistent.
are you changing the filename also?
that was the initial plan yes
you can simply change the class name
ok keen
old:
import adafruit_sht31
sensor = adafruit_sht31.SHT31(i2c)
new:
import adafruit_sht31d
sensor = adafruit_sht31d.SHT31D(i2c)
Correct.
yep. as simple as changing file name and class name.
and then updating all the docs, examples, guides, etc. π
It's not as bad as it sounds. I researched it first π
i wouldn't worry about the constants being name SHT31_blahblah
that's under the hood stuff, i'd just leave them as is
@tidal kiln Once Travis passes if you could take a look at the PR that would be great.
(if you don't have time or whatever let me know)
done and done
Beautiful, thank you!
Wow Learn caches hard... The example filename changed, so I changed it on Learn, and it's currently displaying the old file still.
Β―_(γ)_/Β―
It'll update eventually.
That went really well.
Everything seems to have updated.
Now to see if it passes and deploys to PyPi. I'm betting on an error. π
Giant release done.
Ooh fun, I was wrong. It worked π
@SpitfireMk The guides and documentation haven't been updated yet, but SHT31D has been added to PyPi and should be ready for you to use.
new to circuitpython, enjoying the initial experience but 4 questions: 1. interrupt support/examples? 2. faster than 115.2kbps USB comms? 3. timer support/examples 4. is this intended to be a general purpose micro-controller platform or is it targeting a education/simple application niche?
- no 2. yes (baud rate is actually ignored) 3. depends on what you want to do 4. beginner focused
M0 Express DAC Test: Yes, ramping up to the midpoint level did help to quiet the initial pop sound when a RawSample array was played.
When AudioOut was first instantiated, it appeared that the DAC output remained at its previous value; 0 after a board reset or some other value based upon previous playback. If the DAC value was slowly increased to the mid-point value of 2^15 (over 30 ms) before AudioOut was instantiated, the initial pop sound was minimized when first executing `Pl...
Is it possible to run code from the SD card ?
All done testing I2S and DAC AudioOut (I think). The objective is to eliminate as much of the start/stop pop sound as possible. It's characterized now -- I'm just not skilled enough software-wise to fix it. Where does it need soldering? π π
tannewt: so if I need interrupts for lots of peripherals Arduino is the option?
Test the timings a reference PWM output because CPU clock isn't perfect.
import neopixel_write
import digitalio
import time
import board
import pulseio
pwm = pulseio.PWMOut(board.D10)
pwm.duty_cycle = 2 ** 15
pin = digitalio.DigitalInOut(board.D12)
pin.direction=digitalio.Direction.OUTPUT
pixel_off=bytearray([0,0,0,0])
pixel_on=bytearray([0,255,0,0])
while True:
neopixel_write.neopixel_write(pin,pixel_off)
time.sleep(1)
neopixel_write.neopixel_write...
Sphinx builds fine locally on this one, fails miserably remotely.
@woeful dawn yeah, for time-sensitive/interrupt-driven operations you'll have a better experience with Arduino.
To add a string in the code to the list of translations #include "supervisor/shared/translate.h", wrap it in translate(), and run make translate.
To build with a specific translation provide TRANSLATION to make. For example:
make -j3 BOARD=trinket_m0 TRANSLATION=es
To start a new translation copy locale/circuitpython.pot to locale/<language code>.po where <language code> is an IETF language tag with underscores betwee...
Quick followup to let you know how things went with my time.sleep power consumption question yesterday: I ended up using the deepsleep mode based on the recipe at https://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/powerctrl.html (I only needed to sleep between samples), and it worked great. That recipe is not a drop-in replacement for time.sleep, since it resets the program, but it may really be helpful for bringing power consumption down.
Also: I'm using MP's umqtt client to talk to io.adafruit.com. It might be nice if we could port that to CP, and bring the io.adafruit.com and CircuitPython universes closer; it only required a few library renames. Should I just write the port and send a pull request to adafruit/circuitpython, or what?
@rotund basin yes, you can run code from an sdcard. See https://learn.adafruit.com/micropython-hardware-sd-cards?view=all#code-storage-on-sd-card. Beware that if you are using an SPI device, you have to share the device with the sdcard.
Ok I don't get it. I have a number of essentially identical sphinx setups, one errors with the following, the others don't. /Users/kattni/repos/Adafruit_CircuitPython_Bundle/libraries/helpers/featherwing/docs/index.rst:17: WARNING: toctree contains reference to document 'api' that doesn't have a title: no link will be generated
Getting the warning remotely as well, it's failing to generate and Travis is failing. The build succeeds locally with the warning.
Remote error: Warning, treated as error: /home/travis/build/adafruit/Adafruit_CircuitPython_FeatherWing/docs/index.rst:17:toctree contains reference to document 'api' that doesn't have a title: no link will be generated
I could give api.rst a title, but none of the rest have titles, so that doesn't seem right. It gets rid of the warning locally if I do that though. But It doesn't explain why it's fine on the others.
@solar whale You tagged the wrong Mike. You're looking for @rotund basin I believe.
@idle owl thanks. Fixed
@solar whale thanks and @idle owl thank you much! The SPI can use a CS ... but if I have an ESP that is connected via SPI to the M0 adalogger ... and I want bidirectional communication .... do I have to use an interrupt to turn each into a master or slave? or will they buffer ?
@rotund basin Iβm not sure I understand the question . You can have multiple SPI devices .
@solar whale i want to send data ESP32 <---> Adalogger via SPI bus
they have to take turns being master, right?
so will they internally buffer the received data ?
or , if they don't listen they don't receive ...
Sorry. Iβm still confused. Iβve never used 2 masters.
it's cool. I guess they will have to play switch π
Ok done banging my head against this for the day. No idea why it's failing.
@idle owl have a good night. Itβll wait!
where can I whine about mu install errors? - looks like this one from june that is:
"... In the meantime I'll try to work out what the latest version of PyQt has broken. :-/"
Will wait for Jerry to test, if he has time.
@dhalbert Sorry, I may not be able to test it for a week or so.
Hi @idle owl , sorry for the late reply. I'm getting familiar with the po files and reading a link tannewt sent me.
@tidal kiln sorry for the slow reply. Yes, thank you. Of course now everything seems so obvious π
@granite crow No apologies needed! I'm glad you're getting started!
@idle owl I've gotten that error a couple times, but can't envision what it was. got a link to the repo? (or...i might just try and find it on Travis...)
@raven canopy I get it all the time, but it never halts the build. It's suddenly treating it as an error for some reason
there's a whisper in my brain that its actually caused by automock...but its just a whisper. π€
Well hmph. Because that one won't build without automock. It fails SPECTACULARLY without it. Cascade failures of progressively large size.
hehe. yeah, helps to look at the PR...not master. π
I don't think shared is needed, but without adafruit_featherwing it completely buggers itself on the shared I2C module.
Ok removed shared to test it.
I don't think that's the issue, but if it doesn't need to be there, I should remove it anyway.
Same failure, looks like I was right shared wasn't needed because that's not where it fails if the automock isn't right. So, still same error.
hmm...
I tried suppress_warnings but I don't think this one is included, the closest I could find was ref.doc and it's still giving the warning locally. So I don't think I can suppress that one. Not that that's a good plan anyway but it was worth trying.
if there was an easy way to search PR comments, i could dig up my past run-ins with this... argh. :pirate:
did you see my comment on the seesaw typo for the intersphinx mapping?
No but I already found it and fixed it
π
Good morning folks! What are my options for troubleshooting: building latest for a board with external flash, W25Q32BV (board defininition Trinket M0 Haxpress + W25Q32BV). CIRCUITPY does not show up, I'm able to get it to work with an older 2.0x build ...
What might be the reason that CP (3.0.0 2018-07-09 on Feather M4 Express) sometimes doesn't see/load the contents of a file that is included. It's in the root of CIRCUITPY alongside code.py. Typically it won't load the contents until the OS does its soft restart thing randomly (Linux).
@teal bear I think this is the current state of things:
https://github.com/mu-editor/mu/issues/575#issuecomment-408415209
it's also where you can provide feedback or info on what's happening in your situation.
@umbral dagger are you sure the file is there? there are some quirks with various buffered/delayed file writes with various file manager UI's. i've also gotten in the habit of adding ; sync to everything i do on the CLI
Hmm.. could be. I'll add a sync to my cp commands
@tidal kiln - thanks - the issue I found was closed. this one is still open and active and out of their hands so . um. thanks again.
@umbral dagger - yeah, sync is what you want, because what Linux says is on the disk includes what has not yet been written.
@ruby oyster Help with that would be welcome! The trickiest part is ensuring the APIs match a normal CPython API where possible
any chance Circuit python supports ESPNOW on ESP32 ?
@rotund basin CircuitPython does not support ESP32 at this time.
@solar whale thanks!
@rotund basin FYI - there is support under micropython -- your mileamge may vary ;-) https://github.com/micropython/micropython-esp32/issues/197
ESP-Now offers a low-level adhoc network over 802.11 frames ... make this available from a nice MicroPython API. Refs: http://espressif.com/sites/default/files/documentation/esp-now_user_guide_en.p...
@solar whale thanks!
@Thomasinator could you test a new build from here: https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/itsybitsy_m4_express/ Its commit 2e80.
Oh we never did the rest of the process with TMP007. @solar whale @slender iron Is it ready to go for addition to the bundle, travis and RTD etc?
Closer! You can have an internal class with __getitem__ that creates the channel objects on demand and caches them. It'd be sensor1 = some_i2c_sensor.Sensor(tca.channel[0]).
just noticed there's no raspberry pi emote π¦
@idle owl think so
Ok keen.
thanks!
@slender iron Is the reason to run Adabot in this process to create the environment variable? As in, if I create it manually, do I need to run Adabot for any other reason?
nope. I don't think so
Thanks
np. errand time. gotta get kitty fuel
@idle owl FeatherWing Travis woes are killing me. I can't see anything that doesn't comparably pass elsewhere.... π¦
vacation is almost over. i needed to take off the rose-colored glasses at some point. π
How do i tell which version of the Adafruit_TSL2561 driver is being distributed with the most recent 3.0.0 driver release package?
The reason I need it is that I need to get the right .py file to update so I can do address select for multiple lux sensors.
@red dock you can probably look at the commit on the submodule in the circuitpython bundle...
tsl2561 @ 43e7a87
@solar whale What were you using to test STMPE610? You wrote that right?
@raven canopy Oh man, sorry to be the source of the buzzkill. Figures it's Travis that would bring you down. π
@red dock The same version is distributed with both, it's how the .mpy files are created that matters for 3.x vs 2.x. If you download the .py bundle, you'll get the .py file for it and you can use that.
@idle owl . The stmpe610 breakout with a screen attached or the 2.4 inch TFT
@solar whale ok, I was hoping there was something I was missing and that it wasn't one of those options. That there was a breakout that worked π
@idle owl Ok, so what do I do different to create my .mpy differently with 3.x?
Build mpy-cross with the 3.0 build of CircuitPython and then use it on your file.
@idle owl whats the problem?
@red dock No, download the mpy-cross for your OS that's on the 3.x release of CircuitPython. We already built them.
@solar whale We're PyPi-ing everything, so everything needs to be tested with RPi and I was hoping there was something simpler. Will the breakout and that resistive touch screen overlay thing in the store work for testing?
Yes. Just a sec. Iβll confirm PID s
3575 + 333 + 1571 TFT was 3315
Oh that uses the STMPE610?
Yes. 3315 has stmpe610 in it. But only via SPI. The board does SPI and i2c
Youβre welcome. Sorry I canβt help now.
No apologies needed, that's exactly the help I needed π
I'll try to test it the next few days
@hollow snow I don't know if you ever got your issues worked out with the touch screen and the Adafruit_tsl2561 driver, but if not, I did, and it was because I was using a tsl driver that was on the old 2.3.1 build, and my feather M4 came preloaded with 3.0.0. So as soon as I updated my driver libraries, poof! Fixed it.
@idle owl if you donβt get to it in the next 10 days Iβll be happy to.
@solar whale I'll keep that in mind. Hopefully we're done by then though. π
Hi!! Thank you for wanting to help translate CircuitPython! We're hoping to translate the supervisor messages like Press any key to enter the REPL. Use CTRL-D to reload., and error messages like Microphone startup delay must be in range 0.0 to 1.0. We're not translating any Python keywords.
First, please check to see if there is an existing translation for your language exists here.
If the file doesn't exist, then check...
is there a tut or code for hooking a pot up to the CPX?
" left pin to ground, the middle pin to A1, and the right pin to 3V." bingo. I knew it would be easy
someone at PS1 wants a metronome
here is what I came up with to keep the beat consistent regardless of how long the ... um.. IO operations take
is there s simpler way? threads come to mind, but not sure that is simpler :p
how do I get 3 separate LEDs to blink at different rates? (Feather M0 Express)
threads! lol
@stoic marsh - threads may be the best answer, but I have never done threads anywhere... so ... plan B:
list of 3 times till next blink. while True: find the minimum, sleep, blink, +time.
Are there any circuit python libraries for the TFT display for displaying text? Or other graphics libraries? Every time I search for graphics libraries I keep getting Arduino results, and I'm really trying to keep this a circuitpython project
I'm using a 2.4" TFT Featherwing
@teal bear CP doesn't have threads, so your code looks fine.
I was wondering about that. thanks.
@stoic marsh don't use sleep, instead keep track of time and toggle LEDs on/off based on amount of time elapsed, with each LED having different amounts of time
(also the random function maybe)
@tidal kiln If you have a minute: https://github.com/adafruit/Adafruit_CircuitPython_Bundle/pull/87
@idle owl just wanting a merge?
Yep
done
Thanks much!
@stoic marsh ya, you may want to use time.monotonic() to keep track of the time since you last toggled an LED. it takes a few tries but once you've got it working, you'll be golden
@umbral dagger im gonna try and find a photo interrupter for the TT motor encoder
do you have measurements handy? i can measure it too but i figure you have it handy
like, assumingwe want to hot-glue or foam-tape it directly onto the tt motor
@idle owl The guide I'm working through says I need the framebuf module. So I go to that page, and it appears to have been last released with cp 2.0 compatibility. If I rebuild the source code with mpy-cross-3.x, will the result be compatible for cp 3.0, or could there be other issues with the module that cause problems for 3.0?
https://github.com/adafruit/micropython-adafruit-framebuf/releases
I think framebuf is built into CircuitPython.... Is it not working to simply import it?
The guide might be out of date.
@idle owl It was last updated Oct, 2017.
It says "Furthermore, CircuitPython for M0 boards after version 0.8.1 do not have the framebuf module built in to save flash space. So, please download and install the pure Python implementation of framebuf and copy it to lib folder of the board as well."
If this is incorrect, great.
>>> import framebuf
>>> dir(framebuf)
['__name__', 'FrameBuffer', 'FrameBuffer1', 'MVLSB', 'MONO_VLSB', 'RGB565', 'GS4_HMSB', 'MONO_HLSB', 'MONO_HMSB']
>>>```
@red dock It appears to be incorrect.
@meager fog I used super glue. less bulky that hotglue.
what m,easurements do you want? I think I sent you theDigikey product page for the one I'm playing with.
i guess if we can figure out one that will 'just work' with the depth/height
There's a datasheet on the product page.
i suppose you can move the encoder up an ddown
yes
we dont have seesaw/crickit code to handle encoders
but its something ive thought about ading
since there's so many IRQs on the samd21
you'd use two of the signal pins
This one has a gap of 3.6mm gap 8.8 long, 5.2 wide, and 7.8 tall
I'm using pulseio with it.
That'll give you number of pulses in a period of time as well as the widths, both can be used to guage rpm.
Or to get motor speeds synced.
@idle owl Ok, sweet! I will pass that info along to the page manager.
I've been playing with a single motor so far. Next will be to try with 2.
@red dock I'm about to work on a graphics revamp
@slender iron Awesome!!!!! The project I'm working on needs to have a simple graphics solution in the next few weeks. I found some stuff from tdicola, but it's pretty out dated.
https://github.com/adafruit/micropython-adafruit-bitmap-font
@slender iron Sure, and mine is a pretty simple one. I want to segment the display into probably 6 "buttons" or less with the ability to display text or shapes in the buttons. (Eg, an arrow, "next", "pass", "fail", etc.)
I feel like I'm on the verge of it being possible already, but I need a text/font library, at the bare minimum.
@slender iron I could also imagine a function that allowed someone to load images (icons, etc) from a file would also be useful.
@slender iron I don't need it for this project, but being able to have data entry would probably be useful for a lot of projects. If I were working on a brewery controller, I'd want to be able to input Temperature through the display for instance.
kk, good to know!
@red dock There is a VERSIONS.txt file in the lib directory in every bundle that lists all the versions. Also for any particular module, you can import it and then look at adafruit_somelibrary.__version__
@tannewt I've added source code comments at both changed sites, hopefully they provide good signposts for future contributors.
now it's time to read up about the samd51 frequency counter.
@onyx hinge Quality time!
https://learn.adafruit.com/circuit-playground-simple-simon/circuitpython-version following this on the circuit playground express, buttons dont do anything and i dont get a flashing green led
i am using a circuit playground express and mu to save the code
@raven canopy I can get my local build to fail on that error when I add the -W to the command. This still does not explain why every other repo builds successfully with that warning. But it's the -W in sphinx-build -E -W -b html . _build/html that's making it treat the warning as an error. So in theory I could remove the -W from .travis.yml and it would build. But that's not the way to fix it. No more tonight though.
ok i got it working, just it keeps flashing the code on and off instead of keeping it on
got it working, microusb to pc wasnt supplying enough power
Urrg. I just spent the last 6 hours trying to debug an issue with rosie and it turns out the problem was with ngrok.io the service I was using to set up a tunnel through my home firewall.
hola! I'm trying to figure out how to debug why I'm not seeing CIRCUITPY mount/show up with the latest 4.0.0-alpha-922-g9da79c880-dirty (also REPL doesn't load. The dotstar looks does the green fade) with a custom board that is schematically a Trinket M0 with SPI Flash .. I was able to make the same flash chip work with stable 2.0 -
I have a different board with a different flash chip and got it working (so I think I'm doing the board definitions correctly) - and can verify that the hardware works, flashing it with the 2.0 build I have displays CIRCUITPY + all functionality
I did some measurements, the frequency is now 632 kHz for sending an OFF (0,0,0,0) to a pixel and 700 kHz for sending full ON (255,255,255,255). The example with green blinking is working for the ring but not for the strip. To supress the positiv/negativ spikes i use a 150ohm series resistor, the signal is clear as of a 3,3V digital output pin but with the 5v level.
Here the measured timing and the deviations to the datasheet timings
WS2812 SK2812
T0H 480ns + 80ns ...
@indigo wedge @tulip sleet adding the S132 & S140 6.1.0. The S132 2.0.1 API is old, and it is a pain to maintain driver that support both old & new SD API. https://github.com/adafruit/circuitpython/blob/master/ports/nrf/drivers/bluetooth/bluetooth_common.mk#L5
with lots of #if https://github.com/adafruit/circuitpython/blob/master/ports/nrf/drivers/bluetooth/ble_drv.c#L164 Should we remove the old API version, and have everyone up to date
@gentle bronze it was @slender iron s suggestion to leave the old api
I wanted to ditch it too
Right now we have 3 versions and it kinda sucks
I'm back from vacation next week if you can wait, we could discuss
yeah, starting from SD v5, there is major API break since Nordic implement the BLE 5.0 specs. All the call parameters have changed
Ok, I will just update the S140 then. Luckily our ble driver is still in manageable size π
@gentle bronze @indigo wedge Did @slender iron mention a reason to keep the old one? Is there any issue with '832 vs '840? I'd think it'd be ok to drop it, but we can wait for @slender iron to comment later today.
I think it's because 2.0 is smaller so nrf52832 has more flash left when using that one
Oh actually @gentle bronze could we delay that discussion cause I just remembered I have a big BLE rewrite waiting to be finished and reviewed when I come back :D
@tulip sleet @indigo wedge indeed the flash is a bit tight on the 832, maybe we should shrink the file system instead (currently is 100 KB).
@indigo wedge @gentle bronze @slender iron Here's the full set of size data:
nRF52832 has 512kB flash
size of S132 SoftDevices (info from release notes):
s132_nrf52_6.1.0
Flash: 152 kB (0x26000 bytes)
s132_nrf52_5.1.0
Flash: 140 kB (0x23000 bytes)
s132_nrf52_4.0.5
Flash: 124 kB (0x1F000 bytes)
s132_nrf52_3.0.0
Flash: 124 kB (0x1F000 bytes)
s132_nrf52_2.0.1
Flash: 112 kB (0x1C000 bytes)
memory map is detailed in linker file
GNU linker script for NRF52 w/ s132 5.0.0 SoftDevice
MEMORY MAP
------------------------------------------------------------------------
START ADDR END ADDR SIZE DESCRIPTION
---------- ---------- ------- -----------------------------------------
0x0007F000..0x0007FFFF ( 4KB) Bootloader Settings
0x0007E000..0x0007EFFF ( 4KB) Master Boot Record Params
0x00074000..0x0007DFFF ( 40KB) Serial + OTA Bootloader
0x00073000..0x00073FFF ( 4KB ) Private Config Data (Bonding, Keys, etc.)
0x00072000..0x00072FFF ( 4KB ) User NVM data
0x00059000..0x00071FFF ( 100KB) User Filesystem
0x00023000..0x00058FFF (216KB) Application Code
0x00001000..0x00022FFF (136KB) SoftDevice
0x00000000..0x00000FFF (4KB) Master Boot Record
too bad, I reserved too much spaces for the bootloader since I thought we may want to upgrade to secured bootlaoder later π¦
My feeling is that nRF52832 Feather is like Feather M0 Basic - sure it can run CPy in a limited way, but it's a stepping-stone device to a board with more adequate memory: Feather nRF52840 Express (with SPI flash). We live with 64kB filesystem on the M0 non-express boards. I'd rather not have two versions of the SoftDevice to support
yeah, the USB MSC make thing esaier to copy python lib, which 832 doesn't have. Maybe we could get away by shrinking the filesystem to 64KB or lower π
We have also trimmed features from the non-Express boards as necessary, and also compiling with -finline-limit=<n> has helped to trim those images by a few kB. Also Scott has done a bunch of work on flash space saving. The nRF image will only grow because we have to implement more missing functionality, but I think we can handle a smaller file system.
Version 4
- Import stdbool.h in lib/utils/interrupt_char.h
- Fix bug where Ctrl-C in I2CSlave.request() could result in raising OSError
- Avoid dragging in the double-precision floating point library (thanks @dhalbert)
- Use macro CIRCUITPY_I2CSLAVE to enable i2cslave
- i2cslave is enabled on: feather_m0_express, feather_m4_express, metro_m0_express and metro_m4_express
- Rebase on i18n
I have a problem with the MP_ETIMEDOUT value. I expect it to be 110 but it is 116:
This is the C code:
if (timeout_ms > 0) {
mp_raise_OSError(MP_ETIMEDOUT);
}
This is the result:
>>> slave.request(timeout=1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: 116
>>>
CPython value:
>>> errno.ETIMEDOUT
110
From py/mperrno.h (MICROPY_USE_INTERNAL_ERRNO is 0):
#if MICROPY_USE_INTERNAL_ERRNO
...
@tulip sleet Noted π
In arm-none-eabi/include/sys/errno.h in the toolchain errno.h defines ETIMEDOUT as 116. In Linux it's 110: /usr/include/libr/sflib/common/sftypes.h (which is included indirectly by errno.h, it appears). It's 116 in FreeRTOS and Android.
This already came up in https://github.com/micropython/micropython/issues/976. We could set MICROPY_USE_INTERNAL_ERRNO to (1)` in our ports. It is set to 0 by default but is set to 1 for st32, esp32, and cc3200. I'm not sure it matters as long a...
@gentle bronze @indigo wedge @tulip sleet Iβm fine with ditching the old sd. Iβd prefer it
Thanks @dhalbert, so it's a OS issue then.
Nice, I can integrate this into my ble rewrite
To prevent adding hex file each time we modify bootloader. Bootloader comes with pre-builtin hex for S140 6.1.0 and S132 6.1.0 for feather & pca10056
I don't think we should add any knowledge of the bootloader to CircuitPython. It's only used to provide convenience targets in the Makefile to flash the bootloader. Those targets should be removed. The documentation and Makefile in it's own repo is enough.
@indigo wedge when will we see your progress on it?
if anyone has time, can you test neopixels on the m4? https://github.com/adafruit/circuitpython/issues/1083
@slender iron I've been on vacation last two weeks but I'm back next week so hoping to have something week after next
k, do you have a branch I can snoop on?
Kinds, but it's not perfect, so can't show that to people :P
@tannewt the bootloader target in the makefile is to flash the bootloader on the device with jlink, or you are referring to other targets. Could you say the target name specifically.
Hmm, probably it is a bit confusing, I will update the readme a bit.
I've been looking at the simpleio docs and under simpleio.Servo, the purpose of microseconds_to_angle is not apparent to me. What use cases would require it?
@wraith tiger it's an arduino-ism (writeMicroseconds uses it), like map range
@indigo wedge its never perfect and its good to see the progress made
It's not obvious to me what to include.
lib/utils/interrupt_char.c
#include "py/obj.h"
#include "py/mpstate.h"
#if MICROPY_KBD_EXCEPTION
<snip>
// Check to see if we've been CTRL-C'ed by autoreload or the user.
bool mp_hal_is_interrupted(void) {
#ifdef MICROPY_VM_HOOK_LOOP
MICROPY_VM_HOOK_LOOP
#endif
return MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception));
}
#endif
ports/esp8266/mpconfigport.h
...
anyone know what the state of bluetooth support for circuitpython is?
@worthy sun currently not there, in work for the future
ok. thanks
@slender iron Am I good to close the PyPi issue? I'm done with that part of it.
110+ PRs later.
That I do. π
This has been completed on everything except CircuitPlayground Express cpx Express lib, and the Featherwing helper library. The Featherwing library I plan to revisit at some point. The structure of the library caused a number of issues that ended with Sphinx requiring an autodock_mock_import of adafruit_featherwing which meant that api.rst was no longer populated by the modules, which caused a build failure.
Otherwise, this is completed for all existing libraries and helper fun...
welp, just saw a python dht with async repo listed on google and was thinking "oh thats cool...but why", clicked thru and it was DHT as in Distributed Hash Tables not DHT-sensors
On FeatherWing I reverted all of the existing PyPi setup PRs because it breaks the docs. The half-PyPi'd version of it had been put into the bundle from a release I deleted - so I did an essentially pointless release to bump it back into the bundle the way it's supposed to be. I realise the functionality wasn't changed so it wasn't really an issue, but it was a mess I wanted to clear up.
kk
@idle owl congrats on finishing them!
Thanks!
also thanks!
You're welcome π
π
almost all the io basics guides are circuitpython-compatible with raspi as of rn, (finishing the last one now)
That's only half the story. Now there's 80+ guides to update.
woa - that's an undertaking. good luck!
we should archive old repos too
@slender iron What old repos?
the python drivers
I would like to know how to take some example Arduino code, and make it so that each animation of a neopixel can be called by pressing a button on the cpx. Would anyone be able to help with that? Sorry if this is in the wrong topic.
for help with Arduino I suppose #help-with-projects would be better
I mean, you would get more answers, probably
@stuck elbow thanks for that.
@slender iron They're not still valid?
they are redundant with the circuitpython versions
ah
there are definitely people still using some of them quite a bit.
it might be worth having a look at issues and PRs on the more popular ones to get people a bit of response before archiving?
"hey, we're actually deprecating this..."
ya, up to you
We recommend that you close all issues and pull requests, as well as update the README file and description, before you archive a repository.
^ that seems sensible.
any reason why there's no CP driver for this?
https://www.adafruit.com/product/364
I assume because no one's written it.
yah. just making sure. there's not even an issue entry for it.
@gusty kiln I feel like we're already not "actively maintaining" any of them anyway. There are PRs open on the first one I found from 2014.
Oi. That is going to be an involved process.
ya. more work now. less later
The first two I looked at have 7-10 each PRs and issues open dating back as far as 2014, and as recent as 6 days ago. The recent ones are install failures π I guess we'll know how to answer those.
it seems like good open source citizenship to at minimum udpate the readme with a deprecation notice and a pointer to the new lib.
@gusty kiln Agreed. I think trying to respond to every PR and issue though is a rabbit hole.
makes sense to me
PN532 NFC/RFID controller breakout board
https://www.adafruit.com/product/364
now there is
i wouldn't mind taking this on, but maybe we should file it for after we get the circuitpy libraries on a bit more solid footing.
(i.e., with the guides in place)
ya
Finish this project first. Then take on the next one.
yeah.
I'm willing to help with it too
cool. let's kinda circle back to it once our checklist of tested-on-pi libs and updated guides is basically done.
Sounds good.
π
OK, I've obtained a few more clues as to how simpleio's microseconds_to_angle works, but why does it use hard coded numbers instead of self.min_pulse and self.max_pulse?
Any left-over issues can be verified in the PyPi Progress spreadsheet.
There are a couple of repos left with badge issues.
- LSM9DS1 shows a build error, but the build is passing.
- CharLCD shows docs failing, they are, but they haven't triggered a new build on the new release which would fix the documentation issue.
Still needing to be added to PyPi:
- FeatherWing helper lib. The structure of the library caused a number of issues that ended with Sphinx requiring an `autodock_moc...
@idle owl I noticed what seems to be a typo in the CircuitPython essentials guide - second paragraph. second sentence, last word was probably supposed to be "pack" rather than "back".
@wraith tiger What page?
Opps, insert "under Servo Wiring" before second paragraph in my last statement.
You're welcome.
@wraith tiger I was keeping it in a range, don't remember why..was probably emulating the arduino impl at the time (maybe?). We could/should change it to take in keyword arguments as a range though.
Hello all, is this the right place to announce a PR?
specifically for circuitPython on the TSL2591
@prime flower Thanks for your responses. I went looking for more info on writeMicroseconds and found an interesting article: https://makezine.com/2014/04/23/arduinos-servo-library-angles-microseconds-and-optional-command-parameters/
It shows how someone was having problems that turned out to have to do with using default min and max vlues instead of specifying them.
Also https://www.arduino.cc/en/Reference/ServoWriteMicroseconds talks about the fact that not all servos follow the expected standards.
It looks to me that there is potentially the need to be able to fine tune that conversion to the parameters of a particular servo.
returning map_range(us, self.min_pulse, self.max_pulse, 0, 180) would allow for that, as the min & max have defaults defined n init.
Boot_out.txt contents:
Adafruit CircuitPython 3.0.0 on 2018-07-09; Adafruit ItsyBitsy M4 Express with samd51g19
Steps to replicate issue:
- Plug in ITSYM4 Express to USB port, green led animates, the Neopixel turns on all colors
- Open mu-editor, load existing code -> Error: The file "code.py" is already open.
- Paste D13 LED blink demo code
- Click 'Check' -> Zero problems found
- Click 'Save' -> Neopixel Blinks one time, then nothing happens
Additionally, when I click "Serial" Button first time, Mu says : Cannot connect to device on port /dev/ttyACM0
Then if I click 'Serial' button again, (whether or not I hit the reset button and wait), the serial console shows up, but If I press any key, I dont get the >>> prompt and nothing else happens
@indigo wraith yup! this is the right place. thanks for the PR!
@wraith tiger I recommend servo in the motor lib over the one in simpleio
Do you have any other computers you can try it on? Thanks!
@notro Thanks! Fixed. I think it might be editing over samba causing it.
- Fix finding translations with escaped characters.
- Fix memory section on ESP8266.
- Add back \r to translations since its needed by screen.
Hi folks! If I'm in the wrong channel, I do not mean to cause offense. I'm having some trouble compiling the SAMD51 bootloader. I actually tried on both my Mac and on Windows.
@teal bear i think there's a main.py, based on the contents of the zip from here:
https://learn.adafruit.com/adafruit-circuit-playground-express/downloads#files-61-1
@frail geode the UF2 bootloader?
@tidal kiln The new CPXs are shipping with Firmata, not CircuitPython. I don't think they have CP code on them.
@idle owl good point. i thought maybe that was just the ones shipped in the code.org kits.
That would have been a lot of overhead. I'm pretty sure they're all shipping the same. The ones I setup for my tutorial weren't running CP and were empty when I loaded CP onto them.
@teal bear ^^ see above. so probably not. but are you having an issue with the board?
@idle owl yep. i maybe need to have one of each of these i just leave in the bag. they're pretty much reprogrammed first thing out of the bag when i get them.
where do things stand with text output on displays? specifically, this one:
https://www.adafruit.com/product/3625
The lib for it doesn't have any text rendering in it.
At least it doesn't look like it.
oh nose - that dashes my "plug in to usb port and start learning Python"
no, it doesn't. guessing this is in work.
@teal bear you can have the CPX running circuitpython in a very short time
"I" can, but im not the one that needs to learn Python π
@teal bear Unfortunately yes. You'll need to load CircuitPython on it to get started. The other boards come with CP on already, but because CPX is used in a curriculum with Code.org, we needed it to ship with Firmata.
well puff puff puff. tell someone to make it optional when it is ordered :p
I hope it is OK to show off stuff now and then. https://github.com/CarlFK/cpx/blob/master/metronome.py
I literally can only find one use of the ASF4 FREQM APIs on the internet, and that one doesn't seem complete. (searching for freqmeter_sync_init and freqmeter_async_init on goog and github). https://github.com/zoubata/test/blob/72f27cc47556c6e83b30169de9e26c0e82e4cc72/Atmel Studio/7.0/LED flasher/LED flasher/driver_init.c
update: the readme does mentions dfu-flash and dfu-flash already, @tannewt would you mind to tell which lines of the makefile you want to remove.
@dhalbert @tannewt maybe we shouldn't add bootloader as submodule at all. A download script like SD's one should be enough ?
I think @tannewt is saying to not have anything about the bootloader in the circuitpython repo. If they are not already there, you can move the Makefile targets that load the bootloader to the https://github.com/adafruit/Adafruit_nRF52_Bootloader repo. If someone wants to load the bootloader they can follow instructions in the bootloader repo and/or use Makefile targets there.
We don't have targets that load the UF2 bootloader in the atmel-samd/Makefile, so they don't
@dhalbert ah that make sense, thanks. I understand what @tannewt means now. Since bootloader target existed previously, I haven't done anything with it in this PR. I will remove bootloader and dfu-bootloader target.
@dhalbert maybe we should remove bootloader as the submodule as well, just tell people to clone the bootloader and flash it there in the readme.md
close this one by now, I need to do a few more things with bootloader repo and submit a separate PR.
@teal bear Looks great! Of course it's ok to show off stuff. We love stuff!
@tidal kiln text support is on my radar
@slender iron thanks. that's what i figured.
hey all, i'm trying to read SPI data from an ESP32 using my adalogger. .. The ESP32 should be sending at 10Mhz, which is Clock / 8. I just don't seem to be reading the data that is being sent .... any ideas? My code for the SPI receive is def readSPI(): while not spi.try_lock(): pass spi.configure(baudrate=10000000, phase=0, polarity=0) #ESP32 Clock / 8 cs.value = False result = bytearray(4) spi.readinto(result) cs.value = False spi.unlock() return result
@rotund basin one of them needs to be a spi slave and not output a clock. CircuitPython can't do it currently. UART may work better
@slender iron my gps takes the only UART on the adalogger... hmm ...
you sure? it may be unmarked
https://learn.adafruit.com/adafruit-feather-m0-adalogger?view=all says serial1 uart
would it be in the board file?
i can define the unused IC lines to UART? π
yes we can
@slender iron thank you much , i really appreciate it!
@slender iron @gentle bronze @indigo wedge I am renaming the nrf boards to feather_nrf52832 and feather_nrf52840_express after consulting with Limor. Also, I'm thinking I'll remove circuitpyhon/lib/nrfutil as a submodule, and just have the README's reference the pypi adafruit-nrfutil version. It's a tool, not a library that can be linked in, and there's not a good reason to have it as a submodule.
Also thinking of getting rid of the pins.csv stuff, which uses a python script to generate pins_gen.c. It doesn't really save much time when setting up pins for a new board, and the actual pins_gen.c file is easier to read and understand than the CSV file. In the atmel port we use hand-generated pins files and they are fine and easy to edit.
@slender iron are you sure using UART on the MOSI and MISO pins work? I verified on the OScilliope that my ESP32 is TX'ing data , but my function for uart is not reading data
I'm pretty sure the chip can have like 6 serial lines, for uart, spi, etc..
something change in 3.0.0 getting a new error... TypeError: object with buffer protocol required
ok sanity check please, anything wrong with this code ``` import board
import digitalio
import busio
remoteEn = digitalio.DigitalInOut(board.A2)
esp32_uart = busio.UART(board.TX, board.RX, baudrate=9600)
def getCommand():
while True:
command = esp32_uart.read()
print(command)
#return command
@rotund basin which line is getting the error?
@tulip sleet not this code. but in my gps code gps_message = str(byte_array, "utf-8").split(',')
used to work, now fails
is byte_array really a bytearray?
it's a uart.readline
'''gps_uart = busio.UART(board.TX, board.RX, baudrate=115200)
# read each byte until we find a start byte
sync = [0x24]
msg_id = '$GNRMC'
# while msg_id in byteArray is False:
byte_array = gps_uart.readline()
gps_message = str(byte_array, "utf-8").split(',')'''
# read each byte until we find a start byte
sync = [0x24]
msg_id = '$GNRMC'
# while msg_id in byteArray is False:
byte_array = gps_uart.readline()
gps_message = str(byte_array, "utf-8").split(',')```
the last one
is the error
if it reads nothing, readline() will return None, which would give that error
it seems like all it's returning is None, despite data flowing
make sure TX->RX and RX->TX
different error sort of
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "gps.py", line 14, in getPosition
UnicodeError:
why don't you print byte_array and see what's coming back?
@rotund basin why is the baudrate 115200? I thought the GPS's usually sent at 9600. Have you tried the sample program here: https://learn.adafruit.com/adafruit-ultimate-gps?view=all#usage-6-6
I had it on 9600
On thr board in an .mpy
Boss couldn't connect either , so I'm rebooting everything and trying again
@tulip sleet think my cyp got corrupted Adafruit CircuitPython 3.0.0 on 2018-07-09; Adafruit Feather M0 Adalogger with samd21g18
import gps
gps.getPosition()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "gps.py", line 13, in getPosition
MemoryError: memory allocation failed, allocating 14920 bytes
ok @tulip sleet riddle me this
@rotund basin - sorry had to go out for an errand. If you have both a .mpy and .py of the file, it will prefer the .py, and probably run out of memory compiling it.
why does this work ``` import busio
import board
def getPosition():
gps_uart = busio.UART(board.TX, board.RX, baudrate=9600)
# read each byte until we find a start byte
sync = [0x24]
msg_id = '$GNRMC'
#while msg_id in byteArray is False:
byte_array = gps_uart.readline()
print(byte_array)
gps_message = str(byte_array, "utf-8").split(',') ```
but it does not work when commenting out the print statements?
i deleted the .mpy first
output showing the working part ``` >>> import gps
gps.getPosition()
b'00,2622.29653,N,08013.25004,W,AANN,12,0.98,16.4,-27.1,,,V1F\r\n'
b'$GNGGA,211056.00,2622.29653,N,08013.25004,W,1,12,0.98,16.4,M,-27.1,M,,4F\r\n'
b'$GNGSA,A,3,05,13,12,15,25,02,29,,,,,,2.04,0.98,1.79,107\r\n'
b'$GNGSA,A,3,81,67,83,68,82,,,,,,,,2.04,0.98,1.79,20D\r\n'
b'$GPGSV,3,1,10,02,47,072,41,05,53,020,41,06,07,101,21,12,14,204,33,061\r\n'
b'$GPGSV,3,2,10,13,56,133,44,15,38,193,28,19,00,146,18,25,20,247,16,06A\r\n'
b'$GPGSV,3,3,10,29,47,316,39,30,00,078,,06E\r\n'
b'$GLGSV,2,1,06,67,46,020,42,68,68,251,28,69,17,222,,81,25,129,41,07D\r\n'
b'$GLGSV,2,2,06,82,67,076,35,83,39,342,31,075\r\n'
b'$GNGLL,2622.29653,N,08013.25004,W,211056.00,A,A62\r\n'
b'$GNRMC,211057.00,A,2622.29654,N,08013.25004,W,0.013,,100818,,,A,V*05\r\n'
('211057.00', 0.371609, 0.220834, '', 'A')
when the commented out prints i get this ``` >>> import gps
gps.getPosition()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "gps.py", line 15, in getPosition
UnicodeError:
could you upload the whole program as a file using the + on the left, or put it in a gist or pastebin or something?
The print takes some time. I think you may need to specify a longer timeout for the UART. Note the sample program uses a timeout of 3000 msecs: https://learn.adafruit.com/adafruit-ultimate-gps?view=all#circuitpython-parsing
so add , timeout=3000 to the busio.UART line
@tulip sleet that seemed to work for the gps
the default timeout is 1000 msecs, and the gps sends one line per second I think, so it's on the hairy edge
@tulip sleet nrf plans sound good to me!
great - thanks
Its weird that its still not working for you. I reproduced the problem and it went away when I tightened up the timings. I don't expect it to be 800khz though since its being bitbanged.
Would you mind experimenting with the numbers yourself like I did in https://github.com/adafruit/circuitpython/commit/b0dd645e27219f8a593f7c5af1339cebffeebfe8 ?
Thanks!
@tulip sleet you know what I just figured out. this works def getCommand(): esp32_uart = busio.UART(board.TX, board.RX, baudrate=9600, timeout=3000) while True: byte_array = esp32_uart.readline() #command = str(byte_array, "utf-8").split(',') print(byte_array) #return command
this does not work ``` esp32_uart = busio.UART(board.TX, board.RX, baudrate=9600, timeout=3000)
def getCommand():
while True:
byte_array = esp32_uart.readline()
#command = str(byte_array, "utf-8").split(',')
print(byte_array)
#return command
the second one will only return None
now i just need to find some other UART pins i can use. Since MOSI and MISO don't work (return None), and SCL and SDA are invalid pins. @slender iron any suggestions?
@idle owl has a script somewhere that checks all combinations
how fast can I change the duty cycle of a PWMOut?
changing it every 1ms doesn't look too great:
I get random flicker instead
huh, the flicker goes away when I disconnect usb, interesting
@slender iron thanks, I hope @idle owl gets back to me soon, I'm striking out with reading the data sheet and trying new combos.
@stuck elbow did you try a usb cable with a ferrite choke?
@proven bluff shouldn't matter, the usb power is not connected
@rotund basin she will. have patience. its dinner time for her
what are you trying to achieve @stuck elbow ?
@stuck elbow but ground is
@slender iron I'm controlling a led matrix by scanning rows (setting all but one to high-z), and setting pwm duty on the rows (with 500kHz freq)
(actually, first I set the pwm, then I enable the row, then I disable the row, then I set the pwm for the next row, etc.)
but it seems there is a delay between setting the pwm duty and it actually changing
I've been wanting a way to dma values out as duty cycles (for audio)
how fast is the base frequency?
the pwm freq is 500kHz, the rows are switched in the systick timer, so 1ms
I also have a weird thing where if I change the duty for PA10, then PA11 and PA17 change too, not sure yet what is the exact cause, might be bug in my code
hrm
same for PA00 and PA05
@rotund basin https://learn.adafruit.com/circuitpython-essentials/circuitpython-uart-serial#wheres-my-uart-13-14
@idle owl thank you so much!! you're the best!!!!
=== ROWS = (
=== pulseio.PWMOut(board.R8, frequency=200000),
=== pulseio.PWMOut(board.R7, frequency=200000),
=== pulseio.PWMOut(board.R6, frequency=200000),
=== pulseio.PWMOut(board.R5, frequency=200000),
=== pulseio.PWMOut(board.R4, frequency=200000),
=== pulseio.PWMOut(board.R3, frequency=200000),
=== pulseio.PWMOut(board.R2, frequency=200000),
=== pulseio.PWMOut(board.R1, frequency=200000),
=== )
===
>>> ROWS[4].duty_cycle
0
>>> ROWS[6].duty_cycle
0
>>> ROWS[6].duty_cycle = 500
>>> ROWS[6].duty_cycle
274
>>> ROWS[4].duty_cycle
274
scratches head
R4 is PA17 and R2 is PA19 there
@slender iron why do I get this error: Pin PBO9 is in use? with this code? ```def getCommand():
esp32_uart = busio.UART(board.A1, board.A2, baudrate=9600, timeout=3000)
while True:
byte_array = esp32_uart.readline()
#command = str(byte_array, "utf-8").split(',')
print(byte_array)
return command
because PB09 is A2
thanks @slender iron your the besT! π
you need to deinit the uart when you are done. otherwise it'll be in use the second time you use it
kk, i was soft resting
@stuck elbow bug. they share the same capture compare channel because wave outs wrap around
@slender iron should I report it?
yes please
Escape table was incorrect
@slender iron also, why does it say 274 when I set it to 500?
Β―_(γ)_/Β―
I tested it with the following code on my custom board:
=== ROWS = (
=== pulseio.PWMOut(board.R8, frequency=200000),
=== pulseio.PWMOut(board.R7, frequency=200000),
=== pulseio.PWMOut(board.R6, frequency=200000),
=== pulseio.PWMOut(board.R5, frequency=200000),
=== pulseio.PWMOut(board.R4, frequency=200000),
=== pulseio.PWMOut(board.R3, frequency=200000),
=== pulseio.PWMOut(board.R2, frequency=200000),
=== pulseio.PWMOut(board.R1, frequency=200000)...
ok, so probably another bug then, or part of this one
I guess when the bug is fixed I will just get an exception when trying to create that many pwm channels
man why do I have all the luck, i am trying the circuit python intro code and I am stuck already, working the I/O demo where you turn D13 on or off depending on the switch state and D13 stays on no mater what I have removed all commented out code as well still no go
@timber birch are you getting errors through the serial console?
@stuck elbow maybe, depends on the other TC on the pin
@slender iron repel does show the following not sure if it shoud
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
using circuit playground with version 3 of python
post your code please
sure
code for error
sorry discord popped up in screen shot
its from CircuitPython_Digital_In_Out.py
weird! it looks right to me
@slender iron that is how i roll, copy code and get a diffrent result
so if i understand the demo, the led should turn off when you slide the switch right?
not sure what direction but yes, it should change
have you tried blinking the led? my guess is that something is wrong with the switch or its code
hrm. weird the switch doesn't work.
@timber birch Try this: https://learn.adafruit.com/circuitpython-made-easy-on-circuit-playground-express/slide-switch
ok weird when i ran the first demo @idle owl it went true (5x) then to false looped repeatedly and when i ran the second program the LED is off and then nothing
I think it needed a time.sleep(0.1) in the initial switch code.
I feel like I remember someone else mentioning that.
i tired that on the first program, and nothing, let me try second program?
import time
...
time.sleep(0.1)```
Hmm. I figured that would at least test whether the switch works.
Do you get True/False with the first one depending on the position of the switch?
still get one true then all false, or if already false just false all the time
if set to true i get one true, then false looped 4 ever
@timber birch what version of CP are you running?
if set to false, false reported looped for ever
adafruit-circuitpython-circuitplayground_express-3.0.0.uf2 and lib to match
it sounds like the pull up could be broken
ok. not what i was thinking then.
Yeah.
ok i got anther one in the Adabox 8, i'll give it a shot then
just walked in....let me try....
thanks!
are we running slide switch demo linked above?
Add a time.sleep(0.1) to it @tidal kiln if you're using the cpx version.
I'm updating it right now on GitHub.
The screenshot won't match it but the code will work better.
short enough might as well post it for clearity:
import time
from adafruit_circuitplayground.express import cpx
while True:
print("Slide switch:", cpx.switch)
time.sleep(0.1)
Yeah exactly.
works for me. toward note is true, toward ear is false.
Adafruit CircuitPython 3.0.0 on 2018-07-09; Adafruit CircuitPlayground Express with samd21g18
>>> import cpx_slide
Slide switch: True
Slide switch: True
Slide switch: True
Slide switch: True
Slide switch: True
Slide switch: True
Slide switch: True
Slide switch: True
Slide switch: False
Slide switch: False
Slide switch: False
Slide switch: False
Slide switch: False
Slide switch: False
Slide switch: False
Slide switch: False
Slide switch: False
Check the first example then from Digital In & Out. That @timber birch posted just a bit ago
slide switch ties D7 to gnd, so if pullup is borked, False should report reliably, True not so much
ok second cpx worked. I guess i have a bad switch on this other board. sad, its only a few months old
around middle of may
or april
same here. also works fine:
import time
import board
from digitalio import DigitalInOut, Direction, Pull
led = DigitalInOut(board.D13)
led.direction = Direction.OUTPUT
switch = DigitalInOut(board.D7)
switch.direction = Direction.INPUT
switch.pull = Pull.UP
while True:
if switch.value:
led.value = False
else:
led.value = True
time.sleep(0.01)
@timber birch you say False reported forever, but True was reporting less reliably?
yes
i'm not seeing an external pull up, so CPX is relying on the internal one.
weird that it's not enabling
just to be sure - double check your CP version. there was a bug in the RC just before release that was related to this.
hmm ok
you can look in boot_out.txt
i just tried this other CPX I got with the ADABOX 8 and it is working with i t
check the version for both
the banner text that looks like this:
Adafruit CircuitPython 3.0.0 on 2018-07-09; Adafruit CircuitPlayground Express with samd21g18
ok here is the "bad" cpx file Adafruit CircuitPython 3.0.0-rc.1 on 2018-07-03; Adafruit CircuitPlayground Express with Crickit libraries with samd21g18
there you go - you're running RC1
Good call, @tidal kiln
ok so is there a fix or do i go back to 2.x
nah. easy peasy. just upgrade to 3.0.
so how do i do this?
we've got links...hold a sec....
sure
installing / updating are the same process:
https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython
^^ try that and see if you can get it to work
that page links to here:
https://github.com/adafruit/circuitpython/releases/tag/3.0.0
which is where you get the latest UF2
ok so i saved the UF2 to the board but the bootio does not change
did you save it to CPLAYBOOT? (after double reset to get into bootloader)
ok tried again and i think it copied over, ok, bootio changed
haha it is working whoo hoo
you are all the best thanks @tidal kiln, @idle owl, @slender iron
this is why I love discord, ive said it before and say it again, best group ever
π
thanks all!
well thanks, i think ill take a break for now and try later
yeah. love the simple / fixable problems. anywho...walking back out of room....have a great evening all!
Travis is not doing well, but one of the Travis builds finished after I restarted a few entries. The other is having a lot of trouble cloning in several subjobs. Since there's one successful set of builds, I'll merge.
good morning. Anyone know how to convert binary bytes? apparently, this doesn't work ```>>> import micropython
binascii.a2b_base64('\x07\x07')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'binascii' is not defined
you can't call a module's functions without first importing that module
@stuck elbow it's not an importable module
but this works just fine ``` struct.unpack('b',b'\x07\x07')
(7,)
love this adafruit channel, even if I talk to myself at times π
it's supposed to be an F
what?
it's Serial.write from an Arduino into my Cpython
but i don't know what format Arduino puts out, it's binary
this is uart.Read(1) b'\x07\x07'
and you want to convert that to base64?
i'm looking to get it to a char
str(b'\x07\x07', 'utf8') <-- like this?
unicode error
well, because it doesn't represent any unicode char
but if you do it with a properly encoded string, it will woek
work
yep, guess I'll go modify that π
weird that python3 doesn't throw a unicode error
I still don't understand what base64 has to do with it
Lines one and two of the default main.py found after flashing with this (https://github.com/adafruit/circuitpython/releases/download/3.0.0/adafruit-circuitpython-gemma_m0-3.0.0.uf2) are:
`# Gemma IO demo
Welcome to CircuitPython 2.0.0 :)`
However, main.py throws a ValueError once flashed and does not run, until you replace the lib files from their respective .mpy files from version 3 (downloaded here: https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/tag/20180810).
...
The https://github.com/adafruit/circuitpython/releases/download/3.0.0/adafruit-circuitpython-gemma_m0-3.0.0.uf2 is just CircuitPython. It does not overwrite CIRCUITPY, so it does not replace any older files that are already there, which might be outdated. So you need to update those yourself.
We might provide a .uf2 that's a factory-fresh load of 3.0.x that also replaces CIRCUITPY.
Understood: I think I have a misunderstanding on what is and is not replaced. Thank you!
Just FYI, it's possible to save the entire contents of a non-Express board (Gemma, Trinket, Feather M0 Basic, etc.). If you copy CURRENT.UF2 when the ...BOOT drive is showing, that will be the entire contents of flash memory, including both CircuitPython and CIRCUITPY. This is handy if you want to back up the state of the whole board. This doesn't work on Express boards because CIRCUITPY is on the separate 2MB SPI flash chip.
But the normal CircuitPython .uf2 files only overwrite the part ...
I have wondered (A) whether it is feasible for the uf2 bootloader could be extended to access the SPI flash chip on express devices and (B) whether it would make sense to offer a "full" image which also refreshes the CIRCUITPYTHON filesystem back to what adafruit ships, or if it would have too big a risk of users deleting their code while trying to update CP versions.
(A) seems like a matter of programming, as long as you don't run out of space in the boot segment; (B) is more a "hmm would this be a good idea or a bad idea in the end"
@onyx hinge in purely technical terms, the uf2 bootloader on m0 haslike 4 bytes left free π
but its a cute idea, if it could fit, yes it would not be hard to do
you'd probably just drag the entire SPI flash filesystem on
i think m4 could do it sicne we bumped the bootloader size
PSA: when documentation recommends using a different module, research that recommendation instead of ignoring it to find out later that it actually was valid. π
@raven canopy Noted π
@onyx hinge @meager fog this could work with nrf52 with spi flash, the "stock/factory" bundle files can be stored in the 256kb internal flash which is currently used as main filesystem ( later replaced by spi flash). Nrf52840 has lots of flash to spare, that we won't touch those 256Kb anyway.
"Factory" files can be exposed by bootloader msc, maybe using another msc lun (or same one with uf2)
Oi. The IRRemote docs haven't updated in 6 months.
There's no webhook. And I don't think I can get to it because I didn't import it into RTD.
Since it passed the last time it built, it's been showing as "Passing" the whole time. But it's still showing the Gitter badge etc.
yeah, that is a tad out-of-date. (fights the urge to "fix" adabot for this check, before finishing current adabot work)
Hello folks!
I was directed to this thread by Scott (@tannewt ) over at the Adafruit forums, in reply to my query about "Arduino-like 'serial' with Circuit Python".
For what I'm trying to achieve, being able to send and receive serial data in this way through the USB connection would be really great.
Thanks all!
-Casey
Can I use CircuitPython Audio Out and not use Audio Out on Crickit
I want to use on board speaker on CircuitPython. Do not want to use the amplifier on cricket
@timber mango are you using the Circuit Playground Express version? (sorry if that is what you meant by "CircuitPython"...the names get confused often)
yes
k. i can think of 2 ways. both involve using a connection to the upper side of A0 on the CPX.
1). turn the audio potentiometer all the way down.
2). place a non-conductive material between A0 on the CPX and the mating point(s) on the Cricket. think along the lines of a nylon washer between the CPX mounting post and Crickit pad
the Feather Crickit is nice for this scenario, since there is a jumper for the amplifier.
if using option 2, you will have to work out any mechanical variances (shorter/longer screw, etc)
Maybe remove the distance on the A0
In adding RTD links to all the guides, I'm finding that some docs are seriously out of date. The issue is that they haven't built in a long period of time. This went unnoticed because when they last built they passed, so the badge has shown passing the entire time.
They do not have webhooks - RTD is instead setup as a service. This needs to be resolved. Only the maintainers on a particular project have access to setup the webhook - adabot and the person who imported it into RTD in the firs...
@timber mango yep just disconnect the speaker from the Crickit and 'enable' the speaker
by setting SPEAKER_ENABLE pin high, see code here https://learn.adafruit.com/adafruit-circuit-playground-express/playground-drum-machine
Make faster and easier than ever with MakeCode, code.org CSD, CircuitPython or Arduino!
receive error messages when I use the import CPX
and enable the speaker code
ValueError: Pin PA30 in use
just a general annoyance .... Circuit Python REPL says autoload is on and you don't need to reset to get the new file loaded. This statement is False. It knows the new file is there, but doesn't load the modules.
Hi!, i'm working on the spanish translation of the strings in circuitpython and i would like to know if somebody in here who knows spanish? i would like to have some feedback, if not, i would like to see how those strings are displayed, so i guess i need to compile my fork of circuitpython and give it a try?
@granite crow Building CircuitPython from your fork to see your strings sounds accurate. I don't know of anyone else who knows Spanish, but that doesn't mean there isn't anyone.
Thanks @idle owl , i will give it a try.
I know enough to understand what I'm reading and fumble my way through a conversation. That's not nearly enough to give you feedback on specific translations π
no problem, is just some phrases sounds weird in spanish hehe
e.g. the string "Bit clock and word select must share a clock unit" is from the function common_hal_audiobusio_i2sout_construct which have parameters named bit_clock and word_select, so i think the translation should keep the "Bit clock" and "word select" without being translated, any thoughts?
Hmm. Good question. If they're kwargs, probably don't translate, because they'd match the instantiation.
i would agree that parameter names that are not being translated in code, should not be translated in documentation/error strings. best to keep them comparable...
i think the same, keeping the parameters names untranslated
hey all, i just upgraded to the metro m4 on cp3.0 and the st7735r rgb library (slightly modified) and i am having two problems. you stop sending the display information for a little while the whole thing turns white AND calling the reset method also causes it to turn all white . if you tell the same digital for reset pin to go low then high manually the same thing happened. i did not have this problem with cp2.0
any ideas?
I am clueless
has anyone else has st7735r problems on cp3?
anyone know why my if statements are not executing? I see in REPL that my command is 0x24 but the logic doesn't execute def getCommand(): esp32_uart = busio.UART(board.A1, board.A2, baudrate=9600, timeout=3000) byte_array = esp32_uart.readline().strip() print(byte_array) retval= "Nothing" command=0x00 command =hex(struct.unpack('H',byte_array)) print(command) if command == 0x24: retval = "forward" print('forward') elif command == 0x25: retval = "reverse" elif command == 0x26: retval = "left" elif command == 0x27: retval = "right" elif command == 0x28: retval = "stop" elif command == 0x29: retval = "work_area" elif command == 0x30: retval = "exclude_area" elif command == 0x31: retval = "done" else: print("error ", command) print(command) print(retval) esp32_uart.deinit() return retval
because @rotund basin you have to make your if statement like this if command == '0x24':
that's so not intuitive... so such is life
@marble hornet I think you need to re-initialize it after reset
in particular, you need to send the command that switches it on
@stuck elbow thanks i called init after reset and it worked perfectly!
@rotund basin if you move your hex() from the command= line to the print(command) then itll work
@stuck elbow what do you think about the turning white when you leave the display alone for 30ish seconds?
hex() turns the number into a string - probably best to only do that on prints π
hey @meager fog
y0
having a good day?
@marble hornet no idea, power problems maybe?
yep workin
its running off of available 3amp at 5v, and the backlight isn't flickering. is spi handled differently in 3.0?
lady Ada do you have any time for your own personal projects anymore?
yes, adafruit is my personal project!
π well it's wonderful
yay! gotta jet. l8r
have fun
@meager fog lady thanks I do need the hex number, how else to get it? It's ok if it's a string it's a work around π
Um, hum. I just tried to build latest, and I get a "too little flash!" error on feather_m0_express, gemma_m0, and trinket_m0. Are those boards no longer supported?
Or is DEBUG=1 (which I assume doesn't strip symbols) causing the firmware image to be too large?
do you have -flto commented out in the Makefile? it shouldn't complain for the feather express either way, but iirc it would for the non-express boards.
I haven't changed the makefiles at all...
then that is more curiouser...
Yessir. Data point: removing "DEBUG=1" works.
hmm. try commenting out the CFLAGS += -flto line (though it makes debugging somewhat infuriating since you miss a whole mess of symbols)
Ok, I'll give that a try after I flash my box o' boards with the latest firmware. π
on second thought(s), I may have that backwards...
Err?
the -flto should make the debug binary smaller, since some things are optimized. which makes debugging harder; lots of "optimized out" values.
i've been fighting code all day...brain is barely holding on π₯ π
That's ok! Hang in there!
automation is much easier when everything is a carbon copy. π
So is machine learning! π
@drowsy geyser make sure you are using a new compiler too
kk
hey all i don't understand why i have an OS errror on this line with open('/storage/work-areas/work-area-tmp.txt', 'a+b') as f: f.write(struct.pack('nn', tmp_lat, tmp_lon))
OSError: [Errno 30]
anyone have an idea? can you not mount the card in a boot.py and then write to it in the main program? @slender iron why would this fail?
@rotund basin looks like "read-only": https://github.com/adafruit/circuitpython/blob/master/py/mperrno.h#L66
@raven canopy hmm ... so what do you have to do to write on the SD Card after mounting? I have this in my boot.py ```import adafruit_sdcard
import digitalio
import storage
import board
import busio
SD_CS = board.D4
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
cs = digitalio.DigitalInOut(SD_CS)
sd_card = adafruit_sdcard.SDCard(spi, cs)
vfs = storage.VfsFat(sd_card)
storage.mount(vfs, "/sd_card")
if 'storage' not in os.listdir('/'):
vfs.mkdir('storage')
if 'work-areas' not in os.listdir('/storage'):
vfs.mkdir('/storage/work-areas')```
this is just like my code... https://circuitpython.readthedocs.io/projects/sd/en/latest/index.html?highlight=open
just +a doesn't work
anyone know why I am getting a read only error?
can you not mount the card in a boot.py and then write to it in the main program?
@rotund basin i'm not sure i could answer that. i've done nothing with SD cards up to this point.
@marble hornet this should get you what you want:
import gc
gc.mem_free()
@raven canopy thanks!
there is also:
import micropython
micropython.mem_info()
which gives the stack info as well (IIRC).
@raven canopy does it output in bytes or bits?
i think its in bytes.
π
@raven canopy i need to make a gui from scratch in cp, any suggested literature?
just looking for advice
hmm. i don't really have any bookmarks on that front. i assume you're going to emulate a Trekian layout? I remember a home-automation project that had a really good layout for that, but not sure how hard it would be to replicate in CP.
or do you mean the functional side?
hehe. the downside to getting something to work...after a separate effort has progressed:
install:
- pip install -r requirements.txt
- pip install circuitpython-build-tools Sphinx sphinx-rtd-theme
- pip install --force-reinstall pylint==1.9.2
- pip install --force-reinstall pylint==1.9.2
at least this patch finally works, and adabot can accommodate a wider range of patch file formats/options! but now i'm not sure running it is worth it. π
@rotund basin - you can use int or string for stuff, but if you're comparing values, probably makes more sense to compare the integer (e.g. 0x30) than the string version (e.g. '0x30') - hex() will turn an number into a string
Ugh ya. Some files simply don't include what they use. That's why I thought it would be simple.
Here I think we should move the VM_HOOK part back into the wait loops. ESP doesn't use that code anyway so it should fix the compile.
PICO-8 talk worth watching: https://www.youtube.com/watch?v=87jfTIWosBw
Hi can any give me the binary file and program guide and how to interface ATWINC1500 through AT Commands
@raven canopy That's great! Yeah, you'll have to put in a check to see if the line is already there. It's not added to all of the repos, I didn't start that until part way through.
@idle owl I'm going to try one more patch format before I put this PR in to update. It may come down to some cleanup afterwards anyway. Going to start working the pylint.rc patch tonight as well (pre-meeting status update, haha)
It should. I need to look at it again , but there is little that adabot won't patch now with my recent additions. There are now 2 git commands available for applying the patches. :evil_laugh:
Brilliant!
Just my weekly reminder - if you're not already on the Adafruit spam-free python newsletter, you can sign up at adafruitdaily.com - more info at https://blog.adafruit.com/2018/08/13/python-on-microcontrollers-newsletter-sign-up-now-adafruit-circuitpython-3/
Catch the weekly news on Python for Microcontrollers withΒ adafruitdaily.com. This ad-free, spam-free news source is filled with the Python news of the week. Currently our fastest growing newsletterβ¦
I dont have another computer at the moment, but I was able to replicate a possibly related issue on another brand new ITSYM4 board. Here's what I did:
- Plugged In new board
- Paste D13 LED blink demo code -> Works fine
- Forced error in the code by changing the line 'led.value = False' to 'D14.value = False'
- Neopixel turned on all colors
- Reverted the changes made in step 3) -> Neopixel Still full color on, Red LED doesnt blink
- Reset the board by pressing the reset button...
Update: Was able to test this on a windows 10 machine, and I got both the boards working again after I reflashed CircuitPython
Hooray! Dew point calculation seems accurate.
still trying to get this to work without any luck...,why doesn't this work? with open('/storage/work-areas/work-area-tmp.txt', 'ab') as f: and Fails with a Read Only error OSError: [Errno 30]
ATWINC1500 does not use AT commands, it is SPI.
I'm looking at the simpleio library again. I've forked and cloned it to my computer. I can sucessfully run circuitpython-build-bundles, but when I try to build the docs (cd docs; sphinx-build -E -W -b html . _build/html) I get an error:
Warning, treated as error:
autodoc: failed to import module 'simpleio'; the following exception was raised:
No module named 'digitalio'
@rotund basin are you make the fs write-able?
https://learn.adafruit.com/circuitpython-essentials/circuitpython-storage
@tidal kiln maybe not .... my boot.py ```import adafruit_sdcard
import digitalio
import storage
import board
import busio
SD_CS = board.D4
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
cs = digitalio.DigitalInOut(SD_CS)
sd_card = adafruit_sdcard.SDCard(spi, cs)
vfs = storage.VfsFat(sd_card)
storage.mount(vfs, "/sd_card")
if 'storage' not in os.listdir('/'):
vfs.mkdir('storage')
if 'work-areas' not in os.listdir('/storage'):
vfs.mkdir('/storage/work-areas')
and the link you gave me wasn't for the SD card...
yep. sry. didn't realize you were working with sd card.
what does your boot_out.txt file look like?
@tidal kiln i think that is the problem ... i forgot to reinstall the libraries
ok. try that. did you see error messages in boot_out.txt?
yes it said it was not found. how do i get it to write a new boot_out it seemed old...
it (should) get re-written every boot
building circuitpython issue . i am following the guide "Building CircuityPython" using Win 10 WSL all went well until trying to build mpy-cross .. i get an error about msgfmt : Command not found. smartrf@kclaptop-PC:~/circuitpython$ make -C mpy-cross
make: Entering directory '/home/smartrf/circuitpython/mpy-cross'
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
QSTR updated
python3 ../py/makeqstrdata.py build/genhdr/qstrdefs.preprocessed.h > build/genhdr/qstrdefs.enum.h
make: msgfmt: Command not found
../py/py.mk:301: recipe for target 'build/genhdr/en_US.mo' failed
make: *** [build/genhdr/en_US.mo] Error 127
any suggestions?
@tidal kiln thank you very much! I really appreciate the help!
Anyone got setup instructions for using Visual Studio 2017 with CircuitPython? I get editing fine but it does not recognize import board or import neopixel for intellisense.
I don't think it's trivial to make it work
one way to do it would be to create stubs with all the definitions and to point the IDE to that
@slender iron I won't be able to make the telecon today. Group hug! Should be back this weekend and will pick up on some testing, especially some of the Binka modules. I did a quick test of the RFM9x and had to make a minor change to the rfm9x_simpletest.py to convert a string to bytestring for the .send() test. That is new with the latest Blinka update, but I have not had time to dig into it. Should be able to followup on that this weekend.
<@&356864093652516868> Meeting in two minutes!
@weary spindle you'll need gettext installed
notes are here: https://docs.google.com/document/d/117IXCkuwyuS-jmKsIQczAbzA9iMA73g7IzP7eUdq3AE/edit?usp=sharing
@slender iron thank you very much .... sudo apt install gettext did the trick and now all is building ok.
I'm just a fly on the wall today.
@prime flower you remained muted
@turbid radish just fixed it on discord, thanks!
will go to you after sommersoft, brent
yay Adabot!
Just a group hug this week!
I like the design, really symmetrical
(I just realized the logger is running/sitting on my desk, if you'd like to view some real-time data about the Adafruit Factory Floor, head on over - https://io.adafruit.com/brubell/dashboards/environmental-monitor)
wow. did you solder on all those LEDs? @stuck elbow
@tidal kiln solderpaste + hot air gun
@tidal kiln the up-side-down components sunken into holes in the PCB were more of a challenge
nice, it is soooooo important to do 'something'... and even MORE important to do it "right" π
thanks mikeb!
Adabot Patching: finished adding the ability to pass command line arguments to the git calls. Then discovered that only certain git apply flags can be used with git am, so I added the option to force the use of git apply + git commit -a -m "patch message from patch file" to allow all flags. The main difference between git am and git apply is that am does a commit automatically and apply doesn't. Buuuut, turned out that using zero lines of context for the .travis.yml patch results in duplicated lines for the ones that are already updated (see below). Will work one more approach for the patch file (1 line of context), but may just have to cleanup after. I'm also going to work on the .pylint.rc patch that @kattni brought up. And, while typing this, I figure I can add some "test run" ability. #featurecreep
install:
- pip install -r requirements.txt
- pip install circuitpython-build-tools Sphinx sphinx-rtd-theme
- pip install --force-reinstall pylint==1.9.2
- pip install --force-reinstall pylint==1.9.2
It's loong. Sorry. π
I need to update Β΅Game to 3.x
Thanks everyone!! Monday: it's the breakfast of the work week; make it tasty. π₯ π₯
π
@stuck elbow got time to chat about micropython libs
@slender iron in voice chat?
thats easiest for me
i'm dropping off. have a fun chat!
me as well. π
Elixir Cross Referencer
Port of https://www.lexaloffle.com/bbs/?tid=2145 to Python from Lua/PICO-8
Official homepage for Little Sound Dj, the ultimate Game Boy music editor.
Ok, I'll take it out of mp_hal_is_interrupted().
Is it really necessary to check that the macro is defined:
#ifdef MICROPY_VM_HOOK_LOOP
MICROPY_VM_HOOK_LOOP
#endif
When we have this in py/mpconfig.h?
// Hook for the VM during the opcode loop (but only after jump opcodes)
#ifndef MICROPY_VM_HOOK_LOOP
#define MICROPY_VM_HOOK_LOOP
#endif
It looks like I can just do this:
while (common_hal_time_monotonic() < timeout_end) {
...
@meager fog can the bluefruit BLE SPI model be used with circuit python / micropython?
@worthy sun nope! we're focussed on nrf52
How do I get several LEDs blinking at different rates simultaneously?
@stoic marsh use time.monotonic() instead of time.sleep()
@slender iron Alright. What products will have that functionality?
to do what @worthy sun ?
the nrf52832 feather and upcoming nrf52840 feather
Nrf52 is a different BLE module right?
I see it on the site. No chance of being able to use circuit python to control it?
@stoic marsh basic example using neopixels on a CPX:
import time
import board
import neopixel
pixels = neopixel.NeoPixel(board.NEOPIXEL, 10)
BLINK_RATE_1 = 0.2
BLINK_RATE_2 = 1.3
now = time.monotonic()
last_update_1 = now
last_update_2 = now
while True:
now = time.monotonic()
if now - last_update_1 > BLINK_RATE_1:
if sum(pixels[0]) == 0:
pixels[0] = 0x00FF00
else:
pixels[0] = 0
last_update_1 = now
if now - last_update_2 > BLINK_RATE_2:
if sum(pixels[1]) == 0:
pixels[1] = 0x0000FF
else:
pixels[1] = 0
last_update_2 = now
I have recently been working on a C module that drives a LED matrix directly with GPIO pins, and for that I needed the scanning of the matrix to happen in the background. Normally I would use the system tick timer for this, like I did for the gamepad module, but here I needed a little bit higher frequency to prevent flickering.
I found the relevant code needed for this in two places, one is https://github.com/adafruit/circuitpython/blob/master/ports/atmel-samd/common-hal/pulseio/PulseOut...
@idle owl @slender iron I've noticed a documentation discrepancy. The servo page of the CP essentials guide (https://learn.adafruit.com/circuitpython-essentials/circuitpython-servo) under "Servo Code", first paragraph after the first code block uses the unit ms (milliseconds) while the simpleio readthedocs (https://circuitpython.readthedocs.io/projects/simpleio/en/latest/api.html) states that the units used are microseconds (us).
Within the Servo class in simpleio.py init uses .5 and 2.5 while microseconds_to_angle uses 500 and 2500 showing a 1000x difference though microseconds_to_angle also states that it uses microseconds. This suggests that init is in fact using milliseconds.
That would mean that the documentation for simpleio is in error.
@wraith tiger it wouldn't surprise me. care to fix it?
@granite crow thanks for pushing your in progress translations! I'm going to feature them in tomorrow's newsletter.
I'm currently experimenting with driving LED matrices (both charlieplexed and normal) directly with the GPIO pins. I have some hacky code that does the deed in the background by using a timer, so all the user needs to do is tell it what pixel should be what shade.
The code that I have so far is at https://github.com/pewpew-game/circuitpython/tree/pewpew70
I'm wondering if there would be an interest in this kind of thing to be merged into the main CircuitPython repository, and if so, wha...
@slender iron Will do.
thanks!
OK. There's a pull request from me with two changes.
<@&356864093652516868> Here is the recording from today's meeting: https://youtu.be/gBxo6uz6Yfw
Notes with time codes are available here: https://gist.github.com/tannewt/0cbf5ba16f6270e63a0e6ed9d47b3bcd Thanks to @kattni for taking notes! Join here for ...
@tidal kiln thank you. i'l play with that
@slender iron I am jealous of that find, goodwill again?
@slender iron I had one of those back in 1980!
π
Now you need a 410 cassette drive to go with it.
Great @arofarn! Please file a separate issue for French. Let me know if you have any questions. Thanks!
@raven canopy i mean a functional side of the gui. object structure, pages etc. i figure the g of the gui can be customized. thoughts?
@meager fog are you still keeping an ATMaker port on the arcade wing?
@idle owl can you point me at a url where I can dl/setu the cpx like you did for your tut?
@granite crow I rebased your code here: https://github.com/tannewt/circuitpython/tree/es_lang
