I had to get one. So i got two! The first one is just running XBIAN (XBMC). For those that dont know this is a media centre and with a few plug-ins such as TVCatchup it hangs off th eback of a spare HD TV and streams some free TV channels. I also discovered i can send any media on my phone to this setup as well.
The second one is more for playing around with. At the moment its running a NAS drive for backups and music etc. Theres plenty of help for this on the net at http://elinux.org/R-Pi_NAS and it works quite well.
I’m also playing around with bluetooth. I discovered this site http://www.dreamgreenhouse.com/projects/2012/rpibt/index.php .
I followed it more or less. I tried using it on Arch linux but this wouldnt find any devices so i installed Raspbian and it worked. I then mashed up a couple of scripts to send an email whenever the Pi scans and finds another bluetooth device in range.
I used this script to scan for a bluetooth device
#!/bin/bash
if hcitool scan | grep “:” > string
then
/home/pi/sendit.sh
else
echo “failed”
fi
The second script is a small python script to send an email. Its not pretty but it works and send the contents fo the file “string” which is the BT or MAC address of the devices found in the scan.
#!/usr/bin/python
import smtplib
import sys
message = “””From: Pi from@email.com
To: Home destination@email.com
Subject: Bluetooth Alert
“””
bluetooth = open(‘string’, ‘r’).read()
mssg=message+bluetooth
server = smtplib.SMTP(“mail.server.com”)
server.ehlo()
server.starttls()
server.ehlo()
server.login(‘from@email.com’, ‘password’)
# print message
print bluetooth
server.sendmail(‘from@email.com’,’destination@email.com’, mssg)
server.quit()
Leave a Reply