SlideShare ist ein Scribd-Unternehmen logo
1 von 14
MEmento - Final Presentation
Cervelli - De Luca - Di Maggio
Ever forgot to
lock your door?
MEmento is here to help you
avoid such unpleasant
situations!
Or to take the keys?
Finally a Twitter notification reminds
the user to lock the door
In order to stop the alert, the user has
to bring the FOB on his keyring near
the RFID reader next to the keyhole
If he is actually leaving,
a sound alert starts playing (emulated
via led)
A keys-reminder system
Through a magnetic switch, we are
able to detect if the user is leaving
Powered by
● STM DISCO-L475VG-IOT01A
○ One of STM’s finest pieces of hardware
○ Enabled with low-power wireless, BLE, NFC, SubGHz, Wi-Fi
○ Perfect for developing cloud-based IoT applications
● ARM Mbed OS
○ Provides API preventing IoT developers from reinventing the wheel
● AWS IoT Core
○ Easily integrated with our STM board
● Twitter
○ Used to notify the user on his mobile devices
Hardware components
We have to connect to our STM board a magnetic switch, used
to detect if the door is open or closed (it simply checks whether
the electric current passes or not), and an MFRC522 RFID
reader.
The MFRC522 also comes with a keyholder tag, which was
simply perfect for the user experience we designed.
Why not NFC?
Currently ARM Mbed hasn’t implemented any API to support its use as an
initiator in the NFC protocol. All it can do as of now is to emulate a tag, or to act
as an EEPROM, so it’s not viable for our use case.
Source: Mbed Office Hours with Donatien Garnier
AWS IoT Core MQTT connection (1/3)
pc.printf("Connecting to host %s:%d ...rn", MQTT_SERVER_HOST_NAME, MQTT_SERVER_PORT);
{
mqttNetwork = new MQTTNetwork(network);
int rc = mqttNetwork->connect(MQTT_SERVER_HOST_NAME, MQTT_SERVER_PORT, SSL_CA_PEM,
SSL_CLIENT_CERT_PEM, SSL_CLIENT_PRIVATE_KEY_PEM);
if (rc != MQTT::SUCCESS){
const int MAX_TLS_ERROR_CODE = -0x1000;
// Network error
if((MAX_TLS_ERROR_CODE < rc) && (rc < 0)) {
pc.printf("ERROR from MQTTNetwork connect is %d.", rc);
}
// TLS error - mbedTLS error codes starts from -0x1000 to -0x8000.
AWS IoT Core MQTT connection (2/3)
if(rc <= MAX_TLS_ERROR_CODE) {
const int buf_size = 256;
char *buf = new char[buf_size];
mbedtls_strerror(rc, buf, buf_size);
pc.printf("TLS ERROR (%d) : %srn", rc, buf);
}
return -1;
}
}
pc.printf("Connection established.rn");
pc.printf("rn");
AWS IoT Core MQTT connection (3/3)
pc.printf("MQTT client is trying to connect the server ...rn");
{
MQTTPacket_connectData data = MQTTPacket_connectData_initializer;
data.MQTTVersion = 3;
data.clientID.cstring = (char *)MQTT_CLIENT_ID;
data.username.cstring = (char *)MQTT_USERNAME;
data.password.cstring = (char *)MQTT_PASSWORD;
mqttClient = new MQTT::Client<MQTTNetwork, Countdown>(*mqttNetwork);
int rc = mqttClient->connect(data);
if (rc != MQTT::SUCCESS) {
pc.printf("ERROR: rc from MQTT connect is %drn", rc);
return -1;
}
}
pc.printf("Client connected.rn");
pc.printf("rn");
Door checking, starting alert and firing MQTT message
// IF DOOR IS OPEN
if (doorSensor.read() == 1) {
static unsigned short id = 0;
char payload[] = "{ "payload": TWITTER-ID-GOES-HERE }";
//START LED ALERT (A SOUND ALERT COULD BE IMPLEMENTED AS WELL)
led = 1;
MQTT::Message message;
message.retained = false;
message.dup = false;
const size_t buf_size = 100;
char *buf = new char[buf_size];
message.payload = (void*)buf;
message.qos = MQTT::QOS0;
message.id = id++;
int ret = snprintf(buf, buf_size, "%s", payload);
if(ret < 0) {
pc.printf("ERROR: snprintf() returns %d.", ret);
continue;
}
message.payloadlen = ret;
Shutting down the alert with MFRC 522
// Wait for the RFID tag to stop the alert
pc.printf("Wait alert to stoprn");
while(! (RfChip.PICC_IsNewCardPresent() || stopAlarm)) {
wait(0.5);
}
pc.printf("Alert stoppedrn");
// Reset led to off state and stopAlarm to false
led = 0;
stopAlarm = false;
// Wait until the door is closed before restarting the cycle
pc.printf("Wait for door to be closed againrn");
while(doorSensor.read() == 1) {
wait(0.5);
}
Send Twitter message with AWS Lambda
The MQTT message publishing acts as a trigger to an AWS
Lambda function.
We choose to use AWS Lambda because it allows us to run
the “lambda_handler” function when the MQTT request is
received and take is payload, without configuring any server.
For our purposes AWS services are provided for free and we
were able to write our function in Python, using a Twitter API
library.
AWS Lambda Notification Code
Thank you!
Contacts:
Gabriele Cervelli
gabriele-cervelli-88406b181
polyc
Giovanni De Luca
gdlroma
jotaro-sama
Antonino Di Maggio
antonino-di-maggio-216479143
antoninus96
Blogpost: https://www.hackster.io/memento-team/memento-07ff93
Code on GitHub: https://github.com/memento-iot-final-project-2018-2019

Weitere ähnliche Inhalte

Ähnlich wie MEmento Final Presentation

Interface gsm with 8051 microcontroller (at89 c51)
Interface gsm with 8051 microcontroller (at89 c51)Interface gsm with 8051 microcontroller (at89 c51)
Interface gsm with 8051 microcontroller (at89 c51)
mdkousik
 
DEFCON-21-Koscher-Butler-The-Secret-Life-of-SIM-Cards-Updated.pdf
DEFCON-21-Koscher-Butler-The-Secret-Life-of-SIM-Cards-Updated.pdfDEFCON-21-Koscher-Butler-The-Secret-Life-of-SIM-Cards-Updated.pdf
DEFCON-21-Koscher-Butler-The-Secret-Life-of-SIM-Cards-Updated.pdf
Wlamir Molinari
 
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 FinalExploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
masoodnt10
 

Ähnlich wie MEmento Final Presentation (20)

Kamery, światło, akcja!
Kamery, światło, akcja!Kamery, światło, akcja!
Kamery, światło, akcja!
 
Interface gsm with 8051 microcontroller (at89 c51)
Interface gsm with 8051 microcontroller (at89 c51)Interface gsm with 8051 microcontroller (at89 c51)
Interface gsm with 8051 microcontroller (at89 c51)
 
Intel galileo gen 2
Intel galileo gen 2Intel galileo gen 2
Intel galileo gen 2
 
WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11
WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11
WIFI ESP01 interfacing with Arduino UNO with Sensor DHT11
 
Connecting NEST via MQTT to Internet of Things
Connecting NEST via MQTT to Internet of ThingsConnecting NEST via MQTT to Internet of Things
Connecting NEST via MQTT to Internet of Things
 
Didactum SNMP Manual
Didactum SNMP ManualDidactum SNMP Manual
Didactum SNMP Manual
 
Gas leakage detection system
Gas leakage detection systemGas leakage detection system
Gas leakage detection system
 
A Computer Based Artificial Neural Network Controller with Interactive Audito...
A Computer Based Artificial Neural Network Controller with Interactive Audito...A Computer Based Artificial Neural Network Controller with Interactive Audito...
A Computer Based Artificial Neural Network Controller with Interactive Audito...
 
DEFCON-21-Koscher-Butler-The-Secret-Life-of-SIM-Cards-Updated.pdf
DEFCON-21-Koscher-Butler-The-Secret-Life-of-SIM-Cards-Updated.pdfDEFCON-21-Koscher-Butler-The-Secret-Life-of-SIM-Cards-Updated.pdf
DEFCON-21-Koscher-Butler-The-Secret-Life-of-SIM-Cards-Updated.pdf
 
IoT on Raspberry Pi
IoT on Raspberry PiIoT on Raspberry Pi
IoT on Raspberry Pi
 
CHAPTERS
CHAPTERSCHAPTERS
CHAPTERS
 
Home automation using IoT and AWS Cloud technology
Home automation using IoT and AWS Cloud technologyHome automation using IoT and AWS Cloud technology
Home automation using IoT and AWS Cloud technology
 
MQTT - Austin IoT Meetup
MQTT - Austin IoT MeetupMQTT - Austin IoT Meetup
MQTT - Austin IoT Meetup
 
MQTT enabling the smallest things
MQTT enabling the smallest thingsMQTT enabling the smallest things
MQTT enabling the smallest things
 
Physical Computing and IoT
Physical Computing and IoTPhysical Computing and IoT
Physical Computing and IoT
 
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 FinalExploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
 
Udp socket programming(Florian)
Udp socket programming(Florian)Udp socket programming(Florian)
Udp socket programming(Florian)
 
Rodrigo Almeida - Microkernel development from project to implementation
Rodrigo Almeida - Microkernel development from project to implementationRodrigo Almeida - Microkernel development from project to implementation
Rodrigo Almeida - Microkernel development from project to implementation
 
Linux Serial Driver
Linux Serial DriverLinux Serial Driver
Linux Serial Driver
 
Leveraging Android for the Internet of Things with Eclipse M2M
Leveraging Android for the Internet of Things with Eclipse M2MLeveraging Android for the Internet of Things with Eclipse M2M
Leveraging Android for the Internet of Things with Eclipse M2M
 

Kürzlich hochgeladen

Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Christo Ananth
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Dr.Costas Sachpazis
 

Kürzlich hochgeladen (20)

The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spain
 

MEmento Final Presentation

  • 1. MEmento - Final Presentation Cervelli - De Luca - Di Maggio
  • 2. Ever forgot to lock your door? MEmento is here to help you avoid such unpleasant situations! Or to take the keys?
  • 3. Finally a Twitter notification reminds the user to lock the door In order to stop the alert, the user has to bring the FOB on his keyring near the RFID reader next to the keyhole If he is actually leaving, a sound alert starts playing (emulated via led) A keys-reminder system Through a magnetic switch, we are able to detect if the user is leaving
  • 4. Powered by ● STM DISCO-L475VG-IOT01A ○ One of STM’s finest pieces of hardware ○ Enabled with low-power wireless, BLE, NFC, SubGHz, Wi-Fi ○ Perfect for developing cloud-based IoT applications ● ARM Mbed OS ○ Provides API preventing IoT developers from reinventing the wheel ● AWS IoT Core ○ Easily integrated with our STM board ● Twitter ○ Used to notify the user on his mobile devices
  • 5. Hardware components We have to connect to our STM board a magnetic switch, used to detect if the door is open or closed (it simply checks whether the electric current passes or not), and an MFRC522 RFID reader. The MFRC522 also comes with a keyholder tag, which was simply perfect for the user experience we designed.
  • 6. Why not NFC? Currently ARM Mbed hasn’t implemented any API to support its use as an initiator in the NFC protocol. All it can do as of now is to emulate a tag, or to act as an EEPROM, so it’s not viable for our use case. Source: Mbed Office Hours with Donatien Garnier
  • 7. AWS IoT Core MQTT connection (1/3) pc.printf("Connecting to host %s:%d ...rn", MQTT_SERVER_HOST_NAME, MQTT_SERVER_PORT); { mqttNetwork = new MQTTNetwork(network); int rc = mqttNetwork->connect(MQTT_SERVER_HOST_NAME, MQTT_SERVER_PORT, SSL_CA_PEM, SSL_CLIENT_CERT_PEM, SSL_CLIENT_PRIVATE_KEY_PEM); if (rc != MQTT::SUCCESS){ const int MAX_TLS_ERROR_CODE = -0x1000; // Network error if((MAX_TLS_ERROR_CODE < rc) && (rc < 0)) { pc.printf("ERROR from MQTTNetwork connect is %d.", rc); } // TLS error - mbedTLS error codes starts from -0x1000 to -0x8000.
  • 8. AWS IoT Core MQTT connection (2/3) if(rc <= MAX_TLS_ERROR_CODE) { const int buf_size = 256; char *buf = new char[buf_size]; mbedtls_strerror(rc, buf, buf_size); pc.printf("TLS ERROR (%d) : %srn", rc, buf); } return -1; } } pc.printf("Connection established.rn"); pc.printf("rn");
  • 9. AWS IoT Core MQTT connection (3/3) pc.printf("MQTT client is trying to connect the server ...rn"); { MQTTPacket_connectData data = MQTTPacket_connectData_initializer; data.MQTTVersion = 3; data.clientID.cstring = (char *)MQTT_CLIENT_ID; data.username.cstring = (char *)MQTT_USERNAME; data.password.cstring = (char *)MQTT_PASSWORD; mqttClient = new MQTT::Client<MQTTNetwork, Countdown>(*mqttNetwork); int rc = mqttClient->connect(data); if (rc != MQTT::SUCCESS) { pc.printf("ERROR: rc from MQTT connect is %drn", rc); return -1; } } pc.printf("Client connected.rn"); pc.printf("rn");
  • 10. Door checking, starting alert and firing MQTT message // IF DOOR IS OPEN if (doorSensor.read() == 1) { static unsigned short id = 0; char payload[] = "{ "payload": TWITTER-ID-GOES-HERE }"; //START LED ALERT (A SOUND ALERT COULD BE IMPLEMENTED AS WELL) led = 1; MQTT::Message message; message.retained = false; message.dup = false; const size_t buf_size = 100; char *buf = new char[buf_size]; message.payload = (void*)buf; message.qos = MQTT::QOS0; message.id = id++; int ret = snprintf(buf, buf_size, "%s", payload); if(ret < 0) { pc.printf("ERROR: snprintf() returns %d.", ret); continue; } message.payloadlen = ret;
  • 11. Shutting down the alert with MFRC 522 // Wait for the RFID tag to stop the alert pc.printf("Wait alert to stoprn"); while(! (RfChip.PICC_IsNewCardPresent() || stopAlarm)) { wait(0.5); } pc.printf("Alert stoppedrn"); // Reset led to off state and stopAlarm to false led = 0; stopAlarm = false; // Wait until the door is closed before restarting the cycle pc.printf("Wait for door to be closed againrn"); while(doorSensor.read() == 1) { wait(0.5); }
  • 12. Send Twitter message with AWS Lambda The MQTT message publishing acts as a trigger to an AWS Lambda function. We choose to use AWS Lambda because it allows us to run the “lambda_handler” function when the MQTT request is received and take is payload, without configuring any server. For our purposes AWS services are provided for free and we were able to write our function in Python, using a Twitter API library.
  • 14. Thank you! Contacts: Gabriele Cervelli gabriele-cervelli-88406b181 polyc Giovanni De Luca gdlroma jotaro-sama Antonino Di Maggio antonino-di-maggio-216479143 antoninus96 Blogpost: https://www.hackster.io/memento-team/memento-07ff93 Code on GitHub: https://github.com/memento-iot-final-project-2018-2019