Getting on to the Network
As previously mentioned, you’re already networking with your project but through a wired connection over the USB cable. Shelling into the Raspberry Pi and updating firmware both use this USB network. Let’s take a look at the configuration that makes USB networking possible. Open up sensor_hub/config/target.exs:
| config :vintage_net, |
| regulatory_domain: "US", |
| config: [ |
| {"usb0", %{type: VintageNetDirect}}, |
| {"eth0", |
| %{ |
| type: VintageNetEthernet, |
| ipv4: %{method: :dhcp} |
| }}, |
| {"wlan0", %{type: VintageNetWiFi}} |
| ] |
This config entry establishes the configuration for all of the networking needs related to your project. The line of interest in this case is {"usb0", %{type: Vintage ...
Get Build a Weather Station with Elixir and Nerves now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.