Navigation

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

    Topics created by mikeones

    • mikeones

      Can't tell if time is set with TimeAwareSensor Sketch
      Troubleshooting • • mikeones  

      4
      0
      Votes
      4
      Posts
      2726
      Views

      Daemon D

      I have the same problem. Work goes through a repeater. Everything works, other than time. Setup: sensor started, id=4, parent=0, distance=1 send: 4-4-0-0 s=255,c=0,t=17,pt=0,l=5,st=fail:1.4.1 send: 4-4-0-0 s=255,c=3,t=6,pt=1,l=1,st=fail:0 read: 0-0-4 s=255,c=3,t=6,pt=0,l=1:M send: 4-4-0-0 s=255,c=3,t=11,pt=0,l=18,st=fail:Temperature Sensor send: 4-4-0-0 s=255,c=3,t=12,pt=0,l=3,st=fail:1.0 send: 4-4-0-0 s=0,c=0,t=6,pt=0,l=5,st=fail:1.4.1 lost parent find parent send: 4-4-255-255 s=255,c=3,t=7,pt=0,l=0,st=bc: read: 3-3-4 s=255,c=3,t=8,pt=1,l=1:1 new parent=3, d=2 read: 0-0-4 s=255,c=3,t=8,pt=1,l=1:0 new parent=0, d=1 send: 0-4-0-4 s=255,c=3,t=8,pt=1,l=1,st=fail:0 send: 4-4-0-0 s=2,c=0,t=8,pt=0,l=5,st=fail:1.4.1 send: 4-4-0-0 s=3,c=0,t=3,pt=0,l=5,st=fail:1.4.1 send: 4-4-0-0 s=4,c=0,t=1,pt=0,l=5,st=fail:1.4.1 gw.getStatus CHILD_ID_VIRT_Relay: 1 send: 4-4-0-0 s=255,c=3,t=1,pt=0,l=5,st=fail:1.4.1 lost parent read: 0-0-4 s=255,c=3,t=8,pt=1,l=1:0 new parent=0, d=1 requestTemperatures: requestTemperatures done: temperature done: 13.70 temperature: 13.70 send: 4-4-0-0 s=0,c=1,t=0,pt=7,l=5,st=fail:13.7 send: 4-4-0-0 s=2,c=1,t=4,pt=7,l=5,st=fail:279 send: 4-4-0-0 s=255,c=3,t=1,pt=1,l=1,st=fail:0 gw.requestTime:0
    • mikeones

      Relay Actuator Sketch
      Troubleshooting • • mikeones  

      2
      0
      Votes
      2
      Posts
      953
      Views

      RJ_Make

      I think it's both. you can have a relay node (say a light switch) act as a repeater (passing other nodes msg's on)
    • mikeones

      Internal I_REBOOT command
      Development • • mikeones  

      2
      0
      Votes
      2
      Posts
      2061
      Views

      hek

      You have to have a bootloader with watchdogs enabled like optiboot or the MySensors bootloader.
    • mikeones

      RELAY_ON 0 or 1?
      Troubleshooting • • mikeones  

      4
      0
      Votes
      4
      Posts
      1940
      Views

      Zeph

      @mikeones Yes you got it, some devices are active low. (Just to confuse things, some relays have double throw outputs, meaning that one pair of conductors is shorted when the relay is powered - "Normally Open/NO" - and one when it's not powered - "Normally Closed/NC" (with one of those contact being common to both). So sometimes you might power a device with the NC connection of the relay output, meaning the device loses power when the relay is powered. One reason do so this would be if you want the device to be powered even if the microcontroller was disabled. Anyway, take that into account too, and return 1 if after all the possible inversions, the hardware device is powered on. For code, you could just return !digitalRead(...), where the NOT operator ! will convert 0 into 1, and 1 into 0 more simply than the ?: syntax (actually it will change any non-zero value to zero, not just 1).
    • mikeones

      Get Relay State
      Development • • mikeones  

      4
      0
      Votes
      4
      Posts
      2865
      Views

      epierre

      I don't know why you use a telay. Look at thr watermeter code, it uses the pattern I described above
    • mikeones

      Multi-Binary Switch Sketch
      Troubleshooting • • mikeones  

      3
      0
      Votes
      3
      Posts
      3113
      Views

      mikeones

      I did get this code to compile... I am going to test with this over the weekend. // Simple binary switch example // Connect button or door/window reed switch between // digitial I/O pin 3 (ZONE_1 below) and GND. #include <Sensor.h> #include <SPI.h> #include <EEPROM.h> #include <RF24.h> #include <Bounce2.h> #define ZONE_1 14 // Arduino Digital I/O pin for button/reed switch #define NUMBER_OF_ZONES 6 Sensor gw; Bounce debouncer_1 = Bounce(); Bounce debouncer_2 = Bounce(); Bounce debouncer_3 = Bounce(); Bounce debouncer_4 = Bounce(); Bounce debouncer_5 = Bounce(); Bounce debouncer_6 = Bounce(); int oldValue_1 =-1; int oldValue_2 =-1; int oldValue_3 =-1; int oldValue_4 =-1; int oldValue_5 =-1; int oldValue_6 =-1; void setup() { gw.begin(); for (int i=0; i<NUMBER_OF_ZONES;i++) { // Setup the button pinMode(ZONE_1+i,INPUT); // Activate internal pull-up digitalWrite(ZONE_1+i,HIGH); // After setting up the button, setup debouncer switch (1+i) { case 1: debouncer_1.attach(ZONE_1); debouncer_1.interval(5); break; case 2: debouncer_2.attach(ZONE_1+i); debouncer_2.interval(5); break; case 3: debouncer_3.attach(ZONE_1+i); debouncer_3.interval(5); break; case 4: debouncer_4.attach(ZONE_1+i); debouncer_4.interval(5); break; case 5: debouncer_5.attach(ZONE_1+i); debouncer_5.interval(5); break; } // Register binary input sensor to gw (they will be created as child devices) // You can use S_DOOR, S_MOTION or S_LIGHT here depending on your usage. // If S_LIGHT is used, remember to update variable type you send in below. gw.sendSensorPresentation(ZONE_1+i, S_DOOR); delay(1000); } } // Check if digital input has changed and send in new value void loop() { for (int i=0; i<NUMBER_OF_ZONES;i++) { int num = 1+i; // Get the update value switch (num) { case 1: { debouncer_1.update(); int value_1 = debouncer_1.read(); if (value_1 != oldValue_1) { // Send in the new value gw.sendVariable(ZONE_1+i, V_TRIPPED, value_1==HIGH ? "1" : "0"); // Change to V_LIGHT if you use S_LIGHT in presentation above oldValue_1 = value_1; } break; } case 2: { debouncer_2.update(); int value_2 = debouncer_2.read(); if (value_2 != oldValue_2) { // Send in the new value gw.sendVariable(ZONE_1+i, V_TRIPPED, value_2==HIGH ? "1" : "0"); // Change to V_LIGHT if you use S_LIGHT in presentation above oldValue_2 = value_2; } break; } case 3: { debouncer_3.update(); int value_3 = debouncer_3.read(); if (value_3 != oldValue_3) { // Send in the new value gw.sendVariable(ZONE_1+i, V_TRIPPED, value_3==HIGH ? "1" : "0"); // Change to V_LIGHT if you use S_LIGHT in presentation above oldValue_3 = value_3; } break; } case 4: { debouncer_4.update(); int value_4 = debouncer_4.read(); if (value_4 != oldValue_4) { // Send in the new value gw.sendVariable(ZONE_1+i, V_TRIPPED, value_4==HIGH ? "1" : "0"); // Change to V_LIGHT if you use S_LIGHT in presentation above oldValue_4 = value_4; } break; } case 5: { debouncer_5.update(); int value_5 = debouncer_5.read(); if (value_5 != oldValue_5) { // Send in the new value gw.sendVariable(ZONE_1+i, V_TRIPPED, value_5==HIGH ? "1" : "0"); // Change to V_LIGHT if you use S_LIGHT in presentation above oldValue_5 = value_5; } break; } case 6: { debouncer_6.update(); int value_6 = debouncer_6.read(); if (value_6 != oldValue_6) { // Send in the new value gw.sendVariable(ZONE_1+i, V_TRIPPED, value_6==HIGH ? "1" : "0"); // Change to V_LIGHT if you use S_LIGHT in presentation above oldValue_6 = value_6; } break; } } } }
    • mikeones

      Sensor node stuck in a sending loop?
      Troubleshooting • • mikeones  

      4
      0
      Votes
      4
      Posts
      1967
      Views

      mikeones

      That seems to be the case. If I shutdown the controller, the sensor node does not see the extra replies from the gateway. Thanks