1

I am unable to establish communication between server and client when using seperate JSON configuration files for client and server My requirement is to transmit SOME/IP data using the vsomeip framework. I am transmitting the data on the same system. However, I am able to transmit data when using the same JSON file for transmitter and receiver. Below is the JSON file used.

{
    "unicast" : "160.48.199.102",
    "logging" :
    { 
        "level" : "trace",
        "console" : "true",
        "file" : { "enable" : "false", "path" : "/tmp/vsomeip.log" },
        "dlt" : "false"
    },
    "applications" : 
    [
        {
            "name" : "master_tx",
            "id" : "0x1277"
        },
        {    
            "name" : "master_rx",
            "id" : "0x1344"
        }
    ],
    "services" :
    [
        {
            "service" : "0x3556",
            "instance" : "0x0001",
            "reliable" : { "port" : "30490", "magic-cookies" : "false" },
            "events" : 
            [
                {
                    "event" : "0x8001",
                    "is_field" : "true",
                    "is_reliable" : "false"
                }
            ]
        }
    ]
    "max-payload-size" : "5000",
    "max-payload-size-unreliable" : "5000",
    "routing" : "master_tx",
    "service-discovery" :
    {
        "enable" : "true",
        "port" : "30490",
        "protocol" : "_udp_",
        "initial_delay_min" : "100",
        "initial_delay_max" : "200",
        "repetitions_base_delay" : "200",
        "repetitions_max" : "15",
        "ttl" : "100",
        "cyclic_offer_delay" : "2000",
        "request_response_delay" : "1500"
    }
}

But, when using different JSON files for transmitter and receiver, I am not able to establish any connection. Below are the JSON files used.

server.json

{
    "unicast" : "192.168.0.178",
    "logging" :
    { 
        "level" : "trace",
        "console" : "true",
        "file" : { "enable" : "false", "path" : "/tmp/vsomeip.log" },
        "dlt" : "false"
    },
    "applications" : 
    [
        {
            "name" : "master_tx",
            "id" : "0x1277"
        }
    ],
    "services" :
    [
        {
            "service" : "0x3556",
            "instance" : "0x0001",
            "reliable" : { "port" : "30490", "magic-cookies" : "false" },
            "events" : 
            [
                {
                    "event" : "0x8001",
                    "is_field" : "true",
                    "is_reliable" : "false"
                }
            ],
            "eventgroups" :
            [
                {
                    "eventgroup" : "0x001",
                    "events" : [ "0x8001" ]
                }
            ]
        }
    ],
    "max-payload-size" : "5000",
    "max-payload-size-unreliable" : "5000",
    "routing" : "master_tx",
    "service-discovery" :
    {
        "enable" : "true",
        "port" : "30490",
        "protocol" : "_udp_",
        "initial_delay_min" : "100",
        "initial_delay_max" : "200",
        "repetitions_base_delay" : "200",
        "repetitions_max" : "15",
        "ttl" : "100",
        "cyclic_offer_delay" : "2000",
        "request_response_delay" : "1500"
    }
}

client.json

{
    "unicast" : "192.168.0.178",
    "network" : "vsomeip-rx",
    "logging" :
    { 
        "level" : "trace",
        "console" : "true",
        "file" : { "enable" : "false", "path" : "/tmp/vsomeip.log" },
        "dlt" : "true"
    },
    "applications" : 
    [
        {    
            "name" : "master_rx",
            "id" : "0x1344"
        }
    ],
    "clients" :
    [
        {
            "service" : "0x3556",
            "instance" : "0x0001",
            "unreliable" : [ "30490" ]
        }
    ],
    "max-payload-size" : "5000",
    "max-payload-size-unreliable" : "5000",
    "routing" : "master_rx",
    "service-discovery" :
    {
        "enable" : "true",
        "port" : "30490",
        "protocol" : "_udp_",
        "initial_delay_min" : "100",
        "initial_delay_max" : "200",
        "repetitions_base_delay" : "200",
        "repetitions_max" : "15",
        "ttl" : "100",
        "cyclic_offer_delay" : "2000",
        "request_response_delay" : "1500"
    }
}

Can someone please help me if something is wrong in JSON files or if I am missing something else.

Sireesha
  • 21
  • 1
  • 2

2 Answers2

0

server.json

  1. Port 30490 is defined as reliable whereas it is used as a service discovery port (which is unreliable). Use other one like 30500.
  2. I'm not sure if a "_udp_" is allowed value - "udp" for sure is.

client.json

  1. "clients" tag specifies the ports that shall be used to connect to a specific service. In this case again only one port is used 30490 which is already defined for service discovery. Additionally in the client it is specified as unreliable whereas it is reliable in the server. Beside as specified in documentation: vsomeip will take the first free port of the list. If no free port can be found, the connection will fail. Try with other port or remove "clients" tag for tests.

  2. I'm not sure if a "_udp_" is allowed value - "udp" for sure is.

0

Hm, difficult. I would say the port 30490 is reserved for ServiceDiscovery (which is used by the vsomeip daemon). So maybe the reuse for the application could lead to a problem.

But I would say the main problem here is that you using a reliable port (which means TCP) for the the service "0x3556" in the server.json and an unreliable port (UDP) in the client.json. Maybe this solves the problem.

Thomas K
  • 42
  • 6