Skip to content

TORIFUKUKaiou/temperature_and_humidity_nerves

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TemperatureAndHumidityNerves

TORIFUKUKaiou/hello_iot_cloudのPhoenix Webアプリと共に利用します. Nervesデバイス(Raspberry Pi)からGrove AHT20 I2Cの温湿度値を打ち上げます.

利用方法

  1. ./lib/temperature_and_humidity_nerves/worker.exの2行を変更してください.
    • ローカルPCにTORIFUKUKaiou/hello_iot_cloudを立ち上げている場合(IPアドレスは例)
      @url "http://192.168.1.2/values"
      @name "awesome"
      
    • 2021年11月30日までは,下記のURLで遊んでいただいて構いません.
      @url "https://nervesjp-dsf2021.japaneast.cloudapp.azure.com/values"
      @name "awesome"
      
  2. いつものようにNervesのビルドなり書き込みなりを行います.
    $ export MIX_TARGET=rpi3
    $ mix deps.get
    $ mix firmware
    ### SDカードに書き込みの場合
    $ mix burn 
    ### ネットワーク越しにアップデートの場合
    $ mix upload 
    
  3. Nerves IExで値が取れていることを確認してみてください.
    $ ssh nerves.local 
    Interactive Elixir (1.11.2) - press Ctrl+C to exit (type h() ENTER for help)
    Toolshed imported. Run h(Toolshed) for more info.
    RingLogger is collecting log messages from Elixir and Linux. To see the
    messages, either attach the current IEx session to the logger:
    
      RingLogger.attach
    
    or print the next messages in the log:
    
      RingLogger.next
    
    iex(1)> RingLogger.attach(level: :info)
    :ok
            
    03:57:47.536 [info]  {23.9, 56.7}
            
    03:57:48.535 [info]  {23.9, 56.7}
            
    03:57:49.535 [info]  {23.9, 56.7}
    
  4. Webページで打ち上がっていることが確認できます 🚀

Targets

Nerves applications produce images for hardware targets based on the MIX_TARGET environment variable. If MIX_TARGET is unset, mix builds an image that runs on the host (e.g., your laptop). This is useful for executing logic tests, running utilities, and debugging. Other targets are represented by a short name like rpi3 that maps to a Nerves system image for that platform. All of this logic is in the generated mix.exs and may be customized. For more information about targets see:

https://hexdocs.pm/nerves/targets.html#content

Getting Started

To start your Nerves app:

  • export MIX_TARGET=my_target or prefix every command with MIX_TARGET=my_target. For example, MIX_TARGET=rpi3
  • Install dependencies with mix deps.get
  • Create firmware with mix firmware
  • Burn to an SD card with mix firmware.burn

Learn more

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published