gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gpsd issue #53 forwarding: UBX8 batched mode operation (super-e Mode) su


From: Quentin Cabrol
Subject: gpsd issue #53 forwarding: UBX8 batched mode operation (super-e Mode) support
Date: Thu, 30 Jan 2020 14:59:10 +0100

Hi to the gpsd-dev team and thanks for your great project and support!

Following Gary E. Miller suggestion, I forward here an issue I have operating the UBX ZOE-M8B module in batched mode operation (UBX super-E mode).

=====================

Reference MR & issues:
https://gitlab.com/gpsd/gpsd/issues/53 
https://gitlab.com/gpsd/gpsd/-/merge_requests/71  
https://gitlab.com/gpsd/gpsd/issues/23 

In super-E mode operation, UBX modules such as the ZOE-M8B can operate as stand-alone and batch data internally. Batched data is then retrieved by a proper pull request UBX-LOG-RETRIEVEBATCH.

The thing is, in this mode, the GNSS modem will send no data at all (no periodic frame) This bit of code in gpsd.c causes a disconnection when entering this mode (proper configuration with ubxtool):

GPSD_LOG(LOG_PROG, &context.errout,
			 "checking client(%d)\n",
			 sub_index(sub));
		if ((buflen =
		     (int)recv(sub->fd, buf, sizeof(buf) - 1, 0)) <= 0) {
		    detach_client(sub); //==> causes unwanted detach for super e-Mode devices
		} else {
		    if (buf[buflen - 1] != '\n')
			buf[buflen++] = '\n';
		    buf[buflen] = '\0';
		    GPSD_LOG(LOG_CLIENT, &context.errout,
			     "<= client(%d): %s\n", sub_index(sub), buf);

In this mode of operation, it is preferred to keep the device attached even without receiving periodic frames.

I ran some tests and commenting the detach_client() call after the buffer length check is performed yields the expected behavior. But I am not sure how exactly gpsd.c could be modified to account for the use case without impacting the normal operation.

What would you suggest ?

=====================  

Also, in the driver_ubx, parsing of the frame is not supported yet. I made an initial proposal for parsing the UBX-LOG-BATCH frames pushing the parsed data to the "newdata" structure (current data) but as commented by Gary, BATCHED data is in fact a log of older data and not the current data per say.  So this is incorrect to do so and LOG-BATCH data should not be parsed by updating the newdata structure.

 =====================  

Used ubxtool configuration script for the ZOE-M8B EVK:

echo Start UBX config script


#disable NMEA
ubxtool -d NMEA
#disable GLONASS
ubxtool -d GLONASS

#disable UBX_NAV_POSECEF
ubxtool -c 0x06,0x01,0x01,0x01,0,0,0,0,0,0
#disable UBX_NAV_POSLLH
ubxtool -c 0x06,0x01,0x01,0x02,0,0,0,0,0,0
#disable UBX_NAV_STATUS
ubxtool -c 0x06,0x01,0x01,0x03,0,0,0,0,0,0
#disable UBX_NAV_DOP
ubxtool -c 0x06,0x01,0x01,0x04,0,0,0,0,0,0
#disable UBX_NAV_SOL
ubxtool -c 0x06,0x01,0x01,0x06,0,0,0,0,0,0
#disable UBX_NAV_PVT
#ubxtool -c 0x06,0x01,0x01,0x07,0,0,0,0,0,0
#disable UBX_NAV_ODO
ubxtool -c 0x06,0x01,0x01,0x09,0,0,0,0,0,0
#disable UBX_NAV_VELECEF
ubxtool -c 0x06,0x01,0x01,0x11,0,0,0,0,0,0
#disable UBX_NAV_VELNED
ubxtool -c 0x06,0x01,0x01,0x12,0,0,0,0,0,0
#disable UBX_NAV_TIMEGPS
ubxtool -c 0x06,0x01,0x01,0x20,0,0,0,0,0,0
#disable UBX_NAV_TIMEUTC
ubxtool -c 0x06,0x01,0x01,0x21,0,0,0,0,0,0
#disable UBX_NAV_CLOCK
ubxtool -c 0x06,0x01,0x01,0x22,0,0,0,0,0,0
#disable UBX_NAV_TIMEGLO
ubxtool -c 0x06,0x01,0x01,0x23,0,0,0,0,0,0
#disable UBX_NAV_TIMEBDS
ubxtool -c 0x06,0x01,0x01,0x24,0,0,0,0,0,0
#disable UBX_NAV_TIMEGAL
ubxtool -c 0x06,0x01,0x01,0x25,0,0,0,0,0,0
#disable UBX_NAV_TIMELS
ubxtool -c 0x06,0x01,0x01,0x26,0,0,0,0,0,0
#disable UBX_NAV_SVINFO
ubxtool -c 0x06,0x01,0x01,0x30,0,0,0,0,0,0
#disable UBX_NAV_DGPS
ubxtool -c 0x06,0x01,0x01,0x31,0,0,0,0,0,0
#disable UBX_NAV_SBAS
#disable UBX_NAV_ORB
ubxtool -c 0x06,0x01,0x01,0x34,0,0,0,0,0,0
#disable UBX_NAV_SAT
ubxtool -c 0x06,0x01,0x01,0x35,0,0,0,0,0,0
#disable UBX_NAV_GEOFENCE
ubxtool -c 0x06,0x01,0x01,0x39,0,0,0,0,0,0
#disable UBX_NAV_AOPSTATUS
ubxtool -c 0x06,0x01,0x01,0x60,0,0,0,0,0,0
#disable UBX_NAV_EOE
ubxtool -c 0x06,0x01,0x01,0x61,0,0,0,0,0,0

#disable all INF messages
ubxtool -c 0x06,0x02,0,0,0,0,0x00,0x00,0x00,0x00,0x00,0x00

#enable autonomous AssitNow, set initial fix as 3D
ubxtool -c 0x06,0x23,0x02,0,0x40,0x40,0,0,0,0,0,0,0,0,0,0,0x01,0,0,0,0,0,0,0,0,0,0,0,0,0x01,0,0,0,0x64,$

#setup super E-mode 1Hz aggressive
ubxtool -c 0x06,0x86,0,0x03,0,0,0,0,0,0
#enable power save mode on CFG-RXM
#enable power save mode on CFG-RXM
ubxtool -c 0x06,0x11,0,0x01

##configure batching solution: ##
#flags >> pioActiveLow,pioEn,extraPvt,Enable
#buff size >> 150 = 0x96
#fill level trigger >> 144 = 0x90
#pio output >> pio14 = 0xE

#ubxtool -c 0x06,0x93,0,0x65,0x96,0,0x90,0,0xE,0
##configuration without PIO output
ubxtool -c 0x06,0x93,0,0x05,0x96,0,0x90,0,0x0,0

##configure LOGFILTER
#flags >> recorEnabled, applyAllFilters
#minInterval >> 120s=0x78
#timeThd >> 10s=0x0A
#speedThd >> None=0
#distanceThd >> 500m=0x1F4
ubxtool -c 0x06,0x47,0x01,0x05,0x78,0x00,0x2C,0x01,0,0,0xF4,0x01,0,0
#save current NAV  messages configuration into QSPI (last byte selects for memory to load  from/to)
#ubxtool -c 0x06,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x02
ubxtool -c 0x06,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00

echo UBX ZOE-M8B config complete

=====================  

Example of LOG-BATCH frame decoded by ubxtool
Class x21 (LOG) ID x11 (BATCH), len: 0x64
payload: 00,01,0b,00,c8,2d,f1,13,e4,07,01,1d,14,37,37,33,32,00,00,00,69,ba,00,00,03,09,0a,07,18,3e,ed,03,56,27,bd,1b,da,a3,07,00,5d,eb,06,00,db,40,00,00,cb,52,00,00,e1,ff,ff,ff,59,ff,ff,ff,00,00,00,00,46,00,00,00,8f,ce,66,ff,a1,02,00,00,87,50,3c,00,b3,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
UBX-LOG-BATCH:
  version 0 contentValid x1 msgCnt 11 iTow 334573000
  year 2020 month 1 day 29 hour 20 min 55 sec 55 valid x33
  tAcc 50 fracSec 47721 fixType 3 flags x9 flags2 xa numSV 7
  lon 65879576 lat 465381206 height 500698 hMSL 453469 hAcc 16603 vAcc 0
  vel N 21195 E -31 D -167 gSpeed 0dA headMot 70 sAxx 4284927631 headAcc 673
  pdep 20615 reserved1 x3c distance 179 totalDistance 0
  distanceStd 0 reserved2 x0
      contentValid (extraPvt) valid (validDate validTime) fixType (3D Fix) flags (gnssFixOK) psmState (Acquisition)
=====================   Examples of binary frames for LOG-BATCH (0x2111) gpsd:IO: UBX: len 108
gpsd:WARN: UBX: unknown packet id 0x2111 (length 108)                                                                                                                                                                                         
gpsd:CLIENT: => client(0): =b5622111640000018600704b9117e407011e0d312837110000000e3cfaff03110a082569ea03a7bebc1bac1a07002f620600e60e0000151b00004d0000000c010000e7ffffff030200000de77000700200009f164000db00000000000000000000000000000000000000c90d 
gpsd:IO: UBX: len 108 
gpsd:WARN: UBX: unknown packet id 0x2111 (length 108)
gpsd:CLIENT: => client(0): =b5622111640000018700584f9117e407011e0d31293712000000153bfaff03110a084469ea0386bebc1bd1140700555c06000c0f0000581b00005d0000009d0100000000000015030000c40176007102000074892d00db00000000000000000000000000000000000000424b

Thank you in advance for your support
Kind regards
-----------------------
Quentin Cabrol
Aeler Technologies SA
c/o EPFL Innovation Park, Building C
1015 Lausanne, Switzerland



CONFIDENTIALITY NOTICE: This email communication may contain private, confidential, or legally privileged information intended for the sole use of the designated and/or duly authorized recipient(s). If you are not the intended recipient or have received this email in error, please notify the sender immediately by email and permanently delete all copies of this email including all attachments without reading them. If you are the intended recipient, secure the contents in a manner that conforms to all applicable state and/or federal requirements related to privacy and confidentiality of such information
reply via email to

[Prev in Thread] Current Thread [Next in Thread]