counts the anchor chain pulses via "inputs DSR" and CTS of an RS232 device (e.g. USB-to-RS232-device)
The plugin reads pulses from a reed relais on the anchor winch. Addtionally it need the Up (and Down) information of the anchor windlass relais.
It is widely based on the
- seatalk remote plugin (https://github.com/wellenvogel/avnav-seatalk-remote-plugin),
- more nmea plugin (https://github.com/kdschmidt1/avnav-more-nmea-plugin).
- device: e.g. '/dev/ttyUSB0'
- usbid: as alternative for devive name
- circumference: circumference of anchor winch
- debuglevel: debug level
It is recommended to use optocoupler between board voltage level and RS232.
An example for such an circuit is suggested here: https://pysselilivet.blogspot.com/2020/06/seatalk1-to-nmea-0183-converter-diy.html
First tests are made with th module BUCCK_817_4_V1.0.
The reed relais is a brought one:
To install this plugin please
- create directory '/usr/lib/avnav/plugins/avnav-anchor-chain-counter-rs232' and
- copy the file plugin.py to this directory.
- only tested with linux
Setup the serial devices by their serial numbers
- Label your first USB serial device (e.g SeatalkOut)
- Connect the first USB serial device to the PC
- Get the vendorID, deviceID and serial number of the tty device (here "/dev/ttyUSB0") udevadm info -a -n /dev/ttyUSB0 | grep {idVendor} | head -n1 => ATTRS{idVendor}=="0403" udevadm info -a -n /dev/ttyUSB0 | grep {bcdDevice} | head -n1 => ATTRS{bcdDevice}=="0600" udevadm info -a -n /dev/ttyUSB0 | grep {serial} | head -n1 => ATTRS{serial}=="A10KKBM3"
- creates an udev rule mcedit sudo mcedit /etc/udev/rules.d/10-local.rules SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A10KKBM3", MODE="0666", SYMLINK+="ttyUSB_SeatalkOut"
- Continue with the next devices
- at the end the file /etc/udev/rules.d/10-local.rules may look like that SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A10KKF9V", MODE="0666", SYMLINK+="ttyUSB_SeatalkInp" SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A10KKBM3", MODE="0666", SYMLINK+="ttyUSB_SeatalkOut"
- Use this names in avnav (e.g: "/dev/ttyUSB_SeatalkInp")