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

Popular Prag Prog topics Top

mikecargal
Title: Hands-On Rust (Chap 8 (Adding a Heads Up Display) It looks like ​.with_simple_console_no_bg​(SCREEN_WIDTH*2, SCREEN_HEIGHT*2...
New
AleksandrKudashkin
On the page xv there is an instruction to run bin/setup from the main folder. I downloaded the source code today (12/03/21) and can’t see...
New
Chrichton
Dear Sophie. I tried to do the “Authorization” exercise and have two questions: When trying to plug in an email-service, I found the ...
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
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
rainforest
Hi, I’ve got a question about the implementation of PubSub when using a Phoenix.Socket.Transport behaviour rather than channels. Before ...
New
mert
AWDWR 7, page 152, page 153: Hello everyone, I’m a little bit lost on the hotwire part. I didn’t fully understand it. On page 152 @rub...
New
bjnord
Hello @herbert ! Trying to get the very first “Hello, Bracket Terminal!" example to run (p. 53). I develop on an Amazon EC2 instance runn...
New
redconfetti
Docker-Machine became part of the Docker Toolbox, which was deprecated in 2020, long after Docker Desktop supported Docker Engine nativel...
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

dasdom
No chair. I have a standing desk. This post was split into a dedicated thread from our thread about chairs :slight_smile:
New
Rainer
My first contact with Erlang was about 2 years ago when I used RabbitMQ, which is written in Erlang, for my job. This made me curious and...
New
AstonJ
This looks like a stunning keycap set :orange_heart: A LEGENDARY KEYBOARD LIVES ON When you bought an Apple Macintosh computer in the e...
New
DevotionGeo
The V Programming Language Simple language for building maintainable programs V is already mentioned couple of times in the forum, but I...
New
OvermindDL1
Woooooooo! This is such a huge release for it, and 2 years incoming! In short, the library is now using an updated hyper backend (not j...
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 Erin Dees @undees Welcome to our new author spotlight! We had the pleasure of chatting with Erin Dees, co-author of ...
New
New
DevotionGeo
I have always used antique keyboards like Cherry MX 1800 or Cherry MX 8100 and almost always have modified the switches in some way, like...
New
PragmaticBookshelf
Author Spotlight: Bruce Tate @redrapids Programming languages always emerge out of need, and if that’s not always true, they’re defin...
New

Latest in PragProg

View all threads ❯