Navigation

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

    martins

    @martins

    1
    Reputation
    35
    Posts
    494
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    martins Follow

    Best posts made by martins

    • RE: Sleep function breaks code

      OK it's working. Main fix I think is I used the new 2.1.1 library and all comms to the RFM69 radio seems to be fixed.

      Current code:

      • DESCRIPTION
      • Simple binary switch example
      • Connect button or door/window reed switch between
      • digitial I/O pin 3 (BUTTON_PIN below) and GND.
      • http://www.mysensors.org/build/binary
        */

      // Enable debug prints to serial monitor
      #define MY_DEBUG

      // Enable and select radio type attached
      // #define MY_RADIO_NRF24
      #define MY_RADIO_RFM69
      #define MY_RFM69_FREQUENCY RF69_433MHZ
      #define MY_IS_RFM69HW

      #if F_CPU == 8000000L
      #define MY_BAUD_RATE 38400
      #endif

      #include <SPI.h>
      #include <MySensors.h>

      #define CHILD_ID 3
      #define BUTTON_PIN 3 // Arduino Digital I/O pin for button/reed switch

      int oldValue=-1;

      // Change to V_LIGHT if you use S_LIGHT in presentation below
      MyMessage msg(CHILD_ID,V_TRIPPED);

      void setup()
      {
      // Setup the button
      pinMode(BUTTON_PIN,INPUT);
      // Activate internal pull-up
      digitalWrite(BUTTON_PIN,HIGH);
      }

      void presentation() {
      // Register binary input sensor to gw (they will be created as child devices)
      sendSketchInfo("Binary Sensor", "1.0");
      // 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. See "msg" above.
      present(CHILD_ID, S_DOOR);
      // Send the sketch version information to the gateway and Controller
      }

      // Check if digital input has changed and send in new value
      void loop()
      {
      int value = digitalRead(BUTTON_PIN);
      #ifdef MY_DEBUG
      Serial.println("Sensor Value");
      Serial.println(value);
      #endif
      send(msg.set(value==HIGH ? 1 : 0));
      sleep(BUTTON_PIN-2, CHANGE, 0);
      }

      Thanks,
      Martin

      posted in Troubleshooting
      martins
      martins

    Latest posts made by martins

    • RE: Serial Gateway

      @gohan IDE version 1.8.1.

      posted in Troubleshooting
      martins
      martins
    • RE: Serial Gateway

      @gohan I'm pulling my hair out of my head. Tried it with 2 different power sources(one an 2amp ipad charger). 2 Different mcu's. 2 Different rfm69 radios. Symptom is the same.

      Configured one with the stock standard mockmysensor and it runs without a problem. Take that same one and load the serial gateway and it does this weird loop/reset thing.

      Thanks

      posted in Troubleshooting
      martins
      martins
    • RE: Serial Gateway

      @mfalkvidd said in Serial Gateway:

      mcu

      It's currently connected via an usb ftdi connector to my laptop so the power should be fine. It's an arduino pro mini 3.3v 8mhz.

      posted in Troubleshooting
      martins
      martins
    • RE: RFID Log

      @dpcr

      MyMessage TEXTMsg(CHILD_ID_TXT,V_TEXT);  // Send UID of RFID tag
      
        sendSketchInfo("RFID UID", "0.0.9",false);
        present(CHILD_ID_TXT, S_INFO, "RFID UID",false);
      
        #ifdef MY_DEBUG
          Serial.print("UID sent to Controller: ");
          Serial.println(uid_rfid_str);
        #endif
        send(TEXTMsg.set(uid_rfid), false);		
      

      Hope this helps. I use it this way and it works like a charm. Just remember you need to convert the uid to string in order to send it as text to Domoticz.

      Regards,
      Martin

      posted in Development
      martins
      martins
    • Serial Gateway

      I just can't seem to fix this. This is the serial monitor output captured. Is it normal that the gateway act in this way? It'seems to me it reloads itself but I can't figure out why!!

      ;255;3;0;9;MCO:BGN:INIT GW,CP=RRNGA--,VER=2.1.1
      0;255;3;0;9;TSM:INIT
      0;255;3;0;9;TSF:WUR:MS=0
      0;255;3;0;9;TSM:INIT:TSP OK
      0;255;3;0;9;TSM:INIT:GW MODE
      0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0
      0;255;3;0;9;MCO:REG:NOT NEEDED
      0;255;3;0;14;Gateway startup complete.
      0;255;0;0;18;2.1.1
      0;255;3;0;9;MCO:BGN:STP
      0;255;3;0;9;MCO:BGN:INIT OK,TSP=1
      0;255;3;0;9;TSF:MSG:READ,253-253-0,s=255,c=3,t=0,pt=1,l=1,sg=0:84
      253;255;3;0;0;84
      0;255;3;0;9;TSF:MSG:READ,253-253-0,s=255,c=3,t=0,pt=1,l=1,sg=0:84
      253;255;3;0;0;84
      0;255;3;0;9;TSF:MSG:READ,253-253-0,s=255,c=3,t=0,pt=1,l=1,sg=0:84
      253;255;3;0;0;84
      0;255;3;0;9;TSF:MSG:READ,253-253-0,s=10,c=1,t=37,pt=2,l=2,sg=0:-76
      253;10;1;0;37;-76
      0;255;3;0;9;TSF:MSG:READ,253-253-0,s=10,c=1,t=37,pt=2,l=2,sg=0:-76
      253;10;1;0;37;-76
      0;255;3;0;9;TSF:MSG:READ,253-253-0,s=10,c=1,t=37,pt=2,l=2,sg=0:-76
      253;10;1;0;37;-76
      0;255;3;0;9;TSF:MSG:READ,253-253-0,s=255,c=3,t=1,pt=0,l=0,sg=0:
      253;255;3;0;1;
      0;255;3;0;9;TSF:MSG:READ,253-253-0,s=255,c=3,t=1,pt=0,l=0,sg=0:
      253;255;3;0;1;
      0;255;3;0;9;TSF:MSG:READ,253-253-0,s=255,c=3,t=1,pt=0,l=0,sg=0:
      253;255;3;0;1;
      0;255;3;0;9;TSF:MSG:READ,253-253-0,s=255,c=3,t=1,pt=0,l=0,sg=0:
      0;255;3;0;9;TSF:MSG:ACK REQ
      0;255;3;0;9;!TSF:MSG:SEND,0-0-253-253,s=255,c=3,t=1,pt=0,l=0,sg=0,ft=0,st=NACK:
      0;255;3;0;9;MCO:BGN:INIT GW,CP=RRNGA--,VER=2.1.1
      0;255;3;0;9;TSM:INIT
      0;255;3;0;9;TSF:WUR:MS=0
      0;255;3;0;9;TSM:INIT:TSP OK
      0;255;3;0;9;TSM:INIT:GW MODE
      0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0
      0;255;3;0;9;MCO:REG:NOT NEEDED
      0;255;3;0;14;Gateway startup complete.
      0;255;0;0;18;2.1.1
      0;255;3;0;9;MCO:BGN:STP
      0;255;3;0;9;MCO:BGN:INIT OK,TSP=1
      0;255;3;0;9;TSF:MSG:READ,253-253-0,s=1,c=1,t=16,pt=2,l=2,sg=0:0
      253;1;1;0;16;0
      0;255;3;0;9;TSF:MSG:READ,253-253-0,s=1,c=1,t=16,pt=2,l=2,sg=0:0
      253;1;1;0;16;0
      0;255;3;0;9;TSF:MSG:READ,253-253-0,s=1,c=1,t=15,pt=1,l=1,sg=0:1
      253;1;1;0;15;1
      0;255;3;0;9;TSF:MSG:READ,253-253-0,s=1,c=1,t=15,pt=1,l=1,sg=0:1
      253;1;1;0;15;1
      0;255;3;0;9;TSF:MSG:READ,253-253-0,s=1,c=1,t=15,pt=1,l=1,sg=0:1
      253;1;1;0;15;1
      0;255;3;0;9;TSF:MSG:READ,253-253-0,s=3,c=1,t=16,pt=2,l=2,sg=0:0
      253;3;1;0;16;0
      0;255;3;0;9;TSF:MSG:READ,253-253-0,s=3,c=1,t=16,pt=2,l=2,sg=0:0
      253;3;1;0;16;0
      0;255;3;0;9;TSF:MSG:READ,253-253-0,s=3,c=1,t=15,pt=1,l=1,sg=0:1
      253;3;1;0;15;1
      0;255;3;0;9;TSF:MSG:READ,253-253-0,s=3,c=1,t=15,pt=1,l=1,sg=0:1
      253;3;1;0;15;1
      0;255;3;0;9;TSF:MSG:READ,253-253-0,s=255,c=3,t=0,pt=1,l=1,sg=0:84
      253;255;3;0;0;84
      0;255;3;0;9;TSF:MSG:READ,253-253-0,s=255,c=3,t=0,pt=1,l=1,sg=0:84
      253;255;3;0;0;84
      0;255;3;0;9;TSF:MSG:READ,253-253-0,s=255,c=3,t=0,pt=1,l=1,sg=0:84
      253;255;3;0;0;84
      0;255;3;0;9;TSF:MSG:READ,253-253-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
      0;255;3;0;9;TSF:MSG:BC
      0;255;3;0;9;TSF:MSG:FPAR REQ,ID=253
      0;255;3;0;9;TSF:PNG:SEND,TO=0
      0;255;3;0;9;TSF:CKU:OK
      0;255;3;0;9;TSF:MSG:GWL OK
      0;255;3;0;9;!TSF:MSG:SEND,0-0-253-253,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
      0;255;3;0;9;MCO:BGN:INIT GW,CP=RRNGA--,VER=2.1.1
      0;255;3;0;9;TSM:INIT
      0;255;3;0;9;TSF:WUR:MS=0
      0;255;3;0;9;TSM:INIT:TSP OK
      0;255;3;0;9;TSM:INIT:GW MODE
      0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0
      0;255;3;0;9;MCO:REG:NOT NEEDED
      0;255;3;0;14;Gateway startup complete.
      0;255;0;0;18;2.1.1
      0;255;3;0;9;MCO:BGN:STP
      0;255;3;0;9;MCO:BGN:INIT OK,TSP=1
      0;255;3;0;9;TSF:MSG:READ,0-0-0,s=0,c=0,t=0,pt=0,l=0,sg=0:
      0;255;3;0;9;!TSF:MSG:LEN,0!=7
      0;255;3;0;9;TSF:MSG:READ,253-253-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
      0;255;3;0;9;TSF:MSG:PINGED,ID=253,HP=1
      0;255;3;0;9;!TSF:MSG:SEND,0-0-253-253,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=NACK:1
      0;255;3;0;9;MCO:BGN:INIT GW,CP=RRNGA--,VER=2.1.1
      0;255;3;0;9;TSM:INIT
      0;255;3;0;9;TSF:WUR:MS=0
      0;255;3;0;9;TSM:INIT:TSP OK
      0;255;3;0;9;TSM:INIT:GW MODE
      0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0
      0;255;3;0;9;MCO:REG:NOT NEEDED
      0;255;3;0;14;Gateway startup complete.
      0;255;0;0;18;2.1.1
      0;255;3;0;9;MCO:BGN:STP
      0;255;3;0;9;MCO:BGN:INIT OK,TSP=1
      0;255;3;0;9;TSF:MSG:READ,0-0-0,s=0,c=0,t=0,pt=0,l=0,sg=0:
      0;255;3;0;9;!TSF:MSG:LEN,0!=7

      posted in Troubleshooting
      martins
      martins
    • RE: RFID and NRF24L01 Wireless Network Coding Issues

      @Aron-Sjöberg said in RFID and NRF24L01 Wireless Network Coding Issues:

      int getID()

      Change that line in the getID() function to return 0;

      posted in Troubleshooting
      martins
      martins
    • RE: Serial Gateway crash and reloads

      @Yveaux

      alt text

      posted in Troubleshooting
      martins
      martins
    • RE: Serial Gateway crash and reloads

      IDE 1.8.1

      0_1489826183494_upload-88d0d7f0-c39a-47e1-aa30-6f49a3310a96

      posted in Troubleshooting
      martins
      martins
    • RE: Serial Gateway crash and reloads

      Narrowed it down a bit more. As soon as I change the true (req ack) to false the gateway don't crash anymore. So my question now is why would a ack req cause the gateway to crash ?

        send(TEXTMsg.set(uid_rfid), false);```
      posted in Troubleshooting
      martins
      martins
    • RE: Serial Gateway crash and reloads

      Changed the arduino pro mini. Same effect. As soon as this is executed the serial gateway restarts send(TEXTMsg.set(uid_rfid), true);

      Output on serial gateway:
      0;255;3;0;9;!TSF:MSG:SEND,0-0-10-10,s=9,c=1,t=47,pt=0,l=8,sg=0,ft=0,st=NACK:c350fd4b
      Gateway restart😢
      0;255;3;0;9;MCO:BGN:INIT GW,CP=RRNGA--,VER=2.1.1
      0;255;3;0;9;TSM:INIT
      0;255;3;0;9;TSF:WUR:MS=0
      0;255;3;0;9;TSM:INIT:TSP OK
      0;255;3;0;9;TSM:INIT:GW MODE
      0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0
      0;255;3;0;9;MCO:REG:NOT NEEDED
      0;255;3;0;14;Gateway startup complete.
      0;255;0;0;18;2.1.1
      0;255;3;0;11;MySensors Serial Gateway
      0;255;3;0;12;2.0.0
      0;255;3;0;9;MCO:BGN:STP
      0;255;3;0;9;MCO:BGN:INIT OK,TSP=1

      posted in Troubleshooting
      martins
      martins