gman

gman

Build a Weather Station with Elixir and Nerves: %Mint.TransportError connecting from Pi to Phoenix on host

Hi All,

I’ve followed pretty much all of the book so have most of the pieces in place. Really enjoyed it so far!

Running on a rpi4. Using wifi to talk to the rpi4. I can ssh onto and download firmware to the rpi4 no problem. I can’t seem to get measurements off the rpi4 though.

From the log I get this message every 10s when the rpi4 tries to publish the measurements to the Phoenix server on my host machine:

23:31:03.506 [debug] Server response: {:error, %Mint.TransportError{reason: :econnrefused}}

My host machine is Windows 11, with WSL2 running ubuntu. On this machine I start phx.server logs:


graham@DESKTOP-Q3UO4M4:~/weather_tracker$ mix phx.server
warning: use Mix.Config is deprecated. Use the Config module instead
config/config.exs:8

warning: use Mix.Config is deprecated. Use the Config module instead
config/dev.exs:1

[info] Running WeatherTrackerWeb.Endpoint with cowboy 2.9.0 at 0.0.0.0:4000 (http)
[info] Access WeatherTrackerWeb.Endpoint at http://localhost:4000

I’ve set up the http://localhost:4000 in mu config/target/exs as:

config :sensor_hub, :weather_tracker_url,
http://localhost:4000/api/weather-conditions

So I think I have all that correct. But I receive no measurements. When I go on to the rpi4 I only see the messages wit the TransportError.

It feels like a network config problem but I’m new to nerves and elixir would appreciate any advice you have.

Many thanks,
Graham

First Post!

gman

gman

The timescaledb and postgres look all good - I can send ‘test’ measurements via curl and they are inserted into the DB.

I can also view those ‘test’ measurements in grafana so that side looks OK too.

It just seems to to be the connectivity between the rpi4 and Phoenix on my host PC :man_shrugging:

Where Next?

Popular Pragmatic Bookshelf topics Top

raul
Hi Travis! Thank you for the cool book! :slight_smile: I made a list of issues and thought I could post them chapter by chapter. I’m rev...
New
gilesdotcodes
In case this helps anyone, I’ve had issues setting up the rails source code. Here were the solutions: In Gemfile, change gem 'rails' t...
New
patoncrispy
I’m new to Rust and am using this book to learn more as well as to feed my interest in game dev. I’ve just finished the flappy dragon exa...
New
jgchristopher
“The ProductLive.Index template calls a helper function, live_component/3, that in turn calls on the modal component. ” Excerpt From: Br...
New
brunogirin
When I run the coverage example to report on missing lines, I get: pytest --cov=cards --report=term-missing ch7 ERROR: usage: pytest [op...
New
s2k
Hi all, currently I wonder how the Tailwind colours work (or don’t work). For example, in app/views/layouts/application.html.erb I have...
New
andreheijstek
After running /bin/setup, the first error was: The foreman' command exists in these Ruby versions: That was easy to fix: gem install fore...
New
New
redconfetti
Docker-Machine became part of the Docker Toolbox, which was deprecated in 2020, long after Docker Desktop supported Docker Engine nativel...
New
roadbike
From page 13: On Python 3.7, you can install the libraries with pip by running these commands inside a Python venv using Visual Studio ...
New

Other popular topics Top

Devtalk
Hello Devtalk World! Please let us know a little about who you are and where you’re from :nerd_face:
New
PragmaticBookshelf
A PragProg Hero’s Journey with Brian P. Hogan @bphogan Have you ever worried that your only legacy will be in the form of legacy...
New
dasdom
No chair. I have a standing desk. This post was split into a dedicated thread from our thread about chairs :slight_smile:
New
AstonJ
I ended up cancelling my Moonlander order as I think it’s just going to be a bit too bulky for me. I think the Planck and the Preonic (o...
New
PragmaticBookshelf
“Finding the Boundaries” Hero’s Journey with Noel Rappin @noelrappin Even when you’re ultimately right about what the future ho...
New
PragmaticBookshelf
Build highly interactive applications without ever leaving Elixir, the way the experts do. Let LiveView take care of performance, scalabi...
New
AstonJ
Saw this on TikTok of all places! :lol: Anyone heard of them before? Lite:
New
AstonJ
We’ve talked about his book briefly here but it is quickly becoming obsolete - so he’s decided to create a series of 7 podcasts, the firs...
New
PragmaticBookshelf
Author Spotlight: VM Brasseur @vmbrasseur We have a treat for you today! We turn the spotlight onto Open Source as we sit down with V...
New
sir.laksmana_wenk
I’m able to do the “artistic” part of game-development; character designing/modeling, music, environment modeling, etc. However, I don’t...
New

Sub Categories: