paultclark.com

Raspberry Pi

Ok you heard about a $35 computer. Well depends on how many spare parts you have lying around. So technically, its $35 and some parts.

Notes:

  • Identify how you are going to use it. You may need a 32 GB Class 10 SDHC. The SD card is your hard drive (HDD), unless you mount an external via USB.
  • You will have to understand another operating system (OS). This is not Windows or Ubuntu. You will have to use command line interface.
  • You may have to install the OS more than once. Persistance wins. This is a do it yourself project.

Parts for Model B:

  • The raspberry pi. I bought the Raspberry Pi Model B Programmers Kit from Micro Center, If they were in stock I would have bought the Raspberry Pi Model B Starter Kit. Both are above the $35 but you will need a power supply and a SDHC card.
  • SD card. Don't buy any 8GB, use this list. You will want a Class 10 and I recommend 16GB.
  • Power supply, make sure it is at least 700mA at 5V.
  • USB wired keyboard. You can go wireless, results may vary.
  • USB wired mouse. You can go wireless, results may vary.
  • Display / monitor.
  • Cable to connect your display to the HDMI input on the pi.
  • Speakers, if you need sound.
  • Cable to connect your speakers to the 3.5mm input on the pi.
  • Network cable.
  • If you do not have all of these parts lying around, then you may want to consider Raspberry Pi HDMI Cable Accessory Kit
  • USB Powered Hub, depending on what you are going to plug into it. You may wnat to use this list.

What to do:

  • Don't plug it in, not yet.
  • Skip this step if you have a SDHC card with the OS on it. Install OS on the SD card using a non-pi computer. I was unable to get their formatting tool to work, so I used Microsoft's. I chose NOOBS Lite.
  • Assemble the parts.
  • Plug it in.
  • I chose Raspbian. The install will take a while.
  • Once you get to the configuration screen
    I recommend leaving the Boot to Desktop alone.
    Set the time zone in internationalisation options.
    Set the hostname in Advanced Options.
  • Default username and password.
  • Should be at command line.

SMTP - How to
Your mileage may vary. This is how I did it.

  • sudo apt-get update
  • sudo apt-get install ssmtp
  • sudo apt-get install mailutils
  • sudo vi /etc/ssmtp/ssmtp.conf
      root=postmaster
      mailhub=smtp.gmail.com:587
      hostname=rasppi2
      AuthUser=YourGmailUserName@gmail.com
      AuthPass=YourGmailPassword
      FromLineOverride=YES
      UseSTARTTLS=YES
                  
  • Let less secure apps use your account
  • echo "Hello world email body" | mail -s "Test Subject" recipientname@recipientdomain.com

SNMP - How to
Your mileage may vary. This is how I did it. If you follow the attached links, you will see they did it slightly different.

  • sudo apt-get update
  • sudo apt-get install snmpd
  • sudo apt-get install snmp
  • sudo apt-get install snmp-mibs-downloader
  • sudo download-mibs
  • sudo vi /etc/snmp/snmpd.conf
    • agentAddress udp:161
      ipv4 only, dont turn on ipv6 instance unless you have installed ipv6 already
    • rocommunity public localhost
      gives localhost read access using a password of \"public\" w/o quotes
    • rocommunity something 10.0.0.0/8
      gives anyone on 10 network read access using a password of \"something\" w/o quotes
  • sudo vi /etc/snmp/snmp.conf
    • #mibs
      add # symbol to mibs line as file states
  • sudo service snmpd restart
  • ps -A | grep snmp
    • should yield pid and snmpd
      if not, view /var/log/syslog for errors
  • snmpwalk -v1 -c public localhost sysName.0
    • assumes the password is public
    • assumes you are on localhost
    • returns your hostname, e.g. rasppi2

Commands:

  • startx
    This starts your graphical user interface (GUI).
  • sudo fdisk -c /dev/mmcblk0
    p
    This displays how your SD card is formatted.
    For example: Disk /dev/mmcblk0: 4012 MB, 4012900352 bytes. Pi thinks this a 4GB card.
  • df -h
    Show in human readable format my disk usage.
  • sudo shutdown now
    A proper way to turn it off.

Useful links: