Author Topic: Raspberry Pi Basics  (Read 9232 times)

Cayenne

  • New User
  • *
  • Posts: 6
    • View Profile
Raspberry Pi Basics
« on: 21 August, 2014, 03:19:26 am »
Forgive a few questions from a n00b.  I am new both at Pi and at AISDispatcher.

I have wgotten the latest version of the program and untarred it.  From the directory in which it sits, I run the command:

./aisdispatcher -t -h 10.0.0.17  -p xxxx -H 5.9.207.224:yyyy,data.aishub.net:zzzz -x10 -y60

Where xxxx, yyyy, and zzzz are the relevant ports.  I am getting the ais data through a local ser to eth converter, and the whole thing works fine on Windoze.

Now, when I run the command above, there's no return to a prompt, just a blank line unless I control-C.

Is that how it's supposed to run, it seems wrong?  How can I check locally whether it's working?

Thanks


Cayenne

  • New User
  • *
  • Posts: 6
    • View Profile
Re: Raspberry Pi Basics
« Reply #1 on: 22 August, 2014, 06:25:09 pm »
Okay, answering the first of my own questions, adding an ampersand (&) after the command runs it in background, so that you get a return of the cursor.

Thus ./aisdispatcher -t -h 10.0.0.17  -p xxxx -H 5.9.207.224:yyyy,data.aishub.net:zzzz -x10 -y60 &

It's said that this should be done in the startup script, too.

Still no convenient way to check output locally.

vetobus

  • New User
  • *
  • Posts: 5
    • View Profile
Re: Raspberry Pi Basics
« Reply #2 on: 26 August, 2014, 09:26:10 pm »
i copied this from my reply in another thread....


to verify that packets where sent to marinetraffic i added tcpdump to my raspbian (http://www.ronnutter.com/raspberry-pi-intro-to-tcpdump/).

sudo tcpdump -i wlan0 -s1500 -n host 5.9.207.224 -X

seabonk

  • Seaman
  • *
  • Posts: 3
    • View Profile
Re: Raspberry Pi Basics
« Reply #3 on: 19 November, 2014, 06:29:58 pm »
Hi,
I’d like to run aisdispatcher on my raspberry pi, running latest raspian, kernel 3.12.

Aisdispatcher works perfectly on windows in the same environment, but on raspberry it does not seem to work.

The uLibC version does not start at all, the glibc version starts, but does not do much either..

pi@nanaberry ~/aisdispatcher $ uname  -a

Linux nanaberry 3.12.28+ #709 PREEMPT Mon Sep 8 15:28:00 BST 2014 armv6l GNU/Linux
pi@nanaberry ~/aisdispatcher $ ./aisdispatcher_arm_uClibc/aisdispatcher
-bash: ./aisdispatcher_arm_uClibc/aisdispatcher: No such file or directory
pi@nanaberry ~/aisdispatcher $ ls -al ./aisdispatcher_arm_uClibc/aisdispatcher
-rwxr-xr-x 1 pi pi 960203 Aug 16  2012 ./aisdispatcher_arm_uClibc/aisdispatcher
pi@nanaberry ~/aisdispatcher $ sudo !$
sudo ./aisdispatcher_arm_uClibc/aisdispatcher
sudo: unable to execute ./aisdispatcher_arm_uClibc/aisdispatcher: No such file or directory
pi@nanaberry ~/aisdispatcher $ file !$
file ./aisdispatcher_arm_uClibc/aisdispatcher
./aisdispatcher_arm_uClibc/aisdispatcher: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), stripped

hmm, trying glibc version:
pi@nanaberry ~/aisdispatcher $ sudo ../aisdispatcher/aisdispatcher_arm_glibc/aisdispatcher -u -h 0.0.0.0 -p 10021 -H 5.9.207.224:XXXX -G -g -v
Start in UDP mode

Hmmm…  despite massive AIS noise on udp port 10021 (Furuno) and debug (-G) and nmea dump (-g) activated, aisdispatcher keeps entirely silent except some irregular CRC Error messages.

When checking with netstat or tcpdump I cannot find any traffic being forwarded to marinetraffic.

Any idea whats going wrong here ?

Regards,
seabonk.

seabonk

  • Seaman
  • *
  • Posts: 3
    • View Profile
Re: Raspberry Pi Basics
« Reply #4 on: 20 November, 2014, 03:44:57 pm »
Hi,

when trying other UDP ports with aisdispatcher (GPS or B&G), i at get

Start in UDP mode
CRC failed 16,58,189,31,18,39,060,39,19,48,310,39*73
non VDM OK $GPGSV,4,3,14,21,21,058,35,22,59,117,35,27,73,356,35,33,40,207,00*7B
non VDM OK $GPGSV,4,4,14,39,38,146,00,40,19,116,00,,,,,,,,*74
non VDM OK $GPGSA,A,3,04,16,18,19,21,22,27,,,,,,2.4,1.3,1.9*3A

at least some more verbose output.

checking with tcpdump I notice a difference between the udp packets on the GPS or B&G ports and the AIS packets from furuno:

Furuno FA50 AIS (sending to port 10021):
09:48:37.875731 IP 192.168.0.203.10021 > 192.168.0.255.10021: UDP, length 949

Furuno GPS via Moxa (sending to port 10061)
09:48:37.700076 IP 192.168.0.211.4002 > nanaberry.fritz.box.10061: UDP, length 1024

(nanaberry being the local ip of the raspberry)

hmmm...  no idea if this makes a difference, especially since I start aisdispatch with -h 0.0.0.0,  but aisdispatcher on windows in the same environment has no problem receiving and forwarding the same data.

when using "strace" it seems that aisdispatcher is continuously receiving data on port 10021, but _never_ writes the data somewhere...

recvfrom(3, "\1\374\0\1\0\0\0\0!AIVDM,1,1,,B,1CEd3RW00L"..., 16384, 0, {sa_family=AF_INET, sin_port=htons(10021), sin_addr=inet_addr("192.168.0.203")}, [16]) = 996
nanosleep({0, 100000}, NULL)            = 0
select(4, [3], [], [3], {1, 0})         = 1 (in [3], left {0, 202826})
recvfrom(3, "\1\375\0\1\0\0\0\0!AIVDM,1,1,,B,1D``eO0P28"..., 16384, 0, {sa_family=AF_INET, sin_port=htons(10021), sin_addr=inet_addr("192.168.0.203")}, [16]) = 980
nanosleep({0, 100000}, NULL)            = 0
select(4, [3], [], [3], {1, 0})         = 1 (in [3], left {0, 803716})
recvfrom(3, "\1\376\0\1\0\0\0\0!AIVDM,1,1,,A,14Sh7`?vh1"..., 16384, 0, {sa_family=AF_INET, sin_port=htons(10021), sin_addr=inet_addr("192.168.0.203")}, [16]) = 106
nanosleep({0, 100000}, NULL)            = 0


in the strace output i notice several open() failures on numerous shared libs, but obviously no sympbol seems missing.

open("/lib/arm-linux-gnueabihf/tls/v6l/vfp/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/tls/v6l/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/tls/vfp/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/tls/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/v6l/vfp/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/v6l/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/vfp/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/arm-linux-gnueabihf/tls/v6l/vfp/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/arm-linux-gnueabihf/tls/v6l/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/arm-linux-gnueabihf/tls/vfp/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/arm-linux-gnueabihf/tls/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/arm-linux-gnueabihf/v6l/vfp/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/arm-linux-gnueabihf/v6l/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/arm-linux-gnueabihf/vfp/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/arm-linux-gnueabihf/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/tls/v6l/vfp/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/tls/v6l/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/tls/vfp/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/tls/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/v6l/vfp/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/v6l/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/vfp/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/libnss_db.so.2", O_RDONLY)   = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/v6l/vfp/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/v6l/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/vfp/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/v6l/vfp/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/v6l/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/vfp/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)


so whats going wrong? why is aisdispatcher not forwarding any data to marinetraffic or aishub ?

regards,
seabonk.

seabonk

  • Seaman
  • *
  • Posts: 3
    • View Profile
Re: Raspberry Pi Basics
« Reply #5 on: 21 November, 2014, 12:35:04 am »
sigh...

i now wrote a tiny programm, that reads from udp port 10021, removes leading zeros and other trash from the input and writes the proper string to stdout. this output is  piped to aisdispatcher -i....  and

Voila  ... it works, but it rather feels like a workaround than a solution.

can someone please explain why aisdispatcher works fine on windows with the same input, but fails on linux ? (ideally fix it) ?

thanks in advance,
seabonk

c3mtl

  • New user
  • Posts: 1
    • View Profile
Re: Raspberry Pi Basics
« Reply #6 on: 13 February, 2015, 07:46:01 am »
Any updates on this? I would love to get AIS Dispatcher working on my RPI. Right now, it just seems to hang trying to feed data.
Scott.

Bolk

  • New User
  • *
  • Posts: 8
    • View Profile
Re: Raspberry Pi Basics
« Reply #7 on: 09 June, 2015, 11:23:37 am »

i would recomend also to add:  -D 0 after the -y60
because i had some promblems that my SD card got corrupted with errors after a while of using and after adding the -D 0 it went over.

./aisdispatcher -t -h 10.0.0.17  -p xxxx -H 5.9.207.224:yyyy,data.aishub.net:zzzz -x10 -y60 &

Cayenne

  • New User
  • *
  • Posts: 6
    • View Profile
Re: Raspberry Pi Basics
« Reply #8 on: 03 July, 2015, 08:31:21 am »
Here is the script that has run for a year.

#!/bin/bash
echo "Hello $USER."
echo "Today is $(date)"
echo "Current working directory : $(pwd)"
while :
  do
    if pgrep [a]isdispatcher
      then
     
       sleep 29
    else
      echo "AisDispatcher not running ... starting"
      /home/pi/aisdispatcher_arm_glibc/aisdispatcher  -r -d /dev/ttyUSB0 -s38400 -H 5.9.207.224:XXXX,data.aishub.net: XXXX&
 
   
    fi
  sleep 1
done


« Last Edit: 05 November, 2015, 04:27:52 pm by Cayenne »