Giter Site home page Giter Site logo

pwhelan / gorf24 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from galaktor/gorf24

0.0 0.0 0.0 3.7 MB

Golang bindings for RF24 (Raspberry Pi) libraries, which can be used to control a Nordic nRF24L01 type radio transceiver on the Raspberry Pi.

License: MIT License

Go 36.36% C++ 34.59% Shell 8.92% C 20.13%

gorf24's Introduction

***************************
      HOW TO INSTALL
***************************
TODO! More detail (on the way)

The gist of it:

1) install and set up basic developer tools, git as well as golang on your RPi
   e.g. on Arch ARM:
   $> sudo pacman -S base-devel git go
   
   be sure to export GOPATH and add $GOPATH/bin to your PATH; e.g.
     $> mkdir ~/mygo
     $> echo "export GOPATH=~/mygo" >> ~/.bashrc
     $> echo "export PATH=$PATH:$GOPATH/bin" >> ~/.bashrc
   
   log off and on again for GOPATH changes to take effect
   
2) fetch gorf24 using 
   $> go get github.com/galaktor/gorf24 (you will get an "ld" type error; ignore!)
3) $> cd $GOPATH/src/github.com/galaktor/gorf24
4) $> chmod +x build.sh
5) $> sudo ./build.sh
6) you might have to add /usr/local/lib to your /etc/ld.so.conf file (see below)
7) include gorf24 in your golang source code as usual, i.e. 'import "github.com/galaktor/gorf24"'
8) Accessing GPIO on Rpi requies elevated permissions, so it makes sense to build normally ("go build")
   then run the executable as sudo, i.e.
   $> go build mycode.go
   $> sudo ./mycode
   If you do not use sudo, you will get segfaults and panics

(Tested on an overclocked (900 MHz) Model A RPi running Arch Linux for Rpi/ARM.)

Note that this is project is in progress, and the golang or ansi C wrapper haven't been fully tested yet.
Basic send/receive testing has occured, but many functions might have bugs.
Please log any issue you might find and I will try to address it when I get a chance!
Or even better, fork and contribute, that would be much appreciated.

***************************
ADD /USR/LOCAL/LIB LDCONFIG
***************************

On Arch ARM for RPi, /usr/local/lib had to be added to ld.so.conf in order for golang to find the librf24*.so files at runtime.
you can check if the librf shared objects are detected by running:

$> ldconfig -v | grep librf

If the result is empty, then you need to add /usr/local/lib to /etc/ld.so.conf so that the golang runtime will detect the librf libraries.
NOTE: despite the "include ld.so.conf.d/*.conf" line in /etc/ld.so.conf, adding such a file had no effect. Needed to add directly to
ld.so.conf!

### 1. Open /etc/ld.so.conf with a text editor:
$> sudo nano /etc/ld.so.conf

### 2. Add the line "/usr/local/lib" and save (in nano, "Ctrl+X", "Y" then "Return")

### 3. Run ldconfig to update
$> sudo ldconfig

### 4. Verify detection of librf* shared objects using ldconfig
$> ldconfig -v | grep rf
   	    librf24.so.1 -> librf24.so.1.0
	    librf24_c.so -> librf24_c.so



***************************
         TODOS
***************************
* Makefiles instead of shell scripts
* maybe better way of installing via go get?
* more testing of correct wrapping, data types etc
* branch that includes verified-working snap of RF24-rpi
* download with RPi binaries for armv6?



***************************
  COPYRIGHT AND LICENSE
***************************

Copyright 2013, Raphael Estrada

gorf24 is licensed under the MIT license.
You should have received a copy of the MIT License along
with gorf24 (file "LICENSE"). If not, see 

<http://opensource.org/licenses/MIT>


**************************
  THE GIANTS' SHOULDERS
**************************

NOTE: gorf24 dynamiclly links to the C++ RF24 library for Raspberry
Pi by Stanley Seow. At the time gorf24 was created, Seow's software
had no apparent license included. The license for gorf24 described
here applies exclusively to the software provided as part of gorf24,
but does not extend to Seow's RF24 software.

https://github.com/stanleyseow/RF24

Seow's work is stronly derived from maniacbug's original RF24 library.
Much kudos to maniacbug for the great work.
https://github.com/maniacbug/RF24
http://maniacbug.wordpress.com/


gorf24's People

Contributors

galaktor avatar pwhelan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.