Hello,

I´m trying to receive data from a GPS tracker (Toplovo TL-202) using the
socket gateway in ColdFusion (CF 8 and CF 9 enterprise on windows tested)

The data is sent as a TCP connection via GPRS from the tracker.

When I test the socket gateway via telnet I can connect to it and everything
I type is received and logged to a file.

I am using an example from cfdocs to test if I can receive and process the
data:

<cfcomponent>
    <cffunction name="onIncomingMessage" output="no">
       <cfargument name="CFEvent" type="struct" required="yes">
        <cfscript>
            if (NOT IsDefined("CFEvent.Data.file")) {
                    CFEvent.Data.file="defaultEventLog"; }
            if (NOT IsDefined("CFEvent.Data.type")) {
                CFEvent.Data.type="info"; }
        </cfscript>
        <cflog text="#CFEvent.Data.message#"
             file="#CFEvent.Data.file#"
            type="#CFEvent.Data.type#"
            thread="yes"
            date="yes"
            time="yes"
            application="yes">
    </cffunction>
</cfcomponent>

However ­ nothing is received/logged from the tracker until I disconnect the
GPRS session, then all accumulated data is processed and logged in the log
file.

When I look at the data received with a packet sniffer the data is like
this:

#013226006970707,CMD-T,A,DATE:130604,TIME:163554,LAT:59.1493866N,LOT:005.260
9933E,Speed:003.1,X-X-X-X-88-24,024,24202-01F8-2E2D##013226006970707,CMD-T,A
,DATE:130604,TIME:163854,LAT:59.1495200N,LOT:005.2610833E,Speed:000.5,X-X-X-
X-88-24,000,24202-01F8-2E2D#

And the data is exactly this ­ there is no additional data in the packet
received when looking at the hex values

This data represents 2 position updates ­ and the data packet is sent to the
gateway every 3 minutes.

I guess that the socket gateway is expecting some sort of "end of
transmission" before it receives and logs the data.

Can anyone point me to what I need to do to make the socket gateway receive
/ log the information on every transmission from the unit?

The full source code for the gateway is included, but I do not know what to
do with that kind of code....Š ;)
(\JRun4\servers\cfusion\cfusion-ear\cfusion-war\WEB-INF\cfusion\gateway\src\
examples\socket on my devserver)

 I´m going to parse the data as it is received and store it in database for
further processing.

Maybe there is better and smarter ways to do this ­ especially if there is
thousands of trackers sending position data to the system?

Thanks,
Helge Hetland
WebSite AS

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:355867
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to