Particle’s Raspberry Pi (beta) development scheme.
Having the Photon imitate the Arduino sketch structure (setup(), loop()) made sense. But the Raspberry
Pi is not that kind of animal. Or rather, Linux is not that kind of OS.
The “sketch” model leads to running particle-agent as
super-user since generally access to GPIO pins require SU. However, I
can imagine using Particle’s cloud services without any reference to
GPIO in the RPi at all. E.g., collecting data from Photons and passing
it along.
When I DO read sensors or write to GPIO to switch things
I tend to split device access up into separate programs that provide
info when I ask (through the several inter-processor communication
methods). Or I use crontab to schedule things. If I need to turn
something on at 6pm and off at 7am with a Photon I have to do it in a
sketch loop() but I’d never do that with a RPi. There are better ways.
These “programs” may have to run as SU briefly but the main Particle
cloud communicator need not. And should not.
Thanks for sharing your thoughts. What we tried to do in the first beta is provide the minimal way to compile and run firmware-style sketches on the Raspberry Pi. I hear loud and clear the need to use more restricted accounts when possible. It was on my to-do list but it didn’t make it in time for the first beta. Stay tuned for improvements in that area early next year.
Good morning all and a merry Christmas … I have with some success have been using a Raspi and a Photon or two with an opensource program called OpenHAB … www.openhab.org if you would like more information please let me know …I have discovered that not only can you post values to OpenHAB you can also publish to particle at the same time and then forward to an IOT provider…thanks
Yea it can …I use the Node-Red program to bridge the two as the MQTT sketches are a bit wonky and the particle needs to be reset once I. A while but Particle publish and subscribe seem to work great …I’m going to be publishing a full instruction set on OpenHab/ Particle/Node-Red on how to tie them together with some examples on the Particle side and the node Red on the instructable sand hacks yer sites here in the next week or so …
There are 2 PDFs at the bottom that will get you started with OpenHab …How to download etc… I also used a link to another tutorial that takes you step by step http://www.homeautomationforgeeks.com …As for node Red http://nodered.org it come with the Raspberry Pi as a Program
Thanks @jade7272!
Sorry for my late reaction to your posts.
I am very busy with other matters right now but I will try to proceed with your tips and come back here…