Problem receiving 802.15.4 data frames in meshlium

How to configure Meshlium or use the Manager System
Post Reply
jvillalobos
Posts: 4
Joined: Wed Feb 16, 2011 11:11 am

Problem receiving 802.15.4 data frames in meshlium

Post by jvillalobos » Wed Feb 23, 2011 12:59 pm

Hi!

I'm working with meslium, following your "Storing 802.15.4/ZigBee Sensor Data on a Database" example (http://www.libelium.com/development/mes ... torialmw03).

I have all the codes in his places, I have create de database... I think all is correct, but the only thing that I see in meshlium is:

meshlium:/mnt/user# ./sniffer_ddbb S0 localhost
Connected to database: return:

=====================================================

This is the configuration of my meshlium:

Presets: Meshlium Zigbee AP
Network ID: 1234
Channel: 0x0D
Network address: 1122
Node ID: meshlium
Power Level: 4
Encrypted mode: off
MAC HIG: 13A200
MAC LOW: 406C1BB3

======================================================

And this is de code on my waspmote, is the same that you give us in the example, but it has the configuration parameters of the 802 net in his setup function:

Code: Select all

 
 packetXBee* paq_sent; 
 int8_t state=0; 
 long previous=0; 
 int g=0; 
 int i=0; 
 char X[10]; 
 float value=0; 
 char data[100]; 
 
#define  SENS_PIR       SENS_SOCKET7

uint8_t  PANID[2]={0x12,0x34};
int dirAlta = 0x22;
int dirBaja = 0x22;
char identificador[20] = "nodo1";
 
void setup() 
{ 
  // Inits the XBee 802.15.4 library 
  xbee802.init(XBEE_802_15_4,FREQ2_4G,NORMAL); 
 
  // Powers XBee 
  xbee802.ON(); 
 
  ACC.begin();    // opens I2C bus 
  ACC.setMode(ACC_ON); // starts accelerometer
  
  // Chosing Channel: 0x0D
  xbee802.setChannel(0x0D);
  if( !xbee802.error_AT ) XBee.println("Channel set OK");
  else XBee.println("Error while changing channel");
  
  // Chosing a PANID : PANID=0x1234
  xbee802.setPAN(PANID);
  if( !xbee802.error_AT ) XBee.println("PANID set OK");
  else XBee.println("Error while changing PANID");
 
  // Set 0x2222 as Network Addres
  xbee802.setOwnNetAddress(dirAlta,dirBaja); 
  if(xbee802.getOwnNetAddress() == 0){
    USB.print("NetAddress: ");
    for(i=0; i<2; i++)  
    {
      XBee.print(xbee802.sourceNA[i], HEX);
    }
    XBee.println("");
  }
  else{
    XBee.println("Error en getOwnAddress");
  }
  
  // Le damos al nodo un identificador
  xbee802.setNodeIdentifier(identificador);
  
  xbee802.writeValues();
  if( !xbee802.error_AT ) XBee.println("Changes stored OK");
  else XBee.println("Error while storing values");
} 
 
void loop() 
{ 
  sendData(); 
  delay(1000);
  Utils.blinkLEDs(100); 
} 
 
// sends a message changing it depending on the input option 
void sendData() 
{ 
   paq_sent=(packetXBee*) calloc(1,sizeof(packetXBee)); 
   paq_sent->mode=UNICAST; 
   paq_sent->MY_known=0; 
   paq_sent->packetID=0x52; 
   paq_sent->opt=0; 
   xbee802.hops=0; 
   xbee802.setOriginParams(paq_sent, "SENDER", NI_TYPE); 
 
   sprintf(data,"W01#ACCX#%d#ACCY#%d#ACCZ#%d%c%c",ACC.getX(), ACC.getY(), ACC.getZ(), '\r', '\n'); 
 
   xbee802.setDestinationParams(paq_sent, "0013A200406C1BB3", data, MAC_TYPE, DATA_ABSOLUTE); 
                                          
   state=xbee802.sendXBee(paq_sent); 
   if(!state) 
   { 
     XBee.println("OK"); 
   } 
   free(paq_sent); 
   paq_sent=NULL; 
} 
====================================================

The code on meshlium is the same you give us, but I have erased the reference in line 145 to the parameters "s4_id" and "s4_val". They don't appear in the rest of the code.


I can't find the problem, could you help me please?

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

Re: Problem receiving 802.15.4 data frames in meshlium

Post by libelium-dev » Fri Feb 25, 2011 2:48 pm

There is an errata in our example code. We're going to fix it and we'll notify you when updated.

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

Re: Problem receiving 802.15.4 data frames in meshlium

Post by libelium-dev » Mon Feb 28, 2011 11:00 am

We've fixed the example and also checked you're code, and it works well.

jvillalobos
Posts: 4
Joined: Wed Feb 16, 2011 11:11 am

Re: Problem receiving 802.15.4 data frames in meshlium

Post by jvillalobos » Mon Feb 28, 2011 12:30 pm

Hi again!

I'm sorry but are you sure to have uploaded the fixed code to the web?

I've download it and compare it with the older version and I thing it's exactly the same.

Could you check it please?

Thank you!

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

Re: Problem receiving 802.15.4 data frames in meshlium

Post by libelium-dev » Mon Feb 28, 2011 4:54 pm

I've re-checked it and it works. Be sure to put the MAC address of your meshlium's xbee in the waspmote code. Have you tried to put in a usb gateway to check if the problem is in the waspmote?

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests