Send time request over arduino "monitor serial"



  • How can i send a time request ?? " over monitor serial in arduino ...

    1;255;3;0;1;14:55:30 06/01/2015" something like this??

    thanks! im finally complete the most part of my windows controller in .net ^^


  • Admin

    You can't.

    The serial messages you enter in monitor is only destined to radio network. Whilst the time request is sent from a node over radio network to gateway/controller.



  • thanks man!



  • when the node send "gw.requestTime(receiveTime); " i cant answer from arduino monitor serial no?


  • Admin

    yes, you can



  • how, who need send?? or an example


  • Admin

    Something like:

    <node-id>;255;3;0;1;<seconds since 1970>\n



  • thanks, the problem is i dont know who is "<seconds since 1970> any example? im use a custom controller.


  • Admin

    Depends on your programming language. Normally you would have a function returning milliseconds since 1970. Just divide this with 1000.



  • 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
    } **


  • Admin

    Just request ack from the node by setting ack parameter to 1.

    <node-id>;<child-sensor-id>;<message-type>;<ack>;<sub-type>;<payload>\n

    The node will then respond back with the same message in return. (You don't need to update sketch code)



  • THANKS for your help!!



  • @ch3b7 do you mind sharing your .net code?



  • HERE my source code my-sensors-controller-net


Log in to reply
 

Suggested Topics

17
Online

11.2k
Users

11.1k
Topics

112.5k
Posts