$SMCommRoute doesnt seem to work very well for me on my iphone 4s.
Im using scadamobile1, and even when i am in my home LAN, connected to wifi, $SMCommRoutedoesnt will return 3. I noticed in the connections tab that i am connected to my external IP, and not the lan IP.
is there something I can do to make this work better?
The $SMCommRoute variable determines whether a connection is established on the IP given in the ‘local_ip’ setting or the ‘remote_host’ setting, but the app it can not determine anything beyond that. In your case you state that even when you are at home you see your external IP on the connections tab. This is because your router at home allows this by routing your external IP to your internal IP. As this may be useful in some cases, most routers do not allow this and just drop connections if attempted to connect to their internet IP from the Local side.
ScadaMobile will use the last connection that worked, so if the ‘remote’ connection continues to be ok the app will not attempt to switch to the local one. In fact SM has no way to determine which one to use except by determining whether it works or not. So if you really need the SMCommRoute feature you must disable your router to accept connections to its own external IP from the LAN, so only real external connections are allowed on that IP.