Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
N

nono056

@nono056
About
Posts
17
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • NodeId, ChildId and EEPROM
    N nono056

    Hye everybody!
    I have a trouble...

    (The sketch used is RelayActuator)

    If a clear my eeprom with the sketch in the example, and if i upload a new sketch after, nothing appened. Zero message in the serial gateway and zero message in the serial of the sensor.
    If i specify a NodeId, nothing else...

    The solution : i clear eeprom with the original sketch of arnduino (with 0 and not 255 or 0xff) and upload a new sketch, messages are send.

    If i specify a NodeId, the message is : 1;255;0;0;18;1.4
    Is there a problem with my childId? why 255? and why there isn't the sketch name which appear in the serial gateway? Why is there no message when i clear EEPROM whith the "official" method?

    I don't understand.

    Please help me!!!!

    Troubleshooting node child childid eeprom nodeid 255

  • Using optocoupler as actuator in node
    N nono056

    @ferpando
    You can't control blinds motors with an optocoupler. If you tried this connected to your blinds, you opto is dead....
    Use a relay or an optotriac + triac

    Hardware

  • Using optocoupler as actuator in node
    N nono056

    @ferpando
    Hye!
    Yes, it will work. I used a led for testing the actuator example and it works great.
    What would you like to command?

    Hardware

  • Can't control actuator
    N nono056

    ARF!!!!!!!
    3 years i use Arduino and i have never pay attention to this line... :-(
    Thanks!

    Troubleshooting

  • Can't control actuator
    N nono056

    @hek
    I haven't understand this question, we can't change this in arduino?

    Troubleshooting

  • Can't control actuator
    N nono056

    @nono056 said:

    42;3;1;2;0

    I have found where is the error!
    In the SerialGateway sketch, if we use the serial monitor with arduino IDE (with my PC), there isn't a "\n" char who is send.
    i have to change this in the sketch with z.
    now it function!!

    so the new serialEvent function is :

    void serialEvent() {
    while (Serial.available()) {
    // get the new byte:
    char inChar = (char)Serial.read();
    // if the incoming character is a newline, set a flag
    // so the main loop can do something about it:
    if (inputPos<MAX_RECEIVE_LENGTH-1 && !commandComplete) {
    if (inChar == 'z') {
    inputString[inputPos] = 0;
    commandComplete = true;
    } else {
    // add it to the inputString:
    inputString[inputPos] = inChar;
    inputPos++;
    }

    } else {
       // Incoming message too long. Throw away 
        inputPos = 0;
    }
    

    }
    }

    and to activate my led (or relay), i use this line : 42;3;1;2;0z in the serial monitor on arduino

    Is it my PC, the Arduino serial monitor or the script which isn't atapted with this tools?
    i don't know...

    Et voila for the solution (for my problem in fact)
    thanks for all!

    Troubleshooting

  • Can't control actuator
    N nono056

    @nono056 said:
    I use arduino ide for serial communication.
    I write 42;3;1;2;0 in the serial send line and clic on Send.
    Nothiing appears.
    For debugging, i had Serial.println(inputString); at the end of serialEvent funtion for testing what i was sending
    and i have this appearing :
    0;0;4;11;Arduino startup complete.
    4
    42
    42;3
    42;3;
    42;3;1;
    42;3;1;2;
    42;3;1;2;0

    No tx line...

    Troubleshooting

  • Can't control actuator
    N nono056

    Hello!
    I have inverted the 2 arduinos, now nano is the relay actuator node and the mini is the serial gateway.
    Nothing happens else...
    Someone can help me?
    thanks

    Troubleshooting

  • Can't control actuator
    N nono056

    I've tested with an another computer near the first (1 meter)
    the only things i see in this serial monitor (the relay or led node) i have this :

    Started sensor.
    Relay=0, distance=1
    Relaying message back to gateway.
    Tx: fr=42,to=0,la=42,ne=0,ci=255,mt=0,ty=17,cr=166: 1.3b3 (18848a2)
    Ack: received OK
    Relaying message back to gateway.
    Tx: fr=42,to=0,la=42,ne=0,ci=255,mt=4,ty=7,cr=234: 0
    Ack: received OK
    Relaying message back to gateway.
    Tx: fr=42,to=0,la=42,ne=0,ci=255,mt=4,ty=14,cr=83: Relay
    Ack: received OK
    Relaying message back to gateway.
    Tx: fr=42,to=0,la=42,ne=0,ci=255,mt=4,ty=15,cr=97: 1.0
    Ack: received OK
    Relaying message back to gateway.
    Tx: fr=42,to=0,la=42,ne=0,ci=1,mt=0,ty=3,cr=37: 1.3b3 (18848a2)
    Ack: received OK

    nothing when the gateway send this : 42;3;1;2;0
    I have inverted the two nrf24l01 and it is the same
    Any idea?

    Troubleshooting

  • Can't control actuator
    N nono056

    @nono056 said:

    OK for the serial Gateway.
    My radios communicate really. I test it with a ds18b20 and i have my temperature (thanks for yesterday!!!)
    I've just activate the debug and it says :
    0;0;4;11;Arduino startup complete.
    0;0;4;11;Message available on pipe 1
    0;0;4;11;Sent ack msg to 42
    0;0;4;11;Rx: fr=42,to=0,la=42,ci=255,mt=0,t=17,cr=166(ok): 1.3b3 (18
    0;0;4;11;Message addressed for this node.
    42;255;0;17;1.3b3 (18848a2)
    0;0;4;11;Message available on pipe 1
    0;0;4;11;Sent ack msg to 42
    0;0;4;11;Rx: fr=42,to=0,la=42,ci=255,mt=4,t=7,cr=234(ok): 0
    42;255;4;7;0
    0;0;4;11;Message available on pipe 1
    0;0;4;11;Sent ack msg to 42
    0;0;4;11;Rx: fr=42,to=0,la=42,ci=255,mt=4,t=14,cr=83(ok): Relay
    42;255;4;14;Relay
    0;0;4;11;Message available on pipe 1
    0;0;4;11;Sent ack msg to 42
    0;0;4;11;Rx: fr=42,to=0,la=42,ci=255,mt=4,t=15,cr=97(ok): 1.0
    42;255;4;15;1.0
    0;0;4;11;Message available on pipe 1
    0;0;4;11;Sent ack msg to 42
    0;0;4;11;Rx: fr=42,to=0,la=42,ci=1,mt=0,t=3,cr=37(ok): 1.3b3 (18848a
    0;0;4;11;Message addressed for this node.
    42;1;0;3;1.3b3 (18848a2)

    I don't see anything when i send this : 42;3;1;2;0
    I think my numbers are good
    I don't understand why it doesn't work :-(

    Troubleshooting

  • Can't control actuator
    N nono056

    @hek
    I have tested via the serial gateway and nothing happened.
    Can I do that via serial monitor of arduino connected on Serial Gateway?

    Troubleshooting

  • Can't control actuator
    N nono056

    OK thanks for this precision!
    How i ca control it?
    Can i send 42;3;1;2;0 or 42;3;1;2;1 via arduino IDE serial monitor?
    It doesn't work for me...

    Troubleshooting

  • Can't control actuator
    N nono056

    Hi Every body!
    I have a new problem.... Sorry :-()

    I have my arduino nano as serial gateway.
    I already have a mini as light actuator (without relay but with a led to see if it works)

    My code for the mini :

    #include <Relay.h>
    #include <SPI.h>
    #include <EEPROM.h>
    #include <RF24.h>

    #define RELAY_1 3 // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
    #define NUMBER_OF_RELAYS 1
    #define RELAY_ON 0
    #define RELAY_OFF 1

    Sensor gw;

    void setup()
    {
    gw.begin(42);

    // Send the sketch version information to the gateway and Controller
    gw.sendSketchInfo("Relay", "1.0");

    // Register all sensors to gw (they will be created as child devices)
    for (int i=0; i<NUMBER_OF_RELAYS;i++) {
    gw.sendSensorPresentation(1, S_LIGHT);
    }
    // Fetch relay status
    for (int i=0; i<NUMBER_OF_RELAYS;i++) {
    // Make sure relays are off when starting up
    digitalWrite(RELAY_1+i, RELAY_OFF);
    // Then set relay pins in output mode
    pinMode(RELAY_1+i, OUTPUT);

    // Request/wait for relay status
    gw.getStatus(RELAY_1+i, V_LIGHT);
    setRelayStatus(gw.getMessage()); // Wait here until status message arrive from gw
    

    }

    }

    /*

    • Example on how to asynchronously check for new messages from gw
      */
      void loop()
      {
      if (gw.messageAvailable()) {
      message_s message = gw.getMessage();
      setRelayStatus(message);
      }
      }

    void setRelayStatus(message_s message) {
    if (message.header.messageType==M_SET_VARIABLE &&
    message.header.type==V_LIGHT) {
    int incomingRelayStatus = atoi(message.data);
    // Change relay state
    digitalWrite(message.header.childId, incomingRelayStatus==1?RELAY_ON:RELAY_OFF);
    // Write some debug info
    Serial.print("Incoming change for relay on pin:");
    Serial.print(message.header.childId);
    Serial.print(", New status: ");
    Serial.println(incomingRelayStatus);
    }
    }

    When i open the serial monitor in arduino (with the port of my nano of course) and i type :
    42;3;1;2;0 or 42;3;1;2;1 nothing happens
    Is it possible to command led at distance with the gateway?
    I do a mistake?

    In the serial monitor, i have :
    0;0;4;11;Arduino startup complete.
    42;3;2;2;
    42;3;2;2;

    42;3;2;2; is a presentation messsage isn't it?
    Why does it present every 5 seconds? can i change this time?
    Thank you for your help

    Troubleshooting

  • Problem when sending or receiving
    N nono056

    @hek Ok perfect!
    Thanks!

    Troubleshooting

  • Problem when sending or receiving
    N nono056

    Thanks Hek!!
    now it works!

    So any idea why the serial gateway doesn't give me an id?
    If i put metric = gw.isMetricSystem(); in the code i give 40;255;4;13; and without, it gives me 40;0;1;0;20.7
    isMetricSystem would give me metric data and not imperial? I don't understand...
    Thanks

    Troubleshooting

  • Problem when sending or receiving
    N nono056

    Thanks Hek for your answer!
    The really message is :
    0;0;4;11;Arduino startup complete.
    255;255;4;5;
    255;255;4;5;
    255;255;4;5;
    255;255;4;5;

    This is exactly the same thing without metric = gw.isMetricSystem();
    I have another problem (i think...)
    I receive messages every 5 seconds. This is normally 30s?
    An other precision, my ds18b20 is on pin 4 (changed in the sketch). Not a problem?

    Troubleshooting

  • Problem when sending or receiving
    N nono056

    Hello everybody!
    I have a problem :
    I have an arduino nano which is the SerialGateway
    An arduino mini is a node with a ds18b20.
    When i test my sensor with the original arduino library for the ds18b20, it works, i have a good temperature.
    I test too my two nrf24l01 with a ping with the mirf library and this works too.
    My problem is the SerialGateway return me infos like 255;255;5;4; for my temp sensor.
    I have used originals sketchs of the mysensors
    Anyone can tell me why i don't have my temperature in the serial interface?

    PS : Sorry for my bad english...

    Troubleshooting
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular