Flutterでもシリアルコンソール通信 できるもん!
by
Ryotaro Onoue
Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
2023.9.29 FlutterͰγϦΞϧίϯιʔϧ௨৴ Ͱ͖ΔΜ! YUMEMI Inc. Flutter Engineer - Onoue Ryotaro YOUTRUST × ΏΊΈ Flutter LTձ@ौ୩ #3
Slide 2
Slide 2 text
0. whoami
Slide 3
Slide 3 text
1. Today’s topic γϦΞϧίϯιʔϧ௨৴ × Flutter
Slide 4
Slide 4 text
γϦΞϧ .. . ? ίϯιʔϧ…? 1-1. γϦΞϧίϯιʔϧͬͯͳΜͧ?
Slide 5
Slide 5 text
γϦΞϧ .. . ? ίϯιʔϧ…? 1-1. γϦΞϧίϯιʔϧͬͯͳΜͧ?
Slide 6
Slide 6 text
γϦΞϧ .. . ? ίϯιʔϧ…? 1-1. γϦΞϧίϯιʔϧͬͯͳΜͧ?
Slide 7
Slide 7 text
γϦΞϧ .. . ? ίϯιʔϧ…? 1-1. γϦΞϧίϯιʔϧͬͯͳΜͧ? 71/ϧʔλͱεΠον
Slide 8
Slide 8 text
γϦΞϧ .. . ? ίϯιʔϧ…? 1-1. γϦΞϧίϯιʔϧͬͯͳΜͧ? Oracle Cloud Infrastructure ͷ Compute InstanceʹγϦΞϧίϯιʔϧଓ
Slide 9
Slide 9 text
γϦΞϧ .. . ? ίϯιʔϧ…? 1-1. γϦΞϧίϯιʔϧͬͯͳΜͧ? 0SBDMF$MPVE*OGSBTUSVDUVSFͷ $PNQVUF*OTUBODFʹγϦΞϧίϯιʔϧଓ
Slide 10
Slide 10 text
γϦΞϧ .. . ? ίϯιʔϧ…? 1-1. γϦΞϧίϯιʔϧ௨৴ͬͯͳΜͧ? - γϦΞϧίϯιʔϧ / γϦΞϧϙʔτͱ? 1ʹ1bitͣͭσʔλΛૹड৴͢ΔΠϯλʔϑΣʔεύϥϨϧଓ σΟεϓϨΠϚεͷೖग़ྗΠϯλʔϑΣʔεΛ࣋ͨͳ͍αʔό ΈࠐΈγεςϜʹଓ͢Δͷʹར༻͞Ε͍ͯΔ
Slide 11
Slide 11 text
CO2ηϯαʔ UD-CO2S 1-2. ۩ମతͳσόΠε
Slide 12
Slide 12 text
EQIS-1 1-2. ۩ମతͳσόΠε
Slide 13
Slide 13 text
Ճηϯαʔ EQIS-1 1-2. ۩ମతͳσόΠε (ࠨ): https: // quake.one/sense/ ΑΓ
Slide 14
Slide 14 text
GNSSड৴ػ 1-2. ۩ମతͳσόΠε https: / / prioris.jp/gnss/
Slide 15
Slide 15 text
2. FlutterͰγϦΞϧίϯιʔϧ ωΠςΟϒ͡Ό
Slide 16
Slide 16 text
ԿΛ࡞͍͖͍͔ͬͯͨ 2-0. ඪ - ֓ཁ - CO2ηϯαʔͷΛදࣔɾάϥϑදࣔ - ൚༻ੑͷߴ͍γϦΞϧίϯιʔϧؔ࿈ΫϥεΛ࡞Δ - ϓϥοτϑΥʔϜ - Android, macOS, Linux - iOSOSͷ੍্ݫ͍͠ - ঢ়ଶཧ - riverpod, flutter_hooks
Slide 17
Slide 17 text
Flutterͷ֎ͷੈքΞΫηε 2-1. ϓϥάΠϯௐࠪ
Slide 18
Slide 18 text
Flutterͷ֎ͷੈքΞΫηε 2-1. ϓϥάΠϯௐࠪ AndroidͰ࣮ߦ͢ΔͱɺݖݶෆͰౖΒΕΔ - > ΘΓʹusb_serial pluginΛ͏͜ͱͰճආͰ͖Δ IUUQTHJUIVCDPNKQOVSNJ fl VUUFS@MJCTFSJBMQPSUJTTVFT IUUQTHJUIVCDPNKQOVSNJ fl VUUFS@MJCTFSJBMQPSUJTTVFT
Slide 19
Slide 19 text
Android ͱ ͦΕҎ֎Ͱར༻͢ΔϓϥάΠϯΛ͚Δ 2-2. ϓϥάΠϯ͚Δ࡞ઓ Android ↑ macOS, Linux, Windows ↑
Slide 20
Slide 20 text
Android ͱ ͦΕҎ֎Ͱར༻͢ΔϓϥάΠϯΛ͚Δ 2-2. ϓϥάΠϯ͚Δ࡞ઓ
Slide 21
Slide 21 text
Android ͱ ͦΕҎ֎Ͱར༻͢ΔϓϥάΠϯΛ͚Δ 2-2. ϓϥάΠϯ͚Δ࡞ઓ usb_serial (Android)
Slide 22
Slide 22 text
Android ͱ ͦΕҎ֎Ͱར༻͢ΔϓϥάΠϯΛ͚Δ 2-2. ϓϥάΠϯ͚Δ࡞ઓ flutter_libserialport (AndroidҎ֎)
Slide 23
Slide 23 text
Android ͱ ͦΕҎ֎Ͱར༻͢ΔϓϥάΠϯΛ͚Δ 2-2. ϓϥάΠϯ͚Δ࡞ઓ Android͔Ͳ͏͔ΛνΣοΫ࣮ͯ͠ΛΓସ͑Δ 👍: ࣮࣌ʹϓϥοτϑΥʔϜͷੈքͷ͜ͱΛߟ͑ͳͯ͘OK!
Slide 24
Slide 24 text
ڞ௨Խͨ͠SerialConsoleProviderΛୟ͘ 2-3. දࣔ·Ͱͷ࣮ ը໘ߏ - σόΠεબը໘ (deviceSelectorPage) - ηϯαʔͷใΛදࣔ͢Δը໘ (monitoringPage)
Slide 25
Slide 25 text
RiverpodͰΰγΰγ͢Δ 2-3-1. σόΠεબը໘ serialConsoleDeviceΛҰཡ͢ΔFutureProviderΛ࡞ͬͯ͋͛ͯ switchࣜ(ύλʔϯϚονϯά)Ͱ [σόΠεແ͠ɾσόΠεҰཡɾ ಡΈࠐΈதɾΤϥʔ]ঢ়ଶͰग़͚͠
Slide 26
Slide 26 text
RiverpodͰΰγΰγ͢Δ 2-3-1. σόΠεબը໘ σόΠεҰཡͰListTileΛදࣔͯ͠ λοϓ͞ΕͨΒ MonitoringPage ભҠ
Slide 27
Slide 27 text
RiverpodͰΰγΰγ͢Δ 2-3-2. ϞχλϦϯάը໘ CO2SensorProvider: ଌఆͷอ࣋ɾ։࢝ॲཧ ʮCO2=489,HUM=46.4,TMP=28.6ʯͰྲྀΕͯ͘Δଌఆͷύʔε
Slide 28
Slide 28 text
RiverpodͰΰγΰγ͢Δ 2-3-2. ϞχλϦϯάը໘ CO2SensorProvider: ଌఆͷอ࣋ɾ։࢝ॲཧ ʮCO2=489,HUM=46.4,TMP=28.6ʯͰྲྀΕͯ͘Δଌఆͷύʔε
Slide 29
Slide 29 text
< - Starbucks ԣͦ͝͏ళ ࠓ͜͜·ͰདྷΔ·Ͱͷిं(ΓΜ͔͍ઢ) ↓
Slide 30
Slide 30 text
3. Live Demo PixelͰಈ͔ͯ͠Έ·͢ʙ
Slide 31
Slide 31 text
FlutterͰγϦΞϧίϯιʔϧ௨৴Ͱ͖ΔΜ! 4. ·ͱΊ ͱ Φν - Flutter͔ͩΒωΠςΟϒ৮Δػೳ͑ͳ͍ΜͰ͠ΐ? - > ͍͍͑ Plugin͕͋Γ·͢ (વྫ֎͋Γ·͕͢) - γϦΞϧίϯιʔϧ௨৴ͰཧతͳσόΠεͱଓͯ͠ ใΛૹड৴͢Δ͜ͱ͕Ͱ͖Δ - ࠓޙ ՃηϯαʔGNSSड৴ػͷApp࡞͍ͬͯͭ͘ΓͰ͢
Slide 32
Slide 32 text
FlutterͰγϦΞϧίϯιʔϧ௨৴Ͱ͖ΔΜ! - Flutter͔ͩΒωΠςΟϒ৮Δػೳ͑ͳ͍ΜͰ͠ΐ? - > ͍͍͑ Plugin͕͋Γ·͢ (વྫ֎͋Γ·͕͢) - γϦΞϧίϯιʔϧ௨৴ͰཧతͳσόΠεͱଓͯ͠ ใΛૹड৴͢Δ͜ͱ͕Ͱ͖Δ - ࠓޙ ՃηϯαʔGNSSड৴ػͷApp࡞͍ͬͯͭ͘ΓͰ͢ 4. ·ͱΊ ͱ Φν pub.devʹग़͍ͯͳ͍͚ͩͰ ίʔυ ͢ͰʹରԠ͞Εͯͨ!!!
Slide 33
Slide 33 text
FlutterͰγϦΞϧίϯιʔϧ௨৴Ͱ͖ΔΜ! 4. ·ͱΊ ͱ Φν - Flutter͔ͩΒωΠςΟϒ৮Δػೳ͑ͳ͍ΜͰ͠ΐ? - > ͍͍͑ Plugin͕͋Γ·͢ (વྫ֎͋Γ·͕͢) - γϦΞϧίϯιʔϧ௨৴ͰཧతͳσόΠεͱଓͯ͠ ใΛૹड৴͢Δ͜ͱ͕Ͱ͖Δ - ࠓޙ ՃηϯαʔGNSSड৴ػͷApp࡞͍ͬͯͭ͘ΓͰ͢ - IssueͪΌΜͱಡΈ·͠ΐ͏ - ਂͰஅྗ͕Լ͍ͯ͠Δͱ͖ʹॏཁͳஅΛ͠ͳ͍ํ͕ྑ͍
Slide 34
Slide 34 text
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠! ࣭ɾؾʹͳΔ͜ͱ͕͋Ε ͍ͭͰ࿈བྷ͍ͩ͘͞! Follow me on X: @YumNumm https: / / github.com/YumNumm/CO2SensorViewer