Jump to content


Photo

RF24 library for wireless comunication


  • Please log in to reply
24 replies to this topic

#1 jim

jim

    Advanced Member

  • Administrators
  • 3,385 posts

Posted 13 February 2015 - 08:13 AM

Hello

Anyone where able to work with https://github.com/maniacbug/RF24 ? I's a lib for a low cost device for wireless comunication
There are ports for Raspberry Pi like this one    https://github.com/s...eyseow/RF24.git

Thanks



#2 jim

jim

    Advanced Member

  • Administrators
  • 3,385 posts

Posted 13 February 2015 - 08:13 AM

Hi!

I'm using RF24 library for my own home automation project, and fater look at RF24 code it seems to use standard SPI interface. I've not yet tested, but have you tried to compile it?

RSPI don't use Arduino'ish headers, so RF24 has been ported to it...but for pcudion it should be easier...at least, I hope... :-)

Keep my in touch, I'll do the same.
Alex.



#3 jim

jim

    Advanced Member

  • Administrators
  • 3,385 posts

Posted 13 February 2015 - 08:13 AM

Hello,

It seems like I am also dealing with the same problem, I implemented arduino and raspberry pi with RF24 library (https://github.com/s...eyseow/RF24.git) but I could not manage to make it work in PCDuino, any progress could you make on this topic?

Thanks.



#4 jim

jim

    Advanced Member

  • Administrators
  • 3,385 posts

Posted 13 February 2015 - 08:13 AM

We will write up a tutorial.


  • japBoi likes this

#5 jim

jim

    Advanced Member

  • Administrators
  • 3,385 posts

Posted 13 February 2015 - 08:13 AM

Hey all!

I've tried to port RF24 and RF24Network libraries from maniacbug but without any success. I still got bad configuration data like:


"STATUS           = 0x07 RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=3 TX_FULL=1
RX_ADDR_P0-1     = 0x0404040404 0x0404040404
RX_ADDR_P2-5     = 0x07 0x07 0x07 0x07
TX_ADDR          = 0x0404040404
RX_PW_P0-6       = 0x07 0x07 0x07 0x07 0x07 0x07
EN_AA            = 0x07
EN_RXADDR        = 0x07
RF_CH            = 0x07
RF_SETUP         = 0x07
CONFIG           = 0x07
DYNPD/FEATURE    = 0x07 0x07
Data Rate        = 1MBPS
Model            = nRF24L01
CRC Length       = Disabled
PA Power         = PA_HIGH"

I hope to see a tutorial soon  on how to have a working version for pcduino smiley.gif



#6 jim

jim

    Advanced Member

  • Administrators
  • 3,385 posts

Posted 13 February 2015 - 08:13 AM

Is this SPI interface?



#7 jim

jim

    Advanced Member

  • Administrators
  • 3,385 posts

Posted 13 February 2015 - 08:14 AM

Is this SPI interface?
 

Hey Jim!

Yes it uses SPI interface, but I can't use SPI library provided with c_environnement. It needs little changes, but without any success...I've not yet tried software SPI interface.

Source code I use:
https://github.com/maniacbug/RF24/

There's a RPI port:
https://github.com/s...f24-rpi/librf24

But without any success too...

Thanks for you quick answer,
Alex.



#8 jim

jim

    Advanced Member

  • Administrators
  • 3,385 posts

Posted 13 February 2015 - 08:14 AM

Please refer to http://learn.linkspr...01-for-pcduino/



#9 jim

jim

    Advanced Member

  • Administrators
  • 3,385 posts

Posted 13 February 2015 - 08:14 AM

Wow thanks you very much for your tutorial! I'll try now to port your great works into maniacbug's libraries(rf24 and rf24network)...  cheesy.gif

I think i'll be ready to remove Arduino from my pcduino board!

Keep up the good work!
Alex.



#10 jim

jim

    Advanced Member

  • Administrators
  • 3,385 posts

Posted 13 February 2015 - 08:18 AM

Ok, with the help of your tutorial I've successfully ported RF24 and RF24Network from maniacbug to pcduino! all works perfectly now:

Output from gettingStarted shipped with RF24:

"RF24/examples/GettingStarted v0.1
STATUS           = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1     = 0xf0f0f0f03c 0xf0f0f0f05a
RX_ADDR_P2-5     = 0x69 0x96 0xa5 0xc3
TX_ADDR          = 0xf0f0f0b43c
RX_PW_P0-6       = 0x20 0x20 0x20 0x20 0x20 0x20
EN_AA            = 0x3f
EN_RXADDR        = 0x3f
RF_CH            = 0x4c
RF_SETUP         = 0x07
CONFIG           = 0x0f
DYNPD/FEATURE    = 0x00 0x00
Data Rate        = 1MBPS
Model            = nRF24L01+
CRC Length       = 16 bits
PA Power         = PA_HIGH
Ok! done!"

In attachments you'll found ugly(but working) hack to use them!

Thanks to jim!
Alex.

Attached Files


  • maurohkt likes this

#11 jim

jim

    Advanced Member

  • Administrators
  • 3,385 posts

Posted 13 February 2015 - 08:19 AM

Thanks for sharing your work! smiley.gif



#12 jim

jim

    Advanced Member

  • Administrators
  • 3,385 posts

Posted 13 February 2015 - 08:20 AM

i try those library but i have a trouble i got this 

STATUS       = 0x00 RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=0 TX_FULL=0
RX_ADDR_P0-1    = 0x0000000000 0x0000000000
RX_ADDR_P2-5    = 0x00 0x00 0x00 0x00
TX_ADDR       = 0x0000000000
RX_PW_P0-6    = 0x00 0x00 0x00 0x00 0x00 0x00
EN_AA       = 0x00
EN_RXADDR    = 0x00
RF_CH       = 0x00
RF_SETUP    = 0x00
CONFIG       = 0x00
DYNPD/FEATURE    = 0x00 0x00
Data Rate    = 1MBPS
Model       = nRF24L01
CRC Length    = Disabled
PA Power    = PA_MIN

i have made some arduino shield only with nrf24l01 on it, it work on arduino uno but on pcduino if fail i don't know why can someone help me ?



#13 jim

jim

    Advanced Member

  • Administrators
  • 3,385 posts

Posted 13 February 2015 - 08:20 AM

Hey!

What library do you use, my modified rf24 lib? if you, then what pins do you use to connect your shield?



#14 jim

jim

    Advanced Member

  • Administrators
  • 3,385 posts

Posted 13 February 2015 - 08:20 AM

i'm connect like this

Name     arduino           radio
GND            GND                1    
3V3            3V3                2    
CE            9                3    
CSN           10                4    
SCK           13                5    
MOSI       11                6    
MISO       12                7    

and i use helloworld_rx_exemple sketch



#15 jim

jim

    Advanced Member

  • Administrators
  • 3,385 posts

Posted 13 February 2015 - 08:20 AM

i find it on library nrf24l01.h at the end you got sck on pin 10 but in my case it pin 13, i change that and i work. 

Thank you for your help and for those library


  • juanitolol likes this

#16 jim

jim

    Advanced Member

  • Administrators
  • 3,385 posts

Posted 13 February 2015 - 08:20 AM

Alex,
I am wondering why did you have to modify the library? if Hardware SPI is being used and if PcDuino is compatible with Arduino shields and core libraries are provided with the necessary changes.

Just trying to understand what to expect when utilizing the board. Thanks
Fadi



#17 jim

jim

    Advanced Member

  • Administrators
  • 3,385 posts

Posted 13 February 2015 - 08:20 AM

Hi Fadi!

I've tried HardwareSPI pcduino(v1) thing but without any success, so I've used some code of SoftwareSPI(ported from jim) to fix usage of RF24 lib for pcduino.

I don't really know why pcduino HardwareSPI lib don't works, but dmesg buffer seems to be flooded with many complaint about SPI device that block correct usage of it. Maybe we can try to remove debug things from spi module on pcduino v1(fdon't know for pcduino v2...) 

I'm using pcduino3 now, and I've tried to use RF24 directly with spi device...It's on my TODO list, but my TODO list is very very big...and my time very very limited...  angry.gif

Many arduino libraries needs adaptation(specially code using interrupt, register, atmega things...) to works with pcduino..don't expect plug&play at 100% but in 'normal' case you can use them without any problem. Pcduino3 seems to have better module(gpio,spi...) support that ease import of arduino libs.

Greets,
Alex.



#18 jim

jim

    Advanced Member

  • Administrators
  • 3,385 posts

Posted 13 February 2015 - 08:21 AM

Thank you Alex for the quick reply.

Understood. I have pcDuino v2, so let's hope that I have better luck with it.
I thought it is 100% compatible without issues, seems that they still need to
do more work.

As long as the product is not dying and is being actively worked on that is good.
(in hopes that we are not forced to buy new boards just to get the functionality promised in the older ones!)

FK



#19 jim

jim

    Advanced Member

  • Administrators
  • 3,385 posts

Posted 13 February 2015 - 08:21 AM

ood luck working on those cheesy.gif.
the obstacle is hardwarelib is closed source tongue.gif
I prefer on arduino on interfacing to  sensors and I/O. fast and simple where many open source libs around the net.

I am using RF24 on my arduino project, very solid. 
how I connect to devices including arduino, pcduino, and others? pretty simple -> IoT that I use MQTT opensource implementations. No messy coding and configuration.

once again good luck on your project

we need AllWinner to open hardwarelib or partially gives us API, in addition they release fixes in blob( if they want to open partially)..

my pcduino3 serves me as a low power headless ubuntu server(MQTT Broker, Apache, mysql, zone minder,and on going).
Since I connects my pcduino3 to Wild Wild World of internet. all fixes/patches are done by updating  ubuntu. No Heartbleed, and No Bash exploit. Ubuntu is very fast on delivering fixes. I am using 14.04LTS
One thing to be done is to use GPIO for switches and LED since headless. 
Other  thought, connect my all serial 4X20 LCD display or buy a new USB model. USB Model basically is USB-serialport .



#20 jim

jim

    Advanced Member

  • Administrators
  • 3,385 posts

Posted 13 February 2015 - 08:21 AM

Hey superbima and Fadi!

Faid, I only bought pcduino3 for better perfs and additions(audio jack output, csi camera, battery support). I don't think(or at least I hope!) linksprite force users to buy new things just to have better support...but future time say us the truth...but yes, you've right stille needs more works to be really simple for many people...

superbima has right, hardwarelib and AllWinner attitude are very very bad things!  angry.gif when I'm speaking about pcduino3 support I'm speaking about using more recent kernel(3.4.79 vs 3.4.29+)...but hardwarelib is closed on both platform!

RF24 modified source code works perfectly, so for using RF24 networks driven with pcduino(ie:without using Arduino) no problem if using HardwareSPI or not...speed is the same, no difference at all...but in a more 'generic' way, using one or one Arduino library is more problematic since you must port them to pcduino(when they require specific things..as I said in my previous message).

In my current project, I'm driving nrf24l01 from arduino linked to pcduino with serial link. I'd like to use nrf24l01 directly from pcduino3...to save some arduino pins(and to prove me I can do it!  grin.gif) but my main problem is to port RF24 code to C(C++ to C is hard to implement).

Greets,
Alex.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users