Saturday, April 27, 2013

LED via momentary switch



And then we hit the button for coolness...

Thursday, April 25, 2013

New area for electronic fun


Yes that is an oscope - not sure why I need one but since the wife was electronic purchase approval mode I decided that I should pick one up. 

The next pictures show (or attempt to show) the issue with the "Low-profile microSD card adapter for Raspberry Pi" that I ordered from adafruit.com - the card holder for the microSD sticks out below the space that an SD would normally go in. Thinking about it it seems obvious but it means that most cases for the Pi wont work.  I plan to build one of the cool lego cases anyway so the crisis is minimized, but still. 


You can also see that it is not flush it still sticks out from the Pi. I do like that it is smaller and I also like using the microSD cards so all is not lost.

Wednesday, April 24, 2013

Getting bluetooth up and running

Like any hopeful person I plugged in the little bluetooth dongle I bought for something else and hoped for the best... (I WOULD NOT BUY THIS DONGLE UNTIL I HAVE CONNECTED SOMETHING TO IT)

Lets check the device with lsusb
With the device unplugged...
pi@raspberrypi ~ $ lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. 
With the device plugged in
pi@raspberrypi ~ $ lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 0a5c:21e8 Broadcom Corp. 
So I am running a Broadcom Corp bluetooth usb device - no word on the rpi verified devices list (yes I am an idiot and did not check first...)

It turns out that bluetooth is not setup by default on Raspbian “wheezy”.

So time to install bluetooth and the bluez system.
sudo apt-get install bluetooth bluez
And boom it wants to install an insane amt of stuff...
The following extra packages will be installed:
  acl avahi-daemon bc bind9-host bluez-alsa bluez-cups bluez-gstreamer colord cups cups-bsd cups-client cups-filters cups-ppdc dc
  foomatic-db-compressed-ppds foomatic-db-engine foomatic-filters geoip-database ghostscript-cups gir1.2-glib-2.0 hpijs hplip
  hplip-data libart-2.0-2 libavahi-core7 libbind9-80 libcap-ng0 libcups2 libcupscgi1 libcupsdriver1 libcupsfilters1 libcupsimage2
  libcupsmime1 libcupsppdc1 libdns88 libescpr1 libgeoip1 libgirepository-1.0-1 libgusb2 libgutenprint2 libhpmud0 libieee1284-3
  libisc84 libisccc80 libisccfg82 liblwres80 libnss-mdns libperl5.14 libsane libsane-common libsane-extras libsane-extras-common
  libsane-hpaio libsensors4 libslp1 libsnmp-base libsnmp15 libv4l-0 libv4lconvert0 mscompress perl perl-base perl-modules
  printer-driver-all printer-driver-c2050 printer-driver-c2esp printer-driver-cjet printer-driver-escpr printer-driver-foo2zjs
  printer-driver-gutenprint printer-driver-hpcups printer-driver-hpijs printer-driver-m2300w printer-driver-min12xxw
  printer-driver-pnm2ppa printer-driver-postscript-hp printer-driver-ptouch printer-driver-pxljr printer-driver-sag-gdi
  printer-driver-splix python-dbus python-dbus-dev python-gi python-gobject-2 python-imaging python-pexpect python-renderpm
  python-reportlab python-reportlab-accel sane-utils ssl-cert
It looks like they want to make sure that all the things you may want to connect to via bluetooth get their drivers and software installed.  But perl? Well in a former life I wrote a huge engine in perl for a project so I dont mind having perl but somebody may want to look at the dependencies on these packages because that is insane. Ahh, well I went ahead and did the install.

pi@raspberrypi ~ $ hcitool dev
Devices:
hci0 00:02:72:3F:67:F9
looks like I have a device - no clue if it works or not...

Tuesday, April 23, 2013

Bluetooth on the pi

I am interested in setting the pi up as a bluetooth device for a project that I am considering. I found this code http://anselm.hoffmeister.be/computer/hidclient/ that looks like a promising start. My next step is to make a github (I have not used it so it is worth giving it a go).
To see if I can link files using google's nifty suite of products I have set up a google site and then uploaded a file to it (and linked in a name of my own). The file is the code for hidclient.

Use my mac as the interface to the pi

On the raspberrypi.com site they had a link to a guy who showed how to set up your pi as headless. It had a decidedly windows bent. But that is OK because on the mac it is much easier :)

On the pi:

pi@raspberrypi ~ $ ifconfig | grep HWaddr
eth0      Link encap:Ethernet  HWaddr b8:27:eb:43:91:0c  

# Take that HWaddr and then log in to the router and set a reserved ip address for that address
# I set the name to raspberrypi.localnet

On the mac in a terminal session:
ssh pi@raspberrypi -X
# This will allow you to run X back to your mac through the ssh tunnel.

# Prove that it all goes through the tunnel
lxterminal
# Works but why use a lxterminal rather than the Mac Terminal program?

# run scratch
scratch
# Get a big blank screen and errors in the terminal session
Executing: /usr/lib/squeak/4.4.7-2357/squeakvm -encoding UTF-8 -vm-display-x11 -xshm -plugins /usr/lib/scratch/plugins/:/usr/lib/squeak/4.4.7-2357/ -vm-sound-alsa /usr/share/scratch/Scratch.image
XShmAttach: BadAccess (attempt to access private resource denied)
X Error: BadShmSeg (invalid shared segment parameter)
  Major opcode of failed request:  132
  Minor opcode of failed request:  3
  Serial number of failed request: 85
X Error: BadShmSeg (invalid shared segment parameter)
  Major opcode of failed request:  132
  Minor opcode of failed request:  3
  Serial number of failed request: 86
X Error: BadShmSeg (invalid shared segment parameter)
  Major opcode of failed request:  132
  Minor opcode of failed request:  3
  Serial number of failed request: 87
# Look at the errors and notice that it has -xshm as an option the errors all seem to be about Shared Memory segments so lets lose the -xshm option
/usr/lib/squeak/4.4.7-2357/squeakvm -encoding UTF-8 -vm-display-x11 -plugins /usr/lib/scratch/plugins/:/usr/lib/squeak/4.4.7-2357/ -vm-sound-alsa /usr/share/scratch/Scratch.image
# Runs dog slow but it runs!

Attached coderchimp.com to google blogger app

I have owned coderchimp.com since 2005. I am not sure why... Today I attached coderchimp.com to the google blogger app so that it is now accessible as coderchimp.com - it was a straightforward setup (2 CNAME entries) and I did not have to pay 3-4 bucks a month to host a site.

Pi setup and running

Accessible via ssh. I can run X apps with the ssh -X option. Note the SD Card sticking out - this just looks like something that will become a problem. In the previous post I mentioned that I ordered the "Low-profile microSD card adapter for Raspberry Pi" from adafruit.com to fix the issue.

Raspberry Pi

I thought it would be fun to mess about with the raspberry pi.

I bought a pi, breadboard, resistors, capacitors, led lights and a bunch of wires to start mucking about with the raspberry GPIO.

Installing Raspbian on the pi was easy (I did an Arch image as well).
I think the Raspbian is a more friendly little distro but Arch was easy to setup with only the stuff that I needed.

Adafruit has a cool little adapter to use microSD cards on the Pi and not have it stick out like the SD cards "Low-profile microSD card adapter for Raspberry Pi"

The 2 OS installs both include /dev/net/tun device so I may set up a VPN to one that I can play with as well.