Show Posts
Pages: 1 [2] 3 4 ... 8
16  Using Arduino / Networking, Protocols, and Devices / Re: Can't get nRF24L01 working on: May 29, 2013, 05:29:15 am
I dont know if you still have that problem, but when i tried the NRF modules for the first time that happened, the solution it to check the baud on serial monitor
17  Using Arduino / Networking, Protocols, and Devices / Re: nRF24L01+ and roles on: May 25, 2013, 09:02:46 am
1 quick question...
if im gonna have 1 main module, that asks for temp and send 0 or 1 for the remote modules take action and then reply the event to the main, should i use radio or network.
do i need to use pipes?

im not sure if the question is clear if its not ill try to be more specific
18  Using Arduino / Networking, Protocols, and Devices / Re: nRF24L01+ and roles on: May 24, 2013, 10:25:44 am
The first question to be answered is what does the role pin do... If you had taken the time to read ALL the documentation you'd know...
From the pingpair sketch...
// sets the role of this unit in hardware.  Connect to GND to be the 'pong' receiver
// Leave open to be the 'ping' transmitter
const int role_pin = 7;

Thank you for the reply,

I've read it, though since its phisically connected to the ground, i can change the status? isnt ground always low? im preety new to this stuff, and believe that i read a lot about this... i even printed the classes http://maniacbug.github.io/RF24Network/annotated.html except the sync

19  Using Arduino / Networking, Protocols, and Devices / Re: nRF24L01+ and roles on: May 23, 2013, 08:45:43 am
Perhaps i should post some code that might help, this is the modules part, and at the end of the loop part you can see the if, where i want the role thing.

Code:
//RX

#include <RF24Network.h>
#include <RF24.h>
#include <SPI.h>
#include <printf.h>
#include <OneWire.h>
#include <DallasTemperature.h>

//########################### DS18B20 MAIN #############################

// Data wire is plugged into pin 6 on the module
#define ONE_WIRE_BUS 6
 
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
 
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);

//########################### NRF24L01 MAIN #############################

// nRF24L01(+) radio attached using Getting Started board
RF24 radio(8,7);
 
// Network uses that radio
RF24Network network(radio);
 
// Address of our node
const uint16_t this_node = 1;
 
// Address of the other node
const uint16_t other_node = 0;
 
// How often to send 'hello world to the other unit
const unsigned long interval = 2000; //ms
 
// When did we last send?
unsigned long last_sent;
 
// How many have we sent already
unsigned long packets_sent;
 
// Structure of our payload
struct payload_t
{
  float temperatura;
  unsigned long ms;
  unsigned int order;
  unsigned long counter;
 
};

void setup(void)
{
  Serial.begin(57600);
  Serial.println("RF24Network/examples/helloworld_rx/");
  sensors.begin();
  SPI.begin();
  radio.begin();
  network.begin(/*channel*/ 90, /*node address*/ this_node);
}

//########################### NRF24L01 LOOP #############################

void loop(void)
{
 
  // Pump the network regularly
  network.update();
 
  // Is there anything ready for us?
  while ( network.available() )
  {
    // If so, grab it and print it out
    RF24NetworkHeader header;
    payload_t payload;
    network.read(header,&payload,sizeof(payload));
    Serial.print("Received packet #");
    Serial.println(payload.counter);
    Serial.print(" Milisegundos ");
    Serial.println(payload.order);
    Serial.print(" Temperatura remota ");
    Serial.println(payload.temperatura);
    Serial.print(" Order ");
    Serial.println(payload.ms);
    if (payload.order == 1)
    {
      //Change mode and send temp

      temp();
  }

}

//########################### DS18B20 VOID #############################

  void temp()
{
 
sensors.requestTemperatures(); // Send the command to get temperatures

Serial.print(" Arduino Temperature: ");
Serial.println(sensors.getTempCByIndex(0)); // Why "byIndex"? You can have more than one IC on the same bus. 0 refers to the first IC on the wire
delay (1000);
}

20  Using Arduino / Networking, Protocols, and Devices / nRF24L01+ and roles on: May 23, 2013, 08:14:57 am
Hello all, once again...

I have a couple of questions about the roles on nRF24L01+.
I'm using the RF24 lib, my "network" wont be a tree, but a star, where i have my main equipment, and the individual modules will communicate only with the main.
at the moment i have my main recieving and the nodes transmitting but what i really need is to have the nodes in receive mode and when they get a specific request it will automatically change his own role to send the answer to the main, example: Temperature

Main                                                                                    Module
Ask temp                        ------------------------------->           receive request
receive ack (automatic)    <-------------------------------           send ack (automatic)
change to receive mode    --------------------------------            change to send mode
receive answer                <-------------------------------            send answer
send ack (automatic)       ------------------------------->            receive ack (automatic)
change to send mode       --------------------------------            change to receive mode

The http://maniacbug.github.io/RF24/pingpair_8pde-example.html is long and a bit confusing to me to be honest, im looking for an extremelly easy, small code example that dont need human interation like
Code:
printf("*** PRESS 'T' to begin transmitting to the other node\n\r");
Other question: is it really need to set pipes?
what about the
Code:
// sets the role of this unit in hardware.  Connect to GND to be the 'pong' receiver
// Leave open to be the 'ping' transmitter
const int role_pin = 7;
what does he mean by that?

Thanks in advance and sorry for the looong noob post
21  Using Arduino / Microcontrollers / Re: Arduino Mega with NRF24L01+ and NRF24L01+ with Atmega328p on: May 16, 2013, 03:24:07 pm
got it working now... My problem was the connections, they were wrong.

Thanks for the help
22  Using Arduino / Microcontrollers / Re: Arduino Mega with NRF24L01+ and NRF24L01+ with Atmega328p on: May 16, 2013, 04:52:45 am
Just so you know, i'm not asking for you to check the code, but the pin assignment, cause that's what i'm really struggling. I've never worked with uC before, so this is mostly new to me
23  Using Arduino / Microcontrollers / Re: Arduino Mega with NRF24L01+ and NRF24L01+ with Atmega328p on: May 15, 2013, 04:26:49 pm
Unfortunatly i'm back with some bad news :S

first of all, ill post my code on each side then the connections...

Arduino Side (tx)

Code:
/*
 Copyright (C) 2011 James Coliz, Jr. <maniacbug@ymail.com>

 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 version 2 as published by the Free Software Foundation.
 */

#include <RF24Network.h>
#include <RF24.h>
#include <SPI.h>

// nRF24L01(+) radio attached using Getting Started board
RF24 radio(49,53);
 
// Network uses that radio
RF24Network network(radio);
 
// Address of our node
const uint16_t this_node = 1;
 
// Address of the other node
const uint16_t other_node = 0;
 
// How often to send 'hello world to the other unit
const unsigned long interval = 2000; //ms
 
// When did we last send?
unsigned long last_sent;
 
// How many have we sent already
unsigned long packets_sent;
 
// Structure of our payload
struct payload_t
{
  unsigned long ms;
  unsigned long counter;
};


void setup(void)
{
  Serial.begin(57600);
  Serial.println("RF24Network/examples/helloworld_tx/");
 
  SPI.begin();
  radio.begin();
  network.begin(/*channel*/ 90, /*node address*/ this_node);
}


void loop(void)
{
  // Pump the network regularly
  network.update();
 
  // If it's time to send a message, send it!
  unsigned long now = millis();
  if ( now - last_sent >= interval  )
  {
    last_sent = now;
 
    Serial.print("Sending...");
    payload_t payload = { millis(), packets_sent++ };
    RF24NetworkHeader header(/*to node*/ other_node);
    bool ok = network.write(header,&payload,sizeof(payload));
    if (ok)
      Serial.println("ok.");
    else
      Serial.println("failed.");
  }
}

Connections:

nrf24l01+          Arduino Mega 2560

1-GND               GND
2-VCC               5v
3-CE                 53 or 49
4-CSN               49 or 53
5-SCK               52
6-MOSI              51
7-MISO              48


ATMega328p on breadboard (RX)

Code:
//RX

#include <RF24Network.h>
#include <RF24.h>
#include <SPI.h>

// nRF24L01(+) radio attached using Getting Started board
RF24 radio(49,53);
 
// Network uses that radio
RF24Network network(radio);
 
// Address of our node
const uint16_t this_node = 0;
 
// Address of the other node
const uint16_t other_node = 1;
 
// How often to send 'hello world to the other unit
const unsigned long interval = 2000; //ms
 
// When did we last send?
unsigned long last_sent;
 
// How many have we sent already
unsigned long packets_sent;
 
// Structure of our payload
struct payload_t
{
  unsigned long ms;
  unsigned long counter;
};



void setup(void)
{
  Serial.begin(57600);
  Serial.println("RF24Network/examples/helloworld_tx/");
 
  SPI.begin();
  radio.begin();
  network.begin(/*channel*/ 90, /*node address*/ this_node);
}


void loop(void)
{
  // Pump the network regularly
  network.update();
 
  // Is there anything ready for us?
  while ( network.available() )
  {
    // If so, grab it and print it out
    RF24NetworkHeader header;
    payload_t payload;
    network.read(header,&payload,sizeof(payload));
    Serial.print("Received packet #");
    Serial.print(payload.counter);
    Serial.print(" at ");
    Serial.println(payload.ms);
  }
}

Connections:

nrf24l01+          ATMega328p

1-GND               GND
2-VCC               5v
3-CE                 14
4-CSN               15
5-SCK               19
6-MOSI              17
7-MISO              18


Results:

On Arduino (tx)

with CE on 53 and CSN on 49
Code:
RF24Network/examples/helloworld_tx/
Sending...failed.
Sending...failed.
Sending...failed.

only with CSN on 49
Code:
Sending...RF24Network/examples/helloworld_tx/
Sending...failed.
Sending...failed.
Sending...failed.

Without CE or CSN
Code:
RF24Network/examples/helloworld_tx/
Sending...ok.
Sending...ok.

Something must be wrong and im too blind/newb to see. Maybe the pins on ATMega328p (breadboard)? maybe arduino? maybe both?

I tried to be as explicit as possible and btw, the code was from http://maniacbug.wordpress.com/2012/03/30/rf24network/

Thanks in advance
24  Using Arduino / Microcontrollers / Re: Arduino Mega with NRF24L01+ and NRF24L01+ with Atmega328p on: May 14, 2013, 06:05:22 am
Thank you for the answers, i'll update this thread if needed
25  Using Arduino / Microcontrollers / Re: Arduino Mega with NRF24L01+ and NRF24L01+ with Atmega328p on: May 12, 2013, 05:03:21 pm
i chose the RF24 library to go to.
RF24 radio(9,10); these would be the CSN and CE?

9 and 10 would be on arduino side, and on the uC?
26  Using Arduino / Microcontrollers / Re: Arduino Mega with NRF24L01+ and NRF24L01+ with Atmega328p on: May 12, 2013, 04:51:48 pm
5-SCK               ?
6-MOSI              ?
7-MISO              ?

Those connect to the Mega/Mega328 pins with the same name.

All the others will depend on the driver you want to use.


Thank you for the reply... in that case, i should first get the "code" part.
I'll get by when i have more work done on that matter

Again, Thanks
27  Using Arduino / Microcontrollers / Arduino Mega with NRF24L01+ and NRF24L01+ with Atmega328p on: May 12, 2013, 04:31:54 pm
Hello all,

im here, trying to get help to get myself out of misery... I've been searching for info on how to achieve my goal, but i still couldn't find :S

Basically i have an Arduino Mega 2560, 2x NRF24L01+ (5v capable) and an Atmega328p on a breadboard...
I would like to know the connections i should make, since i have already found several versions and none worked...
I know that this post asks for a lot, but im quite desperate...

First Step:

NRF24L01+ / Arduino Mega
1-GND             GND
2-VCC             VCC
3-CE                 ?
4-CSN               ?
5-SCK               ?
6-MOSI              ?
7-MISO              ?
8-IRQ                ?

Can you fill the ? please

Second Step:

NRF24L01+ / Atmega328p (breadboard with 16mhz crystal)

1-GND             GND
2-VCC             VCC
3-CE                 ?
4-CSN               ?
5-SCK               ?
6-MOSI              ?
7-MISO              ?
8-IRQ                ?

Can you fill the ? please

The purpose of this is to use the arduino to activate a relay on the breadboard and then receive the completed order

If i know that the hardware part is correct, i can go and deal only with the software part

Thanks in advance

28  Using Arduino / General Electronics / Re: error on power supply on: February 04, 2013, 05:45:30 pm
mmm i see, ill take a look on that.

thanks for the info. i apreciate it smiley-wink
29  Using Arduino / General Electronics / Re: error on power supply on: February 04, 2013, 05:39:08 pm
i see now... errors aproved. i thought i couldnt proceed without fixing it smiley-grin

THANK YOU ALL!!!

pin 1 from JP3 is the lamp i want to turn on.

i didnt understand this...

you do need to decide if you are using output 1 or ouput 2

output 1 is pin 6 0V pin 7 +V
output 2 is pin 9 0v pin 10 +V

thanks in advance
30  Using Arduino / General Electronics / Re: error on power supply on: February 04, 2013, 11:25:59 am
i want to thanks to everyone that tried to help so far. crap i feel real dumb... i still cant solve my problem. i tried to rename but with no sucess... i've added the schematic on the first post, please help me smiley-sad
Pages: 1 [2] 3 4 ... 8