Send data to other sensor
-
Can I send data to other sensors directly from the arduino serial window?
-
The gateway is the only place where you can send out data via serial window. The Sensor-class does not listen to serial input.
But it is a two-liner to send a value (1.4 example below).
MyMessage msg = new MyMessage(<chidldSensorId>,<dataType>).setDestination(<destinationNode>).set(<value>); gw.send(msg);
-
This example work in 1.4b1 (18848a2) ?
-
@hek said:
MyMessage msg = new MyMessage(<chidldSensorId>,<dataType>).setDestination(<destinationNode>).set(<value>); gw.send(msg);
This will not compile, as the new()-operator returns a pointer to a MyMessage object.
Better to compress the whole to:gw.send( MyMessage(<chidldSensorId>,<dataType>).setDestination(<destinationNode>).set(<value>) );
-
can i put values like this "gw.send( MyMessage("1","3").setDestination("2").set("1") );" ?
-
@Yveaux Could you write sample messages to send from node, and receive value on another?
-
@jendrush do you want some example code? I don't understand...
-
@Yveaux Yes, example messages. Something like that - i have temperature from dht22 on one node, and i want to send this value to example node with radio id 2. Second thing, how to pick this value on radio node with id 2?