-
Notifications
You must be signed in to change notification settings - Fork 5
SDM : SDMShell Example
Where to download and how to compile sdmsh go to link sdmsh:Compile and Run.
Go to cloned sdmsh directory and run:
./sdmsh Usage: sdmsh [OPTIONS] IP/NUM [command; [command;] ...] Mandatory argument IP of EvoLogics S2C Software Defined Modem. Or NUM is 192.168.0.NUM. -f, --file=FILENAME Run commands from FILENAME. Can be apply multiply time. -e, --expression="cmd" Run commands separeted by ';'. Can be apply multiply time. -x, --ignore-errors If commands running from FILE, do not exit on error reply of SDM modem, -h, --help Display this help and exit -p, --port=PORT Set TCP PORT for connecting the SDM modem. Default is 4200 -s, --stop Send SMD STOP at start -v[[a|[=]log-level]] --verbose[[=]log-level] Set log level. Without parameter enable debug logging
sdmsh should be run at least with one parameter, so the IP should be set. So run sdmsh with IP and type stop:
./sdmsh $IP $IP>stop tx cmd STOP : 0 samples rx cmd STOP : $IP>
stop command stops running TX/RX processes and also switches S2C Modem to SDM mode. Another way to switch modem to SDM mode use command ATP:
nc $IP 9200
Check current mode using command AT?S.
AT?S Local Address: 2 Remote Address: 0 Acoustic Link Status: INITIATION LISTEN Pool Status: 0 packages, 16384 bytes free Promiscuous Mode: ON
Switch modem to SDM mode using command ATP
ATP INITIATION PHY
And check once more modem status.
AT?S Local Address: 2 Remote Address: 0 Acoustic Link Status: PHY Pool Status: 0 packages, 16384 bytes free Promiscuous Mode: ON
INITIATION PHY or Acoustic Link Status PHY means the modem is in SDM mode.
Before transmitting a custom signal, modem has to be configured. Threshold, gain, source level and optionally preamplifier gain have to be set.
To get help for config command type:
./sdmsh $IP $IP> help config config - Config SDM command. Usage: config <threshold> <gain> <source level> [<preamp_gain>]
To get information about each of this parameters go to link SDM : Protocol Description.
For our example, let us set signal threshold to 350, gain to 0 - normal gain, source level to 3 (min) and let preamplifier gain be auto mode, it means set to 0. Let us config:
./sdmsh $IP $IP>config 350 0 3 0 tx cmd CONFIG: 1 samples rx cmd REPORT: CONFIG done
Let us configure 2 modems, modem with $IP1 will transmit custom signal, modem with $IP2 - detect and record received signal.
./sdmsh $IP1 $IP1>config 350 0 3 0 tx cmd CONFIG: 1 samples rx cmd REPORT: CONFIG done
./sdmsh $IP2 $IP2>config 350 0 3 0 tx cmd CONFIG: 1 samples rx cmd REPORT: CONFIG done
Reception begins at the moment when the signal detector is triggered. To setup the detector, one must use the ref command - it defines a reference signal 1024 samples long.
Let us set a ref signal which is saved in our case in examples dir:
./sdmsh $IP2 $IP2>ref examples/1834_polychirp_re_up.dat tx cmd REF : 1024 samples rx cmd REPORT: REF done
And now we can switch the modem into the reference signal detection mode. To do that, we use the rx command, where we have to set the number of received signal samples and the filename where the received signal should be saved. In our example we will set number of received signal samples to 2048 and the signal will be saved to rx.dat file in examples dir.
./sdmsh $IP2 $IP2> rx 2048 examples/rx.dat tx cmd RX : 0 samples rx cmd RX : $IP2:rx[0]>
In response to rx command, we see rx cmd REPORT report. It means that the SDM modem is configured and ready for signal reception with the reference we defined.
To trigger the reception detector, the transmitted signal must include the reference waveform in the very beginning. It will not be added automatically. We can create such file using command cat. Let us create a signal including 1 chirp up as a reference and 1 the signal itself.
cat examples/1834_polychirp_re_up.dat examples/1834_polychirp_re_up.dat > examples/1834_polychirp_re_up_signal.dat
Use command tx and the filename, including reference waveform at the beginning following by custom signal. We will uses already created signal 1834_polychirp_re_up_signal.dat.
./sdmsh $IP1 $IP1> tx examples/1834_polychirp_re_up_signal.dat
In detection mode, preamplifier gain is controlled by AGC - automatic gain control. From the moment of signal detection till the end of signal reception, gain is fixed at the value, set by AGC at the moment of signal detection.