Reply
Thread Tools
Guest | Posts: n/a | Thanked: 0 times | Joined on
#1
Hello, hello.

Something that may be useful to other app developers, especially if tying in mobile apps to web apps and vice versa -

I feel like there is an easily accessible Unique ID string for every device, like a mac address.

Does this exist? If so, any ideas how to access it? (bonus points if it's in python)
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#2
The IMEI number of the device can be retrieved:
dbus-send --system --print-reply --type=method_call --dest=com.nokia.phone.SIM /com/nokia/phone/SIM/security Phone.Sim.Security.get_imei

(Sorry, no Python example; I don't know python-dbus and my dbus-glib knowledge is quite bad anyway...)

Two things returned (in this order):
* IMEI as a string
* An int32 (which says 0 here)
 

The Following 13 Users Say Thank You to qwerty12 For This Useful Post:
daperl's Avatar
Posts: 2,427 | Thanked: 2,986 times | Joined on Dec 2007
#3
An n8x0 Python hack to get MAC address:

Code:
import os

for line in os.popen('/sbin/ifconfig'):
    if line.find('wlan0') > -1:
        mac = line.split()[4]
        print mac
__________________
N9: Go white or go home
 

The Following 7 Users Say Thank You to daperl For This Useful Post:
Fargus's Avatar
Posts: 1,217 | Thanked: 446 times | Joined on Oct 2009 @ Bedfordshire, UK
#4
Originally Posted by daperl View Post
An n8x0 Python hack to get MAC address:

Code:
import os

for line in os.popen('/sbin/ifconfig'):
    if line.find('wlan0') > -1:
        mac = line.split()[4]
        print mac
Nice idea but MAC can be easily spoofed. IMEI is legally not supposed to be changed as I believe it's programmed in at low level. This is also the number used to bar handsets reported as stolen from networks. Should therefore work as unique number for any device.
 

The Following User Says Thank You to Fargus For This Useful Post:
Kieron's Avatar
Posts: 388 | Thanked: 115 times | Joined on Oct 2009 @ London, UK
#5
Could one not install something like macchanger to spoof or get mac? I've used such a thing on Ubuntu a few years back when messing with WEP cracking.
 
daperl's Avatar
Posts: 2,427 | Thanked: 2,986 times | Joined on Dec 2007
#6
Originally Posted by Fargus View Post
Should therefore work as unique number for any GSM device.
..........
__________________
N9: Go white or go home
 
fragos's Avatar
Posts: 900 | Thanked: 273 times | Joined on Aug 2008 @ Fresno CA USA
#7
Linux uses vendor:device hex codes as in 046d:c03f for my Logitech mouse. Udev uses these to identify devices as well in /lib/udev/rules.d. Here's an example of rule file 50-video.rules which I created to set special mount points for video devices.

KERNEL=="video*", SYSFS{vendor}=="0x4444", SYSFS{device}=="0x0016", SYSFS{name}=="ivtv0 encoder MPEG", SYMLINK+="video/pvr150"
KERNEL=="video*", SYSFS{vendor}=="0x109e", SYSFS{device}=="0x036e", SYMLINK+="video/bttv"
KERNEL=="video*", SYSFS{vendor}=="0x046d", SYSFS{device}=="0x092e", SYMLINK+="video/webcam"

Hopefully this will give you some hints on where to look as it relates to Nokia tablets.
__________________
George Fragos
Internet Coach & Writer
Maemo Mapper HowTo
Personal Blog -- 3 Joe's Blog


N810 -- 5.2010.33-1
 
fragos's Avatar
Posts: 900 | Thanked: 273 times | Joined on Aug 2008 @ Fresno CA USA
#8
Linux uses vendor:device hex codes as in 046d:c03f for my Logitech mouse. Udev uses these to identify devices as well in /lib/udev/rules.d. Here's an example of rule file 50-video.rules which I created to set special mount points for video devices.

KERNEL=="video*", SYSFS{vendor}=="0x4444", SYSFS{device}=="0x0016", SYSFS{name}=="ivtv0 encoder MPEG", SYMLINK+="video/pvr150"
KERNEL=="video*", SYSFS{vendor}=="0x109e", SYSFS{device}=="0x036e", SYMLINK+="video/bttv"
KERNEL=="video*", SYSFS{vendor}=="0x046d", SYSFS{device}=="0x092e", SYMLINK+="video/webcam"

Hopefully this will give you some hints on where to look as it relates to Nokia tablets. Note that will identify the device as in vendor and model and isn't like a mac address which identifies a port on the network.
__________________
George Fragos
Internet Coach & Writer
Maemo Mapper HowTo
Personal Blog -- 3 Joe's Blog


N810 -- 5.2010.33-1
 
daperl's Avatar
Posts: 2,427 | Thanked: 2,986 times | Joined on Dec 2007
#9
Originally Posted by fragos View Post
Linux uses vendor:device hex codes as in 046d:c03f for my Logitech mouse. Udev uses these to identify devices as well in /lib/udev/rules.d. Here's an example of rule file 50-video.rules which I created to set special mount points for video devices.

KERNEL=="video*", SYSFS{vendor}=="0x4444", SYSFS{device}=="0x0016", SYSFS{name}=="ivtv0 encoder MPEG", SYMLINK+="video/pvr150"
KERNEL=="video*", SYSFS{vendor}=="0x109e", SYSFS{device}=="0x036e", SYMLINK+="video/bttv"
KERNEL=="video*", SYSFS{vendor}=="0x046d", SYSFS{device}=="0x092e", SYMLINK+="video/webcam"

Hopefully this will give you some hints on where to look as it relates to Nokia tablets. Note that will identify the device as in vendor and model and isn't like a mac address which identifies a port on the network.
I think the vendor/device code is only suppose to be unique per product, not per physical instantiation of a product. For instance, when plugged into a PC, all n800's should export the same USB vendor/device ID, but every n800 should have its own unique default wlan MAC address.
__________________
N9: Go white or go home
 

The Following User Says Thank You to daperl For This Useful Post:
Posts: 119 | Thanked: 110 times | Joined on Sep 2009 @ Prague
#10
Originally Posted by Kieron View Post
Could one not install something like macchanger to spoof or get mac? I've used such a thing on Ubuntu a few years back when messing with WEP cracking.
even simpler -

ip link set wlan0 address 11:22:33:44:55:66

...but one has to have ip tools installed, which I didn't find last time I tried n900 with RDA... :-/ and the device driver has to support this functionality, of course
 
Reply

Tags
maemo 5, n900, python, unique id


 
Forum Jump


All times are GMT. The time now is 06:59.