Try to recover device id.
Merged serial_number branch.