All,
automating my home, I have looked into several (read all) possible serial communications protocols, none of which satisfies my needs. Biggest problem is the arduino UART taking over the processor while 'communicating'. Also any use of these low level protocols is quite 'difficult' for many computer/programmer illiterate.
Users should be able to plug an arduino micro into their wall socket, attach a switch, upload below code and be up and running ...
So I decided, you guessed it, to come up with my home made solution: YASPIE yaspie: yet another serial protocol inthe ether
I would like this protocol to be 'user friendly'. So one could invoke the following functions:
slave
#include "yaspie.h"
void setup() {
YSP_init();
}
void loop() {
/** function YSP_listenToPinSwitchOnOff
*
* listens to a(n arduino) pin input defined in first param,
* sends message defined in second param if previous pin
* was switched on and off, in this particular order
* @pre: listening pin is input and off, low, negative, 'at rest'
* @pre: messaging 'bus' is free
* @param: pin_to_listen_to: integer from 0 to 12
* @param: message to send: string, character pointer,
* @side-effect: sends a message on the 'bus'
* @return: error if wrong params where provided
* @return: warning if message was not sent
* @return: succes if message was sent succesfully
*/
YSP_listenToPinSwitchOnOff(8, "kitchen.lights.switched")
}
master
#include "yaspie.h"
void setup() {
YSP_init();
}
void loop() {
/** toggles a pin high low on receiving a certain message*/
YSP_togglePinOnMessage(8, "kitchen.lights.switched")
}
The relation to the OSI model:
| Layer 1: Physical layer: | for now, the physical layer is divided between a input pin and an output pin, using the arduino's 5V high and common ground. Receive pin is neutral high, send pin is neutral low. Any message, being a sequence of bits, high low changes, is called 'signal' from here on. The signal, being transmitted or received, will be a sequence of voltage changes, in the arduino instance between 0 and 5V. The signal will be duplicated onto the arduino itself, where an input pin being receive will be bridged into an output pin and similarly one output pin being transmit will be bridged into an input pin. All this is to deal with error checking and collision detection and avoidance. The signal will be duplicated by all the nodes in the network using the catch-phrase:"it wasn't me". If a node detects a signal transmitted, it will copy paste the signal from it's receive pin to it's send pin. All the above will be changeable by setting the appropriate flags, eventually to also be able to link different protocols, physical layers, wire sets, media use, ... simplest form: we fire a one into space and don't care about the rest most complex form: time, voltage and frequency multiplexing signals are sent through all sorts of possible media, using all sorts of protocols, the signals are error checked back and forth, in and out, into four dimensions |
|---|---|
| Layer 2: Data link layer |
There is a lot more to say about the error checking, serial communication, practical implementation and so on, but my basic question is:
has this been done already?
trying to prevent re-inventing the wheel here ![]()