A Novel Optimized iBeacon Localization Algorithm Modeling

The conventional methods for indoor localization rely on technologies such as RADAR, ultrasonic, laser range localization, beacon technology, and others. Developers in the industry have started utilizing these localization techniques in iBeacon systems that use Bluetooth sensors to measure the object’s location. The iBeacon-based system is appealing due to its low cost, ease of setup, signaling, and maintenance; however, with current technology, it is challenging to achieve high accuracy in indoor object localization or tracking. Furthermore, iBeacons’ accuracy is unsatisfactory, and they are vulnerable to other radio signal interference and environmental noise. In order to address those challenges, our study focuses on the development of error modeling algorithms for signal calibration, uncertainty reduction, and interfered noise elimination. The new error modeling is developed on the Curve Fitted Kalman Filter (CFKF) algorithms. The reliability, accuracy, and feasibility of the CFKF algorithms are tested in the experiments. The results significantly show the improvement of the accuracy and precision with this novel approach for iBeacon localization.


Introduction
Indoor localization technology is a crucial area of study within the realm of Wireless Sensor Networks (WSN) [1][2][3]. Current research widely uses the Received Signal Strength Indicator (RSSI) in WSN because of its ease of operation; however, in indoor environments, RSSI-based location measurement is impacted by multipath fading effects [4]. Signal transmission is interfered with by furniture, people, and objects; this results in poor accuracy [5][6][7]. Sensor node localization or range-based localization techniques calculate the distance between the nearest nodes [8,9]; they are used in most WSN applications [10]. The node localization method in WSN typically measures range using the RSSI [11,12]. Previous studies [13] have explored various technologies for indoor localization, including RFID [14,15], RADAR [16], WiFi [17], and 5G [18]; however, these technologies need to offer the essential balance of low cost, low energy consumption, accuracy, reliability, and ease of use. Bluetooth is a low-cost wireless sensor for short-distance communication [19,20]. Bluetooth Low Energy (BLE) is a crucial technology that enables the use of iBeacon [7,20,21]. BLE-mounted beacons contain identification information to detect the location of the system [22]. iBeacon is a power-efficient and cost-effective indoor localization system that can send presence information to iOS 7 or above devices and Android systems [23][24][25]. The indoor localization system uses identification from the sensor device and the data of the RSSI from a smartphone [26]. The range between the iBeacon and the smartphone is determined by the value of the estimated RSS [27]. The RSS values are highly susceptible to errors caused by factors such as the transmission platform, the surrounding environment, and other communication devices such as receivers and antennas [22,28]. The RSSI technique is primarily used to obtain the signal strength from Bluetooth and iBeacon and identify the localization data [29]. A localization method based on Bayes' likelihood algorithm with RSSI and fingerprint is proposed to approach the accuracy at meter level in a static environment. The accuracy can be improved by 20% but the fingerprint training process takes much longer and is difficult [30]. A machine learning algorithm applying the RSSI-based fingerprinting method was introduced recently. The offline performance is well-presented whereas the online performance is not comprehensive due to a lack of calibration [31]. The least squares methods, such as nonlinear least squares, total least squares, weighted least squares, and generalized least squares, etc., are utilized to analyze the transmission model for Bluetooth localization accuracy. The results indicate that the generalized least squares method performs with better accuracy than the others [32]. The KF is a recursive linear filtering technique that can be utilized to minimize the impact of noise in position measurements [33]. It processes past measurements to constrain arbitrary calculation deviations [34]. A Bluetooth signal strength measurement method using an Extended Kalman Filter (EKF) is proposed to obtain the distance accuracy [35]. The weighted least square algorithm is used in the KF equations to reduce the square error for the variance. The developed KF can smooth the noise caused by signal drift and vibration [36]; however, the calibration process is not introduced in the research. The developed KF method does not apply to the measured distance compared with the estimated distance, which could achieve better distance accuracy. A solution that meets all these requirements has yet to be discovered. Improving the accuracy and precision of localization in iBeacon can be achieved by implementing error modeling algorithms based on a developed KF with a least squares algorithm to correct distance measurement errors.
This paper introduces novel error modeling algorithms for indoor localization. Based on a CFKF error-modeling filter-adjustment strategy, the proposed methodology reduces measurement errors in the iBeacon localization system. The CFKF error modeling algorithm considers iBeacon sensor calibration, improving the measured data through error modeling. This research compares the proposed CFKF error modeling with recent existing error filtering methods according to accuracy and precision. The experimental results show that the CFKF error modeling approach provides the most accurate and precise results for iBeacon localization. The main contributions of the article are:

•
A developed KF state estimate algorithm based on the modified Least Squares Algorithm (LSA) is proposed to enhance the accuracy of iBeacon measurement distance; • A developed system calibration process has been proposed to calibrate the RSSI and estimated distance for indoor localization using iBeacon; • A novel CFKF error modeling approach has been proposed to enhance the estimation accuracy of iBeacon systems in field experiments.
The paper is structured as follows: Section 2 introduces the materials and methods for the research, including the iBeacon protocol, calibration process, and CFKF algorithms. Section 3 states the results and discussions of the iBeacon localization experiment, including the system calibration, error modeling calculations, and field experiment. Finally, conclusions are presented in Section 4.

iBeacon Protocol
The iBeacon system utilizes a localization technique with the BLE method to determine the objects' locations [37]. The distance between an object and iBeacon is calculated by detecting when the object enters or exits a designated position and measuring the Bluetooth's signal transmission and Received Signal Strength (RSS). The information transmitted by iBeacon includes a Universally Unique Identifier (UUID) that distinguishes each company. Major information represents a group of related iBeacons, and Minor information represents the specific iBeacon. The code area in iBeacon, which is 4 bytes, can only be used to identify a specific area within a building, not individual objects [38]. The iBeacon employs an identifier in 128-bit known as UUID for transmitting its information. The UUID holds information about the organization that the iBeacon belongs to, thus identifying the company that it is associated with [39]. In the Bluetooth specification, UUID is used as a unique identifier for some devices. The UUID is situated at the highest level of the hierarchy and serves as an identifier for the ordinary management of iBeacons. Unlike some networking protocols, such as 802.11, Bluetooth does not have central management of UUIDs to prevent conflicts. Instead, iBeacons can generate a random unique UUID at any moment [39].

BLE Minor Number
The Minor number is employed to distinguish a lower-level group within a set of iBeacons. As an illustration, in a retail chain, it can be utilized to recognize a specific item within a single shop [40].

BLE Major Number
The Major number, as specified in Bluetooth and iBeacon specifications, is utilized to identify the ID of a particular class of iBeacons that belong to a particular body. As an illustration, in a retail chain, it is utilized to distinguish the particular shop in which a particular class of beacons is situated [39].

Advertising Interval
The advertising interval is typically set to 100 milliseconds in Bluetooth. While extending the advertising interval can increase battery life, it also decreases the frequency of signal transmission in communication, requiring a balance to be struck between the length of the advertising interval and the intended usage [41].

Calibration Process
The range measurement accuracy in iBeacon depends on the calibration constant, "measured single power". Smartphones use the constant to determine the RSS. It is assumed that the iBeacon is located in free space, with signal loss primarily impacted by inversesquare fading; however, in real-world experimentation, the measured range experiences fluctuations due to interference caused by multiple paths. When the RF signal is transmitted through multiple pathways, the radio energy can interfere with other radio transmissions. This interference can either strengthen the signal (constructive interference) or weaken it (destructive interference). Multipath interference often occurs when the iBeacon is placed near the ceiling or a barrier, causing the radio signal to reflect when it hits the surface.
As shown in Figure 1, the system calibration stage focuses on initializing RSSI at a 1 m distance. The experiment involves the iBeacon broadcasting raw RSSI data signals while a smartphone with Bluetooth is the mobile receiver. The data from the iBeacon is received by the Bluetooth of the mobile receiver, and the raw RSSI data is recorded and stored on the mobile receiver. The stored data, which includes time (milliseconds), UUID, Minor number, Major number, and RSSI (dBm), is then transferred to a computer for analysis. Equation (1) is used to process the measured power at a 1 m distance from the iBeacon.
where D denotes distance; RSSI denotes signal strength, RSSI; A denotes measured power at a 1 m distance; N denotes environmental factor, N = 2 in free space.
where denotes distance; denotes signal strength, RSSI; denotes measured power at a 1 m distance; denotes environmental factor, = 2 in free space.
We need to know the values of and to determine the values of distance. The value can be collected from the raw data logged by the mobile receiver. The value of the constant " " can be determined by positioning the iBeacon 1 m away from the mobile receiver. This calibration procedure helps to minimize noise and errors in the signal transfer. After collecting the raw data, the data must be processed using error modeling algorithms, such as KF, Curve Fitting (CF), or CFKF, to generate an estimated value. The environmental factor, , represents the signal loss due to distance and environment. In free space, is equal to 2, and, generally, it does not change as long as the environment remains the same; however, in case of a change in the environment, can be calculated using Equation (2).
The next step after obtaining the estimated data is to plot it on a Matlab figure. The system then calculates the error rates, revealing that the CFKF algorithm is the most accurate and precise among the others. This completes the calibration stage. To calculate the distance between the iBeacon and the mobile receiver at a value other than 1 m using We need to know the values of RSSI and A to determine the values of distance. The RSSI value can be collected from the raw data logged by the mobile receiver. The value of the constant "A" can be determined by positioning the iBeacon 1 m away from the mobile receiver. This calibration procedure helps to minimize noise and errors in the signal transfer. After collecting the raw data, the data must be processed using error modeling algorithms, such as KF, Curve Fitting (CF), or CFKF, to generate an estimated value. The environmental factor, N, represents the signal loss due to distance and environment. In free space, N is equal to 2, and, generally, it does not change as long as the environment remains the same; however, in case of a change in the environment, N can be calculated using Equation (2).
The next step after obtaining the estimated data is to plot it on a Matlab figure. The system then calculates the error rates, revealing that the CFKF algorithm is the most accurate and precise among the others. This completes the calibration stage. To calculate the distance between the iBeacon and the mobile receiver at a value other than 1 m using the received RSSI, the previous results, including the value of A, must be utilized in Equation (3).
To calculate a distance different from 1 m using the RSSI value, the previous results, including the value of A, must be utilized in Equation (3). The accuracy of the different algorithms in calculating distance at various ranges is evaluated by plotting the results in Matlab. In Figure 2, the inputs used for calculation are the measured distances obtained from Equation (3) based on raw data. These inputs are programmed using the KF. The updated data generated by KF is not the most accurate and will be further calculated using Curve Fitting (CF) to produce the final estimated data, referred to as the CFKF-estimated data. The equations for CFKF modeling are as follows: To calculate a distance different from 1 m using the value, the previous results, including the value of , must be utilized in Equation (3). The accuracy of the different algorithms in calculating distance at various ranges is evaluated by plotting the results in Matlab.
In Figure 2, the inputs used for calculation are the measured distances obtained from Equation (3) based on raw data. These inputs are programmed using the KF. The updated data generated by KF is not the most accurate and will be further calculated using Curve Fitting (CF) to produce the final estimated data, referred to as the CFKF-estimated data. The equations for CFKF modeling are as follows: Sensors 2023, 23, 6560 For optimal compatibility with the Least Square Algorithm (LSA), the algorithm is initialized with k = 1, β 0 = 0 as follows: where β denotes the scale factor of the system; ε denotes the bias of the system. Here, the KF State Update Estimate equation is modified by incorporating the Least Square Algorithm (LSA): At this stage, the distance measurement values are calculated using Equation (3) after processing and calibrating the raw data collected by the mobile receiver using the CF algorithm to determine A. The state of the object is then updated using a state update equation, which is as follows: x n,n = K n (z n −x n,n−1 ) +x n,n−1 = K n z n + (1 − K n )x n,n−1 (12) According to the derivation of LSA: Therefore, y n,n = ∑(xn,nŷn,n) − ∑(xn,n) ∑(ŷn,n)/n ∑(xn,n 2 ) − (∑x n,n ) 2 /nx n,n + ∑xn,n 2 ∑ŷ n,n − (∑x n,n ) ∑xn,nŷ n,n n(∑x n,n 2 ) − (∑x n,n ) 2 The new State Update equation for KF is formulated as follows: The Kalman Gain equation: A covariance update equation is presented below:

iBeacon Localization Experiment
The experiment for the iBeacon localization system has been conducted in this section. The initial step was to calibrate the system, and multiple algorithms were evaluated to determine the most effective one for maximizing localization accuracy. The measurement phase was then carried out to determine the estimated distance. Finally, an experiment was conducted in a real-life environment. The results indicated that the error modeling using CFKF provided the highest accuracy for the system.

iBeacon Localization Testbed Setup
The experiment utilized Estimote iBeacons, and their specifications can be found in Table 1. The specifications of the smartphone can be found in Table 2. As shown in Figure 3a,b, both the iBeacon and mobile receiver were fixed on stands that stood 50 cm tall and positioned 1 m apart. This test setup was used to calibrate the distance measurement for the iBeacon. The datasets received by the mobile phone from the iBeacon can be found in the repository [42]. The datasets include the time (milliseconds), UUID, Minor number, Major number, and RSSI (dBm). The signal transmission interval was around 300 milliseconds, and the device was placed at a distance of 1 m from the mobile phone receiver to gather data. A total of 1500 datasets were gathered; below are a few examples. Figure 4 illustrates the linear modeling of 1500 sample sets of RSSI ( , ) using the CF algorithm. The blue lines depict the raw RSSI data ( , ), and the red line shows the CF data. The in the modeling represents the scaling of the CF data, while represents the measured power at 1 m. The CF algorithm is also displayed. The datasets received by the mobile phone from the iBeacon can be found in the repository [42]. The datasets include the time (milliseconds), UUID, Minor number, Major number, and RSSI (dBm). The signal transmission interval was around 300 milliseconds, and the device was placed at a distance of 1 m from the mobile phone receiver to gather data. A total of 1500 datasets were gathered; below are a few examples. Figure 4 illustrates the linear modeling of 1500 sample sets of RSSI (x rn,n ) using the CF algorithm. The blue lines depict the raw RSSI data (y rn,n ), and the red line shows the CF data. The β r in the modeling represents the scaling of the CF data, while ε r represents the measured power at 1 m. The CF algorithm is also displayed. The datasets received by the mobile phone from the iBeacon can be found in the repository [42]. The datasets include the time (milliseconds), UUID, Minor number, Major number, and RSSI (dBm). The signal transmission interval was around 300 milliseconds, and the device was placed at a distance of 1 m from the mobile phone receiver to gather data. A total of 1500 datasets were gathered; below are a few examples. Figure 4 illustrates the linear modeling of 1500 sample sets of RSSI ( , ) using the CF algorithm. The blue lines depict the raw RSSI data ( , ), and the red line shows the CF data. The in the modeling represents the scaling of the CF data, while represents the measured power at 1 m. The CF algorithm is also displayed. When the value of ε r is −88.85, the coefficient β r is −2.23 × 10 −5 , which is too tiny to affect the results; therefore, the influence of β r can be omitted, whereas the value of ε r accounts for much more.
(ε is −88.85, the mean of the range between −89.04 and −88.67) Figure 5 displays the conversion of the raw data's RSSI into distance using Equation Where β d represents the scale factor and ε d represents the bias of the estimated distance calculated by the CF algorithm, the error modeling for the CF-estimated distance can be expressed as follows: y dn,n = β d x dn,n +ε d  When the value of is −88.85, the coefficient is −2.23 × 10 −5 , which is too tiny to affect the results; therefore, the influence of can be omitted, whereas the value of accounts for much more.
( is −88.85, the mean of the range between −89.04 and −88.67) Figure 5 displays the conversion of the raw data's RSSI into distance using Equation Where represents the scale factor and represents the bias of the estimated distance calculated by the CF algorithm, the error modeling for the CF-estimated distance can be expressed as follows:  Alternatively, we can use the KF to reduce noise in the measured distance. As shown in Figure 6, the KF estimated value is displayed in red. Alternatively, we can use the KF to reduce noise in the measured distance. As shown in Figure 6, the KF estimated value is displayed in red. Finally, the CF algorithm was applied to the KF-estimated distance, resulting in even greater accuracy, as depicted in Figure 7. Finally, the CF algorithm was applied to the KF-estimated distance, resulting in even greater accuracy, as depicted in Figure 7.  The CFKF error modeling for the distance (CFKF-Distance) is computed using Equation (11),ŷ n,n = βx n,n + ε, and the results are displayed as follows: β = −0.00154 (−0.00402, 0.000953) ε = 1.026 (1.023, 1.028)

Error Modeling Optimized Calibration Results
The algorithm bias and Mean Absolute Error (MAE) in Table 3 show that the CFKFestimated distance is more accurate and precise than other algorithms. The results can be seen in Figure 8, which show that the distance estimated through the CFKF method successfully minimizes uncertainties and is much closer to the actual distance than other methods.  From Figure 9, the comparison CDF plots present that our CFKF estimated result outperforms the other algorithms. From Figure 9, the comparison CDF plots present that our CFKF estimated result outperforms the other algorithms.
We repeated the calibration processes from 1 m to 15 m. Same as the previous calibration, 1500 raw data samples were collected and processed for each distance. The calibrated RSSI values have been recorded in Table 4. Figure 10 presents the RSSI values and curvefitted RSSI values. When the distance is larger than 8 m, the difference in the RSSI values is minor due to the loss of signal strength. The signal strength is poor when RSSI is less than −103.5 dbm. Due to the limitation of the device, the distance between the iBeacon and the receiver should be no more than 8 m to obtain the best accuracy. We can also extend the iBeacon setup for every 8 m to measure the longer distance. From Figure 9, the comparison CDF plots present that our CFKF estimated result outperforms the other algorithms. We repeated the calibration processes from 1 m to 15 m. Same as the previous calibration, 1500 raw data samples were collected and processed for each distance. The calibrated RSSI values have been recorded in Table 4. Figure 10 presents the RSSI values and curve-fitted RSSI values. When the distance is larger than 8 m, the difference in the RSSI values is minor due to the loss of signal strength. The signal strength is poor when RSSI is less than −103.5 dbm. Due to the limitation of the device, the distance between the iBeacon and the receiver should be no more than 8 m to obtain the best accuracy. We can also extend the iBeacon setup for every 8 m to measure the longer distance.

. Field Experiment of iBeacon Localization
As illustrated in Figure 11, the iBeacon was placed 2.53 m above the wall of an office. To avoid signal reflection interfering with signals transmitted from other angles, the iBeacon was positioned 0.2 m away from the ceiling. A setup was created, which consisted of a stand with a mobile phone on top, positioned 1 m away from the wall and 0.8 m in height. As shown in Figure 11, it was estimated that the angle between the wall and the line connecting the iBeacon and the mobile phone was roughly 30 degrees, and the distance between the two devices was approximately 2 m. This was a real-world field experiment, and the CFKF error modeling process results were validated through calculation.

Field Experiment of iBeacon Localization
As illustrated in Figure 11, the iBeacon was placed 2.53 m above the wall of an office. To avoid signal reflection interfering with signals transmitted from other angles, the iBeacon was positioned 0.2 m away from the ceiling. A setup was created, which consisted of a stand with a mobile phone on top, positioned 1 m away from the wall and 0.8 m in height. As shown in Figure 11, it was estimated that the angle between the wall and the line connecting the iBeacon and the mobile phone was roughly 30 degrees, and the distance between the two devices was approximately 2 m. This was a real-world field experiment, and the CFKF error modeling process results were validated through calculation. Figure 12 displays 1000 samples of RSSI received by the mobile phone. Using Equation (20), we can calculate the measured power from the iBeacon at an angle of 30 • (or 150 • from the top).
iBeacon was positioned 0.2 m away from the ceiling. A setup was created, which consisted of a stand with a mobile phone on top, positioned 1 m away from the wall and 0.8 m in height. As shown in Figure 11, it was estimated that the angle between the wall and the line connecting the iBeacon and the mobile phone was roughly 30 degrees, and the distance between the two devices was approximately 2 m. This was a real-world field experiment, and the CFKF error modeling process results were validated through calculation. Figure 11. Testbed for iBeacon Localization Field Experiment. Figure 11. Testbed for iBeacon Localization Field Experiment.  In this scenario, the measured distance was determined using Equation (3), and the CF and CFKF error modeling is processed using Equations (11) and (21)  In this scenario, the measured distance was determined using Equation (3), and the CF and CFKF error modeling is processed using Equations (11) and (21) The comparison of the results between the KF algorithm and the CFKF algorithm can be seen in Figure 11, shown in the distance diagram.
As demonstrated in Figure 13, the CFKF-estimated distance is the significantly closest result to the actual distance of 2.09 m. The KF-estimated distance result is from 1.89 to 2.31 m. The measured distance ranges from 1.019 to 3.55 m. Figure 14 displays that the CFKF-estimated distance is the most accurate in the CDF comparison results, which demonstrates the effectiveness and reliability of our error modeling in the real-life field experiment.  According to Table 5, we can see the MAE of CFKF is less than any others. The bias According to Table 5, we can see the MAE of CFKF is less than any others. The bias of the measurement distances varies from 0.35 to 0.67 m. On the other hand, the KF-estimated bias falls in the range of 0.06 to 0.15 m. The CF bias stands at 0.049 m. Meanwhile, the bias of the CFKF is 0.045 m. The results show that the CFKF error modeling provides higher accuracy and precision than the other methods. The CFKF error modeling was discovered to be approximately 30-60% more accurate than the measured results, outperforming the KF estimated distance by 1-10% and surpassing the CF-estimated distance by 0.4%. It shows that the CFKF error modeling provides the highest degree of accuracy.  According to Table 5, we can see the MAE of CFKF is less than any others. The bias of the measurement distances varies from 0.35 to 0.67 m. On the other hand, the KFestimated bias falls in the range of 0.06 to 0.15 m. The CF bias stands at 0.049 m. Meanwhile, the bias of the CFKF is 0.045 m. The results show that the CFKF error modeling provides higher accuracy and precision than the other methods. The CFKF error modeling was discovered to be approximately 30-60% more accurate than the measured results, outperforming the KF estimated distance by 1-10% and surpassing the CFestimated distance by 0.4%. It shows that the CFKF error modeling provides the highest degree of accuracy.

Large Area Field Experiment of iBeacon Localization
At this stage, we set up the experiment to validate the feasibility of our error modeling in an ample area, as illustrated in Figure 15. The iBeacon was placed 2.5 m above the wall in a large open space. A test bed was set up, which consisted of a stand with a mobile phone on top, placed 7 m away from the wall and 0.8 m in height. From Figure 15, we can estimate that the distance between the iBeacon and the mobile phone was approximately 7.2 m. This was a large-area field experiment for indoor localization.

Large Area Field Experiment of iBeacon Localization
At this stage, we set up the experiment to validate the feasibility of our error modeling in an ample area, as illustrated in Figure 15. The iBeacon was placed 2.5 m above the wall in a large open space. A test bed was set up, which consisted of a stand with a mobile phone on top, placed 7 m away from the wall and 0.8 m in height. From Figure 15, we can estimate that the distance between the iBeacon and the mobile phone was approximately 7.2 m. This was a large-area field experiment for indoor localization. In this case, we repeated the calibration and calculation process with 1000 received data sets. The comparison of the results among the multiple algorithms is shown in the distance diagram in Figure 16. In this case, we repeated the calibration and calculation process with 1000 received data sets. The comparison of the results among the multiple algorithms is shown in the distance diagram in Figure 16. As presented in Figure 16, the CFKF-estimated distance is 7.46 m which is the best outstanding result compared to the others. The KF-estimated distance result is from 7.31 to 7.63 m; it needs to be more precise. The measured distance ranges from 2.5 to 12.9 m; it is far from accurate. Moreover, the result from CF was the second-closest result from the ground true value. Figure 17 displays that the CFKF-estimated distance is the most accurate in the CDF comparison results, which demonstrates the effectiveness and reliability of our error modeling in the large-area field experiment. According to Table 6, the MAE of CFKF is 0.26 m, which is less than any other algorithm. The bias of the measurement distances changes from 4.72 to 5.71 m. The bias of KF starts in the range of 0.11 to 0.45 m; the average value is 0.27 m. The CF bias stands at 0.28 m. Furthermore, the bias of the CFKF is 0.26 m. These results indicate that the CFKF error modeling provides the best accuracy and precision in the large area field experiment.  As presented in Figure 16, the CFKF-estimated distance is 7.46 m which is the best outstanding result compared to the others. The KF-estimated distance result is from 7.31 to 7.63 m; it needs to be more precise. The measured distance ranges from 2.5 to 12.9 m; it is far from accurate. Moreover, the result from CF was the second-closest result from the ground true value. Figure 17 displays that the CFKF-estimated distance is the most accurate in the CDF comparison results, which demonstrates the effectiveness and reliability of our error modeling in the large-area field experiment. As presented in Figure 16, the CFKF-estimated distance is 7.46 m which is the best outstanding result compared to the others. The KF-estimated distance result is from 7.31 to 7.63 m; it needs to be more precise. The measured distance ranges from 2.5 to 12.9 m; it is far from accurate. Moreover, the result from CF was the second-closest result from the ground true value. Figure 17 displays that the CFKF-estimated distance is the most accurate in the CDF comparison results, which demonstrates the effectiveness and reliability of our error modeling in the large-area field experiment. According to Table 6, the MAE of CFKF is 0.26 m, which is less than any other algorithm. The bias of the measurement distances changes from 4.72 to 5.71 m. The bias of KF starts in the range of 0.11 to 0.45 m; the average value is 0.27 m. The CF bias stands at 0.28 m. Furthermore, the bias of the CFKF is 0.26 m. These results indicate that the CFKF error modeling provides the best accuracy and precision in the large area field experiment.  According to Table 6, the MAE of CFKF is 0.26 m, which is less than any other algorithm. The bias of the measurement distances changes from 4.72 to 5.71 m. The bias of KF starts in the range of 0.11 to 0.45 m; the average value is 0.27 m. The CF bias stands at 0.28 m. Furthermore, the bias of the CFKF is 0.26 m. These results indicate that the CFKF error modeling provides the best accuracy and precision in the large area field experiment.

Conclusions
In this study, the development and experimentation of CFKF error modeling in iBeacon localization research have been carried out. Firstly, the experimental setup was established, and the iBeacon was positioned a meter away from the mobile receiver during the distance measurement error modeling calibration. The first step was to utilize the CF to process the raw data and calculate the measured power at 1 m. Subsequently, the measured distance was calculated by the distance equation using the received RSSI. To verify the accuracy, various algorithms were tested in the field experiments, with the results indicating that the CFKF error modeling provided the best precision and accuracy among all of them. This CFKF approach can be utilized in RSSI-based iBeacon/Bluetooth localization. In future research, machine learning algorithms could be combined with CFKF error modeling to improve localization performance. The state-of-the-art literature introduces machine learning algorithms based on RSS fingerprinting methods [31,43]. Our error modeling can enhance the calibration process of the online system, which will be demonstrated to improve the result to be more solid and robust. Data fusion techniques are another excellent approach for the future; recent research [44] proposes a method for the fusion of RSSI and magnetometer measurements. The CFKF will be adapted into more sensor networks, such as WIFI, RADAR, and laser range systems, to optimize the localization system's accuracy.