Mongoose OSとIFTTTでJavaScript IoT事始め / IoT with Mongoose OS and IFTTT

B074a109c8bed590e36ce7d053c0d683?s=47 shanonim
November 18, 2017

Mongoose OSとIFTTTでJavaScript IoT事始め / IoT with Mongoose OS and IFTTT

2017.11.18
秋のJavaScript祭 in mixi 2017
https://javascript-fes.doorkeeper.jp/events/66335

B074a109c8bed590e36ce7d053c0d683?s=128

shanonim

November 18, 2017
Tweet

Transcript

  1. ɹɹɹɹɹɹɹɹɹͱ ɹɹɹɹɹɹͰ +BWB4DSJQU*P5ࣄ࢝Ί TIBOPO !TIBOPOJN

  2. "CPVUNF TIBOPO !TIBOPOJN  "OESPJE ,PUMJO *P5

  3. ໿Ұ೥ৼΓͷࢀՃ

  4. None
  5. *P5ͷ࿩Λ͠·͢

  6. lϞϊͷΠϯλʔωοτʢ*OUFSOFUPG5IJOHTɺ*P5ʣ͸ɺ ҰҙʹࣝผՄೳͳʮ΋ͷʯ͕ΠϯλʔωοτΫϥ΢υʹ઀ଓ͞Εɺ ৘ใަ׵͢Δ͜ͱʹΑΓ૬ޓʹ੍ޚ͢Δ࢓૊ΈͰ͋Δɻz ग़యɿ8JLJQFEJBʢIUUQTKBXJLJQFEJBPSHXJLJϞϊͷΠϯλʔωοτʣ

  7. None
  8. 0, (PPHMFɺ ిؾΛ఺͚ͯɻ

  9. Ϟϊ͕Πϯλʔωοτʹ ܨ͕͍ͬͯͯɺ ࣗ༝ʹૢ࡞Ͱ͖Δ ˣ ศར

  10. *P5ͷΠϝʔδ ͋ΔͰΎ͍ͷ Βͣ΂Γʔͺ͍ ૊ΈࠐΈ $ݴޠ ϋʔυ΢ΣΞ ௿ϨΠϠʔ όζϫʔυ Α͘Θ͔Βͳ͍ Կ͔Β͢Ε͹

  11. ࠓ೔࿩͢͜ͱ ϑϩϯτΤϯυͷٕज़Λ࢖ͬͯ खܰʹೖ໳Ͱ͖Δ *P5ͷ޻࡞ྫ

  12. ࠓ೔࿩͢͜ͱ w ϋʔυ΢ΣΞ w ιϑτ΢ΣΞ w Πϯλʔωοτʹܨ͙ w ޻࡞ྫ w

    ·ͱΊ
  13. ࠓ೔࿩͢͜ͱ w ϋʔυ΢ΣΞ w ιϑτ΢ΣΞ w Πϯλʔωοτʹܨ͙ w ޻࡞ྫ w

    ·ͱΊ 5IJOHT *OUFSOFU
  14. ϋʔυ΢ΣΞ

  15. &41Sš%FWFMPQFS ແઢ௨৴Ϟδϡʔϧ ʢ8J'J #MVFUPPUIʣΛ ౥ࡌͨ͠։ൃϘʔυ

  16. None
  17. &41Sš%FWFMPQFS༻(307&γʔϧυ &41S%FWFMPQFSͰ (307&γεςϜͷσόΠεΛ ࢖͏ͨΊͷγʔϧυ

  18. (SPWF4ZTUFN TFFFETUVEJP͕։ൃ͍ͯ͠Δ ͚ࠩͩ͢Ͱѻ͑Δηϯαʔ

  19. ։ൃϘʔυ ηϯαʔ

  20. None
  21. None
  22. ιϑτ΢ΣΞ

  23. "O0QFSBUJOH4ZTUFNGPSDPNNFSDJBMDPOOFDUFE QSPEVDUT 4VQQPSUFENJDSPDPOUSPMMFST$$ $$  &41 &41

  24. 8SJUF

  25. .POHPPTF04ͷॻ͖ࠐΈ curl -fsSL https://mongoose-os.com/downloads/mos/install.sh | /bin/bash ~/.mos/bin/mos --help ~/.mos/bin/mos %PDVNFOUIUUQTNPOHPPTFPTDPNTPGUXBSFIUNM

  26. None
  27. None
  28. None
  29. None
  30. %FNP d.POHPPTF04ͷΤσΟλը໘ىಈd

  31. ίʔσΟϯά ϒϥ΢βͷΤσ Ολը໘Ͱίʔσ Οϯά

  32. ίʔσΟϯά ʲ4BWF 3FCPPUʳͰσϓϩΠ

  33. %FNP dιʔείʔυͷσϓϩΠd

  34. %FNP (SPWF#VUUPO $MJDL͢Δͱl$MJDLFEz͕ग़ྗ͞ΕΔ

  35. ࠓ೔࿩͢͜ͱ w ϋʔυ΢ΣΞ w ιϑτ΢ΣΞ w Πϯλʔωοτʹܨ͙ w ޻࡞ྫ w

    ·ͱΊ 5IJOHT *OUFSOFU
  36. Πϯλʔωοτʹܨ͙

  37. None
  38. None
  39. None
  40. load('api_config.js'); load('api_http.js'); load('api_gpio.js'); load('api_timer.js'); let button = 25; GPIO.set_button_handler(button, GPIO.PULL_UP,

    GPIO.INT_EDGE_NEG, 200, function() { print("clicked!"); HTTP.query({ url: 'https://maker.ifttt.com/trigger/esp32/with/key/{your-key}', headers: { }, data: { event: 'esp32', message: 'clicked!', timestamp: Timer.now() }, success: function(body, full_http_msg) { print(body); }, error: function(err) { print(err); }, }); }, null);
  41. %FNP d.POHPPTF04Ͱ*'5558FCIPPLTΛ ୟ͍ͯ1VTI௨஌ 1VTI#VMMFU Λड͚औΔd

  42. DBMM8FCIPPLT63- DBMM&WFOU

  43. ΞΠσΟΞྫ 1*3ηϯαʔʷ ˠࣗಈͰর໌Λ఺౮ফ౮ ߱Ӎηϯαʔʷ ˠӍ͕߱ͬͨΒ4MBDLϝϯγϣϯ Ξϧίʔϧηϯαʔʷ ˠҿΈա͗ΛπΠʔτʢʁ

  44. ·ͱΊ

  45. ·ͱΊ w ϋʔυ΢ΣΞͷηοτΞοϓɹˠ։ൃϘʔυΛ࢖͏ w ιϑτ΢ΣΞͷηοτΞοϓɹˠ*P5ಛԽܕ04ʹ೚ͤΔ w 4%,ͷηοτΞοϓɹˠ*'555

  46. خ͍͜͠ͱ ։ൃ؀ڥͷηοτΞοϓͱ ίʔσΟϯάΛ࠷খݶʹͯ͠ ΞΠσΟΞʹूதͰ͖Δ

  47. ·ͱΊ w +BWB4DSJQU*P5͸ϓϩτλΠϐϯάʹ࠷ద w ηϧϑ*P5Ͱੜ׆Λศརʹ͍ͯ͜͠͏

  48. )BQQZ*P5JOH