Post a new topicPost a reply Page 1 of 1   [ 7 posts ]
Author Message
 Post subject: UNO + cooking hacks + microchipRN2483A (receiver errors)
PostPosted: Fri Feb 09, 2018 3:25 pm 

Joined: Mon Feb 05, 2018 5:17 pm
Posts: 4
Hi all

I am doing the first steps on LORAWAN.

My setup is:


UNO + cooking hacks + microchipRN2483A

and

UNO + cooking hacks + microchipRN2483A

Firstly I burned LoRaWAN_P2P_01_configure_module on both UNO
Then I burned the LoRaWAN_P2P_02_Send_Packets on the first set and
the LoRaWAN_P2P_03_Receive_Packets on the second set.


When I run the run set, I dont see the LED turned on and serial shows:

sys get ver
mac pause
radio set pwr 15
radio get pwr
radio set freq 868100000
radio get freq
radio set sf sf12
radio get sf
radio set cr 4/5
radio get cr
radio set bw 125
radio get bw
radio set crc on
radio get crc
radio tx 0102030405060708090A0B0C0D0E0F
radio tx 0102030405060708090A0B0C0D0E0F
radio tx 0102030405060708090A0B0C0D0E0F

When running the second set, I saw LED turned on, which is a sign of error. So I added serial suport and now I see:


sys get ver
mac pause
radio set pwr 15
radio get pwr
radio set freq 868100000
radio get freq
radio set sf sf12
radio get sf
radio set cr 4/5
radio get cr
get cr ERROR:

radio set bw 125
set BW ERROR:

radio get bw
radio set crc on
set CCRC ERROR:

radio get crc
get CCRC ERROR:

SETUP ERROR
radio set wdt 10000
RECEIVED PACKET ERROR:

radio set wdt 10000
RECEIVED PACKET ERROR:

radio set wdt 10000
RECEIVED PACKET ERROR:

radio set wdt 10000
RECEIVED PACKET ERROR:

radio set wdt 10000
RECEIVED PACKET ERROR:

radio set wdt 10000
RECEIVED PACKET ERROR:

radio set wdt 10000
RECEIVED PACKET ERROR:

radio set wdt 10000
RECEIVED PACKET ERROR:

radio set wdt 10000
RECEIVED PACKET ERROR:




I am using this code to show error but I cant display error code

Serial.write("set freq ERROR: \n");
str=String(e);
str.toCharArray(b,5);
Serial.write(b);
Serial.write("\n");





Please, help me overcome these errors on receiver.

Thank you

Alex


Top
 Profile  
 
 Post subject: Re: UNO + cooking hacks + microchipRN2483A (receiver errors)
PostPosted: Mon Feb 12, 2018 8:40 am 

Joined: Mon Sep 28, 2009 12:06 pm
Posts: 11311
Hi AlexCo,

Have you modified the codes?

Have you tried to interchange the modules to see if the error appears in the same point?

Can you upload some photos to see your hardware configuration?

Thanks.

Regards.


Top
 Profile  
 
 Post subject: Re: UNO + cooking hacks + microchipRN2483A (receiver errors)
PostPosted: Mon Feb 12, 2018 2:52 pm 

Joined: Mon Feb 05, 2018 5:17 pm
Posts: 4
Source code is unmodified. Here is a picture of the setup.

Is there a unique program sample that does all things in order to avoid to burn multiple sketches?

Thanks a lot

Alex


[url]
https://ibb.co/dTpUo7
[/url]


Top
 Profile  
 
 Post subject: Re: UNO + cooking hacks + microchipRN2483A (receiver errors)
PostPosted: Tue Feb 13, 2018 8:23 am 

Joined: Mon Sep 28, 2009 12:06 pm
Posts: 11311
Hi AlexCo,

Have you tried to interchange the modules to see if the error appears in the same point?

Make sure that the modules are not too close when they try to communicate, sometime when they are to close, you can get some errors in the communication.

Can you try with this code in the receiver?

Code:
/* 
 *  ------ P2P Code Example --------
 * 
 *  Explanation: This example shows how to configure the module
 *  for P2P mode and the corresponding parameters. After this,
 *  the example shows how to receive packets from other radio modules
 *  which must be set with the same radio settings
 * 
 *  Copyright (C) 2015 Libelium Comunicaciones Distribuidas S.L.
 *  http://www.libelium.com
 * 
 *  This program is free software: you can redistribute it and/or modify 
 *  it under the terms of the GNU General Public License as published by 
 *  the Free Software Foundation, either version 3 of the License, or 
 *  (at your option) any later version. 
 *   
 *  This program is distributed in the hope that it will be useful, 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 *  GNU General Public License for more details. 
 *   
 *  You should have received a copy of the GNU General Public License 
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 *  Version:           1.3
 *  Design:            David Gascon
 *  Implementation:    Luismi Marti
 *  Ported to Arduino: Ruben Martin
 */

#include <Wire.h>

// Cooking API libraries
#include <arduinoUART.h>
#include <arduinoUtils.h>

// LoRaWAN library
#include <arduinoLoRaWAN.h>

// Pin definition for LoRaWAN module error LED:
const int error_led =  13;

//////////////////////////////////////////////
uint8_t socket = SOCKET1;
//////////////////////////////////////////////

// define radio settings
//////////////////////////////////////////////
uint8_t power = 15;
uint32_t frequency = 868100000;
char spreading_factor[] = "sf12";
char coding_rate[] = "4/5";
uint16_t bandwidth = 125;
char crc_mode[] = "on";
//////////////////////////////////////////////


// variable
uint8_t error;


void setup()
{
  //Radio P2P example - Receiving packets
  pinMode(error_led, OUTPUT);
  digitalWrite(error_led, LOW);

  // module setup
  error = radioModuleSetup();
 
  // Check status
  if (error == 0)
  {
    //Module configured OK
    digitalWrite(error_led, LOW);
  }
  else
  {
    //Module configured ERROR
    digitalWrite(error_led, HIGH);
  } 
}


void loop()
{
 
  //Listening to packets...
 
  // rx
  error = LoRaWAN.receiveRadio(10000);
 
  // Check status
  if (error == 0)
  {
    //--> Packet received
    //packet in LoRaWAN._buffer
    //length in LoRaWAN._length
    digitalWrite(error_led, LOW);
    // get SNR
    LoRaWAN.getRadioSNR();
    Serial.print("Packet length  = ");
    Serial.println(LoRaWAN._length);
    Serial.println("Packet content: ");
    for (int i = 0; i < LoRaWAN._length; i++)
      Serial.println(LoRaWAN._buffer[i]);
    Serial.print("Signal to Noise Ratio = ");
    Serial.println(LoRaWAN._radioSNR);
    //SNR in LoRaWAN._radioSNR
  }
  else
  {
    //Error waiting for packets. error
    // error code
    //  1: error
    //  2: no incoming packet
    digitalWrite(error_led, HIGH);
  } 
}


/***********************************************************************************
*
* radioModuleSetup()
*
*   This function includes all functions related to the module setup and configuration
*   The user must keep in mind that each time the module powers on, all settings are set
*   to default values. So it is better to develop a specific function including all steps
*   for setup and call it everytime the module powers on.
*
*
***********************************************************************************/
uint8_t radioModuleSetup()
{

  uint8_t status = 0;
  uint8_t e = 0;
 
  //////////////////////////////////////////////
  // 1. switch on
  //////////////////////////////////////////////
  e = LoRaWAN.ON(socket);

  // Check status
  if (e == 0)
  {
    //1. Switch ON OK
    digitalWrite(error_led, LOW);
  }
  else
  {
    //1. Switch ON error
    digitalWrite(error_led, HIGH);
    status = 1;
  }
  //-------------------------------------------------------

  //////////////////////////////////////////////
  // 2. Enable P2P mode
  //////////////////////////////////////////////
  e = LoRaWAN.macPause();

  // Check status
  if (e == 0)
  {
    //2. P2P mode enabled OK
    digitalWrite(error_led, LOW);
  }
  else
  {
    //2. Enable P2P mode error
    digitalWrite(error_led, HIGH);
    status = 1;
  }
  //-------------------------------------------------------

  //////////////////////////////////////////////
  // 3. Set/Get Radio Power
  //////////////////////////////////////////////

  // Set power
  e = LoRaWAN.setRadioPower(power);

  // Check status
  if (e == 0)
  {
    //3.1. Set Radio Power OK
    digitalWrite(error_led, LOW);
  }
  else
  {
    //3.1. Set Radio Power error
    digitalWrite(error_led, HIGH);
    status = 1;
  }

  // Get power
  e = LoRaWAN.getRadioPower();

  // Check status
  if (e == 0)
  {
    //3.2. Get Radio Power OK.
    //"Power in LoRaWAN._radioPower
    digitalWrite(error_led, LOW);
  }
  else
  {
    //3.2. Get Radio Power error
    digitalWrite(error_led, HIGH);
    status = 1;
  }
  //-------------------------------------------------------

  //////////////////////////////////////////////
  // 4. Set/Get Radio Frequency
  //////////////////////////////////////////////

  // Set frequency
  e = LoRaWAN.setRadioFreq(frequency);

  // Check status
  if (e == 0)
  {
    //4.1. Set Radio Frequency OK
    digitalWrite(error_led, LOW);
  }
  else
  {
    //4.1. Set Radio Frequency error
    digitalWrite(error_led, LOW);
    status = 1;
  }

  // Get frequency
  e = LoRaWAN.getRadioFreq();

  // Check status
  if (e == 0)
  {
    //4.2. Get Radio Frequency OK
    //Frequency in LoRaWAN._radioFreq
    digitalWrite(error_led, LOW);
  }
  else
  {
    //4.2. Get Radio Frequency error
    digitalWrite(error_led, HIGH);
    status = 1;
  }
  //-------------------------------------------------------

  //////////////////////////////////////////////
  // 5. Set/Get Radio Spreading Factor (SF)
  //////////////////////////////////////////////

  // Set SF
  e = LoRaWAN.setRadioSF(spreading_factor);

  // Check status
  if (e == 0)
  {
    //5.1. Set Radio SF OK
    digitalWrite(error_led, LOW);
  }
  else
  {
    //5.1. Set Radio SF error
    digitalWrite(error_led, HIGH);
    status = 1;
  }

  // Get SF
  e = LoRaWAN.getRadioSF();

  // Check status
  if (e == 0)
  {
    //5.2. Get Radio SF OK
    //Spreading Factor in LoRaWAN._radioSF
    digitalWrite(error_led, LOW);
  }
  else
  {
    //5.2. Get Radio SF error
    digitalWrite(error_led, HIGH);
    status = 1;
  }
  //-------------------------------------------------------

  //////////////////////////////////////////////
  // 6. Set/Get Radio Coding Rate (CR)
  //////////////////////////////////////////////

  // Set CR
  e = LoRaWAN.setRadioCR(coding_rate);

  // Check status
  if (e == 0)
  {
    //6.1. Set Radio CR OK
    digitalWrite(error_led, LOW);
  }
  else
  {
    //6.1. Set Radio CR error
    digitalWrite(error_led, HIGH);
    status = 1;
  }

  // Get CR
  e = LoRaWAN.getRadioCR();

  // Check status
  if (e == 0)
  {
    //6.2. Get Radio CR OK.
    //Coding Rate in LoRaWAN._radioCR
    digitalWrite(error_led, LOW);
  }
  else
  {
    //6.2. Get Radio CR error
    digitalWrite(error_led, HIGH);
    status = 1;
  }
  //-------------------------------------------------------

  //////////////////////////////////////////////
  // 7. Set/Get Radio Bandwidth (BW)
  //////////////////////////////////////////////

  // Set BW
  e = LoRaWAN.setRadioBW(bandwidth);

  // Check status
  if (e == 0)
  {
    //7.1. Set Radio BW OK
    digitalWrite(error_led, LOW);
  }
  else
  {
    //7.1. Set Radio BW error
    digitalWrite(error_led, HIGH);
  }

  // Get BW
  e = LoRaWAN.getRadioBW();

  // Check status
  if (e == 0)
  {
    //7.2. Get Radio BW OK.
    //Bandwidth in LoRaWAN._radioBW
    digitalWrite(error_led, LOW);
  }
  else
  {
    //7.2. Get Radio BW error
    digitalWrite(error_led, HIGH);
    status = 1;
  }
  //-------------------------------------------------------

  //////////////////////////////////////////////
  // 8. Set/Get Radio CRC mode
  //////////////////////////////////////////////

  // Set CRC
  e = LoRaWAN.setRadioCRC(crc_mode);

  // Check status
  if (e == 0)
  {
    //8.1. Set Radio CRC mode OK
    digitalWrite(error_led, LOW);
  }
  else
  {
    //8.1. Set Radio CRC mode error
    digitalWrite(error_led, HIGH);
    status = 1;
  }

  // Get CRC
  e = LoRaWAN.getRadioCRC();

  // Check status
  if (e == 0)
  {
    //8.2. Get Radio CRC mode OK.
    //CRC status in LoRaWAN._crcStatus
    digitalWrite(error_led, LOW);
  }
  else
  {
    //8.2. Get Radio CRC mode error
    digitalWrite(error_led, HIGH);
    status = 1;
  }
  //-------------------------------------------------------

  return status;
}


AlexCo wrote:
Is there a unique program sample that does all things in order to avoid to burn multiple sketches?

The codes configure the module, it is not necessary to upload the "LoRaWAN_P2P_01_configure_module" code, it is only an example of how to do it.

Regards

Thanks.

Regards.


Top
 Profile  
 
 Post subject: Re: UNO + cooking hacks + microchipRN2483A (receiver errors)
PostPosted: Wed Feb 14, 2018 11:19 am 

Joined: Mon Feb 05, 2018 5:17 pm
Posts: 4
Hello

Using your code for receiver makes it show no error and **something** is being received.

On the sender set I am sending this:


...
char data[] = "414141414141414142424242424242";
...
error = LoRaWAN.sendRadio(data);
...



Here is the output of the receiver set:

radio set pwr 15
radio get pwr
radio set freq 868100000
radio get freq
radio set sf sf12
radio get sf
radio set cr 4/5
radio get cr
radio set bw 125
radio get bw
radio set crc on
radio get crc
radio set wdt 10000
radio rx 0
radio get snr
Packet length = 3
Packet content:
55
0
10
Signal to Noise Ratio = 7
radio set wdt 10000
radio set wdt 10000
radio set wdt 10000
radio set wdt 10000
radio set wdt 10000

My doubts now are:

I am sending 15 bytes and receiver says that the packet length is 3...Then it outputs 55, 0 and 10.
Why is not being showed the data sent by sender set?

Thanks a lot

Alex


Top
 Profile  
 
 Post subject: Re: UNO + cooking hacks + microchipRN2483A (receiver errors)
PostPosted: Thu Feb 15, 2018 8:32 am 

Joined: Mon Sep 28, 2009 12:06 pm
Posts: 11311
Hi Alexco,

Nice to read that, this means that the modules are working correctly.

You get that data because you need to read the LoRaWAN buffer immediately after receiving the info, after "radio rx 0", if not, you have in the buffer other not valid information.

As you can see, you have to be careful with the serial.print because the LoRaWAN uses the UART and you only have got one UART in the Arduino.

Regards.


Top
 Profile  
 
 Post subject: UNO cooking hacks microchipRN2483A receiver errors
PostPosted: Tue Jul 24, 2018 5:42 pm 

Joined: Sat Jun 16, 2018 3:36 pm
Posts: 4
Location: Virgin Islands
Thanks John for the feedback.

I am using an OSEPP Uno clone, After checking with the OSEPP folks turns out that burning a "Duemilanove" bootloader to the R3 fixed the problem. I can now communicate to the R3 using Robotc

Thanks

Joe


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 7 posts ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Libelium theme based on 610nm Style by Daniel St. Jules of http://www.gamexe.net


© Libelium Comunicaciones Distribuidas S.L. | Terms of use.