Toe Dabbing in ESP8266

The start of something small

I’ve always had a dream of learning electronics and I’ve had a ESP8266 sitting around on my desk for a quite a while now.

By Sparkfun Electronics -, CC BY 2.0,
By Sparkfun Electronics –, CC BY 2.0,

This board is a marvel of technology, originally it was designed as a WiFi chip, but it was made so well and flexibly, that hackers learnt that you could program this small chip to do wonderful amazing low power things via the serial port using just the AT command set, which is how they used to talk to modems, way back when.

An entire eco-system of tools formed around this and a community of hardware aficionados who wanted to build small pervasive electronics were born.

The dream

My dream was always to build small ‘throw away’ electronic devices cheaply that could form some sort of network and provide access to metrics of some sort, light levels, temperatures, air pressure and layer them throughout a room and then build displays of this data. An example that I’ve seen recently isn’t quite this but it is similar in a popular supermarket chain that shows their electricity and water usage on real time updated graphs at the entrance.

I find this sort of information which is kinda mundane being turned into something useful, fascinating.

Turn it into a reality

To find a project there first needs to be something to do… so the simplest project for the ESP is to set it up as a WiFi Access Point, pretty advanced functionality for a single chip, or you can make it connect to an existing wifi network and display a button on a website to click on and off . Once it’s connected with this example above, it should serve a website to you regardless of where you try to browse, regardless of where you try to browse to.

The board I got has a micro usb port with a serial port chip, two buttons and easy pin outs for doing additional things like adding sensors or servos’

The first steps into the new brave world.

The chip arrives blank so I had to first program the firmware using a flasher and a ROM.

This was relatively scary as I always find my heart skips a beat when it comes time to click the flash button.

Once we have the firmware, which is only actually writing some code. I installed the Arduino IDE and a few plugins to make it work with the ESP8266.

I found the online code sample for doing exactly what I wanted and the code was simple enough to copy paste while still understanding every line, so that made it perfect.

Up and running.

With the code deployed and live on the ESP, I can fire up the wireless connection wizard on my PC (and my phone) and can connect to the new WiFi network (IoT — Free WiFi).

And it displays this page when you try to browse anything!

No too exciting, but pretty good for a tiny little board.

Where to from here ?

Now that I have an ESP8266 up and running and doing something useful, what more could I do ?

There’s some hardware like the Sonoff Basic 

which can let you switch electrical switches on and off using a simple programmable interface.

Getting the whole house hooked up to be controlled from a mobile phone is something that I find fascinating, control sound, appliances, moods, lighting.

You could for instance have a temperature sensor which knows what times of day to activate a heater for when you get home to a nice and cosy lounge.

You can have movement sensors that could play music which follows you around the house, but only in the room you’re in.

The world becomes yours to control and gamify. A future I look forwards too and I’m glad I have dabbled my toes, and will definitely be back to dive in, in the coming years!


FaceOff without the surgery… DeepFace and FaceSwap

What is FaceSwap ?

FaceSwap is a technology used for taking one face and swapping it with another in an image or video. What makes this news ? All the tools are available for anyone to use now!

It’s an interesting topic and it’s pretty current, I found the images of Nic Cage everywhere absolutely amazing, especially the Indianna Jones video, that was fantastic. Take a look at the video below!

I love the technology and the way it’s so accessible, unfortunately that comes with the bad part of it too, that people are using this to put people into situations they were never in.

What I’m trying to accomplish and what I want to share

So with the bad people doing bad things, what am I trying to do ?

I want to see how easy it is for a person like me to grab the required tools, and with very little understanding of the underlying technologies and how they work, see what I can accomplish at what to me, feels like the cutting edge of ML (Machine Learning).

Getting setup

The tools

OpenCV logo

The toolset runs on Python and uses OpenCV and TensorFlow on a GPU, this is pretty standard for this area from what I understand.

So I grabbed the source code, Python, OpenCV, TensorFlow and then proceeded to have ultimate pain on my windows box.

After fighting the requirements and massive Nvidia downloads of many different drivers. I actually upgraded the requirements for the DeepFace source code to a new version of TensorFlow, which then entailed using newer versions of CUDA and cuDNN and then the magic happened.


Some of the libraries used are fascinating, to have the images setup the way you need, they actually understand that in all likelyhood you’re not going to have a homegenous image set of faces ready to use and provide a first step, which takes all the faces out of the photos you have, even doing some simple rotations to align them. I will definitely be using this feature in future.

Once I had my two face sets from an image search on my Google Photo’s by Name, I pulled the faces out and cleaned out the out directories of the additional people who appeared in the photos.

This took about an hour of manual labour, but there is now a very freaky collection of 300+ photos of me and my wife in single folders. (The actual reccomendation is about 3000 photos, so I’m well under, this might bite me later)

I am imagining doing this process for multiple friends one day so I can put them in places they’ve never been and see if I can freak them out. That is probably a LOT of effort for a very minimal payoff.

Do the face magic

Now that we have training data, we actually need to train a model that will encode the logic for doing this transformation from one face to another, my understanding is that there are libraries logic for mapping the features of a face and with enough data the mapping from the one face to the other face will become seamless. This involves a lot of processing and trial and error to build a model that can do this in a repeatable fashion over and over.

The training step runs for a very long time and the longer you run it the better a result you get, thankfully this isn’t a one off process and you can pick up your training to make the resultant image better quite easily.

Working Hard

Make me images

The process of making images is quite straight forward of providing a source image, this then gets taken along with the model and the face mapping magic goes on, on your GPU and you get a new image outputted with the faces changed.

After a few minutes of processing, my data loss went down to 0.055 and my images looked like a child had cut a copy of the one face out and stuck inside the other!

You can see above how the alignment is actually amazing, but unfortunately without the face shapes being similar that effect is not believable at all. Even more so when we move to video.

Make me videos

Interestingly the process of creating a video is the same as with images, though it’s batch processing of the single frames which you then recombine back into a video.

Where to from here ?


The technology is amazing and the work that has been put in is awesome, but there is a lot of manual tinkering to get to where you want to be, so automating this would be amazing.

I had a few ideas.

Face Classification from Source Images

This whole process could be automated, you take your whole image set, and let DeepFace automated the pulling of faces (which is already does), but then it takes those faces and matches them with each other to work out which are the same peoples (much like Google does using TensorFlow on Google Photos)

Automated model generation

Once we have our people classified, we could have a process to take all the images fed in and do all the combinations of models for those people.

Only replace the person for the model.

Since we can identify individuals now, you could actually only replace the face of the person who matches the model on a face match. This was a bit unfortunate from my experience that everyone gets treated to the model fitting.

Video Processing

Being able to process videos directly could be a boon for the software.


And finally since we’re doing the video now, we should extend this to do the audio as well. Imagine being able to change a person entirely in a video, including the way their voice sounded on your own home PC!

Adobe and Lyra both have products in testing to do just this, with one minute of audio!

The future is bright

And fake! or whatever you want it to be, depending on how you look at it.

A miner in a new world

I’m a self confessed techno nerd, I find almost everything to do with computers fascinating from reading every technology news source on the web on a daily basis to Kickstarting insane technologies, it’s actually a surprise to me that I never had the urge to learn about the ‘seedy underworld’ of crypto.

Even now I still find it amazing how far the phenomenon has come and what levels people have gone to, to be involved in it.

With so much critical mass and not wanting to feel left out anymore, I started a journey to find out more about what crypto is and how it works.

In all honesty, it’s after the fact and the bubble has actually started to pop on the last 6 months hay days of ever rising exchange rates, but I was still finally ready to read up and learn some more about what’s going on, and dig my hands in a bit further than I had before.

I decided that more than for financial gain, I wanted to get in on the technology and learn start to finish what it takes to be involved.


What is it

At a simplistic, off the top of my head level of it, is that you make your computer work hard to validate something, this work, when done by 1000’s of PC’s can’t be faked by any one corporation and the PoW (Proof of Work) that you do builds upon the Blocks of the work previously done (The BlockChain) to allow a decentralised network to validate a transaction on your behalf without actually involving a third party between the two parties transacting.

What should I mine ?

Actually mining on the popular cryptos takes a lot of patience or money for a rig. So my journey started with finding a viable mining currency.

This changes on a practically daily basis. WhatToMine Is a great website for finding out what’s going on the market and what you can potentially do with your gaming rig. After working out that my little gaming rig’s 1070 wasn’t going to bring home the $$$’s I started looking for something that I could feasably mine and make some coins off of.

A quick investigation into some algorithms shows that some are now FPGA and ASIC resistant. Bitcoin is not, so if you’re not mining with ASIC’s you shouldn’t waste your time.

FPGA - Fully programmable gate array, a device that you can
program specifically to run certain code very efficiently and fast, much
faster than a normal generic processor could.

ASIC - A circuit developed to run a specific program in hardware, VERY fast at doing a very specific task.

Another great website is CoinMarketCap where you can see all the top currencies.

For my jouney I found Monero, a even more privacy orientated coin, which seems quite interesting. I also really liked the look of TRON and Ripple but unfortunately were too hard to mine and already felt a bit too mainstream for my interests. ZCash also cropped up a few times as really good for Nvidia cards.

Thankfully there’s a couple offshoot projects like AEON and SumoKoin

I chose SumoKoin for my learning experience.

How to mine

There is a lot of software out there for mining, from the simple miners (which are normally only CPU), to what feels like dodgy miners (unverified). But a couple pop out quite soon in, though which ones support your GPU and the crypto you want to mine will determine which you want to use.

  • CCMiner – Good comprehesive miner, not always the fastest though.
  • Claymore – Recognised as a great AMD Mining software stack, supports Nvidia too.
  • XMR-Stak – A great Monero miner for AMD and Nvidia.
  • MinerGate – Really easy to use, while it was easy to get up and running, I didn’t feel like I had control over anything, which this whole new world is meant to provide you with.

I chose XMR-Stak for it’s speed to ease of use, the SumoKoin website actually detailed it’s setup as well.

What else do I need

For any of the crypto’s you want to get involved in you need to have a Wallet for storing and transferring funds.


Normally you would generate these yourself, as there is no fully trusted third part to do this. To do so, you need to download the wallet software as well as the blockchain (which can be 10’s of Gigabytes big).

If you’re willing to cede control you can have a third party do this on your behalf. It’s safest to do this on your own, or use a very reputable exchange.


At some point you’re going to want to turn your coin into something else, so you’ll need an exchange which can handle the exchange of one token to another, they normally do this by providing you with wallets on the exchange in the different crypto’s you want to use. Some exchanges will even allow you to transfer back into fiat letting you spend your hard earned $$$’s.

SumoKoin is currently only listed on Cryptopia A well regarded exchange from my travels online. LiveCoin The one I used to succesfully make my conversions between crypto’s


Even with the new currencies the amount of processing power being thrown at them is staggering, to find the key to the block chain is like searching for a needle in a haystack, you could possibly get lucky on your own or you could pool your procesing together with others (for a small fee) and collectively as a group split the bounty you get for successfully finding a key.

I chose to go with the Official SumoKoin pool

Other ones I found included – Main coins, but not Sumo FlyPool – Seemed quite nice, have some unconfirmed balances there, no transfers.

Lets get mining

Once you have a wallet, you setup your mining software to mine to the pool, either to your account at the pool, or to your wallet directly.

With your software configured, off you go.

Some time later

For mining SumoKoins, I determined my end goal was to mine enough to make a profit, aparently I was going to mine a revenue or $4 / day, so from a profit expecation I should have come out with roughly $3.40 per day.

I decided on 5 SumoKoins for my experiment and this took about a week to mine with my hardware and the current difficulty on the coin.

Thus the task of retreiving cash from my hard earned coins started.

Get the money in your physical wallet

Depending on the pool your mining too you could have a different flow.

For the main SumoKoin pool, I was mining directly to my wallet and whenever I hit a threshold, 0.5 SumoKoin’s, they would transfer the cash from my unconfirmed balance on the pool to my wallet which I had setup to mine to.

For another pool you would mine to your account and then have to initiate a transfer at a later date which is also over a threshold they hold you to.

Now that you have control over you money, it’s time to move it to an exchange which you can get it into the crypto / currency you need.

In my case I transferred it

  • From my wallet
  • To an exchange which supported it (very few for some altcoins, sometimes only one)
  • Exchanged the Sumo into Ethereum
  • Move to an exchange in my country which supported Ethereum and my local currency.
  • Move onto my bank card

The whole process to about a day all in all with moving around, mostly waiting time to confirm.

In the case of the crypto currencies there is normally waiting time to confirm that you didn’t try to double transfer the cash or fake it, and in the case of banks, they just take a day or two.

At the end of that I made half of what the coins where worth as when I started, most of it was actually the withdrawl fee which was static, but hurt quite a bit at the low volume I was moving around.

Where to from here ?

I honestly thought I knew more about the process when I started and learnt quite a lot. The setting up of the wallets and the mining clients as well as keeping it all running smoothly was very interesting. The process of moving the coins around was actually quite complicated to work out, but once I had it I was very happy with the process.

The other things I’m interested in is the idea of a mining rig with proper operating system support, actual running of a Crypto currency, the pools and the exchanges. I still think there’s a lot for me to learn here and I look forwards to exploring it more.