-- MySQL dump 10.13  Distrib 5.5.49, for debian-linux-gnu (x86_64)
--
-- Host: 0.0.0.0    Database: iotlab
-- ------------------------------------------------------
-- Server version	5.5.49-0ubuntu0.14.04.1

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `Charts`
--

DROP TABLE IF EXISTS `Charts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `Charts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(50) DEFAULT NULL,
  `tipo` varchar(5) DEFAULT NULL,
  `formato` varchar(20) DEFAULT NULL,
  `botones` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `Charts`
--

LOCK TABLES `Charts` WRITE;
/*!40000 ALTER TABLE `Charts` DISABLE KEYS */;
INSERT INTO `Charts` VALUES (1,'Co2','2','line',1),(2,'Humidity','5','line',1),(3,'Temperature','8','line',1),(4,'Power Consumption','7','line',0),(5,'energy cost','10','bar',0),(6,'Co2 Lab','2','gauge',0),(7,'Hum Lab','5','numeric',0),(8,'Temp Lab','8','numeric',0);
/*!40000 ALTER TABLE `Charts` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `Menus`
--

DROP TABLE IF EXISTS `Menus`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `Menus` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(50) DEFAULT NULL,
  `url` varchar(100) DEFAULT NULL,
  `espadre` tinyint(1) DEFAULT NULL,
  `padre` int(3) DEFAULT NULL,
  `orden` int(3) DEFAULT NULL,
  `edit` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  UNIQUE KEY `Menus_id_unique` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `Menus`
--

LOCK TABLES `Menus` WRITE;
/*!40000 ALTER TABLE `Menus` DISABLE KEYS */;
INSERT INTO `Menus` VALUES (1,'Home','/',0,0,1,0),(2,'Use case','/use-case',1,0,2,0),(3,'General','/use-case/general',0,2,1,1),(4,'Smart Grid','#',0,2,2,1),(5,'SG Info','/use-case/smart-grid/info',0,2,3,1),(6,'Data','/use-case/smart-grid',0,2,4,1),(7,'Air Quality','#',0,2,5,1),(8,'AQ Info','/use-case/air-quality/info',0,2,6,1),(9,'Data','/use-case/air-quality',0,2,7,1),(10,'Contact','/contact',0,0,3,0);
/*!40000 ALTER TABLE `Menus` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `PageCharts`
--

DROP TABLE IF EXISTS `PageCharts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PageCharts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `idPage` int(11) DEFAULT NULL,
  `idChart` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `PageCharts`
--

LOCK TABLES `PageCharts` WRITE;
/*!40000 ALTER TABLE `PageCharts` DISABLE KEYS */;
INSERT INTO `PageCharts` VALUES (1,3,1),(2,3,3),(4,2,3),(5,3,2),(6,2,4),(7,2,5),(8,8,6),(9,8,7),(10,8,8);
/*!40000 ALTER TABLE `PageCharts` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `PageTypes`
--

DROP TABLE IF EXISTS `PageTypes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PageTypes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `PageTypes`
--

LOCK TABLES `PageTypes` WRITE;
/*!40000 ALTER TABLE `PageTypes` DISABLE KEYS */;
INSERT INTO `PageTypes` VALUES (1,'contenido'),(2,'dashboard');
/*!40000 ALTER TABLE `PageTypes` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `Pages`
--

DROP TABLE IF EXISTS `Pages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `Pages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `titulo` varchar(50) DEFAULT NULL,
  `url` varchar(100) DEFAULT NULL,
  `contenido` text,
  `tipo` int(2) DEFAULT NULL,
  `plantilla` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  UNIQUE KEY `Pages_id_unique` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `Pages`
--

LOCK TABLES `Pages` WRITE;
/*!40000 ALTER TABLE `Pages` DISABLE KEYS */;
INSERT INTO `Pages` VALUES (1,'Contacto','/contact','<p><img alt=\"logo cttc\" src=\"/static/images/iotworldR.png\" /></p>\r\n\r\n<p>mail: iotworld@cttc.es<br />\r\nIoTWORLD website:<a href=\"http://iotworld.cttc.es/\" target=\"_blank\">http://iotworld.cttc.es</a><br />\r\nCommunication Technologies Division (CTD)<br />\r\nCentre Tecnologic de Telecomunicacions de Catalunya (CTTC) -<a href=\"http://www.cttc.es/\" target=\"_blank\">www.cttc.es</a></p>\r\n',1,'contentPage'),(2,'Smart Grid','/use-case/smart-grid','',5,'usecase/smartgrid'),(3,'Air Quality Dashboard','/use-case/air-quality','',2,'usecase/templateChartBtns'),(5,'Smart Grid','/use-case/smart-grid/info','<p>The key elements of the E2SG set-up are:<br />\r\n&nbsp;</p>\r\n\r\n<p>&emsp; 1. A set of HVAC modules (Loads).<br />\r\n&emsp; 2. A set of actuators (IP LAN sockets) that control the HVAC modules.<br />\r\n&emsp; 3. A WSN, which sends measurements of temperature and energy consumption to a gateway.<br />\r\n&emsp; 4. A Control Center that incorporates the energy scheduling methods and connects the local network to the Internet. That is, contains a web server and a database to store the data received.<br />\r\n&emsp; 5. An embedded IP device (e.g., tablet or smartphone) with an interface to interact with the HVAC energy scheduler. It also displays both the temperature and the power consumption in the building measured by the WSN.</p>\r\n\r\n<p><br />\r\n<br />\r\n<img src=\"https://iotlab-local-iubeda.c9users.io/static/images/smartgrid1.png\" /><br />\r\n<img src=\"https://iotlab-local-iubeda.c9users.io/static/images/smartgrid2.png\" /><br />\r\n<img src=\"https://iotlab-local-iubeda.c9users.io/static/images/smartgrid3.png\" /></p>\r\n',1,'contentPage'),(6,'Air Quality','/use-case/air-quality/info','<p>The key elements of the ESEE set-up are:<br />\r\n&nbsp;</p>\r\n\r\n<p>&emsp; 1. A set of CO2, temperature and humidity sensors.<br />\r\n&emsp; 2. Two Wireless Sensor Networks (WSN) deployed in two diferent buildings.<br />\r\n&emsp; 3. A gateway, which is a plug computer, that connects both networks.<br />\r\n&emsp; 4. A Control Center that gathers the data and stores it in a MySQL database and connects the local network to the Internet.<br />\r\n&emsp; 5. An embedded IP device (e.g., tablet or smartphone) with an interface where the data gathered and the Air Quality level are displayed.</p>\r\n\r\n<p><br />\r\n<br />\r\n<img src=\"https://iotlab-local-iubeda.c9users.io/static/images/airquality1.png\" /><br />\r\n<img src=\"https://iotlab-local-iubeda.c9users.io/static/images/airquality2.png\" /></p>\r\n',1,'contentPage'),(7,'IotWorld','/','<p>IoTWORLD is a unique end-to-end experimental platform for the Internet of Things. It is focused on Wireless Communications systems and data analytics. It has been entirely developed by the Communication Technologies Division of CTTC.</p>\r\n\r\n<p>&nbsp;</p>\r\n\r\n<p>The heterogeneity of IoTWORLD is realized in a variety of available sensors, actuators, wireless technologies, Internet connectivity, and use cases already available. IoTWORLD relies on a 4-layer architecture.</p>\r\n\r\n<p><br />\r\n<img src=\"https://iotlab-local-iubeda.c9users.io/static/images/IoTWORLD_architecture_web.jpg\" /></p>\r\n\r\n<p>The bottom layer consists of heterogeneous low power sensing devices and actuators which permit to interact with the real world. Sensors include temperature, humidity, light, ultrasonic, accelerometers, CO2 level, power consumption meters, and a variety of eHealth sensors, among others. Various actuators are available in IoTWORLD: smart DC plugs, lights, and moving robots, among others.</p>\r\n\r\n<p>&nbsp;</p>\r\n\r\n<p>The second layer of IoTWORLD consists of a set of gateways which permit to gather the data sent by the sensing devices via heterogeneous wireless technologies. This can be done either in a single hop or via multihop routes. Moreover, the gateways can also store and analyze the data measurements, and communicate with data centers on the edge via software defined networking. Thereby, data analytics on the edge are enabled.</p>\r\n\r\n<p>&nbsp;</p>\r\n\r\n<p>Various wireless communication technologies are available in IoTWORLD to connect the sensors and actuators with the gateways. This includes Low Power Wide Area Networks, like LoRa and SigFox technologies, operating in SubGigahertz bands, as well as Zigbee and Low Power Wi-Fi.</p>\r\n\r\n<p>&nbsp;</p>\r\n\r\n<p>The gateways of IoTWORLD are implemented in Raspberry Pi 2 platforms. These are, essentially, small and low-cost computers which facilitate the flexibility and scalability of IoTWORLD. One of the functions of these gateways is to provide sensors and actuators with Internet connectivity to reach the cloud. This connectivity is provided in IoTWORLD via Ethernet, Wi-Fi, 3G and LTE, or operator-like Low Power Wide Area Networks. Another important function of the gateways is to provide distributed data analytics capabilities of the gathered measurements. Moreover, they can be connected to data centers in the cloud through software defined networking.</p>\r\n\r\n<p>&nbsp;</p>\r\n\r\n<p>The third layer lies on the cloud. Distributed data storage and applications running on the cloud are available in IoTWORLD.</p>\r\n\r\n<p>&nbsp;</p>\r\n\r\n<p>The top layer of IoTWORLD consists of the user layer. Users can interact with IoTWORLD through applications running in their computing devices, such as tablets, smartphones, or personal computers.</p>\r\n\r\n<p>&nbsp;</p>\r\n\r\n<p>The overall architecture is independent of the number of simultaneous running networks and connected nodes. Therefore, it is extremely flexible and scalable, as it is desired for a platform devoted to experiment with the Internet of Things.</p>\r\n',1,'contentPage'),(8,'General','/use-case/general','',2,'usecase/general');
/*!40000 ALTER TABLE `Pages` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `SensorDetails`
--

DROP TABLE IF EXISTS `SensorDetails`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SensorDetails` (
  `tipo` int(11) NOT NULL DEFAULT '0',
  `nombre` varchar(255) DEFAULT NULL,
  `unidad` varchar(255) DEFAULT NULL,
  `evento` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`tipo`),
  UNIQUE KEY `tipo` (`tipo`),
  UNIQUE KEY `SensorDetails_tipo_unique` (`tipo`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `SensorDetails`
--

LOCK TABLES `SensorDetails` WRITE;
/*!40000 ALTER TABLE `SensorDetails` DISABLE KEYS */;
INSERT INTO `SensorDetails` VALUES (2,'CO2','ppm','co2'),(5,'Humidity','%','hum'),(7,'Power Consumption','W','halleff'),(8,'Temperature','ºC','temp'),(10,'Energy cost','€','cost'),(11,'Unknown','Unknown','unk');
/*!40000 ALTER TABLE `SensorDetails` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `SensorLocations`
--

DROP TABLE IF EXISTS `SensorLocations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SensorLocations` (
  `address` int(11) NOT NULL DEFAULT '0',
  `nombre` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`address`),
  UNIQUE KEY `address` (`address`),
  UNIQUE KEY `SensorLocations_address_unique` (`address`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `SensorLocations`
--

LOCK TABLES `SensorLocations` WRITE;
/*!40000 ALTER TABLE `SensorLocations` DISABLE KEYS */;
INSERT INTO `SensorLocations` VALUES (1,'Lab Temp1'),(2,'Lab Hum1'),(3,'Lab Temp2'),(4,'Lab Hum2'),(5,'Hall-effect Load_1'),(6,'Hall-effect Load_2'),(7,'Hall-effect Load_3'),(8,'CO2_Lab'),(9,'CO2_Audit'),(11,'outside Temp'),(12,'outside Hum'),(15,'CO2_Floor1'),(16,'CO2_Corridor'),(80,'Load 1'),(81,'Load 2'),(82,'Load 3'),(83,'Energy Cost 1'),(84,'Energy Cost 2');
/*!40000 ALTER TABLE `SensorLocations` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `Sensors`
--

DROP TABLE IF EXISTS `Sensors`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `Sensors` (
  `identifier` varchar(255) NOT NULL DEFAULT '',
  `name` varchar(255) DEFAULT NULL,
  `type` int(11) DEFAULT NULL,
  `address` int(11) DEFAULT NULL,
  `lastseq` int(11) DEFAULT NULL,
  `createdAt` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `updatedAt` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `active` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`identifier`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `Sensors`
--

LOCK TABLES `Sensors` WRITE;
/*!40000 ALTER TABLE `Sensors` DISABLE KEYS */;
INSERT INTO `Sensors` VALUES ('1+8','Sensor of type 8',8,1,1,'2014-09-01 12:16:03','2016-03-07 06:14:17',1),('11+8','Sensor of type 8',8,11,1,'2015-11-16 11:36:54','2016-03-04 02:00:37',0),('12+5','Sensor of type 5',5,12,1,'2015-11-16 11:36:54','2016-03-04 02:00:37',0),('15+2','Sensor of type 2',2,15,1,'2015-09-07 13:12:47','2015-09-23 01:25:08',1),('16+2','Sensor of type 2',2,16,NULL,'0000-00-00 00:00:00','0000-00-00 00:00:00',0),('2+5','Sensor of type 5',5,2,1,'2014-09-01 12:16:03','2016-03-07 06:14:17',1),('3+8','Sensor of type 8',8,3,1,'2014-09-01 12:15:38','2016-03-07 06:14:17',1),('4+5','Sensor of type 5',5,4,1,'2014-09-01 12:15:38','2016-03-07 06:14:17',1),('5+7','Sensor of type 7',7,5,1,'2014-09-01 12:15:57','2016-03-14 14:58:50',0),('6+7','Sensor of type 7',7,6,1,'2014-09-01 12:15:50','2016-03-14 14:58:51',0),('7+7','Sensor of type 7',7,7,1,'2014-09-01 12:15:54','2016-03-14 14:58:52',1),('8+2','Sensor of type 2',2,8,1,'2014-09-01 11:58:40','2016-03-14 14:58:51',1),('80+11','Sensor of type 11',11,80,1,'0000-00-00 00:00:00','0000-00-00 00:00:00',0),('81+11','Sensor of type 11',11,81,1,'0000-00-00 00:00:00','0000-00-00 00:00:00',0),('82+11','Sensor of type 11',11,82,1,'0000-00-00 00:00:00','0000-00-00 00:00:00',0),('83+10','Sensor of type 10',10,83,1,'0000-00-00 00:00:00','0000-00-00 00:00:00',1),('9+2','Sensor of type 2',2,9,1,'0000-00-00 00:00:00','2015-09-23 01:25:08',0);
/*!40000 ALTER TABLE `Sensors` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `Users`
--

DROP TABLE IF EXISTS `Users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `Users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(50) DEFAULT NULL,
  `pass` varchar(200) DEFAULT NULL,
  `tipo` int(2) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `Users`
--

LOCK TABLES `Users` WRITE;
/*!40000 ALTER TABLE `Users` DISABLE KEYS */;
INSERT INTO `Users` VALUES (1,'admin','21232f297a57a5a743894a0e4a801fc3',1);
/*!40000 ALTER TABLE `Users` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2016-06-20  8:42:52

/* mysqldump -u iubeda -p iotlab Charts Menus PageCharts PageTypes Pages SensorDetails SensorLocations Sensors Users > production_script.sql */