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:

Popular Pragmatic topics Top

johnp
Running the examples in chapter 5 c under pytest 5.4.1 causes an AttributeError: ‘module’ object has no attribute ‘config’. In particula...
New
herminiotorres
Hi @Margaret , On page VII the book tells us the example and snippets will be all using Elixir version 1.11 But on page 3 almost the en...
New
herminiotorres
Hi! I know not the intentions behind this narrative when called, on page XI: mount() |> handle_event() |> render() but the correc...
New
jeremyhuiskamp
Title: Web Development with Clojure, Third Edition, vB17.0 (p9) The create table guestbook syntax suggested doesn’t seem to be accepted ...
New
swlaschin
The book has the same “Problem space/Solution space” diagram on page 18 as is on page 17. The correct Problem/Solution space diagrams ar...
New
adamwoolhether
When trying to generate the protobuf .go file, I receive this error: Unknown flag: --go_opt libprotoc 3.12.3 MacOS 11.3.1 Googling ...
New
jonmac
The allprojects block listed on page 245 produces the following error when syncing gradle: “org.gradle.api.GradleScriptException: A prob...
New
rainforest
Hi, I’ve got a question about the implementation of PubSub when using a Phoenix.Socket.Transport behaviour rather than channels. Before ...
New
SlowburnAZ
Getting an error when installing the dependencies at the start of this chapter: could not compile dependency :exla, "mix compile" failed...
New
dachristenson
I just bought this book to learn about Android development, and I’m already running into a major issue in Ch. 1, p. 20: “Update activity...
New

Other popular topics Top

Exadra37
Please tell us what is your preferred monitor setup for programming(not gaming) and why you have chosen it. Does your monitor have eye p...
New
AstonJ
I’ve been hearing quite a lot of comments relating to the sound of a keyboard, with one of the most desirable of these called ‘thock’, he...
New
PragmaticBookshelf
Rust is an exciting new programming language combining the power of C with memory safety, fearless concurrency, and productivity boosters...
New
AstonJ
Inspired by this post from @Carter, which languages, frameworks or other tech or tools do you think is killing it right now? :upside_down...
New
PragmaticBookshelf
Build highly interactive applications without ever leaving Elixir, the way the experts do. Let LiveView take care of performance, scalabi...
New
PragmaticBookshelf
A Hero’s Journey with Chris Pine @chrispine Chris Pine, author of Learn to Program, Third Edition, discusses his journey to beco...
New
wmnnd
Here’s the story how one of the world’s first production deployments of LiveView came to be - and how trying to improve it almost caused ...
New
AstonJ
If you want a quick and easy way to block any website on your Mac using Little Snitch simply… File > New Rule: And select Deny, O...
New
AstonJ
If you’re getting errors like this: psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory ...
New
AstonJ
This is cool! DEEPSEEK-V3 ON M4 MAC: BLAZING FAST INFERENCE ON APPLE SILICON We just witnessed something incredible: the largest open-s...
New

Latest in PragProg

View all threads ❯