Saturday, February 15, 2014

Update to the Last post.

After updating the Pi, using sudo apt-get update and sudo apt-get upgrade, I seemed to not be able to access my Pi any more by SSH over the ethernet crossover.  At this point, I gave in and plugged the Pi into my monitor and keyboard and tried to suss out what the issue was NOW.

So...in the end, I am not totally sure which is which.  I know that the ssh works when I am on the WiFi network that allows me to share the internet with the Pi.  But I am not sure if that is an exclusive thing.  I know that the SSH was disabled (or something) when I updated the Pi OS and shutdown.

The problem being that there is no clear way how to make SSH activate on start up short of going into the configuration menu again just as when I first started the device up.  In all honestly, this is more of a pain than I bargained it would be.

Still going at it.  Updates to come.

Thursday, February 13, 2014

So I recently started working on a school project that involved a (gasp) Raspberry Pi.  This was not an attempt to create a new webserver or anything so fancy, or even an attempt to control backlights for a TV - all of which are great ideas! - but communication between a remote sensor array and a communication device for human interaction.

The first issue I came across was...the PI didn't have any form of screen or keyboard...hmm.  I attached it to my TV on first boot with a simple keyboard, filled out the first time boot information (setting location, time zone, SSH)...oh yea...dat SSH.

Turns out the open source of the Pi is it's greatest downfall.  I want to boot into my Pi locally from my mac using it as development and breakout environment (sort of like an Arduino, but with more processing guts).  I searched high and low for a simple solution.  However, to my astonishment, most of them involved setting static IP addresses, setting DNS information,....just a lot of hullabaloo for something so simple.

After three tries, multiple re-installs of the OS (PiBang), as well as a lot of frustration - trust me...a lot - I finally decided to do something so very stupid.  For a last time, I ran the first time boot for the PI, set up all the necessaries - including SSH server - and rebooted.  Then I yanked out the HDMI cable and keyboard from the Pi and turned to my mac's terminal.

Now for some context.

I found it necessary to SHARE my computer's internet over the ethernet bridge.  Setting that up within the Sharing preference pane was easy, but once on my networks page, that's where I got into trouble.  It turns out that Apple - in internet sharing mode - forces the computer to adopt the ethernet IP 192.168.2.1.  Within the ethernet preference in the network panel, I set the IPv4 to Manual and entered that IP and the subnet mask of 225.0.0.0.  With that applied and saved, I plugged in the Raspberry PI's ethernet to my computer and booted the Pi.

After a few minutes - I didn't know how long to necessarily wait - I turned to my terminal and entered "arp -a", which searches all IP's linked to you computer at that time.  I saw the entry "? (192.168.2.2)...." which was reminiscent of the computer's internet sharing IP - this may vary per user, but that's what I had.  {NOTE: I also saw the IP entry 192.168.2.255, but I ignored that because 192.168.2.2 worked}
The next step was logging into the Pi.  There are plenty of tutorials covering setting your username and password for your Pi when you first boot it up, so I won't bore you with that.  I typed the SSH command "ssh -X 192.168.2.2 -l USRNAME" into the terminal and was presented with RSA key authenticity warnings.

OMG.  IT WORKED!  I agreed to all the key to be added to my list of accepted keys, and entered my password for my PI when prompted.  And that was it...I was in.

So much frustration for something so easy!

Anyway, now that it seems to be working perfectly no matter what I do (YAY :D), I hope that this little summary of my experience helps those who simply look to their PI as a development and breakout environment.  It seems there are a lot of these issues out there, and I hope this helps y'all a little more than the internet helped me!

Cheers!