Problem changing CS and CE pins on RPi gateway



  • Hi,

    I recently set up an OpenSprinkler that's using a Raspberry Pi and thought I could use it for more, then I found MySensors and now I think I have a new hobby 🙂 It's all very impressive.

    I've connected up a nrf24l01 module to the Raspberry Pi and followed the guide, but I found that the rpi would only successfully connect to the nrf24 when I'm using the default CS and CE pins. When I try to change their pins using --my-rf24-ce-pin=33 --my-rf24-cs-pin=37 with the configure script, it didn't appear the change the pins as the rpi would fail to connect to the nrf24 on those pins, but could still connect with the default pins. When the make is running, I can see it launching g++ with -DMY_RF24_CS_PIN=37 -DMY_RF24_CE_PIN=33.

    I also tried directly editing the MyConfig.h file to explicitly define the values, but that failed to work as well.

    The OpenSprinkler RPi PCB board and case makes it harder (but not impossible) to access the back row of pins which is why I was trying to use non-default pins in the first place.

    If I add --extra-cxxflags="-DMY_DEBUG_VERBOSE_RF24" to the configure script, then when I run a test, it includes the output:

    DEBUG RF24:INIT:PIN,CE=33,CS=37
    

    Which suggests that the software knows that's I've specified alternate pins to use.

    I'm using DietPi distribution, btw. It does some things a little different which complicates things.

    Does anyone have any suggestions?

    To be honest, I'm happy enough to just use the default pins at this stage but this might help anyone else that finds themselves in the same situation.

    Cheers,
    Konrad.



  • Welcome to the forums, tinnut!

    @tinnut said in Problem changing CS and CE pins on RPi gateway:

    I found MySensors and now I think I have a new hobby

    (Emphasis mine). This is certainly the right approach, IMO. 😉

    Contrary to popular opinion, I am not such a fan of RPi, but since you already have it, on we go. Even I must admit that it was my first purchase, before I knew any better. 🙂

    @tinnut said in Problem changing CS and CE pins on RPi gateway:

    I found that the rpi would only successfully connect to the nrf24 when I'm using the default CS and CE pins. When I try to change their pins using --my-rf24-ce-pin=33 --my-rf24-cs-pin=37 with the configure script, it didn't appear the change the pins as the rpi would fail to connect to the nrf24 on those pins, but could still connect with the default pins. When the make is running, I can see it launching g++ with -DMY_RF24_CS_PIN=37 -DMY_RF24_CE_PIN=33.
    I also tried directly editing the MyConfig.h file to explicitly define the values, but that failed to work as well.
    The OpenSprinkler RPi PCB board and case makes it harder (but not impossible) to access the back row of pins which is why I was trying to use non-default pins in the first place.
    If I add --extra-cxxflags="-DMY_DEBUG_VERBOSE_RF24" to the configure script, then when I run a test, it includes the output:
    DEBUG RF24:INIT:PIN,CE=33,CS=37

    Which suggests that the software knows that's I've specified alternate pins to use.

    As to particulars of this issue, hopefully one of devs familiar with that part of code (build scripts for RPi?) stops by. Because I am not that person. 😉 Furthermore as mentioned, I eschew RPi (for lots of reasons). You could also help the project out tremendously by lodging an issue over at the GitHub, which is probably more likely to get addressed (sooner or later) than posting here in forums, where possibly it could get overlooked.

    @tinnut said in Problem changing CS and CE pins on RPi gateway:

    I'm using DietPi distribution, btw. It does some things a little different which complicates things.

    As you are just beginning to figure out (perhaps) this is only one aspect of the problems with RPi. I played around with DietPi once a little bit (if that is what I am thinking of), what a mess with all their custom stuff going on. It was very hard to even know what is really going on with it, I finally gave up.



  • @tinnut Set each GPIO you use as a slave select to be an output and set it high

    some info to do it in terminal other then scripts and code

    https://raspberry-projects.com/pi/command-line/io-pins-command-line/io-pin-control-from-the-command-line

    or use a library as WiringOP

    or even better buy a Orange Pi for 10 euro and check your pins of your opensprinkler pcb most likley you only have it to turn around RPi is right to left and a OPI is the io pins from left to right .

    Get Armbian and have mainline kernel and up to date linux distro

    have fun



  • @henk-herck said in Problem changing CS and CE pins on RPi gateway:

    Get Armbian and have mainline kernel and up to date linux distro

    This is main reason I have become such big fan (and proponent) of Armbian ever since finding out about it only a few years ago!

    Very glad to run into a fellow man of taste and distinction! 🍻

    At least you are able to help OP in the meantime with what he has now. I can't even do that any more as I gave up on RPi long time ago.



  • @TRS-80
    Thanks for your reply 🙂

    If I get the energy I might move away from DietPi, but unfortunately I have a lot to do at the moment.



  • @henk-herck - thanks for your reply and suggestions.

    I changed the pins to output and set them as high, but unfortunately it didn't change the outcome. In the end I soldered some wire into the OpenSprinkler's expansion board to help me get to that row of pins which allowed me to work around my issue.

    I'd never really looked at the Orange Pi range before and went a bit down a rabbit hole looking at them yesterday. They're quite interesting and I'll look into them a bit more today.


Log in to reply
 

Suggested Topics

  • 1
  • 5
  • 2
  • 1
  • 6
  • 3

4
Online

11.4k
Users

11.1k
Topics

112.7k
Posts