freshworkstudio / gps-tracking-nodejs

Let you work with some GPS trackers that connects through tcp.
MIT License
260 stars 159 forks source link

gps server misses events and does not log them : is trying to 'ping' but it isn't loged. Action wasn't executed #4

Closed ashu-daffodil closed 9 years ago

ashu-daffodil commented 9 years ago

Hi I implemented a gps server using repo docs and during tested that i'm getting location for some time like : device ping : {"latitude":29.158416666666668,"longitude":75.71923333333334,"time":null,"speed":0,"orientation":"129.83","mileage":204851,"inserted":"2015-06-18T09:43:49.762Z","from_cmd":"BR00"}

then in middle is get missed events like :

is trying to 'ping' but it isn't loged. Action wasn't executed. is trying to 'alarm' but it isn't loged. Action wasn't executed. Then again i get device ping in like 1/50 ping events. Why am i missing events ?
gdespirito commented 9 years ago

Normally, the gps send a login request the first time its establish the connection. Then, your server respond acceptong the login request and TK103 starts sending the pings. When the connection is lost, normally the device reconnects and resend another login request and the porcess repeats again. (the server accepts and the device start pinging their location) but if this doesnt happen, and the devuce dont send a login request, the device its going to be forbidden to do any action. thats why you see a 'device is trying to ... but is not loged' mesage. do you think this coul be the case? if not, we can check why its happening...

El El jue, 18 jun 2015 a las 7:41, Ashu Vashishat notifications@github.com escribió:

Hi I implemented a gps server using repo docs and during tested that i'm getting location for some time like : device ping : {"latitude":29.158416666666668,"longitude":75.71923333333334,"time":null,"speed":0,"orientation":"129.83","mileage":204851,"inserted":"2015-06-18T09:43:49.762Z","from_cmd":"BR00"}

then in middle is get missed events like : is trying to 'ping' but it isn't loged. Action wasn't executed. is trying to 'alarm' but it isn't loged. Action wasn't executed.

Then again i get device ping in like 1/50 ping events. Why am i missing events ?

— Reply to this email directly or view it on GitHub https://github.com/freshworkstudio/gps-tracking-nodejs/issues/4.

ashu-daffodil commented 9 years ago

@gonzunigad Yes i think this is the case. Here are my logs when location pings go missing :

gps server alive : Fri Jun 19 2015 14:13:22 GMT+0000 (UTC) 009729320858 is trying to 'ping' but it isn't loged. Action wasn't executed 009729320858 is trying to 'ping' but it isn't loged. Action wasn't executed 009729320858 is trying to 'ping' but it isn't loged. Action wasn't executed 009729320858 is trying to 'ping' but it isn't loged. Action wasn't executed gps server alive : Fri Jun 19 2015 14:15:22 GMT+0000 (UTC) 009729320858 is trying to 'ping' but it isn't loged. Action wasn't executed login_request: 009729320858 device ping : {"latitude":29.15841833333333,"longitude":75.71911666666666,"time":null,"speed":0,"orientation":"211.82","mileage":204851,"inserted":"2015-06-19T14:16:39.420Z","from_cmd":"BR00"} device ping : {"latitude":29.158416666666668,"longitude":75.71908333333334,"time":null,"speed":0,"orientation":"211.82","mileage":204851,"inserted":"2015-06-19T14:17:08.545Z","from_cmd":"BR00"} gps server alive : Fri Jun 19 2015 14:17:22 GMT+0000 (UTC) device ping : {"latitude":29.158406666666664,"longitude":75.71911666666666,"time":null,"speed":0,"orientation":"211.82","mileage":204851,"inserted":"2015-06-19T14:17:40.623Z","from_cmd":"BR00"} device ping : {"latitude":29.158391666666663,"longitude":75.71913333333333,"time":null,"speed":0,"orientation":"211.82","mileage":204851,"inserted":"2015-06-19T14:18:09.722Z","from_cmd":"BR00"} . . . gps server alive : Fri Jun 19 2015 14:37:22 GMT+0000 (UTC) device ping : {"latitude":29.158403333333332,"longitude":75.71913333333333,"time":null,"speed":0,"orientation":"211.82","mileage":204851,"inserted":"2015-06-19T14:37:43.886Z","from_cmd":"BR00"} device ping : {"latitude":29.158403333333332,"longitude":75.71913333333333,"time":null,"speed":0,"orientation":"211.82","mileage":204851,"inserted":"2015-06-19T14:38:13.584Z","from_cmd":"BR00"} 009729320858 is trying to 'ping' but it isn't loged. Action wasn't executed gps server alive : Fri Jun 19 2015 14:39:22 GMT+0000 (UTC) 009729320858 is trying to 'ping' but it isn't loged. Action wasn't executed 009729320858 is trying to 'ping' but it isn't loged. Action wasn't executed 009729320858 is trying to 'ping' but it isn't loged. Action wasn't executed 009729320858 is trying to 'ping' but it isn't loged. Action wasn't executed 009729320858 is trying to 'ping' but it isn't loged. Action wasn't executed gps server alive : Fri Jun 19 2015 14:41:22 GMT+0000 (UTC) 009729320858 is trying to 'ping' but it isn't loged. Action wasn't executed 009729320858 is trying to 'ping' but it isn't loged. Action wasn't executed 009729320858 is trying to 'ping' but it isn't loged. Action wasn't executed . . . gps server alive : Fri Jun 19 2015 15:13:22 GMT+0000 (UTC) 009729320858 is trying to 'ping' but it isn't loged. Action wasn't executed 009729320858 is trying to 'ping' but it isn't loged. Action wasn't executed 009729320858 is trying to 'ping' but it isn't loged. Action wasn't executed 009729320858 is trying to 'ping' but it isn't loged. Action wasn't executed gps server alive : Fri Jun 19 2015 15:15:22 GMT+0000 (UTC) 009729320858 is trying to 'ping' but it isn't loged. Action wasn't executed login_request: 009729320858 device ping : {"latitude":29.158351666666665,"longitude":75.71908333333334,"time":null,"speed":0,"orientation":"211.82","mileage":204851,"inserted":"2015-06-19T15:16:45.306Z","from_cmd":"BR00"} device ping : {"latitude":29.158353333333334,"longitude":75.7191,"time":null,"speed":0,"orientation":"211.82","mileage":204851,"inserted":"2015-06-19T15:17:17.367Z","from_cmd":"BR00"} gps server alive : Fri Jun 19 2015 15:17:22 GMT+0000 (UTC)

From what i see is that adapter.request_login_to_device() implementation is pending which might be causing the issue. Would also like to know how and when logout() works?