fulup-bzh / geogate Goto Github PK
View Code? Open in Web Editor NEWGeoGate is an opensource tracking GPS/AIS framework to implement GTS applications.
License: Apache License 2.0
GeoGate is an opensource tracking GPS/AIS framework to implement GTS applications.
License: Apache License 2.0
unable to create device in mysql backend using telnet console.
db create nauman hello x10 123456789 bike 10 10
but it gave me the following error
??? (Hoops) Unknown Command [help ???]
why this code error , GammuSms.SendTo (E:\Node Server\smsgateway\node_modules\ggsmsc\lib\GG-GammuMySql.js:163:31)?
Could someone kindly point me to some reference on how to interpret the decoded data, as in what does mmsi, bitarray, sog etc refer to?
In ggencoder lib the mmsi value comes as integer.
The ais definition says it is a 9-digit ID.
E.g. the base stations has 2 leading zeros.
I forgot it when I made the changes.
I did a short check for Signal K. There is no problem with the type change.
Are there other clients that come into trouble?
Hello , how could I use GeoGate in my project ?? I didn't find any documentation or tutorial . Please help .
Have you thought about adding support for multipart AIS message decoding?
From comments in the source file it appears that there is no support for this, but is it so that the original C++ code didn't have this either?
Encountered NaN error using GGSimulator to pump NmeaAis data to GGServer.
NmeaAis Simulator Config for GGSimulator
var MyDispatcher =
{ debug : 9 // debug 0-9
, verbose : true // provide a copy of outgoing message on console
, srvmod : true // move to false for client connect mode
, host : 'localhost' // only useful in client connect mode
, port : 8800 // tcp port for client to connect
, dumpfile: "/tmp/simulator.dump" // send a copy of outgoing packet to a dumpfile
};
// instanciate one or multiple simulators to process one/many gpxfile(s)
var simu1 = new GGsimulator.Simulator(MyBoat1); // parse GPX route and compute position
var simu2 = new GGsimulator.Simulator(MyBoat2);
var dispatcher = new GGsimulator.Dispatcher (MyDispatcher); // dispatch message to tcp clients
dispatcher.SetEncoder(GGsimulator.NmeaAisEncoder); // register presentation encoder
dispatcher.SetListener(simu1); // register simulator position/statics events
dispatcher.SetListener(simu2);
MySqlDb-Config for GGServer
{ debug : 4
, Telnet : {info: "Telnet Console" , adapter: "TelnetConsole" , port: PortBase}
, Httpd : {info: "Minimalist HTTPd", adapter: "HttpAjax" , port:PortBase +80, debug:9}
, AisTcp2 : {info: "Ais Hub Feed 2" , adapter: "AisTcpFeed" , hostname: "mydomain.com" , remport:8800, timeout:60, mindist:2}
},
GGServer Console Log
Gateway Start: DummyDemo
-- 4 [no trace] -- "MySQL creating connection [mysql:ggserver@localhost/ggserver
]"
-- 1 [DevAdapter] -- "adapter:telnet//4000"
-1- HttpAjax-adapter.js/DevAdapter:69 [adapter:httpdajax//4080 rootdir=c:\ggserv
erorig\node_modules\www]
-- 1 [DevAdapter] -- "DevAdapter: adapter:[email protected]:8800"
-- 3 [TcpSvrListenOk] -- "TcpServer [TcpServer://TelnetConsole:4000] listening"
-- 3 [TcpSvrListenOk] -- "TcpServer [HttpServer://HttpAjax:4080] listening"
-- 4 [TcpClientConnect] -- "[TcpClient://AisTcpFeed:8800] connected"
-5- MySqlDb-backend.js/null:54 [MySQL Connect Done [mysql:ggserver@localhost/ggs
erver]]
-- 3 [DevAdapter.ParseLine] -- "Ignoring AIS count:0 mmsi:159847387 type:18 [not
logged]"
-- 3 [DevAdapter.ParseLine] -- "Ignoring AIS count:1 mmsi:123456789 type:18 [not
logged]"
-- 3 [DevAdapter.ParseLine] -- "Ignoring AIS count:2 mmsi:159847387 type:18 [not
logged]"
-- 3 [DevAdapter.ParseLine] -- "Ignoring AIS count:3 mmsi:123456789 type:18 [not
logged]"
-- 3 [DevAdapter.ParseLine] -- "Ignoring AIS count:4 mmsi:159847387 type:18 [not
logged]"
-- 3 [DevAdapter.ParseLine] -- "Ignoring AIS count:5 mmsi:159847387 type:18 [not
logged]"
-- 3 [DevAdapter.ParseLine] -- "Ignoring AIS count:6 mmsi:123456789 type:18 [not
logged]"
-- 3 [DevAdapter.ParseLine] -- "Ignoring AIS count:7 mmsi:159847387 type:18 [not
logged]"
-6- MySqlDb-backend.js/BackendStorage.LoginDev:245 [Login MySQL device:sockclien
t//TcpAis/remote:50.23.126.218:8800 devid=159847387]
-9- MySqlDb-backend.js/null:253 [sqlQuery {"id":3,"devid":"159847387","devname":
"gpsdemodevice2","callsign":"gps2","model":"gpsmodel2","track":"T_159847387","al
arm":"A_159847387","obd":"O_159847387","date":"2015-02-04T14:03:58.000Z"}]
-6- MySqlDb-backend.js/BackendStorage.UpdateAlarmDev:311 [Updating Alarm MySQL d
evid=159847387]
-0- MySqlDb-backend.js/null:320 [MySql ERROR LookupDev INSERT INTO A_159847387 s
et ? err=Error: ER_BAD_FIELD_ERROR: Unknown column 'NaN' in 'field list']
-- 3 [DevAdapter.ParseLine] -- "Ignoring AIS count:8 mmsi:123456789 type:18 [not
logged]"
-6- MySqlDb-backend.js/BackendStorage.UpdateAlarmDev:311 [Updating Alarm MySQL d
evid=159847387]
-0- MySqlDb-backend.js/null:320 [MySql ERROR LookupDev INSERT INTO A_159847387 s
et ? err=Error: ER_BAD_FIELD_ERROR: Unknown column 'NaN' in 'field list']
-- 3 [DevAdapter.ParseLine] -- "Ignoring AIS count:9 mmsi:123456789 type:18 [not
logged]"
-6- MySqlDb-backend.js/BackendStorage.UpdateAlarmDev:311 [Updating Alarm MySQL d
evid=159847387]
-0- MySqlDb-backend.js/null:320 [MySql ERROR LookupDev INSERT INTO A_159847387 s
et ? err=Error: ER_BAD_FIELD_ERROR: Unknown column 'NaN' in 'field list']
-6- MySqlDb-backend.js/BackendStorage.UpdateAlarmDev:311 [Updating Alarm MySQL d
evid=159847387]
-0- MySqlDb-backend.js/null:320 [MySql ERROR LookupDev INSERT INTO A_159847387 s
et ? err=Error: ER_BAD_FIELD_ERROR: Unknown column 'NaN' in 'field list']
It may be caused by following code:
AisTcpFeed-adapter.js line 117
data.cmd= TrackerCmd.GetFrom.TRACKER;
should be data.cmd=TrackerCmd.GetFrom.TRACK;
and _TcpClient.js line 171 may need to add data.valid = "";
case TrackerCmd.GetFrom.TRACK:
var update = true; // default is do the update
// compute distance only update backend is distance is greater than xxxm
if (this.stamp !== undefined) {
var moved = parseInt (this.Distance (this.stamp, data));
// compute elapse time since last update
var elapse = parseInt ((data.date.getTime() - this.stamp.date.getTime()) / 1000); // in seconds
var speedms = parseInt (moved/elapse); // NEED TO BE KNOWN: with short tic speed is quicky overestimated by 100% !!!
// usefull human readable info for control console
data.moved = moved;
data.elapse = elapse;
data.valid = "";
// if moved less than mindist or faster than maxspeed check maxtime value
if (moved < this.controller.svcopts.mindist || speedms > this.controller.svcopts.maxspeed) {
this.Debug(2,"%s Dev %s Data ignored moved %dm<%dm ?", this.count, this.devid, moved, this.controller.svcopts.mindist);
// should we force a DB update because maxtime ?
if (elapse < this.controller.svcopts.maxtime) update = false;
}
} else {
data.moved = 0;
data.elapse = 0;
data.valid = "";
}
Hi,
BackendStorage.prototype.CreateDev at file MongoDB-backend.js is never get called.
and due to that there is no "ALL_Devices" collections created.
also the variable this.logged at file _TcpClient.js is never set to "true".
it always not logged in.
I am trying to use following config for TK102 device ..
Gps103 : {info: "Tk102 Gps103" , adapter: "Gps103Tk102" , port: 8090}
in encoder/lib/GG-AisDecode.js
The var this.length is used for message length and ship length.
So when I call it from Signal K there is always a value for ship length in all messages.
A Signal K user reported that most of the messages in AIS feed available at 153.44.253.27:5631 are ignored.
The feed's data has prefix BS
!BSVDM,1,1,,A,H3m=CT0tlDL4000000000000000,2*25
!BSVDM,1,1,,A,13oOBn00000NIB@SoTEcDDHN0<0H,0*38
!BSVDM,1,1,,A,33eG6N0OiOPPnC0Q49irT8RL00n0,0*4A
Apparently this is already fixed for BSVDM in 6eaeac6 but not published to npm. Could you please publish it so that people can enjoy the fix?
Furthermore the talker does not really matter afaik, the messages are VDM and VDO, so a better check would be to just ignore the talker id and check the sentence id. I can provide a PR if you think that's the way to go.
I think this is the module ggserver.
Is there a command architecture implemented to send commands back to the device when the client is connected through the GPRS protocol?
If so, where can i extend it for other devices and learn about it's architecture?
People are trying to create Open Embedded linux images with Signal K Node server, which uses ggencoder as you know.
OE build process for applications with npm dependencies is not 100% equal to npm process. ggencoder's jison dependency is causing problems with the build process.
One particular problem is the mixed case package id in JSONSelect, used via jison dep in ggencoder: https://github.com/lloyd/JSONSelect/blob/master/package.json#L3. That is but one of the issues.
Would you consider dropping the jison dependency, as it is not used by the published module and is just that bit extra, just the command line tool? You could make it a dev dependency, so that if you run npm install
in ggencoder it would get installed, but somebody using ggencoder as a dependency would not be affected by it?
Would it possible to add more binary message decodings to case 8?
One interesting message could be meteorological-hydrographic-data to get weather observations from AIS where available.
After updating to version 0.1.16, we're getting a TypeError when decoding the following multiline AIS sentence:
const sentences = [
'!AIVDM,2,1,0,A,53brRt4000010SG700iE@LE8@Tp4000000000153P615t0Ht0SCkjH4jC1C,0*25\n',
'!AIVDM,2,2,0,A,`0000000001,2*75\n'
]
This used to work fine. The error we're seeing:
TypeError: Cannot read property 'trim' of undefined
at new AisDecode (node_modules/ggencoder/lib/GG-AisDecode.js:367:57)
Edit: version 1.1.14 works as expected, 1.1.15 & 1.1.16 throw the error.
Would you be able to release AIVDO supported ggencoder version to npm?
Just had a ship go by that sent this message:
!AIVDM,2,1,9,A,53Moi:81Qk8LLpQH000PD98T@D4r118Tp<E=<0153@f594ke07TSm21D,0*63
!AIVDM,2,2,9,A,hF@000000000000,2*73
Unfortunately the decoder seemed to ignore a lot of the data and only output this:
AisDecode {
bitarray: [],
valid: false,
payload: <Buffer 35 33 4d 6f 69 3a 38 31 51 6b 38 4c 4c 70 51 48 30 30 30 50 44 39 38 54 40 44 34 72 31 31 38 54 70 3c 45 3d 3c 30 31 35 33 40 66 35 39 34 6b 65 30 37 ... >,
msglen: 56,
channel: 'A' }
AisDecode {
bitarray:
[ 133, 131, 157, 183, 177, 138, 136, 129, 161, 179, 136, 156, 156, 184, 161, 152, 128, 128, 128, 160, 148, 137, 136, 164, 144, 148, 132, 186, 129, 129, 136, 164, 184, 140, 149, 141, 140, 128, 129, 133, 131, 144, 174, 133, 137, 132, 179, 173, 128, 135, 164, 163, 181, 130, 129, 148, 176, 150, 144, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 ],
valid: false,
payload: <Buffer 35 33 4d 6f 69 3a 38 31 51 6b 38 4c 4c 70 51 48 30 30 30 50 44 39 38 54 40 44 34 72 31 31 38 54 70 3c 45 3d 3c 30 31 35 33 40 66 35 39 34 6b 65 30 37 ... >,
msglen: 71,
channel: 'A',
aistype: 5,
repeat: 0,
mmsi: '232649000',
class: 'A' }
Hi, can you provide readme file on how to install and run it locally in my machine? thank you
Hi! When i call "npm install ggsmsg" i get ERR! 404 Not Found: ggsmsg
Hi,
Thanks for developing this app - I managed to install and run GeoGate using DummyBackend
on Windows 2012R2. However, when using 'MySqlDb' as backend, I'm unable to get geojson data from
[server]:4080/ajax/geojson.rest?format=json&key=123456789&cmd=list&group=all
and MySQL database is still empty (no all_devices table)
My MySqlDb config file:
var PortBase = 4000;
var GeoGateConfig = {
backend : "MySqlDb", // backend file ==> mysql-backend.js [default file]
name : "GpsdMySQL", // friendly service name [default Gpsd-Track]
inactivity : 900, // remove device from active list after xxxs inactivity [default 600s]
debug : 7, // debug level 0=none 9=everything
"services" : { debug: 4
// this controle console, you probably want it hyden behind your firewall
, Telnet : {info: "Telnet Console" , adapter: "TelnetConsole" , port: PortBase +0}
, Httpd : {info: "Minimalist HTTPd", adapter: "HttpAjax" , port:PortBase +80, debug:5}
// following apaters are TCP servers and wait for clients to connect
, Gps103 : {info: "Tk102 Gps103" , adapter: "Gps103Tk102" , port:PortBase + 3, debug:6}
// phone applications typically some form of OpenGPRMC
, Celltrac : {info: "CellTrac Android", adapter: "GtcGprmcDroid" , port:PortBase + 20, debug:5} // OpenGPRMC
},
"mysql": { // [should reflect your MySQL configuration]
hostname: "localhost", // MySql hostname
basename: "gpsdtest", // Basename base should exist
username: "gpsdtest", // MySql username
password: "password" // MySql password
}
};
module.exports = GeoGateConfig;
This is the console screenshot - I'm able to receive GPS message from my phone (connecting to port 4020) - using iOS\GTSTracker:
This is MySQL (I've created the DB and User)
and this is the browser screenshot:
Using Dummy Backend, I successfully get:
I'm not sure whether it is caused by the server or the mobile app config. Any idea how I can resolve this? (I have used gpsdtracking with flatfile backend before, it is also unable to record location data sent by GTSTracker).
Thanks in advance!
I just tried the library. It works with the command line client example, but with the following, I get the error
/home/pi/geogate/SMS.js:21
var smsc = new GGsmsc(SmscConfig);
^
TypeError: undefined is not a function
Here's my SMS.js
var GGsmsc = require("ggsmsc").GammuSms;
var SmscConfig =
{ debug : 1 // can be overloaded with --debug in cli
, hostname: '127.0.0.1' // Gammu MySql config
, username: 'smsd'
, basename: 'smsd'
, password: 'smsd'
, smsc : '' // your SMS gateway phone number
, report : true // enforce delivery report when sending
};
function DisplayCallback (message) {
var count=1;
for (var sms in message) {
console.log("-%d- Inbox SMS=%j", count++, message[sms]);
}
}
var smsc = new GGsmsc (SmscConfig);
simulator.event.on("position",MyEventHandler4Position); // GPS position report
simulator.event.on("static" ,MyEventHandler4Statics); // AIS static data report
//smsc.GetAll (DisplayCallBack);
//smsc.GetFrom (DisplayCallBack, '+xxPhonexxxNumberxxx');
//smsc.DelById (this.cli.smsid);
//smsc.CheckById (this.cli.smsid);
smsc.SendTo (DisplayCallBack, '09175213612', 'This is my message');
here's my package.json
{
"name": "SMS",
"version": "0.1.0",
"dependencies": {
"mysql": "*",
"ggsmsc": "*"
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.