Thursday, September 03, 2009
Automatic detect COM Port List
Get in touch with Serial Programming?
Maybe you are wondering how to detect list of communication port so that the user wouldn’t have to type it manually in the text box anymore.
Step 1:
Drag and drop Combo Box from Toolbox.
If you don't see your Toolbox panel, just press Ctrl+Alt+x, or go find it in View-Toolbox.
Go to the properties, and name it, such as "COMPortsBox".
Step 2:
Add these lines to the top of source code.
Imports System
Imports System.IO.Ports
Imports System.Threading.Thread
Step 3:
When load the main form, add these lines
Private Sub MaxiTester_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
For Each COMString As String In My.Computer.Ports.SerialPortNames ' Load all available COM ports.
COMPortsBox.Items.Add(COMString)
Next
End Sub
Ps: MaxiTester is the name of main form.
Last step:
Try to run it, and smile :)
Reference: here.
Sunday, August 30, 2009
Finding a pair of supported network operators to run CSD in Indonesia
You will probably have to activate you CSD service. You can do this by visiting the customer service of your network operator. But then, to really make sure that your SIM card is working on CSD, the only way is that you should try it out, one by one.
As my experience, I activated two cards (XL and Indosat) but unfortunately, they can't dial the ATD (AT Command for data calls). I tried randomly but it just led me to desperate.
After a quite long time in desperation, I succeed in finding the supported card. I'll share it here (hope this will be useful for you):
1. Option #1: a prepaid number of XL (to dial) and a post paid number of XL
2. Option #2: a postpaid number of Halo Telkomsel (to dial) and a post paid number of XL
Fight-oh!
Sunday, August 09, 2009
ATMega128 has arrived!
I transfered on Friday, and this Sunday (about 11 am) I've already received the evaluation board.
Nice service, prasimax..
Now, lets try the hardware..
Thursday, August 06, 2009
Stupid mistakes, but nice progress. Fight!
SIM300's evaluation board.
Status = solved.
I bought it from Jaya Plaza, Bandung, in a shop named "iwant".
Price: evaluation board = about Rp 800,000
SIM300 = about Rp 450,000
ATMega128's minimum system.
Status = couldn't find it in Anam or JP (Jaya Plaza).
Now I'm using ATMega32 (bought it from Anam, for about Rp 200,000)
FYI, the ATMega32 has a same minimum system with ATMega8535.
Another problem is how to download the program to the microcontroller.
I need STK200 Dongle downloader.
Status = subtituted by STK500 USB Dongle.This is great. The dongle is a USB version of programmer so I could continue using my laptop (which have no parallel port needed for STK200) to code.I bought this DT-HiQ AVR USB ISP from Anam (about Rp 200,000)
But this dongle leads me to another problem. When i try it using CodeVisionAVR 1.24.7e, it always give me an "AVRISP error leaving programming mode".
I wrote an email to the support system of innovative electronics (the one who produced this dongle), and have a suggestion not to use CVAVR version 1.24.7, because it has a bug in programmer STK500/AVRISP.
I browsed and googled, found Prasimax Mikron 123, located in Depok, near Jakarta.
Nice. I found ATMega128 + System Minimum / Development Board (Rp 350,000 + Rp 38,000 for the mailing cost).
I also found a link to download CodeVisionAVR 2.04.3a Evaluation version in Prasimax Mikron. And guess what? It works. There is no "AVRISP error leaving programming mode" error anymore.
Err, actually, while downloading the program, I found another error.
"The FLASH buffer is empty. Do you want to load a file?"
But it was happened just because I haven't compiled my source file before download it to the microcontroller :D Stupid mistake.
=
Well, that's my progress.Now I'm in process of ordering ATMega128 + Development Board from Prasimax.
Hope it will be fine at all.
Amin..
Wednesday, June 10, 2009
AT Command for fun
Computers use AT commands to communicate with modems. Most communications applications, however, have a user interface that hides the AT commands from the user. [1]
AT commands can be issued via a communications application. When the software in the Nokia product has received an AT command, it responds with a message that is displayed on the screen of the used device, which can also be the mobile phone. [1]
Some AT commands are not supported by all Nokia products or by all operators. Giving a command that is not supported by the product causes an error response. Some Nokia products do not necessarily support all command parameters and using the unsupported parameters causes an error response. [1]
Simple AT Command for fun ;)
Let's play a bit using your phone! I'm using my Nokia 6120 classic, connect it with bluetooth, open a Hyperterminal. Try to type the green command on your hyperterminal.
1. To call/dial, for example phone number 085612345678
ATD085612345678;
Note: Actually, the reference said to dial ATD085612345678 (without using the semicolon ; ) but somehow my cellphone always give me a "NO CARRIER" response.
So I tried to google, and.. Tadaaa…
Just add a simple semicolon (;) and it's working. I guess the previous one tried to dial using data mode, because when it dialed the number, I saw a "phone-with-letter-D" icon on the upper right corner.
2. To send sms to phone number 085612345678
AT+CMGF=1
OK
AT+CSCS=”GSM”
OK
AT+CMGS=”085612345678”
> Hello world
// end the message by press Ctrl+Z, and then "Enter"
The AT commands above are successfully tested.
Just try it..
This is a basic knowledge for making sms gateway. And, believe me, there are so much more to try! Now you can imagine.. There's a lot of applications that you can make using the AT Commands.
Happy coding!
References:
[1] FORUM NOKIA; AT Command Set For Nokia GSM And WCDMA Products, Version 1.2; July 1, 2005
[2] Charley Yang; SIM300 Software Application Note V2.0
Monday, October 20, 2008
First Step to Socket Programming
Maybe some of us often hear the word but dont know what is the meaning of protocol, including me.
So here we start, figure out what is the meaning of protocol..
Protocol is important when we write programs that communicate across a computer network. Protocol is the agreement on how those programs will communicate.
If we started from the high level decision, we should decide, which program is expected to initiate communication (usually, the client side) and when the responses is expected. On the other side, the server side, usually acts as a daemon that sends network messages only in response to request coming from in from the network.
FYI, daemon is a term used for a long running program.
So what is socket?
Sockets are interfaces that can "plug into" each other over a network. Once so "plugged in", the programs so connected communicate.
For getting started your journey with socket programming, I suggest you to try and analyze a socket server programs provided by the MSDN (Microsoft's Developer Network). FYI, now I'm using an October 2004 version of MSDN, and for the IDE (Integrated Development Environment), I'm using Visual Studio 2005. I'll write step by step on trying the socket, based on my experience.
reference:
UNIX® Network Programming Volume 1, Third Edition: The Sockets Networking API, Addison Wesley
http://www.troubleshooters.com/codecorn/sockets/
my team mate
i've also sent a message to him, but he never reply.
its ok if he want to go out of the team. But please, be a gentleman, notify me, reply my sms, my call, or just answer the phone (please)!
Maybe i would be mad, but at least each of us could step forward and continue our business..
-.- now i'm alone, doing our documentation and trying to make a big progress for our project. its kind of hard task, but i know i can, and i dont want to be failed.
Hope everything is going to be ok. Amin :)
Friday, October 17, 2008
One week before the deadline
I've already succeeded in compiling the program and building the project (although its a sample program from the msdn), but i dunno how to test it..
What should i do?
Browsing, browsing.. (hope i'll get some explanations about it)
getting started to winsock
This article is taken from here (copy paste -sorry-, but of course with some modifications to simplify the article as I use it for learning)
What is winsock?
1. WinSock is an abbreviation of Windows Socket
2. Its spec defines a network progrmg interface for Ms Windows, based on the "socket" paradigm popularized in BSD Unix.
Winsock 1 apps can ask Winsock to send notifications in window messages. This allows your program to handle both the network, UI issues, and background processing without having to worry about concurrency.
What is the difference between Winsock 1 and Winsock 2?
Winsock 2 adds many features. One of the most important new features is official support for multiple transport protocols. Although Winsock 1.1 was not actually limited to TCP/IP, that was the only protocol that had official support written into the spec. Winsock 2 also adds support for technical initiatives like quality of service (QoS) and multicasting.
How about Winsock 2.x?
Basically it defines two interfaces: API and SPI. Through proper use of the API, a Winsock app can work over various network transport protocols and Winsock implementations.
API
(Application Programming Interface):
shields application developers from underlying layers.
SPI
(Service Provider Interface):
allows transparent extensions to a Winsock stack.