Log temperature / air pressure to a Google Sheet with a Raspberry Pi
Install Python 3.6 (Note: This step can take several hours to run)
Install the required packages: pip3.6 install gspread oauth2client
Install Adafruit_Python_BMP python module
Enable the I2C protocol feature in Raspberry Pi
Follow the tutorial here to get API access to Google Sheets
Put the resulting client_secret.json
file in this directory
Open logger.py
and set the SPREADSHEET_NAME
variable to the title of your spreadsheet.
(You can also specify the worksheet tab name, if you're using a specific tab)
Run python3.6 logger.py
to get a temperature and pressure reading and log it to the google sheet.
Run crontab -e
to edit your crontab and add the following line (you may have to adjust the path based on where you cloned the repository). This will make the script run every 5 minutes.
*/5 * * * * /usr/local/bin/python3.6 /home/pi/log-temperature/logger.py /home/pi/log-temperature/client_secret.json