#define DEFAULT_RFM69_IRQ_PIN



  • Good morning . I have a sensor that have an MPU6050 that uses pin 2 for interrupt ,and i need wire the rfm69 for the radio that uses the same pin 2.
    i read that i shoud use #define MY_RFM69_IRQ_PIN 3 and #define MY_RFM69_IRQ_NUM 1 , for move interrupt pin for pin D3 ,but isn't working .
    Always log that on sensor side and stops:

     16 MCO:BGN:INIT NODE,CP=RRNNA---,FQ=8,REL=255,VER=2.3.2
     28 TSM:INIT
     28 TSF:WUR:MS=0 */
    

    already try :#undef MY_RFM69_IRQ_PIN first but the same.. . unce i can't move the pin 2 from mpu6050 library what can i do? thank you



  • @Tmaster I'm making a wild guess the define is wrong
    See #define MY_RFM69_IRQ_PIN DEFAULT_RFM69_IRQ_PIN
    Define this to override the default RFM69 IRQ pin assignment.



  • @zboblamont said in #define DEFAULT_RFM69_IRQ_PIN:

    #define MY_RFM69_IRQ_PIN DEFAULT_RFM69_IRQ_PIN

    sory, i couldn't understand, to move it to pin 3 shoud be that?:
    #define DEFAULT_RFM69_IRQ_PIN 3
    #define DEFAULT_RFM69_IRQ_NUM 1

    ?
    i will try and tell if it works. thankyou



  • @Tmaster Sorry, I should have been clearer, but I have little knowledge of the details

    • I you do a search on Google (I haven't checked if the site search function has been restored) for that entire define statement you will land here https://www.mysensors.org/apidocs/MyConfig_8h.html
      Scroll down and you will find "#define MY_RFM69_IRQ_PIN DEFAULT_RFM69_IRQ_PIN" as one single line statement which I presume you append it with "3" to redirect the pin and solve your current problem - Perhaps try that first.

    I've no idea what the "#define DEFAULT_RFM69_IRQ_NUM 1" does at all as it sounds like it's altering an internal RFM69 register.



  • not working.same result .... lets think again.. out of the box... is it possible use same pin form both rfm69 and mpu6050 ? or even not using the int pin on mpu6050... maybe that is the solution...

    _IRQ_NUM 1 shoud be the interrupt pin 1. 0 is D2



  • @Tmaster Oh well, told you it was a wild guess 😉 I'm using default settings of D2 here so never encountered the need to find out.
    You need complete separation of the interrupts, I'm not sure the gyroscope will function without it.

    Looking again at https://www.mysensors.org/download/sensor_api_20 for perhaps a better understanding, I note the explanation of both"#define" lines you originally posted which now makes sense. Pin D3 is indeed INT 1, so you were redefining both the pin and the interrupt.
    So long as these are set before including the MySensors library it should indeed override the defaults.

    Not sure if it's relevant, but could it be something to do with the rfm69 driver ? Many of the guides relate to the original driver.
    I recently upgraded to the NEW rfm69 driver thinking it was more efficient, but with the Gateway and 2 Nodes reprogrammed, ended up with repeat messages and the system slowing to a crawl.
    Reversing the procedure to the original driver restored system reliability, speed, and sanity.


  • Mod

    @Tmaster could you share the entire sketch? That usually makes it easier to spot problems.



  • @zboblamont said in #define DEFAULT_RFM69_IRQ_PIN:

    So long as these are set before including the MySensors library it should indeed override the defaults.

    OMG. this is the problem! i was defining AFTER Including Mysensors library. well i should knew that if i know more about programing😖 🤦

    this code now is working comunicating well.

    I still having an issue. termometer doesn't appear on domoticz. i think it's well presented... i'm not sure whats happen. but the axel for angle, that i need is , working good already .

    The corret statement is .
    #define MY_RFM69_IRQ_PIN 3
    #define MY_RFM69_IRQ_NUM 1

    /*
     ->  __  __       ____
     -> |  \/  |_   _/ ___|  ___ _ __  ___  ___  _ __ ___
     -> | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
     -> | |  | | |_| |___| |  __/ | | \__ \  _  | |  \__ \
     -> |_|  |_|\__, |____/ \___|_| |_|___/\___/|_|  |___/
     ->         |___/                      2.3.2
    */
    
    #define MY_DEBUG
    #include <basicMPU6050.h> 
    #define MY_RADIO_RFM69
    #define MY_RFM69_IRQ_PIN 3 //!< DEFAULT_RFM69_IRQ_PIN
    #define MY_RFM69_IRQ_NUM 1
    #include <MySensors.h>
    #include <RunningMedian.h>
    RunningMedian samples = RunningMedian(100);
    
    #define CHILD_ID 98
    #define CHILD_ID_TEMP 99
    
    
    
    MyMessage msg(CHILD_ID, V_LEVEL);
    MyMessage msg1(CHILD_ID_TEMP,V_TEMP);
    // Create instance
    basicMPU6050<> imu; //credits:https://github.com/RCmags/basicMPU6050
     float incl;
     
      static uint8_t sentValue;
    void presentation()
    {
      // Send the sketch version information to the gateway and controller
      sendSketchInfo("TANQUE", "2.3");
    
      // Register all sensors to gw (they will be created as child devices)
        present(CHILD_ID, S_MOISTURE);
         present(CHILD_ID_TEMP,S_TEMP);
    }
    
     
    void setup() {
      // Set registers - Always required
      imu.setup();
    
      // Initial calibration of gyro
      imu.setBias();
    
      
    }
    
    void loop() { 
      // Update gyro calibration 
       imu.updateBias();
      
       incl= imu.ay();
    
       int val = ((incl+1)*50);
    
       int x = val;
      
      samples.add(x); 
     
     //long m = samples.getAverage(); 
      int m = samples.getMedian();
      delay (200);
    
            
      if (m != sentValue)
       {
       
     
       send(msg.set(m));
       float temp = imu.temp();
      send(msg1.set(temp,1));
      sentValue = m;
      delay (5000);
      
       }
    }   
    
    


  • this is the log. everything appear be fine with presetation of gyro termometer .But never show on devices. someting wrong with my gateway...

    1282 TSF:MSG:READ,7-7-4,s=255,c=3,t=8,pt=1,l=1,sg=0:1
    2050 TSM:FPAR:OK
    2050 TSM:ID
    2052 TSM:ID:OK
    2054 TSM:UPL
    2062 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
    2101 TSF:MSG:READ,0-0-4,s=255,c=3,t=25,pt=1,l=1,sg=0:1
    2107 TSF:MSG:PONG RECV,HP=1
    2111 TSM:UPL:OK
    2113 TSM:READY:ID=4,PAR=0,DIS=1
    2326 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    2353 TSF:MSG:READ,0-0-4,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    2572 TSF:MSG:SEND,4-4-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.3.2
    2791 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
    2828 TSF:MSG:READ,0-0-4,s=255,c=3,t=6,pt=0,l=1,sg=0:M
    3250 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=11,pt=0,l=6,sg=0,ft=0,st=OK:TANQUE
    3469 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:2.3
    3688 TSF:MSG:SEND,4-4-0-0,s=98,c=0,t=35,pt=0,l=0,sg=0,ft=0,st=OK:
    3905 TSF:MSG:SEND,4-4-0-0,s=99,c=0,t=6,pt=0,l=0,sg=0,ft=0,st=OK:
    3911 MCO:REG:REQ
    4124 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
    4151 TSF:MSG:READ,0-0-4,s=255,c=3,t=27,pt=1,l=1,sg=0:1
    4157 MCO:PIM:NODE REG=1
    4159 MCO:BGN:STP
    10801 MCO:BGN:INIT OK,TSP=1
    11014 TSF:MSG:SEND,4-4-0-0,s=98,c=1,t=37,pt=2,l=2,sg=0,ft=0,st=OK:49
    11233 TSF:MSG:SEND,4-4-0-0,s=99,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:36.5
    
    
    


  • @Tmaster The problem cannot be your gateway if some messages are being passed but not others, it is likely an issue at the Node or has not been enabled at the Controller.

    Most Controllers have a live log of what is coming in, and a devices table from which you can see what was last updated and when.

    I suggest editing the Node sketch to print locally over serial to verify the results you are getting then investigate from there.



  • @zboblamont said in #define DEFAULT_RFM69_IRQ_PIN:

    ode sketch to print locally over serial t

    this is local log already. thal last line: 11233 TSF:MSG:SEND,4-4-0-0,s=99,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:36.5
    is the message sending 36.5 degrees to gateway.

    domoticz log report message received from this node...but is not even on devices...



  • @Tmaster Ah, didn't spot that...
    My next thought was it was not enabled under Devices in Domoticz but you said nothing shows up, yet you presumably see that specific child updating on the Domoticz log at intervals ?

    Have a look at Hardware, click Setup for the Gateway line, then the Node, and verify what is there is what is expected for child 99.

    Something's not making sense here.



  • this is my gw . in fact i never understud very well the child thing. last one is "tanque"( tank) is ths node that we talk and is showing as 13 ?? why?

    normally what i do is go to devices ,see what next id is available and atribute it to children..worked until now but i think its wrong
    f822faf0-b88a-40a5-b65c-0402bc01db48-image.png



  • Now is working. so what i did is call to children 0 and 1 and #define MY_NODE_ID 101 ,so next node appear on harware/mysensors gw ,and apear on devices as IDX 99 and 100... The auto node idx from domoticz shoud have caused some issue.... now is working



  • @Tmaster What I meant by my previous comment was to tap on the Node name to see what sensors were connected - Had you clicked on TANQUE you would have seen a box pop up below giving you all the children to that particular Node with what value was last updated and when, so you could easily have found out all about your mysterious 13 children.

    At least you have it sorted now, but it pays to do a bit of housekeeping in the sketch setup and Domoticz - eg which of the 6 "Unknown" Nodes is the one you want to next have a look at ?

    All my Node IDs are set at the Node, and the sketch name labels the Node ID also, the Nodes are named in Domoticz for easy identification.

    In the sketch my sensors are numbered sequentially and commented on what they are, so naming them in Domoticz becomes very much easier.


Log in to reply
 

Suggested Topics

  • 14
  • 1
  • 1
  • 4
  • 5
  • 41
  • 13

61
Online

11.4k
Users

11.1k
Topics

112.7k
Posts