...
The AclCommissioning application demonstrates that network commissioning (setting network ID and join key) can be done automatically using the manager and mote APIs. The program flow is as follows:
- It prompts the user for the manager API COM port, connects to the manager, and sets the manager network ID
- It prompts the user for the mote API COM port, connects to the mote, retrieves its MAC address, randomly generates a join key and sets it on the mote.
- It then adds the mote's MAC and join key to the manager's ACL, then prompts the user to attach the next mote, etc.
The network ID can be changed by modifying the Python source.
...
Code Block |
---|
ACL Commissioning (c) Dust Networks SmartMesh SDK 1.0.5.138 ==== Connect to serialmanager Serial port of SmartMesh IP Manager (e.g. COM11COM15): COM11 ok. connectedConnected to manager at COM11COM15. ==== Connect mote Setting1 theto networkyour IDcomputer on Manager(or Ctrl+C to quit) --> 2560 Tuple_dn_setNetworkConfig(RC=0) serialSerial port of SmartMesh IP Mote (e.g. COM15COM19): COM15 ok. connectedConnected to mote at COM15COM19. ==== Retrieving the Mote MAC address Mote MAC is --> [0 ,17 ,d ,0 ,0 ,38 ,33 ,59] ==== Setting the network ID on Mote to --> 2560 Tuple_dn_setParameter_networkId(RC=0) ==== Programming the Mote join key as follows --> [131, 98, 192, 58, 207, 246, 155, 101, 95, 119, 124, 154, 241, 108, 161, 218] Tuple_dn_setParameter_joinKey(RC=0) Random join key: b1-66-ec-9a-4f-d2-4a-8e-d2-f0-9b-2a-1b-da-ba-6d mote's MAC address: 00-17-0d-00-00-38-06-d6 Writing joinKey in mote... done. Configuring joinKey in manager... done. Disconnecting from mote... done. ==== Connect mote 2 to your computer (or Ctrl+C to quit) Serial port of SmartMesh IP Mote (e.g. COM19): ==== Programmingdisconnect thefrom Managermanager ACLdone. with thisScript Moteended information Tuple_dn_setACLEntry(RC=0) Remove the mote, connect the next one and hit any key. <Ctrl>+C to quit ..normally Press Enter to close. |