XBEE

MIKron
Posts: 23
Joined: Wed Feb 27, 2019 9:20 am
Company: Ability

Re: XBEE

Post by MIKron » Mon Mar 25, 2019 4:57 am

Battery charged (96%).

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: XBEE

Post by libelium-dev » Mon Mar 25, 2019 9:27 am

Hi,

If none of the two modules is working in Waspmote, please fill the RMA form and out tech support team will contact you to solve the issue.
https://www.libelium.com/contact/#rma

Regards

MIKron
Posts: 23
Joined: Wed Feb 27, 2019 9:20 am
Company: Ability

Re: XBEE

Post by MIKron » Wed Mar 27, 2019 7:41 am

Hi,

We need send only XBEE module or complete Waspmote with Gate?

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: XBEE

Post by libelium-dev » Wed Mar 27, 2019 11:38 am

Hi,

Ones you fill the RMA form, our colleagues from tech support department will give you instruction about that. Anyway, you will have to send Waspmote + XBee nodes to make sure your Waspmote works with the your XBee modules.

Regards

MIKron
Posts: 23
Joined: Wed Feb 27, 2019 9:20 am
Company: Ability

Re: XBEE

Post by MIKron » Mon Apr 01, 2019 10:51 am

Hi,

Now we have a Waspmore default code running without error. But there is still an one question. I created a simple firmware for device ^

Code: Select all

#include <WaspXBee802.h>
#include <WaspSensorAgr_v30.h>

uint8_t error;

float temp,humd,pres;

char RX_ADDRESS[] = "000000000000FFFF";

void setup() 
{
  USB.println(F("Start program"));  

  error =  xbee802.ON();

  if (error == 0)
  {    
    USB.println(F("1. XBEEi switched ON"));
  }
  else
  {
    USB.println(F("1. XBEE did not initialize correctly"));
  }
  
  Agriculture.ON(); 

  USB.println(F("2. Agriculture sensor board OK"));
}

void loop()
{    
  temp = Agriculture.getTemperature();
  humd  = Agriculture.getHumidity();
  pres = Agriculture.getPressure();  

  USB.print(F("Temperature: "));
  USB.print(temp);
  USB.println(F(" Celsius"));
  USB.print(F("Humidity: "));
  USB.print(humd);
  USB.println(F(" %"));  
  USB.print(F("Pressure: "));
  USB.print(pres);
  USB.println(F(" Pa"));  
  USB.println(); 


uint8_t *a1;
uint8_t *a2;
uint8_t *a3;

a1 = (uint8_t*)(&temp);
a2 = (uint8_t*)(&humd);
a3 = (uint8_t*)(&pres);

uint8_t data[] = { 
  a1[0], a1[1], a1[2], a1[3],
  a2[0], a2[1], a2[2], a2[3],
  a3[0], a3[1], a3[2], a3[3]};

// send XBee packet
  error = xbee802.send( RX_ADDRESS, data, 12 );   
  
  // check TX flag
  if( error == 0 )
  {
    USB.println(F("send ok"));
    
    // blink green LED
    Utils.blinkGreenLED();
    
  }
  else 
  {
    USB.println(F("send error"));
    
    // blink red LED
    Utils.blinkRedLED();
  }

  USB.println(F("Wait 30 seconds...\n")); 
  delay(30000);
}

There are 12 bytes are sending, but with our external console app we receive 29 bytes from gateway serial port. Why so?

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: XBEE

Post by libelium-dev » Tue Apr 02, 2019 8:51 am

Hi,

What data are you sending? What data is received in the app?

Every packet contains a Source Address and Destination Address field in its header. We think that the behavior of you nodes is normal.

Regards

MIKron
Posts: 23
Joined: Wed Feb 27, 2019 9:20 am
Company: Ability

Re: XBEE

Post by MIKron » Tue Apr 02, 2019 9:09 am

Hi,

As you can see in code above, we send :

uint8_t data[] = {
a1[0], a1[1], a1[2], a1[3],
a2[0], a2[1], a2[2], a2[3],
a3[0], a3[1], a3[2], a3[3]};

// send XBee packet
error = xbee802.send( RX_ADDRESS, data, 12 );

How many bytes in XBEE packet header?

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: XBEE

Post by libelium-dev » Wed Apr 03, 2019 8:35 am

Hi,

The header are 15 bytes. Could you please print data through the serial monitor before sending and share with us the output? We want o see the exact data send and the data received.

Regards

MIKron
Posts: 23
Joined: Wed Feb 27, 2019 9:20 am
Company: Ability

Re: XBEE

Post by MIKron » Wed Apr 03, 2019 8:44 am

So, header 15 we sent 12 and we have 27 in total. Where comes 2 additional bytes? Some delimeters? There are outputs from Wasmote and gate :

Image Image

MIKron
Posts: 23
Joined: Wed Feb 27, 2019 9:20 am
Company: Ability

Re: XBEE

Post by MIKron » Wed Apr 03, 2019 8:56 am

It seems that result XBEE packet is 15 bytes header + 1 byte separator + <original sent bytes message> + 1 byte separator . At least, it ts seems true in out case .

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest