P10 LILLIAD: Connected Learning Center : Différence entre versions
m (→Implementation) |
m (→Implementation) |
||
Ligne 66 : | Ligne 66 : | ||
Then, I created a bash script (implemented in Raspberry Pi) where it will make a query to the MySQL database to retrieve the file name and the it will connect to the SFTP server and download the given | Then, I created a bash script (implemented in Raspberry Pi) where it will make a query to the MySQL database to retrieve the file name and the it will connect to the SFTP server and download the given | ||
configuration file. | configuration file. | ||
+ | |||
+ | [[Fichier:Arch partial P10.PNG|frame|Parctial architecture of the system| center]] | ||
====Programming the sensors==== | ====Programming the sensors==== | ||
====Collecting log and sensor data==== | ====Collecting log and sensor data==== |
Version du 14 décembre 2015 à 23:23
The library of University of Lille 1 is in the transformation phase to becoming LILLIAD Learning Center Innovation by 2016. Based on strong service proposal, LILLIAD will offer a unique combination of discovery and experimentation of innovation through an event complex, an experimentarium, educational space and documentary collection. LILLIAD, as desired by University of Lille 1 and the region of Nord-Pas de Calais, will be a place to think, learn and discover about innovation. Situated in the heart of the campus, it will be accessible to companies, innovators, educational institutes and public.
Sommaire
Scope statement
Project overview
Context
Objective
The main goal of this project is to develop a user interface which allows the personnel of LILLIAD to use and maintain the deployed network of sensors.
Project description
LILLIAD is a modern building that will be equipped with huge network of sensors. These sensors will be used to capture and collect data (such as temperature, luminosity, AQI, etc.) to inform the users and personnel of LILLIAD. The sensors will be connected with a Raspberrry Pi in a star topology and the latter will be connected to the local area network (LAN). The Raspberry Pi could be used not only to send data (especially logs) to the central system but also to reconfigure the sensors.
Project phases
- Reservation of time slot to roll-out configuration
- Deploying configuration via network
- Programming the sensors
- Collecting log and sensor data
Work progress
Reservation of time slot to roll-out configuration
Objective
To enable an administrator to reserve a time slot through a web interface (where the configuration file will be uploaded) so that the boards (daughterboard, d2b) connected to the network are configured according to the schedule.
Conception
To manage the time slots, it’s important to have a database. Thus, I had to come up with a block diagram (of a databse) that describes relationships between each block.
To normalize the diagram, I had to identify the primary and foreign key and use intermediate table such as “configure” and “play_role” as described below:
Role(id[PK],roleName) User(id[PK],name,login,password) Play_role(roleId[FK->Role],userId[FK->User],PK[roleID,userId]) TimeSlot(startDate,startTime,endTime,PK(startDate,startTime)) Board(id,type,subId,PK(id,subId)) File(fileName[PK],fileDescription,fileChecksum) Configuration(startDate, startTime, idUser[FK->User],fileName[FK->File],[FK(startDate, startTime)->TimeSlot],PK(startDate, startTime)) Configure(startDate, startTime,id ,subId, [FK(startDate, startTime)->Configuration], [FK(id, subId)->Board],PK(startDate,startTime, id, subId)) |
Implementation
To implement the database, I started with the installation of LAMP stack in Linux. Thus, the packages “apache2, php5, mysql-server php5-mysql” were installed. Then, it was time I configured the MySQL database with the relational database model conceptualized earlier.
TODO : Web interface
Deploying configuration via network
Conception
To be able to configure equipment automatically via network, we need to have a file server where all the configuration files will be stored. Each equipment must retrieve those files and configure the boards (and the sensors) automatically.
Implementation
The configuration files will be stored in the main server (where the user will upload through a website). This server was configured to function as a SFTP server so that the files could be retrieved automatically through script.
#file: /etc/ssh/sshd_config Subsystem sftp internal-sftp Match user sftp_usr ChrootDirectory /sftp ForceCommand internal-sftp |
Then, I created a bash script (implemented in Raspberry Pi) where it will make a query to the MySQL database to retrieve the file name and the it will connect to the SFTP server and download the given configuration file.