MQTT vs HTTP for Bluetooth WiFi Gateways?

Bluetooth WiFi gateways offer MQTT and/or HTTP for sending data to servers/cloud services. We are often asked which should be used. HTTP is what’s used by your web browser to fetch and send data to web servers. In very high level terms, MQTT accomplishes a similar thing but is better optimised for mobile devices and the Internet of Things.

HTTP is very ‘chatty’ which means it’s more complex, code wise, to implement at the sending end and wastes a lot of data and processing power getting information from sender to receiver. You can think of HTTP as wrapping the data within lots other data that gets sent backwards and forwards. MQ Telemetry Transport Protocol (MQTT) came out of IBM, is now an ISO standard and uses lightweight publish/subscribe messaging. It requires a smaller code footprint at the sender and uses less network bandwidth. This matters most when you are trying to get the maximum transactions per second or are being billed for data use.

Bluetooth WiFi gateways are powered via USB and have reasonably powerful microcontrollers so MQTT’s efficient processing doesn’t matter that much. The more efficient processing is more applicable to apps running on mobile devices. For example, Facebook uses MQTT which saves battery life.

However, being lightweight, MQTT offers faster response times and lower data use than HTTP that, while not necessarily being of much of an advantantage for the BLE WiFi gateway, benefits the communications medium and server side. The communications medium, that can sometimes be cellular or be data constrained, uses (and possibly bills) less data. More crucially, the server can process more requests in less time. MQTT tends to be better when connectivity is intermittent, bandwidth is at a premium and throughput is critical.

In summary, MQTT has lower latency and is more efficient. Whether these are required advantages depends on your actual project. If you need more help, consider our development services.

Is There a Beacon That Works Without Bluetooth On?

We sometimes get asked if it’s possible that smartphones can detect beacons without Bluetooth being on. All beacons are based on Bluetooth LE that, in turn, relies on Bluetooth being switched on in the phone to scan for beacons. There’s no magic underling operating system mechanism on iOS nor Android that allows you to use Bluetooth without the user having Bluetooth on.

More users are leaving their Bluetooth on due to the proliferation of connecting with other devices such as cars, Bluetooth headphones and smart speakers. If you are writing an app you should take steps to detect if Bluetooth is on and prompt the user appropriately.

The phone and beacon industries need to better educate users that Bluetooth is no longer the heavy battery drainer it was in the early days of smartphones.

How Accurate is Bluetooth Direction Finding?

Bluetooth direction finding promises sub-meter accuracy. In practice, the accuracy varies depending on factors such as the locator hardware quality, radio signal noise, surfaces causing radio reflections, the accuracy of locator placement and beacon orientation. The sophistication of the location engine software in mitigating some of the aforementioned factors can improve the accuracy.

As a guideline, our Location Engine with the Minew G2/AR1 tends to find beacons with a maximum angular error range between 6° to 10°, depending on the above factors. The error in position due to an error in angle gets magnified with distance from the locator. Hence, the accuracy also depends on the distance between the locator and the beacon.

Here are graphs of error vs distance for 6° error and 10° error:

The above accuracies are for hardware such as the Minew G2/AR1 with PCB antennas 50mm apart. It’s expected that greater accuracies might be achieved with hardware having greater inter-antenna distances.

It can be seen that the sub-meter promise has caveats. We have some tips to help reduce angular errors. Averaging data, over time, also reduces angular error with the trade-off of increased latency of detecting location changes. As with all locating technologies, headline performance claims need to be carefully examined and are only achievable in particular situations.

Read about PrecisionRTLS™

Do You Have a Beacon That Makes a Sound When You Are Near?

The quick answer is no.

The longer answer is that beacons don’t know if anyone is near because they are not doing the listening. They just send out information. It’s possible to have a smartphone app see the beacon and the phone make a sound.

F6 Tracker Beacon

We also have special tracker type beacons to which an app can connect rather than just detect. Once connected, the app can cause the beacon to ring. However, only one app user can connect at a time.

Is it Possible to Continuously Scan for Bluetooth Devices on iOS and Android?

We sometimes get asked if it’s possible to use a smartphone as a gateway to scan for Bluetooth devices. The thinking is usually that workers or users already have devices so why not make use of them?

While it is possible, there are many reasons why you might not want to do this:

  • On iOS, Apple hide Bluetooth MAC addresses and for some APIs hide the iBeacon ids making unique identification more difficult.
  • You will find it very difficult to get a continuously scanning app through Apple app store review. You will need strong justifications.
  • Scanning continuously uses lots of battery power, even when advertising with periodic ‘off’ and ‘on’ periods.
  • Capabilities of devices vary meaning you will almost certainly get some end user devices where your implementation won’t work. For example, some manufacturers stop long running processes.
  • Some users will play with their phones and end up purposely or inadvertently disabling your application.

The best scenarios are those where you can dictate the phone type, it can be mains (PSU) powered and the phone isn’t owned by a user (i.e. it’s just used as a gateway). It’s almost always better to use a dedicated gateway.

What’s the Smallest iBeacon?

Small beacons are sometimes needed so that they remain unobtrusive or need to be embedded into larger devices. The smallest, cased, beacons we supply are:

The compromise with small beacons is that they have CR2032 batteries that don’t last as long as larger battery beacons. If the beacons won’t be moving and you have access to USB power, consider using USB beacons that are also small.

What are Beacon OTA Updates?

Beacons are small computers that run software, more specifically firmware. Beacon manufacturers write the firmware that uses Bluetooth software libraries to send out iBeacon, Eddystone and/or sensor data advertising.

When a beacon supports over-the-air (OTA) update, it allows that firmware to be updated without physically connecting to the beacon with wires. A smartphone app, such as the manufacturers’ app or the generic Nordic nRF Toolbox is used to connect to the beacon via Bluetooth and update the firmware.

In practice, manufacturers never update their firmware so whether a beacon supports OTA update or not isn’t usually an issue.

A further use of OTA is the facilitation of custom firmware when the standard firmware needs to be updated to provide for specially required functionality. This is non-trivial and ideally needs to be performed by the original manufacturer because they have the original source code. We have arranged this for a few customers but it tends to only be financially viable for large orders.

Programming jig

It’s also possible to completely replace the software in some beacons, something we provide via custom solutions and used in our social distancing and mesh solutions. In these cases, OTA tends to be too slow so wired programming jigs are sometimes used instead.

What’s the Best Beacon?

Too many potential customers contact us asking what’s the least expensive beacon that provides the best range, the best battery life and the smallest size. Unfortunately, all these things are related. You need a larger battery to provide enough power for a longer range. A large battery implies a larger beacon size. A larger battery and case implies a more expensive beacon. The choice of ‘best’ beacon usually involves some sort of compromise.

It’s also often the case that customers focus on price, range, battery life and size without considering other factors such as:

  • Visual appearance – Good-looking beacons can sometimes be counter-productive as they can be attractive to thieves.
  • App – Some manufacturer configuration apps are easier to use than others.
  • Waterproofing – Some unexpected scenarios need waterproofing due to high humidity.
  • Motion triggering – Some beacons provide motion triggering to significantly increase battery life.
  • On-off button – It’s sometimes desirable to be able to turn the beacon on and off without having to remove the battery.
  • Attachment options – Some beacons include strong double sided stickers, tabs for screws or holes for fastening.

View All Beacons

What Can Block Beacon Signals?

We often get questions asking what kinds of things can block Bluetooth signals and enquiries about the relative blocking of different materials.

Metal obstructions or metal-based surfaces such as metal-reinforced concrete cause the most blocking followed by other dense building materials such as plaster and concrete. Next comes water that you might not think would be a problem but, as people are made up of 60% water, bodies blocking Bluetooth signals can be a significant factor. Least blocking are glass (but not bulletproof), wood and plastics.

Blocking can be caused by wireless noise as well and physical obstructions. This includes electrical noise from other electrical equipment as well as interference from devices using the same 2.4GHz frequency. WiFi on 2.4GHz causes negligible interference.

In extreme cases, a very large number of Bluetooth devices can cause interference with each other because only one can advertise at a time without there being collisions and hence lost data. The maximum number of Bluetooth devices depends on how long and how often the Bluetooth devices transmit. It also depends on whether devices are just advertising or additionally using GATT connections. Bluetooth also has adaptive frequency hopping that helps reduce packet interference.

We have a deeper analysis of interference in the post on Bluetooth LE on the Factory Floor.