The nrf24 daemon is a service which runs on a raspberry pi used to interface with a nrf24l01+ chip, especially the NRF24 board.
The following connection is necessary:
NRF24L01+ | Raspberry PI |
GND | GND |
VCC | 3.3V |
CSN | SPI CE 0 |
CE | GPIO 3 |
IRQ | GPIO 2 |
SCK | SPI SCLK |
MOSI | SPI MOSI |
MISO | SPI MISO |
$ cat /opt/nrf24d/interrupts/1500
#!/bin/sh
# <arg1> = event id
# <arg2> = value
# event = event 0 (in this case turn on/off lamps)
if [ "$1" -eq "0" ]; then
# default case turn off lamps
VAL=0
#if second argument is 0 then turn on lamps
if [ "$2" -eq "0" ]; then
VAL=2
fi
# send commands to lamps
/opt/nrf24d/nrf24ctl 1521 "$VAL" &
/opt/nrf24d/nrf24ctl 1522 "$VAL"
fi
The command nrf24ctl can be used to send commands to the lamps via the ipc server.
It has two different command lines:
/opt/nrf24d/nrf24ctl <id> <value>
Sends a command to the board with the specified id to change its PORTB register to the specified value.
This is equivalent to:
/opt/nrf24d/nrf24ctl <id> 4 716 <value>
/opt/nrf24d/nrf24ctl <id> <command> <address> <value>
Sends a command with the specified addres and value to board id.
> Download NRF24 daemon including nrf24ctl