I thought it might be useful for beginners to go through the installation of Raspberry Pi 2 Jessie (July 2017) and “the script” – so here goes… I’m also doing this to help a friend who had issues installing the script on a Pi late last night, most likely due to network issues…. short answer is - this works…. read on…
Using this download link to the official Raspberry Pi site, grab the zip file for Raspbian Jessie with Desktop. This is a huge file at 1.54GB so it may take some time depending on your connection.
Meanwhile, also grab “the script” from the link above. I recommend a good quality SD – something like a Samsung or Sandisk and I usually use 16GB microSDs from one or the other of those two.
Everyone has their favourite tools, on Windows 10 I use SDFormatter to ensure the disk is formatted, then Win32DiskImager to do the actual copying of the image file onto SD.
So while waiting for the file to download – let me remind you what the script does:
Firstly it installs a bunch of prerequisites – so that it can then install or make sure is installed (further options are available):
Apache with PHP
Mosquitto MQTT and clients
Node-Red (and many NODES including my own BigTimer and others)
These tools can be used for many purposes but essentially this was put together to support a DIY home control setup of the kind often discussed on this blog.
On installing and powering up Jessie I noted that with an HDMI adaptor connected and an Ethernet cable connected, the Pi was fully connected to the outside world but would NOT SCP from Windows. A shame as many other boards will do that right from the start, allowing headless connection. However.. I attached a mouse to the Pi and went off to check out the Configuration utility. I enabled SSH in the utility at the press of a mouse - and now without rebooting, could use WinSCP to connect to the Pi as user pi password raspberry.
Now I was where I wanted to be! In the WinSCP window – and in the PI directory I created a new file called script.sh, copied the script across – and saved the file – ensuring it was in Linux (not PC) format as regards CRLF. I use Microsoft Visual Studio Code for editing such files and on the bottom you can click on CRLF and set that to LF mode – which simply strips the CR from each line as Linux prefers. Notepad++ has such an option hidden away in the edit menu. Normally I have to add execute permissions for the script but it seems that in this case, that is the default for the PI directory.
I opened a terminal (Putty) in WinSCP and noted the temperature at 48c. I started off the script as “./script.sh” without the quotes. Within a minute, the menu came up and I left as defaults except to add HABRIDGE at the bottom… and to remove the incredibly space-wasting WolfRAM and Office as I had no need for them. I selected ok, gave the board a name (pi) and filled in the request for user and admin passwords and left the software to run. How long absolutely depends on the board and the Internet connection but it is not worth looking in until after at least half an hour has transpired. I noted after a few minutes that the temperature was up to 54c. By comparison The little NEO Air generally does the script at 38c but I’ve seen boards as high as 70c. In this case I have the tiniest heatsink on the Pi2 main processor – same size as the chip.
After 1 hour and 3 minutes and with core temperature at 52c, the process finished. A quick look back through the Putty screen showed no problems at all.
The next step was to use “sudo reboot” to set everything into place.
After a minute I popped up a browser…
http://pi - showed a simple web page I use as a test
http://pi:82 – showed the HA-Bridge installation
http://pi:1880 – showed Node-Red with all the nodes I’d expect – and dropping an MQTT node into the default flow – giving it 127.0.0.1 as the address and admin username and pass as set up when running the script showed MQTT to be running perfectly. Attempts to run the serial port in Node-Red showed not connected. To fix this required root access and so I went into the terminal as pi and changed the root password to a useful one. I then SCP’d into the terminal as root so I could access files without restriction.
I went into raspi-config, disabled the shell monitoring and enabled the serial port. The board insisted on a reboot at this point. After reboot I found that the serial port worked in Node-Red as expected with a green “connected”.
http://pi:10000 should have shown webmin but did not work.
At this point – a quick look in the /home/pi directory showed a log file which the script had made… in this instance called script.sh-2017-07-24_08h29m.log – there are some warnings in there which are not relevant – the only ERROR as such was to do with WEBMIN – this happens from time to time as whatever they use as a server isn’t 100% reliable. I ran the script again – unticking everything except Webmin… I ran the script… it installed no problem – quick reboot – running.
All done. The script which WAS marked “experimental” is now called “the script” – and the original how has “old” added to it. Next stop… the new FriendlyArm NanoPi Neo Plus2…