The Raspberry Pi is a great piece of hardware. However you don't always want to hook it up to some screen and keyboard when working with it. I in fact never did since I like to do everything using SSH which is enable out of the box if you are using the raspbian distribution. So just hook it up to your router and start hacking. But what if you have no router and only you Mac?
The Raspberry Pi is configured by default to receive an IP address from a DHCP server. So you need a DHCP server.
This can be done using the sharing option in OSX. Just set it up like that, ignore the warning about your ISP, since you are not connecting to anything but you Raspberry Pi. You can also share your wifi-connection if you are at home but if you have secure enterprise wifi this option doesn't work. Once you have enabled this option just connect your mac and Raspberry Pi using an ethernet cable and THEN connect the power to the Pi.
Also note that you don't need a cross-over cable, any normal …
Now and then the need arises to plot data in realtime. I know how simple this is using LabView but I always pefer Python for its versatility in data analysis.
However when it comes to plotting data in realtime I have never seen any easy solution for Python.
For my daily plotting needs I mostly use matplotlib but the Bokeh project is currently ahead when it comes to interactive plotting for the web.
Another exciting development has been Python3's asyncio which is python's native approach to an event driven framework. This puts python in the spotlight for io-bound applications for which people would use node.js.
Combing the Bokeh and asyncio allows building an interactive, realtime plotting application in less then 30 lines of code. I did not find any official documentation on how to do this so I decided to provide my own adapted from the official example here. I suggest to have a look at the official example to get a better understanding how the asyncio version works. In essen…
n = len(identifiers) values = [.0]*n valuecount = 0
for line in process.stdout: line = line.split() values[valuecount] = line valuecount += 1
output = "" for i,j in zip(identifiers,values): j = str(j) output += (i+j+" ") print output
It is called by cacti using
python /scripts/check_digitemp.py cool air hot out
The parameters given to the script are simply labels of your choice. Just make shure they fit the number of sensors installed. Also make sure /etc/digitemp.conf exists and the cacti user (in my case www-data…