Show Posts
Pages: [1] 2
1  Using Arduino / Networking, Protocols, and Devices / Re: nRF24L01 with Mirf library terrible packet lost rate on: January 18, 2014, 01:01:08 pm
I think you are right. I will try this next.
2  Using Arduino / Networking, Protocols, and Devices / nRF24L01 with Mirf library terrible packet lost rate on: January 18, 2014, 08:51:11 am
Hello,
I have two Arduino Mega 2560 with nRF24L01. I am using Mirf library but my device "freezes" after few send messages. It is "freezing" on while(Mirf.isSending()){} this loop will never ends. What can be problem here? Mechanical error or software error how to repair it?  

EDIT: I repaired it by reconnection CSN from 46 to 53 pin. But Packet lost ratio is now about 1/10 tested with Mirf ping client and server example. (received 1 message from 10).
Now I have connected like this. Can you tell me what can be cause of this terrible packet lost ration?

53: CSN
52: SCK
51: MOSI
50: MISO
48: CE
IRQ: Not connected
3  Using Arduino / Networking, Protocols, and Devices / Re: nRF24L01 is not working with Arduino MEGA 2560 on: January 16, 2014, 06:14:30 pm
Thanks that is what I missed. Can I join CE and CSN on  47-48 ?
4  Using Arduino / Networking, Protocols, and Devices / nRF24L01 is not working with Arduino MEGA 2560 on: January 16, 2014, 05:47:25 pm
Hello,
I have problem with setting up my Arduinos Mega 2560 with nRF24L01. I have connected SCK -> Pin 13, MISO -> 12, MOSI -> 11 ,  CE -> 10, CSN -> 9, IRQ -> 8. I have used Mirf library where I edit   Mirf.cePin = 10; Mirf.csnPin = 9; It is unable to send message and when I am receiving all messages are (in integer) -1. Can someone tell me where problem can be?
5  Using Arduino / Networking, Protocols, and Devices / nRF24L01 one to many communication on: September 23, 2013, 05:15:22 pm
Hello, I would like to make one to many communication using nRF24L01+Arduino Mega with Mirf library. For example I would have 5 devices and on one device I would like to send message on rest of 4 devices at once. The first thing that came to my mind is to set address on Data_pipe_0 same on all devices and Data_pipe_1 address to be unique. When I would like to use 1:M communication I just need to send message on common address. But I don't know what will happens when I have set same target and receiving address and also what will happened with ACK system how it will respond on multiple ACK response. But right now I don't have enough devices to try it.

Can someone give me some hint how to do it or another approach to solve this problem?

Thanks for any suggestions
6  Using Arduino / Programming Questions / Re: nRF24L01 with MIRF library using ART multiple messages send on: September 08, 2013, 01:33:14 pm
Thaks for your reply i didnt realize this.
7  Using Arduino / Programming Questions / [RESOLVED] nRF24L01 with MIRF library using ART multiple messages send on: September 08, 2013, 12:20:20 pm
Hello,
I am sending messages from one arduino to anther using nRF24L01 and Mirf library. Becouse sometimes messages wasnt delivered i tried to fix it using OBSERVE_TX and infromation from ARC_CNT. I increased ARC to 15. So when i read from register 15 I resend message. But sometimes message is send multiple times. Can someone tell me how to fix it?

Code:
 while(i<101){
    do{
      char a = i;    
      Mirf.setTADDR((byte *)&target);
      Mirf.send((byte *) &a);
      lcd.setCursor(0,1);
      lcd.print(i);
      while(Mirf.isSending()){
      }
      Mirf.readRegister(OBSERVE_TX,&observe_tx,sizeof(observe_tx));
      arc_cnt = observe_tx & 0x0F;
    }
    while(arc_cnt == 15);
    i++;
  }
8  Using Arduino / Programming Questions / nRF24L01 with MIRF Auto Acknowledgement working? on: September 06, 2013, 06:25:27 am
Hello, i would like to ask if there is any Auto Acknowledgement working in Mirf library or i shloud do this by my self? Or is there any other library that works with nRF24L01 and have some kind of ACK?

Thanks Roman
9  Using Arduino / Programming Questions / Re: Error when sending and receiving mesage using Mirf library on: September 06, 2013, 04:29:47 am
Code:
String setAddress(String rec) {
...
while (true) {
 if ( key == 'C' )
    return setAddress(rec);
 }
}

means for every 'C' without 'D' you go one level deeper in the setAddress() recursion ?

Looks suspicious to me, but didn't analyse completely
( ... because I hate Strings, which look like they could be used like ordinary variables, e.g. returned by value without fear to get a pointer to invalid stack variable.)

@ holmes4: Assumed it's implemented properly, setAddress returns a valid copy of it's local variable add. Guess how many constructors and destructors have to be called to make it work ...

It looks like real problem was one broken cable.
10  Using Arduino / Programming Questions / Re: Error when sending and receiving mesage using Mirf library on: September 05, 2013, 07:17:06 am
So i tried to avoid this problematic code so i set Recieving and Target address in code manually for both devices. But still same problem occures. Any other thoughts where problem could be?
11  Using Arduino / Programming Questions / Re: Error when sending and receiving mesage using Mirf library on: September 04, 2013, 01:50:50 pm
Setting address is ok but my real problem is then from one device everithing what i send is registred on second device. But for example only 1 of 10 message is recieved when sending from second to first.
12  Using Arduino / Programming Questions / Error when sending and receiving mesage using Mirf library on: September 04, 2013, 12:46:44 pm
Hello i have 2x ardiono Mega 2560 with LCD and keypad connected using NRF24L01 module. It is working only sometimes so i dont know where is problem in code or in hardware? Please look at my code and tell me if it is functional. Thanks for help.

Code:
//klávesnice
#include <Keypad.h>
const byte ROWS = 4; //four rows
const byte COLS = 4; //three columns
char keys[ROWS][COLS] = {
  {
    '1','2','3','A'                                  }
  ,
  {
    '4','5','6','B'                                  }
  ,
  {
    '7','8','9','C'                                  }
  ,
  {
    '*','0','#','D'                                  }
};

char rec;


byte rowPins[ROWS] = {
  34, 36, 38, 40}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {
  42, 44, 46, 48};//connect to the column pinouts of the keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

//RF
#include <SPI.h>
#include <Mirf.h>
#include <nRF24L01.h>
#include <MirfHardwareSpiDriver.h>

//LCD
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
#define I2C_ADDR    0x20 

#define BACKLIGHT_PIN  7
#define En_pin  4
#define Rw_pin  5
#define Rs_pin  6
#define D4_pin  0
#define D5_pin  1
#define D6_pin  2
#define D7_pin  3
#define  LED_OFF  0
#define  LED_ON  1

//String count;

LiquidCrystal_I2C  lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);

void setup(void)
{
  Serial.begin(9600);

  //LCD
  {
    lcd.begin (16,2);
    lcd.setBacklightPin(BACKLIGHT_PIN,NEGATIVE);
    lcd.setBacklight(LED_ON);
    lcd.backlight();
  }



  Mirf.cePin = 9;
  Mirf.csnPin = 10;

  Mirf.spi = &MirfHardwareSpi;
  Mirf.init();


  String rec = setAddress("Receiving address");
  String tar = setAddress("Target address");

  Mirf.setRADDR((byte *)&rec);
  Mirf.setTADDR((byte *)&tar);

  //Mirf.setRADDR((byte *)"00002");
  //Mirf.setTADDR((byte *)"00001");

  Mirf.payload = sizeof(char);

  Mirf.config();

  lcd.setCursor(0,0);
  lcd.print("Send:");
  lcd.setCursor(0,1);
  lcd.print("Rec:");
}

void loop(void)
{
  char key = keypad.getKey();
  if (key != NO_KEY){
    Mirf.send((byte *) &key);
    lcd.setCursor(5,0);
    lcd.print(key);
    while(Mirf.isSending()){
    }
  }

  if(Mirf.dataReady()){
    char get;
    lcd.setCursor(5,1);
    Mirf.getData((byte *) &get);
    lcd.print(get);
  }
}

String setAddress(String rec){
  int pos = 0;
  String add = "";
  lcd.setCursor(0,0);
  lcd.print(rec);
  char key = keypad.getKey();
  char keyOld;

  while(pos<5){
    if (key != NO_KEY){
      lcd.setCursor(pos,1);
      pos++;
      add +=key;       
      lcd.print(key);
    }
    key = keypad.getKey();
  }
  while(true){
    if(key == 'D'){
      lcd.clear();
      return add;
    }
    if(key == 'C'){
      lcd.clear();
      return setAddress(rec);
    }
    key = keypad.getKey();
  }
}
13  Using Arduino / Project Guidance / Re: Walkie-talkie made from Arduino on: August 01, 2013, 03:01:24 am
What range do you want from the walkie talkie?
Most of the radio modules that Arduinos can drive are low power and have limited range, usually a few hundred meters at best.

That is the reason why I want to do it like Manet network. 
14  Using Arduino / Project Guidance / Re: Walkie-talkie made from Arduino on: July 31, 2013, 05:10:48 pm
Quote
It must be in really old phones.
I did say "analogue".
If you think about it, an 8kHz sampling rate and taking into account Mr Nyquist's cut, you get around a 3kHz bandwidth (I checked, it was 3.1kHz, from 300 to 3400 Hz).

Yes, it is true but not completely in practice. 3400 Hz is highest frequency of voice you need to hear to understand, although ear can hear max to 20 kHz. 3400 Hz you will round it on 4 kHz and double it on 8 kHz to be sure you will capture it.
15  Using Arduino / Project Guidance / Re: Walkie-talkie made from Arduino on: July 31, 2013, 03:46:16 pm
Quote
I would like to use same kHz as old phones used (8kHz)
Standard analogue telephony bandwidth was 3kHz.

It must be in really old phones.

A nRF24L01 module will theoretically get up to 2Mbps, should be fast enough.

As for audio processing directly on the Arduino see:

http://interface.khm.de/index.php/lab/experiments/arduino-realtime-audio-processing/

If it were me, I'd connect a SPI or I2C audio sampling / codec chip to the Arduino rather than try to do it standalone.

It is really good idea. As Input and output i will have only digital and it will make my job lot of easier.
Pages: [1] 2