Navigation

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

    elysion

    @elysion

    3
    Reputation
    9
    Posts
    404
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    elysion Follow

    Best posts made by elysion

    • RE: I got a plug-and-play NRF24 shield for the Pi on Aliexpress

      FYI for anyone who finds this thread:

      I installed the shield on a Raspberry Pi 3 and used --my-leds-rx-pin=15 --my-rf24-ce-pin=12 config parameters. The network seems to work and the red LED is blinking. I have not verified whether the LED blinks when MySensors daemon receives a message, but I would assume it does and does not just blink randomly.

      All in all this shield seems like quite a nice way to install the NRF24 radio to a Raspberry Pi, so I would highly recommend it over Dupont cables.

      posted in Hardware
      elysion
      elysion
    • RE: Interrupt and sleep

      From your description it sounds like your problem is pretty much exactly same as mine was when I started that thread. I have not experienced any crashes. The issue is just that the board does not wake up on CHANGE. Have you tried using LOW instead of CHANGE for sleep? There were comments in the aforementioned thread that this might be an issue with a certain version of Arduino and boards file. Have not yet had time to investigate tough.

      posted in Development
      elysion
      elysion

    Latest posts made by elysion

    • RE: I got a plug-and-play NRF24 shield for the Pi on Aliexpress

      FYI for anyone who finds this thread:

      I installed the shield on a Raspberry Pi 3 and used --my-leds-rx-pin=15 --my-rf24-ce-pin=12 config parameters. The network seems to work and the red LED is blinking. I have not verified whether the LED blinks when MySensors daemon receives a message, but I would assume it does and does not just blink randomly.

      All in all this shield seems like quite a nice way to install the NRF24 radio to a Raspberry Pi, so I would highly recommend it over Dupont cables.

      posted in Hardware
      elysion
      elysion
    • RE: I got a plug-and-play NRF24 shield for the Pi on Aliexpress

      Did you get the LEDs to work @alowhum? From the previous messages I gather all you need in order to get the shield to work is to include the configuration flag. Is this correct? Bought the shield, because I wanted to build a more robust setup without dupont cables everywhere.

      posted in Hardware
      elysion
      elysion
    • RE: Pin change interrupt not firing with MySensors

      I updated my sensors to use v2 of the MySensors library and this issue went away. Used the same board with same fuses and same Arduino IDE and boards file version. Imho this would suggest that there is an issue in MySensors.

      Before migrating to v2 I ran some tests using a button in place of the PIR sensor and it seemed that using a short timeout for the gw.sleep would work, but a longer would not. Did not dig deeper into this though, so might be that it just seemed to work better.

      posted in Troubleshooting
      elysion
      elysion
    • RE: Pin change interrupt not firing with MySensors

      I'll see if I can find time today or tomorrow to try this. Also might be interesting to see whether it would be possible to get around the issue using Platform.io.

      posted in Troubleshooting
      elysion
      elysion
    • RE: Interrupt and sleep

      From your description it sounds like your problem is pretty much exactly same as mine was when I started that thread. I have not experienced any crashes. The issue is just that the board does not wake up on CHANGE. Have you tried using LOW instead of CHANGE for sleep? There were comments in the aforementioned thread that this might be an issue with a certain version of Arduino and boards file. Have not yet had time to investigate tough.

      posted in Development
      elysion
      elysion
    • RE: Pin change interrupt not firing with MySensors

      @idstone: Have you tried passing another mode (e.g. LOW) to gw.sleep method? The issue I am having is that with LOW the interrupt fires, but with CHANGE (which is the default in the sketches) it does not.

      posted in Troubleshooting
      elysion
      elysion
    • RE: Pin change interrupt not firing with MySensors

      What I am currently uploading is the unmodified version of MotionSensor.ino linked above. I have previously build a motion sensor using a 3.3V pro mini with the same code. The only difference that I can think of with my current setup is that I am using the internal RC oscillator instead of the external and have changed the fuses accordingly by using the bootloader upload in Arduino IDE. I used the following board configuration:

      atmega328PstandaloneInt8MHz.name=Standalone ATmega328P (ATmega boot, internal 8MHz)
      
      atmega328PstandaloneInt8MHz.upload.tool=arduino:avrdude
      atmega328PstandaloneInt8MHz.upload.protocol=arduino
      atmega328PstandaloneInt8MHz.upload.maximum_size=30720
      atmega328PstandaloneInt8MHz.upload.maximum_data_size=2048
      atmega328PstandaloneInt8MHz.upload.speed=57600
      
      atmega328PstandaloneInt8MHz.bootloader.tool=arduino:avrdude
      atmega328PstandaloneInt8MHz.bootloader.low_fuses=0xE2
      atmega328PstandaloneInt8MHz.bootloader.high_fuses=0xDA
      atmega328PstandaloneInt8MHz.bootloader.extended_fuses=0xFD
      atmega328PstandaloneInt8MHz.bootloader.unlock_bits=0x3F
      atmega328PstandaloneInt8MHz.bootloader.lock_bits=0x0F
      atmega328PstandaloneInt8MHz.bootloader.file=atmega/ATmegaBOOT_168_atmega328_pro_8MHz.hex
      atmega328PstandaloneInt8MHz.build.mcu=atmega328p
      atmega328PstandaloneInt8MHz.build.f_cpu=8000000L
      atmega328PstandaloneInt8MHz.build.board=AVR_PRO
      atmega328PstandaloneInt8MHz.build.core=arduino
      atmega328PstandaloneInt8MHz.build.variant=standard```
      posted in Troubleshooting
      elysion
      elysion
    • RE: Pin change interrupt not firing with MySensors

      Thanks for the reply scalz!

      @scalz said:

      for the moment you can't use pin interrupt change lib with mysensors.

      I'm not sure what you mean by "pin interrupt change lib", but I would assume it would be possible to use the CHANGE type when calling gw.sleep as in the examples: https://github.com/mysensors/MySensors/blob/59550410a3f55f11b39aacfcaaa2dd8926682673/libraries/MySensors/examples/MotionSensor/MotionSensor.ino#L64

      Also, note, pinchange need you handle the change state. these are not working like D2/D3 INT0/1.
      I'm using pinchange with mysensors, but i use raw registers, my own isr for interrupts, and my sleep function.

      I have only connected the one motion sensor to my board and the interrupt handler just sends the current state (tripped / not tripped) to the controller. Thus I do not think I need to do anything special here.

      To clarify, I am using the MotionSensor.ino code without any modifications on my board. The execution reaches the gw.sleep call without problems, but does not resume even if the pin state changes. I am able to read the value from the pin by setting SLEEP_TIME to 1000 and this way confirm that the value of the pin does change and that can be read correctly.

      posted in Troubleshooting
      elysion
      elysion
    • Pin change interrupt not firing with MySensors

      Hi!

      I have been working on building motion sensors with MySensors to be able to trigger events on my Vera. Earlier I was able to get a few sensors working using 3.3V 8MHz Pro Minis. Now I am trying to build one with a custom ATMega328 board that uses the internal RC oscillator. For some reason I am unable to get the board to respond to pin change interrupts when using MySensors gw.sleep() using the MotionSensor.ino. I debugged the issue with a Pro Mini that (afaicr) is also using the internal oscillator instead of the external oscillator on the board. Everything however works correctly if I do not include MySensors code in my sketch and use attachInterrupt with mode set to CHANGE:

      void setup() {
        Serial.begin(115200);
        Serial.println("Boot");
        pinMode(3, INPUT_PULLUP);
        attachInterrupt(digitalPinToInterrupt(3), handler, CHANGE);
      }
      
      void loop() {
      }
      
      void handler() {
         Serial.println("foo");
      }
      

      However if I pass LOW mode to gw.sleep, the interrupt seems to work and a message seems to be sent to the controller correctly. But of course this only happens when the pin is in LOW state and not on changes.

      Has anyone got a clue on what might be causing the issue? I read through the interrupt handling code in MySensors that I believe is relevant in my case (MyHwATMega328 class), but was unable to find anything that might cause the issue.

      edit Forgot to mention, but I am using version 1.5 of MySensors /edit

      posted in Troubleshooting
      elysion
      elysion