/weatherstation

Primary LanguageJavaApache License 2.0Apache-2.0

Android Things - Cloud Weather Station using ThingSpeak

This work is a fork of this Google sample weather station. This project uses the Android Things SDK and the MQTT Protocol to publish data on ThingSpeak cloud. The data (temperature and pressure) are generated by a development board (in this case a Raspberry Pi 3). The chosen MQTT Protocol library is Eclipse Paho. The communication with the MQTT broker is done using SSL, as specified by the ThingSpeak documentation here

Run the application

Before running the application, you need to configure the build.gradle file with your ThingSpeak channel settings. Modify the lines:

buildConfigField "String", "THINGSPEAK_CHANNEL_ID", '"YOUR_CHANNEL_ID"'
buildConfigField "String", "THINGSPEAK_WRITE_API_KEY", '"YOUR_WRITE_API_KEY"'

Pre-requisites

Schematics

If you have the Raspberry Pi Rainbow Hat for Android Things, just plug it onto your Raspberry Pi 3. Otherwise here are the schematics.