Navigation

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

    Sasquatch

    @Sasquatch

    20
    Reputation
    55
    Posts
    129
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Sasquatch Follow

    Best posts made by Sasquatch

    • RE: Issues when upgrading EnergyMeterPulseSensor from 1.5.x to 2.3.2

      V_Var1 is variable(your total pulses) stored in the controller - HomeAssistant, Domoticz etc....
      Assuming you have controller shut down you have to send that value from MYSController.

      This request will be fulfilled by controller after you configure it to use node's 7 child 1

      posted in Development
      Sasquatch
      Sasquatch
    • RE: Suggestions for my setup? Very new here.

      Imagine thermostat relying on IFTTT/cloud to work on schedule and your internet fails(winter, someone crashes car into ISP cabinet)... πŸ˜‰

      posted in General Discussion
      Sasquatch
      Sasquatch
    • RE: NodeManager sensors with multiple interrupt pins

      @j54n1n said in NodeManager sensors with multiple interrupt pins:

      So can somebody confirm that pin change interrupts can wake up a sleeping node loaded with a NodeManager template sketch?

      I have got the impression by reading here in the forum that the ATmega328p microcontroller has problems waking up from pin change interrupts. Maybe I am wrong?

      You are wrong, i have one sitting on my bench right now sleeping and waking up on A5 pin change.
      it's bare 328p test bead drawing mere 1uA in sleep...
      Use sleep(0);
      All the code you need to set things up:(tested on nano and mini boards)

      void pciSetup(byte pin)// enables pin change for given pin
      {
      	*digitalPinToPCMSK(pin) |= bit (digitalPinToPCMSKbit(pin));  // enable pin
      	PCIFR  |= bit (digitalPinToPCICRbit(pin)); // clear any outstanding interrupt
      	PCICR  |= bit (digitalPinToPCICRbit(pin)); // enable interrupt for the group
      }
      void pciClear(byte pin)// disables pin change for given pin
      {
      	*digitalPinToPCMSK(pin) &= ~(bit (digitalPinToPCMSKbit(pin)));  // disable pin
      	PCIFR  |= bit (digitalPinToPCICRbit(pin)); // clear any outstanding interrupt
      	PCICR  &= ~(bit (digitalPinToPCICRbit(pin))); // disable interrupt for the group
      }
      
      
      ISR (PCINT0_vect)//pins d8-d13
      {
      	
      }
      ISR (PCINT1_vect)// pins a0-a7
      {
      	
      }
      ISR (PCINT2_vect)//pins d0-d7
      {
      	
      }
      
      

      If you want to get several readings and then send them to gateway(power meter pulse counting) it's better to write your own sleep function. Built in sleep(); wakes radio on every wake up.
      :work in progress:

      void PowerDown(void)
      {
        ADCSRA &= ~(1<<ADEN);//disable ADC - 120uA
        sleep_bod_disable();//disable bod  - 15uA
        set_sleep_mode(SLEEP_MODE_PWR_DOWN);
        wdt_disable();
        sleep_enable();
        sleep_cpu();
        sleep_disable();
       ADCSRA |= (1<<ADEN);//enable ADC
       }
      

      then call transportDisable(); before powering down
      and transportReInitialise(); before sending your data.

      posted in NodeManager
      Sasquatch
      Sasquatch
    • RE: Arduino pro mini, rfm69 with 2 Reed switches on interrupts?

      @kiesel

      Found on here:
      Quote:

      Commented by Manoraj Gnanadhas (Atmel)
      2015-01-20 06:23:36 GMT
      [Recipients: Nick Gammon]

      Hello Nick,

      Our design team has confirmed that β€œNote-3 mentioned under Table 10-1” is a datasheet bug. So you can use any type of interrupt (Rising edge/ Falling edge / Low level / Any logical change) to wake up from sleep mode. Sorry for the inconvenience caused.

      Best Regards,
      Manoraj Gnanadhas

      Not responding to reed relay:
      PRIMARY_BUTTON_PIN interrupt is active only in sleep. if you're (un)lucky enough to move magnet when cpu is awake it will ignore it.

      More likely is that relay bounce longer than wake up time + 5ms in your loop.
      Do away with pin reading, serial print and delay, shorter your loop, longer battery life.
      In ISR (PCINT0_vect) set flag, then in a loop check for that flag.
      If it's set it's secondary buttton pin that avoke your cpu,
      if it's not set it's primary button .

      I'm reusing your variables:

      #include <avr/sleep.h>
      #define DEBUG  // coment out when ready to go into the box 
      #ifndef DEBUG //disable serial in production compile, potentially saves few uA in sleep mode
           #define MY_DISABLED_SERIAL
      #endif
      ISR (PCINT0_vect) // handle pin change interrupt for D8 to D13 here
       {    
          //delayMicroseconds(2);
          valueSecondary = true; // ISRs need to finish very fast or the arduino crashes. 
      void loop()
      {
         // Sleep until something happens with the sensor
        //sleep(PRIMARY_BUTTON_PIN-2, CHANGE, SECONDARY_BUTTON_PIN-2, CHANGE, 0);
        sleep_bod_disable();//disable BOD  - saves~ 15uA
        sleep(PRIMARY_BUTTON_PIN-2, CHANGE, 0);
      
        #ifdef DEBUG   //get rid of unnecessary slow downs when ready    
        Serial.println("Woken up");
        #endif
        
      
        if (valueSecondary == true){
               valueSecondary = false;
               #ifdef DEBUG     //get rid of unnecessary slow downs when ready    
               Serial.print("Secondary:");
               #endif
               send(msg2.set(1)); //box emptied/mail in the box
        }
        else{
            #ifdef DEBUG   //get rid of unnecessary slow downs when ready    
             Serial.print("Primary:");
            #endif
            send(msg.set(1));//mail in the box/box emptied
        }
      }
      

      Unless you really need to know if box was opened then closed, then check pin states in my if/else after 10-50ms delay, experiment until you get no bounce errors. BUT it will increase battery drain SIGNIFICANTLY.
      You will have 2 messages sent per event, one per door opening and one per door closing.

      posted in Development
      Sasquatch
      Sasquatch
    • RE: Suggestions for my setup? Very new here.

      @Smart-Projects-ABC
      1- not really. HA can use any sensor with Google Assistant(not sure if alexa was added since I last used it)
      2-flash requried? - going back to 2005 is IMHO not the way forward, what kind of advanced automation cannot be done in, say Domoticz or HomeAssistant?
      3-as little different protocols as practicable is a good idea
      4- I would add: avoid cloud based sensors at all cost for security and future proofing reasons. Cloud based sensor can be rendered useless by vendor deciding it's time to sell you a new one. Having local controller talking to sensors/actuators over WIFI/ZIGBEE/RFM69/NRF24/MagicBeam and allowing remote control over GA/Aexa/an app is more robust solution than every sensor talking to a server in china over different open port and ten talking trough outdated website(ittt.com) to talk to controller over yet another open port....

      And yes, with a bit of creativity and couple seeedstudio.com orders you can get every sensor you want on MySensors transport πŸ˜‰

      posted in General Discussion
      Sasquatch
      Sasquatch
    • RE: Domoticz/Mysensors

      @alco plenty people here ready to help

      posted in Domoticz
      Sasquatch
      Sasquatch
    • RE: [SOLVED] Go to loop(); when parent/gateway can't be found.

      @mfalkvidd Thank You!!!
      @skywatch just search forums, plenty of use examples, knowing what to search for was a key problem ;).

      posted in Development
      Sasquatch
      Sasquatch
    • RE: Generic pressure sensors -SOLVED

      It is most likely OP amp output you are seeing,
      connect 5v, resistors as needed and multimeter to resistor output, check if works satisfactory, simple....

      posted in Hardware
      Sasquatch
      Sasquatch
    • RE: BATERY CHARGER CONNECTION ?

      In Proteus you click on terminal end to draw a wire connection πŸ˜‰

      But on serious note - with copper with help from soldering alloy on PCB πŸ˜‚ .

      If you are asking for exact schematics then do your own homework and look in TP4056 datasheet. You are looking for typical application drawing.

      Tp4056 is linear regulator, very inefficient, look at spv1040 or spv1050 instead - MPPT tracking propper solar chargers.

      posted in General Discussion
      Sasquatch
      Sasquatch
    • RE: [SOLVED] Go to loop(); when parent/gateway can't be found.

      @BearWithBeard my bad, looked at wrong post and understood your answer wrong, bloody small text on phones ;~)

      posted in Development
      Sasquatch
      Sasquatch

    Latest posts made by Sasquatch

    • RE: Nb of possible nodes in a mysensors networks with domoticz

      @OldSurferDude
      yeah, 10 virgin nodes powered up at the same time is a bad idea I seem to remember reading somwewhere here warning aginst that.
      If yu have node ID trust issues with Mysensors you should move your address to different locaion as 0x00 is used by Mysensors... just sayin..;)

      posted in My Project
      Sasquatch
      Sasquatch
    • RE: Nb of possible nodes in a mysensors networks with domoticz

      @OldSurferDude
      Yeah I see the special use case here.
      but.
      A) MySensors stores node ID in epprom without any of your code
      B) Sketch without

      #define MY_NODE_ID 
      

      will use eeprom stored ID, If eeprom is empty, addres 0x00=0xFF node will request ID to be assigned by gateway and save assigned ID at eeprom address 0x00
      C) to retrieve eeprom stored ID you should use MySensors function :

      getNodeId();
      

      To put it bluntly your code to read/write eeprom is redudndant as everything it does is natively handled by MySensors.
      Don't get me wrong, your code looks tidier than most of my "efforts" but you're reinventing the wheel here, a bit.. πŸ˜‰
      Neat trick with skipping compile before upload by the way.

      To replace dead node all you have to do is upload simplest node sketch with definded desired node ID, let it boot to update eeprom, then load your node program using

      getNodeId(); 
      

      to retrieve node id if you need it in your code.

      Or am I still missing something? πŸ€”

      posted in My Project
      Sasquatch
      Sasquatch
    • RE: Sending offset to node

      easiest way would be to add thermostat "sensor2 to youd node and adjust that to desired temperature. But since your node is sleeping you will have to request the set value when it wakes up.
      Here is an example of how my power meter was getting last KWH from controller after power cut, I removed irrevelant code for clarity:

      loop(){
      	if (!daySet) {
      		request(dayID, V_KWH);
      		wait(3333, C_SET, V_KWH);
      	}
      	
      	if(!nightSet){
      		request(nightID, V_KWH);
      		wait(3333, C_SET, V_KWH);
      	}
      }
      
      void receive(const MyMessage &message) {
      	
      		if(message.getCommand() == C_SET){
      			if (message.type == V_KWH) {
      				if(message.sensor == dayID){
      					dayCount = MeterRatio * message.getFloat();
      					dayCountOld = dayCount;
      					dayCountWatt =dayCount;
      					daySet = true;
      				}
      				else if (message.sensor == nightID){
      					nightCount = MeterRatio * message.getFloat();
      					nightCountOld = nightCount;
      					nightCountWatt = nightCount;
      					nightSet = true;
      				}
      					
      			}
      		}
      }
      

      It was taking approx 2 seconds wits domoticz(2019 version) to reply to my requests.

      You may run into errors with this method as your sleeping node won't send back ACK when you set new offset though.
      Some controllers can disable requirement for ACK, i think.
      More advanced way would be creating dummy thermostat to set new value(so you would have live and dummy thermostats) and using controller scripts to update the live thermostat on receipt of a temperature, you would have to wait after sending temperature or humidity.

      posted in Development
      Sasquatch
      Sasquatch
    • RE: Nb of possible nodes in a mysensors networks with domoticz

      @OldSurferDude
      no offence but rtfm πŸ˜‰

      #define MY_NODE_ID 3
      

      is all you need to set predefined node id's, change 3 to any number from 1 to 254, it's worth having a spreadsheet with assigned ID's to avoid doubles, or at least write ID on the node itself.
      If you ommit above define Mysensors store ID in eeprom after it gets autoassigned by gateway/controller on first start.

      posted in My Project
      Sasquatch
      Sasquatch
    • RE: Nb of possible nodes in a mysensors networks with domoticz

      @GLAB Uno-Nrf comms are ok, your node woulnd't get to sending radio packest if radio chip comms weren't ok.
      Instead of reflashing working node and gateway try backdating MySensors library in arduino. You should see what version is used in working gateway somewhere in your contrloller, or by connecing yor serial gateway directly to your PC. in case of ethernet/wifi gateway you can alco use MySController from here:
      https://www.dropbox.com/scl/fi/prn9p2cnheyteopokszor/MYSController.zip?rlkey=up54kg4lt2blmff66t2jlgeo6&e=1

      if your working node/gateway in on 2.00 and your new node works with that, then you can update them all with minimal risk of borking it all.

      posted in My Project
      Sasquatch
      Sasquatch
    • RE: Nb of possible nodes in a mysensors networks with domoticz

      it seems your node never received any reply, are you setting you radio correctly? I'm not using nrf24l01s but you are probably using pa+lna version witn non pa+lna code...

      posted in My Project
      Sasquatch
      Sasquatch
    • RE: Saving last known good state, but not in EEPROM

      @OldSurferDude jus request counter states from controller on each reset, worked fine with Domoticz...
      or save in eeprom but increase location every write, on power up/reset search eeprom for largest value stored and carry on from that location, one long integer will fit 256 times in atmega328(p) eeprom, is that long enough for you πŸ˜‰ ?

      posted in Development
      Sasquatch
      Sasquatch
    • RE: Radio waking up for no reason.

      Over 4 years on, and my node ran continuously sending 4 messages every 5 minutes.
      It's 700mAh LiFePo4 battery voltage dropped from initial 3.45V to 3.24V, according to LiFePo4 voltge/SoC tables It's just under 40% left.
      700*60% = 420mAh. 100 mAH per year. using library 2.40 and blob message I could cut usage to ~25mAh/year, not bad

      posted in Development
      Sasquatch
      Sasquatch
    • RE: Best password manager?

      @NeverDie Linux and antivirus... I say no since only one I can recommend is only available for windows and mac.

      @mfalkvidd said in Best password manager?:

      @NeverDie for travel, I would say the largest risk is a border search. US does it, so I would suspect Russia does as well. Good guide: https://www.eff.org/document/eff-border-search-pocket-guide

      Say whaat? Border officials in US can confiscate my laptop willy nilly? I'm glad I have no plans to travel there, and if I do I'll encrypt the hell out of everything I carry, even my wrist watch will need password to show time πŸ˜‰

      posted in General Discussion
      Sasquatch
      Sasquatch
    • RE: Best password manager?

      @NeverDie said in Best password manager?:

      Here's a case study that examined how 1Password, Dashlane, KeePass and LastPass could leak data: https://www.ise.io/casestudies/password-manager-hacking.

      As I said before no password manager is safe on machine crawling with viruses and/or malware
      That's where antivirus software comes to play if you skip that there is no escape from being eventually "hacked".

      Main advantage of password manager is not reusing passwords for different services. When one gets compromised it's that. One password leaked, one account compromised, rest is safe. Alternative would be pen and paper notepad, reusing one password, or using memorable password combinations all bearing much greater risks than any decent password manager.

      IMHO you are getting a bit paranoid, I do agree with BearWithBeard, use as few extensions as practical.
      Firefox+adblockplus+kepassxc+cookiecleaner is my "daily driver"
      For weird side of internet I use TOR browser.
      For testing downloads use VM.
      Plus good paid antivirus, so far so good.

      posted in General Discussion
      Sasquatch
      Sasquatch