I have a server on my Raspberry Pi with Rasbian on it. To control it, i made a Java TCP/IP client/server. The java Server Side run all the day, and i can connect on it by the Client program. Basically, the Server wait for some code, and execute the command bind to this code.
All works perfectly, on my computer and on my Android smartphone.
So i add an authentification function. I had a white list and the server check if the client IP (obtained by the socket.getRemoteSocketAddress()
) is allowed to connect and send command to my server.
I added my computer IP (local IP, because my computer is on the same network than my Raspberry) and i added my smartphone IP too.
My problem is here : Instead of my PC, my smartphone has a dynamic IP. So when i add it's IP to my whitelist, it's works well. But after a few time, my smartphone IP is changed because it's dynamic, so my smartphone isn't allowed anymore.
So i'm searching for a unique key on my smartphone i could use to identify my smartphone and only mine.
Also i need to have a similar key on my computer to identify my computer by the same way.
Do you know a key like that ?