Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 24-05-2012, 07:54   #1
Registered User

Join Date: May 2012
Location: Porto Santo
Posts: 3
Linux, Marine Gadgets AIS, Unreliable Restart

Hello, I installed opencpn, usibg a gps dongle and marinegadgets AIS reader using a netbook running Linux mint (Julia). The GPS is read on ttyUBSn and the AIS on ttyACMn. I have checked the ports using dmesg and entered then in the settings tabs. Once working the programme has worked for over 24 hours without problems.

However, once I close the computer or program and start up again, it has been virtually impossible to get the AIS to connect. I have verified the port, tried unplugging etc, tried root but nothing seems to work... Then after hours of frustration it seems to make the connection again and all is right. It seems to me that the port is unavailable or otherwise blocked, despite what dmesg or the opencpn log says. Any ideas? All suggestions appreciated. Thanks
__________________

__________________
jimmo5 is offline   Reply With Quote
Old 24-05-2012, 10:46   #2
Registered User

Join Date: Dec 2005
Location: WNA
Boat: Dufour 35
Posts: 3,247
Re: Linux, marine gadgets AIS, unreliable restart

Quote:
Originally Posted by jimmo5 View Post

.....

It seems to me that the port is unavailable or otherwise blocked, despite what dmesg or the opencpn log says. Any ideas? All suggestions appreciated. Thanks
Check with the command "lsof" if any processes are using the port.
Use the info to kill those. For full info "man lsof".

An example from running a gps via gpsd.
Code:
$ sudo lsof /dev/ttyUSB0
[sudo] password for thomas: 
lsof: WARNING: can't stat() fuse.gvfs-fuse-daemon file system /home/thomas/.gvfs
      Output information may be incomplete.
COMMAND   PID   USER   FD   TYPE DEVICE SIZE/OFF  NODE NAME
gpsd    25169 nobody    8u   CHR  188,0      0t0 88634 /dev/ttyUSB0
Thomas
__________________

__________________
cagney is offline   Reply With Quote
Old 25-05-2012, 10:28   #3
Registered User

Join Date: May 2012
Location: Porto Santo
Posts: 3
Re: Linux, Marine Gadgets AIS, Unreliable Restart

Thank you for the pointer. It seems that if the device is unplugged and replugged, it gets a new port name in dmesg (eg ttyACM1) but in reality open cpn is using the original port (eg ttyACM0). By assigning the port according to what dmesg has been telling me, I was actually assigning it to the wrong tty. Does that make sense? Unfortunately I cant test the AIS right now as the seas here are empty. Below is an extract from terminal (the ACM device is the marinegadgets AIS reader);

#end of dmesg response
[96132.652077] usb 2-2: new full speed USB device using uhci_hcd and address 8
[96132.846794] cdc_acm 2-2:1.0: This device cannot do calls on its own. It is not a modem.
[96132.846853] cdc_acm 2-2:1.0: ttyACM1: USB ACM device
[96333.040100] usb 2-2: USB disconnect, address 8
[96420.329062] usb 2-2: new full speed USB device using uhci_hcd and address 9
[96420.524154] cdc_acm 2-2:1.0: This device cannot do calls on its own. It is not a modem.
[96420.524213] cdc_acm 2-2:1.0: ttyACM1: USB ACM device

netbook@netbook ~ $ sudo lsof /dev/ttyACM1
lsof: WARNING: can't stat() fuse.gvfs-fuse-daemon file system /home/netbook/.gvfs
Output information may be incomplete.

netbook@netbook ~ $ sudo lsof /dev/ttyACM0
lsof: WARNING: can't stat() fuse.gvfs-fuse-daemon file system /home/netbook/.gvfs
Output information may be incomplete.
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
opencpn 10195 netbook 8w CHR 166,0 0t0 37567 /dev/ttyACM0


Is my interpretation correct? and if so whats the best way to deal with it?

Thanks so much for the help.
__________________
jimmo5 is offline   Reply With Quote
Old 25-05-2012, 11:32   #4
Registered User

Join Date: Dec 2005
Location: WNA
Boat: Dufour 35
Posts: 3,247
Re: Linux, Marine Gadgets AIS, Unreliable Restart

Yes it seems that way.
I think you need to look into the wonders of "udev rules".
Some links to earlier discussions here ->USB Ports and Sleep.

Just pointing .....

Thomas
__________________
cagney is offline   Reply With Quote
Old 25-05-2012, 12:58   #5
Registered User

Join Date: May 2012
Location: Porto Santo
Posts: 3
Re: Linux, Marine Gadgets AIS, Unreliable Restart

Thanks, I'll digest them and report back if I find a solution. Its not just a matter of trying different ports. I have just tried that (and a large cargo vessel is passing by) with no response.

By the way, is there any way to verify that ais data is being received (like you have for gps) or that the receiver is operational. It would ease testing (esp away from the water) and also avoid that a non functioning AIS is not noticed when in quiet waters.
__________________
jimmo5 is offline   Reply With Quote
Old 25-05-2012, 13:51   #6
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,016
Re: Linux, Marine Gadgets AIS, Unreliable Restart

jimmo5...
You can check the message stream in any serial terminal app, like for example minicom.

Pavel
__________________

__________________
nohal is offline   Reply With Quote
Reply

Tags
ais, linux, marine

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 15:33.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.