Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. krayola
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    krayola

    @krayola

    0
    Reputation
    6
    Posts
    453
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    krayola Follow

    Best posts made by krayola

    This user hasn't posted anything yet.

    Latest posts made by krayola

    • RE: Node to Node communication

      I figured that out from the other thread 🙂

      I added this little helper to my copy of MySensors.cpp:

          void MySensor::wait(unsigned long ms) {
                  bool slept_enough = false;
                  unsigned long start = millis();
                  unsigned long now;
      
                  // Let serial prints finish (debug, log etc)
                  Serial.flush();
      
                  while (!slept_enough) {
                          MySensor::process();
                          now = millis();
                          if (now - start > ms) {
                                  slept_enough = true;
                          }
                  }
          }
      

      In theory it'll handle the millis() rollover, but I haven't verified yet.

      I'm now able to send messages between nodes with and without being in repeater mode. I have yet to test repeater mode, as i haven't convinced a sensor it can't see the gw yet 🙂

      posted in Development
      krayola
      krayola
    • RE: Node to Node communication

      It seems #define DEBUG is on by default in master 🙂

      https://github.com/mysensors/Arduino/blob/9192da3a7d99171c2f42436a0a4ab8c72463119d/libraries/MySensors/MyConfig.h

      My topology seems to be flat right now. I only have 3 nodes + gateway at present.
      I did try having combination repeater+sensor nodes, but they were using sleep() which may have been part of the problem.

      When I use gw.request() I'm able to get messages from the gateway to the node in question (with appropriate controller logic).

      Here's the code on the test sensor:
      gw.send(msg.setSensor(i).set(temperature, 2).setDestination(1));

      Here's the sensor connecting and trying to send a message to node 1 (which is
      <- 0;0;3;0;9;send: 0-0-2-2 s=255,c=3,t=6,pt=0,l=1,st=fail:M
      <- 0;0;3;0;9;read: 2-2-0 s=255,c=3,t=11,pt=0,l=18:Temperature Sensor
      <- 2;255;3;0;11;Temperature Sensor
      <- 0;0;3;0;9;read: 2-2-0 s=255,c=3,t=12,pt=0,l=3:1.0
      <- 2;255;3;0;12;1.0
      <- 0;0;3;0;9;read: 2-2-0 s=0,c=0,t=6,pt=0,l=5:1.4.1
      <- 2;0;0;0;6;1.4.1
      <- 0;0;3;0;9;read: 2-2-1 s=0,c=1,t=0,pt=7,l=5:24.00
      <- 0;0;3;0;9;send: 2-0-1-1 s=0,c=1,t=0,pt=7,l=5,st=fail:24.00

      Node 1 was initialized:
      gw.begin(incomingMessage, AUTO, false);
      and uses
      gw.sleep(SLEEP_TIME);

      I thought I'd mention that having a request in the code makes it so i can reliably receives up to 2 messages from the gw (via the controller). Any more than that get lost.
      gw.request(outdoorTempSensorId, V_TEMP, outdoorTempNodeId);

      I clearly need to go read all the code 🙂 There's not that much of it.

      posted in Development
      krayola
      krayola
    • RE: Repeater nodes - gw.sleep(ms)

      Oh, I want a couple sensor nodes around the house to also be repeaters, but to only poll sensors send results periodically (to avoid overwhelming the RF network with chatter). There's no actual need to power down these wired repeaters, but I do want to have timed sleep.

      I've been setting repeater mode with begin(). I'm tempted to make a gw.sleepAndProcess(ms) like variant to make it easy to keep the base logic of the various sketches, but also be a repeater node.

      I'm not in a huge house, but I must have a lot of RF interference, as there are some rooms that are too far from the gateway. I do experience 2.4ghz interference even on my SONOS system, so I'm not surprised. Someone has some noisy gear nearby.

      posted in Development
      krayola
      krayola
    • RE: Car present detector needed

      Why not have a battery operated sensor transmitting every 2-5 min? When it's not in the driveway it wouldn't be in range 🙂

      posted in General Discussion
      krayola
      krayola
    • RE: Node to Node communication

      Earlier today, I was fiddling with using setDestination() and always got st=fail showing up on the gateway, and the message never got to the node I wanted it to... And all the nodes were in my office at the time. I was running trunk for all libs.

      Any ideas what to look at? The gateway's error led never flashed, either.

      posted in Development
      krayola
      krayola
    • Repeater nodes - gw.sleep(ms)

      I've looked over the source incl MySensor.cpp and can't tell if the radio IRQ pin (2) will actually wake the repeater nodes up to do work (and cause messages to be processed) when a sensor is using gw.sleep(60000) like many of the sketches do.

      The other question I had about repeater nodes - is the repeater selected at sensor boot time, dynamically, or only at initial registration from empty?

      PS - Awesome project. I now have a semi-smart custom humidifier actuator (I still need to adjust the controller to pump it outside temperature - which I still need to get a sensor working for), a BMP180 sensor, and a testbed sensor on a breadboard. Oh and the gateway (currently on a Uno).

      posted in Development
      krayola
      krayola