Secure your node

To secure your nodes you have to upload to your Arduino board or bare ATmega microcontroller the SecurityPersonalizer.ino sketch that comes pre-installed with the MySensors library in the Arduino IDE.

You have to modify the following lines in the sketch, inserting your personal keys:

  • #define MY_HMAC_KEY
  • #define MY_AES_KEY
  • #define MY_SOFT_SERIAL

Uncomment the line 119:

  • #define PERSONALIZE_SOFT_RANDOM_SERIAL

and then upload the modified sketch to your Arduino board or bare ATmega microcontroller.
In the serial monitor of the Arduino IDE, if nothing is go wrong, you should see a success message.

Now your node is able to communicate with the gateway in a secure way. Save your modified SecurityPersonalizer.ino sketch to easily secure other nodes

If you wont to delete the keys from the eeprom of your board, run the ClearEepromConfig.ino sketch that comes pre-installed with the MySensors library in the Arduino IDE.

If you are using Platformio, you can download the pre-built MySensors-Clear-EEPROM and the d-diot-personalize-node projects from the d-diot account on github.

Follow the firmware upload guide to know how to flash your Arduino board with PlatformIO CLI, directly from your d-diot hub.

  • how_to/mysensors/sign_your_node.txt
  • Last modified: 2019/09/11 18:32
  • by franzunix