Author Topic: wireless / nRF24L01  (Read 26639 times)

Telek

  • Newbie
  • *
  • Posts: 1
wireless / nRF24L01
« on: September 03, 2012, 07:13:12 am »
Would the nRF24L01 module be able to work with Digistump?  It's $2 shipped, so incredibly cheap (a lot cheaper than the other module from what I can tell).  The nRF24L01 is a really popular and common radio module, but does Digistump have enough flash/ram to drive this effectively?  The routines look fairly small.

I'm considering using Digistumps for a remote sensor project since transmitting data over longer distances is far more reliable than transmitting analog sensor signals.  These $2 radio modules seem ideal for the task.

Thanks in advance!
« Last Edit: September 03, 2012, 07:13:12 am by Telek »

yellowfeather

  • Newbie
  • *
  • Posts: 1
wireless / nRF24L01
« Reply #1 on: September 04, 2012, 05:26:32 pm »
I too would be interested in an nRF24l01 shield with a PCB or ceramic antenna, would make a great wireless sensor node.

robb

  • Newbie
  • *
  • Posts: 5
wireless / nRF24L01
« Reply #2 on: September 07, 2012, 08:04:33 pm »
I\'m sure there will be enough flash and ram to run the code. One problem I do see though is IO pins. The nRF24L01 uses 4 IO pins which only leaves 2 IO pins for sensors. If you\'re only reading one or two sensor then this would work fine.

fraguada

  • Newbie
  • *
  • Posts: 17
wireless / nRF24L01
« Reply #3 on: September 12, 2012, 05:25:56 am »
@robb, this could be solved with a port expander perhaps?

Airith

  • Newbie
  • *
  • Posts: 4
wireless / nRF24L01
« Reply #4 on: September 21, 2012, 01:05:01 pm »
Where are you finding these cheap nRF24L01 module @Telek?

And yes fraguada, a port expander would solve that.

myfrog

  • Newbie
  • *
  • Posts: 4
wireless / nRF24L01
« Reply #5 on: January 10, 2013, 10:40:25 am »
I have a few, will try and have a play this weekend...

Lami

  • Newbie
  • *
  • Posts: 13
Re: wireless / nRF24L01
« Reply #6 on: January 22, 2013, 09:39:55 am »
I managed to do some tests with standalone attiny44 (Digispark's bigger brother with more pins), so it should be possible. I did not test real communication yet, but managed it to respond to initialization commands. I am using hacked Mirf library. It uses [Arduino's] hadware SPI library, which is unsupported on attiny44 or Digispark. I hacked sofware SPI which plugs well [enough] into Mirf library and made it talk with attiny. It would be possible to hack TinyWire (USI) library into the Mirf same way. I used software because I was debuging it on Arduino, which has serial console for debugging, but lacks USI hardware.

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: wireless / nRF24L01
« Reply #7 on: January 22, 2013, 12:27:29 pm »
I just got a few of these and will start playing with them as soon as shipping is over - Lami, that info should be a great start - thanks

Lami

  • Newbie
  • *
  • Posts: 13
Re: wireless / nRF24L01
« Reply #8 on: January 23, 2013, 02:56:58 pm »

If it would be of any help, here are my changes to the Mirf library and code it uses them. It is still hacked together, but should work. You can change pins it uses for communication with nRF23L01 and it flashes a LED to notify about progress (for testing without serial console). You need to comment out some bits to make it work on attiny (especially Serial stuff). My Digispark did not arrived yet, so I can't test it myslef (not sure if Serial works over USB on Digispark).

http://dl.dropbox.com/u/2198738/MirfAttiny.zip

raphG

  • Newbie
  • *
  • Posts: 3
Re: wireless / nRF24L01
« Reply #9 on: February 13, 2013, 04:50:40 pm »
Is there any progress on that ? Also, how would that work as the nRG24L01 needs a 3.3V input ?
Thanks

Lami

  • Newbie
  • *
  • Posts: 13
Re: wireless / nRF24L01
« Reply #10 on: April 01, 2013, 09:40:38 am »
Ok, got it kind of working. I managed to send some data which were received by Arduino running Mirf's server example. Although for some reason, library reported it is still sending data - and it probably did. And when specs say not to transmit for longer than 4ms, they really mean it. Luckily enough I have 3 more nRF24L01 modules.

I will give it a rest for at least a week, I fried enough stuff today and I am tired battling Arduino compile process (embeddedXcode helps a bit).

Is there any progress on that ? Also, how would that work as the nRG24L01 needs a 3.3V input ?
I/Os are 5V tolerant, you need just 3.3V power for the module. I connect I/O pins directly and take power from external 3.3V source.

kehribar

  • Newbie
  • *
  • Posts: 18
Re: wireless / nRF24L01
« Reply #11 on: April 08, 2013, 02:24:36 am »
Hi All,

I recently finished my nrf24l01+ library. It is designed to be a very easy to use and very easy to port.

It uses software SPI and requires you to define couple of digital input / output functions or macros.

The library isn't directly suitable to be used in Arduino IDE but it is easiliy portable.

Let me know if you test it on your digisparks. I made the test run on my Attiny84 boards and I haven't encountered any problems so far.

You can grab the library from here: https://github.com/kehribar/nrf24L01_plus

Best,
ihsan.

sbright33

  • Newbie
  • *
  • Posts: 7
Re: wireless / nRF24L01
« Reply #12 on: May 12, 2013, 07:30:51 am »
Anyone get this to work with Arduino IDE?

kehribar

  • Newbie
  • *
  • Posts: 18
Re: wireless / nRF24L01
« Reply #13 on: May 14, 2013, 02:27:18 am »
Hi,

If you are talking about my library, i can show you a way around to use it inside the Arduino.

Basically,

You'll copy the nrf24.c, nrf24.h and nRF24L01.h files inisde your sketch folder.

You'll declare the library by


Code: [Select]
#include <nrf24.h>


Finally, inside your sketch you have to define couple of hardware spesific functions. You can find the example in here: https://github.com/kehribar/nrf24L01_plus/blob/master/rx_example/radioPinFunctions.c You don't need to create additional file, you can define those functions inside your sketch.

Let me know if it is helpful.
ihsan.

PhragMunkee

  • Newbie
  • *
  • Posts: 2
Re: wireless / nRF24L01
« Reply #14 on: June 06, 2013, 11:59:39 am »

I have been trying your (kehribar) library but am stuck.  I've spent a couple of hours trying to research the issue on my own, but have given up.  When I try to compile, the IDE gives me several error messages about DDRA, PORTA, and PINA not being declared.  I have tried using DDRB, DDRC, etc for each of them to no avail.  Here are the exact error messages:


Code: [Select]
DigiSpark_NRF24L01.ino: In function 'void nrf24_setupPins()':
DigiSpark_NRF24L01:24: error: 'DDRA' was not declared in this scope
DigiSpark_NRF24L01.ino: In function 'void nrf24_ce_digitalWrite(uint8_t)':
DigiSpark_NRF24L01:35: error: 'PORTA' was not declared in this scope
DigiSpark_NRF24L01:39: error: 'PORTA' was not declared in this scope
DigiSpark_NRF24L01.ino: In function 'void nrf24_csn_digitalWrite(uint8_t)':
DigiSpark_NRF24L01:47: error: 'PORTA' was not declared in this scope
DigiSpark_NRF24L01:51: error: 'PORTA' was not declared in this scope
DigiSpark_NRF24L01.ino: In function 'void nrf24_sck_digitalWrite(uint8_t)':
DigiSpark_NRF24L01:59: error: 'PORTA' was not declared in this scope
DigiSpark_NRF24L01:63: error: 'PORTA' was not declared in this scope
DigiSpark_NRF24L01.ino: In function 'void nrf24_mosi_digitalWrite(uint8_t)':
DigiSpark_NRF24L01:71: error: 'PORTA' was not declared in this scope
DigiSpark_NRF24L01:75: error: 'PORTA' was not declared in this scope
DigiSpark_NRF24L01.ino: In function 'uint8_t nrf24_miso_digitalRead()':
DigiSpark_NRF24L01:81: error: 'PINA' was not declared in this scope