Wednesday, August 15, 2012

Raspberry PI – Learning LINUX



A reader commented: “The good and bad is that it uses Linux and various languages that look fairly cryptic to me.”

Yes, there is a bit of learning curve with Linux, but if you liked the old DOS command world, Linux is learnable. That is what I like about the rPI, there seems to be lots of support for it and if 100's of Ks of them get out there, there will be lots of howtos and examples.

You can read a lot about LINUX here (and in the links from there): http://en.wikipedia.org/wiki/LINUX

All LINUX versions (aka distributions or distro's) include at least a command line interface (like good old DOS) and some include a Graphical User Inerface or GUI - the rPI has both.

Most *nix commands are very short: ls, cat, cp, etc. because it started when an ASR-33 was the console of choice! Test - who are these guys:
     http://icedfire.mine.nu/unixthings/unix_port.jpg

All Linux configuration stuff is done via flat text files. With a GUI, there are sometimes tools to change the config setting with buttons, etc., but you can do anything on Linux from the command line. When DEC started doing popular OS's for schools, etc like OS-8, TOPS-10, RSTS, etc. the commands were made more human readable like copy, type, etc. Then Bill Gates (who learned to program on TOPS-10) just copied the DEC commands 1:1 with DOS.

When you get the rPI up at the command prompt "$", here are some things to try.

This command will display a refreshing screen with all the running processes (ctrl+C to get out)

  $ top

This command will display commands "apropos" to what you want to do

  $ apropos memory

This will display free memory

  $ free

If you want more detail on any command (enter to go one line down, space to go a page, q to quit)

  $ man free

If you want to edit a file

  $ nano file.txt

If you want to see the contents of a file

  $ cat file.txt

cat is short for Concatenate, the command can be use to Concatenate files, but with one argument just Concatenates a single file to standard output, which is the screen. Every command does a lot of things... it's the UNIX way

Note how you can string Linux commands together, you can even feed output of one to the next. For example

  $ ps -A | grep apache

The ps command will show all running processes with the -A switch The "|" pipes the output of the command to the grep pattern search, which searches the output for the pattern "apache" The result is that it will show you the process detail of all the web server processes A Process is just a program that is running in the background, with no I/O to a terminal.

   $ sudo (any command) 

gives the next command root privs, the "pi" user does not normally have the ability to accidentally or on purpose change system files. This is one of the things that makes Linux a lot more secure and safe than Windoze

Here is a tutorial of more commands:

http://www.embeddedheaven.com/online-linux-tutorial.htm

Ignore the part about "Starting an Xterminal session" in the intro, when you boot the rpi you are already at the command line.

I spent MANY hours working with UNIX (and other) systems at the command line, only it they used to cost $100's and filled a room. Now the rPI costs $25 and is the size of the credit card. I am amazed!


Eric Pierce VA3EP - See the Disclaimer in the Introduction

© Eric Pierce and "VA3EP Amateur Radio And Other Geek Pursuits", 1952-2099. Unauthorized use and/or duplication of this material without express and written permission from this blog’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to Eric Pierce and "VA3EP Amateur Radio And Other Geek Pursuits", with appropriate and specific direction to the original content.

Tuesday, August 14, 2012

Raspberry PI – First Boot

There are a LOT of different LINUX options

http://elinux.org/RPi_Distributions


I think that I will stick with Raspbain:

"... Raspbian the easiest to use, most stable and best performing Linux distribution available for the Raspberry Pi."


You can get Raspbian here: http://www.raspberrypi.org/downloads

I used the "Easy Way" here: http://elinux.org/RPi_Easy_SD_Card_Setup

The 1st time you do not beed a username and pwd, thereafter you can log in as

  Username: pi  
  Password: raspberry

When you 1st boot Raspbian, you can skip any of the config steps at this time (unless you have a large SD card, I think there is an option to expand it).
Then you need to change the KB from GB to US (or the key mapping is wrong). This did NOT work when I tried the condig option (above - maybe finger trouble)
Use the command

 $ sudo nano /etc/default/keyboard

and edit the GB to US, then ^X to exit and save. You need to reboot for this to become effective

You can reboot with

 $ sudo shutdown -r now

You can change the password at the command prompt with command

 $ passwd

You start the GUI with

 $ startx



Have Fun!


Eric Pierce VA3EP - See the Disclaimer in the Introduction

© Eric Pierce and "VA3EP Amateur Radio And Other Geek Pursuits", 1952-2099. Unauthorized use and/or duplication of this material without express and written permission from this blog’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to Eric Pierce and "VA3EP Amateur Radio And Other Geek Pursuits", with appropriate and specific direction to the original content.

Monday, August 13, 2012

Raspberry PI – Ordered and arrived

I went to the Newark site the other day to see if they had updated the date they would be available, and it said there were 4 IN STOCK. No kidding!

He who hesitates is lost, so I immediately ordered the 4 of them and they are now on the way by UPS (according to the email I got this AM).
BTW, the restock date is now showing as 30 Sep, 2012!

THEY ARRIVED - Have not had more than a few minutes to play with it, but it is easy to get going, and there are LOTs of possibilities.
For $35 it is the biggest bang for the buck I know of for a single board computer.


Eric Pierce VA3EP - See the Disclaimer in the Introduction

© Eric Pierce and "VA3EP Amateur Radio And Other Geek Pursuits", 1952-2099. Unauthorized use and/or duplication of this material without express and written permission from this blog’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to Eric Pierce and "VA3EP Amateur Radio And Other Geek Pursuits", with appropriate and specific direction to the original content.






Sunday, August 12, 2012

Raspeberry PI – Books

A reader passed this link on:


There are other books out there as well:



Eric Pierce VA3EP - See the Disclaimer in the Introduction

© Eric Pierce and "VA3EP Amateur Radio And Other Geek Pursuits", 1952-2099. Unauthorized use and/or duplication of this material without express and written permission from this blog’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to Eric Pierce and "VA3EP Amateur Radio And Other Geek Pursuits", with appropriate and specific direction to the original content.




Raspberry PI - Lots of Links To Information

** Updated Sep 8, 2012 **

One of my work habits when goggling around learning something is to keep a Gmail draft with links and sometimes notes to prevent the problem of finding something and then NOT being able to find it later.
I have decided to put these here instead of in a Gmail draft, as I can edit in place to add more later. Some of these may generate new blog entries later.

Main sites
========
http://www.raspberrypi.org  <= check often, lots of good stuff!
Press
Reviews
======
Setup
=====
     set up SD card - Username: pi Password: raspberry
     change kb =>  sudo nano /etc/default/keyboard
Remote term
=========
Xterm
====

Web Server
========
      apt-get update <= needed to do this
      -- fix-missing   <= not this

GPIO
       http://nickhumphreyit.blogspot.ca/2011/10/buildbot-install-error.html   need to install python dev 1st
http://code.google.com/p/raspberry-gpio-python/downloads/list
      Raspbian package for Python 3 /  Raspbian package for Python 2
https://projects.drogon.net/raspberry-pi/wiringpi/

Serial
=====
http://pyserial.sourceforge.net/pyserial.html  python serial 2 and 3
      MAX3232CPE    

TTL 5 V to 3.3 V 3v3
===============
Out
    ULN2803A / 74HC14N
In

Out/In

Loff
http://e2e.ti.com/support/logic/f/151/t/118676.aspx
      Ioff - The maximum leakage current into an input or output terminal of the device, with the specified voltage applied to the terminal and VCC = 0 V.The Ioff protection circuitry ensures that no excessive current is drawn from or to an input, output, or combined I/O that is biased to a specified voltage while the device is powered down.
Books:
=====

Linux / Debian / Raspbain
=====================
http://www.nixtutor.com/linux/all-the-best-linux-cheat-sheets/   cheat sheet collection
http://files.fosswire.com/2007/08/fwunixref.pdf   cheat sheet *** nice ****

LINUX commands
=============
cat /proc/cpuinfo - see board rev

Programming
==========

Python 2 3
=========
Both python 2 and 3 from command line
$ python3 -V => Python 3.2.3
$ python -V => Python 2.7.3rc2
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=14849
     If you are learning Python, use Python 3 (IDLE3), not 2.X (but a lot of old code is still 2.X)
     There are some differences in 3 (language "cleanup") that make 3 not totally backwards compatible with 3
http://www.swaroopch.org/notes/Python  A Byte of Python - BEST place to start (use version 3 if starting)
http://docs.python.org/release/3.0.1/tutorial/ More detailed Python Tutorial
http://wiki.python.org/moin/Python2orPython3  Good description of why the differences in 3.X
http://www.python.org/  Official Website, tons of info
http://en.wikibooks.org/wiki/Non-Programmer's_Tutorial_for_Python_3  
http://research.cs.queensu.ca/home/cisc121/2011w/slides/Intro2-4up.pdf   python 2 vs 3
http://docs.python.org/library/functions.html#print      from __future__ import print_function
http://infohost.nmt.edu/tcc/help/pubs/python/web/print-as-function.html 
    from __future__ import print_function
    print(*args, sep=' ', end='\n', file=None)
http://en.wikipedia.org/wiki/Shebang_(Unix)
http://stackoverflow.com/questions/2429511/why-do-people-write-usr-bin-env-python-on-the-first-line-of-a-python-script    #!/usr/bin/env python
http://stackoverflow.com/questions/7670303/purpose-of-usr-bin-python3
Python GUI
=========
http://en.wikipedia.org/wiki/Tkinter  Python's de facto standard GUI
http://www.pythonware.com/library/
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=32&t=14627
Decided to rewrite my GUI in wxglade. Then generate the python code for that from within wxglade.
http://www.udacity-forums.com/cs101/questions/62056/gui-builder-for-python
http://forums.devshed.com/python-programming-11/easiest-gui-builder-for-python-653893.html 
http://en.wikipedia.org/wiki/Qt_(framework)
http://wxpython.org/screenshots.php   python gui
http://easygui.sourceforge.net/
PWM
====

Assembler programming
=================
http://arm-assembler-for-raspberrypi.posterous.com/lesson-1-hello-world
Schematics/Data Sheets
==================
http://www.raspberrypi.org/wp-content/uploads/2012/04/Raspberry-Pi-Schematics-R1.0.pdf
http://infocenter.arm.com/help/topic/com.arm.doc.ddi0301h/DDI0301H_arm1176jzfs_r0p7_trm.pdf   
     ARM 11 CPU
http://www.designspark.com/files/ds/supporting_materials/Broadcom%20BCM2835.pdf  
     BCM2835 ARM Peripherals 

LCD
===
http://www.raspberrypi-spy.co.uk/2012/07/16x2-lcd-module-control-using-python/   Hitachi HD44780 LCD

Pyserial
======
http://pyserial.sourceforge.net/pyserial.html 
    python setup.py install
    python3 setup.py install

Courses
======
http://www.udacity.com/view#Course/cs101/CourseRev/apr2012/Unit/671001/Nugget/675002

Sound
=====
http://www.raspberrypi-spy.co.uk/2012/06/raspberry-pi-speakers-analog-sound-test/

Music
====
http://issuu.com/themagpi/docs/the_magpi_issue_2_final

APRS
====
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=36&t=12906
http://wiki.ham.fi/Aprx.en
https://www.google.ca/search?q=%22raspberry+pi%22+aprs&sugexp=chrome,mod=5&sourceid=chrome&ie=UTF-8

Blogs
====
http://www.doctormonk.com/search/label/raspberry%20pi   I2C / servo  / etc

HDMI to VGA
==========
http://www.ebay.ca/itm/HDMI-Male-VGA-Female-Video-Cable-Cord-Adapter-1080P-PC-Notebook-/310401781443?pt=US_Video_Cables_Adapters&hash=item4845634ec3#ht_2262wt_1271

GPS
===
http://en.wikipedia.org/wiki/Gpsd
http://www.catb.org/gpsd/index.html

GPIO
====
http://www.adafruit.com/blog/2012/08/28/adafruit-ultimate-gps-on-a-raspberry-pi/   use old motherboard connectors for connecting to header!!!!!

Raspberry PI Ham Radio
==================
http://amateurradiopi.com/forum/viewtopic.php?f=4&t=123&sid=dfdfa7bc23d8b226708cf7edb562e25b  
     Raspbian “wheezy” Version dated 8/16/2012 has the ax25, mkiss, rose and netrom modules included in the compile.
http://184.4.145.55:800/docs/Raspberry.html   RMS Gate on a Raspberry Pi


Educational, Tutorial  Links
====================

http://www.cl.cam.ac.uk/freshers/raspberrypi/   looks really good


Misc
====
-------------------------------------------------------------

Eric Pierce VA3EP - See the Disclaimer in the Introduction

© Eric Pierce and "VA3EP Amateur Radio And Other Geek Pursuits", 1952-2099. Unauthorized use and/or duplication of this material without express and written permission from this blog’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to Eric Pierce and "VA3EP Amateur Radio And Other Geek Pursuits", with appropriate and specific direction to the original content.

Friday, August 10, 2012

Raspberry PI – What Is It


A reader commented:  “What I need as an old geezer is a practical overview of what this new stuff will do for me...”

Well, the beauty is that it is an entire computer the size of a credit card that will run Linux for $35, you can then program in almost any language, including basic.

Linux handles all the heavy lifting: file i/o, Ethernet i/o, real time interrupts, clocks and timers, etc, so you can focus on the programming.

There is a cable to bring out hardware I/O, so you can read/control anything without a lot more HW.

A LOT of bang for the buck. You can do the same on an old PC, but since it seems to be getting a lot of support in schools, there are already lots of example code and how-tos, and will be a lot more.


Eric Pierce VA3EP - See the Disclaimer in the Introduction

© Eric Pierce and "VA3EP Amateur Radio And Other Geek Pursuits", 1952-2099. Unauthorized use and/or duplication of this material without express and written permission from this blog’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to Eric Pierce and "VA3EP Amateur Radio And Other Geek Pursuits", with appropriate and specific direction to the original content.



Thursday, August 9, 2012

Raspberry PI - Looks Interesting


There seems to be a lot of interest in the new Raspberry PI single board computer, so I decided to check it out.

I am starting to see how cool they are. It is a very interesting for a $35 computer! It looks like there is a lot of critical mass developing on these, which means lots of people doing cool things with sw and hw to give lots of examples.

Looks like it is coming available again:


They are available from this Canadian supplier, further stock expected to ship 5 Sep, 2012.


Here is a free online mag:

http://www.themagpi.com/

You can build a a multimedia box for your big screen tv...


They are also working on porting Android to it:


You can tap into the rPI General Purpose I/O pins using something like
 this to control stuff with Python, Bash, and C programming languages:






Getting very interesting indeed.


 

Eric Pierce VA3EP - See the Disclaimer in the Introduction

© Eric Pierce and "VA3EP Amateur Radio And Other Geek Pursuits", 1952-2099. Unauthorized use and/or duplication of this material without express and written permission from this blog’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to Eric Pierce and "VA3EP Amateur Radio And Other Geek Pursuits", with appropriate and specific direction to the original content.