Ananth's Blog - page 13

Posts

Testing NAT Port Forwarding and reverese NAT

For a long time I have been trying to configure port forwarding using NAT. But every attempt was futile...  Finally I found that my port forwarding works just fine. But it just appears to be not working because my router doesn't support reverse NAT. In this post I will show you guys how to test whether you configure your NAT correctly or not. (Read a detailed write up by shane. Link)

First make a port forwarding rule in your router say 1600. Download this little tool called simple internet tools. Install it and open port listener and select your internal IP(192.168.x.x). Then type your port number and press start listening.

Go to this site and check whether it says port is opened. If your connection is successful you will notice it in the port listener application.

Then go to your browser and type your internet ip address. (You can find it from www.whatismyip.com) . Tnen type your port number after a colon. (116.211.22.12:1600). Your browser shows a webpage not available window. Check your port listener. If you find a connection successful message it means your router supports reverse NAT. Otherwise reverse NAT is not available.

You can also check it by an nc command like this.

nc 116.211.22.12 1600

If you didn't want to test the connection using the above site you can do it by nc from a remote ssh account. Login to your ssh account and try to connect it with nc.

How to see DNS reply? or Testing DNS server?

Wonder how the dns works or want to know the dns reply from server? Sometimes when setting up a local dns server we have to test whether it is working or not. Here is how you can test it in Linux.

dig @127.0.0.1 www.google.com

Ultrasonic Hover Input Device

This was my Bachelor Project. The project was selected for the Malayala Manorama Yuva Master Mind 2014. This is a video describing the project at the final round in the competition.

How to send AT commands?

For details about AT commands refer this link.

If you are using windows you can use hyperterminal to communicate with any modem. In this case the GSM modem. Find a method to connect your GSM modem to the PC  (Refer this Link ). You can use a USB2TTL converter to directly interface your GSM modem to PC. After interfacing the modem go to device manager and find the com port no: assigned to your GSM modem.
After identifying the port number open hyperterminal. You need to download Hyperterminal or copy the files from windows XP. You can also use putty for this purpose. 
Type a name and click OK. Then select the com port you are using and press ok.
Change the boadrate to 9600(you can choose other also. Higher boadrates may not work with some GSM modem) and let other options remain unchanged.

After that type AT and press Enter. If you get a response showing OK. Then everything is fine. As a default typed character are not shown in the terminal. You can enable this by going to File=> Properties=> Settings=>ASCII Setup and check Echo typed characters locally.

You can follow the same procedures in putty also. This is a screenshot of putty.
You can do the same in Linux also. Use minicom or any other terminal softwares for communicating with you GSM modem in Linux. This link describes how to use minicom.
And this link describes how to identify the name of your modem.


AT Commands

AT commands are used for communicating with a modem. AT is the abbreviation of ATtention commands. Every command start with AT. Some of the useful AT commands are listed below. You can call a number, attend a call, hang a call, send sms, read sms, and the list goes on with the features of a particular provider. Some commands are specific to some models. GSM modems can be bought and can be integrated to Micro-controllers or directly to PC. Following list may be helpful to hobbyist or others working on GSM modems for project works.

AT

The response will be OK. This means that the modem is up and ready.

ATD94xxxxxxxx
This command will initiate a voice call to the no 94xxxxxxxx. The semicolon indicates that it is a voice call. If you want to run any USSD codes like *123# for balance enquirey, do the same without semicolon.

ATD*123#

Other Call control commands
Command
Description
ATA
Answer command
ATD
Dial command
ATH
Hang up call

 

Sending an SMS.


First put the modem into text mode. Otherwise output will be in hex format.

AT+CMGF=1


Then

AT+CMGS="+94xxxxxxxx" > This is the text message
Then press Cntrl+z to complete typing message and send it. You will get a response like

+CMGS: 100 OK

 

Reading a message

AT+CMGR=<indexofmessage>

For example

AT+CMGR=1

The response will be the message indexed at 1.

Some other AT commands :
Command
Description
AT+CBC
Battery charge
AT+CSQ
Signal quality

For a whole set of AT commands refer this link..
Link
For a quick overview of some useful commands go to this site.
Link.

For how to communicate (like sending message, calling etc) using a microcontroller and a GSM modem (like SIM300) am gonna write a post soon.