Sunday, October 14, 2018

Remote Controlling LED Using NodeMCU (ESP8266) Board

Been tinkering around with the NodeMCU (ESP8266) more after I published the original tutorial about Getting Started To Use NodeMCU (ESP8266) With Arduino IDE. Before reading this further, I would recommend you go through it to make sure the board is already setup on your PC with the Arduino IDE (if not already).

I came to notice its quite easy to jump into the interesting world of IoT with this particular board. Since the board has on-board WiFi chip from Espressif, you can control just about anything you want remotely.

I have shared below a simplest possible example of how you can control state of an LED connected to the NodeMCU board remotely (from your phone). Let's start by putting connecting the LED as shown below:

Connect the board to the PC using a/the Micro-USB cable. Go to Tools, Board, select NodeMCU 0.9 (ESP-12 Module). Go to Tools, Port & select COMX port on which the board is connected to PC.

Replace below example code into your Sketch in Arduino IDE. Let me describe what the above code actually does. At startup, it tries to and waits for a successful connection with the SSID & password you have specified. Once connected, it then starts and listens for incoming connections over port 80 (HTTP default). This is what it does in the setup stage.

Now in the main loop, it waits for an incoming HTTP client connection which if found, the checks if the request method is GET and URL contains a specific command like /state/OFF or /state/ON and then reacts accordingly i.e., put the specified pin LOW or HIGH which in turn, sets the LED off or on respectively. In either case, it also responds with a HTML page that shows current state of LED and a link to change the state.

To access the HTML page, you need to be connected to the same WiFi network as the NodeMCU (ESP8266) board and browse the board's local IP address in your favorite browser. To know the IP address easily, the above code writes some useful messages over the serial port it is connected to which you can see by open the Serial Monitor from Tools, Serial Monitor from the Arduino IDE.

Sunday, September 30, 2018

Getting Started To Use NodeMCU (ESP8266) With Arduino IDE

I have recently started getting my hands a bit dirty with the electronics. To start with, I bought a Arduino UNO, Arduino Nano, CubieBoard 3 (CubieTruck), Raspberry Pi Zero W & a couple NodeMCUs. I am still into in-depth learning how these electronics work. When trying to use one of my NodeMCU with the Arduino IDE (they said it was compatible so it's convenient), I found its not very straight forward to get it working in first attempt.

In this blog post, I will try to write the exact steps that were need to get it working along with a minimal example to test. This tutorial assumes you got a Windows (10) PC. Linux/Mac users should be able to adapt most of this write-up to their systems accordingly. Let's start!

First you need to get yourself a ESP8266/NodeMCU board. You can buy one from Amazon (India/International) or any other website/place you like. Along with the board, make sure to get yourself a Micro-USB cable to connect the board with PC. When it comes to cable, I just prefer those from AmazonBasics. Always the top-notch quality and choice of black/white color (am I doing promotions here? :D Nope, I just love it so much). Also buy a breadboard and a simple LED required for the example program to run.

Once it arrives, download and install the Arduino IDE on your PC from here. Before you connect your board to PC, you will also need to download and install USB to UART drivers from here to get the serial/COM port working.

Launch Arduino IDE. Go to File, Preferences, Settings (Tab). Put below URL in additional board manager URLs:

Click OK. Go to Tools, Board, Board Manager. In the filter box at the top, type ESP8266 and install the esp8266 package by ESP8266 Community.

Not put your NodeMCU in the center of any breadboard end and connect the LED to GND and D8 (GPIO 15) as shown below:

Connect the board to the PC using a/the Micro-USB cable. Go to Tools, Board, select NodeMCU 0.9 (ESP-12 Module). Go to Tools, Port & select COMX port on which the board is connected to PC.

Replace below example code into your Sketch in Arduino IDE.

Hit the Upload button to compile + push your program to the board and run it! You should see the LED blinking or maybe not if anything messed up. Ask me in comments if you encounter issues!

Sunday, May 15, 2016

***SPAM*** Invoice #34069680 [Malware]

Iam always more interested in SPAM emails rather than my Inbox. Today, I stumbled upon an email in my Spam box with subject Invoice #34069680. It had a spam-my named attachment along with it saying they have sent some of my shipment lol! and this is the invoice to the same.

I then de-activated my Anti-Virus software, downloaded the zip archive, extracted & it had a lonely file in it named invoice_copy_Bqa6Ci.js. It was in fact, no invoice document but a JavaScript file with following contents.

It seemed like it was obfuscated, so I went in to dig the thing deeper and de-obsfuscate it line-to-line by hand. The result I got is as below:

This clearly shows what it does. It downloads a file from either or (most probably the second URL is there as a fallback in case the first one fails), and saves it as 4194304.exe in your %TEMP% folder, and finally executes it upon successful download. Thenafter, you cannot tell how much the unknown executable saved in your %TEMP% folder will be able to exploit your system.

So beware! If you receive any email similar or exactly as this one, make sure don't download anything there in it.

Just Found This! 3-years Old, Resting In Peace :D

Been recursing in multi-level folders in my eHDD, cleaning up not needed anymore stuff, moving things from here 'n there today morning. Fortunately, just found something I thought I can show-off here :D. I used to convert cars from various games to Grand Theft Auto Vice City and Need For Speed Hot Pursuit 2 in my childhood. I only had these 2 games running at playable FPS with lowest graphics settings on my 128MB RAM desktop, out of which 32 MB was shared with the onboard GPU. Lol! When I built my new gaming desktop in 2013, back then I again wanted to make one more card for Grand Theft Auto. Just for the love with the game.

The model was actually Ryo Watanabe's (Showdown King) from Need For Speed ProStreet, converted to Need For Speed Hot Pursuit 2 by MKIII-Twin-Turbo of I took the model, create new vinyl texture with Adobe Photoshop, re-textured the chassis, create damage models & finally ported to both games.

Flickr Gallery

However, I could not find the exported vehicle for neither Grand Theft Auto 3 or Grand Theft Auto Vice City, but you can atleast enjoy the screenshots below of the final work.


Friday, November 13, 2015

New APK Studio Version (d49d3de), Native Installers For Windows & Linux


I have been trying real hard to keep the APK Studio project active. Solving issues, adding missing features as soon I notice.

I am excited to announce new beta release, i.e., d49d3de available for download.

With this release, now you get a couple Toolbars, one at bottom & one at left. These toolbars have icons which allow you toggle visible/invisible views (Project, Console etc.). Also as an enhancement to build process, APK Studio's versioning now uses Git tags.

In result to which APK Studio now looks more like a professional IDE (which it may become someday).

One more of the few good things that have happened in the while is I have been able to get a free license for InstallBuilder donated by BitRock. Tried & tested, it is way too powerful program for creating native, cross platform installers for any kind of application and barely adds anything noticeable to final package size. Thanks to the software, I am able to produce all-in-one installers for APK Studio to be run on Linux x86/x86_64 & Windows.

These installers automatically install APK Studio along with vendor binaries, add Desktop/Start Menu shortcuts, create Uninstaller & more.

You can download the Linux (x86 & x86_64) installer from this and this link, Windows installer from this link. Source code for this release is available here.