how do I change serial number?

Posted on
  • The method getSerial(), I got a serial number is so long, I want to rewrite it with a simple number....
    Are there any methods like setSerial() to change it?

  • Altho you didn't say which device you have, but I think it returns the MAC of the device in all cases.
    Question is: what do you want to accomplish. You can use for example storage to save configuration like a shorter device name in flash. And read that in the onInit().

  • What device are you using?

    But I'm afraid not. The serial number is usually based on the underlying hardware, so cannot be changed - that's the whole point.

    If you want it smaller, use .substr(...) to take only a small fraction of it.

  • I have a STM32F4DISCOVERY board. Yes, I want to have a unique identity whick like MAC ADDRESS in the board, but I don't want to define it in code. I see process.env.SERIAL is a good position to store.

  • Thank you, your suggestion is good for me.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

how do I change serial number?

Posted by Avatar for user109783 @user109783

Actions