I decided to go mainstream and get the PI but there is some other interesting stuff out there.
Found some articles on competing products,
This one has a GPIO breakout connector
The android OS appeals to me, since I already know how to write Android apps.
This one has an add on breakout board for IO, but says the example code "will be released". The company website is half in Korean. I'm sure it is great but it could end up being a major headache and hours of non fun debugging software and getting unsupported stuff to work. No thanks.
This one looks more promising. It has a GPIO header. $79
The previous version was trashed on newegg for being slow, unstable and useless for video
Web page is minimalist at best. That is kind of cool, but...
The forum is dead. Can only buy the new rock board from them.
I also picked up a breakout connector for the IO pins
and a plastic case
It also needs a >4Gb micro SD card. I chose a class 10 16G to try to keep the disk write time to a minimum.
It takes some digging to figure out what SD cards are faster. Retailers don't always show the speed.
I stuck with SanDisk, having worked with them in my real job they are a reputable company and they try to meet the specs they claim.
Sandisk 4GB MicroSDHC Memory Card with SD Adapter (BULK Packaging) - This one turned out to be Class 2 I think, not totally sure but there was a user post with a speed rating
This initially identical $6 card has a part number in the description. SDSDQ004GA11M
SanDisk 4GB microSDHC Memory Card
That leads me to learning it is Class 4
Finally, This card from Amazon is Class 10 for $15
SanDisk Ultra 16 GB microSDHC Class 10 UHS-1 Memory Card 30MB/s with Adapter SDSDQUA-016G-U46A
So altogether so far I've spent $74 + $6 in shipping
39 for the R PI
12 for the case
8 for the breakout
15 for the SD card
Not as cheap as you'd think. I probably have a phone charger, HDMI cable, USB keyboard/mouse I can use. But if I had to buy all that I'd be over $100.
While I wait for it to come:
Some notes on ideas of what to do with it...
- Internet connected appliance that moves something depending on web info like stocks, weather, user commands.
- Remote activated widget from smartphone
- Connect to webcam and do some image processing function.
- Drive my laser light show, the Arduino wasn't making the rate I needed.
Looking for some examples of how to use the GPIO to communicate with the real world.
Downside seems to be that it is 3.3V logic, not 5V, so interface will be different. Less voltage for some analog interfaces.
Programming appears to be in Python or C. I haven't used Python, and I'm hesitant to learn yet another coding language. It appears I can use C and linux command line. I'm hoping this doesn't turn into being a software exercise that slows down the hardware fun!
Good article on using it as a media center
Started by downloading the basic wheezy distro zip file 2013-02-09-wheezy-raspbian.zip
"To use an image file, you will need to unzip it and write it to a suitable SD card using the UNIX tool dd. Windows users should use Win32DiskImager. "
http://sourceforge.net/projects/win32diskimager/ downloaded win32diskimager
unzipped the diskimager and the wheezy download zip file.
Ran the diskimager exe and pointed the diskimager at the unzipped .img file and the new 16Gb SD card and hit write. It took a few minutes and said done. Now the SD card can't be seen by the PC anymore. I suppose that is normal but I was hoping that the SD card could be a way to transfer files back and forth.
Got the raspberry PI in the mail. Plugged in the SD card I formatted above. Plugged in the USB cable to a phone charger, used an HDMI to DVI adapter cable to plug in a monitor. Plugged in a USB keyboard and mouse. Ethernet too. Voila! It booted right up to the desktop after one setup screen. I can surf the web.
Here is the screen with the desktop and linux terminal and the browser open, it was able to see the internet with no effort whatsoever.
I'd like a virtual keyboard so I don't need the USB keyboard.
sudo apt-get install matchbox
Then to to the accessories window and keyboard is now there. A virtual keyboard pops up. This is good for remote control apps
Tried to play a youtube video, it complains about missing flash
You need to type sudo first to get permission
Got lots of errors when it ran 404 errors not found, etc.. Fail
Did some looking to see if I can run Java on this platform, so I don't have to learn Python. Seems I can but memory space is very limited
Here is a tutorial on the GPIO
This example has a different numbering scheme...
I connected an LED and 2.2K resistor between the 3.3V power and GPIO 4 on the header and I wanted to light it up.
Flailed around alot with GPIO examples, not reading carefully, trying to download stuff and failing.
I learned that I needed to do a software update to my Raspberry PI OS because all the app-get commands were failing. This turned out to be key, even though I just imaged the disk straight from the RPi website yesterday.
sudo apt-get update
Now the instructions in app-get have started working.
The definitive GPIO work appears to be this page:
This is how you install it and build it...
First install git.
sudo apt-get install git-core
Then install the libraries and build
git clone git://git.drogon.net/wiringPi
cd wiringPi ./build
Now the commands gpio -v, and gpio readall are recognized!
Looks like he numbers the pins differently than the previous examples, but at least combines a table showing all the numbering schemes. The pin I'm using is pin GPIO7.
I'm using his basic command line utility on this page to control the GPIO pins.c
I flailed a bit until I did things in exactly the correct sequence. And the LED lights up! W00t! This was a bit frustrating up to this point, mostly because the steps weren't really spelled out and I didn't do things carefully and the gpio commands don't complain when you type the arguments all wrong.
This is exactly what did the trick (after WiringPI was installed using the commands above)
gpio export 7 out <-allows it to work without being the super user
gpio mode 7 out <-- sets the pin direction
gpio write 7 0 <--note that my led is set to light up when the output is LOW
After some messing around with bash syntax, I got this bash script working that blinked the LED. Far more frustrating than it should have been. Kept getting weird echo command not found errors on commands that weren't in the file, probably due to unpritable characters I pasted out of web posts. Finally typing it by hand solved the problem.c
Here is the first code that worked to blink the LED. Hooray! Paste this into a file, chmod 777, and then type ./<filename>
gpio export 7 out
gpio mode 7 out
gpio write 7 0
gpio write 7 1
gpio write 7 0
Next I want to try the C complilation method of controlling the rpi GPIO for some more complex apps
I attempted to run the blink program in WiringPI in c code next. This is how I did it:
- cd to wiringPI/examples and copied blink.c up to the user's home directory and renamed it cblink.c
- I modified LED to output on pin 7, like my bash script.
- Then I compiled it
cc -o cblink cblink.c -L/usr/local/lib -lwiringPi
- From the users home directory where the cblink.c program is sitting I ran it.
And hooray the LED starts blinking, just like my bash script earlier!!! Win!
- I want to set up to rlogin into the Raspberry PI so it can be a remote internet appliance
- Need to set up rlogin
- Look into wifi communication, finding it on the net, sending messages, etc
- controlling remotely from a PC or smartphone is probably the ticket. Then I'd like to build an Android app that talks to it
THis guy has done some of the homework to remote control the PI
This page has info on remote login to the pi
I don't really want to go with a fixed IP address as he describes. I'd much rather set up a system where the remote control and the raspberry pi find each other on the network.
It looks like putting .rc files in /boot will run them at starup. Im not sure about this yet but I need to know how to execute code on boot for when the rpi is running as an embedded machine. Need to come back to figure this out
A couple posts on remote login from this page
This post has it pulling down messages from web sites. Although there is no explanation of how it works.
Here is a good idea. Use google docs as a drop box. The pi will create and read docs.
THese all use gspread to upload. no mention of download yet.
Setting up a webcam
sudo apt-get install libcv-dev libopencv-dev libcv2.3 opencv-doc
sudo apt-get install python-opencv
chmod +x test
sudo apt-get install scrot
This post (like a lot of mine) is just my notes as I learn, and will build as I work on this. Or it may sit and rot while I'm distracted by another project or life in general :)