Category Archives: Electronics

TP-Link TL-MR3020 Portable OpenVPN Router

I’ve had a TP-Link TL-MR3020 mini router sitting around in my draw for sometime waiting for an idea for a project for it.

Motherboard

Finally decided that I would configure it as a portable OpenVPN hot spot based on this article from Logan Marchione to allow secure internet access, bypass geo-blocking and also to get around browsing restrictions on both the uni network and other public networks.

I had issues with the standard firmware download from the OpenWRT website as there was not enough room left on the flash to install kmod-fs-ext4 for ExtRoot.

I came across another firmware that had been repackaged with all the required USB packaged installed and can be downloaded here.

After that the rest of the instructions worked fine, I use Usenetserver as my VPN provider as I also use Usenet and configured two different profiles one with several Australian servers just for bypassing restrictions and for security. The second profile is several US servers for getting around geo-blocking.

A copy of the OpenVPN config file I created can be downloaded here.

After configuring and testing the VPN a DNS leak was being shown allowing traffic to still be monitored by my ISP, etc so I edited the dns servers here to the google DNS servers.

n

And changed the DNS resolve file to a custom one here:

With the lines:

nameserver 37.235.1.174

nameserver 37.235.1.177

WIth both of these changes the DNS leak was fixed and now showed the correct information when checked on IP Leak.

I’ve only really tested with a single client so far but throughput appears to be between 500-600kb/s the limit appears to be CPU power in the unit but is more than enough for browsing and the odd download.

After that was solved it was onto the hardware.

I removed the USB port and soldered the USB stick internally to tidy the whole package up.

 

My finally plan for this project is to incorporate a USB power bank inside as well reusing the old USB hole to be able to charge a phone, etc and internally wire the power bank to the router allowing it to be truly portable.Β  Going to be fun to try and make it all fit…

Update 29-3-16

Bit of an update on the current state of projects, things have slowed down a lot during summer as I have been working on a lot more things outside, with the weather cooling down now work on some inside/electronic projects can begin again.

The mysql, weather station and temp sensors have all been working well with now over 300,000 data points giving per minute data points on most for now just shy of twelve months.

Overall database size has grown to around 140mb for the whole set of sensors.

dbsize

The laundry fan has been installed and added to one of the relay boards and both DHT22 sensors have been mounted. One in the laundry and one in the bathroom.

Laundry Fan with DHT22
Laundry Fan with DHT22
Bathroom fan with DHT22
Bathroom fan with DHT22

The RFID system on the front door as also been working flawlessly now for almost 18 months with 1750 entries during that time.

webpage

 

The outdoor sensor array still hasn’t quite made it from it’s temp cardboard home however the final two sensors have arrived

The Sharp GP2Y1010AU0F dust sensor and the ML8511 UV sensor.Β  So now I can at least finish off the software side on the Arduino and do final testing before finding a case and mounting it outside.

DSC_0214

 

Doorbell camera has also stopped working. Not sure if it’s just a corrupt SD-Card in the Raspberry Pi if it’s gotten a bit too hot over summer and cooked, going to take it down in the next few days and find out.

Another project that has been collecting dust for a while now is a MAME arcade machine I started sometime back. Needs a couple of new joysticks, a tidy up and probably a new PC to drive it as the one in there is a little under powered and generates a lot of heat.

Some cable management would go astray either πŸ˜›

DSC_0209

DSC_0220

Quick look VoCore

Had a package arrive the other month with my VoCore which was a project I baked on Indiegogo a while back.

The VoCore is a tiny computer running OpenWRT with a 360mhz processor and 32MB of RAM and 16MB of flash with built in Wi-Fi, two 100mbs network cards, USB and 28 GPIO ports.

Perfect for projects that have limited room or that require WiFi.

I knew the board was small but really didn’t think it would be as small as it is, here it is next to a USB stick:

DSC_0854

The size (and my soldering skills) made soldering connectors onto the board quite a challenge.

They do make a dock for it which breaks out the USB and Ethernet connectors but prettyΒ  much doubles the price of the unit.

Initial configuration is done over serial with the provided USB-TTL converter but first power and serial lines have to be soldered on.

DSC_0863

As you can see my soldering skills aren’t the best on these small pitch connectors I will have to redo them before I use the unit in a permanent installation.

DSC_0861

After firing the unit up and connection via serial I reconfigured the wireless to operate in client mode and connect to my home Wi-Fi and was then able to connect via SSH:

vocore-login

My intention is to use this board with a USB Relay board to operate my garage door as well as other projects out the front of the house, this saves having to get a cable from the house into the garage which would be a nightmare.

Future projects may also include Wi-Fi connected appliances such as washing machine, dryer, kettle and the likes due to the small size, GPIO pins and cheap price.

Update 1-7-2015

Bit of an update, I’ve done more work on the back end and data collection and have ordered parts to begin a outdoor sensor array to compliment the weather station.

First upgrade was to my NAS which runs unRAID which previously had VirtualBox running on top of it to run the Webserver and Windows 7 VM for the home automation. The new version of unRAID includes the KVM visualization solution.

After updating unRAID and converting the VirtualBox images over everything was back up and running all with a nice web interface:

unraidvm

 

This allows for much easier control of the VM’s as well as start/shutdown with the NAS.

Two new data sources have been added to the system the first being the data from my front door RFID system which unfortunately doesn’t have a direct interface with mysql (it uses access) so I found a program that pulls data from msaccess into mysql here which I configured to poll every hour and insert into mysql.

This has been added to the web interface which now shows the Doorbell as well as the RFID data:

doors

Clicking into RFID gives the last 20 entries/exits allowing a quick view of who has been home over the last few days.

The second data source is CPU temperature from the Doorbell Raspberry Pi which was mostly out of curiosity but also to see how the Raspberry Pi was holding up to living outside.

I used a Python script to poll the data every 5 minutes and insert it into mysql, you can download the script here.

Below is a graph of the Pi temperature over a 24 hour period:

doorbellpigraph

And the added page for the sensor:

doorbellpi

Few changes to the internal web interface to show number of records for each sensor as well as min/max/avg of both temperature and humidity from each sensor:

tempreadings

minmaxavg

Mostly minor changes but gives a bit more info on everything.

 

I’ve ordered parts to build a outdoor sensor array which will be based off an Arduino with Ethernet shield and the following sensors:

DHT22 – Temperature and humidity

MQ-9 – Carbon Monoxide and Combustible gas sensor

BMP180 – Barometric pressure

ML8511 – UV level sensor

I may add a few other air quality sensors as well over time, this will be added to the data from the weather station and uRAD monitor data to give a good overview of outside conditions.

Update 21-5-15

Just a bit of a quick update on everything:

After running alright for about a month the Raspberry Pi in the doorbell locked up a few times and then stopped booting, from what I can tell my estimation of voltage drop over the PoE setup may have been a bit off and fed the Pi a bit too much voltage so I’ve bought a LM2596S step down voltage regulator off eBay and will run 12v over the PoE and then regulated 5v into the mini USB of the Pi.

Doorbell system is now back up and running and hopefully should remain stable now.

Voltage Regulator

I’ve done a bit more work on the internal house website to add the ability to quickly see the pictures taken from the doorbell camera as well as current data from my uRAD Monitor.
It gives a good overview of current weather,Β  sensor data and last ring of the doorbell. As more sensors are added I’ll add them in here. Clicking on each of the sensors brings up the last 100 entries and clicking the front door brings up the last 20 doorbell presses.

uRAD Monitor section give the current radiation counts per minute as well as an average and the links below create graphs showing CPM vs wind, rain fall and temp/humidity.

Updated House web page
Last 20 doorbell presses

The software that came with the weather station was pretty basic so I got Weather Display which is much more powerful and can export data directly into mysql as well as upload to a website, etc.

Weather Display

I’ve found the wireless from the weather station to be a bit unreliable hopefully just due to some flat batteries.

I’ve added new graphs to match weather data with radiation data from my uRAD Monitor, you can see flat sections in the graph where the weather station has not reported back correctly:

Rain vs CPM
Temp and Humidity vs CPM
Wind speed and gust speed vs CPM

A bit more work has been done with the home automation system. I replaced the 4 channel relay board with an 8 channel board which will do low voltage operations (12v/5v) and have re-purposed the 4 channel board for 240v switching as to keep LV and HV separate.

This has allowed adding of several more devices without buying expensive Insteon modules for each device.

Here are the different “rooms” in HCA now:

Kitchen
Lounge
Bathroom
Backyard

The front yard “room” now also includes buttons to capture and email a picture from the doorbell camera as well as start a live stream as seen below:

Frontyard
Captured picture sent via E-Mail

Currently finishing off the 5.1 system in the lounge and after that work will begin on expanding the rack to a floor to ceiling 19″ rack.

Weather Station

Been a good fortnight for deliveries it seems, my weather station arrived this morning πŸ™‚

The unit is just a cheap station (~$90 eBay) but provides wind speed/direction, rain fall, temp, humidity and air pressure as well as a USB connection to pull data into a PC and should have enough accuracy for what I need.

Got the unit unpacked and put together and begun some testing:

Test Setup

The included software is rather simple but does include an upload function which can be used with Weather Underground for their PWS system or to a custom PHP, JSP, ASP file which I will use to import the data to my mysql system.

This will allow me to graph data from my radiation monitor, my own temp/humidity sensors and weather data.

Easyweather Software

After testing the unit worked correctly I set about mounting the hardware. The station I’ve mounted to my antenna poll on the roof giving it good height from the surrounding houses, etc and the display has been mounted next to my thermostat allowing easy viewing and a short distance to run the USB cable to my NAS for data collection.

Next step is to write a PHP script to interpret the data from the unit and store it in my database.

Display mounted on the wall

I’ve also ordered an Insteon Thermostat which should hopefully arrive in the next couple of days allowing my to control the heating/cooling in the house πŸ™‚

Raspberry Pi Doorbell and Camera Part 2

After a session of lifting tin and climbing through the roof to run cables the camera has now made it’s way to it’s new home πŸ™‚

After the cable was run I wired up the POE and Ethernet and found there was too much of a voltage drop over the line to keep the Raspberry Pi running while taking a picture so I changed out the 5v PSU for a 7.5v PSU to bring the line voltage up.

After I did this the Pi booted no worries and shot off a picture.

psu

My eBay case arrived and while not the most subtle case for the job it has more than enough room to house everything.

The Pi was mounted to the plastic board inside with a pair of zip ties and the camera with a good chunk of blue tack. I think I’ll eventually mount the camera better but with the camera board being so small it is a bit of a pain to mount.

case outside

case inside

camera

And after mounting the case out the front we have success:

front door

I made a few further changes to the software side as well as shown here:

run script

As you can see here upon the door bell being pressed the Pi:

1. Sends a pushover notification via the API

2. Captures two pictures. One low res and one hi res

3. Attaches and emails the low resolution picture

4. Inserts the date and time to a mysql database

5. Copies the hi resolution picture to my NAS

 

Here you can see the mysql table which simply contains the date and time the door bell was pressed, eventually I will do up a PHP interface to be able to view the data from mysql more easily.

mysql

 

And now onto the next project πŸ™‚

Raspberry Pi Doorbell and Camera Part 1

After missing several people knocking at the door it was decided a doorbell was in order but I didn’t just want some annoying ringing bell to drive me nuts so after seeing Ahmad Khattab’s project on Hackaday here planning began on my own Raspberry Pi based door bell.

You can find Ahmad’s original Github repository here and Google doc with build instructions here.

Parts List:

Raspberry Pi Model B

Raspberry Pi Camera

Cheap wireless doorbell

Weather proof Case

 

I downloaded the complete SD image from here and used Win32 Disk Imager to put the image on an 8GB SD-Card after boot I went in and modified the code slightly by commenting out lines related to the LCD as I won’t be using it and have added support for Pushover a service that allows for push notifications to be sent to iOS, Android and also desktop browsers.

I also modified camera.py to take two pictures one at 800×600 which is emailed and a second at full resolution which is later copied to my NAS for storage.

launch.sh is used to start it monitoring the GPIO pin, I added this as a cron job on reboot.

Can download the modified files here.

The files that need to be customized for use are:

send_email_fast.py – Set your email address and SMTP server

send_email_attachment.py – Set your email address and SMTP server

pushover.py – Set your Pushover User and App Key’s

run.py – Un-comment and set path if you wish to copy the picture to a network share

There is also Google hangouts, twitter and Zapier support but I have not used them here.

 

With the software sorted it was onto the hardware:

DSC_1198

I stripped the circuit board from the receiver unit and un-soldered the speaker and battery connectors and replaced them with new leads. Someone was even nice enough to silk screen the board with all the appropriate labels.

DSC_1199

I then connected the battery leads to 3.3v (Pin 1) and Ground (Pin 9) and the speaker leads to GPIO7 (Pin 26) and Ground (Pin 25) for my build I omitted the 10K resister and am yet to have any issues.

gpio

DSC_1200

DSC_1222

A quick test and seconds later both a pushover notification and E-Mail arrived:

notification

Open up the email and we find the picture attached:

email

I’m still awaiting my case from China after it arrives the next step will be to mount all the hardware in the case, run a network cable to the location and wire up PoE for the unit.

I also intend to add support for the camera to be triggered by the motion sensor out the front for when I’m away or asleep for security.

 

Read on in Part 2

uRAD Monitor Flash Update

I recently received a firmware update for my uRAD Monitor so I thought I’d share my experience on it.

The new firmware adds a local web interface to few current stats as well as encryption back to the server.

You will need a ASP programmer that is capable of 3.3v, the firmware which you will have to request from Radu and avrdude for the flashing.

You can download avrdude from here.

I picked up a cheap ASP programmer from eBay for around ~$3 supporting both 5v and 3.3v.

Make sure the jumper is set for 3.3v.

DSC_1122

I then pulled down my monitor and removed the two screws on the back of the unit:

DSC_1127

Connected the programmer and powered it up, be careful as the orientation of the programmer may be different to mine!

DSC_1129

Fired up a command prompt and avrdude to download the firmware to the flash:

Command

Put the unit back together and reinstalled outside, after a few seconds the unit was back up and now responding with the new web interface:

web

Over all a pretty easy process, I look forward to future updates and am intending on building a weather station in the near future to be able to match weather data with the radiation data.

Front Door Electric Lock Part 2

Well after 2+ months of waiting for parts that never arrived I gave up and ordered new ones.
Rather annoying but did mean I went ahead and got better parts instead.

Instead of an all in one RFID/Controller I got a LAN connected controller board that supports up to four RFID readers and two doors.Β  This allows for more control in terms of users, time in/out and easy lock out of existing tags. Also means when I add in the garage door I’ve already got all the supporting equipment.

One extra feature that I plan on using is keeping an eye on the occupancy of the house so when everyone has taped out can switch off lights, heating, etc to save power.

I had already run a length of speaker wire to the door striker location and a length of CAT5 to the position of the RFID reader so hookup was pretty easy, the RFID reader uses 5 wires in total: +12v, GND, Data0, Data1 and LED

Was then just a matter of installing the software and entering the users. The wizard asks you to tap the tag on the RFID reader and then you add a name, department and any other information you want about the user.Β  You can then set access privileges on a per door and user basis. Software is quite overkill for this application (can support something like 20,000 users…) but for the price who cares πŸ™‚

And onto the pictures… I plan on making a video showing the door operation as well.

 

Electric Strike lock wired up.
Delivery πŸ˜€
RFID Tag
Control board all wired up
RFID Reader connected up
RFID Reader Mounted up