473,507 Members | 2,776 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

communicating with Nokia 6610

shahjapan
63 New Member
Hello,

I am trying to connect my Nokia 6610 using usb cable,
I have installed usb-serial driver of it.


I hv tested it with Hyperterminal and it works fine.

but when I wrote a python script I am not able to receive the responce from the device.

Expand|Select|Wrap|Line Numbers
  1. import os
  2. import re
  3. import time
  4. import sys
  5. from threading import Thread
  6. import serial
  7.  
  8. class connect_serial(Thread):
  9.    def __init__(self,socks):
  10.       Thread.__init__(self)
  11.       self.sock = socks
  12.       self.count = 0
  13.  
  14.    def run(self):
  15.       self.count = 0
  16.       try:
  17.           while 1:                        
  18.              self.count +=1
  19.              if (self.count>=5):
  20.                 break
  21.  
  22.            lines = self.sock.read(100)
  23.            if lines:
  24.               print lines
  25.               print 'read success-----------------------------------------------'
  26.            else:
  27.               print 'nothing to read',str(self.getName())
  28.       except Exception,e:          
  29.           print self.getName()                  
  30.  
  31. print time.ctime()
  32. print
  33. try:
  34.     conn1 = serial.Serial(4)
  35.     conn1.baudrate = 19200
  36.     conn1.parity = serial.PARITY_EVEN
  37.     conn1.baudrate = 19200    
  38. except Exception,e:
  39.     print 'port is Buzy'
  40.     sys.exit(-1)
  41. conn1.timeout=1
  42. list1 = []
  43.  
  44. command = ['AT','ATI','ATl1','AT+GMMM']
  45.  
  46. for cmd in command:
  47.    conn1.write(str(cmd))     
  48.    print 'port is in use',conn1.portstr 
  49.    th = connect_serial(conn1)
  50.    list1.append(th)
  51.    th.start()
  52.  
  53. for th1 in list1:
  54.     print 'started joining',th1.getName(), 'counter :',th1.count
  55.     th1.join()
  56.  
  57. print time.ctime()
Jul 3 '07 #1
5 2271
shahjapan
63 New Member
Hello,

I am trying to connect my Nokia 6610 using usb cable,
I have installed usb-serial driver of it.


I hv tested it with Hyperterminal and it works fine.

but when I wrote a python script I am not able to receive the responce from the device.

Expand|Select|Wrap|Line Numbers
  1. import os
  2. import re
  3. import time
  4. import sys
  5. from threading import Thread
  6. import serial
  7.  
  8. class connect_serial(Thread):
  9.    def __init__(self,socks):
  10.       Thread.__init__(self)
  11.       self.sock = socks
  12.       self.count = 0
  13.  
  14.    def run(self):
  15.       self.count = 0
  16.       try:
  17.           while 1:                        
  18.              self.count +=1
  19.              if (self.count>=5):
  20.                 break
  21.  
  22.            lines = self.sock.read(100)
  23.            if lines:
  24.               print lines
  25.               print 'read success-----------------------------------------------'
  26.            else:
  27.               print 'nothing to read',str(self.getName())
  28.       except Exception,e:          
  29.           print self.getName()                  
  30.  
  31. print time.ctime()
  32. print
  33. try:
  34.     conn1 = serial.Serial(4)
  35.     conn1.baudrate = 19200
  36.     conn1.parity = serial.PARITY_EVEN
  37.     conn1.baudrate = 19200    
  38. except Exception,e:
  39.     print 'port is Buzy'
  40.     sys.exit(-1)
  41. conn1.timeout=1
  42. list1 = []
  43.  
  44. command = ['AT','ATI','ATl1','AT+GMMM']
  45.  
  46. for cmd in command:
  47.    conn1.write(str(cmd))     
  48.    print 'port is in use',conn1.portstr 
  49.    th = connect_serial(conn1)
  50.    list1.append(th)
  51.    th.start()
  52.  
  53. for th1 in list1:
  54.     print 'started joining',th1.getName(), 'counter :',th1.count
  55.     th1.join()
  56.  
  57. print time.ctime()
waiting for your reply :)
Jul 3 '07 #2
bartonc
6,596 Recognized Expert Expert
waiting for your reply :)
That's just rude. It's 7:14 AM PST. We have some Posting Guidelines that I'd like you to read.
Jul 3 '07 #3
bartonc
6,596 Recognized Expert Expert
Hello,

I am trying to connect my Nokia 6610 using usb cable,
I have installed usb-serial driver of it.


I hv tested it with Hyperterminal and it works fine.

but when I wrote a python script I am not able to receive the responce from the device.

Expand|Select|Wrap|Line Numbers
  1. import os
  2. import re
  3. import time
  4. import sys
  5. from threading import Thread
  6. import serial
  7.  
  8. class connect_serial(Thread):
  9.    def __init__(self,socks):
  10.       Thread.__init__(self)
  11.       self.sock = socks
  12.       self.count = 0
  13.  
  14.    def run(self):
  15.       self.count = 0
  16.       try:
  17.           while 1:                        
  18.              self.count +=1
  19.              if (self.count>=5):
  20.                 break
  21.  
  22.            lines = self.sock.read(100)
  23.            if lines:
  24.               print lines
  25.               print 'read success-----------------------------------------------'
  26.            else:
  27.               print 'nothing to read',str(self.getName())
  28.       except Exception,e:          
  29.           print self.getName()                  
  30.  
  31. print time.ctime()
  32. print
  33. try:
  34.     conn1 = serial.Serial(4)
  35.     conn1.baudrate = 19200
  36.     conn1.parity = serial.PARITY_EVEN
  37.     conn1.baudrate = 19200    
  38. except Exception,e:
  39.     print 'port is Buzy'
  40.     sys.exit(-1)
  41. conn1.timeout=1
  42. list1 = []
  43.  
  44. command = ['AT','ATI','ATl1','AT+GMMM']
  45.  
  46. for cmd in command:
  47.    conn1.write(str(cmd))     
  48.    print 'port is in use',conn1.portstr 
  49.    th = connect_serial(conn1)
  50.    list1.append(th)
  51.    th.start()
  52.  
  53. for th1 in list1:
  54.     print 'started joining',th1.getName(), 'counter :',th1.count
  55.     th1.join()
  56.  
  57. print time.ctime()
This is going to be a bit tricky to help with; not having that phone hooked up here, and all. I think that it's a shame to be coercing USB into serial, but if that works for you....

One place to start would be to look at my USB Model as a thoroughly debugged threaded read() example.
Jul 3 '07 #4
Motoma
3,237 Recognized Expert Specialist
If you have a USB->Serial connection, you should be able to access it as a normal COM port. Take a look at the pySerial project for a useful class for doing so with Python.
Jul 3 '07 #5
shahjapan
63 New Member
If you have a USB->Serial connection, you should be able to access it as a normal COM port. Take a look at the pySerial project for a useful class for doing so with Python.
if you have read the post,

I have used statement

Expand|Select|Wrap|Line Numbers
  1.  import serial 

thats nothing but the pySerial package.
Jul 4 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

4
1622
by: Robin Becker | last post by:
This might be the start of a success story. Says Nokia prefers Python! http://www.theregister.co.uk/content/64/35040.html -ringing-ly yrs- Robin Becker
10
2321
by: Jollino | last post by:
Hello, I've seen several articles about Nokia starting to support Python for its Series 60 phones (like the 6600, for example), and I even found a blog entry with some screenshots of it:...
1
1382
by: Mark Doukidis | last post by:
Is it DEAD ? An exciting prospect when I first heard of Nokia's proposal. I thought there would be a few more postings here since the idea first surfaced around Jan 2004. Maybe I missed...
10
3686
by: mike | last post by:
regards: I use Jtidy (api) to translate a HTML file into a "XHTML file". But The "XHTML file" cannot be identified by nokia 6600. Do I miss something important? Or this is Jtidy's weakness or...
6
13480
by: Daniel Kabs | last post by:
Hello there, I have a Nokia 6630 phone that is based on the Series 60 Software Platform. -> http://www.series60.com/ These "smartphones" are said to support HTML 4.01 and "a subset of...
1
1948
by: mike | last post by:
regards: when nokia mobile browser at the first time access HTTP Server, What kind of "HTTP request" does the nokia mobile browser give to the HTTP Server? thank you May goodness be with you...
1
1600
by: worlman385 | last post by:
anyway I can setup and debug nokia s60 python in komodo ( a python IDE )? thanks
5
1648
by: Jassim Rahma | last post by:
anybody tried to connect to nokia mobile phone and grab the contcats?
0
7109
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7029
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7481
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3190
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.