#circuitpython-dev
1 messages ยท Page 141 of 1
@jerryneedell I'm hoping to put in a PR this week with BLE support enabled out of the box, but we migrated to a different version of the SD so I need to make sure there aren't any gotchas or breaking changes that aren't immediately visible.
@microbuilder Thanks. So far, I have tried enabling BLE with the current version and executed the ubluepy_scan and the ubluepy_eddystone examples.
Hold of on merging. Just compiled on my new Feather M0 Express, and I'm getting some weird results:
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'TRJ=\x01\x00\x00\x00(a\x00 @\x13\x00 ')
>>>
yeah, nevermind. I was actually getting errors on the struct.unpack...but now it isn't. must have been a case of "error: sommersoft did something wrong".
>>> import microcontroller
>>> import struct as struct
>>> print(struct.unpack('<i', microcontroller.cpu.uid))
(1028280916,)
>>>
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
Thanks for putting a list together!
@microbuilder Thanks for the update - I have downloaded, built and tested the ble_scan.py example both via USB REPL and NUS!! Works great!
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.
You'll need a loop within this one to save the four bytes of each uint32_t into four slots in raw_id.
Just an oversight, please remove.
We need to make some further additions to the apps to send char sequences like CTRL+C and CTRL+D, yeah ... I'll get an update started for that. Occurred to me just after creating the PR and some quick REPL over NUS tests that I can't cancel a script, for example (CTRL+C).
Good point about the control-C ! I just wanted to make sure I had not missed something. I'll use the USB REPL most of the time anyway, but the NUS REPL is pretty cool!
@solar whale have you used bluepy? I want to make sure we target its API and not ubluepy
@slender iron no - so far all the examples I have tried have been using ubluepy.
ok, I think the largest thing will be using attributes where bluepy does instead of methods like ubluepy
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
yeah, it'd be good to get it reorganized
@slender iron I found the ubluepy code in nrf/modules --- is bluepy somewher else? Not finding it.
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.
ah - so you would like to see that replace ubluepy ??
yeah
the api should be the same
they are close but got adapted for mciropython-isms like not using properties
@slender iron ah - saw your note in the PR - sounds good. This has been fun to play with.
great! thanks as always for the testing
Kevin has made it pretty easy!
he's a rock star
Now I just need to find time to study his book!
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
could taht be related to the import problems I reported?
I honestly haven't read in depth about the issue. I saw it go by
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.
I did see that. its super helpful
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..
yeah, really hard
any memory issues you've come across with libraries would be helpful
my heap tools are very neat
I saw your "map" very nice!
yeah, I think it'll be useful to find bad libraries
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.
it definitely isn't an easy process. @solar whale is a champ though. helped me get through mine.
just follow the steps in ports/nrf/boards/feather52 readme
I'm talking about getting the connector on in the first place.
teh swd connector?
yes
oh. you were going the Segger/JLink route
you really don't even need it for the feather52
Oh. Thought I did, heh
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.
I see
but it is nice to have in case of "emergency"
...told ya he was a champ. ๐
@raven canopy I just like banging my head against things....
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.
@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?
@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...
@idle owl are you free in an hour or two? I need lunch soon
@raven canopy I think 16 was correct
@slender iron Yah should be
Just curious - I have a J-lInk connector on t my feather52 board and in the past, I was able to just the "make BOARD=feather52 flash" and "make BOARD=feather52 SD=s132 sd" commands to flash via the J-link. Should I expect that to still work? Does anything need to be updated in the make files for this? I thought I'd ask before trying it.
its four words of four bytes each so 16 total
then i am adding to the raw_id array incorrectly. back at it
yeah, did you see my comment?
i did. working it...in baby-step fashion. ๐
I think you need the loop from esp8266 code inside the code for the samd and nrf
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.
@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.
@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
I decided to just try the J-link and it alls seems to have worked fine. I just wanted to make sure there was not something missing with regards to eh Single bank change. Let me know if I missed something.
@solar whale Bonus! Survival is good
@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.
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.
not hard - if you remember how ๐
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.
I think I just got lucky!
@idle owl What are you attempting to do?
I've missed everything before "rework station"
@solar whale I think it should work for the other boards as well
That's really nice - sorry I gave the wrong answer on the forum. It will be great for some of the basic boards.
np, thats how we learn ๐
I was sure it had come up and had been ruled out. Lesson learned to do simple tests before relying on vague memories!
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 ...
@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++;
}
}
i think id_tick is 4 * i + k
well now it's staring right at me...too many iterations and i lost it (forest/trees). thanks!
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.
Oof. I'd be worried about the rework station melting the plastic on the connector, but it might be possible with care.
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.
Which feather, which connector, and which location?
nRF52, SWD, center of the board.
Oooh, yeah. My personal attempt would be with a soldering iron.
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.
How time-pressed are you?
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.
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
Hmm. Depends on whether he makes it, I suppose.
You're putting a new bootloader on it, right? Why not use the NRF52 Pro? https://www.adafruit.com/product/3574
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.
Exactly.
Changes made. SAMD tested on Feather M0 Express; nRF tested on Feather nRF52.
bus device is built into some firmware right?
@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?
i don't know what trellis is
in general, its better to have functionality split so only what you need can be imported
I'd suggest building a separate trellis library that uses the ht16k33 one
well, I could just import the current library inside a Trellis library. yeah. same page.
yup yup ๐
i doubt i'll be of much help, but are you talking about native bus device? or CP implemented?
gah! ```>>> from adafruit_featherwing.motor_featherwing import MotorFeatherWing
wing = MotorFeatherWing()
s = wing.stepper2
s.onestep()
MemoryError: memory allocation failed, allocating 512 bytes```
Oi
stupid parser
ok, it works
code.py works fine
dear repl,
(โฏยฐโกยฐ๏ผโฏ๏ธต โปโโป
The main tool is tools/analyze_heap_dump.py tools/analyze_mpy.py is still very coarse but the Preamble stuff is used by the dump tool.
The heap dump tool creates graphs of the heap objects like this:

well, i think i
my Trellis. assumptions...get you everytime. "Of course i put the right color wires on the right connections..."
lol 
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.
ok we'll take a look and close this issue when its added :)
Thanks @jerryneedell looks like its related to Dan's 2.2 merge in 5cb361c. I'll try and take a look later this week. I don't think its related to the FS thing I mentioned earlier today on discord.
@slender iron does that mean i wouldn't be able to use it with the bluefruit app?
@covert birch correct
ok thx
np, sorry its not there
it's cool. just glad to clarify
we'll have bluetooth support with the nrf52 first
so cool
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.
@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
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
that'll work too!
@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...
will there be a library for RFM69 to use with circuitpython?
I'm sure that sooner or later someone writes one
@upbeat plover @timber lion has started working on it here: https://github.com/adafruit/Adafruit_CircuitPython_RFM69
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
@timber lion thanks for this addition! Looking forward to working with it.
@timber lion Is a LoRa RFM95 planned? I'm assuming you're going to get this library complete first, of course
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
@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.
whats the import error? you may need to automock something
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
yup yup
No idea how to do that though
ok
I think I left an example in there commented out
autodoc_mock_imports = ["adafruit_motor", "adafruit_pca9685", "board", "busio"] this?
yeah but delete the contents and list the things for your library that you need
I'm building that lib inside adafruit_featherwing though. So don't I need to leave those too?
ah
just add to the list
Hah! Sorted a bunch of other errors that popped up once it dealt with that. And Sphinx is now happy
great!
@opaque patrol @umbral dagger @stuck elbow gonna make the meeting?
yes
sweet!
On my way
kk
using txt ๐
hear me?
Ditto txt
nope, sorry for the lack of generosity this week
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.
CircuitPython in 2018 Wow, 2017 was an amazing year for CircuitPython. This time last year it was me (@tannewt) working alone on the core while @tdicola did the first guides and @deshipu helped with drivers. It didnโt ship on any Adafruit products and none had been designed for it. We had just de...
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)
wow good luck with grad school app! ๐
thanks tony!
@prime flower That's great! Good luck again!
@prime flower Woot! Grad school is a blast.
uid as you said earlier is done (minus pending PR). Started working on a Trellis library...+/- wires crossed...
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.
โฌ #sparky

UICR is also available on SAMD in NVM. User Info Control Register
But, that's Express only ATM.
Thanks everyone! 
This was awesome... glad I finially made it.
Yeah glad to have you!
thx everyone (was deep in illustrator listening to the call ๐ )
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 ...
@tannewt to get examples done for the current library, i had to lint it as well. These are examples that will need to be rewritten for you experimental version of IS31FL3731. Let me know if you want me to finish that work.
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 ?
@mrmcwethy I'll merge it now.
I'm actually tempted to punt on the experimental version for a bit longer until we know how we want all of the displays to work.
@fading solstice thanks for doing the is31.... I think I'll skip it on my end then
This is done. Thanks @sommersoft !
Basic RFM69 support is here: https://github.com/adafruit/Adafruit_CircuitPython_RFM69
Since we don't have ISR support it only supports one packet at a time.
This is superseded by https://github.com/adafruit/circuitpython/issues/475 which is almost done.
At minimum we should delete unsupported docs and examples by 3.0.
This is done. Its in master and has other issues for its additional polish.
To do this we may need to allow for configurable USB descriptors.
Whats the goal with this? We make no timing promises when running python code. It should be expected to be variable.
someone is busy tugging on the issue thread... ๐
This is done in #474. You can:
import microcontroller
microcontroller.on_next_reset(microcontroller.RunMode.SAFE_MODE)
microcontroller.reset()
SAMD21 is working fine without this and the SAMD51 comes factory calibrated to 48 mhz.
Users haven't had an issue with terse prints for native objects. Enum-like object support seems to have been enough.
The contents of QSTRs can be quite repetitive. Perhaps a dictionary compression scheme would use less memory to store the strings.
<img width="1404" alt="qstr_chunks" src="https://user-images.githubusercontent.com/52649/35017644-93fc2688-fad2-11e7-9b40-f75aadc252a2.png">
Many strings and code info (line numbers) used for error messages are loaded into memory but used rarely. Instead, we could leave them on the filesystem until we need them when we print an error.
The parser tries to allocate 512 bytes contiguous and gives up immediately if it fails. Instead, it should be ok with a smaller chunk but be more likely to fail later if the thing to parse was complicated.
The heap gets pretty fragmented by complex libraries. We should add a step at the end of import that compacts the allocations related to the import. That way we'll have a consolidated chunk of free memory.
Are there specific things to try to test turning off the CPYTHON_COMPAT ?
MICROPY_CPYTHON_COMPAT enables:
TextIOWrappernamedtuple("MyTuple", ("id name"))in addition tonamedtuple("MyTuple", ("id", "name"))-- parsed string in addition to sequence for tuple namesprint(f)prints<function f at 0x20001220>instead of just<function>str()and bytes()withencodingarg (encoding` as a keyword arg is not implemented in any case)decode()andencode()...
Add driver to support the DS2413 1-Wire Two GPIO Controller Breakout.
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...
can someone help me with a general python question?
@hot surge go ahead
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
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
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 ;)
@timber mango get the appropriate mpy-cross from https://github.com/adafruit/circuitpython/releases then just execute mpy-cross your.py
Oh! wow. Neat. Thanks, Jerry.
good luck. That should help witht he memory allocation at startup.
Thanks. Didn't see any errors. Seems to work just fine! @solar whale
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).
For CPX what are the MOSI and MISO, is it TX/A7 and RX/A6?
@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...
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?
@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?
thank you
no, mac os 10.11.16
did you just try rebooting?
no, guess i should try that
we've seen MacOS get confused or refuse to mount CIRCUITPY. A reboot has fixed it.
let us know if it doesn't
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
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.
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
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.
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')
@raven canopy are you getting the ValueError on the ara.readinto() or on the with? Maybe you need to wrap the with in try?
@tulip sleet sorry, could've made that clearer. getting the error on ara.readinto(). "No I2C device at address..."
@raven canopy I think you will get that error if there's no device at that I2C address earlier, in the I2CDevice constructor. Checking...
moving the try: up a level worked. thx!
@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?
the travis.yml needs to be adjusted. its not set up for subfolders
so makes more sense to make sure the examples pass pylint now for less updating later?
QQ: #circuitpython-dev is great. Is there a channel in a similar vein for discussing Arduino/C++ interfaces?
@robust coral nothing as specific, best is #help-with-projects
Ok. That was my guess as well. Thanks.
@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?
I was just looking to bounce some ideas about the Adafruit_SSD1306 driver.
I've written my own SSD1306 code if you're interested (in C)
I've made a lot of private improvements and I want to see what it would take to upstream some of it.
I ported it to Arduino, but haven't shared that code yet. What kind of improvements did you make
?
I
@robust coral submit a PR to the repo
I'm also working on a remote API to use the Arduino as an I/O slave
Both displays are running my https://github.com/bitbank2/oled_example project. The one on the left is running from my Mac remotely through an Arduino. The on...
today, my itsy bitsy (Atmega32u4) stopped being recognized by my computer. Another one I have works fine, so it's not a driver issue
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.
@robust coral let's continue in #general-tech
ok
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")
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.
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".
if not value in (0, 1)
that's pretty pythonic
if value not in (0,1) is even better
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.
i like that second one @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
Cool. "-m timeit" just changed my life.
welp, I hosed my usb bus ๐
yikes!
lost my stream audio
did you fry it, or is this a software problem?
lol
Ok I actually laughed out loud.
@opal elk careful, you might set off a pun-battle with Andon. ๐
took me a while to get that joke
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 
I think I have to write an example for a library to make up for the sins of that pun though
lol
how do I wire this to be controlled by a trinket? https://www.adafruit.com/product/3191
@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
Before I purchase can a trinket handle the relay, Si7021 ,RFM69HCW, and a Magnetic contact switch ?
@upbeat plover you mean trinket m0?
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
we have no libraries yet for RFM69, but they are being worked on
@upbeat plover I think you will run out of pins for an I2C sensor and the SPI rfm69 and a switch on a trinket.
@upbeat plover easier to use feather m0 and stack all that stuff
or use a feather doubler or tripler
I would go with a feather M0 express so you have the UF2 Bootloader as well.
does Feather M0 RFM69HCW work with the sample ?https://github.com/adafruit/Adafruit_CircuitPython_RFM69
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.
you may also need the extra code space available in the Express version (2MB instead of 64kB)
Okay, thanks for advise @solar whale & @tulip sleet
Youโre welcome. Good luck with your project.
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!
VEML6070 driver done (I think). Now to tackle the tough part: {cookiecutter} and linting on a windows machine...oh, and non-WIP documentation.
@slender iron I see you are working on the i2c/spi registers stuff โ some time ago I started work on an alternate approach to the whole thing: https://github.com/deshipu/circuitpython-bus_registers
@slender iron maybe it will give you some ideas
it uses a shared buffer for all the registers
@idle owl you've been working with joy featherwing?
@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
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 ...
@timber lion looking at the pinouts for the M0 RFM69 aren;t the CS and RST availble on 11 and 13? https://cdn-learn.adafruit.com/assets/assets/000/046/255/original/feather_Feather_M0_RFM95_v1.2-1.png?1504886606
it's 3, 4, 8
not sure what those black boxes are
sorry - my confusion - you are correct 3,4,8 - the black boxes are Physical Pin names for the processor chips
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
good advice! Sorry for the misleading advice @upbeat plover
could you use a wire from the radio over to the feather?
@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.
I won't be getting the parts for another week. I want to order a bunch of stuff at once.
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. ๐
@timber mango do you have examples about how the drivers would change?
@slender iron when you get a chance:
https://github.com/adafruit/circuitpython/issues/535
some first pass code to take a look at.
kk, will look
Is anyone working on a CP driver for the SHT31-D temp/humidity sensor? https://www.adafruit.com/product/2857
@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
guess I have a challenge ๐
It was dicsuused a long time ago and not recommended as a "first try". I'll do some digging.
@solar whale not seeing an issue for it, nor an entry in the spreadsheet
@tidal kiln thanks - guess I'll add one after I look into it a bit.
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
oh interesting, FYI for pycharm users: https://blog.jetbrains.com/pycharm/2018/01/micropython-plugin-for-pycharm/
could be nice to use its repl view and code editing at least
the upload i bet uses the pyboard stuff
@tidal kiln where is the "speadsheet"?
@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 linked from this issue:
https://github.com/adafruit/circuitpython/issues/269
thanks!
The other day I said "plant turgor pressure", but I really mean is "vapour pressure deficit". How do you write the equation in python?
i assume it's still being used?
@tidal kiln yeah, exactly
@upbeat plover what do you mean by that? 'write the equation'?
Vapour-pressure deficit, or VPD, is the difference (deficit) between the amount of moisture in the air and how much moisture the air can hold when it is saturated. Once air becomes saturated, water will condense out to form clouds, dew or films o...
computing plants in greenhouse
try exp() from math
@upbeat plover https://docs.python.org/3/library/math.html#math.exp
thank you
math.log is natural log (ln):
https://docs.python.org/3/library/math.html#math.log
sorry - my mistake -- having a bad day .... yes math.log
Where are we at on this? I was hoping to hear something about the API plans going forwards.
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']
...
@slender iron so you can access any pin like this from microcontroller.pin import PA08 pin=digitalio.DigitalInOut(PA08)
cool!
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...
My goal is to focus us on 3.0 beta. I'm hoping that we can release our first beta in a few weeks. Adding more boards in 2.x is extra work because board definitions have changed with 3.x and ASF4.
I only want to modify 2.x if we need it for a hardware release like the ItsyBitsy.
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.
@tidal kiln Yes, re joy featherwing
The advertising API seems a bit limited, but I think all of those issues belong in a different PR and discussion, separate from this one which just enables the radio and BLE by default.
So would you accept a pull for adding the board in 2.x then if it's too much work for others to do now? Sorry I'm not following the need for extra work. From the user perspective this is new circuitpython support for hardware that's been requested a lot. I'd rather support it well out of the gate vs. hold on it longer to an unknown time with 3.x.
If you want to do it, then please do it in both 2.x and master.
Works for me. Thanks @microbuilder!
@slender iron sorry, I don't have an example, I will add it
np, just trying to understand the differences
<@&356864093652516868> Here is the recording of the Weekly meeting from this week: https://youtu.be/a34DH1FSqJc
Meeting notes are here: https://gist.github.com/tannewt/463052e44faf19616e6fb5cc1c3fbc63 Join here for the chat all week: http://adafru.it/discord The weekly...
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
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
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
๐ experimentation is good. did you see my latest heap stuff?
I only saw that you started to come up with ideas, but didn't look at any code
so the top row is root pointers?
are you using dot?
try javascript and d3
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
I love graphviz, but it has its limitations
yeah, having fixed positions is being finnicky
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
ah esoteric git commands to the rescue ๐ https://stackoverflow.com/questions/6006737/git-merge-errors
perhaps it's time for a fresh clone
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$
@timber lion sorry, I don't know the answer, thats why I didn't reply
its green on travis: https://travis-ci.org/adafruit/circuitpython/builds/327788515
yeah i don't see a makefile in this submodule: https://github.com/adafruit/Adafruit_FreeTouch
unsure how is it supposed to build?
is there some state folks have that isn't checked in?
travis wouldn't have it
ah ok, is there a step i'm missing?
just following the standard build steps we've had
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
ah, I see
yeah that seems to be the issue
great!
would be awesome to keep the readme up to date with that, we don't mention it here: https://github.com/adafruit/circuitpython/tree/master/ports/atmel-samd
please update it ๐
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 ๐
travis does the submodule stuff automatically
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
ยฏ_(ใ)_/ยฏ
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
your local branch is "missed_feathers"
yes
and your push is "missing"
๐
23cad67 Add missing Feather M0 boards: RFM69, RFM9x, nR... - tdicola
oh boy now we enter the world of pain figuring out how to send the pull against 2.x and not master ๐
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...
world of pain = drop down menu
yeah looks like they made it a lot easier than last i did it
๐
@tidal kiln Finishing up a lib for the joy featherwing right now
@idle owl cool. just started using it this morning. saw ur previous comments. so was wondering if one was in works.
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.
also, saw that issue in the main seesaw lib, was wondering if there was any relation
I don't know about that issue
to make the api match cp
Ah. In this case we're building a featherwing library. Where you can import the featherwing and don't have to deal with setup.
yep. nvm then. basically just looking for a next thing to work on.
and sounds like joywing is covered ๐
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
๐
abf125e Add missing Feather M0 boards: RFM69, RFM9x, nR... - tdicola
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...
Thanks for doing this on both branches!
I kept it nRF51 because it will lead to confusion with future nRF52 and other bluetooth boards that use the Bluefruit nomeclature. To prevent any confusion it's explicit with the chip name. The RFM69 and 9x boards go by 'RadioFruit' but again have confusion between which one is supported.
I disagree. I think it will be more confusing now when it doesn't match the product name in the shop or the guide page. RFM69 and 9x LoRa are not called RadioFruit in the product name like the M0 Bluefruit LE is. (I'm looking here: https://learn.adafruit.com/adafruit-feather?view=all#lora-radio-feathers)
How to resolve this then?
<img width="1046" alt="screen shot 2018-01-18 at 2 40 09 pm" src="https://user-images.githubusercontent.com/1332183/35125194-8bc8f0d6-fc5d-11e7-9dbb-be9f806ac5db.png">
# temp in C
def vpd(temp, rh):
# Saturation Vapor Pressure
es = 0.6108 * math.exp(17.27 * temp / (temp + 237.3))
# Actual Vapor Pressure
ea = rh / 100 * es
# Vapor Pressure Deficit
vpd = ea - es
return vpd
I'm having troubles with VPD calculations, I don't know how to do log stuff. Equations from
http://bioma.jrc.ec.europa.eu/components/componentstools/evapotranspiration/help/Actual_vapor_pressure.html
Can someone else do it for me? ๐คง
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!
@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
thats fine to be able to have code running on the computer, how would i do that?
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
huh
@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.)
in two weeks
@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
how do you do these?
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
How about feather_m0_bluefruit_le_nrf51? I know it's long but if there's a bluefruit_le_nrf52 they will be easy to disambiguate. Similar for the RFM boards: processor and chipset name.
Perhaps @ladyada has an opinion as well.
@raven canopy lol ๐
Whatever we want to land on ultimately works for me--my suggestion is don't 'use up' feather_m0_wifi, feather_m0_bluefruit, etc. with these early boards like the WINC1500 and nRF51--it would be unfortunate when a fancier/better/etc. WiFi or BLE board comes around and wants to be the 'default' feather.
the VM doesn't like cookiecutter either...hrm
oh man. i gotta make dinner! later taters
@raven canopy have a good one!
@tulip sleet I think I found a speed up: https://github.com/adafruit/circuitpython/blob/master/py/persistentcode.c#L127
str can be allocated on the stack
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
@slender iron ! is the qstr obj ever possibly returned from the routine that calls load_qstr()?
@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?
@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"
i have been summoned!!!
i don't want an m0+nrf51 or m0+winc board definition at this time because we dont have drivers for em right now and no plans to write drivers, & if we have bins it will make people think that its supported
for the m0+radios, please keep the two as feather_m0_rfm69 & feather_m0_rfm9x
@slender iron should I approve this https://github.com/adafruit/circuitpython/pull/529 or is it still very much in process? (obviously you are still working on the display stuff).
@tulip sleet yeah sure
@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.
@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?
yay blinka!
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!
how do you print something in serial, and then read it back in python on the pc
@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#
(they didn't have a spot-on emoji, so I chose 'on' here)
take that, cookiecutter! I win! i may be too excited about that
oh rad super cool @solar whale !
what happened to that blinka logo in that tutorial?
half her stomach scales are missing
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
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.
the .mpy file doesn't have to be smaller
you can try just removing all the comments
Here is the current RFM69 library compiled for CircuitPython 2.2.0
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.
make sure your system didn't put any hidden files in there
@stuck elbow who is responsible for adding a release to a bundle library? The review (merging) or the coder?
@fading solstice no idea, really
the ds1307 lib last got release 11/2016 but has important changes made in the last month. no release
i.e. do not work
please update to remove winc1500 and nrf51
thx
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.
@fading solstice feel free to release as long as you've tested it
@split ocean what are you trying to do?
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:
did you start with the circuitplayground code?
and this to send:
with a python command in between to generate the bytearray
>>> import array
>>> array.array('B', [223, 32, 239, 16]).tostring()
Sounds good, this is changed to remove the board definitions. If anyone needs to access the internally routed pins on these boards check out the microcontroller module and a Feather M0 basic build.
or whatever the decode array is for the given button
can you post your full code somewhere? how is it not working?
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.
ah, so its transmitting different things?
yes.
kk
These boards are removed like with pull #539 now.
this is the reader code: https://gist.github.com/anonymous/7e64e42545030d9cf10095c0f75767e8
this is the sender code:
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
oops, I definitly messed that up
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
oop, i just realized that travis is running but it wont actually check this build!
@tdicola please update .travis.yml and tools/build_adafruit_bins.sh for both
Sure--I also show above the build is clean and works for all boards. This was from a fresh pull of the repo with GCC 7. Let me know if there's a doc or explanation of what to update in the travis file before I update it too. I assume it just needs an addition similar to the M0 basic boards.
ok, i wasn't signed into git when I made those gists, so here they are again, but ediatable this time: https://gist.github.com/jedgarpark/7920289fd1d19399daa908426d11f258
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',)
@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
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',)```
a25bd7f Update build_adafruit_bins.sh to include Feathe... - tdicola
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).
Rosie will store them temporarily. It doesn't check the board name until later.
@split ocean where did you come up with the values for the generictransmit init?
@candid sun had some notes on that here: https://www.hackster.io/BlitzCityDIY/circuit-python-ir-remote-for-apple-tv-e97ea0
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?
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
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.
@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
@split ocean these numbers are too close (570, 570), (570, 580)
w debug on for my real remote i get this output:
my guess is that ones are (570, 1600) or so
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
so looking at this: evenbins: [[588, 17], [1679, 15]] oddbins: [[569, 33]] outliers: [4510]
one of the even and odd are almost the same
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)
@split ocean this might be a good guide to check out for reference: https://learn.adafruit.com/ir-sensor/circuitpython i go through some basics of capturing a remote press
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
@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 :)
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)
is this it?
remote = adafruit_irremote.GenericTransmit((1679, 15), (588, 17), (569, 33), 4510)
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)
?
k
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)
that's closer for sure
(570, 570) and (570, 580).. they're both effectively the same
the gemma transmit is now understood as being sorta properly formed, but not decoded correctly just yet
this is good background too i think mention in the guide: http://techdocs.altium.com/display/FPGA/NEC+Infrared+Transmission+Protocol
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
so this is what the gemma output looks like now:
so this code in the gist is saying a logical one is a 570, 570 pulse and a logical zero is a 570, 580 pulse (the order of the initializer is one bit first, then zero bit it seems): https://gist.github.com/jedgarpark/7920289fd1d19399daa908426d11f258
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]```
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?
@slender iron lazy'd, examples, and some bug fixes:
https://github.com/caternuson/Adafruit_CircuitPython_DS2413
@split ocean the second number in the bin (like 17 and 33) is a count and you don't want to use it
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 >.<
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)
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 :)
GenericTransmit((a, b), (e, f), (c, d), z)
(a, b) = timing
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
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
yep check out the NEC protocol doc
pretty much all remotes start with a header of 9ms on 4.5ms off
4490 is the highest value of the even bins, so that's the next one
so everything will be about (9000, 4500) for the header
(rounded)
yeah, i wouldn't get too wrapped up in decoding exact values
there's jitter and timing diffs
yep
as long as its near 9000, 4500 you're seeing the start of a remote code for sure
then the value of a one
which is the higher number in the odd bin pairs?
so 1610?
and a zero which is 570?
1615
yeah check the protocol http://techdocs.altium.com/display/FPGA/NEC+Infrared+Transmission+Protocol
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
then the zero which is 580
1.6875 turns into, 1687.5
and then the trail which is 580?
so adafruit_irremote.GenericTransmit((9145, 4490), (1615, 570), (590, 570), 580)
roughly?
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
:)
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
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)
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
[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?
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
hi all,
Can the circuitpython board do soft serial?
sorry, this is the wrong forum ..
@timber lion I'm not sure I'm following. the protocol wants double the time I've listed for the space after the one?
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
4bd1d09 Add missing Feather M0 RadioFruit boards: RFM69... - tdicola
3b946f6 Add missing Feather M0 RadioFruit boards: RFM69... - tdicola
huh, my attempts at that fail
oh, wait, now i have it working. my zero and one were reversed.
yes, @upbeat plover we hit the solution at the same time :)
i still dont see where you get the tail lol
@slender iron you were right, the one and zero is reversed in the GenericTransmit
I think
it seems to be (header, zero, one, trail)
yoinks!
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
of course!
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
@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
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).
@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
@bronze geyser also, you can try and mpy your modified file, grab a mpy-cross binary from here:
https://github.com/adafruit/circuitpython/releases
@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
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...
Reassigned A1, A2, A3 to MOSI/MISO/SCK. Removed FLASH_CS.
@simple quarry you need the computer to tell the circuitplayground express something over serial
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...
we wont be putting the silkscreen for SPI onto the CPX, and on the classic, SPI isnt exposed, so....use any pins ya like (other than A0 of course :)
Si1145 or VEML6070 library?
@upbeat plover i'm actually putting the finishing touches on a VEML6070 library. hope to have it done over the weekend.
Im just looking for parts to put in my wishlist, no hurry. Any plans for the si1145?
thanks for the good review @stuck elbow ! I'll get to it next week. brain is in the heap now ๐
TGIF
๐
I on the other hand finally have some time to do something...
@upbeat plover i've haven't heard of anyone working on the SI1145, but that doesn't mean it isn't happening.
@slender iron is Sphinx/RTD a requirement for libraries? not trying to dodge it, just seeing some disparity among libraries...
its been something we should maintain but have been bad about
ok. i'll jott down what i come across...
we'll add checking to adabot when we want them to be consistent
yes, @slender iron
hi
@simple quarry take a look at pyserial as a way to connect to the circuitpython serial connection
hi @golden tartan
I've never done it myself either
oh, huh
thats why I'm not being more helpful ๐
@simple quarry let me know if you figure it out or have other circuitpython questions!
i will
oh hello!
hi @last drum
@bronze geyser what pins are you using for RST and CS for the rfm69 on your M0?
Update SPI Flash code to allow differing flash 'types' (seems like some are 0x40 some are 0x60
Update SPI Flash def's with the matching macros
Add W25Q16 USON Flash type
Add working Itsy Bitsy M0 Express support
got a 7.26/10 on my first pylint... this close to passing the test! ๐
Right now there are merge conflicts due to Tony's RFM board changes. Can you fetch from upstream and then do a rebase? Tnx.
wierd i did a fix here https://github.com/adafruit/circuitpython/pull/541/commits/70b9c7a49f85915dccb4d259b9bb67f5996a0cda as GH requested but it didnt work right. ill try again
i said some magic git words and i think it worked ?