docker-observerip-proxy-mqtt

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

README

Docker Pulls license

docker-observer-proxy-mqtt

Publishes a web server (golang) with a path /weatherstation/updateweatherstation.php that intercepts the request to weather forecast and publishes info on mqtt.

Based on projects:

Build

Using local golang:

//dependencies
go get -d -v
// build
go build -i -o bin/proxy
//execute
./bin/proxy

Using docker:

docker build -t glarfs/observerip-proxy-mqtt .

//docker login to docker-hub
docker login
//username and password
docker push glarfs/observerip-proxy-mqtt

Using docker (multiarchitecture)

//enable docker experimental features
//docker login to docker-hub
docker login
//username and password
docker buildx build -t glarfs/observerip-proxy-mqtt --platform=linux/arm,linux/arm64,linux/amd64 . --push

Run

Requisites in your local network:

  • observerip weather station (y.y.y.y)
  • mqtt server (x.x.x.x)
  • server with docker (z.z.z.z)

Run the following command remplacing the variables:

docker run -p 8080:8080 -e OBSERVER_MQTT_HOST=x.x.x.x -e OBSERVER_MQTT_PORT=1883 -e OBSERVER_MQTT_ENTRYPOINT=my/meteo glarfs/observerip-proxy-mqtt

Modify the endpoint on the observerip administration page(http://y.y.y.y) to go to http://[z.z.z.z]:8080/weatherstation/updateweatherstation.php

Test

To test application connect the mosquitto client to your mqtt server:

mosquitto_sub -v -h x.x.x.x -t my/meteo/#

This will show the values pushed to proxy server

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL