Going to next level of Aquarium Automation...who's with me?

I found the following…

SSH TROUBLESHOOTING

If PuTTY tells you that the host does not exist, and your Pi is powered and the WiFi configured correctly:

Make sure you don’t have any other Raspberry Pis on your network with the hostname raspberrypi.
Try connecting to raspberrypi.local
If the previous step doesn’t work for you, proceed with the following.
Windows: open command prompt as an administrator:
Windows 10: press Windows-Key + X to bring up the power-user menu. Select Command Prompt (Admin)
Earlier versions: Start > accessories > Command Prompt (Admin)
Execute the command ipconfig /flushdns
APPENDIX

WHY DOES THIS WORK?

On startup, Raspbian checks the contents of the boot directory for specific files:

If it detects a file called wpa_supplicant.conf, Raspbian will copy the file into /etc/wpa_supplicant, replacing any existing wpa_supplicant.conf file that may be there. The file in the boot directory is then removed.
If an empty file named ssh is detected, Raspbian will adjust it’s settings to accept SSH connections. The ssh file is then deleted.
This means that if something goes wrong we can always get our Pi back onto a wifi network by repeating the steps above!

If you wish, you can include more than one network block. wpa_supplicant will select the network that it rates as the best choice based off:

Order of network blocks in the wpa_supplicant.conf file
Security level (WPA2 is preferred)
Signal strength
Doing so will look something like this:

Network 1

network={
ssid=“SSID1”
psk=“password1”
key_mgmt=WPA-PSK
}

Network 2

network={
ssid=“SSID2”
psk=“password2”
key_mgmt=WPA-PSK
}

And this has slightly different instructions…

http://desertbot.io/setup-pi-zero-w-headless-wifi/

1 Like

No worries. I understand the technical challenges thingy. Been facing several of my own right now as well, sorry to hear I wasn’t alone in some ways. :-/ Sorry my head got buried / focused only on my own issues & I didn’t check back on here sooner.

Hopefully you were able to get on with @keithh666’s advice / tips and are on your way to success now, but if not, give a shout. I’ll do better about keeping this window open. :slight_smile:

If you get really stuck, let’s try to coordinate a time to meet up on here together and walk you through this.

No need to apologize. I was just teasing you about my slight thread hijack. I’ve been searching other resources (like I should be). Still stuck though. I thought this would be simple honestly.

I’m thinking I may have to track down an hdmi adapter and use the gui to get this going.

1 Like

Just keep in mind, it could always be worse & stay positive. :wink:

Myself, I’m spent all day yesterday preparing and executing a rollback from 58.1 to 43.2 to restart my migration forward towards (but perhaps not too) 58.1. Turns out too many things went wrong after the migration, and finally decided to backup restart and take baby steps this time, in an effort to understand what’s been changed, and when, in the internals of HA that’s causing me some problems.

Namely, one of the issues that seems to have developed along the way (at least in my migration attempts) was that the state information I returned from my command line scripts is now being ignored or dropped by HA and I can’t understand why. Changing it back and forth between STDERR and STDOUT makes no difference. Even tried sending it back via both STDERR & STDOUT. Nada.

Also, with 58.1, it seemed as if the cpu load was averaging well above 1.00 sometimes above 2.00. This was never the case with 43.2, usually averaging 0.4-0.8 with all my automations and sensor input running. home-assistant.og reveal nothing useful in terms of errors or warnings, just a lot of “timers out of sync” stuff. :-/

Not to mention, I was expecting to realise some of the SQL(lite) database performance improvements, and felt like that actually SQLite was breaking far easier now. :-/

I started with a fresh 58 hassbian image, so I was really surprised. I finally decided, maybe either that image or my download of it somehow broke.

So now I’ve made extra SD card based copies of my 43.2 install and am using a smaller SD to test and migrate forward each release level to find where things start going wrong. More of a baby step approach, but maybe I’ll have better success figuring this out with less frustration. And don’t have to worry about flooding the floor as a result of some technical gaff / bug. :wink:

Hopefully future iterations of HA will make that a thing of the past. Sounds like you do some things with HA that I may never understand but at least for the basic automations and things I would like to control on my house most of it seems pretty accessible. Hell, I had a two day problem of trying to get the temp/humidity probe on a sonoff TH to display on HA. Turns out I was missing a capital letter, lol

Well, I might have had a head start on you a bit. But there again, I’m happy to help you and others from what I’ve learned. Just don’t ask me about AppDemon, I haven’t played with that at all. Maybe one day.

There’s also the possibility - I, like you, broke something when I migrated to 58.1. Something in my config file.

I used that opportunity to break apart my monolithic config file into lots of pieces. I was very careful and methodical, or so I thought. But even on the double and triple checks, I couldn’t find anything. On the flip side, YAML can be damn frustrating in that regards. And even after several months now, I’m still learning it. lol

Hehe that’s one hell of a config file :smiley:

Having said that my automations file is 3466 lines on it’s own :stuck_out_tongue:

1 Like

I’m getting up there on the crazy level of what I can control with HA.

Here’s a high level breakdown of the components HA currently monitors/controls:

63 x 220v AC Electrical sockets (2 of these are Sonoff POWs feeding electrical usage data)
3 x Hue Bridges (first gen)
27 x Philips Hue / Living Color LED Lights
24 x Temp Sensors (mostly DS18B20s)
2 x Humidity/Temp/Pressure sensors
3 x Seneye Sensors (not directly connected…yet) feeding it data on pH, NH4, NH3, O2 levels
3 x Kodi / TV Media Center setups
7 x water level float sensors
16 x streaming cameras

And that’s kinda just the basics. I’ve got GPIO based buttons around the house which send MQTT commands for various things. Say, for turning on a power socket 30 minutes AFTER I re-insert the cordless vacuum into it’s charging station, so it doesn’t try to charge “hot” batteries, causing premature battery death. Other things where my wife particularly was having to resort to using her mobile to turn something on at the power source, I ended up giving her “buttons” for those functions. One of her favourites is the 2 hour sunset alarm. The living / dining room is on a east-west alignment and inside those rooms, everything lit purely by LEDs. So obviously any old sunset alarm won’t do - it’s got to simulate an actual sunset transitioning across the room, in sync with the actual sunset. (I did read I will have to re-do all the sunset alarm thanks to a breaking change between 43.1 & 59. sigh)

But by and large, probably 50% or more of HA’s CPU time is focused on the Aquarium in some way.

On that note, 44 seems nice and good, so tomorrow morning I’ll pop on up to 45. Hopefully I’ll get fully caught up at this pace by Winter’s Solstice. :smiley:

I hope you’re not controlling that lot with one RPI, no wonder it struggles, I have :-

7 PIRs,
13 433mhz door/window sensors,
2 sonoff powers,
4 sonoff basics,
4 zwave switches/lights
1 zwave multisensor,
20 433mhz mains switches,
4 433mhz ceiling rose dimmers
7 temp/pressure/humidity sensors (mix of 433mhz and wifi (wemos d1 mini/node mcu)
2 hacked wifi switches
3 streaming cameras
Plus some IR or 433 RF stuff controlled either with a Broadlink RMPRO or an Orvibo.

My HA struggles with that lot and it’s been getting worse since around .5x or at least that’s when I noticed it. .59.2 is very bad, switching anything off or on, particularly the 433 stuff can take 20secs, so I may do the same as you and revert back to around .50. I’m trying to convert some of my automations over to Appdaemon but it’s a big learning curve as although I did programming many years ago, it was mostly C and assembler, so python is not really very understandable to me at the moment :frowning: So it’s a toss up between carrying on with conversion to AppD or revert back. Reverting back would probably be quicker, but you have to move forward :slight_smile:

Actually, only one Pi functions as the controller. And up until 43.2 - I thought the performance was actually brilliant. (44 seems actually a hair improved even it seems to idle around .37 load last night.)

I keep toying with the idea to have two controllers, one for the aquarium and one for the house. But I prefer the idea of having a single controller and back up controllers for failover if that one goes down. If I have to split up to two controllers, that adds more complexity.

Today we’re getting our first heavy snow and I’ve been using HA interface to keep tabs on both the cameras around the house & 6 web streaming cameras coming in from the beach to watch the snow. And this is about all the load I’m pulling on it.

The electrical sockets aren’t directly connected to the HA, but by means of IP. For the APC MasterSwitches, it’s SNMP (for which I wrote my own script for HA to use before there was native SNMP support). For the Neol PowerSwitch bars, it’s simple auth’d HTTP requests.

Everything is super responsive at this stage, and works extremely well. Not to mention as you can probably sympathise yourself… I’m kinda “invested” in this project now, so I have to find a way forward.

I have a feeling there’s some performance bugs that’ve been overlooked. If I or we can find them and document, we can get them fixed. I hope. :wink:

My average load is 1.6 and that’s with only 1 camera streaming.
image

I do however have Influx, Grafana, pilight, squeezelite, appdaamon and a FIND server running.

Looking at top - d 10
HA is at 46% - 100%
Influx 20% - 40%
pilight 6%
appdaemon 4%
the rest sub 1%
So moving Influx off the pi might improve matters, not sure how I go about doing that tho’.

Have a look to see if you can use JPG generic camera streaming. I have this setup so it maintains a low bit rate during idle usage, but if I tap a camera, it goes to full frame with a. higher frame rate comparable to normal video streaming. I use this instead of mjpg to save bandwidth / overhead on CPU.

Yep I use ffmepg thru’ avconv rather than the ffmpeg default so with out me tapping the camera I get an image every 10s. Using top I don’t see avconv very often at all so not sure that is having much effect. If I have all 3 cameras streaming at once my router fails :P, so I have to be careful what I have streaming at any one time :frowning:

Buy yourself a NUC and it will completely change how HASS works for you. I just did that migration and it was nothing short of amazing.

59.2 sits At 0.02 load on a i5 NUC with 150 zwave devices and other stuff running… automations are instant

1 Like

Well I figured out what I was doing incorrectly. When I thought I was naming the files correctly I was actually just changing the file name and not the file extension. So I had files named wpa_supplicant.conf.txt and ssh.txt and didn’t realize it because windows just lets you do that now…

The pi zero is up and running now though. Next step will be to make it send temp data over mqtt but that is for another day because there is a game of American Hand Egg Ball I want to watch tonight :smiley:

2 Likes

In windows set the file extension to show then you’ll always see them :), it’s in one of the deep menus in explorer I think. I get a similar thing when I do photography competitions (I enter the images into some software), but people add the file extension which windows already adds :stuck_out_tongue:

1 Like

Yes, that’s how I figured out I was doing it wrong. In older versions of windows it would just assume you wanted to change the file extension. So I always forget that’s not true anymore (maybe I’ll finally remember now)

Now lets get back to awesome aquarium stuff!

2 Likes

Personally, I might still come to that solution for myself in the end, but for now, trying to exhaust all software possibilities. :wink:

Ok so I have 5 temp probes hooked up to my pi zero all are working. Now the question is how do I use that python script to see all 5 devices? After that I’ll worry about setting up the MQTT.

1 Like