P10 LILLIAD: Connected Learning Center

De Wiki d'activités IMA
LILLIAD interior view

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.



Scope statement

Project overview

Context

To enrich the user experience, the new library will be equipped with multiple sensors (for temperature, etc.) in large scale. However, it requires a lot of effort to implement and configure these sensors. Hence, we had to come with a solution that could automate the reconfiguration process.

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. This interface should allow them to configure the sensors by uploading the required files to the main server. On the other hand, we will also be developing a reliable data communication between the sensor boards and the server through radio communication and wired communication in case of wireless network failure. A web interface will also be developed so that the users (students, guests) of LILLIAD would be able to visualize the different data (temperature, luminosity, etc.) to determine their preferred spot in the LILLIAD building.

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:
    • Develop a database to store information about configuration files and the boards (MB, DB, D²B)
    • Integrate a web interface for an admin to upload configuration files
  • Deploying configuration via network:
    • Automatize the configuration of the boards via scripts
    • Update the state of configuration (success or failure) and notify the admin
  • Collecting log and sensor data:
    • Collect log data received through serial communication for debugging
    • Collect raw data from the sensors (through wireless or wired communication in case of failure)
    • Process the raw data and store it in the server
  • Creating a website to display sensor data:
    • Visualize the processed data in a graph for different type of data (luminosity, noise, etc.) via website

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.

Db block diagram.png

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.

Partial architecture of the system

Collecting log and sensor data

Creating a website to display sensor data