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. - import os
-
import re
-
import time
-
import sys
-
from threading import Thread
-
import serial
-
-
class connect_serial(Thread):
-
def __init__(self,socks):
-
Thread.__init__(self)
-
self.sock = socks
-
self.count = 0
-
-
def run(self):
-
self.count = 0
-
try:
-
while 1:
-
self.count +=1
-
if (self.count>=5):
-
break
-
-
lines = self.sock.read(100)
-
if lines:
-
print lines
-
print 'read success-----------------------------------------------'
-
else:
-
print 'nothing to read',str(self.getName())
-
except Exception,e:
-
print self.getName()
-
-
print time.ctime()
-
print
-
try:
-
conn1 = serial.Serial(4)
-
conn1.baudrate = 19200
-
conn1.parity = serial.PARITY_EVEN
-
conn1.baudrate = 19200
-
except Exception,e:
-
print 'port is Buzy'
-
sys.exit(-1)
-
conn1.timeout=1
-
list1 = []
-
-
command = ['AT','ATI','ATl1','AT+GMMM']
-
-
for cmd in command:
-
conn1.write(str(cmd))
-
print 'port is in use',conn1.portstr
-
th = connect_serial(conn1)
-
list1.append(th)
-
th.start()
-
-
for th1 in list1:
-
print 'started joining',th1.getName(), 'counter :',th1.count
-
th1.join()
-
-
print time.ctime()
5 2271
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. - import os
-
import re
-
import time
-
import sys
-
from threading import Thread
-
import serial
-
-
class connect_serial(Thread):
-
def __init__(self,socks):
-
Thread.__init__(self)
-
self.sock = socks
-
self.count = 0
-
-
def run(self):
-
self.count = 0
-
try:
-
while 1:
-
self.count +=1
-
if (self.count>=5):
-
break
-
-
lines = self.sock.read(100)
-
if lines:
-
print lines
-
print 'read success-----------------------------------------------'
-
else:
-
print 'nothing to read',str(self.getName())
-
except Exception,e:
-
print self.getName()
-
-
print time.ctime()
-
print
-
try:
-
conn1 = serial.Serial(4)
-
conn1.baudrate = 19200
-
conn1.parity = serial.PARITY_EVEN
-
conn1.baudrate = 19200
-
except Exception,e:
-
print 'port is Buzy'
-
sys.exit(-1)
-
conn1.timeout=1
-
list1 = []
-
-
command = ['AT','ATI','ATl1','AT+GMMM']
-
-
for cmd in command:
-
conn1.write(str(cmd))
-
print 'port is in use',conn1.portstr
-
th = connect_serial(conn1)
-
list1.append(th)
-
th.start()
-
-
for th1 in list1:
-
print 'started joining',th1.getName(), 'counter :',th1.count
-
th1.join()
-
-
print time.ctime()
waiting for your reply :)
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.
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. - import os
-
import re
-
import time
-
import sys
-
from threading import Thread
-
import serial
-
-
class connect_serial(Thread):
-
def __init__(self,socks):
-
Thread.__init__(self)
-
self.sock = socks
-
self.count = 0
-
-
def run(self):
-
self.count = 0
-
try:
-
while 1:
-
self.count +=1
-
if (self.count>=5):
-
break
-
-
lines = self.sock.read(100)
-
if lines:
-
print lines
-
print 'read success-----------------------------------------------'
-
else:
-
print 'nothing to read',str(self.getName())
-
except Exception,e:
-
print self.getName()
-
-
print time.ctime()
-
print
-
try:
-
conn1 = serial.Serial(4)
-
conn1.baudrate = 19200
-
conn1.parity = serial.PARITY_EVEN
-
conn1.baudrate = 19200
-
except Exception,e:
-
print 'port is Buzy'
-
sys.exit(-1)
-
conn1.timeout=1
-
list1 = []
-
-
command = ['AT','ATI','ATl1','AT+GMMM']
-
-
for cmd in command:
-
conn1.write(str(cmd))
-
print 'port is in use',conn1.portstr
-
th = connect_serial(conn1)
-
list1.append(th)
-
th.start()
-
-
for th1 in list1:
-
print 'started joining',th1.getName(), 'counter :',th1.count
-
th1.join()
-
-
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.
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.
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
thats nothing but the pySerial package.
Sign in to post your reply or Sign up for a free account.
Similar topics |
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
|
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:...
|
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...
|
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...
|
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...
| |
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...
|
by: worlman385 |
last post by:
anyway I can setup and debug nokia s60 python in komodo ( a python IDE
)?
thanks
|
by: Jassim Rahma |
last post by:
anybody tried to connect to nokia mobile phone and grab the contcats?
|
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...
|
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...
|
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...
| |
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |