Skip to content

Troubleshooting

2.7k Topics 21.5k Posts

Help! Everything just falls apart

  • Analog to digital how ?

    5
    0 Votes
    5 Posts
    2k Views
    R
    All working fine sometimes the pir reaction could be a bid faster, and sometimes i get a false reading think i'll have to put the pir signal lines to the ground with an resistor. Any advice is welcome, to make thing faster, and less complex. else use this with fun...... #define MY_RADIO_NRF24 #define MY_REPEATER_FEATURE #define MY_DEBUG #include <Wire.h> // Wire library t.b.v. I²C #include <MySensors.h> byte GPIOA = 0x12; // GPIOA adres in 16-bit mode, is directe aansturing 1e groep van 8 I/O poorten. byte GPIOB = 0x13; // GPIOA adres in 16-bit mode, is directe aansturing 1e groep van 8 I/O poorten. boolean sensorBovenActive; // Status of Pir motion sensor 2. boolean sensorOnderActive; // Status of Pir motion sensor 1. boolean sensorKelderActive; // Status of Pir motion sensor 0. int PIR0new; // Pir motion sensor 0 updated value "Kelder". int PIR0old; // Pir motion sensor 0 old value "Kelder". int PIR1new; // Pir motion sensor 1 updated value "sensorOnderActive". int PIR1old; // Pir motion sensor 1 old value "sensorOnderActive". int PIR2new; // Pir motion sensor 2 updated value. "sensorBovenActive" int PIR2old; // Pir motion sensor 2 old value. sensorBovenActive" int StairDelay = 250; // Delay for stairs int StairOn = 30000; // Delay to keep stair light on #define MY_NODE_ID 30 #define CHILD_ID_PIR00 31 // Id of the sensor child #define CHILD_ID_PIR01 32 // Id of the sensor child #define CHILD_ID_PIR02 33 // Id of the sensor child void presentation(){ // Send the sketch version information to the gateway and Controller sendSketchInfo("Trap Controller", "4.0"); // Register all sensors to gw (they will be created as child devices) present(CHILD_ID_PIR00, S_MOTION, "PIR Sensor Kelder"); present(CHILD_ID_PIR01, S_MOTION, "PIR Sensor Trap Onder"); present(CHILD_ID_PIR02, S_MOTION, "PIR Sensor Trap Boven"); } // Initialize motion message MyMessage msgPIR00(CHILD_ID_PIR00, V_TRIPPED); MyMessage msgPIR01(CHILD_ID_PIR01, V_TRIPPED); MyMessage msgPIR02(CHILD_ID_PIR02, V_TRIPPED); // the setup routine runs once when you press reset: void setup() { Wire.begin(); // wake up I2C bus // set I/O pins to outputs Wire.beginTransmission(0x20); // Start adress of mcp23017 Wire.write(0x00); // IODIRA register Wire.write(0x00); // set all of port A to outputs Wire.endTransmission(); Wire.beginTransmission(0x20); Wire.write(0x01); // IODIRB register Wire.write(0x00); // set all of port B to outputs Wire.endTransmission(); } // the loop routine runs over and over again forever: void loop() { Pir0lezen(); Pir1lezen(); Pir2lezen(); effneerop(); effopneer(); effKelder(); } void Pir0lezen() { int PIR0new = analogRead(A0); if (PIR0new >=900) { sensorKelderActive = true; // Send status to Domoticz send (msgPIR00.set(sensorKelderActive?"1":"0")); Serial.println("PIR0new----"); Serial.println(PIR0new); PIR0old = PIR0new; sensorKelderActive = false; send (msgPIR00.set(sensorKelderActive)); }} void Pir1lezen() { int PIR1new = analogRead(A1); if (PIR1new != PIR1old && PIR1new >=710) { sensorOnderActive = true ; sensorBovenActive = false ; // Send status to Domoticz send (msgPIR01.set(sensorOnderActive?"1":"0")); Serial.println("PIR1----"); Serial.println(PIR1new); PIR1old = PIR1new; }} void Pir2lezen() { int PIR2new = analogRead(A2); if (PIR2new != PIR2old && PIR2new >=710) { sensorBovenActive = true ; sensorOnderActive = false ; // Send status to Domoticz send (msgPIR02.set(sensorBovenActive?"1":"0")); Serial.println("PIR2----"); Serial.println(PIR2new); PIR2old = PIR2new; }} void effopneer() { if (sensorOnderActive==true && sensorBovenActive==false){ Serial.println("PIR1--aan"); sensorOnderActive = false ; setLEDA(B01111111); // Tree 1 delay(StairDelay); setLEDA(B00111111); // Tree 2 delay(StairDelay); setLEDA(B00011111); // Tree 3 delay(StairDelay); setLEDA(B00001111); // Tree 4 delay(StairDelay); setLEDA(B00000111); // Tree 5 delay(StairDelay); setLEDA(B00000011); // Tree 6 delay(StairDelay); setLEDA(B00000001); // Tree 7 delay(StairDelay); setLEDA(B00000000); // Tree 8 delay(StairDelay); setLEDB(B01111111); // Tree 9 delay(StairDelay); setLEDB(B00111111); // Tree 10 delay(StairDelay); setLEDB(B00011111); // Tree 11 delay(StairDelay); setLEDB(B00001111); // Tree 12 delay(StairDelay); setLEDB(B00000111); // Tree 13 delay(StairDelay); setLEDB(B00000011); // Tree 14 send (msgPIR01.set(sensorOnderActive)); // switch off before delay delay(StairOn); setLEDA(B11111111); // all off setLEDB(B11111111); // all off Serial.println("PIR1--uit"); }} void effneerop() { if (sensorOnderActive==false && sensorBovenActive==true){ Serial.println("PIR2--aan"); sensorBovenActive = false ; setLEDB(B11111011); // Tree 14 delay(StairDelay); setLEDB(B11110011); // Tree 13 delay(StairDelay); setLEDB(B11100011); // Tree 12 delay(StairDelay); setLEDB(B11000011); // Tree 11 delay(StairDelay); setLEDB(B10000111); // Tree 10 delay(StairDelay); setLEDB(B00000011); // Tree 9 delay(StairDelay); setLEDA(B11111110); // Tree 8 delay(StairDelay); setLEDA(B11111100); // Tree 7 delay(StairDelay); setLEDA(B11111000); // Tree 6 delay(StairDelay); setLEDA(B11110000); // Tree 5 delay(StairDelay); setLEDA(B11100000); // Tree 4 delay(StairDelay); setLEDA(B11000000); // Tree 3 delay(StairDelay); setLEDA(B10000000); // Tree 2 delay(StairDelay); setLEDA(B00000000); // Tree 1 send (msgPIR02.set(sensorBovenActive)); delay(StairOn); setLEDA(B11111111); // all off setLEDB(B11111111); // all off Serial.println("PIR2--uit"); }} void effKelder() { } void setLEDA(byte value) { Wire.beginTransmission(0x20); Wire.write(GPIOA); // gpioa Wire.write(byte(value)); // set LEDs volgens waarde 'value' Wire.endTransmission(); } void setLEDB(byte value) { Wire.beginTransmission(0x20); Wire.write(GPIOB); // gpiob Wire.write(byte(value)); // set LEDs volgens waarde 'value' Wire.endTransmission(); } void bonuseff() { setLEDB(B11111011); // Tree 14 delay(StairDelay); setLEDB(B11110111); // Tree 13 delay(StairDelay); setLEDB(B11101111); // Tree 12 delay(StairDelay); setLEDB(B11011111); // Tree 11 delay(StairDelay); setLEDB(B10111111); // Tree 10 delay(StairDelay); setLEDB(B01111111); // Tree 9 delay(StairDelay); setLEDA(B11111110); // Tree 8 delay(StairDelay); setLEDA(B11111101); // Tree 7 delay(StairDelay); ; setLEDA(B11111011); // Tree 6 delay(StairDelay); ; setLEDA(B11110111); // Tree 5 delay(StairDelay); setLEDA(B11101111); // Tree 4 delay(StairDelay); setLEDA(B11011111); // Tree 3 delay(StairDelay); setLEDB(B10111110); // Tree 2 delay(StairDelay); setLEDB(B01111111); // Tree 1 delay(StairDelay); setLEDA(B10111111); // Tree 2 delay(StairDelay); setLEDA(B11011111); // Tree 3 delay(StairDelay); setLEDA(B11101111); // Tree 4 delay(StairDelay); setLEDA(B11110111); // Tree 5 delay(StairDelay); setLEDA(B11111011); // Tree 6 delay(StairDelay); setLEDA(B11111101); // Tree 7 delay(StairDelay); setLEDA(B11111110); // Tree 8 delay(StairDelay); setLEDB(B01111111); // Tree 9 delay(StairDelay); setLEDB(B10111111); // Tree 10 delay(StairDelay); setLEDB(B11011111); // Tree 11 delay(StairDelay); setLEDB(B11101111); // Tree 12 delay(StairDelay); setLEDB(B11110111); // Tree 13 delay(StairDelay); setLEDB(B11111011); // Tree 14 }```
  • HELP !! cannot make Sensor work with RFM69

    25
    0 Votes
    25 Posts
    10k Views
    M
    I also have a problem with rfm69. NRF24 always works. RFM69 can operate for hours and then disconnect and can not connect to the gateway for a long time.
  • Pls help debug this...

    3
    0 Votes
    3 Posts
    1k Views
    siodS
    @tbowmo I removed the 100 uF cap, now it is working :thumbsup:
  • HomeAssistant > MySensors:MQTT relay actuator works but very slow

    1
    0 Votes
    1 Posts
    712 Views
    No one has replied
  • 0 Votes
    8 Posts
    3k Views
    S
    @mfalkvidd yes, I'm using node 2 and mysensor 1 gateway. Unfortunately I don't get on work 2.0 gateway..... :( :( :( Next week I will restart with a fresh Raspbian, maybe I will solve my initial issues... Thank you very much!
  • RPi 3 gateway problem

    4
    0 Votes
    4 Posts
    1k Views
    F
    it seems strange but I solved with recompiling MySensors Gateway with the following configuration options ./configure --my-rf24-cs-pin=24 --my-rf24-ce-pin=15 --my-gateway=ethernet by magic, everything begins to work (for the first time).
  • MySensors SenseBender GW + W5100

    4
    0 Votes
    4 Posts
    1k Views
    tbowmoT
    @JWB That setting is turning the gateway into a "client" which needs to connect to a server (which is your controller). Without this set it is running as a "server" which accepts incoming connections from other devices on the network (like your controller)
  • Message is send twice

    27
    0 Votes
    27 Posts
    7k Views
    E
    @core_c correction, after I typed and posted this, the serial log started again and it did send the message, this is weird 14026 MCO:SLP:MS=0,SMS=0,I1=1,M1=1,I2=255,M2=255 14032 MCO:SLP:TPD 14034 MCO:SLP:WUP=1 14047 TSF:MSG:SEND,11-11-0-0,s=7,c=1,t=38,pt=7,l=5,sg=0,ft=0,st=OK:0.85 14055 MCO:SLP:MS=3000,SMS=0,I1=1,M1=1,I2=255,M2=255 14059 MCO:SLP:TPD 14061 MCO:SLP:WUP=-1 14065 MCO:SLP:MS=2990,SMS=0,I1=1,M1=1,I2=255,M2=255 14071 MCO:SLP:TPD 14073 MCO:SLP:WUP=-1 14075 MCO:SLP:MS=2980,SMS=0,I1=1,M1=1,I2=255,M2=255 14082 MCO:SLP:TPD 14084 MCO:SLP:WUP=-1 14086 MCO:SLP:MS=2969,SMS=0,I1=1,M1=1,I2=255,M2=255 14092 MCO:SLP:TPD 14094 MCO:SLP:WUP=-1 14098 MCO:SLP:MS=2957,SMS=0,I1=1,M1=1,I2=255,M2=255 14102 MCO:SLP:TPD 14104 MCO:SLP:WUP=-1 14108 MCO:SLP:MS=2947,SMS=0,I1=1,M1=1,I2=255,M2=255 14114 MCO:SLP:TPD 14116 MCO:SLP:WUP=-1 14118 MCO:SLP:MS=2937,SMS=0,I1=1,M1=1,I2=255,M2=255 14125 MCO:SLP:TPD 14127 MCO:SLP:WUP=-1 14129 MCO:SLP:MS=2926,SMS=0,I1=1,M1=1,I2=255,M2=255 14135 MCO:SLP:TPD 14137 MCO:SLP:WUP=-1 14141 MCO:SLP:MS=2914,SMS=0,I1=1,M1=1,I2=255,M2=255 14145 MCO:SLP:TPD 14147 MCO:SLP:WUP=-1 14151 MCO:SLP:MS=2904,SMS=0,I1=1,M1=1,I2=255,M2=255 14157 MCO:SLP:TPD 14159 MCO:SLP:WUP=-1 14161 MCO:SLP:MS=2894,SMS=0,I1=1,M1=1,I2=255,M2=255 14168 MCO:SLP:TPD
  • SensebenderMicro with two additional DS18b20

    6
    0 Votes
    6 Posts
    2k Views
    HarrySteffH
    Again, that was it! @tbowmo Thank you again so much! Everything is running smoothly :-)
  • 0 Votes
    30 Posts
    7k Views
    R
    @gohan yes . i change raspberrypi gateway to latest 2.2.0 beta
  • Can vias and traces conduct electricity on PCB surface?

    3
    0 Votes
    3 Posts
    1k Views
    A
    @sundberg84 haha:grin: ,I did not found myself a robot,But thank you for your links.
  • Who can Debug this GW Messages?

    1
    0 Votes
    1 Posts
    657 Views
    No one has replied
  • [RESOLVED] I'm new to this. Cannot do a simple gateway.

    5
    0 Votes
    5 Posts
    2k Views
    gohanG
    If you want to check only communication you can use myscontroller, but using a proper controller will give you a more complete test.
  • [Solved] Sensebender GW: TSP FAIL

    3
    0 Votes
    3 Posts
    2k Views
    nick van alstN
    @tekka said in Sensebender GW: TSP FAIL: @nick-van-alst You need to install the MySensors Board definitions, please follow the instructions here | section "Other configurations" you are a life safer! i didn't realize i didn't have that one yet!
  • Repeater Node Question

    6
    0 Votes
    6 Posts
    5k Views
    siodS
    ok, thanks for clarifying this!
  • Sleep issue

    8
    0 Votes
    8 Posts
    2k Views
    Richard van der PlasR
    @Yveaux Ok went to 2.0 and that indeed works
  • 0 Votes
    7 Posts
    4k Views
    rozpruwaczR
    @rusg323 said in [Solved] Building RPi Gateway - No Support for nRF24 radio on this platform: nfiguration chang actually this is the only way, every configure launch will overwrite previous settings. Thats how configure wokrs. You can do ./configure --help to see all the options
  • Problem with a small amount of RAM

    5
    0 Votes
    5 Posts
    2k Views
    AnticimexA
    @melwinek signing is memory optimized on the development branch. It cost some yes, but that is pretty much just how it is. It takes some ram to store digests and intermediate data for the calculations.
  • What is the time code in debug messages?

    4
    0 Votes
    4 Posts
    1k Views
    mfalkviddM
    @bgunnarb correct, the counter is frozen during sleep.
  • Serial Note NRF communication stability problem

    1
    0 Votes
    1 Posts
    642 Views
    No one has replied

4

Online

12.5k

Users

11.2k

Topics

113.5k

Posts