Navigation

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

    Best posts made by Joost

    • RE: Is soldering castellated pads on THT pads feasible?

      Hi,

      just a quick feedback on this; I tried it now with two boards and so far it works pretty well. I'll keep using this technique for my minimal nodes for now. Those are by no means "mission critical" in any way, so a possible failure at some point won't pose a major problem.
      I'll probably post a picture on my openhardware.io entry in the coming days.
      Bye, Joost

      posted in Hardware
      Joost
      Joost
    • RE: Getting Pin Change Interrupts working together with Timer interrupts / sleep(XX ms) on Arduino Pro Mini

      @Yveaux & others:
      So this works great! Here is an example sketch to get Pin Change Interrupts working together with timer-based sleep(). There will be identification of the triggered pin as well as discrimination between rising and falling edge. To test, just add a jumper wire to pin A1 or/and A2 to a Arduino Pro Mini and short it to Ground to wake the Arduino out of a timed sleep() (a connected Radio, here a RFM95, is needed to get the sketch started).

      #include <Arduino.h>
      
      #define MY_RADIO_RFM95
      #include <MySensors.h>
      
      volatile int isrcounter = 0, timercounter=0;
      volatile char PinRegLast, ChangedPin, PinRegister;
      volatile boolean isr_interrupted;
      uint32_t remainingSleepTime = 0;
      
      ISR(PCINT1_vect)
      {
          PinRegister = PINC;
          ChangedPin = PinRegister ^ PinRegLast;
          PinRegLast = PinRegister;
          _wokeUpByInterrupt = 0xFE;
          isr_interrupted=true;
          isrcounter++;
      }
      
      void setup()
      {
      noInterrupts();
      PCICR |= 0b00000011; // Enables Ports B and C Pin Change Interrupts
      PCMSK1 |= 0b00000110; //PCINT9 & PCINT10 = A1 & A2
      PCIFR  = B00000001; // Reset Interruptflag
      pinMode(A1, INPUT_PULLUP); pinMode(A2, INPUT_PULLUP);
      PinRegister = PINC;
      interrupts();
      Serial.begin(38400);
      }
      
      void presentation() {}
      
      void loop()
      {
        noInterrupts();
        if ( isr_interrupted ) {
          isr_interrupted = false;
          switch (ChangedPin){
          case (1 << PINC1):
            if (~PinRegister & (1 << PINC1)) { 
              Serial.print("Interrupted / Woken up by Pin A1, remaining sleep() time: ");  
              remainingSleepTime = getSleepRemaining();
              Serial.println( remainingSleepTime );}
            else { 
              Serial.println("Falling edge of Pin A1"); 
             } 
            break;
          case (1 << PINC2):
            if (~PinRegister & (1 << PINC2)) { 
              Serial.print("Interrupted / Woken up by Pin A2, remaining sleep() time: "); 
              remainingSleepTime = getSleepRemaining();
              Serial.println( remainingSleepTime );}
            else { 
              Serial.println("Falling edge of Pin A2"); 
             }
            break;
          default:
            break;
          interrupts();
          }
        }
        else  { 
          interrupts();
          Serial.println("Timer wake up / Loop"); 
          timercounter++; 
          }
      
        Serial.print("  ");  Serial.print(" ISR Counter: ");Serial.print(isrcounter);  Serial.print("   Timer counter: "); Serial.println(timercounter);
        sleep((uint32_t) 60*1000);
      }
      

      Thanks a lot! Joost

      posted in Troubleshooting
      Joost
      Joost
    • RE: Pro Mini + RFM95 and two ISR-watched buttons possible?

      Thanks very much for pointing me the way and linking all those docs/references!

      I'll try to make up a working example and leave it here as reference,
      bye,

      Joost

      posted in General Discussion
      Joost
      Joost
    • RE: Looking for "beginner" PCB for an Arduino Pro Mini paired with RFM95/96

      @zboblamont
      Hi, thanks for confirming.
      I will probably look into KiCAD this weekend or the next week to see if I can import/adapt the nrf2rfm69 https://github.com/tbowmo/nrf2rfm69 board to accomodate an RFM69*CW size and pinout (which would be the same as RFM95/96), which would pave the way to all kinds of NRF24 based PCBs as far as I see. On the above GitHub seem to be KiCAD files already, I hope the learning curve won't be too steep.

      @ncollins
      Thanks for this new suggestion, looks pretty good!
      Will check the pinouts of SX1278 to see if it's compatible to SX1276 (it probably is, but it's too late right now :-), so my option would be to get the barebones ATMEGA328 board and fill in the RFM96 transceiver. Will dive in a bit more in the coming days; they have a link about low power usage which states some problems in the beginning, but it seems some folks have overcome them already, so this might pretty well be worth a shot. Thanks again!

      posted in Hardware
      Joost
      Joost
    • [Solved] Small problem with getting RSSI in an otherwise working RFM95 setup

      Hi everybody,

      I'd like to send RSSI data to the controller (Home Assistant on a Raspi 3 with an Arduino Pro Mini USB Gateway; both node and GW on lib 2.3.2; RFM95 transceivers). I used the example sketch with just minimal additions (as it does not work for me out of the box):

      // Enable debug prints
      #define MY_DEBUG
      #define MY_DEBUG_VERBOSE_RFM95
      
      // Define a lower baud rate for Arduinos running on 8 MHz (Arduino Pro Mini 3.3V & SenseBender)
      #if F_CPU == 8000000L
      #define MY_BAUD_RATE 38400
      #endif
      
      // RFM95
      #define MY_RADIO_RFM95
      #define MY_RFM95_ATC_TARGET_RSSI_DBM (-70)  // target RSSI -70dBm
      #define MY_RFM95_MAX_POWER_LEVEL_DBM (10)   // max. TX power 10dBm = 10mW
      //#define MY_RFM95_ATC_MODE_DISABLED
      
      #include <MySensors.h>
      
      // ID of the sensor child
      #define CHILD_ID_UPLINK_QUALITY (0)
      #define CHILD_ID_TX_LEVEL       (1)
      #define CHILD_ID_TX_PERCENT     (2)
      #define CHILD_ID_TX_RSSI        (3)
      #define CHILD_ID_RX_RSSI        (4)
      #define CHILD_ID_TX_SNR         (5)
      #define CHILD_ID_RX_SNR         (6)
      
      
      // Initialize general message
      MyMessage msgTxRSSI(CHILD_ID_TX_RSSI, V_CUSTOM);
      MyMessage msgRxRSSI(CHILD_ID_RX_RSSI, V_CUSTOM);
      MyMessage msgTxSNR(CHILD_ID_TX_SNR, V_CUSTOM);
      MyMessage msgRxSNR(CHILD_ID_RX_SNR, V_CUSTOM);
      MyMessage msgTxLevel(CHILD_ID_TX_LEVEL, V_CUSTOM);
      MyMessage msgTxPercent(CHILD_ID_TX_PERCENT, V_CUSTOM);
      MyMessage msgUplinkQuality(CHILD_ID_UPLINK_QUALITY, V_CUSTOM);
      
      void setup()
      {
      }
      
      
      void presentation()
      {
      	// Send the sketch version information to the gateway and controller
      	sendSketchInfo("ATC", "1.0");
      
      	// Register all sensors to gw (they will be created as child devices)
      	present(CHILD_ID_UPLINK_QUALITY, S_CUSTOM, "UPLINK QUALITY RSSI");
      	present(CHILD_ID_TX_LEVEL, S_CUSTOM, "TX LEVEL DBM");
      	present(CHILD_ID_TX_PERCENT, S_CUSTOM, "TX LEVEL PERCENT");
      	present(CHILD_ID_TX_RSSI, S_CUSTOM, "TX RSSI");
      	present(CHILD_ID_RX_RSSI, S_CUSTOM, "RX RSSI");
      	present(CHILD_ID_TX_SNR, S_CUSTOM, "TX SNR");
      	present(CHILD_ID_RX_SNR, S_CUSTOM, "RX SNR", true); //so bekommt man ein ACK zurück, wird über void receive verarbeitet (funktioniert)
      }
      
      void loop()
      {
      	Serial.println(transportGetSignalReport(SR_RX_RSSI));
      	Serial.println(transportGetSignalReport(SR_UPLINK_QUALITY));
      	// send messages to GW
      	send(msgUplinkQuality.set(transportGetSignalReport(SR_UPLINK_QUALITY)));
      	send(msgTxLevel.set(transportGetSignalReport(SR_TX_POWER_LEVEL)));
      	send(msgTxPercent.set(transportGetSignalReport(SR_TX_POWER_PERCENT)), true);
      	// retrieve RSSI / SNR reports from incoming ACK
      	send(msgTxRSSI.set(transportGetSignalReport(SR_TX_RSSI)));
      	send(msgRxRSSI.set(transportGetSignalReport(SR_RX_RSSI)));
      	send(msgTxSNR.set(transportGetSignalReport(SR_TX_SNR)));
      	send(msgRxSNR.set(transportGetSignalReport(SR_RX_SNR)));
      	// wait a bit
      	sleep(10000);
      }
      
      void receive(const MyMessage &message) {
        Serial.print("Incoming message for child: "); Serial.println(message.sensor);
        if (message.isAck() ) {//&& message.type == V_TRIPPED) {  // Test if ack received and for which type of msg, you could also test for which child id
           Serial.println("This is an ack from gateway");
           // set your "flag" ack variable to true here. Test it in your retry loop and reset it to false
        }
      }
      

      Unfortunately data retrieved by transportGetSignalReport(X) is "0". Here is the log with additional RFM95 debug output:

      
      0
      0
      72869 RFM95:SWR:SEND,TO=0,SEQ=200,RETRY=0
      72974 RFM95:SWR:ACK FROM=0,SEQ=201,RSSI=-30
      72986 TSF:MSG:SEND,131-131-0-0,s=0,c=1,t=48,pt=2,l=2,sg=0,ft=0,st=OK:0
      73005 RFM95:SWR:SEND,TO=0,SEQ=201,RETRY=0
      73111 RFM95:SWR:ACK FROM=0,SEQ=202,RSSI=-31
      73121 TSF:MSG:SEND,131-131-0-0,s=1,c=1,t=48,pt=2,l=2,sg=0,ft=0,st=OK:0
      73142 RFM95:SWR:SEND,TO=0,SEQ=202,RETRY=0
      73246 RFM95:SWR:ACK FROM=0,SEQ=203,RSSI=-31
      73259 TSF:MSG:SEND,131-131-0-0,s=2,c=1,t=48,pt=2,l=2,sg=0,ft=0,st=OK:0
      73277 RFM95:SWR:SEND,TO=0,SEQ=203,RETRY=0
      73289 !TSF:MSG:SEND,131-131-0-0,s=3,c=1,t=48,pt=2,l=2,sg=0,ft=0,st=NACK:0
      73310 RFM95:SWR:SEND,TO=0,SEQ=203,RETRY=0
      73502 !RFM95:SWR:NACK
      73578 RFM95:SWR:SEND,TO=0,SEQ=204,RETRY=1
      73777 !RFM95:SWR:NACK
      73820 RFM95:SWR:SEND,TO=0,SEQ=204,RETRY=2
      73996 !RFM95:SWR:NACK
      74082 RFM95:SWR:SEND,TO=0,SEQ=204,RETRY=3
      74276 !RFM95:SWR:NACK
      74326 RFM95:SWR:SEND,TO=0,SEQ=204,RETRY=4
      74496 RFM95:SWR:ACK FROM=0,SEQ=204,RSSI=-31
      74508 TSF:MSG:SEND,131-131-0-0,s=4,c=1,t=48,pt=2,l=2,sg=0,ft=1,st=OK:0
      74526 RFM95:SWR:SEND,TO=0,SEQ=204,RETRY=0
      74631 RFM95:SWR:ACK FROM=0,SEQ=205,RSSI=-31
      74643 TSF:MSG:SEND,131-131-0-0,s=5,c=1,t=48,pt=2,l=2,sg=0,ft=0,st=OK:0
      74661 RFM95:SWR:SEND,TO=0,SEQ=205,RETRY=0
      74768 RFM95:SWR:ACK FROM=0,SEQ=206,RSSI=-31
      74778 TSF:MSG:SEND,131-131-0-0,s=6,c=1,t=48,pt=2,l=2,sg=0,ft=0,st=OK:0
      74799 MCO:SLP:MS=10000,SMS=0,I1=255,M1=255,I2=255,M2=255
      74813 TSF:TDI:TSL
      74819 RFM95:RSL
      74823 MCO:SLP:WUP=-1
      74829 TSF:TRI:TSB
      74833 RFM95:RSB
      0
      0
      74840 RFM95:SWR:SEND,TO=0,SEQ=206,RETRY=0
      74854 !TSF:MSG:SEND,131-131-0-0,s=0,c=1,t=48,pt=2,l=2,sg=0,ft=0,st=NACK:0
      74872 RFM95:SWR:SEND,TO=0,SEQ=206,RETRY=0
      74979 RFM95:SWR:ACK FROM=0,SEQ=207,RSSI=-31
      74991 TSF:MSG:SEND,131-131-0-0,s=1,c=1,t=48,pt=2,l=2,sg=0,ft=1,st=OK:0
      75010 RFM95:SWR:SEND,TO=0,SEQ=207,RETRY=0
      75114 RFM95:SWR:ACK FROM=0,SEQ=208,RSSI=-31
      75126 TSF:MSG:SEND,131-131-0-0,s=2,c=1,t=48,pt=2,l=2,sg=0,ft=0,st=OK:0
      75145 RFM95:SWR:SEND,TO=0,SEQ=208,RETRY=0
      75159 !TSF:MSG:SEND,131-131-0-0,s=3,c=1,t=48,pt=2,l=2,sg=0,ft=0,st=NACK:0
      75177 RFM95:SWR:SEND,TO=0,SEQ=208,RETRY=0
      75354 !RFM95:SWR:NACK
      75397 RFM95:SWR:SEND,TO=0,SEQ=209,RETRY=1
      75567 !RFM95:SWR:NACK
      75630 RFM95:SWR:SEND,TO=0,SEQ=209,RETRY=2
      75812 !RFM95:SWR:NACK
      75909 RFM95:SWR:SEND,TO=0,SEQ=209,RETRY=3
      76038 !RFM95:SWR:NACK
      76113 RFM95:SWR:SEND,TO=0,SEQ=209,RETRY=4
      76265 RFM95:SWR:ACK FROM=0,SEQ=209,RSSI=-31
      76275 TSF:MSG:SEND,131-131-0-0,s=4,c=1,t=48,pt=2,l=2,sg=0,ft=1,st=OK:0
      76296 RFM95:SWR:SEND,TO=0,SEQ=209,RETRY=0
      76400 RFM95:SWR:ACK FROM=0,SEQ=210,RSSI=-31
      76412 TSF:MSG:SEND,131-131-0-0,s=5,c=1,t=48,pt=2,l=2,sg=0,ft=0,st=OK:0
      76431 RFM95:SWR:SEND,TO=0,SEQ=210,RETRY=0
      76535 RFM95:SWR:ACK FROM=0,SEQ=211,RSSI=-31
      76548 TSF:MSG:SEND,131-131-0-0,s=6,c=1,t=48,pt=2,l=2,sg=0,ft=0,st=OK:0
      76566 MCO:SLP:MS=10000,SMS=0,I1=255,M1=255,I2=255,M2=255
      76582 TSF:TDI:TSL
      76587 RFM95:RSL
      

      Here I see that in the debug output of the RFM95 driver, the RSSI is read and printed, alternating slightly over time from -29 to -31, seeming like valid data. But reading it in the sketch with transportGetSignalReport() gives me zeroes for all fields.

      Anyone with an idea what might be going on?

      Thanks very much for all your work & help with this great project,

      Joost

      posted in Troubleshooting
      Joost
      Joost
    • How do commercial products achieve continuous receive (like in battery powered wireless weather stations)?

      Hi everyone,

      I wonder how more or less cheap commercial products like e.g. wireless weather stations (often 433MHz) achieve a continuous wireless connection with both parties battery powered?
      So far this looks impossible to me with RFM95 or NRF24; is the implemented hardware in those products that different? Or are there other tricks I could implement myself in own products (short transceive windows come to mind, probably necessitating some form of synchronization)?

      Bye,

      Joost

      posted in General Discussion
      Joost
      Joost
    • RE: Looking for "beginner" PCB for an Arduino Pro Mini paired with RFM95/96

      @sweetpants Wow, that's just ...🙄 ... exactly what I am looking for! Thanks for the link!

      This gives me a pretty sweet-sour feeling though... In the last days I invested quite some time to get into some basic PCB designing with KiCAD and hacked something together as a starting point, and just now you link to the perfect solution for me 😝 😳

      I will upload the raw guts of my attempts here, perhaps I will continue with it nevertheless. In the last decades I never needed PCB designing skills, but perhaps with all this sensors stuff it might still be worth for me following along with KiCAD.

      posted in Hardware
      Joost
      Joost
    • RE: 💬 Arduino Pro Mini 3,3V PCB for RFM95/96

      Sure, there is already the KiCAD file including everything to play around with on your own; added a picture of the schematic here for a quick glance without downloading.

      posted in OpenHardware.io
      Joost
      Joost
    • RE: [Solved] Small problem with getting RSSI in an otherwise working RFM95 setup

      @tekka
      Hi, thanks a ton, this was the missing piece! Working great now!

      I started with the "official" example sketch out of the MySensors codebase

      https://github.com/mysensors/MySensors/blob/master/examples/RFM69_RFM95_ATC_SignalReport/RFM69_RFM95_ATC_SignalReport.ino ,

      where I did not see any reference to

      #define MY_SIGNAL_REPORT_ENABLED
      

      Did I overlook something or is this example sketch not working on its own in the current form?

      Thanks again very much for your help, best regards,

      Joost

      posted in Troubleshooting
      Joost
      Joost
    • RE: Is soldering castellated pads on THT pads feasible?

      @Joost Added two photos to the project page. KiCAD/rendering still to follow.

      posted in Hardware
      Joost
      Joost