Show Posts
Pages: [1]
1  Using Arduino / Networking, Protocols, and Devices / Re: Transmitting & Receiving DMX using nRF24L01 radio transceivers on: September 11, 2014, 03:55:05 pm
Question....The LED blinks if data is received. What dose it mean if the LED is solid?
2  Using Arduino / Networking, Protocols, and Devices / Re: Transmitting & Receiving DMX using nRF24L01 radio transceivers on: August 27, 2014, 07:48:14 pm
OK So The boards are talking via PIN PAIR. Next question. How would I put in a code on the TX side to be like if no DMX is available then send these values, to imitate DMX channels on the RX side? I unfortunately do not have my console available at the moment so I have no way of testing if the code you helped me with is working correctly.
3  Using Arduino / Networking, Protocols, and Devices / Re: Transmitting & Receiving DMX using nRF24L01 radio transceivers on: August 25, 2014, 08:55:16 pm
Ok so I am at a total loss for ideas.   Here is my RX code.. I am trying with some LED's first just to get everything setup.
Receiver Code:
Code:
// DMX RECEIVE USES ATMEGA328 or ATMEGA8-16PU
// connection information...
// http://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo
// use ATMEGA DigitalPin 1 to send DMX data to pin 4 of SN75176 chip
// SN75176: pins 2 & 5 to 0v | pin 3 & 8 to 5v | pin 6 to DMX+ | pin7 to DMX-
// Ensure 3.3v is used to supply NRF24L01 board !!
//
#include <SPI.h>
#include "nRF24L01.h" // library: https://github.com/maniacbug/RF24
#include "RF24.h"
#include <Wire.h>
#include "pins_arduino.h";

RF24 radio(9,10);

const uint64_t pipe = 0xF0F0F0F0E1LL;
#define MAXPAYLOAD 32 // max payload size for nrf24l01
#define DMXout 1      // DMX signal output pin (same as TX pin)
#define ERRout 8      // LED to show signal strength : digitalpin 8 to LED via 470 resistor to 0v
#define MAXGROUPS 17 // 17 groups of 30 channels = 510 channels
int ch1;
int ch2;
int ch3;
int Ch1a = 3;
int Ch2a = 5;
int Ch3a = 6;
unsigned long time;
uint8_t payload[MAXPAYLOAD], DMXData[30*MAXGROUPS];
uint8_t lastStamp, channel=0, i;
unsigned long timer;


void setup(void)
{
  pinMode(Ch1a, OUTPUT);
  pinMode(Ch2a, OUTPUT);
  pinMode(Ch3a, OUTPUT);
  pinMode(DMXout, OUTPUT);
  digitalWrite(DMXout, HIGH);
  pinMode(ERRout, OUTPUT);
  digitalWrite(ERRout, LOW);
  digitalWrite(Ch1a, HIGH);//Make sure the LED's Work
  digitalWrite(Ch2a, HIGH);
  digitalWrite(Ch3a, HIGH);
  delay(2000);
  digitalWrite(Ch1a, LOW);
  digitalWrite(Ch2a, LOW);
  digitalWrite(Ch3a, LOW);//Finish Test

  radio.begin();
  radio.setAutoAck(false);
  radio.setPayloadSize(MAXPAYLOAD); // 9 for 6 byte packet, 12 for 6 byte data + SSD, needs to be 14 to stop failing !!
  radio.setPALevel(RF24_PA_HIGH); // try and set PA to max !   
  radio.setDataRate(RF24_250KBPS); // 250kbps for best tx/rx
  radio.openReadingPipe(1,pipe);
  radio.startListening();
  radio.setChannel(channel);
}

void loop(void)
{
    if ( radio.available() ) {
      radio.read( payload, sizeof(payload) ); // get data packet from radio if available
      for (i = 0; i <30; i++) {
        DMXData[(30*payload[0])+i] = payload[i+2]; // recompile DMX data from RF data
        /// your channels are now in the correct place to send to the servos...
        ch1 = (DMXData[1]);
        ch2 = (DMXData[2]);
        ch3 = (DMXData[3]);
        analogWrite(Ch1a,ch1);
        analogWrite(Ch2a,ch2);
        analogWrite(Ch3a,ch3);

    }
}
}
Transmitter:
Code:
// FOR ATMEGA328 16mhz ONLY //
// connection information...
// http://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo
// use ATMEGA RXD pin to receive DMX data from pin 1 of SN75176 chip
// SN75176: pins 2, 3 & 5 to 0v | pin 8 to 5v | pin 6 to DMX+ | pin7 to DMX-
// Ensure 3.3v is used to supply NRF24L01 board !!

#include <SPI.h>
#include "nRF24L01.h" // library: https://github.com/maniacbug/RF24
#include "RF24.h"
#include <Wire.h>
#include <DMXSerial.h> // library: http://www.mathertel.de/Arduino/DMXSerial.aspx //

#define MAXGROUPS 17 // 17 groups of 30 channels = 510 channels
#define MAXPAYLOAD 32 // max payload size for nrf24l01
#define BURSTTIMER 40 // 40ms between blasts of radio data
#define DMX_LED 8 // DMX monitor : LED from digital pin 8 to 0V via 470R resistor

RF24 radio(9,10);

const uint64_t pipe = 0xF0F0F0F0E1LL; //0xE8E8F0F0E1LL;
uint8_t payload[MAXPAYLOAD];
unsigned long timeslot, flashTimer;
uint8_t timeStamp, channel=0; // ensure TX & RX channels are the same

void setup(void)
{
  pinMode(DMX_LED, OUTPUT);
  digitalWrite(DMX_LED, LOW);
  DMXSerial.init(DMXReceiver);
  radio.begin();
  radio.setAutoAck(false);
  radio.setPayloadSize(MAXPAYLOAD);
  radio.setPALevel(RF24_PA_HIGH);   
  radio.setDataRate(RF24_250KBPS);
  radio.openWritingPipe(pipe);
  radio.stopListening();
  radio.setChannel(channel);
  flashTimer = millis();
}

void loop(void)
{
  if (millis() - timeslot > BURSTTIMER) {
    timeslot = millis();
    for (uint8_t group = 0; group<=MAXGROUPS; group++) {
      payload[0] = group; // set first byte to point to group (groups of 30 bytes)
      payload[1] = timeStamp++; // second byte helps us monitor consistency of reception at receiver
      for (uint8_t chan = 1; chan<31; chan++) {
        payload[1+chan] = DMXSerial.read((group*30)+chan); // fill payload with DMX data
      }
      radio.write( payload, sizeof(payload) ); // dump payload to radio
      delayMicroseconds(20); // short delay between packets to ensure radio not overloaded   
    }
  }
  unsigned long lastPacket = DMXSerial.noDataSince();
  unsigned long lastFlash = millis() - flashTimer;
  if (lastPacket < 5000) { // if continuous DMX data is received then flash LED
    if (lastFlash < 500) { digitalWrite(DMX_LED,1); } // flash on 0.5sec
    else if (lastFlash < 1000) { digitalWrite(DMX_LED,0); } // flash off 0.5sec
    else if (lastFlash > 1000) { flashTimer = millis(); } // reset timer after 1 second
  }
}

I am using an arduino Pro Mini which has the ATmega328 for my RX and an Arduino Dumanilie also with an ATmega328 for my TX. Both units have NRF24L01+ attached ashttp://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo describes for the ATmega328 with 100uF cap. The TX unit has a blinking Red LED from pin 8 as described in your code.  I tested my max485 chip using the DMX Serial example and I was able to receive 3 channels of DMX and control the LED's. So I know that is working.  On the RX pin 8 is not showing any blinking or anything so I am assuming that it is not receiving any signal. I have tried two sets of NRF24L01+ units and have gotten nowhere. If you have any ideas. I know you said that you had problems.  What steps did you take to make these units work?
4  Using Arduino / Networking, Protocols, and Devices / Re: Transmitting & Receiving DMX using nRF24L01 radio transceivers on: August 21, 2014, 05:56:35 pm
At the moment I am still trying to get my NRF24L01's to work with the getting started script from RF24

STATUS    = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1    = 0xe7e7e7e7e7 0xf0f0f0f0d2
RX_ADDR_P2-5    = 0xc3 0xc4 0xc5 0xc6
TX_ADDR    = 0xe7e7e7e7e7
RX_PW_P0-6    = 0x00 0x20 0x00 0x00 0x00 0x00
EN_AA    = 0x3f
EN_RXADDR    = 0x03
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

Thats my Serial Print out...not sure what any of it means.
5  Using Arduino / Networking, Protocols, and Devices / NRF24L01+ Help on: August 21, 2014, 05:36:15 pm
I have everything wired up correctly and I am trying to run RF24's Getting started Script.  Here are my serial print outs for each node.


Node 1




RF24/examples/GettingStarted/

ROLE: Pong back

*** PRESS 'T' to begin transmitting to the other node

STATUS    = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1    = 0xe7e7e7e7e7 0xf0f0f0f0d2
RX_ADDR_P2-5    = 0xc3 0xc4 0xc5 0xc6
TX_ADDR    = 0xe7e7e7e7e7
RX_PW_P0-6    = 0x00 0x20 0x00 0x00 0x00 0x00
EN_AA    = 0x3f
EN_RXADDR    = 0x03
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
*** CHANGING TO TRANSMIT ROLE -- PRESS 'R' TO SWITCH BACK

Now sending 2441...failed.

Failed, response timed out.

Now sending 3716...failed.

Failed, response timed out.

Now sending 4989...failed.

Failed, response timed out.

Now sending 6263...failed.

Failed, response timed out.

Now sending 7537...failed.

Failed, response timed out.

Now sending 8811...failed.

Failed, response timed out.

Now sending 10086...failed.

Failed, response timed out.



Node 2


RF24/examples/GettingStarted/

ROLE: Pong back

*** PRESS 'T' to begin transmitting to the other node

STATUS    = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1    = 0xe7e7e7e7e7 0xf0f0f0f0d2
RX_ADDR_P2-5    = 0xc3 0xc4 0xc5 0xc6
TX_ADDR    = 0xe7e7e7e7e7
RX_PW_P0-6    = 0x00 0x20 0x00 0x00 0x00 0x00
EN_AA    = 0x3f
EN_RXADDR    = 0x03
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
*** CHANGING TO TRANSMIT ROLE -- PRESS 'R' TO SWITCH BACK

Now sending 2441...failed.

Failed, response timed out.

Now sending 3716...failed.

Failed, response timed out.

Now sending 4989...failed.

Failed, response timed out.

Now sending 6263...failed.

Failed, response timed out.

Now sending 7537...failed.

Failed, response timed out.

Now sending 8811...failed.

Failed, response timed out.

Now sending 10086...failed.

Failed, response timed out.




Im not sure how to diagnose what is being told to me in the status.  Could someone breakdown each thing  ex. RX_ADDR_P0-1.
and tell me why its not working.  I have 100uF caps bridging the 3.3v and GND as I have  read this is required.
6  Using Arduino / Networking, Protocols, and Devices / Re: Transmitting & Receiving DMX using nRF24L01 radio transceivers on: August 18, 2014, 06:02:46 pm
Thank you. I am having issues with the NRF24L01's talking to each other... I order the capisitors as that seems to be a common problem.   Also do you know how these radios would work with one TX and a bunch of RX units? I would like one controller to control all the events of the haunted house. Other articles have said it should work fine.  They may just not check the data as well. but many RX units could receive the same data through one pipe.   Any input to this idea?
7  Using Arduino / Networking, Protocols, and Devices / Re: Transmitting & Receiving DMX using nRF24L01 radio transceivers on: August 17, 2014, 10:21:05 am
Better  yet something like this?

Code:
// DMX RECEIVE USES ATMEGA328 or ATMEGA8-16PU
// connection information...
// http://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo
// use ATMEGA DigitalPin 1 to send DMX data to pin 4 of SN75176 chip
// SN75176: pins 2 & 5 to 0v | pin 3 & 8 to 5v | pin 6 to DMX+ | pin7 to DMX-
// Ensure 3.3v is used to supply NRF24L01 board !!
//
#include <SPI.h>
#include "nRF24L01.h" // library: https://github.com/maniacbug/RF24
#include "RF24.h"
#include <Wire.h>
#include "pins_arduino.h";

RF24 radio(9,10);

const uint64_t pipe = 0xF0F0F0F0E1LL;
#define MAXPAYLOAD 32 // max payload size for nrf24l01
#define DMXout 1      // DMX signal output pin (same as TX pin)
#define ERRout 8      // LED to show signal strength : digitalpin 8 to LED via 470 resistor to 0v
#define MAXGROUPS 17 // 17 groups of 30 channels = 510 channels
int ch1;
int ch2;
int ch3;

unsigned long time;
uint8_t payload[MAXPAYLOAD], DMXData[30*MAXGROUPS];
uint8_t lastStamp, channel=0, i;
unsigned long timer;

void setup(void)
{
  pinMode(DMXout, OUTPUT);
  digitalWrite(DMXout, HIGH);
  pinMode(ERRout, OUTPUT);
  digitalWrite(ERRout, LOW);
  radio.begin();
  radio.setAutoAck(false);
  radio.setPayloadSize(MAXPAYLOAD); // 9 for 6 byte packet, 12 for 6 byte data + SSD, needs to be 14 to stop failing !!
  radio.setPALevel(RF24_PA_HIGH); // try and set PA to max !  
  radio.setDataRate(RF24_250KBPS); // 250kbps for best tx/rx
  radio.openReadingPipe(1,pipe);
  radio.startListening();
  radio.setChannel(channel);
}

void loop(void)
{
    if ( radio.available() ) {
      radio.read( payload, sizeof(payload) ); // get data packet from radio if available
      for (i = 0; i <30; i++) {
        DMXData[(30*payload[0])+i] = payload[i+2]; // recompile DMX data from RF data
        /// your channels are now in the correct place to send to the servos...
        ch1 = (DMXData[1]);
        ch2 = (DMXData[2]);
        ch3 = (DMXData[3]);

    }
}
}
void fourUSdelay(void) {
    asm("nop\n nop\n nop\n nop\n nop\n nop\n nop\n nop\n nop\n nop\n nop\n nop\n nop\n nop\n nop\n nop\n");
    asm("nop\n nop\n nop\n nop\n nop\n nop\n nop\n nop\n nop\n nop\n nop\n nop\n nop\n nop\n nop\n nop\n");
    asm("nop\n nop\n nop\n nop\n nop\n nop\n nop\n nop\n nop\n nop\n nop\n nop\n nop\n nop\n nop\n nop\n");
}


Also could a MAX485 be substituted for the SN75176? I believe they are the same thing.
8  Using Arduino / Networking, Protocols, and Devices / Re: Transmitting & Receiving DMX using nRF24L01 radio transceivers on: August 17, 2014, 09:11:55 am
Thank you so much for helping! 

Where and what would I replace in your code with the code you gave me? Also is the payload[channel number]? Like this?

Code:

   if ( radio.available() ) {
      radio.read( payload, sizeof(payload) ); // get data packet from radio if available
channel1= payload[1];  // DMX address 1
channel2=payload[2];
channel3=payload[3];
//....
channel56=payload[56]; //DMX address 56

    }



9  Using Arduino / Networking, Protocols, and Devices / Re: Transmitting & Receiving DMX using nRF24L01 radio transceivers on: August 15, 2014, 07:28:38 pm
So I am trying to Implement your code to make my "own fixture". I am looking to use DMX to control servos and relays for a haunted house that I work at for a fundraiser. I have two Arduino Duemilanove with ATMega328. I also have two NRF24L01+ similar that you mentioned. I am looking to make the DMX receiver take "channels" and put those values into a int variable.

etc.
Set Start address = 1
# Of channels = 5
int channel1 = 0
int channel2 =0
int channel3= 0
int channel4= 0
int channel5= 0

and I will map these values as PWM for servos and such.
If there is anyway at all you could help me out with coding that would be AMAZING!  Thank you so much.



I see that there is a Example on the DMXSerial Lib that does this. I just do not know how to take the NRF24L01+ signal and make it use the code.
10  Using Arduino / Sensors / Reading sensors and acting on their input on: July 12, 2012, 08:30:36 am
I am building a greenhouse that is going to be totally controlled by my arduino mega. At the moment I have two DHT11 sensors a light sensor  and two voltage sensors. One for battery ad one for solar. Then I have servos to open vents and intake and extralegal fans controlled by relays. All this data is displayed on an LCD aswell as sent via xbee to a second arduino that is displaying the info.


On to the problem. I would like the arduino to always be updatin the LCD with the most uptodate info. But. If it gets into a a 5 min delay that allows the battery to recoup the display dose not update. How can I create a separate loop that is always running?
11  Using Arduino / Networking, Protocols, and Devices / Your Arduino becomes a OpenDmx USB interface on: February 26, 2012, 05:04:20 pm
Below I have added the OpenDMX page from the Arduino Playground. My question is to make this wireless using two arduinos....How can I do this?

Your Arduino becomes a OpenDmx USB interface

All this just works with an old arduino board, since the UNO there is a different chip used smiley-sad

This short tutorial explains how to use the Arduino as a USB to DMX interface for software that works with OpenDmx. This USB to DMX interface enabled you to use your PC as a DMX master device to control DMX slave devices.
DMX (Digital MultipleXed) is an agreement over the connection between lighting controllers, dimmers, scrollers, scanners, etc. With DMX you can control 512 channels.
OpenDmx is a Open Source project to produce a low cost USB to DMX interface with a GPL license.

The OpenDmx USB circuit simply consists of a USB to serial converter (FT232BM) and a driver block (max485). This circuit takes care of transforming your signal from USB to Serial and from Serial (RS 232) to DMX (RS485) but it does not care about what are you sending (transmitting). The signal itself has to be produced by your PC. The PC has to take care of timing and order of the signal. This kind of devices is called "unbuffered", because the USB to DMX device is not storing or buffing anything, if your computer hang-up, your signal gets also jam.
FT232BM chip is a USB to Serial converter produced by FTDI.
The Driver Block (max485 or SN75176) Outputs the 3 Pins are needed for sending DMX (DMX-Pin1 � Reference (GND); DMX-Pin2 � Signal inversion (cold); DMX-Pin3 � Signal (hot)). Furthermore is the Driver Block taking care of changing the Arduino signal Voltage (0V / 5V, according to RS232) into the DMX signal Voltage (-2,5V / +2,5V, according to RS485).

The Arduino is using the same USB to Serial converter like the OpenDmx USB device. The only thing we have to add is the driver block (max485). We just have to wire up a driver block (as you can see in the following schematic) and connect the Driver Block Input (DI) to the RX Input (output of the USB chip) at the Arduino. That's it. Just install the driver for the OpenDmx USB interface, for example from enttec ( http://www.enttec.com/index.php?menu=downloads&prod=70303&show=downloads ) and get some software or write your own programm.

Here are some links where you can find some software and building examples:
http://www.enttec.com/index.php?menu=downloads&prod=70303&show=downloads
http://www.nextec.co.uk/opendmx.htm
http://sourceforge.net/projects/lightsup
http://www.chromakinetics.com/DMX (Windows and Mac opensource)
a good one for linux
http://qlc.sourceforge.net/index.php?doc=Features
(edited by tomek ness (k3/fhp))
Pages: [1]