Before doing any configurations you should identify every device by getting their addresses using command GetDeviceAddress()
.
Once you know the addresses of all of your devices you can then start configuring them. The order in which you configure which device is generally not important.
For the later examples we will assume that we have a router and two node devices with addresses 0x01234567, 0x11111111 and 0x22222222 respectively.
Router configuration consists of:
SetRFSettings
[Optional if you want to use the default or previously saved configuration]SaveSettings
[Optional]It is important and somewhat trivial to note that when setting RF configuration frequency, datarate, modulation, frequency deviation, network ID and AES key should be the same for all routers and nodes that are in the same network.
Example:
SetRFSettings(868000000, 1000, 0x41, 15000, 11, 0, 4, 1000, [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 0x072394) ClearNodes() AddNode(0x11111111) AddNode(0x22222222) SaveSettings()
Node configuration consists of:
SetRFSettings
[Optional if you want to use the default or previously saved configuration]SetSystemSettings
SetRouter
SaveSettings
[Optional]Example:
SetRFSettings(868000000, 1000, 0x41, 15000, 11, 0, 4, 1000, [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 0x072394) SetRouter(0x01234567) SetSystemSettings(3000, 57) SaveSettings()
Connection can be tested from either side by using Ping
command.
Example:
When testing from router: Ping(0x11111111)
When testing from node: Ping(0x01234567)
If after some time you want to add an additional node (with address 0x33333333) to your existing network all you have to do is:
Example:
For node:
SetRFSettings(868000000, 1000, 0x41, 15000, 7, 0, 9, 1000, [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 0xC4) SetRouter(0x01234567) SetSystemSettings(1000, 0) SaveSettings()
For router:
AddNode(0x33333333)