Friday, August 20, 2021

Home Automation - Pi Hub

I was very happy with the centralized Pi based Smart Truck / openHAB architecture. 

Alas leaky roofs and monsoons were too much for the system and I have been using paleolithic switches to turn my lights on and off.

I am planning a system that uses a headless Pi and remotely located ESPxx communicating using MQTT and node red.

It should be far more flexible. Involve a lot less copper and be much more tractable when it comes to custom applications. I dont care how pretty the UI is. 

"And so ... (to coin a phrase) lets get started." 

I started with a fresh install of Kubuntu 21.04. Ubuntu had been buggy and annoying whereas last time used Kubuntu it seemed a lot less cluttered. I want this project to be focused slow and thorough. The roof still leaks so the ceiling project must proceed accordingly but the electronics can be deployed prior. 

Kunbuntu is being a bit naughty. 

Connection is buggy - speed is fine but it keeps dropping out Deactivating and asking for the password. The password doesn't have to be reentered. Just click through. Going to try a slow Torrent to see if it is a workaround. Transmission isnt used in Kubuntu. Ktorrent is the client. It looks good but I haven't used it before. 

Arduino IDE wont launch. Not just me apparently - reports of this from IDE 2.0. I dont know what version Discovery installs.

now..

Ktorrent wont launch.  Ktorrent did launch as the application for the Kubuntu LTS download and I throttle it back to 100kBps (10 hour d/l) to see if the Network will stay active. So far so good after half an hour.


Build a Developer's Linux Workstation - Complete Guide

I will build this on the NUC. 

error: /boot/vmlinuz-4.4.0-141-generic has invalid signature.
error: you need to load the kernel first.

On attempt boot from USB.   

Disable Secure Boot. 

BIOS on NUC -


Press F2 during boot to enter BIOS Setup.

Turned off secure boot Boot menu. - now displays Ubuntu Menu and them screen goes blank and activity on USB for a few seconds then hangs.   

Will go on to boot off openSUS if the boot order is changed in the BIOS.

Ubuntu install just wouldn't. I chucked in the Kubuntu USB and it installed hitchless. I didnt opt for secure boot or third party software since this is supposed to be a strapped down development install.

So crazy so soon?

 

On my switch panel I am using the Jaycar SK0955 switch which I thought was SPDT and hence would have cause shorting problems trying to parallel it with the relay to give an OR type switching.  I measured it and it wont. I should have read the maker's sheet. I have used a stupidly huge number of spades to get the wiring I needed. Mainly because I want to be able to disconnect each light separately. I will probably have to solder onto the tongues of the switches to get the relay tidily into the circuit. 

Downloaded Raspbery Pi OS Lite ( fmrly Raspbian).  

Wont instal Etcher - Make Startup Disk should work.

N: Updating from such a repository can't be done securely, and is therefore di
sabled by default.

Scanned IPs;

IP:    192.168.1.101
Ping:    38 ms
Hostname:    HP.local
Ports:    [n/a]

IP:    192.168.1.103
Ping:    0 ms
Hostname:    NUC
Ports:    [n/a]

IP:    192.168.1.104
Ping:    2 ms
Hostname:    raspberrypi.local
Ports:    [n/a]



Enable SSH - created a ssh file in the boot sector of the SD card.

Enable WiFi. 

 

Hardware :  




Relay Board


GND                  Brown

GPIO   4 - IN1      Pin 4

GPIO   17  - IN2    6

GPIO   27  - IN3    7

GPIO  22 - IN4   8

GPIO  9 - IN5   11

GPIO  5 - IN6    15

GPIO  6 - IN7    16

GPIO  13 - IN8    17

VCC                    RED

Node Red Installed 

http://192.168.1.105:1880

Add Node to Reboot / Shutdown

npm install node-red-contrib-rpi-shutdown

Add DHT22 Node

Temp / Humidity 

Fault ; The above method didnt give a temperature ... The output was "undefined" .. I removed the filter msg.payload = msg.temperature node and it worked. I lost interest trying to get the entire string ouput from the Pi.  Dont want to get too far down in the weeds.

No comments:

Post a Comment