bonewell / franca-capi-someip-sample

Sample of using FrancaIDL, CommonAPI and SOME/IP over TCP
39 stars 22 forks source link

OFFER_SERVICE multicast messages are not getting sent on QNX #3

Closed uj864 closed 5 years ago

uj864 commented 5 years ago

Hello I built the apps using the code from branch release/qnx660/2.5.2. I can see that the FIND_MESSAGES from the client side are getting sent. But no OFFER_SERVICE messages are getting sent from the server's side. Do you have any idea what could be going wrong. Thanks in advance.

bonewell commented 5 years ago

Have you added route on your both computers? For example for QNX: route add -net 224.0.0.0/4 default 224.0.0.0/4 - this is default address for service discovery.

uj864 commented 5 years ago

Hello, thanks for your reply Yes i added the route on both machines using route add -net 224.0.0.0/4 default also i am using the json file in which multicast address for service discovery is 224.224.224.245. Also since i am able to see find messages using tcpdump doesn't that mean that multicasting is working?

bonewell commented 5 years ago

Did you try default parameters for service discovery? Like this: "service-discovery" : { "enable" : "true" }

uj864 commented 5 years ago

Again Thanks for your quick reply, I just tried to not explicitly give the multicast address but still no offer messages are getting sent. Also the app is running fine across Linux machines. I am trying to debug by comparing the two. I just noticed that for qnx implementation/endpoints/src/server_endpoint_impl.cpp has a send function this never gets called while for linux it is getting called.

bonewell commented 5 years ago

Is firewall disabled? Let me clarify up, do you try run my sample? Also I had the issue on QNX. I have to restart QNX machine after every run application, otherwise it doesn't work next attempts.

uj864 commented 5 years ago

Yes I run your sample apps. The apps run fine across two Linux machines(one having server app and other client) and they also work on one qnx machine (both server app and client app on one machine ).I am trying to see the difference in flow of the apps on Linux and qnx right now. So far I know that there is a send function in implementation/routing/src/routing_manager_impl.cpp which calls another send in implementation/endpoints/src/server_endpoint_impl.cpp, which sends the offer messages, this is not happening for service app on qnx. Anyways I am still debugging. Thanks for replying.

uj864 commented 5 years ago

Hey hello again. I saw that you have commented out the code for netlink_connector for qnx. Any idea how this functionality is going to be handled in qnx. From what I understand you would have commented it due to Linux specific headers like <linux/netlink.h> & <linux/rtnetlink.h> but I think this is the reason the multicast offer messages are not getting sent. Also did you check the apps across two QNX machines?

bonewell commented 5 years ago

How I remember I checked two case:

  1. service on Linux and client on QNX
  2. vise versa - possible :)

I'm not sure that I have checked both sides on two QNX machines.

uj864 commented 5 years ago

Ok so for you running service on QNX worked which means your offer messages were sent.Any idea about how the functionality of netlink_connector worked for you?

bonewell commented 5 years ago

Sorry. I did this sample 2 years ago. I remember that the first case works. I don't have expertise in SomeIP protocol and vsomeip implementation of this protocol. My task was to try to run service on Linux and client on QNX using CommonAPI and FrancaIDL. I have done simple changes to build vsomeip on QNX. It have worked. If you can not run the first case, you do something wrong. In other case it might not work. I don't exactly remember whether I tested them or not.

uj864 commented 5 years ago

Ok Thanks for your help.

lifangwang commented 5 years ago

@uj864 , I think I have sovled your problem. I have done a simple multicast test on QNX 7.0, found that the endpoint local address should be set as INADDY_ANY, any other specified IP address(as 192.168.0.1) cause the problem that can't receive any multicast packet, so I change the source code implmentation/routing/src/routing_manager_impl.cpp as following, comment the case for QNX and let QNX use INADDR_ANY for create_server_endpoint.

1555 //#if !defined(_WIN32) && !defined(__QNX__)
1556 #if !defined(_WIN32) 
1557                 if (its_unicast.is_v4()) {
1558                     its_unicast = boost::asio::ip::address_v4::any();
1559                 } else if (its_unicast.is_v6()) {
1560                     its_unicast = boost::asio::ip::address_v6::any();
1561                 }
1562 #endif

the simple multicast test file for qnx is following:

multi_recv.txt

bonewell commented 5 years ago

@lifangwang Thanks you. Did you use my fork of vsomeip? Can you create a pull request?

lifangwang commented 5 years ago

@bonewell ,
I completely follow your instructions to build this sample for QNX 7.0. and found some case it do not work properly, so I fallback to test vsomeip samples first, and then run your sample. the test is on going , I will update it later.

johnsolom commented 3 years ago

@uj864 i am also facing the same issue did you find any solution?