This is part of the summer "Maker Resolution" project from the local makespace. I've always wanted to connect a few Arduinos so they can share data and do things from a distance away. To do this I'll be using CAN-BUS.
Why not IFTTT?
If this works out, parts of this project might be handling physical security, like door locks or smoke alarms. I'm old school, and while I've done some Photons and am not specifically against IoT, there are some services I don't want relying on cloud connectivity and WiFi.
Why not some existing Arduino automation framework?
Why not indeed, a search for the above yields over 13k hits on HaD.
To meet my Maker Resolution contract, I only need to automate a simple door lock process. I don't need a whole framework for that, I "just" need to figure out CAN-BUS and get a few peripherals to go. I've been off Arduino for a while so it'll be good experience.
Just a quick update since I'm busy with work stuff. But I did finish this on time, I didn't bail. Learned a lot, definitely need to study CAN more. I tried to write my own network stack, that is hard. I bailed on that approach and went with simpler code that did basic acknowledgement, it wasn't what I wanted, but it worked. Wound up with three nodes on the bus. That's the demo, some day I need to build a version that will do stuff around my place. I'll add some pics when I find them.
Been working with a lot of things, getting boards ordered, my workstation, and figuring out the Arduino online editor. Probably not going to build my own CAN-BUS interface for the demo. It'd be cool but I'm out of time, if I go live with the project after the demo I'll probably make something. A CAN interface is less then a dozen components, even less if you aren't being fancy.
Finding my feet again with Arduino, it didn't take long to start changing packets going over the CAN. But today was the first day a real world input had a real world output, basically checking a button, sending it's state over CAN, and turning an LED on or off on another controller. It's the simpler things, right? I must have blinked that LED dozens of times...
I'm not sure I need to complicate things with the masking or filtering that is part of CAN. For the size of my network, one byte is enough for a device number, a variable ID, and variable value. I have a few CAN shields, some good/some bad (that's a story on it's own) and have more Arduinos coming in the mail so I'm looking forward to making more addresses and getting things to pass data.
So by borrowing chunks of the schematics for two CB boards I made my own CB interface on a breadboard. It sends -and- receives! Next big things are....
Get the code to do something
Figure out how to get more interfaces
The options are to sub out the CB stuff to get nice Uno SPI stickons, add CB to some protoshields that I can then stick the project parts onto, or just get more CB shields. I think modifying the protoshields is best of all worlds but we'll see. One month to go.
I acquired two SEEED Studio CAN-BUS shields and got them to talk with the demo code. The price is a bit high for anything you are going mass with, and the shields don't fit on a Stem Tera. But they are highly configurable, easy to get going and have decent libraries.
Currently working on reverse engineering that and some other designs into a small CAN-BUS board. Doing all this in Fritzing, big fun as I've Fritzed a few little things but it's been a while.