The original garage pi was a model 1 – 26 pin GPIO, 2 USB A, composite video, full size SD card. It served admirably for many years but I was looking to add to its responsibilities. So a Raspberry Pi 3 is replacing it.
The Pi 3 had been in the drawer for a year or so with raspian from late 2018. A full sudo apt-get update/upgrade/dist-upgrade later and we are ready to start.
sudo apt-get install mosquitto mosquitto-clients libmosquitto-dev
gets MQTT ready to go.
The outdoor i2c temp sensor will need the library from https://bitbucket.org/loblik/libam2315/src/master/ . So wget https://bitbucket.org/loblik/libam2315/get/701be2837287.zip
downloads the archive, a quick unzip and we are ready to install.
sudo make install
is the magic for installing the AM2315 library we will need for the sensor.
Using the gateway C code we long ago modified from the original RFM69 Gateway Pi port, we compile with first gcc -lam2315 am2315-get.c -o am2315-get
and then gcc piGateway.c -o piGateway -lwiringPi -lmosquitto -lam2315 -DRASPBERRY -DDEBUG
.
A simple shell script to start things and we are done with the temp/humidity sensor. sudo ~/piGateway2/piGateway /dev/i2c-1
For clarity – the connection to the sensor uses the Pi I2C connection:
- Pin 4 – Vcc (5v) [orange & orange/white]
- Pin 6 – GND [brown & brown/white]
- Pin 3 – SDA1 (GPIO2) [green]
- Pin 5 – SCL1 (GPIO3) [green/white]
Update: So all of that is brilliant but the real reason for the upgrade was to use the RTL-SDR – well the reception is very poor from the garage so we are back to the original Pi 1 Model B V 2.0.