Author Topic: AIS Dispatcher hangs after a while (glibc version). latest  (Read 7594 times)

vetobus

  • New User
  • *
  • Posts: 5
    • View Profile
AIS Dispatcher hangs after a while (glibc version). latest
« on: 27 August, 2014, 08:37:58 am »
The aisdispatcher software hangs after several hours (between 5-40).
i can see that my AIS box is still sending to the usb port (sudo od -x /dev/ttyUSB0)

pi@raspberrypi:~$ sudo od -X /dev/ttyUSB0
0000000 56494121 312c4d44 2c2c312c 33332c42
0000020 6c444275 52687150 41304451 42775154
0000040 53335461 3130306a 302c4032 0d39302a
0000060 4941210a 2c4d4456 2c312c31 312c412c
0000100 313e7533 30303f44 71423130 75515441
0000120 3e646063 3030483a 2c625230 44302a30
0000140 41210a0d 4d445649 312c312c 2c412c2c
0000160 773f3333 4f304461 43517169 513c3155


This is my startup parameters.

pi@raspberrypi:~$ less /etc/rc.local
#!/bin/sh -e
# start my AIS Dispatcher program.
/home/pi/AIS2/aisdispatcher_arm_glibc/aisdispatcher -r -d /dev/ttyUSB0 -s38400 -H 5.9.207.224:5855 -D4 &


The problems is that when i start the software it consumes around 0,3% CPU... when it is in "hang" state it uses 98% (stable until reboot).


Here is an output of TOP

Tasks:  68 total,   2 running,  66 sleeping,   0 stopped,   0 zombie
%Cpu(s): 99.3 us,  0.7 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem:    447996 total,   165544 used,   282452 free,    14900 buffers
KiB Swap:   102396 total,        0 used,   102396 free,   122684 cached

  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND                                                                                                                                     
 2385 root      20   0 11420 1152  980 R  98.9  0.3 497:55.82 aisdispatcher                                                                                                                               
 5994 pi        20   0  4672 1408 1040 R   1.0  0.3   0:00.24 top


any ideas?
// vetobus

lucienve

  • Ensign
  • **
  • Posts: 10
    • View Profile
Re: AIS Dispatcher hangs after a while (glibc version). latest
« Reply #1 on: 06 October, 2014, 10:09:18 pm »
I had this problem as well; it appears that there is broadcast 'noise' for periods of time in my area, which causes a long string of invalid characters to be output by my AIS receiver - and ais_dispatcher doesn't seem to recover and keep trying to read until it gets the start of a next valid sentence.

As a truly brute-force workaround, I wrapped it in a quick python script to restart it every 2 minutes - it starts quickly enough only a second or two of data is lost in the cases where it isn't wedged.  With more time, I'd like to get to a more intelligence setup where aisdispatcher sends packets back to the monitoring script as well, and the script restarts if it hasn't seen any packets for a specific period of time.

In any case, here's my quick and dirty version that I use on my raspberry pi, called from rc.local

#!/usr/bin/python

import subprocess
import time

while True:
  p = subprocess.Popen([
    '/usr/bin/aisdispatcher', '-v', '-r', '-d', '/dev/ttyUSB0', '-s', '38400',
    '-H', '50.19.213.120:6186'])
  time.sleep(120)
  p.terminate()
  p.wait()


vetobus

  • New User
  • *
  • Posts: 5
    • View Profile
Re: AIS Dispatcher hangs after a while (glibc version). latest
« Reply #2 on: 08 November, 2014, 01:58:41 pm »
Thanks for that... i will try later...

// TAB

joko1

  • New user
  • Posts: 1
    • View Profile
Re: AIS Dispatcher hangs after a while (glibc version). latest
« Reply #3 on: 06 March, 2015, 12:40:11 am »
I had the same problem which I also solved with a workaround using a nice little piece of Software called PTFB Pro - enabled me to stop and start the programme on a schedule as required.
The same software has a lot of other handy features.
http://www.ptfbpro.com/
Free 30 day trail to see if it works for you.

ecm56

  • Seaman
  • *
  • Posts: 3
    • View Profile
Re: AIS Dispatcher hangs after a while (glibc version). latest
« Reply #4 on: 31 March, 2015, 05:43:09 pm »
I have just started experimenting with Raspberry Pi . . . Is it possible that this is a problem with the USB port?  I am reading of problems that sound similar to yours.  I am in the process of adding a 9 pin serial port to my Pi via the GPIO to see if that is more stable than the USB ports.  I will report when I have some results.

Bolk

  • New User
  • *
  • Posts: 8
    • View Profile
Re: AIS Dispatcher hangs after a while (glibc version). latest
« Reply #5 on: 09 June, 2015, 11:18:25 am »
I have implemented for the company i work for some RPI's with an ais lan version and atleast at one company i placed an antenna it is still running sincs june 2014 or so, so almost one year now.
without breaking down.
because a few times the sd card broke down due to some functions i used in the rpi service, and after removing them on a new sd card, it is still running.
I am just using a little script on the pi that automaticaly starts dispatching the data and sending it to aishub.net.

Nieuw-Hoorn

  • New user
  • Posts: 1
    • View Profile
Re: AIS Dispatcher hangs after a while (glibc version). latest
« Reply #6 on: 22 August, 2015, 10:29:07 am »
We hoped that the issue would be solved with the update HOWEVER: no improvement  >:(

The software problem is carried over to AisDispatcher 1.5

We are open to share our data with AisDispacher when they improve their act.

Currently we stopped sending data to AisDispacher because of this error and send our data to MarineTraffic.

michalina.krop

  • New user
  • Posts: 1
    • View Profile
    • bi┼╝uteria srebrna
Re: AIS Dispatcher hangs after a while (glibc version). latest
« Reply #7 on: 31 August, 2015, 01:54:17 pm »
I tried and everything is OK

thx a lot

killer3dfx

  • New user
  • Posts: 1
    • View Profile
Re: AIS Dispatcher hangs after a while (glibc version). latest
« Reply #8 on: 10 April, 2017, 07:23:04 pm »
Hello, I have the same problem, the software hung after some minutes, hours of use, i wrote a batch script that runs every minute to check the AisDispatatcher webserver, and if it is hung, kill the app and restart it. it is necessary to set auto connect feature in the software.

goelectric

  • New User
  • *
  • Posts: 5
    • View Profile
Re: AIS Dispatcher hangs after a while (glibc version). latest
« Reply #9 on: 13 April, 2017, 08:29:53 pm »
Has anyone tried the alternative ais forwarding app kplex http://www.stripydog.com/kplex/? It is opensource on github. How stable is it?