-2

I have a gate opener module which I call to open my gate. The module also have the ability to communicate over Cellular Data, in fact the module's vendor is able to connect to my module over the Internet only by using the SIM phone number which I gave them.

In order to communicate with the module (I have the credentials), how do I translate the phone number into the device current IP address?

Thanks!

Nino
  • 702
  • 2
  • 6
  • 12

1 Answers1

0

The IP address is dynamically allocated to the device so you cannot normally use the phone number to look it up.

One way around this problem, which is common to many solutions and protocols, is to have your gate opener module register with a central server and supply its contact details to the server. You can then contact the central server and ask it to send a message to the gate module when you need to contact it via IP. The Gate module either needs to poll the server or support some form of notifications to get the message from the central server.

Another approach, if you gate module is Android based, is to send a SMS and register a listener in the manifest:

<receiver android:name=".YourSMSReceiveClass">
            <intent-filter>
                <action android:name="android.provider.Telephony.SMS_RECEIVED"></action>
            </intent-filter>
        </receiver>

You can then add code to do whatever you require in the receiver.

Mick
  • 24,231
  • 1
  • 54
  • 120
  • Thanks, but, there is no way to program this thing, there must be a way to translate the phone number otherwise the vendor wouldn't be able to connect with it. As for dynamic IP, it is not relevant in this case, static or dynamic, same problem. – Nino Jul 11 '18 at 15:35
  • The vendor will not be able to map the SIM to an IP address if this is what you mean - they may have set up their firmware to receive an SMS and respond over IP however. – Mick Jul 11 '18 at 20:30
  • Yes, that's possible. Thanks! – Nino Jul 11 '18 at 20:36