How to use iSpindel without external service

The Homebrew Forum

Help Support The Homebrew Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

GeorgieV

Well-Known Member
Supporting Member
Joined
Apr 9, 2020
Messages
147
Reaction score
71
Finally got to write up and share with the community what I did with my iSpindel.
First of all my motivation - I may just be a privacy freak (this is what my children think) but I'm not happy with all "free services" leeching private data. Many people would think it's not a big deal but for me it's a matter of principal.

So after I got an iSpindel for my birthday, I began exploring its capabilities and how it operates. Basically, what iSpindel does is to send a http request to a preset URL. I guess the format of the data sent along may be a bit different depending on which app is selected in the settings. I went with the universal HTTP interface which as far as could get from the German documentation sends the data in a JSON formatted PUT request.

Second step was to arrange the data to be received. For the http request to be processed the usual solution is to use a web server. I had a Raspberry Pi to hand (I know many other people on this form use RPis too) and it was like the obvious option. As a receiving side I installed an Apache web server on my Raspberry Pi. Any other server will do the trick as long as it supports cgi scripts. CGI scripting must be enabled on the server. With the Apache this is done by a simple edit of a config file.
The 3-rd step was to write a piece of code that reads the data and stores them on the RPi. This turned out to be rather simple. I can share the code if anyone is interested.

So I ended up with the data stored on the RPi and needed a way to display them. Since I already had the Apache web server running it made sense to display the data on a webpage for which I found a JavaScript package called Highcharts to be very useful (comes with examples too :) ).

And here it is - live ISpindel data chart. This only a snapshot as the server is visible from my home network only.

live-ispindel-temperatur[1].jpeg
 
No, I'm not fermenting anything at the moment. This is the temperature in my under-stairs cupboard.

However, I'm intending to ferment a lager at that location with a few layers of insulation around the FV to smoothen out the temperature fluctuations.
 
Hi GeorgieV i am very interested in this project was thinking running Fermentrack on my Pi for my brews but this looks less intensive. Would very much like the code and if possible a layman's step by step on how to install the server and code
 
Yeah I’m interested in the code and charting. I experimented with pulling JSON data off a salus iT500 heating controller but only used scripting off a free create your own website with the obvious data risks pointed out earlier. I also wrote a crude JSON parser (not sure why) to scrape the data off the salus webserver. I think I used something else for charting maybe a JavaScript plugin. Anyway I think I could run the ispindel to get the extra in fermenter temp and the gravity reading.
 
Hi all,
Sorry for the late reply. Below is the code for the cgi-script. It works as it is but now as I'm lookin at it, I see it can be improved. I'll keep you posted.
#!/usr/bin/python

import sys, json
from datetime import datetime
try:
data = sys.stdin.read()
info = json.loads(data)

angle = info['angle']
temperature = info['temperature']
battery = info['battery']
except Exception as e:
with open("/home/pi/log/ispindel.log", "a+") as log:
log.write(str(e) + '\n')
log.close()

with open('/home/pi/ispindel.dat', 'a+') as data_file:
data_file.write(str(datetime.now()))
data_file.write( ', ' + str(angle) + ',' + str(temperature)+ ',' + str(battery))
data_file.write('\n')
data_file.close()
with open('/home/pi/ispindel_temp.dat', 'a+') as data_file:
data_file.write(str(datetime.now()))
data_file.write( ', ' + str(temperature))
data_file.write('\n')
data_file.close()
with open('/home/pi/ispindel_angle.dat', 'a+') as data_file:
data_file.write(str(datetime.now()))
data_file.write( ', ' + str(angle))
data_file.write('\n')
data_file.close()
with open('/home/pi/ispindel_battery.dat', 'a+') as data_file:
data_file.write(str(datetime.now()))
data_file.write(',' + str(battery))
data_file.write('\n')
data_file.close()

print ("""\
Content-Type: text/html\n\n
<html><head>
<META HTTP-EQUIV=refresh CONTENT=\"1;URL=http://127.0.0.1:8080" >\n</head></html>
""")
 
avollkopf/iSpindel-TCP-Server

This basically does the same, with other bells and whistles. It also requires an SQL db which is a bit annoying to set up.

I ended up modifying the core python script and just outputting to a CSV file. It would be fairly easy to present this through a webserver I think but a) I'm homeschooling and have no time and b) I'm a C++ programmer so not really my department :). My main use is actually that the python script turns on/off my fridge and heater.
 
Very simple to setup, download the image, flash onto an SD card and boot, little to no configuration required! Instruction on how to setup your iSpindel included.

I've kept an SD card just for that purpose now. Not that I use it that often, it's just easy to put card into a Pi, boot and start logging data. Not that I calibrate that often, but I found it very easy.

Chris
 
Does anyone get remotely accurate reading off thei iSpindle? I've calibrated mine during multiple brews but it's always off by a considerable margin. It's fine for tracking rough progress but no use for actual readings.
 
Very simple to setup, download the image, flash onto an SD card and boot, little to no configuration required! Instruction on how to setup your iSpindel included.

I've kept an SD card just for that purpose now. Not that I use it that often, it's just easy to put card into a Pi, boot and start logging data. Not that I calibrate that often, but I found it very easy.

Chris

I feel so stupid for asking this, but I can't find the default login and password anywhere. Do you know it please?
 
The two packages quoted above are actually two versions of the same code.
avollkopf/iSpindel-TCP-Server is the newer version (v. 3.1).

@JT_Brews, I also want to control staff with the RPi and to use iSpindel as an input. However, I hadn't found the time to build the hardware interface. Would you mind sharing what is your setup?
 
Very simple to setup, download the image, flash onto an SD card and boot, little to no configuration required! Instruction on how to setup your iSpindel included.

I've kept an SD card just for that purpose now. Not that I use it that often, it's just easy to put card into a Pi, boot and start logging data. Not that I calibrate that often, but I found it very easy.

Chris
Sorry to be a pain but its all in German where is the i
 

Latest posts

Back
Top