This document targets AVL integrators, providing them with a step-by-step guide on integrating BlueTree’s 5200/5400/5600 modems’ protocol into their software services.
The 5200/5400/5600 modems support a set of features aimed at the Fleet Management and AVL markets, allowing users to:
- Query and control the I/O in the modem, remotely as well as locally
- Define events that can trigger when:
- an I/O value meets a user-defined condition
- GPS fix fields (e.g. Speed, Heading) meet a user-defined condition
- a user-specified time interval expires for periodic reporting
- Send a BlueTree default report to one or more destinations. The event report settings can be configured for continuous reporting that can be interrupted by a user-defined expiry timer and/or an acknowledge reception. The default report includes:
- event and device identification data
- GPS fix
- I/O status
- RF diagnostics data e.g. RSSI
This guide assumes understanding of CDMA (1xRTT/1xEVDO) and GSM/GPRS connectivity concepts. As a summary, here’s a quick list of how the modem operates:
First the modem needs to have an active account (packet data plan) from the Wireless Carrier
- For CDMA carriers, the account info (e.g. phone number) needs to be programmed into the modem through BlueVue Device Manager
- For GPRS carriers, this information is already preloaded into the SIM card
- Then the modem needs to be configured, also using BlueVue Device Manager, to connect to the wireless network and maintain this connection (Always-on)
- From this point on, the modem has a packet data connection (PPP-TCP/IP) to the network
- When configured to generate event reports, it will send those over the air in TCP or UDP packets to a user defined destination server – the next section describes how to configure these events, and interpret these reports.
It is important to first read the “BlueTree AVL Reference” document to
- Understand the IO interface and its management
- Understand the event architecture and configuration
- Understand the event report structure
Step 1: Build Modem’s Event Reporting Configuration
The outcome of this step is a list of AT commands that we refer to as the “AVL-Config”.
- Start by clearly identifying your requirements:
- For position information, which GPS protocol should be set in the modem: TAIP or NMEA?
- Which destination(s) should the modem report to? IP address, TCP or UDP, port number?
- What data should the modem include in its reported messages? Do I need different contents based on the event triggered?
- Should the modem add a start and end flags to the reported message for synchronization?
- Should the modem keep sending the event report periodically until it receives an acknowledgement from the server? How often?
- Which Data Sources should the modem monitor? Digital inputs, Ignition, Speed, Analog inputs, Timers?
- Map these requirements to AT commands
- As an example refer to the “AVL-Config” listed below
- The “BlueTree AVL Reference” document also contains detailed examples
- Save this AVL- Config list
; Example of AVL-Config ;****************************************
'Setting GPS position messages to NMEA RMC.............'AT+BGPSPR=1,1,1AT+BGPSNM="RMC"
'Setting reporting destination........' AT+BRPRDS=1,1,"126.96.36.199",5432,1
'Setting report message...............'AT+BEVRPR=1,"GP-1IO1","1",0,0,0
'Enable Synchronization flag..........................START Bytes = 0x55AA, END Bytes = 0x17C'AT+BSYNCF=1,"0x55AA","0x17C9"
'EVENT 1: every 300sec when the vehicle is moving.....'AT+BEVGSS=1,"GS<3"AT+BEVENT=1,"GSS1!","T300","S",0,1
'EVENT 2: every 3600sec when the vehicle is stationary' AT+BEVENT=2,"GSS1","T3600","S",0,1
'EVENT 3: engine idling more than 15 min..............' AT+BEVENT=3,"GSS1&DIS3","T900","S",0,1
'EVENT 4: exceeded 70mph (60knots) for at least 1min..'AT+BEVGSS=2,"GS>60"AT+BEVENT=4,"GSS2","T60","S",0,1
'EVENT 5: input 1 turned ON (Battery ON)..............'AT+BEVDIS=1,"DI1=1"AT+BEVENT=5,"DIS1","R","S",0,1
'EVENT 6: input 1 turned OFF (Battery OFF)............' AT+BEVENT=6,"DIS1!","R","S",0,1
'EVENT 7: input 2 turned ON (Door open)...............'AT+BEVDIS=2,"DI2=1"AT+BEVENT=7,"DIS2","R","S",0,1
'EVENT 8: input 2 turned OFF (Door closed)............' AT+BEVENT=8,"DIS2!","R","S",0,1
Step 2: Build your AVL Server
The communication layer of your AVL server should handle 2 socket connections with the modem:
1. The “report” socket
- through this socket, the modem will send its event reports to the AVL server using the BEP protocol
- the fixed IP address and port number of the AVL server should be preconfigured in the modem as per Step 1, the AVL server should be always listening on this UDP or TCP port
- this socket is one-direction only: from the modem to the AVL server
- the modem will initiate a socket connection to this listening port and try to maintain it all the time, even if the AVL server attempts to close it
- the AVL server should be able to handle simultaneous connections from multiple modems to its listening port by multithreading it
2. The “set/query” socket
- through this socket, the AVL server can send AT commands to configure the modem or query its state
- The AVL server should keep a record of the modem’s IP in order to connect to it
- the modem has a dedicated and fixed TCP listening port #6070
- this socket is bidirectional: AVL server sends commands to the modem and receives responses back from it
- the AVL server is responsible for initiating the socket connection to this port, and can open/close it at will
The Communication Layer described above will extract the BEP message from the received TCP or UDP packet. The raw BEP message is then processed by the BEP parser to retrieve its content:
- Modem ID
- Event ID
- IO information
- GPS information
Note that the BEP protocol is binary.BEPserver C-based source code shows an example of how the BEP messages should be parsed and interpreted.
Part of the BEP message is the GPS information. The modem will report this position information in either TAIP or NMEA. Both these protocols are ASCII based.
- For design help on how to parse TAIP, please check the Trimble TAIP document and source code
- For design help on how to parse NMEA, please check the Trimble NMEA document
AT Command Handler
This software module sends AT commands to the modem and interprets the response back from the modem. This communication flow is done through the “set/query” socket (TCP 6070). Your application might require sending over the air AT commands to the modem for the following reasons:
- Change, fully or in part, the AVL-Config
- Query current position
- Query current IO states
- Query modem Diagnostics
- Set digital outputs state (turn ON or OFF)
It is the customer's responsibility to review the advice provided herein and its applicability to the system. Red Lion makes no representation about specific knowledge of the customer's system or the specific performance of the system. Red Lion is not responsible for any damage to equipment or connected systems. The use of this document is at your own risk. Red Lion standard product warranty applies.
Red Lion Technical Support
If you have any questions or trouble contact Red Lion Technical Support by clicking here or calling 1-877-432-9908.
For more information: http://www.redlion.net/support/policies-statements/warranty-statement