A remote control distributed to students allows them to call the teacher for any question or check the work requested. During a call, the student is placed on a waiting list. Then, the teacher can follow the waiting list in order to help or check the work of the students who are waiting. This system respect equity of students by the fact that: "first come, first served". The remote control use a LoRa communication which is a wireless long range connection and it has low power consumption.
I. Analysis of the need
II. Demonstration
III. Configuring The Things Network
IV. Make your own remote control
V. Install your own system
____________________________________________________________
I. Analysis of the needTeachers were looking to help students during their practical work. However, equity issues were occurring. And some students were waiting availability of the teacher for long minutes and it's a great loss of time. Furthermore, teachers sometimes are loosing their minds when they have to manage more than 3 or 4 questions together. This is why we wanted to meet this need. In addition, another need related to the subject of the assignments is the grading of the students. This is why the idea of creating an administrator interface in order to mark the students seems to us to be a good idea.
To respond to all these criterias, we made a remote control that will be given to students during their practical work. A WEB interface is made in order to every students to see the waiting list and a administration panel for the teachers for the mark system.
II. Demonstrationa) Remote control
Three buttons are available on this remote control. The first is used to call, the second to request verification and the third to cancel the request. 2 LEDs are indicating the status of powering and showing the type of the selected message to send. (Green for a call, blue for a request and red for canceling).
b) WEB Interface
Each button has its unique specificity to react with the WEB interface.
On this WEB interface, a so-called "waiting list" page is used to display all the requests sent during a session (A session is opened by a teacher via his administration interface). This page can be projected via a video projector in a classroom for example or can be consulted directly by the students on their digital device.
The administrator has access to an administration page, allowing to open or close a session but also to consult any session that has taken place. In addition, in a session, the administrator can process a call when he has gone to help the student, allowing him to be removed from the waiting list. Finally, the teacher can leave a note depending on the relevance of the question or note the work provided in practical work.
Also, if there are not enough remote control available for a session. Every student can access to a remote control online and join the running session.
The remote control using LoRaWan Network needs to use a TTN gateway to work. In order to be recognized by the network, you have to create a new end device on the website of The Things Network.
Here are the following steps:
Go to The Things Network, create an account and configure a new application
Click on "Add a new application"
Enter a name to your application
Create a new end device by choosing the frequency plan according to your location, LoraWAN version 1.0.4 and don't forget to turn ABP mode.
After that generate a new device address, and the keys (NwkSkey, AppSkey).
Then into the general settings, you have to reset the frame counters and remove the adaptive data rate (ADR). We will use specific frequencies that are directly written into the Arduino code (see Part IV for the Arduino part).
Set a payload formatter to your end-device. It's important to format the data coming to The Things Network, because it will be directly transmitted to your Node Red server thanks to MQTT.
here is the following code for the payload formatter:
function decodeUplink(input) {
return {
data: {
table: input.bytes[0],
bouton: input.bytes[1],
time: Date.now(),
},
warnings: [],
errors: []
};
}
Now you have to generate the MQTT credentials, that you have to keep for the Part V (Install your own system) that you will put into the MQTT node on your Node Red Server.
Last step is to save the DevAddress, NwkSkey and AppSKey into the right format (MSB format for the NwkSkey and AppSKey).
a) Build your own electronic card
To create the electronic card, we chose to use Kicad in free version. I recommend these tutorials to get started:
https://youtube.com/playlist?list=PLuQznwVAhY2XyLtk11MdgLkLk3thxQi8K
We started by creating our electrical diagrams, then we create the PCB by placing the different footprints and then routing them together.
The goal being to create a remote control, we chose to create the smallest card possible. Thus, we chose to place the resistors under the LoRa chip in order to save space :
b) 3D Modeling
For 3D modeling, we chose to use Fusion 360. To get started, we followed this excellent tutorial:
[TUTORIAL] Fusion360: Learn how to model USB flash drive media - YouTube
Once again, the case had to be as small as possible in order to fit in the hand. Thus, in the final version, the case is 5cm high, 12.5cm long and 6.5cm wide. Depending on the accuracy of your printer, it may be necessary to file the contours of the orifices on 1mm:
c) Arduino Code:
Get the code at the end of the article, edit it.
Firstly you have to setup the Arduino IDE by following the steps there:
https://learn.adafruit.com/adafruit-feather-m0-radio-with-lora-radio-module/setup
Enter the TTN credentials (DevAdress, AppSkey, NwkSkey) that you saved from TTN.
Select the idNumber of this remote control and write it into the code (in this example, the selected ID is: 1):
// Traitement
mydata[0] = 1; // Table 1
mydata[1] = choosedBtn; // Question
Deploy the code into the Arduino Feather 32u4. Your remote control is now ready !You can click on a button and check on TheThingsNetwork (live data) if your remote device is sending messages.
V. Install your own systemThe remote control communicate with the WEB page thanks to LoRa wireless network, The Things Network(TTN) and a NodeRED server. The role of NodeRed is to get data from TTN and save it into the database.
This system requires a WEB server and a NodeRED server. This can be installed on a simple raspberry PI. To start, the WEB server can be under apache2 or nginx and you must install PHP and MySQL or mariaDB.
a) WEB Server
Create a database named "cmm" in "utf8mb4_general_ci" format and import the "cmm_db.sql" file available in the GitHub repository available below.
https://github.com/lucasfanech/project_rioc
Drop the content of WEB resources from the repository into the htdocs folder.
Then edit "db.php" from the ressources files and enter the host (IP adress), username, password of your database.
//localhost
$db_host = 'localhost';
$db_username = 'root';
$db_password = '';
$db_name = 'cmm';
To finish access to the web page, this page should appear:
Create a session :
Enter the administration page, and here are the default credentials:
login: admin
password: mdp
Write the name of a new session and click to create it.
b) NodeRed Server
Install the NodeRed service on a server thanks to the documentation available there: https://nodered.org/docs/getting-started/
Enter in the NodeRed dashboard and import the JSON file available below (at the end of the hackster article).
Edit MQTT node thanks to your TTN account details:
- Choose the recommended server for your region (eu1.cloud.thethings.network in our case)
- In "Security" enter the credentials available from TTN
Edit DB local node thanks to your database settings:
- Enter host
- Enter port
- Enter username
- Enter password
- Enter database name ("cmm" in our case)
Don't forget to deploy the flow on NodeRED, then your Node Red Server is now ready to get data from TTN !
Comments
Please log in or sign up to comment.