-
Notifications
You must be signed in to change notification settings - Fork 191
actisense serial
The actisense-serial program is the interface program to exactly one Actisense NGT-1 USB or serial.
The usage is as follows:
Usage: rel/darwin-arm64/actisense-serial [-w] -[-p] [-r] [-v] [-d] [-s <n>] [-t <n>] device
Options:
-w writeonly mode, no data is read from device
-r readonly mode, no data is sent to device
-p passthru mode, data on stdin is sent to stdout but not to device
-v verbose
-d debug
-s <n> set baudrate to 38400, 57600, 115200, 230400
-t <n> timeout, if no message is received after <n> seconds the program quits
-o output commands sent to stdin to the stdout
<device> can be a serial device, a normal file containing a raw log,
or the address of a TCP server in the format tcp://<host>[:<port>]
Examples: rel/darwin-arm64/actisense-serial /dev/ttyUSB0
rel/darwin-arm64/actisense-serial tcp://192.168.1.1:10001
If you have only a single NGT-1 on /dev/ttyUSB0
the normal use mode is:
actisense-serial -r /dev/ttyUSB0
If you use a NGT-1 with firmware 2.500 or higher, or a NGT-1 that has been programmed to use a baudrate of 230400, use:
actisense-serial -s 230400 -r /dev/ttyUSB0
It can be used in a pipeline in case you have multiple NGT-1s. For example if you have data on Actisense #1 (example devicename /dev/ttyS1) that you want to send out to Actisense #2 (device /dev/ttyS2) and want to analyze the PGNs on both networks you'd use the following:
actisense-serial -r /dev/ttyS1 | actisense-serial /dev/ttyS2 | analyzer
There is no program yet to set the PGN list that a NGT-1 writes out onto the bus. You need to do this using the Actisense NMEA Reader program. If you fail to do this only a very limited list of PGNs (and no useful ones) are sent out.
If you do not get any output from actisense-serial or only error messages like these:
ERROR 2018-04-07T08:42:41.266Z [actisense-serial] DLE followed by unexpected char 21, ignore message
you are using the wrong baudrate. Use the -s
switch to use the correct one. The default baudrate is 115200 but newer firmware uses 230400.
On Linux you can use the standard FTDI serial driver. It used to be a bit difficult to enable this driver for a device that uses a USB device PID that the driver did not know about.
The best way with a new kernel is to add new device ID after the module is loaded. This allows the driver to function for multiple FTDI device IDs, so it will also work if you have other FTDI devices in the system.
# - Detect any Actisense device. This adds a new USB ID to the FTDI driver, so is always safe.
# The driver will autoenumerate the bus after this and report the new device (see dmesg)
modprobe ftdi_sio
echo 0403 d9aa > /sys/bus/usb-serial/drivers/ftdi_sio/new_id
A less flexible way to tell the driver about the Actisense device ID is to load it at module load. This might make the driver not function for other devices:
sudo echo 'ftdi_sio vendor=0x0403 product=0xd9aa' >>/etc/modules
and after reboot it shows up:
You can get persistent naming for the NGT-1 USB device with the following udev rule:
pi@raspberrypi:~$ cat /etc/udev/rules.d/99-my-usb-device.rules
SUBSYSTEM=="tty", ACTION=="add", ENV{ID_SERIAL}=="Actisense_NGT-1_1FD34", NAME="actisense"
The serial number above is unique, so you can find out information about your device to base the udev rule on with
udevadm info -q all -n /dev/ttyUSB0