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


  • Plugin Developer

    I want to give workshops with MySensors in which I want to make connecting things as simple as possible. That's why I bought this "Raspi Wireless Shield v1.0" from Aliexpress:

    alt text

    https://www.aliexpress.com/item/Wireless-Rapspberry-Pie-Rpi-Shield-Board-For-Raspberry-Pi-Support-Zigbee-Xbee-NRF24L01-NRF24L01-RFM12B-D/32858434375.html

    The short version
    I traced the pins to their origin, as they are not perfectly connected to the same pins MySensors normally uses.

    NRF24 -> PI GPIO -> PI PIN

    IRQ = ?? unconnected?
    MO = io10 = 19 (normal)
    CSN = io8 = 24 (normal)
    VCC = 3.3v (normal)

    MI = io9 = 21 (normal)
    SCK = io11 = 23 (normal)
    CE = io18 = 12 (different!)
    GND = GND (normal)

    The board also supports plugging in the RFM12B 433Mhz transceiver. That thing is another story for another thread.

    More details
    It's a mysterious shield: and learning more about it took some detective work. The shield itself has some markings: a nice metalic "GEEKROOM" logo (found nothing on that..), and an almost invisible "ukonline2000" logo as well. That last name is from ukonline2000.com which seems to be a Chinese website with Raspberry Pi news. The earliest mention of the board I found was this one.

    There are a lot of pictures on SmartDuino. There's also an Instructables page that only adds to the confusion because they plugged in the board the wrong way in the first picture.

    It also seems to be called the "wireless picobber", including on Amazon.


  • Plugin Developer

    In order to use this board you only need to add this parameter to the configure command:
    --my-rf24-ce-pin=12

    The board also has a built-in multicolor LED. I'll see what happens when I use this:
    --my-leds-rx-pin=32 or --my-leds-rx-pin=15
    Probably nothing, since it should in theory be driven via PWM af 50hz.


  • Mod

    @alowhum you could use MY_INDICATION_HANDLER to pwm the leds if you want to.


  • Plugin Developer

    @mfalkvidd Sounds interesting! Could you explain that a bit more? The page you link to doesn't offer any details on what it is.


  • Mod



  • 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.



  • 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.



  • Hello

    Not sure if this will be helpfull, I have a module/breakout board that looks exactly the one above, but both the CE and CSN pins are different.

    CE (3) my board = gpio21 = pin 13
    should be = gpio17 = pin 11
    CSN(4) my board = gpio18 = pin 12
    should be = gpio8 = pin 24

    So I found info from the following link: link text

    So it seem the raspberry pi SPIDEV0 by default has 2 CSN pins configured ( 7 and 8 ) and the SPI driver in the kernel uses GPIOS toggled by software, rather than hardware. So, this means that any GPIO can be used for CSN, and it can support more then two.

    Also based on the link all of the setup for the SPI driver is defined in the device tree, and we can use device tree overlays stored in /boot to dynamically configure the device tree.

    The following is my example spi-cs-extend.dts file to create SPIDEV with CSN pins, on GPIO 8, 7, 18. (18 is the GPIO for my RF24 breakout board)

    To compile it to a binary I used the following command:

    dtc -@ -I dts -O dtb -o spi-cs-extend.dtbo spi-cs-extend.dts

    Then I placeed the new spi-cs-extend.dtbo into /boot/overlays/ and added the following line to the /boot/config.txt file.

    dtoverlay=spi-cs-extend.

    After rebooting, I had a /dev/spidev0.2 which now allows me to communicate with the RF24L01 breakout board.

    my spi-cs-extend.dts file
    /dts-v1/;
    /plugin/;
    
    
    / {
            compatible = "brcm,bcm2835";
    
            fragment@0 {
                    target = <&spi0_cs_pins>;
                    frag0: __overlay__ {
                            brcm,pins = <8 7 18>;
                    };
            };
    
            fragment@1 {
                    target = <&spi0>;
                    frag1: __overlay__ {
                            #address-cells = <1>;
                            #size-cells = <0>;
    
                            cs-gpios = <&gpio 8 1>, <&gpio 7 1>, <&gpio 18 1>;
                            status = "okay";
    
                            spidev0_2: spidev@2 {
                                    compatible = "spidev";
                                    reg = <2>;
                                    #address-cells = <1>;
                                    #size-cells = <0>;
                                    spi-max-frequency = <125000000>;
                            };
    
                    };
            };
    };
    


  • UPDATE: if at one point you need to use GPIO18 for something other then RF24L01 then you have to delete the spi-cs-extend.dtbo file from the /boot/overlays/ and then reboot.


Log in to reply
 

Suggested Topics

  • 87
  • 3
  • 2
  • 1
  • 7
  • 10

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts