Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

Connected but no data
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

Connected but no data

by play2liv on Wed Mar 02, 2016 5:23 am

Hi All

I have a yun running on MQTT sketch provided by IO.adafruit. I can send onoff data to and from the server. I am trying to send Photocell and DTH11 data to the server. I get a count of how many time data has been sent but not actual sensor data. What did i miss im just starting on this? Any Ideas?

play2liv
 
Posts: 11
Joined: Sat Jan 24, 2015 3:23 am

Re: Connected but no data

by play2liv on Thu Mar 03, 2016 1:48 am

Ok I let it run about 24 hours. It counted to about 25000 before i restarted it tried some changes to the code. should it bee and integer or float?

play2liv
 
Posts: 11
Joined: Sat Jan 24, 2015 3:23 am

Re: Connected but no data

by play2liv on Sat Mar 05, 2016 11:35 pm

Hi all

I don't know if this will help. but i turned on the debug and here is what i'm getting now. No sensor data and what ever nan means.

OK!

Sending photocell val 0...OK!

Sending Humidity val 0...OK!

Sending Temperature val nan...OK!

Sending photocell val 0...OK!

Sending Humidity val 0...OK!

Sending Temperature val nan...OK!

Sending photocell val 0...OK!

Sending Humidity val 0...OK!

Sending Temperature val nan...OK!

play2liv
 
Posts: 11
Joined: Sat Jan 24, 2015 3:23 am

Re: Connected but no data

by play2liv on Sat Mar 05, 2016 11:53 pm

Thought of adding one where i use the only thing that seams to work. it it the on off button.

Sending Temperature val nan...OK!

Sending photocell val 0...OK!

Sending Humidity val 0...OK!

Sending Temperature val nan...OK!

Sending photocell val 0...OK!
Got: OFF
Got: ON
Got: OFF
Got: ON

play2liv
 
Posts: 11
Joined: Sat Jan 24, 2015 3:23 am

Re: Connected but no data

by robert90 on Mon Apr 04, 2016 10:28 pm

I had some of the same issues trying to run a sample sketch with a Adafruit Feather M0 WiFi https://www.adafruit.com/products/3010 board and SHT-31D Temperature/Humidity https://www.adafruit.com/products/2857%20board. I had the problem that the float values for temperature and humidity seemed to send fine in the serial output window but the values never showed up in the feeds. In the end I converted the floats for Temperature and Humidity to unsigned ints and then the feeds began working. The examples I've found so far seem to show integer values for temperature and humidity. The issue may be that floats are not supported by the feeds.

robert90
 
Posts: 22
Joined: Wed Feb 19, 2014 7:04 pm

Re: Connected but no data

by Mr_Paul on Mon Apr 04, 2016 11:35 pm

If you publish a the string version of a float it definitely works.

Mr_Paul
 
Posts: 24
Joined: Mon Dec 10, 2012 11:58 am

Re: Connected but no data

by play2liv on Wed Apr 06, 2016 12:47 pm

HI Is there any examples of the conversion to a string that you guys know of that i can take a look at to figure out what i have to do? Will post some code in a little while

play2liv
 
Posts: 11
Joined: Sat Jan 24, 2015 3:23 am

Re: Connected but no data

by chillypenguin on Wed Apr 06, 2016 1:41 pm

This is working for me;

Code: Select all | TOGGLE FULL SIZE
  // Grab the current state of the sensor
  float humidity_data = dht.readHumidity();
  float temperature_data = dht.readTemperature();

  // Publish data
  if (! temperature.publish(temperature_data,1))
    Serial.println(F("Failed to publish temperature"));
  else
    Serial.print(F("Temperature published: "));
    Serial.print(temperature_data,1);
    Serial.println(F("C"));
  if (! humidity.publish(humidity_data,1))
    Serial.println(F("Failed to publish humidity"));
  else
    Serial.print(F("Humidity published: "));
    Serial.print(humidity_data,1);
    Serial.println(F("%"));


Code is from here; https://learn.adafruit.com/home-automation-in-the-cloud-with-the-esp8266-and-adafruit-io just changed to "float" from "int".

chillypenguin
 
Posts: 8
Joined: Fri Apr 01, 2016 7:02 am

Please be positive and constructive with your questions and comments.