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:
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?