Tuesday, 2 February 2016

Raspberry Pi CRASH - start again

A few weeks ago I bought a Raspberry Pi, I thought I would play with it. It was a kit from VILROS. I added to it a very small USB/Dongle keyboard. I set it up by connecting the HDMI output to my TV, plugged in the KB dongle and inserted the supplied SD Card (they said it was the latest version of NOOBS/Raspian OS!!!). I started up and the installation went well.

Then I started to try to learn about the R_PI... and Raspian/Debian/Linux/Unix, oh my goodness, how many nerds are there in the world? There is site after site on the web all giving conflicting advice about how to do this and that. In the end I loaded a few extra bits of software (for Bonjour, VNC access). I also tried Javascript. In the end my Python, C and Javascript programs have crashed. The programs do not run. They ran once, but now something has happened. All I get is inscrutable error messages. I stand no chance at all of finding the solution.

Turns out the SD card supplied was NOT the latest NOOBS/Raspian OS and was missing a lot of stuff. Lucky it worked at all really. Message to all out there: buy a blank SD Card, download the latest NOOBS from the Raspberry Pi web site and install it yourself. Then do an update and upgrade to get a clean new system.

I am starting again... follow along if you like

These instructions are what I did on my iMac, a PC may be different...

1 Find and Install SDFormatter program on your iMac / PC

2 Download NOOBS. I used the zip version (1.1GB)

3 Format the SD Card, chose "Overwrite Format", name it "NOOBS". Mine is a 7.97GB card. Format takes a while...

4 Unzip downloaded NOOBS_v1_x_x_x.zip

5 Copy all files in the folder to the SD Card using the Mac Finder, Eject the card

6 Put the SD Card into the R_PI. Connect HDMI (a TV), Insert USB KB dongle, switch on KB. Power up the R_PI. Wait for all the startup garbage to pass by on the screen...

7 Select "Raspian" OS and Install (3.1GB). Takes a while...

8 Starts up at R_PI Desktop.

9 Open LXTerm and Find the R_PI IP address

	ifconf			# find pi_ip_addr (wlan)
	sudo raspi-config	# chose command line auto-startup, reboot
Then connect by
	ssh pi@pi_ip_addr 	# connect from Mac Terminal
Which makes it easier to
	sudo apt-get update 	# of apps listed in /etc/apt/sources.list
	sudo apt-get upgrade	# upgrade all apps
	sudo apt-get dist-upgrade	# upgrade OS
	sudo apt-get autoremove	# remove unused apps
... and wait very patiently for it to upgrade.

10 Now get Bonjour working (to access R_PI as "raspberrypi.local" on your WiFi) and VNC working (to view the Desktop on your Mac/PC screen - use VNC Viewer software). There is a very good system called "netatalk" for Macs which not only allows you to login to the R_PI from the Terminal app using ssh, but also places the "raspberrypi" in the Mac Finder's sidebar so you can copy files to/from it. Install these two and then start the VNC server:
	sudo apt-get install avahi-daemon # included in netatalk?
	sudo apt-get install netatalk	 # add AFP protocol
	sudo apt-get install tightvncserver
	tightvncserver	 # and create a VNC login password
Now access the R_PI from your Mac Terminal, give the password "raspberry"
	ssh pi@raspberrypi.local
	password: raspberry
Screen Shot 2016 03 05 at 19 36 08

and use VNC by starting a VNC server channel on the R_PI command line, first launch the server, screen "0"
pi@raspberrypi:~ $ vcnserver :0
second, start the VNC Viewer program on your Mac and connect to raspberrypi.local. Create your own password.

Screen Shot 2016 03 05 at 19 36 20

After all that

I am back to ground zero and have to start my app writing efforts all over again. Wouldn't it be nice to have a solid, stable computer to do it on. Maybe this version of NOOBS/Raspian will be better...

No comments: