-
Notifications
You must be signed in to change notification settings - Fork 0
Step by step guide for Dynamic Scheduling
TSCH Dynamic scheduling enables the Coordinator to dynamically change schedules of the network. The Coordinator needs to be connected to a machine running the python Network Manager script nm_script.py through a serial interface. The script gives a command line interface to select a particular schedule that will be sent out by the Coordinator. Since the schedule is sent as part of the Enhanced Beacon (EB), the selected schedule is applied to the network only after the subsequent EB is sent out by the Coordinator.
This step by step guide shows how to run the example application of Dynamic Scheduling.
-
Download source code for Dynamic scheduling with Contiki-NG
git clone https://gitlab.lrz.de/teaching_zoppi/hiwi-dynsched-sharada.git
-
Install required toolchain for compiling Contiki-NG using Contiki-NG documentation
-
Go to the directory containing the Dynamic Scheduling example
cd contiki-ng/os/services/dynsched/example/
-
Make sure the Zoul mote is connected to the USB port.
-
Compile and upload the example to the Zoul motes.
# For coordinator make TARGET=zoul BOARD=remote-revb NODEID=0x1 dynamic-scheduling.upload # For Nodes make TARGET=zoul BOARD=remote-revb NODEID=0x2 dynamic-scheduling.upload make TARGET=zoul BOARD=remote-revb NODEID=0x3 dynamic-scheduling.upload
-
Have the Coordinator connected to the serial port as per the Network Manager script nm_serial.py(/dev/ttyUSB0 by default)
-
Run the Network Manager script
python nm_serial.py
-
The script prints out Schedule choices, as follows (Linkopt=1 indicates that the Node gets TX opportunity)
*************************************************
Choice of Schedules
Choice 1:
Number of links: 4
Link 0: Timeslot:0 Choff:0 Linkopt:1 NodeID:1
Link 1: Timeslot:1 Choff:0 Linkopt:1 NodeID:2
Link 2: Timeslot:2 Choff:0 Linkopt:1 NodeID:3
Link 3: Timeslot:3 Choff:0 Linkopt:1 NodeID:4
Choice 2, Choice 3 and so on
-
Select your choice of schedule and hit enter.
-
The Network Manager script also logs the messages on the screen. You can monitor the logs to check that the Nodes are indeed transmitting with the updated schedule by setting
TSCH_LOG_CONF_PER_SLOT
in project-conf.h. -
If the schedule transmission to the Coordinator over serial port is unsuccessful, the same is displayed on the screen asking the user to re-enter the choice.
-
Depending on the Log Level configured in the project-conf.h file, the console might be very busy with the logs. To configure the log level of the application refer to Contiki-NG Logging System.
-
Press any key other than a number to end the python script.