4 Replies Latest reply on Aug 25, 2017 3:09 PM by KimLorentz

    BLE Service - Location and Navigation, help needed

    KimLorentz

      Can anyone help me With the Location and Navigation Service off the BLE?

       

      I want to be able to read UTC Time, Latitude, Longitude, HDOP and VDOP.

        • 1. Re: BLE Service - Location and Navigation, help needed
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          Hi KimLorentz,
           
          Thanks for your interest in the Intel Curie platform.
           
          Could you please let me know if you are using the Arduino IDE or the Curie ODK?
           
          I have found an article about using BLE with the Arduino 101* Board, that discusses how to create a BLE Service and communicate with an Android device. In this article also is set up a BLE blood pressure monitoring system to demonstrate the BLE capabilities of the Arduino 101*, therefore, you can take that example as a reference to set up the Localization and Navigation service and the characteristics you need. Please take a look at the article for more details: Use Bluetooth® Low Energy Technology with the Arduino 101* Board.
           
          Hope you find this information useful.
           
          Regards,
          -Yermi A.
           

          • 2. Re: BLE Service - Location and Navigation, help needed
            KimLorentz

            I found out that my tinyTILE Board BLE system is not working. but the BLE on arduino 101 I also have is working.

            How do I fix the BLE firmware on the tinyTILE Board? or how to reflash the tinyTILE to be an arduino 101.

             

            Can I use the Curie ODK to install a New bootloader on the Board?

            Where do I find the Curie ODK?

            • 3. Re: BLE Service - Location and Navigation, help needed
              Intel Corporation
              This message was posted on behalf of Intel Corporation

              Hi,
               
              The Intel Curie ODK documentation can be found on this site: Intel® Curie™ Open Developer Kit (ODK), it includes three firmware source trees (A, M, and Z). The A tree is the actual Arduino 101 product firmware source code, so you can try to install and use the A tree, additionally, you can try to update the BLE firmware following this instructions: Installing and Using the A Tree.
               
              Regarding the bootloader we recommend you do not modify it, however, in case the bootloader is damaged, you will need to use JTAG to recover it, take a look at this site for more details: About the Bootloader.
               
              Regards,
              -Yermi A.
               

              • 4. Re: BLE Service - Location and Navigation, help needed
                KimLorentz

                Tnx got it working. The fault was found on the Iphone. I needed to reboot the Bluetooth everytime I changed the code on the intel curie.

                 

                 

                Here is my test code for multiple BLE services. still working on the lat/long part but gething closer.

                 

                 

                /*
                BLEBoolCharacteristic
                BLECharCharacteristic
                BLEUnsignedCharCharacteristic
                BLEShortCharacteristic
                BLEUnsignedShortCharacteristic
                BLEIntCharacteristic
                BLEUnsignedIntCharacteristic
                BLELongCharacteristic
                BLEUnsignedLongCharacteristic
                BLEFloatCharacteristic
                BLEDoubleCharacteristic
                */
                #include <CurieBLE.h>
                
                BLEPeripheral blePeripheral;  // BLE Peripheral Device (the board you're programming)
                BLEService ledService("19B10000-E8F2-537E-4F6C-D104768A1214"); // BLE LED Service
                BLEService batteryService("180F"); // BLE Battery Service
                BLEService temperatureService("1809"); // BLE Temperature Service
                
                // BLE LED Switch Characteristic - custom 128-bit UUID, read and writable by central
                BLEUnsignedCharCharacteristic switchCharacteristic("19B10001-E8F2-537E-4F6C-D104768A1214", BLERead | BLEWrite);
                BLEUnsignedCharCharacteristic batteryLevelChar("2A19", BLERead | BLENotify);
                BLEFloatCharacteristic tempChar("2A3C", BLERead | BLENotify);
                
                const int ledPin = 13; // pin to use for the LED
                int oldBatteryLevel = 0;  // last battery level reading from analog input
                float tempLevel = 12.258;
                long previousMillis = 0;  // last time the battery level was checked, in ms
                
                
                
                void setup() {
                  Serial.begin(9600);
                  // set LED pin to output mode
                  pinMode(ledPin, OUTPUT);
                
                  // set advertised local name and service UUID:
                  blePeripheral.setDeviceName("NRH-01");
                  delay(100);
                  blePeripheral.setLocalName("NRH-01");
                  delay(100);
                  blePeripheral.setAdvertisedServiceUuid(ledService.uuid());
                  blePeripheral.setAdvertisedServiceUuid(batteryService.uuid());
                  blePeripheral.setAdvertisedServiceUuid(temperatureService.uuid());
                
                  // add service and characteristic:
                  blePeripheral.addAttribute(ledService);
                  blePeripheral.addAttribute(switchCharacteristic);
                  
                  blePeripheral.addAttribute(batteryService);
                  blePeripheral.addAttribute(batteryLevelChar);
                
                  blePeripheral.addAttribute(temperatureService);
                  blePeripheral.addAttribute(tempChar);
                
                  // set the initial value for the characeristic:
                  switchCharacteristic.setValue(0);
                  batteryLevelChar.setValue(oldBatteryLevel);
                  tempChar.setValue(tempLevel);
                
                  // begin advertising BLE service:
                  blePeripheral.begin();
                  Serial.println("BLE LED Peripheral");
                }
                
                void loop() {
                  // listen for BLE peripherals to connect:
                  BLECentral central = blePeripheral.central();
                  // if a central is connected to peripheral:
                  if (central) {
                    Serial.print("Connected to central: ");
                    // print the central's MAC address:
                    Serial.println(central.address());
                    // while the central is still connected to peripheral:
                    while (central.connected()) {
                      // if the remote device wrote to the characteristic,
                      // use the value to control the LED:
                      if (switchCharacteristic.written()) {
                        if (switchCharacteristic.value()) {   // any value other than 0
                          Serial.println("LED on");
                          digitalWrite(ledPin, HIGH);         // will turn the LED on
                        } else {                              // a 0 value
                          Serial.println(F("LED off"));
                          digitalWrite(ledPin, LOW);          // will turn the LED off
                        }
                      }
                      long currentMillis = millis();
                      if (currentMillis - previousMillis >= 200) {
                        previousMillis = currentMillis;
                        updateBatteryLevel();
                      }      
                    }
                    // when the central disconnects, print it out:
                    Serial.print(F("Disconnected from central: "));
                    Serial.println(central.address());
                  }
                }
                void updateBatteryLevel() {
                  /* Read the current voltage level on the A0 analog input pin.
                     This is used here to simulate the charge level of a battery.
                  */
                  int battery = analogRead(A0);
                  int batteryLevel = map(battery, 0, 1023, 0, 100);
                  if (batteryLevel != oldBatteryLevel) {      // if the battery level has changed
                    Serial.print("Battery Level % is now: "); // print it
                    Serial.println(batteryLevel);
                    batteryLevelChar.setValue(batteryLevel);  // and update the battery level characteristic
                    oldBatteryLevel = batteryLevel;           // save the level for next comparison
                  }
                }