Ways of remotely monitoring temperature

I was wondering if there was a way to remotely monitor temperature profiles? Maybe as basic as having the pi spit out somehow the CSV avoiding the need to open ports in the local wifi?

My situation is that I have one location that is monitoring temperatures but there is another location that needs the temperature monitoring as well. I do not frequently go to this secondary location so it would be good to be able to monitor it at least from the first location.

I’m not entirely sure what you’re asking.

You apparently have two locations. Where is the sensor? Where is the client? Does this scenario use a Spark controller, or a third-party sensor? Is this about having a remote sensor, or about being able to access sensor data remotely?

That said, there is a lot of flexibility in how data is published and shared. I’m pretty sure an elegant solution can be configured.

Thanks!

What I mean is Our current street address is 47 X Road and we have 5 fridges there and I am also monitoring the one room temperature. We also have another address in 55 Y Road where there is one fridge and one room temperature that I need to know the temperature of.

For X address it is easy because I am frequently there and I can check while I am in the wifi range.

I could install another spark with another Pi in the Y address but I am seldom at that address and out of range of the wifi network. So I would like to be able to check those temperatures remotely. Ideally with a similar UI.

The most straightforward solution would be forward a router port to the ssh port (22) on your Pi at 47 X Rd, and tunnel in there from 55 X Rd.

First, open up the eventbus port at 47X:

brewblox-ctl service expose eventbus 1883:1883

Below is a good walktrough on how to set up an SSH tunnel. For it to work, you need to open a port on your router, and forward it to port 22 on your Pi at 47X.

Don’t open port 22 on your router: it’ll attract a lot of automated malware login attempts.
You must change the Pi password from it’s default value, or disable password SSH login entirely.

Let’s assume the external IP address of 47X is 123.456.0.47, you opened port 8822 on your router at 47X, and forwarded that to port 22 on your Pi.

Follow the instructions in the article. They use 8080 as redirect target, and 3000 as application port.
The 8080 doesn’t matter as long as there’s no conflict.

Replace 3000 with 1883, and where they connect with admin@server1.example.com, use pi@123.456.0.47:8822.

Now, at 55X, install Brewblox. Discover and name your sensor. Use a different name for your Spark service than the ones running at 47X.

When your service is set up and working locally, we’ll forward all its published data through the SSH tunnel to 47X.

The use case is rather interesting, so I think I’ll build a trivial forwarding service, and publish that as docker image. I’ll let you know in a bit when it’s done.

Hi that would be amazing.

Would it help if I say that I have a hosted server?

For security reasons I’d still recommend tunneling over SSH, but it’d certainly help with naming (if server is at 47X).
In the long term, we’ll probably want to improve support for using remote / additional MQTT brokers.
It would open up some interesting use cases, but would require changes to multiple services and possibly the proxy configuration.

Image is up. On 55X add it to your docker-compose.yml as:

services:
  # <- other services go here
  forwarder:
    image: kargathia/area51:forwarder
    restart: unless-stopped
    command: --dest-port PORT

The --src-host, --src-port, --dest-host, --dest-port args all exist, and have default values.
The default value for --dest-port is 9883. Change this to match the tunnel port (or tunnel to this port). In the guide I linked earlier, that’d be 8080.

Note that it will happily forward all history messages published in your 55X brewblox install. Make sure your service names in 47X and 55X are unique.
You won’t be able to see or control the 55X Spark service in your UI at 47X, but its sensor values should show up in your graph settings.

I think I might have sound more confident than I actually am with this. It will take me a bit to sort this. Thank you for your help!

I need to order a new spark and Pi first!

There’s always a learning curve =)

If it helps, an itemized to-do list would be:

  • Install brewblox at 47X.
  • Install brewblox at 55X.
  • Expose eventbus port on your Pi at 47X.
  • Forward an external port (eg. 2222) in your router at 47X to port 22 on your Pi at 47X.
  • Test SSH login from 55X to 47X. (ssh pi@47x_ip_address:2222)
  • Create SSH tunnel from 55X to 47X. (ssh -N pi@47x_ip_address:2222 -L 0.0.0.0:9883:localhost:1883)
  • Install forwarding service at 55X, and configure it to forward to 55Xs side of the SSH tunnel.

Feel free to message me if something is proving troublesome. I think there’s potential in this approach - it may need some tuning, but could then be useful to others as well.