Skip to content

dixon1e/smoker-beacon

Repository files navigation

Smoker Beacon

Take the output from a thermocouple, input through a PCDuino and transmit via BLE Beacon to a Cordova Android App.

App

  • Receives output showing the temperature from one or more thermocouples
  • Configurable min/max temperature alarm
  • Uses Apache Cordova to select and receive Beacon
  • Beacon assumed to have two fields:
  1. Major: ID of Thermocouple
  2. Minor: Temperature

N.B. Not included in this repo

Items needed:

TL;DR - To run the system by hand, execute dispatcher and thermocouple scripts.

cd smoker-beacon
source venv/bin/activate
python dispatcher.py
python sensor.py

##Field Guide

  • Hook up a USB keyboard, preferably with built-in mouse
  • Use a USB hub to connect more than one device
  • Hit CTRL-ALT-T to open a Terminal
  • Hit ALT-TAB to switch between Terminal and Application
  • Logs are located in /var/log/smoker-beacon
  • Startup log located in /home/linaro/logs/cronlog
  • Key programs are "sensor.py" and "dispatcher.py"
  • Programs are located in /home/linaro/smoker-beacon
  • The order: attach thermocouple first, then turn on CPU unit
  • Calibrate the thermocouple when setting up,

Objective: Thermocouple readings through beacon to app

System Installation Requirements

  • ZeroMQ
  • Python
  • iPython
  • supervisor

Python Installation Requirements

  • pillow
  • transitions
  • virtualenv development environment

Block Architecture


									   Ampilfier
									   Assembly
		+--------------+            +---------------+
		|              |            |               |
		|              |            |               |
		|              +------------>               |
		|              |            |               |
		|              |            |               |
		+--------------+            +-------+-------+
											|
		  Thermocouple                      |
											|                        BLE (Beacon)
									+-------v-------+            +---------------+
									|               |            |               |
									|               |            |               |
									|               +------------>               |
									|               |            |               |
									|               |            |               |
									+---------------+            +-------+-------+
										  PCDuino                        |
																		 |
																		 |
																		 |
																 +-------v-------+
																 |               |
																 |               |
																 |               |
																 |               |
																 +---------------+
																  Android App
																  Using Apache Cordova

Platform preparation

  1. Clone this repo

     git clone [email protected]:dixon1e/smoker-beacon.git
    
  2. Install all Ubuntu Linux packages (build-essential already included)

     sudo apt-get update && sudo apt-get upgrade -y
     sudo apt-get install -y python-pip python-virtualenv python-dev curl 
     sudo apt-get install -y python-bluez
    
  3. Set the correct Time Zone

     sudo timedatectl set-timezone America/Denver
    
  4. Install the supervisor package

     sudo pip install supervisor
    
  5. Create a virtualenv in the repo directory (/home/linaro/smoker-beacon)

     cd ~/smoker-beacon
     virtualenv venv --no-site-packages
    
  6. Activate virtual environment

     . ./venv/bin/activate
    
  7. Install the Python libraries

     pip install -r requirements.txt
    
  8. Add a new job to crontab for root user

     sudo su -  
     crontab -e 
     
     (make the following the last line)  
     
     @reboot su linaro -c "DISPLAY=:0.0 sh /home/linaro/smoker-beacon/startall.sh >/home/linaro/logs/cronlog 2>&1"
    
  9. Change Desktop Background

     Open "Preferences >" | "Desktop Preferences" panel (from from lower left icon in Desktop Toolbar)
     In the "Appearance" Tab, change the "Wallpaper", opens new panel
             Browse to: "Filesystem" | "/smoker-beacon/images/logo.png"
             Click "Open"
     		Click Background Color and change to "White", e.g. 255, 255, 255 in the R,G,B fields
     Click "Close"
    
  10. Check dispatcher.py and sensor.py to make sure Logging level is not more than "WARNING"

State Machine Description

Bluetooth

About

Send temperature telemetry for a smoker.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published