Arduino 101 won't appear on my phone's bluetooth list

Hi guys,

I'm having trouble getting my arduino 101 to appear on my cell phone's bluetooth list. My code is listed below.

I was getting it to appear and making connections prior to adding the IOTCharacteristic attribute shown in the line below to the ArduinoIOT peripheral.

ArduinoIOT.addAttribute(IOTCharacteristic);

It seems as soon as I added that, the arduino quit appearing on my device list. Any help would be appreciated.


#include <SPI.h>
#include <Ethernet.h>
#include <CurieBLE.h>
#include "Mudbus.h"

Mudbus Mb;
BLEPeripheral ArduinoIOT;
BLEService IOTservice("fbd6d91a-118a-11e7-93ae-92361f002671");
BLEUnsignedCharCharacteristic IOTCharacteristic("fbd6d91a-118a-11e7-93ae-92361f002671", BLERead | 
BLENotify);

int i=0;
//signed int Mb.R[0 to 125] and bool Mb.C[0 to 128]
//Modbus on Port 502 (defined in Mudbus.h)

void setup()
{
Serial.begin(9600);

uint8_t mac[] = { 0x90, 0xA2, 0xDA, 0x10, 0xD0, 0x96 };
uint8_t ip[] = { 192, 168, 0, 12 };
uint8_t gateway[] = { 192, 168, 0, 1 };
uint8_t subnet[] = { 255, 255, 255, 0 };
Ethernet.begin(mac, ip, gateway, subnet);

ArduinoIOT.setLocalName("IOT");
ArduinoIOT.addAttribute(IOTCharacteristic);
ArduinoIOT.addAttribute(IOTservice);
ArduinoIOT.setAdvertisedServiceUuid(IOTservice.uuid());

ArduinoIOT.begin();
}

void loop()
{

BLECentral central = ArduinoIOT.central();
Mb.Run();

if (central) {
Serial.print("Connected to: ");
Serial.println(central.address());
while(central.connected()){
i += 1;
IOTCharacteristic.setValue(i);
}
}
else{
Serial.println("Not connected");
}

delay(2000);
}

UPDATE:

So I finally got my Arduino to show up on Bluetooth in case this happens to anyone else.

Putting the UUIDs in all uppercase fixed the issues (I have no idea why). I'm new to Arduinos, so the case sensitivity throws me off a bit at times.