Raspberry Pi wireless weather station with TI SensorTag CC2650STK connected via Bluetooth Low Energy.
This project was developed with Python 2.7 on Raspbian. It works on the Raspberry Pi 3 Model B, which includes a Bluetooth Low Energy receiver. It requires the TI SensorTag CC2650STK.
The project is based on the Mini Weather Station project on hackster.io adapted for the SensorTag.
# clone the repository
git clone git@github.com:yxtay/raspberry-pi-sensortag.git
cd raspberry-pi-sensortag
# install dependencies
sudo apt install python-pip virtualenvwrapper libglib2.0-dev
mkvirtualenv sensortag # OPTIONAL: create virtualenv
pip install -r requirements.txt
Please set the following variables at the top of sensortag_weather.py
as described.
The MAC address of the SensorTag can obtained by typing the following into the terminal.
sudo hcitool lescan
Turn on the SensorTag. You should see:
24:71:89:E6:AD:84 CC2650 SensorTag
Set SENSORTAG_ADDRESS
accordingly.
Follow the gspread
documentation instructions to obtain OAuth2 credentials from Google Developers Console.
Set GDOCS_OAUTH_JSON
to the name of the file.
Open up the credentials file and note the email address under client_email
, which is required in the next section.
Create a Google Spreadsheet and name it as you desire. Set GDOCS_SPREADSHEET_NAME
to the name of the spreadsheet.
Rename the worksheet as you desire. Otherwise, it shall be "Sheet1" by default. Set GDOCS_WORKSHEET_NAME
to the name of the worksheet.
Share the spreadsheet with client_email
in the credential file from the previous section.
It takes about 5-6 seconds to obtain readings from the SensorTag and upload them to Google Spreadsheet.
For approximiately per minute readings, set FREQUENCY_SECONDS
to 55.
workon sensortag # activate virtualenv
python sensortag_weather.py