Theseus käyttökatko ma 22.4. klo 12 alkaen. Katko jatkuu 22.4. klo 15 asti ja on koko Theseuksen laajuinen. Lisäksi töiden käsittely ja syöttö on estetty ti 23.4. ainakin klo 12 asti. Theseus service break from Mon 22.4. at 12:00. The break will last until 15:00 on Mon 22.4. and is Theseus-wide. In addition, processing and uploading of work will be blocked until at least 12:00 on Tue 23.4.
Cloud-based Iot electric scooter
Smedberg, Jesse (2021)
Smedberg, Jesse
2021
Julkaisun pysyvä osoite on
https://urn.fi/URN:NBN:fi:amk-2021061716276
https://urn.fi/URN:NBN:fi:amk-2021061716276
Tiivistelmä
The popularity of personal light electric vehicles has seen a significant increase in recent years. In city streetscapes, the popularity increase is most noticeable as electric scooters and electric cars. This thesis documented a project where an electric scooter comparable to a rentable electric scooter was built.
The requirements for this thesis project were acquired by researching the features of rentable and commercial electric scooters. In the thesis project, an electric scooter was implemented according to the specifications of the acquired motor. Additionally, GPS tracking, always online capabilities, and remote start-up were implemented on the electric scooter so that, the electric scooter could be tracked and turned off remotely if stolen.
The back end was built on Amazon Lightsail based on the Flask web framework. The endpoints were first tested locally with Postman and over the internet after routing was implemented with NGINX and uWSGI. The electric scooter’s data is sent to the back end from an Arduino MKR1500 using NB-IoT radio technology, where it is processed and saved into MongoDB. The device’s reliability was tested with an overnight stress test, where the Arduino continuously sent data to the back end. During testing, the HTTP library used in the project was found getting stuck when sending or receiving data multiple times, interrupting the running program indefinitely.
The goals of the thesis project were achieved adequately, and a minimum viable product was built. However, the electric scooter’s web communications are unreliable because of issues found during testing with ArduinoHttpClient. The scooter’s development will be continued after the completion of the thesis, with the goal of fixing the issues found during testing such as, changing the HTTP protocol used to the MQTT protocol meant for IoT applications. Henkilökohtaisten sähkökulkuvälineiden suosio on viime vuosina lisääntynyt huomattavasti. Kaupunkien katukuvassa suosio on näkynyt parhaiten sähköpotkulautojen ja sähköautojen yleistymisenä. Tämän opinnäytetyön tarkoituksena on dokumentodia projekti, jossa rakennetaan ominaisuuksiltaan vuokrattavaan sähköpotkulautaan verrattavissa oleva sähköpotkulauta.
Opinnäytetyön vaatimukset selvitettiin tutkimalla vuokrattavien sekä myynnissä olevien sähköpotkulautojen ominaisuuksia. Opinnäytetyössä toteutettiin sähköpotkulauta, joka rakennettiin hankitun sähkömoottorin mukaan. Lisäksi sähköpotkulautaan tehtiin GPS-seuranta, onlinevalmius sekä etäkäynnistys ominaisuudet. Näin potkulaudan sijaintia voidaan seurata mahdollisen varkauden tapahtuessa ja sekä potkulauta voidaan kytkeä pois päältä kontaktittomasti.
Potkulaudan ominaisuuksia varten rakennettiin Amazon Lightsail alustalle Flask verkkokehykseen pohjautuva backend, päätepisteet testattiin toimiviksi Postman sovelluksen avulla ensin paikallisesti ja sen jälkeen verkon ylitse NGINX ja uWSGI reitityksen valmistuttua. Potkulaudalta data lähetettiin backendiin Arduino MKR1500 NB-IoT:lla, josta se tallennettiin MongoDB:hen. Laitteiston luotettavuus testattiin yön yli kestävällä stressitestillä, jossa Arduino lähettää jatkuvasti dataa palvelimelle. Testauksen aikana Arduinossa huomattiin projektissa käytetyn HTTP- kirjaston pysäyttävän ohjelmansuorituksen.
Projekti saavutti tavoitteet pienimmän toimivan laitteen toteutuksesta. Sähköpotkulaudan verkkoliikenne on kuitenkin vielä epäluotettavaa ja ohjelmiston kehitystä pyritään jatkamaan tulevaisuudessa eteenpäin toteutuksen aikana opittujen vajaavaisuuksien pohjalta mm. vaihtamalla HTTP-verkkoprotokolla IoT-laitteisiin tarkoitettuun MQTT-kommunikaatioprotokollaan.
The requirements for this thesis project were acquired by researching the features of rentable and commercial electric scooters. In the thesis project, an electric scooter was implemented according to the specifications of the acquired motor. Additionally, GPS tracking, always online capabilities, and remote start-up were implemented on the electric scooter so that, the electric scooter could be tracked and turned off remotely if stolen.
The back end was built on Amazon Lightsail based on the Flask web framework. The endpoints were first tested locally with Postman and over the internet after routing was implemented with NGINX and uWSGI. The electric scooter’s data is sent to the back end from an Arduino MKR1500 using NB-IoT radio technology, where it is processed and saved into MongoDB. The device’s reliability was tested with an overnight stress test, where the Arduino continuously sent data to the back end. During testing, the HTTP library used in the project was found getting stuck when sending or receiving data multiple times, interrupting the running program indefinitely.
The goals of the thesis project were achieved adequately, and a minimum viable product was built. However, the electric scooter’s web communications are unreliable because of issues found during testing with ArduinoHttpClient. The scooter’s development will be continued after the completion of the thesis, with the goal of fixing the issues found during testing such as, changing the HTTP protocol used to the MQTT protocol meant for IoT applications.
Opinnäytetyön vaatimukset selvitettiin tutkimalla vuokrattavien sekä myynnissä olevien sähköpotkulautojen ominaisuuksia. Opinnäytetyössä toteutettiin sähköpotkulauta, joka rakennettiin hankitun sähkömoottorin mukaan. Lisäksi sähköpotkulautaan tehtiin GPS-seuranta, onlinevalmius sekä etäkäynnistys ominaisuudet. Näin potkulaudan sijaintia voidaan seurata mahdollisen varkauden tapahtuessa ja sekä potkulauta voidaan kytkeä pois päältä kontaktittomasti.
Potkulaudan ominaisuuksia varten rakennettiin Amazon Lightsail alustalle Flask verkkokehykseen pohjautuva backend, päätepisteet testattiin toimiviksi Postman sovelluksen avulla ensin paikallisesti ja sen jälkeen verkon ylitse NGINX ja uWSGI reitityksen valmistuttua. Potkulaudalta data lähetettiin backendiin Arduino MKR1500 NB-IoT:lla, josta se tallennettiin MongoDB:hen. Laitteiston luotettavuus testattiin yön yli kestävällä stressitestillä, jossa Arduino lähettää jatkuvasti dataa palvelimelle. Testauksen aikana Arduinossa huomattiin projektissa käytetyn HTTP- kirjaston pysäyttävän ohjelmansuorituksen.
Projekti saavutti tavoitteet pienimmän toimivan laitteen toteutuksesta. Sähköpotkulaudan verkkoliikenne on kuitenkin vielä epäluotettavaa ja ohjelmiston kehitystä pyritään jatkamaan tulevaisuudessa eteenpäin toteutuksen aikana opittujen vajaavaisuuksien pohjalta mm. vaihtamalla HTTP-verkkoprotokolla IoT-laitteisiin tarkoitettuun MQTT-kommunikaatioprotokollaan.