Raspberry: Difference between revisions
Line 62: | Line 62: | ||
sudo fing -n 192.168.1.1/24 | sudo fing -n 192.168.1.1/24 | ||
</pre> | </pre> | ||
where /24 means 'network prefix' size 24 bits. | where /24 means 'network prefix' size 24 bits. Check wikipedia [http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing classless inter domain routing]. | ||
* [http://angryip.org Angry ip scanner] cross platform. open source. Basic knowledge on internet protocol. | * [http://angryip.org Angry ip scanner] cross platform. open source. Basic knowledge on internet protocol. | ||
Revision as of 13:09, 11 March 2013
Raspberry Pi
Miscellaneous
- Raspberry pi quick start guide
- http://elinux.org/RPi_Hub
- wifi setup
- Berryboot for multiple boots
- video player: omxplayer videofile.mp4
- mp3 player: mpg321 "my file.mp3"
- raspberry pi server
- re-run configuration
- MagPi: The Unofficial Raspberry Pi Magazine—Published around eight times a year, MapPi is a free and polished electronic magazine for Pi hobbyists.
- HTG guide to getting started with Raspberry Pi
- A month with raspbian How to change date/time.
- My youtube video demostrating GPIO function.
- N900 as a remote display
Get internet from sharing the internet from another machine
- https://wiki.archlinux.org/index.php/Internet_Share
- static iP. Set up host eth0 IP and then set up RPi IP:
- In Windows, allow Internet sharing. An IP of 192.168.0.2 will be automatically assigned to the Laptop's network card. Make static IP of 192.168.0.2 in Rasp Pi. Enter subnet mask and gateway (192.168.0.1). Also make an entry in /etc/resolv.conf with nameserver=192.168.0.1. Reboot and Rasp Pi will get Net all right.
- In Linux, An IP of 10.42.0.37 will be assigned to eth0 card. Make static IP of 10.42.0.37 in Rasp Pi. Enter subset mask and gateway (10.42.0.1). Also make an entry in /etc/resolv.conf with nameserver=10.42.0.1. Reboot and Rasp Pi will get Net all right.
- Other thoughts:
sudo nano /etc/network/interfaces iface eth0 inet static address 192.168.100.1 netmask 255.255.255.0 network 192.168.100.0 broadcast 192.168.100.255 gateway 192.168.100.254
The gateway is important and in most cases will always point to your firewalls, switch or routers IP address.
In my current setting, the host machine's eth0 has IP 10.42.0.1 (inet addr). The RPi has IP 10.42.0.37 and gateway 10.42.0.1.
$ netstat -rn Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 wlan0 10.42.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 wlan0 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
And /etc/resolv.conf may be worth to be changed too. /etc/hostname and /etc/hosts are unnecessary.
An example of /etc/resolv.conf (set up linux DNS) shown from my RPi is
nameserver 10.42.0.1
But maybe another choice is nameserver 8.8.8.8.
Some tools for discovering the IPs in a network include Fing (iOS/Android) or Scapy (python).
IP scan tools
- fing (ios, android, linux, windows). Command line usage
sudo fing -n 192.168.1.1/24
where /24 means 'network prefix' size 24 bits. Check wikipedia classless inter domain routing.
- Angry ip scanner cross platform. open source. Basic knowledge on internet protocol.
GPIO experiments
Blink a single LED
I follow the instruction in https://projects.drogon.net/raspberry-pi/gpio-examples/tux-crossing/gpio-examples-1-a-single-led/ to install gpio program/library in raspberry pi. Here is the result
- without PI cobbler: http://www.youtube.com/watch?v=xWJZRK4W13Q
- with PI cobbler: see the picture below. The soldering part is not easy for a beginner. Be sure to follow some instruction on youtube videos to begin with. Note that the white stripe is on the edge closest to the SD card.
16x2 LCD
http://learn.adafruit.com/drive-a-16x2-lcd-directly-with-a-raspberry-pi