Domoticz as controller **and** a gateway for MySensor nodes running on a Raspberry Pi 2
-
Cracked it! I'm using an RPi 2, and cat /proc/cpuinfo gives a01041 as hardware version. According to GitHub readme, CE needs to go to pin 15, not 22.
Now working with radio connected directly, but will now need to connect a jumper wire from the adaptor board.
-
Strange, I'm also working on the RPi 2. I will check what I have in my RF24 library, because I'm sure that you can change pin assignment in software instead of needing to resort to extra jumper wire.
When home I will check this tonight. I really need to write out a procedure for this, or we will forget in the future how it should be set up. -
Hello @GertSanders, for the time being I've got the gateway working with CE connected to pin 15, having carried out some 'surgery' to the board!
I've found this code in PiGatewaySerial.cpp (line 198 onwards):
/* create MySensors Gateway object */
#ifdef __PI_BPLUS
gw = new MyGateway(RPI_BPLUS_GPIO_J8_15, RPI_BPLUS_GPIO_J8_24, BCM2835_SPI_SPEED_8MHZ, 1);
#else
gw = new MyGateway(RPI_V2_GPIO_P1_22, BCM2835_SPI_CS0, BCM2835_SPI_SPEED_8MHZ, 1);
#endifIs this the 'offending' code?
-
Yes, as the rpi2 is not recognised properly the code compiles for rpib+.
I changed the code so that both rpi b+ as rpi2 have the same: use pin 22
-
@MikeF said:
gw = new MyGateway(RPI_V2_GPIO_P1_22, BCM2835_SPI_CS0, BCM2835_SPI_SPEED_8MHZ, 1);
You will need the code as here above, then no need for surgery
-
Had some time to log into my Raspberry 2 today, and indeed I adapted the code I used for the PiGatewaySerial because a RPI2 is not recognised properly.
So here is what I used as source-file:

I'm not sure where the correction should be made so that the RPI2 is recognised properly (instead of being recognised a s a raspi B+)
-
I will need to document this. In the original post I followed to compile the gateway for rpi, this was also mentioned.
I would prefer that the code is corrected in the right place, because I feel the RPI2 should be recognised properly.
Anyway, happy to know there is a +1 user with a raspberry 2 and direct connected NRF24. -
That's the code change I made (makes the 'if' redundant).
I've also changed the tty name (to /dev/ttyUSB40 - which is what I've declared to Domoticz) in this file and in Makefile.
BTW: Very impressed with OSH Park - got the PCBs here in UK (from US) 13 days after ordering!
-
This was the fourth board I ordered from OSHPark. For boards with ENIG finish, they are cheap. And the quality is indeed excellent. I have ordered a fifth design from them (should be ready end next week) and at the same time I sent my files to DirtyPCB. We will see what that gives quality wise. On this forum someone mentioned Shenzen2u and they are eaven cheaper then DirtyPCB. So my next design will also be ordered from those guys.
Now it's time to enjoy a local brew :-) -
@GertSanders Check out http://pcbshopper.com/, there are places slightly cheaper than DirtyPCB and places that will do runs of 5 boards instead of 10 for the same price per board. http://www.elecrow.com/ looks really good (5 boards for $15 delivered) but I haven't ordered from them yet so I can't comment on quality (other reviews of them say it's fine though).
-
I would rather pay 8.90 USD for 10 boards, then 15 USD for 5 boards delivered. http://www.shenzhen2u.com does the thing for me.
-
@GertSanders Did you have a shopping part list available? I've ordered your board at OSHPark and I've got the Caps in stock but not the blue thingy and the dupont blocks.
Could you put me in the right directorion where to shop those two parts? -
Nevermind the dupont blocks. I've found those!
-
@Sander-Stolk The blue thingy is a ceramic 100nF capacitor, the two others are electrolytic capacitors of 100uF and 10uF respectively.
-
Thanks alot!
-
@Fat-Fly said:
What i select from drop down menu? Mysensors gateway USB ?
yes, follow these instructions:
-
Is there any pros/cons for using the nrf directly on the RPi instead of a NodeMCU?
Right now i use NodeMCU (esp) with nrf radio as gateway, but i want to reduce the nuber of units around my house so connecting directly to the RPi would be better as long as there is no negative sides to it.