Re: Unable to write to the serial port /dev/ttyS0 using, QextSerialPort on Maemo device

2010-07-04 Thread Angel Perles


I also considered QextSerialPort for the N900 (but I haven't started yet).

In my case, I will try to use the Bluetooth SPP profile (Serial 
Peripheral) that offers a Virtual COM port over Bluetooth.


I don't want to connect directly devices to the N900 in order to avoid 
breaking it, so I consider that this is a good option.


I utilized succesfully QextSerialPort on Linux and Windows with a 
Bluettooth-enabled GPS (that also uses the SPP profile), so I expect the 
same result with Maemo.


May be this hack guide could help you.

http://blogs.nokia.com/pushn900/wp-content/uploads/2009/09/PUSH_N900_Hackers_guidev1.0.pdf


I depends on what you want to do.

Regards,
Àngel


suyash.ku...@tieto.com wrote:
  OK, I understood, Thanks for the explanation Denis but I have one 
more question?
  IWe decided this approach as we have already implemented serial 
communication of Nokia N95 and PC (connected via USB cable). We simply 
used the symbian APIs for writing the information to the COM1 port and 
received the same on the windows PC's COM1 port and read it from there 
thus establishing a successful serial communication.

 
  That's why I was trying the same for Maemo. The serial port is not 
visible physically on N95 also but somehow we managed the serial 
communication between device and PC using this approach.

 
  Also, if the serial communication is not possible in this way, can 
you suggest me some other way/ sample code to achieve the same.

 
That wasn't really USB, it was RS232, with a wierd connector.

There are some RS232-over-USB-port capable phones - but absolutely no
desktop hosts support this.

Serial (RS232) and Universal Serial Bus - have about as much in common
as man and manatee.

You need to configure the n900s USB port to emulate a RS232-USB
converter - in some way.
http://www.kernel.org/doc/Documentation/usb/gadget_serial.txt is an
overview of how it would be setup.

Unfortunately, I'm unaware of how this would interact with the default
process that enables the requisite USB drivers.

I know hald-addon-usb-cable monitors the lowest level of this, and sends
an event on dbus, but I'm unsure what watches for this event, and
configures USB gadgets.


*
Angel F. Perles Ivars

Departament d'Informàtica de Sistemes i Computadors - DISCA
Universitat Politècnica de València - E.U.Informàtica
Cami de Vera s/n. 46022-Valencia
Edifici 1G Despatx 2S-13
e-mail: aper...@disca.upv.es
Telf.+34 963877007 Ext. 75775 Fax.+34 963877579
http://www.disca.upv.es/aperles
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Unable to write to the serial port /dev/ttyS0 using QextSerialPort on Maemo device

2010-07-02 Thread Suyash.Kumar
Hi,

I am writing a simple Qt on Maemo application for serial communication between 
device and PC for which I am using QextSerialPort 1.2 library to write on the 
/dev/ttyS0 port so that it could be read by the COM1 port on my windows machine 
connected to the device via USB cable.

I am able to create the .so libraries and using the QESPTA example provided in 
QextSerialPort to write on the first serial port. Initially I was trying to 
write on the COM1 port and the device was creating a file named COM1 and 
writing everything there. Then I found the naming convention used for the first 
port on Linux/Maemo is /dev/ttyS0 and changed the port ame accordingly. but 
this is returning error when the API for writing on port is used although the 
API to open the port is returning Success.

Port Settings  open/ write calls (Code Snippet):
port = new QextSerialPort(/dev/ttyS0);
port-setBaudRate(BAUD9600);
port-setFlowControl(FLOW_HARDWARE);
port-setParity(PAR_NONE);
port-setDataBits(DATA_8);
port-setStopBits(STOP_1);
//set timeouts to 500 ms
port-setTimeout(500);

port-open(QIODevice::ReadWrite | QIODevice::Unbuffered);
// internally calls QFile-Open(..) as shown below and returs success
if (Posix_File-open(QIODevice::ReadWrite|QIODevice::Unbuffered)) {
  qDebug(Opened File succesfully);
  /*set open mode*/
  QIODevice::open(mode);

int i = port-write((message-text()).toAscii(),(message-text()).length());
qDebug(trasmitted : %d, i);
// internally calls QIODevice::Write(...) returns -1 as error

Has anyone used QextSerialPort before to write on the serial port on Maemo 
device and does it works? Also, please suggest the possible reason for 
QIODevice returning error even when the port opens successfully?

Regards,
Suyash.

___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Unable to write to the serial port /dev/ttyS0 using QextSerialPort on Maemo device

2010-07-02 Thread Rémi Denis-Courmont
On Friday 02 July 2010 10:15:25 ext suyash.ku...@tieto.com, you wrote:
 Hi,
 
 I am writing a simple Qt on Maemo application for serial communication
 between device and PC for which I am using QextSerialPort 1.2 library to
 write on the /dev/ttyS0 port so that it could be read by the COM1 port on
 my windows machine connected to the device via USB cable.

You do realize that /dev/ttyS0 is the device for a physical serial port on 
Linux. Unless you have your Maemo device on a development jig, your device 
does not have a serial port. So no wonder that it is not working.

-- 
Rémi Denis-Courmont
Nokia Devices RD, Maemo Software, Helsinki
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


RE: Unable to write to the serial port /dev/ttyS0 using QextSerialPort on Maemo device

2010-07-02 Thread Suyash.Kumar
OK, I understood, Thanks for the explanation Denis but I have one more 
question? 
IWe decided this approach as we have already implemented serial communication 
of Nokia N95 and PC (connected via USB cable). We simply used the symbian APIs 
for writing the information to the COM1 port and received the same on the 
windows PC's COM1 port and read it from there thus establishing a successful 
serial communication.

That's why I was trying the same for Maemo. The serial port is not visible 
physically on N95 also but somehow we managed the serial communication between 
device and PC using this approach.

Also, if the serial communication is not possible in this way, can you suggest 
me some other way/ sample code to achieve the same.

Regards,
Suyash.

-Original Message-
From: Rémi Denis-Courmont [mailto:remi.denis-courm...@nokia.com] 
Sent: Friday, July 02, 2010 4:44 PM
To: Kumar Suyash
Subject: Re: Unable to write to the serial port /dev/ttyS0 using QextSerialPort 
on Maemo device

On Friday 02 July 2010 12:10:11 ext suyash.ku...@tieto.com, you wrote:
 Hi Denis,
 
 Could not understand what you meant by:
 Unless you have your Maemo device on a development jig, your device does
 not have a serial port.

Where do you see a serial port on the N900?
...
Nowhere?

There _is_ actually a serial port. It is muxed on some of the electrical pins 
(gold colored dots) that you can see if you remove the battery from its 
compartment.

 I am testing my application on the N900 device itself.
 Also, the command ls -l /dev/ttyS0 gives proper output when run on the
 device terminal.

You would need to wire the above mentioned pins to see the output from ttyS0.

-- 
Rémi Denis-Courmont
Nokia Devices RD, Maemo Software, Helsinki


On Friday 02 July 2010 10:15:25 ext suyash.ku...@tieto.com, you wrote:
 Hi,
 
 I am writing a simple Qt on Maemo application for serial communication 
 between device and PC for which I am using QextSerialPort 1.2 library 
 to write on the /dev/ttyS0 port so that it could be read by the COM1 
 port on my windows machine connected to the device via USB cable.

You do realize that /dev/ttyS0 is the device for a physical serial port on 
Linux. Unless you have your Maemo device on a development jig, your device does 
not have a serial port. So no wonder that it is not working.

--
Rémi Denis-Courmont
Nokia Devices RD, Maemo Software, Helsinki
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Unable to write to the serial port /dev/ttyS0 using QextSerialPort on Maemo device

2010-07-02 Thread Rémi Denis-Courmont
On Friday 02 July 2010 14:25:18 ext suyash.ku...@tieto.com, you wrote:
 OK, I understood, Thanks for the explanation Denis but I have one more
 question? IWe decided this approach as we have already implemented serial
 communication of Nokia N95 and PC (connected via USB cable).

If it is USB then it is not serial. N95 is the same as N900 w.r.t. the serial 
port: you will also find it hidden in the battery compartment.

If you want to transmit data on the USB cable, you need to use one of the USB 
interfaces. If you mean to use the EMULATED serial line, then you need to use 
the USB CDC ACM interface of the PC suite profile. That will LOOK LIKE a COM 
port on Windows if you have the Nokia connectivity device drivers. On Maemo 5, 
that is called /dev/ttyGS2 but that device node is reserved by the N900 built-
in AT commands handler.

-- 
Rémi Denis-Courmont
Nokia Devices RD, Maemo Software, Helsinki
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Unable to write to the serial port /dev/ttyS0 using QextSerialPort on Maemo device

2010-07-02 Thread Ian Stirling

suyash.ku...@tieto.com wrote:
OK, I understood, Thanks for the explanation Denis but I have one more question? 
IWe decided this approach as we have already implemented serial communication of Nokia N95 and PC (connected via USB cable). We simply used the symbian APIs for writing the information to the COM1 port and received the same on the windows PC's COM1 port and read it from there thus establishing a successful serial communication.


That's why I was trying the same for Maemo. The serial port is not visible 
physically on N95 also but somehow we managed the serial communication between 
device and PC using this approach.

Also, if the serial communication is not possible in this way, can you suggest 
me some other way/ sample code to achieve the same.


That wasn't really USB, it was RS232, with a wierd connector.

There are some RS232-over-USB-port capable phones - but absolutely no 
desktop hosts support this.


Serial (RS232) and Universal Serial Bus - have about as much in common 
as man and manatee.


You need to configure the n900s USB port to emulate a RS232-USB 
converter - in some way.
http://www.kernel.org/doc/Documentation/usb/gadget_serial.txt is an 
overview of how it would be setup.


Unfortunately, I'm unaware of how this would interact with the default 
process that enables the requisite USB drivers.


I know hald-addon-usb-cable monitors the lowest level of this, and sends 
an event on dbus, but I'm unsure what watches for this event, and 
configures USB gadgets.



___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers