It is possible to GPS support in LG308 EC25 version so device will add location info to uplink packet to LoRaWAN server.

Below are the steps:

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

https://wiki.dragino.com/images/thumb/1/19/LG308_GPS_1.png/600px-LG308_GPS_1.png

Connect GPS antenna

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
}

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]: (% style="color:red" %)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

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