I am writing a python program from scratch to capture and transmit GPS data from the NMEA port. Each update I send to my server needs to have a unique ID associated with the device it came from. The source IP address can not be used for this purpose.
Typically items such as an ESN, or IMIE, or Manufacture Device ID are used for this purpose.
I’m not seeing anywhere that I can use Python to get at some piece of information to uniquely identify the device.
It would seem that the module digihw should serve this purpose.
Hi, IMEI and Gateway Device ID are the unique hardware ID of the gateway. Another authentication can be given in the python code running on the gateway and talks to iDigi and encrypt the data to be sent, and another python code running on the PC decrypt the received data in the sci string format.
Thanks for the reply. Perhaps my questions isn’t clear. I’m looking for a python call that will return some sort of unique identifer for the X3 or X5. This isn’t about encryption or iDigi at all.
Imagine a GPS packet that looks like this:
>DeviceID,Lat,Lon,Alt,Speed<
Without a DeviceID, I have no waying of knowing which device this particual message came from.
I know I can “set” a DeviceID in my code by parsing an external parameters file. But what I’d really like is a way to query the hardware and have it return a unique ID that I can count on. Something like:
import digihw
deviceid = digihw.get_deviceid()
Basically, I’m looking to query the serial number of the device (or something similar) and append all messages with that ID.
The socket.read() and socket.write() functions may offer what you are looking for. Another option would be to use the zigbee.ddo_get_param(None,‘SH’) or zigbee.ddo_get_param(None,“SL”) commands.