12 Replies Latest reply on Dec 1, 2014 8:55 AM by userc_6396

    WICED SENSOR SERVICE AND CHARACTERISTICS UUID's

      Hi Community,

       

      I am developing an Android App for the ongoing hackathon. I want to access only  Gyroscope and i required the UUID's of the sensor and the methodology to read Charaacteristics for  each sensor. Can someone please help me or provide me a data sheet which can be helpful?

      Thanks a lot, in advance

        • 1. Re: WICED SENSOR SERVICE AND CHARACTERISTICS UUID's

          Hello ishang,

           

          Please start here:

          WICED Sense SDK 2.1 Firmware.zip

           

          Thanks

          JT

          • 2. Re: WICED SENSOR SERVICE AND CHARACTERISTICS UUID's

            Hi j.t.

             

            I couldn’t get your reply. I am working on Android SDK and just need the UUID’s

            Please guide me. I am a bit new

             

            Best,

            Ishan

            • 3. Re: WICED SENSOR SERVICE AND CHARACTERISTICS UUID's

              You can look into source code (FW C-code or Android App).

               

              Or: you use an Android App which can scan.

              My like "nRF Master Control" but there are also some other nice BLE Apps where you can see UUIDs (and play with it, e.g. to enable Notification, Read/Write Characteristics ...), e.g. "BLE Device Monitor", "BLE Debugger" etc.

              For me the easiest way to use such App to discover the device.

              • 4. Re: WICED SENSOR SERVICE AND CHARACTERISTICS UUID's

                Hello ishan

                 

                we use Light Blue by Punch-thru as the App to read UUIDs and Characteristics

                thanks

                JT

                • 5. Re: WICED SENSOR SERVICE AND CHARACTERISTICS UUID's

                  WICEDSense_UUID_1.png

                  WICEDSense_UUID_2.png

                  WICEDSense_UUID_3.png

                  For your convenience.

                  Taken from "BLE Debugger" (other Apps might be better, here I do not see CCCD).

                  • 6. Re: WICED SENSOR SERVICE AND CHARACTERISTICS UUID's

                    Thanks a lot

                    Will be of great help ☺

                     

                    Ishan

                    • 7. Re: WICED SENSOR SERVICE AND CHARACTERISTICS UUID's

                      Hi,

                       

                      I downloaded the BLE debugger yesterday.

                      Some question:-

                      I think the Unknown Service is the “Sensor Service” and the characteristic under it is the “Characteristic for all the sensors”

                      So, all the sensor data will be coming under this characteristic not separately under different characteristics as it comes in Sensor Tag by TI

                      Please correct me if I am wrong.

                       

                      Ishan

                      • 8. Re: WICED SENSOR SERVICE AND CHARACTERISTICS UUID's

                        OK, here the explanation:

                        • most of the services and attributes are as "Unknown" because the WICED Sense FW does not not use "well known" and already defined UUID. The FW in device uses their own UUIDs, even there is a temperature feature and related UUID.
                          The sensor values will be sent anyway in in a proprietary format so that a standard device, assuming "Temp. would be UUID xx.yy.zz" cannot not find. It might make sense to go with "Unknown" here if the sensor values do not follow any rules how they are sent.
                          Don't care, just to bear in mind: when writing own App, you had to know the "private" UUIDs used and provided.
                        • The sensor service is under the one of the services with UUID: 739298B6-87B6-....
                          If you use another App, e.g. "nRF Master Control" you can activate the Notifications there and you will get the sensor values (on this App display, quite fast but works for me).
                        • I cannot say, when you see such a display: the first or the second is for the service: it depends, the order can change. So, if you want to know what is what - use really the UUIDs.
                        • The other service is for the OTA (Over The Air update). Do not touch it (there is a WRITE characteristic, do not try to write).

                         

                        Often, you can find such sensor service by following approach:

                        • Check, if you find any service which has a Characteristic with Notification (or Indication), if Read or not does not matter (here you find Read and Notification on only one service)
                        • If you use another App as mentioned, you should find also a "Client Configuration Characteristic" (shortened often as CCC or CCCD). On this you do not see anything, maybe a Write capability, but such a service which comes with Notification must have also a CCC/CCCD. Keep also this UUID handy.
                          If you want to subscribe for a service which is provided as Notification, the App has to write to its related CCC (a value 0x0001 for Notification). This will enable on device to send you Notifications to App.

                         

                        So, if you try to discover a device, watch for "Notification" (or "Indication") and if you find a CCC under this service. This might tell you: this is the service in order to aggregate some data from device, e.g. sensors.

                        (BTW: you can have more such services, it depends: it is possible that a device provides you all the sensors as separate services. Here it is just one, so it means: you get all sensor values together as one single Notification packet.)

                        If you find Write - be skeptical: it can be a UART, an LED ... but here it is OTA. When writing to it (some Apps allows to send something) - you could bring device in a strange state.

                        1 of 1 people found this helpful
                        • 9. Re: WICED SENSOR SERVICE AND CHARACTERISTICS UUID's

                          Hi community,

                           

                          Thanks userc_6396 for a wonderful reply. It helped me a lot.

                          Finally my android app is searching for BLE devices and able to see characteristics and services.

                           

                          I am having one doubt. The data inside service with UUID 739298B6-87B6-.... is containing all 0s…

                          What I think is the data should change if I am moving the WICED tag “accelerometer” if the following service contains the Sensor Data.

                           

                          Regards,

                          Ishan

                          • 10. Re: WICED SENSOR SERVICE AND CHARACTERISTICS UUID's

                            A bit lost:

                            Under this service you find an "Unknown Characteristic" and a "Descriptors" as "Client Characteristic Configuration" (CCC or CCCD).

                            If you have not written any non-zero value to the CCC - all your sensor values will be 0, under the "Unknown Characteristic". The Service itself does not have any data to see - it is just the parent node, the container for the characteristics and descriptors inside.

                             

                            So, you had to write to CCC, maybe not done. If you use "nRF Master Control Panel" as App - you can enable Notifications (which will do the write of value 0x0001 to CCC, the small icon there which is crossed because "enabled" and next state would be disable) for you. The tool you use might work a bit differently, maybe you have to see if you can write to CCC with it.

                             

                            Screenshot_2014-11-30-21-04-17.jpg

                            1 of 1 people found this helpful
                            • 11. Re: WICED SENSOR SERVICE AND CHARACTERISTICS UUID's

                              Okay,

                               

                              Basically I am writing an android app. I am able to scan the nearby BLE devices and see their characteristics (something like BLE) .

                              So from your reply, basically I have to write in the Client Characteristic Configuration , basically enable it. I will try doing it using android .

                               

                              Thanks,

                              Ishan

                              • 12. Re: WICED SENSOR SERVICE AND CHARACTERISTICS UUID's

                                Yes, you have to do: CCC must be written, actually with value 0x0001 for enabling Notifications, on device.

                                Please, do not forget: also on Android App you have to enable Notifications, in addition to it. There is an Android API call, e.g. in Java: GattManager.setCharacteristicNotification(characteristic, boolean)

                                 

                                The WICEDSense Android App has this code:

                                mGattManager.write(mSensorNotificationClientConfig,

                                                    mEnableSensorNotifications ? BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE

                                                            : BluetoothGattDescriptor.DISABLE_NOTIFICATION_VALUE);

                                 

                                and

                                boolean success = mGattManager.setCharacteristicNotification(mSensorNotification,

                                                mEnableSensorNotifications);

                                 

                                It works there in this way:

                                The App writes to the CCCD. There is a callback, when written, a function is called. Inside this functions is a check if via this WRITE the device notifications were enabled. If so, the App enables Notifications also for itself.

                                 

                                Helpful links:

                                android - What are the steps to get notified by Bluetooth Low Energy (BLE) device? - Stack Overflow

                                Bluetooth Low Energy | Android Developers