TORIFUKUKaiou/hello_iot_cloudのPhoenix Webアプリと共に利用します. Nervesデバイス(Raspberry Pi)からGrove AHT20 I2Cの温湿度値を打ち上げます.
- ./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"
- ローカルPCにTORIFUKUKaiou/hello_iot_cloudを立ち上げている場合(IPアドレスは例)
- いつものようにNervesのビルドなり書き込みなりを行います.
$ export MIX_TARGET=rpi3 $ mix deps.get $ mix firmware ### SDカードに書き込みの場合 $ mix burn ### ネットワーク越しにアップデートの場合 $ mix upload
- 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}
- Webページで打ち上がっていることが確認できます 🚀
- ローカルPCにTORIFUKUKaiou/hello_iot_cloudを立ち上げている場合(IPアドレスは例)
http://192.168.1.2/temperature-chart - 2021年11月30日までは,下記で打ち上げ結果を確認できます.
https://nervesjp-dsf2021.japaneast.cloudapp.azure.com/temperature-chart
- ローカルPCにTORIFUKUKaiou/hello_iot_cloudを立ち上げている場合(IPアドレスは例)
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
To start your Nerves app:
export MIX_TARGET=my_target
or prefix every command withMIX_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
- Official docs: https://hexdocs.pm/nerves/getting-started.html
- Official website: https://nerves-project.org/
- Forum: https://elixirforum.com/c/nerves-forum
- Discussion Slack elixir-lang #nerves (Invite)
- Source: https://github.com/nerves-project/nerves