Accessing 1-wire devices on Raspberry Pi using OWFS

To connect 1-wire serial devices to the RPi I am using a DS9490R USB 1-wire adapter (rather than wiring I2C 1-Wire master components to GPIO I2C - which I might look at sometime down the track) Install packages sudo apt-get install owfs ow-shell Edit config file vim /etc/owfs.conf ! server: server = localhost:4304 # USB device: DS9490 server: usb = all ######################### OWFS ########################## mountpoint = /mnt/1wire allow_other ####################### OWHTTPD ######################### http: port = 2121 ####################### OWFTPD ########################## ftp: port = 2120 ####################### OWSERVER ######################## server: port = localhost:4304 Create Startup Script I created a startup script for owfs modelled on the owserver script (not sure why this one is actually missing) vim /etc/init.d/owfs #!/bin/sh ### BEGIN INIT INFO # Provides: owfs # Required-Start: $remote_fs $syslog $network $named # Required-Stop: $remote_fs $syslog $network $named # Should-Start: owfs # Should-Stop: owfs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: 1-wire file system mount & update daemon # Description: Start and stop 1-wire file system mount & update daemon. ### END INIT INFO CONFFILE=/etc/owfs.conf DESC="1-Wire file system mount" NAME="owfs" DAEMON=/usr/bin/$NAME case "$1" in start) echo "Starting $NAME" $DAEMON -c $CONFFILE ;; stop) echo "Stopping $NAME" killall $NAME ;; *) echo "Usage: $N {start|stop}" >&2 exit 1 ;; esac exit 0 Starting daemons /etc/init.d/owserver start /etc/init.d/owfs start Checking output #ls /mnt/1wire/ Should show output similar to: 10.575349000000 12.95DD17000000 alarm simultaneous uncached 10.575349000000 12.95DD17000000 bus.0 statistics 12.57DD16000000 81.B2EA2E000000 bus.1 structure 12.57DD16000000 81.B2EA2E000000 settings system cat /mnt/1wire/10.575349000000/temperature Will then show…

Continue Reading

Raspberry Pi – Text to Speech

Just a quick note on Speech Synthesis a Raspberry Pi project. I had to research some of the options on the Raspberry Pi while looking into a project where I need some audio announcements. Configuring Sound echo 'snd-bcm2835' >> /etc/modules sudo modprobe snd-bcm2835 sudo apt-get install mplayer alsa-base alsa-utils pulseaudio mpg123 # make mplayer use mpg123 codec instead of default ffmp3float echo "afm=mp3lib" >> ~/.mplayer/config Since I am using Raspbian which is a Debian based (Wheezy) Distribution I used some Ubuntu documentation (https://help.ubuntu.com/community/TextToSpeech) as the starting point. Festival sudo apt-get install festival festival-english echo "Hello World - Testing" | festival --tts Plus: Local install (no internet connection required) Minus: Mechanical sounding voice Espeak sudo apt-get install espeak espeak -v en "Hello World - Testing" Plus: Local install (no internet connection required) Minus: Mechanical sounding voice (slightly better than Festival) Google Translate Create a shell script tts.sh #!/bin/bash mplayer -ao alsa -noconsolecontrols "http://translate.google.com/translate_tts?tl=en&q=$*" > /dev/null 2>&1 chmot +x tts.sh ./tts.sh "Hello World - Testing" Plus: needs live internet connection Minus: excellent human sounding voice Google Speech API I will most likely look at this in the long run to get better control rather than calling the Google Translate url too much.

Continue Reading

Enable GeoIP lookups on CentOS

GeoIP enables you to identify the location, organization, connection speed, and user type of your website visitors. yum install GeoIP mod_geoip cd /usr/share/GeoIP/ wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz gunzip GeoIP.dat.gz gunzip GeoLiteCity.dat.gz rm -f *.gz Edit the VirtualHost settings in httpd.conf <ifmodule mod_geoip.c> GeoIPEnable On GeoIPDBFile /usr/share/GeoIP/GeoIP.dat Standard GeoIPDBFile /usr/share/GeoIP/GeoLiteCity.dat Standard </ifmodule> Restart Apache /etc/init.d/httpd restart

Continue Reading

Accessing Amazon RDS from Desktop

Every once in a while it is handy to be able to access an Amazon RDS Database Instance remotely from a desktop. ssh -i YOUR-AMAZON-PRIVATE-KEY.pem -l YOUR-AMAZON-RDS-USERNAME -L 33060:YOUR-AMAZON-RDS-PRIVATE-IPADDRESS:3306 -N ec2-usr@YOUR-AMAZON-EC2-INSTANCE-PUBLIC-ADDRESS Note: YOURAMAZONRDSPRIVATEIPADDRESS needs to be the AWS internal RDS IP Address - not the external hostname You can then connect to RDS using mysql commands or any GUI tool such as MySQL Workbench via localhost:33060 Thanks to: Dirk Taggesell via AWS Forums

Continue Reading

Installing the latest stable version of LibreCAD on Ubuntu

I have recently been looking at different CAD options on Ubuntu and LibreCAD (http://librecad.org/) is looking like the best option for my needs at current (apart from the wish there would be some DWG support). Since the main Ubuntu repositories are usually a fair bit behind the lastest stable realeases of LibreCAD you need to add the LibreCAD Dev PPA Repository sudo add-apt-repository ppa:librecad-dev/librecad-stable sudo apt-get update sudo apt-get install librecad

Continue Reading

Mobile Browser Testing on the Desktop

If you need to check websites for mobile compliance on a regular basis you know that having a device to constantly check is painful and slows down your work during debugging and phases of constant change.   by  adactio  There are a few tools that will make this work a lot easier: Google Chrome Chrome does have some nice dedicated plug-ins to help with this task Ripple Mobile Environment Emulator (https://chrome.google.com/webstore/detail/geelfhphabnejjhdalkjhgipohgpdnoc) appMobi HTML5 XDK (https://chrome.google.com/webstore/detail/onmkoldigcfmebcinpmineoadckalllb) Firefox I am not aware of any plug-ins like Chrome, but as a hack I have found it useful to employ a user-agent switching plugin to trick the browser User Agent Switcher (http://chrispederick.com/work/user-agent-switcher/) works well for this. Download the User Agent Switcher Add-on for Firefox Restart Firefox for the add-on change to take place. To start a new browsing session using an emulated browser, go to Tools > User Agent Switcher and select the appropriate mobile web browser you want to emulate To switch back to normal browsing, just select the default option from the above menu. If you need more specific UA Strings check here: http://www.zytrax.com/tech/web/mobile_ids.html For more serious work there are obviously dedicated emulators from the major Mobile OS vendors (but they need to be installed and configured for each platform): Android (http://developer.android.com/guide/developing/tools/emulator.html) iOS (http://developer.apple.com/devcenter/ios/) WinPhone (http://www.microsoft.com/download/en/details.aspx?id=13890) Nokia (http://www.developer.nokia.com/Develop/Web/) Opera (http://www.opera.com/developer/tools/mini/) WebOS (http://developer.palm.com/)   PS: Nothing substitutes final QA testing on actual devices ...  

Continue Reading

BESPIN – another nice one from Mozilla.org

Getting excited about a new text editor of all things is not something I like to admit to easily, but in my line of work (although less and less is actually doing hands on coding) text editing is an important part. That's why I checked out the BESPIN project as soon as I heard of it. The prospect of being able to edit your files from anywhere is very appealing to me since I spend a lot of time away from the desk and on devices that not always have good text editor (let alone all the files necessary). The thought of being able to edit files from a netbook while on the run is coming to mind straight away. So far (even though this is a 0.1 'techo-preview') I really like what you see. Not something that the average word processor crowd would find appealing or easy to use, but for somebody that is familiar with (specially *NIX) text editors it is easy to pick up and I can definitely see lots of potential there. There are some important features still missing to make it truly useful in practical conditions, but I am sure they will be addressed in future revisions and it should be fairly easy to host your own since it's basically Javascript & HTML5 and an Open Source project. Great work by these guys: Keep it coming ! Soon ...

Continue Reading

Mobile 2D codes gathering pace (outside of Asia)

FINALLY !!! As somebody that has been experimenting with this technology for over 2 years now I am quite exited to see that the adoption of this technology is gathering some steem. While it has bee widely adopted in Asia for some years now, it has taken some time to get a foothold in the rest of the world this seems to be changing now. At least in Europe as I can see for myself at the moment. In my opinion with Nokia finally getting serious and throwing its (considerable) weight behind this technology (http://mobilecodes.nokia.com/) and some other industry heavyweights joining forces in the Mobile Codes Consortium.� This will hopefully produce one key outcome, the stadardisation of the label technology, which up to now has been one of the stumbling blocks that has kept people such as myself from adopting these codes in real-world projects. Along with the adoption by some major companies in their advertising this should produce the momentum that was needed to push mobile 2D codes into some broad adoption. Of course there is similar technology available for the applications that require this link between the physical world (presence) and the mobile internet. One example is RFID together with Near Field Communications (NFC). However apart from the additional expense for RFID labels, no other technology has anywhere close the number of handsets that are capable of using this technology without some add-on to the mobile phone. Currently there are only very few handsets that will support this…

Continue Reading