Leopold Palomo-Avellaneda wrote:
> A Dijous 05 Abril 2007 19:30, Jan Kiszka va escriure:
>> Leopold Palomo-Avellaneda wrote:
>>> Hi,
>>>
>>> probably I'm doing some big mistake but I'm a bit lost in a trouble with
>>> rtnet. I have rtnet compiled, installed and running without rtmac/tdma.
>>>
>>> I have configured the interface and the routes:
>>>
>>> $:~/robotica/orocos/rtnet-proves$ sudo /usr/local/rtnet/sbin/rtifconfig
>>> rteth0    Medium: Ethernet  Hardware address: 00:A0:C9:1D:52:B9
>>>           IP address: 192.168.1.3  Broadcast address: 192.168.1.255
>>>           UP BROADCAST RUNNING  MTU: 1500
>>>
>>> rtlo      Medium: Local Loopback
>>>           IP address: 127.0.0.1
>>>           UP LOOPBACK RUNNING  MTU: 1500
>>>
>>> $:~/robotica/orocos/rtnet-proves$ sudo /usr/local/rtnet/sbin/rtroute
>>> Host Routing Table
>>> Hash    Destination     HW Address              Device
>>> 00      0.0.0.0         00:00:00:00:00:00       rtlo
>>> 01      127.0.0.1       00:00:00:00:00:00       rtlo
>>> 03      192.168.1.3     00:00:00:00:00:00       rtlo
>>> 3F      192.168.1.255   FF:FF:FF:FF:FF:FF       rteth0
>>>
>>>
>>> I can do a ping to my rteth0:
>>> $:~/robotica/orocos/rtnet-proves$ sudo /usr/local/rtnet/sbin/rtping
>>> 192.168.1.3
>>> Real-time PING 192.168.1.3 56(84) bytes of data.
>>> 64 bytes from 127.0.0.1: icmp_seq=1 time=22.9 us
>>> 64 bytes from 127.0.0.1: icmp_seq=2 time=14.0 us
>>> .....
>>>
>>> if I run the examples of the rtai directory, both run. However I don't
>>> see the expected result because the server run:
>>> $:~/robotica/orocos$ sudo /usr/local/rtnet/examples/rtai/simpleserver
>>> 5000 RTnet, simpleserver for LXRT
>>>
>>> and the client runs:
>>> $:~/robotica/orocos/rtnet-proves$
>>> sudo /usr/local/rtnet/examples/rtai/simpleclient 5001 192.168.1.3 5000
>>> RTnet, simpleclient for LXRT
>>>
>>> and exit and no message is printed in the server side.
>>>
>>> Someone could tell me how can I test what is wrong or what I'm doing bad?
>> Not immediately. I must admit, the RTAI examples are in bad shape. I
>> would start checking the return codes of all involved RTnet service
>> requests. One of them should/must fail. Maybe the information which one
>> and with what code will help.
> 
> ok, I had done it in a modified version of the examples. In the server 
> program, I added some printf to the return values of the functions, and so, 
> the important parts:
> 
> .....
> 
>     char *a1;
>     a1= inet_ntoa(local_addr.sin_addr);
>     printf("Running the server in the ip: %s\n", a1 );
> .....
> this print:
> Running the server in the ip: 0.0.0.0
> 
> .............. 
>     /* Switch over to hard realtime mode. */
>     rt_make_hard_real_time();
> 
>     printf("Ret after the rt = %d \n", ret );
> .........
> this print:
> Ret after the rt = 0
> 
> ..........
>     /* Bind socket to local address specified as parameter. */
>     ret = rt_dev_bind(sockfd, (struct sockaddr *) &local_addr,
>                       sizeof(struct sockaddr_in));
> 
>     printf("Ret = %d \n", ret );
> ...........
> here, the print:
> Ret = 0
> 
> so, I understand that open the socket without any problem
> 
> ............
>     /* Block until packet is received. */
>     ret = rt_dev_recv(sockfd, msg, sizeof(msg), 0);
> ...............
> 
> but the program is blocked here.

"but"? Sorry, don't understand. Does the application block here as
expected? But then it never returns from rt_dev_recv?

> 
> In the client side:
> sudo ./simpleclient 5001 127.0.0.1 5000
> RTnet, simpleclient for LXRT
> 
> The connection says : 0
> 
> 
> .............
>     /* Bind socket to local address specified as parameter. */
>     ret = rt_dev_bind(sockfd, (struct sockaddr *) &local_addr,
>                       sizeof(struct sockaddr_in));
>   printf("Ret after the rt_dev_bind = %d \n", ret );
> ...........
> 
> print:
> Ret after the rt_dev_bind = 0
> ......................
>     /* Specify destination address for socket; needed for rt_socket_send(). */
>     int value = rt_dev_connect(sockfd, (struct sockaddr *) &server_addr,
>                    sizeof(struct sockaddr_in));
>     printf("The connection says : %i\n", value);
> ..................
> The connection says : 0
> 
> 
> really I'm blocked now ....

???

What does rt_dev_send return?

Additionally, you could attach RTcap to the loopback device in sniff if
there is something on the "virtual" wire, and how that frame precisely
look like.

> 
>> BTW, I'm always open to apply cleanup patches for the RTAI examples, or
>> new and better ones. But I depend on RTAI users here, I don't have that
>> test environment anymore.
> 
> Ok, I take note.
> 
> regards,
> 
> Leo

Jan

Attachment: signature.asc
Description: OpenPGP digital signature

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
RTnet-users mailing list
RTnet-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rtnet-users

Reply via email to