1. Introduction


It is possible to GPS supports in LG308N-EC25 version and LPS8v2-EC25 version so device will add location info to uplink packet to LoRaWAN server.

2. Add GPS support on LG308N

Below are the steps:

1. Open the box and connect GPS antenna to GNSS port of EC25

image-20220527160148-2.png

Connect GPS antenna

2. modify the two files:

/etc/chatscripts/3g.chat

ABORT   BUSY
ABORT   'NO CARRIER'
ABORT   ERROR
REPORT  CONNECT
TIMEOUT 10
""      "AT&F"
OK      "ATE1"
OK  "AT+QGPS=1"   --> Add this line, so EC25 module GPS will be enable when dial up
OK      'AT+CGDCONT=1,"IP","$USE_APN"'
SAY     "Calling UMTS/GPRS"
TIMEOUT 30
OK      "ATD$DIALNUMBER"
CONNECT ' '

Note: After above settings, the GPS will be enable when dial up, if user doesn't use Cellular for Internet access, above script won't execute, in this case, user can run "echo AT+QGPS=1 > /dev/ttyUSB2" to enable GPS /usr/bin/generate-config.sh, after configure this, in the web page, select any frequency band and save to make this take affect.

gen_gw_cfg() {
   json_init
   json_add_object gateway_conf
   json_add_string "gateway_ID" "$gwid"
   json_add_string "server_address" "$server"
   json_add_int "serv_port_up" "$upp"
   json_add_int "serv_port_down" "$dpp"
   json_add_int "stat_interval" "$stat"
   json_add_boolean "forward_crc_valid" 1
   json_add_boolean "forward_crc_error" 0

   json_add_string "gps_tty_path" "/dev/ttyUSB1"   -----> Add this line so lora program knows to get the gps info from EC25

   json_close_object
   json_dump  > /etc/lora/local_conf.json

}

3. Reboot the device and run logread -f to verify if GPS already works.

Fri Mar  6 04:08:59 2020 daemon.info lora_pkt_fwd[3016]: INFO~ GPS serial port path is configured to "/dev/ttyUSB1"
Fri Mar  6 04:08:59 2020 daemon.info lora_pkt_fwd[3016]: INFO~ [main] TTY port /dev/ttyUSB1 open for GPS synchronization
Fri Mar  6 04:09:00 2020 cron.err crond[1689]: time disparity of 4301528 minutes detected
Fri Mar  6 04:09:00 2020 daemon.info lora_pkt_fwd[3016]: INFO~ sockfd=4
Fri Mar  6 04:09:00 2020 daemon.info lora_pkt_fwd[3016]: INFO~ sockfd=5
Fri Mar  6 04:09:00 2020 daemon.info lora_pkt_fwd[3016]: INFO~ FPort Filter: 0
Fri Mar  6 04:09:00 2020 daemon.info lora_pkt_fwd[3016]: INFO~ DevAddrMask: 0x0
Fri Mar  6 04:09:34 2020 daemon.info lora_pkt_fwd[3016]: INFO: [jit] queue is empty
Fri Mar  6 04:09:34 2020 daemon.info lora_pkt_fwd[3016]: STAT~ {"stat":{"time":"2020-03-06 04:09:34 UTC","lati":22.70627,"long":114.24277,"alti":58,
"rxnb":0,"rxok":0,"rxfw":0,"ackr":0.0,"dwnb":0,"txnb":0}}
Fri Mar  6 04:09:35 2020 daemon.info lora_pkt_fwd[3016]: INFO~ [up] PUSH_ACK received in 293 ms
Fri Mar  6 04:09:35 2020 daemon.info lora_pkt_fwd[3016]: INFO~ [down] PULL_ACK received in 596 ms

2. Add GPS support on LPS8v2

 

Tags:
    
Copyright ©2010-2024 Dragino Technology Co., LTD. All rights reserved
Dragino Wiki v2.0