Navigation

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

    Bens

    @Bens

    Long time IT guy with lots of software development experience, most of it pretty old by now. As a hobby I'm looking into home automation and taking my first steps into the hardware domain, well ... Arduino, RPi and SenseBender Micro's, that is.
    As often, my ambition is higher than my capabilities in this area.

    3
    Reputation
    7
    Posts
    579
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online
    Location Netherlands

    Bens Follow

    Best posts made by Bens

    • PiGatewaySerial using interrupts

      Hi All,

      I have the following set-up:

      • A couple of SenseBender Micro's

      • A Raspberry Pi 2 with the NRF24 connected to the GPIO pins

      • The RPi runs the PiGatewaySerial

      • The RPi also runs the pimatic(.org) controller, using the mysensor plugin.

      In this set-up I noticed that the RPI misses some messages send by the SenseBender Micro's, especially when messages are send in rapid succession, e.g. when "presenting" the sensors.

      I modified the PiGatewaySerial.cpp by using the interrupt generated by the NRF24 (see https://www.raspberrypi.org/forums/viewtopic.php?t=17061&p=290453) and have the interrupt routine run "gw->processRadioMessage();". (And remove this call from the main loop of PiGatewaySerial.cpp). I also use a semaphore to ensure that the NRF24 connected to the RPi is either used by the interrupt routine or by "gw->parseAndSend(buff);", which is the other major item in the main loop.
      The result is that no messages are lost anymore. 😃 I can share the code if requested.

      In the main loop there remains only one polling item "ret = poll(&fds, 1, 500);". I searched quite a bit, but am not able to find a way to make also this call interrupt based. This call waits for about half a second if there is a message that can be read from, in loose terms, "/dev/ttyMySensorsGateway". This waiting for half a second is what makes the RPi miss send messages and which is resolved using the interrupt from the NRF24.

      Does anybody know how to make this call "ret = poll(&fds, 1, 500);" using interrupts? I do not like polling!

      Ben

      posted in Development
      Bens
      Bens

    Latest posts made by Bens

    • PiGatewaySerial using interrupts

      Hi All,

      I have the following set-up:

      • A couple of SenseBender Micro's

      • A Raspberry Pi 2 with the NRF24 connected to the GPIO pins

      • The RPi runs the PiGatewaySerial

      • The RPi also runs the pimatic(.org) controller, using the mysensor plugin.

      In this set-up I noticed that the RPI misses some messages send by the SenseBender Micro's, especially when messages are send in rapid succession, e.g. when "presenting" the sensors.

      I modified the PiGatewaySerial.cpp by using the interrupt generated by the NRF24 (see https://www.raspberrypi.org/forums/viewtopic.php?t=17061&p=290453) and have the interrupt routine run "gw->processRadioMessage();". (And remove this call from the main loop of PiGatewaySerial.cpp). I also use a semaphore to ensure that the NRF24 connected to the RPi is either used by the interrupt routine or by "gw->parseAndSend(buff);", which is the other major item in the main loop.
      The result is that no messages are lost anymore. 😃 I can share the code if requested.

      In the main loop there remains only one polling item "ret = poll(&fds, 1, 500);". I searched quite a bit, but am not able to find a way to make also this call interrupt based. This call waits for about half a second if there is a message that can be read from, in loose terms, "/dev/ttyMySensorsGateway". This waiting for half a second is what makes the RPi miss send messages and which is resolved using the interrupt from the NRF24.

      Does anybody know how to make this call "ret = poll(&fds, 1, 500);" using interrupts? I do not like polling!

      Ben

      posted in Development
      Bens
      Bens
    • Scetch doesn't want to load into Sensebender Micro

      Hi All,

      I have bought 6 Sensebender Micro's.
      I have loaded 3 of them with scetches already and they all work.
      This evening I wanted to upload a scetch to #4 and that failed. The error I get is
      "Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions."
      It is the first time I tried to upload something to this #4. I have tried multiple times. The same scetch can be uploaded to one of the 3 I already use.

      I use an FTDI to upload the scetches.Instead of a green and red led blinking quickly, now only a red led blinks a few times before the error message appears.
      What could be the problem?

      posted in Troubleshooting
      Bens
      Bens
    • RE: RPi as a 'node'?

      Hi Skywatch,

      Not sure you are still looking into this.
      It can be done, and I have done it. Actually, all the documentation is there.
      You can directly connect the radio to the Pi2 and you could modify the PiSerialGateway not to act as a gateway, but simply use the sending part.

      posted in General Discussion
      Bens
      Bens
    • RE: What are the pin numbers for D3, D4, ...

      Hi @tbowmo and @hek,
      Many thanks, I got it working!

      posted in Troubleshooting
      Bens
      Bens
    • RE: What are the pin numbers for D3, D4, ...

      Hi Hek,
      I think I got it, When using PD3, PD4 it seems to work.
      I'll test a bit and see whether I can get it confirmed.
      Thanks

      posted in Troubleshooting
      Bens
      Bens
    • RE: What are the pin numbers for D3, D4, ...

      Hi Hek, Many thanks for the schematic,

      Nevertheless, I struggle a bit.
      I (serial) printed the values of A0..A3 and they are 14..17.
      On the schematic I see A0..A3 and for each one, I see two numbers: pcint8 and 23 for A0, pcint9 and 24 for A1 etc, but I don't see anywhere 14..17 in relationship to A0..A3. Or is there something simple like add 6 to the pcint value or subtract 9 from the other one.
      Help is appreciated!

      posted in Troubleshooting
      Bens
      Bens
    • What are the pin numbers for D3, D4, ...

      Hi All,

      I bought a couple of Sensebender Micro's and got them working with a Raspberry Pi 2 as a gateway and controller.
      I want to use the digital outputs of the Sensebender Micro's but don't know the pin numbers of D3-D7, nor am I able to find them.
      Simply using D3, and so on, in my scripts fails (although using A0 works).
      Please help.

      posted in Troubleshooting
      Bens
      Bens