4G模组_室内Wi-Fi定位“排坑”指南

最近有个用户,使用合宙的Air201——4G资产定位模组,做室内Wi-Fi定位,发现同一园区不同楼栋内的定位结果相同,希望我帮忙做问题排查。

排查过程记录在这里了,如果你的定位项目也有类似问题,希望可以帮助到你。

了解用户情况

我第一反应是,用户的定位流程可能有问题。让用户出示了两栋楼中对应的AT流程,流程如下:

一号楼AT流程:

五号楼AT流程:

看了一下,似乎也没有什么问题。对比来看,两栋不同的楼栋,定位结果完全相同。给我人看傻了,马上都要自我怀疑了,不可能是合宙的Wi-Fi定位服务器的问题啊,我们产品发布前做过无数次测试,像这种楼和楼之间的定位是很精确的,是绝对没有问题的。

原理分析

思来想去,还是要从Wi-Fi定位的原理去分析。

实际上,Wi-Fi定位原理就是:模块收集周围Wi-Fi的mac地址和信号质量,然后带着这些信息去访问Wi-Fi定位服务器,由服务器去自己数据库里搜索对应mac地址;再根据信号质量确定设备离对应的Wi-Fi信息源距离,进而返回对应坐标。

知道了原理后,我指导用户,使用"AT+Wi-FiSCAN"这条指令,主动显示出周围的Wi-Fi信息。我拿着这些信息,手动去访问一下高德的定位库,看看是不是高德认为这两栋楼是同一个地方。

以下是用户两栋楼不同的Wi-Fi信息:

一号楼扫描到的Wi-Fi:

五号楼扫描到的Wi-Fi:

很明显,两栋楼的Wi-Fi信息也不一样。按理说不应该显示同一个地点啊?

不死心的我,拿着这个信息又去请求了高德的定位(由于是付费库,此处仅显示定位出的结果):

可以很明显的看到,不是一个地方。那么,为什么我们服务器返回的却是相同的地方呢?

我想了又想,有没有可能:高德使用的是GCJ坐标系,而经过我们服务器下发给用户的时候,由于用户习惯的坐标系不同,所以服务器经过GCJ坐标系转换成了WGS-84坐标系的dd.dddd格式。

是不是坐标转换或者格式转换的时候,丢失了精度?

于是我将上述两个经纬度,转换成了WGS-84坐标系的dd.dddd格式,再根据信号质量确定设备距离离对应的Wi-Fi信号源之间的大致距离。

完整代码请参见下方链接:

合宙GPS定位纠偏

转换过后看了一看,这也不是同一个地方啊,那为什么模块返回的是同一个地方呢?

查看手册,找到答案

我百思不得其解,于是又返回去对照AT指令手册。

AT指令手册下载链接

仔细看了下用户最初的AT指令流程,对比AT手册上的描述,发现了端倪!用户的流程缺失了一个设置:

如果没有使用AT+Wi-FiLOC设置Wi-Fi定位优先,则默认使用的是基站定位。

由于一座4G基站理论上可以管1.5km内的几乎所有设备通讯,所以用户不管是一号楼还是五号楼,都连的是同一个基站。如果你使用的是合宙免费的单基站服务,那么基站定位的返回的肯定是同一个结果。

猜想成立,于是问用户要到了设备的imei号,和合宙定位服务器那边对线了一下,确定了这个用户上传的信息只有基站信息,所以服务器一直返回的是基站定位的结果。

问题终于找到了!

问题解决 

和用户沟通后,用户使用AT+Wi-FiLOC指令,设置完Wi-Fi优先,再次去实地验证。果然,定位结果不同了:

个人分享

问题解决了,用户很高兴!作为一个FAE,我在这里也和大家分享点室内定位一些要点:

不管是Wi-Fi定位,还是基站定位,只能当作室内定位的补充。

在成本可控的情况下,不能只依靠Wi-Fi定位/基站定位做室内定位,会出现偏差较大的情况。

个人实测经历:在我曾经的几次上海路测,Wi-Fi定位出现过不少的错误数据,有给我定位到合肥的多个点,也有给我定位到北京的点。

合理怀疑是Wi-Fi信号源从上海挪到了合肥或者北京,也有可能是Wi-Fi信息被造假了,基站也可能有类似情况。

一般来说,室内定位为蓝牙芯片+蓝牙信标:

放置几个蓝牙信标在需要定位的场所,然后蓝牙芯片根据搜到的蓝牙信标的信号强弱,大概判断出来位置。LoRa也可以做此类应用。

如果需要室内高精度定位:

如地下停车场寻车这种场景,一般的解决方案为UWB定位,可以实现室内厘米级别定位。当然,此种方式成本较高,需要购买UWB基站和UWB设备。

更多详细资料获取请点击:合宙文档资料中心

室内定位算法,有助于研究者认清研究方向,给定位算法一个准确的描述,是很好的参考教材。the possibility for the user to be notified by visible and Waveformof Distance audible warnings using buzzer and led ar to Very close to al 1903 Tme「 samples Fig 4 Distance measurement using the RSSi signal The system is used to determine the distance between Fig. 2. Tag4M Data Acquisition System tags and 2, 3, 4 or more APs. The tag scans after the aps ⅣV. EXPERIMENTS and sends the rssi values for each ap to the ap which is associated The system presented above can be used for objects or In order to read the corresponding rSsi values of all people localization in an indoor enviro found access points, a""operation is implemented at Let's suppose a building where several objects are Tag4M level. The time to scan is smaller than few distributed all over milliseconds, because the tag doesnt associate with the all For a better understanding of the system, it is showed an APs. These values are sent to a pC where the localization experiment where the objects are placed only at one floor. algorithm is implemented in LabVIFW20 10 (see Fig. 5) Each of these objects has attached a tag. The devices are Table I presents a scan operation result. In this case used to determine the location of the objects in the four APs(which are placed in the floor building)named building and the distance between tags and APs. To Hawk, Helicopter, Tag4M and WitagServer are detected measure the distance, the RSSI is processed. This method The corresponding rSSi values(in dBm) measured by the is not very accurate and is strong depended to the Tag4M are reported for every AP environment, but is very easy to implement with the TABLE 1. A SEQUENCE OF RESULTS FOR THE SCANOPERATION The Fig 3 presents the experiment environment for one EXFCUTED ON THE TAG4M DEVICE oor where the colored circles represents the APs and the rectangles represents the objects intended to be located This floor is divided in six rooms separated by walls RSSI Scan results: 4 Time Ssid Ch ad-Iloc Sec wps mac Address erp WMM SSI Supported Rates(Mbits, Mandatory) Crypto Suites CW Max/min AP SCAN. llawk. -57 dBm AP SCAN, Helicopter, -50 dBm, AP SCAN, Tag4M.-68 dBm AP SCAN. WitagServer. -45 dBm The Rssi values are converted to distance values using formula(1) The value of the received signal strength is a function of the transmitted power and the distance between the Fig 3. The Experiment Environment sender and the receiver. The received signal strength will decrease when the distance increases as the following First step in finding the location is distance equation shows [23] measurement using the RSSI signal. The experiment for computing the distance is presented in Fig. 4. The RSSI(IOn- logo+A)(1) experimental precisions of measurements are less than 5 meters Where: lal propagation constant al d propagation exponent. d represents the distance from sender, A represents the received signal strength at a distance of one meter worn even by people. The system runs on batterie w sSID having a characteristic life time of a couple of years and 回H offers a platform for sensor measurements. Thus, the system can use any existent infrastructure, with significant decrease of implementation costs REFERENCES [1] H. Liu, H. Darabi, P. Banerjee and J. Liu, ""Survey of wireless Distance 2 Tn] aRch Indoor Positioning Techniques and SystemS", IEEE TRANSACTIONS ON SYSTEMS. MAN. AND CYBERNETICS-PART C: APPLICATIONS AND REVIEWS VOL 37, NO 6, NOVEMBER 2007, pp. 1067-10801 Distance 3[] [2 Want, A. Hopper, V. FalcaO, J. Gibbons, "The Active Budge 4MDastDct v Location System, ACM Transactions on Information Systems vol. 10, no l, January 1992, pp 91-102. Fig. 5. Block Diagram of the localization program [3] Firefly Motion Tracking System User's guide", vcrsion 2.2 December 1999 http://www.gesturecentral.com/firefly/fireflyuserguide.pdf The application compute the distances between the Wi- [4] Northen Digilal Inc. Website, Oplotrak PROseries, 2011 Fi Tags placed on targets and the APs placed in indoor http:/www.ndigital.com/industrial/optotrakproseries-family.php [5] E. Aitenbichler, M. Mhlhuser, An /R Local Positioning System for environment. For this case, three APs are enough but the Smart Items and Devices Proc. 23rd IEEE Internationa number of Aps can be increased for obtaining more Conference on Distributed Computing Systems Workshops accurate position estimation. The distances between the TWSAWC03), 2003 Wi-fiTagsandeachAparerepresentedascirclesasit[6]topaz,2004,http:/www.tadlys.co.il/pAges/productcontent.asp?igi bald=2 can be seen in Fig. 6, having the centre in the AP locations [7 A. Kotanen, M. Hannikainen, H. Leppakoski, and T. D which have previously known coordinates. The target's Hamalaincn, E.cperiments on local positioning with Bluetoothin position is given by the point at the intersection of the Proc. IEEE Int Conf. Inf. Technol. Comput. Commun., Apr 2003 three circles PP.297-303 [8 J. Hallberg, M. Nilsson, and k. Synnes, "Positioning with Bluetooth"in Proc. Ieee 10th Int Conf. Telecommun. Mar. 2003 ol.2,pp.954958 9 Active bat website. 2008 http:/www.cl.cam.ac.uk/research!dtg/attarchive/bat/ [10] Hazas, M, Hopper, A, "A Novel Brucdbund Ultrasonic Locution System for Improved Indoor Positioning IEEE Transactions on mobile Computing. Vol 5, No 5, May 2006 [11 N B Priyantha, The Cricket Indoor Location System", PhD thes MIT.2005 2]SonitorSystemWebsite2011,http://www.sonitor.com/ [13] Minami M, Fukuju Y, Hirasawa K, Yokoyama S, Mizumachi M Aoyama T ,"Dolphin. A practical approach for implementing a fully distributed indoor ultrasonic positioning system", Ubicomp, 2004, 347-365 Fig. 6. Front Panel of the localization program 14]J. Ilightower, R. Want, and G. borriello, SpotON: An indoor 3D cation sensing technology hased on RF signal strength"Univ The simplicity and cost efficiency of the rssi based Washington, Seattle, Tech Rep UW CSE 2000-02-02, Feb. 2000 localization make the proposed system a desired candidate 15]L. M. Ni, Y. Liu, Y. C. Lau, and A. P. Patil,"LANDMARC: Indoor location sensing using active RFID Wireless Netw., vol 10, no 6 for specific applications like tracking and positioning svstems hP.701-70.N0v.200 Zebra Technologies Corporation eb sit http://www.7ebra.com/id/zebra/na/en/index/products/location/isoie c 24730 2html V. CONCLUSION [17 P. Bahl and V. Padmanabhan, "RADAR: An in-building rf based user location and tracking system, Proc. IEEE INFOCOM, voL 2 In this paper, an indoor localization system based on March200,pp.775784 ultra-low power Wi-Fi technology and designed to 18Ekahau2011,http://www.ekahau.com: [19] T. King, S. Kopf, T. Haenselmann, C. Lubberger and w determine location of objects in a closed environment is Effelsberg, "COMPASS: A Probabilistic Indoor Positioning System proposed gILo rOC In the first part of this paper a survey of existing indoor Workshop on Wireless Network Testbeds, Experimental evaluation and Cllaracterization (WiNTECID), Los Angeles, CA, USA positioning systems was made In the second part was presented the way in which an [20] Convert sensor data to web pages using a Cloud Instrument, june object can be localized by using access points and Tag 4M 2011.http://www.tag4m.com devices which may read the rssi values [21Tag4mDatasheet2010,http://test.tag4m.com/wp- content/uploads/20/03/Tag4M Prod Datasheet Revised3. pdf The importance of the proposed system lies in ultra-low [22] Aamodt, K.(2006). CC2431 Location Engine, Application Note power and Wi-Fi transmission capabilities that are An042,fromhttp://focus.tii.co.ip/ip/lit/an/swra095/swra095.pdf embedded in a very small package, why they are suitable 320
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值