OOBE w/RasPI
Goal: Just wanted to hook this thing up to power and ethernet and ssh into it. That’s all.
Tried to d/l and install
http://www.raspberrypi.org/downloads Downloaded Debian Image
Using:
Image Writer for Windows
https://launchpad.net/win32-image-writer/+download
Must manually extract. No self-installer.. Put in C:\win32-image-writer\
Unzippeded archlinux-hf-2013-01-22.zip Write archlinux-hf-2013-01-22.img to an SD card
Booted, then discovered it had no ssh out of the box. *sigh*
Did a little actual reading and discovered it archlinux-hf doesn’t ship with ssh enabled See http://www.penguintutor.com/linux/raspberrypi-headless
Looked at the Adafruit RasPi Distro – http://learn.adafruit.com/adafruit-raspberry-pi-educational-linux-distro/occidentalis-v0-dot-2
D/L’d unzipped and wrote to SD card. Power-cycled pi. Comes up. Will ask for a DHCP address on your ethernet
How to ssh onto your Pi
Some people like the putty ssh client. Others like me like poderosa. The simplest approach I find is to use the ssh that comes w/Git for Windows. Just install it then run Git Bash command line tool
How to discover the IP address allocation
You can go to your DHCP server, which is typically your gateway router and try to find it..
Or… *if* you have itunes installed you also have a magical bonjour service installed which allows for auto-discovery..
So at the command prompt you can type
ssh pi@raspberrypi.local password: raspberry Linux raspberrypi 3.1.9adafruit+ #10 PREEMPT Thu Aug 30 20:07:05 EDT 2012 armv6l The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Type 'startx' to launch a graphical session Last login: Fri Aug 31 13:37:57 2012 from ladyada301-pc.local NOTICE: the software on this Raspberry Pi has not been fully configured. Please run 'sudo raspi-config' Please change your password using 'sudo /usr/bin/raspi-config'
And *BAM* you are in.
Plug In Bar Code Reader
I wanted to mess with a bar code reader..
My generic $39 bar code scanner from amazon http://goo.gl/uRZXl
Do a tail -f /var/log/messages then plug in the scanner. You should see:
[ 2685.578555] snd_bcm2835_playback_close:167 Alsa close [ 2834.526579] usb 1-1.2: new low speed USB device number 4 using dwc_otg [ 2834.631871] usb 1-1.2: New USB device found, idVendor=05fe, idProduct=1010 [ 2834.631908] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 2834.631930] usb 1-1.2: Product: WIT 122-UFS V2.02 [ 2834.631945] usb 1-1.2: Manufacturer: WIT Electron Company [ 2834.649637] input: WIT Electron Company WIT 122-UFS V2.02 as /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2:1.0/input/input0 [ 2834.649784] generic-usb 0003:05FE:1010.0001: input: USB HID v1.10 Keyboard [WIT Electron Company WIT 122-UFS V2.02] on usb-bcm2708_usb-1.2/input0
Take note of the input0, Now go into /dev/input and you should see an event0 entry.
pi@raspberrypi /dev/input $ ls /dev/input ./ ../ by-id/ by-path/ event0 mice
Now it is just a matter of writing a little python script:
[cc lang=”python” width=370]
print “barcode scanner tests”
def k():
byte = []
f = open(‘/dev/input/event0’, ‘r’)
while True:
for bit in f.read(1):
byte.append(ord(bit))
if len(byte) == 8:
print byte
byte = [
[/cc]
Installing The Adafruit Web IDE
Then I went ahead and kept following the Adafruit instructions – http://learn.adafruit.com/webide/installation
pi@raspberrypi:~$ curl https://raw.github.com/adafruit/Adafruit-WebIDE/alpha/scripts/install.sh | sudo sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 3786 100 3786 0 0 7657 0 --:--:-- --:--:-- --:--:-- 13330 **** Downloading the latest version of the WebIDE **** % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 22.2M 100 22.2M 0 0 416k 0 0:00:54 0:00:54 --:--:-- 181k **** Installing required libraries **** **** (redis-server git restartd libcap2-bin avahi-daemon i2c-tools python-smbus) **** Get:1 http://archive.raspberrypi.org wheezy InRelease [7,737 B] Get:2 http://mirrordirector.raspbian.org wheezy InRelease [12.5 kB] Get:3 http://archive.raspberrypi.org wheezy/main armhf Packages [6,421 B] Get:4 http://mirrordirector.raspbian.org wheezy/main armhf Packages [7,403 kB] Ign http://archive.raspberrypi.org wheezy/main Translation-en_GB Ign http://archive.raspberrypi.org wheezy/main Translation-en Get:5 http://mirrordirector.raspbian.org wheezy/contrib armhf Packages [23.3 kB] Get:6 http://mirrordirector.raspbian.org wheezy/non-free armhf Packages [47.8 kB] Get:7 http://mirrordirector.raspbian.org wheezy/rpi armhf Packages [14 B] Ign http://mirrordirector.raspbian.org wheezy/contrib Translation-en_GB Ign http://mirrordirector.raspbian.org wheezy/contrib Translation-en Ign http://mirrordirector.raspbian.org wheezy/main Translation-en_GB Ign http://mirrordirector.raspbian.org wheezy/main Translation-en Ign http://mirrordirector.raspbian.org wheezy/non-free Translation-en_GB Ign http://mirrordirector.raspbian.org wheezy/non-free Translation-en Ign http://mirrordirector.raspbian.org wheezy/rpi Translation-en_GB Ign http://mirrordirector.raspbian.org wheezy/rpi Translation-en Fetched 7,500 kB in 1min 8s (110 kB/s) Reading package lists... Done Reading package lists... Done Building dependency tree Reading state information... Done avahi-daemon is already the newest version. i2c-tools is already the newest version. python-smbus is already the newest version. The following extra packages will be installed: libjemalloc1 libpam-cap Suggested packages: git-daemon-run git-daemon-sysvinit git-doc git-el git-arch git-cvs git-svn git-email git-gui gitk gitweb libcap-dev The following NEW packages will be installed: libcap2-bin libjemalloc1 libpam-cap redis-server restartd The following packages will be upgraded: git 1 upgraded, 5 newly installed, 0 to remove and 231 not upgraded. Need to get 6,206 kB of archives. After this operation, 946 kB of additional disk space will be used. Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libjemalloc1 armhf 3.0.0-3 [87.3 kB] Get:2 http://mirrordirector.raspbian.org/raspbian/ wheezy/main git armhf 1:1.7.10.4-1+wheezy1+rpi1 [5,864 kB] Get:3 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libcap2-bin armhf 1:2.22-1.2 [21.1 kB] Get:4 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libpam-cap armhf 1:2.22-1.2 [10.0 kB] Get:5 http://mirrordirector.raspbian.org/raspbian/ wheezy/main redis-server armhf 2:2.4.14-1 [213 kB] Get:6 http://mirrordirector.raspbian.org/raspbian/ wheezy/main restartd armhf 0.2.2 [11.0 kB] Fetched 6,206 kB in 4s (1,487 kB/s) debconf: unable to initialize frontend: Dialog debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.) debconf: falling back to frontend: Readline Selecting previously unselected package libjemalloc1. (Reading database ... 56026 files and directories currently installed.) Unpacking libjemalloc1 (from .../libjemalloc1_3.0.0-3_armhf.deb) ... Preparing to replace git 1:1.7.10.4-1+rpi11 (using .../git_1%3a1.7.10.4-1+wheezy1+rpi1_armhf.deb) ... Unpacking replacement git ... Selecting previously unselected package libcap2-bin. Unpacking libcap2-bin (from .../libcap2-bin_1%3a2.22-1.2_armhf.deb) ... Selecting previously unselected package libpam-cap:armhf. Unpacking libpam-cap:armhf (from .../libpam-cap_1%3a2.22-1.2_armhf.deb) ... Selecting previously unselected package redis-server. Unpacking redis-server (from .../redis-server_2%3a2.4.14-1_armhf.deb) ... Selecting previously unselected package restartd. Unpacking restartd (from .../restartd_0.2.2_armhf.deb) ... Processing triggers for man-db ... debconf: unable to initialize frontend: Dialog debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.) debconf: falling back to frontend: Readline Setting up libjemalloc1 (3.0.0-3) ... Setting up git (1:1.7.10.4-1+wheezy1+rpi1) ... Setting up libcap2-bin (1:2.22-1.2) ... Setting up libpam-cap:armhf (1:2.22-1.2) ... debconf: unable to initialize frontend: Dialog debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.) debconf: falling back to frontend: Readline Setting up redis-server (2:2.4.14-1) ... Starting redis-server: redis-server. Setting up restartd (0.2.2) ... Starting process checker: No processes defined in config file. Exiting. restartd. **** Create webide user and group **** **** Adding webide user to sudoers **** /etc/sudoers.tmp: parsed OK /etc/sudoers.d/README: parsed OK **** Adding default .bashrc file for webide user **** **** Installing the WebIDE as a service **** **** (to uninstall service, execute: 'sudo update-rc.d -f adafruit-webide.sh remove') **** update-rc.d: using dependency based boot sequencing **** Starting the server...(please wait) **** **** The Adafruit WebIDE is installed and running! **** **** Commands: sudo service adafruit-webide.sh {start,stop,restart} **** **** Navigate to http://raspberrypi.local to use the WebIDE pi@raspberrypi:~$
The WebIDE did come up at http://raspberrypi.local