Re: [Ftdi-usb-sio-devel] Raspberry Pi FDTI Driver issue
Brought to you by:
bryder
From: Bill R. <bil...@gm...> - 2015-04-09 00:09:03
|
At a guess the Pi isn't loading the right driver. Do you have the output from dmesg when the FTDI is plugged in? It should say something about a ftdi_sio device being attached. On Thu, Apr 9, 2015 at 9:40 AM, Brett Whittacre <wh...@ec...> wrote: > I am having a very strange issue with serial communication through a fdti > FT232 device. I have created a serial program that communicated with a > device. It is set to blocking mode. When I run the program on a PC, it > works just fine. However, when I run the same program on a Raspberry pi 2, > it always returns at least one character, even though there is nothing on > the line at that time. The code below works on Ubuntu 14.04 with no > issues. I get full blocking using either a read of select call. > > I am just wondering if I am doing something wrong on the PI.... > > Here is how I am connecting to the port.' > > > fd=open(sDev.c_str(), O_RDWR | O_NOCTTY ); > > > struct termios options; > > tcgetattr(fd, &options); > > > cfsetispeed(&options, B115200); > > cfsetospeed(&options, B115200); > > options.c_cflag |= (CLOCAL | CREAD ); > > options.c_cflag &= ~CSTOPB; //Set one stop bit > > options.c_cflag &= ~CRTSCTS; // > > options.c_cflag &= ~CSIZE; //Mask the character size bits > > options.c_cflag |= (ICANON); > > options.c_cflag &= ~(IXON| IXOFF |IXANY); //No software flow control > > options.c_cc[VTIME]=0; > > options.c_cc[VMIN]=1; > > > tcsetattr(fd, TCSANOW, &options); > > int flags; > > //clear DTR and RTS > > flags &= ~(TIOCM_DTR | TIOCM_RTS); > > ioctl(fd, TIOCMSET, &flags); > > usleep(200); > > > //SET DTR > > flags |= TIOCM_DTR; > > ioctl(fd, TIOCMSET, &flags); > > usleep(200); > > > //clear DTR > > flags &= ~(TIOCM_DTR); > > ioctl(fd, TIOCMSET, &flags); > > usleep(200); > > > > > > > Kind Regards, > > *Brett Whittacre* > Vice President > wh...@ec... > *ec2 Software Solutions* > 3035 E. Patrick > Ste. 1 > Las Vegas, Nevada, 89120 > *P*: 1.866.791.3673 ext 200 | *F:* 1.702.947.7357 > <http://www.ec2software.com/>www.ec2software.com > <http://www.ec2software.com/>*Follow the rules.* * Exceed the standard**.* > > > Kind Regards, > > *Brett Whittacre* > Vice President > wh...@ec... > *ec2 Software Solutions* > 3035 E. Patrick > Ste. 1 > Las Vegas, Nevada, 89120 > *P*: 1.866.791.3673 ext 200 | *F:* 1.702.947.7357 > <http://www.ec2software.com>www.ec2software.com > <http://www.ec2software.com> *Follow the rules.* * Exceed the standard**.* > > > > ------------------------------------------------------------------------------ > BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT > Develop your own process in accordance with the BPMN 2 standard > Learn Process modeling best practices with Bonita BPM through live > exercises > http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- > event?utm_ > source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF > _______________________________________________ > Ftdi-usb-sio-devel mailing list > Ftd...@li... > https://lists.sourceforge.net/lists/listinfo/ftdi-usb-sio-devel > > |