How to use Nerves.Utils.HTTPClient in RaspberryPi 3?

Hi,

I want to use an http client on the device, but I can’t figure out how to do it. It looks like :inets is not available when I connect to the device via ssh. Also I try to run Nerves.Utils.HTTPClient.start_link() but the module is not there, even though it’s on the nerves source code.

I’ve been looking in the documentation but I found nothing related to this. What am I missing?

Thanks!

1 Like

Nerves uses OTP releases when creating target images. This means that the Erlang runtime is trimmed down on the Raspberry Pi 3. To use :inets, include in your mix.exs's :extra_applications list. You probably have :logger and :runtime_tools in that list already.

The nerves project (the one that you found with Nerves.Utils.HTTPClient is only tooling. None of the code actually runs on the Raspberry Pi 3. It can get to :inets since it’s available from your laptop’s Erlang installation.

Oh, I understand thanks!

This is very helpful, I haven’t found this on the documentation.

I’m enjoying more and more with nerves :slight_smile: