#circuitpython-dev

1 messages Β· Page 189 of 1

onyx hinge
#

that makes sense, thanks

#

thank you

raven canopy
#

as well as reset_clocks() below it.

raven canopy
#

thanks everyone!!! keep making Mondays awesome! πŸ‘‹

manic glacierBOT
#

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...
errant grail
#

Thanks!

wraith tiger
#

πŸ‘‹

neat folio
#

thanx everyone for "making it" πŸ˜‰

raven canopy
#

how many candles though???

idle owl
#

All.

raven canopy
#

"By the grace of all the candles!!" πŸ˜„

#

Scooby Doo font?

#

off to "toil"; island life is rough. 🏝 later taters! πŸ‘‹

manic glacierBOT
manic glacierBOT
slender iron
errant grail
#

Bye!

rotund basin
rotund basin
#

ok never-mind, i figured it out. The level shifter isn't working

manic glacierBOT
#

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...

slender iron
manic glacierBOT
#

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

ruby atlas
#

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 πŸ˜ƒ

tidal kiln
#

@ruby atlas have you seen the one @stuck elbow made?

ruby atlas
#

nope!

#

but i bet it's awesome

tidal kiln
ruby atlas
#

I was thinking a lot larger - bigger even than the CPX.

stuck elbow
#

I have the svg files if you want to give it a go

idle owl
#

@raven canopy We have an update to .pylintrc we need deployed globally. Ping me when you're around.

manic glacierBOT
ruby oyster
#

Is this good place for me to ask a couple of questions about Circuit Python?

cunning crypt
#

@ruby oyster It's the perfect place to ask

ruby oyster
#

Yay!

ruby atlas
#

It sure is!

#

Welcome @ruby oyster !

ruby oyster
#

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?

cunning crypt
#

@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

ruby oyster
#

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.

cunning crypt
#

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

ruby oyster
#

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!

cunning crypt
#

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

idle owl
#

@ruby oyster One of our community members, @bronze geyser, has been working on something similar.

ruby oyster
#

@idle owl Similar to what? Sorry, the topics have diverged a bit.

idle owl
ruby oyster
#

Ah, gotcha. Yeah, I saw that in the channel pins after I asked the question. πŸ˜ƒ

idle owl
#

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 πŸ˜ƒ

ruby oyster
#

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?

cunning crypt
#

@ruby oyster They post those sorts of things on the blog quite often!

ruby oyster
#

Ok. I'll probably do a writeup on hackaday.io sometime soon then.

#

Thanks again for all your help!

idle owl
#

@ruby oyster Keep us posted!

manic glacierBOT
#

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...

raven canopy
#

@idle owl πŸ‘‹

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.

raven canopy
#

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.

idle owl
#

You're stretching my brain capabilities for the night πŸ˜„

raven canopy
#

i blame PyPI. πŸ˜„

idle owl
#

The commits are all mushed together with PyPi setup

#

as in a single commit for all of it, unfortunately

raven canopy
#

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.

idle owl
#

Well if you're feeling sassy, feel free to deploy the updated pylintrc somewhere in there.

raven canopy
#

πŸ˜† i might be able to pull that off.

idle owl
#

Either way I'm off for the night. Hopefully my brain will recongeal for another day in PyPiland. πŸ˜„

raven canopy
#

πŸ’€ "Never let 'em see you sweat" - Someone

manic glacierBOT
granite crow
#

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.

opaque thicket
#

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!

granite crow
#

o/ @opaque thicket

opaque thicket
#

So I'm just curious - no affiliation with Adafruit, but what do you mean by "internalization" for Spanish?

granite crow
#

So i'm listening today's weekly recording and heard about a request for help to translate strings in Circuitpython.

opaque thicket
#

Oh nice!

granite crow
#

I think so, but i don't know if there's a lot of people from latinoamerica.

manic glacierBOT
opaque thicket
#

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?

manic glacierBOT
manic glacierBOT
#

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...

manic glacierBOT
#

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...

idle owl
#

@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.

tidal kiln
#

@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'
>>> 
lone sandalBOT
idle owl
#

Thanks @tidal kiln

tidal kiln
manic glacierBOT
#

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)
idle owl
#

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.

tidal kiln
#

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

idle owl
#

Ok that's kind of what I was thinking.

#

Thanks for looking further into it too πŸ˜ƒ

idle owl
#

@slender iron Opinion on renaming the driver file in SHT31D?

slender iron
#

renaming is fine with me @idle owl . just do a major version bump since it'll break code

idle owl
#

Exactly. That was the plan. Thanks

rotund basin
#

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?

#

thanks @rotund basin !!

idle owl
#

There's more to that example, but it might help anyway.

rotund basin
#

thank you much @idle owl !!

idle owl
#

@tidal kiln The class in the driver is called SHT31. Should I add the D to that as well?

lone sandalBOT
idle owl
#

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):

tidal kiln
#

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?

idle owl
#

that was the initial plan yes

tidal kiln
#

you can simply change the class name

idle owl
#

ok keen

tidal kiln
#

old:

import adafruit_sht31
sensor = adafruit_sht31.SHT31(i2c)

new:

import adafruit_sht31d
sensor = adafruit_sht31d.SHT31D(i2c)
idle owl
#

Correct.

tidal kiln
#

yep. as simple as changing file name and class name.

#

and then updating all the docs, examples, guides, etc. πŸ˜ƒ

idle owl
#

It's not as bad as it sounds. I researched it first πŸ˜„

tidal kiln
#

i wouldn't worry about the constants being name SHT31_blahblah

#

that's under the hood stuff, i'd just leave them as is

idle owl
#

@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)

tidal kiln
#

done and done

idle owl
#

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 πŸ˜ƒ

manic glacierBOT
woeful dawn
#

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?

slender iron
#
  1. no 2. yes (baud rate is actually ignored) 3. depends on what you want to do 4. beginner focused
manic glacierBOT
#

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...

rotund basin
#

Is it possible to run code from the SD card ?

stuck elbow
#

yes, you should be able to import it normally

#

I think

#

actually I never tried

errant grail
#

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? πŸ›  πŸ˜‰

woeful dawn
#

tannewt: so if I need interrupts for lots of peripherals Arduino is the option?

manic glacierBOT
#

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...
idle owl
#

Sphinx builds fine locally on this one, fails miserably remotely.

raven canopy
#

@woeful dawn yeah, for time-sensitive/interrupt-driven operations you'll have a better experience with Arduino.

manic glacierBOT
#

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...

ruby oyster
#

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?

solar whale
idle owl
#

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.

solar whale
#

@idle owl thanks. Fixed

rotund basin
#

@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 ?

solar whale
#

@rotund basin I’m not sure I understand the question . You can have multiple SPI devices .

rotund basin
#

@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 ...

solar whale
#

Sorry. I’m still confused. I’ve never used 2 masters.

rotund basin
#

it's cool. I guess they will have to play switch πŸ˜‰

idle owl
#

Ok done banging my head against this for the day. No idea why it's failing.

solar whale
#

@idle owl have a good night. It’ll wait!

teal bear
#

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. :-/"

granite crow
#

Hi @idle owl , sorry for the late reply. I'm getting familiar with the po files and reading a link tannewt sent me.

bronze geyser
#

@tidal kiln sorry for the slow reply. Yes, thank you. Of course now everything seems so obvious πŸ˜ƒ

idle owl
#

@granite crow No apologies needed! I'm glad you're getting started!

raven canopy
#

@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...)

idle owl
#

@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

raven canopy
#

there's a whisper in my brain that its actually caused by automock...but its just a whisper. πŸ€”

idle owl
#

Well hmph. Because that one won't build without automock. It fails SPECTACULARLY without it. Cascade failures of progressively large size.

raven canopy
#

i don't see the automock in conf.py...

raven canopy
#

hehe. yeah, helps to look at the PR...not master. πŸ˜„

idle owl
#

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.

raven canopy
#

hmm...

idle owl
#

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.

raven canopy
#

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?

idle owl
#

No but I already found it and fixed it

raven canopy
#

πŸ‘

idle owl
#

pushed

#

Sphinx building locally build succeeded, 1 warnings.

tawny creek
#

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 ...

umbral dagger
#

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).

tidal kiln
#

@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

umbral dagger
#

Hmm.. could be. I'll add a sync to my cp commands

teal bear
#

@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.

tulip sleet
#

@umbral dagger - yeah, sync is what you want, because what Linux says is on the disk includes what has not yet been written.

slender iron
#

@ruby oyster Help with that would be welcome! The trickiest part is ensuring the APIs match a normal CPython API where possible

rotund basin
#

any chance Circuit python supports ESPNOW on ESP32 ?

solar whale
#

@rotund basin CircuitPython does not support ESP32 at this time.

rotund basin
#

@solar whale thanks!

solar whale
rotund basin
#

@solar whale thanks!

idle owl
#

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?

manic glacierBOT
prime flower
#

just noticed there's no raspberry pi emote 😦

slender iron
#

@idle owl think so

idle owl
#

Ok keen.

slender iron
#

thanks!

idle owl
#

@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?

slender iron
#

nope. I don't think so

idle owl
#

Thanks

slender iron
#

np. errand time. gotta get kitty fuel

raven canopy
#

@idle owl FeatherWing Travis woes are killing me. I can't see anything that doesn't comparably pass elsewhere.... πŸ¦„

idle owl
#

@raven canopy EXACTLY.

#

At least it's a sanity check for me.

#

Thank you for that.

raven canopy
#

vacation is almost over. i needed to take off the rose-colored glasses at some point. πŸ˜„

red dock
#

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.

gusty kiln
#

@red dock you can probably look at the commit on the submodule in the circuitpython bundle...

#

tsl2561 @ 43e7a87

idle owl
#

@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.

solar whale
#

@idle owl . The stmpe610 breakout with a screen attached or the 2.4 inch TFT

idle owl
#

@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 πŸ˜‰

red dock
#

@idle owl Ok, so what do I do different to create my .mpy differently with 3.x?

idle owl
#

Build mpy-cross with the 3.0 build of CircuitPython and then use it on your file.

solar whale
#

@idle owl whats the problem?

idle owl
#

@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?

solar whale
#

Yes. Just a sec. I’ll confirm PID s

idle owl
#

PID: 1676 and PID: 1571 ?

#

What is the TFT you used? PID for that please.

solar whale
#

3575 + 333 + 1571 TFT was 3315

idle owl
#

Oh that uses the STMPE610?

solar whale
#

Yes. 3315 has stmpe610 in it. But only via SPI. The board does SPI and i2c

idle owl
#

Ohh ok.

#

Thanks @solar whale!

solar whale
#

You’re welcome. Sorry I can’t help now.

idle owl
#

No apologies needed, that's exactly the help I needed πŸ˜ƒ

manic glacierBOT
red dock
#

@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.

solar whale
#

@idle owl if you don’t get to it in the next 10 days I’ll be happy to.

idle owl
#

@solar whale I'll keep that in mind. Hopefully we're done by then though. πŸ˜„

manic glacierBOT
#

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...

teal bear
#

is there a tut or code for hooking a pot up to the CPX?

idle owl
teal bear
#

" 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

stoic marsh
#

how do I get 3 separate LEDs to blink at different rates? (Feather M0 Express)

teal bear
#

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.

red dock
#

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

tidal kiln
#

@teal bear CP doesn't have threads, so your code looks fine.

teal bear
#

I was wondering about that. thanks.

tidal kiln
#

@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

prime flower
#

(also the random function maybe)

tidal kiln
#

@idle owl just wanting a merge?

idle owl
#

Yep

tidal kiln
#

done

idle owl
#

Thanks much!

meager fog
#

@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

red dock
#

@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

idle owl
#

I think framebuf is built into CircuitPython.... Is it not working to simply import it?

#

The guide might be out of date.

red dock
#

@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.

idle owl
#
>>> import framebuf
>>> dir(framebuf)
['__name__', 'FrameBuffer', 'FrameBuffer1', 'MVLSB', 'MONO_VLSB', 'RGB565', 'GS4_HMSB', 'MONO_HLSB', 'MONO_HMSB']
>>>```
#

@red dock It appears to be incorrect.

umbral dagger
#

@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.

meager fog
#

i guess if we can figure out one that will 'just work' with the depth/height

umbral dagger
#

There's a datasheet on the product page.

meager fog
#

i suppose you can move the encoder up an ddown

umbral dagger
#

yes

meager fog
#

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

umbral dagger
#

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.

red dock
#

@idle owl Ok, sweet! I will pass that info along to the page manager.

umbral dagger
#

I've been playing with a single motor so far. Next will be to try with 2.

slender iron
#

@red dock I'm about to work on a graphics revamp

red dock
slender iron
#

have any more info on what you want to do?

#

good for me to have example use cases

red dock
#

@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.

slender iron
#

kk, good to know!

tulip sleet
#

@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__

manic glacierBOT
onyx hinge
#

now it's time to read up about the samd51 frequency counter.

idle owl
#

@onyx hinge Quality time!

acoustic pollen
#

i am using a circuit playground express and mu to save the code

idle owl
#

@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.

acoustic pollen
#

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

torpid goblet
#

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.

manic glacierBOT
tawny creek
#

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

manic glacierBOT
manic glacierBOT
#

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  ...
gentle bronze
indigo wedge
#

@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

gentle bronze
#

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 πŸ˜„

tulip sleet
#

@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.

indigo wedge
#

I think it's because 2.0 is smaller so nrf52832 has more flash left when using that one

indigo wedge
#

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

gentle bronze
#

@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).

tulip sleet
#

@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)

gentle bronze
#

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 😦

tulip sleet
#

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

gentle bronze
#

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 πŸ˜„

tulip sleet
#

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.

manic glacierBOT
#

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
...
idle owl
#

@tulip sleet Noted πŸ˜‰

manic glacierBOT
#

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...

slender iron
#

@gentle bronze @indigo wedge @tulip sleet I’m fine with ditching the old sd. I’d prefer it

manic glacierBOT
indigo wedge
#

Nice, I can integrate this into my ble rewrite

manic glacierBOT
manic glacierBOT
slender iron
#

@indigo wedge when will we see your progress on it?

indigo wedge
#

@slender iron I've been on vacation last two weeks but I'm back next week so hoping to have something week after next

slender iron
#

k, do you have a branch I can snoop on?

indigo wedge
#

Kinds, but it's not perfect, so can't show that to people :P

manic glacierBOT
wraith tiger
#

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?

prime flower
#

@wraith tiger it's an arduino-ism (writeMicroseconds uses it), like map range

slender iron
#

@indigo wedge its never perfect and its good to see the progress made

manic glacierBOT
#

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

...
worthy sun
#

anyone know what the state of bluetooth support for circuitpython is?

tidal kiln
#

@worthy sun currently not there, in work for the future

worthy sun
#

ok. thanks

idle owl
#

@slender iron Am I good to close the PyPi issue? I'm done with that part of it.

#

110+ PRs later.

slender iron
#

sure!

#

you know better than me

idle owl
#

That I do. πŸ˜„

manic glacierBOT
#

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...

prime flower
#

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

idle owl
#

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.

slender iron
#

kk

prime flower
#

@idle owl congrats on finishing them!

idle owl
#

Thanks!

prime flower
#

also thanks!

idle owl
#

You're welcome πŸ˜„

slender iron
#

πŸŽ‰

prime flower
#

almost all the io basics guides are circuitpython-compatible with raspi as of rn, (finishing the last one now)

idle owl
#

That's only half the story. Now there's 80+ guides to update.

prime flower
#

woa - that's an undertaking. good luck!

slender iron
#

we should archive old repos too

idle owl
#

@slender iron What old repos?

slender iron
#

the python drivers

indigo hazel
#

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.

stuck elbow
#

I mean, you would get more answers, probably

indigo hazel
#

@stuck elbow thanks for that.

idle owl
#

@slender iron They're not still valid?

slender iron
#

they are redundant with the circuitpython versions

idle owl
#

ah

gusty kiln
#

there are definitely people still using some of them quite a bit.

slender iron
#

do we want to support it?

gusty kiln
#

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..."

slender iron
#

ya, up to you

gusty kiln
#

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.

tidal kiln
idle owl
#

I assume because no one's written it.

tidal kiln
#

yah. just making sure. there's not even an issue entry for it.

idle owl
#

@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.

slender iron
#

ya. more work now. less later

idle owl
#

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.

gusty kiln
#

it seems like good open source citizenship to at minimum udpate the readme with a deprecation notice and a pointer to the new lib.

idle owl
#

@gusty kiln Agreed. I think trying to respond to every PR and issue though is a rabbit hole.

slender iron
#

makes sense to me

manic glacierBOT
tidal kiln
#

now there is

gusty kiln
#

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)

slender iron
#

ya

idle owl
#

Finish this project first. Then take on the next one.

gusty kiln
#

yeah.

idle owl
#

I'm willing to help with it too

gusty kiln
#

cool. let's kinda circle back to it once our checklist of tested-on-pi libs and updated guides is basically done.

idle owl
#

Sounds good.

slender iron
#

πŸ‘

wraith tiger
#

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?

manic glacierBOT
#

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...
wraith tiger
#

@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".

idle owl
#

@wraith tiger What page?

wraith tiger
#

Opps, insert "under Servo Wiring" before second paragraph in my last statement.

idle owl
#

Fixed.

#

Thanks!

wraith tiger
#

You're welcome.

prime flower
#

@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.

indigo wraith
#

Hello all, is this the right place to announce a PR?

#

specifically for circuitPython on the TSL2591

wraith tiger
#

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.

#

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.

manic glacierBOT
#

Boot_out.txt contents:
Adafruit CircuitPython 3.0.0 on 2018-07-09; Adafruit ItsyBitsy M4 Express with samd51g19

Steps to replicate issue:

  1. Plug in ITSYM4 Express to USB port, green led animates, the Neopixel turns on all colors
  2. Open mu-editor, load existing code -> Error: The file "code.py" is already open.
  3. Paste D13 LED blink demo code
  4. Click 'Check' -> Zero problems found
  5. Click 'Save' -> Neopixel Blinks one time, then nothing happens
slender iron
#

@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

manic glacierBOT
manic glacierBOT
teal bear
#

There is no code.py on a new CPX, right?

manic glacierBOT
manic glacierBOT
frail geode
#

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.

tidal kiln
#

@frail geode the UF2 bootloader?

idle owl
#

@tidal kiln The new CPXs are shipping with Firmata, not CircuitPython. I don't think they have CP code on them.

tidal kiln
#

@idle owl good point. i thought maybe that was just the ones shipped in the code.org kits.

idle owl
#

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.

tidal kiln
#

@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.

manic glacierBOT
tidal kiln
idle owl
#

The lib for it doesn't have any text rendering in it.

#

At least it doesn't look like it.

teal bear
#

oh nose - that dashes my "plug in to usb port and start learning Python"

tidal kiln
#

no, it doesn't. guessing this is in work.

#

@teal bear you can have the CPX running circuitpython in a very short time

teal bear
#

"I" can, but im not the one that needs to learn Python πŸ˜‰

idle owl
#

@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.

teal bear
#

well puff puff puff. tell someone to make it optional when it is ordered :p

teal bear
onyx hinge
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

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

manic glacierBOT
manic glacierBOT
idle owl
#

@teal bear Looks great! Of course it's ok to show off stuff. We love stuff!

slender iron
#

@tidal kiln text support is on my radar

tidal kiln
#

@slender iron thanks. that's what i figured.

rotund basin
#

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

slender iron
#

@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

rotund basin
#

@slender iron my gps takes the only UART on the adalogger... hmm ...

slender iron
#

you sure? it may be unmarked

rotund basin
#

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!

tulip sleet
#

@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.

rotund basin
#

@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..

rotund basin
#

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

tulip sleet
#

@rotund basin which line is getting the error?

rotund basin
#

@tulip sleet not this code. but in my gps code gps_message = str(byte_array, "utf-8").split(',')

#

used to work, now fails

tulip sleet
#

is byte_array really a bytearray?

rotund basin
#

it's a uart.readline

tulip sleet
#

could you paste the line

#

or lines

rotund basin
#

'''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

tulip sleet
#

if it reads nothing, readline() will return None, which would give that error

rotund basin
#

it seems like all it's returning is None, despite data flowing

tulip sleet
#

make sure TX->RX and RX->TX

rotund basin
#

different error sort of

#

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "gps.py", line 14, in getPosition
UnicodeError:

tulip sleet
#

why don't you print byte_array and see what's coming back?

rotund basin
#

ok

#

it's always None

#

this is frustating

tulip sleet
rotund basin
#

I had it on 9600

#

On thr board in an .mpy

#

Boss couldn't connect either , so I'm rebooting everything and trying again

rotund basin
#

@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

rotund basin
#

ok @tulip sleet riddle me this

tulip sleet
#

@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.

rotund basin
#

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,1
07\r\n'
b'$GNGSA,A,3,81,67,83,68,82,,,,,,,,2.04,0.98,1.79,2
0D\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,0
6A\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,0
7D\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,A
62\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:

tulip sleet
#

could you upload the whole program as a file using the + on the left, or put it in a gist or pastebin or something?

rotund basin
tulip sleet
#

so add , timeout=3000 to the busio.UART line

rotund basin
#

@tulip sleet that seemed to work for the gps

tulip sleet
#

the default timeout is 1000 msecs, and the gps sends one line per second I think, so it's on the hairy edge

rotund basin
#

ahh

#

let me see if that fixes my other uart problem too

slender iron
#

@tulip sleet nrf plans sound good to me!

tulip sleet
#

great - thanks

manic glacierBOT
rotund basin
#

@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?

slender iron
#

@idle owl has a script somewhere that checks all combinations

stuck elbow
#

how fast can I change the duty cycle of a PWMOut?

#

I get random flicker instead

#

huh, the flicker goes away when I disconnect usb, interesting

rotund basin
#

@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.

proven bluff
#

@stuck elbow did you try a usb cable with a ferrite choke?

stuck elbow
#

@proven bluff shouldn't matter, the usb power is not connected

slender iron
#

@rotund basin she will. have patience. its dinner time for her

#

what are you trying to achieve @stuck elbow ?

proven bluff
#

@stuck elbow but ground is

stuck elbow
#

@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

slender iron
#

I've been wanting a way to dma values out as duty cycles (for audio)

#

how fast is the base frequency?

stuck elbow
#

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

slender iron
#

hrm

stuck elbow
#

same for PA00 and PA05

idle owl
rotund basin
#

@idle owl thank you so much!! you're the best!!!!

stuck elbow
#
=== 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

rotund basin
#

@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! πŸ˜‰

slender iron
#

you need to deinit the uart when you are done. otherwise it'll be in use the second time you use it

rotund basin
#

kk, i was soft resting

slender iron
#

@stuck elbow bug. they share the same capture compare channel because wave outs wrap around

stuck elbow
#

@slender iron should I report it?

slender iron
#

yes please

manic glacierBOT
#
[adafruit/circuitpython] New branch created: tannewt\-patch\-3
stuck elbow
#

@slender iron also, why does it say 274 when I set it to 500?

slender iron
#

Β―_(ツ)_/Β―

manic glacierBOT
#

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)...
stuck elbow
#

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

timber birch
#

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

slender iron
#

@timber birch are you getting errors through the serial console?

#

@stuck elbow maybe, depends on the other TC on the pin

timber birch
#

@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

slender iron
#

post your code please

timber birch
#

sure

#

sorry discord popped up in screen shot

#

its from CircuitPython_Digital_In_Out.py

slender iron
#

weird! it looks right to me

timber birch
#

@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?

slender iron
#

not sure what direction but yes, it should change

timber birch
#

hmmmm

#

I switch it back and forth nothing occurs

slender iron
#

have you tried blinking the led? my guess is that something is wrong with the switch or its code

timber birch
#

not sure about blinking

#

@slender iron ok found it, blinking code works

slender iron
#

hrm. weird the switch doesn't work.

idle owl
timber birch
#

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

idle owl
#

I think it needed a time.sleep(0.1) in the initial switch code.

#

I feel like I remember someone else mentioning that.

timber birch
#

i tired that on the first program, and nothing, let me try second program?

idle owl
#
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?

timber birch
#

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

tidal kiln
#

@timber birch what version of CP are you running?

timber birch
#

if set to false, false reported looped for ever

#

adafruit-circuitpython-circuitplayground_express-3.0.0.uf2 and lib to match

slender iron
#

it sounds like the pull up could be broken

tidal kiln
#

ok. not what i was thinking then.

idle owl
#

Yeah.

timber birch
#

ok i got anther one in the Adabox 8, i'll give it a shot then

slender iron
#

can you repro kattni or cater.

#

it might be a bug in the code

tidal kiln
#

just walked in....let me try....

slender iron
#

thanks!

tidal kiln
#

are we running slide switch demo linked above?

timber birch
#

haha

#

i get it

idle owl
#

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.

tidal kiln
#

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)
idle owl
#

Yeah exactly.

tidal kiln
#

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
idle owl
#

Check the first example then from Digital In & Out. That @timber birch posted just a bit ago

tidal kiln
#

slide switch ties D7 to gnd, so if pullup is borked, False should report reliably, True not so much

timber birch
#

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

tidal kiln
#

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?

timber birch
#

yes

tidal kiln
#

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.

timber birch
#

hmm ok

tidal kiln
#

you can look in boot_out.txt

timber birch
#

i just tried this other CPX I got with the ADABOX 8 and it is working with i t

tidal kiln
#

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
timber birch
#

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

tidal kiln
#

there you go - you're running RC1

idle owl
#

Good call, @tidal kiln

timber birch
#

ok so is there a fix or do i go back to 2.x

tidal kiln
#

nah. easy peasy. just upgrade to 3.0.

timber birch
#

so how do i do this?

tidal kiln
#

we've got links...hold a sec....

timber birch
#

sure

tidal kiln
#

^^ try that and see if you can get it to work

timber birch
#

ok so i saved the UF2 to the board but the bootio does not change

tidal kiln
#

did you save it to CPLAYBOOT? (after double reset to get into bootloader)

timber birch
#

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

idle owl
#

πŸ˜ƒ

slender iron
#

thanks all!

timber birch
#

well thanks, i think ill take a break for now and try later

tidal kiln
#

yeah. love the simple / fixable problems. anywho...walking back out of room....have a great evening all!

manic glacierBOT
manic glacierBOT
manic glacierBOT
lone sandalBOT
rotund basin
#

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

stuck elbow
#

you can't call a module's functions without first importing that module

rotund basin
#

@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 πŸ˜‰

stuck elbow
#

but that's not base64

#

what are you trying to do?

rotund basin
#

it's supposed to be an F

stuck elbow
#

what?

rotund basin
#

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'

stuck elbow
#

and you want to convert that to base64?

rotund basin
#

i'm looking to get it to a char

stuck elbow
#

str(b'\x07\x07', 'utf8') <-- like this?

rotund basin
#

unicode error

stuck elbow
#

well, because it doesn't represent any unicode char

#

but if you do it with a properly encoded string, it will woek

#

work

rotund basin
#

yep, guess I'll go modify that πŸ˜‰

stuck elbow
#

weird that python3 doesn't throw a unicode error

#

I still don't understand what base64 has to do with it

manic glacierBOT
#

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).
...

manic glacierBOT
#

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.

manic glacierBOT
#

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 ...

onyx hinge
#

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"

meager fog
#

@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

raven canopy
#

PSA: when documentation recommends using a different module, research that recommendation instead of ignoring it to find out later that it actually was valid. πŸ˜„

idle owl
#

@raven canopy Noted πŸ˜„

gentle bronze
#

@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)

idle owl
#

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.

raven canopy
#

yeah, that is a tad out-of-date. (fights the urge to "fix" adabot for this check, before finishing current adabot work)

manic glacierBOT
timber mango
#

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

raven canopy
#

@timber mango are you using the Circuit Playground Express version? (sorry if that is what you meant by "CircuitPython"...the names get confused often)

timber mango
#

yes

raven canopy
#

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)

timber mango
#

Maybe remove the distance on the A0

manic glacierBOT
#

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...

meager fog
#

@timber mango yep just disconnect the speaker from the Crickit and 'enable' the speaker

lone sandalBOT
timber mango
#

receive error messages when I use the import CPX
and enable the speaker code
ValueError: Pin PA30 in use

rotund basin
#

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.

granite crow
#

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?

idle owl
#

@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.

granite crow
#

Thanks @idle owl , i will give it a try.

idle owl
#

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 πŸ˜„

granite crow
#

no problem, is just some phrases sounds weird in spanish hehe

granite crow
#

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?

idle owl
#

Hmm. Good question. If they're kwargs, probably don't translate, because they'd match the instantiation.

raven canopy
#

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...

granite crow
#

i think the same, keeping the parameters names untranslated

marble hornet
#

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?

manic glacierBOT
rotund basin
#

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

stuck elbow
#

@marble hornet I think you need to re-initialize it after reset

#

in particular, you need to send the command that switches it on

marble hornet
#

@stuck elbow thanks i called init after reset and it worked perfectly!

meager fog
#

@rotund basin if you move your hex() from the command= line to the print(command) then itll work

marble hornet
#

@stuck elbow what do you think about the turning white when you leave the display alone for 30ish seconds?

meager fog
#

hex() turns the number into a string - probably best to only do that on prints πŸ˜ƒ

marble hornet
#

hey @meager fog

meager fog
#

y0

marble hornet
#

having a good day?

stuck elbow
#

@marble hornet no idea, power problems maybe?

meager fog
#

yep workin

marble hornet
#

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?

meager fog
#

yes, adafruit is my personal project!

marble hornet
#

πŸ˜„ well it's wonderful

meager fog
#

yay! gotta jet. l8r

marble hornet
#

have fun

rotund basin
#

@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 πŸ˜€

drowsy geyser
#

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?

raven canopy
#

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.

drowsy geyser
#

I haven't changed the makefiles at all...

raven canopy
#

then that is more curiouser...

drowsy geyser
#

Yessir. Data point: removing "DEBUG=1" works.

raven canopy
#

hmm. try commenting out the CFLAGS += -flto line (though it makes debugging somewhat infuriating since you miss a whole mess of symbols)

drowsy geyser
#

Ok, I'll give that a try after I flash my box o' boards with the latest firmware. πŸ˜ƒ

raven canopy
#

on second thought(s), I may have that backwards...

drowsy geyser
#

Err?

raven canopy
#

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 πŸ₯Š πŸ˜„

drowsy geyser
#

That's ok! Hang in there!

raven canopy
#

automation is much easier when everything is a carbon copy. πŸ˜„

drowsy geyser
#

So is machine learning! πŸ˜‰

slender iron
#

@drowsy geyser make sure you are using a new compiler too

drowsy geyser
#

I just built this toolchain a couple weeks ago...

#

So it should be good.

slender iron
#

kk

rotund basin
#

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?

raven canopy
rotund basin
#

@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')```

rotund basin
#

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?

marble hornet
#

how does one turn on uheap?

#

or find out how much ram is left?

raven canopy
#

@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()
marble hornet
#

@raven canopy thanks!

raven canopy
#

there is also:

import micropython
micropython.mem_info()

which gives the stack info as well (IIRC).

marble hornet
#

@raven canopy does it output in bytes or bits?

raven canopy
#

i think its in bytes.

marble hornet
#

πŸ™‚

#

@raven canopy i need to make a gui from scratch in cp, any suggested literature?

#

just looking for advice

raven canopy
#

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?

manic glacierBOT
raven canopy
#

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. πŸ˜†

meager fog
#

@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

manic glacierBOT
manic glacierBOT
idle owl
#

@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.

raven canopy
#

@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)

idle owl
#

@raven canopy Ooh sneak peeks.

#

Will it handle the .pylintrc update we need as well?

raven canopy
#

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:

idle owl
#

Brilliant!

turbid radish
#

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/

Adafruit Industries - Makers, hackers, artists, designers and engineers!

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…

manic glacierBOT
#

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:

  1. Plugged In new board
  2. Paste D13 LED blink demo code -> Works fine
  3. Forced error in the code by changing the line 'led.value = False' to 'D14.value = False'
  4. Neopixel turned on all colors
  5. Reverted the changes made in step 3) -> Neopixel Still full color on, Red LED doesnt blink
  6. Reset the board by pressing the reset button...
idle owl
#

Hooray! Dew point calculation seems accurate.

timber mango
rotund basin
#

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]

manic glacierBOT
wraith tiger
#

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'

tidal kiln
rotund basin
#

@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...

tidal kiln
#

yep. sry. didn't realize you were working with sd card.

#

what does your boot_out.txt file look like?

rotund basin
#

@tidal kiln i think that is the problem ... i forgot to reinstall the libraries

tidal kiln
#

ok. try that. did you see error messages in boot_out.txt?

rotund basin
#

yes it said it was not found. how do i get it to write a new boot_out it seemed old...

tidal kiln
#

it (should) get re-written every boot

weary spindle
#

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?

rotund basin
#

@tidal kiln thank you very much! I really appreciate the help!

plush roost
#

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.

stuck elbow
#

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

solar whale
#

@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.

slender iron
#

<@&356864093652516868> Meeting in two minutes!

#

@weary spindle you'll need gettext installed

weary spindle
#

@slender iron thank you very much .... sudo apt install gettext did the trick and now all is building ok.

wraith tiger
#

I'm just a fly on the wall today.

turbid radish
#

@prime flower you remained muted

prime flower
#

@turbid radish just fixed it on discord, thanks!

slender iron
#

will go to you after sommersoft, brent

neat folio
#

yay Adabot!

raven canopy
#

Just a group hug this week!

stuck elbow
#

🌴

#

dependency injection

prime flower
#

I like the design, really symmetrical

tidal kiln
#

wow. did you solder on all those LEDs? @stuck elbow

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

idle owl
neat folio
#

nice, it is soooooo important to do 'something'... and even MORE important to do it "right" πŸ˜‰

prime flower
#

thanks mikeb!

raven canopy
#

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. πŸ™‚

idle owl
#

It's easy to paste πŸ˜ƒ

#

I can explain the .pylintrc update quickly.

stuck elbow
#

I need to update Β΅Game to 3.x

gusty kiln
#

i'll give 3.1 a run on my one "serious" project.

#

er, 3.01

raven canopy
#

Thanks everyone!! Monday: it's the breakfast of the work week; make it tasty. πŸ₯š πŸ₯“

wraith tiger
#

πŸ‘‹

slender iron
#

@stuck elbow got time to chat about micropython libs

stuck elbow
#

@slender iron in voice chat?

slender iron
#

thats easiest for me

tidal kiln
#

i'm dropping off. have a fun chat!

raven canopy
#

me as well. πŸ‘‹

slender iron
manic glacierBOT
#

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) {
  ...
worthy sun
#

@meager fog can the bluefruit BLE SPI model be used with circuit python / micropython?

slender iron
#

@worthy sun nope! we're focussed on nrf52

stoic marsh
#

How do I get several LEDs blinking at different rates simultaneously?

timber mango
#

2288 bytes. ;)

tidal kiln
#

@stoic marsh use time.monotonic() instead of time.sleep()

slender iron
worthy sun
#

@slender iron Alright. What products will have that functionality?

slender iron
#

to do what @worthy sun ?

worthy sun
#

Take commands from a mobile phone app.

#

And or publish sensor data

slender iron
#

the nrf52832 feather and upcoming nrf52840 feather

worthy sun
#

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?

tidal kiln
#

@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
manic glacierBOT
#

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...

wraith tiger
#

@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.

slender iron
#

@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.

manic glacierBOT
#

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...

wraith tiger
#

@slender iron Will do.

slender iron
#

thanks!

lone sandalBOT
wraith tiger
#

OK. There's a pull request from me with two changes.

slender iron
stoic marsh
#

@tidal kiln thank you. i'l play with that

prime flower
#

@slender iron I am jealous of that find, goodwill again?

slender iron
#

nope, electronics recycler

#

Got this too

prime flower
#

oh dang

#

nice!

#

(need to find one of those around nyc)

sterile bronze
#

@slender iron I had one of those back in 1980!

slender iron
#

πŸ˜ƒ

sterile bronze
#

Now you need a 410 cassette drive to go with it.

manic glacierBOT
marble hornet
#

@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?

teal bear
#

@idle owl can you point me at a url where I can dl/setu the cpx like you did for your tut?

slender iron