Reading and Uploading the Sequence

The sequence in the tag is read using the RFID reader. The reader is interfaced with a PC through the serial port. The sequence read from the tag is uploaded using the POST method(about which I’ve already posted, click here).

The first step is to open a port with baudrate 9600 bps, no parity and one stop bit.

  • def port_open():
  • ser = serial.Serial(0)
  • s = ser.read(12)
  • return s
  • seq = port_open()
The next step is to encode the sequence in the url. It is done using POST method. The sequence is encoded with the url as parameters of the url. Also a connection with the server is established using ‘httplib.HTTPConnection()’.
  • from urllib import urlencode
  • params = urlencode({‘sequence’:sequence,’place’:’kannur’,’time’:’12.00′})
  • headers = {“Content-Type”:”application/x-www-form-urlencoded”,”Accept”:”text/plain”}
  • conn = httplib.HTTPConnection(“127.0.0.1:8080”)
  • conn.request(“POST”,”/”,params,headers)
Advertisements

About Odol Shinu

I've completed my B Tech in Information Technology in 2010 from Government Engineering College Sreekrishnapuram Palakkad under Calicut University.

Posted on September 12, 2010, in Appengine/RFID Reader Project. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: