Upgrade to Pro — share decks privately, control downloads, hide ads and more …

TTNの使いかた

 TTNの使いかた

0816ab548e6a8fb81f01c8f8790f63a9?s=128

Yoshihiro TSUBOI

July 10, 2020
Tweet

Transcript

  1. 55/ͷ࢖͍͔ͨ 4FFFE :PTIJIJSP546#0*

  2. ࣗݾ঺հ 2 2009 2010-2015 2015-2018 2016 2017 2018 ௶Ҫٛߒ ͭ΅͍Α͠ͻΖ

    !ZUTVCPJ 4FFFEͷϓϩμΫτ୲౰71ɺ೔ຊ๏ਓ୅ද ֎ࢿܥ೥ੜɻ ωοτϫʔΫʹܨ͕ΔϚΠίϯɺ ։ൃϘʔυΛ࡞Δͷ͕޷͖ͳ.BLFS ͋Μ·ΞϓϦέʔγϣϯʹڵຯແ͍Ͱ͢ɻ
  3. (SPWFTFSJFT 3 300+

  4. 4         

                          
  5. ͳ͓ɺ೔ຊ޲͚-P3B8"/੡඼͸ ͋Γ·ͤΜɻPS[ 5

  6. -P3B8"/ͷΊΜͲ͍ͱ͜Ζ w ٕదϚʔΫ෇͍ͯΔσόΠε͕গͳ͍ w ௿ϨΠϠΛ͍͡ΕΔ w ()[ΑΓ໘౗͍͘͞ w 4VC()[ʹ͖ͭɺ֤ࠃͰप೾਺ଳ͕ҧ͏ ೔ຊʜ.)[ˠ"4

    +1 w .)[ͳΒ޷͖ʹ࢖͑ΔΘ͚Ͱͳ͍ "3*#45%5 6
  7. ೔ຊͰ໔ڐແ͠Ͱ࢖͑Δप೾਺ଳ 7 w31-P3B8"/3FHJPOBM1BSBNFUFST IUUQTMPSBBMMJBODFPSHSFTPVSDFIVCSQMPSBXBOSSFHJPOBMQBSBNFUFST wి೾๏ࢪߦنଇୈ࿡৚ୈ࢛߲ୈೋ߸ͷنఆʹجͮ͘ಛఆখిྗແઢہͷ༻్ɺి೾ͷܕࣜٴ ͼप೾਺ฒͼʹۭதઢిྗ IUUQTXXXUFMFTPVNVHPKQIPSFJSFJLJ@IPOCVOBIUNM w"3*#45%5 IUUQTXXXBSJCPSKQLJLBLVLJLBLV@UVTIJOTUEUIUNM ˞؆қແઢہ͸໔ڐ͸ෆཁͰ͕͢ɺొ࿥͕ඞཁͰ͢ɻ

  8. ΩϟϦΞηϯεɺ-#5 -JTUFO#FGPSF5BML 8 ग़య: https://www.tele.soumu.go.jp/horei/reiki_honbun/a720085001.html ग़య: ARIB STD-T108 Version 1.3

    (English translation) ͭ·Γɺి೾ਧ͘લʹNTҎ্୭͔ ଞͷਓ͕஻͍ͬͯͳ͍͔ฉ͘͜ͱɻ ୭΋࿩͍ͯ͠ͳ͍৔߹͸ඵҎ಺ ΋͘͠͸NTҎ಺ ͳΒి೾ਧ͚Δɻ ࿩ִؒ͢͸NTҎ্ ΋͘͠͸ਧ͍ͨ ࣌ؒͷഒ ۭ͚Δ͜ͱɻ
  9. -P3B8"/ͷجૅ஌ࣝ 9 σόΠε ήʔτ΢ΣΠ ωοτϫʔΫαʔόʔ IP packet_forwarder IP ΞϓϦέʔγϣϯ Class

    A $MBTT#͸(8͔Βͷड৴Λ͖͔͚ͬʹ ௨৴Λߦ͏ํࣜɻ $MBTT$͸ৗʹσόΠεͷड৴ػͷ ిݯΛೖΕ͓ͯ͘ํࣜɻ AppSKey NwkSKey AES Encryption ग़య: https://www.thethingsnetwork.org/docs/lorawan/classes.html AppEUI DeviceEUI Gateway ID AppKey ηογϣϯ伴Λ௨৴Ͱަ׵͢Δͷ͕ɺ 05"" 0WFSUIFBJSBDUJWBUJPO  σόΠεʹ༧Ίॻ͍͓ͯ͘ͷ͕ɺ "#1 "DUJWBUJPO#Z1FSTPOBMJ[BUJPO
  10. -P3B8"/ͷωοτϫʔΫαʔόʔ 10 IUUQTHJUIVCDPNHPUUIBSEQMPSBXBOTFSWFS &SMBOHͰॻ͔Ε͍ͯΔɻ IUUQTHJUIVCDPNCSPDBBSDIJSQTUBDLOFUXPSLTFSWFS (PͰॻ͔Ε͍ͯΔɻ ΦϯϓϨϛε IUUQTHJUIVCDPN5IF5IJOHT/FUXPSLMPSBXBOTUBDL (PͰॻ͔Ε͍ͯΔɻ Ϋϥ΢υ

    IUUQTXXXUIFUIJOHTOFUXPSLPSH ͨͿΜ࠷େखɻ'0/Έ͍ͨʹ(8Λڞ༗ɻ IUUQTXXXUIFUIJOHTJOEVTUSJFTDPN 55/ͷ঎༻൛ɻ IUUQTXXXMPSJPUJP (8 %FWJDF·Ͱͷແঈϓϥϯ͕͋Δɻ
  11. ήʔτ΢ΣΠͷҰྫ 11 %SBHJOP-P3B(14)"5+1 34ίϯϙʔωϯπ=  DIHBUFXBZ ηοτΞοϓํ๏ %SBHJOP-14+1 %SBHJOPμΠϨΫτγϣοϓ= 

    DIHBUFXBZ ೔ຊޠϚχϡΞϧ
  12. %SBHJOP-P3B(14)"5+1 12 ൺֱత͍҆͠3BTQCFSSZ1J͕׆༻Ͱ͖Δʂ ͨͩ͠ɺDI(BUFXBZ ग़య: RP2-1.0.1 LoRaWAN Regional Parameters Ͱ΋"4తʹ͸ɺ࠷௿DI͸ཁΔͬΆ͍ɻ

    %SBHJOP-P3B(14)"5+1 34ίϯϙʔωϯπ=  DIHBUFXBZ ηοτΞοϓํ๏
  13. ͔ͩΒ-14+1 13 %SBHJOP-14+1 %SBHJOPμΠϨΫτγϣοϓ=  DIHBUFXBZ ೔ຊޠϚχϡΞϧ

  14. ηοτΞοϓํ๏ 14 64#͔ΒڅిΛͯ͠ɺ " 8J'J"1 44*%ESBHJOPYYYYYY ཱ͕͍ͬͯΔ ͷͰ8J'JͰ઀ଓͯ͠ɺʹϒϥ΢βͰ ΞΫηεɻ #

    ΠʔαωοτͰ઀ଓͯ͠ɺׂΓ౰ͯ͞Εͨ*1 ʹϒϥ΢βͰΞΫηεɻ
  15. ๻͸8J'J࢖Θͳ͍ͷͰɺ 15 8J'JΠϯλʔϑΣʔεΛ࡟আͯ͠མͱ͠·ͨ͠ɻ ύεϫʔυͷແ͍"1Λ࢒ͨ͘͠ͳ͔ͬͨͷͰ͢ɻʣ

  16. -P3B8"/ͷઃఆ͸͜͜ 16 ·ͣɺ(BUFXBZ*%Λ͜͜Ͱೖख͠·͢ɻ

  17. ࣍ʹ55/ͷ$POTPMFˠ(BUFXBZT΁ 17

  18. 55/΁ͷ(8ͷొ࿥  18 ·ͣɺMFHBDZQBDLFUGPSXBSEFSΛબͼ·͢ɻ ͑ɺMFHBDZ࢖͏ͷʁͱ͍͏ٙ໰΁ͷճ౴͸ ޙ΄Ͳɻ  ࣍ʹɺઌ΄Ͳ-14ͷ8FCίϯιʔϧͰݟͨ (BUFXBZ*%(BUFXBZ&6*Λೖྗ͠·͢ɻ ద౰ʹ%FTDSJQUJPOΛೖྗ͠ɺ

    'SFRVFODZ1MBOʹɺ"TJB.)[Λ બ୒͠·͢ɻ͜͜େࣄɻ 3PVUFS͸ɺUUOSPVUFSBTJBTFΛબͼ·͠ΐ͏ɻ
  19. ͳΜͰ-FHBDZ 19

  20. 55/΁ͷ(8ͷొ࿥  20 ͋ͱ͸ɺ(8Λஔ͍ͨ৔ॴͱɺΞϯςφ͕԰಺͔ ԰֎ʹ͋Δ͔Λબ୒͢Δ͚ͩͰ͢ɻ

  21. -14ଆͷઃఆ 21 4FSWJDFͱͯ͠-P3B8"/3"8GPSXBSEFSΛબͼɺ 4FSWJDF1SPWJEFSʹ55/Λɺ 4FSWFS͸ɺઌ΄Ͳ55/ίϯιʔϧͰબΜͩ UUOSPVUFSBTJBTFΛબ୒ɻ ࠷ޙʹ'SFRVFODZ1MBOͱͯ͠ɺ "TJB.)[Š"4 ͜ΕΒΛઃఆ͠·͢ɻ

  22. 55/ίϯιʔϧͰ઀ଓͷ֬ೝ 22

  23. ஍ਤʹ΋ग़Δ͸ͣɻ 23 ਺෼ʙ਺े෼ܦͭͱɺ஍ਤʹ͋ͳͨͷ ήʔτ΢ΣΠ͕ϓϩοτ͞ΕΔ͸ͣͰ͢ɻ $POOFDUFEʹͳ͍ͬͯΔ͠ɺ໊ݹ԰ࢢͳΜ͚ͩͲ ͜͜ʹϓϩοτ͞Εͳ͍ͱ͖͸࿈བྷԼ͍͞ɻ ໊ݹ԰ͷΤϦΞ಺ͱͯ͠ೝࣝ͞Ε͍ͯͳ͍͔΋ɻ ͳ͓ɺ౎ࢢ෦Ͱ͜ͷബ͍੨ͷԁ΄ͲͷΧόϨοδ ͸࣮ࡍʹ͸͋Γ·ͤΜɻ

  24. 2" 24

  25. ٳܜ 25

  26. σόΠε༻ͷϘʔυ 26 #-;-38"/ νοϓϫϯετοϓ=  $4ͰങͬͨΒɺ ٕదϚʔΫ෇͍ͯ·ͨ͠ɻ ϑΝʔϜ΢ΣΞɿ*$6#&-38"/ʢ೔ຊରԠ൛ʣ IUUQTXXXTUNDVKQEFTJHOTX@EFWpSNXBSF ͪ͜Βʹ೔ຊ޲͚ͷमਖ਼͕ೖͬͨαϯϓϧίʔυɻ

  27. *$6#&-38"/ʢ೔ຊରԠ൛ʣ 27 #ifdef REGION_AS923_JAPAN if( ( freq < 920600000 )

    || ( freq > 923400000 ) ) { DBG_PRINTF("\tChannel ** CANNOT BE ADDED ** in Japan: Freq %d Hz is outside channels 24~38\n\r", freq); return false; // Japan region channels used are 24~38 (Center Freq: 920.6 MHz to 923.4 MHz @ 200 kHz max BW each) // Note: We do not use Japan channel plan for 33~61 due to unavailability of channel-by- channel controls for LBT, TX time, Pause time and Duty cycle in this stack. } #else if( ( freq < 915000000 ) || ( freq > 928000000 ) ) { return false; } #endif REGION_AS923_JAPANϚΫϩͰ೔ຊରԠͷઃఆ͕ೖΔΑ͏ʹͳ͍ͬͯΔɻ
  28. *$6#&-38"/ʢ೔ຊରԠ൛ʣ 28 /*! * Default Max EIRP */ #ifdef REGION_AS923_JAPAN

    #define AS923_DEFAULT_MAX_EIRP 13.0f #else #define AS923_DEFAULT_MAX_EIRP 16.0f #endif EIRP΋20mW==13dBmʹઃఆ͍ͯ͠Δɻ
  29. *$6#&-38"/ʢ೔ຊରԠ൛ʣ 29 /*! * Maximal datarate that can be used

    by the node */ #ifdef REGION_AS923_JAPAN #define AS923_TX_MAX_DATARATE DR_5 #else #define AS923_TX_MAX_DATARATE DR_7 #endif /*! * Maximal datarate that can be used by the node */ #ifdef REGION_AS923_JAPAN #define AS923_RX_MAX_DATARATE DR_5 #else #define AS923_RX_MAX_DATARATE DR_7 #endif ग़య: RP2-1.0.1 LoRaWAN Regional Parameters ઌड़ͷͱ͓Γɺ೔ຊͰ͸200 kHzͰChΛ۠੾͍ͬͯΔͷͰɺଳҬ250 kHzͷDR_6͸࢖Θͳ͍༷ʹ͍ͯ͠Δɻ
  30. ೔ຊ޲͚ͷίʔυ 30 ϑΝʔϜ΢ΣΞɿ*$6#&-38"/ ʢ೔ຊରԠ൛ʣ IUUQTXXXTUNDVKQEFTJHO TX@EFWpSNXBSF ೔ຊ޲͚ͷमਖ਼͕ೖͬͨαϯϓϧ ίʔυɻ

  31. 55/ΞϓϦέʔγϣϯͷొ࿥ 31

  32. 55/"QQMJDBUJPOͷ௥Ճ͸؆୯ 32 *%ͱઆ໌Λೖྗ͢Δ͚ͩɻ &6*͸55/͕ൃߦͯ͘͠Ε·͢ɻ )BOEMFS͸ɺUUOIBOEMFSBTJBTFͰ ͋Δ͜ͱΛ֬ೝ͠·͠ΐ͏ɻ

  33. 55/"QQ௥Ճ׬ྃ 33 ˡ"QQ&6*͕ൃߦ͞Ε͍ͯ·͢ɻ ͔͜͜Βɺ"QQʹඥ෇͚ΔσόΠεͷొ࿥Λ ߦ͍·͢ɻ ˡ(8ಉ༷ɺෳ਺ͷΞΧ΢ϯτͰ؅ཧ͕Ͱ͖·͢ɻ

  34. -P3B8"/ͷجૅ஌ࣝ 34 σόΠε ήʔτ΢ΣΠ ωοτϫʔΫαʔόʔ IP IP ΞϓϦέʔγϣϯ AppEUI DeviceEUI

    Gateway ID AppKey
  35. 55/σόΠεͷొ࿥ 35 ˡద౰ͳ໊લΛ͚ͭΔ ˡσόΠεʹ෇͍͍ͯΕ͹ɺͦΕΛɻ ෇͍͍ͯͳ͚Ε͹ɺࠨͷΞΠίϯΛΫϦοΫɻ

  36. 55/σόΠεͷొ࿥׬ྃ 36

  37. -P3B8"/ͷجૅ஌ࣝ 37 σόΠε ήʔτ΢ΣΠ ωοτϫʔΫαʔόʔ IP IP ΞϓϦέʔγϣϯ AppSKey NwkSKey

    AES Encryption AppEUI DeviceEUI Gateway ID AppKey ηογϣϯ伴Λ௨৴Ͱަ׵͢Δͷ͕ɺ 05"" 0WFSUIFBJSBDUJWBUJPO  σόΠεʹ༧Ίॻ͍͓ͯ͘ͷ͕ɺ "#1 "DUJWBUJPO#Z1FSTPOBMJ[BUJPO
  38. %FW&6* 38 https://www.murata.com/en-us/support/faqs/products/lpwa/lora/software/0001

  39. %FW&6* 39 https://lora-developers.semtech.com/library/tech-papers-and-guides/the-book/deveui/

  40. 06* 40

  41. .%,"3.ΛखʹೖΕΑ͏ 41 .%,GPS45.' 45.( BOE45.-*OTUBMMBUJPO"DUJWBUJPO IUUQXXXLFJMDPNTUNJDSPFMFDUSPOJDTTUNNEL ্ه$PSUFY.. ίΞͷ45.ϚΠίϯͰ͋Ε͹ɺόΠφϦ,#্ݶ ͳ͕Β΋ແঈͰ"SNͷ঎༻ίϯύΠϥ͕࢖͑·͢ɻ ͋ͱɺ45-JOL6UJMJUZ΋ɻ

  42. ϓϩδΣΫτΛ։͘ 42 I-CUBE-LRWAN v1.1.1-AS923-JP-v3¥Projects¥Multi¥Applications¥LoRa¥End_Node¥MDK-ARM¥B-L072Z-LRWAN1

  43. .%,"3.ʹඞཁͳ1BDLΛΠϯετʔϧ 43

  44. &6*Λιʔεʹॻ͘ 44

  45. ಈ͍ͨʂ 45

  46. ήʔτ΢ΣΠͰ΋֬ೝͰ͖·͢ 46

  47. .CFE04Ͱ-P3B8"/ͯ͠ΈΔ 47 $ mbed import mbed-os-example-lorawan $ cd mbed-os-example-lorawan $

    mbed target DISCO_L072CZ_LRWAN1 $ vi mbed_app.json "lora.phy": "JP920", "lora.device-eui": "{ YOUR_DEVICE_EUI }", "lora.application-eui": "{ YOUR_APPLICATION_EUI }", "lora.application-key": "{ YOUR_APPLICATION_KEY }" มߋՕॴ $ mbed toolchain ARM $ mbed compile $ cp ./BUILD/DISCO_L072CZ_LRWAN1/ARM/mbed-os-example-lorawan.bin /Volumes/DIS_L072Z ೔ຊ޲͚ͷύον࡞Γ·ͨ͠ͷͰɺίʔυ੔ཧͯ͠13ग़͠·͢ɻ
  48. ŘŠƄŘŦ 48

  49. ŘŠƄŘŦ  49

  50. ΞϓϦέʔγϣϯ 50

  51. 5XJUUFS͸͡Ί·ͨ͠ 51 @TTN_Nagoya