vasja
Posts: 92
Joined: Wed Mar 26, 2008 2:25 pm

TCP communication log

Wed Mar 26, 2008 3:44 pm

Hello all,

This is my first post here. I am using GpsGateServer 1.3 and I have device for which I am not sure what is included in packets that it sends. Here is part of my logfile

2008-03-26 12:52:07.6596 | Info | 7 | TcpNmeaListener.m_Listen | New incoming connection! m_uiAcceptCount = 28, remoteEP = 217.65.194.4:17388, type = GpsGate.NmeaPipe.SmartPipeTcpListener |
2008-03-26 12:52:08.4096 | Info | 13 | TcpConnection.m_ReadCallback | Client closed connection GpsGate.NmeaPipe.SmartPipeTcpConnection |
2008-03-26 12:52:08.4096 | Info | 13 | NmeaConnection.Dispose | Disposing... GpsGate.NmeaPipe.SmartPipeTcpConnection, GpsGate.NmeaPipe.SmartPipeTcpConnection |

How can I see more data about what is going on? Is there a way to log raw packets as they a received from the device?



Vasja

User avatar
johan
GpsGate
Posts: 14925
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

RE: TCP communication log

Wed Mar 26, 2008 4:15 pm

Yes, you can log at a lower level by editing NLog.config. Change "Info" to "Debug". See bold word below.

Then you need to restart the service "Franson NMEA Service"
You do that in SiteAdmin, or in the Control panel, or by using the "net" command from a command prompt.

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <targets>
    <target name="file" xsi:type="File" fileName="${basedir}/loggfile_${shortdate}.txt"
              layout="${longdate} | ${level} | ${threadid} | ${stacktrace:topFrames=1} | ${message} | ${exception}"/>
  </targets>
  <rules>
    <logger name="*" minlevel="Debug" writeTo="file"/>
  </rules>
</nlog>

Regards,
Johan

Franson Support

altf4
Posts: 1035
Joined: Mon Feb 04, 2008 8:05 pm
Location: Thailand
Contact: Website

RE: TCP communication log

Wed Mar 26, 2008 4:41 pm

just out of couriousity !
<logger name="*" minlevel="Debug" writeTo="file"/>

is there a option to change this to database ??
this would help ALOT .. specialy for the issue about "non report connections"
they are mentioned in the log .. but grep a 5MB logfile in realtime need a huge machine ;-)



--
Backups are for WIMPS!

User avatar
johan
GpsGate
Posts: 14925
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

RE: TCP communication log

Wed Mar 26, 2008 5:17 pm

Yes, you can log to DB. Please take a look at NLog
http://www.nlog-project.org/

Regards,
Johan

Franson Support

vasja
Posts: 92
Joined: Wed Mar 26, 2008 2:25 pm

RE: TCP communication log

Wed Mar 26, 2008 5:28 pm

Hi,

Thanks for help. Actually it did not gave me much more info, but with other software I found that data which comes is like this

<fox><gps id="3" data="27,A,260308,125434,4447.0096,N,02027.4055,E,0,280,,,24" /></fox>

What can I do to get this kind of data to work with GpsGateServer?


Vasja

User avatar
johan
GpsGate
Posts: 14925
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

RE: TCP communication log

Wed Mar 26, 2008 5:56 pm

Yes, you can. Please use the "SmartPipe". More info:
http://franson.com/forum/topic.asp?TOPIC_ID=5896


Regards,
Johan

Franson Support

vasja
Posts: 92
Joined: Wed Mar 26, 2008 2:25 pm

RE: TCP communication log

Wed Mar 26, 2008 6:30 pm

Hi,

I did that at the beginning. My config file has this data ini it

<?xml version="1.0"?>
<configuration>
<appSettings>
<clear />
<add key="StarsNavUdpPort" value="6080" />
<add key="StarsNavTcpPort" value="6082" />
<add key="GlobalSatTcpPort" value="5000" />
<add key="SmartPipeUdpPort" value="1002" />
<add key="SmartPipeTcpPort" value="1002" />
<add key="DatabaseType" value="MySQL" />
<add key="NmeaPort" value="1003" />
<add key="UdpNmeaPort" value="1003" />
</appSettings>
<connectionStrings>
<clear />
<add name="ConnStr" connectionString="Dsn=GpsGateServer" />
</connectionStrings>
</configuration>

I checked and I can see packets coming through on port 1002 to GpsGateServer. But instead of recognizing them, in my log file I find this:

2008-03-26 16:20:58.7221 | Info | 7 | TcpNmeaListener.m_Listen | New incoming connection! m_uiAcceptCount = 1, remoteEP = 217.65.194.4:10558, type = GpsGate.NmeaPipe.SmartPipeTcpListener |
2008-03-26 16:21:00.4096 | Info | 13 | TcpConnection.m_ReadCallback | Client closed connection GpsGate.NmeaPipe.SmartPipeTcpConnection |
2008-03-26 16:21:00.4252 | Info | 13 | NmeaConnection.Dispose | Disposing... GpsGate.NmeaPipe.SmartPipeTcpConnection, GpsGate.NmeaPipe.SmartPipeTcpConnection |
2008-03-26 16:21:58.1596 | Info | 7 | TcpNmeaListener.m_Listen | New incoming connection! m_uiAcceptCount = 2, remoteEP = 217.65.194.4:11342, type = GpsGate.NmeaPipe.SmartPipeTcpListener |
2008-03-26 16:22:00.2221 | Info | 14 | TcpConnection.m_ReadCallback | Client closed connection GpsGate.NmeaPipe.SmartPipeTcpConnection |
2008-03-26 16:22:00.2221 | Info | 14 | NmeaConnection.Dispose | Disposing... GpsGate.NmeaPipe.SmartPipeTcpConnection, GpsGate.NmeaPipe.SmartPipeTcpConnection |

What am I doing wrong?




Vasja

User avatar
johan
GpsGate
Posts: 14925
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

RE: TCP communication log

Wed Mar 26, 2008 6:43 pm

It is because no IMEI number is found. Can you set the <gps id="3" .../>?

Set it to a 15 figures long number like 123456789012345
Then set this number as IMEI number when you add a device to your user.

Regards,
Johan

Franson Support

vasja
Posts: 92
Joined: Wed Mar 26, 2008 2:25 pm

RE: TCP communication log

Thu Mar 27, 2008 2:26 pm

Hi,

Unfortunately, max number of characters is 10. What should I do?


Vasja

vasja
Posts: 92
Joined: Wed Mar 26, 2008 2:25 pm

RE: TCP communication log

Thu Mar 27, 2008 2:50 pm

Hi,

I tried also to use PipeSettings.xml, and received packets are correctly authenticated, but I have same result - position data is not recognized.

Vasja

User avatar
johan
GpsGate
Posts: 14925
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

RE: TCP communication log

Thu Mar 27, 2008 2:52 pm

PipeSettings will not work, since the data sent is not complete NMEA.
SmartPipe will not work since the device ID is not IMEI (15 or 16 digits)

Please contact us here, and we'll try to work something out:
http://franson.com/gpsgateserver/support.asp

Regards,
Johan

Franson Support

vasja
Posts: 92
Joined: Wed Mar 26, 2008 2:25 pm

RE: TCP communication log

Fri Apr 04, 2008 3:51 am

Hi Johan,

Thank You for your help on this matter, I really appreciate it. I did as you suggested and built small proxy. It listens on port 1002. It converts XML data into something like this:

IMEI=000001234567890 $GPRMC,154326,A,4447.0083,N,02027.4068,E,0,152,010408

Then it send it to localhost on port 1001 on which smartpipe listens, and this works! Only thing left is to convert my program to proper service.

One thing although is not working. I am sure I send speed (after 'E,' in output string) but on GpsGateServer speed is always shown as 0. What is wrong?

Vasja

Return to “GpsGate Server - How to setup and use”