Java wrapper for the nRF24L01 library RF24 using SWIG and JNI.
git clone git@github.com:anvo/rf24-bcm-java.git
cd rf24-bcm-java/
git submodule init
git submodule update
cd cpp/RF24/RPi/RF24/
make
cd ../../../../
make wrapper
See examples/ folder.
java -Djava.library.path=cpp/ -Djava.class.path=bin/ GettingStarted
Simply upload the default RF24 GettingStarted sketch onto your Arduino and start the connection.
For the Raspberry Pi you can download the following compiled binaries:
- nRF24L01 + JNI Wrapper library librf24bcmjava.so
- Java wrapper jar rf24-bcm-java.jar
To run the included GettingStarted example:
java -Djava.library.path=. -jar rf24-bcm-java.jar
You may get the following error:
bcm2835_init: Unable to open /dev/mem: Permission denied
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x42d3077c, pid=27571, tid=1086088304
The nRF24L01 library requires access to /dev/mem
which is by default only possible for root:
sudo java -Djava.library.path=. -jar rf24-bcm-java.jar