dsnetcmd is a Linux command-line tool which helps configure Tibbo devices over the network. It makes a UDP command connection to the command port of the EM or DS module, sends configuration commands and gets replies (all commands are described under http://docs.tibbo.com/soism/commands.htm)
dsnetcmd is provided as part of the free Tibbo VSPDL package. After installation, you can find it under /usr/local/vspd/bin/.
Usage: ./dsnetcmd [options] [cmd]
[-h|–help]: this help
[-v]: verbose (debugging messages)
[-b]: broadcast mode
[-a]: send broadcast from all interfaces (auto-discover bcast interfaces)
[-p]: prompt for user command
[-i]: interactive (read commands from stdin)
[-t<tout>]: wait for reply timeout (default:50 msec)
[–ta=<ipmask>]: IP subnet mask (default: 255.255.255.255) or specific destination address.
[–tp=<port>]: command port (default: 65535)
[cmd]: network command (for example, X)
dsnetcmd works in 3 modes:
Simple mode
Command-line mode (with prompt)
Command-line mode without prompt (batch mode)
-b - broadcast command, -a - send command from all interfaces, X - echo command for DS.
[dvorkin@dvhome bin]$ ./dsnetcmd -b -a X
<dev-reply from="10.1.1.8:65535" cmd="X">
<reply-msg>success</reply-msg>
<mac>0.2.3.4.22.216</mac>
<data-port>1001</data-port>
<device-state>usual mode</device-state>
<ip-status>fixed, set manually</ip-status>
<data-conection-status>closed</data-connection-status>
<owner-name>admin</owner-name>
<device-name>c4</device-name>
</dev-reply>
found 1 device with MAC=0.2.3.4.22.216, data_port = 1001
[dvorkin@dvhome bin]$ ./dsnetcmd -v -b -a X
setting target to 255.255.255.255:65535..
found broadcast address 127.255.255.255 in lo
found broadcast address 10.1.1.255 in eth0
found broadcast address 10.1.2.255 in eth1
sending command X to 127.255.255.255:65535...
sending command X to 10.1.1.255:65535...
sending command X to 10.1.2.255:65535...
reply A0.2.3.4.22.216/1001/N**M*/**/admin/c4 from 10.1.1.8:65535
<dev-reply from="10.1.1.8:65535" cmd="X">
<reply-msg>success</reply-msg>
<mac>0.2.3.4.22.216</mac>
<data-port>1001</data-port>
<device-state>usual mode</device-state>
<ip-status>fixed, set manually</ip-status>
<data-conection-status>closed</data-connection-status>
<owner-name>admin</owner-name>
<device-name>c4</device-name>
</dev-reply>
[dvorkin@dvhome bin]$ ./dsnetcmd -b -a U
<dev-reply from="10.1.1.8:65535" cmd="U">
<reply-msg>success</reply-msg>
<last-ip>192.168.0.2</last-ip>
<last-port>6450</last-port>
<Net-to-Serial-buffer>
<in-buffer>0</in-buffer>
<capacity>285</capacity>
</Net-to-Serial-buffer>
<Serial-to-Net-buffer>
<commited-chars>0</commited-chars>
<in-buffer>0</in-buffer>
<capacity>308</capacity>
</Serial-to-Net-buffer>
<cur-baud-rate>38400 bps</cur-baud-rate>
<Serial-port>
<state>closed</state>
<mode>full-duplex</mode>
<flow-control>RTS/CTS</flow-control>
<parity>none</parity>
<bits-per-byte>8</bits-per-byte>
</Serial-port>
<Lines>
<rts>LOW</rts>
<cts>LOW</cts>
<dtr>HIGH</dtr>
<dsr>LOW</dsr>
</Lines>
</dev-reply>
-p - prompt –ta - <current DS IP>, -i - input from stdin
[dvorkin@dvhome bin]$ ./dsnetcmd -p --ta=10.1.1.8 -i
dsnetcmd>GIP
<dev-reply from="10.1.1.8:65535" cmd="GIP">
<reply-msg>access denied</reply-msg>
</dev-reply>
// we try to get current IP - access denied - need login
dsnetcmd>Ltest
<dev-reply from="10.1.1.8:65535" cmd="Ltest">
<reply-msg>success</reply-msg>
</dev-reply>
// we are successfully logged in with password "test"
dsnetcmd>GIP
<dev-reply from="10.1.1.8:65535" cmd="GIP">
<reply-msg>success</reply-msg>
<reply-data>10.1.1.8</reply-data>
</dev-reply>
// now we can make any command on DS
dsnetcmd>SIP10.1.1.7
<dev-reply from="10.1.1.8:65535" cmd="SIP10.1.1.7">
<reply-msg>success</reply-msg>
</dev-reply>
// we changed DS IP
dsnetcmd>
<Ctrl>+<C>
// exit from dsnetcmd
[dvorkin@dvhome bin]$ echo -ne "Ltest\nGIP\n" | ./dsnetcmd --ta=10.1.1.8 -i
<dev-reply from="10.1.1.8:65535" cmd="Ltest">
<reply-msg>success</reply-msg>
</dev-reply>
<dev-reply from="10.1.1.8:65535" cmd="GIP">
<reply-msg>success</reply-msg>
<reply-data>10.1.1.7</reply-data>
</dev-reply>