Friday, July 21, 2017

BlessTags: saving the data

BlessTags: saving the data

     The ability to save your recorded data (from all or from some of the sensors place on a SensorTag) is one of the most important feature of the blessTags application. In this way, the data can be analyzed, processed, or viewed later – on the same system with which the recordings were made, or it can be send (email, ftp, usb stick etc.) to a third person.
     Currently, the blessTags application can only save data in txt format.
    The acquisition process can be initiated from the user interface (locally) or by pressing one of the SensorTag button (remotely). Then, the data can be saved simply by pressing a button on the graphical interface and indicating the name of the file where the data will be saved.


Start the acquisition process from the user interface – the local mode

So, let's start the presentation:
  1. Push the “Refresh Sensor Tag List” button;
  2. Select the type of SensorTag - one from the discovered SensorTag (s) (theoretically there are four possibilities: CC2541DK, CC2650STK, Thunderboard React and Thunderboard Sense);
  3. Select the specific SensorTag;
If these steps (1 to 3) were done previously, you no longer need to do them anymore.
  1. Press the “Set Sensors & Acq” button.
  2. From the “Set SensorTag parameters” window, first you must enable at least the sensors from which you want to save the data.
From the figure shown above, it can be seen that I enabled: all accelerometer sensor channels, the magnetometer, the temperature sensor and the light sensor.
  1. Second, select from the Save field the sensors from which you want to save the data. Also, select the number of samples (from each channel) or the time window required to be saved. Note that "No. samples", "Time window" and "Acquisition Timer" controls are linked to each other – the information entered in one of these elements will influence the values in the other two.
  2. Push the button “Set the values”.
Notice now that only the enabled sensors are validated on the graphical interface. 
  1. To save data you need to open a graphical interface. One of the graphical interfaces associated with one of enabled sensor. So, check one of the corresponding checkbox from the main panel. In the bottom right corner of the graphical window, notice the "Start Acq." and “Save data” buttons. The button "Start Acq." will be active only if there are no other data acquisition in progress and the sensor associated with the graphical window has been marked as one from which data will be saved!
  1. To start the acquisition process, press the "Start Acq." button.
  2. Only when the acquisition process is finish, the “Save data” button will be validated. Push the “Save data” button to save in a file the acquired data.
  3. In the new open window enter the file name in the "File name" field and, then, click the "OK" button.
On the hard drive, you will have a file with a similar content:

           AccX              AccY             AccZ                Light
        -0.19283         0.049357       -0.166504              152.24
      -0.134969        -0.059021       -0.062134      159.213333
      -0.056925              -0.138        0.046448        90.106667
      -0.050435        -0.203308        0.093628        20.426667
      -0.121989        -0.189636        0.032227        19.853333
      -0.169434        -0.095988       -0.076253        21.806667
      -0.170654          -0.09668       -0.050293        27.546667
      -0.173442        -0.196879         -0.06897                37.03
      -0.177022        -0.172078       -0.082886                32.78
      -0.163696        -0.036051         -0.07843        19.046667

     Note that in the end only the data from {the enabled sensor(s)} and {from sensor(s) selected to be saved} will be saved. 
    The buttons "Start Acq." and “Save data” will be validated only when they can do their job properly. For example, the "Start Acq." button will be activated only when all the conditions are met to save the data for at least one sensor. The button “Save data” will be validated only when there are internally stored data, previously acquired.

Start the acquisition process remotely – from the SensorTag

To start remotely the acquisition process, you have still to do the following steps:
  1. In addition to point 5 please:
  •  for the CC2541 tick the boxes: “Key notification”, “Test mode” and “Input SW”.

  • For the CC2650 tick the check boxes “Key Notification” and “Input SW and/or Reed” – see the below figure.

  • For the Thunderboard React and Sense tick the check boxes “Inputs Keys data” and Push Buttons “Notification” – see the below figure (the figure is for the setting panel associated with the Thunderboard Sense SensorTag).

  1. To be able to tart the acquisition remotely (from the SensorTag), first, you must to validate this function. To do this open the graphical interface associated with the buttons placed on the SensorTag. In the bottom part of the window you can select the desire input able to start the acquisition: (a) SW1, SW2 or SW3 for the CC2541, (b) SW1, SW2 or reed for CC2650 and (c) SW1 or SW2 for the Thunderboard React and Sense SensorTags. Once the association is done, you can close this window.
Graphical window for user input elements - CC2541 and CC2650
Graphical window for user input elements - Thunderboard React and Sense

  1. Now, to start remotely the acquisition process: press the selected button or close the magnet to the reed sensor (for CC2650). At this point, the sensor data acquisition process will begin. Information about the state of the input devices, controlled by the user, will be also recorded - buttons or reed sensor. 
     The next two steps (10 and 11) required to saving data are similar to those presented in the previous sub-chapter: “Start the acquisition process from the interface – the locally mode”.
     Thank you very much for using this app and please come back to this blog, new features will be implemented as soon as possible.
This application,  blessTags (BLE SensorTags) application, can be downloaded from the Windows Store Apps: