mik3y / airdash

A standalone, alternative ADS-B (readsb) web frontend
MIT License
42 stars 2 forks source link

Unable to use feed from serial port (ttyS0) #11

Open yanniedog opened 3 years ago

yanniedog commented 3 years ago

Hi Mikey,

I get this error when trying to use the ttyS0 serial port for AIS data:

pi@SmoothIsland:~ $ sudo docker run --rm -i -t -p 8888:8000 -e DATA_SOURCES=ais-serial://dev/ttyS0?baud=38400 mik3y/airdash yarn run v1.22.5 $ WEBPACK_TARGET=prod node server/server.js info: Server starting ... info: config: {"listenPort":8000} info: Starting server ... Error: Failed to add data source ais-serial://dev/ttyS0?baud=38400: Error: Unsupported protocol "ais-serial:"

mik3y commented 3 years ago

Hey @yanniedog! Okay, this will probably take us a few iterations, but I think we can get this solved.

Your command looks right, the issue here is the docker image has not been updated. I'm checking why, and it looks like this is because the automatic build failed - so there's no fresher one for you. Let me see if I can get this fixed, it may take about 20-30 minutes. Stand by!

mik3y commented 3 years ago

@yanniedog okay, please try updating the docker image, and running again.

You can update the image with this command:

docker pull mik3y/airdash
yanniedog commented 3 years ago

@mik3y thanks very much. Please see below:

`pi@SmoothIsland:~ $ sudo docker pull mik3y/airdash Using default tag: latest latest: Pulling from mik3y/airdash 709549ab8c59: Pull complete a47835026e1d: Pull complete d9aa96a1a673: Pull complete c4e19bdda1d2: Pull complete 2b538cd0b24d: Pull complete 91d489fd59ac: Pull complete 69a4687b2da3: Pull complete efe643b6c2af: Pull complete 455c1917998f: Pull complete ea3dd698273e: Pull complete 4beb7b46e67a: Pull complete 82b9e5bf9da0: Pull complete ea994a47fa33: Pull complete 8beec020d5ba: Pull complete Digest: sha256:da99cafac0bd2f4653245d24e7d5c9eb564ae79694dc5769abbfb973f426b021 Status: Downloaded newer image for mik3y/airdash:latest docker.io/mik3y/airdash:latest

pi@SmoothIsland:~ $ sudo docker run --rm -i -t -p 8888:8000 -e DATA_SOURCES=ais-serial:///dev/ttyS0 mik3y/airdash

docker: Error response from daemon: driver failed programming external connectivity on endpoint confident_shamir (5adc13f4ab768d588946c5aef3df50b89abf186ec36d722e20f86f82e413ab9f): Bind for 0.0.0.0:8888 failed: port is already allocated. `

As an alternative (with the baud specified): pi@SmoothIsland:~ $ sudo docker run --rm -i -t -p 8888:8000 -e DATA_SOURCES=ais-serial:///dev/ttyS0?baud=38400 mik3y/airdash docker: Error response from daemon: driver failed programming external connectivity on endpoint unruffled_villani (1a096d9d3ae2c67d952b0219132e0a06562576142cb445bf1d05649ea41a541b): Bind for 0.0.0.0:8888 failed: port is already allocated.

mik3y commented 3 years ago

Hm! That error suggests you might already have it (or something) running on port 8888.

Try a docker ps to see what's running. You should then be able to use docker stop or docker kill to shut down an existing version of airdash, if one is running.

yanniedog commented 3 years ago

Thanks mik3y, that fixed it. Now, Docker loads correctly, but unfortunately it still doesn't show ships on the map:

pi@SmoothIsland:~ $ sudo docker ps
CONTAINER ID   IMAGE          COMMAND                  CREATED        STATUS        PORTS                    NAMES
98ed63ea25c2   7819a6390adf   "docker-entrypoint.s…"   10 hours ago   Up 10 hours   0.0.0.0:8888->8000/tcp   awesome_payne
pi@SmoothIsland:~ $ sudo docker stop 98ed63ea25c2
98ed63ea25c2
pi@SmoothIsland:~ $ sudo docker run --rm -i -t -p 8888:8000 -e DATA_SOURCES=ais-serial:///dev/ttyS0 mik3y/airdash
yarn run v1.22.5
$ WEBPACK_TARGET=prod node server/server.js
info: Server starting ...
info: config: {"listenPort":8000}
info: Starting server ...
info: 200 | GET /api/entities duration=99 for=undefined agent=Mozilla/5.0 (X11; Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.197 Safari/537.36
info: 200 | GET /api/entities duration=4 for=undefined agent=Mozilla/5.0 (X11; Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.197 Safari/537.36
info: 200 | GET /api/entities duration=4 for=undefined agent=Mozilla/5.0 (X11; Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.197 Safari/537.36

image

mik3y commented 3 years ago

Whoops! Sorry I missed your comment here.

Could you try enabling debug logs? I am not sure if it will add what we need.. but it could.

Should be something like adding the following to the docker run command:

-e DEBUG='airdash:*'
mik3y commented 3 years ago

Hey @yanniedog - I thought of another issue that could be affecting this. Do you run some other software that reads from the AIS device at port /dev/ttyS0? I believe only one program can read from that at a time, so if something other than airdash is running, that could be the problem.

yanniedog commented 3 years ago

The issue I'm really, really struggling with is the basic Docker / Docker-compose commands. I don't know how to do the fundamental basics of Docker, and don't have any idea what I'm doing when it comes to docker/docker-compose. It's preventing me from participating

mik3y commented 3 years ago

Understood! Sorry about that - I remember there is indeed a bit of a learning curve. And probably doubly so when you aren't sure whether the software itself is buggy (as could definitely be the case here)..

Would you be up for letting me ssh in and look things over? I can probably troubleshoot things quickly that way. No worries if not - I understand not wanting to trust a random internet stranger with computer access :-)