I’ve recently run into a few hardware failures in my servers and network so I figured I’d write up my debugging process and resolutions for all of them. The faults include a switch wall adapter, motherboard network interface, and a NAS data disk.
Continue reading “Recent Hardware Failures”BlueIris and the No Signal Camera
I recently setup a few new cameras on my BlueIris box, however one camera in particular was giving me problems. I tried a few different configurations and each time I got a no signal error. I could change the IP to another camera and all was well, but this one in particular was angry at me. I could log into the web interface and view the feeds, so I knew it was working, it just had something up in the configuration. I ended up looking at the Blue Iris status UI to see that I was getting about 1.5FPS through with a slightly lower bitrate than the camera was configured to at the time. I updated the camera config to drop the bitrate and voila, signal, smooth video.
The root cause is something in the cable, either too much interference from AC wiring, or an end isn’t as well crimped as it could be. Either way, I got my camera up in my Blue Iris instance and things worked fine after that.
Calling HASS API from Various Shells
While working on making my macro pad trigger Home Assistant automations, I found the API would be the easiest way to integrate the systems. Here’s some of my experimenting with the API and how to call it from Linux curl and PowerShell Invoke-WebRequest
Linux Curl
Using the Linux curl command is pretty straight forward.
curl -X POST http://hass.local:8123/api/services/switch/toggle -H 'Authorization: Bearer ABCDEF' -d '{"entity_id": "switch.testsubject_test_subject"}'
PowerShell Invoke-WebRequest
PowerShell is a bit more annoying to get everything right, as Invoke-WebRequest is a bit pickier on its input arguments.
Invoke-WebRequest -Method POST -Uri "http://hass.local:8123/api/services/switch/toggle" -H @{"Authorization"="Bearer ABCDEF"} -Body '{"entity_id": "switch.testsubject_test_subject"}'
Apparently windows has a build of the official Unix curl and tar commands, but my PowerShell prompts all had curl as an alias to Invoke-WebRequest. I did find that if i call curl.exe, it would run the official curl command.
Conclusion
Do be careful when copying and pasting between shells, I found that copying out of the PowerShell prompt and back in would yield an invalid token. This was also encountered in the WSL terminal as well.
The API is pretty straight forward after a little bit of trying things out. The documentation covers the capability but doesn’t have as many examples as I would have liked otherwise.
Resources
WLED with Home Assistant
Integrating WLED into Home Assistant is a relatively simple task.
- Go to the integrations page on home assistant
- Add a new integration and search for WLED
- Add the ip
After the, you’re good to go. Home Assistant will show the unit as a number of entities, a light and a number of switches.
Resources
Continue reading “WLED with Home Assistant”PhotoPrism MySQL DSN
Setting up the service was simple enough, I chose to run it on my UNRAID server however this meant I couldn’t use the example docker-compose file. I took all the settings from it and set it all up on my UNRAID server with the only changes being to paths for my file structure and the SQL database information. I use a MySQL database server for most of my services, so I needed to get the DSN for that server, however this was the first time I used DSNs, however it is pretty simple to setup correctly. I used PHPmyAdmin to add a user and database for PhotoPrism, and from there I used the default DSN with my username/password and host/port information
<user>:<password>@tcp(192.168.1.11:3306)/<databaseName>?charset=utf8mb4,utf8&parseTime=true
After that, everything was simple to setup and use. I logged in and was ready to start ingesting images.
Configuring PhotoPrism with NextCloud Sync
PhotoPrism is easy to setup with NextCloud sync, though it seems a bit odd the way its done. The NextCloud server is added to Settings / Backup in PhotoPrism, then you can click the circular arrows under the sync heading, and setup sync. To pick up the NextCloud auto uploads from my phone, I selected the InstantUploads folder to sync, with a daily interval. I told PhotoPrism to download remote files, preserve filenames, and sync raw and video files. I didn’t want PhotoPrism to upload to NextCloud as I wanted it to be a one way file sync to gather data. My PhotoPrism server is setup as a data viewer and not generating data itself as well. Then a flip of the “enable” switch and its complete. The first sync didn’t start instantaneously, however it did start not too long after setting it up, and it took a few hours to slowly sync and process all the files in my NextCloud folder (a few thousand files).
Installing Scrutiny on Unraid
What is Scrutiny? An application that monitors SMART statistics on HDDs and SSDs. This is useful to monitor the health of an array of disks like what unraid handles. As someone who’s had disks silently start failing and loosing data without notice (like unraid dropping the disk out of the pool), an application like this will be extremely useful.
Continue reading “Installing Scrutiny on Unraid”Installing Docker on a Raspberry Pi
On Raspbian
Install Docker
sudo curl -sSL https://get.docker.com | sh
Add Permissions to run Docker Commands
sudo usermod -aG docker pi
Test Docker Install
docker run hello-world
Install Docker-Compose
sudo apt-get install libffi-dev libssl-dev
sudo apt-get install -y python python-pip
sudo pip install docker-compose
Continue reading “Installing Docker on a Raspberry Pi” Fixing the Docker Swarm tasks.db
The Issue: The docker swarm manager node becomes useless after the tasks.db file explodes in size. This can be seen by worker nodes not being able to connect to the swarm, or manager nodes not seeing the other manager.
The Fix: Stop the docker service (service docker stop), delete or move the tasks.db file, start the docker service (service docker start). This seems too simple to be true, but it isn’t, the tasks.db file can be safely removed and regenerated by the docker swarm manager.
Adding UCS Authentication Account
Adding an account to use in authenticating against the LDAP directory is a simple enough. The process is done all within the LDAP directory GUI from the Domain menu option in UCS. Navigate to the “user” container, and select the add button. Select the type of the account to be a “Simple Authentication Account”, pick a username and password and click add.
- Domain -> LDAP Directory
- User Container, Add
- Type: Simple Authentication Account
- Username: my-new-auth-account
- Click Add
- Profit
This user account can now be used in a service to authenticate against the LDAP server.
Continue reading “Adding UCS Authentication Account”