Browsed by
Month: April 2014

Make HTTP requests from SIM300 GSM module

Make HTTP requests from SIM300 GSM module

SIM300 is a GSM module by Simcom.

And believe me it’s no less than a piece of shit. I was unlucky enough to have my hands on it. I spent 3-4 days figuring out and testing the correct sequence of AT commands that must be used to make HTTP request via this module. In the following post I’m going to explain how to use it with the Arduino to send and receive data to a web server over HTTP.

Let’s start with the code :

Fist we need to create an object of the SoftwareSerial class. Let’s call it GPRS. The object must be created at the start of the program. The code for this is :

The SoftwareSerial library ships as a default library with the Arduino IDE. Here, 2 and 3 are the pin numbers on the Arduino board where we need to connect our GSM module. Here pin 2 is being used as the Rx pin and pin 3 is being used as the Tx pin. Rx of Arduino should be connected with the Tx of the module and Tx of Arduino with the Rx of the GSM module. The line GPRS.begin(9600) initialises the serial communication with the module with setting a baud rate of 9600. This is the default baud rate for SIM300. The line Serial.begin(9600) initialises the Arduino’s default hardware Serial communication. The Rx and Tx of this default Serial are at pins 0 and 1 of the Arduino. The output that you see in the Serial monitor is also via this default hardware Serial communication.

Upto this point we have done our initialisation part.

Let’s setup our HTTP request with the following code. I’ve provided comments at each line to tell what it does.

Upto this point we’ve initialized our connection to the web server. The following code makes the actual HTTP request.

In the above post you’ll have to change the domain name and put the domain name of your server. Update the line yourphpfile.php?key=value as per your needs. You can add extra parameters if you want.

You can browse the whole code on my Github :

And at last I would say if you’ve a choice then better go for SIM900 GSM Module. SIM900 is way better and more reliable than SIM300.

My work at Cube26

My work at Cube26

Cube26 has it’s innovations in the areas of Image Processing, Machine Vision, Machine Learning. They basically focus on gesture and image based controlling of the device. At this time Cube26 has partnerships with 6 Indian phone manufacturers including Micromax, Intex and Spice.

I’m in the Android development team of Cube26. At the time of writing this blog I’m working on the release of Micromax A290. We currently don’t have access to the whole source but some parts of the OS.

Below is the list of the features that I implemented/partly implemented in the Canvas A290 release :

  1. Low light reading flux mode : On the first day at Cube26 I started working on this flux mode. For the beta release I implemented it with the Launcher. Later I implemented it in the SystemUI.
  2. Stamina Mode : Ah. There was a lot of code involved in the Stamina mode. It’s task was to kill all the background apps, remove all apps from the recents, disable GPS, WiFi, Bluetooth. At 14% mode it will be automatically enabled. And at the 4% mode the it’ll automatically kill the RF of the phone by enabling Airplane mode.
  3. Vault : Vault itself was the part of a feature called Eyeris. In Eyeris, your phone will scan your retina and if it matches to the owner’s retina it will automatically unlock the phone and decrypt it. I implemented the functionality of Eyeris in Gallery to hide the images and in the messaging app to hide the messages.
  4. Camera : For some of the later days I kept working on implementing some features in the Camera app. The features included say cheese to capture a selfie, Anti Shake mode, Front and Back mode. Implementing all of them took a little long time.
  5. Look away to pause : To tell you the truth I didn’t wrote it’s Image Processing related code. The whole Image Processing code was written by some other genius soul. I just implemented it in the Gallery app (It’s one of the best features). The implementation is that if while watching a video if you look away to somewhere else the video will automatically pause.
  6. Auto Collage Maker : The core code of this feature was also written by someone else. I just improved upon it and enhanced it and merged it with the Gallery app.

Other projects:

  1. App for LAVA tablets to search internet for education related content given the topic as a query.
  2. Launcher to search your whole phone providing suggestions in realtime. Search was based on Lucene.