The Script Step By Step

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…

JessieFor latest updates on "the script" which now supports Raspbian "Stretch" - here's the main article.

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, 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 “./” 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 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 – 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…


47 thoughts on “The Script Step By Step

  1. Hi Peter,

    I've just run THE script in a new Pi and everything worked fine. Thank you!

    One hint just in case you don't have a HDMI and mouse at hand (like me). Once the Jessie OS image is created in the SD card, create an empty file called ssh.txt. Then move the card to the raspi and it will allow SSH connections and you can use winSCP.

    Then you can connect by ssh and type "sudo raspi-config" and make several adjustments like, users, passwords, activate interfaces, etc.

      1. Pi3 full raspbian jessie.

        Btw, I read some time again you were porting your ESP code to Arduino IDE. Is that progressing?
        I'm quite familiar with Arduino IDE, but Eclipse is a new (big) world for me...

        Regards from Spain!

        1. There is very little programming difference... Eclipse is just an editor - granted, Makefiles are not easy but there are many projects already done that you can take as a base.

      2. AFAIK, the file should be named just "ssh", no extension, is in standard raspbian docs:


        For headless setup, SSH can be enabled by placing a file named ssh, without any extension, onto the boot partition of the SD card. When the Pi boots, it looks for the ssh file. If it is found, SSH is enabled, and the file is deleted. The content of the file does not matter: it could contain text, or nothing at all.

    1. Hi it is possible as I've not tested the I2c on a Pi3 (recent addition) that there is something peculiar about the Pi3 and I2c).

      In the /home/pi/.node-red/.settings.js there are TWO lines that refer to i2c - just comment them out...


  2. from now on, everyone please upload the logs somewhere when you ask for help... i added their generation to let you have a better help and we go less blind in the dark without needed info... more will be added, testing going on...

    p.s.: the script can even be run without actual making it executable, by just running it as "bash"

  3. an other good tip, in case of Raspberry Pi 0 and 0W, is their setup via usb networking... practically they will use the pc connectivity via an emulated network adapter on the OTG microusb socket, so even the PI 0 (NO connectivity AT ALL...) can go on the net...

    and of course you can then run The Script, but be prepared to a 2 or 3 hours run: they're equivalent to the RPi1...

    1. If you put a "wpa_supplicant.conf" into boot partition, this will be copied to the right directory (/etc/wpa_supplicant/) at boot.


      ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev


      Change ssid/psk as your needs but dont remove the ->"<-.

      Including the "ssh"-file you are able to completely configure the Pi headless.

  4. One good thing about external antennas is longer range. I have an application that was juuuust out of reach of my WiFi base station, and an external antenna solved the problem.

  5. Hi,
    I can't make that script finish on my Orange Pi Zero. It freezes mstlu during or after installing node red or nodes. I'm running it on a fresh system. Updated or not. Should i make some additional preparations?
    I'm using Armbian Debian Jessie. 32GB Samsung Evo SD Card.

    1. Hi,
      Same problem with me.
      Have made a screenshot with the last line...
      You can also see that the script obviously cannot write the logfile...
      Thanks for advice how to solve this.

        1. how did you run the script?

          from what folder?
          Pi home
          which user?
          which command line?

          i see /home/pi//home/pi which is WRONG...
          Then what would be right?

          Thanks from a linux newbie!

              1. no, you did not run as it's impossible to run a script as such unless you added the current folder to the path, never to be done on unix... nor you run ./, or bash you run /home/pi/, and that's why you get that double /home/pi//home/pi
                please run the script as it's supposed and advertised to be run...

            1. It's working now! Started script again with


              Don't know what this user/pi/user/pi thing was about...
              Now I have to know where (with complete path) the user credentials including passwords are located since I must change these data...
              Thanks for hints!

              1. why didn't you changed them during script running?
                anyway, open script, look for the relevant part (example, the node-red setup), and you'll find where are the files, how credentials are generated, etc... you can't just rerun the script to change them, as this works only first time, for the way they are generated by the various services...

  6. Hi,
    I am new in this mater (this is my first time with MQTT).
    I just install the ubunto in VM and run the scrpits, every thing run very well thank you.
    The Node-Red use for MQTT the localhost ( work also very well.
    Now I want to use a sonoff but sonoff cannot see this IP, I don't know where and how should this name defined.
    Can you please help me.

      1. Hi Pete,

        Thank you very much for quick answer.
        I am using the Sonoff-Tasmota and I am getting the following messages:

        18:47:51 mDNS: Query done with 0 mqtt services found
        18:47:57 MQTT: Connect FAILED to, rc -2. Retry in 10 seconds
        18:48:08 MQTT: Attempting connection...
        18:48:09 mDNS: Query done with 0 mqtt services found
        18:48:15 MQTT: Connect FAILED to, rc -2. Retry in 10 seconds

            1. first of all: are you able to identify the ip address of the vm? Login as whatever you want, then do just:
              and look for the ip address associated to the interface which is NOT "lo"...
              then put THAT ip in your sonoff mqtt configuration, nothing else...

              second: check with whatever virtualization hypervisor you're using and see if the virtual network switch to which is connected the virtual interface associated with the vm is BRIDGED to the physical one, or is NATted... if it's nat, you can only enter in it via your pc and your vm can access it and surf the net, period... in worst scenario, you have a HOST ONLY networking interface, which allows strictly and only communication between host and vm, the vm cannot even surf...

          1. Now I give for the sonoff the user "admin" then I got the communication with the MQTT. I thought that no admin user should be assigned to the sonoff.
            Thanks, I it is great.

  7. Peter I am trying to run xginx with the script. I tried moving the apache server to port 8080. Which worked and did work. I now have your page on and on:80 as well.
    Help please. I am trying to get xginx which will not start to recieve thing for dataplicity which are send from iFTTT. Thanks in advance, and much appreicated.

    1. I usually try to avoid commenting on things I know nothing about - and nginx as an alternative to Apache is one of them. Dataplicity is another and I've only briefly looked at IFTTT. I'll leave further comments to others.

  8. Hi Peter. Ran the script multiple times on a pi3 with raspbian stretch. Script finishes and then after reboot, node-red works for a bit and then stops. When trying to run from cmd line, i get the following:

    Starting as a systemd service.
    Started Node-RED graphical event wiring tool..
    Error loading settings file: /home/pi/.node-red/settings.js
    Error: Cannot find module 'i2c-bus'

    Any ideas?

      1. Thanks MrShark. I did this and then was prompted with a similar message that indicated 'Moment' was missing. I then installed 'npm install moment' and node-red started but all of the additional nodes the script had installed were now missing. btw, I do have the latest version of the script.

        I've just noticed Peter seemed to have commented on this although oddly his response is way up in the thread (out of chronological order). He mentioned to comment out two lines related to i2c in the settings.js file. I'll try that next.

    1. Thanks for the added detail Peter. I'm definitely using the latest version of the script (confirmed twice). Just a quick recap of what i'm doing to see if something stands out.

      Burn Raspbian Stretch image to disk
      Start it on Pi3 and log into Desktop
      Set Wifi password and enable SSH via Raspi Config (also set locale, keyboard, Timezone)
      Set password on PI user due to warning after enabling SSH
      From PC:
      Connect to Pi directory via WinSCP (PI Creds)
      Create '' at root of Pi directory
      Open it via notepad++ and pasted in raw script
      Set the EOL to Unix then Save
      Edit properties and grant execute to 'Owner'
      SSH into the PI
      start the script './'
      Node-Red console and dashboard work.
      Install additional node - works
      All looks good.
      Then, I open Webmin portal and almost immediately Node-Red stops.
      I realized that in each of the times i've tried it, that's what happens. I'm not completely certain that it has something to do with launching Webmin but it does look like there's a correlation.

      Ring any bells?

      1. Ok, I think it's not webmin related now. I'm adding the node-red-contrib-alexa-home-skill node. After installation, I import a flow from my clipboard that was previously working on an past PI. When I deploy, I get an error that the server has lost connection. At that point, it appears that node-red has crashed and I get the same error codes when trying to start it seen in my previous posts. I'll continue investigating. I've snapped an image of my PI (post script run but just before the problem) so I can repeat the situation fairly quickly. I may shift over and try this on a VM to see if I can repeat. That might make it much easier to troubleshoot.

  9. ok, i've now installed the script on a VM of Ubuntu following exactly the steps outlined in your earlier video. All installed, All runs including node-red. I've taken snapshots with VirtualBox so I can repeat the issue. I've now narrowed it down to this. If I install any additional node whether by cmd line (npm install ...) or by the 'Manage Palette' feature, then stop NR and try to restart or reboot, I'm back to the same error (below). Prior to installing any additional nodes, i can build flows, deploy them and they run fine. I can reboot, no problem. I'm completely stumped. I've tried turning logging up to trace but no that has provided no clues. At least nothing obvious. Any other suggestions?

    Starting as a systemd service.
    Started Node-RED graphical event wiring tool..
    Error loading settings file: /home/pi/.node-red/settings.js
    Error: Cannot find module 'i2c-bus'

    1. already answered: install that module or remove that line...
      publish your node-red logs somewhere so we can take a look, anyway...
      but could be just a bogus module recently updated that's causing the error... script always try to install latest...

      1. Thanks for the help MrShark. I was probably unclear in my last message. On both the PI and on my VM the script finishes and all appears to run fine. I can stop/start NR without issue. I can reboot without issue. But as soon as I install ANY net new node, node-red won't restart. (i've tried at least 5 different times by restoring the VM snapshot to a known running state and installing any different node)

        Here are the script logs from my RPI3 install and Ubuntu install. Thanks again.


        1. on both i see NPM version 5.4.2, while it's clearly advertised at script beginning to NOT update it...


          and there's a bug in java install on raspbian stretch, we'll take a look...

          1. Antonio is right - big notice at the top of the script not to select that update. I've removed the NPM update option from the menu for now - I've never felt the need to use it anyway. As for Java and Raspbian Stretch... for now I'm at a loss as my notes say 10/08/2017 I installed the script on a new Stretch-equipped Pi3 without a single error.

  10. Gentlemen, thank you so much. Terribly sorry I missed the the message up front in the script. I ran again today without the npm update and it works like a charm. Again thanks for your valuable time.

Leave a Reply

Your email address will not be published. Required fields are marked *