TPWT
March 29th, 2011, 10:55 PM
Hello all!
Bit of a pickle- I have a piece of serial hardware I cannot connect to via Ubuntu anymore (used to work with same code back in January 2011).
The setup is a serial device connected to a serial cable, to a FTDI serial converter.
The serial device outputs a constant stream on information using these settings:
BAUD_9600,
CHAR_SIZE_8,
PARITY_NONE,
STOP_BITS_1,
FLOW_CONTROL_NONE
On windows, I get the test message appearing in a serial terminal with the above settings.
However when I try to do this in Linux with cutecom no response.
To add to the confusion the port seems correctly setup:
lsusb:
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 002: ID 0eef:480d D-WAV Scientific Co., Ltd
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 014: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 005: ID 13d3:5111 IMC Networks Integrated Webcam
Bus 001 Device 003: ID 1415:2000 Nam Tai E&E Products Ltd. or OmniVision Technologies, Inc. Sony Playstation Eye
Bus 001 Device 002: ID 1415:2000 Nam Tai E&E Products Ltd. or OmniVision Technologies, Inc. Sony Playstation Eye
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
dmsg:
[ 4060.789194] usb 2-1: new full speed USB device using uhci_hcd and address 14
[ 4060.988321] ftdi_sio 2-1:1.0: FTDI USB Serial Device converter detected
[ 4060.988479] usb 2-1: Detected FT232RL
[ 4060.988493] usb 2-1: Number of endpoints 2
[ 4060.988505] usb 2-1: Endpoint 1 MaxPacketSize 64
[ 4060.988517] usb 2-1: Endpoint 2 MaxPacketSize 64
[ 4060.988528] usb 2-1: Setting MaxPacketSize 64
[ 4060.989711] usb 2-1: FTDI USB Serial Device converter now attached to ttyUSB0
I tried my own code (used to work), but to no avail:
#include <iostream>
#include <SerialStream.h>
using namespace LibSerial;
using namespace std;
int main()
{
char byte;
//connect to ttyUSB0
SerialPort mySerialPort("/dev/ttyUSB0");
//open
mySerialPort.Open(SerialPort::BAUD_9600, SerialPort::CHAR_SIZE_8, SerialPort::PARITY_NONE, SerialPort::STOP_BITS_1, SerialPort::FLOW_CONTROL_NONE);
while(1){
cout << "In" << endl;
//read with a timeout of 500 ms
byte = mySerialPort.ReadByte(10000);
cout << byte << endl;
/*
cout << "Out" << endl;
//write a byte
mySerialPort.WriteByte(0xbfb9694c);
*/
cout << "Done" << endl;
}
//close port
mySerialPort.Close();
cout << "Closed" << endl;
return 0;
}
which gives:
In
�
Done
In
terminate called after throwing an instance of 'SerialPort::ReadTimeout'
what(): Read timeout
Please help this is for a big project of mine and the deadline is approaching. I had code working in January, but the same code, on the same hardware, in the same room, no longer works.
Bit of a pickle- I have a piece of serial hardware I cannot connect to via Ubuntu anymore (used to work with same code back in January 2011).
The setup is a serial device connected to a serial cable, to a FTDI serial converter.
The serial device outputs a constant stream on information using these settings:
BAUD_9600,
CHAR_SIZE_8,
PARITY_NONE,
STOP_BITS_1,
FLOW_CONTROL_NONE
On windows, I get the test message appearing in a serial terminal with the above settings.
However when I try to do this in Linux with cutecom no response.
To add to the confusion the port seems correctly setup:
lsusb:
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 002: ID 0eef:480d D-WAV Scientific Co., Ltd
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 014: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 005: ID 13d3:5111 IMC Networks Integrated Webcam
Bus 001 Device 003: ID 1415:2000 Nam Tai E&E Products Ltd. or OmniVision Technologies, Inc. Sony Playstation Eye
Bus 001 Device 002: ID 1415:2000 Nam Tai E&E Products Ltd. or OmniVision Technologies, Inc. Sony Playstation Eye
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
dmsg:
[ 4060.789194] usb 2-1: new full speed USB device using uhci_hcd and address 14
[ 4060.988321] ftdi_sio 2-1:1.0: FTDI USB Serial Device converter detected
[ 4060.988479] usb 2-1: Detected FT232RL
[ 4060.988493] usb 2-1: Number of endpoints 2
[ 4060.988505] usb 2-1: Endpoint 1 MaxPacketSize 64
[ 4060.988517] usb 2-1: Endpoint 2 MaxPacketSize 64
[ 4060.988528] usb 2-1: Setting MaxPacketSize 64
[ 4060.989711] usb 2-1: FTDI USB Serial Device converter now attached to ttyUSB0
I tried my own code (used to work), but to no avail:
#include <iostream>
#include <SerialStream.h>
using namespace LibSerial;
using namespace std;
int main()
{
char byte;
//connect to ttyUSB0
SerialPort mySerialPort("/dev/ttyUSB0");
//open
mySerialPort.Open(SerialPort::BAUD_9600, SerialPort::CHAR_SIZE_8, SerialPort::PARITY_NONE, SerialPort::STOP_BITS_1, SerialPort::FLOW_CONTROL_NONE);
while(1){
cout << "In" << endl;
//read with a timeout of 500 ms
byte = mySerialPort.ReadByte(10000);
cout << byte << endl;
/*
cout << "Out" << endl;
//write a byte
mySerialPort.WriteByte(0xbfb9694c);
*/
cout << "Done" << endl;
}
//close port
mySerialPort.Close();
cout << "Closed" << endl;
return 0;
}
which gives:
In
�
Done
In
terminate called after throwing an instance of 'SerialPort::ReadTimeout'
what(): Read timeout
Please help this is for a big project of mine and the deadline is approaching. I had code working in January, but the same code, on the same hardware, in the same room, no longer works.