Connect 2015 Smoking Salmon with Splunk and Raspberry Pi

13
Smoking Salmon with Splunk and Raspberry Pi Greg Dostatni

Transcript of Connect 2015 Smoking Salmon with Splunk and Raspberry Pi

Page 1: Connect 2015  Smoking Salmon with Splunk and Raspberry Pi

Smoking Salmon with Splunk and Raspberry Pi

Greg Dostatni

Page 2: Connect 2015  Smoking Salmon with Splunk and Raspberry Pi

Assumptions

Cold Smoking

Requires temperatures between 20°C and 30°C

Raspberry Pi

Tiny computer used by hobbyists for just about anything

Splunk

Software used for searching, visualizing and analyzing machine generated data

Page 3: Connect 2015  Smoking Salmon with Splunk and Raspberry Pi

Equipment

Page 4: Connect 2015  Smoking Salmon with Splunk and Raspberry Pi

Electronics

Page 5: Connect 2015  Smoking Salmon with Splunk and Raspberry Pi

Connecting sensors

Page 6: Connect 2015  Smoking Salmon with Splunk and Raspberry Pi

Code*#!/usr/bin/pythonimport dhtreader, time, os, sys, os.path

type=22pins =(18,)

dhtreader.init()time.sleep(3)

for loop in range(SAMPLECOUNT): for pin in pins: time.sleep(0.5) val = dhtreader.read(type,pin) if val: temp, hum = val sensors[pin]["count"] += 1 sensors[pin]["temperature"] += temp sensors[pin]["humidity"] += hum time.sleep(0.5)

for pin in pins:if sensors[pin]["count"] > 0:

sensors[pin]["tempoutput"]=str(sensors[pin]["temperature"] / sensors[pin]["count"])

sensors[pin]["humoutput"]=str(sensors[pin]["humidity"] / sensors[pin]["count"])

else:

sensors[pin]["tempoutput"]="ERR"sensors[pin]["humoutput"]="ERR"

sensors[pin]["errors"]=str(SAMPLECOUNT-sensors[pin]["count"])

# output averagesfpw.write( "%s,"%time.ctime() + ','.join(["%s,%s"%(sensors[x]["tempoutput"],sensors[x]["humoutput"]) for x in pins])+"\n")sys.stderr.write("%s, samples=%d, "%(time.ctime(),SAMPLECOUNT)+','.join(["S%d_errorcount=%s"%(x,sensors[x]["errors"]) for x in pins])+"\n”)

*Complete source available in comments on this slide.

Page 7: Connect 2015  Smoking Salmon with Splunk and Raspberry Pi

Dry Cure

4 cups brown sugar1 cup saltSpices (optional)

Video instructions at http://youtu.be/Jk3xl6H9o94

Page 8: Connect 2015  Smoking Salmon with Splunk and Raspberry Pi

Smoking Salmon

Page 9: Connect 2015  Smoking Salmon with Splunk and Raspberry Pi

Delicious results

Page 10: Connect 2015  Smoking Salmon with Splunk and Raspberry Pi

MotivationSalmon economics

Salmon Filet $9 / lbs.Typical batch 4 lbs.Finished weight 2.8 lbs.C. Smoked Salmon $ 40 - 45 / lbs.Savings $ 70 - 85

CFO’s approval …

Priceless

Page 11: Connect 2015  Smoking Salmon with Splunk and Raspberry Pi

Future Plans

Page 12: Connect 2015  Smoking Salmon with Splunk and Raspberry Pi

Future Plans #2

Page 13: Connect 2015  Smoking Salmon with Splunk and Raspberry Pi

THANK YOU!Questions?