How to make your dumb doorbell smarter for under €10!

These Ritto doorbells are fairly popular is most households in Germany especially in high-storey apartment buildings. There are two sources of signals that trigger the ringer inside your apartment:
1) Doorbell outside of the main building that interacts with main “intercom” that decypts the signals and channels the signal to the ringer inside your apartment

2) Doorbell in front of your apartment door that sends a simple electric pulse to the ringer

Anyway, the process is fairly simple. I looked at the initial board of the my doorbell and I figured out there is just a single button that, if I could control in a smart way, would allow me to use my phone to operate the main door of the building.

Figuring out the power-supply

I found out that the intercom sends 30V to the ringer. In order to avoid using any external power source, I thought it would be a great idea to tab on the 30V power source already coming from the intercom.
Benefits:

  1. I don’t consume another power socket from outside the ringer
  2. I don’t operate on batteries which avoids maintenance

The solution

I used a Sonoff SV as the core component that turns my doorbell smart. It is fairly cheap ($4.85 with long shipping duration), or you could pay a bit more and have a faster delivery from a local supplier in Germany.

There are several tweaks to be done to make the Sonoff SV applicable for our uses.

  1. Turn the Sonoff SV into a relay. From the circuit board below, you would first remove the two resistors marked and since I want my Output to be a short (that is, simulate that I pressed the “open door” button), I short the input using a piece of wire.
  2. Wires from the pins of the Sonoff SV output are soldered to the Ringer’s button’s pins
  3. Now, since the Sonoff SV requires 24V max of input and my doorbell’s supply is constantly 30V, I did the math of voltage division is it turns out that 100 Ohms are enough to drop the voltage from 30V to 24 V approximately, considering the resistance of the Sonoff SV board itself as a circuit.
  4. That’s it. With the Sonoff SV turning on, and simulating and on/off by a tap on the button in the eWelink app on my smartphone, I was able to simulate pressing the “open door” button.
Posted in High Performance Computing

Product Reviews

Use a mouse on any surface!

Posted in Reviews

mount: unknown filesystem type ‘exfat’ – Fedora 24

Hello folks,

Having issues mounting your flash drive on Fedora 24? Here are quick steps to make things work:

Install the free and non-free RPMFusion repository. The fuse-exfat package is not available in Fedora at install due to patent issues. Thanks Microsoft! As a result, you need to get it from a third-party repository:

sudo rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm 

sudo rpm -Uvh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

Then install fuse-exfat:

sudo dnf -y install fuse-exfat

Done. Please let me know if it worked, or if you encountered issues!

Greetings,

Shailen

Posted in High Performance Computing

How to send emails from a python script using Gmail’s SMTP servers

Hello people,

I decided to write down all the steps involved since this topic seems to be quite popular and many people have issues about that, especially when using GMail.

First, the software requirements:

  • Python 2.7 + (which comes with smtplib)

For smtplib to work, you need to have SSL and all its accompanying packages installed. I use Fedora. Therefore, go ahead and install openssl-devel:

sudo yum install -y openssl-devel

If you are going to use a python script to send an email, you will need to tweak your Gmail (Google) security settings because my default Google blocks any unsecure 3rd-party applications accessing your account. This is great for security but not good for our python script.

Head to your Google settings (not Gmail settings; you can access google.com by staying signed-in. You should see your email address in the top right corner). Click on My Account and then Sign-in & Security. In the left pane, choose Connected apps & sites. Scroll to the bottom of the page and turn ON Allow less secure apps. Make sure that the settings remain ON by clicking on another menu and coming back to this setting. When I tried it for the first time, the setting seemed to reset itself.

When this is done, the following script should work out of the box:

import smtplib

gmail_user = 'your_email@gmail.com'
gmail_pwd = 'your_password'
FROM = gmail_user # sendmail needs the from
TO = 'recipient@gmail.com'
message = 'TEST msg'

# SMTP_SSL Example
server_ssl = smtplib.SMTP_SSL("smtp.gmail.com", 465)
server_ssl.ehlo() # optional, called by login()
server_ssl.login(gmail_user, gmail_pwd)
server_ssl.sendmail(FROM, TO, message)
server_ssl.close()
print 'successfully sent the mail'

Voilà! If that was helpful, please let me know. Feel free to shoot your question in case you had issues. I will update this document based on your feedback.

Posted in High Performance Computing

How to install Texlive via a proxy server.

Hey everybody,

Yep, these proxy issues are frustrating but the solution is dead simple. Strangely, this is not documented anywhere on the texlive webpage.

1. Download install-tl.zip (standalone) fromt he Texlive download page.

2. Extract and locate the install-tl-advanced.bat file.

3. Add your proxy settings in the bat file.

@echo off
echo Add proxys:
set http_proxy=http://proxy-site.domain.com
set https_proxy=http://proxy-site.domain.com
rem $Id: install-tl-advanced.bat 33536 2014-04-19 09:41:24Z siepo $
rem Public domain.
rem Originally written 2009 by Norbert Preining.
rem
rem Start installer in advanced (perltk) mode. This is here so that
rem it can easily launched from the normal Windows GUI, not just the
rem command line.

call “%~dp0install-tl-windows.bat” -gui perltk %*

4. Open an elevated command prompt (i.e as Administrator) and execute the batch script.

5. Boom and you are welcome 🙂

Posted in High Performance Computing

Fixing the driver issues with Intel Galileo Gen 2

Hi everybody,

Getting started with driver problems can be annoying. Therefore, I have written a small step-by-step article to help you solve these finicky problems. Good luck! 🙂

  1. Install Arduino IDE 1.6.5+
  2. Install the Latest Java development kit 32-bit
  3. Connect the Galileo Gen 2 board to your computer and head to Device Manager.

 4. Fix the driver issues by installing the latest USB drivers:

CDC Serial:

Head to: https://software.intel.com/en-us/articles/intel-galileo-board-assembly#firmwareupdater

If link does not work, navigate from https://software.intel.com/en-us/iot/library/galileo-getting-started

Choose OS and Arduino as IDE and then proceed with downloading the drivers.

Once the zip file is downloaded, extract it. In Device Manager, right-click on CDC Serial and click ‘Update Driver Software…’. Then ‘Browse my computer for driver software’ and navigate to the folder you extracted earlier. Make sure you check ‘Include subfolders.’

 

After that, the driver should be installed successfully;

 

Note the COM port of the Intel IoT Dev Kit Serial device -> mine is COM4

 

 

Gadget serial 2.4

For some reason, after having installed the CDC Serial drivers, I saw the Gadget Serial v2.4 device in Device Manager. I expected the previous drivers to install everything. But anyway, I had to find other drivers in a different place, but still on the Intel website.

Head to: https://downloadcenter.intel.com/product/83137/Intel-Galileo-Gen-2-Board

Sort results by date

Download and install the latest drivers.

In my case currently, the latest version is 1.0.4

 

Perform the same driver installation procedure as explained earlier.

 5. Update Firmware (Firmware to download from above link)

6. Done!.

Posted in General, Operating Systems, Windows

Android Studio and Java (JDK/JVM) installation issues

Hello everybody,

The JAVA_HOME issue seems to be a problem that has affected many. Therefore, I decided to take the time to lay down everything you need to do to fix your problems completely.

Problem:

“Error launching Android Studio: The environment variable JAVA_HOME (…) does not point to a valid JVM installation.”

image

If you intend to develop Android apps, you will need the Java Development Kit (JDK). Do not confuse with the Java Runtime Environment (JRE). If you download and install the JDK, you get the JRE as well.

To download the Java Development Kit, head to http://www.oracle.com/technetwork/java/javase/downloads/index.html and make sure you click download for the JDK.

To check if you already have the JDK installed, do the following:

  • In a command prompt (Windows Key + R, then type cmd), type:

javac –version

If the command prompt complains that javac is not found, it is possible that the bin folder, where all the java binaries are located, is not in your system path ($PATH). What you can do is check the following folders:

64-bit: C:\Program Files\Java

32-bit: C:\Program Files (x86)\Java

and see if you have any jdk1.x.x_xx folders.

I recommend that you install the 64-bit JDK on a 64-bit machine.

Alright, once you have the latest JDK installed, we need to set the JAVA_HOME variable. On Windows 8, press the windows key and search for “View advanced system settings”. Alternately, you may right click on My Computer(or ‘This PC’ in explorer)>Properties>Advanced system settings.

Navigate your way to the Environment variables: Advanced Tab>Environment Variables

image

In the User variables section, check if you have a JAVA_HOME variable already set. If not, create one and set the path to the root of your JDK. For instance, if you installed the 64-bit JDK 8 Update 45 version, the root folder will be:

C:\Program Files\Java\jdk1.8.0_45

Set the JAVA_HOME to the root folder as per your installation.

Click OK, leave all configuration screens and open Android Studio.

You are welcome Smile

Tagged with: , ,
Posted in High Performance Computing

Three flashships fight head to head – Sony Z3 vs Moto X (2014) vs LG G3

Hello folks,

A colleague today just said that December is the Friday of the year. The festive period (Christmas) is coming soon and many are excited to upgrade their smartphones by Christmas. Thus, I have leased three top flagship phones in view to compare them. Yes, that is a first world problem and I am always trying to find the best smartphone every. Somehow, I found it hard to get all the perfect and desirable features in one device. Hopefully in the coming years, Project Ara (or similar projects) will attempt to solve this problem.

As we speak right now, some flagship specifications would be:

  1. 5.x inch display

I have big hands and I consume a lot of content on my phone. Therefore, any screen smaller than 5 inches would be too small for me. On the other hand, while I could do with a 6-inch phone like the Nexus 6, I would have an issue carrying my phone around as my jean pockets are not designed for such devices.

  1. 3500+ mAh battery which hopefully translates to more than 6 hours of screen-on time.

The bigger the better. Naturally, this can lead to a heavier device. A heavy device is undesirable as the latter becomes cumbersome while doing sports activities (such as running). As a result, using fitness tracking software such as Runtastic becomes difficult. I could invest in additional fitness bracelets amongst others, but the market is still nascent at the moment and I do not want to maintain too many devices.

  1. Qualcomm Snapdragon 805 processor + Adreno 440

At we speak right now, Qualcomm has a leading edge on mobile processors, although there is increasing competition at the moment. Samsung is pushing its ARM-based Exynos processors, LG plans to publicly release its own in-house ARM-based BIG.little Nuclun (previously known as Odin) processor in 2015 and nVidia has its own System on Chip (SoC) which integrates an ARM-based CPU and their own in-house built CPU. Apple has its own ARM-based Cortex mobile processors. Somewhere in this big crowd, Intel offers some powerful solutions based on the x86 microarchitecture. The year 2015 will be very interesting as Intel (as publicly announced) plans to push forward a high-performance, battery-friendly SoC based on the 14nm Cherry Trail platform.

In the end, it will be a war between ARM vs x86. Healthy competition is crucial for the sake of technological progress. I am eagerly looking forward to 2015.

  1. micro-SD card slot

Not everybody has access to high-speed mobile internet. LTE coverage is still very limited, even in developed countries. Lastly, a sizable proportion of people (I do not have a source/quote for this, but this is my general impression, especially following the NSA scandal) do not trust online storage service. In this limelight, some people would prefer storing their pictures and other files locally on their phone. The storage size to price ratio is increasing and therefore, micro-SD cards are very desirable.

  1. A 12 MP + camera that can record in at least 2K and support optical image stabilization (OIS).

Mobile cameras are a pocket-camera market killer. Life is beautiful. I would not want to miss taking pictures of beautiful sceneries or of silly friends.

A flagship phone this year will naturally support LTE (at least cat.4)

Now, coming to the head-to-head clash among the three top phones of Q4 2014:

My (subjective) experiences with the Sony Xperia Z3:

The Good:

  • The Sony Xperia UI is nicer more productive than stock Android. I am able to search for apps in the drawer and organise my apps in folders in the app drawer itself. When I switched to the Moto X, I immediately found it very annoying to scroll many pages to find my apps.

The Bad:

  • The bezels are too big. This unnecessarily makes the phone very long. Sony could have done a better job to trim these bezels. Sharp Aquos rings any bells?
  • The glass back can easily be scratched. I searched but I could not find whether the glass was Gorilla Glass 3. In any case, what I know is that the glass is covered with a shatter-proof layer of plastic. The glass itself is scratch resistant (thus probably a Gorilla glass). As a result, the (permanent) scratches on my phone were on the shatter-resistant layer hence having a scratch-resistant gorilla glass is a little bit an overstatement to me.
  • I prefer the direction that Intel is going – no wires! Thus wireless charging is important for me. The Z3 lacks wireless charging. With these water-proof flaps, wireless charging would have been a great addition.

The Ugly:

  • There is a serious lack of reasonably priced casing for the Sony Z3. If you manage to land yourself an expensive leather case, you will not be able to use the Magnetic Charger holder (also known as a charging dock, although I think the term dock here is an overstatement; you can only charge your phone with that holder.) properly. Yes, the phone is splash-resistant. I saw splash because I have heard somebody who plunged the phone in a 1m deep pool and the phone got damaged. However, popping up the charging flap every time one has to charge the phone is very annoying.

Although the back camera is okay, the front camera is very pixelized.

Moto X (2014)

The Good:

  • Small bezzels
  • Great AMOLED screen

This is a matter of preference. I found the AMOLED display in the Moto X more vivid (in terms of colors) than the IPS (LED) display on the Sony Z3.

  • great built-in software from Motorola

The Bad:

  • Lack of wireless charging

The Ugly:

  • Short battery life

Every day, I travel approximately 40 minutes each way to work. I use that time to read the news on my phone. At the same time, I stream Spotify music to my bluetooth headset. I always have Wifi, data and bluetooth because I do not want a hassle of toggling them all everyday. At work, I use my phone once a while. Thus, I approximate 3 hours of screen-on time. Such a lifestyle gives me 12 hours. If I start my day at 8:00am, by 20:00 in the evening, I am out of juice. Thus, if I am planning an evening out, I make sure to charge my phone during the day. I would have preferred a battery that fits my lifestyle. The battery in the Sony Z3 lives up to my lifestyle.

LG G3

The Good:

  • Wireless charging
  • Very nice, bright display
  • knock-on/off feature

This feature is great although I found that the knock-off feature only worked when I knocked twice on a empty space on the home screen. Thus, I always have to keep some empty space on my home screen and I have to target that empty area all the time for the feature to work.

The Bad:

  • LG UI is not enticing enough.
  • The buttons at the back are not programmable.

The Ugly:

  • Display drains the battery very fast

As a very last point, I found the sim card holders that the Sony Z3 and the Moto X use to be quite silly. Both phones require nano-SIM-sized (FF3) cards but they provide a micro-SIM-sized holder that you use to insert the nano-SIM. I guess it would have been simpler to just allow the insertion of micro-SIMs right away without the need for SIM holders. I have had to go out of the way to get my micro-SIM cut to the nano size. And my bad luck, I lost the nano-SIM holder for the Sony Z3.

I reckon you would not swap SIM cards on a frequent basis, but I found micro-to-nano-SIM tray unnecessary.

Final Words
I picked the Sony Z3 over the Moto X(2014) and the LG G3. The Sony Z3 had a better battery and is future proof in terms of specs (I am sure that the Qualcomm 801 processor and 3GB of RAM should allow me to install any apps for the next 2 years). I do not have a Playstation and therefore the bundled Playstation remote app that comes bundled with the Sony is useless for me. However, if you own a playstation and you are hesitating which phone to buy, the race suddenly becomes easier.

I hope this article helped. Have fun with your next purchase.

Posted in High Performance Computing

Disable Ads on Skype 6.x

You just updated to Skype for Desktop to enjoy the new shiny user interface and you want to get rid of the eye-breaking ads? Below is a working solution for Windows only. I am not sure whether that will work for newer updates. In any case, please let me know in the comments section whether my workaround worked and let me know which version of Skype you have.

Who would have thought that this big cashcow of Microsoft would bundle ads in one of their top products competing against Hangouts? The Hangouts plugin for Chrome is neat and sports a Material-design-ish user interface. The new Skype is not that bad either. I am still faithful to Skype since all my close family still uses that. To teach my parents a new technology would be too painful. I am not sure how much monetary benefit Microsoft makes with these ugly ads bundled in Skype. If I were at the head of the Skype division at MSFT, I would certainly make sure that I provide the best user experience to the public first. Quality first – can that be Microsoft’s moto, pretty please? Guess Metro on Windows 8.1 would be an answer to that. (Did you say ‘no’ too? Comment that below 😉

Anyway, without digressing any further, there are the steps:

Working environment:
Windows 8.1, Skype 6.22.59.107

  1. Modify some Skype settings.
  2. Go to Tools > Options > Privacy and uncheck the last three checkboxes as in the screenshot below.
    skype_settings

  3. Edit your config.xml file.
  4. Navigate to your user-folder’s App Data. The path can be something like:
    C:\Users\<your_username>\AppData\Roaming\Skype\<skype_username>

    Locate the AdvertPlaceholder xml tag and set it to -1.

    Example:
    <AdvertPlaceholder>-1</AdvertPlaceholder>

    Save and close.

    3) Modify some Internet Explorer security settings

    Navigate to Internet Explorer Options > Security tab > Restricted sites > Sites:

    Add https://apps.skype.com to the list, close and Apply.

    4) Lastly, edit your hosts file.

    You can edit the hosts file using an app open with administrator privileges. Otherwise, I find it simple enough (old habits maybe) to just copy the file on my desktop, make the changes and copy back the modified file and allow Windows to overwrite the previous file.

    Locate your hosts file. It will normally be located here (unless you have a custom windows installation):
    C:\Windows\System32\drivers\etc

    Copy the hosts file to the desktop and add the following to the end of the file:

    127.0.0.1 rad.msn.com
    127.0.0.1 live.rads.msn.com
    127.0.0.1 ads1.msn.com
    127.0.0.1 static.2mdn.net
    127.0.0.1 g.msn.com
    127.0.0.1 a.ads2.msads.net
    127.0.0.1 b.ads2.msads.net
    127.0.0.1 ac3.msn.com
    127.0.0.1 apps.skype.com
    

    Save the file and overwrite the previous file in the above-mentioned folder with the modified hosts file.

    If the above steps helped solve the ads problem in Skype, please let me know!

    Cheers,

    Shailen.

Tagged with: , ,
Posted in General

How to embark on the HPC bandwagon?

Ladies and gentlemen,

Note: Until the end of this blog article, I talk about my history why I came where I am now. You may fast-forward to the next articles.

Times have changed. I still remember the time when I was kid and I was starting with computers. My father bought the first family computer to do his basic office work (mainly using Word.) It was an Acer desktop PC running Windows 95. It had 2.1 GB of hard disk space and 32 MB of RAM. At the time of purchase, this desktop PC was supposedly the top-in the line machine.

Back in the days, nobody really knew how to use the computer. My father knew only the basics of the basics (turn the computer on, and open a program.). Next in the line, came my elder brother who, at the time, at best knew how to install a PC game.

Internet was scarce commodity since we were using dial-up. Dial-up networks were ridiculously slow and we paid per minute.

Then there was me. I was not allowed to use to computer at all, since I was known to break stuff. However, a couple of months later, I was allowed to have access since we were learning how to use Microsoft Paint at school. And they were right; I did end up breaking the computer – at least the software. I somehow crashed Windows entirely and it would boot anymore. Needless to say, my father was extremely furious as he had to pay the technician to fix it.

Speeding up a bit and skipping some part, a few months later, I had started programming. It was the most basic of things. I was automating some tasks with batch. Batch was fun. It was sequential, logical and loved the jumps, done with the goto: statement. I was still small when I started with Visual Basic, all on my own. I did some stupid programs and they were fun.

A bit a year after the purchase of that desktop machine, the latter was upgraded to Windows 98 and to 64MB of RAM. I was already more knowledgeable in computer stuffs than anybody else in the family.

It appears that a significantly large amount computer professionals these days happen to learn their first programming language on their own. All of them started with proper languages (like C, C++, python) or scripting languages or markup languages (like HTML).[sources: sampling my immediately network].

Well, my generation of people were born in the age of uni-processors which makes sense why we start with such languages. We then get acquainted to MPI and OpenMP at the university.

Times have changed now, and as multi-core processors are becoming the de facto standard these days. Even low-powered devices like mobile phones are multicore. As the trend speaks for itself, it will be time to start teaching MPI and co. right in high school itself (or even before).

While I started with serial programs, I guess in a few years to come, kids will start right away with algorithms. The basic books about programming will already guide them to think into parallel ways of solving problems. Serial algorithms will be a thing of the past and will not even be teached at all (maybe in history classes.). Just kidding.

Anyway, if you were like me and were raised in the uni-processor world and you want to embark on the HPC bandwagon, it is paramount to understand some core computer architecture concepts before you are able to grasp why things are done the way they are.

You will need to understand what is going on when a processor is multicore. You will need to know what is a NUMA architecture. (I assume you know clearly the von Neumann architecture. What, no? Don’t panic :)) I will introduce it, and briefly tell you about the Flynn’s taxonomy. Knowing these fundamental architectures, you will have the basic foundation to embrace the parallel world.

More coming soon..

Posted in High Performance Computing