So I’m gathering data, and while I can uniquely ID based on the MAC when I have an ethernet adapter, I’m moving to wireless/gateway in my next iteration with some xbee modules. Can anyone advise me on how to best have a gadgeteer device uniquely identify itself in a consistent manner?
I’ll likely have a Cerbuino Bee with an Xbee module and a sensor or two, talking to a Cerberus or Spider which will then talk to an Azure API. I need to ID the Cerbuino Bee in such a way that I can track it’s readings among a group of sensor devices.
I’ve asked an a-like question before, lots of reads but no single sofar after 17 days … a unique serial number or the possibility to write somewhere in the config area a generated guid so you can distinquish even if you have multiple boards of the same kind.
At the moment I’m tagging the board with a in the program hardcoded ID.
Hi,
You can use this code to uniquely identify each cerb family board…
#if MF_FRAMEWORK_VERSION_V4_2
using GHI.OSHW.Hardware;
#else
//this is for framework 4.3 and higher
using GHI.Processor;
#endif
//check if this is a Cerb Family board
if (DeviceInfo.GetDeviceID() == DeviceID.FEZ_CERB)
{
//create an empty byte array to hold the unique Deviceid of STM32F4
var deviceid = new byte[12];
//read the address where the unique id is burned.
#if MF_FRAMEWORK_VERSION_V4_2
GHI.OSHW.Hardware.LowLevel.AddressSpace.Read((uint)0x1FFF7A10, deviceid, 0, 12);
#else
//this is for framework 4.3 and higher
GHI.Processor.AddressSpace.Read((uint)0x1FFF7A10, deviceid, 0, 12);
#endif
}
The stm32f4 has a unique serial number integrated
You can also use my code here to generate a unique GUID or a MAC address based on a string or the above unique id in case of CERB board https://www.ghielectronics.com/community/codeshare/entry/822
Cheers,
Jay
@ Jay Jay - Cool, so your code will generate a unique MAC for the device, that is consistent with every startup? That sounds better since it won’t depend on the mainboard type!
If it’s a Cerb family board, the mac will be unique for each board because the seed is the unique serial number burnt in each smt32f4 chip. As for other boards like spider and raptors, you can skip them since they all come with a unique MAC from the manufacturer (ghi) or you can use a simple unique hardcore string per board.
It kind of strikes me with surprise these pieces of mem are filled with 0xFF and not with real numbers. I’ve not seen a board using these, pretty obvious places of info ??
And if MFDeploy can find it, we certainly can too. After all, it’s open source now right ?
I refer to the HalSystemInfo. part in the picture.
@ PiWi - Setting those values seems reasonably straightforward and I can even imagine a post-compile step that you could use set them by fiddling with CONFIG.hex before each MFUpdate. The trouble is, they are not exposed in managed code anywhere, so you would need special firmware or an RLP add-in to read them.
The other values near there are read in Framework\Core\Native\HW_SystemInfo.cs, so one could either expand that class or create an RLP to read the moduleSerialNumber and systemSerialNumber. It kind of baffles me as to why those were not exposed in the first place.
Anyway, no point in setting them unless you also build firmware that can read them.