Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
B

Bens

@Bens
About
Posts
7
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • PiGatewaySerial using interrupts
    B Bens

    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. :smiley: 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

    Development raspberry pi 2 pimatic interrupts serial gateway

  • Scetch doesn't want to load into Sensebender Micro
    B Bens

    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?

    Troubleshooting uploading scetc sensebender

  • RPi as a 'node'?
    B Bens

    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.

    General Discussion

  • What are the pin numbers for D3, D4, ...
    B Bens

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

    Troubleshooting digitalwrite digital io pin numbers

  • What are the pin numbers for D3, D4, ...
    B Bens

    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

    Troubleshooting digitalwrite digital io pin numbers

  • What are the pin numbers for D3, D4, ...
    B Bens

    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!

    Troubleshooting digitalwrite digital io pin numbers

  • What are the pin numbers for D3, D4, ...
    B Bens

    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.

    Troubleshooting digitalwrite digital io pin numbers
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular