[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gpsd-users] TWO BUGS IN GPSD (When connecting to tcp source & nmea2
From: |
address@hidden |
Subject: |
Re: [gpsd-users] TWO BUGS IN GPSD (When connecting to tcp source & nmea2000 source) |
Date: |
Mon, 16 Mar 2015 17:57:26 +0100 |
Hello,
how do you remove a single nmea2000 device?
Reinhard
-----Original-Nachricht-----
Betreff: Re: [gpsd-users] TWO BUGS IN GPSD (When connecting to tcp source & nmea2000 source)
Datum: Mon, 16 Mar 2015 16:12:36 +0100
Von: Vignesh Krishnan <address@hidden>
An: address@hidden
Hi,
Hi
For the nmea2000 error you just fixed
I am referring to the below array.
static char can_interface_name[NMEA2000_NETS][CAN_NAMELEN];
In nmea2000_open function there is a check for CAN device duplicate before the can device is copied to the can_interface_name[] array.
for (l = 0; l < NMEA2000_NETS; l++) {
if (strncmp(can_interface_name[l],
interface_name,
MIN(sizeof(interface_name), sizeof(can_interface_name[l]))) == 0) {
gpsd_report(session->context->debug, LOG_ERROR, "NMEA2000 open: CAN device duplicate open: %s .\n", interface_name);
return -1;
}
If you have a look at the nmea2000_close function which get called when the device is removed can_interface_name[] array which has the list of can devices is not cleared.
So re-adding the can device again results in CAN device duplicate open error
---------------------------------
Thanks and Regards
Vignesh Krishnan
Caterpillar India Pvt. Ltd.
From: "Eric S. Raymond" <address@hidden>
To: Vignesh Krishnan <address@hidden>
Cc: address@hidden
Date: 16-03-2015 19:34
Subject: Re: TWO BUGS IN GPSD (When connecting to tcp source & nmea2000 source)
Vignesh Krishnan <address@hidden>:
> Hi,
>
> I am using gpsd to connect to a gps source that sends gps sentences via
> tcp stream.
>
> ./gpsd -n tcp://10.10.10.12:3123
>
> If at all the gps source goes down . gpsd detects it but never closes its
> tcp socket with tcp source. So if the gps source comes back up again ,
> gpsd maintains an old socket which cannot receive any GPS sentences. Work
> around is to manually detect the source going down (with a linux tcp
> socket ) and remove and add the source back again once the source goes
> down and comes back up.
I'd like to fix this, but I'm not sure what you mean by "detects". What
message do you actually see?
I need to know this so I can figure out where to intervene with the
socket close.
> For the nmea2000 bug . I connect using gpsd control socket
>
> ./gpsd -n -F /tmp/control_sock
>
> Adding source is possible
> +nmea2000://can1
>
> Removing sourc is also possible with
> -nmea2000://can1
>
> Readding the source is not possible with
> +nmea2000://can1
>
> This is because the there is an array which stores the list of nmea
> devices. That is not cleared on removed. So adding the second time results
> in device exist error when actually device does not exist.
Which array are you referring to? Is it nmea2000_units[] in the NMEA2000
driver. or somewhere else.
--
<a href=""https://urldefense.proofpoint.com/v2/url?u=http-3A__www.catb.org_-7Eesr_&d=AwIBAg&c=p0oa49nxxGtbbM2qgM-GB4r4m9OlGg-sEp8sXylY2aQ&r=QzRXKjoyTROxPFfVg2Rse0zRfZ_4ButSq-ltHQYzoAw&m=q8O14wrkk6RThLtlK0awGsGZUFmwjeqwBRg1ZAhg3x8&s=YPI7EYjMoVUvzSDMpHtl0mG7qd7RSHf2LdOXkf6ZtI0&e=">https://urldefense.proofpoint.com/v2/url?u=http-3A__www.catb.org_-7Eesr_&d=AwIBAg&c=p0oa49nxxGtbbM2qgM-GB4r4m9OlGg-sEp8sXylY2aQ&r=QzRXKjoyTROxPFfVg2Rse0zRfZ_4ButSq-ltHQYzoAw&m=q8O14wrkk6RThLtlK0awGsGZUFmwjeqwBRg1ZAhg3x8&s=YPI7EYjMoVUvzSDMpHtl0mG7qd7RSHf2LdOXkf6ZtI0&e= ">Eric S. Raymond</a>