How to use FORScan to enable Automatic Door Locking on a Ford Fiesta MK7 (ST’s/Zetec’s/etc)

Introduction

I’ve seen quite a few posts on car enthusiast groups about the popular software FORScan and how to use it to diagnose and enable certain features on the cars internal computer.

FORScan is a desktop application (also available for Android/iPhone’s albeit with limited functionality) that is used for diagnosis and configuration of the main cars computer.

It should be noted that if you don’t know what you’re doing, DO NOT guess as it can lead to unintended results!

Download & Install FORScan

FORScan can be downloaded from their website by clicking here.

(As of this article, the current version is 2.3.20 beta and will change in the future).

On your computer, you’ll need to click where it says “FORScan version 2.3.20 beta for Windows – free”.

Generate Licence

In order to use FORScan fully, you will need to generate a licence key. This is quite simple and you don’t need to pay a penny. Just follow the steps below and you’ll be ready to begin using the software.

  1. Click here to generate a licence key. You will need an account if you don’t have one already. Proceed to register than come back to this step.
  2. When logged in, and you’re viewing the “Generate Extended License” page, fill in the details accordingly.
  3. For the field that says “Hardware ID *:”, you will find this in the FORScan software by clicking the very bottom icon on the left hand side. (It looks like a wheel with a question mark in the middle)
  4. Click the “Copy to clipboard” button next to where it says “Standard licence. Hardware ID: XXXXXXXX-XXXX (where X is an alphanumeric character).
  5. Paste this back into the field on the web page and click Generate.
  6. You will then get a record in the table below. On the far right, click “Download” under the Action column.

Importing the licence into FORScan

Once you have downloaded the Licence, you can then proceed to import it into FORScan. You only need to do this once until the licence expires, then just repeat the steps above again.

  1. Click the “Load licence key” button on the same tab where you found the Hardware ID (step 3 above).
  2. Find the file and click OK.
  3. You should now have a valid licence within the software.

Activating Automatic Door Lock in the Main Car Configuration

At this stage, you will need your ELM327 USB device and your laptop. Follow the steps below to activate automatic door locking within the Main Car Configuration.

  1. Plug your ELM327 USB Device into your laptop.
  2. Plug the OBD end of the device into your cars OBDII port.
  3. Start the ignition on your car.
  4. Click the connect icon on the main screen (car icon with the yellow information symbol) which is in the bottom left and looks like two blue plugs connected together.
  5. Wait for the software to connect to your car. At this point you may get an additional dialog that asks if you want to save the profile of your current car, you can click “Yes” to this to stop it asking you in future.
  6. Once connected, head over to the “Configuration and Programming” tab (third icon from the bottom on the left hand side that looks like a computer chip).
  7. You will see a list of modules and their names identified by FORScan. You want to find the name “Central Configuration” and click the Play button at the bottom of the screen.
  8. You will be told to turn off the ignition. Turn it off, then click Ok, then turn it back on again.
  9. You will get another screen with a lot of  configurable items on. Make sure in the dropdown next to “Mode”, you have it on “Engineering 1 (+ all editable)” so you can edit the fields.
  10. Find where it says “Automatic locking by speed” and click on it. Then click the button at the bottom that says “Edit selected”.
  11. A window will popup with a selection. Click on “02 – Automatic Locking” and click the tick button.
  12. Click write and then follow the on screen instructions.
  13. Wait until it finishes writing the configuration back to the car. Your dials may make a funny sound during this process and the radio may change.
  14. Once complete, click the stop button down below and head over to the main tab again and click the disconnect icon down below next to the connect icon identified earlier.
  15. You may now disconnect your ELM327 device and unplug it from your laptop.

Activating Automatic Door Lock

In order to finish off the process of activating automatic door locking, you will need to perform a sequence on the car. Follow the steps in order and you should be good.

  1. Turn the ignition on.
  2. Press the power door lock control three times.
  3. Turn the ignition off.
  4. Press the power door lock control three times.
  5. Turn the ignition on. The module is now in programming mode (mine beeped on this final step).

Congratulations! You have now successfully activated Automatic Door Locking. Now, when you travel above 15MPH, the doors automatically lock themselves!

How to use .Include() with .Select() in EF Core (.NET Core)

Introduction

I come across a situation in which I had a navigation property that had a property with a collection of items and I needed to use this data to loop over within a React component. The problem was, I was using a .Select() within LINQ to format my JSON response to a more suitable format that I can easily interpret on my frontend. This then caused the .Include() to “not work” and fail to populate the property.

The Solution

The solution was pretty simple, although I’m still wondering if there is a better way (please comment if you have one). All I did was include the following after my .Include()‘s and before my .Select();

Apparently this causes the query to get executed and then the rest of the operations after will be done in memory. This then populated my navigation property collection property and I was able to use the data on the frontend.

Example code

Before

After

I hope this helped you out if you’re wondering why your properties aren’t being populated when you use an .Include() and a .Select()!

How to create a GPS tracker with a Raspberry Pi, USB GSM Modem, and AWS

Introduction

Recently I’ve been worried about recent car thefts and thought I’d create something to give me some security over the matter. This is why I decided to create a GPS tracker. It’s not the first time I’ve installed a Raspberry Pi in my car, I created a dashcam that used the Raspberry Pi V2 camera and the inbuilt WiFi to act as an AdHoc AP. This allowed me to see what’s happening in front of the car when I wasn’t there and also transfer files as soon as I arrived back at home to my local home server as a USB WiFi dongle was also attached that connected to my home WiFi.

The Accessories

For this project I used;

  • USB mobile GSM dongle (I used a Huawei E303).
  • USB GPS Dongle (U-Blox 7).
  • Raspberry Pi 2 (I had this spare laying around + good processing power).

How it works

The raspberry pi has Debian Jessie installed that is currently the latest OS you can run from the Raspberry Pi website. I chose to have the desktop already installed as it comes in useful when I want to remotely control the pi via VNC. More on this later.

WVDial – Connecting to the GSM network

Setting up the USB GSM Modem was a bit of a pain. I used a piece of software called wvdial that you can install via apt-get. The configuration for this, since I used giffgaff is;

The config file is located at /etc/wvdial.conf

There’s no private parts retracted from this as it is all generic since the SIM card is what is registered with the network.

Once this was setup you can simply run sudo wvdial and it should dial in and connect fine. You’ll notice if you also run ifconfig -a it created a ppp0 interface that is used to access the internet.

Now, for me when testing, I also had my Ethernet cable connected so in order to test I had to change the default route. To do this, just run;

Now, if you ping google.co.uk or any other site, you should see some times that are quite high due to latency when on the mobile network.

Once I know this was working, I created a little script that launches on startup;

This could be written better, but I’m no bash expert, but it works.

This script checks to see if the interface ppp0 is available, if not, then it continues with the loop and attempts to start wvdial again. Once wvdial is running an an interface is created, it then starts the tracker application that is written in node.

GPS Dongle

Setting GPS up on the raspberry pi is a relatively simple task once I knew what I was doing. Simply plug in the USB dongle and identify which port it is using. I found that mine was on /dev/ttyACM0. I found this out because if I ran sudo cat /dev/ttyAMC0 I could see a lot of raw GPS data.

Once this port was identified, then I proceeded onto installing some utilities by doing sudo apt install gpsd gpsd-clients.

Once this has finished installing, proceed to run the following commands, assuming the port you identified was /dev/ttyAMC0 like mine was.

If you have a GPS lock, you will see all the fields populated in that window. You can close it by doing CTRL+C.

The tracker + AWS

At some point I will upload this to github. For now, I’ll explain what I did.

The tracking application is built in NodeJS and uses a node module I come across called node-gpsd. This handles the parsing of the raw GPS data that you saw earlier and returns a constant stream of GPS data in the form of a JSON object. I then setup the necessary IAM roles and policies in AWS so that only the Lambda has permission to read/write to the DynamoDB table and Cloudwatch for logging. I also setup an AWS gateway and added a POST method that is passed to the Lambda that just handles putting the data into dynamo, nothing else.

Here is how it looks in AWS Gateway:

And here’s what the DynamoDB table looks like (with the coordinates retracted):

NOTE: I should note that the tracking application determines whether to send the location by checking to see if the vehicle has moved by matching the previous sent coordinates to the current coordinates. This saves bandwidth and write units on DynamoDB.

Repositories

You can clone the repositories for both projects from Github.

Summary

I will improve this article soon and provide images for you to see what I have done visually and provide the source code for my Lambda and tracking application.

I have tested this system and it works very well, the location is highly accurate!

Please feel free to leave a comment on any questions you may have and i’ll try my best to help you.

How to setup an Access Point via hostapd – Including using the TL-WN725N

Introduction

I recently had to setup an Access Point using my TL-WN725N which allowed me to share my internet to multiple devices whilst my in-built WiFi on my laptop was connected to a WiFi Access Point with an internet connection. This was because only one device could be connected using the access code which I paid quite a lot of money for and thus I couldn’t connect my phone, or other devices.

In this tutorial, I will guide you through step by step on how to install the required software, and use a very helpful piece of software that does all the hard work for you.

Install the required software

Download and Install create_ap

create_ap is an excellent piece of software that manages hostapd and all the networking for you. It is run via command line and is very easy to use. You can read the README for it here on Its github page.

In order to install this, we are going to create a directory called “src” in the home directory. This is where we will download the code to and run the install command from.

NOTE: The install command places the file in /usr/bin or /usr/local/bin so it can be used from the command line without specifying its directory.

Start an AP

In order to start an Access Point (AP) we need to know what the device is called.

Run the following command;

We should see something like this;

NOTE: I removed my MAC Address and replaced it with numbers for privacy 🙂

I know wlan1 is going to be my Access Point adapter since I ran ifconfig before and after I plugged it in. All you need to know now is the other name of the device you want to share internet from.

To start an AP with wlan1 as the AP, and let’s say, wlan0 as the source adapter which is currently connected to a WiFi network with internet access, then run;

This should start up correctly and you should be able to find and connect to the WiFi AP. When you connect, you should be able to use the internet. You can find more examples by reading the README on the github page.

Using the TL-WN725N as an AP

If you followed everything above and it fails to start an AP, this is probably because you need to download a special version of hostapd for Ralink support. This is what I had to do in order to use the TL-WN725N USB adapter which uses the ralink drivers.

Before we start, let’s remove hostapd since we’re going to compile and install our own version;

Now we download hostapd to our src directory and extract it;

And finally, compile and install;

The last step will move the compiled hostapd binary to /usr/local/bin, add a startup script and create a configuration file in /etc/hostapd/hostapd.conf.

Now it is a good idea to reboot your device and then try and use the command above with the “–driver rtl871xdrv” paramter to start an AP. Hopefully it works!

An example would be;

How to install FFMPEG, Libx264, LibRTMP, LibAACPlus, LibVPX on the Raspberry Pi (Debian “Wheezy” ARMHF)

In the past I’ve had to been required to install FFMPEG for applications such as Serviio or a website like Clipbucket. It can be quite stressful since you could get dependency issues if you tried reading any other tutorials online, since the worst nightmare is if something breaks when you have compiled software using wrong dependencies. But this tutorial should ensure that it’ll work first time.

 UPDATE (12/10/2016): I’ve since updated this tutorial to add two new codecs for FFMPEG. I’ve also changed the FFMPEG repository to the official one rather than VideoLan. I’ve tested this complete tutorial for my Raspberry Pi 3 and it works fine.

Removing any existing dependencies

It’s vital to uninstall everything we’re going to be compiling/installing just in case there have been custom compilations of software that might be corrupted or broken. I’ve had a few errors in the past which resulted in “Illegal Instruction” when executing “ffmpeg” in the terminal.

Just copy and paste this into your terminal and hit enter. Type y and hit enter when necessary.

Downloading the Dependencies

Copy and Paste the commands below. When it asks, type and press Enter. This will download and install everything we need for later on.

Downloading & Compiling FFMPEG AND It’s Modules

Before we get started, we will be working inside a folder within the home directory. It is important not to remove this file in-case you want to uninstall anything later. Type the commands below in order and follow through.

Downloading & Compiling LibaacPlus

Again, type the below commands in order, and then move onto the next step.

Downloading & Compiling Libx264

 Downloading & Compiling LibVPX

NOTE: if you see the command output for “./configure” incorrectly identify the Pi as ArmV7 instead of ArmV6, try running the configure command again with the following parameter;

Downloading & Compiling LibRTMP

Now, before we move on, it’s important to run the command

This will update the system and make it aware of the new packages which have been installed.

Downloading & Compiling Libfaac

When you’re in the nana editor, you will need to go to line 126. Once you’re at that line, make the below code the same as in the file…

Once you’re finished, press CTRL + O to save, and then hit enter, then press CTRL + X to close the editor.

Then carry on…

It’s important to do a reboot just to make sure everything is being recognised and found.

Downloading & Compiling LibFDK-aac

Downloading & Compiling FFMPEG (Latest Version)

NOTE: This took my Raspberry Pi (Model B) around ~2 hours when overclocked to “Turbo” – 1GHz.

Finishing up

Now that FFMPEG has been compiled and installed successfully, we will need to reboot to make sure that everything is working. Type in;

When the Pi boots up, type in “ffmpeg” and you should see an output similar to that of what I get below;

And that’s it! You have now successfully installed FFMPEG on your Raspberry Pi! 🙂

Summary

The Raspberry Pi is a small credit-card sized computer. It’s very low powered and can be powered by a mini-usb cable and USB plug, such as a modern day phone charger. The Raspberry Pi (Model B) has a stock 700Mhz Armv6 processor and 512MB of RAM. The processor can be overclocked in the configuration to a maximum of 1Ghz (WARNING – Overclocking the Pi may void your warranty and break it).

When software utilises FFMPEG, you will see that it may bring the processor usage to 100% on the pi. This will cause the SoC to heat up rapidly unless you have a heatsink or some other form of cooling. At 100% CPU utilisation, the temperature without a heatsink can reach up to 80 Degrees Celsius!

Feel free to comment below and ask any questions!

How to run Boinc & BoincTUI on the Raspberry Pi

Before we start, I would like to take this time to explain what BOINC actually is.

What is BOINC?

BOINC is an open-source piece of software that allows users to volunteer their computers idle time to carry out scientific research. This in turn is called Grid-Computing. In other words, you can register to become part of a project which uses your computers’ idle time to search for new cures for diseases or help gain a better understanding of our galaxy. There are plenty of research projects available which you can find here.

Installing BOINC on the Raspberry Pi

In order to install BOINC on the Raspberry Pi, you will need to make sure that you have enough space on the SDCard. Other than that, you can go ahead and install it by typing in…

This will install BOINC and the GUI if you want to Remote Desktop (presuming its headless) into the Pi and check up on your projects instead of using the text interface.

Installing BOINCTUI on the Raspberry Pi

This was a little frustrating at first, however I managed to get help on the Raspberry Pi forums from a user named ghans.

Start off by navigating to the home directory by typing in cd ~/. Then type in the following to download the source code into the folder “boinctui” – presuming you have subversion installed. If not, then type in

Download source code –

After the source code has downloaded, cd into the directory by typing in “cd boinctui” – without the quotes.

Then follow, in order, the commands listed;

The compiling took me about 20 minutes give or take with my Pi over-clocked @ 1GHz.

NOTE: If you get any errors about missing libraries when running ./configure, you may need to run the following commands;

Once it’s finished, type in boinctui to load the Text-Based Interface and ta-da!. You can now manage your boinc-client with ease.

It’s been a while

It’s been a while since I last wrote a blog post. I thought I’ll just give you all a quick update as to what is going on right now.

In September I started college studying Electrical/Electronic Engineering at Level 3. It’s been over a month since then and I’m really enjoying it. Never the less, I still continue on with my projects at home. A few days after enrolment day, I mounted a 100W solar panel on my roof. This connects to a solar charge controller which controls the voltage/current going to the battery. Right now I only have one single leisure battery and require more for my project to be completed. My aim is to completely run this room from solar. I only ever use the light, computer, and my home server which is planned to stay on 24/7. In total the wattage adds up too… 600W(pc) + 250W(home server) + 25W(light) = 875W. Currently, the system powers the room light and my phone charger.

Right now I’m seeking a job in order to complete this project.

This Single Molecule Drives Cancer Cells to Suicide

biologyA team of researchers has identified a single molecule, called TIC10, that kick-starts the body’s tumor-destroying systems—causing a chain reaction that can kill cancer dead.”. “In a series of experiments in mice the researchers, from Pennsylvania State University, found that TIC10 activities the gene for a protein called TRAIL—that’s short for tumour-necrosis-factor-related apoptosis-inducing ligand—which causes cancerous cells to commit suicide.”

Read the full article here.