Is it safe to use the MAC address as the serial number of a microcontroller in embedded systems? Is it a security threat or can it be duplicated perhaps? (Usually through software from what I read).
MAC Addresses are generated randomly by the manufacturer but as far as I understood there is a slight chance (0.000001% perhaps) that the MAC Address will be duplicate. i.e. it is not entirely unique.
Related
I've got a windows 7 machine with numerous physical serial ports going into it and I would like the information coming into the machine to be read by multiple pieces of software at the same time. My first idea was a physical serial port splitter, however, this isn't viable as it may not have enough power to be split even once let alone multiple times.
So the next idea is to open a physical serial port on the computer and read everything coming through and then send that data to one or more virtual serial ports and then those virtual serial ports can be opened by individual pieces of software. After some research, I found a few pretty basic solutions which got my hopes up but they require "pty" which upon further research and a few "ModuleNotFound" errors I discovered this is for Mac Os only.
Is there any pty equivalent for windows or really anything that will make this possible? And if not is there something that is viable on Java or C++?
I am developing a cross-platform User Interface with Qt, and I need to communicate through a serial port.
I am able to use the serial port on Windows and Linux by using the following port names:
COM1, COM2, and so on, on Windows;
ttyACM0, ttyS0, ttyS1, etc, on Linux.
Now I want to do the same on Mac OS X. Do you know which are the possible port names on Mac OS X?
Thanks in advance!
They could be pretty much anything. They'll probably be /dev/tty.SOMETHING, but there's no guarantee of that. For example, my USB->serial dongle is: /dev/tty.usbserial-FTG6RCEJ. The last bit of gibberish there is a serial number or something, I think.
Shouldn't you be asking the user for which port to use, anyway?
To use the programmer in Mac OS X, you will need to determine which names have been assigned to its serial ports.
To do this, open a Terminal window, type ls /dev/tty.usb*, and press enter. You should see two entries of the form tty.usbmodem<number> (e.g. /dev/tty.usbmodem00022331). These entries represent virtual serial ports created by the programmer.
The entry with the lower number is your programmer’s Programming Port, and later you will need to pass its name as a parameter to AVRDUDE. The entry with the higher number (which should be two plus the lower number) is the TTL Serial Port, and you can use a terminal program such as screen to send and receive bytes from it.
If you have other USB devices plugged in, you might see additional serial ports for those devices.
Using an Arduino, one of mine is:
/dev/tty.usbmodemfa131
The last 5 characters are different for each port.
The name of the serial port in OS X is dependant on the driver. It might be something like /dev/tty.USBSERIAL/ and it might be /dev/tty.PL2303-xxx
You might wish to have the user create a symlink such as /dev/tty.MY_APP_USB that points to their specific serial port.
many USB->miniUSB cables no has all pins plugged, only Vcc and GND. Them, cables may be the problem
I am working on a project that involves the auto-detection of USB and firewire devices being plugged and unplugged from an OS X system. For a given device, the system needs to recognise a device when it is plugged in (no matter which port) and load a device-specific bundle to deal with it.
The key to making this work is obviously the unique identification of each device. I know that USB devices are identified by a combination of the vendor ID and product ID fields, but this does not provide a unique ID, only the "kind" of device. If I have two devices the same and I plug both of them in to the computer, I would like some way to distinguish them. Is there a general and reliable way to do this, perhaps using other fields in the USB descriptor?
A related question, how does this work for USB serial ports? Suppose I plug in two USB serial ports of the same make/model. OS X should give them unique inodes in the /dev tree. However, suppose it calls them /dev/usbserial1 and /dev/usbserial2. If I then unplug the ports and plug in only one one of them, will that port be given the same name as it previously had, or will it just get /dev/usbserial1 (since it is the only) port plugged in?
Same question for firewire devices, although I think firewire devices are supposed to have a 64-bit GUID. In this case I am looking for someone to verify that using the GUID for firewire device identification would be reliable. In other words, if I plugged in two separate cameras of the same make and model, would I expect them to have different GUIDs?
I know I could test some of these with the appropriate hardware, but I don't have multiple bits of hardware at this time, so I am hoping someone may know at least some of the answers to the above questions.
With luck, your USB devices should have unique serial numbers, in addition to the VID/PID combination. If you're enumerating IOUSBDevice objects, look at the USB Serial Number property.
On Windows, Microsoft remembers device-specific settings by:
the device's serial number (the iSerialNumber field in the USB device descriptor), if available
or otherwise, by the "path" to the device: its bus (i.e. what hub it's plugged into etc.) + USB VID and PID
Without serial numbers, USB devices are virtually indistinguishable. You could tell apart different USB disk drives, but for devices which have no non-volatile memory of any kind (and many USB devices fall into this category), they are just indistinguishable, so you just have to make the best effort to do what the user expects.
In order to recognize a computer in a certain manner (MAC adress not appropriate for some cases, disk ID or hostname neither etc.), I would like to detect a CPU id (or first CPU core id)... How can I achieve this on different platforms? (not necessarily in manner that is robust to OS change on the same computer)
Thanks
The CPU id identifies the processor model, and isn't unique to each computer. See: http://en.wikipedia.org/wiki/CPUID
The MAC address is usually the best way to uniquely identify a system.
My understanding is that on Windows systems in XP, Vista, and Win7, and on the server products based on the same kernels, the UuidCreateSequential() Win32 API call makes use of one of the MAC addresses on the system to generate the UUID, and places that value at the tail end of the generated GUID.
My question is, given that the configuration set of network devices does not change, does UuidCreateSequential always choose the same MAC address each time?
You cannot rely on the same MAC address being used. From the RFC:
4.1.6. Node
For UUID version 1, the node field
consists of an IEEE 802 MAC
address, usually the host address.
For systems with multiple IEEE 802
addresses, any available one can be
used.