Author Topic: RFduino repeated loses connection  (Read 2446 times)

relliott127

  • RFduino Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
RFduino repeated loses connection
« on: April 16, 2014, 12:38:25 PM »
uploading a simple humidity sketch to RFduino and repeated drops bluetooth service. I have to reload the software to get it to broadcast again. Here is sketch:
#include <DHT.h>
#include <RFduinoBLE.h>
#define DHTPIN 3     // what pin we're connected to
#define DHTTYPE DHT11   // DHT 11


int probe = 3; //probe pin
DHT dht (DHTPIN, DHTTYPE);
void setup()
{
 RFduinoBLE.deviceName = "Humid1";
  RFduinoBLE.advertisementData = "Humidity";
  RFduinoBLE.begin();
  dht.begin();
  pinMode(probe, INPUT);
}
void loop(){
  float h  = dht.readHumidity();
  RFduinoBLE.sendFloat(h);   
 
//sends the humidity number

}
On iPhone program that I am running I repeatedly get the erro Code 6 "the connection has timed out unexpectedly".

I have tried some similar programs using the DHT.h files with similar results. If I run a simple included RFduino temperature program I get a rare, once very 10 minutes stop in data send but does not drop the connection.

Appreciate the help.

relliott127

  • RFduino Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: RFduino repeated loses connection
« Reply #1 on: April 16, 2014, 03:48:43 PM »
CoreBluetooth[WARNING] <CBCentralManager: 0x17e70d10> is disabling duplicate filtering, but is using the default queue (main thread) for delegate events

This is what the Log on the computer posts right before it quits.

tolson

  • Global Moderator
  • *****
  • Posts: 827
  • Karma: +19/-0
    • View Profile
    • Thomas Olson Consulting
Re: RFduino repeated loses connection
« Reply #2 on: April 17, 2014, 01:25:51 PM »
You are assigning pin3 as DHTPIN and then re-assigning it to 'probe'.

Instantiating the DHT library makes pin 3 an input or an output depending which way it is talking to DHT.
DHT dht (DHTPIN, DHTTYPE);
Then you are defining it as an input again explicitly.
  pinMode(probe, INPUT);

How about remove your probe statements. Perhaps these are conflicting.
« Last Edit: April 17, 2014, 02:01:29 PM by tolson »

tolson

  • Global Moderator
  • *****
  • Posts: 827
  • Karma: +19/-0
    • View Profile
    • Thomas Olson Consulting
Re: RFduino repeated loses connection
« Reply #3 on: April 17, 2014, 03:33:32 PM »
I started a new topic on using DHT with BLE active...

DHT Sensors with BLE
« Last Edit: April 17, 2014, 03:53:43 PM by tolson »

pcrosland

  • RFduino Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: RFduino repeated loses connection
« Reply #4 on: July 26, 2016, 11:31:38 AM »
I had similar issue. Are you powering the DHT11 through the module?  If so then it's only getting 3v which is the minimal for powering the sensor. When we switched to using the nominal (5v) it fixed the issue.

 

anything