💬 Building a Raspberry Pi Gateway


  • Mod

    @barrydou I don't know what dio0 is either, but https://learn.sparkfun.com/tutorials/rfm69hcw-hookup-guide/all describes it like this:

    Digital I/O 0
    RX interrupt Received data ready interrupt signal from RFM69HCW to microcontroller

    which sounds like it could be interrupt. It might be worth a try at least.



  • @mfalkvidd Thank you.
    I've found that too https://www.mysensors.org/apidocs/RFM69_8h_source.html
    It's clearly indicated that DIO0 is IRQ.

    So I think with "--my-rfm69-irq-pin=" it will do the job.

    I'll test it as soon as i'll receive RFM69.

    Thank you again



  • @marceloaqno Sorry to kick this old topic, but I will soon be trying to build my gateway with a Raspberry pi. I was wondering if the capacitor is also required for the gateway, or just for the nodes?

    Because at the instruction page on how to wire and build a Raspberry Pi gateway, the capacitor isn't mentioned.

    I'll be using a RPI 1 and NRF24L01+


  • Mod

    @rolandow yes the capacitor is needed. I'll add that info to the page. Thanks for noticing.



  • Ok, one more question. I thought I read somewhere that the wiring between the RPI and de radio should be as short as possible, but I can't find exactly where I read that anymore.

    At another project (zigbee2mqtt) I read that users had better reception when they placed the transceiver further away from the controller, because there was less inteference. So if possible, I would like to use a piece of UTP cable to wire the radio to the raspberry pi. That way I can put the rpi inside a closet, but the radio outside.

    So I am not sure if longer wires (say 2, 3 meters) is going to be a problem?


  • Mod

    @rolandow there could be a problem.

    There are two things to consider.

    1. Power drop due to resistance in the cable. See https://electronics.stackexchange.com/questions/113253/voltage-drop-and-safe-current-load-on-cat5-cable for details but use the current used by the radio (provided in the datasheet) instead of the 2.5A used in that question.

    2. SPI communication problems due to capacitance in the cable. See https://electronics.stackexchange.com/questions/163468/spi-max-distance for details. See also my post at https://forum.mysensors.org/post/92967 for oscilloscope pictures of what an i2c signal can look like through a long cable. SPI can handle longer cable lengts than i2c though.



    1. For me, my electronics is not as good as my development skills ;-). But I gave it a try. According to the datasheet the NRF24 will consume about 14 mA max. My cable is 2 m max, so then the resistance is 0,16ohms. So if I understand correctly the voltage drop would be 0,00224 volt. Sounds neglegtable to me? Also; can't I just measure the voltage at the end of the cable once it's connected to the RPI?

    2. At the stackoverflow page somebody says: "In an answer on a Microchip forum, Jan Axelson, author of 'Serial Port Complete', claims a maximum cable length of 10' for the SPI bus. Other posts have mentioned the same figure.". So 10" is about 3 metres, so I am within that range. I do understand though that this isn't a preferred thing to do.

    Which makes me wonder how other people handle this. I mean; I think ideally you'd want the radio that is connected to the controller in the most 'center' way of the home, right? So do people just hange the Pi and the whole shebang to the ceiling? 😉 I'd rather put the controller in the closet where my modem and router are, and then only wire the receiver to outside the closet. Isn't there a better way to do this?


  • Mod

    Nice work @rolandow
    You can measure the voltage drop, if you put a load of 14mA on the cable. But without load, there will be no voltage drop.

    One small adjustment on your calculation: there will be 4m cable (2m to the radio and 2m back). But the drop will still be negligable for a normal nrf24.



  • Please edit the image used in this tutorial:
    alt text
    It is wrong and misleading, as it says that pin36 is SPI1 CS0. In fact SPI1 CS0 by default is pin12. To be able to use pin36 as SPI1 CS0 one have to follow implicit steps which can be found on this forum thread: https://www.raspberrypi.org/forums/viewtopic.php?t=203776.
    Also it would be useful to add instructions to enable SPI1 in /boot/config.txt to the tutorial.


 

Suggested Topics

347
Online

8.4k
Users

9.2k
Topics

97.3k
Posts