connection between waspmote and meshilum

Post Reply
Posts: 21
Joined: Sun Mar 13, 2016 11:27 am

connection between waspmote and meshilum

Post by hajous » Fri Mar 17, 2017 3:24 pm

I want to send sensors value from the wasmpote to the meshlium and have this value in right form in the table of the local database

the probleme is that I can see frames in teh XCTU by the gateway but dont with the meshilum and the other problem is that the frame is not complete truncated)

there is the program :

// Step 1. Includes of the Sensor Board and Communications modules used

#include <WaspSensorCities.h>
#include <WaspSensorGas_v20.h>
#include <WaspXBeeZB.h>

// Step 2. Variables declaration

char sensor_temp[5] = "Temp";
char CO2_gaz[4] = "CO2";
char air_pressure[15] = "air_pressure";

long sequenceNumber = 0;

char nodeID[10] = "node 2";

char* sleepTime = "00:00:00:05";

char data[100];

float sensor_tempFloatValue;
float CO2_gazFloatValue;
float air_pressureFloatValue;

int sensor_tempIntValue;
int CO2_gazIntValue;
int air_pressureIntValue;

char sensor_tempString[10];
char CO2_gazString[10];
char air_pressureString[10];

char ACC_X[3] = "AX";
char ACC_Y[3] = "AY";
char ACC_Z[3] = "AZ";

int accelerometerX;
int accelerometerY;
int accelerometerZ;

char accelerometerXString[10];
char accelerometerYString[10];
char accelerometerZString[10];

int batteryLevel;
char batteryLevelString[10];
char BATTERY[4] = "BAT";

char TIME_STAMP[3] = "TS";

void setup()


// uint8_t panid[8]={0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01};
// xbeeZB.setPAN(panid);

void loop()
// Step 8. Turn on the Sensor Board

//Turn on the sensor board
//Turn on the RTC
//supply stabilization delay

//Turn on the accelerometer

// Step 9. Turn on the sensors


SensorGasv20.setSensorMode(SENS_ON, SENS_PRESSURE);

// Step 10. Read the sensors

//Reading acceleration in X axis
accelerometerX = ACC.getX();
//Conversion into a string
itoa(accelerometerX, accelerometerXString, 10);

//Reading acceleration in Y axis
accelerometerY = ACC.getY();
//Conversion into a string
itoa(accelerometerY, accelerometerYString, 10);

//Reading acceleration in Z axis
accelerometerZ = ACC.getZ();
//Conversion into a string
itoa(accelerometerZ, accelerometerZString, 10);

// First dummy reading for analog-to-digital converter channel selection
// Getting Battery Level
batteryLevel = PWR.getBatteryLevel();
// Conversion into a string
itoa(batteryLevel, batteryLevelString, 10);

//First dummy reading for analog-to-digital channel selection
//Sensor temperature reading
sensor_tempFloatValue = SensorCities.readValue(SENS_CITIES_TEMPERATURE);
//Conversion into a string
Utils.float2String(sensor_tempFloatValue, sensor_tempString, 2);

//First dummy reading to set analog-to-digital channel
CO2_gazFloatValue= SensorGasv20.readValue(SENS_CO2);
SensorGasv20.setSensorMode(SENS_OFF, SENS_CO2);
//Conversion into a string
Utils.float2String(CO2_gazFloatValue, CO2_gazString, 2);

//First dummy reading for analog-to-digital converter channel selection
//Sensor temperature reading
air_pressureFloatValue = SensorGasv20.readValue(SENS_PRESSURE);
//Conversion into a string
Utils.float2String(air_pressureFloatValue,air_pressureString, 2);

// Step 11. Turn off the sensors


// Step 12. Message composition

//Data payload composition
nodeID ,
ACC_X, accelerometerXString,
ACC_Y, accelerometerYString,
ACC_Z , accelerometerZString,
BATTERY, batteryLevelString,
TIME_STAMP, RTC.getTime(),
sensor_temp, sensor_tempString,
CO2_gaz , CO2_gazString,
air_pressure, air_pressureString);


delay (5000);


i use a fonction sed_msg and this is the code :
//envoi un tableau de char en broadcast sur le reseau xbee
#include <WaspXBeeZB.h>

void send_msg(char * message)

packetXBee* paq_sent;
int code;

paq_sent=(packetXBee*) calloc(1,sizeof(packetXBee));// Allocation mémoire dynamique de paq_sent
paq_sent->mode=UNICAST; //Broadcast Payload constatée = 86 ; en UNICAST c'est 78

paq_sent->opt=0; // No option selected.

xbeeZB.setDestinationParams(paq_sent, "0000000000000000", message , MAC_TYPE);
// 0000000000000000 : Just send to the COORDINATOR / 000000000000FFFF : BROADCAST
code=xbeeZB.sendXBee(paq_sent); // return '0' on success, '1' otherwise

free(paq_sent); // Libération mémoire de paq_sent
paq_sent = NULL;

the result that i see by the XCTU is :

I:node 2#N:0#AX:94#AY:-82#AZ:984#BAT:38#TS:Fri, 13/01/11, 18:13:24#Temp:-50.00#CO2:3

So I want to know why i could not see my frames by the web manger (meshlium)

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

Re: connection between waspmote and meshilum

Post by libelium-dev » Mon Mar 20, 2017 9:31 am


Have you used the code generator tool for generating your code? Code generator is deprecated, we recommend you use the example codes as starting point to create your code.

You can take a look at the examples for zigbee module here, ... cat=zigbee


Posts: 21
Joined: Sun Mar 13, 2016 11:27 am

Re: connection between waspmote and meshilum

Post by hajous » Mon Mar 20, 2017 4:24 pm

I want to send values of wasmpmote sensors to the meshlium
I use the code in the example of the IDE (sending gaz value by zigbee)
The problem is that I see frames on the ssh command mode but not on the web manager
please how can I see my frames in the web manger

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

Re: connection between waspmote and meshilum

Post by libelium-dev » Mon Mar 20, 2017 6:09 pm


Try to tun the sensor parser with this command

Code: Select all start

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest