tailcall

tailcall

Including observer on rpi0 for nerves

I literally have just started my first nerves project and thought it would be nice to get the observer up and running on the node.

I have run ‘ssh -X nerves.local’ to get to the node and that takes me to the node with the X forwarding configured.

The observer doesn’t start as it is not recognised.
(UndefinedFunctionError) function :observer.start/0 is undefined (module :observer is not available)

Can this be included in my firmware? No obvious web searches have found a solution.

Most Liked

fhunleth

fhunleth

Co-author of Nerves

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.

First, ssh into the device and run the following:

iex> System.cmd("epmd", ["-daemon"])
{"", 0}
iex> Node.start(:"nerves@nerves.local")
{:ok, #PID<0.1160.0>}
iex(nerves@nerves.local)> Node.set_cookie(:my_secret_cookie)
true

Then on your laptop, start iex and :observer:

$ iex --name me@0.0.0.0 --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)
iex(me@0.0.0.0)1> :observer.start
:ok

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 (nerves@nerves.local or nerves@nerves-19d1.local or anything@an.ip.add.ress) 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.

Where Next?

Popular in Questions Top

lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
mgjohns61585
Could someone help me? I’m making my first elixir program, number guessing game. I can’t figure out how to convert the user’s guess from ...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: The documentation above suggests that while ...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New

Other popular topics Top

Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
Nvim
Anybody knows a comprehensive comparison of Django and Phoenix, thanks for the help. Where are they similar? Where do they differ the m...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31142 143
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New

We're in Beta

About us Mission Statement