I'm trying to develop small app detecting when/which phone was connected / disconnected to rpi and than base on that take some actions it should work with both android and apple phones
I know how to detect if something was connected to USB but I don't know how / if its possible to detect exact phone (unique Id - eg imei or serial)
High level functionality I'm thinking of - phone registration (store unique number in local db) - phone connected to usb : * check if it is "known" phone, then do something * if unknown do Notting
Can somebody please advise if this is possible / where to start?
** EDIT ** This will be just USB cable connection Rpi-Phone. Only to 'authorize' user that way (and keep Phone charging). I do not need send anything / exchange data etc.
Ideally this should work without need phone unlocking
lsusb
to get, eg., the manufacturer and model USB ids. You can also get that and other info from udev (probably including themei
, which I believe is used to create individual device paths in/sys
). A udev hook could also be used to log the information (much of which is logged by the kernel and/or udev already).