display waspmote P&S noise level sensor to my Meshlium gateway , Visualizer

Post Reply
samkabare
Posts: 20
Joined: Mon Sep 18, 2017 11:17 am
Company: Cyberteq

display waspmote P&S noise level sensor to my Meshlium gateway , Visualizer

Post by samkabare » Thu Nov 09, 2017 7:32 am

Dear
I would like to thanks you for your great support that are allowing me to improve more with libelium Devices.
but am now able to get data from sensors on my local computer. i have connected my meshlium gateway and am able to get access via WIfi , to inter in http://10.10.10.1/ManagerSystem/ and by Ethernet then how can get sensor data to the meshlium when am trying with visualizer i get this :

Meshlium blocked

The license validation was not completed
Unable to connect, please check your internet connection

Unable to connect, please check your internet connection.

What can i do now to display my waspmote P&S noise level sensor to my Meshlium gateway , Visualizer ?

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

Re: display waspmote P&S noise level sensor to my Meshlium gateway , Visualizer

Post by libelium-dev » Thu Nov 09, 2017 8:44 am

Hi samkabare,

We are so glad about your progress. All the sensor information is saved in Meshlium and available through the Manager System under the "Sensor Network" section. (http://www.libelium.com/downloads/docum ... _guide.pdf - page 43). In this section, you can check the current status of all devices. If you need more detailed information, you can click on the "Capturer" subsection where you can find all information stored in the Meshlium database (http://www.libelium.com/downloads/docum ... _guide.pdf - page 51).

On the other hand, we offer the customers who bought IoT Vertical Kits the possibility of using Meshlium Visualizer in order to watch all the sensor values in graphs. This service includes 100 visualizations in this kind of kits. This is a paid service and after this 100 visualizations, customers have to contact their sales agent or Libelium Sales Department (http://www.libelium.com/downloads/docum ... _guide.pdf - page 63).

Hope this information helps you.

Best regards,

samkabare
Posts: 20
Joined: Mon Sep 18, 2017 11:17 am
Company: Cyberteq

Get noise level data into meshlium

Post by samkabare » Thu Nov 16, 2017 11:04 am

Dear Team ;
Am thanking you for the following support you are given without you i couldn't have reach here .
Now this my question ,Am able to get noise level sensor data on my local computer using waspmote pro IDE.
The output is like this :
H#
Reading Noise Level Sensor
Sound Pressure Level with A-Weighting (SLOW): 50.0962982177 dBA
Sound Pressure Level with A-Weighting (SLOW): 50.7660980224 dBA
Sound Pressure Level with A-Weighting (SLOW): 49.9928970336 dBA
.
.
.
SO now am trying to view my this noise level sensor output on my meshlium but i can't see anything what can i do
because am now searching for a dashboard application where i can display my sensor output .
thanx.


using 192.168.1.100 as static ip and am able to inter PHP myadmin from the meshlium

Am connected though the following meshlium :
Meshlium Info
------------------
Hardware model Meshlium 4G 802.15.4 AP EU

Radio Interfaces 4G, 802.15.4, AP
Serial Number 17146092103519

ManagerSystem Version 4.0.3

GPS Feature Yes

Ethernet MAC 00:0d:b9:44:f9:80

Wifi AP MAC 04:f0:21:2c:74:b7

Wifi AP ESSID meshliumf980

RF modules

Module 1

Socket socket1

Hardware model XBee 802.15.4

MAC 000013A20041678B18



Am waiting fro your good response that i hope will help me to move forward !.

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

Re: display waspmote P&S noise level sensor to my Meshlium gateway , Visualizer

Post by libelium-dev » Fri Nov 17, 2017 8:49 am

Hi,

What communication module does your P&S have? You should develop a code which read the noise sensor and send data to Meshlium through the radio module the P&S has. For example, if you P&S has XBee802 module, you should combine the following example code.
http://www.libelium.com/development/was ... l-sensorg/
http://www.libelium.com/development/was ... d-packets/

Regards

samkabare
Posts: 20
Joined: Mon Sep 18, 2017 11:17 am
Company: Cyberteq

Re: display waspmote P&S noise level sensor to my Meshlium gateway , Visualizer

Post by samkabare » Tue Nov 21, 2017 1:20 pm

communication module does my P&S have xbee 802.15.4 and i have develop a code which read the noise sensor and send data to Meshlium through the radio module the P&S has. P&S has XBee802 module, i combined the following example code.
http://www.libelium.com/development/was ... l-sensorg/
http://www.libelium.com/development/was ... d-packets/

and this the output am getting :

H#
Reading Noise Level Sensor
Sound Pressure Level with A-Weighting (SLOW): 48.7613983154 dBA
Sound Pressure Level with A-Weighting (SLOW): 49.6670989990 dBA
======================================================================

H#
Sending packets example
send error
send error
send error
send error
send error

can you please help still i can't see anything from my noise level sensor to Meshlium gateway ?

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

Re: display waspmote P&S noise level sensor to my Meshlium gateway , Visualizer

Post by libelium-dev » Tue Nov 21, 2017 2:40 pm

Hi,

First of all, you should configure the same PANID and channel than Meshlium. You can see the configuration parameters of the XBee of Meshlium in the Meshlium Manager system (Sensor Networks -> RF Modules). Then you should configure the same parameters in the P&S using the 802 01: Configure XBee example code.

Here you can see a tutorial to send data from Waspmote to Meshlium using XBee 802.15.4 modules.
http://www.libelium.com/development/was ... -tutorial/

On the other hand, you should develop your own code using the example codes that we share in our above post. You don't have to upload a code to the P&S and then upload the another code. For example,

Code: Select all

#include <WaspSensorCities_PRO.h>
#include <WaspXBee802.h>
#include <WaspFrame.h>

// Destination MAC address
//////////////////////////////////////////
char RX_ADDRESS[] = "MESHLIUM_ADDRESS";
//////////////////////////////////////////

// Define the Waspmote ID
char WASPMOTE_ID[] = "node_01";

// define variable
uint8_t error;

void setup()
{
  // init USB port
  USB.ON();
  USB.println(F("Sending packets example"));
  
  // store Waspmote identifier in EEPROM memory
  frame.setID( WASPMOTE_ID );
}

void loop()
{
  // Configure the noise sensor for UART communication
  noise.configure(); 
  // Get a new measure of the SPLA from the noise sensor
  int status = noise.getSPLA(SLOW_MODE);

  if (status == 0) 
  {
    USB.print(F("Sound Pressure Level with A-Weighting (SLOW): "));
    USB.print(noise.SPLA);
    USB.println(F(" dBA"));
  }
  else
  {
    USB.println(F("[CITIES PRO] Communication error. No response from the audio sensor (SLOW)"));
  }
  ///////////////////////////////////////////
  // 1. Create ASCII frame
  ///////////////////////////////////////////  

  // create new frame
  frame.createFrame(ASCII);  
  
  // add frame fields
  frame.addSensor(SENSOR_CITIES_PRO_NOISE, noise.SPLA);

  frame.showFrame();

  ///////////////////////////////////////////
  // 2. Send packet
  ///////////////////////////////////////////  
    
  // init XBee
  xbee802.ON();
  // send XBee packet
  error = xbee802.send( RX_ADDRESS, frame.buffer, frame.length );   
  
  // 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();
  }

  // wait for five seconds
  delay(5000);
}
Regards

samkabare
Posts: 20
Joined: Mon Sep 18, 2017 11:17 am
Company: Cyberteq

Re: display waspmote P&S noise level sensor to my Meshlium gateway , Visualizer

Post by samkabare » Thu Nov 23, 2017 11:03 am

HI!

Thank you dear for your great support giving to us . I tried to follow everything you mansion in the above answers , still
i can't reach on getting sensor data on meshlium . Look on the below is my RF modules configure same pan id , Chanel in P&S Configure XBee 802.15.4

RF modules
---------------

Disable Service


Module 1
802.15.4

SensorParser Running Start

PAN ID: 1234
Channel:0x0f
Network address (4 hex digits): 0
Node ID: meshlium802

Power Level:4
Encrypted mode: off
Encryption key (must be 16 characters): libelium2015MVXB
MAC high: 0013A200
MAC low: 41678B18



Capturer
---------
Local DataBase
Connection data
Database:MeshliumDB
Table:sensorParser
IP:localhost
Port:3306
User:root
Password:libelium2007
Auto-purge Keep the last 1
days in the database
deleting only synchronized data
deleting all dataSave
Show data Last 100 insertions.


In the below after show data i can't see anything from sensor on my meshlium .

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

Re: display waspmote P&S noise level sensor to my Meshlium gateway , Visualizer

Post by libelium-dev » Thu Nov 23, 2017 2:04 pm

Hi,

Could you please share with us the code uploaded to the P&S and the output through the serial monitor?

Regards

samkabare
Posts: 20
Joined: Mon Sep 18, 2017 11:17 am
Company: Cyberteq

Re: display waspmote P&S noise level sensor to my Meshlium gateway , Visualizer

Post by samkabare » Fri Dec 01, 2017 1:41 pm

Hi !
Thank you for your response in the bellow this the code uploaded on my P&S which

* ------------ [SCP_v30_08] - Noise Level Sensor --------------
*
* Explanation: This is the basic code to manage and read the noise
* level sensor. The sensor can be configured at SLOW (1 second of
* measuring) and SLOW (125 milliseconds of measuring).
*
* Copyright (C) 2016 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: 3.0
* Design: David Gascón
* Implementation: Ahmad Saad Al Kalla
*/


#include <WaspSensorCities_PRO.h>

void setup()
{
USB.ON();
USB.println(F("Reading Noise Level Sensor"));
// Configure the noise sensor for UART communication
noise.configure();
}


void loop()
{

// Get a new measure of the SPLA from the noise sensor
int status = noise.getSPLA(SLOW_MODE);

if (status == 0)
{
USB.print(F("Sound Pressure Level with A-Weighting (SLOW): "));
USB.print(noise.SPLA);
USB.println(F(" dBA"));
}
else
{
USB.println(F("[CITIES PRO] Communication error. No response from the audio sensor (SLOW)"));
}

delay(5);

}


Output from Serial Monitor
-------------------------------------------------------------
H#
Reading Noise Level Sensor
Sound Pressure Level with A-Weighting (SLOW): 60.6277999877 dBA
Sound Pressure Level with A-Weighting (SLOW): 59.2125968933 dBA
Sound Pressure Level with A-Weighting (SLOW): 65.1796951293 dBA
Sound Pressure Level with A-Weighting (SLOW): 68.3559951782 dBA
Sound Pressure Level with A-Weighting (SLOW): 65.0639953613 dBA
Sound Pressure Level with A-Weighting (SLOW): 62.7895965576 dBA
Sound Pressure Level with A-Weighting (SLOW): 62.0357971191 dBA
Sound Pressure Level with A-Weighting (SLOW): 65.4482955932 dBA
Sound Pressure Level with A-Weighting (SLOW): 58.7721977233 dBA
Sound Pressure Level with A-Weighting (SLOW): 62.5567970275 dBA
Sound Pressure Level with A-Weighting (SLOW): 60.7723999023 dBA
Sound Pressure Level with A-Weighting (SLOW): 70.8780975341 dBA
Sound Pressure Level with A-Weighting (SLOW): 86.0822982788 dBA
Sound Pressure Level with A-Weighting (SLOW): 51.3008003234 dBA
Sound Pressure Level with A-Weighting (SLOW): 54.6769981384 dBA
Sound Pressure Level with A-Weighting (SLOW): 54.4911994934 dBA
Sound Pressure Level with A-Weighting (SLOW): 59.3477973937 dBA
Sound Pressure Level with A-Weighting (SLOW): 63.6949996948 dBA
Sound Pressure Level with A-Weighting (SLOW): 75.0275955200 dBA
Sound Pressure Level with A-Weighting (SLOW): 74.7716979980 dBA
Sound Pressure Level with A-Weighting (SLOW): 56.4072990417 dBA
Sound Pressure Level with A-Weighting (SLOW): 53.8042984008 dBA
Sound Pressure Level with A-Weighting (SLOW): 71.1617965698 dBA


The Only problem was how to get this output from my Meshlium gateway which is on my AP ?
I really appreciate your support on the forum without you i couldn't even reach on this stage.
Thnx.

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

Re: display waspmote P&S noise level sensor to my Meshlium gateway , Visualizer

Post by libelium-dev » Mon Dec 04, 2017 1:20 pm

Hi,

That code reads the noise sensor and print the values through the serial monitor but it doesn't send the data to Meshlium. For that, you should develop your own code.

We shared with you in a previos post a code that read the sensor and then send that to Meshlium through XBee802. You should use that code.

Code: Select all

#include <WaspSensorCities_PRO.h>
#include <WaspXBee802.h>
#include <WaspFrame.h>

// Destination MAC address
//////////////////////////////////////////
char RX_ADDRESS[] = "MESHLIUM_ADDRESS";
//////////////////////////////////////////

// Define the Waspmote ID
char WASPMOTE_ID[] = "node_01";

// define variable
uint8_t error;

void setup()
{
  // init USB port
  USB.ON();
  USB.println(F("Sending packets example"));
  
  // store Waspmote identifier in EEPROM memory
  frame.setID( WASPMOTE_ID );
}

void loop()
{
  // Configure the noise sensor for UART communication
  noise.configure(); 
  // Get a new measure of the SPLA from the noise sensor
  int status = noise.getSPLA(SLOW_MODE);

  if (status == 0) 
  {
    USB.print(F("Sound Pressure Level with A-Weighting (SLOW): "));
    USB.print(noise.SPLA);
    USB.println(F(" dBA"));
  }
  else
  {
    USB.println(F("[CITIES PRO] Communication error. No response from the audio sensor (SLOW)"));
  }
  ///////////////////////////////////////////
  // 1. Create ASCII frame
  ///////////////////////////////////////////  

  // create new frame
  frame.createFrame(ASCII);  
  
  // add frame fields
  frame.addSensor(SENSOR_CITIES_PRO_NOISE, noise.SPLA);

  frame.showFrame();

  ///////////////////////////////////////////
  // 2. Send packet
  ///////////////////////////////////////////  
    
  // init XBee
  xbee802.ON();
  // send XBee packet
  error = xbee802.send( RX_ADDRESS, frame.buffer, frame.length );   
  
  // 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();
  }

  // wait for five seconds
  delay(5000);
}
On the other hand, first you have to configure the XBee inside the P&S with the same configuration than Meshlium. You can use this code

Code: Select all

/*  
 *  ------ [802_01] - configure XBee basic parameters -------- 
 *  
 *  Explanation: This program shows how to configure basic XBee
 *  parameters in order to communicate between different XBee 
 *  devices using the same network. 
 *  
 *  Copyright (C) 2016 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:           3.0
 *  Design:            David Gascón 
 *  Implementation:    Yuri Carmona
 */

#include <WaspXBee802.h>

// PAN (Personal Area Network) Identifier
uint8_t  panID[2] = {0x12,0x34}; 

// Define Freq Channel to be set: 
// Center Frequency = 2.405 + (CH - 11d) * 5 MHz
//   Range: 0x0B - 0x1A (XBee)
//   Range: 0x0C - 0x17 (XBee-PRO)
uint8_t  channel = 0x0F;

// Define the Encryption mode: 1 (enabled) or 0 (disabled)
uint8_t encryptionMode = 0;

// Define the AES 16-byte Encryption Key
char  encryptionKey[] = "WaspmoteLinkKey!"; 


void setup()
{
  // open USB port
  USB.ON();

  USB.println(F("-------------------------------"));
  USB.println(F("Configure XBee 802.15.4"));
  USB.println(F("-------------------------------"));

  // init XBee 
  xbee802.ON();


  /////////////////////////////////////
  // 1. set channel 
  /////////////////////////////////////
  xbee802.setChannel( channel );

  // check at commmand execution flag
  if( xbee802.error_AT == 0 ) 
  {
    USB.print(F("1. Channel set OK to: 0x"));
    USB.printHex( xbee802.channel );
    USB.println();
  }
  else 
  {
    USB.println(F("1. Error calling 'setChannel()'"));
  }


  /////////////////////////////////////
  // 2. set PANID
  /////////////////////////////////////
  xbee802.setPAN( panID );

  // check the AT commmand execution flag
  if( xbee802.error_AT == 0 ) 
  {
    USB.print(F("2. PAN ID set OK to: 0x"));
    USB.printHex( xbee802.PAN_ID[0] ); 
    USB.printHex( xbee802.PAN_ID[1] ); 
    USB.println();
  }
  else 
  {
    USB.println(F("2. Error calling 'setPAN()'"));  
  }

  /////////////////////////////////////
  // 3. set encryption mode (1:enable; 0:disable)
  /////////////////////////////////////
  xbee802.setEncryptionMode( encryptionMode );

  // check the AT commmand execution flag
  if( xbee802.error_AT == 0 ) 
  {
    USB.print(F("3. AES encryption configured (1:enabled; 0:disabled):"));
    USB.println( xbee802.encryptMode, DEC );
  }
  else 
  {
    USB.println(F("3. Error calling 'setEncryptionMode()'"));
  }

  /////////////////////////////////////
  // 4. set encryption key
  /////////////////////////////////////
  xbee802.setLinkKey( encryptionKey );

  // check the AT commmand execution flag
  if( xbee802.error_AT == 0 ) 
  {
    USB.println(F("4. AES encryption key set OK"));
  }
  else 
  {
    USB.println(F("4. Error calling 'setLinkKey()'")); 
  }

  /////////////////////////////////////
  // 5. write values to XBee module memory
  /////////////////////////////////////
  xbee802.writeValues();

  // check the AT commmand execution flag
  if( xbee802.error_AT == 0 ) 
  {
    USB.println(F("5. Changes stored OK"));
  }
  else 
  {
    USB.println(F("5. Error calling 'writeValues()'"));   
  }

  USB.println(F("-------------------------------")); 
}



void loop()
{

  /////////////////////////////////////
  // 1. get channel 
  /////////////////////////////////////
  xbee802.getChannel();
  USB.print(F("channel: "));
  USB.printHex(xbee802.channel);
  USB.println();

  /////////////////////////////////////
  // 2. get PANID
  /////////////////////////////////////
  xbee802.getPAN();
  USB.print(F("panid: "));
  USB.printHex(xbee802.PAN_ID[0]); 
  USB.printHex(xbee802.PAN_ID[1]); 
  USB.println(); 

  /////////////////////////////////////
  // 3. get encryption mode (1:enable; 0:disable)
  /////////////////////////////////////
  xbee802.getEncryptionMode();
  USB.print(F("encryption mode: "));
  USB.printHex(xbee802.encryptMode);
  USB.println(); 

  USB.println(F("-------------------------------")); 

  delay(3000);
}
Regards

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest