Open Innovation Platform for IoT-Big data in Sub-Sahara...
Transcript of Open Innovation Platform for IoT-Big data in Sub-Sahara...
WAZIUP: Co-funded by the Horizon 2020 Framework Programme of the European Union
www.waziup.eu
OpenInnovationPlatformforIoT-BigdatainSub-Sahara
Africa
GrantAgreementNº687607
Report D2.1
Deliverable Title: Hardware selection and integration of long-range connectivity for IoT and heterogeneous
networking building blocks
ResponsibleEditor: UPPA
Contributors: UPPA,UI
DocumentReference: WAZIUPD2.1–Hardwareselectionandintegrationoflong-rangeconnectivityforIoTandheterogeneousnetworkingbuildingblocks
Distribution: Public
Version: 1.1
Date: 07/02/2017
ProjectNº687607 WAZIUPD2.1
Page2
ProjectNº687607 WAZIUPD2.1
Page3
CONTRIBUTORSTABLE
DOCUMENTSECTION AUTHOR(S) REVIEWER(S)Section1 C.PHAM,UPPA M.SHEIKHALISHAHISection2 C.PHAM,UPPA S.FATNASSISection3 T.TEIXEIRA,UI C.PHAMSection4 C.PHAM,UPPA O.THIARÉSection5 C.PHAM,UPPA C.DUPONTSection6 C.PHAM,UPPA T.TEIXEIRASection7 M.DIOPANDC.PHAM,UPPA F.BAIDOOSection8 C.PHAM,UPPA P.COUSIN
DOCUMENTREVISIONHISTORY
Version Date Changesv1.1 FEB6TH,2017 PUBLICRELEASEv1.0 JAN31ST,2017 FIRSTDRAFTVERSIONFORINTERNALAPPROVALv0.5 JAN30TH,2017 INTEGRATIONOFREVIEWSFORSECTION7v0.4 JAN20TH,2017 INTEGRATIONOFREVIEWSFORSECTION1AND5v0.3 JAN19TH,2017 INTEGRATIONOFREVIEWSFORSECTION3,6AND8v0.2 JAN15TH,2017 INTEGRATIONOFREVIEWSFORSECTION2,4,AND6v0.1 JAN5TH,2017 FIRSTRELEASEFORREVIEW
ProjectNº687607 WAZIUPD2.1
Page4
EXECUTIVESUMMARY
Thisdeliverable2.1entitled«Hardwareselectionandintegration oflong-rangeconnectivityforIoTandheterogeneousnetworkingbuildingblocks»coverstheachievementsofthefirst12monthsofT2.1andT2.2.Itwillbestructuredasfollows:
• 2.SENSINGSYSTEMSANDIOTDEVICES:HARDWAREPLATFORM:reviewstheconceptofWAZIUPIoTdevicesanddescribesthehardwareplatformsthatwillbetargetedbyWAZIUP.
• 3.IOTCATALOGUEFORHARDWARESELECTION:describestheIoTcataloguetoolsforhardwareselectionandsimplecodegeneration.
• 4.IOTCONNECTIVITY:reviewsIoTconnectivitytechnologiesandchallenges.Willfocusonthelong-rangeLoRatechnologythatwillbeusedinWAZIUP.
• 5.WAZIUPlow-costIoTplatform:describesthesoftwarelibrariesforlong-rangecommunicationsandsensormanagement.
• 6.HETEROGENEOUSNETWORKING:describeshowheterogenousnetworkingwillbemanaged,especiallyatthegatewaylevel.
• 7.TESTSWITHLORAWANANDMINIMUMINTEROPERABILITY:describesourLoRaWANtestsandhowmiminuminteroperabilityisprovided.
ProjectNº687607 WAZIUPD2.1
Page5
TABLEOFCONTENTS
1. BriefreviewofWAZIUPandWP2....................................................................................11
1.1. WAZIUP.....................................................................................................................11
1.2. WP2..........................................................................................................................11
1.3. DeliverableD2.1.......................................................................................................12
2. SensingsystemsandIoTdevices:hardwareplatform.....................................................13
2.1. Sensorplatform........................................................................................................13
2.1.1. SensingsystemsandIoTdevices.......................................................................13
2.2. Low-costhardwareplatformsforDIYIoT.................................................................15
2.3. Hardwareselectionprocess.....................................................................................17
3. IoTcatalogueforhardwareselection..............................................................................18
3.1. Concepts...................................................................................................................18
3.2. Back-end...................................................................................................................19
3.2.1. MongoDB...........................................................................................................19
3.2.2. MongoDBConnector.........................................................................................20
3.2.3. Authentication...................................................................................................21
3.2.4. API.....................................................................................................................21
3.2.5. Pricecrawler......................................................................................................21
3.3. Front-end..................................................................................................................22
3.3.1. DataInput/Output.............................................................................................23
3.3.2. Dataprocessing.................................................................................................24
3.3.3. Userinterface....................................................................................................24
3.4. Manual......................................................................................................................27
3.4.1. MVP’smenu......................................................................................................28
3.4.2. Hardwaremenu.................................................................................................31
3.4.3. Othermenu.......................................................................................................32
3.4.4. Newelement.....................................................................................................34
4. IoTconnectivity................................................................................................................36
4.1. Introduction..............................................................................................................36
4.2. Briefreviewoflong-rangetechnologies...................................................................38
4.3. LoRalong-rangetechnology.....................................................................................39
4.3.1. Physicallayer.....................................................................................................39
4.3.2. LoRaWAN...........................................................................................................40
4.3.3. LoRaradiomodules...........................................................................................41
4.4. Transmissionintheunlicensedfrequencyband......................................................42
ProjectNº687607 WAZIUPD2.1
Page6
5. WAZIUPlow-costIoTplatform.........................................................................................45
5.1. IoTplatform'sobjectives..........................................................................................45
5.1.1. Deploymentscenarios.......................................................................................45
5.1.2. WhyarewenotLoRaWANcompliant?.............................................................46
5.2. Low-costgateways....................................................................................................46
5.3. Long-rangecommunicationlibrary...........................................................................47
5.3.1. ImprovementstotheLibeliumSX1272library..................................................47
5.3.2. LoRamodulesthathavebeentested................................................................48
5.3.3. Radioregulationssuchasfrequencybandsandduty-cycle..............................48
5.3.4. LoRamodes.......................................................................................................48
5.3.5. Minimumfunctionsettobuildalong-rangeend-device..................................49
5.3.6. Packetformat....................................................................................................49
5.4. Buildingalow-costIoTdevice..................................................................................50
5.4.1. Softwareintegrationforlong-rangeIoTdevice................................................51
5.4.2. Softwaretemplatesforquickandeasyappropriation......................................52
5.4.3. Programmingtheboard....................................................................................52
5.4.4. Customizationoftemplates..............................................................................55
5.4.5. IoTdevicepowerconsumptiontests.................................................................56
5.4.6. IoTdeviceintegrationforoutdoorusage..........................................................57
5.5. Buildingalow-costgateway.....................................................................................58
5.5.1. Gatewayhardwareandarchitecture.................................................................58
5.5.2. Lowerlevelradiobridgeandpost-processingblockinteraction.......................60
5.5.3. Whatcloudsforlow-costIoT?...........................................................................61
5.5.4. Uploadingtoclouds...........................................................................................62
5.6. Energyrequirementsofthewholesystem...............................................................65
5.6.1. Measuredenergyconsumption........................................................................65
5.6.2. Investigatingusageofsolarpanels....................................................................66
5.6.3. Internetconnectivitywith2G/3Gshield/dongle...............................................66
5.7. RunningwithoutInternetconnectivity.....................................................................67
5.8. Softwareandtutorialmaterialsavailableonthegithub..........................................68
5.9. WAZIUPdemokit......................................................................................................69
5.10. MinimumViableProductsbasedontheIoTplatform..........................................72
5.11. OverviewoftheWAZIUPplatformarchitecture...................................................74
6. Heterogeneousnetworking.............................................................................................75
6.1. Heterogeneitywithlegacyshort-rangeradiotechnologies.....................................75
6.2. Takingintoaccountdatafromotherradiointerfaces..............................................77
ProjectNº687607 WAZIUPD2.1
Page7
6.2.1. UsecasewithIEEE802.15.4..............................................................................78
6.2.2. Generalizationtoothertypeofinterfaces........................................................79
7. TestswithLoRaWANandminimuminteroperability.......................................................80
7.1. LoRaWANpacketformatandrequirements............................................................80
7.1.1. LoRaWANpacketformat...................................................................................80
7.1.2. LoRaWANencryption........................................................................................80
7.2. SettingupaLoRaWANgateway:theMultitechmConduit......................................81
7.2.1. TheMultitechmConduit...................................................................................81
7.2.2. ThemDot...........................................................................................................87
7.3. ProvidingasimpleLoRaWANinteroperabilitylevel.................................................91
7.3.1. Low-costIoTdevice...........................................................................................91
7.3.2. Low-costgateway..............................................................................................92
7.3.3. FromLoRaWANmDottolow-costgateway......................................................95
8. Annexes............................................................................................................................97
8.1. OurLoRaFAQs..........................................................................................................97
8.2. Low-costLoRaIoTplatformpartlist.........................................................................98
8.3. Tutorialsmaterials....................................................................................................99
8.4. Keynotetalks..........................................................................................................100
8.5. Scientificpublications.............................................................................................101
ProjectNº687607 WAZIUPD2.1
Page8
LISTOFFIGURES
Figure1–avarietyofphysicalsensors...................................................................................13
Figure2–ArduinoUNOmicrocontrollerboardwithDHT22physicalsensor.........................13
Figure3–IoTDeviceIntegration............................................................................................14
Figure4–FishFarming...........................................................................................................15
Figure5–Arduinoecosystem.................................................................................................16
Figure6–OriginalSparkfunArduinoProMini(left)andaChineseclone(right)...................16
Figure7–Teensyboards:LCand3.1.....................................................................................17
Figure8–Back-endoverview.................................................................................................19
Figure9–Databaserepresentation........................................................................................20
Figure10–Pricecrawler.........................................................................................................22
Figure11–Front-endoverview..............................................................................................23
Figure12–Webinterfacelayout............................................................................................25
Figure13–Listingofallthesensors.......................................................................................26
Figure14–Parameterinformation.........................................................................................26
Figure15–Helpmode............................................................................................................27
Figure16–Consultinganusecase.........................................................................................27
Figure17–AgricultureMVP’s.................................................................................................28
Figure18–Agricultureusecase.............................................................................................28
Figure19–Listofallactors.....................................................................................................29
Figure20–CattleRustlingreport...........................................................................................30
Figure21–HardwaresolutionsforCattlerustling.................................................................30
Figure22–Listofallboards....................................................................................................31
Figure23–ArduinoNano.......................................................................................................32
Figure24–Radiocommunicationprotocols...........................................................................33
Figure25–Bluetoothv4.2......................................................................................................33
Figure26–Newunit...............................................................................................................34
ProjectNº687607 WAZIUPD2.1
Page9
Figure27–Navigationoverview.............................................................................................35
Figure28–Remotesensingscenariowith1-hopconnectivitytothegateway......................36
Figure29–Energyconsumptionfortraditionalcellulartechnologies...................................37
Figure30–Simplifiedviewofthelinkbudgetofawirelesstransmission..............................37
Figure31–IEEE802wirelesstechnologiesandLPWAN.........................................................38
Figure32–LoRathroughputandsensitivityforvariousBWandSFvalues...........................39
Figure33–spectrogramexampleofaLoRatransmission......................................................40
Figure34–LoraWANtypicaltopology....................................................................................41
Figure35–someradiomodulebuiltfromSX127xSemtechchips.........................................42
Figure36–ISMbandperregion.............................................................................................42
Figure37–868MHzunlicensedbandrestrictions..................................................................43
Figure38–additionalnotes....................................................................................................43
Figure39–TraditionalInternetaccessscenario(top),withoutInternetaccess(bottom).....45
Figure40–LoRamodeascombinationofBWandSF............................................................49
Figure41–Thelong-rangelibraryforArduino-compatibleboardsandLoRaradiomodules50
Figure42–DraginoLoRaproductlinebasedonHopeRFRFM95W.......................................51
Figure43–Softwarebuildingblocksforeasyintegrationoflong-rangeIoTdevices.............51
Figure44–Simpletemperaturesensorwithperiodicsensingandtransmission..................55
Figure45–powerconsumptionandlow-powertests............................................................56
Figure46–Low-costhardwareintegration............................................................................58
Figure47–Low-costsinglechannelLoRagateway................................................................59
Figure48–Gatewayarchitecture...........................................................................................59
Figure49–post-processingblocktemplate...........................................................................60
Figure50–Post-processingstagewithInternetconnectivity................................................61
Figure51–FromgatewaytoIoTclouds.................................................................................62
Figure52–Raspberrypowerconsumption(left),10000mAhUSBchargingpack(right).......65
Figure53–Mass-marketintegratedUSBsolarchargingpack................................................66
Figure54–3Gshield(left)and3Gdongle(right)...................................................................66
Figure55–GatewaywithoutInternetaccess.........................................................................67
ProjectNº687607 WAZIUPD2.1
Page10
Figure56–Autonomousgatewayforno-Internetaccessdeploymentscenarios..................67
Figure57–Fullyautonomouscattlerustlingapplication.......................................................68
Figure58–githubrepositoryforIoTdevicesandgateway....................................................69
Figure59–WAZIUPLoRademokit.........................................................................................69
Figure60–demogateway(left)anddemoIoTdevice(right)................................................70
Figure61–Usingthedemokit...............................................................................................71
Figure62–Visualizingreal-timedatawiththeembeddedwebserver..................................71
Figure63–distributionoftheWAZIUPdemokit...................................................................72
Figure64–GenericsensorIoTdeviceplatform......................................................................72
Figure65–MinimumViableProductsdefinedinWAZIUP.....................................................73
Figure66–Exempleofanactivebeaconcollarsystemforcattlerustlingapplications.........73
Figure67–IoTplatformgeneralarchitecture........................................................................74
Figure68–IEEE802.15.4asPHY/MAClayerinvariousshort-rangetechnologies.................75
Figure69–VariousintegratedsensorswithembeddedIEEE802.15.5radios.......................76
Figure70–Short-range(IEEE802.15.4)forlegacysensorsmixedwithlong-rangeLoRa......76
Figure71–Generalapproachforheterogeneousnetworking...............................................77
Figure72–XBeeserialgateway..............................................................................................79
Figure73–LoRaWANpacketformat......................................................................................80
Figure74–LoRaWANframeassembyprocess.......................................................................81
Figure75–TheMultitechConduitandsomeavailablemCards.............................................82
Figure76–Gatewaysettings..................................................................................................87
Figure77–MultiConnectmDot..............................................................................................87
Figure78–DevicesettingsonTTN.........................................................................................88
Figure79–ReceivingdataonTTN..........................................................................................90
LISTOFTABLES
Table1–SummaryofenergyconsumptionforProMiniandTeensyboards........................57
ProjectNº687607 WAZIUPD2.1
Page11
1. BRIEFREVIEWOFWAZIUPANDWP2
1.1. WAZIUP
WAZIUPisacollaborativeresearchprojectusinginnovativetechnologicalresearchapplicationsonIoTandrelatedbigdatamanagementandadvanceddataanalytictechniques.IthasthesupportofmultipleAfricanstakeholdersandpublicbodieswiththeaimofdefininganewinnovationspacetoadvancetheAfricanRuralEconomy.ThepotentialofIoTandBigData,inSub-SaharanAfrica,canberealizedonlyifthecostisreasonableasmostoftheruralpopulationintheAfricaisatthepovertylevel.ThisisthemainchallengethatWAZIUPwilladdress.Inaddition,WAZIUPiscreatingdevelopercommunitiesandinnovationhubstotrain,adapt,validateanddisseminateresults.WAZIUP'stechnicalpartnerswilldevelopmethodologies,tools,softwarelibrariesand"recipes"forbuildinglow-costIoTanddataanalysisplatforms.Tightlyinvolvingend-userscommunitiesintheloop,namelyruralAfricancommunitiesofselectedpilots,willensurequickappropriationandeasycustomizationbythirdparties.Furthermore,WAZIUPorganizesfrequenttrainingandHackathonsessionsinthesub-SaharanAfricanregion.WAZIUPwilltacklethechallengesenlistedbelow:
• Challenge1:InnovativedesignoftheIoTplatformfortheRuralEcosystem.Low-cost,genericbuildingblocksformaximumadaptationtoend-applicationsinthecontextoftheruraleconomyindevelopingcountries.
• Challenge2:NetworkManagement.FacilitateIoTcommunicationandnetworkdeployment.Lowercostsolutionscomparedtostateofthearttechnology:privilegepriceandsinglehopdedicatedcommunicationnetworks,energyautonomous,withlowmaintenancecostsandlonglastingoperations.
• Challenge3:Longdistance.Dynamicmanagementoflongrangeconnectivity(e.g.,copewithnetwork&servicefluctuations),providedevicesidentification,abstraction/virtualizationofdevices,communicationandnetworkresourcesoptimization.
• Challenge4:Big-data.Exploitthepotentialofbig-dataapplicationsinthespecificruralcontext.
1.2. WP2
TheobjectivesofWP2aretoco-design,adaptanddeploysensingsystemswithlow-powerandlow-costlong-range(LR)communicationandnetworkinginfrastructure.WP2willsetatest-bedinUGBforvalidationandperformanceevaluationofusecasesinvariousruralareas.TheoutcomesfromWP2withcorrespondingtasksarelistedbelow:
• T2.1Designandadaptationofsensingsystemsconsideringsocietalandenvironmentalthreat-design,adaptanddevelopsensingsystemsforIoTnodesthatwillbedeployedandtestedintheusecases.Produceopen-sourceplug-&-senseplatformsforfast,easydeployment&customizationtousecases.Methodologyandtoolsforlow-costdesign.
ProjectNº687607 WAZIUPD2.1
Page12
• T2.2DesignandintegrationofheterogeneousIoTnetworking-integratethehardwarecomponentsanddevelopthesoftwarebuildingblocksforgenericusageofLRradiotechnologies.DevelopandevaluateIoTactivityschedulingalgorithmsthatensurefairnessandefficiencyinheterogeneousradiotechnologiescommunications.Datamanagementforseamlesslysupportingintermittentnetworking.
• T2.3Low-latencyandlow-energyMACprotocols-addresstheissueofachievinglow-latencyandlow-energycommunicationswiththecombinationofLRandshort/mediumrangeradios.ProposeandevaluateIoTnodeactivityschedulingbasedonthetimingrequirementoftheendapplication.
• T2.4OpenIoTtest-bedsetupandbenchmark-deploytheIoTtest-bedfeaturingLRIoTdevice.Providethevalidationinfrastructureforinternalsub-tasks(T2.1,T2.2andT2.3)andthedemonstratorinfrastructurefortheusecases.
• T2.5Trainingmaterialsandtoolsfordevelopercommunity-addressthetraininganddisseminationpartofWP2.Developedsensingsystemsandsoftwarewillbepresentedandexplainedtoend-developersandend-users.OrganizededicatedLivingLabs,TechEventsandHackatontoboostinnovationsaroundtheIoTtechnologiesandtheWAZIUPdevelopedsolutions.
1.3. DeliverableD2.1
Thisdeliverable2.1entitled«Hardwareselectionandintegration oflong-rangeconnectivityforIoTandheterogeneousnetworkingbuildingblocks»coverstheachievementsofthefirst12monthsofT2.1andT2.2.Itwillbestructuredasfollows:
• 2.SENSINGSYSTEMSANDIOTDEVICES:HARDWAREPLATFORM:reviewstheconceptofWAZIUPIoTdevicesanddescribesthehardwareplatformsthatwillbetargetedbyWAZIUP.
• 3.IOTCATALOGUEFORHARDWARESELECTION:describestheIoTcataloguetoolsforhardwareselectionandsimplecodegeneration.
• 4.IOTCONNECTIVITY:reviewsIoTconnectivitytechnologiesandchallenges.Willfocusonthelong-rangeLoRatechnologythatwillbeusedinWAZIUP.
• 5.WAZIUPlow-costIoTplatform:describesthesoftwarelibrariesforlong-rangecommunicationsandsensormanagement.
• 6.HETEROGENEOUSNETWORKING:describeshowheterogenousnetworkingwillbemanaged,especiallyatthegatewaylevel.
• 7.TESTSWITHLORAWANANDMINIMUMINTEROPERABILITY:describesourLoRaWANtestsandhowmiminuminteroperabilityisprovided.
ProjectNº687607 WAZIUPD2.1
Page13
2. SENSINGSYSTEMSANDIOTDEVICES:HARDWAREPLATFORM
2.1. Sensorplatform
WAZIUPmainlyfocusesonsensingsystemsforso-calledtelemetryapplicationswherephysicalparametersoftheenvironmentismeasured.InthissectionwewillbrieflyintroducesuchsensingsystemsthatwillbeatthecoreofWAZIUPUseCases.
WAZIUPhasseveralUseCasesthatfocusoncompletelydifferentissues,thereforeimposingtheneedforWAZIUPtobeveryflexibleintermsoftheHardwarerequiredtotackleeachUseCase.So,takingthisintoaccount,WAZIUPneedstosetupawaysothateachpieceofhardwaredeployedcanbeveryspecifictotheparticularUseCase,sothatWAZIUPcanreducethecoststoaminimum.[D1.1,section6.2.1]
2.1.1. SensingsystemsandIoTdevices
Sensingtheenvironmentisperformedbyspecializedphysicalsensors.Figure1showsavarietyofphysicalsensors,eachonedesignedtomeasureaparticularphysicalparameter:soundlevel,temperature,airhumidity,soilconductivity/humidity,dissolvedoxygenlevel,...
Figure1–avarietyofphysicalsensors
Sensingsystemsarethengenerallybuiltwithamicrocontrollerboardwherephysicalsensorswillbeconnectedanddrivenbyanappropriateprogramrunningontheboard.Figure2showsanArduinoUNOmicrocontrollerboardwithaDHT22digitalphysicalsensor.
Figure2–ArduinoUNOmicrocontrollerboardwithDHT22physicalsensor
Image from http://cactus.io/hookups/sensors/temperature-humidity/dht22/hookup-arduino-to-dht22-temp-humidity-sensor
ProjectNº687607 WAZIUPD2.1
Page14
Physicalsensorsareeitheranalogordigital.Theprogramrunningonthemicrocontrollerboardwill«read»theanalogordigitalvaluefromtheI/Opinsandwillgenerallyconvertthisvalueintomeaningfuldataaccordingtothephysicalsensorreferencedatasheet.
TheIoTDeviceinWAZIUPisthedevicethatwillbemonitoringtheenvironment,collectingandprocessingthedatanecessaryfortheUseCasesandthencommunicatethemtotheWAZIUPPlatform.So,itwillhavecommunication,processingandsensingcapabilities,thatmeansanIoTDevicecanmeasureoneormoreparameterfromtheenvironment,processingthoseparametersbygeneratingmeaningfuldataandthencommunicatesthedataby(possible)differentmeans(radio,cablelink,localstorage,etc).[D1.1,section6.2.1]
These IoT Devices are composed by a group of hardware components, such as a board,sensor, radioand interfaces (when it’sneeded). Each IoTDevice canhavemultiple sensors(and sensor interfaces)andalsomultiple radios (and radio interfaces), as faras theboardsupportsit.ThedomainsinWAZIUPrelyondatagatheredfromtheenvironmentbytheIoTDevices,andtobeabletodoso,theIoTDevicesneedtobecomposedbyspecifichardware:
• Sensor: used to collect data of physical parameters from the environment (e.g.Temperature,Humidity,etc.).
• Interface: Required by some hardware to communicate (eg, converting sensorconductivityintoananalogsignal).
• Board:MaincomponentofanIoTDevice.It’susedtoreceivethedatagatheredfromthesensor(s),processitasdefinedandforwarditusingtheradio(s)available.
• Radio:Thiscomponentisusedforcommunicationpurposes,sothattheIoTDevicecanreceiverequestsandsenddatafrom/totheWAZIUPPlatform.
Intermsofreadingsfromthe IoTDevice, itusesthesensor(oreachone, incaseofhavingmore than 1) to gather data. This process is made through measurements, which arecomposedbythefollowingelements:
• Parameter:Physicalinputthatisreadfromtheenvironment(e.g.,Temperature,Humidity,etc.).
• Unit:Howthedataobtainedbythemeasurementisrepresented(e.g.,°F,°C).
Figure3showstheoverallpictureregardingthehardwarecomponentsofanIoTDeviceandhow it relates to the WAZIUP domains and to the measurements gathered form theenvironment.
Figure3–IoTDeviceIntegration
BoardSensor
Interface
Radio
°F°C
Parameter Unit
IoT Device
Domains
Measurements
Interface
ProjectNº687607 WAZIUPD2.1
Page15
Thefollowingexampledescribesausecasefromthe“FishFarming”domain,presentinganIoT device that can be used on this situation. The main purpose of the IoT Device herespecified is to collect data from the water. Among several parameters, the watertemperature(°C)ismeasuredbyusinganIoTDevicecomposedbythefollowinghardware:
• PT-1000TemperatureSensor:Itsconductivitychangeswiththewatertemperature.• PT-1000TemperatureModule:Ittranslatesthesensorconductivityintoa
temperaturevalue• ArduinoUNOBoard:MainboardoftheIoTDevice• LoraRFModule:Enablesthecommunicationfrom/totheIoTDevice
Figure4–FishFarming
[D1.1,section6.2.2]
2.2. Low-costhardwareplatformsforDIYIoT
ThematurationoftheIoTmarketishappeninginmanydevelopedcountries.WhilethecostofIoTdevicescanappearreasonablewithindevelopedcountriesstandards,theyaredefinitelystilltooexpensiveforverylow-incomesub-saharanones.Thecostargument,alongwiththestatementthattoointegratedcomponentsaredifficulttorepairand/orreplacedefinitelypushforaDo-It-Yourself(DIY)and"off-the-shelves"designorientation.
Theworld-wideavailabilityoflow-cost,open-sourcehardwareplatformssuchasArduino-likeboardsisclearlyanopportunityforbuildinglow-costIoTdevicesfromconsumermarketcomponents.Inadditiontothecostargumentsuchmass-marketboardgreatlybenefitsfromthesupportofaworld-wideandactivecommunityofdevelopers.Thislastargumentisvery
importantanditmustbekeptinmindthatsoftwarecansometimebemoreimportant
thanhardwarebecausedevelopingdriversandspecificlibrariesisaveryhardandtime-
consumingtask.
Figure5showsaselectedsetofthegenuineArduinoecosystemwithvariousArduinoboardmodelsandtheprogrammingIDEthatacceptsplugginsfromalargervarietyofArduino-
RadioBoardInterfaceSensor
Lora 868 ModuleArduino UNOTemp. modulePT1000 Sensor
Fish FarmingAs fish farmer I want to know about water quality …
°C
Water Temperature
IoT Device
ProjectNº687607 WAZIUPD2.1
Page16
compatibleboards:Teensy,Sparkfun,Seeeduino,SODAQ,AdafruitFeather,RFduino,IdeetronNexus,Galileo,…
Figure5–Arduinoecosystem
Anon-exhaustivelistofArduino-compatibleboardsisavailableathttps://en.wikipedia.org/wiki/List_of_Arduino_boards_and_compatible_systems.Theseboardscanbecompatibleeitheratthehardwareoratthesoftwarelevel.
ThecoreArduinoboardecosystemconsistsinlargeformboards(UN0,MEGA,ZERO,DUE)andsmallformboards(MICRO/MINI,PROMINI,NANO).Largeboardsaresuitablefortestingandfirststepprototypingwhilesmallboardscanbeusedforhigherintegratedprototypes,closetofinalproduct.Forinstance,asmallboard(18mmx33mm)liketheArduinoProMinibasedonanATmega328microcontrolleroffersanexcellentprice/performance/energytradeoffandcanprovidealow-costplatformforgenericsensingIoTwithLoRalong-rangetransmissioncapabilityforatotaloflessthan15euro.Figure6showstheoriginalSparkfunProMiniboardontheleft.Thankstoitsopen-sourcedesignandhighversatility,therearemanyChineseclonesavailableataverylow-cost(lessthan1.5euro),seeFigure6(right).
Figure6–OriginalSparkfunArduinoProMini(left)andaChineseclone(right)
ProjectNº687607 WAZIUPD2.1
Page17
TheArduinoProMiniexistsin3.3vand8MHzversiontofurtherreducetheenergyconsumption.Forallthesereasons,weselectedtheArduinoProMiniasthegeneric
platformfordevelopinglow-costIoTdeviceforWAZIUPUseCases.
However,thecoreATmega328microcontrollerhasonly2KBofmemorywhichcanbecomealimitingfactorforsomememory-demandingapplications.Insearchingforaboardwithmorememory,wealsohavetokeepinmindtheArduino-compatibleissue,theenergyconsumptionissueandtheavailabilityoflibraries.WeselectedtheTeensyboardsthatare
compatibleatthesoftwarelevelwithmostoftheArduinolibrariesandcanbe
programmedwithintheArduinoIDE.Theyfeaturemorerecentmicrocontrollerswith
morememory,morepowerefficiencyandmoreadvancedpowermanagement
possibilities.Figure7showstheTeensyLC(left)andtheTeensy3.1(right)boardsthathavethesamesizethantheProMini.
TheTeensyLCcostsabout10eurowhiletheTeensy3.1costsabout16euro.Apartfromthecostfactor,theamountofmemoryrequiredbytheapplicationwillbethedeterminingfactorforchoosingbetweentheLCorthe3.1boardasbothhaveprocessingcapabilitiesthatarewellabovewhatifusuallyneededforsensingapplications.TheTeensyLChasmuchlowerpowerconsumptionthanthe3.1thereforeif8KBofmemoryissufficient,theTeensyLCistheboardofchoice.
Figure7–Teensyboards:LCand3.1
2.3. Hardwareselectionprocess
InWP2,theintegrationofsensinghardwareforaspecificapplicationdomainwillberealizedbyanIoTCataloguetoolthatwilllistalargevarietyofphysicalsensorswiththeirapproximatepriceandrequirementstoeasethedecision-makinganddesignprocess.Thefinalchoicewillbelefttotheintegratorpersonbutoncethechoicehasbeenrealized,theIoTCataloguecanalsohelpingeneratingcodeforthemanagementthephysicalsensors.ThesegeneratedcodecanthenbeintegratedintotheIoTgenerictemplates.
TheIoTCatalogueisdescribedinthenextSection.
Teensy LC48MHzCortex-M0+8K of RAM memory
Teensy 3.172MHzCortex-M464KBof RAMmemory
ProjectNº687607 WAZIUPD2.1
Page18
3. IOTCATALOGUEFORHARDWARESELECTION
Inthelastyears,wehavewitnessedanunprecedentedgrowthinthenumberofIoTdevicesusedamongdifferentdomainsincludinghealthcare,agriculture,smartcities,etc.Eachdomainhasitsownsetofapplicationswhereitisnecessarytocollectandprocessinformationaboutanenvironmentwiththepurposeofproducinganoutputwhichisusedtoimprovetheknowledgeforthatspecificdomain.
Findingasolutioncouldbechallenging,consideringthecomplexityandvarietyofdevicesavailableonthemarket.ThepurposeoftheIoTCatalogueistohelpusersontheprocessofchoosingthemostsuitabledevices.Inthischapter,weexplainwhicharethecomponentsrepresentedinthetool,howtheyarerelatedeachother,howthetoolstoresinformationofeachelementandhowstoreddataisprocessedandcombinedwiththepurposeofproducingmeaningfulinformation.Instructionsarealsoprovidedregardingtheusageofthetool.
3.1. Concepts
Foreachcase,wheninformationisbeingcollectedfromtheenvironment,aspecificsolutionmustbeassembledwhichconsistsinagroupofIoTdevicesthatareworkingasasinglesolutioncapableofsensing,processing,storingandtransmittingdata.TheIoTCatalogue,basedonaproblemdefinedbytheuser,canpresentseveralsolutionswithdifferentcosts,levelsofcomplexity,etc.
AllthecomponentsusedinasolutionarerepresentedbytheIoTCataloguewithdetailedinformation,includingmanufacturer,productpageanditsvendorsallowingtheusertochoosewheretobuythecomponentbasedonthestorelocation,price,etc.Currentlythecomponentsaredividedamongthefollowingtypes:sensor,radio,interfaceandboard.Eachtypeisalsoassociatedwithspecificinformation.
• Sensor:isusedtoperformmeasurementsbycollectinginformationfromtheenvironment.IntheIoTCatalogueeachsensorisrepresentedbytheparametersitmeasuresandwhichunitsareused(eg.Atmospherictemperatureusing°C).
• Interface:isacomponent,usuallyashield,requiredbysomesensorstocommunicatewiththeboard.
• Board:receivesdatacomingfromthesensors/interfaces,processesthem.Datacanbestoredand/ortransmitted.
• Radio:isusedtotransmitdataprocessedbytheboard.Thiscomponentcouldbepartofasolutionwhenconsideringthedeploymentinremoteareas.
IntheIoTCatalogueseveralapplicationsareconsideredtakingintoaccountdifferentenvironments,soallthephysicalinputsmeasuredhavetobetakenintoconsiderationandtheyarerepresentedusingparameters.
• Parameter:representsthephysicalinputcollectedfromtheenvironmentandwhichunitsareused.
ProjectNº687607 WAZIUPD2.1
Page19
• Unit:givesinformationonhowtointerpretaparameteranditcouldchangetakingintoaccounttheorderofmagnitudeofthemeasuredvalue,thetypeofmeasurement,etc.Aunitcouldberelatedwithanother(eg:V<->1000mV).
OneofthepurposesoftheIoTCatalogueistoproposesolutionsbasedonissuesdescribedbyusecasesanddomains:
• Usecase:givesinformationaboutaspecificproblemalongwiththeapplicationdomain,thetargetandtheparametersthatareusefultomeasure,takingintoaccountthecontextoftheproblem.
• Domain:theissuesdescribedbythevarioususecasesoftheIoTCataloguearegroupedintoseveralapplicationsdomains:Agriculture,Environment,etc.
3.2. Back-end
Theback-endisresponsibleforstoringallthedatausedbytheIoTCatalogueandalsotoprovideaninterfacetotheenduser.Thisback-endisbasedonNode.jsaJavaScriptruntimeenvironment,whichprovidesalltherequiredservicessuchasstorage,userauthenticationandrestAPI.
TheFigure8givesanoverviewofallthecomponentsthatarepartoftheback-endwhichareresponsiblefordatastorage,dataaccess,userauthenticationandJSONrestAPI.AllofthesecomponentsareworkingtogetherandarecombinedintoaNode.JSapplication.
Figure8–Back-endoverview
3.2.1. MongoDB
DatausedintheIoTCataloguearerepresentedthroughJSONobjectsthatarestoredonadocument-orienteddatabase.Eachdocumentcancontainoneormorefields,includingarrays,binarydataandsub-documents.MongoDBdatabaseisusedasitisawidelyused
Back-end
Authentication
API
MongoDBConnector MongoDB
Pricecrawler
ProjectNº687607 WAZIUPD2.1
Page20
open-sourcedatabase.Figure9showsthedatamodelusedtorepresentandmodulatetheexistingobjects.
Figure9–Databaserepresentation
3.2.2. MongoDBConnector
ThiscomponentestablishesthecommunicationbetweenthemongoDBserverandthenode.jsapplication,bothrunningintheback-end.ItcontainsthesettingsrequiredtoestablishtheconnectionwiththemongoDBserverandthemethodsusedtoinsert,deleteandupdatedatafromthedatabaseusingthefollowingmethods.
• mongoConnect:establishestheconnectionwiththemongoDBserver.Incaseoffailurethefunctionisgoingtoretrytheconnectioneverysecond.
• insertMongoDoc:addsnewdatatothedatabase.
• updateMongoDoc:updatesanexistingdocumentbasedonagivenid.
• deleteMongoDoc:deletesadocumentfromthedatabasewiththegivenid.
ProjectNº687607 WAZIUPD2.1
Page21
3.2.3. Authentication
AusercanbeauthenticatedontheIoTCatalogue.Withoutauthentication,thetoolisavailableinpublicmodewheretheuserhasonlylimitedaccesstofeatures.Withauthenticationtheuserhasaccesstofurtherinformationand,dependingontheprivileges,theuserwillbeabletoeditandinsertinformationontheIoTCatalogue.Actuallytheauthenticationissupportedbyusername/passwordorusingagoogleaccountandtherearecurrentlythreetypesofusers:
• Read:hasreadonlyaccesstoallthecomponentsincludingtheusecases.
• Write:hasreadandwriteaccesstoallcomponentsincludingtheusecases.
• Admin:besidesthereadandwriteaccess,hasalsoaccesstoauseradministrationpage.
TheauthenticationisbasedonPassport.JSwhichisanauthenticationmiddlewarethatusesthepassport-localstrategyforuser/passwordloginandthepassport-google-oauthstrategyforloginwithagoogleaccount.
3.2.4. API
ItspecifiesthecommunicationandinteractionoftheIoTCataloguewiththeuserandexternalapplications.ThisisaRESTAPIwhichworkswithJSONmessagesthroughthefollowingservices:
• POST-/login:tosigninusingausername/password.
• GET-/auth/google:tosigninusingagoogleaccount.
• GET-/data:toretrieveinformationstoredinthedatabase.
• POST-/data:toadd,deleteormodifyinformationfromthedatabase.Onlyavailableforauthenticatedusers.
TheAPIishostedusingthelibraryExpress.JSwhichisawebapplicationframeworkthatprovidesasetoffeaturesforwebapplications.
3.2.5. Pricecrawler
TheIoTCataloguecontainsinformationaboutthevendorsforeachcomponent(sensor,interface,radioandboard)andstoresdatawithitsname,priceandalinktothevendor’spage.Takingintoaccountthattheinformationofaspecificvendorcouldbeoutdated(newprice,retiredproduct,etc)acrawlerisavailabletoensuretheproductcontainsthelastupdatedprice.
• ThepricecrawlerreceivesfromtheIoTCatalogueinformationaboutthecommercialdetailsofaproduct.
• Thepricecrawlerrequeststheinformationaboutthepricesfromtheproductpagesforeachvendor.
• Thepricecrawlerreceivesthenewprices.
ProjectNº687607 WAZIUPD2.1
Page22
• Ifthenewpricesaredifferentfromthepreviousprices,theupdatedpricesaresentbacktotheIoTCataloguetoupdatetheproductinfo.
• Thisprocessisthenrepeatedforthenextproduct.
Figure10–Pricecrawler
ThepricecrawlerisscheduledtoruneverydayandissupportedbytheinformationavailableinRequestQuerywhichtellstothepricecrawlerhowtoretrievedatafromeachvendorsiteincludingthepricevalue,currencyandavailability.
ThiscrawlerisbasedontheCheeriolibrary,ajQueryimplementationontheserversideallowingtoextractinformationfromHTMLdocuments,andonthenode-schedulelibrarywhichisajobschedulerforNode.JSusedtorunthepricecrawlerautomaticallyeverydayataspecifictime.
3.3. Front-end
Thefront-endallowstheinteractionbetweentheIoTCatalogueandtheend-userbyprovidingawebinterface.Whenaccesstothetoolisavailableinguestmodeitispossibletoconsultinformationaboutdifferentelements.Whenloggedinandauthenticated,itispossibletoaddoreditdataaboutthestoredcomponents.TheusecaseswhichareavailableundertheMVP’sarealsoavailabletoeditandconsult.
Thisfront-endisdividedinto3components:datainput/outputwhichisusedtoreceiveandsenddatatotheback-end;data-processingwhichisusedtoprocessandcombinethedataavailableanduserinterfacewhichreceivestheinputsgivenbytheuseranddisplaystheinformationrequestedbytheuser.AnoverviewisgivenintheFigure11.
SequenceDiagram1interaction
IoT Catalogue Price Crawler Product Page
1 : Product comercial details
2 : Price info request
3 : New prices
4 : Updated prices
Collaboration1::Interaction1::SequenceDiagram1
ProjectNº687607 WAZIUPD2.1
Page23
Figure11–Front-endoverview
Eachcomponentisimplementdwithdifferentlibraries:
• jQuery:aJavaScriptlibraryusedonthemanipulationofHTMLdocuments,eventhandling,AJAXandanimation.
• jQueryUI:asetofuserinterfaceinteractions,effects,widgetsandthemesbuiltonthetopofthejQuerylibrary.
• Bootstrap:anHTML,CSSandJavaScriptframeworkusedonthedesignofresponsivewebinterfaces.
• DataTables:ajQuerypluginusedtoprovideadvancedinteractioncontrolsandenhanceddatavisualizationtotheHTMLtablesofthecatalogue.
• Mustache.JS:aJavaScriptbasedtemplatesystemwhichisusedforformrendering.
• Chosen:asearchengineforselectboxes,makingitsusagesimpler.
• Showdown:aJavaScriptbasedmarkdowntoHTMLconverter.
• Moment.JS:aparsertomanipulatedatesinJavaScript(eg:12:00-14:00->“Twohoursago”).
3.3.1. DataInput/Output
Thiscomponentisusedinthecommunicationbetweenthefront-endandtheback-end.Itisusednotonlyfortheauthenticationprocess(sendusername/password)butalsotoreceiveandsenddataaboutnewelementsandusecases.ThecommunicationisdonethroughthefollowingfunctionswhicharecallingtheRESTAPIavailableontheback-end:
• getData:Usedtoretrievedataabouttheelements.o AJAXURL:./data/<ElementType>/<ElementId>(Forasingleelement)o AJAXMethod:GET
• insertData:Usedtoaddoreditinformationaboutanelement.o AJAXURL:./data/<ElementType>/<ElementId>(Whenediting)o AJAXMethod:POSTo Data:{“action”:”insert”,”data”:<ElementData>}
Front-end
Dataprocessing
Userinterface
DataInput/Output
Back-end
ProjectNº687607 WAZIUPD2.1
Page24
• deleteElement:Usedtodeleteanelement.o AJAXURL:./data/<ElementType>/<ElementId>o AJAXMethod:POSTo Data:{“action”:”delete”}
Insomecases,itisnecessarytoprocessthedatabeforesendingitthroughtheAPIortoprocessthedatareceivedthroughtheAPIbeforeshowingittotheuser.Thisisensuredbythefollowingcomponent.
3.3.2. Dataprocessing
ThiscomponentisresponsibleinprocessingthedataavailableontheIoTCatalogue,inhandlingthedataenteredbytheuser,inpreparingthemtobesentandstoredontheback-endandinarrangingandcombiningthedatacomingfromtheback-endaccordingtotherequestmadebytheuserthroughtheuserinterface.Thefollowingfunctionsareusedonthiscomponent.
• newElement:readsthedataenteredbytheuser,validateandcombinesthemintoanobject,readytobesenttotheback-end.
• getHardwareInfo:givesinformationaboutthehardwarethatisabletomeasurefromalistofgivenparameters.
• sortObjects:sortsobjectsfromavectortakingintoaccountagivenattribute(eg:sortthevectorvendorsbytheattribute‘price’).
Afterprocessingthedata,informationwillbedisplayedtotheuserandthisisdonethroughauserinterface.
3.3.3. Userinterface
Thisisawebbasedinterfacewhichprovidesthemechanismsnecessarytodisplaytotheuserinformationaboutseveralcomponentsandalsoallowstoenternewinformation.OnIoTCataloguetheinformationisaccessedbytheuserthroughtablesandformsandthisinterfaceisprovidedinthefollowinglayout.
ProjectNº687607 WAZIUPD2.1
Page25
Figure12–Webinterfacelayout
Theuserinterfaceisdividedinto3parts:
• Aheaderbarlocatedonthetopofthepagewhichcontainsamenuandinformationfortheloggeduser;
• thenavigationareawhichcontainsanMVPmenuallowingtoseetheusecasesdefinedineachone.Amenuwillcontainthedifferentcategoriesforthehardwareandan‘other’menuwillcontaininformationaboutmiscellaneouscomponents;
• acontentareawhichiswheretheinformationisshownandenteredbytheuserthroughtablesandforms.
Atableisusedtodisplayinformationaboutagroupofobjectsandcouldbeusedforexampletoshowallthecomponentsofspecifictype(listallthesensors).Clickingonasinglelineofthetableopensaformcontainingextrainformationabouttheobjectanditisalsopossibletoperformasearchusingthesearchtextboxfilterlistbyattributenameusingthedropdownsavailable.Figure13showsanexamplewhereinformationaboutseveralsensorsisbeingdisplayedalongwiththename,themanufactureranditsprice.
Navigationarea Contentarea
Headerbar
ProjectNº687607 WAZIUPD2.1
Page26
Figure13–Listingofallthesensors
Aformcanbeusedbothineditandviewmodewheninformationisbeingadded/enteredorwhendetailedinformationisbeingconsultedfromacomponent.Thefollowingfigureshowsanexamplewheredetailedinformationisshownaboutaparameter,bothineditandviewmode.
Figure14–Parameterinformation
ThefollowingfunctionsareusedtohandletheformsandthetablesavailableintheIoTCatalogue.
• newFormLoad:loadsinthecontentareatheformlayouttakingintoaccountthedatathatisbeingenteredbytheuser.
• fillElementForm:fillsallthefieldsoftheloadedformtakingintoaccountthedataavailableforaspecificelement.
• fillElementsTable:listsinatableallthecomponentsofaspecifictype,includinginformationofspecificofeachtype(eg:Name,ManufacturerandPrice).
• fillVendorsTable:listinatableallthevendorsforaspecificcomponent,includinginformationaboutthevendorname,thepriceandthedateofthelastpriceupdate.
ProjectNº687607 WAZIUPD2.1
Page27
• fillHardwareTable:listsinatableallthehardwarethatcanbeusedtomeasureagroupofparameters,includinginformationaboutthesensornameandaboutitsprice.
• exportDoc:displaysonthecontentareaalltheusecasesorganizedbyMVP’slistingalltheactors,parametersandhardwareforeachone.
Thisfront-endalsoprovidesanadministrationpageforuserswithadminprivileges.Thenextsectionprovidesinstructionontheusageofthetoolandtheinstructionsareillustratedbyseveralexamples.
3.4. Manual
TheIoTCatalogueprovidesahelpmodewhichisintendedtoaidtheuserduringitsnavigation.ThismodecanbeactivatedinthetopbarasshownintheFigure15.
Figure15–Helpmode
Thewebinterfaceforeachpageincludesextrainstructions,makingeasiertoconsultandenterinformation.NavigationontheIoTcatalogueismadethroughmenus,tablesandforms.Menusareusedtoselectwhichtypeofinformationarelistedinthetable.Itisthenpossibletoselectalinefromthetabletoconsultdetailedinformationaboutasingleelement.Figure16showshowinformationaboutasingleusecasecanbeconsulted.
Figure16–Consultinganusecase
Inthenextparagraphs,examplesaregivenforallthemenusavailableunderthenavigationarea,showingalltheoptionsandthetypesofinformationthatareretrievedbyusingeachmenu.
Menu with all MVP’s, byselecting ‘Agriculture’ allthe use cases for thisMVP are listed.
This table lists all the usecases for the AgricultureMVP, detailed informationis shown by clicking in asingle line.
This form shows detailedinformation for the usecase selected in the table.
ProjectNº687607 WAZIUPD2.1
Page28
3.4.1. MVP’smenu
TheIoTCatalogueinthecontextofWAZIUPorganizestheinformationfromtheusecasesamongdifferentMVP’s.UnderthefirstmenulocatedinthenavigationareaitispossibletolistalltheusecasesforaspecificMVP.Thefollowingexampleshowshowtheagriculturerelatedusecasesarebeinglisted.
Figure17–AgricultureMVP’s
Figure18–Agricultureusecase
ProjectNº687607 WAZIUPD2.1
Page29
ThetableinFigure18showsalltheusecasesrelatedwiththeAgricultureMVPalongwithinformationaboutdescriptionofeachone,thenumberofactorsthatareaffectedandtheparametersthataremeasuredunderthecontextoftheproblem.Byclickinginalineofthetableitispossibletoconsultdetailedinformationabouttheusecase.AnexampleisprovidedinFigure18.
TheformshowninFigure19detailsinformationaboutausecaseoftheAgricultureMVP.IntheMVPmenuitisalsopossibletolistalltheactors,thehardwareusedortogenerateareportcontainingdetailedinformationofeachusecase.Figure19showsalistofalltheactorsavailableonthetool.
Figure19–Listofallactors
Alltheactorsusedontheusecasesarebeinglistedalongwithitsname.Clickingonatablelineallowsthroughaformtoconsultoredititsname.TheinformationoftheactorsusedisdisplayedwhenconsultinginformationaboutausecaseoraMVP.AsshowninFigure20itispossibletoseeareportforCattleRustlingMVPbeinggeneratedincludingtheinformationofitsactors.
ProjectNº687607 WAZIUPD2.1
Page30
Figure20–CattleRustlingreport
Inthisreportitispossibletoseeforeachusecasedetailedinformationalongwithitsactors,theparametersandthehardwaresolutions.Therearebuttons(locatedonthetop)usedtohide/unhideinformationpercategoryandabutton(locatedonthetopright)usedtoprinttheinformationdisplayed.ItisalsopossibletolistthehardwaresolutionsperMVP.
Figure21–HardwaresolutionsforCattlerustling
ProjectNº687607 WAZIUPD2.1
Page31
ThetableincludesallthesensorsusedonCattleRustlingMVPalongwithinformationaboutitsnameandprice.
3.4.2. Hardwaremenu
TheHardwaremenuliststhehardwarestoredontheIoTCataloguetochooseamongBoard,Interface,RadioandSensortolistthecomponentsofaspecifictype.Theinformationisdisplayedinatableanditincludesthenameofthecomponent,themanufacturerandthecostconsideringthevendorwiththelowestprice.InFigure22wecanseeaexamplewhereinformationaboutthealltheboardsisbeinglisted.
Figure22–Listofallboards
Alltheboardsarebeinglistedalongwithbasicinformation.Byclickinginatablelineitispossibletosee/editdetailedinformationaboutthecomponent.Figure23showsanexamplewheredetailedinformationaboutthe“ArduinoNano”isbeingshown.
ProjectNº687607 WAZIUPD2.1
Page32
Figure23–ArduinoNano
Onthisscreenitispossibletoseeandeditalltheattributesforthesensor“AnalogpHMeterKit-Probe".Itisalsopossibletoremovethedocumentfromthedatabasebyusingthe“Delete”buttonlocatedatthebottomoftheform.
3.4.3. Othermenu
Thelastmenuofthenavigationgivesaccesstomiscellaneouscomponentssuchasradiocommunicationprotocols,domains,parametersandunits.Inthefollowingexampleitispossibletoseethelistingofallradiocommunicationprotocols.
ProjectNº687607 WAZIUPD2.1
Page33
Figure24–Radiocommunicationprotocols
Foreachcommunicationprotocolitispossibletoseeinformationregardingitsname,theprotocolstandard,thefrequencyandthemodeofoperation.Byselectingasingleelementitispossibletoseedetailedinformationabouttheprotocolandalsothehardwarethatisassociatedwiththeprotocol.Figure25showsanexampleforthe“Bluetoothv4.2”.
Figure25–Bluetoothv4.2
ProjectNº687607 WAZIUPD2.1
Page34
3.4.4. Newelement
IntheIoTCatalogue,addingnewinformationaboutacomponentisdonethroughaform.Foreachtypeofcomponenttakingintoaccountitsattributesadifferenttemplateisusedtogeneratetheformthatwillallowtheusertoinputinformationaboutthecomponent.Figure26showsanexampleforacasewhereanewunitisbeingaddedtotheIoTCatalogue.Therearetemplatesforthefollowingcomponenttypes:
• Actor• Board• Communication• Domain• Interface• MVP• Parameter• Radio• Sensor• Unit• Usecase
Figure26–Newunit
ProjectNº687607 WAZIUPD2.1
Page35
Onthisexampletheloadedformwasbasedonthe“Unit”templatewhereeachfieldoftheformisrelatedtoanattributeoftheproducedJSONobjectforthiscomponentandwheresomeofthefieldsaremandatory.Thefollowingpageshowsasummaryofalloptionthatareavailablethroughthenavigationarea.
ThenavigationareaintheIoTCataloguecontainsseveraloptionsandeachonehasitsowntypeofinteractionwiththeusertoconsultoreditinformationabouttheelementsstoredonthetool.Thefollowingfiguregivesanoverviewofthenavigationareawhereitispossibletoseealltheoptionsavailable,howtheyarerelatedeachotherandhowtheyinteractwiththeuser(byforms,table,menus,etc.).
Figure27–Navigationoverview
� IoT CatalogueMVP�MVP Dropdown�Export data�List hardware solutions�List actors
�MVP Selector�MVP Selector dropdown�Export data�List hardware solutions
�Use case detailsHardware�Board�Board details
� Interface� Interface details
�Radio�Radio details
�Sensor�Sensor details
Other�Communication�Communication details
�Domain�Domain details
�Parameter�Parameter details
�Unit�Unit details
�New element
ProjectNº687607 WAZIUPD2.1
Page36
4. IOTCONNECTIVITY4.1. Introduction
IoTdevicesnaturallyusewirelesstechnologiestocommunicate.IoTcommunicationsarecategorizedasMachine-to-Machinecommunicationstodifferentiatethemfromtraditionalhuman-orientedcommunications.
ManyIoTapplicationsaregenerallyremotesensingsystemswheremeasures(e.g.temperature,acceleration,contacttime,...)fromthephysicalworld,orfromentitiesinthephysicalworld,arecollectedformonitoringandpossiblyanalysis&instrumentationtasks.TheapplicationmodelofIoTisverylargeandWAZIUPwillnotaddressallofthem.IntheWAZIUPproject,theremotesensingscenariosarewillbethemainscenariosfordeployed
applicationsandFigure28showsatypicalIoTremotesensingusingeithersimple1-hopconnectivity(redlinks)ormulti-hopconnectivity(blackdottedlinks)fromend-devicetoagateway.
Figure28–Remotesensingscenariowith1-hopconnectivitytothegateway
1-hopconnectivityhasclearadvantagesoverthemulti-hopcasebecauseofitssimplicitywhendeployingthedevicesonalarge-scale.Multi-hopcommunicationstypicallyneedmorecomplexmechanismstobeimplementedsuchasroutingprotocols,synchronizationissueswhenduty-cyclingisapplied,funnelingeffectsfordevicesclosetothegateway,...Overthelastdecade,themainradiotechnologyformulti-hopIoTisIEEE802.15.4whichservesforinstanceasthephysicallayerofZigBee,WirelessHart&ISA100networksandproductstonameafew.
However,1-hopconnectivityinlong-rangescenariosisveryenergyconsumingwithtraditionalcellularradiotechnologiessuchasGSMorGPRSasshowninFigure29.Thereforeitisdifficulttodeploybattery-operateddevicesunderthesetechnologiesthathavealonglifetime.Inadditiontotheenergycost,cellulartechnologiesrelyonmobilecellularoperatorswherethecostofthenetwork/servicesubscriptionfeesisfarfrombeingnegligible.
ProjectNº687607 WAZIUPD2.1
Page37
Figure29–Energyconsumptionfortraditionalcellulartechnologies
AnimportantfeatureforanIoT1-hopradiotechnologycandidateisthereforelowpowerconsumption.Theotherfeatureisofcoursethelong-rangetransmissioncapability.Regardingtransmission(andreception)range,Figure30showsinaverysimplifiedviewthetransmission/receptionchainofawirelesstransmissionwherethenotionof"receiver'ssensitivity"forcorrectpacketreceptionisillustrated.
Figure30–Simplifiedviewofthelinkbudgetofawirelesstransmission
Thereceiver'ssensitivityisusuallydefinedasthelowestinputpowerwithacceptablelinkquality,typically1%PER(PacketErrorRate).Generally,thereceiver'ssensitivity,atagiventransmissionpower,canbegreatlyimprovedbyreducingthethroughput.
Recently,2radiotechnologieshaveinitiatedanincrediblemovementtowardslow-powerlong-rangewideareanetworks(LPWAN):SigFoxTMandLoRaTMwheretherangein1-hopcanbemorethan15kmsinLine-of-Sight(LOS)conditions.TheseLPWANtechnologiesaredefinitelymoresuitableforbattery-operatedIoTdevicesthantraditionalcellulartechnologiesastheirpowerconsumptioncanbecomparedtopreviousshort-rangeradiotechnologies(suchasIEEE802.15.4)but,withtheincreaseinreceptionrange,canavoidthecomplexityofmulti-hopnetworks.Theybothfollowthe"talkslower":throughputisintheorderofseveralkbpswhichisbyfarmuchsmallerthantraditionalwirelesstechnologies.Followingtheseprecursortechnologies,manyothertechnologiesoradaptationofexistingtechnologiesarealsotryingtoaddressthelow-power,long-rangeandlowerthroughputIoTmarket.ThenextsectionwillprovideabriefreviewoftheseLPWANtechnologies.
200-500mA 500-1000mA 100-300mA
From Peter R. Egli, INDIGOO.COM
ProjectNº687607 WAZIUPD2.1
Page38
4.2. Briefreviewoflong-rangetechnologies
Figure31showsthemainIEEE802wirelesstechnologiesandtheircorrespondingtargetdatarateandrange.TheregionaddressedbytherecentLPWANtechnologiesistypicallytheoneprovidingverylowdataratebutlongerrange.Thisregionhasnotbeensignificantlyaddressedinthepast.SigFoxandLoRaarethefirsttruelong-rangetechnologieswithahighperformance/pricetradeoff,makingthemverypromisingforlarge-scaledeploymentofIoT.
Figure31–IEEE802wirelesstechnologiesandLPWAN
ThereareothertechnologiesthatclaimtoaddresstheLPWANsegment.Itisbeyondthepurposeofthisdocumenttodescribethemisdetailbutwecanmentionsomeofthem:
• Weightless-N,Weightless-P• LTE-CatM1• RPMA• IEEE802.11ah• NWave• Telensa• NB-IoT• Amber-Wireless• WaveIoT
Manyofthemarenotavailableyetonamass-marketperspective.SigFoxandLoRaarestillthe2majorLPWANtechnologiesthatreceivedimportantsupportfromalargenumberofindustrialsandoperators.ReaderswillingtoknowmoreaboutthesetechnologiescanfirstrefertotheLinkLabwhitepaper[1]andthentotheEDN.comarticle[2].
SigFoxisverydifferentfromLoRainthesensethatSigFoxpositionitselfmainlyasanoperatorwherasLoRaisonlythephysicalmodulationtechniquesthatispatentedbySemtech.Thirdpartiescanuse(buy)SemtechLoRachipstodeploytheirownLPWANnetworks.Somethirdpartiesmaybethemselvesoperatorswithatraditionalbusinessmodelbutsomeotherscanbesimplyend-usersdeployingtheirownad-hocLPWANnetworks.ThisiswhyWAZIUPprojectusesonlyLoRatechnologytobuildlow-costIoTinfrastructuresand
platforms.
Energy
Energy-Range dilemma
L P W A N ?
2G/3G/4G
ProjectNº687607 WAZIUPD2.1
Page39
4.3. LoRalong-rangetechnology
LoRaisalong-rangeradiotechnologydevelopedbySemtech.HereisadefinitionfromSemtech'sLoRaFAQ:
"LoRaTM(LongRange)isamodulationtechniquethatprovidessignificantlylongerrangethancompetingtechnologies.Themodulationisbasedonspread-spectrumtechniquesandavariationofchirpspreadspectrum(CSS)withintegratedforwarderrorcorrection(FEC).LoRasignificantlyimprovesthereceiversensitivityandaswithotherspread spectrummodulationtechniques,usestheentirechannelbandwidthtobroadcastasignal,makingitrobusttochannelnoiseandinsensitivetofrequencyoffsetscausedfromtheuseoflowcostcrystals.LoRacandemodulatesignals19.5dBbelowthenoisefloorwhilemostfrequencyshiftkeyingsystems(FSK)needasignalpowerof8-10dBabovethenoisefloortodemodulateproperly.TheLoRamodulationisthephysicallayer(PHY),whichcanbeutilizedwithdifferentprotocolsandindifferentnetworkarchitecture–Mesh,Star,pointtopoint,etcetera."[http://www.semtech.com/wireless-rf/lora/LoRa-FAQs.pdf]
InLoRa,throughputandrangedependon3mainLoRaparameters:BW,CRandSF.BWisthephysicalbandwidthforRFmodulationandcantakevaluesof500kHz,250kHz,125kHzand62.5kHz.Largersignalbandwidthallowsforhighereffectivedatarate,thusreducingtransmissiontimeattheexpenseofreducedsensitivity.CRisthecodingrateforforwarderrordetectionandcorrection.Suchcodingincursatransmissionoverheadandthelowerthecodingrate,thehigherthecodingrateoverheadratio,e.g.withcoding_rate=4/(4+CR)theoverheadratiois1.25forCR=1whichistheminimumvalue.Finally,SFisthespreadingfactorthatcanbesetfrom6to12.ThelowertheSF,thehigherthedataratetransmissionbutthelowertheimmunitytointerferencethusthesmalleristherange.
Figure32fromSemtechshowsforvariousbandwidthandspreadingfactorvaluestheexpectedthroughputandreceiversensitivity.
Figure32–LoRathroughputandsensitivityforvariousBWandSFvalues
4.3.1. Physicallayer
Atthephysicallayer,LoRamodulationisavariationofChirpSpreadSpectrum(CSS)thatwaslongbeforebeendevelopedinradartechnologies.WewillnotdescribeindetailtheLoRamodulationasitisalsobeyondthescopeofthisdocumentbutthereaderscanrefertotheSemtechdocument[3],theRevSpacearticle[4]andtheReversingLoRaarticle[5]thatexplainsinacomprehensivemannertheLoRaunderlyingmodulationapproach.However,forafastglanceonLoRamodulation,weincludebelowatexttakenfrom[3].
ProjectNº687607 WAZIUPD2.1
Page40
FromSemtech'sAN1200.22
"LoRaisaproprietaryspreadspectrummodulationschemethatisderivativeofChirpSpreadSpectrummodulation(CSS)andwhichtradesdatarateforsensitivitywithinafixedchannelbandwidth.Itimplementsavariabledatarate,utilizingorthogonalspreadingfactors,whichallowsthesystemdesignertotradedatarateforrangeorpower,soastooptimizenetworkperformanceinaconstantbandwidth."
"InLoRamodulationthespreadingofthespectrumisachievedbygeneratingachirpsignalthatcontinuouslyvariesinfrequency.Anadvantageofthismethodisthattimingandfrequencyoffsetsbetweentransmitterandreceiverareequivalent,greatlyreducingthecomplexityofthereceiverdesign.Thefrequencybandwidthofthischirpisequivalenttothespectralbandwidthofthesignal."
WealsoincludehereanillustrationofaLoRatransmissiontakenfrom[4].
Figure33–spectrogramexampleofaLoRatransmission
"Theimage[...]showstheLoRaspectrogramforashortmessageasrecordedbygqrx,whensendinga1-bytepayload(withsettingsSF=12,BW=8,CR=4/8,implicitheader).Atthebottomofthespectrogramyoucanseethepreambleconsistingof10up-chirpsand2down-chirps.Atthetopofthespectrogramyouseethedataportionofthesignal,consistingsolelyofup-chirps."
4.3.2. LoRaWAN
AsLoRadefinesonlythephysicallayer,themodulation,theLoRaWANspecification[6][7]additionallydefinescommondataandcontrolchannels(frequencyandspreadingfactors),packetformat,MACcommands,...forlarge-scaledeploymentwithnetworkserversandapplicationservers.LoRaWANalsodefinesseveralclassesfortheend-devicedependingonthecommunicationneeds.EachclasshasitsownrequirementsalsodefinedbyLoRaWANspecifications.
ProjectNº687607 WAZIUPD2.1
Page41
FromSemtech'sLoRaFAQ:
“TheLoRamodulationisthePHY,andLoRaWANisaMACprotocolforahighcapacitylongrangeandlowpowerstarnetworkthattheLoRaAllianceisstandardizingforLowPowerWideAreaNetworks(LPWAN).TheLoRaWANprotocolisoptimizedforlowcost,batteryoperatedsensorsandincludesdifferentclassesofnodestooptimizethetradeoffbetweennetworklatencyandbatterylifetime.Itisfullybi-directionalandwasarchitectedbysecurityexpertstoensurereliabilityandsafety.ThearchitectureofLoRaWANwasalsodesignedtoeasilylocatemobileobjectsforassettracking,whichisoneofthefastestgrowingvolumeapplicationsforInternetofThings(IoT).LoRaWANisbeingdeployedfornationwidenetworksbymajortelecomoperators,andtheLoRaAllianceisstandardizingLoRaWANtomakesurethedifferentnationwidenetworksareinteroperable.”
AtypicalLoRaWANnetworkisdepictedinFigure34.Networkserverswillhandleallcommunicationsbetweenend-devicesandgatewaysandthereforeimplementmostoftheLoRaWANfunctionalitiesbyinteractingatalowerlevelwiththegateways.Applicationserverscanservetostoretheend-userapplicationdata.
Figure34–LoraWANtypicaltopology
4.3.3. LoRaradiomodules
TheLoRamodulationisimplementedinso-calledLoRatransceiverchipsprovidedbySemtech.TheybelongtotheSX127xfamilyandLoRamodulationisimplementedinSX1272/73/76/77/78chipsasdocumentedin[8].
VariousmanufacturersthenusetheSemtechchipstoproposeLoRaradiomodulesthatcanfurtherbeintegrated/connectedintomicrocontrollerboards.NotethatalthoughanSX1276chipcanforexamplesupportseveralfrequencybands,i.e.433MHz,868MHzand915MHz,thedesignofaradiomoduletosuitagivenfrequencybandcanbedifferentasdocumentedintheSemtechReferenceDesignOverviewdocument[9].Thisismainlyduetohowthedifferentamplifiercomponents/linesoftheLoRachipsareused/wiredtopowertheradiotransmission.
Figure35showssomeradiomodulesthatwefullytestedintheWAZIUPproject,asitwillbeexplainedlateroninsection5.3.2.
ProjectNº687607 WAZIUPD2.1
Page42
Figure35–someradiomodulebuiltfromSX127xSemtechchips
LoRaradiomodulescaneitherexposetherawLoRatransceiverfeaturesoraddaLoRaWANprotocolstackontopoftheSemtechchip.The6modulesshownaboveonlyexposetherawLoRatransceiverfunctionalities.
4.4. Transmissionintheunlicensedfrequencyband
Wirelesscommunicationsareusuallyhighlyregulatedinmostcountriesanditisnotallowedtotransmitfreelyinafrequencybandexceptorsomeso-calledunlicensedbands.TheISM(Industry,ScientificandMedical)bandisoneofthemostwell-knownunlicensedband.Forinstance,the2.4GHzISMbandisaninternationallyagreedunlicensedbandsothatWiFioperatinginthisbandcanbedeployedfreeoflicenseauthorizationandcharges.ItisthesamereasonthatallowsmostpeopleonEarthtobeabletohavemicrowaveovensastheyuse2.4GHzmicrowaves.Figure36showsabriefoverviewoftheunlicensedfrequencybandsperregion.
Figure36–ISMbandperregion
Manyrecentlong-rangeradiotechnologies(thusincludingLoRa)dooperateintheunlicensedfrequencybandsthatusuallychangefromonecountrytoanother.Thechoiceofunlicensedbandisnotreallyatechnicalconstraintbecausetheselong-rangetechnologiescanalsooperateinotherfrequencybandsthatarelicensed(forinstancethoseusesbymobiletelephonyoperators).Thechoiceofunlicensedbandisrathermotivatedbytheeaseofdeploymentoftheseinitiallong-rangedevicesinordertoboostthemarket.Itisforeseen
Libelium LoRa HopeRF RFM92W/95W
Modtronix inAir9/9B
NiceRF LoRa1276
ProjectNº687607 WAZIUPD2.1
Page43
thatmanyoperatorswillfinallyreuseGSM/2GfrequencybandsfordeployingLPWANtechnologiesinlicensedbands.
InmostofEuropeancountries,theunlicensedbandsforLoRausageis433MHzand868MHz.ThesecountriesusuallyadheretotheETSIregulationsforShortRangeDevice(SRD)insub-GHzbandsdefinedintheETSIEN300-220-1document[10].The868MHzbandisusuallypreferredforIoTasthe433MHzbandisquitesaturatedbyexistingradiodevicessuchasaudio,alarmsandotherremotecontroldevices.Additionally,asthesebandsare“free”,someconstraintsaretobeputtoavoidexcessiveusageandsaturationofthefrequencybands.Themainregulationmechanismsaretransmissionpowerlimitationandtransmissiontimelimitation.Thelatterisusuallyrefertoas“duty-cycle”limitationexpressedforinstanceas1%perhour.Inthiscase,thetotaltransmissiontimeofanSRDdeviceunder1%duty-cycleis36sperhourperiod.MoredetailsonSRDregulationscanbereadin[10].Fortransmissionpowerlimitation,typicallimitationis14dBm(25mW)inEuropeinthe868MHzbandasillustratedinFigure37belowtakenfromETSIEN300-220-1document[10].
Figure37–868MHzunlicensedbandrestrictions
Notethat1%dutycyclecanbeusedprovidedthatthebandisrestrictedto865-868MHzasindicatedmainlybynote9below,alsotakenfromETSIEN300-220-1document[10].
Figure38–additionalnotes
ProjectNº687607 WAZIUPD2.1
Page44
InSub-SaharanAfricacountries,theunlicensedbandsusuallydifferfromonecountrytoanother,withalsovariousconstraintsfromonecountrytoanother.
IntheWAZIUPproject,theradiotransmissionwillhavetoadaptedtothelocal
regulations.Therefore,rangeorperformanceofthelong-rangeplatformmayvaryfrom
onecountrytoanother.
ForSenegal,wewillusethe863-865MHzbandwithtransmissionpowerlimitedto10dBm
(10mW)[11].WeareintheprocessofadaptingtootherAfricanpartner’scountryaswell.
ProjectNº687607 WAZIUPD2.1
Page45
5. WAZIUPLOW-COSTIOTPLATFORM
5.1. IoTplatform'sobjectives
TheWAZIUPlow-costIoTplatformwillprovideanopen-source,simplelong-rangecommunicationlibrary,genericbuildingblocksandtoolsforbuildingefficientlow-costIoTdevicesandgatewaysfrom“off-the-shelves”consumer-marketcomponents.Thelong-rangecommunicationlibrarytargetsLoRaradiomodulesasLoRaradiotechnologiesischosenfortheIoTcommunicationpart.
Forthelow-costend-devices,weshowtheusageofthelong-rangecommunicationlibraryandhowlow-power/duty-cycledapplicationscanbeprogrammed.
Forthelow-costgateway,WAZIUPprovidesalow-levelradiobridgeprogramtoreceiveLoRapacketsfromend-devicesandhigher-levelprograms/tools/scriptstofurtherprocessthereceiveddata.AtypicalsimpletaskwouldbeforinstancetopushreceiveddatafromdeployedsensorstopublicIoTcloudplatforms.
Trainingmaterialssuchasstep-by-steptutorialslidesandshorttutorialvideosequencesexplainhowtobuildtheentirelow-costWAZIUPLoRaIoTecosystem.
RegardingLoRaWANadoption,ratherthanprovidinglarge-scaledeploymentsupport,WAZIUPtargetssmallsizedeploymentscenarios.Inthosekindofapplications,therewillbemostlikelyasingleapplicationowner,e.g.afishfarmingmanagerwillingtogetinreal-timevariouswaterqualityindicatorsinthefishponds.
5.1.1. Deploymentscenarios
OurLoRaframeworkfocusesoneasyintegrationoflow-cost"off-the-shelves"componentswithsimple,openprogramminglibrariesandtemplatesforeasyappropriationandcustomizationbythird-partiesapplications,communitiesandICTcompanies.
Inaddition,WAZIUPalsotakesintoaccountthefactthatInternetconnectivitycanbequiteunstableorsimplyimpossibletogetinsomeremoteareas.Figure39depictsthe2scenarios(withInternetaccessandwithoutInternetaccess)thatWAZIUPcanhandle.
Figure39–TraditionalInternetaccessscenario(top),withoutInternetaccess(bottom)
Internet access
B
A
10-15kms
No subscription Deploy own network Low energy consumption
ProjectNº687607 WAZIUPD2.1
Page46
OurframeworkcanbedeployedinafullyautonomouswaywithouttheneedofInternetaccessnorInternetservers(especiallyavoidingnetworkandapplicationserversasdefinedbyLoRaWAN)togetthesenseddata.Therefore,ourframeworkproposeslocalinteractionmethodswiththeend-userusingsmartphones/tablet/laptopwithwell-knowntechnologiessuchasWiFiorBluetooth.
5.1.2. WhyarewenotLoRaWANcompliant?
Fromtheorientationanddesignchoiceperspective,wealreadyexplainedourchoiceabove:whileLoRaWANistargetedatlargescaledeployments,WAZIUPtargetssmall-scaledeployments.Furthermore,wewanttoprovidealevelofperformanceandcustomizationthatisnotavailablewithLoRaWAN.
Withthegateway-centricmodeofLoRaLPWANtechnology,commercialLoRaWANgatewaysforlarge-scaledeploymentscenariosareabletolistenonseveralchannelsandLoRasettingssimultaneously.Theytypicallyuseadvancedradioconcentratorschipscapableofscanningupto8differentchannels:theSX1301concentratorisusedinsteadoftheSX127xchipseriesthataredesignedforend-devices.
Ourgatewayusesadifferentapproachinthecontextofagriculture/microandsmallfarm/villageenvironments:simpler"singleconnection/channel"(onecombinationofBW,CR,SFandonefrequencyatatime)gatewayscanbebuiltaroundanSX1272/76radiomodule,muchlikeanend-devicewouldbe.Thisdesignchoicegreatlydecreasesthecostandcomplexityofthegateway.Atthesametime,advancedmechanismstolimitinterferencescanbeimplementedtocompensateforthe"singleconnection/channel"limitation.
OurframeworkalsodoesnotfollowtheLoRaWANstandardbecauseitwantstoproposethepossibilitytoaddadvancedandad-hocmechanismssuchas:
• P2P(device-to-device)communicationstoallowfordirectdevicecooperationschemes;
• LoRarepeatersfunctionalityinend-devicestohandlepracticaldeploymentissueswhensomesensingdevicesareinveryremoteareas,placedveryclosetothegroundorobstacles;
• Advanced(andad-hoc)channelaccessmethodstoincreasetransmissionreliability;
• AdvancedQualityofServicemechanismtohandletheduty-cyclelimitofsub-GHztransmission,providingsomemeansofguaranteeingtransmissionlatency;
MoreinformationaredetailedinourFAQ:[Doc]Low-costLoRaIoTdevicesandgatewayFAQLatestversioncanbedownloadedfrom:https://github.com/CongducPham/tutorials/blob/master/FAQ.pdf
5.2. Low-costgateways
Withthesimpler"single-connection"gatewayapproach,alow-costgatewaycanbebuiltbasedonasimplerradiomodule,muchlikeanend-devicewouldbe.Then,byusingan
ProjectNº687607 WAZIUPD2.1
Page47
embeddedLinuxplatformssuchastheRaspberryPIwithhighprice/quality/reliabilitytradeoff,thecostofsuchgatewaycanbelessthan45euro.
Therefore,ratherthanprovidinglarge-scaledeploymentsupport,IoTplatformsindevelopingcountriesneedtofocusoneasyintegrationoflow-cost"off-the-shelves"componentswithsimple,openprogramminglibrariesandtemplatesforeasyappropriationandcustomizationbythird-parties.Bytakinganadhocapproach,complexandsmartermechanisms,suchasadvancedradiochannelaccesstoovercomethelimitationsofalow-costgateway,canevenbeintegratedaslongastheyremaintransparenttothefinaldevelopers.Thelow-costgatewayarchitecturewillbedescribedinSection5.5.
5.3. Long-rangecommunicationlibrary
Thelong-rangecommunicationlibraryisbasedonanopen-sourcelibrarydevelopedbytheLibeliumcompanyfortheirLibeliumSX1272radiomodule.WeenhanceditwithvariousmechanismsforWAZIUPasexplainedinthenextparagraphs.Notethatthedevelopedlibraryworksforend-devicesandgateways,thereforesimplifyingmaintenance,updatesandfuturecommondevelopments.
5.3.1. ImprovementstotheLibeliumSX1272library
ThefollowingimprovementshavebeenperformedontheinitialSX1272library:
* Now, 26th, 2016 * - add preliminary support for ToA limitation * - when in "production" mode, uncomment #define LIMIT_TOA * Now, 16th, 2016 * - provide better power management mechanisms * - manage PA_BOOST and dBm setting * Jan, 23rd, 2016 * - the packet format at transmission does not use the original Libelium format anymore * - the format is now dst(1B) ptype(1B) src(1B) seq(1B) payload(xB) * - ptype is decomposed in 2 parts type(4bits) flags(4bits) * - type can take current value of DATA=0001 and ACK=0010 * - the flags are from left to right: ack_requested|encrypted|with_appkey|is_binary * - ptype can be set with setPacketType(), see constant defined in SX1272.h * - the header length is then 4 instead of 5 * Jan, 16th, 2016 * - add support for SX1276, automatic detect * - add LF/HF calibaration copied from LoRaMAC-Node. * - change various radio settings * Dec, 10th, 2015 * - add SyncWord for test with simple LoRaWAN * - add mode 11 that have BW=125, CR=4/5, SF=7 on channel 868.1MHz * Nov, 13th, 2015 * - add CarrierSense() to perform some Listen Before Talk procedure * - add dynamic ACK suport * Jun, 2015 * - Add time on air computation and CAD features
Notableimprovementsare:
1. ThesupportofbothArduino-basedend-devicesaswellasRaspberry-basedgatewaytoreducemaintenancecomplexityandthird-partyappropriationandtraining,
2. ThesupportofbothSX1272,1276and1278transceiverswhichmakesthelibraryabletodrivemostavailableSPI-basedradiomodulesonthemarket,
3. amoreflexiblepowermanagementwithselectionofPA_BOOSTorRFOamplifierlinestodrivemostavailableSPI-basedradiomodulesonthemarket,
ProjectNº687607 WAZIUPD2.1
Page48
4. acarriersensemechanismwithcustomizableback-offprocedure,
5. aTimeonAirlimitationforduty-cycleregulationenforcement,
6. additionalfrequencybandsforAfricacountries,
7. asimplificationofdevelopper'sAPI
5.3.2. LoRamodulesthathavebeentested
TherearemanySX1272/76/78-basedradiomodulesavailableandwecurrentlytestedwith7:theLibeliumSX1272LoRa,theHopeRFRFM92W(SX1272)&RFM95W(SX1276),theModtronixinAir9(SX1276)&inAir9B(SX1276)&inAir4(SX1278orSX1276)andtheNiceRFSX1276.ActuallymostnativeSPI-basedLoRamodulesaresupportedwithoutmodificationsasreportedbymanyusers.Inmostcases,onlyaminimumsolderingworkisnecessarytoconnecttherequiredSPIpinsoftheradio(MISO,MOSI,CS,CLK)tothecorrespondingpinsonthemicrocontrollerboard.
5.3.3. Radioregulationssuchasfrequencybandsandduty-cycle
InEurope,electromagnetictransmissionsinthe868MHzISMBandusedbySemtech'sLoRatechnologyfallsintotheShortRangeDevices(SRD)category.TheETSIEN300-220-1andERC/REC70-03documentsspecifyvariousrequirementsforSRDdevices,especiallythoseonunlicensedfrequencybandsandradioactivitylimitation.
Regardingfrequencybands,thelibraryhas6predefinedchannels(from4to9)inthe863-865MHzband,8pre-definedchannels(from10to17)inthe865-868MHzbandand13pre-definedchannels(from0to12)inthe903-915MHzband.
Regardingregulationunderduty-cyclelimitation,generallytransmittersareconstrainedtoamaximumof0.1%,1%or10%everyhourdependingonthetransmissionpowerandthefrequencyband.Forinstancea1%duty-cyclemeans36sofradioactivitytimeperperiodof1hour.Thisdutycyclelimitappliestothetotaltransmissiontime,evenifthetransmittercanchangetoanotherchannel.Therationaleforsuchconstraintsistoavoidsaturatingtheradiochannelasthisisanunlicensedband(freeforeverybodytouseasopposedtomostoffrequencybandsusedincommercialmobilephonenetworks).
5.3.4. LoRamodes
Asindicatedpreviously,the3mainLoRaparametersareBW,CRandSF.BWandSFbeingthe2mostimportant.Howeveryoudonotneedtoactontheseparametersdirectly.Thecommunicationlibrarydefines10so-calledLoRamodes(from1to10)thatarevariouscombinationsofBWandSF.ForinstanceLoRamode1definesBW=125kHz,CR=4/5andSF=12.Thiscombinationprovidesthehighestsensitivityatthereceiverthereforeitissuitabletoachievethelongestrange.However,thetransmissiontimeisthehighest.Practicallyarealdeploymentcanusethismodeforalldeployeddevicestobesuretogetthelargercoverage.Fortheothermodes,therangeisgenerallydecreasedbuttransmissiontimeisreduced.Figure40showsthevariousLoRamodeascombinationofBWandSF.
ProjectNº687607 WAZIUPD2.1
Page49
Figure40–LoRamodeascombinationofBWandSF
5.3.5. Minimumfunctionsettobuildalong-rangeend-device
Hereisanexampleofaminimalsettingforanend-devicetoactuallysendpacketstoagateway.
sx1272.setMode(1); sx1272.setChannel(CH_10_868); sx1272.setPower('M'); // or sx1272.setPowerDBM(14); sx1272.setNodeAddress(6); sx1272.setPacketType(PKT_TYPE_DATA); sx1272.sendPacketTimeout(1,"TC/18.56",8);
5.3.6. Packetformat
TheLoRaPHYlayerpacketformatisunchangedandmanagedbytheradiomodule.Then,thereisa4-byteheaderbeforetherealuserdata.Theheaderisorganizedasfollows:
[DST(1B),PTYPE(4bits),FLAGS(4bits),SRC(1B),SN(1B)][DATA(nB)]
DSTisthedestinationaddress.Withthegateway-centrictopology,thegatewayusuallyhasaddress1soDSTwillmostlikelybe1.SRCisthesourceaddresson1-byte[2..255].SNisthepacketsequencenumber.PTYPEhascurrently2values:0001forDATApacketand0010foranACKpacket.FLAGSisa4-bitarraythatdefinesthefollowingoptions:
• 1000:ackrequested
• 0100:dataisencrypted
• 0010:datahasapplicationkey
• 0001:reserved
This4-byteheaderismanagedbyourcommunicationlibraryandonlythenbytesof[DATA]willbeprovidedtotheprogrammer.Iftheprogrammerwantstoimplementapplicationkeytoperformfurtherfiltering,hecansettheapplicationkeyflagandinsertin[DATA]asequenceofbytesthatcanbefurthercheckedatthepost-processingstage.Ingeneral,onecanimplementitsownpacketformat,variantsornewfunctionalities(suchasAES
Ran
ge
Throughput
LoRa%mode BW CR SF 5%bytes 55%bytes
105%bytes
155%Bytes
205%Bytes
255%Bytes
max%thr.%for%255B%in%bps
1 125 %4/5 12 0.95846 2.59686 4.23526 5.87366 7.51206 9.15046 2232 250 %4/5 12 0.47923 1.21651 1.87187 2.52723 3.26451 3.91987 5203 125 %4/5 10 0.28058 0.69018 1.09978 1.50938 1.91898 2.32858 8764 500 %4/5 12 0.23962 0.60826 0.93594 1.26362 1.63226 1.95994 10415 250 %4/5 10 0.14029 0.34509 0.54989 0.75469 0.95949 1.16429 17526 500 %4/5 11 0.11981 0.30413 0.50893 0.69325 0.87757 1.06189 19217 250 %4/5 9 0.07014 0.18278 0.29542 0.40806 0.5207 0.63334 32218 500 %4/5 9 0.03507 0.09139 0.14771 0.20403 0.26035 0.31667 64429 500 %4/5 8 0.01754 0.05082 0.08154 0.11482 0.14554 0.17882 1140810 500 %4/5 7 0.00877 0.02797 0.04589 0.06381 0.08301 0.10093 20212
time%on%air%in%second%for%payload%size%of
ProjectNº687607 WAZIUPD2.1
Page50
encryption)bydefiningaspecificformatin[DATA]andmaketheappropriatedecodingatthepost-processingstage.
5.4. Buildingalow-costIoTdevice
Asindicatedpreviously,theavailabilityoflow-cost,open-sourcehardwareplatformssuchasArduino-likeboardsisclearlyanopportunityforbuildinglow-costIoTdevicesfromconsumermarketcomponents.Ourlong-rangecommunicationlibrarythereforetargetssuchArduino-likeboards:originalArduinoboards(Uno,MEGA,Due,Micro,ProMini,Nano,M0)butalsomanyotherArduino-compatibleboardsfromSparkfun,Teensy,AdafruitFeather,RFduino,IdeetronNexus,Sodaq,...iftheyhavecompatibilitywiththeArduinoIDE.Onemainissueforaneasyeligibleboardbeingtheavailabilityofabuilt-in3.3vpintopowertheradiotoavoidanextravoltageregulator.Figure41showsourlong-rangecommunicationlibrarylong-rangelibrarysupportingvariousArduinoboardsandLoRaradiomodules.Alloftheseboardsandradiomoduleshavebeensuccessfullytestedandwearecontinuouslytestingnewboardsandradiomodules.
Figure41–Thelong-rangelibraryforArduino-compatibleboardsandLoRaradiomodules
Additionally,someradioshieldsfromthemarketareactuallybasedontheradiomodulessupportedbyWAZIUP.ThisisthecaseforthequiteinterestingDraginoproductlinewhichisbasedontheHopeRFRFM95W:LoRaBee,LoRa/GPSshield,LoRaShieldandDraginoLoRaGPSHatshield.Figure42below,withimagestakenfromDragino,showsfromlefttorighttheaforementionedproducts.
Long-Range communication library
Libelium LoRa HopeRF RFM92W/95W
Modtronix inAir9/9B
LoRa radios that our library already supports NiceRF
LoRa1276
Ideetron Nexus TeensyLC/3.1/3.2
Adafruit Feather 32u4/M0
ProjectNº687607 WAZIUPD2.1
Page51
Figure42–DraginoLoRaproductlinebasedonHopeRFRFM95W
InthecontextofWAZIUP,weusetheArduinoProMiniinits3.3vand8MHzversionforsimple,small-memoryapplicationssuchastelemetryapplications.SuchArduinoProMinicanbepurchasedforabout1.5€apiecefromChinesemanufacturers.WethenusetheTeensy31/3.2/LCformorepower/memorydemandingapplications.
5.4.1. Softwareintegrationforlong-rangeIoTdevice
Attheend-device,themainsoftwarecomponentsarethelong-rangecommunicationlibraryandthepredefinedbuildingblocksforrealizinggenerictaskssuchasduty-cycledbehaviour,physicalsensormanagement,low-powermanagementandencryption.Figure43showsthesoftwarebuildingblocksforeasyintegrationoflong-rangeIoTdevices.
Figure43–Softwarebuildingblocksforeasyintegrationoflong-rangeIoTdevices
Low-powerisanimportantfeatureforWAZIUPandIoTingeneral.Oneadvantageofusingmass-marketcomponentsisalsotheavailabilityofalargevarietyofsoftwarelibraries.ForthegenericsensordevicebasedontheArduinoProMiniortheTeensy,weusespecificlow-powerlibrariesthatarecapableofconsiderablyreducingthepowerconsumptionofthedevicebyprovidingdeepsleeporhibernatemodes.ThesecuritybuildingblockisalsoanimportantfeaturethatWAZIUPprovides:AES128-bitencryptionmodeissupportedtoprovidebothsecurityandcompatibilitywithLoRaWANifnecessary.
Physical sensor reading
Physical sensor reading
Physical sensor reading
Physical sensor
management
Long-range transmission
Activity duty-cycle, low
power
Logical sensor management Security
ProjectNº687607 WAZIUPD2.1
Page52
5.4.2. Softwaretemplatesforquickandeasyappropriation
Wehavedevelopedanumberofexamplestodemonstratehowsimple,yeteffective,low-costLoRaIoTdevicecanbeprogrammed.Forinstance,theyshowhowLoRaradiomodulesareconfiguredandhowadevicecansendsenseddatatoagateway.Theyactuallyserveastemplateforfuturedevelopments.
Arduino_LoRa_Ping_Pongshowsasimpleping-pongcommunicationbetweenaLoRadeviceandagatewaybyrequestinganacknowlegmentfordatamessagessenttothegateway.
Arduino_LoRa_Simple_tempillustrateshowasimpleLoRadevicewithtemperaturedatacanbeflashedtoanArduinoboard.TheexampleillustratesinasimplemannerhowtoimplementmostofthefeaturesofarealIoTdevice:periodicsensing,transmissiontogateway,duty-cycleandlow-powermodetorunonbatteryformonths.
Arduino_LoRa_tempillustratesamorecomplexexamplebyaddingacustomCarrierSensemechanismthatyoucaneasilymodify,AESencryptionandthepossibilitytosendLoRaWANpacket.ItcanserveasatemplateforamorecomplexLoRaIoTdevice.
Arduino_LoRa_Generic_Sensorisaverygenericsensortemplatewherealargevarietyofnewphysicalsensorscanbeadded.AllphysicalsensorsmustbederivedfromabaseSensorclass(definedinSensor.cppandSensor.h)andshouldprovideaget_value()andget_nomenclature()function.Alltheperiodictaskloopwithduty-cyclelow-powermanagementisalreadythereasinpreviousexamples:theduty-cyclebuildingblockcanbeconfiguredtotriggersensorreadingeveryMminutes.Allsensorsconnectedtotheboardwillbepolledandthereturnedvaluesconcatenatedintoamessagestringfortransmission.Somepredefinedphysicalsensorsarealsoalreadydefined:
- verysimpleLM35DZanalogtemperaturesensor- digitalDHT22temperatureandhumiditysensor- digitalDS18B20temperaturesensor- ultra-sonicHC-SR04distancesensor- DaviesLeafWetnesssensor- generalrawanalogsensor
Arduino_LoRa_InteractiveDeviceisatoolthatturnsanArduinoboardtoaninteractivedevicewhereausercaninteractivelyenterdatatobesenttothegateway.AESencryptionandthepossibilitytosendLoRaWANpacketisincluded.Therearealsomanyparametersthatcandynamicallybeconfigured.Thisexamplecanservefortestanddebugpurposesaswell.
5.4.3. Programmingtheboard
Programminganddeployingthelow-costend-deviceismadeverysimplethankstotheusageofArduinoboardsandArduinoIDE.ThesestepsaredescribedindetailsinthevarioustutorialsthatweredevelopedforWAZIUP.Weshowheresomefigurestoillustratethesimplicitythatwewanttoprovidetoend-usersorthird-parties.
ProjectNº687607 WAZIUPD2.1
Page53
Ge#ngtheso+ware
Fisrt, you will need the Arduino IDE 1.6.6 or later (left). Then get the LoRa library from our github: https://github.com/CongducPham/LowCostLoRaGw (right). Get into the Arduino folder and get both Arduino_LoRa_temp and SX1272 folder. Copy Arduino_LoRa_temp into your “sketch” folder and SX1272 into “sketch/libraries”
Compiling
Open the Arduino_LoRa_temp sketch and select the Arduino Pro Mini board with its 3.3V & 8MHz version. Then, click on the « verify » button
ProjectNº687607 WAZIUPD2.1
Page54
Uploading(1)
For the Pro Mini, you need to have an FTDI breakout cable working at 3.3v level (there is also 5v version but our advised Pro Mini version is running at 3.3v to reduce energy consumption). Be careful, on some low-cost Pro Mini version (Chinese manufacturer for instance) the pins may be in reversed order. The simplest way in to check the VCC pin and make it to correspond to the VCC pin of the FTDI breakout.
VCC
Original Sparkfun version
Some clone version, check the VCC pin
Uploading(2)
Connect the USB end to your computer and the USB port should be detected in the Arduino IDE. Select the serial port for your device. It may have another name than what is shown in the example. Then click on the « upload » button
ProjectNº687607 WAZIUPD2.1
Page55
OnceprogrammedwithforinstancetheArduino_LoRa_Simple_temptemplate,theend-deviceisfullyoperationalandstarttheperiodicsensingandtransmission.InFigure44,thetemperatureis18.5°C.Thenextsectionwilldescribethelow-costgatewaypart.
Figure44–Simpletemperaturesensorwithperiodicsensingandtransmission
5.4.4. Customizationoftemplates
Thetemplatescaneasilybecustomizedbychangingsomedefinestatementsandvariablesthatareclearlyidentifiedinthetemplatecode.Wesummarizebelowthemainpartsthatcanbecustomizedforadaptationtousecases.
/////////////////////////////////////////////////////////////////// // please uncomment only 1 choice // #define ETSI_EUROPE_REGULATION //#define FCC_US_REGULATION //#define SENEGAL_REGULATION ///////////////////////////////////////////////////////////////////
Serialmonitor
You can see the output from the sensor if it is connected to your computer. Use the Arduino IDE « serial monitor » to get such output, just to verify that the sensor is running fine, or to debug new code. Be sure to use 38400 baud.
\!##TC/18.5
ProjectNº687607 WAZIUPD2.1
Page56
/////////////////////////////////////////////////////////////////// // please uncomment only 1 choice #define BAND868 //#define BAND900 //#define BAND433 /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// // // uncomment if your radio is an HopeRF RFM92W, HopeRF RFM95W, Modtronix inAir9B, NiceRF1276 // or you known from the circuit diagram that output use the PABOOST line instead of the RFO //#define PABOOST /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// // COMMENT OR UNCOMMENT TO CHANGE FEATURES. // ONLY IF YOU KNOW WHAT YOU ARE DOING!!! OTHERWISE LEAVE AS IT IS #if not defined _VARIANT_ARDUINO_DUE_X_ && not defined __SAMD21G18A__ #define WITH_EEPROM #endif #define WITH_APPKEY #define FLOAT_TEMP //#define NEW_DATA_FIELD #define LOW_POWER #define LOW_POWER_HIBERNATE //#define WITH_ACK /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// // CHANGE HERE THE LORA MODE, NODE ADDRESS #define LORAMODE 1 #define node_addr 10 ////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// // CHANGE HERE THE TIME IN MINUTES BETWEEN 2 READING & TRANSMISSION unsigned int idlePeriodInMin = 10; ///////////////////////////////////////////////////////////////////
5.4.5. IoTdevicepowerconsumptiontests
WedidsomepowerconsumptionmeasuresusingtheArduino_LoRa_Simple_temptemplateandtheModtronixinAi9radiomodulewherethetransmissionpowerissetto14dBm.Figure45showsourenergyconsumptiontestsforanArduinoProMini.
Figure45–powerconsumptionandlow-powertests
Thanks to T. Mesplou and P. Plouraboué for their help
Low-Power library from RocketScream
Wakes-up every 10min, take a measure (temp) and send to GW 120µA in deep sleep mode, 93mA when active and sending
Can run for 100 days with 1 measure/10min Can run for 1 year with 1 measure/1h 2500mAh
ProjectNº687607 WAZIUPD2.1
Page57
Usingtheverylow-costProMini,energyconsumptionindeepsleepmodecanbeaslowas
120uAwithverysmallandeasymodificationtotheboard(mainlyremovingthepowerled).Whentransmitting,thepowerconsumptionjumpsto93mA.WedidthesametestsfortheTeensyboardsandwiththeTeensyLCthepreliminarytestshowsanenergyconsumptionof
about90uAinhibernatemodeforaboardthatismuchmorepowerfulthantheProMini.
Table1belowsummarizesthepreliminarypowerconsumptionteststhatwedidwiththeArduinoProMini,theTeensyLCandtheTeensy31.AllthetestsusetheArduino_LoRa_Simple_temptemplateandtheModtronixinAir9radiomodule.Theactivestateismeasuredwhentheboardisnottransmitting.
Testsetting Powerconsumption
ProMini3.3v8MHz Active 20mADeepSleep 120uA
TeensyLC Activeat24MHz 12mAActiveat48MHz 15mAHibernate 80uA-90uA
Teensy3.1 Activeat24MHz 20mAActiveat48MHz 30mAActiveat72MHz 34mAHibernate 115uA-120uA
Table1–SummaryofenergyconsumptionforProMiniandTeensyboards
Wewilldescribeinmoredetailstheenergyrequirementsofthewholesysteminsection5.6.
5.4.6. IoTdeviceintegrationforoutdoorusage
Withalltheprovidedbuildingblocks,realizingIoTdeviceintegrationforoutdoorusagecanbedoneeasily.Figure46showsaChineseProMinipoweredwith4AAbatteriesandfittedintoawater-proofcase.WeprovideaspecifictutorialforbuildingsuchIoTdevices.
Arduino Pro Mini
3.3v and 8MHz version
VC
C
MO
SI
MIS
O
CLK
CS
GN
D
ProjectNº687607 WAZIUPD2.1
Page58
Figure46–Low-costhardwareintegration
Moreinformationaredetailedin:
[Doc]Low-costLoRaIoTplatformpartlistLatestversioncanbedownloadedfrom:https://github.com/CongducPham/tutorials/blob/master/low-cost-iot-hardware-parts.pdf
[Slides]"Low-costLoRaIoTdevice:astep-by-steptutorial"Latestversioncanbedownloadedfrom:https://github.com/CongducPham/tutorials/blob/master/Low-cost-LoRa-IoT-step-by-step.pdf
[Slides]"BuildingIoTdeviceforoutdoorusage:astep-by-steptutorial"Latestversioncanbedownloadedfrom:https://github.com/CongducPham/tutorials/blob/master/Low-cost-LoRa-IoT-outdoor-step-by-step.pdf
[Slides]"Low-costLoRaIoTdevice:supportedphysicalsensors"Latestversioncanbedownloadedfrom:https://github.com/CongducPham/tutorials/blob/master/Low-cost-LoRa-IoT-supported-sensors.pdf
[Video]Buildyourlow-cost,long-rangeIoTdevicewithWAZIUPhttps://www.youtube.com/watch?v=YsKbJeeav_M
5.5. Buildingalow-costgateway
5.5.1. Gatewayhardwareandarchitecture
OurLoRalow-costgatewaycanbequalifiedas"singleconnection"asitisbuiltaroundanSX1272/76,muchlikeanend-devicewouldbe.Thelow-costgatewayisbasedonaRaspberryPI(1A+/1B/1B+/2B/3B)whichisbothalow-costandareliableembeddedLinuxplatform.ToinstalltheRaspberry,ourpre-installedSDcardimagecanbedownloaded(onhttp://cpham.perso.univ-pau.fr/LORA/WAZIUP/raspberrypi-jessie-WAZIUP-demo.dmg.zip).CompleteinstructionstoinstallfromscratchwiththeRaspbianOSisalsoprovided.Whenallthesoftwarecomponentsareinstalled,aradiomodulecanbeconnected.Figure47showsthevariousstepsforbuildingourlow-costLoRagateway.
Thegatewaysoftwarearchitecturehasbeendesignedformaximumflexibilityandeasythird-partyappropriationandcustomization.Inourgatewayarchitectureweclearlywanttodecouplethespecificlowerlevelradiobridgeprogramfromthehigher-leveldatapost-processingstagethatmustbeeasilycustomizedbythirdparties.Thedatapost-processing
ProjectNº687607 WAZIUPD2.1
Page59
block(orangeblockinFigure48)iswritteninhigh-levellanguage(e.g.Python)forsimplicityandmaximumcustomizationpossibilitiesbythird-parties.
Figure47–Low-costsinglechannelLoRagateway
AscanbeseenintherightpartofFigure48,theWAZIUPprojectwillprovidemostofthegatewaysoftwarelogic,withthetoplayerbeinghighlycustomizableforspecificapplication'sneeds.
Figure48–Gatewayarchitecture
Ascanbeseen,thepost-processingblockisthecoreofallincomingpacketdataprocessingtasks.WeprovideaPythontemplateforthepost-processingblock(post_processing_gw.py)andFigure49showsadetailedviewoftheproposedpost-processingtemplatecomponentsandfeatures.Themaincomponentisthe«incomingdataparsingblock»thatcalls
user/app-specificcloudscripts.Ourpost-processingtemplatealsoprovidesadditionalfeaturessuchasgatewaytemperaturemonitoring(withaDHT22sensorconnectedtothe
We can use all model of Raspberry. The most important usefull feature is the Ethernet interface for easy Internet connection. Then WiFi and Bluetooth can be added with USB dongles. RPI3 provides built-in Ethernet, WiFi and Bluetooth!
Less than 50€
Raspbian
Long-range radio lib
lora_gateway program
radio bridge
program
stdout
stdin
postprocessing
Kept as simple as possible
high
-leve
l lan
g.e.
g. p
ytho
n
Most of user or application specific logics is done here! We provide some basic features, up to you to enhance them
stdout
post-processing
user/app-specific
ProjectNº687607 WAZIUPD2.1
Page60
gateway),AESencryptionanddecryption,managementdownlinkdatarequest,managementofdatafromotherradiointerfacesandsimpleLoRaWANinteroperability.These2lastfeatureswillbedescribedinmoredetailsinSection6andSection7respectively.
Figure49–post-processingblocktemplate
5.5.2. Lowerlevelradiobridgeandpost-processingblockinteraction
AsshowninFigure49,thelowerlevelradiobridgewriteformattedreceiveddatatostdoutandthepost-processingblockwillreadfromstdin.
ForeachincomingLoRapacket,thelowerlevelradiobridgewillwritethe5followingformattedstrings:
1. ^p.Indicatesapacketinfostringformattedasfollows:^pdst(%d),ptype(%d),src(%d),seq(%d),len(%d),SNR(%d),RSSI(%d)e.g.^p1,16,3,0,10,8,-45
2. ^r.Indicatesaradioinfostringformattedasfollows:^rbw(%d),cr(%d),sf(%d)e.g.^r125,5,12
3. ^t.Indicateatimestampinfostringformattedasfollows:^ttime(%s)e.g.^t2016-12-25T01:15:11.264700
4. \xFF\xFE.2-bytesprefixtoindicateincomingpacketpayload
5. receivedpacketpayload
radio bridge
program
stdout
stdin
postprocessing
post-processing
Incoming dataparsing block
Handledownlinkdata
cloud_script_1
user/app-specific
Monitorgateway
temperature
LoRaWANinteroperability
Handle datafrom other
radiointerfaces
stdout
cloud_script_2 cloud_script_n
AESencryptiondecryption
ProjectNº687607 WAZIUPD2.1
Page61
Forinstanceif“hello”fromsensor6isreceivedatthelowerlevelradiobridge,thefollowingstringswillbewrittentostdout,assumingLoRamode1(seeFigure40foralistofLoRamodes):
^p1,16,6,0,5,8,-45 ^r125,5,12 ^2016-12-25T01:51:11.058 \xFF\xFEhello
Thepost-processingblockwillreadthesestringstogetpacketinfo,radioinfo,timestampinfoandfinallypacketpayloadcontenttotakefurtheractionsuchasparsingthepayloadcontentandeventuallyuploadpayloadcontenttoIoTclouds.Thecurrentpost-processingtemplatewouldshowthefollowingoutputwhenreceivingthepreviousstrings:
2016-12-25T00:51:11.059762 rcv ctrl pkt info (^p): 1,16,6,0,5,8,-45 splitted in: [1, 16, 6, 0, 5, 8, -45] (dst=1 type=0x10(DATA) src=6 seq=0 len=5 SNR=8 RSSI=-45) rcv ctrl radio info (^r): 125,5,12 splitted in: [125, 5, 12] (BW=500 CR=5 SF=12) rcv timestamp (^t): 2016-12-25T01:51:11.058 got first framing byte --> got data prefix hello
5.5.3. Whatcloudsforlow-costIoT?
IfthegatewayisconnectedtotheInternetasshowninFigure50,datareceivedonthegatewayareusuallypushed/uploadedtosomeInternet/cloudserverssuchastheWAZIUPCloudPlatform(seeWAZIUPD3.1).Thesetasksarehandledbythepost-processingstageaspreviouslyillustratedinFigure49.
Figure50–Post-processingstagewithInternetconnectivity.
radio bridge
program
stdout
stdin
post processing
Kept as simple as possible
high
-leve
l lan
g.
e.g.
pyt
hon
Most of user or application specific logics is done here! We provide some basic features, up to you to enhance them
stdout
ProjectNº687607 WAZIUPD2.1
Page62
Additionally,itisimportantinthecontextofdevelopingcountriestobeabletouseawiderangeofinfrastructuresand,ifpossible,atthelowestcost.Fortunately,alongwiththeglobalIoTuptake,thereisalsoatremendousavailabilityofsophisticatedandpublicIoTcloudsplatformsandtools,offeringanunprecedentedlevelofdiversitywhichcontributestolimitdependencytoproprietaryinfrastructures.Manyoftheseplatformsofferfreeaccountswithlimitedfeaturesbutthatcanalreadysatisfytheneedsofmostagriculture/microandsmallfarm/villagebusinessmodels.Itisthereforedesirabletohighlydecouplethelow-levelstagegatewayfunctionalitiesfromthehigh-levelstagewithdatapost-processingfeatures,privileginghigh-levellanguagesforthelatterstage(e.g.Python)sothatcustomizingdatamanagementtaskscanbedoneinminutes,usingstandardtools,simpleRESTAPIinterfacesandavailablepubliccloudsasdepictedinFigure51withpubliclyavailableIoTcloudssuchasFireBase,ThingSpeakorGroveStreams.
Figure51–FromgatewaytoIoTclouds
5.5.4. Uploadingtoclouds
ToindicatethatapayloadcontentshouldbeuploadedtoIoTclouds,thecurrentpost-processingblockusesthe«\!»prefix.ForeachIoTcloudthatisenabledatthegateway,acloudscriptshouldbeprovided.Thecloudscriptwilltypicallydissectthepayloadtoextractrelevantinformationandwilluploadtherelevantinformationtothecorrespondingcloudplatformusingadequatecommands.
Thepost-processingblockwillparseaclouds.jsonfilethatcontainsalistofcloudsdefinitionsfordatatobeuploaded.Hereisanexamplewith3clouds:localMongoDB,ThingSpeakandGrovestreams.
ProjectNº687607 WAZIUPD2.1
Page63
{ "clouds" : [ { "notice":"do not remove" "name":"Local gateway MongoDB", "script":"python CloudMongoDB.py", "type":"database", "max_months_to_store":2, "enabled":false }, { "name":"ThingSpeak cloud", "script":"python CloudThingSpeak.py", "type":"iotcloud", "write_key":"", "enabled":true }, { "name":"GroveStreams cloud", "script":"python CloudGroveStreams.py", "type":"iotcloud", "write_key":"", "enabled":true } }
Foreachclouddeclaration,thereareonly2relevantfields:"script"and"enabled"."script"isusedtoprovidethenameofascript.Thelauncherthatwillbeusedmustalsobeindicated.Actually,"script"ismoreacommandlinethanafilename.Inthisway,severalscriptlanguagescanbeused(includingshellscriptsandbinaryexecutablesprovidedthattheyreadparametersthatarepassedbytheircommandline).Forinstance,ifthescriptisapythonscript,"script"shouldcontain"pythonmy_script_filename".
"enabled",whensettotrue,indicatesthatthiscloudisactivesothatthepost-processingblockwillcalltheassociatedscripttoperformuploadofthereceiveddata.Alltheotherfieldsarenotrelevantforthepost-processingblockbutcanbeusedbytheassociatedscripttogetadditionalinformationthattheusermaywanttoprovidethroughtheclouds.jsonfile.
Afterparsingclouds.json,thepost-processingblockhasthelistofenabledcloudsasshowninthefollowingoutputfromthepost-processingblock:
Parsing cloud declarations [u'python CloudThingSpeak.py'] [u'python CloudThingSpeak.py', u'python CloudGroveStreams.py'] Parsed all cloud declarations post_processing_gw.py got cloud list: [u'python CloudThingSpeak.py', u'python CloudGroveStreams.py']
Then,assumingthat_enabled_cloudscontains:
['python CloudThingSpeak.py', 'python CloudGroveStreams.py']
themaindatauploadprocessingloopinthepost-processingblockisnowverysimpleandlooksasfollows:
ProjectNº687607 WAZIUPD2.1
Page64
#ldata will contain the payload ldata = getAllLine()
print "number of enabled clouds is %d" % len(_enabled_clouds) #loop over all enabled clouds to upload data #it is up to the corresponding cloud script to handle the data format # for cloud_index in range(0,len(_enabled_clouds)): print "--> cloud[%d]" % cloud_index cloud_script=_enabled_clouds[cloud_index] print "uploading with "+cloud_script cmd_arg=cloud_script+" \""+ldata+"\""+" \""+pdata+"\""+
" \""+rdata+"\""+" \""+tdata+"\""+" \""+_gwid+"\"" os.system(cmd_arg) print "--> cloud end"
Forinstance,weprovidetheCloudThingSpeak.pytemplatescriptthatacceptsthefollowingformattedcontent:«write_key#field_index#TC/18.5».Ifwrite_keyandfield_indexarenotspecified,thenthedefaultwritekeyandfieldindexwillbeused.Therefore,anIoTdevicesending«\!##TC/18.5»asillustratedpreviouslyinFigure44willtriggeratthegatewaytheexecutionoftheCloudThingSpeak.pyscriptthatwillupload«18.5»tothedefaultThingSpeakchannelatthedefaultfieldindex.Withthepreviousexample,theexecutionofthemaindatauploadprocessingloopwilllookasfollows,withtextinredprintedbythecloudscriptwhiletextinblackarethoseprintedbythemainprocessingloop:
number of enabled clouds is 2 --> cloud[0] uploading with python CloudThingSpeak.py ThingSpeak: uploading rcv msg to log (\!) on ThingSpeak ( default , 4 ): 18.5 ThingSpeak: will issue curl cmd curl -s -k -X POST --data field4=18.5 https://api.thingspeak.com/[…] ThingSpeak: returned code from server is 156 --> cloud[1] uploading with python CloudGroveStreams.py GroveStreams: uploading Grovestreams: Uploading feed to: /api/feed?compId=node_6&TC=18.5 --> cloud end
Moreinformationaredetailedin:
[Doc]Low-costLoRaIoTplatformpartlistLatestversioncanbedownloadedfrom:https://github.com/CongducPham/tutorials/blob/master/low-cost-iot-hardware-parts.pdf
[Slides]"Low-costLoRagateway:astep-by-steptutorial"Latestversioncanbedownloadedfrom:https://github.com/CongducPham/tutorials/blob/master/Low-cost-LoRa-GW-step-by-step.pdf
[Slides]"Low-costLoRaIoTantennatutorialforgateway"Latestversioncanbedownloadedfrom:https://github.com/CongducPham/tutorials/blob/master/Low-cost-LoRa-IoT-antennaCable.pdf
[Slides]"Low-costLoRaIoT:usingtheWAZIUPdemokit"Latestversioncanbedownloadedfrom:https://github.com/CongducPham/tutorials/blob/master/Low-cost-LoRa-IoT-using-demo-kit.pdf
[Video]Buildyourlow-costLoRagatewaywithWAZIUPhttps://www.youtube.com/watch?v=peHkDhiH3lE
ProjectNº687607 WAZIUPD2.1
Page65
5.6. Energyrequirementsofthewholesystem
5.6.1. Measuredenergyconsumption
AsshownpreviouslyinFigure45,theenergyconsumptionofanArduinoProMiniinits3.3vand8MHzversionisabout120uAindeepsleepmode.Withascenarioofperiodicsensingandtransmissiononceeveryhour,thesensorcanbeactiveforsensingandtransmissionbetween2.5sand6sdependingonthenumberofconnectedsensors.ThetransmissionofthesenseddatausingtheLoRamodethatprovidesthelongestrange(i.e.,mode1)takesabout1.5s,leavingabout1sto4.5sforpollingandreadingthephysicalsensor.Inthepolling/readingstate,theconsumptionisabout20mA.Duringtransmission,theconsumptionisabout93mA.Thereforethemeanconsumption/hourcanbeestimatedas:
E2.5=[0.120x3597.5+93x1.5+20x1]/3600=0.164mA
E6=[0.120x3594+93x1.5+20x4.5]/3600=0.183mA
Inbothscenarios,usingtraditional2500mAhbatteries,theexpectedlifetimecantheoreticallybelongerthanayear.Wehaveasimpletemperaturesensorrunningon4AAbatteriessinceApril6th,2016forrealtestsonautonomy.RealtimedataarepushedtoaThingSpeakchannel:https://thingspeak.com/channels/66583,seedatafor‘Sensor6’.
Figure52–Raspberrypowerconsumption(left),10000mAhUSBchargingpack(right)
AtthegatewaysiderunningonaRaspberryPI,wemeasuredtheconsumptiontobebetween100mAand330mAdependingontheRaspberryversion:fromversion1A+toversion3.OurRPI3-basedgatewaywithInternetviaEthernetandbothWiFiandBluetoothinterfacesenabledconsumesabout320mAincontinuousreceptionmode.ThisconsumptionlevelroughlycorrespondstotheidlecaseshowninFigure52left(takenfromhttps://www.raspberrypi.org/magpi/raspberry-pi-3-specs-benchmarks/)astheradiomodule’sconsumptionisverysmall.The‘load’powerconsumptionvaluesshowninFigure52correspondtoheavyCPUcomputationbenchmarks.
Theusualsettingforsuchagatewayistorunwithtraditionalwall-plugpowersupply.TherearehoweversomebiggerbatterypackssuchasthoseusedforsmartphonerechargingthatcanbeusedtopowertheRaspberrygatewayformorethan10hours.
ProjectNº687607 WAZIUPD2.1
Page66
5.6.2. Investigatingusageofsolarpanels
Nowadays,itisquiteeasytopowersmallelectronicdevicesfromrechargeablebatteriesplussolarpanels.Therearesomemass-marketintegratedproductssuchasthosededicatedforon-the-gosmartphonerecharging.OnesampleisillustratedinFigure53.
Figure53–Mass-marketintegratedUSBsolarchargingpack
Forinstance,ifaRaspberryA+isusedforthegateway,a10000mAhbatterycanpowerthegatewayforseveralhours.IfthebatterypackcanberechargedfromtheSunatthesametimethentheideaofafullyautonomousgatewaycanbereality.Suchgatewaycanbeusedinastandalonemannerasitwillbedescribedlateron.
Moreelaboratedanddedicatedchargingcircuitcanalsobefoundeasilytohandlesolarpanelandrechargeablebatteries(e.g.LiPo).Therearealsoexperimentsaddressingdeploymentofsolar-poweredLoRagateways(suchastheonereportedathttp://embeddedexperience.blogspot.fr/2015/05/first-lora-network-now-open.html)andtheseissueswillbefurtherinvestigated.
5.6.3. Internetconnectivitywith2G/3Gshield/dongle
CellularInternetconnectivitycanbeprovidedtotheRaspberrygatewayusingeithershieldsordongles.Figure54showsa3GshieldandaUSB3GdonglethatcanbeconnectedtotheRaspberrygateway.
Figure54–3Gshield(left)and3Gdongle(right)
TheenergyconsumptionofthesedevicesisquitehighandfurthertestswillbeinvestigatedinWAZIUP.
ProjectNº687607 WAZIUPD2.1
Page67
5.7. RunningwithoutInternetconnectivity
OurgatewaycanalsohandlecaseswhereInternetconnectivityisnotavailableasdatacanbelocallystoredonthegatewayinaNoSQLMongoDBdatabaseasillustratedinFigure55.
Figure55–GatewaywithoutInternetaccess
Thegatewaycaneitherbeusedasanend-computerbyjustattachingakeyboardandadisplay,oritcanalsointeractwiththeend-users'computingdevice(smartphone,tablet).Figure56showsthegateway’sembeddedwebserverandaspecificAndroidsmartphoneapplicationdisplayingthecontentofthelocalMongoDBdatabase.
Figure56–Autonomousgatewayforno-Internetaccessdeploymentscenarios
radio bridge
program
stdout
stdin
postprocessing
Kept as simple as possible
high
-leve
l lan
g.e.
g. p
ytho
n
Most of user or application specific logics is done here! We provide some basic features, up to you to enhance them
stdout
ProjectNº687607 WAZIUPD2.1
Page68
WithRaspberry1or2,WiFiorBluetoothdonglesforRaspberrycanbefoundatreallylow-costbuttheRaspberryPI3alreadycomeswithembeddedWiFiandBluetoothandisthereforemoreinteresting.AsmartphonecanbeusedtodisplaycaptureddataandnotifyusersaboutimportanteventswithouttheneedofInternetaccessasthissituationcanclearlyhappeninveryisolatedareas.
Ifsuchagatewayisoperatedwithahigh-capacitybattery(seeFigure53)thatcanpowerthegatewayforabout10hours,onecanthenimaginefullyautonomouslong-rangesensingapplicationssuchasacattlerustlingapplicationusingbeacon-collardevicesasillustratedinFigure57.Thefigureshowsanautonomousgatewaypoweredwithahigh-capacitybatterypack/solarpanelthatisusedbyafarmertocollectbeaconsfromcollarsplacedoncowsoftheherd.Theembeddedwebpageprovidedbythegatewayisaccessedonthefarmer’ssmartphoneandalertscanbeindicatedifsomebeaconsarenotreceived.TheRSSIcanalsogivesomeindicationsonthedistanceofthecows(theRSSIissueswillbeinvestigatedinmoredetailedinthefuturefortheCattleRustlingUseCase).
Figure57–Fullyautonomouscattlerustlingapplication
5.8. Softwareandtutorialmaterialsavailableonthegithub
AllthesoftwareforbothIoTdevicesandgatewayaredistributedthroughagithubrepository:https://github.com/CongducPham/LowCostLoRaGwwithextensiveREAMEfilesforexplanations.ThegatewayparthasalreadybeenbeintegratedandstructuredintotheWAZIUPrepositoryastheIoTBridgecomponent:https://github.com/Waziup/Platform/tree/master/gateway/IoTBridge.TheIoTBridgecomponentintheWAZIUPplatformiscomposedofalow-levelpartandofahigh-levelpartwhichisthepost-processingstagedescribedpreviouslyinFigure49.
ProjectNº687607 WAZIUPD2.1
Page69
Figure58–githubrepositoryforIoTdevicesandgateway
5.9. WAZIUPdemokit
AspartofWP2,wealsopackagedaWAZIUPdemokitconsistinginalow-costgatewayandasimpletemperatureIoTdevice,seeFigure59andFigure60.Thegatewayispre-configuredtouploadreceiveddatatotheWAZIUPLoRaThingSpeakdemochannel:https://thingspeak.com/channels/123986.
Figure59–WAZIUPLoRademokit
Unpack the demo kit
Be carefull, the wire are fragile. The floating red wire are normal, don’t connect them now!
ProjectNº687607 WAZIUPD2.1
Page70
Figure60–demogateway(left)anddemoIoTdevice(right)
TheIoTend-devicerunstheArduino_LoRa_Simple_temptemplateandworks«out-of-the-box»withthepreconfiguredgatewayasillustratedinFigure61.ItalsoactsasaWiFiaccess-pointandcontentofthelocalMongoDBdatabasecanbeaccessedthroughtheembeddedwebserverasdepictedinFigure62.Thisbehaviorishighlyappreciatedindemosessions
especiallywhenusingparticipants’ownsmartphonestoconnecttothegateway.
Raspberry PI with LoRa radio module and WiFi Arduino Pro Mini with LoRa radio module & temperature sensor
q Once switched on the end-device will1. Initialize the radio2. Take a measure (temperature)3. Send the measure to gateway4. Go to sleep for 10 minutes and repeat from step 2
q After demonstration, just disconnect the VCC wires (red)
q No need to remove the batteries
Takes about 4s
The default configuration in the Arduino_LoRa_Simple_temp example is:
Send packets to the gateway (one or many if in range)Use LoRa mode 1Node short address is 8
\!#4#TC/24.81
24.81 is an example, real temperature will be readby temperature sensor
ProjectNº687607 WAZIUPD2.1
Page71
Figure61–Usingthedemokit
Figure62–Visualizingreal-timedatawiththeembeddedwebserver
Thedemokithasbeendistributedto3AfricanpartnersfordemoandtrainingpurposesduringtheWAZIUPmid-reviewmeetingthattookplaceinSeptember2016.
Data received at the gateway will be pushed to the WAZIUP demo ThingSpeak channel
https://thingspeak.com/channels/123986
ProjectNº687607 WAZIUPD2.1
Page72
Figure63–distributionoftheWAZIUPdemokit
Moreinformationaredetailedin:
[Slides]"Low-costLoRaIoT:usingtheWAZIUPdemokit"Latestversioncanbedownloadedfrom:https://github.com/CongducPham/tutorials/blob/master/Low-cost-LoRa-IoT-using-demo-kit.pdf
5.10. MinimumViableProductsbasedontheIoTplatform
ThegenericIoTdevicewillserveforso-calledMinimumViableProduct(MVP)implementationandprototyping.Dependingontheapplicationdomain,dedicatedphysicalsensorswillbeconnectedandthedevice’sbehavioradaptedfromthegenerictemplateasillustratedinFigure64.
Figure64–GenericsensorIoTdeviceplatform
WAZIUPproposes5MVPinthedomainofWater/Fishfarming,CattleRustling,Agriculture,LogisticandUrbanWasteManagementasillustratedinFigure65.
CTIC, Dakar, Senegal
iSpace, AccraGhana
WoeLab, Lomé, Togo
Arduino Pro Mini
3.3v and 8MHz version
VC
C
MO
SI
MIS
O
CLK
CS
GN
D
ProjectNº687607 WAZIUPD2.1
Page73
Figure65–MinimumViableProductsdefinedinWAZIUP
Figure66–Exampleofanactivebeaconcollarsystemforcattlerustlingapplications
MVP 1
Water Fish Farming
MVP 2
Cattle Rustling
MVP 3
AGRI
MVP 4
Logistic Transport
MVP 5 Urban Waste mgt
Waziup Advisory Board
Waziup Community
WAZIUP PROJECT WP1 WP2 WP3 WP4 WP5 WP6
Minimum Viable Product
Cre
dit:
P. C
ousi
n, E
GM
Use an Arduino Pro Mini 3.3v at 8MHz and a LoRa radio module
Then you need a water-proofbox , 2 small cable gland ,1 male connector (MC) and 1 female connector (FC)
4 AA batteries will power the board with an autonomy of several months
11
2
2
3
3
4
4
5
6
5
6
Put all the hardware parts in the box
See how VCC from the battery pack is connected to the female connector FC. Use intermediate Dupont connectors if needed.
GND from battery pack is connected to the board (see arrow)
1
1
Take a 1m wire (old USB wire for instance)
Solder at one end a female Dupont connector and at the other end the male connector MC
Use heat-shrink tubes (in yellow)
11
22
3
3
When connecting the male connector MC to the female connector FC , the board will be powered and will start sending periodic beacons
1
1
Connect to RAW pin of the Arduino Pro Mini
GND was already connected at previous step
Use a robust belt for the collar, fix the box on the belt. Activate the beacon collar by connecting MC to FC by passing the long wire around the cattle’s neck. Any attempt to remove or cut the collar will disconnect the beacon system.
The length of the wire may need to be ajusted
Afim
ilk c
ollar
cou
rtesy
of I
. And
onov
ic fro
m U
niver
sity
of S
trath
clyde
ProjectNº687607 WAZIUPD2.1
Page74
Forinstance,theCattleRustlingMVPthatproposesanactivebeaconsystemthatwasillustratedpreviouslyinFigure57,adaptstheArduino_LoRa_Simple_temptemplatetoimplementthebeaconsystem.Figure66showsthevariousstepsforbuildingthelong-rangecollarbeaconsystemfromthegenericIoTplatform.
5.11. OverviewoftheWAZIUPplatformarchitecture
Figure67illustratestheproposedIoTplatformarchitecture.ThefullLPWANarchitectureisrepresentedbythetopparttakenfromaSemtechillustrationwhereend-nodesaresendingdatatoconcentrator/gatewaysthatarecontrolledbynetworkserversthat,inturnwillprovidedatatoapplicationservers.
WAZIUPplatformcanimplementthefullLPWANarchitecturewithlow-costend-devices,low-costgateway,theWAZIUPFIWare-baseddatacloudandWAZIUPdataanalyticplatformtargetingamulti-usersscenario.ThisisrepresentedbyboxAinFigure67.
However,themainobjectiveofWAZIUPistoadaptthisarchitecturetodevelopingcountrieswhereitisdesirabletoprovidesimplerarchitectures,thattakeintoaccounttheissueofverysmalldeploymentscenarioforsingleuser(e.g.farmer)andtheissueofInternetconnectivity.Forverysimpledeploymentscenario,theNetworkServerstagecaneasilybereplacedbyapublic&freeIoTcloudaccountsuchasThingSpeakorGroveStreams,removingthedependencyonasinglenetworkserver.BoxBrepresentsthe«noInternet»scenariowherethelow-costgatewaywillbothstoredataanddirectlyinteractwiththeend-userwithWiFiandBluetoothdevices(e.g.smartphones,tablet,…).
Figure67–IoTplatformgeneralarchitecture
radio bridge
program
stdout
stdin
post processing
Figu
re fr
om S
emte
ch
Application, MVP
WAZIUP Sensor platform
WAZIUP gateway platform
WAZIUP platform
A
B
ProjectNº687607 WAZIUPD2.1
Page75
6. HETEROGENEOUSNETWORKING
WepresentinthisSectionhowheterogeneousnetworkingishandledintheWAZIUPIoTplatform.Firstofall,wewillnotaddressthecasewheresensornodescanhavedirectaccesstotheInternetwithaGPRS/3GorWiFiconnection,referredtoassensor<->Internetconnectivity.InthesecasestraditionalTCP/IPprotocolstackrunningonthesensornodewillhidethelowercommunicationlayers.However,aWiFisensorcanbeconnectedtothegateway’sWiFiandthereforecannothavedirectaccesstotheInternet.Inthiscase,theproposedframeworkthatwillbedescribedinthefollowingsubsectionscanbeusedalthoughatraditional«Wireless-to-WiredEthernet»routing/forwardingmethodisprobablybetter(seeforinstance«HowTo:WifitoEthernetBridge»athttps://www.raspberrypi.org/forums/viewtopic.php?t=132674).
So,byheterogeneitywemeansensor<->gatewayradiotechnologyheterogeneity.Gateway<->InternetheterogeneityisnotreallyanissueasthistypeofInternetconnectivityisusuallyprovidedthoughtadedicatednetworkinterfacewith,onceagain,traditionalTCP/IPprotocolstackthatcompletlyhidesthelowercommunicationlayers.
Thissensor<->gatewayheterogeneitywillbemanagedatthegatewaylevelwheredatacomingfromotherradiointerfacescanbeincorporatedintothepost-processingblockasbrieflyillustratedpreviouslyinFigure49.Wewillexplainourproposedapproachinthenextsections.
6.1. Heterogeneitywithlegacyshort-rangeradiotechnologies
Sensor<->gatewayheterogeneitythereforemainlycomesfromlegacyshort-rangeradiotechnologiessuchasIEEE802.15.4.Inthelastdecade,beforelong-rangeandlow-powerLPWANtechnologiesbecamereality,short-rangesensorsmostlybasedonIEEE802.15.4radioswerethe«defacto»standardforbuildingsensinginfrastructures.IEEE802.15.4isusedinvarioustechnologiesasthePHY/MAClayerasillustratedinFigure68.
Figure68–IEEE802.15.4asPHY/MAClayerinvariousshort-rangetechnologies
802.15.4(PHY & MAC)
CC2420 (TI)Xbee (Digi)
MRF24J40MA (Microchip)
ZigBit AT86RF230 (ATMEL)
OSI 3 & 4
OSI 2
OSI 1
duty-cycling
ProjectNº687607 WAZIUPD2.1
Page76
IEEE802.15.4radioscanbeaddedtoArduinoboards(e.g.withXBeemodules)buttherearealsoalargevarietyofexistingintegratedsensorswithCC2420radiosasshowninFigure69.
Figure69–VariousintegratedsensorswithembeddedIEEE802.15.5radios
Evenifthisheterogeneityissuehaslittleimportanceindevelopingcountriesbecausethenumberlegacyshort-rangeinfrastructuresislikelytobeverysmall,WAZIUPprovidessupportforheterogeneousnetworkingscenariosasshowninFigure70wherelegacyIEEE802.15.4sensorscanbere-usedtocomplementalong-rangeinfrastructure.ThecommunicationpatternmustbefromsensorstogatewaybecausetheWAZIUPIoTplatformdoesnotprovidecommunicationbetweenend-devicesalthoughthiscanbedone.
Figure70–Short-range(IEEE802.15.4)forlegacysensorsmixedwithlong-rangeLoRa
MICAz
iMote2
iMote2 with IMB400 multimedia board
TelosB
AdvanticSys CM5000 & CM3000TelosB-like mote
8MHz Atmega128L4kB SRAM, 128kB FlashCC2420 radio
8Mhz MSP430F161110K SRAM, 48K flash CC2420 radio
13-416MHz PXA271 XscaleWireless MMX DSP256kB SRAM, 32MB Flash, 32MB SDRAMCC2420 radio
LibeliumWaspMote
8MHz Atmega12818kB SRAM, 128kB Flash Xbee radio
Short-range radio
Long-range radio
ProjectNº687607 WAZIUPD2.1
Page77
6.2. Takingintoaccountdatafromotherradiointerfaces
OurapproachisillustratedinFigure71:foreachradiotechnologyX,aUSB-serialbridgeisusedasatransparentXgateway.Thenasoftwarecomponentblock,implementingspecificpacketformatdissector/interpretorfortechnologyX,willformatpacketinformationintoaJSONrecordthatwillbewrittenintoatextfile.ThetextfilecontainingJSONrecordsiscommontoallradiointerfaceblock.OurgatewaywillthenperiodicallyreadnewJSONrecordsfromthetextfileandinjectthepayloadintothemainincomingdataparsingblock,thususingallthecloudfacilitiesalreadydefinedforlong-rangeIoTdevices.
Figure71–Generalapproachforheterogeneousnetworking
ThesharedtextfilecontainslinesofJSONrecordsasshownbelow.Thereare2JSONrecords,eachrecordisforonedatapacket:
{"^p":"^p1,16,3,0,55,8,-45","^r":"^r802154,0C,3332", \ "^t":"^t2016-10-12T09:00:20.956902","data":"\\!TC/22.5"} {"^p":"^p1,16,6,0,128,9,-55","^r":"^r802154,0C,3332", \ "^t":"^t2016-10-12T09:01:22.453498","data":"\\!HU/85"}
EachJSONrecordmusthaveatleast3mandatoryfields:"^p","^t"and"data".Thefirst2fieldshavethesamemeaningthanpreviouslyexplained:packetinformationandtimestampinformation.Notethatan"^r"fieldcanbespecifiedtokeepthesameformalismthanwiththeLoRaradioasshownintheexample(e.g."^r":"^r802154,0C,3332")toprovideradiospecificinformation.Howevertheseinformationwillnotbeparsedbythepost-processingblockastheseradioinformationareoftenveryspecifictotheradiotechnology.Actually,itispossibletouseanotherfieldnameasthisfieldisonlyforkeepingtrackofwhatpackethasbeenreceivedonwhatinterface.
Bydefault,thepost-processingblockwillperiodicallysearchforthe«aux_radio/aux_radio_post.txt»filethatwillcontainthenewJSONrecords.
2016-11-08 23:13:31.476448 post aux_radio: checking for aux_radio/aux_radio_post.txt post aux_radio: no aux_radio messages post aux_radio: list of aux_radio messages None
radio bridge
program
stdout
stdin
postprocessing
post-processing
Incoming dataparsing block
Handledownlinkdata
cloud_script_1
user/app-specific
Monitorgateway
temperature
LoRaWANinteroperability
Handle datafrom other
radiointerfaces
stdout
cloud_script_2 cloud_script_n
AESencryptiondecryption
Monitor
Reads fromradio interface USB bridge and
writes JSON record to file
Reads fromradio interface USB bridge and
writes JSON record to file
Radio X
Radio Y
Software component X
Software component Y
aux_radio_post.txt
ProjectNº687607 WAZIUPD2.1
Page78
WhennewJSONrecordsarecreatedforincomingpacketsfromotherradiointerfaces,thepost-processingblockwillreadallrecordsfromtheaux_radio/aux_radio_post.txtfileintomemoryanddeletesthefile.
2016-11-08 23:35:32.808260 post aux_radio: checking for aux_radio/aux_radio_post.txt post aux_radio: reading aux_radio/aux_radio_post.txt {u'^p': u'^p1,16,3,0,55,8,-45', u'data': u'\\!TC/22.5', u'^r': u'^r802154,0C,3332', u'^t': u'^t2016-10-12T09:00:20.956902'} post aux_radio: list of aux_radio messages {"^p":"^p1,16,3,0,55,8,-45","^r":"^r802154,0C,3332","^t":"^t2016-10-12T09:00:20.956902","data":"\\!TC/22.5"}
Then,whenthegatewayisidlefromprocessingLoRapackets,itwillstartprocessingpendingdatapacketsfromtheotherradiointerfaces:
post aux_radio: process aux_radio message {"^p":"^p1,16,3,0,55,8,-45","^r":"^r802154,0C,3332","^t":"^t2016-10-12T09:00:20.956902","data":"\\!TC/22.5"} post aux_radio: inserting in input buffer ^p1,16,3,0,55,8,-45 ^t2016-10-12T09:00:20.956902 \!TC/22.5 2016-11-08T23:36:49.820980 rcv ctrl pkt info (^p): 1,16,3,0,55,8,-45 splitted in: [1, 16, 3, 0, 55, 8, -45] (dst=1 type=0x10(DATA) src=3 seq=0 len=55 SNR=8 RSSI=-45) rcv timestamp (^t): 2016-10-12T09:00:20.956902 number of enabled clouds is 1 --> cloud[0] uploading with python CloudThingSpeak.py ThingSpeak: uploading rcv msg to log (\!) on ThingSpeak ( default , 4 ): 22.5 ThingSpeak: will issue curl cmd curl -s -k -X POST --data field4=22.5 https://api.thingspeak.com/[…] ThingSpeak: returned code from server is 156 --> cloud end
Ascanbeseen,whenapendingdatapacketisprocessed,thepost-processingblockshowstheentireJSONrecord(textinred).Whentheoutputofthepost-processingblockisloggedintoafilethenonecantracewhatpackethasbeenreceivedonwhatradiointerfaceandwhenithasbeenprocessed.
6.2.1. UsecasewithIEEE802.15.4
InordertoreceiveIEEE802.15.4packets,weuseanUSB-serialbridgewhereanXBee802radiomodulecanbepluggedin,seeFigure72.WiththeUSB-serialbridge,anIEEE802.15.4packetthatisreceivedbytheradiomodulewillbewrittentoaserialport(e.g./dev/tty/USB0forinstance).OursoftwarecomponentfortheIEEE802.15.4USB-serialbridgeiswritteninPythonandperiodicallypollsfordataontheserialinterface.Incaseofanincomingpacket,itwillcreateaJSONrecordwiththerequiredfield(e.g."^p","^t"and"data")and,ifnecessary,optionalfieldssuchas"^r":"^r802154,0C,3332"toindicatethatthepacketcomesfroman«802154»radio,listeningonchannel0x0CwithPANID0x3332.
ProjectNº687607 WAZIUPD2.1
Page79
Figure72–XBeeserialgateway
EachsoftwarecomponentXforaradioXappendstheirJSONrecordsintotheaux_radio/aux_radio_post.txtfile.
6.2.2. Generalizationtoothertypeofinterfaces
Figure71showedthegeneralapproachbasedonradiobridgeanddedicatedsoftwarecomponentsblocks.Thereforeforagivenradiotechnology,aUSB-serialbridgeisusuallyrequired.Inmanycases,whenadedicatedUSBdongleisnotavailable,itispossibletoprogramamicrocontrollersensornodetoactasatransparentUSB-serialbridge.Then,thesoftwarecomponenthastobewrittenoradaptedtoformatincomingdataintoJSONrecordsasexplainedpreviously.
ForwidelyusedradiotechnologiessuchasWiFiorBluetoothwherethenetworkinterfacecanbeembeddedintothegateway(forinstancetheRaspberry3hasbuilt-inWiFiandBluetooth),thesameapproachcanbeimplemented:asoftwarecomponentcanbewrittenoradaptedtoformatincomingdataontheWiFiorBluetoothinterfaceintoJSONrecordsasexplainedpreviously.Inthesecases,itismostlikelythathigh-levellibraries(e.g.Pythonlibraryies)canbeusedtohandlealltheconnectionissuesinordertogetthepacketpayload.
ProjectNº687607 WAZIUPD2.1
Page80
7. TESTSWITHLORAWANANDMINIMUMINTEROPERABILITY
7.1. LoRaWANpacketformatandrequirements
7.1.1. LoRaWANpacketformat
AbriefdescriptionofLoRaWANwasprovidedinSection4.3.2.WedescribeheremoredetailsoftheLoRaWANpacketformatasitisthecoresupportforaminimuminteroperabilitylevel.TakenfromtheLoRaWANspecificationdocument[6],theLoRaWANpacketformatisillustratedinFigure73.
Figure73–LoRaWANpacketformat
ALoRaWANpacket,asourownLoRapacketformat(seeSection5.3.6)startsatthePHYPayloadandconsistsofMHDR,FHDR,DevAddr,FCtrl,FCnt,FOpts,FPort,encryptedapplicationpayloadandMIC.
TosupportLoRaWANpacket,itisnecessarytobeabletoencrypttheapplicationpayloadandcomputetheMICaccordingtotheLoRaWANspecifications.
7.1.2. LoRaWANencryption
TheLoRaWANencryptionprocedureuses2keys:anapplicationkey(AppSKey)andanetworkkey(NetSKey).Bothare16-byteslong.The128-bitAES-CTRencryptionmodeisthenappliedwiththe2keysasillustratedinFigure74fortheframeassemblyprocess.
AppSKeyisusedtoencryttheapplicationpayloadandNetSKeyisusedtoproducetheMIC.Inbothoperations,FCnt,whichisacounterthatisincrementedforeachpacket,and
App payload
0..15B
defined by FCtrl[0..3]
ProjectNº687607 WAZIUPD2.1
Page81
Direction,whichtakes0x00valueforuplinkand0x01fordownlink,areincorporatedintotheencryptionprocess.
Figure74–LoRaWANframeassembyprocess
7.2. SettingupaLoRaWANgateway:theMultitechmConduit
7.2.1. TheMultitechmConduit
"MultiConnectConduitfromMultitechisaprogrammablegatewaythatusesanopenLinuxdevelopmentenvironment(mLinux)toenablemachine-to-machine(M2M)connectivityusingvarious wireless interfaces. It also provides an online application store as a platform fordevelopers to provision and manage their gateway and associated sensors and devices.Conduitallowsyou touseeither IBM’sNode-REDdrag-and-drop interfaceormLinuxOpenEmbedded/YoctotodevelopIoTapplicationsformonitoringandcontrollingassets.AdiverserangeofMultiConnectmCardaccessorycardsprovidethelocalwiredorwirelessfieldassetconnectivityandplugdirectlyintotherearoftheConduitgateway".
TheMultitechConduitisshowninFigure75.
"TheMTAC-LoRaaccessorycardprovideslongrangeRFsupportusingSemtech’sLoRaradiotechnology. The Conduit gateway uses this accessory card to connect MultiTech’s mDotproductstothecloud".
OurConduitmodelistheMTCDT-210L-US-EU-GBmLinuxProgrammableGateway.
DevAddr Encrypted Payload MIC(*)
AES128signature
end-device network session key NetSKey
FCtrl
Application payload
AES128encryption
end-device application session key AppSKey
(*) MIC = Message Integrity Check
FCnt FPort
(FCnt, Direction, payload)then FCnt++
MHDR
(FCnt, Direction, frame)
1B 4B 1B 2B 1B nB 4B
nBLoRaWAN frame assembly process
ProjectNº687607 WAZIUPD2.1
Page82
Figure75–TheMultitechConduitandsomeavailablemCards
TheConduitcanbeconfiguredintwoways.Oneistousetheserialportbyconnectingthegatewaytoyourcomputerwithamicro-USB-cabletotheUSBdeviceportandopeningupaserialmonitortoolsuchasPutty.Inourcase,weuseasecondsolutionwhichistoaccesstheterminalinterfaceviaEthernet.First,weneedtoconnecttheantennatotheMTAC-LoRamodule,thentheEthernetcableandfinallythepowersupply.Thegatewayshoudnowbootup. BydefaulttheConduithasanhardcodedIPaddress:192.168.2.1(DHCPisdisabled).Onyourcomputer,configurethenetworkinterfacethatisconnectedtotheConduittobeastaticIPaddresswithin192.168.2.2 - 192.168.2.254.NextopenanSSHconnectionusingthedefaultfactorycredential:userisroot,passwordisroot.
OnLinux,issuethiscommandinyourcomputer’sterminal:
Whenprompted,enterthedefaultpassword.OnWindows,installPuttyandopenanewsessionSSHonport22usingtheabovedefaults.
IftheloginwassuccessfultheConduit’sterminalpromptshouldappear:
root@mtcdt:~#
UpgradingLoRaServer&PacketForwarder
1. Downloadfromhttp://www.multitech.net/developer/downloads/ thelatestLora-Packet-forwarderandLora-Network-ServerpackagesfromtheMultitech.Thefilesshouldbesimilartothis:
• lora-packet-forwarder_1.4.1-r9.1_arm926ejste.ipk
• lora-network-server_1.0.8-r0.0_mlinux.ipk
ProjectNº687607 WAZIUPD2.1
Page83
2. CopybothpackagestotheConduitusingSCPoranalternative(flashdriveforexample),andinstallthemusingtheopkgpackagemanager:$ opkg install lora-packet-forwarder_*.ipk $ opkg install lora-network-server_*.ipk
ConfiguringthepacketforwarderforTheThingsNetwork
1. IssuethesecommandsontheConduit:$mkdir /var/config/lora $cp /opt/lora/lora-network-server.conf.sample /var/config/lora/lora- network-server.conf
2. Edit/var/config/lora/lora-network-server.confandmodifythesesettingsasneeded(useviornano).
Field MTAC-LORA-915 (NA) MTAC-LORA-868 (EU)
lora["frequencyBand"]: “915″ “868″
lora["channelPlan"]: “US915″ or “AU915″ “EU868″
lora["frequencySubBand"]: (integer: 1 to 8) Not applicable
lora["frequencyEU"]: Not applicable default: 869500000 range: [863500000 - 867500000] and [869100000 - 869500000]
network["public"]: true
3. Restartthenetworkserver.Thiswillgenerateaconfigurationfileforthepacketforwarder.$ /etc/init.d/lora-network-serverrestart
4. Copythegeneratedpacketforwarderconfigurationtotheconfigpartition$cp /var/run/lora/1/global_conf.json /var/config/lora/global_conf.json
5. Edit/var/config/lora/global-conf.jsonandmodifythesesettings.Entertheserveraddressdependingonyourregion:router.eu.staging.thethings.network#EU433andEU863-870router.us.staging.thethings.network#US902-928router.cn.staging.thethings.network#China470-510and779-787router.au.staging.thethings.network#Australia915-928MHz
ProjectNº687607 WAZIUPD2.1
Page84
"gateway_conf" : { "gateway_ID" : "00000008004A0410", "forward_crc_disabled" : true, "forward_crc_error" : false, "forward_crc_valid" : true, "keepalive_interval" : 12, "push_timeout_ms" : 120, "serv_port_down" : 1700, "serv_port_up" : 1700, "server_address" : "router.eu.thethings.network", "stat_interval" : 20, "synch_word" : 52 }
6. Edit/etc/init.d/lora-network-severasfollows:Commentouttheloranetworkserverstartcode(line57to61)
# start network server
# start-stop-daemon --start --background --make-pidfile \
# --pidfile $net_server_pidfile --exec $net_server -- \
# -c $conf_file --lora-eui $lora_eui --lora-path $run_dir --db $conf_db \
# --noconsole -l $net_server_log
#sleep 1
Online65,changethe-c$run_dirto-c$conf_dir
# start packet forwarder
start-stop-daemon --start --background --make-pidfile \
--pidfile $pkt_fwd_pidfile --exec $pkt_fwd -- \
-c $conf_dir -l $pkt_fwd_log
echo "OK"
CommentouttheLoranetworkserverstopcode(line71)
#start-stop-daemon --stop --quiet --oknodo --pidfile $net_server_pidfile --retry 15
start-stop-daemon --stop --quiet --oknodo --pidfile $pkt_fwd_pidfile --retry 5
7. Restartthepacketforwarder$ /etc/init.d/lora-network-serverrestart
ProjectNº687607 WAZIUPD2.1
Page85
8. Fordebbugging,youcanviewthepacketforwarderlogwiththiscommand:$tail -f /var/log/lora-pkt-fwd.log
setup_sx125x:678: Note: SX125x #0 clock output enabled
setup_sx125x:721: Note: SX125x #0 PLL start (attempt 1)
setup_sx125x:673: Note: SX125x #1 version register returned 0x21
setup_sx125x:678: Note: SX125x #1 clock output enabled
setup_sx125x:721: Note: SX125x #1 PLL start (attempt 1)
lgw_start:1120: Note: calibration started (time: 3000 ms)
lgw_start:1141: Note: calibration finished (status = 191)
Info: Initialising AGC firmware...
Info: loading custom TX gain table
Info: putting back original RADIO_SELECT value
*** Basic Packet Forwarder for Lora Gateway ***
Version: 1.4.1
*** Lora concentrator HAL library version info ***
Version: 1.7.0; Options: ftdi sx1301 sx1257 full mtac-lora private;
***
INFO: Little endian host
INFO: found global configuration file /var/config/lora/global_conf.json, parsing it
INFO: /var/config/lora/global_conf.json does contain a JSON object named
SX1301_conf, parsing SX1301 parameters
INFO: radio 0 enabled, center frequency 867500000
INFO: radio 1 enabled, center frequency 868500000
INFO: Lora multi-SF channel 0> radio 1, IF -400000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 1> radio 1, IF -200000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 2> radio 1, IF 0 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 3> radio 0, IF -400000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 4> radio 0, IF -200000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 5> radio 0, IF 0 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 6> radio 0, IF 200000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 7> radio 0, IF 400000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora std channel> radio 1, IF -200000 Hz, 250000 Hz bw, SF 7
INFO: FSK channel> radio 1, IF 300000 Hz, 100000 Hz bw, 50000 bps datarate
INFO: /var/config/lora/global_conf.json does contain a JSON object named
gateway_conf, parsing gateway parameters
INFO: gateway MAC address is configured to 00000008004A0410
INFO: server hostname or IP address is configured to "router.eu.thethings.network"
INFO: upstream port is configured to "1700"
INFO: downstream port is configured to "1700"
INFO: synch word is configured to 34
INFO: downstream keep-alive interval is configured to 12 seconds
INFO: statistics display interval is configured to 20 seconds
INFO: upstream PUSH_DATA time-out is configured to 120 ms
INFO: packets received with a valid CRC will be forwarded
INFO: packets received with a CRC error will NOT be forwarded
INFO: packets received with no CRC will be forwarded
INFO: found local configuration file /var/config/lora/local_conf.json, parsing it
INFO: redefined parameters will overwrite global parameters
ProjectNº687607 WAZIUPD2.1
Page86
INFO: /var/config/lora/local_conf.json does not contain a JSON object named
SX1301_conf
INFO: /var/config/lora/local_conf.json does contain a JSON object named
gateway_conf, parsing gateway parameters
INFO: gateway MAC address is configured to 00000008004A0410
INFO: packets received with a valid CRC will be forwarded
INFO: packets received with a CRC error will NOT be forwarded
INFO: packets received with no CRC will be forwarded
INFO: [main] concentrator started, packet can now be received
INFO: Start of downstream thread
INFO: [down] PULL_ACK received in 29 ms
INFO: [down] PULL_ACK received in 28 ms
##### 2016-10-13 22:34:30 GMT #####
### [UPSTREAM] ###
# RF packets received by concentrator: 0
# CRC_OK: 0.00%, CRC_FAIL: 0.00%, NO_CRC: 0.00%
# RF packets forwarded: 0 (0 bytes)
# PUSH_DATA datagrams sent: 0 (0 bytes)
# PUSH_DATA acknowledged: 0.00%
### [DOWNSTREAM] ###
# PULL_DATA sent: 2 (100.00% acknowledged)
# PULL_RESP(onse) datagrams received: 0 (0 bytes)
# RF packets sent to concentrator: 0 (0 bytes)
# TX errors: 0
ForUpstream:
• RFpacketsreceivedbyconcentrator:packetsarestoredinconcentrator)
• RFpacketsforwarded:packetsareforwardedtoTheThingsNetworkserver
• PUSH_DATAacknowledged:forwardingacknowledgement
ü 0%:noactiveconnectiontoTTNbackend
ü 100%:activeconnectiontoTTNbackend
ForDownstream:
• PULL_DATAsent:requestingavailabledownstreampackets
ü 0%:noactiveconnectiontoTTNbackend
ü 100%:activeconnectiontoTTNbackend
• PULL_RESP(onse)datagramsreceived:downstreampackets
• RFpacketssenttoconcentrator:concentratorsendsdownstreampackets
Thegatewayisnowoperational.
ProjectNº687607 WAZIUPD2.1
Page87
GatewayregistrationonTheThingsNetwork(seeFigure76)
Figure76–Gatewaysettings
7.2.2. ThemDot
"TheMultiConnectmDot isasecure,programmable, long-rangeand low-powerRFmodulethatprovidesdataconnectivitytosensors,industrialequipment,andremoteappliances"(seeFigure77).
Figure77–MultiConnectmDot
BeforeourmDotdevicecancommunicateviaTheThingsNetworkweneedtoregisteritwithanapplication.Figure78depictsthesesettings.WeuseABPactivationmethodthatisusefulforworkshops:nowaitingforadownlinkwindowtobecomeavailabletoconfirmtheactivation.Inproduction,thedefaultOverTheAirActivation(OTTA)isrecommended.Thisismorereliablebecausetheactivationwillbeconfirmedandmoresecurebecausethesessionkeyswillbenegotiatedwitheveryactivation.
ProjectNº687607 WAZIUPD2.1
Page88
Figure78–DevicesettingsonTTN
SettingupthemDottojointheConduitLoRanetwork
SettingupthemDottojointheConduitLoRanetwork,weneedtoconnectthemDottoourcomputerusingSerialtoUSBconnectorandwithanhyperterminaltosendATcommands.TheseATcommandsareasfollows:
• Manual join mode AT+NJM=0
• Public network mode AT+PN=1
• Set Network Session Key AT+NSK=8017FE3C648E370BBE6AB699303E0026
• Set Data Session Key AT+DSK=A4C451698B489C75BEF8B2EE6D1A011F
• Set Network ID AT+NI=0,70B3D57EF0001DCB
• Set Network Address AT+NA=26011BC0
• Save settings AT&W
• Restart ATZ
Forchecking,wecandisplaycurrentsettingsandstatus:
ProjectNº687607 WAZIUPD2.1
Page89
AT&V Device ID: 00:80:00:00:00:00:a5:8f Frequency Band: FB_868 Frequency Sub Band: 0 Public Network: on Start Up Mode: COMMAND Network Address: 26011bc0 Network ID: 70:b3:d5:7e:f0:00:1d:cb Network ID Passphrase: Network Key: Network Key Passphrase: Network Session Key: 80.17.fe.3c.64.8e.37.0b.be.6a.b6.99.30.3e.00.26 Data Session Key: a4.c4.51.69.8b.48.9c.75.be.f8.b2.ee.6d.1a.01.1f Network Join Mode: MANUAL Network Join Retries: 2 Join Byte Order: LSB Link Check Threshold: off Link Check Count: off Error Correction: 1 bytes ACK Retries: off Encryption: on CRC: on Adaptive Data Rate: off Command Echo: on Verbose Response: off Tx Frequency: 0 Tx Data Rate: SF_9 Tx Power: 11 Tx Wait: on Tx Inverted Signal: off Rx Frequency: 869525000 Rx Data Rate: SF_9 Rx Inverted Signal: on Rx Output Style: HEXADECIMAL Debug Baud Rate: 115200 Serial Baud Rate: 115200 Wake Mode: INTERVAL Wake Interval: 10 s Wake Delay: 100 ms Wake Timeout: 20 ms Log Level: 0
Now,wecanjointheConduitLoRanetworkbysendingamessagewithoutrequestinganACK:
AT+ACK=0 AT+SEND=Hello from Dakar
CheckiftheConduitisreceivingpackages
Wecanrun
tail -f /var/log/lora-pkt-fwd.log
ontheConduitterminalsessionasdescribedaboveandviewthelog.Hereisasuccessfulresult:
ProjectNº687607 WAZIUPD2.1
Page90
##### 2016-12-30 16:39:48 GMT ##### ### [UPSTREAM] ### # RF packets received by concentrator: 1 # CRC_OK: 100.00%, CRC_FAIL: 0.00%, NO_CRC: 0.00% # RF packets forwarded: 1 (29 bytes) # PUSH_DATA datagrams sent: 1 (252 bytes) # PUSH_DATA acknowledged: 100.00% ### [DOWNSTREAM] ### # PULL_DATA sent: 1 (100.00% acknowledged) # PULL_RESP(onse) datagrams received: 0 (0 bytes) # RF packets sent to concentrator: 0 (0 bytes) # TX errors: 0 ##### END ##### INFO: [down] PULL_ACK received in 28 ms INFO: [down] PULL_ACK received in 28 ms
VisualizepackagesonTheThingsNetwork
Figure79–ReceivingdataonTTN
Sources:www.multitech.net,www.thethingsnetwork.org
TheConduit’sID
EncodedPayload(base64)
DecodedPayload
ProjectNº687607 WAZIUPD2.1
Page91
7.3. ProvidingasimpleLoRaWANinteroperabilitylevel
TheLoRaWANinteroperabilitylevelthattheWAZIUPplatformproposesisasfollows:
• Uplinkmessageonly:alow-costIoTdevicecansendLoRaWAN-formattedpacketthatcanbereceivedbothbyWAZIUPlow-costandcommercialLoRaWANgateway;
• TheWAZIUPlow-costgatewaycanreceivedandprocessLoRaWANpacketsfromaLoRaWANdevice(eitherwithaLoRaWANradiomodule,orusingaLoRaWANprotocolstacksuchasseveral“IBMLoRaWAN-in-C”[12](LMIC)portsforArduinoboards;localdecryptioncanbeenabledifAppSKeyandNetSKeyarebothknownbythegateway;
• FortheIoTdevice,theknowledgeofAppSKeyandNetSKeyarerealizedfollowingtheActivationByPersonalizationmechanism(ABP)whichmeansthatAppSKeyandNetSKeyarestoredinitiallyintheIoTdevice.
7.3.1. Low-costIoTdevice
Atthelow-costIoTdevice,bothAppSKeyandNetSkeyarestoredasfollows:
unsigned char AppSkey[16] = { 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C }; unsigned char MwkSkey[16] = { 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C };
Hereweusethestandardkeysfortestpurposes.Then,a4-bytedeviceaddressisdefined,possiblyusingthe1-byteaddressusedbyourlong-rangecommunicationlibrary(seeSections5.3.6and5.4.4).Inthefollowingexamples,weused:
unsigned char DevAddr[4] = { 0x00, 0x00, 0x00, 0x06 };
LoRaWANAES-CTRencryptionfunctionalitiesareprovidedbythegreatlight-weightlibrarywrittenbyGerbendenHartog,initiallyfortheIdeetronNexusboard,butfurtherusedinseveralLMICportsforArduinoboardsbecauseofitssimplicity,efficiencyandsmallmemoryfootprint.
Asindicatedpreviously,Arduino_LoRa_tempisatemplatewithAESencryptionandthepossibilitytosendLoRaWANpacket.Assumingthatthepayloadis\!#3#TC/22.50,weshowbelowanexampleoutputofanIoTdevicerunningtheArduino_LoRa_tempprogram:
LoRa temperature sensor Arduino Pro Mini detected SX1276 detected, starting SX1276 LF/HF calibration ... Get back previous sx1272 config Using packet sequence number of 100 Setting Mode: state 0 Setting Channel: state 0 Setting Power: state 0
ProjectNº687607 WAZIUPD2.1
Page92
Setting node addr: state 0 SX1272 successfully configured Reading 70 (Temp is 22.55 Sending \!#3#TC/22.50 Real payload size is 13 \!#3#TC/22.50 plain payload hex 5C 21 23 33 23 54 43 2F 32 32 2E 35 30 Encrypting encrypted payload 4F 29 E7 49 77 A1 C2 E7 81 E6 16 A6 68 calculate MIC with NwkSKey transmitted LoRaWAN-like packet: MHDR[1] | DevAddr[4] | FCtrl[1] | FCnt[2] | FPort[1] | EncryptedPayload | MIC[4] 40 06 00 00 00 00 00 00 01 4F 29 E7 49 77 A1 C2 E7 81 E6 16 A6 68 FD 75 68 74 end-device uses native LoRaWAN packet format --> CAD duration 547 OK1 --> waiting for 1 CAD = 62 --> CAD duration 547 OK2 --> RSSI -126 LoRa pkt size 26 LoRa pkt seq 100 LoRa Sent in 1733 LoRa Sent w/CAD in 9091 Packet sent, state 0
7.3.2. Low-costgateway
Thepost-processingblockofourlow-costgatewaycanreceiveLoRaWANpacketandcaneitherlocallydecryptthepacketifbothAppSKeyandNetSKeyareavailableorpushtheencryptedpayloadintothecloud.TheLoRaWANdecryptioncapabilitiesareprovidedbytheLoRaWANpythonpackagefromhttps://github.com/jeroennijhof/LoRaWAN.WewrappedtheLoRaWANsupportusingtheLoRaWANencryption/decryptionpythonpackageintoaloraWAN.pypythonscript.
Inthefollowingexample,weshowourlow-costgatewaylocallydecryptingtheLoRaWANpacketandpushingdatatotheThingSpeakcloudasexplainedinSection5.5.4.
Parsing cloud declarations [u'python CloudThingSpeak.py'] Parsed all cloud declarations post_processing_gw.py got cloud list: [u'python CloudThingSpeak.py'] raw output from gateway. post_processing_gw will handle packet format enable local AES decryption Current working directory: /home/pi/lora_gateway SX1276 detected, starting. SX1276 LF/HF calibration ... **********Power ON: state 0 Default sync word: 0x12 LoRa mode 1 Setting mode: state 0 Channel CH_10_868: state 0 Set LoRa Power to M Power: state 0 Get Preamble Length: state 0 Preamble Length: 8 LoRa addr 1: state 0 Raw format, not assuming any header in reception SX1272/76 configured as LR-BS. Waiting RF input for transparent RF-serial bridge
ProjectNº687607 WAZIUPD2.1
Page93
--- rxlora. dst=0 type=0x00 src=0 seq=0 len=26 SNR=-16 RSSIpkt=-110 BW=125 CR=4/5 SF=12 2016-10-20T12:34:22.420292 rcv ctrl pkt info (^p): 0,0,0,0,26,-16,-110 splitted in: [0, 0, 0, 0, 26, -16, -110] rawFormat(len=26 SNR=-16 RSSI=-110) rcv ctrl radio info (^r): 125,5,12 splitted in: [125, 5, 12] (BW=125 CR=5 SF=12) rcv timestamp (^t): 2016-10-20T12:09:25.281 got first framing byte --> got data prefix raw format from gateway LoRaWAN? loraWAN: valid MIC loraWAN: plain payload is \!#3#TC/22.50 plain payload is : \!#3#TC/22.50 number of enabled clouds is 1 --> cloud[0] uploading with python CloudThingSpeak.py ThingSpeak: uploading rcv msg to log (\!) on ThingSpeak ( default , 3 ): 22.50 ThingSpeak: will issue curl cmd curl -s -k -X POST --data field3=22.50&field7=0 https://api.thingspeak.com/[…] ThingSpeak: returned code from server is 210 --> cloud end
WhenthegatewaydoesnotknowAppSKeynorNetSkeyasitisthecasewhenseveralorganizationssharethesamegateway,thefollowingexampleshowshowthegatewaycanpushtheencryptedpayloadintothecloudwheredecryptionwillbeperformedinalaterstep.TheexampleusesFireBasetostoreinJSONformattheLoRaWANpacket.EncryptedpayloadandtheentireLoRaWANframearestoredinBase64format.
Parsing cloud declarations [u'python CloudThingSpeak.py'] Parsed all cloud declarations post_processing_gw.py got cloud list: [u'python CloudThingSpeak.py'] Parsing cloud declarations [u'python CloudFireBaseLWAES.py'] Parsed all cloud declarations post_processing_gw.py got LoRaWAN encrypted cloud list: [u'python CloudFireBaseLWAES.py'] raw output from gateway. post_processing_gw will handle packet format Current working directory: /home/pi/lora_gateway 2016-10-26T22:14:12.985467 rcv ctrl pkt info (^p): 0,0,0,0,26,8,-45 splitted in: [0, 0, 0, 0, 26, 8, -45] rawFormat(len=26 SNR=8 RSSI=-45) rcv ctrl radio info (^r): 125,5,12 splitted in: [125, 5, 12] (BW=125 CR=5 SF=12) got first framing byte --> got data prefix raw format from gateway LoRaWAN? --> DATA encrypted: local aes not activated --> FYI base64 of LoRaWAN frame w/MIC: QAYAAAAAAAABTynnSXehwueB5hamaP11aHQ= --> number of enabled clouds is 1 --> LoRaWAN encrypted cloud[0] uploading with python CloudFireBaseLWAES.py FireBase: uploading Firebase: upload success --> LoRaWAN encrypted cloud end
ProjectNº687607 WAZIUPD2.1
Page94
OnFireBase,thefollowingrecordisstored:
sensor0x00000006 msg0x0000 FCnt: "0x0000" FPort: "0x01" MIC: "0xfd756874" cr: 5 data_b64: "TynnSXehwueB5hamaA==" datarate: "SF12BW125" devAddr: "0x00000006" frame_b64: "QAYAAAAAAAABTynnSXehwueB5hamaP11aHQ=" gateway_eui: "00000027EB795C47" len: 26 pdata:"0,0,0,0,26,8,-45" ptype: "0x40" ptypestr: "unconfirmed data up" rdata:"125,5,12" rssi: -45 snr: 8 time: "2016-10-26T20:14:13.110056"
ThepreviousloraWAN.pyscriptcanbeusedonacomputertodecrypttheencryptedpayload.
> python loraWAN.py "QAYAAAAAAAABTynnSXehwueB5hamaP11aHQ=" "1,20,6,0,26,8,-45" "125,5,12" ?loraWAN: valid MIC ?loraWAN: plain payload is \!#3#TC/22.50 ?plain payload is : \!#3#TC/22.50 ^p1,16,6,0,13,8,-45 ^r125,5,12 ??\!#3#TC/22.50
Notethe2'?'infrontoftheplaindata.Thesearenormallythedataprefix\xFF\xFEinsertedbythelora_gatewayprogramandemulatedbyloraWAN.py.The'?'infrontoftheotherlinesindicatetoapost-processingblockthattheselinesshouldbeignored.
Oncetheapplicationhastheplainpayload,itcanfurtherpushtheplaindataintootherIoTclouds.Forinstance,afinalapprunningonaLinuxmachinecansimplyuseourpost-processingblockwritteninPython(post_processing_gw.py)withtheplaindatatouploaddatatoIoTcloudsjustasagatewaywithNetSKeyandAppSKeywoulddo.
> python loraWAN.py "QAYAAAAAAAABTynnSXehwueB5hamaP11aHQ=" "1,20,6,0,26,8,-45" "125,5,12" | python post_processing_gw.py Parsing cloud declarations [u'python CloudThingSpeak.py'] Parsed all cloud declarations post_processing_gw.py got cloud list: [u'python CloudThingSpeak.py'] Parsing cloud declarations [u'python CloudFireBaseLWAES.py'] Parsed all cloud declarations post_processing_gw.py got LoRaWAN encrypted cloud list: [u'python CloudFireBaseLWAES.py'] Current working directory: /home/pi/my_final_app 2016-10-27T22:18:45.079058 rcv ctrl pkt info (^p): 1,16,6,0,13,8,-45 splitted in: [1, 16, 6, 0, 13, 8, -45]
ProjectNº687607 WAZIUPD2.1
Page95
(dst=1 type=0x10(DATA) src=6 seq=0 len=13 SNR=8 RSSI=-45) rcv ctrl radio info (^r): 125,5,12 splitted in: [125, 5, 12] (BW=125 CR=5 SF=12) got first framing byte --> got data prefix number of enabled clouds is 1 --> cloud[0] uploading with python CloudThingSpeak.py ThingSpeak: uploading rcv msg to log (\!) on ThingSpeak ( default , 3 ): 22.50 ThingSpeak: will issue curl cmd curl -s -k -X POST --data field3=22.50&field7=0 https://api.thingspeak.com/ […] ThingSpeak: returned code from server is 218 --> cloud end
Ifyouusethisfeaturewherepost_processing_gw.pytakesitsinputfromloraWAN.py,youhavetopassatleast2arguments:thebase64-encodedstringandthepacketinfostring(e.g.^pstring).loraWAN.pysetthepackettypeandthedatalengthtotheappropriatevalueforpost_processing_gw.py.post_processing_gw.pycanuseexactelythesamecloudconfigurationthananormalgatewaywouldhave.
7.3.3. FromLoRaWANmDottolow-costgateway
Asdescribedpreviously,themDotisaLoRaWANradiomodulefromMultiTech.ThemdotwillbeconfiguredbyABP,withtheAppSKeyandNetSKeymatchingthosedeclaredinloraWAN.py.Thefrequencywillbe868.1MHzandtheLoRaparametersare:bw=125kHz,cr=4/5andsf=12whichcorrespondtoourLoRamode1.
# Data session encryption key (16 bytes) AT+DSK=2B7E151628AED2A6ABF7158809CF4F3C OK # Network session encryption key (16 bytes) AT+NSK=2B7E151628AED2A6ABF7158809CF4F3C OK
Then,sendingwiththemDot:
AT+SEND=HelloWorld OK AT+SEND=HelloWorld_1 OK
Thelow-costgatewayisstartedasfollows,notethesyncwordof0x34tomatchtheoneofLoRaWAN.
> sudo ./lora_gateway --mode 1 --raw --sw 34 --freq 868.1 | python post_processing_gw.py --raw –aes Parsing cloud declarations Parsed all cloud declarations post_processing_gw.py got cloud list: [] raw output from gateway. post_processing_gw will handle packet format enable local AES decryption Current working directory: /home/pi/lora_gateway SX1276 detected, starting. SX1276 LF/HF calibration ... **********Power ON: state 0
ProjectNº687607 WAZIUPD2.1
Page96
Default sync word: 0x12 Set sync word to 0x34 LoRa sync word: state 0 LoRa mode 1 Setting mode: state 0 Frequency 868.100000: state 0 Set LoRa Power to M Power: state 0 Get Preamble Length: state 0 Preamble Length: 8 LoRa addr 1: state 0 Raw format, not assuming any header in reception SX1272/76 configured as LR-BS. Waiting RF input for transparent RF-serial bridge
Hereisthereceptiononourlow-costgateway:
... --- rxlora. dst=0 type=0x00 src=0 seq=0 len=23 SNR=7 RSSIpkt=-68 BW=125 CR=4/5 SF=12 2016-10-24T11:13:51.119549 rcv ctrl pkt info (^p): 0,0,0,0,23,7,-68 splitted in: [0, 0, 0, 0, 23, 7, -68] rawFormat(len=23 SNR=7 RSSI=-68) rcv ctrl radio info (^r): 125,5,12 splitted in: [125, 5, 12] (BW=125 CR=5 SF=12) rcv timestamp (^t): 2016-10-24T11:13:51.118 got first framing byte --> got data prefix raw format from gateway LoRaWAN? loraWAN: valid MIC loraWAN: plain payload is HelloWorld plain payload is : HelloWorld HelloWorld --- rxlora. dst=0 type=0x00 src=0 seq=0 len=25 SNR=6 RSSIpkt=-80 BW=125 CR=4/5 SF=12 2016-10-24T11:30:34.333976 rcv ctrl pkt info (^p): 0,0,0,0,25,6,-80 splitted in: [0, 0, 0, 0, 25, 6, -80] rawFormat(len=25 SNR=6 RSSI=-80) rcv ctrl radio info (^r): 125,5,12 splitted in: [125, 5, 12] (BW=125 CR=5 SF=12) rcv timestamp (^t): 2016-10-24T11:30:34.333 got first framing byte --> got data prefix raw format from gateway LoRaWAN? loraWAN: valid MIC loraWAN: plain payload is HelloWorld_1 plain payload is : HelloWorld_1 HelloWorld_1
ProjectNº687607 WAZIUPD2.1
Page97
8. ANNEXES8.1. OurLoRaFAQs
[Doc]Low-costLoRaIoTdevicesandgatewayFAQLatestversioncanbedownloadedfrom:https://github.com/CongducPham/tutorials/blob/master/FAQ.pdf
Author : Congduc Pham, University of Pau, France page Last update : 24.11.2016
1"
EU"H2020"grant"agreement"number"687607"
Low-cost LoRa IoT devices and gateway FAQ
1) What is Internet-of-Thing (IoT)?
From IERC (European Research Cluster on the Internet of Thing)
The IERC definition states that IoT is "A dynamic global network infrastructure with self-configuring capabilities based on standard and interoperable communication protocols where physical and virtual “things” have identities, physical attributes, and virtual personalities and use intelligent interfaces, and are seamlessly integrated into the information network."
From http://www.gartner.com/it-glossary/internet-of-things/
"The Internet of Things (IoT) is the network of physical objects that contain embedded technology to communicate and sense or interact with their internal states or the external environment."
From http://internetofthingsagenda.techtarget.com/definition/Internet-of-Things-IoT
"The Internet of Things (IoT) is a system of interrelated computing devices, mechanical and digital machines, objects, animals or people that are provided with unique identifiers and the ability to transfer data over a network without requiring human-to-human or human-to-computer interaction."
2) What is WAZIUP?
The EU H2020 WAZIUP project, namely the Open Innovation Platform for IoT-Big Data in Sub-Saharan Africa is a collaborative research project using cutting edge technology applying IoT and Big Data to improve the working conditions in the rural ecosystem of Sub-Saharan Africa. First, WAZIUP operates by involving farmers and breeders in order to define the platform specifications in focused validation cases. Second, while tackling challenges which are specific to the rural ecosystem, it also engages the flourishing ICT ecosystem in those countries by fostering new tools and good practices, entrepreneurship and start-ups. Aimed at boosting the ICT sector, WAZIUP proposes solutions aiming at long term sustainability.
WAZIUP will deliver a communication and big data application platform and generate locally the know how by training by use case and examples. The use of standards will help to create an interoperable platform, fully open source, oriented to radically new paradigms for innovative application/services delivery. WAZIUP is driven by the following visions:
1. Empower the African Rural Economy. Develop new technological enablers to empower the African rural economy now threatened by the concurrent action of rapid urbanization and of climate change. WAZIUP technologies can support the necessary services and infrastructures to launch agriculture and breeding on a new scale;
ProjectNº687607 WAZIUPD2.1
Page98
8.2. Low-costLoRaIoTplatformpartlist
[Doc]Low-costLoRaIoTplatformpartlistLatestversioncanbedownloadedfrom:https://github.com/CongducPham/tutorials/blob/master/low-cost-iot-hardware-parts.pdf
Low-cost LoRa IoT platform part list! last update November 6th, 2016
TO BUILD THE GATEWAY
Raspberry: take either the RPI2 or RPI3 (RPI3 better for WiFi and Bluetooth)
You also need an 8GB SD card
RPI3 has built-in WiFi and Bluetooth 4.0,
if you get or already have the RPI2 and want WiFi and Bluetooth, get dongles, but it is not mandatory. Dongles that have been tested successfully are:
Bluetooth 4.0: CSR dongle or Konig dongle !WiFi: TP-LINK TL-WL725N!
ProjectNº687607 WAZIUPD2.1
Page99
8.3. Tutorialsmaterials
[Slides]"Tutorialonhardware&softwareforlow-costlong-rangeIoT"Latestversioncanbedownloadedfrom:https://github.com/CongducPham/tutorials/blob/master/tutorial-SWHW-LoRa-WAZIUP.pdf
[Slides]"Low-costLoRaIoTdevice:astep-by-steptutorial"Latestversioncanbedownloadedfrom:https://github.com/CongducPham/tutorials/blob/master/Low-cost-LoRa-IoT-step-by-step.pdf
[Slides]"BuildingIoTdeviceforoutdoorusage:astep-by-steptutorial"Latestversioncanbedownloadedfrom:https://github.com/CongducPham/tutorials/blob/master/Low-cost-LoRa-IoT-outdoor-step-by-step.pdf
[Slides]"Low-costLoRaIoTdevice:supportedphysicalsensors"Latestversioncanbedownloadedfrom:https://github.com/CongducPham/tutorials/blob/master/Low-cost-LoRa-IoT-supported-sensors.pdf
[Slides]"Low-costLoRagateway:astep-by-steptutorial"Latestversioncanbedownloadedfrom:https://github.com/CongducPham/tutorials/blob/master/Low-cost-LoRa-GW-step-by-step.pdf
[Slides]"Low-costLoRaIoT:usingtheWAZIUPdemokit"Latestversioncanbedownloadedfrom:https://github.com/CongducPham/tutorials/blob/master/Low-cost-LoRa-IoT-using-demo-kit.pdf
[Slides]"Low-costLoRaIoTantennatutorialforgateway"Latestversioncanbedownloadedfrom:https://github.com/CongducPham/tutorials/blob/master/Low-cost-LoRa-IoT-antennaCable.pdf
[Video]Buildyourlow-cost,long-rangeIoTdevicewithWAZIUPhttps://www.youtube.com/watch?v=YsKbJeeav_M
[Video]Buildyourlow-costLoRagatewaywithWAZIUPhttps://www.youtube.com/watch?v=peHkDhiH3lE
32!
Tutorials/resources!
Author : Congduc Pham, University of Pau, France page Last update : 07.09.2016
1"
EU"H2020"grant"agreement"number"687607"
Low-cost LoRa IoT devices and gateway FAQ
1) What is Internet-of-Thing (IoT)?
From IERC (European Research Cluster on the Internet of Thing)
The IERC definition states that IoT is "A dynamic global network infrastructure with self-configuring capabilities based on standard and interoperable communication protocols where physical and virtual “things” have identities, physical attributes, and virtual personalities and use intelligent interfaces, and are seamlessly integrated into the information network."
From http://www.gartner.com/it-glossary/internet-of-things/
"The Internet of Things (IoT) is the network of physical objects that contain embedded technology to communicate and sense or interact with their internal states or the external environment."
From http://internetofthingsagenda.techtarget.com/definition/Internet-of-Things-IoT
"The Internet of Things (IoT) is a system of interrelated computing devices, mechanical and digital machines, objects, animals or people that are provided with unique identifiers and the ability to transfer data over a network without requiring human-to-human or human-to-computer interaction."
2) What is WAZIUP?
The EU H2020 WAZIUP project, namely the Open Innovation Platform for IoT-Big Data in Sub-Saharan Africa is a collaborative research project using cutting edge technology applying IoT and Big Data to improve the working conditions in the rural ecosystem of Sub-Saharan Africa. First, WAZIUP operates by involving farmers and breeders in order to define the platform specifications in focused validation cases. Second, while tackling challenges which are specific to the rural ecosystem, it also engages the flourishing ICT ecosystem in those countries by fostering new tools and good practices, entrepreneurship and start-ups. Aimed at boosting the ICT sector, WAZIUP proposes solutions aiming at long term sustainability.
WAZIUP will deliver a communication and big data application platform and generate locally the know how by training by use case and examples. The use of standards will help to create an interoperable platform, fully open source, oriented to radically new paradigms for innovative application/services delivery. WAZIUP is driven by the following visions:
1. Empower the African Rural Economy. Develop new technological enablers to empower the African rural economy now threatened by the concurrent action of rapid urbanization and of climate change. WAZIUP technologies can support the necessary services and infrastructures to launch agriculture and breeding on a new scale;
Low-cost LoRa IoT device:!a step-by-step tutorial!
Prof. Congduc Pham !http://www.univ-pau.fr/~cpham!
Université de Pau, France!!
Building an IoT device for outdoor usage:!
a step-by-step tutorial!
Prof. Congduc Pham !http://www.univ-pau.fr/~cpham!
Université de Pau, France!!
Low-cost LoRa IoT device: !supported physical sensors !
Prof. Congduc Pham!http://www.univ-pau.fr/~cpham!
Université de Pau, France!!
Low-cost LoRa IoT:!using the WAZIUP demo kit!
Prof. Congduc Pham!http://www.univ-pau.fr/~cpham!
Université de Pau, France!!
Low-cost LoRa gateway: !a step-by-step tutorial!
Prof. Congduc Pham !http://www.univ-pau.fr/~cpham!
Université de Pau, France!!
Tutorial on hardware & software for low-cost long-
range IoT!
Prof. Congduc Pham!http://www.univ-pau.fr/~cpham!
Université de Pau, France!!
ProjectNº687607 WAZIUPD2.1
Page100
8.4. Keynotetalks
WeprovideheresomelinkstoselectedkeynotetalksininternationaleventswheretheWAZIUPprojectanditsapproachtowardslow-costlong-rangeIoTdeveloppedinWP2hasbeenpresented.
"Internet-of-ThingforAll"KeynoteatFDSE'2016/ACOMP'2016CanThoUniversityofTechnology,CanTho,VietnamNovember24th,2016Latestversioncanbedownloadedfrom:http://cpham.perso.univ-pau.fr/LORA/WAZIUP/IoT4all.pdf
"Internet-of-Thingandreasonsitisbecomingareality"KeynoteatBDAW'2016AmericanUniversityofBulgaria,Sofia,BulgariaNovember10th,2016Latestversioncanbedownloadedfrom:http://cpham.perso.univ-pau.fr/LORA/WAZIUP/BDAW16-IoT-reality.pdf
"Deployinglow-costandlong-rangeInternetofThingsindevelopingcountries:thechallengesoftheWAZIUPH2020project"InvitedtalkatSMYLEeventon"Understandtheissuesandchallengesoftheconnectedworld"Neuchatel,Switzerland,September23rd,2016Latestversioncanbedownloadedfrom:http://cpham.perso.univ-pau.fr/LORA/WAZIUP/Talk-iot-challenges-smyle.pdf
"Low-power,long-rangeWANforIoT:atechnologyoverview"InvitedtalkatRESSACS'2016IRDBondy-ParisMay10th2016Latestversioncanbedownloadedfrom:http://cpham.perso.univ-pau.fr/LORA/WAZIUP/RESSACS16-LPWAN-review.pdf
"Internet-of-Thingandreasonsitisbecomingareality"KeynoteatICCSA2016UniversityofOumElBouaghi,AlgeriaApril12th2016Latestversioncanbedownloadedfrom:http://cpham.perso.univ-pau.fr/LORA/WAZIUP/IoT-reality.pdf
"LowerCost,LongerRangeSensingSystemsforSurveillanceInfrastructures"SeminaratMAPCIinstituteLundUniversity,Lund,SwedenMarch17th2016.Latestversioncanbedownloadedfrom:http://cpham.perso.univ-pau.fr/LORA/WAZIUP/LowerCostLongerRange.pdf
ProjectNº687607 WAZIUPD2.1
Page101
8.5. Scientificpublications
Weprovideheresomelinkstoselectedscientificpublicationsininternationalpeer-reviewedjournalsandconferenceswheretheWAZIUPprojectanditsadvancedmechanismsproposedaspartofWP2havebeenpresented.
1. C.Pham,A.Rahim,P.Cousin,"WAZIUP:Alow-costinfrastructurefordeployingIoTindevelopingcountries".AcceptedforAFRICOMM'2016,Ouagadougou,BurkinaFaso,Dec.6-7,2016.
2. C.Pham,"QoSforLong-RangeWirelessSensorsunderDuty-CycleRegulationswithSharedActivityTimeUsage".ACMTransactionsonSensorNetworks.Vol12(4),September2016.
3. C.Pham,"Low-cost,Low-PowerandLong-rangeImageSensorforVisualSurveillance".Proceedingsofthe2ndWorkshoponExperienceswithDesignandImplementationofSmartObjects(SMARTOBJECTS'16).Co-locatedwithACMMobiCom'2016,New-York,USA,October3-7,2016.Canbedownloadedat:http://cpham.perso.univ-pau.fr/Paper/SmartObjects16.pdf
4. C.Pham,A.Rahim,P.Cousin,"Low-cost,Long-rangeOpenIoTforSmarterRuralAfricanVillages".ProceedingsoftheIEEEInternationalSmartCitiesConference(ISC2),Trento,Italy,Sep.12-15,2016.Canbedownloadedat:http://cpham.perso.univ-pau.fr/Paper/ISC2-16.pdf
5. C.Pham,"Buildinglow-costgatewaysanddevicesforopenLoRaIoTtest-beds".Proceedingsofthe11thEAIInternationalConferenceonTestbedsandResearchInfrastructuresfortheDevelopmentofNetworks&Communities(TridentCom'2016),Hangzhou,China,June13-15,2016.Canbedownloadedat:http://cpham.perso.univ-pau.fr/Paper/TridentCom2016.pdf
6. C.Pham,"TowardsQualityofServiceforLong-rangeIoTinUnlicensedRadioSpectrum".ProceedingsofWirelessDays(WD'2016),Toulouse,France,March2016.Canbedownloadedat:http://cpham.perso.univ-pau.fr/Paper/WD16.pdf
ProjectNº687607 WAZIUPD2.1
Page102
REFERENCES
[1] LinkLab.Acomprehensivelookatlow-power,widearenetworks.2015.
[2] EDNnetworks.Lowpowerwide-areanetworkingalternativesfortheIoT.[http://www.edn.com/design/systems-design/4440343/1/Low-power-wide-area-networking-alternatives-for-the-IoT].
[3] Semtech.AN1200.22.LoRamodulationbasics.Rev.2.May2015.
[4] RevSpace.DecodingLoRa.[https://revspace.nl/DecodingLora].
[5] MattKnight.ReversingLoRa.[https://static1.squarespace.com/static/54cecce7e4b054df1848b5f9/t/57489e6e07eaa0105215dc6c/1464376943218/Reversing-Lora-Knight.pdf]
[6] LoRaAlliance.LoRaWANspecificationv1.02.[https://www.lora-alliance.org/What-Is-LoRa/Technology].2016.
[7] LoRaAlliance.LoRaWANwhitepapers.[https://www.lora-alliance.org/What-Is-LoRa/LoRaWAN-White-Papers]
[8] Semtech.WirelessRFsolutions.[http://www.semtech.com/wireless-rf]
[9] Semtech.AN1200.19.SX127xReferencedesignoverview.Rev.1.May2014.
[10]ETSI.Electromagneticcompatibilityandradiospectrummatters(ERM);shortrangedevices(SRD);radioequipmenttobeusedinthe25MHzto1000MHzfrequencyrangewithpowerlevelsrangingupto500mw;part1.2012.
[11]AgencedeRégulationdesTélécomsduSénégal,DECISIONDETERMINANTLESCARACTERISTIQUESETLESCONDITIONSTECHNIQUESD’UTILISATIONDESRESEAUXETDESINSTALLATIONSRADIOELECTRIQUESEXCLUSIVEMENTCOMPOSESD’APPAREILSDEFAIBLEPUISSANCEETDEFAIBLEPORTEE.2004-005ART/DG/DRC/D.Rég.
[12]IBM.LoraWANinC.[https://www.research.ibm.com/labs/zurich/ics/lrsc/lmic.html]
ProjectNº687607 WAZIUPD2.1
Page103
ACRONYMSLIST
Acronym Explanation
ABP ActivationbyPersonalization
AES AdvancedEncryptionStandard
AFA AdaptiveFrequencyAgility
API ApplicationProgrammingInterface
BW Bandwidth
CSS ChirpSpreadSpectrum
DIY Do-It-Yourself
DSSS DirectSequenceSpreadSpectrum
ETSI EuropeanTelecommunicationsStandardsInstitute
FAQ FrequentlyAskedQuestions
FEC ForwardErrorCorrection
FHSS FrequencyHoppingSpreadSpectrum
FSK FrequencyShiftKeying
GPRS GeneralRadioPacketService
GPS GlobalPositioningSystem
GSM GlobalSystemforMobilecommunications
IDE IntegratedDevelopmentEnvironment
IoT Internet-of-Thing
IP InternetProtocol
ISMband IndustrialScientificMedicalband
JSON JavaScriptObjectNotation
LBT ListenBeforeTalk
LOS LineofSight
LPWAN LowPowerWideAreaNetworks
LTE Long-TermEvolution
M2M Machine-to-Machine
MAC MediumAccessControl
MIC MessageIntegrityCheck
MVP MinimumViableProduct
ProjectNº687607 WAZIUPD2.1
Page104
NB NarrowBand
NLOS NonLineofSight
OTTA OverTheAirActivation
PANID PersonalAreaNetworkID
PER PacketErrorRate
PHYlayer Physicallayer
QoS QualityofService
RESTAPI REpresentationalStateTransferAPI
RSSI ReceivedSignalStrengthIndicator
SF SpreadingFactor
SNR SignaltoNoiseRatio
SRD ShortRangeDevice
TTN TheThingNetwork
USB UniversalSerialBus
WiFi WirelessFidelity
ProjectNº687607 WAZIUPD2.1
Page105
PROJECTCO-ORDINATORCONTACT
Dr.AbdurRahim
CREATE-NET
ViaallaCascata56/D
Povo-38123Trento,Italy
Tel:(+39)0461408400
Fax:(+39)0461421157
Email:[email protected]
ProjectNº687607 WAZIUPD2.1
Page106
ACKNOWLEDGEMENT
ThisdocumenthasbeenproducedinthecontextoftheH2020WAZIUPproject.TheWAZIUPprojectconsortiumwouldliketoacknowledgethattheresearchleadingtotheseresultshasreceivedfundingfromtheEuropeanUnion’sH2020ResearchandInnovationProgramundertheGrantAgreementH2020-ICT-687607.