Software – Dirty Optics https://dirtyoptics.com Jack of all trades, Master of none Sun, 11 Oct 2020 14:31:05 +0000 en-US hourly 1 How to Monitor a Raspberry Pi Remotely https://dirtyoptics.com/how-to-monitor-a-raspberry-pi-remotely/ https://dirtyoptics.com/how-to-monitor-a-raspberry-pi-remotely/#respond Sun, 11 Oct 2020 13:51:18 +0000 https://dirtyoptics.com/?p=54921 I’m working on a project that houses a bunch of Raspberry Pi computers in multiple remote locations. I wanted to be able to monitor the “Health” of the hardware in these remote locations. The metrics I was hoping to capture are Up-time, CPU temps, CPU usage, Memory and disk usage, etc.. as you may have noticed, I also have a love/hate relationship with Grafana, which made it the only choice for displaying these metrics in a user-friendly way.

Prerequisites:

1 x VM running Ubuntu 20.04 – I tested using a Cloud Compute server on VULTR, but you could use any VM that is on the same network as the RPi.

1 x RPi – As long as the RPi is on the same network it will be good to go. I tested over a VPN and it worked also.

Software Stack:

Influxdb – As usual the time series database.

Grafana – My favorite program for displaying this kind of data.

Telegraf – A plugin server agent for collecting and passing hardware metrics such as CPU, Temps, RAM, Storage, etc…

Install InfluxDb on VM/Host

Install Grafana on VM/Host

PLEASE READ: Now that our host/server has Grafana and InfluxDb Installed. We need to install Telegraf on the RPi that we wish to fetch metrics from. Don’t worry, we will come back and configure Grafana/InfluxDb Shortly.

Install Telegraf on Raspberry Pi (RPi)

Configuration – Telegraf on RPi

Telegraf.conf

PLEASE READ: Now that we are done configuring the Raspberry Pi, it’s back to the VM/Host to configure influx and grafana.

Configuration – InfluxDB on VM/Host

Configuration – Grafana

Navigate to your Grafana Install: http://<server-ip-address>:3000

Login: default login is admin:admin

Please change the username and password straight away.

The first step is to add the Influxdb data source:

Grafana Datasource

The second step is to import the Dashboard – We used this dashboard from the Grafana Library:

https://grafana.com/grafana/dashboards/10578/reviews Props to Jorge

To import the dashboard, navigate to DASHBOARD > MANAGE > IMPORT

Insert 10578 into the field and click ‘Load’

Grafana Import Dashboard

 

 

 

 

 

Make sure you then select the datasource to associate with the dashboard.

Grafana Import Dashboard

 

 

 

 

 

You should now be greeted with a Dashboard that is connected to the RPi.

Dashboard Complete

 

The rest is now up to you! Add multiple RPi’s. You can switch between them at the top of the Dashboard.

A big thanks to Dorian Machado and his article. Also Jorge de la Cruz and his Dashboard! These guys did the real heavy lifting.

]]>
https://dirtyoptics.com/how-to-monitor-a-raspberry-pi-remotely/feed/ 0
Batrium integration with Home Assistant https://dirtyoptics.com/batrium-integration-with-home-assistant/ https://dirtyoptics.com/batrium-integration-with-home-assistant/#comments Sun, 06 Sep 2020 11:07:39 +0000 https://dirtyoptics.com/?p=54815 The ultimate goal is to be able to monitor my power-wall in the Home Assistant (HA) dashboard. In my case, HA runs on a 10″ android tablet out in the Kitchen. Firstly, I need to throw some recognition to a couple of people. The first being @Wolf. Absolute legend helped me out with some Node-red issues, and basically, without him, the 2-3 days development time would have turned into weeks. A Full list of recognition is at the bottom of the past! Enjoy!

Oh and yes I could have done this whole install on Docker/Portainer and I most likely will go down that route, but for now, this is the down-and-dirty version line by line.

Prerequisites

  • Ubuntu 20.04 LTS Server Installed on a VM or PC.
  • A Batrium Watchmon on the same network as your VM/PC.
  • Node-Red Flow (JSON file) Download Here.
  • Grafana Dashboard (JSON File) Download Here.

Step 1 – Update/Upgrade

Step 2 – Install Grafana

Step 3 – Install InfluxDB and Chronograf

INFLUXDB Install

CHRONOGRAF Install (Not Essential, but good for fault finding.)

CREATE INFLUX DATABASE (For use with Grafana)

Step 4 – Install Node-Red

NODE-RED BOOT ON STARTUP

Step 5 – Configure Node-Red

Once Node-Red is installed we need a few additional packages installed to allow Node-Red to interpret the UDP data coming from the Batrium Watchmon. The 3 packages are:

  • Binary-Parser (Install via Linux CLI)
  • node-red-contrib-influxdb (Installed in Node-Red GUI)
  • node-red-dashboard (Installed in Node-Red GUI)

The latter two items can be installed via the “Manage Palette” function in the Node-Red Settings. The Binary Parser function needs to be installed via the CLI.

Now you need to import the Flow into Node-Red. You can download the flow here. Of note here is that this flow is set up to listen for the Batrium UDP data on port 18542. We opened up this UDP port during the Node-Red install. This flow is also set up for a string of 14 longmons. If you have more as I do, then you will need to edit some of the nodes to reflect this.

 

node-red influx configWe now need to configure a couple of nodes in Node-Red. The main configuration is pointing node-red influx flow to the database we created after we installed influxDB. In this tutorial we created a database called “batrium” and we know that the port for influx is 8086.

 

deploy and debugNow we need to Deploy the Node-Red flow and check the debug tab for any errors. If you see some “TypeErrors” then it is usually because the Binary-Parser was not installed correctly. Also, you can toggle the green msg.payload debug filters on and off to see the data being received in the debug window.

Step 6 – Configure Grafana

We now need to set up Grafana. In a nutshell, we need to do two things. First, add the influxdb data source. Secondly, import the Dashboard that Mr @Wolf has been nice enough to allow us to share. You can find a copy of the JSON file here.

Setup Data Source:

Import Dashboard:

grafana dashboardDepending on your battery type, amount of longmons, etc. you will need to play around with the visualization. If you have come this far I’ll let you figure out your ideal settings.

Step 7 – Configure Home Assistant

We are going to add the Grafana dashboard into Home Assistant using an embed from Grafana. Log back into your Grafana instance and locate the share button on your dashboard.

Find the Grafana Dashboard share/embed tab:

Use the link created in Grafana to create a new entity in HA. I also append the following to my link to ensure it opens in ‘fullscreen’ and ‘kiosk’ mode in HA. &kiosk&fullscreen 

If your dashboard does not show up in HA, read on below to fix.

Dashboard embed fix – From what I have found online, most users report that just enabling the ‘allow_embedding = true’ function sorted the issue. I had to allow anonymous logins also. But that is probably because I have not set up a user in Grafana for Home Assistant. Use the anonymous logins at your own risk.

Well it’s been emotional, thanks for sticking with me. If you find something wrong here let me know and I’ll fix it up asap. I hope it helps and again, thanks to the contributors.

Batrium in Home Assistant

Recognition

https://github.com/Bloats/Powerwall-stuff – Bloats for the original Flow

https://secondlifestorage.com/showthread.php?tid=8645&pid=59143 – Of course, the Second Life Storage Forum!

https://discourse.nodered.org/t/flow-to-decode-binary-data-and-a-walk-through-on-how-to-install-the-npm-module/5174 – Binary-Parser info

https://github.com/daromer2 – For his initial work with the UDP listener!

]]>
https://dirtyoptics.com/batrium-integration-with-home-assistant/feed/ 10
Infographic – Linux for Dummies! https://dirtyoptics.com/infographic-linux-for-dummies/ https://dirtyoptics.com/infographic-linux-for-dummies/#respond Fri, 21 Aug 2020 01:25:35 +0000 https://dirtyoptics.com/?p=54728 Having grown up with Windows it pains me to try and learn all the intricacies of the Linux operating system. However, the pro’s for running a server based on this architecture is great. The cons are that I must learn a bunch of new commands to try and get things done. And yes, I have printed this out and have it as a quick reference guide next to my pc. I hope it can help you also. Let me know if you think I should add/subtract anything. Happy to update as necessary!

infographic basic linux commandsinfographic basic linux commandsinfographic basic linux commands

 

]]>
https://dirtyoptics.com/infographic-linux-for-dummies/feed/ 0
Home Assistant – Amazon Fire Tablet Kiosk https://dirtyoptics.com/home-assistant-amazon-fire-tablet-kiosk/ https://dirtyoptics.com/home-assistant-amazon-fire-tablet-kiosk/#comments Sat, 18 Jan 2020 08:21:03 +0000 https://dirtyoptics.com/?p=54570 The Home Assistant setup I have is pretty basic at the moment. The biggest problem  I have with the whole automation thing is accessibility. I want to be able to turn on or off automation without having to get my phone out. We use our phones enough, adding to it was something I want to try and avoid if I can. It was a pretty easy decision to try and set up a tablet in the most common area of our house. The idea for the tablet was to allow anyone to be able to control lights, security cameras, etc.

So what tablet did I go with?

amazon fire tablet 10 inchThe choice was pretty easy, the Amazon Fire HD tablets come in 7″, 8″ and 10″. If you do go investigate your own Amazon Fire tablet, pay particular attention to the generation of the tablet. Amazon has been able to produce a tablet at a reduced cost. The caveat to this is that it runs its own Fire OS (Operating System) which has a fair bit of advertising throughout. However, we will be bypassing a lot of these adverts, you will not even notice it’s on Fire OS by the time we are done with it. Check out the wiki here for a list of generations and the specs on each one.

amazon fire tablet generation list

The price of the tablet varies, obviously the newer the more expensive, however, we decided on the Fire HD 10, 5th generation. The price seemed right for the specs. To be honest, the tablet running Home Assistant doesn’t need a whole lot of resources. (Found one locally for $99)

The Mount

amazon fire tablet wall mountI could have gone in a few directions for the mount. I did think about using an articulated arm so that it could swing out and face the kitchen, however that would make it stick out from the wall. I wanted a very seamless/minimalist look when mounted on the wall. I ended up going down the magnet path as I figured it could be taken off the wall easily enough if it was to be used elsewhere. I did look around for a suitable tablet magnet and gave this one a try. Turns out to be brilliant and very sturdy. (I suggest cleaning all surfaces with rubbing alcohol prior to installation.)

tablet mounted on wallOn the wall side, it mounts directly to a Clipsal electrical wall plate. I did make up a small acrylic spacer to also attach to the wall plate. This would give it just a bit extra clearance for the USB angled connector.

Depending on how you want to power your device, I ended up using an old phone wall port and converting it to a mains powered USB port. (Note: Electrician may be required for this connection!) Usually, these kinds of  USB ports are jumped from a 240v outlet, however, I did not want this and got its own line run in the wall cavity.

Fully Kiosk Browser App

fully kioskfire apkThis is the bees-knees of kiosk apps. It looks simple but is very powerful. To get it installed, check out the website here first. Have a bit of a read. Hopefully, if you had a good read you will notice that they do a different APK (That’s the app executable/install file) for different operating systems. Grab yourself a copy of the “Fully Kiosk Browser APK (For Fire OS)” Using this method means you will not have to install google play onto your tablet, it also has some additional features that work only with the Amazon tablet.

I’m not going to explain how to sideload an APK onto an android device, there are plenty of tutorials already on the net, either google it or try this one.

Now that you have the app on your tablet:

When you first open the Fully Kiosk browser app, you will be asked to put in a URL to the page you want it to load. Insert your Home Assistant IP including the port number.

The next two settings work hand-in-hand with each other to provide a couple of benefits. That is the camera motion detection and the screensaver. The screensaver is set so that the tablet is never locked, and the motion detection by the camera is used to turn the screen saver off.

fully kiosk browser motion dectectionSet up motion detection. To set the screensaver, swipe the left side of the screen to reveal the “Fully Kiosk App” settings.

 

 

 

Fully Kiosk screensaverI suggest setting the screensaver up and making it use a black background. This effectively turns the screen off (kind of.) it will also stop any burn-in on the screen. Having the screensaver become active eliminates the chances of the tablet from locking. This then allows the motion detection to work without a user having to swipe through a lock screen. Also, the added benefit is that it stops us from having to view any advertising on the lock screen.

These are the main settings I am using on my tablet thus far, feel free to have a play around. I did end up purchasing a pro copy of the app so that I could mess around with all the settings. Some may not be available on the free version.

What now?

Start working on the home assistant UI to get the layout that works for you. The 10″ version can hold a lot more cards and is a bit easier to work with. Have a good think about what you use the most and have this on the first screen.

I also ended up using a right-angled USB connector to power the tablet from the wall. It took me a while to find the correct one (It’s not pictured.) I ended up using these from amazon. You get two in a pack and they allow you to go either way, left or right.

If you got this far, you are now where I am at. Happy hacking, and feel free to show me your tablet/wall mount builds!

Gallery

 

 

]]>
https://dirtyoptics.com/home-assistant-amazon-fire-tablet-kiosk/feed/ 2
What is Home Assistant? https://dirtyoptics.com/what-is-home-assistant/ https://dirtyoptics.com/what-is-home-assistant/#respond Tue, 12 Nov 2019 11:57:35 +0000 https://dirtyoptics.com/?p=54449 Home Assistant is an open-source home automation platform that is powered by a massive community of makers, tinkerers, and DIY enthusiasts. The software itself runs on numerous hardware and software platforms including the Raspberry Pi, Tinkerboard, Odroid, and Intel NUCs. You can even run the Home Assistant OS (HassOS) from inside a virtual machine if you wish. I run an Intel Nuc with multiple VM’s. One of which is the HassOS and to be honest I do not remember ever having to turn the VM on/off or reset. It has been solid as a rock! At first, I did install Home Assistant on the Raspberry Pi to test with but decided that I did not want another piece of hardware lying about and opted for the VM. I have not looked back since. For a full list of hardware and (VM Images), check out the HassOS installation section here.

So what were my first thoughts about Home Assistant? Well, the installation of HassOS on the hardware of choice is actually the easy part. The Learning Curve for configuration of the devices you want to add to Home Assistant was easily the most challenging. My aim for this post is to help you out a bit with the on-boarding. Here are my top tips for an easier onboarding experience to Home Assistant:

What are (Device) integrations?

Ok, so now that HassOS is installed we navigate around the software and easily start to get confused about what the heck we are meant to configure. If you head over to this webpage, you will be greeted by sheer volumes of possible devices and hardware that Home Assistant allows you to control. For example, your goal may be to use Home Assistant to Automate some lighting. Under the “Light” tab you will see 76 different integrations. Ranging from IKEA Tradfri smart bulbs through to the more common LifX and Phillips Hue integrations. These integrations pages are basically guides or configurations that you must follow to allow Home Assistant to control the devices.

What is YAML?

YAML stands for “Yet Another Markup Language”. It is a human-readable, data serialization language. It is commonly used for configuration files and yes, we use YAML for the configuration of our Integrations! In a nutshell, YAML is not a programming language, but a configuration language. It certainly is not hard to pick up and if I can manage to nut it out, then I’m sure you can too.YAML configuration exactly like above, be it a very simple example, the idea is the same throughout. Of note is the configuration.yaml document. The majority of all your integrations will end up inside this file, or similar .yaml files. YAML does follow a certain syntax, I would suggest having a read through the Home Assistant YAML page prior to diving in.

What are Entities?

Each individual device you add to Home Assistant via an Integration and Entity ID. (Yes, every single item, device, switch and automation, even non-physical items can have entities!) When you first install HassOS and run it, you may find that some devices are automatically found on your network are assigned an entity. As long as you remember that an entity represents a particular device then you cannot go wrong. For example, you may have 15 Phillips Hue Globes on the network, (Via a Bridge) each globe will have its own entity. It is this entity that defines the particular device. example “light.lounge” represents the Phillips Hue light in the lounge and you will need to reference that in your configuration integration.

Love Lace UI

You will hear the term ‘Love Lace UI” thrown around the forums and web a fair bit. This User Interface is somewhat newish to Home Assistant and is the main user interface that we see on the startup of Home Assistant. Everything we do generally speaking is via the Love Lace UI. A Demo of the Love Lace Ui can be found here.

The User Interface is made up of a few components:

  • Cards – These are a bit like tiles that can be laid out in the UI to display different information. HA has 24 predefined cards. The HA community, however, has many more. I use cards to display switches which I can tap to turn lights on and off. I also use cards to show the current weather forecast and check the temperatures around the house. One card even lets me view the IP CCTV cameras I have around the house.
  • Customization – The customization section allows you to change the layout of the cards to suit the view you want. You can add tabs and change the layout as you see fit. If you decide to run the Love Lace UI on a tablet, then you may need to customize the look and feel.

Well, I hope I have not scared you off or bored you to death, but these are the things I wish were explained to me a bit better before getting stuck into Home Assistant. Stay tuned for more on Home Assistant!

]]>
https://dirtyoptics.com/what-is-home-assistant/feed/ 0
Do you Podcast? – Darknet Diaries https://dirtyoptics.com/do-you-podcast-darknet-diaries/ https://dirtyoptics.com/do-you-podcast-darknet-diaries/#respond Wed, 15 May 2019 00:24:26 +0000 https://www.dirtyoptics.com/?p=53057 I have never really been a Podcast listener, however, in the last 6 months, one particular podcast caught my interest. This particular podcast titled ‘Darknet Diaries’ was able to hold my interest for more than a few minutes. I am one of those kinds of people that flick through books really quickly and if I get bored, usually put it down and do not come back. (Hence why podcasts appeal to me!) However, this awesome production of geekiness and real-life stories easily quenches my thirst for topics I am very passionate about. The podcast is not so technical that you get scared away, it actually covers some great history and real-life examples of the hacking world and how vulnerable our digital lives actually are.

The Show is produced by Jack Rhysider and incredibly he is able to pump out two shows a month single-handedly! Jack also writes for a blog ‘Tunnels Up’ which has a few cool bits and pieces that can be helpful. (Especially some of the cheat sheets tunnelsup.com/cheatsheets/)

So, if you find yourself into similar interests, then head on over to darknetdiaries.com and get your fix ASAP. The episodes actually make your early morning commute and coffee bearable!

]]>
https://dirtyoptics.com/do-you-podcast-darknet-diaries/feed/ 0
How to configure TVheadend server https://dirtyoptics.com/how-to-configure-tvheadend-server/ https://dirtyoptics.com/how-to-configure-tvheadend-server/#respond Mon, 19 Nov 2018 02:55:23 +0000 https://www.dirtyoptics.com/?p=52239 Recently, I have had a few requests for a ‘How To’ configure the TVheadend server. This article will cover off on the basics to get you up and running. If you want to review the hardware requirements then check out the build post here. When you first open TVheadend via your web browser it can be a bit overwhelming which settings to choose. I have broken it down below into the ‘wizard’ setup and then some manual configuration. I have also listed the steps involved to stream the feed onto the internet so you can view externally!

How to configure TVheadend via the wizard

If you are unsure how to get to the web GUI for TVheadend, I would suggest a quick review of this post. Particularly looking at step 3. In a nutshell, you need to use a web browser to configure TVheadend. Go to the IP address you set on your device. If it is your first-time use, you will not get a login screen, however, you should get the wizard to come straight up. If for some reason you canceled the wizard, you can find it by clicking ‘Configuration > Start Wizard’

Open up a web browser and enter the IP address of your TVheadend Server. Also, use the port number ‘9981’. (For example http://192.168.1.168:9981) This will bring up the TVheadend Web GUI. On the first startup, you will be presented with the setup wizard.

Select the web interface language and the EPG language if different. In most cases, you will only need to select the web interface language. Click next.

This section allows you to set ‘allowed’ networks to use the server. You can insert 0.0.0.0/0 to allow all networks, or you can use something like 192.168.1.0/24 to allow anything on that network to access the server. This is a personal preference. You might also notice an open IPV6 entry separated by a comma. This is also acceptable. You can add multiple networks this way. Add an admin login, keep this super strong, especially if you plan to stream content via the internet. If you plan to allow other users into the network, then set them up here also.

The next section will give you an insight into how many adapters the server has picked up. You should see all of them plugged in. If not, then check your connection to the tuner (USB) and ensure the RPi operating system has loaded the drivers. Some TV tuners may not be picked up by Linux. Network 1 always defaults to IPTV, disregard this and continue to your adapters/tuners. Assign each adapter to a network. In my case, it is DVD-T which is Digital Terrestrial TV in Australia.

Because terrestrial television is transmitted on different frequencies dependant on your location, you need to select a profile that matches the location you are in. This will tell the tuner to look at these frequencies. Go ahead and select the correct profile for your area.

This next screen will begin to scan for all services available for the area that you selected. If you accidentally select the wrong location, then you may run into issues. Also, ensure that your TV antenna is connected at this stage. Some of the tuner details can be found in the window behind the wizard. We can revisit this screen later to fault find signal quality issues.

Now that we have found the desired TV channels, we need to map out all the tags and channel names/numbers. This can be done automatically by selecting the 3 check boxes. It is possible to re-sort these at a later date. For now, it is easier to allow TVheadend server to sort it out.

Congrats, your server is now set up! Be it at a basic level, you should now be able to consume some IPTV. The next section will cover off on some ways to do this!

Watch a stream with VLC

Now that you have done all the hard work, its time to consume some IPTV. This section will outline how to view a channel with VLC. If you have not downloaded VLC, then you will need to do this first. https://www.videolan.org/ For those of you who are not aware, VLC is a media player that is very popular and compatible with a LOT of different media types. We can use VLC media player to open our TVheadend streams.

Open up the TVheadend web GUI and navigate to the channel you want to watch. Click on the small ‘info’ button on the left-hand side of the screen. This will open up a modal window with which you can grab the stream.

Select the ‘play program’ button. This should initiate a download. This file is basically a .m3u which can be opened by VLC. VLC will then be pointed directly to the stream you selected.

Open the downloaded file with VLC.

Your stream should then begin to play in VLC.

]]>
https://dirtyoptics.com/how-to-configure-tvheadend-server/feed/ 0
Raspberry Pi TV server using TVheadend https://dirtyoptics.com/raspberry-pi-tv-server-using-tvheadend/ https://dirtyoptics.com/raspberry-pi-tv-server-using-tvheadend/#comments Fri, 17 Aug 2018 12:33:57 +0000 https://www.dirtyoptics.com/?p=51831 I have a projector out in the theatre room, however, this same room does not have any coax run for TV reception. Nor does the projector have a tuner for Digital TV. Thus the idea for the RPi TV streamer! I could have easily gone to the local tech shop and purchased a tuner and ran some coax, but I already have an android device hooked up to the projector, why not try and stream TV to it locally in the house. My own IPTV service of sorts.

I do want to give a bit of a shout out to CWNE88, (Go follow him if you get a chance!) This is the guy that got me started streaming TV via the Raspberry Pi, however he concentrates a lot on multicast streaming and to be honest, most of us do not have the infrastructure to handle multicast traffic on our LAN. So I had to find an alternative option that actually worked. (dvblast works great?if you have suitable switches/routers to handle multicast) Anyhow, during my research, I stumbled across TVheadend. I learned pretty quickly that it could be installed on a Raspberry Pi and be used to stream tv via HTSP. (Home TV Streaming Protocol) HTSP is a TCP based protocol and works in a unicast type fashion without killing your home network.

This is the hardware you will require:

  • Raspberry Pi 3 B+ (This is what we tested with)
  • USB Extension Cables
  • Good quality 5v power supply for RPi
  • USB TV Tuner (We used Avermedia Volar Green HD @ $29ea)
  • Splitter (We used a 3-way splitter to really push the RPi3B+)
  • F-type adapters
  • USB to Ethernet Adapter (Optional)

Prerequisites

I am going to assume you know how to get Raspbian/Stretch Lite onto your Raspberry Pi. If not check out the Prerequisites of this post here. It will walk you through, downloading the image, using Etcher to put the image onto an SD card, setting up the RPi via Raspi-config, and enabling SSH. Once you have completed those steps, come back here and continue.

The end state of the Prerequisites is to have access to your Raspberry Pi via SSH and have the command line up and in front of you.

For those confident on the RPi

Step 1: Update/Upgrade the Raspberry Pi

First things first, you need to ensure your Raspbian repositories are up to date. Run the Following commands:


sudo apt-get update
sudo apt-get upgrade

After running the second command, select ‘Y’ and go get a coffee. This process can take 5-10 minutes depending on how old the initial image was.

Step 2: Install TVheadend server

Now that your Raspberry Pi is fully up to date, you need to run the following commands:


sudo apt-get install dirmngr

This command may not need to be run, however, for me, TVheadend would not install without it.


sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 379CE192D401AB61

More info about installing the GPG keys can be found here.


echo "deb https://dl.bintray.com/mpmc/deb raspbianstretch stable-4.2" | sudo tee /etc/apt/sources.list.d/tvheadend.list

Again, more info on where to get the correct repo for the RPi is here.
Check and make sure the correct one is used. This can update at times.


sudo apt-get update

In a nutshell, we are telling ‘apt-get’ to grab any updates from the repository we added above. This will then allow us to install TVheadend because it now knows where to ‘grab’ it from.


sudo apt-get install tvheadend

Select ‘Y’ and allow TVheadend to install. If you tried to run this command without doing the steps above, you would run into errors

During the install, you will be asked to set an administrator username and password. (See Screenshots below!) Be sure to set this correctly and remember. You do not get two chances to enter the password. I learned this the hard way!

If for some reason, you did stuff up the username and password. Uninstall tvheadend with:

sudo apt-get purge tvheadend

and

sudo apt-get autoremove

Then reinstall tvheadend again.

 

Step 3: Log into TVheadend

Open up a web browser and enter the IP address of your Raspberry Pi. Also, use the port number ‘9981’. For example http://192.168.1.168:9981 (Your IP address for the RPi will be different.) Type ifconfig in the terminal screen to confirm RPi IP address.

When you first open Tvheadend, you will get the Wizard which will step you through setting up the tv tuners. Hopefully, you left them plugged in from the start. If not, plug them in and restart the Raspberry Pi. Go back into the web browser and log back into TVheadend.

Step 4: Configure TVheadend for streaming

The configuration for TVheadend settings post is here.

I have no doubt, however, if you got this far, you will be able to bumble your way through the configuration. This was the easiest part. I then used VLC to watch the streams. You can get these links from inside Tvheadend.

Update: Apple/iOS App

If you want to consume some TV from your iOS device, I can confirm that the tvhclient app works a treat. No nonsense setup, easy channel browsing. It can be used in conjunction with the VLC app to stream video easily.

Update: Video Hardware Configuration

Gallery:

]]>
https://dirtyoptics.com/raspberry-pi-tv-server-using-tvheadend/feed/ 34
Before and After with Adobe Lightroom https://dirtyoptics.com/before-and-after-with-adobe-lightroom/ https://dirtyoptics.com/before-and-after-with-adobe-lightroom/#respond Wed, 18 Jul 2018 12:01:51 +0000 https://www.dirtyoptics.com/?p=51535 On our recent trip/honeymoon to Koh Samui, I thought I would conjure my inner photographer. It’s fair to say that I still have a lot to learn. The camera I had was a Canon 80D. (Yes not a full-frame camera, but I primarily purchased it for the video functionality.) However, saying that it was pretty cool getting down to the beach and having a go at mashing the buttons and seeing what came out at the other end. The results were actually pretty average?.as expected. Practice makes perfect hey! Anyhoo nothing a bit of adobe lightroom can’t fix!

I’m definitely no expert on Adobe Lightroom, however, a couple of hours messing around and the following pics were ‘Enhanced’.

Drag the slider to reveal the edited image.

This is my very first attempt at a long exposure shot. Trying to draw out all the light I could. To the naked eye, it was pitch black down at the beach, except for the lights of the restaurant. It was difficult to check settings/change settings on the fly as I was doing it due to low light.

To my eye, the green grass did look as good as the Adobe Lightroom edit. I guess I still have a lot of work to do on the camera settings. It was very bright and I was a little bit hungover?

I tried to do something a bit different here. The edit was supposed to highlight the face of the statue and make it stand out more. How do you think I went? any tips? Maybe I could have blurred out the background.

This is what happens when you are really hungover, laying on a very comfortable cushion chair and have absolutely zero motivation to do anything. Yep, take photos of trees and the sky for practice! In the Lightroom version, I tried to bring the green and blue out, however, I think the white in the balloon has become a bit green.

Last one promise! The idea here was to try and dray some of the brown back out of the rock face and the greens into the shrubs. It worked ok I think. Still some work to do.

Well, after all of that it is clear I still have a lot of work to do on the whole ‘Camera Settings’ and technique side of photography. Would it be correct in saying that a good photographer should not need to edit his/her photos at all to make them better?

]]>
https://dirtyoptics.com/before-and-after-with-adobe-lightroom/feed/ 0
Inspecto Roboto: A dirty robot, just how we like it. https://dirtyoptics.com/inspecto-roboto/ https://dirtyoptics.com/inspecto-roboto/#respond Mon, 18 Jun 2018 10:50:41 +0000 https://www.dirtyoptics.com/?p=51284 Our resident electronics expert, Andrew has been busy in the man cave this weekend. After reporting some dampness inside his house he decided to take matters into his own hands. The outcome: ‘Inspecto Roboto’! Andrew has pulled apart his racing drone and a few other bits and pieces to hack together a pretty sweet inspection robot for under the house. Check out his build below. And don’t forget to check out some of his other cool projects on his website.

Some of the Key components

  • Lynx motion Tri-Tracks chassis
  • 2 x 12V geared DC motors
  • LM298 motor controller drivers
  • 4s LiPo battery pack
  • LED light bar
  • Servos
  • Taranis hobby RC transmitter
  • FRsky receiver
  • Teensy 3.2

The ‘Inspecto Roboto’ – A confined space inspection robot.

My house has a bit of a moisture problem and I wanted to inspect the floor crawl space to see if there was an obvious fault. It is a horrible cramped environment that whilst I can just wiggle inside the rat carcass at the door confirmed my doubts about venturing any further. So I decided to tackle the problem with robotics!

This was a weekend build and whilst I just used parts lying around I had a lot of nice spares and old projects to work with. Essentially this was a hybrid system using parts from an old racing drone & a lynx motion robotics kit.

Locomotion was a lynx motion Tri-Tracks chassis. It has a nice set of rubberized Tracks as well as an acrylic frame, two 12V geared DC motors and other associated hardware. A basic LM298 motor controller drives each set of tracks from a 4s LiPo battery pack tucked inside. The camera system was from an old racing drone with an FPV display to make driving it around easier. The servo allows for tilting the camera up, panning is just turning the robot on the spot. Finally, a large LED light bar from a vehicle was installed up against the front with some additional acrylic pieces to act as bushes and help retain it in place. The light is controlled via a relay as it is convenient to switch it off when unrequired as it draws about 12W.

The controller was a Taranis hobby RC transmitter paired with a FRsky receiver and a teensy 3.2. The teensy decodes the signals & operates the motors, lights & servo. I have written about using these transmitters with microcontrollers before (Here) and they are a great option for long-range and reliable communication which xBees & other serial radios often struggle with.

The whole system was a bit of a hack but as someone who often spends forever ‘gilding the lily’ on a project until they grow bored of it and don’t finish it, this was a fun and pleasant change.

 

 

 

 

 

]]>
https://dirtyoptics.com/inspecto-roboto/feed/ 0