Smoking Salmon with Splunk
and Raspberry Pi
Greg Dostatni
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
Equipment
Electronics
Connecting sensors
Code*
#!/usr/bin/python
import dhtreader, time, os, sys, os.path
type=22
pins =(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 averages
fpw.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.
Dry Cure
4 cups brown sugar
1 cup salt
Spices (optional)
Video instructions at
http://youtu.be/Jk3xl6H9o94
Smoking Salmon
Delicious results
Motivation
Salmon 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
Future Plans
Future Plans #2
THANK YOU!
Questions?

More Related Content

PDF
Fun with sensors - JSConf.asia 2014
PDF
bpftrace - Tracing Summit 2018
PDF
AWS ロボを作ろう JAWSUG Kobe
PPTX
Tensorflow internal
PDF
破解:企圖開放瘦肉精美豬的詭辯話術 修
PPTX
Splunk live university of alberta 2015
PDF
0to100 in 18 months
PDF
Postgresql in Education
Fun with sensors - JSConf.asia 2014
bpftrace - Tracing Summit 2018
AWS ロボを作ろう JAWSUG Kobe
Tensorflow internal
破解:企圖開放瘦肉精美豬的詭辯話術 修
Splunk live university of alberta 2015
0to100 in 18 months
Postgresql in Education

Recently uploaded (20)

PDF
Enhancing plagiarism detection using data pre-processing and machine learning...
PDF
A review of recent deep learning applications in wood surface defect identifi...
DOCX
search engine optimization ppt fir known well about this
PDF
How IoT Sensor Integration in 2025 is Transforming Industries Worldwide
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
Developing a website for English-speaking practice to English as a foreign la...
PDF
Consumable AI The What, Why & How for Small Teams.pdf
PPT
What is a Computer? Input Devices /output devices
PPTX
Custom Battery Pack Design Considerations for Performance and Safety
PPTX
Benefits of Physical activity for teenagers.pptx
PPTX
The various Industrial Revolutions .pptx
PDF
STKI Israel Market Study 2025 version august
PDF
Credit Without Borders: AI and Financial Inclusion in Bangladesh
PPTX
2018-HIPAA-Renewal-Training for executives
PDF
Improvisation in detection of pomegranate leaf disease using transfer learni...
PDF
“A New Era of 3D Sensing: Transforming Industries and Creating Opportunities,...
PDF
A proposed approach for plagiarism detection in Myanmar Unicode text
PDF
Five Habits of High-Impact Board Members
PDF
OpenACC and Open Hackathons Monthly Highlights July 2025
PPTX
TEXTILE technology diploma scope and career opportunities
Enhancing plagiarism detection using data pre-processing and machine learning...
A review of recent deep learning applications in wood surface defect identifi...
search engine optimization ppt fir known well about this
How IoT Sensor Integration in 2025 is Transforming Industries Worldwide
1 - Historical Antecedents, Social Consideration.pdf
Developing a website for English-speaking practice to English as a foreign la...
Consumable AI The What, Why & How for Small Teams.pdf
What is a Computer? Input Devices /output devices
Custom Battery Pack Design Considerations for Performance and Safety
Benefits of Physical activity for teenagers.pptx
The various Industrial Revolutions .pptx
STKI Israel Market Study 2025 version august
Credit Without Borders: AI and Financial Inclusion in Bangladesh
2018-HIPAA-Renewal-Training for executives
Improvisation in detection of pomegranate leaf disease using transfer learni...
“A New Era of 3D Sensing: Transforming Industries and Creating Opportunities,...
A proposed approach for plagiarism detection in Myanmar Unicode text
Five Habits of High-Impact Board Members
OpenACC and Open Hackathons Monthly Highlights July 2025
TEXTILE technology diploma scope and career opportunities
Ad
Ad

Connect 2015 Smoking Salmon with Splunk and Raspberry Pi

  • 1. Smoking Salmon with Splunk and Raspberry Pi Greg Dostatni
  • 2. 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
  • 6. Code* #!/usr/bin/python import dhtreader, time, os, sys, os.path type=22 pins =(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 averages fpw.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.
  • 7. Dry Cure 4 cups brown sugar 1 cup salt Spices (optional) Video instructions at http://youtu.be/Jk3xl6H9o94
  • 10. Motivation Salmon 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

Editor's Notes

  • #4: Inexpensive diy smoker
  • #6: Diy breakout board for rapidly connecting sensors.
  • #7: #!/usr/bin/python import dhtreader import time import os, sys, os.path type=22 #pins=(23,24,25) pins =(18,) LOGDIR="/var/log/sensor" LOGFNAME = "sensors.csv" SAMPLECOUNT = 5 HEADER="Timestamp," + ','.join(["S%d_Temp,S%d_Humidity"%(x,x) for x in pins])+"\n" dhtreader.init() time.sleep(3) if not os.path.exists(os.path.join(LOGDIR, LOGFNAME)) : fpw=open(os.path.join( LOGDIR ,LOGFNAME),"a+") fpw.write(HEADER) else: fpw=open(os.path.join( LOGDIR ,LOGFNAME),"a+") # Sampling loop. # Sample 5 times each sensor , 1 second between sample runs # Record averages in CSV, Output error rate to stderr sensors={} for pin in pins: sensors[pin]={"count":0,"temperature":0,"humidity":0} 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 averages fpw.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" )
  • #10: Spike corresponds to when I accidently dumped a lot of snow on one of the sensors.
  • #12: Without data you don’t know what you get. Above: Temperature and humidity of my dryer (two loads). There is a fair amount of time spent just warming up the clothes without removing any more water. Below: A small bar fridge we use to store breast milk for the little one. The temperature fluctuates over a 5 degree range, which is much higher than expected. I realize that the bottle of milk will have a much better stability, but the range did surprise me.
  • #13: This is a 3d model of my house. One of the perksof being married to a structural engineer. I want to make it into a house dashboard inside of our home Splunk.