From Digi Developer

Jump to: navigation, search

This simple DIA example is a NTP (Network Time Protocol) connector / driver. With it, you can easily direct your ConnectPort-X to update its system time via any publicly available time server.

You should register at and then download DIA. After that, read the Getting Started guide and begin looking at the simple drivers (found under ../src/devices in the DIA source code tree). You should have a basic working knowledge of DIA (how to start / stop & use basic drivers / presentations) before proceeding.

Step 1
Download the archive. The included "yml" file is the configuration is used when starting the DIA application. It's included here for reference.

## NTP Time Server DIA Configuration File
 # The ntp_time_device device driver; creates a demonstration device
 # containing a network time server address and timezone settings.
 # Recommended update_rate for this driver is 86400 seconds (1 day).
 - name: ntp_time
   driver: devices.ntp_time_device:NTPTimeDevice
       Time_Server: ""
       Time_Zone: -6
       update_rate: 3540
 # Create a new console instance on TCP port 4146.  It can be connected
 # to by using any telnet client.
 - name: console0
   driver: presentations.console.console:Console
       type: tcp
       port: 4146

 # Create a web presentation instance.  When running on a PC this will
 # start a new web-server on a default port
 # When running on a Digi device this presentation will "extend" the
 # web-server built in to the Digi device with a new page named
 # "idigi_dia.html".  
 - name: web0
   driver: presentations.web.web:Web
       page: idigi_dia.html
       port: 8081

Step 2
Re-compile DIA to using this configuration file or incorporating the elements you require. You can do this via the command line (python ntp_time.yml) or using the Digi IDE for DIA.

Step 3
Test the "virtual" device with your browser (Gateway IP Address/idigi_dia.html) or via telnet (to port 4146 on your Gateway). You can adjust the Time Server, Time Zone and the update rate (in seconds).

Personal tools
Wiki Editing