I am developing a project to drive some arduino device (IOT spirit) using hosted webserver that will communicate with.
For a particular task I would like to determine (automatically) if the client is locally connected on the same LAN, witch would mean he is on location else he would be outside.
Is there any from the ARDUINO to get this information directly ?
Is there a way for the server to determine if the request come from same public IP than the ARDUINO to control and forward then a specific command ?
I have that capability with my server. It requires accessing lower level libraries. I can determine which IP (public or localnet) the request is coming from.
This code works with the ethernet library included with the IDE. If you use the Wiznet library, it requires a simple mod to the library to add the getSocketNumber function.
thisSocket = client.getSocketNumber();
// here is where you would do a comparison to your localnet IP range