Observer uses a GUI framework called Wx, and Wx doesn’t crosscompile. That means it’s unavailable for use on a Nerves device.
The good news is that Observer also works via Erlang distribution. This is a better way in almost all respects since the GUI runs directly on your laptop. Erlang distribution isn’t started by default. There are many ways of doing this, but I think the one described in the
nerves_pack docs is good for one-off uses.
ssh into the device and run the following:
iex> System.cmd("epmd", ["-daemon"])
Then on your laptop, start
$ iex --name email@example.com --cookie my_secret_cookie
Erlang/OTP 23 [erts-11.0.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]
Interactive Elixir (1.10.3) - press Ctrl+C to exit (type h() ENTER for help)
You should see an Observer window. Go to the Nodes menu, then Connect Node. Connect to
nerves.local. If all goes well, you should see the CPU count and “compiled for” change change. Observer is now getting all of its data from the device.
A note on
nerves.local: This is one of the mDNS names that Nerves devices advertise by default. If you type
hostname on the device or explore the network with an mDNS browser, you can see the other one. On my device, it’s
nerves-19d1.local. If you have multiple Nerves devices, you can no longer use
nerves.local. Some people have trouble with mDNS and use IP addresses for Erlang distribution. The key is to make sure that the name that you use on the device (
firstname.lastname@example.org) matches what you use in the Observer UI since if you don’t, you’ll get an error (probably a pang) and it might not be obvious what to do.