Home/Support/Support Forum/How to print response out on terminal on Linux

How to print response out on terminal on Linux

0 votes
Hello, I am using 2 XBee 802.15.4 modules.

I connected one on USB adapter to raspberry pi, and another one on bread board.

when I generate Remote AT Command packet and send it. they work.

but after I generate ND command, they don't work. but after that, If I send Remote AT command to itselves, It prints out ND response and Remote AD command response.

when I test it on X-CTU on Macbook, I can see output on X-CTU, but I couldn't see response on terminal.

how to print out them on terminal?

※ I send pakcets by /dev/ttyUSB0
asked Jun 15, 2016 in IEEE 802.15.4 by Junsu Kim New to the Community (0 points)

Please log in or register to answer this question.

1 Answer

0 votes
That is something you need to ask on a Rasbury Pi support site.
answered Jun 15, 2016 by mvut Veteran of the Digi Community (11,966 points)
Thank you for your response.

However same problem is on Macbook too.
What do you mean by they don't work after you issue an ATND command?  How long after you do the ND do you try to send a data packet? Are you using the API AT command to issue the ND or are you doing an ATND via AT command mode?
Oh I am testing on API mode and I made this C program.

also to check response, I open one more terminal and use cat command on the terminal (ex:$ "cat /dev/tty.usbserial-DA7OBT8"), and then I make packet like the program, but I cannot get response.

when I use Remote AT Command. I can see response by cat command on terminal, but response is not shown on terminal when I use that program.

------ND_Packet_Generater.c-------------

#include<stdio.h>

int main(int argc, char* argv[])
{
        char stream[8] = {0x7E, 0x00, 0x04, 0x08, 0x01, 0x4E, 0x44, 0x64};
        int i;

        FILE *fp = fopen ("/dev/tty.usbserial-DA7OBT8","w");

        for (i = 0; i < 8; i++)   
                fprintf (fp, "%c", stream[i]);
        fclose (fp);

        return 0;
}
...