Send time request over arduino "monitor serial"
-
WORK! im get "1420578901" ^^ thanks HEK!
im have other question about the light actuator with a button, i send the command to tun on/off its works, but can the node can send again the new state when received the turn on/off command? sorry for my bad english im from argentina^^ im needed to update the state in my controller and know if the command sended work.
this work but when i press the button the controller send 2 sets commands
**void incomingMessage(const MyMessage &message) {
// We only expect one type of message from controller. But we better check anyway.
if (message.isAck()) {
Serial.println("This is an ack from gateway");
}
if (message.type == V_LIGHT) {
// Change relay state
state = message.getBool();
digitalWrite(RELAY_PIN, state?RELAY_ON:RELAY_OFF);
// Store state in eeprom
gw.saveState(CHILD_ID, state);
// Write some debug info
Serial.print("Incoming change for sensor:");
Serial.print(message.sensor);
Serial.print(", New status: ");
Serial.println(message.getBool());
gw.send(msg.set(state), false); // Send new state and request ack back
} ** -
HERE my source code my-sensors-controller-net