Skip to content

yxtay/raspberry-pi-sensortag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raspberry Pi wireless weather station

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.

Setup

# 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

Configuration

Please set the following variables at the top of sensortag_weather.py as described.

SENSORTAG_ADDRESS

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.

GDOCS_OAUTH_JSON

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.

GDOCS_SPREADSHEET_NAME and GDOCS_WORKSHEET_NAME

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.

FREQUENCY_SECONDS

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.

Run script

workon sensortag  # activate virtualenv
python sensortag_weather.py

About

Raspberry Pi wireless weather station with TI SensorTag CC2650 connected via Bluetooth Low Energy.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages