Skip to content

Instantly share code, notes, and snippets.

@marisancans
Created January 5, 2019 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marisancans/756072b600bdfea7d5415fa0b5df8309 to your computer and use it in GitHub Desktop.
Save marisancans/756072b600bdfea7d5415fa0b5df8309 to your computer and use it in GitHub Desktop.
Raspbian lite os
https://www.youtube.com/watch?v=O4oVIsZJDs4
Start by editing the wpa-supplicant config file:
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
network={
ssid="YOUR_NETWORK_SSID"
psk="WIFI_PASSWORD"
}
Download docker with:
https://github.com/moby/moby/issues/38175
sudo apt-get install docker-ce=18.06.1~ce~3-0~raspbian
Docker compose can be installed as usual
Im using ngnix to forward mqtt requests from client to pi(conf.d):
server {
listen 1883;
server_name YOUR_IP_ADDRESS;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
location / {
proxy_pass http://127.0.0.1:1883;
}
}
as raspberry uses ARM procesors, not all docker images are aviable
Be carefull when using non-offical docker images as they can be tempered with and you can't trust them
porting images to ARM
https://blog.hypriot.com/post/port_dockerfiles_to_arm/
MQTT arm32v6
https://hub.docker.com/r/arm32v6/eclipse-mosquitto
NGNIX arm32v6
https://hub.docker.com/r/arm32v6/nginx
NODERED
https://hub.docker.com/r/nodered/node-red-docker
node-red has base image as RPi-compatible Docker Image with Node.js by hypriot
docker run -it -p 1880:1880 --name nodered nodered/node-red-docker:rpi-v6
HOME-ASSISTANT
raspberry pi 3 docker image works on raspberry pi zero 1.6
https://hub.docker.com/r/homeassistant/raspberrypi3-homeassistant
@marisancans
Copy link
Author

marisancans commented Jan 5, 2019

home assistant mqtt addon
https://www.home-assistant.io/components/mqtt/

edit configuration.yaml:
mqtt:
broker: 127.0.0.1
port:1883

@marisancans
Copy link
Author

if above ngnix doesnt work:
https://hub.docker.com/r/tobi312/rpi-nginx/

@marisancans
Copy link
Author

0.96 OLED I2C
sudo apt-get install i2c-tools
sudo i2cdetect -y 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment