Cruisers Forum
 


Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 24-05-2012, 06: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, 09:46   #2
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
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, 09: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, 10:32   #4
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
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 ->http://http://www.cruisersforum.com/forums/f134/usb-ports-and-sleep-71941.html#post822189.

Just pointing .....

Thomas
cagney is offline   Reply With Quote
Old 25-05-2012, 11: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, 12:51   #6
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,145
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 Search this Thread
Search this Thread:

Advanced Search
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


Advertise Here


All times are GMT -7. The time now is 01:58.


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

ShowCase vBulletin Plugins by Drive Thru Online, Inc.