Navigation

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

    Joost

    @Joost

    12
    Reputation
    59
    Posts
    46
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Joost Follow

    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

    Latest posts made by Joost

    • RE: πŸ’¬ Minimal LiPo powered Arduino Pro Mini + RFM95 MySensors node

      @evb said in πŸ’¬ Minimal LiPo powered Arduino Pro Mini + RFM95 MySensors node:

      Thanks for the dimensions πŸ™‚
      That will work in my setup!

      I have read also these links with results much better then my 133Β΅A.
      I have tested my pro mini with the lowpower sketch to get the pro mini in deep sleep and I measure 133Β΅A. My multimeter is already 30 years old and his last calibration was 20 years ago? But the voltage measurements are still correct, so I don't know...
      LowpowerLab has a Current Sense Amplifier device, but for 141 euros it is bit expensive πŸ˜‰

      You didn't mention where you did buy your Pro Mini's? I'm thinking about the quality of the used electronics...

      @evb I don't have a specific source for my Pro Minis. Some are from Ali, some from Ebay international - I don't even know which one is from where. I just keep sure to always order the same layout/design, as can be seen in the photos.
      Also, when the regulator and LED are removed, there is not that much left besides the ATMega328 itself, is there? Some resonators, but not any questionable parts AFAICS.
      Perhaps you should really give another multimeter a try?

      posted in OpenHardware.io
      Joost
      Joost
    • RE: πŸ’¬ Minimal LiPo powered Arduino Pro Mini + RFM95 MySensors node

      Maybe we are comparing deep sleep current vs. a "mix" of deep sleep and wake times added together and averaged? See differences between those approaches in the first

      See "calculation"

      vs. these last two links:

      See table "The Simple @ 8Mhz"

      Sparkfun article

      posted in OpenHardware.io
      Joost
      Joost
    • RE: πŸ’¬ Minimal LiPo powered Arduino Pro Mini + RFM95 MySensors node

      Or am I measuring nonsense/inaccurately? Just a hobbyist...
      If so, sorry for that

      posted in OpenHardware.io
      Joost
      Joost
    • RE: πŸ’¬ Minimal LiPo powered Arduino Pro Mini + RFM95 MySensors node

      Hi, with a newer, potentially better DMM I found 12.4Β΅A at 3.3V for a Pro Mini (3.3/8MHz, regulator and power LED removed, stock bootloader) with a BME280 (which has an additional, in this 3.3V setting unneeded, power regulator on board that could be removed) and a RFM95/96, at deep sleep.
      Also I got you some pic of the dimensions for that older version of the board I had lying around.
      Cheers, Joost

      PXL_20201121_121708555.jpg PXL_20201121_121643304.jpg ProMini-BME280-RFM95.jpg

      posted in OpenHardware.io
      Joost
      Joost
    • RE: πŸ’¬ Minimal LiPo powered Arduino Pro Mini + RFM95 MySensors node

      HI, I'll try to get back to you this weekend and re-measure my power consumption (you're correct, these are unmodified 8MHz/3.3V Pro Minis, no modified bootloader or anything). The consumption was measured with two relatively cheap multimeters, giving the same result (in comparison to your link without the DS18B20 and with a RFM95), though I'm pretty confident this would be kind of correct.

      Btw. you mean the thickness of the radio module on its own?

      posted in OpenHardware.io
      Joost
      Joost
    • RE: Thanks for node-red-contrib-mysensors and a question regarding collections or arrays

      This seems to evaluate to true/undefined every time, effectively resetting the array:

      var global_individual_data=global.get("global_invidual_data");
      if (global_individual_data===undefined) {
          msg.kein_array_vorhanden="true"
          global_individual_data=[];
      }
      

      even though it's later set with

      global.set("global_individual_data",global_individual_data);
      
      posted in Node-RED
      Joost
      Joost
    • RE: Thanks for node-red-contrib-mysensors and a question regarding collections or arrays

      HI, thanks, I guess right now the problem lies in the data storage in global or flow context.
      With this I can build the individual obejct, and pushing it on a global array gives no error. But the array is not properly stored and retrieved from the global context:

      var ind_data={};
      ind_data.nodeid=msg.nodeId;
      ind_data.type=msg.type;
      ind_data.payload=msg.payload;
      
      var global_individual_data=global.get("global_invidual_data");
      if (global_individual_data===undefined) {
          msg.kein_array_vorhanden="true"
          global_individual_data=[];
      }
      global_individual_data.push(ind_data);
      
      global.set("global_individual_data",global_individual_data);
      
      
      posted in Node-RED
      Joost
      Joost
    • RE: Thanks for node-red-contrib-mysensors and a question regarding collections or arrays

      Ok, with this I can at least create an individual data point object:

      var ind_data={};
      ind_data.nodeid=msg.nodeId;
      ind_data.type=msg.type;
      ind_data.payload=msg.payload;
      
      var global_individual_data=global.get("global_invidual_data");
      if (global_individual_data===undefined) {
          global_individual_data={};
      }
      global_individual_data.push(ind_data);
      

      But "pushing" this on to global_individual_data gives me an error. How could I store those indivudal objects in global context and iterate over them in a template node?

      posted in Node-RED
      Joost
      Joost
    • RE: Thanks for node-red-contrib-mysensors and a question regarding collections or arrays

      PS: this here

      var nodekey=msg.nodeId;var datatype=msg.type;var payload=msg.payload;
      //var individual_data={ nodekey, {datatype, payload}};
      var ind_data=[];
      ind_data.push[nodekey][datatype]=payload;
      
      var global_individual_data=global.get("global_invidual_data");
      if (global_individual_data===undefined) {
          global_individual_data={"node":0,"type":"voltage", "payload":3.3333 };
      }
      //global_individual_data.add(individual_data);
      //var nodekey=msg.nodeId;var datatype=msg.type;
      //global_individual_data[nodekey][datatype]=msg.payload;
      
      global.set("global_individual_data",global_individual_data);
      msg.global_individual_data=global_individual_data;
      
      

      is just my last non-working attempt and probably way way off (I know ind_data is not added to global_individual_data in there at this point); I have tried innumerable variations before with no success. I am pretty lost here...

      Debug log right now:

      10/25/2020, 8:52:05 AMnode: Store nodeIDs in arrayfunction : (error)
      "TypeError: Cannot set property 'humi' of undefined"
      10/25/2020, 8:52:05 AMnode: Store nodeIDs in arrayfunction : (error)
      "TypeError: Cannot set property 'pres' of undefined"
      10/25/2020, 8:52:05 AMnode: Store nodeIDs in arrayfunction : (error)
      "TypeError: Cannot set property 'volt' of undefined"
      
      posted in Node-RED
      Joost
      Joost