Search

Lazy Man Joe's Ramblings

Sonoff Wifi Switches – Flashing it with Tasmota Over-The-Air (OTA)

A friend of mine recently introduced me to the Sonoff switches – affordable, easy to use AND RE-programmable ! [Thanks Cliff ;-)]

I got the Sonoff Dual switch, which allows you to switch 2 separate appliances/devices from 1 Wifi switch.

dual2

Anyways, to get going I decided to flash it with the Sonoff-Tasmota firmware (as I wanted to be able to pull it into my Home Assistant setup easily)

The instructions on the Tasmota-Sonoff Wiki is fairly easy to follow and although they suggest you use a wired 3.3V FTDI USB-to-Serial Converter/Programmer (or a Raspberry Pi) – I also noticed you can use Wifi to update the firmware Over-The-Air !

The tool for that is called SonOTA. [Please note not all Sonoff switches may support this – so make sure you have a supported Sonoff Firmware version BEFORE you try to flash with SonOTA)

There are a couple of ways to get SonOTA working:

  1. Using the Windows pre-built .EXE (you can find it here)
    1. I used this as a 1st pass for the 1st Sonoff Dual switch I flashed with the firmware
    2. This is a quick & dirty way – but it CAN work & there’s nothing wrong with this 🙂
  2. Installing the SonOTA software on your machine & customising it as you need (this involves installing Python 3, etc. on your local machine)
    1. Here you can customise some of the setting beforehand
    2. I left all vanilla & it still worked fine 🙂

Once you have SonOTA on your machine, you can run it and follow the instructions on-screen.

The process involves:

  1. Running SonOTA (./sonota.py)
  2. Confirming the configuration of you local machine to ensure you have all the required bits in place
  3. Putting your Sonoff in Access Point (AP) mode [holding the button in for more than 7 seconds] and then connecting to the ITEAD-* wifi network
  4. Installing a small base firmware uploader
  5. The Sonoff will then connect to you local machine to get the actual firmware installed
  6. Just be patient and things will happen 🙂
  7. Once installed, you will go into “FinalStage” mode
    1. Here you connect to the Sonoff [wifi now called FinalStage] and configure it to be able to connect to your wifi network
    2. Once configured, it will reboot and join your wifi
  8. Then you have to check your router /DHCP server to make sure your Sonoff’s IP address gets reserved (to make sure it doesn’t change on power loss / reboot)

Upgrading your Sonoff to the latest Tasmota Firmware

The SonOTA tool flashes a version of Tasmota which may be outdated (you CAN update the config manually, but why worry ? :-))

So once you have your Sonoff on your wifi network, you can connect directly to it and select the “Firmware Upgrade” option

Tasmota-Upgrade

Get the latest Sonoff-Tasmota firmware release here [select the .bin version which is applicable to you, normally just sonoff.bin]

Upload it and wait for the Sonoff to reboot with the latest version.

Great – Now you’re SET !

Next steps:

  1. Connect your Sonoff to the device / devices you want to control & get going !
  2. Integrate into Home Assitant

Have fun !

Advertisements

Home-Assistant.io and Hassio – The best and easiest Home Automation tools to get going !

I’ve played with some home automation stuff on my Raspberry Pi in the past, but setting up the stuff was always a bit involved and I would loose interest somewhere down the line. This meant I’ve always had good intentions, but never really implemented anything (all the work was “proof-of-concept” stuff :-))

Well that has changed in the last couple of days ! 🙂

HomeAssistant-Dashboard

Home-Assistant.io, Hass.io, Sonoff switches (running Tasmota Firmware) and Node-Red changed ALL of that !

What do you need:

  1. Somewhere to run Home Assistant (I used a Raspberry Pi 3)
  2. Install Home Assistant
    1. They have an easy to follow install guide
  3. Once you have Home Assistance installed, you configure Hass.io to help you manage additions, etc. on Home Assistant
    1. A couple of add-ons I use:
    2. Hassio-Dashboard
      1. Configurator (makes it easy to edit Home Assistant configuration yaml files)
      2. Samba share (to connect to the Raspberry Pi and be able to edit files if the front-end breaks)
      3. SSH Server (if you’re more used to using ssh to connect to your Pi)
      4. TasmoAdmin (used because I make use of Sonoff switches running Tasmota firmware)
      5. Mosquitto Broker (used to communicate with your switches)
      6. Node-Red (Visual Environment for putting “flows” together)
  4. You install all of these add-ons via the Hass.io Add-On Store
  5. THEN you need some switches
    1. I’m using the Sonoff switches as they’re easy to use and not too expensive
    2. I installed the Tasmota Firmware on them
  6. Adding your Sonoffs to Home Assistant involves some configuration editing (will cover that in a separate post), but once you have it working – it works like a charm !

Have fun !

 

How to get telnet onto MacOS High Sierra

Sometimes you just want to drop into a terminal window and test some “stuff”.

If you are running MacOS High Sierra (10.13), you may notice that telnet is not available as part of a standard install anymore 😦

Well, the Homebrew guys have come to the rescue and provide an option to install the “missing packages on macOS”.

Head over to brew.sh for more info.

Basically you have to install Homebrew and then after that you can install other packages.

In terminal, paste the following:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

wait for the install to finish (it will download and install the Xcode command-line tools, as well as configure homebrew.)

Once you’ve done this you can install packages like telnet, etc.

For telnet use this command:

brew install telnet

Have fun !

Adding Porn, Fake News and Gambling blocking to PiHole

I’ve been using the RaspberryPi PiHole ad-blocking installation (see my post) quite successfully in our home environment and am very happy with it.

Lately I’ve also looked at adding additional content blocking to the solution to block other content like:

  • Porn
  • Gambling
  • Fake News

I found the following resources for hosts which you can add to your Block Lists in PiHole.

Steven Black’s Lists (multiple – select which one makes sense for you)

Chad Mayfields’ List (post) and actual list

To configure:

  1. Open your PiHole Dashboard and login
  2. Go to Settings -> Block Lists
  3. Add the following to your current lists (PiHole already has ad-blocking lists)
    1. https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
    2. https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling-porn/hosts
    3. https://raw.githubusercontent.com/chadmayfield/pihole-blocklists/master/lists/pi_blocklist_porn_top1m.list
  4. Save and Update

The PiHole installation will pull all the hosts into its configuration and ensure the sites are blocked on a DNS level.

Sample screen of my current configuration

PiHoleBlockLists

You may find however that some sites are classified as “porn” (i.e. Maxim.com, etc.) but this is probably due to some potential content on there which is deemed “close” to porn 🙂

A small price to pay for better piece of mind – although the lists will not block all content (new sites pop up every day), it will help with the majority of the content.

You always have the option to add your own Blacklist sites and I recommend you review the PiHole DNS queries on a regular basis to see any potential additional items to add.

Have fun !

Raspberry Pi, Homebridge, Apple & Siri

About a year ago I was playing with my Raspberry Pi, connecting it via HomeBridge to my Apple TV & iPhone.

HomeBridge links of interest:

This was just a proof of concept and I never posted about it on my blog 😦

I am planning on doing some work on this again (soon) – doing some automation at home for my garden, etc.

In the meantime – some of the videos from a year ago:

https://www.youtube.com/watch?v=JFq824Yditw

https://www.youtube.com/watch?v=z9tFEF8FzdI

https://www.youtube.com/watch?v=BZEXJil-KD8

https://www.youtube.com/watch?v=NrMXOTM2-wM

https://www.youtube.com/watch?v=ncvaOB08CGE

 

Struggling with Locales on your Raspberry Pi ? Here’s a fix !

I tend to tinker with my Raspberry Pi every now & then, but keep on running into a Locale issue.

Even using the sudo raspi-config utility doesn’t seem to fix things 😦 [btw – I’m setting the locale to en_ZA.UTF-8 as I’m in South Africa :-)]

I found the following way seems to work best as it FORCES the locale info 🙂

Use the following:

sudo nano /etc/default/locale

In the editor, make the following changes:

LANG=en_ZA.UTF-8
LC_ALL=en_ZA.UTF-8
LANGUAGE=en_ZA.UTF-8

Save and reboot !

This fixed the issue for me.

Have fun !

Deleting your Facebook account #DELETEFACEBOOK

Used this article as a guide on how to delete my Facebook account permanently.

 

https://mashable.com/2018/03/19/how-to-delete-facebook-account/#EKUnvbrLdPqp

 

Quite a big step for me – although I’ve not been using FB actively the last year 🙂

Tunnelblick – free software for OpenVPN on OS X and macOS

I installed PiVPN on one of my Raspberry Pi’s at home yesterday to set up my own VPN server at home. (blog post)

As PiVPN makes use of OpenVPN on the Raspberry Pi, I’ve been looking for an easy to use  OpenVPN client for my Mac.

Tunnelblick is a free open source OpenVPN VPN client which fits the bill 🙂

Have a look here to get it – Tunnelblick

Setup is easy:

  •  Install Tunnelblick on your Mac
  • Download the .ovpn configuration file from your VPN server (PiVPN in my case)
  • Double-click on the file.
  • Tunnelblick will automatically open the configuration and you’re ready to connect 🙂

Easy !

Have fun !

Running your own Home VPN Server from a Raspberry Pi (PiVPN)

I recently installed Pi-Hole as an ad-blocking service on our home network – it’s working quite well and I’m truly impressed!

While on holiday recently I thought it would be quite “cool” to have VPN access to our network at home and came across the following article – “How to turn your Raspberry Pi into a Home VPN Server using PiVPN” using PiVPN.

Installing PiVPN on the same Raspberry Pi I’m running Pi-Hole on seemed like a good idea (and it IS a supported installation).

So needless to say, once we got back from holiday I had a quick look at the article and followed the instructions. Within a very short period of time I had a PiVPN (OpenVPN) server running on our network and just had to configure our router for port-forwarding.

I’ve also signed up for the free option from noip.com to make it easier for us to connect to our VPN at home.

NOTE: One tweak I added to our configuration was to edit the /etc/dnsmasq.conf file to ensure that when I connect to the VPN that my clients would also have ad-blocking enabled 🙂

For more detail on this, refer to the FAQ for the PiVPN software.

Installation was quick & easy!

Have fun !

Create a free website or blog at WordPress.com.

Up ↑