--Serial interface works perfectly.A simple calculation :
--Problem was in RS232 cable. It was my mistake to use straight cable. I checked serial interface using null modem cable, i am good with it.
--I need hint for Xbee side. QNX simulated data is almost 60-70 MB in 1-2 minutes. I want to receive data on host side as a Real time.
--Target simulation data i need to receive on host side in Real time.
--I am going to use ("https://www.sparkfun.com/products/13225") serial to Xbee module.
-- Is it possible with this implement?
Thanks in advance.
Hello,RS232 serial port , it sends data to Xbee and Host receive data through USB Xbee . I also tried serial communication using RS232 cable. That also doesn't work.Now, I am trying to run following code on Target & send some data to host.
I am trying to develop wireless communication between host(Windows) & Target (QNX). I am using serial port RS232 to send data to host. RS232 is connected to Xbee for wireless communication. USB Xbee dongle is inserted on Host. So, Target send data to
---------------------------------------------------------------------------- #include <stdio.h> /* Standard input/output definitions */
#include <string.h> /* String function definitions */
#include <unistd.h> /* UNIX standard function definitions */
#include <fcntl.h> /* File control definitions */
#include <errno.h> /* Error number definitions */
#include <termios.h> /* POSIX terminal control definitions */ #include<sys/types.h>
#include<sys/stat.h>
#include<stdlib.h>
//'open_port()' - Open serial port 1.
int open_port(void)
{
int fd; /* File descriptor for the port */
fd = open("/dev/ser1", O_RDWR | O_NOCTTY | O_NDELAY);
if (fd == -1)
{
// Could not open the port.
perror("open_port: Unable to open /dev/ttyf1 - ");
}
else
{
printf("Port Opened\n");
fcntl(fd, F_SETFL, 0);
}
return (fd);
}
void close_port(int fd)
{
close(fd);
printf("Port closed\n");
}
int main()
{
int n, x, y;
char data[6];
n = open_port();
printf("File Descriptor for port is: %d\n", n);
x = write(n, "Ankur\r", 6);
if(x < 0)
fputs("writing failed\n", stderr);
else
printf("Total written bytes of data: %d\n", x);
y = 0;
while(y < 6)
{
y = read(n, data, 6);
printf("Bytes read: %d\n", y);
}
close_port(n);
return 0;
}
----------------------------------------------------------------------------
I also use command "devc-ser8250", "ls /dev/ser*" on Target.
On host side i am using "Serial Port monitor" software to check receive data. Unfortunately, i couldn't find anything on it.
Can you elaborate the procedure to help me in my project.
Thanks in advance
Ankur.
I tried Xbee serial explorer.
The same code which I posted and works perfectly in serial interface.
But when i execute that using Xbee serial explorer, it shows different output ,Bytes read :0 multiple times.
Is there any configuration to do before run that code?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 63:32:35 |
Calls: | 6,654 |
Files: | 12,200 |
Messages: | 5,331,702 |