Month: November 2018

Installing Node-RED on Raspbian for Raspberry PI

I found some problems getting Node-RED running the way I like Linux applications to work, so I determined the following steps to make it happen. Installing Node-RED on Raspbian for Raspberry PI Get Node JS installed, on raspian, install nodejs sudo apt install nodejs sudo apt install npm sudo npm install -g npm Install Node-RED using NPM sudo npm install -g --unsafe-perm node-red Auto Start Node-Red on boot https://nodered.org/docs/hardware/raspberrypi sudo wget https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/nodered.service -O /lib/systemd/system/nodered.service sudo wget https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/node-red-start -O /usr/bin/node-red-start sudo wget https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/node-red-stop -O /usr/bin/node-red-stop sudo chmod +x /usr/bin/node-red-st* sudo systemctl daemon-reload sudo systemctl enable...

Read More

Install Home Assistant on Raspberry PI

Install Home Assistant on Raspberry PI Follow the instructions on this page https://www.home-assistant.io/docs/installation/raspberry-pi/ Encountering problems with Home Assistant on Raspberry PI When running hass from the command line after other steps were complete, I had some problems and was getting errors like the following. 2018-10-14 13:12:20 INFO (Thread-14) [homeassistant.util.package] Attempting install of pychromecast==2.1.0 2018-10-14 13:12:28 INFO (MainThread) [homeassistant.components.http.view] Serving / to 192.168.2.150 (auth: False) 2018-10-14 13:12:28 INFO (MainThread) [homeassistant.components.http.view] Serving /api/onboarding to 192.168.2.150 (auth: False) 2018-10-14 13:12:37 ERROR (Thread-14) [homeassistant.util.package] Unable to install package pychromecast==2.1.0: Exception: Traceback (most recent call last):   File "/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connection.py", line 138, in _new_conn     (self.host, self.port), self.timeout, **extra_kw)   File "/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/connection.py", line 75, in create_connection     for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):   File "/usr/lib/python3.5/socket.py", line 733, in getaddrinfo     for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -3]Temporary failure in name resolution The important message there is “Temporary failure in name resolution” This indicates that there is some issue with DNS, I suspect that for me one of the mirror servers was offline. To resolve this issue, I looked for all the instances of the phrase “Attempting install of”, then run a pip3 three install of each of this from the server shell.  To be in the server shell, the commands are: sudo -u homeassistant -H -s cd /srv/homeassistant python3 -m venv . source bin/activate The extra packages I installed manually were: pip3 install PyQRCode pip3...

Read More

Checklist for Robust Linux Applications

Linux is very powerful when it is set up correctly.  Behind the scenes of Linux are 1000’s and 1000’s of Linux developers, they do lots of things to make Linux robust, and sometimes when we are working on our own projects we forget what a robust application is. Assuming that you are not developing the application from scratch because that is where robust applications begin, but deploying another application can follow this simple list to make sure that the application will stay operational for a long time. Checklist for Robust Linux Applications Install the application Setup the application Auto start on reboot of server Secure application access (set up an admin user, or change the default password) Log rotation of any generated logs Automated backup of the application configuration information Automated backup of the application data Install the application Using Debian or Red-Hat based systems, choosing applications which are available in the repositories is your best bet.  These will come with some of the following steps done for you. Setup the application While many applications will work out of the box, most applications will work better for you with a little setup or configuration, this is not customisation, you are just telling the application your preferences. Auto start on reboot of server This is critical, because when the power goes out, you will likely forget about your application and then when...

Read More

Install Raspbian Linux with Desktop (because GUI’s help people)

Using Linux opens a world of high quality and robust Open Source projects which you can use to make things happen.  Getting a Raspberry PI running in your home network is the first step to Home Automation, it is quite straightforward for anyone with a little interest in computers. This is a quick start guide to installing Raspbian (Debian Linux for Raspberry PI) onto a Raspberry PI. Installing Raspbian with Desktop onto a Raspberry PI. Getting NOOBS Installed https://www.raspberrypi.org/downloads/noobs/ Download Noobs.zip Unzip the file, e.g. NOOBS_v2_8_2 https://www.raspberrypi.org/learning/software-guide/quickstart/ https://www.raspberrypi.org/documentation/installation/sdxc_formatting.md If using exFAT on the SD card, then delete the exFAT partition and create a FAT32 partition. Put the SD card into the PI, connect to HDMI and boot, select the Raspbian Desktop image and install. Complete the OS install, using the desktop – Set password for the user pi – Setup networking, probably wifi – Access the Raspberry PI Configuration GUI by accessing the Raspberry icon -> Preferences -> Raspberry PI Configuration I suggest the following system settings – setting the hostname – Adjusting the screen resolution – Disable overscan (this will depend on your TV/monitor) The following interfaces settings are important – Enable SSH Save your changes by clicking on OK Reboot when prompted Accessing your Raspberry PI Give the pi a known IP address, some decisions to make, easiest would be use your home network device to reserve an...

Read More