Hi,
I'm stuck trying to setup my Raspberry Pi 2 with NRF24L01 to the GPIO pins as a Gateway and as a controller (MyController.org). Im trying to use MySensors 2.0 library. I will gladly pay a bit if someone can help with 1-to-1 via Skype or similar to get this working. As Im close to giving up on my own...
Any help is very much appreciated.
Configuration of the gateway on the Raspberry Pi 2
pi@raspberrypi:~/MySensors $ ./configure --my-gateway=serial --my-serial-is-pty --my-serial-pty=/dev/ttyMySensorsGateway --my-radio=nrf24 --my-rf24-channel=0
[SECTION] Detecting target machine.
[OK] machine detected: SoC=BCM2836, Type=Rpi2, CPU=armv7l, REV=a01041.
[OK] init system detected: systemd
[SECTION] Saving configuration.
[SECTION] Cleaning previous builds.
[OK] Finished.
Make command on the Raspberry Pi 2 via Terminal on my Mac.
pi@raspberrypi:~/MySensors $ make
cc -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/log.o drivers/Linux/log.c
g++ -DMY_RADIO_NRF24 -DMY_GATEWAY_SERIAL -DMY_DEBUG -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_RF24_CHANNEL=0 -DMY_LINUX_SERIAL_PTY=\"/dev/ttyMySensorsGateway\" -DMY_IS_SERIAL_PTY -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/noniso.o drivers/Linux/noniso.cpp
g++ -DMY_RADIO_NRF24 -DMY_GATEWAY_SERIAL -DMY_DEBUG -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_RF24_CHANNEL=0 -DMY_LINUX_SERIAL_PTY=\"/dev/ttyMySensorsGateway\" -DMY_IS_SERIAL_PTY -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/Print.o drivers/Linux/Print.cpp
g++ -DMY_RADIO_NRF24 -DMY_GATEWAY_SERIAL -DMY_DEBUG -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_RF24_CHANNEL=0 -DMY_LINUX_SERIAL_PTY=\"/dev/ttyMySensorsGateway\" -DMY_IS_SERIAL_PTY -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/EthernetClient.o drivers/Linux/EthernetClient.cpp
g++ -DMY_RADIO_NRF24 -DMY_GATEWAY_SERIAL -DMY_DEBUG -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_RF24_CHANNEL=0 -DMY_LINUX_SERIAL_PTY=\"/dev/ttyMySensorsGateway\" -DMY_IS_SERIAL_PTY -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/SerialPort.o drivers/Linux/SerialPort.cpp
g++ -DMY_RADIO_NRF24 -DMY_GATEWAY_SERIAL -DMY_DEBUG -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_RF24_CHANNEL=0 -DMY_LINUX_SERIAL_PTY=\"/dev/ttyMySensorsGateway\" -DMY_IS_SERIAL_PTY -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/Stream.o drivers/Linux/Stream.cpp
g++ -DMY_RADIO_NRF24 -DMY_GATEWAY_SERIAL -DMY_DEBUG -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_RF24_CHANNEL=0 -DMY_LINUX_SERIAL_PTY=\"/dev/ttyMySensorsGateway\" -DMY_IS_SERIAL_PTY -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/IPAddress.o drivers/Linux/IPAddress.cpp
g++ -DMY_RADIO_NRF24 -DMY_GATEWAY_SERIAL -DMY_DEBUG -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_RF24_CHANNEL=0 -DMY_LINUX_SERIAL_PTY=\"/dev/ttyMySensorsGateway\" -DMY_IS_SERIAL_PTY -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/compatibility.o drivers/Linux/compatibility.cpp
g++ -DMY_RADIO_NRF24 -DMY_GATEWAY_SERIAL -DMY_DEBUG -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_RF24_CHANNEL=0 -DMY_LINUX_SERIAL_PTY=\"/dev/ttyMySensorsGateway\" -DMY_IS_SERIAL_PTY -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/SoftEeprom.o drivers/Linux/SoftEeprom.cpp
g++ -DMY_RADIO_NRF24 -DMY_GATEWAY_SERIAL -DMY_DEBUG -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_RF24_CHANNEL=0 -DMY_LINUX_SERIAL_PTY=\"/dev/ttyMySensorsGateway\" -DMY_IS_SERIAL_PTY -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/EthernetServer.o drivers/Linux/EthernetServer.cpp
g++ -DMY_RADIO_NRF24 -DMY_GATEWAY_SERIAL -DMY_DEBUG -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_RF24_CHANNEL=0 -DMY_LINUX_SERIAL_PTY=\"/dev/ttyMySensorsGateway\" -DMY_IS_SERIAL_PTY -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o examples_linux/mysGateway.o examples_linux/mysGateway.cpp
cc -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/RPi/piHiPri.o drivers/RPi/piHiPri.c
cc -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/RPi/bcm2835.o drivers/RPi/bcm2835.c
g++ -DMY_RADIO_NRF24 -DMY_GATEWAY_SERIAL -DMY_DEBUG -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_RF24_CHANNEL=0 -DMY_LINUX_SERIAL_PTY=\"/dev/ttyMySensorsGateway\" -DMY_IS_SERIAL_PTY -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/RPi/rpi_util.o drivers/RPi/rpi_util.cpp
g++ -DMY_RADIO_NRF24 -DMY_GATEWAY_SERIAL -DMY_DEBUG -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_RF24_CHANNEL=0 -DMY_LINUX_SERIAL_PTY=\"/dev/ttyMySensorsGateway\" -DMY_IS_SERIAL_PTY -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/RPi/Wire.o drivers/RPi/Wire.cpp
g++ -DMY_RADIO_NRF24 -DMY_GATEWAY_SERIAL -DMY_DEBUG -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_RF24_CHANNEL=0 -DMY_LINUX_SERIAL_PTY=\"/dev/ttyMySensorsGateway\" -DMY_IS_SERIAL_PTY -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/RPi/SPI.o drivers/RPi/SPI.cpp
g++ -pthread -o examples_linux/mysGateway drivers/Linux/log.o drivers/Linux/noniso.o drivers/Linux/Print.o drivers/Linux/EthernetClient.o drivers/Linux/SerialPort.o drivers/Linux/Stream.o drivers/Linux/IPAddress.o drivers/Linux/compatibility.o drivers/Linux/SoftEeprom.o drivers/Linux/EthernetServer.o examples_linux/mysGateway.o drivers/RPi/piHiPri.o drivers/RPi/bcm2835.o drivers/RPi/rpi_util.o drivers/RPi/Wire.o drivers/RPi/SPI.o
I then ran the mysGateway
pi@raspberrypi:~/MySensors $ sudo ./examples_linux/mysGateway -d
mysGateway: Starting gateway...
mysGateway: Protocol version - 2.0.1-beta
mysGateway: MCO:BGN:INIT GW,CP=RNNG---,VER=2.0.1-beta
mysGateway: TSF:LRT:OK
mysGateway: TSM:INIT
mysGateway: TSM:INIT:TSP OK
mysGateway: TSM:INIT:GW MODE
mysGateway: TSM:READY
mysGateway: MCO:REG:NOT NEEDED
mysGateway: MCO:BGN:STP
mysGateway: MCO:BGN:INIT OK,ID=0,PAR=0,DIS=0,REG=1
mysGateway: TSF:MSG:READ,0-0-0,s=0,c=0,t=0,pt=0,l=0,sg=0:
mysGateway: !TSF:MSG:LEN,0!=7
mysGateway: TSF:MSG:READ,0-0-0,s=0,c=0,t=0,pt=0,l=0,sg=0:
mysGateway: !TSF:MSG:LEN,0!=7
mysGateway: TSF:MSG:READ,0-0-0,s=0,c=0,t=0,pt=0,l=0,sg=0:
mysGateway: !TSF:MSG:LEN,0!=7
--Continues with same code a lot longer - just cut it short here
Then over to the Arduino Uno that is also connect with an NRF24L01
The sketch I'm running on the Arduino
/*
* The MySensors Arduino library handles the wireless radio link and protocol
* between your home built sensors/actuators and HA controller of choice.
* The sensors forms a self healing radio network with optional repeaters. Each
* repeater and gateway builds a routing tables in EEPROM which keeps track of the
* network topology allowing messages to be routed to nodes.
*
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2015 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
*
* Documentation: http://www.mysensors.org
* Support Forum: http://forum.mysensors.org
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
*******************************
*/
#include <stdint.h>
#include <pins_arduino.h>
#define MY_DEBUG
#define MY_DEBUG_VERBOSE_SIGNING
#define MY_RF24_CHANNEL 0
#define MY_RADIO_NRF24
//#define MY_SIGNING_SOFT
#define MY_SIGNING_ATSHA204
#define MY_SIGNING_NODE_WHITELISTING {{.nodeId = GATEWAY_ADDRESS,.serial = {0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01}}}
#define MY_SIGNING_REQUEST_SIGNATURES
#ifndef MY_SIGNING_SOFT_RANDOMSEED_PIN
#define MY_SIGNING_SOFT_RANDOMSEED_PIN 7
#endif
#ifndef MY_SIGNING_ATSHA204_PIN
#define MY_SIGNING_ATSHA204_PIN 17
#endif
#define MY_RF24_ENABLE_ENCRYPTION
#include <SPI.h>
#include <MySensors.h>
However with this sketch I'm recieving an error that I can read on the Serial Monitor on my Mac (output from the Arduino sensor node)
Starting sensor (RNNNAA, 2.0.0)
TSM:INIT
TSM:RADIO:OK
TSP:ASSIGNID:OK (ID=1)
TSM:FPAR
TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
TSM:FPAR
TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
TSM:FPAR
TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
TSM:FPAR
TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
!TSM:FPAR:FAIL
!TSM:FAILURE
I don't understand what is wrong. I do believe all the wires are correct, so I believe it is related to the Arduino sketch, or more likely the gateway setup on the Raspberry Pi.
I hope someone can help. I'll gladly pay someone to give me some 1-to-1 support over Skype or similar.