Top Internet of Things Daily & Weekly

Using Python to Store Data From Many BLE Devices

Using Python to Store Data From Many BLE Devices  #IoT #Cloud #BigData

  • BLE (Bluetooth Low Energy) sensor devices like the Hexiwear are great, but they cannot store a large amount of data.
  • For a research project, I have to collect data from many BLE devices for later processing.
  • What I’m using is a Python script running on a Raspberry Pi, which collects the data and stores it on a file:

    The following script gets sensor data from a single device:

    Calling it with the device ID, it gets the sensor node data, appends it to the file, and shows it on the console:

    The data gets stored into a CSV text file.

  • That brings us to the following script file:

    The script has a list of BLE devices, which are used to poll the data.

  • With a Raspberry Pi and Python scripting, I can collect data from multiple BLE devices and store the information into a file for further processing.

It’s hard to connect to more than eight BLE devices at one time, which makes it harder to collect large amounts of data. Here’s a Python script to avoid it.

@craigbrownphd: Using Python to Store Data From Many BLE Devices #IoT #Cloud #BigData

BLE (Bluetooth Low Energy) sensor devices like the Hexiwear are great, but they cannot store a large amount of data. For a research project, I have to collect data from many BLE devices for later processing. What I’m using is a Python script running on a Raspberry Pi, which collects the data and stores it on a file:

The following script gets sensor data from a single device:

Calling it with the device ID, it gets the sensor node data, appends it to the file, and shows it on the console:

The data gets stored into a CSV text file.

That brings us to the following script file:

The script has a list of BLE devices, which are used to poll the data.

With a Raspberry Pi and Python scripting, I can collect data from multiple BLE devices and store the information into a file for further processing. Because I don’t need to keep the BLE connection active, I can extend this to an almost unlimited number of devices, without running into the typical BLE connection limit of around eight devices.

I’m using a similar method to update all the devices (e.g. with the current time/date), plus I have implemented a remote shell in each BLE device: That way, I can send commands to each node, which then are executed on the BLE device.

The Python scripts used can be found on GitHub.

Happy saving!

Using Python to Store Data From Many BLE Devices