An other scenario - same problem (exact specification of the interface to use for communication)
Two interfaces too, but added successively.
-first install Ethernet on 192.168.1.70/24, default gateway 192.168.1.1 (device is behind a separate router including NAT)
-install TCP server (Ethernet)
-open connection A from 192.168.1.10 and transfer data bidirectional
-open connection B from 192.168.2.1 (via the router) and transfer data bidirectional
-open UDP connection C to 192.168.2.1 (via the router) to send debug messages
-than install GPRS interface resp. connection (PPP over serial, using ittyd), interface got IP address 37.85.159.2
now connection A still works fine
communication on connection B is out of order: TCP packets were received, but send() returns "error 0x1510" (no route to host)
UDP debug message sending (connection C) returns "error 0x1510" (no route to host), every reopen of the socket now takes not the former used interface (Ethernet on 192.168.1.70/24, default gateway 192.168.1.1) but the GPRS interface and sends the messages to 192.168.2.1 via GPRS/PPP - these packets get lost because the receiver on 192.168.2.1 is'nt a global reachable IP address
-open connection D from 80.85.192.37 (GPRS/PPP) and transfer data bidirectional (works fine)
-trying to reopen connection B via router results every time "error 0x1510" (no route to host)
Questions:
How to specify the interface to use by RTCS? (setsockopt option SO_BINDTODEVICE is not supported in MQX)
We did'nt unterstand the system how MQX 'find the best route to host'. While adding the PPP interface, the route struct will be modified - than the return path for working connections are corrupted.... Is there a fix to prevent these? Is RTCSCFG_ENABLE_VIRTUAL_ROUTES required to work in the scenario above ?
best regards,
Caesar