#circuitpython-dev

1 messages ยท Page 141 of 1

raven canopy
#

no matter how many times i "proofread" my comments, i always miss something. ๐Ÿ˜ฐ

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

This PR:

  • Enables BLE support via s132 v2.0.1 SD by default
  • Fixed NUS REPL support (via MICROPY_PY_BLE_NUS), tested with Bluefruit LE Connect
  • Increased available SRAM from 49.5KB to 52KB
  • Added a simple BLE Central example (boards/feather52/examples/ble_scan.py) scanning for devices and displaying the results on the command line:

Test script can be run via: $ ampy -d 1.5 -p /dev/tty.SLAB_USBtoUART run boards/feather52/examples/ble_scan.py

manic glacierBOT
manic glacierBOT
#

One thing I have noticed when using the NUS REPL. If I disconnect, I have to manually reset the board ignorer to establish a new connection. Is this a bug or a "feature"

Also do you know if there is a way send a Control-D via the Adafruit_BLE Connect app? I have connected via both IOS and MACOS and the EOL setting works great but I can't find way to send a control-D to execute a soft reboot.

slender iron
#

@solar whale have you used bluepy? I want to make sure we target its API and not ubluepy

solar whale
#

@slender iron no - so far all the examples I have tried have been using ubluepy.

slender iron
#

ok, I think the largest thing will be using attributes where bluepy does instead of methods like ubluepy

solar whale
#

i'm very new to this but will be happy to take a look at it.

#

@slender iron only ubluepy is in the moules list at this time - with the current build

slender iron
#

yeah, it'd be good to get it reorganized

solar whale
#

@slender iron I found the ubluepy code in nrf/modules --- is bluepy somewher else? Not finding it.

manic glacierBOT
#

This is very exciting!

I'd like us to refine ubluepy back into a bluepy compatible API so that drivers written on top of it can apply to the raspberry pi as well. I'd also like the Python -> conversion of the API to happen in shared-bindings/bluepy so that other ports like ESP32 will use the same thing.

This doesn't need to happen in the PR but it'd be nice to have it soon for the upcoming 3.0 Betas.

slender iron
#

its a raspberry pi library

solar whale
#

ah - so you would like to see that replace ubluepy ??

slender iron
#

yeah

#

the api should be the same

#

they are close but got adapted for mciropython-isms like not using properties

solar whale
#

@slender iron ah - saw your note in the PR - sounds good. This has been fun to play with.

slender iron
#

great! thanks as always for the testing

solar whale
#

Kevin has made it pretty easy!

slender iron
#

he's a rock star

solar whale
#

Now I just need to find time to study his book!

slender iron
#

yeah, I thought about picking it up

#

I realized on fs issue coudl be that we don't flush the flash cache when repl is active unless a different block is written

solar whale
#

could taht be related to the import problems I reported?

slender iron
#

I honestly haven't read in depth about the issue. I saw it go by

solar whale
#

I can give a report on it tomorrow - in the issue - I tracked it to down to a specific build but I don't see the cause.

slender iron
#

I did see that. its super helpful

solar whale
#

easy workaround when it happens

#

the potential FS bug is good to find. Htere have been some "funny" things taht are not reproducible. They are so hard to find..

slender iron
#

yeah, really hard

#

any memory issues you've come across with libraries would be helpful

#

my heap tools are very neat

solar whale
#

I saw your "map" very nice!

slender iron
#

yeah, I think it'll be useful to find bad libraries

idle owl
#

I tried to get an nRF52 setup, pretty sure I hosed the board. Although my friend who is a wizard with hardware says he bets he can fix it.

raven canopy
#

it definitely isn't an easy process. @solar whale is a champ though. helped me get through mine.

solar whale
#

just follow the steps in ports/nrf/boards/feather52 readme

idle owl
#

I'm talking about getting the connector on in the first place.

solar whale
#

teh swd connector?

idle owl
#

yes

raven canopy
#

oh. you were going the Segger/JLink route

solar whale
#

you really don't even need it for the feather52

idle owl
#

Oh. Thought I did, heh

solar whale
#

the docs use the dfu port so it is all done via USB

#

I used j-link initially before this was updated but have been using the dfu recent;y - have not tried j-link in quite awhile.

idle owl
#

I see

solar whale
#

but it is nice to have in case of "emergency"

raven canopy
#

...told ya he was a champ. ๐Ÿ˜„

solar whale
#

@raven canopy I just like banging my head against things....

raven canopy
#

it's one of my favorite past-times as well. ๐Ÿคผ

#

i also like to change thoughts mid-stream. example, 2 minutes ago i ended up with a +=, and was surprised when the output value kept climbing exponentially.

idle owl
#

@slender iron I need to get Sphinx setup. You helped me with getting the venv setup, but we never got to getting Sphinx up and running again. Do you have a few minutes?

raven canopy
#

@slender iron now this looks a little closer. upped the the raw_id[] size to 128 since 16 was causing the bootloader to fail. however, i'm pretty sure 128 is too much...

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
main.py output:
^...SAMD CPU Information...^
Frequency:  48000000
Unique ID len:  128
Unique ID:  15007828

Adafruit CircuitPython 3.0.0-alpha.1-62-g111faa1-dirty on 2018-01-15; Adafruit Feather M0 Express with samd21g18
>>> import microcontroller
>>> microcontroller.cpu.uid
bytearray(b'T\x00\xe5\x00\xbe\xa9\xcb\x00|\xa9\x07\x00\xf0\x00\x0f\x00R\x00%\x00R\x00\xd5\x00M\x90\x04\x00P\x06\x05 J\xa4\x14\x001\x00\xe3\x00.\x002\x003\x00\x03\x00=\x00C\x00$\x00b\x00\x06\x00\xf0\x00\xff\x00\x0f\x00\x02\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00 \x0f\x00\x00\x00\r\xa8\x01\x00\x91\xa9\x01\x00\x01\x00\x00\x00@\x00\x00\x00\x9f\xa9\x01\x00\x01\x00\x00\x00\xc0\x13\x00 ]i\x00\x00\x00\x00\x00\x00\n\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00')
>>>
#

mathing tells me it should be 64...

slender iron
#

@idle owl are you free in an hour or two? I need lunch soon

#

@raven canopy I think 16 was correct

idle owl
#

@slender iron Yah should be

manic glacierBOT
slender iron
#

its four words of four bytes each so 16 total

raven canopy
#

then i am adding to the raw_id array incorrectly. back at it

slender iron
#

yeah, did you see my comment?

raven canopy
#

i did. working it...in baby-step fashion. ๐Ÿ˜„

slender iron
#

I think you need the loop from esp8266 code inside the code for the samd and nrf

raven canopy
#

well, that one was easier for me since it's just a single nest. just need to get the left side of the second-level assignment figured out. (that's where I got the 64 a minute ago). I'll get there.

idle owl
#

@solar whale I did manage to terribly get the button on the metrowing and it resets the feather/featherwing on top, so apparently it at least works.

solar whale
#

@idle owl nice! It does not have to be pretty to work!

#

same goes for the SWD connector on the nrf52!

#

@idle owl I'm looking ove the makefile for using the jlink with the nrf52 - I'll let you know how it goes.

#

flashing the image woks fine - now to try the soft-device

#

it seems to have survived

manic glacierBOT
idle owl
#

@solar whale Bonus! Survival is good

solar whale
#

@slender iron cool! I was just able to run a .py file from an sd card!!! who knew!

#

somehow I thought that had been discussed and could not be done....

#

@slender iron I did this on a MEtro_m0 Express with an adalogger featherwing. is there any reason it should not also work with a non-express board like a feather m0 basic?

#

@idle owl using the j-link is faster and simpler than the DFU method so when you get to that point, it may be an option. May as well put that connector to use after all the work getting it installed. I just want to get confiration on one point before I deem it a complete success.

#

However, it does wipe out the DFU - boot loader so you have to choose your poison. It is not hard to re-install the DFU loader.

idle owl
#

good to know on all counts.

#

I don't think the one I tried to connect will work. It's bad looking. Not on straight or whatever.

solar whale
#

not hard - if you remember how ๐Ÿ˜‰

idle owl
#

But I have a rework station now, so.... maybe I can get another one connected?

#

I don't have solder paste though

#

Kind of didn't think this through. From looking at the images of it, I thought I could do it. I was wrong.

#

And I forgot to have Brian do it.. he's the solder wizard. Would have had it done and perfect looking.

solar whale
#

I think I just got lucky!

cunning crypt
#

@idle owl What are you attempting to do?

#

I've missed everything before "rework station"

slender iron
#

@solar whale I think it should work for the other boards as well

solar whale
#

That's really nice - sorry I gave the wrong answer on the forum. It will be great for some of the basic boards.

slender iron
#

np, thats how we learn ๐Ÿ˜ƒ

solar whale
#

I was sure it had come up and had been ruled out. Lesson learned to do simple tests before relying on vague memories!

manic glacierBOT
#

I have successfully gone back and forth between the J-link and the DFU boot loader - I just use the arduino IDE to return the default DFU loader then do a make boot-flash and a a make dfu-gen dfu-flash to get back after using the J-Link. Checking with os.statvfs('/') I see the same size file system with both methods.. 20 4K blocks so it all appears to be OK. If I understand correctly, the J-link loadsthe SD directly and overwrites the DFU bootloader. Either method will result in the same ...

raven canopy
#

@slender iron i cheated and just setup a "counter" in the nested loop. truth tabling with a recurring zero beat me. :D

>>> microcontroller.cpu.uid
bytearray(b'\x04\x0e\x0c\x00\x02\x02\r\x00\n\x01\x0e\x03\r\x04\x06\x0f')
>>> struct.unpack('<i', microcontroller.cpu.uid)
(790020,)
>>>
uint8_t id_tick = 0;
    for (int i=0; i<4; i++) {
        for (int k=0; k<4; k++) {
            raw_id[id_tick] = (*(id_addresses[i]) >> k * 8) & 0xf;
            id_tick++;
        }        
    }
slender iron
#

i think id_tick is 4 * i + k

raven canopy
#

well now it's staring right at me...too many iterations and i lost it (forest/trees). thanks!

idle owl
#

Excellent, only one library left on the Lint All The Libraries list!

#

@cunning crypt Trying to attach a connector with very tiny feet to very tiny pads on a Feather. Is what I am trying to do.

cunning crypt
#

Oof. I'd be worried about the rework station melting the plastic on the connector, but it might be possible with care.

idle owl
#

Yeah same.

#

I am fairly certain I already hosed one, so I think I might leave the rest to someone with more skill than I have.

cunning crypt
#

Which feather, which connector, and which location?

idle owl
#

nRF52, SWD, center of the board.

cunning crypt
#

Oooh, yeah. My personal attempt would be with a soldering iron.

idle owl
#

I did do that. And I did end up removing half of one of the pads on the feather, and the connector isn't straight, so maybe it actually connected? I am highly skeptical.

cunning crypt
#

How time-pressed are you?

idle owl
#

Not pressed. It's something I'd like to get going but there's nothing waiting on me. I have a mate who is a solder wizard who might visit again next weekend if he's got time and he could do it. I simply forgot to have him do it when he was here this past weekend. Unfortunately.

cunning crypt
#

I'm confident I could get one of the feathers and solder a header on there, but probably not before your friend gets to it

idle owl
#

Hmm. Depends on whether he makes it, I suppose.

cunning crypt
idle owl
#

Because I wasn't thinking when I ordered it ๐Ÿ˜„

#

I looked right at it and thought, oh this doesn't work for what I need. When I knew bloody well it would work perfectly.

cunning crypt
#

In today's edition of "Why didn't I do that?"...

#

I've done that several times.

idle owl
#

Exactly.

manic glacierBOT
slender iron
#

bus device is built into some firmware right?

raven canopy
#

@slender iron i'm looking at giving a Trellis library a go. ladyada mentioned a couple weeks ago, and I've been studying since last night, the HT16K33 library. Which is preferred: standalone Trellis, or Trellis functionality (button reading) added to the HT16K33 library?

slender iron
#

i don't know what trellis is

#

in general, its better to have functionality split so only what you need can be imported

raven canopy
slender iron
#

I'd suggest building a separate trellis library that uses the ht16k33 one

raven canopy
#

well, I could just import the current library inside a Trellis library. yeah. same page.

slender iron
#

yup yup ๐Ÿ˜ƒ

raven canopy
#

i doubt i'll be of much help, but are you talking about native bus device? or CP implemented?

slender iron
#

actually i'm thinking of register

#

#toomanylibraries

slender iron
#

gah! ```>>> from adafruit_featherwing.motor_featherwing import MotorFeatherWing

wing = MotorFeatherWing()
s = wing.stepper2
s.onestep()
MemoryError: memory allocation failed, allocating 512 bytes```

idle owl
#

Oi

slender iron
#

stupid parser

#

ok, it works

#

dear repl,

#

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

manic glacierBOT
raven canopy
#

well, i think i sparky my Trellis. assumptions...get you everytime. "Of course i put the right color wires on the right connections..."

blazing trail
#

lol sparky

manic glacierBOT
covert birch
#

hey peeps. quick question: can i run/install circuitpython on my bluefruit feather? i;m guessing no as it does not appear in the release list.

manic glacierBOT
slender iron
#

@covert birch yeah but ble won't work

#

its the same as the feather m0 basic build

manic glacierBOT
covert birch
#

@slender iron does that mean i wouldn't be able to use it with the bluefruit app?

slender iron
#

@covert birch correct

covert birch
#

ok thx

slender iron
#

np, sorry its not there

covert birch
#

it's cool. just glad to clarify

slender iron
#

we'll have bluetooth support with the nrf52 first

sick creek
#

so cool

covert birch
#

i just want to play around with my dotstar featherwing. i'm just learning circuitpython, my first exposure to any python and was having trouble with the dotstar featherwing sitting on my mo express which does not have female headers and i've already soldered pins to the dotstar.

slender iron
#

@covert birch it should be usable then, you just won't be able to use bluetooth

#

the drive will be much smaller on the bluefruit board though since its not an express

covert birch
#

oh, well i trying to work with the mo now. may just breadboard each and try that way, if i can get the jumpers in the right spots

slender iron
#

that'll work too!

manic glacierBOT
#

@jerryneedell I haven't tried using the CP makefile to flash via a J-Link (my assumption was always the serial bootloader, or I tend to use AdaLink for anything J-Link related), but the same version of the SD will go in the same place in either case.

The bootloader on the Arduino is the same as the CircuitPython version, although with CP we had to add the option to update to a 'single bank' version out of necessity. The latest Arduino nRF52 B...

upbeat plover
#

will there be a library for RFM69 to use with circuitpython?

stuck elbow
#

I'm sure that sooner or later someone writes one

slender iron
timber lion
#

yeah the library works great, see simpletest.py for example of sending an receiving

#

we'll have a guide update later this week

#

but one thing, you might want to familiarize yourself with the radiohead library for arduino

#

these radios are pretty complex and support a ton of different modulations

#

this lib tries to emulate radiohead's GFSK, 250kbit/s, 250khz frequency deviation by default

#

so it can talk back and forth to itself and to radiohead's default GFSK_250Rb_250Fd config

#

if you want to do something different you'll need to configure the radio yourself

#

and also be careful these radios send 60 byte packets at most.. radiohead hides this and adds extra layers on top like guaranteed delivery, multipart messages, etc

#

we don't have that, it's just like the 'raw' radiohead usage

#

think of it more like UDP packets

#

i do use the same 4 byte packet header as radiohead though so its compatible with radiohead receiving our packets

#

but you can't control node address (it's just always broadcast to everyone) or do other advanced things that radiohead might add

#

so yeah check out the simpletest.py, it shows the basic usage of send and receive and kind of the intended use

#

if you try to receive kilobytes and kilobytes of data at a time it will be troublesome.. you'll lose packets because we can't read them fast enough

#

so stick with simple 60 byte control messages

solar whale
#

@timber lion thanks for this addition! Looking forward to working with it.

cunning crypt
#

@timber lion Is a LoRa RFM95 planned? I'm assuming you're going to get this library complete first, of course

timber lion
#

yeah lora's not on the list yet, haven't look at it but it might have a bit more complexity

#

there's a handful of sensors to do next

#

eventually will get to lora i bet though

#

this RFM69 should be good to go for folks now, just working on a guide update to show the basic usage that simpletest.py demos

idle owl
#

@slender iron I tried updating api.rst and it didn't do what I think it was supposed to. I'm also getting an import error on when Sphinx is trying to build anyway, so I'm not sure if that's the issue even though it builds. Doesn't seem to include the new lib, so the issue may not be with api.rst.

slender iron
#

whats the import error? you may need to automock something

idle owl
#

That sounds like it would be right. reading sources... [100%] api /Users/kattni/repos/Adafruit_CircuitPython_FeatherWing/api.rst:6: WARNING: autodoc: failed to import module 'adafruit_featherwing.ina219_featherwing'; the following exception was raised: Traceback (most recent call last): File "/Users/kattni/repos/venv3/lib/python3.6/site-packages/sphinx/ext/autodoc.py", line 658, in import_object __import__(self.modname) File "/Users/kattni/repos/Adafruit_CircuitPython_FeatherWing/adafruit_featherwing/ina219_featherwing.py", line 34, in <module> import adafruit_ina219 ModuleNotFoundError: No module named 'adafruit_ina219'

#

that's from the middle of the Sphinx build

slender iron
#

yup yup

idle owl
#

No idea how to do that though

slender iron
idle owl
#

ok

slender iron
#

I think I left an example in there commented out

idle owl
#

autodoc_mock_imports = ["adafruit_motor", "adafruit_pca9685", "board", "busio"] this?

slender iron
#

yeah but delete the contents and list the things for your library that you need

idle owl
#

I'm building that lib inside adafruit_featherwing though. So don't I need to leave those too?

slender iron
#

ah right

#

I was thinking that was the placeholder

idle owl
#

ah

slender iron
#

just add to the list

idle owl
#

Hah! Sorted a bunch of other errors that popped up once it dealt with that. And Sphinx is now happy

slender iron
#

great!

slender iron
#

@opaque patrol @umbral dagger @stuck elbow gonna make the meeting?

stuck elbow
#

yes

slender iron
#

sweet!

umbral dagger
#

On my way

slender iron
#

kk

prime flower
#

using txt ๐Ÿ˜ƒ

tidal kiln
#

hear me?

raven canopy
#

Ditto txt

prime flower
#

nope, sorry for the lack of generosity this week

raven canopy
#

HUGS: @slender iron @solar whale for putting up with my myriad of windows + toolchain = headache issues. And @tonyd for his awesome videos on setting up the VMs.

slender iron
idle owl
#

ahhh! yes!!

#

It's so tiny!

prime flower
#

status update(s): metro express explorers guide code is now linted (thx kattni/mrmcwethy) and conforms to 2.2.x instead of what it ran over the summer and runtime errors are gonee, physical booklet for the metrox classic kit is almost done too (it's really awesome - just wait for the cirpy edition..SOON!), and I started a badge design for the BSides security conference in boston (its gonna use circuit python whooo)...oh and I applied to grad school so fingers crossed (my thesis proposal incorporates circuitpython)

timber lion
#

wow good luck with grad school app! ๐Ÿ˜ƒ

prime flower
#

thanks tony!

idle owl
#

@prime flower That's great! Good luck again!

umbral dagger
#

@prime flower Woot! Grad school is a blast.

raven canopy
#

uid as you said earlier is done (minus pending PR). Started working on a Trellis library...+/- wires crossed... sparky came to town. So up next: start working on VEML6070 UV Sensor library, and practicing SMD repair once a new HT16K33 chip shows up. Other than that, cruising the Issues pages for ideas.

tidal kiln
#

โฌ† #sparky

sick creek
raven canopy
#

UICR is also available on SAMD in NVM. User Info Control Register

#

But, that's Express only ATM.

stuck elbow
#

๐Ÿ

#

hmm, that's not the kind of cricket I expected

raven canopy
#

Thanks everyone! blinka

umbral dagger
#

This was awesome... glad I finially made it.

idle owl
#

Yeah glad to have you!

prime flower
#

thx everyone (was deep in illustrator listening to the call ๐Ÿ˜ƒ )

manic glacierBOT
#

I noticed while doing some radio library development that I needed to have two CircuitPython boards (M0-based) connected to my Mac at once (one for transmitting, the other for receiving). This presented an interesting problem as both boards show up in Finder with the exact same drive name (CIRCUITPY):
<img width="228" alt="screen shot 2018-01-16 at 11 53 23 am" src="https://user-images.githubusercontent.com/1332183/35009276-ed31a99a-fab3-11e7-86f9-99f2676b378f.png">
If you use the command ...

manic glacierBOT
#

I added the 2 proposed changes to the feather52 mpconfigport.h ( with PR #528 as well)

#define MICROPY_ENABLE_SOURCE_LINE (1)
#define MICROPY_CPYTHON_COMPAT (0)

The build compiles OK and I have not seen any adverse impact.
The Source line does show up in the REPL for Exception Tracebacks - nice!

Are there specific things to try to test turning off the CPYTHON_COMPAT ?

manic glacierBOT
slender iron
#

@fading solstice thanks for doing the is31.... I think I'll skip it on my end then

manic glacierBOT
raven canopy
#

someone is busy tugging on the issue thread... ๐Ÿ˜„

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Are there specific things to try to test turning off the CPYTHON_COMPAT ?

MICROPY_CPYTHON_COMPAT enables:

  • TextIOWrapper
  • namedtuple("MyTuple", ("id name")) in addition to namedtuple("MyTuple", ("id", "name")) -- parsed string in addition to sequence for tuple names
  • print(f) prints <function f at 0x20001220> instead of just <function>
  • str() and bytes()withencoding arg (encoding` as a keyword arg is not implemented in any case)
  • decode() and encode() ...
manic glacierBOT
#

I will get to this in the next couple weeks if no one else does.

Frank

On Jan 16, 2018, at 6:08 PM, Scott Shawcroft notifications@github.com wrote:

At minimum we should delete unsupported docs and examples by 3.0.

โ€”
You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/adafruit/circuitpython/issues/345#issuecomment-358138315, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAJGagpSY7mTSvnFKZ...

#

Great! Thanks Frank!

On Tue, Jan 16, 2018 at 6:11 PM Frank Morton notifications@github.com
wrote:

I will get to this in the next couple weeks if no one else does.

Frank

On Jan 16, 2018, at 6:08 PM, Scott Shawcroft notifications@github.com
wrote:

At minimum we should delete unsupported docs and examples by 3.0.

โ€”
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <
https://github.com/adafruit/circuitpython...

hot surge
#

can someone help me with a general python question?

tulip sleet
#

@hot surge go ahead

hot surge
#

im trying to convert an opencv/numpy array into a format that can be used to send a request to the google cloud vision api

#

basically, i cant figure out how to go from a numpy array to a json serializable utf8 base64encoded something

#

this works

#

with open('image2.png', 'rb') as image_file: image_data = base64.b64encode(image_file.read()).decode('utf-8')

#

but i can't figure out how to take a numpy array and get to the same type

tulip sleet
#

do you know how to make the json? Are you using a json library?

#

what's the code that creates the numpy array? The base64 thing looks likes it's assuming that it's a base64 encoded png, which is not going to be like a raw image in an array

#

.png files have headers and others stuff in them: they are not just raw pixels

#

could you give a link to the REST cloud API call you are making?

#

looks like you could use opencv cv2.imencode('png', imgdata) to convert a raw buffer of pixels to png format, then you can pass that to base64.b64encode()

#

that's basically the in-memory version of imwrite, which you could use to write a png file that would be read by your code above

timber mango
#

I modified Adafruit_CircuitPython_seesaw/adafruit_seesaw.py
and copied it to /lib on the Metro M0 Express. It is not an .mpy file.
I do not know how to make an .mpy from a .py. ;)
I did remove the existing /lib/adafruit_seesaw.mpy that was already present.

soft reboot
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
main.py output:
Traceback (most recent call last):
  File "main.py", line 3, in <module>
MemoryError: memory allocation failed, allocating 130 bytes
Press any key to enter the REPL. Use CTRL-D to reload.

hailp ;)

solar whale
timber mango
#

Oh! wow. Neat. Thanks, Jerry.

solar whale
#

good luck. That should help witht he memory allocation at startup.

timber mango
#

Thanks. Didn't see any errors. Seems to work just fine! @solar whale

timber mango
#

https://github.com/wa1tnr/Adafruit_CircuitPython_seesaw.git
I now have the ability to setup the PWM Freq for the Seesaw Breakout, in CircuitPython.
Checked with the Extech EX330 in 'Hz' mode (duty cycle also checks).

Also repaired analog_write() which was only passing 8-bit values (unless
I've misunderstood something basic, which is possible). It works now. ;)

#

Oddly enough, the Seesaw Breakout seems to have a power-on default of 44.59 Hz (but cannot be relied upon to stay there during complex operation).

upbeat plover
#

For CPX what are the MOSI and MISO, is it TX/A7 and RX/A6?

tulip sleet
#

@upbeat plover board.MOSI and .MISO refer to the SPI flash chip, but there are other pins you can use for SPI. Looking and will return shortly...

covert birch
#

ok, i screwed something up and now my computer is showing two volumes of circuitpy, the second one is called circuitpy 1 and it is the only one that shows up in atom - i can only see the two volumes in terminal - it's not in my finder window. how can i repair this situation?

tulip sleet
#

@upbeat plover these work:

busio.SPI(board.A3, board.A2, board.A1)
busio.SPI(board.A1, board.A3, board.A2)

and maybe more. The order is clock, mosi, miso. The TX and RX are UART designations

#

@covert birch do you have two boards plugged in? Also, what OS?

upbeat plover
#

thank you

covert birch
#

no, mac os 10.11.16

tulip sleet
#

did you just try rebooting?

covert birch
#

no, guess i should try that

tulip sleet
#

we've seen MacOS get confused or refuse to mount CIRCUITPY. A reboot has fixed it.

#

let us know if it doesn't

covert birch
#

ok, that makes sense. i've had a lot of problems trying to use my dotstar wing because i don't have any pins soldered to my mo express

#

i will let you know

tulip sleet
#

you mean you were just trying to make them touch? yeah, that will be quite unreliable. I know "reboot" seems like Windows advice, but in this case it seems to apply to Mac as well.

covert birch
#

yes, it does. i will solder in some stacking headers too before i plug in after rebooting

#

i think that must be cause of all the problems

#

thanks @tulip sleet

manic glacierBOT
#

The board.MOSI, board.MISO, and board.SCK pins on Circuit Playground Express refer to the SPI flash pins. That isn't too useful; it would probably be better to designate some externally available pins for SPI use. By experimentation, these work (and maybe more would):

busio.SPI(board.A3, board.A2, board.A1)
busio.SPI(board.A1, board.A3, board.A2)

A1, A2, and A3 are the only set of three externally available pins on the same SERCOM.

raven canopy
#

are we able to handle Exceptions from submodules? I'm getting a ValueError that I can't seem to catch:

with I2CDevice(i2c_bus, _VEML6070_ADDR_ARA) as ara: # address will only exist if there is an Alert Response Address (aka INTerrupt)
            try:
                ara.readinto(ara_buf)
                print('ARA: ', ara_buf)
            except ValueError: # also tried except Exception & OSError
                print('err0r')
tulip sleet
#

@raven canopy are you getting the ValueError on the ara.readinto() or on the with? Maybe you need to wrap the with in try?

raven canopy
#

@tulip sleet sorry, could've made that clearer. getting the error on ara.readinto(). "No I2C device at address..."

tulip sleet
#

@raven canopy I think you will get that error if there's no device at that I2C address earlier, in the I2CDevice constructor. Checking...

raven canopy
#

moving the try: up a level worked. thx!

idle owl
#

@slender iron My example code for the INA219 doesn't pyllint, but looking, neither does yours for the motor_featherwing. Are examples exempt from pylint or something?

slender iron
#

the travis.yml needs to be adjusted. its not set up for subfolders

idle owl
#

so makes more sense to make sure the examples pass pylint now for less updating later?

robust coral
#

QQ: #circuitpython-dev is great. Is there a channel in a similar vein for discussing Arduino/C++ interfaces?

tidal kiln
robust coral
#

Ok. That was my guess as well. Thanks.

prime grove
#

@robust coral we just added a Arduino channel on the Sudomod server and the discussion includes C/C++ stuff

#

do you have a specific question?

robust coral
#

I was just looking to bounce some ideas about the Adafruit_SSD1306 driver.

prime grove
#

I've written my own SSD1306 code if you're interested (in C)

robust coral
#

I've made a lot of private improvements and I want to see what it would take to upstream some of it.

prime grove
#

I ported it to Arduino, but haven't shared that code yet. What kind of improvements did you make

#

?

#

I

tidal kiln
#

@robust coral submit a PR to the repo

prime grove
#

I'm also working on a remote API to use the Arduino as an I/O slave

#

today, my itsy bitsy (Atmega32u4) stopped being recognized by my computer. Another one I have works fine, so it's not a driver issue

robust coral
#

A PR would be after the work is done. I wouldn't want to waste reviewer time if the direction isn't where Adafruit wants to go with it, so I was hoping to get a sense of what direction they're looking for. I'll just submit a PR and see what they say.

#

Summary: Eliminate the #define shenanigans to support different sizes. Add a small Python script to generate Adafruit logo bitmaps properly scaled to various sizes. Support for multiple displays. Rename variables to avoid macro conflicts (e.g. CS -> cs_pin). Concentrate #ifdefs with output pin abstractions. Fix dim() to emit the right size-dependent electrical current values. displayOn/displayOff. Like I said, lots of stuff. I'd have to break it down in a few PRs I think.

tidal kiln
robust coral
#

ok

tidal kiln
#

which is more pythonic? or just proper i guess

if value != 0 and value != 1:
    print("must be 0 or 1")

or

if not (value == 0 or value == 1):
    print("must be 0 or 1")
umbral dagger
#

IMO it is more about what's important to communicate.

#

regardless of language

#

To me, personally, the first is usually easier to understand

#

But the details of the code and context effect that.

robust coral
#

Yeah, looks 50/50 to me. I like the second in this case only because what you print() matches the language of the conditional. That is, the phrasing with the word "or".

tulip sleet
#

if not value in (0, 1)

#

that's pretty pythonic

#

if value not in (0,1) is even better

robust coral
#

I wonder if there's a slight runtime cost to making the (0,1) tuple and iterating over it vs just doing the == directly.

#

Or if Python is smart enough to optimize it out.

tidal kiln
#

i like that second one @tulip sleet

tulip sleet
#
halbert@salmonx:~/bin$ python3 -m timeit 'value = 1; value not in (0,1)'
10000000 loops, best of 3: 0.0363 usec per loop
halbert@salmonx:~/bin$ python3 -m timeit 'value = 1; not (value == 0 or value == 1)'
10000000 loops, best of 3: 0.052 usec per loop
#

that's not in CircuitPython, so I don't know how it would do, but one could do a similar test

robust coral
#

Cool. "-m timeit" just changed my life.

slender iron
#

welp, I hosed my usb bus ๐Ÿ˜ƒ

fringe trench
#

yikes!

slender iron
#

lost my stream audio

tulip sleet
#

did you fry it, or is this a software problem?

idle owl
#

I bet reboot fixes it

#

This isn't the first time that's happened ๐Ÿ˜„

slender iron
#

software

#

I'm handing out ptrs that aren't on the heap

#

can't figure out when

opal elk
#

sounds like you're in... a heap of trouble

#

๐Ÿ˜Ž

slender iron
#

lol

idle owl
#

Ok I actually laughed out loud.

slender iron
#

definitely

#

trying to make a gif of the heap

raven canopy
#

@opal elk careful, you might set off a pun-battle with Andon. ๐Ÿ˜„

tulip sleet
#

took me a while to get that joke

opal elk
#

I mean I was a little offended he had the title but I really love my purple color so I won't complain

#

I only contribute to open source for the discord flair adabot

#

I think I have to write an example for a library to make up for the sins of that pun though

raven canopy
#

lol

upbeat plover
tulip sleet
#

@upbeat plover just pick a pin on the trinket and wire that pin to a pin on the relay wing. Solder the on-board jumper for the pin on the relay wing. Don't forget a ground to both as well

upbeat plover
#

Before I purchase can a trinket handle the relay, Si7021 ,RFM69HCW, and a Magnetic contact switch ?

tulip sleet
#

@upbeat plover you mean trinket m0?

upbeat plover
#

I have a project in mind, and want to do it all in circuitpython.... Control the trinket with my CPX using 2 RFM69 breakouts.... Want the relay to turn on and off Humidifier to keep plant turgor pressure good....

#

yes trinket M0

tulip sleet
#

we have no libraries yet for RFM69, but they are being worked on

solar whale
#

@upbeat plover I think you will run out of pins for an I2C sensor and the SPI rfm69 and a switch on a trinket.

tulip sleet
#

@upbeat plover easier to use feather m0 and stack all that stuff

#

or use a feather doubler or tripler

solar whale
#

I would go with a feather M0 express so you have the UF2 Bootloader as well.

upbeat plover
solar whale
#

It should. But you wonโ€™t have the UF2 Bootloader.

#

That library is very new and under development. It only supports some of the rfm69 modes at this time but should be useable. I have not tried it yet. Hope to soon.

tulip sleet
#

you may also need the extra code space available in the Express version (2MB instead of 64kB)

upbeat plover
#

Okay, thanks for advise @solar whale & @tulip sleet

solar whale
#

Youโ€™re welcome. Good luck with your project.

raven canopy
#

taking the lazy route: do we have frozenset available? might need something dictionary-like...but ordered.

#

required less effort than i expected py/objset says we do in fact have frozenset! yay!

raven canopy
#

VEML6070 driver done (I think). Now to tackle the tough part: {cookiecutter} and linting on a windows machine...oh, and non-WIP documentation.

stuck elbow
#

@slender iron maybe it will give you some ideas

#

it uses a shared buffer for all the registers

tidal kiln
#

@idle owl you've been working with joy featherwing?

timber lion
#

@upbeat plover probably not yet, the M0 feather needs a special circuitpython build to expose the internal CS and RST pins

#

later this week when the guide is published it will probably be available

#

and yeah a trinket + SPI + I2C is going to be really hard to do pin-wise

#

the RFM69 library isn't too bad on memory usage but be prepared just in case you can't fit both the Si sensor and RFM in memory

#

you might need to rethink the project or switch some parts to arduino

#

and just FYI @tulip sleet the RFM69 library is done and ready for folks to use in case people ask

manic glacierBOT
#

We need a new build of both 2.2 and later 3.0 which is for the feather M0 RFM69 board (https://learn.adafruit.com/adafruit-feather-m0-radio-with-rfm69-packet-radio?view=all#downloads). Unfortunately our basic M0 build only exposes the pins on the outside of the feather and is unable to access the CS, RST, and interrupt lines of the RFM radio built-in to this feather (which use pins routed internally). Here's the mapping to SAMD21 pins:

D3 = RFM69 D0/interrupt = SAMD21 PA09 (this line is ...

solar whale
timber lion
#

it's 3, 4, 8

#

not sure what those black boxes are

solar whale
#

sorry - my confusion - you are correct 3,4,8 - the black boxes are Physical Pin names for the processor chips

timber lion
#

ah no worries, yet i'm still kinda confused by the fancy graphic diagrams.. a lot of info there ๐Ÿ˜ƒ

#

er yeah i'm still...

#

i always go straight for the schematic these days

solar whale
#

good advice! Sorry for the misleading advice @upbeat plover

upbeat plover
#

could you use a wire from the radio over to the feather?

solar whale
#

@upbeat plover - not sure what you mean. It is not a problem for the breakout board, only for the integrated unit where the radio is on the board with the processor. Building a new version of Circuitpython that allows access is not a big deal. Just has to be done to use that particualar board.

#

If you go withe the M0 express and the breakout board, you are all set.

upbeat plover
#

I won't be getting the parts for another week. I want to order a bunch of stuff at once.

solar whale
#

But as @timber lion pointed out, you still may run into problems with memory availabilty.

#

I hope to run some tests with the RFM69 and a temp/humidity sensor this weekend. I am using the sht31. I'll let you know how it goes.

#

@upbeat plover oops - just realized there is no CP library for the sht31 - gues I'll try the si7021. ๐Ÿ˜‰

slender iron
#

@timber mango do you have examples about how the drivers would change?

tidal kiln
slender iron
#

kk, will look

solar whale
slender iron
#

@solar whale I feel like I saw one go by

#

but maybe not

#

@tidal kiln looks really good overall. the only thing you could change is lazily creating the pin objects when people read the property

solar whale
#

guess I have a challenge ๐Ÿ˜‰

#

It was dicsuused a long time ago and not recommended as a "first try". I'll do some digging.

tidal kiln
#

@solar whale not seeing an issue for it, nor an entry in the spreadsheet

solar whale
#

@tidal kiln thanks - guess I'll add one after I look into it a bit.

timber lion
#

awesome yeah let me know if you run into any RFM69 trouble.. and if you make a fun script we could throw it in the examples to show people more usage too

#

i have a feeling sensor reading and sending is something a lot of folks would find useful there

#

could be nice to use its repl view and code editing at least

#

the upload i bet uses the pyboard stuff

solar whale
#

@tidal kiln where is the "speadsheet"?

tidal kiln
#

@slender iron would that be like setting them to None in __init__ and then having a conditional in the @property function to create them if they are None

solar whale
#

thanks!

upbeat plover
#

The other day I said "plant turgor pressure", but I really mean is "vapour pressure deficit". How do you write the equation in python?

tidal kiln
#

i assume it's still being used?

slender iron
#

@tidal kiln yeah, exactly

tidal kiln
#

@upbeat plover what do you mean by that? 'write the equation'?

upbeat plover
#

computing plants in greenhouse

tidal kiln
#

try exp() from math

upbeat plover
#

thank you

solar whale
#

you will also need math.log2

#

same seciton of the guide

tidal kiln
solar whale
#

sorry - my mistake -- having a bad day .... yes math.log

manic glacierBOT
#

I'm trying to keep 2.x very limited going forwards so we can focus on 3.x.

All SAMD21 pins are exposed in microcontroller.pin:

>>> from microcontroller import pin
>>> dir(pin)
['PA00', 'PA01', 'PA02', 'PA03', 'PB08', 'PB09', 'PA04', 'PA05', 'PA06', 'PA07', 'PA08', 'PA09', 'PA10', 'PA11', 'PB10', 'PB11', 'PA12', 'PA13', 'PA14', 'PA15', 'PA16', 'PA17', 'PA18', 'PA19', 'PA20', 'PA21', 'PA22', 'PA23', 'PA24', 'PA25', 'PB22', 'PB23', 'PA27', 'PA28', 'PA30', 'PA31', 'PB02', 'PB03']
...
solar whale
#

@slender iron so you can access any pin like this from microcontroller.pin import PA08 pin=digitalio.DigitalInOut(PA08)

slender iron
#

yeah

#

it should work, its the same objects that board uses

solar whale
#

cool!

manic glacierBOT
#

I'd recommend taking this for the simplicity of users who want to use the Feather M0 RFM69. The alternative is loading the M0 feather basic build (not obvious or mentioned in docs) and using the alternative pins from microcontroller. We built the tooling to automatically generate builds so adding new ones has minimal overhead right?

If it is the case that adding new builds is too much work for intra-milestone releases I would go ahead and make builds for all the Feathers proactively like...

#

I think this can be merged in as is, separate from any changes to the current BLE API. So far I've found the existing API sensible for peripherals with basic use cases, and have only tryied scanning for devices in Central mode, but I haven't felt a compelling need to reinvent the wheel so far. I still need to test how things like INDICATE and NOTIFY work to make sure they behave as expected, etc., as well as features like the SCAN RESPONSE secondary advertising packet.

idle owl
#

@tidal kiln Yes, re joy featherwing

manic glacierBOT
stuck elbow
#

@slender iron sorry, I don't have an example, I will add it

slender iron
#

np, just trying to understand the differences

stuck elbow
stuck elbow
#

the main difference is that the registers are handled all together, at the level of the whole driver, not at the level of individual registers, so they can use a common shared buffer and so on

#

I also merged the busdevice and register together, to remove overhead

#

I tried to also come up with a way to not have to have a separate object for every register, but couldn't think about anything that didn't seem artificial

#

@slender iron I also wonder if it would make sense for busdevice to have a buffer, so that all drivers on the bus could share it

#

and methods like i2c.writeto_struct(device, data_format, data)

#

then the registers don't need a buffer at all

slender iron
#

yeah, thats a possibility

#

the register data descriptors can always add a share buffer onto the object

#

have you measured a memory or speed increase with this approach? it seems to me like its a lot of the same code organized in a different way

stuck elbow
#

I didn't, I just started rearranging things to see if I can come up with something more efficient

#

and yes, it's the same thing โ€” it's supposed to do the same thing, after all

slender iron
#

๐Ÿ˜ƒ experimentation is good. did you see my latest heap stuff?

stuck elbow
#

I only saw that you started to come up with ideas, but didn't look at any code

slender iron
#

it charts object ownership

stuck elbow
#

so the top row is root pointers?

slender iron
#

and layout

#

yeah

#

still working on the layout code

stuck elbow
#

are you using dot?

slender iron
#

graphviz isn't cooperating

#

yeah

#

know of something better?

stuck elbow
#

try javascript and d3

slender iron
#

yeah, I thought about that

#

I'm trying to not to incur a bunch more work

#

the layout stuff is because I'm experimenting with allocating "long lived" objects at the top of the heap

stuck elbow
#

I love graphviz, but it has its limitations

slender iron
#

yeah, having fixed positions is being finnicky

timber lion
#

is something broken with 2.x @slender iron @tulip sleet ? I'm doing a 'git submodule update' in 2.x and getting: "fatal: no submodule mapping found in .gitmodules for path 'frozen/Adafruit_CircuitPython_BusDevice'"

#

something is very strange, i did a git pull origin 2.x and it's really mad

#

i'm just going to have to delete and start fresh

#

for some reason it's changing a ton of stuff that i haven't modified

#

golly git stash even fails

#

i've never seen that

#

atmel-samd/boards/circuitplayground_express/mpconfigboard.h: unmerged (f9ff05084a26653dc97a6d6300453572a81de331)
...
fatal: git-write-tree: error building trees
Cannot save the current index state

#

that seems like quite a nasty bug in git

#

i wonder if all of this is completely lost now

stuck elbow
#

perhaps it's time for a fresh clone

timber lion
#

hrm i can't get a fresh clone to build either

#

i've done a gitsubmodule init

#

but fail to build any board

#

tony-imac:atmel-samd tony$ make BOARD=feather_m0_basic
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
make: *** No rule to make target freetouch/adafruit_ptc.c', needed by build-feather_m0_basic/genhdr/qstr.i.last'. Stop.

#

are we missing submodules somewhere?

#

@slender iron anything up with 2.x branch? fresh clone and git submodule init after is failing to build the existing boards

#

tony-imac:circuitpython tony$ git submodule init
Submodule 'freetouch2' (https://github.com/adafruit/Adafruit_FreeTouch.git) registered for path 'atmel-samd/freetouch'
Submodule 'frozen/Adafruit_CircuitPython_BusDevice' (https://github.com/adafruit/Adafruit_CircuitPython_BusDevice.git) registered for path 'frozen/Adafruit_CircuitPython_BusDevice'
Submodule 'frozen/Adafruit_CircuitPython_LIS3DH' (https://github.com/adafruit/Adafruit_CircuitPython_LIS3DH.git) registered for path 'frozen/Adafruit_CircuitPython_LIS3DH'
Submodule 'atmel-samd/frozen/Adafruit_CircuitPython_NeoPixel' (https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel) registered for path 'frozen/Adafruit_CircuitPython_NeoPixel'
Submodule 'frozen/Adafruit_CircuitPython_Thermistor' (https://github.com/adafruit/Adafruit_CircuitPython_Thermistor.git) registered for path 'frozen/Adafruit_CircuitPython_Thermistor'
Submodule 'lib/axtls' (https://github.com/pfalcon/axtls) registered for path 'lib/axtls'
Submodule 'lib/berkeley-db-1.xx' (https://github.com/pfalcon/berkeley-db-1.xx) registered for path 'lib/berkeley-db-1.xx'
Submodule 'lib/libffi' (https://github.com/atgreen/libffi) registered for path 'lib/libffi'
Submodule 'lib/lwip' (http://git.savannah.gnu.org/r/lwip.git) registered for path 'lib/lwip'
Submodule 'tools/python-semver' (https://github.com/k-bx/python-semver.git) registered for path 'tools/python-semver'
Submodule 'tools/uf2' (https://github.com/Microsoft/uf2.git) registered for path 'tools/uf2'
tony-imac:circuitpython tony$ cd atmel-samd
tony-imac:atmel-samd tony$ make BOARD=feather_m0_basic
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
make: *** No rule to make target freetouch/adafruit_ptc.c', needed by build-feather_m0_basic/genhdr/qstr.i.last'. Stop.
tony-imac:atmel-samd tony$

slender iron
#

@timber lion sorry, I don't know the answer, thats why I didn't reply

timber lion
#

unsure how is it supposed to build?

#

is there some state folks have that isn't checked in?

slender iron
#

travis wouldn't have it

timber lion
#

ah ok, is there a step i'm missing?

#

just following the standard build steps we've had

slender iron
#

no rule to make target usually means the file is missing

#

can you ls it?

timber lion
#

ah so i think the problem is you need to git submodule init --recursive

#

looking at what travis does differently

#

that pulls in a ton more files

slender iron
#

ah, I see

timber lion
#

yeah that seems to be the issue

slender iron
#

great!

timber lion
slender iron
#

please update it ๐Ÿ˜ƒ

timber lion
#

i'd suggest the creator of the travis config update it

#

since that seems to be the canonical source

#

i can guess but will get it wrong ๐Ÿ˜ƒ

slender iron
#

travis does the submodule stuff automatically

timber lion
#

something is telling it to do this:
2.26s$ git clone --depth=50 --branch=2.x https://github.com/adafruit/circuitpython.git adafruit/circuitpython
Cloning into 'adafruit/circuitpython'...
$ cd adafruit/circuitpython
$ git checkout -qf 8251abba8a39991c4b3475161c1565f4fa8d105b
git.submodule
10.21s$ git submodule update --init --recursive

slender iron
#

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

manic glacierBOT
#
[adafruit/circuitpython] New branch created: missing\_feathers
timber lion
#

wow i cannot for the life of me get github to push this change up

#

tony-imac:circuitpython tony$ git push -u origin missing_feathers
error: src refspec missing_feathers does not match any.

#

i'm in a local 'missing_feathers' branch, it's all committed and ready

#

it refuses to let me push to a remote missing_feathers branch

#

everything looks fine branch-wise

#

tony-imac:circuitpython tony$ git branch -vv
2.x 8251abb [origin/2.x] Merge pull request #520 from pewpew-game/2.x

  • missed_feathers 23cad67 Add missing Feather M0 boards: RFM69, RFM9x, nRF51, WINC1500.
#

what's up?

#

it's tracking origin/2,x

slender iron
#

your local branch is "missed_feathers"

timber lion
#

yes

slender iron
#

and your push is "missing"

timber lion
#

oh!

#

haha

slender iron
#

๐Ÿ˜‰

manic glacierBOT
#
[adafruit/circuitpython] branch deleted: missing\_feathers
#
[adafruit/circuitpython] New branch created: missed\_feathers
timber lion
#

oh boy now we enter the world of pain figuring out how to send the pull against 2.x and not master ๐Ÿ˜ƒ

manic glacierBOT
#

This is a change to add the following board definitions based on the Feather M0 basic:

  • Feather M0 RFM69
  • Feather M0 RFM9x
  • Feather M0 nRF51
  • Feather M0 WINC1500

Each definition is exactly the same as the M0 basic but with the addition of internally routed control pins for the peripherals added to these feathers (CS, RST, etc. lines). No other changes are made to the board definitions.

Each build as expected:

tony-imac:atmel-samd tony$ make BOARD=feather_m0_rfm69
Use mak...
slender iron
#

world of pain = drop down menu

timber lion
#

yeah looks like they made it a lot easier than last i did it

slender iron
#

๐Ÿ‘

idle owl
#

@tidal kiln Finishing up a lib for the joy featherwing right now

tidal kiln
#

@idle owl cool. just started using it this morning. saw ur previous comments. so was wondering if one was in works.

idle owl
#

yeah. The bulk of it is done. I want to add a calibration option, so I'm trying to figure out how to do that. Otherwise needs docs and it'll be set.

#

Mine reads -4, 0 when it's centered.

tidal kiln
#

also, saw that issue in the main seesaw lib, was wondering if there was any relation

idle owl
#

I don't know about that issue

tidal kiln
#

to make the api match cp

idle owl
#

Ah. In this case we're building a featherwing library. Where you can import the featherwing and don't have to deal with setup.

tidal kiln
#

yep. nvm then. basically just looking for a next thing to work on.

idle owl
#

Ah ok

#

The seesaw thing seemed to be unrelated, so that might be good

tidal kiln
#

and sounds like joywing is covered ๐Ÿ˜€

idle owl
#

At least from this angle anyway! I'll send you a link once I post it so you can test it. That would be super helpful

tidal kiln
#

๐Ÿ‘

manic glacierBOT
#
[adafruit/circuitpython] New branch created: missing\_feathers
#

This is the partner of pull https://github.com/adafruit/circuitpython/pull/538 for 2.x but against master. Support for the missing RFM69, RFM9x, nRF51, and WINC1500 boards is added to the atmel-samd port. These are again based on the M0 basic but with the addition of internally routed pins for peripherals.

All build as expected:

tony-imac:atmel-samd tony$ make BOARD=feather_m0_rfm69
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosi...
#

Sounds good, merge these requests to add the missed boards:
2.x: https://github.com/adafruit/circuitpython/pull/538
master: https://github.com/adafruit/circuitpython/pull/539
I added the RFM69, RFM9x, nRF51, and WINC1500 to cover all of the Feather M0 boards. They're based on the Feather M0 basic but add pin definitions for the internally routed peripheral control lines. This will make it much easier for users to use these feathers, and help anyone who wants to start on support for WINC15...

manic glacierBOT
upbeat plover
simple quarry
#

so, im trying to create something that can access the internet from the computer, and read something back to the device.... How would i do this?

#

thanks in advance!

slender iron
#

@simple quarry to use it in conjunction with your computer you'll need code running on it as well. It might be easier to use a Feather Huzzah ESP8266 to connect directly to the internet

simple quarry
#

thats fine to be able to have code running on the computer, how would i do that?

slender iron
#

to use python you'll want to look into pyserial as a way to communicate with circuitpython

#

unfortunately, I don't know of any guides that do this

simple quarry
#

huh

solar whale
#

@timber lion good start - I have an RFM69 featherwing on a feather m0 Express using your rfm69 driver and the example - and it is communicating with my "base" station running an Arduino sketch.

#

@upbeat plover not sure what you are looking for use log just like exp ```
import math
math.pow(2.,4.)
math.exp(2.)
math.log(2.)

stuck elbow
#

in two weeks

tidal kiln
#

@upbeat plover your code looks OK to me

#
es = 0.6108 * math.exp(17.27 * temp / (temp + 237.3))
#
ea = rh / 100 * es
#

and i don't see any log functions

upbeat plover
tidal kiln
#

uses ** to raise to a power:

>>> 4**2
16
>>> 
#

6.11 * 10**((7.5*Td)/(237.3+Td))

upbeat plover
#

thank you

#

i think i can do everything now

raven canopy
#

In today's episode of "Windows Strikes Again..." ๐Ÿ˜›

Python 3.6.2 (v3.6.2:5fd33b5, Jul  8 2017, 04:57:36) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> cookiecutter gh:adafruit/cookiecutter-adafruit-circuitpython
  File "<stdin>", line 1
    cookiecutter gh:adafruit/cookiecutter-adafruit-circuitpython
                  ^
SyntaxError: invalid syntax
manic glacierBOT
timber mango
#

@raven canopy lol ๐Ÿ˜„

manic glacierBOT
raven canopy
#

the VM doesn't like cookiecutter either...hrm

#

oh man. i gotta make dinner! later taters

idle owl
#

@raven canopy have a good one!

slender iron
#

str can be allocated on the stack

upbeat plover
#

best VPD I can get

# temp in C
def vpd(temp, rh):
    # 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 mean
    es = (es1 + es2) / 2
    # Actual Vapor Pressure
    ea = rh / 100 * es
    # Vapour Pressure Deficit
    vpd = es - ea
    return vpd
tulip sleet
#

@slender iron ! is the qstr obj ever possibly returned from the routine that calls load_qstr()?

slender iron
#

I don't believe so

#

well, it doesn't matter

#

the str object is always deleted

tulip sleet
#

@slender iron that's great! was that a module load? Looks like you already did the temp/perm partition. What was all the leftover stuff on the left at the end?

slender iron
#

@tulip sleet its loading the motor featherwing code

#

and doing one step

#

code.py is four lines or something ๐Ÿ˜ƒ

#

this video only has qstr stuff being "long lived"

manic glacierBOT
tulip sleet
slender iron
#

@tulip sleet yeah sure

solar whale
#

@timber lion Success! I now have my rfm69 featherwing transmitting temperature and humidity from and si7021 either on receipt of a packet from the "base" station or at a fixed time interval. This is using the new adafruit_rfm69 driver with CP2.2 on a feather m0 express. The base station (arduino) is an rfm69 featherwing on a feather m0 WINC1500 that then relays the data to my adafuit.io page. I can even request a reading from the adafruit.io Dashboard! It needs some clean up, but it is working great! Thank you for getting the dirver out there.

solar whale
#

@simple quarry try restating your question - it's not quite clear what you are trying to do.

#

What type of computer aare you using and what have you tried so far. How are you communicating with the CP Express now?

timber mango
#

yay blinka!

raven canopy
#

cookiecutter is going to fight me just as hard as everything else has. little does it know, i'm an aires... head down, ramming speed!

simple quarry
#

how do you print something in serial, and then read it back in python on the pc

raven canopy
#

@simple quarry by "print in serial", i'm assuming you mean having a microcontroller send data through the serial port, and then reading that data on the PC, yes? someone mentioned pySerial iirc. which if you're locked into using Python on the PC, would be what you're looking for.
http://pyserial.readthedocs.io/en/latest/pyserial.html#

timber mango
#

(they didn't have a spot-on emoji, so I chose 'on' here)

raven canopy
#

take that, cookiecutter! I win! i may be too excited about that

timber lion
#

oh rad super cool @solar whale !

stuck elbow
#

what happened to that blinka logo in that tutorial?

#

half her stomach scales are missing

upbeat plover
#

okay, so I found another Saturation Vapor Pressure equation, I think I like this one the best. I have no way of checking other then using online calculators and charts. Use plant canopy temperature for best results. The 3 methods of getting SVP are all nearly synonymous.

# temp in C
def vpd(temp, rh):
    # Saturation Vapor Pressure
    es = 6.112 * math.exp(17.62 * temp / (temp + 243.12)) / 10
    # Actual Vapor Pressure
    ea = rh / 100 * es
    # Vapour Pressure Deficit
    vpd = es - ea
    return vpd

while True:
    if vpd(10, 50) < 0.6:
        #turn on humidifier
    if vpd(10, 50) > 1.6:
        #turn off humidifier
bronze geyser
#

I am attempting to try out the RFM60 CircuitPython library @tdcola. The challenge is the library is 33K, too big for the Feather M0.... I assume I need to get it to a .mpy (frozen library). The only directions say to use vagrant on my mac...I can do this but is it possible to post the .mpy on GitHub? Or am I to do something else? I can do the vagrant step...but wanted to ask before investing time. THanks.

#

OOps. I meant RFM69.

stuck elbow
#

the .mpy file doesn't have to be smaller

#

you can try just removing all the comments

bronze geyser
#

Thank you @beshpu

#

@beshipu and thank you about reminding I could just remove the comments! I forgot about that.

#

Ugh @beshipu still complaining there is not enough room. GetInfo shows 10Kb...when I try to copy the 10Kb rfm69 lib you kindly provided, it says it needs 6Kb more... I'm going to Yoga...will figure something out when I get back.

stuck elbow
#

make sure your system didn't put any hidden files in there

fading solstice
#

@stuck elbow who is responsible for adding a release to a bundle library? The review (merging) or the coder?

stuck elbow
#

@fading solstice no idea, really

fading solstice
#

the ds1307 lib last got release 11/2016 but has important changes made in the last month. no release

#

i.e. do not work

manic glacierBOT
split ocean
#

hey @slender iron or anyone else w IR experience, got any time to help me figure this thing out?

#

Attempting to use adafruit_irremote to decode and then transmit, but getting some odd results.

slender iron
#

@fading solstice feel free to release as long as you've tested it

#

@split ocean what are you trying to do?

split ocean
#

decode a button press from the little Adafruit IR remote on a Feather M0 Express, and then code a Gemma M0 to be able to send that same command.

#

so far I'm using this to decode:

slender iron
#

did you start with the circuitplayground code?

split ocean
#

and this to send:

#

with a python command in between to generate the bytearray

manic glacierBOT
split ocean
#
>>> import array
>>> array.array('B', [223, 32, 239, 16]).tostring()
manic glacierBOT
split ocean
#

or whatever the decode array is for the given button

slender iron
#

can you post your full code somewhere? how is it not working?

manic glacierBOT
split ocean
#

will do. the way it is not working is that the serial output of the reader isn't the same between the actual remote button press and the Gemma transmit.

slender iron
#

ah, so its transmitting different things?

split ocean
#

yes.

slender iron
#

kk

manic glacierBOT
timber lion
#

oh check your byte string

#

ONE=bytearray(b'xff\x02\xcf0')

#

did you mean: b'\xff\x02\xcf\x00' ?

#

i.e. 0xFF, 0x02, 0xCF, 0x00

#

because without that leading slash it's actually: ascii ordinal value for x, ascii ordinal value for f, ascii ordinal value for f, 0x02, 0xCF, ascii ordinal value for 0

#

if it's more clear you can do:
ONE=bytearray([0xFF, 0x02, 0xCF, 0x00]) etc

split ocean
#

oops, I definitly messed that up

timber lion
#

yeah byte strings are tricky, i'm starting to realize they're a bad idea to use in practice

#

if you miss that leading b it silently fails too

#

generates a completely different string value

#

burned me once

#

and easy to miss the \x slash.. i think best to be explicit with arrays and numbers

manic glacierBOT
split ocean
#

I've fixed the bytestring in the transmitter code, but still don't get correct read from the gemma transmit

#

failed to decode: ('Pulses do not differ',)

manic glacierBOT
slender iron
#

@tulip sleet @timber lion should I switch my brain to merge only for github?

#

I like being able to squash things but its constantly confusing people

split ocean
#

this is my output from the remote vs. that of the gemma:

#
Heard 3 Pulses: [9122, 2241, 569]
NEC repeat!
Heard 67 Pulses: [9144, 4504, 573, 568, 567, 580, 565, 599, 546, 568, 567, 602, 543, 598, 547, 595, 542, 599, 544, 1679, 621, 1630, 570, 1679, 571, 1680, 570, 1680, 570, 1685, 565, 600, 545, 1678, 573, 569, 566, 602, 543, 572, 572, 596, 540, 1683, 567, 574, 571, 571, 574, 570, 565, 1682, 568, 1683, 567, 1683, 567, 1686, 565, 574, 570, 1680, 576, 1675, 570, 1680, 570]
Decoded: [255, 2, 247, 8]

Heard 67 Pulses: [9179, 4477, 563, 568, 597, 535, 590, 568, 567, 564, 591, 541, 594, 537, 587, 572, 583, 547, 588, 574, 561, 566, 588, 570, 595, 562, 563, 569, 595, 562, 593, 539, 596, 561, 594, 538, 587, 544, 591, 567, 587, 544, 591, 567, 568, 563, 592, 540, 595, 563, 562, 569, 595, 563, 592, 570, 565, 563, 592, 565, 590, 543, 592, 565, 589, 568, 567]
Failed to decode: ('Pulses do not differ',)```
manic glacierBOT
#

Both pulls should be updated with what appears to be the way to add new boards. One thing though, this will send the generated bins to rosie's ngrok URL just like the other boards. If there's any state in rosie that needs to be made aware of these new boards let me know--it's not clear what happens once the bins are sent. Travis should be building them though (both the .uf2 and .bin versions).

slender iron
#

@split ocean where did you come up with the values for the generictransmit init?

split ocean
manic glacierBOT
split ocean
#

she said she trial and errored it, so I'd love to know more about how that should be determined.

#

is there a protocol we can reference for different remote types?

slender iron
#

ok, I think you can get values for it from the decoder

#

try passing debug=True into decode_bits

#

there is a print for the bins that should be what you want

manic glacierBOT
#

Err actually now this pull is updated for the master branch. It looks like the travis config is bifurcated between building on travis and other environments so the list of boards lives in two spots (.travis.yml and build_adafruit_boards.sh). I've updated both places now, but should we remove the concept of ATMEL_BOARDS from build_adafruit_boards.sh? This in particular: https://github.com/adafruit/circuitpython/blob/master/tools/build_adafruit_bins.sh#L5 Something to consider for future work.

upbeat plover
#

@split ocean if you get it working can I see an example? I ended up just sending the whole array... and what your doing is so much better

slender iron
#

@split ocean these numbers are too close (570, 570), (570, 580)

split ocean
#

w debug on for my real remote i get this output:

slender iron
#

my guess is that ones are (570, 1600) or so

split ocean
#
length:  3
NEC repeat!
Heard 67 Pulses: [9123, 4510, 568, 572, 573, 568, 567, 574, 571, 570, 575, 566, 570, 572, 572, 569, 566, 576, 572, 1678, 572, 1678, 569, 1682, 568, 1682, 569, 1681, 569, 1681, 572, 596, 545, 1681, 570, 595, 540, 574, 571, 569, 566, 575, 570, 1680, 570, 599, 546, 569, 566, 575, 570, 1680, 570, 1681, 570, 1683, 567, 1681, 569, 600, 550, 1673, 572, 1679, 571, 1680, 570]
length:  67
new length:  66
evenbins:  [[4510, 1], [588, 17], [1679, 15]] oddbins: [[569, 33]]
evenbins:  [[588, 17], [1679, 15]] oddbins: [[569, 33]] outliers: [4510]
Pulses: [4510, 572, 568, 574, 570, 566, 572, 569, 576, 1678, 1678, 1682, 1682, 1681, 1681, 596, 1681, 595, 574, 569, 575, 1680, 599, 569, 575, 1680, 1681, 1683, 1681, 600, 1673, 1679, 1680] & Bins: [[588, 17], [1679, 15]]
Space: 1679 Mark: 588
32 [True, True, True, True, True, True, True, True, False, False, False, False, False, False, True, False, True, True, True, True, False, True, True, True, False, False, False, False, True, False, False, False]
Decoded: [255, 2, 247, 8]```
#

i don't know what in that is meant to go into my GenericTransmit line

slender iron
#

so looking at this: evenbins: [[588, 17], [1679, 15]] oddbins: [[569, 33]] outliers: [4510]

upbeat plover
#

one of the even and odd are almost the same

slender iron
#

right, so bits are sent as a high pulse and a low pulse

#

and Generic transmit take a tuple of the high time and the low time

#
  • note my highs and lows may be backwards
#

the low time is always the same, hence oddbins are centered around 569

#

(33 is the count of pulses in that "bin")

#

so that means you're params would be (one, 569), (zero, 569)

#

where one and zero are different

#

looking at the even bins there are two values 588 and 1679

#

my guess is one is longer

#

so it'd be (1679, 569), (588, 569)

timber lion
#

from what your gemma is sending it looks like it's a bunch of zeros

#

all those 500 ms changes

#

at least IIRC those are zero

#

not super familiar with the generic IR transmit code, i haven't used that one but let me take a quick look at what it does

#

i wonder if there's a diff in what it expects to be told vs. what you have captured

split ocean
#

@slender iron i'm trying to understand this, but coming up short so far. is the adafruit_irremote.GenericTransmit() looking for two even bins pairs, and odd pair and an outlier? I don't get how to derrive those values from the debug, despite your efforts to help me :)

timber lion
#

oh yeah

#

so you're initializing it like this:
remote = adafruit_irremote.GenericTransmit((9135, 4505), (570, 570), (570, 580), 565)

#

that's telling it the header is (9135, 4505)

split ocean
#

is this it?

#

remote = adafruit_irremote.GenericTransmit((1679, 15), (588, 17), (569, 33), 4510)

timber lion
#

that's the start of a standard NEC pulse

#

9ms high, 4.5 low

#

that's all good

#

but then the transmit code is told a one and a zero are the same

#

its initializer expects the next two tuples to be the time for a zero and one

#

so you're saying
one bit = (588, 17)
zero bit = (569, 33)

#

they differ a teeny bit with that 17 vs 33

#

but that's super quick and i think too fast

#

most remotes are a diff of like 500 and 1000 IIRC

#

see in your capture

#

Heard 3 Pulses: [9128, 2236, 572]
length: 3
NEC repeat!
Heard 67 Pulses: [9123, 4510, 568, 572, 573, 568, 567, 574, 571, 570, 575, 566, 570, 572, 572, 569, 566, 576, 572, 1678, 572, 1678, 569, 1682, 568, 1682, 569, 1681, 569, 1681, 572, 596, 545, 1681, 570, 595, 540, 574, 571, 569, 566, 575, 570, 1680, 570, 599, 546, 569, 566, 575, 570, 1680, 570, 1681, 570, 1683, 567, 1681, 569, 600, 550, 1673, 572, 1679, 571, 1680, 570]

#

you can see pairs like 1680, 570

#

that 1600 500 is different from a 500 500

#

and the diff between a one and zero

#

so basically your transmittier is being told one bits and zero bits should send out the effectively the same pulse lengths

#

and it all looks the same

#

i think you want something a little different there, like
remote = adafruit_irremote.GenericTransmit((1679, 15), (588, 17), (1600, 33), 4510)

#

but i can't remember exactly what the remote codes want

#

try changing that and see what you capture on the board from gemma sending it

#

it shouldn't be all 500s now

#

i might have it swapped too, a one might actually be 1600 first

#

so
remote = adafruit_irremote.GenericTransmit((1679, 15), (1600, 17), (569, 33), 4510)

#

oh wait be careful

#

i just copied your line you pasted

#

but you want that first parameter to be what you originally had

#

that's the header

#

it needs to be 9000, 4500 for most devices

#

remote = adafruit_irremote.GenericTransmit((9135, 4505), (1600, 570), (570, 580), 565)

split ocean
#

?

timber lion
#

try that, it's from your ir transmit code

#

not sure where i got those other values

split ocean
#

k

timber lion
#

but the issue is the same if you look at the transmit code in the gist, a one and zero are basically the same right now

#

and explains why you only see 500's coming from the transmit.. it blinks the LED the same rate for both a one and zero because of this in the transmit gist code: remote = adafruit_irremote.GenericTransmit((9135, 4505), (570, 570), (570, 580), 565)

split ocean
#

that's closer for sure

timber lion
#

(570, 570) and (570, 580).. they're both effectively the same

split ocean
#

the gemma transmit is now understood as being sorta properly formed, but not decoded correctly just yet

timber lion
#

Logical '0' โ€“ a 562.5ยตs pulse burst followed by a 562.5ยตs space, with a total transmit time of 1.125ms
Logical '1' โ€“ a 562.5ยตs pulse burst followed by a 1.6875ms space, with a total transmit time of 2.25ms

#

so that's what those 500 and 1600 numbers mean

split ocean
#

so this is what the gemma output looks like now:

timber lion
split ocean
#
length:  67
new length:  66
evenbins:  [[4490, 1], [571, 32]] oddbins: [[1612, 17], [579, 16]]
evenbins:  [[571, 32]] oddbins: [[1612, 17], [579, 16]] outliers: [4490]
Pulses: [1613, 1646, 1617, 1646, 1617, 1621, 1615, 1595, 582, 586, 594, 591, 594, 595, 1614, 593, 1614, 1618, 1615, 1618, 588, 1599, 1612, 1616, 588, 565, 589, 585, 1612, 586, 564, 586, 579] & Bins: [[1612, 17], [579, 16]]
Space: 1612 Mark: 579
33 [False, False, False, False, False, False, False, False, True, True, True, True, True, True, False, True, False, False, False, False, True, False, False, False, True, True, True, True, False, True, True, True, True]
Decoded: [0, 253, 8, 247, 1]```
timber lion
#

but if you check the protocol you want a logical one as 570, 1600 and a logical zero as 570, 570

#

cool yeah do you see how you want to change the tuple values to change those timings to be like the NEC protocol?

tidal kiln
slender iron
#

@split ocean the second number in the bin (like 17 and 33) is a count and you don't want to use it

upbeat plover
#

GenericTransmit((a, b), (e, f), (c, d), z)
#where the values that appeared in the serial monitor were:
[a, b, c, d, e, f...z]

#

from that apple remote thing

#

hmm i dont see where you would put the 1600 though >.<

timber lion
#

if it helps write out the values in the parenthesis too

#

a zero should be about 570 ms of pulses followed by 570 ms of nothing

#

a one should be 570 ms of pulses followed by 1600 ms of nothing

#

the tuples tell it (time in ms for pulses, time in ms for nothing)

split ocean
#

so, what is each space in the set of values meant to represent in GenericTransmit, then? Sorry, I'm trying to piece this all together :)

upbeat plover
#

GenericTransmit((a, b), (e, f), (c, d), z)
(a, b) = timing

timber lion
#

ah yeah so that's not super clear unfortunately unless you look at thecode

#

but these are the tuples

#

so header, one, zero, tail

#

the tail/trail is just one value, how long to hold low i assume

split ocean
#

I'm going to try to correlate the remote blast to what I need in my GenericTransmit line: so header here is 9146 because that's the first thing read when I hit the real remote button

upbeat plover
#

9145

#

round it out to 5 or 0

timber lion
#

yep check out the NEC protocol doc

#

pretty much all remotes start with a header of 9ms on 4.5ms off

split ocean
#

4490 is the highest value of the even bins, so that's the next one

timber lion
#

so everything will be about (9000, 4500) for the header

split ocean
#

(rounded)

timber lion
#

yeah, i wouldn't get too wrapped up in decoding exact values

#

there's jitter and timing diffs

split ocean
#

yep

timber lion
#

as long as its near 9000, 4500 you're seeing the start of a remote code for sure

split ocean
#

then the value of a one

#

which is the higher number in the odd bin pairs?

#

so 1610?

#

and a zero which is 570?

upbeat plover
#

1615

timber lion
#

Logical '0' โ€“ a 562.5ยตs pulse burst followed by a 562.5ยตs space, with a total transmit time of 1.125ms
Logical '1' โ€“ a 562.5ยตs pulse burst followed by a 1.6875ms space, with a total transmit time of 2.25ms

#

oh they have a typo

#

it says 1.687ms but should b us

#

oh wait no

#

they're right ๐Ÿ˜ƒ

#

ignore me, convert ms to us though

split ocean
#

then the zero which is 580

timber lion
#

1.6875 turns into, 1687.5

split ocean
#

and then the trail which is 580?

#

so adafruit_irremote.GenericTransmit((9145, 4490), (1615, 570), (590, 570), 580)

#

roughly?

timber lion
#

pull it apart to double check, it might help to write out each value

#

head = (9145, 4490)
head on = 9145
head off = 4490
one = (1615, 570)
head on = 1615
etc

#

then compare against the protocol

#

specifically:
Logical '0' โ€“ a 562.5ยตs pulse burst followed by a 562.5ยตs space, with a total transmit time of 1.125ms
Logical '1' โ€“ a 562.5ยตs pulse burst followed by a 1.6875ms space, with a total transmit time of 2.25ms

#

pulse burst = on in their nomenclature, and space = off

#

one

#

ack

#

aw geeze discord is really bad at editing

#

so i meant

split ocean
#

:)

timber lion
#

head = (9145, 4490)
head on = 9145
head off = 4490
one = (1615, 570)
one on = 1615
etc

#

i have no idea what discord just did above

split ocean
#

inception

#

head = (9145, 4490)

#

head on = 9145

#

head off = 4490

#

one = (1615, 570)

#

one on = 1615

#

one off = 570

#

zero = (580, 570)

#

zero on = 580

#

zero off = 570

#

trail = 580

#

does that look right based on this:

#
length:  67
new length:  66
evenbins:  [[4510, 1], [572, 17], [1677, 15]] oddbins: [[572, 33]]
evenbins:  [[572, 17], [1677, 15]] oddbins: [[572, 33]] outliers: [4510]
Pulses: [4510, 571, 571, 568, 574, 576, 576, 571, 596, 1676, 1677, 1679, 1681, 1686, 1684, 604, 1681, 600, 567, 576, 573, 1677, 596, 574, 570, 1678, 1678, 1679, 1680, 569, 1676, 1678, 1678] & Bins: [[572, 17], [1677, 15]]
Space: 1677 Mark: 572
32 [True, True, True, True, True, True, True, True, False, False, False, False, False, False, True, False, True, True, True, True, False, True, True, True, False, False, False, False, True, False, False, False]
Decoded: [255, 2, 247, 8]```
#

(note, some values changed due to fuzziness after I wrote the list and then output from the ir remote)

timber lion
#

check against the protocol first

#

so how what you wrote out compares to

#

Logical '0' โ€“ a 562.5ยตs pulse burst followed by a 562.5ยตs space, with a total transmit time of 1.125ms
Logical '1' โ€“ a 562.5ยตs pulse burst followed by a 1.6875ms space, with a total transmit time of 2.25ms

#

ignore the numbers being measured for now, just get the configuration the same as the protocol

manic glacierBOT
upbeat plover
#

[True, True, True, True, True, True, True, True, False, False, False, False, False, False, True, False, True, True, True, True, False, True, True, True, False, False, False, False, True, False, False, False]

this part tells you what is a one or zero?

timber lion
#

i wouldn't get too into decoding the debug output

#

check the protocol config first, there's a small difference right now

#

i can point it out but am just trying to kinda direct towards it ๐Ÿ˜ƒ

#

but closely compare the protocol timing for one and zero to what the config written out above has

#

look at times on and off

#

ignore all the debug output, etc. this is purely with this line: adafruit_irremote.GenericTransmit((9145, 4490), (1615, 570), (590, 570), 580) and the NEC protocol timing

lucid arch
#

hi all,

#

Can the circuitpython board do soft serial?

#

sorry, this is the wrong forum ..

split ocean
#

@timber lion I'm not sure I'm following. the protocol wants double the time I've listed for the space after the one?

timber lion
#

ahh, yeah that does look like a difference

#

you might try changing it to match

#

but it's not really just double, 570 vs 1600.. more like 3x

split ocean
#

huh, my attempts at that fail

upbeat plover
#

head(9150, 4500)
one = (570, 570)
zero = (1680, 570)

#

idk?

split ocean
#

oh, wait, now i have it working. my zero and one were reversed.

#

yes, @upbeat plover we hit the solution at the same time :)

upbeat plover
#

i still dont see where you get the tail lol

split ocean
#

@slender iron you were right, the one and zero is reversed in the GenericTransmit

#

I think

#

it seems to be (header, zero, one, trail)

timber lion
#

so actually there's more to it @split ocean

#

polarity

split ocean
#

yoinks!

timber lion
#

think of it this way, on and off is just a concept in software

#

but it can change depending on the hardware

#

if you hook up the output of a digital line to the cathod or anode of a LED it swaps how it works

split ocean
#

of course!

timber lion
#

if you hook it up to the negative side of the LED when the digital line is high the LED turns off

#

but if you change it so its hooked up to positive, now when the digital line is still high the LED is on

#

so you might actually be reversed in your hardware setup

#

i.e. how you hooked up the LED

#

and then to throw another wrench into it IIRC the IR pulse output also have a concept of inversion

#

so it can separately change its concept of on vs. off to swap them

#

so potentially two places where polarity might change

#

i haven't dug through all the code and setup but you might check and see

#

because that can drastically change the behavior and timing from what you see

timber mango
#

@upbeat plover I like that someone's working on plant life / agrarian stuff here.
re: > [10:55 UTC] hexthat: okay, so I found another Saturation Vapor Pressure equation

bronze geyser
#

Trying to debug RFM69 library. Used a .mpy ..ran simpletest.py RuntimeError raised (version != 0x24). Thought I'd try some debugging using the .py file...but get a MemoryError ... I tried deleting most (many?) of the comments, but still having a challenge. Admittedly, I'm this side of clueless. What is best way to debug RFM69 on Feather M0 RFM69HCW? (thank you).

manic glacierBOT
slender iron
#

@bronze geyser I think you are on the right track with trying to slim down the py file. Maybe @timber lion can provide insight on the error raised

tidal kiln
timber lion
#

@bronze geyser like the error mentions check your wiring

#

it's trying to validate it can read the ID register from the chip

#

it's the very first thing the library does to talk to the chip

#

so if that fails it's very likely power or wiring to it

#

if it's getting a different value from 0x24 then something is up, make sure you're using a RFM95HCW from adafruit

#

er RFM69HCW

simple quarry
#

im trying to get my circuit playground express to read something that i put into code on the computer, and i cant figure it out...

manic glacierBOT
slender iron
#

@simple quarry you need the computer to tell the circuitplayground express something over serial

manic glacierBOT
#

Oops, that particular assignment doesn't work due to the limited pad assignments on the SERCOM:

>>> spi = busio.SPI(clock=board.A3, MOSI=board.A1, MISO=board.A2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: MOSI and clock pins incompatible

This is what works and doesn't work (copied from REPL trials):

>>> spi = busio.SPI(clock=board.A3, MOSI=board.A2, MISO=board.A1) #OK
>>> spi = busio.SPI(clock=board.A1, MOSI=board.A3, MISO=boar...
upbeat plover
#

Si1145 or VEML6070 library?

raven canopy
#

@upbeat plover i'm actually putting the finishing touches on a VEML6070 library. hope to have it done over the weekend.

upbeat plover
#

Im just looking for parts to put in my wishlist, no hurry. Any plans for the si1145?

slender iron
#

thanks for the good review @stuck elbow ! I'll get to it next week. brain is in the heap now ๐Ÿ˜ƒ

stuck elbow
#

TGIF

slender iron
#

๐Ÿ˜ƒ

stuck elbow
#

I on the other hand finally have some time to do something...

raven canopy
#

@upbeat plover i've haven't heard of anyone working on the SI1145, but that doesn't mean it isn't happening.

raven canopy
#

@slender iron is Sphinx/RTD a requirement for libraries? not trying to dodge it, just seeing some disparity among libraries...

slender iron
#

its been something we should maintain but have been bad about

raven canopy
#

ok. i'll jott down what i come across...

slender iron
#

we'll add checking to adabot when we want them to be consistent

simple quarry
#

yes, @slender iron

golden tartan
#

hi

slender iron
#

@simple quarry take a look at pyserial as a way to connect to the circuitpython serial connection

#

hi @golden tartan

simple quarry
#

i have

#

i just dont know how...

slender iron
#

I've never done it myself either

simple quarry
#

oh, huh

slender iron
#

thats why I'm not being more helpful ๐Ÿ˜ƒ

simple quarry
#

its ok!

#

thanks anyways!

manic glacierBOT
slender iron
#

@simple quarry let me know if you figure it out or have other circuitpython questions!

simple quarry
#

i will

last drum
#

oh hello!

slender iron
#

hi @last drum

solar whale
#

@bronze geyser what pins are you using for RST and CS for the rfm69 on your M0?

manic glacierBOT
raven canopy
#

got a 7.26/10 on my first pylint... this close to passing the test! ๐Ÿ˜„

manic glacierBOT
manic glacierBOT