#circuitpython-dev

1 messages ยท Page 186 of 1

tidal kiln
#

just to make sure - you're currently trying this out on a CPX?

upbeat plover
#

yeah the circuit playground express

tidal kiln
#

ok. here's a boot.py i've used before:

# boot.py
# Use this to control file system state on power up and/or HW reset.
# If read only is set to False, then CP can write to the file system.
# If read only is set to True, then USB can write to the file system.
import storage
from adafruit_circuitplayground.express import cpx

# toward ear = False (CP can write to file system)
# toward note = True (USB can write to file system)
read_only = cpx.switch
print("Read Only = ", read_only)
storage.remount("/", read_only)
#

you use the CPX slide switch to set mode

upbeat plover
#

ok so have cpx lib on board

idle owl
#

Make sure you paste the right thing into boot.py. If you paste the code.py into boot.py you run the risk of CircuitPython never completing startup. Not that I would know.

upbeat plover
#

im still getting OSError 30

#

i tried reset button, and unplugging it and waiting then plugging it back in

tidal kiln
#

boot.py is run automatically with every reset

upbeat plover
#

switch in both possitions

#

with open("/tmp.txt", "a") as fp:
... fp.write("hello, world!")
...

#

then gives me error

tidal kiln
#

do you see tmp.txt in the CIRCUITPY folder?

upbeat plover
#

it was not there so i made one and still nothing

tidal kiln
#

@upbeat plover what version of CP are you currently running?

#

actually. nvm.

#

post the contents of boot_out.txt

upbeat plover
#

okay

#

Adafruit CircuitPython 3.0.0-rc.0 on 2018-06-18; Adafruit CircuitPlayground Express with samd21g18
boot.py output:
Testing
is it working?

#

lol... i think i found issue, was using Atom, now using Mu gana go back and try with your boot.py

tidal kiln
#

you're using RC0

upbeat plover
#
Adafruit CircuitPython 3.0.0-rc.0 on 2018-06-18; Adafruit CircuitPlayground Express with samd21g18
boot.py output:
Traceback (most recent call last):
  File "boot.py", line 6, in <module>
  File "adafruit_circuitplayground/express.py", line 691, in <module>
  File "adafruit_circuitplayground/express.py", line 121, in __init__
  File "adafruit_circuitplayground/express.py", line 146, in detect_taps
  File "adafruit_lis3dh.py", line 334, in _read_register
MemoryError: 
tidal kiln
#

ok. that's similar to what i'm getting with 3.0 (see my note about updating CP firmware above)

upbeat plover
#

okay ill try with 2.2.0

tidal kiln
#

use 3.0

#

same with bundle

#

i'm going to cook up a different boot.py that doesn't use adafruit_circuitplayground

upbeat plover
#

alright im gana put the newer CP on there then storage.erase_filesystem() and put newer lib in there

tidal kiln
#

ok. that'll be good to get back to a clean slate.

#

then try this for boot.py:

import board
import digitalio
import storage

# For Gemma M0, Trinket M0, Metro M0/M4 Express, ItsyBitsy M0/M4 Express
#switch = digitalio.DigitalInOut(board.D2)
# switch = digitalio.DigitalInOut(board.D5)  # For Feather M0/M4 Express
switch = digitalio.DigitalInOut(board.D7)  # For Circuit Playground Express
switch.direction = digitalio.Direction.INPUT
switch.pull = digitalio.Pull.UP

# If the switch pin is connected to ground CircuitPython can write to the drive
read_only = switch.value
print("Read Only = ", read_only)
storage.remount("/", read_only)
manic glacierBOT
upbeat plover
#

@tidal kiln working now, thank you for your patience

tidal kiln
#

yeah!

idle owl
#

I didn't know you could add prints to boot.py

tidal kiln
#

and they show up in boot_out.txt
handy!

idle owl
#

Weirdly I just said "handy!" to someone else.

tidal kiln
#

keen!

tulip sleet
#

@crude fossil saw your several-hours old msg; are you still having trouble?

prime flower
#

easy to use, esp. for when people are going to be doing differential reads (nice to see what pins are available per-IC)

tulip sleet
#

vg! yes, that's the idea. I do it all the time when I can't remember something (or am just a lazy typist)

prime flower
#

It'll be neat when it's implemented on the crickit

#

like CRICKIT.MOTOR_PIN# or however it's implemented

tulip sleet
#

i think we've got what you want:

>>> from adafruit_crickit import crickit
>>> sv = crickit.
touch_2         touch_1         __init__
feather_drive_stepper_motor     servo_4         servo_3
drive_4         servo_2         drive_2         drive_3
SIGNAL8         drive_1         servo_1         __qualname__
SIGNAL3         SIGNAL2         SIGNAL1         SIGNAL4
SIGNAL7         SIGNAL6         __module__
continuous_servo_4              SIGNAL5
continuous_servo_1              _touch
drive_stepper_motor             _drive
continuous_servo_3              _servo
continuous_servo_2              neopixel        init_neopixel
reset           _motor          feather_drive_1
feather_drive_2                 feather_drive_4
feather_drive_3                 seesaw          stepper_motor
dc_motor_1      dc_motor_2      touch_4         touch_3
prime flower
#

๐Ÿ˜„ yep

solar whale
#

@upbeat plover I tried you code on my adalogger with an si7021 -- no memory proble, but it does throw an erro -- have not looked into it yet ```

import hexthat
Logging to filesystem
0.73105
Temperature: 27.2926 degrees C
Humidity: 79.7887%
Temperature = 24.5
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "hexthat.py", line 49, in <module>
File "hexthat.py", line 45, in <module>
TypeError: object with buffer protocol required

upbeat plover
#

almost done with a newer version that needs testing

#

here is what i got so far

#
import adafruit_sdcard
import adafruit_si7021
import board
import busio
import digitalio
import math
import microcontroller
import storage
import time

# si7021 sensor
i2c = busio.I2C(board.SCL, board.SDA)
sensor = adafruit_si7021.SI7021(i2c)
# LEDs
redled = digitalio.DigitalInOut(board.D13)
redled.direction = digitalio.Direction.OUTPUT
greenled = digitalio.DigitalInOut(board.D8)
greenled.direction = digitalio.Direction.OUTPUT
# SD card
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
cs = digitalio.DigitalInOut(board.SD_CS)
sdcard = adafruit_sdcard.SDCard(spi, cs)
vfs = storage.VfsFat(sdcard)
storage.mount(vfs, "/sd")

# calculate current Vapour-pressure deficit
def vpd():
    temp = sensor.temperature
    # Estimate Saturation Pressure
    # Saturation Vapor Pressure method 1
    es1 = 0.6108 * math.exp(17.27 * temp / (temp + 237.3))
    # Saturation Vapor Pressure method 2
    es2 = 6.11 * 10**((7.5*temp)/(237.3+temp)) / 10
    # Saturation Vapor Pressure method 3
    es3 = 6.112 * math.exp(17.62 * temp / (temp + 243.12)) / 10
    # Saturation Vapor Pressure mean
    es = (es1 + es2 + es3) / 3
    # actual partial pressure of water vapor in air
    ea = sensor.relative_humidity / 100 * es
    # return Vapour-pressure deficit
    vpd = es - ea
    return vpd

def sdwrite(sdlog):
    with open("/sd/log.txt", "a") as f:
        redled.value = True
        print(sdlog)
        f.write(sdlog)
        redled.value = False

print("Basic Logging of Vapour-pressure Deficit to filesystem")

while True:
    # CPU temperature
    cput = microcontroller.cpu.temperature
    # write to text fiel
    sdwrite('VPD ='.format(vpd()))
    sdwrite('Temperature: {} degrees C'.format(sensor.temperature))
    sdwrite('Humidity: {}%'.format(sensor.relative_humidity))
    sdwrite('CPU Temperature = {0:f}\n'.format(cput))
    sdwrite('----next-----')
    #
    greenled.value = True
    time.sleep(10)
    greenled.value = False
#

not sure how the def sdwrite will do...have not tested that stuff yet was about to test it with CPX

#

with tweek

solar whale
#

it runs ```
Press any key to enter the REPL. Use CTRL-D to reload.

Adafruit CircuitPython 3.0.0 on 2018-07-09; Adafruit Feather M0 Adalogger with samd21g18

import hexthat2
Basic Logging of Vapour-pressure Deficit to filesystem
VPD =
Temperature: 27.1746 degrees C
Humidity: 80.8797%
CPU Temperature = 25.044954

----next-----
VPD =
Temperature: 27.1746 degrees C
Humidity: 80.9331%
CPU Temperature = 24.826691

----next-----
VPD =
Temperature: 27.1961 degrees C
Humidity: 80.9865%
CPU Temperature = 24.826691

----next-----
VPD =
Temperature: 27.1961 degrees C
Humidity: 81.1315%
CPU Temperature = 24.826691

----next-----
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "hexthat2.py", line 64, in <module>
KeyboardInterrupt:

upbeat plover
#

the VPD is missing... hmm

solar whale
#

contents of log.txt -- after both runs - may be mixed ---This is another line!--- VPD =Temperature: 27.1746 degrees CHumidity: 80.8797%CPU Temperature = 25.044954 ----next-----VPD =Temperature: 27.1746 degrees CHumidity: 80.9331%CPU Temperature = 24.826691 ----next-----VPD =Temperature: 27.1961 degrees CHumidity: 80.9865%CPU Temperature = 24.826691 ----next-----VPD =Temperature: 27.1961 degrees CHumidity: 81.1315%CPU Temperature = 24.826691 ----next-----

upbeat plover
#
import adafruit_sdcard
import adafruit_si7021
import board
import busio
import digitalio
import math
import microcontroller
import storage
import time

# si7021 sensor
i2c = busio.I2C(board.SCL, board.SDA)
sensor = adafruit_si7021.SI7021(i2c)
# LEDs
redled = digitalio.DigitalInOut(board.D13)
redled.direction = digitalio.Direction.OUTPUT
greenled = digitalio.DigitalInOut(board.D8)
greenled.direction = digitalio.Direction.OUTPUT
# SD card
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
cs = digitalio.DigitalInOut(board.SD_CS)
sdcard = adafruit_sdcard.SDCard(spi, cs)
vfs = storage.VfsFat(sdcard)
storage.mount(vfs, "/sd")

# calculate current Vapour-pressure deficit
def vpd():
    temp = sensor.temperature
    # Estimate Saturation Pressure
    # Saturation Vapor Pressure method 1
    es1 = 0.6108 * math.exp(17.27 * temp / (temp + 237.3))
    # Saturation Vapor Pressure method 2
    es2 = 6.11 * 10**((7.5*temp)/(237.3+temp)) / 10
    # Saturation Vapor Pressure method 3
    es3 = 6.112 * math.exp(17.62 * temp / (temp + 243.12)) / 10
    # Saturation Vapor Pressure mean
    es = (es1 + es2 + es3) / 3
    # actual partial pressure of water vapor in air
    ea = sensor.relative_humidity / 100 * es
    # return Vapour-pressure deficit
    vpd = es - ea
    return vpd

def sdwrite(sdlog):
    with open("/sd/log.txt", "a") as f:
        redled.value = True
        print(sdlog)
        f.write(sdlog)
        redled.value = False

print("Basic Logging of Vapour-pressure Deficit to filesystem")

while True:
    # CPU temperature
    cput = microcontroller.cpu.temperature
    # write to text filesystem
    vapord = vpd()
    sdwrite('VPD ='.format(vapord))
    sdwrite('Temperature: {} degrees C'.format(sensor.temperature))
    sdwrite('Humidity: {}%'.format(sensor.relative_humidity))
    sdwrite('CPU Temperature = {0:f}\n'.format(cput))
    sdwrite('----next-----')
    #
    greenled.value = True
    time.sleep(10)
    greenled.value = False
#

slight change made line 56ish

#

hmm ill add /r/n to lines.... too

solar whale
#

runnin test -- you can perfect it when you get your HW ๐Ÿ˜‰

upbeat plover
#

yeah thank you very much

solar whale
#
>>> 
>>> 
>>> import hexthat3
Basic Logging of Vapour-pressure Deficit to filesystem
VPD =
Temperature: 27.1746 degrees C
Humidity: 80.689%
CPU Temperature = 24.390106

----next-----
VPD =
Temperature: 27.1746 degrees C
Humidity: 80.628%
CPU Temperature = 24.608414

----next-----
VPD =
Temperature: 27.1532 degrees C
Humidity: 80.6203%
CPU Temperature = 24.826691

----next-----
VPD =
Temperature: 27.1532 degrees C
Humidity: 80.5517%
CPU Temperature = 24.717553

----next-----
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "hexthat3.py", line 65, in <module>
KeyboardInterrupt: 
>>> 
#

looks great!

#

you should be all set when you get the board! Good luck!

upbeat plover
#

thanks

solar whale
#

You're welcome!

pallid cliff
#

Any idea why a cpx and crickit would be throwing an error on a continuous servo demo code?

Code:

import time
from adafruit_crickit import crickit

print("1 Continuous Servo demo!")

while True:
    crickit.continuous_servo_1.throttle = 1.0 # Forwards
    time.sleep(2)
    crickit.continuous_servo_1.throttle = 0.5 # Forwards halfspeed
    time.sleep(2)
    crickit.continuous_servo_1.throttle = 0   # Stop
    time.sleep(2)
    crickit.continuous_servo_1.throttle = -0.5 # Backwards halfspeed
    time.sleep(2)
    crickit.continuous_servo_1.throttle = -1 # Forwards
    time.sleep(2)
    crickit.continuous_servo_1.throttle = 0   # Stop
    time.sleep(2)

REPL

 File "code.py", line 7, in <module>
  File "adafruit_motor/servo.py", line 132, in throttle
  File "adafruit_motor/servo.py", line 66, in fraction
  File "adafruit_seesaw/pwmout.py", line 57, in duty_cycle
  File "adafruit_seesaw/seesaw.py", line 302, in analog_write
  File "adafruit_seesaw/seesaw.py", line 376, in write
  File "adafruit_seesaw/seesaw.py", line 376, in write
  File "adafruit_bus_device/i2c_device.py", line 102, in write
OSError: [Errno 5] Input/output error
solar whale
#

@pallid cliff That code works on mine.

pallid cliff
#

huh

#

It consistently does one cycle, then throws the errors and just runs half foward endlessly

solar whale
#

at least the servo turns -- not quite sure the speeds are as expected -- first time I've tried a CR servo.

#

no erros for me - but it does not got to full stop

pallid cliff
#

yeah, just noticed that too. doesn't pause. It is still a fairly new library though, think it's worth opening an issue?

solar whale
#

I have not looked at it at all -- not sure what to expect. Open an issue if you thing the driver is at fault. May just need to be calibrated.

#

as t the errors -- that sounds like a wiring or power issue.

#

waht are you powering it with?

pallid cliff
#

3 AA batteries

#

power supplies are in the mail

solar whale
#

make sure they are fresh

pallid cliff
#

yup

solar whale
#

I'll try it on batteries

#

sorry - don't have a 3xAA availble so can't compare.

pallid cliff
#

It's all good. what CR servo are you using?

solar whale
#

FS90R

pallid cliff
#

I'm using a fitec fs5103r, and just noticed it has a trim for the zero position, so at least mine is stopping now ๐Ÿ˜›

solar whale
#

nice! but you still get the errors?

pallid cliff
#

yup, consistent errors though

#

one cycle through the code, then freeze

#

newest crickit firmware and circuit python 3.0 on the cpx with the crickit library

solar whale
#

same - here -- mine does have an adjust pot as well -- have not played with it.

#

Have you tried other crikit funtions -- does it typucally comunicate OK?

#

What are you powering the CPX with?

pallid cliff
#

dc motors are good, stepper on drive is good, standard servo is good. signal io is good. cap touch is good

#

USB power for CPX

#

It does throw "RuntimeError: SDA or SCL needs a pull up" despite the screws being on really good

#

occasionally

solar whale
#

DO you have a meter to check to battery voltage -- they are alkalines, correct?

pallid cliff
#

not as fresh as they were, 4.2V

#

yes alkaline

solar whale
#

That is not normal -- possibly worth making sure the contact to the spacers/xcrews are clean so it is maing good contact, Try new batteries . 4.2 is getting low.

#

just tried using 4 NiMH batteries and it works fine

pallid cliff
#

ok, contacts checked, 3 new batteries, and it's doing multiple cycles. but only 4.6V, not that much more

solar whale
#

just checked my batteries -- its at 5.2V -- they may be alkalines as well -- still much highr voltage

pallid cliff
#

might have to buy some NiMH batteries

solar whale
#

so no errors

pallid cliff
#

none yet, almost a dozen cycles in a row

solar whale
#

so I think its jsut a power issue --

pallid cliff
#

sigh, it's always the simple things isn't it? ๐Ÿ˜›

solar whale
#

it says > 4.5 -- guess they mean it!

pallid cliff
#

yeah!

solar whale
#

gotta run -- good luck

pallid cliff
#

Thank you!

solar whale
#

you're wecome

#

@pallid cliff it does say 4-5V so 4.2 "shpuld" work --- hopefully someone else with more knowledge of the CRIKIT power req can comment.

pallid cliff
#

alright

manic glacierBOT
manic glacierBOT
tulip sleet
#

@pallid cliff Also measure the voltage when it's under load. It might be sagging when the servos are moving

indigo hazel
tidal kiln
#

@indigo hazel easiest is to just use one of the built in animations
LIGHT -> show animation...

#

but another way to do what you're doing is to use the LIGHT -> show ring block

#

then you can individually set each neopixel with one block

#

also, try asking in #help-with-makecode, the makecode devs often hangout in that channel (this one is for circuitpython)

indigo hazel
#

Okay thank you.

tidal kiln
#

np. i'm just a user myself. you might get better info over there. good luck!

raven canopy
#

so much stuff to install on a new system... ๐Ÿ˜ต

tidal kiln
#

indeed. always shocks me too. and you need to install stuff that installs the stuff that then runs the install scripts that installs the stuff so you can finally install the thing.

meager fog
#

@idle owl hey0 kattni since yer at a conf, maybe @tidal kiln can take a look at makecode'n the zombie game

idle owl
#

Ok. @tidal kiln? I can link you to the CP part of the guide and the code.

tidal kiln
#

think i already got it from earlier?

idle owl
#

Yes, that was the same

meager fog
#

you can TEAMUP

#

also, @tidal kiln you make hilarious images, please make some free-clipart CPX-zombie and CPX-nurse to demonstrate how it works?

tidal kiln
#

uh oh. thanks. but it might just be free clip art that you're already seeing?

#

that i just re-used

meager fog
#

yah thats what i mean

#

i like your mashups ๐Ÿ˜ƒ

tidal kiln
#

ah. gotcha.

meager fog
tidal kiln
#

looks like that was made to fit

#

@idle owl for makecode, will probably just make three separate programs. they choose what they want to be when they drag the UF2 over. or is there a reason to have it be field changeable?

idle owl
#

@tidal kiln Not that I'm aware of, we just did the CP code in one program. I don't know that it's a requirement. @meager fog?

meager fog
#

i think for circuitpython it was easiest to do this way

#

for makecode its fine to have 3 programs

#

because you cant edit easily

#

so just make em fixed-usage

#

and they can drag the uf2 around

tidal kiln
#

zombie.uf2, healer.uf2, human.uf2 easy peasy

meager fog
#

but see how you fair!

#

its gonna be very easy in makecode - btw if fading LEDs is hard, just blink the neopixels instead

tidal kiln
#

oh, i see, that's for the zombie and healer

#

human is just a health counter, no fading (pulsing)

meager fog
#

right

tidal kiln
#

hmmmm. a human can become a zombie....that puts a wrinkle in it...

#

@idle owl i'll play around with it and then can just send you the makecode published links

meager fog
#

yeah @tidal kiln

idle owl
#

@tidal kiln Alright, I'm out for tomorrow and the weekend but I'll take a look at them on Monday.

meager fog
#

@tidal kiln you can also send to me - just post in basecamp

#

ill add ya!

tulip sleet
#

just trying to load a CPy build onto the pca10056. I haven't done this for a couple of weeks and can't remember if I can do this with dfu-flash or not. When I try it doesn't work, but I'm not sure how to get the board into DFU mode.

solar whale
#

@upbeat plover ran you latest code ```Adafruit CircuitPython 3.0.0 on 2018-07-09; Adafruit Feather M0 Adalogger with samd21g18

import adalog_VPD
Basic Logging of Vapour-pressure Deficit to filesystem
Start/Reset

VPD = 0.444998

Temperature: 25.1797 degrees C

Humidity: 86.0219%

CPU Temperature = 22.535064

----next-----

VPD = 0.450739

Temperature: 25.1797 degrees C

Humidity: 85.8694%

CPU Temperature = 22.535064

----next-----

VPD = 0.455337

Temperature: 25.1905 degrees C

Humidity: 85.7397%

CPU Temperature = 23.189759

----next-----

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "adalog_VPD.py", line 76, in <module>
File "adalog_VPD.py", line 67, in <module>
KeyboardInterrupt:

cunning crypt
#

OK, so, quick question. My Metro M4 Express seems to be corrupting the main.py file.

#

What am I doing wrong?

tulip sleet
#

what editor are you using?

cunning crypt
#

I'm editing a main.py file locally, saving it, copying it over. Verify it's correct. Reboot the device, and... corrupted file.

#

Notepad++, locally.

tulip sleet
#

how are you copying it over, on what OS

cunning crypt
#

Standard file transfer, Windows 10

tulip sleet
#

you have to eject after copying to force all the bits to get written

cunning crypt
#

This has worked for M0 devices previously.

#

Aha, OK

solar whale
#

@tulip sleet not dfu-flash -- you can use the Jlink interface and just flash

tulip sleet
#

it might look ok from the windows side but that's because windows is looking at the cache, not the actual flash

#

@solar whale but can I do dfu-flash at all, without jlink?

#

how are you "rebooting the device?" reset button or ctrl-D?

solar whale
#

not taht I am awate of -- it is not a dfu boot loader -- justa sec

cunning crypt
#

@tulip sleet Copied it over. Waited a few seconds. Ejected. Saw confirmation it was ejected. Unplugged, plugged back in. Same deal.

tulip sleet
#

@cunning crypt the filesystem could be corrupted. Don't unplug or press the reset button. Just go into the repl and type ctrl-D

#

to get a soft reload

cunning crypt
#

I seem to remember a board doing this and having to re-copy CP over to it.

tulip sleet
#

to fix up the filesystem, save any files you don't have backups of, and then do in the REPL:

import storage
storage.erase_filesystem()
#

you'll have a clean CIRCUITPY and can copy stuff back

solar whale
tulip sleet
#

ok, wasn't sure if it included DFU also. I can use the jlink, or nrfjprog

#

thanks!

solar whale
#

use BOARD=pca10056 not feather52840 though

tulip sleet
#

BOARD=pca10056 SD=s140 ??

#

do i need the softdevice yet?

solar whale
#

to get to boot loader hold buttons 1 and 2 then RESET

tulip sleet
#

wow, where is that written down?

solar whale
#

I think the default sofdevice will be fine

#

it's not

#

default softdevice is 6.0.0

tulip sleet
#

is the MSC bootloader working now? I thought it was just for show

#

and not yet working

solar whale
#

it works

#

just checking a few things

#

been awhile sice I did it...

cunning crypt
#

@tulip sleet Seems to be working. Except now it's filling the character LCD with blank spaces as soon as it runs. Interesting.

solar whale
#

@tulip sleet trying to recall how I got the bootloder installed in the first place...

tulip sleet
#

I know - I did that a long time ago. It might be in the bootloader repo README.md

cunning crypt
#

Aaand fixed. Apparently the LCD doesn't like "nothing" happening.

#

Thanks @tulip sleet - Filesystem seems to be working great now.

solar whale
#

its on that same page - CDC boot laoader make SD=s140 BOARD=pca10056 bootloader

tulip sleet
#

@cunning crypt great. If you tire of ejecting all the time, you can use an editor that writes everything back immediately: VS Code, Atom (with a plugin), emacs, vim, Mu. NOT Notepad++ or Notepad.

cunning crypt
#

Yeah, notepad++ is for local only

#

When I copy the files over now, I can watch it reload in the REPL

#

Haven't had to eject.

solar whale
#

@tulip sleet it may support both dfu and MSC -- sorry -- still a bit fuzzy

tulip sleet
#

i'll try the reset +1 +2. I was just doing reset

solar whale
#

did you load the bootloader?

#

then switch to the nrfUSB port

tulip sleet
#

i did a couple of weeks ago

solar whale
#

comes up as NRF52BOOT

tulip sleet
#

ah, mine says FEATHER5284, so I think it's a much older version. I need nrfjprog. It's not in my PATH. (It was once but that's when I was trying Limor's versions.)

#

so plug in from the jlink port, and then load bootloader and then switch to nrf USB (on long edge)?

solar whale
#

yes

tulip sleet
#

which nrfutil are you using... from our repo?

#

or the pip install one?

solar whale
#

so I guess the dfu laoder may also still work, but have not tried it -- jerryneedell@Ubuntu-Macmini:~/projects/feather_adalogger$ nrfutil version nrfutil version 0.5.2d from the repo

#

It takes quite awhile to reboot after flash -- much longer tahtn SAMD -- be patient - give it 30 seconds

tulip sleet
#

ok, got 0.5.2d from adafruit/nRF52_nrfutil, but where is nrfjprog, or is that just an alias?

solar whale
#

I did not do anything special for it -- just insatlled nrfutil

#

it may come from Segger jerryneedell@Ubuntu-Macmini:~/projects/feather_adalogger$ nrfjprog -v nrfjprog version: 9.7.2 JLinkARM.dll version: 6.30h

tulip sleet
#

what do which nrfutil and which nrfjprog say?

solar whale
#

jerryneedell@Ubuntu-Macmini:~/projects/feather_adalogger$ which nrfutil
/usr/local/bin/nrfutil
jerryneedell@Ubuntu-Macmini:~/projects/feather_adalogger$ which nrfjprog
/home/jerryneedell/bin/nrfjprog

#

nrfjprog is installed locally

tulip sleet
#

k, i'll look around for where to get it from

raven canopy
#

isn't it part of the SDK in the repo? (the cobwebs in my brain can't read back far enough...)

solar whale
#
lrwxrwxrwx  1 jerryneedell jerryneedell   54 Oct 29  2017 nrfjprog -> /home/jerryneedell/projects/nrf52840/nrfjprog/nrfjprog
tulip sleet
#

it's in nRFx-Command-Line-Tools. That's what the link downloads

raven canopy
#

ahh...yeah. guess i downloaded it before. ๐Ÿ˜„

solar whale
#

looks like I have not updated it recently -- must have been part of the DK setup originally

tulip sleet
#

wow this is spread out all over the READMEs

solar whale
#

9.7.2 is still version I have

#

yup! Arturo was my guide

tulip sleet
#

i installed 9.4.0, i'll look for the upate

#

but I have liftoff! NRF52BOOT!

solar whale
#

woohoo!

tulip sleet
#

i accidentally flipped that "nRF ONLY | default" slide switch above LED1 the wrong way and it made the board appear dead. took a while to figure that out. luckily I have two boards

raven canopy
#

@slender iron i totally just remembered about running adabot; new laptop and getting ready for vacation has consumed most of my brain. and, i'll have to figure out the credential part.

solar whale
#

too many buttons and switches on this board!

tulip sleet
#

ok REPL!

raven canopy
#

yeah, i was a little surprised by that when i unpacked mine. "oh good..more variables". ๐Ÿ˜„

solar whale
#

cool!

#

I like the "cheat sheet" stencilled on the back ofr finding pins

tulip sleet
#

the power slide switch is confusing. I have it in the middle, VDD. USB position does not seem to be right, though you might think that would be it

solar whale
#

I've never moved it

#

VDD

tulip sleet
#

when the board seemed dead, i tried that first

#

the point of all this was to test the merge from upstream micropython, which seems finally to be working on all platforms. Still have to run the unix tests

solar whale
#

Wow - nice!

tulip sleet
#

you might be an esp8266 guinea pig on this - but I think it's ok. Upstream changed some stuff about the serial connection and I had to change it back: they were relying on dupterm which we moved to multiterminal, but not providing the same functionality. we are drifting further and further away from upstream on various things

#

i spent like four hours looking at 3-way diffs to vet the merges and fix things up

#

ugh

solar whale
#

I've noticed taht if I try to unmount the nrf CIRCUITPY - it often tells me it has to finish writing then gives an error when I thrn it off. seems to be OK afterward, but just a heads up

tulip sleet
#

it's a completely different USB stack, so not surprising, thanks

solar whale
#

just remounted and unmounted fine so its not reproducible -- don't think it is issue-worthy -- yet

tulip sleet
#

have you tried the beta saleae Logic program yet? v nice, does realtime capture display

solar whale
#

oohh - thanks had not seen it

#

just restarted reading KTowns BLE book -- determined to learn how to use it!!

#

too many acronyms

raven canopy
#

๐Ÿ˜Ÿ ๐Ÿ˜Ÿ

.... Running Patch Checks On 93 Repos ....
tulip sleet
#

@slender iron PR #1057 failed in travis (a long time ago); prob you know that already

raven canopy
#

hmm...well, that didn't work at all. but, its a local problem. also, it seems to not be grabbing everything (unless it's another symptom of the local problem)

.... Patches Applied: 0
.... Patches Skipped: 1
.... Patches Failed: 59
slender iron
#

@tulip sleet yup. been heads down on rom byte hunting. string compression looks promising using huffman encoding

#

will likely do translation support as well

#

qstr 4217 bytes -> 2807

tulip sleet
#

wow, you're on a roll. I think I finally finished the merge. have repl in atmel, esp8266, and nrf. still need to run unix tests

solar whale
#

Brings tears to my eyes -- someone actually remembered to test the esp8266 ๐Ÿ˜‰

solar whale
#

goodnight all! ๐Ÿ’ค

raven canopy
#

@slender iron @tulip sleet so the first 6 patches (initial live test) from adabot have been run for the code of conduct. successively! buuuuut, its causing Travis failures with pylint 2.0 on a few repos. do we want to run the rest of the CoC patch, and then run a patch for .travis.yml? or would you rather put up the patchfile now and then run the two patches together?

slender iron
#

@raven canopy both ๐Ÿ˜ƒ

#

๐Ÿ’ค

raven canopy
#

@slender iron k. i'll grab the commit from the one Dan did and submit the PR for the patch. found something i missed that needs a PR anyway. ๐Ÿ˜„

#

๐Ÿ’ค as well...

gentle bronze
#

@solar whale eject/safe remove send a scsi command which is not handled now, causing host to complain. It will be fixed in the next PR.

#

@tulip sleet both uf2 and cdc (dfu) works. UF2 only upgrade the firmware, cdc/dfu in addition to firmware could also upgrade the bootloader + Softdevice

gentle bronze
#

SD is defaullt to s140 for nrf52840 (feather & pca10056) and s132 for nrf52832 (feather & pca10040). That is most people do, only need to SD= for no SD usage.

solar whale
#

@gentle bronze when using CDC/dfu is it done via the J-Link USB port or the nrf USBPort?

gentle bronze
#

it is done via CDC on the nrf52840, there is no usage of jlink CDC

solar whale
#

OK so all flashing of bootlader, SD or firmware is done via the same port the one labeled nrfUSB near the BLE antenna - no need to use the one near the battery any more.

gentle bronze
#

Yeah, one you flashed the bootloader, it is self upgradable.

solar whale
#

great! thank you. That makes sense.

gentle bronze
#

Flash target still just jlink + nrfjprog, dfu-gen dfu-flash or uf2 copy if you want to omit jlink

#

No problem, it is confusing since we have 2 cdc, and we used to work with jlink cdc until recently

solar whale
#

OK - good -- that is what I had been doing -- since loading the botloader via Jlink, I have only updated the firmware via uf2.. I have not tried dfu or loading bootloader again. I did not realize that the dfu was an option.

gentle bronze
#

Yeah, dfu is better for scripting, we will use it for arduino repo as well.

solar whale
#

ah -- that makes sense. So the feather52840 will support both dfu and UF2 -- the feather52832 will only ever use dfu -- it cannot support UF2

gentle bronze
#

Exactly, since 832 does not has native usb hw

solar whale
#

Thank you for all the clarifications. The PCA10056 board is partiularly confusing because of the multiple ports and the various buttons and switches -- it takes some time to get used to it!

#

for the PCA10056 -- you have to hold buttons 1&2 down when RESETTING to get to the bootloader -- on the feather52840 will it just be a double-tap of the RESET like the other feathers?

gentle bronze
#

Yeah agreed, to get into bootloader mode, you need to press button0 while reset. Too bad double reset trick cannot be implemented if nrf5x series, at least I couldn't.

#

Only button1, holding 2 button will put it into dfu mode with ota support

solar whale
#

hm -- let me try again

gentle bronze
#

Button1 : normal dfu + uf2, led0 blink

#

Button1 and 2: ota dfu + uf: LED1 will also blink as well

solar whale
#

oh -- you are correct -- ok so 1 & 2 -- still works, jut not needed but allow OTA

gentle bronze
#

Double reset won't work since nrf5x will clear all the registers, sram mem. Nordic spents extra logic gate to make sure they are all clean. I tried but couldn't figure to do double reset trick. You are back to default when reset.

solar whale
#

OK - so the feather52840 will have to have a differnt method.

gentle bronze
#

I mean the chip is back to default

solar whale
#

Wow -- I tried button 1 & 2 and I see device adaDFU in the Bluefruit app on my phone!!

#

and I can connect to it!

gentle bronze
#

You can upgrade it there as well, though you need to use Nordic app, since our app does not support the pkg format (it still uses the good old init+binary)

#

Use the pkg .zip file created in the dfu-gen target, the same one cdc interface used to upgrade

#

Another note, if holding only button2 while reset, it will clear the firmware, serving as factory reset button

#

Only bootloader remains afterward

solar whale
#

AH -- good to knw!

gentle bronze
#

Ah, there are 2 extra ways to go into bootloader as well without using phys buttons (not implemented yet)

#

The 1200bps cdc touch, which is used by Arduino. And a simple command using usb control transfer

#

The usb control command may have a bit of driver issue with windows (needs extra step for binding libusbk driver). But it wilk work flawless under macos and linux. Can be used as part of dfu-flash target for auto update

#

I wilk submit a PR for bootloader update later.

solar whale
#

That sounds great! Thank you for all you have done and for how quickly this has been implemented!

gentle bronze
#

No problems, the usb stack is written for like 3 years :( . So it is not really that quick :((

solar whale
#

Not for you -- the nrf52 has gotten a quick start due to all your work!

#

just reading instructions in the nrf app for using OTA -- sounds really nice -- I'll give it a try when I feel brave!

gentle bronze
#

๐Ÿ˜‹

#

For nr52, @indigo wedge did a lot more, I am just involved in usb related thing ๐Ÿ˜‰

solar whale
#

It's a great team! Thanks for answering all my questions this morning ( evening for you)

bronze geyser
#

i'm trying to get up to speed on makefile. i found i was getting confused when building CP. i am trying to build a debug "hello.c" binary/cross-compile to itsy-bitsy m0version. i think my current challenge is in the linker script. i found one for samd21x18.ld w/in CP build. However, I think there is something (when defining sections?) that strips the symbols (e.g.: compile w/ -ggdb)? What am I missing? Any advice greatly appreciated.

gentle bronze
#

Yeah, not at all.

solar whale
#

@bronze geyser to build the DEBUG version just make DEBUG=1 BOARD=xxxx

bronze geyser
#

@solar whale yes. I can do that and it works great. However, i am trying to understand what is going on within a makefile since i found it confusing. so i started w/ basic hello.c then went through setting up CFLAGS, LFLAGS. I get a .elf. gdb however tells me the .elf does not have symbol files. I am not using a -s in the link stage, i do use -ggdb in the compile stage. So i thought is was the .ld file?

#

@solar whale - i very much thank you for your reply.

solar whale
#

@bronze geyser sorry - you are much deeper into it than I realized. Hopefully Dan or Scott can help soon.

bronze geyser
#

@solar whale i do seem to have my hip boots on. again, thank you. it was kind of you to jump in.

solar whale
#

@bronze geyser I have enjoyed following and learning from your progress. Thank you!

manic glacierBOT
small cypress
main meteor
#

It's an I2C device, so it should not only be possible but pretty straightforward.

manic glacierBOT
raven canopy
manic glacierBOT
manic glacierBOT
tulip sleet
#

@bronze geyser Hello World in this case is more like three paragraphs than "Hello World" in terms of all the supporting stuff

#

Getting the .ld map and the Makefile right are tricky. I'd suggest taking the existing Makefile and .ld map and pruning them rather than starting from scratch. Maybe you are doing that already.

#

there is also a lot of setup needed at the beginning to set up the clocks, etc. initialize the chip in other ways, etc.

bronze geyser
#

@tulip sleet thank you. i'm using atmel-samd/boards/samd21x18.ld . I leave it be. i think that is right? but i'm not getting the symbols (compile with -ggdb, LFLAGS doesn't strip symbols)....

tulip sleet
#

it's a tremendous amount to learn and understand and may not be productive if your main goal is understanding how to modify or enhance CircuitPython.

bronze geyser
#

@tulip sleet so i'm trying to take an online embedded systems course. They use Keil. I wanted to use Atom + gdb command line. I thought this would help me get a better feel for why the 2nd call to standby wasn't coming back to me (i.e.: i could use more embedded sys background).

#

@tulip sleet I also dorked around with Eclipse. But the more I used Eclipse, the more I gasped, particularly around managed make files. OMG!

#

@tulip sleet I got sad just thinking about Eclipse and Keil. And Happy thinking about Atom. I mean, i get pluggins that show me the actual colors of hex values. Now THAT is useful!

tulip sleet
#

note that when we link we use gcc to link, not ld. Not sure if you are doing it as well. The settings in the Makefile and in py/*.mk are tuned to do the right thing.

bronze geyser
#

@tulip sleet - i'm using ld because the examples i found did this. hmmm...

tulip sleet
#

Have you tried Atmel Studio? (Or maybe you don't have Windows.) Another approach is to use Atmel START to build a simple program: it generates a Makefile that does "the right thing", I believe (though I haven't tried it). https://start.atmel.com

#
$(BUILD)/firmware.elf: $(OBJ)
    $(STEPECHO) "LINK $@"
    $(Q)$(CC) -o $@ $(LDFLAGS) $^ -Wl,--start-group $(LIBS) -Wl,--end-group
    $(Q)$(SIZE) $@ | $(PYTHON3) $(TOP)/tools/build_memory_info.py $(LD_FILE)
bronze geyser
#

@tulip sleet i don't have Windows.... and thank you. i will take a closer look at the makefile w/in atmel-samd.

tulip sleet
#

try one of the simple examples in Atmel START as well. The config .h files are kind of a mess, but the basic .c and Makefile files are fairly simple.

bronze geyser
#

@tulip sleet Will do. I very much appreciate your time/help.

tulip sleet
#

happy to help!

bronze geyser
#

@tulip sleet - ooh YIPPEE (at least for now...?) the Atmel start goo worked... WOW...i guess the lesson for me is USE THE DARN HALL (two LLs intentional) layer.

manic glacierBOT
upbeat plover
#

what is OSError 28? is it out of space?

#

had CPX logging all night and finally at 0 bytes left

loud reef
#

I am new to circuitpython but I have a neopixel strip connected. It's RGBW so I was wondering if the circuitpython neopixel lib supports them.

raven canopy
#

@bronze geyser what course are you taking? I was searching the ARM offerings earlier today, coincidentally.

solar whale
#

@loud reef yes it does here is an example of the "color wheel" on a feather_m4_express -- the main change was to add the bpp=4 parameter to the configuration line ```
from digitalio import *
from board import *
import neopixel
import time

pixpin = D6
numpix = 8

strip = neopixel.NeoPixel(pixpin, numpix, bpp=4, brightness=0.3,auto_write=False)

def wheel(pos):
# Input a value 0 to 255 to get a color value.
# The colours are a transition r - g - b - back to r.
if (pos < 0):
return (0, 0, 0, 0)
if (pos > 255):
return (0, 0, 0, 0)
if (pos < 85):
return (int(pos * 3), int(255 - (pos3)), 0, 0)
elif (pos < 170):
pos -= 85
return (int(255 - pos
3), 0, int(pos3), 0)
else:
pos -= 170
return (0, int(pos
3), int(255 - pos*3), 0)

def rainbow_cycle(wait):
for j in range(255):
for i in range(len(strip)):
idx = int ((i * 256 / len(strip)) + j)
strip[i] = wheel(idx & 255)
strip.show()
time.sleep(wait)

try:
while True:
rainbow_cycle(0.001)

except:
pass

finally:
strip.fill((0,0,0,0))
strip.show()

#

or as noted here - you can spcify the pixel_order and then the bpp is set automatically -- I have not tried taht myself.

loud reef
#

Oh, ok. Thanks

tulip sleet
#

the default pixel order is GRBW, but with bpp=3 (it ignores the W). So do go ahead and set bpp=4

solar whale
#

@tulip sleet the RTD implies it set bpp based pn pixel_order -- is that not correct?

#

Note that bpp does not need to be specified as it is computed from the supplied pixel_order.

tulip sleet
solar whale
#

agreed -- best tp specify bpp.

loud reef
#

I'll try that with the example

tulip sleet
#

It should probably say "Note that if you supply pixel_order, the bpp will be set appropriately" or something like that.

solar whale
#

It's sort of implied, since if you don't set pixel_order then it would not know bpp was 4 instead of 3, but it could be more explicit.

#

@tulip sleet I finally took the plunge and upgraded to Ubuntu 1804 -- so far so good -- no issues yet

tulip sleet
#

only problem I had was getting the shutter screenshot app to be able to edit. It's possible but annoying

#

i am using cinnamon and it's working fine with the supplied cinnamon instead of having to use a ppa.

solar whale
#

I did update the team-gcc-arm ppa to use "bionic" but I was altready at the latest version so no real change. all the boards built fine with the toolsets I have installed

upbeat plover
#

here is some code for logging on to CPX, without the need for any lib in CPX, for "CircuitPython 3.0.0 on 2018-07-09"

bronze geyser
#

@raven canopy well...i'm not sure i'd recommend it. i get up super early and love to watch videos while i walk on a treadmill. so i found this udemy course - https://www.udemy.com/embedded-system-programming-on-arm-cortex-m3m4/learn/v4/content - it caught my eye because of arm cortex-m...i figured it's better than watching some other stuff...

Udemy

With hands on Coding using C Programming and assembly on ARM Cortex M Processor based Microcontroller

upbeat plover
#

My feather M0 adalogger and sensor came in the mail this morning. ๐Ÿ˜ป

bronze geyser
#

@raven canopy the instructor / guy / person got into installing Keil to make main.c ... it was at that point i went down a rabbit hole saying "how hard can it be?" to do this using Atom....so just for jollies I check out someone else. They use Eclipse...ho ho...i think..i've used that before...so i go down THAT rabbit hole...but recalled...oh just how yucky managed make / etc. was and then there are all these layers... so back to "Atom - good to meet you, how hard can it be?"

#

@raven canopy then Atom says to me "Hey HappyDay...check out the plug in that shows all these colors..." this made me think...well, ok...but...

#

@raven canopy i did find https://hackaday.com/2016/03/22/embed-with-elliot-arm-makefile-madness/ very nicely written/informative. The challenge is alot of stuff is using the ST chips.. microchip's "programming to the peripherals" and such seems a tad more convoluted/complicated.

To wrap up my quick tour through the wonderland of make and makefiles, weโ€™re going to look at a pair of possible makefiles for building ARM projects. Although Iโ€™m specifically targetingโ€ฆ

upbeat plover
#

any update for current version of bossac?

#

like using the GUI that comes with bossac

#

i clicked info then used info from it before i changed to match the settings.... select; "boot to flash", "brownout reset", "brownout detect", "Erase all"

#

circuitpython working fine

#

<@&327289013561982976> is there a way to mount the sd card for windows to use when plugged into PC?

cunning crypt
#

@upbeat plover Not that I am aware of.

upbeat plover
#

mkay thanks ill just take it out and put it something else lol...

#

thanks for reply

torn grail
#

Just to confirm after a bunch of searching... There is no TFT support in Circuit Python, right? I have a 480x320 FeatherWing, but did not see HX8357D in the Bundle.

#

And I should say that I am using 8266, not M0. ๐Ÿ˜‰

solar whale
torn grail
solar whale
#

Youโ€™re welcome

velvet scroll
#

is there a way in the REPL on a circuit playground express running circuit python to get its circuitpython version out of it? trying to determine why my installed libs files are getting that mpy msimatch

#

ah wait if you enter repl and reset it prints it out

#

sweet got it running. once youre set up this is pretty sweet

torn grail
#

When I log in to the REPL on ESP8266, I get this message: Do you?
"Adafruit CircuitPython 3.0.0 on 2018-07-09; ESP module with ESP8266"

torn grail
#

I'm still trying to make the HX8357D display work... Uploaded all the latest modules from adafruit_rgb_display and adafruit_bus_device, and have esp8266_tft_featherwing.py saved as main.py on my device. When I reboot, I see a white screen. No errors in the serial console, even when I try a hard or soft reset. Any ideas? Running 3.0.0 on ESP8266. Thanks!

#

O I C --- The demo script is for the ILI9341. ugh. I'll try changing it to HX8357 and see how much smoke that makes!!

#

No smoke, but also no fire... Still a while screen.

#

I guess the hx8353 is not close enough to the hx8357, so it appears that it may not be supported after all. ๐Ÿ˜ฆ

tidal kiln
#

@velvet scroll you can also look in boot_out.txt

inland tusk
#

I have several circuit playground expresses that i bought before 3.0.0 was released.

#

I have several circuit playground expresses that i bought before 3.0.0 was released I flashed one of them with the new release using uf2 file. When I reset it the demo did not work. There was no indication of any errors. Do I need to refresh the /lib diretory too?

coarse topaz
#

You'll need to use new bundles too, yes

inland tusk
#

that explains it.

#

thaanks

coarse topaz
slender iron
inland tusk
#

@idle owl You should put a note in the docs for updating from 2 to 3 that in order for the demo code to work, you need to replace the files and directories in lib with new ones from the new 3.0.0 library bundle. I mention this because I have a number of cpx's that I bought before the change over to 3.

marble hornet
#

may i ask, did adafruit opensource the bin for the as7262 flash chip? i could not find it on github or the website?

raven canopy
tulip sleet
#

@slender iron woot! you have been on a tear! I noticed micropython is commented out. Is that temp?

raven canopy
#

also, your "flash chip" may have me confused. i couldn't find a flash chip with that part number...

marble hornet
#

@raven canopy I am looking for the bin that is flashed onto the onboard soic flash via the pogo on the back. Link to store incoming...

raven canopy
#

@marble hornet after looking at the datasheet, i understand what you're asking now. per the sheet, the software comes from the manufacturer (ams). i looked on ams's website and didn't see any downloads available. i imagine the license is proprietary and restricted to release...

marble hornet
#

@raven canopy thanks!

#

there has to be a way around that sparky [insert devious laugh]

#

read and save off of purchased unit?

#

good night all, sleep well

velvet scroll
#

hmmm from adafruit_crickit import crickit is triggering a memory allocation error - do I have to remove libs from the bundle to be able to run this?

#

(circuit express w/ crickit)

#
  File "code.py", line 4, in <module>
  File "adafruit_crickit.py", line 58, in <module>
MemoryError: memory allocation failed, allocating 235 bytes
#

it seems like its in the library itself

raven canopy
#

@velvet scroll are you using the CPX Crickit firmware?

velvet scroll
#

im using cpx bundle for v3 of circuit express

raven canopy
#

that firmware has the Crickit library "frozen" into the firmware to keep available space to a maximum.

velvet scroll
#

ah so switch it out with the current one?

#

from the 3.0 bundle?

raven canopy
#

yep. that link is to the 3.0 version.

velvet scroll
#

do i throw that into the lib folder?

#

or top level?

raven canopy
#

no. that is entirely different firmware. so go into bootloader mode (CPLAYBOOT) and drag that over.

velvet scroll
#

ah i see. ok one sec

#

yeah that did it

#

stupidly i had a motor with a wheel plugged in

#

so naturally it dove off the table haha

raven canopy
#

๐Ÿ˜†

velvet scroll
#

now to bother you with one more - why is it asking to enable a pullup resistor butn ot list that in the given examples? (Setting up a servo now)

#
  File "code.py", line 4, in <module>
  File "adafruit_crickit.py", line 373, in <module>
RuntimeError: SDA or SCL needs a pull up

#

examples dont show setting SDA or SCL pull ups

#

oh

#

cause i cut power

#

alright sweet got both kinds of movement working

#

thanks

raven canopy
#

see...didn't need me at all! ๐Ÿ˜„

velvet scroll
#

yeah didnt see itb efore because i powered it down so i wouldnt have it firing itself off of the desk again

#

now to think up a project that uses this thing...

gentle bronze
#

@bronze geyser you may be interested in segger embedded studios as well. It is better than Keil in many ways. No limit for personal usage, debugging is super easy as long you have jlink.

raven canopy
#

if i'm being honest, i've been spoiled by Atmel Studio...

gentle bronze
#

Those vendor-specific is all nice, though I hate switching IDE when switching mcu :)

#

Keil is still look like 9x GUI ๐Ÿ˜๐Ÿ˜

raven canopy
#

understandable. i've only worked the SAMDs at this point. i will need to figure something out if i ever dive into the nRF; still haven't even plugged in the DK yet. ๐Ÿ˜„

#

*esp doesn't count, since its pretty much flash and hope...

slender iron
#

@tulip sleet yup, just experimenting

gentle bronze
#

Yeah, I would hope to just use Segger Studio for all mcu now. It is still gcc, so we have option to compile with makefile project with ease and decent debugger tool

raven canopy
#

@slender iron in case you didn't see it, i put in the PR for adabot. once that is merged, i'll run the full monty. i have a suspicion though that the patch script is going to need some additional GitHub API handling for the data throttle; i've seen mixed numbers of repos when running tests.

#

and..i finally got FREQM clock setup working. first measurements of DFLL: 467nnMHz

slender iron
#

@raven canopy will get to it in the next few days after taking a break

raven canopy
#

k. i'll be out of town for the next couple weeks starting Sunday, but not a total ghost.

tawny creek
raven canopy
#

@tawny creek nice find!

tawny creek
#

Building a board for this myself!

manic glacierBOT
tawny creek
#

Lets say I connected the trinket m0's unused pins and want to use them, is there a guide where I can learn how to properly define them? or move around existing pin definitions? (Is there a general guide to doing this, where should I begin) --

upbeat plover
#

is there a way to set localtime on CPX, currently all i can use the time.localtime() for is to check how long has been powered for

nocturne sluice
#

thanks!

solar whale
#

@nocturne sluice there is no WiFi support for that board in CircuitPython. You can run CP on it - use the Feather M0 Basic image. The only WiFi support is for the ESP8266.

proven bluff
#

hello everyone

solar whale
#

@proven bluff Hello

tulip sleet
#

@tawny creek you can just look at atmel-samd/boards/*/pins.c to see how other boards do the mapping. The general idea is to maximize available functionality, such as exposing a set of pins that can be used for a particular SERCOM, etc. It's kind of tedious. Ladyada calls this pin sudoku, because changing one pin usually has a ripple effect.

proven bluff
#

how do I debug print to serial from within the C code in circuit python? I'm running my code on Feather M0 Express if that matters.

solar whale
#

@proven bluff I'm not sure I unerstand what you are trying to do. Can you provide an example?

proven bluff
#

So I'm in the middle of shared-modules/os/init.c, I don't have a JTAG debugger and I wanted to use a printf like function to display some values.

solar whale
#

I thought you could just use printf @tulip sleet is there any reason not to just use printf ?

tulip sleet
#

a simple printf() is not usually available but mp_printf(&mp_plat_print, "%d %d", i, j) is

solar whale
#

thanks - does DEBUG=1 enable simple printf? I thought I saw some examples using it

tulip sleet
#

i don't think it's across everything; there are some files that define a printf() macro when a debug flag is enabled

solar whale
#

ah --thanks -- sorry for the confusion.

tulip sleet
#

it would be nice ๐Ÿ˜ƒ

manic glacierBOT
proven bluff
#

thanks @solar whale and @tulip sleet

solar whale
#

@proven bluff Good luck! I'm glad you asked -- I learned from it as well ๐Ÿ˜‰

timber mango
small cypress
#

Hmm, is uctypes a built-in library? I can't seem to find it in the downloads, but importing it in my code gets "ImportError: no module named 'uctypes'"

timber mango
#

what's the context, @small cypress

#

One time I used 'ag' on an entire source tree only to find what I was looking for was enumerated in the same file I was working on. ;)

small cypress
timber mango
#

Do you have a paste or screenshot of the error in context?

tidal kiln
small cypress
tidal kiln
#

yah. that may be out of date. sry ๐Ÿ˜ฆ

#

see the warning though

#

you're running into one of the micropython vs. circuitpython differences

#

i think it was originally left in early on, but not sure what current status is

stuck elbow
#

it's actually still there

#

it's only available on the unix port, though

#

because it doesn't make any sense on a non-Von Nemann architectures

tidal kiln
#

and that driver looks like it's a python wrapper for a C library

raven canopy
#

@small cypress did you look at the existing CircuitPython VL53L0X library? I would work from that, and adjust any of the protocol functioning...

proven bluff
#

another newbie question: how do I run all the tests I can? tests/run-tests passes with 33 tests skipped

small cypress
#

hmmm might try that

proven bluff
#

I don't want to make a PR with some test failing

tidal kiln
raven canopy
#

@proven bluff if you setup a TravisCI account, and link it to your forked repo, it will run all the tests.

proven bluff
#

thanks

raven canopy
#

there is a way to do it all locally...i've just never used it. ๐Ÿ˜„

manic glacierBOT
proven bluff
#

hmm, github is trying to be too smart when suggesting PR branches didn't notice the destination is adafruit/circuitpython

manic glacierBOT
fathom trellis
#

Hi. I'm running into some issues building the unix port at the EuroPython sprints, and I'm wondering if anyone has advice for how to troubleshoot.

#

I'm running:
make axtls

on osx in the circuitpython/ports/unix directory.

I'm seeing the following errors:

sha512.c:119:15: error: implicit declaration of function '__be64_to_cpu' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
       w[t] = be64toh(w[t]);
              ^
../ssl/os_port.h:68:20: note: expanded from macro 'be64toh'
#define be64toh(x) __be64_to_cpu(x)
                   ^
sha512.c:119:15: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
../ssl/os_port.h:68:20: note: expanded from macro 'be64toh'
#define be64toh(x) __be64_to_cpu(x)
                   ^
2 errors generated.
make[2]: *** [sha512.o] Error 1
make[1]: *** [target] Error 2
make: *** [build/libaxtls.a] Error 2
tulip sleet
#

@small cypress could you file an issue about uctypes being in the doc but not in any build? Thanks.

#

@fathom trellis I see that's a warning converted to an error. You could remove -Werror from the Makefile.

#

make sure you did git submodule update to get the latest axtls

#

I don't see that issue when it's compiled on Linux

#

so it may have to do with your build environment

#

This is in the Makefile: CWARN = -Wall -Werror

upbeat plover
#

I have a few questions about using a battery, with adalogger;
How does the CHG LED work?
3.7v 2045mAh 7.8Wh work?

small cypress
#

@tulip sleet Do I file it on the doc itself?

tulip sleet
#

no, just in adafruit/circuitpython; there's a "documentation" tag, I think.

tidal kiln
tulip sleet
#

hexthat is asking same questions in projecthelp

manic glacierBOT
small cypress
#

not sure how to add a label to it myself, think you need write access

tidal kiln
#

@small cypress you don't have that option?

small cypress
#

don't have the button ๐Ÿ˜‰

manic glacierBOT
tulip sleet
#

no prob we will label it

tidal kiln
#

done

upbeat plover
#

@tidal kiln @tulip sleet sorry for double posting question, posted first here and then noticed it was more a project help thing then circuitpython... sorry guys wont happen again

tulip sleet
#

no prob, just delete your originals if you move or give a pointer to the channel you've moved to

upbeat plover
#

im not sure how to do a pointer but i can delete =}

small cypress
upbeat plover
#

sweet thanks

small cypress
#

all of the hashtags, or one anyway

manic glacierBOT
half sonnet
#

Hi, thank you for this forum. Have done some googling, but can't find anything about USB Midi and CircuitPython - are there any projects or libraries out there?

tulip sleet
half sonnet
#

Thanks @tulip sleet I'll see what I can work out myself

small cypress
#

flogs himself by just trying to get the VL53L0X library working with the VL53L1X

bronze geyser
tawny creek
#

@tulip sleet thanks,, good idea! Is it non destructive for me to just tinker around with the pin configurations? or is that ripple effect something I can be more aware of in some way?

idle owl
#

Just finished with the CircuitPython Open Spaces at PyOhio. Went well!

manic glacierBOT
#

This merges from https://github.com/micropython/micropython/commit/25ae98f07cb3c4488cb955403dfe56b8bb8db6f0.

I did some REPL testing, and it passes the Unix tests (that took some work), but some hidden issues may show up. Atmel, esp8266, and nrf all compile and bring up the REPL.

Some notes:

  • Churn in extmod/vfs* : some files removed, some renamings. We exposed some statics for our use elsewhere, which means it was not a simple merge.
  • In MPy, lots of #ifdef -> #if, but withou...
raven canopy
#

holy moly, Dan! that looks even more painful than i imagined. a tip-o-the-hat, and thank you! ๐ŸŽฉ

bronze geyser
#

@hathatch thank you for the Segger tools recommendation. i'm in process installing.

lone sandalBOT
idle owl
#

Adafruit_CircuitPython_Featherwing motor isn't working

#

I'll file an issue but we tried to use it and it says something like "pwm doesn't have frequency"

raven canopy
#

well, it doesn't if you don't give it one... ๐Ÿค” ๐Ÿ˜†

small cypress
#

Hmm, would it be possible to add uctypes to CircuitPython from MP? Trying to figure out how to use the existing library for the older ST sensor has me wanting to run and hide.

tidal kiln
#

@idle owl do you have more specifics? what code were you running?

lone sandalBOT
idle owl
#

I don't have it in front of me anymore.

raven canopy
#

[unrelated to above] hooray for predictably reoccurring HardFaults! always means your getting close to being complete...at least that's what i'm telling myself on this one. ๐ŸŽ‰ ๐Ÿ˜„

tidal kiln
#

@idle owl i'll take a look through guide for anything obvious. but, yah, if you can recreate the error, let me know. (or is it too late?)

idle owl
#

@tidal kiln Greg said he'd try it again tonight, but I'm not sure he'll have time. If I don't get him to do it, I'll try to recreate it when I get home. He's super new to CircuitPython so I'd need to walk him through recreating it.

#

It was failing on line 77/78 of stepper.

tidal kiln
#

@idle owl i think i see it. looks like a bug.

idle owl
#

@tidal kiln That's what I thought

fathom trellis
#

@tulip sleet -- My submodules were already up to date. I just pulled them down when I forked the project today. Your tip worked, and the build completed successfully. My environment is OSX High Sierra

tidal kiln
#

@idle owl lots of layers, pretty convoluted, but i'll try:
adafruit_motor/stepper.py in StepperMotor __init__:

self._coil[i].frequency = 2000

where _coil is a tuple of outputs that should support PWM. However, in adafruit_featherwing/motor_featherwing.py, the stepper is created with something like:

self._stepper1 = stepper.StepperMotor(self._pca.channels[10], self._pca.channels[9],
                                      self._pca.channels[11], self._pca.channels[12])

and _pca is a PCA9685 instance. So we look there. In adafruit_pca9685.py, .channels is a PCAChannels instance, the accessor of that returns a PWMChannel (from the same adafruit_pca9685 module). That class has a frequency property, but no frequency setter.

#

woo. that's a quick brain dump. let me read through it and edit if needed....

idle owl
#

Right. Needs to be set to True I thought. I figured it was a change from 2.x

tidal kiln
#

but i'm not sure if the problem is that class's lack of a frequency setter, or if adafruit_motor/stepper.py is doing something wrong.

#

my guess is the former

#

or, to put it another way, this would work:

print(self._coil[i].frequency)

but this doesn't:

self._coil[i].frequency = 2000
#

the other important detail is that the PWM support is coming from the PCA9685, and not a built in PWM channel.

#

i.e., you're using adafruit_pca9685, not pulseio.PWMOut

#

@idle owl it might be an easy fix, if you want to try??

fierce oar
#

hey circuit python folks! i'm not able to find the files to copy to my trinket to keep my os from putting hidden files on my device. i'm following these instructions, but when i click on the link to download the zip, the unzipped files don't contain the files i'm looking for: .fseventsd
.metadata_never_index
.Trashes

#

am i just looking in the wrong place? any help appreciated ๐Ÿ˜ƒ

tidal kiln
#

@fierce oar i see them. the link on that page just goes to the Downloads page for the Trinket M0 - that's where the actual .zip files are - did you download one of those?

fierce oar
#

yes, i downloaded both the V2 and V1.0.0 and they only contain these

#

@tidal kiln ^

tidal kiln
#

@fierce oar that's what i see. maybe your software is hiding dot files?

fathom trellis
#

@fierce oar if you're using a mac, hold down Cmd + Shift + . (dot) in the finder window to see hidden files

#

press the same key combination again to hide them

fierce oar
#

@fathom trellis omg there they are!

#

thanks @fathom trellis & @tidal kiln

#

sneaky os

tidal kiln
#

@ninja--#8902 awesome. thanks.

lone sandalBOT
small cypress
#

@fathom trellis Holy moly that's useful

fathom trellis
#

even better, if you want to see hidden files permanently, do:

defaults write com.apple.finder AppleShowAllFiles YES
killall Finder

(fyi this will cause all your currently open finder windows to close)

manic glacierBOT
#
[adafruit/circuitpython] New branch created: 3\.x\-hallowing
raven canopy
#

^^^ well, that's intriguing... ^^^ ๐ŸŽƒ?

lone sandalBOT
tulip sleet
#

@tawny creek the pin shuffling is done by studying the possible assignments based on the big tables in the "I/O Multiplexing" section in the datasheet.

manic glacierBOT
#
[adafruit/circuitpython] New branch created: micropython\-25ae98f\-merge
#
[adafruit/circuitpython] branch deleted: micropython\-25ae98f\-merge
tawny creek
#

@tulip sleet Thank you kind sir!!

#

would consider myself a newbie when it comes to all of this, and appreciate the guidance! I haven't had much time to dedicate to electronics recently ๐Ÿ˜ญ

drowsy swift
#

Hello! Just started playing with my playground express today. Question -- when looking for add on modules I found - https://learn.adafruit.com/character-lcds/circuitpython-code - which says it works with circuitpython, and even has an example express board in the wiring diagram, but I don't see anything about the playground express or if it would be possible to wire to that too?

Wiring up a character LCD to an Arduino

#

Hello! Just started playing with my playground express today. Question -- when looking for add on modules I found - https://learn.adafruit.com/character-lcds/circuitpython-code - which says it works with circuitpython, and even has an example express board in the wiring diagram, but I don't see anything about the playground express or if it would be possible to wire to that too?

Wiring up a character LCD to an Arduino

lone sandalBOT
lone sandalBOT
proven bluff
#

@drowsy swift if you give me a link to your specific character module I can help you out with wiring

#

the issue is that sometimes some pins are swapped and I don't want to give wrong info

lone sandalBOT
upbeat plover
#

CircuitPython support "Adafruit Mini Color TFT with Joystick FeatherWing"???

#

that thing is pretty sweet, think of making a portable game with; feather M4, adalogger feather wing (to store massive amounts of code) and the "Adafruit Mini Color TFT with Joystick FeatherWing"

lone sandalBOT
upbeat plover
#

What is the REPL command to get how much ram you have used or have left? I remeber seeing Tony D do it in a video, but not sure of how... I thought it was in the "import os" but i dont see it when i do dir(os)

drowsy swift
#

@proven bluff Thanks for your reply. I haven't chosen one yet, but the one I linked is a likely contender, I like the RGB backlight option. So I do have all of the pins required for one? It comes down to a matter of translating the instructions to the correct ones?

coarse topaz
#
import gc
gc.mem_free()

might be what you're thinking of @upbeat plover

upbeat plover
#

yes that is it

#

Thank you so much

tulip sleet
#

@slender iron I'm getting all the builds to work on the micropython merge. Is there any reason we are still building the qemu build?

lone sandalBOT
timber mango
solar whale
#

@tulip sleet just pulled PR1068 and am buildiing boards -- tried CPX crickit - no problems yet.. Anything in particular taht it would be helpful to try?

fervent fog
#

hi lady ada and friends ๐Ÿ˜ƒ

tulip sleet
#

@solar whale thanks for testing. esp8266 merge was not easy, so if you can try some things, esp network, filesystem, and repl-related, that would be great. nrf could use more testing too but that is undergoing enough change that I'm not as worried about breaking it. I'm still trying to get the docs build to work and I think I will remove the qemu-arm build -- not sure it is useful for us anyway. I tried it locally and qemu itself crashes (!).

solar whale
#

OK -- I'll concetrate on the ESP8266 and nrfs

drowsy swift
timber mango
#

HD44780 is a chip used on many (not all) character LCD's.

It needs I think 6 pins back to the microcontroller, plus power, ground, and especially, a 'contrast' line (not controlled by the microcontroller).

The backpack saves you a lot of wiring, but if there's enough GPIO on a given board, you can drive it 'manually'.

#

@drowsy swift Not sure I understood all that.

Signals (pins) SDA and SCL are specific to a two-wire serial protocol called i2c (inter-integrated circuit; aka iic or SMB).

drowsy swift
timber mango
#

Voltage levels can be a problem; I don't remember offhand what the elegant solution is for a 3.3 volt target board such as the Circuit Playground Express.

You may need a level shifter IC such as 74HCT125 (let me look that up for sure).

fervent fog
#

wow all you care about is a stupid microchip ๐Ÿ˜›

timber mango
#

@drowsy swift Well you want to look at i2c and SPI and GPIO on the pinouts page of the learning guide for the Circuit Playground Express.

#

8 GPIO (general purpose Input/Output) pins. That's more than enough to drive a character LCD using a 4-bit parallel interface.

#

Not sure if you can (easily) do SPI (Serial Peripheral Interface) with the Circuit Playground Express (CPX) or not. @solar whale or @tulip sleet would know (several others as well).

drowsy swift
#

So all of the pins are GPIO? I don't have to use them for their printed purpose? like I don't have to use a6/rx for rx?

timber mango
#

No just about (if not every single) port pin is GPIO on most boards. There may be one or two exceptions but I can' t think of any at the moment.

I'm not used trying to squeeze an extra GPIO pin out of a given system, so I may be mistaken.

#

The silcscreen labels are unknown to the microcontroller. ;)

#

In the case of an analog input, you are not going to see that on every single pin by any means.

drowsy swift
#

Ahhhh fantastic!

#

That helps a bunch @timber mango

solar whale
#

@timber mango at first glance , i don't see the SPI pins broken out on the CPX -- I have not tried it. SPI is used for some of the internal sensors.

timber mango
#

Traditionally any pin good for GPIO (including ones you don't get a solder pad for) are labeled D1 D2 D3 and so on, somewhere in documentation.

These correspond 1:1 with the Arduino IDE development environment.

#

@jerry I just don't remember if software SPI is used for CPX projects or not.

@drowsy swift you don't need hardware SPI to do SPI projects but they won't run as fast, and there may be software issues you'd have to resolve less easily.

solar whale
#

@timber mango -- hold on -- I think they are there - just not in the guide -- still looking

drowsy swift
#

Is there a good resource I can use to learn more about this stuff? Buried somewhere in the adafruit site or elsewhere? Seems like most of the pages I've come across are only so technical

timber mango
#

SCL and SDA are SERCOM 5.1 and SERCOM 5.0 (respectively).

#

@drowsy swift I skip over a lot of introductory matter, but any article in the Learn site that has a @idle owl byline is going to be good for you. ;)

#

Once you are not swimming in new terminology it starts to make better sense.
I would personally start with the basics, to get comfortable with very simple expectations, such as uploading the firmware and how that system (all by itself) typically behaves.

This way you get a gut feeling for when it's not performing as expected.

solar whale
timber mango
#

@solar whale right right right

drowsy swift
#

Awesome, I had the built-ins page next on my list to read. I had finished the first round of setting it up yesterday, adding libraries, trying repl and all...Lol, before you linked the parts pal, I was thinking you meant an actual person

timber mango
#

haha yeah Howard the Parts Pal .. he visits here right after the Mac Tools guy leaves ;)

drowsy swift
#

oooo that one is nice

timber mango
#

It is at least technically an SPI device.

#

I am not able to remember a thing about how I programmed it -- oh wait I wrote a Circuit Python driver for it (or a direct program in CircuitPython, anyway)

#

I also did one in the Arduino IDE (probably used an existing Library that LadyAda wrote aeons ago)

#

I even got the Adafruit graphic working on it.

#

Unpublished because at the time I hadn't understood github very well, and was mixed up about intellectual property right and so forth.

drowsy swift
#

Sounds like you've been doing this for a while now?

timber mango
drowsy swift
#

gotcha, will do, and thank you!

timber mango
#

Nice to meet you. Looking forward to the next time.

solar whale
#

@tulip sleet so-far so-goo on esp8266 -- connect to network - I can upload/download via ampy -- send data to adafruit_io -- looks good!

tulip sleet
#

vg!

timber mango
#

@solar whale thank you (as always) for your input.

#

fades

lone sandalBOT
slender iron
#

@tulip sleet I thought we used it to run tests. I'm ok turning it off

#

hi hi @fathom trellis glad to see you here (we met at pycon us)

tulip sleet
#

it does run a simple test. The unix port runs most of the tests, I think.

slender iron
#

@small cypress you may be able to use struct instead. Its worth looking into

#

@tulip sleet up to you!

tulip sleet
#

i'll double check and remove it if it is duplicative.

slender iron
#

kk. back to chores for me

solar whale
#

@tulip sleet not looking good for nrf52832 --- does not come out of bootloader after load -- still checking

tulip sleet
#

i only tried pca10056

solar whale
#

I'll try that next -- want to double chech the SOFTDEV settings

lone sandalBOT
solar whale
#

@tulip sleet reverting to master works on feather52832 -- pr1068 does not -- do you want me to open an issue?

#

or just post to the PR

tulip sleet
#

just add a comment to the pr

solar whale
#

will do

#

@tulip sleet never-mind ----I repeated the build -- including reflash of the bootloader and now it works ...... will try a few more tests

tulip sleet
#

!

solar whale
#

I'm confused -- It now works with both the default SOFTDV_VERSION (2.0.1) and (5.0.0) -- I had flahed both the bootlader and the image a few times earlier when it failed --- looking at history to see if I had somehting wrong -- in any case, its fine now -- REPLOK -- it does a BLE scan -- ampy works

tulip sleet
#

i myself have not internalized what needs to get built and loaded with what

#

on the nrf boards

solar whale
#

or I should say ampy works as usual -- still some ampy issues with ampy the nrf port -- but not new

#

the defaults should be OK , but I have been using the SOFTEV_VERSION 5.0.0 on the 52832 -- just to be cool ๐Ÿ˜Ž I have no idea what the diffences are. pca10056 defaults are fine s140/SOFDEV_VERSION 6.0.0.. 52832 uses SD=s132

#

ampy "get" does not work on the nrf's -- I think there is an issue open already -- I'll verify

manic glacierBOT
#

I pulled this PR and loaded it on to a few boards for test:
CPX_crickit -- no issues
esp8266 - no issues - tested Iternect connection -- send data to Adafruit-IO - tested ampy read/write
nrf52 - feather52832 -- on first attempt I had several cases where to board would not exit bootloader - after flashing. Treied multiple times. Then in order to provide documentation, I reverted to current master build - and reflashed bootloader and CP (used default SD=s132 SOFTDEV_VERSION=2.0.1)
this w...

#

@hathach could you confirm this suggested change? Thanks.

From @jerryneedell in https://github.com/adafruit/circuitpython/pull/1068#issuecomment-40870499:

note that instructions for loading the bootloader to the feather52832 are out-dated on
https://github.com/adafruit/circuitpython/tree/master/ports/nrf/boards/feather52832

the command is shown as

$ make BOARD=feather52832 SERIAL=/dev/tty.SLAB_USBtoUART SOFTDEV_VERSION=5.0.0 boot-flash

but it should be

$ make BOARD...
manic glacierBOT
tulip sleet
lone sandalBOT
manic glacierBOT
#
[adafruit/circuitpython] branch deleted: 3\.x\-hallowing
manic glacierBOT
languid sage
#

Hi All, Just got Adabox008, and thought I'd build a proper bump-bot. I saw JP's Carnival Bumper Car bot, and the Ruiz's Brothers' Lego Crickit rover, but both of those use MakeCode. Not that I'm against new fangled programming tools, but I'd really feel at home with C (as in Arduino) or some flavor of Python (as in derived from C) or anything else that is of that ilk (procedural, structurable programming language). I'm most familiar with languages such as these, as I've been around since Fido's grandaddy was a tiny pup (actually, JFK was President when I took my first programming class). So my question is: is there a piece of code that I can use to build a bumper car bot program that is written in CircuitPython, or Arduino that I can use with a Crickit (either the CPX or the Feather version) and where do I find it? Circuit Python on CPX would be best, as I can make use of all of the CPX on-board goodies as my desire to add totally cool and useless features (i.e., creeping elegance) to the bot. My goal is to provide this bot, as a ruggedized toy to my 1-year old twin grandkids. - Thanks

torpid goblet
#

Still playing with automated testing. Current project is automated board detection using the logic from mu. Does anyone have a suggestion for a high quality large (10 to 15 port) powered USB hub? My cheap 5 port unit is not up to the task ๐Ÿ˜ฆ

slender iron
#

@torpid goblet I like plugable's hubs

torpid goblet
#

@slender iron thanks I'll look them up.

solar whale
#

@torpid goblet On my Linux system, I have had problems with connecting to CP devices via USB 3.0 hubs. USB 2.0 hubs work much better for me. Of course, you mileage may vary ;-)

torpid goblet
#

@solar whale thanks. From a testing point of view would their be a difference USB 2.0 and 3.0? If so I will go with 2.0 to avoid the hub trigging extraneous errors.

solar whale
#

The only testing impact I have seen is that it won;t connect on the 3.0 hub ๐Ÿ˜€ I have not ut a lot of effort int testing this. I t was jsut simple to use a 2.0 hub. I hope others can comment on their experience.

torpid goblet
#

@solar whale thanks, What About doing hard reset. I was looking at splicing a relay into the power lines of the USB cables to be able to do hard resets. Would that be useful or is that getting too carried away?

slender iron
#

I have two of their 7 port hubs. they are usually 4 port hubs daisy chained internally

solar whale
#

my hub allows me to cut the power to each port. That comes in handy. It does not cut the data lines which can be problematic if the poard is externally powed, then it connects even if the port is "off". It is a vety inexpesive 4 port belkin hub.

#

sorr about the typos -- having trouble editing...

brazen rover
#

Is there a Raspberry Pi specific channel to ask about pinout/hardware stuff? (I'm new to discord and Pi but have programming experience---but not for embedded systems etc.)

torpid goblet
#

interesting. thanks

solar whale
brazen rover
#

OK. All I got so far is crickets over there... I guess people are asleep or doing other stuff on a sunday night.

#

thanks for the response @solar whale

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
bronze geyser
#

@timber mango thank you very much for the o'reilly make book recommendation. It certainly clarifies much of the initimidated confusion i have had when looking at make files. To the point that some things look quite elegant. I can see the engineers in the late 70's and 80's find honing their toolset. What a legacy! How wonderful that we can stand work from the shoulders of their work.

lone sandalBOT
lone sandalBOT
solar whale
opaque patrol
#

@solar whale I haven't seen one. What IC is the display driver?

solar whale
#

still trying to find that out -- not finding a lot of information

opaque patrol
#

not sure if that helps

solar whale
#

yup - just found that as well -- may be relevant!

stuck elbow
#

it's st7735

#

same as the bigger ones

opaque patrol
#

But the joystick feather wing says it uses I2c not SPI

stuck elbow
#

it uses both

#

i2c for the joystick and spi for the display, afaik

#

hard to say for sure with no docs or schematic

solar whale
#

@stuck elbow Its not clear to me how to set up the RGB driver for this - It support the st7735, but since this goes through the seesaw, I'm not sure how to configure it.

stuck elbow
#

the display doesn't go through seesaw

solar whale
#

ah -- thanks so it s just eh backlight

stuck elbow
#

backlight and maybe the dc/rst pins

#

but they are normal pin objects, you can pass them around

solar whale
#

ok -- that helps me get started

indigo wedge
solar whale
#

I am totaly confused by the lack of documentation for the miniTFT -- no idea how to assign the pins ...

opaque patrol
solar whale
#

@opaque patrol -- Thank you!!!

opaque patrol
#

Just looked at it though, don't see the tft

solar whale
#

yes - tahts a different board -- getting closeer though!

opaque patrol
#

Look at the image showing the back of the board (or look at the board) and you can see which pins are connected to CS and DC and that there are solder pad to change them

solar whale
#

yes - I see the CS/DC, but are thsose for the display or the TFT -- don't seem to work for the display.

opaque patrol
#

This is what I have for the 1.44" display, just need to change the rst pin...```
dc = digitalio.DigitalInOut(board.D5)
cs = digitalio.DigitalInOut(board.D6)
rst = digitalio.DigitalInOut(board.D9)

cs.switch_to_output(value=1)
spi = busio.SPI(clock=board.SCK, MOSI=board.MOSI, MISO=board.MISO)
spi.try_lock()

spi.configure(baudrate=24000000, polarity=0, phase=0)
spi.unlock()

cs.value = 0

display = st7735.ST7735R(spi, dc, cs, rst, 128, 128)

#

Change the screensize too

solar whale
#

my confusion is that apparently te RST goes through the seesaw , but I have no idea how to configure taht -- I'm just missing something fundamental here.

#

@opaque patrol Thanks for trying to help -- As I noted, I' am missing some baisc understaning of how this board works -- maybe more coffee will help.

opaque patrol
#

This is one I want to get, they sold out really fast

solar whale
#

I was lucky to get one, now just need to make it work! When I ordereed it, I could have sworn I saw a new driver or some other info pop up but I can't find it now...

prime flower
#

@solar whale โ˜• always the answer. I'll ask dean about the board when he gets in

solar whale
#

@prime flower Thanks!

opaque patrol
#

I don't know if you need to have rst connected. It defaults to None and is only used if set

manic glacierBOT
#

I just got an email from Nordic about new versions of the softdevices, now at v6.1.0:

SoftDevice S112 v6.1.0

For a full overview of all changes, please read the release notes located in the installation directory.

Highlights of this release:

Production tested for nRF52832
API to get the SoftDevice variant, flash usage, reserved PPIs, and reserved interrupt priorities
Fixed an issue with the S112 6.0.0 workaround for Errata 201 where the HFXO would s...
opaque patrol
#

Saw a new wing added to boards....don't want to say the name in case it is supposed to be secret

solar whale
#

so - just to add to my confusin regarding the miniTFT - I thoght I'd just try an I2C scan ```Adafruit CircuitPython 4.0.0-alpha on 2018-07-21; Adafruit Feather M4 Express with samd51j19

import board
import busio
i2c=busio.I2C(board.SCL,board.SDA)
i2c.try_lock()
True
i2c.scan()
[94]

#

but seesaw is typicaly at 0x49 (73 decimal) not 94 -- 0x5e.

#

it makes sense taht this would not use the "normal" seesaw address, but without some documentation its a bit confusing!

main meteor
#

Reminds me of an undocumented knockoff RTC board, so I ran an I2C scan on it and got back 2 addresses. Then I realized it included a flash chip as well.

solar whale
#

progress -- if I change the I2C address for the joy-featherwing demo, I get some button responses .... I'm declaring victory!

torpid goblet
manic glacierBOT
narrow igloo
#

Hi, quick question: Does CircuitPython have an inline assembler option?

idle owl
#

@tidal kiln It's odd that the MakeCode stuff runs with an empty else block.

tidal kiln
#

@idle owl it's basically like having a pass in the block

idle owl
#

Ah, fair enough

stuck elbow
idle owl
#

@tidal kiln Some of the time the green LEDs on the human don't disappear while receiving the Zombie signal and then the human turns zombie.

#

Did you run into that at all?

#

I got it to work once. But twice it did what I described.

tidal kiln
#

@idle owl are you running latest versions?

idle owl
#

Yeah, from an hour ago or so?

tidal kiln
#

yah

idle owl
#

Now it's working again

#

Might be a me problem.

#

Seems to heal a lot faster than the CircuitPython version did. Assuming that was intentional?

solar whale
#

@narrow igloo What are you trying to do? Do you mean in a Python Script ? There is no "inline assembler" available via Python

stuck elbow
#

MicroPython has it, I wonder if it was disabled in CircuitPython

idle owl
#

@tidal kiln That last update is working consistently.

#

ยฏ_(ใƒ„)_/ยฏ

#

hmm

#

No, it isn't.

#

I let it sit for a bit, and then it did the same thing.

manic glacierBOT
solar whale
#

@stuck elbow @narrow igloo sorry --I may have misspoke (mis-typed) @stuck elbow can you point to how to use it?

#

I don't see it ``` >>> dir(micropython)
['name', 'const', 'opt_level', 'mem_info', 'qstr_info', 'stack_use', 'heap_lock', 'heap_unlock', 'kbd_intr']

#

hmmm - it may be port dependent -- on the atmel build #define MICROPY_EMIT_INLINE_THUMB (0) but the esp8266 #define MICROPY_EMIT_INLINE_XTENSA (1)

#

no - I don't see ,icropython.asm in the esp8266 either ```Adafruit CircuitPython 4.0.0-alpha-866-gbfbb5cde5 on 2018-07-29; ESP module with ESP8266

import micropython
dir(micropython)
['class', 'name', 'alloc_emergency_exception_buf', 'const', 'heap_lock', 'heap_unlock', 'kbd_intr', 'mem_info', 'opt_level', 'qstr_info', 'schedule', 'stack_use']

lone sandalBOT
solar whale
#

@opaque patrol @stuck elbow Ive been trying this code on the miniTFT with no luck -- do you see any obvious problems? ```import busio
import board
import digitalio
import adafruit_rgb_display.st7735 as st7735
from adafruit_rgb_display import color565

cs_pin = digitalio.DigitalInOut(board.D5)
dc_pin = digitalio.DigitalInOut(board.D6)

spi = busio.SPI(clock=board.SCK, MOSI=board.MOSI, MISO=board.MISO)

Initialize display

display = st7735.ST7735(spi, cs=cs_pin, dc=dc_pin, width=160, height=80)
display.fill(color565(0xff,0,0))
display.pixel(64,64,0)

#

the screen just powers up all white and does not respond to anything I do -- no erros, just no respone

main meteor
#

If that's your whole code, it's probably because it runs it, then falls off the end. Try adding a while True: to keep it from exiting. Guess how I know about this failure mode...

solar whale
#

It's not supposed to loop -- Just set the color to red and one pixel to off.

main meteor
#

Mine was similar, I set some Neopixels and then exited, but it didn't work. Apparently when the program exits, the objects are freed, and the destructors are called. So the trick is to keep the program from exiting.

solar whale
#

hmm - worth a ry

#

well - it does not exit, but no change on the display ๐Ÿ˜ฆ had my fingers crossed

main meteor
#

Rats, I was hoping it was that easy.

solar whale
#

Thanks for trying!

slender iron
turbid radish
#

If you like Python and want a once a week, spam free email on all the hot topics, please consider subscribing to Adafruit's Python on Microcontrollers newsletter https://blog.adafruit.com/2018/07/30/python-on-microcontrollers-newsletter-sign-up-now-adafruit-circuitpython/

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โ€ฆ

#

Why are all the pictures turning to a certain emoji?

solar whale
#

??

timber mango
#

(canonical use of 'lurking' from 25+ years online ;)

errant grail
#

Group hug to the team. Special thanks to Kattni for her exceptional rotary encoder guide โ€“ found it just in time for a project that was stalled looking for just the right input device. Clear, concise, easy to read!
Oh, and to the HVAC tech who arrived just in time to replace the outside compressor before the worst of the heat wave. He not only dressed every wire with cable ties, he also took the time to teach me how to remove and recharge the refrigerant โ€“ at no extra cost. Free training!

timber mango
#

woo woo rotary encoder guide

errant grail
#

Very cool guide @tidal kiln .

#

Put software development on hold (again) this week in order to complete a redesign of the Crunchable Synth PCB platform due to some mechanical issues with TS and TRS jacks. Itโ€™s tough to find vertical PCB-mounted TS and TRS jacks with the same height dimension. Alas. Using the experience to continue to fine-tune my KeyCad (sic) skills.
Led an SMD hot-air soldering/rework workshop at the local makerspace last week. Was surprised to see the interest level. Although all attendees have hand-soldered SMD components in their projects, none had made the next step to hot-air soldering. Lots of oohs and ahhs when the solder paste flashed and components aligned themselves.
This weekโ€™s work will be sponsored by CircuitPython and Ancestry.com. The synth code and associated library should be done by Thursday. Need to put on blinders after that and wrap up the ancestor search so that I can stop paying the subscription fee. I now know where we came from and was able to dispel a couple of fantastic stretched stories that usually make the rounds (and are amplified) during the family reunion.

tidal kiln
#

@errant grail thanks.

#

let's talk about that in "in the weeds"

prime flower
#

not able to participate (dont have headphones, been searching for them....) in audio chat so I'll listen in later. Hug report to @tulip sleet for help with the MCP3xxx implementation and some python book recs. Worked on: MCP3xxx new implementation this past week (https://github.com/adafruit/Adafruit_CircuitPython_MCP3xxx/pull/4), edited analogin AIO Basics guide to prep for when that pr is reviewed/merged in, other hug report to @gusty kiln for updating DHT blinka , might get to that and AIO-Blinka later this week

timber mango
#

(oh me oh my-oh)

proven bluff
timber mango
#

progress:
Silabs CP2104 USB <==> UART gateway works nice with SAMD51 TX/RX UART pair!
See: PiUART or the breakout (both from Adafruit).

issue:
SAMD51 difficulties w/ Atmel Start

https://github.com/wa1tnr/sandboxx/blob/master/AtmelStart.d/cp_meeting_SAMD51_atmel_start.txt

Working on SAMD51 with Atmel Start. GPIO toggle is inoperative - cannot seem to blink D13 (PA23) for the Adafruit Feather M4 Express target board (which runs Arduino IDE code just fine).

Notes per the above 'sandboxx' repository on github.com.

Using ORIGIN 0x4000 (not 0x2000 like on SAMD21). SAMD21 GPIO in Atmel Start working just fine.

Target MCU is SAMD51J19A - Feather M4 Express.

follow-up code:
$ git clone https://github.com/wa1tnr/sandboxx.git

main meteor
#

@errant grail if I were building it, I'd probably go with horizontal mount sockets and put them on a daughterboard.

errant grail
#

@main meteor Yes, that was an option and may be in a future version. This was intended to be a single board Eurorack front panel when flipped, so choices were limited. However, I have a couple of nice workarounds now.

errant grail
timber mango
#

that's the servo 50 Hz

main meteor
#

Yes, looks like you have a nice neat solution, just had to do some fiddling to make it work. The daughterboard trick makes assembly more complex, but gives wonderful freedom in fine-tuning connector position.

ruby atlas
timber mango
#

APA102 dotstar is very easy to bitbang. I've done so inside Atmel Start with just GPIO and empty timing loops.

#

Perfect is the enemy of good. -Voltaire

narrow igloo
#

@solar whale Ah this is great, thank you very much!

idle owl
#

Example release notes.

 
To use in CircuitPython, simply install the [Adafruit CircuitPython bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle).

Read the [docs](http://circuitpython.readthedocs.io/projects/rtttl/en/latest/) for info on how to use it.```
timber mango
errant grail
#

Thanks!

timber mango
#

test points
http://adafru.it/3824 rocks.
I'm using them with wire wrap wire. I bolt the Feather M4 Express
to a piece of perfboard, and 'thread' the wire wrap wire up through

#

the perfboard and thru the plate holes of the Feather, then push in a test point.
Holds really well and secure when stabiliized like this.

solar whale
#

they are great -- I've used them for quick - first test of boards before soldering on headers.

timber mango
#

I also found the Extra Long Pin Headers work really great for mounting perfboard onto a breadboard.
Just fold over the pins on top, so that the perfboard is permanently mechanically secure to the Extra Long Pin Headers.
Holds really good -- a row of 16 pins (singleton) is enough to keep the Feather M4 Express from wiggling around on the solderless breadboard.

#

I'm hardware oriented. From 8051 development.

I do SAMD series only (and legacy 8051 work) and am mostly interested in the core (or kernel) development.

errant grail
#

Yes. Pick a shape and scale it rather than start with a pixel.

#

... and support vector and raster forms natively.

timber mango
#

Borland with their Turbo Pascal implemented turtle graphics to teach young people drawing on-screen under program control.

#

turtle_up, turtle_down (pen up/down) turtle_left turtle_right (to rotate where the turtle is aimed and turtle_walk (making these up but I think I'm close).

neat folio
#

I LOVED Turbo Pascal ๐Ÿ˜ƒ

timber mango
#

Turbo Pascal was my first language besides BASIC.

#

Turbo Pascal BBS was in Volcano, California. ;)

neat folio
#

It was my favorite next to basic ๐Ÿ˜‰

timber mango
#

My father yelled (when he saw the long distance phone bill) Volcano California!

neat folio
#

I recently got it running on the Rasp. Pi3 ๐Ÿ˜ƒ

gusty kiln
#

@idle owl this is what's in my history: sudo gem install travis -v 1.8.8 --no-rdoc --no-ri

solar whale
#

I have to go mow the lawn -- Good day all!

neat folio
#

have fun

idle owl
#

@gusty kiln I'm on MacOS if that matters

gusty kiln
#

yeah, it probably does.

main meteor
#

Turtle graphics originally were used with the Logo programming language. They're coming back because these days it's easy enough to build an actual "turtle" robot that carries a pen around.

timber mango
#

Right. Turbo Pascal 'borrowed' the idea and implemented it.

#

sounds like a saw

gusty kiln
#

there is a tattoo place just up the street, but no. ๐Ÿ˜ƒ

errant grail
#

G'day all. Thanks!

manic glacierBOT
gusty kiln
#

@idle owl - ^ i started automating this a bit at one point

#

didn't get that far, but that might save some keystrokes

idle owl
#

hmm ok

gusty kiln
#

i was just running that script in each repo (the virtualenv bit's just for testing, may not need that)

idle owl
#

If I'm being honest, I'm pretty solidly confused ๐Ÿ˜„

gusty kiln
#

heh, sorry - that may not actually be super helpful.

idle owl
#

Nah, it might be once I understand what's even going on here.

#

That's what I'm still struggling with. I need to go through it a couple of times.

gusty kiln
#

yeah, i had to run through a couple first before it clicked.

neat folio
#

things getting active in Minecraft world... my ability to multitask exceeded... going to have to pull focus elsewhere... thanx for letting me lurk... I'll study up a bit and be back ... have fun all!

idle owl
#

I had to include sudo to run the travis encrypt --add deploy.password. Then it returned this: Shell completion not installed. Would you like to install it now? |y|

#

Is the travis command supposed to run without sudo?

gusty kiln
#

travis should be able to run without sudo

idle owl
#

ok

manic glacierBOT
#

@tannewt and I discussed this. He suggested that we add a .value getter property on PulseIn, so you could just read the current value. We might read the pin directly, keep track of the value in the interrupt handler, or calculate the value based on the count. Does this sound like it would solve your problem?

We would like to implement interrupts, but doing interrupt handlers is a big topic (storage management, etc.). There's the MicroPython model but we'd like something more beginner-fri...

idle owl
#

-bash: /usr/local/bin/travis: Permission denied

lone sandalBOT
idle owl
#

I got out of the bundle, and cloned the repo locally from my fork to see if that was the issue, no change.

gusty kiln
#

hrm - that seems like maybe /usr/local/bin/travis doesn't have execute permission set

#

try ls -lah /usr/local/bin/travis?

idle owl
#

-rwxr--r-- 1 root admin 610 Jul 30 15:29 travis

#

I didn't run what you just said, but I did ls -al from inside /usr/local/bin

gusty kiln
#

yeah, hrm. seems like gem installed it with only user execute... you could sudo chmod a+x travis there, though it seems like there's probably something i'm missing about rubygems on macos.

idle owl
#

yeah I feel like it should have been right to begin with.

#

blech.

gusty kiln
#

probably a side effect of my sudo gem install ... above.

idle owl
#

oi ok so tried to chmod it, and now I get this while running it. Traceback (most recent call last): 1: from /usr/local/bin/travis:23:in `<main>' /usr/local/bin/travis:23:in `load': cannot load such file -- /usr/local/lib/ruby/gems/2.5.0/gems/travis-1.8.8/bin/travis (LoadError)

#

I'll try to reinstall travis

gusty kiln
#

]'

idle owl
#
Ignoring ffi-1.9.25 because its extensions are not built. Try: gem pristine ffi --version 1.9.25
ERROR:  While executing gem ... (Errno::EACCES)
    Permission denied @ dir_s_mkdir - /usr/local/lib/ruby/gems/2.5.0/extensions/x86_64-darwin-17/2.5.0```
main meteor
#

]'? Did you mean ืณื‘?

proven bluff
#

sorry for being noisy before, being on call has its downsides

gusty kiln
#

@main meteor that was my cat walking on the keyboard. ๐Ÿ˜ƒ

main meteor
idle owl
#

(โ•ฏยฐโ–กยฐ๏ผ‰โ•ฏ๏ธต โ”ปโ”โ”ป

gusty kiln
#

going well, i take it...

timber mango
#

$ cat /etc/group | egrep admin
$ sudo adduser kattni admin
Linux - not sure looks a bit Mac OSX-y to me what you have there.

gusty kiln
#

yeah, this is macos.

timber mango
#

chmod g+rx travis

#

But if you had to go that far there's probably an error.

#

I haven't had to change ownership or permissions to these things in many years; they're always correct from the upstream. ;)

#

Generally I add myself to group dialout and that's it, for this stuff. ;)

gusty kiln
#

language-specific package managers are a special kind of suffering, alas.

stuck elbow
#

@solar whale if it's all white, then probably reset pin is wrong

#

@uncut coral it would be all randomly colored otherwise

solar whale
#

@stuck elbow thanks -- any Idea how I can control the RESET Pin? It is set to None now, but I don't know how it routes through the seesaw. At least it is not clear to me that I do.

stuck elbow
#

it's through the seesaw, I think

#

you just have to pull it up

solar whale
#

right, but I don't know where it is on the board

#

does it use the same RESET as the processor - I could just try holdig that up. teh board silkscrees shows RESET at teh same place as the MCU RESET

stuck elbow
#

no

idle owl
#

No it's not going well at all.

timber mango
#

The Crickit CPX is a standalone target board -- its reset button acts like any other target board's does.

manic glacierBOT
solar whale
#

@timber mango true, but not on the feather versions

idle owl
#

I reinstalled Ruby. Now I can't even run gem update --system because I don't have permissions, which is what the instructions say to run, without sudo.

solar whale
#

the RESETS are tied together -- on a feather crickit, doubletapping the feather also puts the crickit into bootloader! You have to reset it after uploading a new .uf2 to the feather

timber mango
#

hehe that's weird @solar whale

solar whale
#

well, different - at least ๐Ÿ˜‰

stuck elbow
#

@uncut coral I mean the reset of the display

solar whale
#

@stuck elbow understood, but I don't have a pinout or schematic for the featherwing and I' dont know where it is.

stuck elbow
#

I know the pinout of that display, if that helps

#

you could maybe probe it...

gusty kiln
#

@idle owl hrm. it more or less makes sense to me that something like gem update --system would require sudo, but i am quite a ways removed from regular macos usage.

stuck elbow
#

you want pin number 6

idle owl
#

@gusty kiln It makes sense to me too, but the problem is it seems like it's updating things to belong to root.

#

Or they already did

stuck elbow
#

no, wait, that's the wrong one

#

this one

gusty kiln
#

root ownership should be fine, but it definitely seems odd that the perms are restricting you from executing them.

stuck elbow
#

but it's still pin number 6

idle owl
#

ah hmm.

gusty kiln
idle owl
#

I'm trying that now

#

it is not intuitive.

#

I can't get it to use the env.

gusty kiln
#

remember when interpreted dynamic languages were easier to use than just compiling some c?

#

(sigh)

solar whale
#

@stuck elbow thanks -- I'll poke at it more soon.

stuck elbow
#

you might need to unglue the display for this