0

Data coming in the feed with sensors and dashboard on not se
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Data coming in the feed with sensors and dashboard on not se

by Invision1 on Sat Dec 09, 2017 3:17 pm

UPDATE 12.16.17
I have contacted Support several times. I was told someone would response within 3 business days. Then I was told I'd get a response by the end of the day Thursday. Neither of these things happened. I had to cancel a live demo for 120 people and literally wasted the last 2 weeks of my live and $500 in electronics purchased from Adafruit in building this project for the whole thing to fail because the API is not functioning properly. Not a single technical support contact. I have been a huge supporter and champion of adafruit for years, and I'm having a difficult time understanding this lack of support and communication.


UPDATE: I've discovered that the API is just not updating. If I press on a sensor, it delivers a "1", but if I let go it does not register that it has gone back to "0".

If I add a "0" to the feed inside the dashboard it changes the value to "0" and then it can be triggered by the actual sensors. BUT does not go back to zero.

Any ideas would be mu appreciated!

Original Post
I'm using a bunch of Huzzah Feathers, running a simple arduino digital input sketch. Every time a sensor is pressed it sends data to the feed and triggers an action, but there seems to be a lot of 1s in the feed that are not triggered by me using the sensors and do not show up in the dashboard on the API, which is https://io.adafruit.com/api/v2/Invision ... de622fc76d
Attachments
https   io.adafruit.com api v2 Invision1 groups default feeds x aio key 2e1ea0688b2746d4b0fa15de622fc76d.png
https io.adafruit.com api v2 Invision1 groups default feeds x aio key 2e1ea0688b2746d4b0fa15de622fc76d.png (216.23 KiB) Viewed 1496 times
IO   SIT.png
IO SIT.png (36.1 KiB) Viewed 1496 times

Invision1
 
Posts: 6
Joined: Thu Nov 30, 2017 4:19 am

Re: Data coming in the feed with sensors and dashboard on no

by adafruit_support_carter on Mon Dec 18, 2017 7:41 pm

Can you provide more details about your hardware setup and the code you are using? A photo of the hardware setup would be best. And you can paste code listing here.

adafruit_support_carter
 
Posts: 7473
Joined: Tue Nov 29, 2016 2:45 pm

Re: Data coming in the feed with sensors and dashboard on no

by Invision1 on Tue Dec 19, 2017 7:19 pm

Using Huzzah Feather w/ ESP8266 Wifi with an FSR sensor. Press down on it and deliver a "1" value", release and deliver a "0".

Arduino code is:
Code: Select all | TOGGLE FULL SIZE
// digital pin 5
#define BUTTON_PIN 5

// button state
bool current = false;
bool last = false;

// set up the 'digital1' feed
AdafruitIO_Feed *digital1 = io.feed("digital1");

void setup() {

  // set button pin as an input
  pinMode(BUTTON_PIN, INPUT_PULLUP);

  // start the serial connection
  Serial.begin(115200);

  // wait for serial monitor to open
  while(! Serial);

  // connect to io.adafruit.com
  Serial.print("Connecting to Adafruit IO");
  io.connect();

  // wait for a connection
  while(io.status() < AIO_CONNECTED) {
    Serial.print(".");
    delay(500);
  }

  // we are connected
  Serial.println();
  Serial.println(io.statusText());

}

void loop() {

  // io.run(); is required for all sketches.
  // it should always be present at the top of your loop
  // function. it keeps the client connected to
  // io.adafruit.com, and processes any incoming data.
  io.run();

  // grab the current state of the button.
  // we have to flip the logic because we are
  // using INPUT_PULLUP.
  if(digitalRead(BUTTON_PIN) == LOW)
    current = true;
  else
    current = false;

  // return if the value hasn't changed
  if(current == last)
    return;

  // save the current state to the 'digital1' feed on adafruit io
  Serial.print("sending button -> ");
  Serial.println(current);
  digital1->save(current);

  // store last button state
  last = current;

}

Thanks

Jason
Last edited by adafruit_support_carter on Wed Dec 20, 2017 12:53 pm, edited 1 time in total.
Reason: added [code] tags

Invision1
 
Posts: 6
Joined: Thu Nov 30, 2017 4:19 am

Re: Data coming in the feed with sensors and dashboard on no

by adafruit_support_carter on Wed Dec 20, 2017 3:49 pm

Getting unexpected 1's could have to do with how the FSR sensor is wired in. But I wouldn't expect you to get multiple same values in a row, either 1's or 0's, since it checks for a change and only updates when there is one.

Your code is basically the digital in example from the library. I just tested that with a Feather ESP8266 and a standard push button, all per this guide:
https://learn.adafruit.com/adafruit-io- ... ital-input
and I don't see any unexpected values or any multiple repeated values. Can you try testing with a regular push button and follow that guide and see if you get the same behavior?

adafruit_support_carter
 
Posts: 7473
Joined: Tue Nov 29, 2016 2:45 pm

Re: Data coming in the feed with sensors and dashboard on no

by Invision1 on Wed Dec 20, 2017 4:30 pm

I'm not getting "unexpected 1's", I'm just not getting the "0"s

Yep, simple sketch straight from the library. I just don't understand how this is a hardware or sketch issue and not an API issue. I can test with whatever input I want and get the correct response in the dashboard and at the same time see that that data is not updating through the API.

Everything works perfectly in the adafruit dash, just not through the API.

If I manually input data in the dashboard and reset all the feeds to "0", I can get the IOT devices to deliver a "1" through the API, but then it just stays there. I have to reset the data with manual data inputs to get each one to go back to "0" through the API. Can that really be an input problem?

I will try what you have suggested. Thanks.

Invision1
 
Posts: 6
Joined: Thu Nov 30, 2017 4:19 am

Re: Data coming in the feed with sensors and dashboard on no

by adafruit_support_carter on Thu Dec 21, 2017 12:03 pm

I will try what you have suggested. Thanks.

Thanks. That will help, since I can't recreate the issue. Report back on what happens.

adafruit_support_carter
 
Posts: 7473
Joined: Tue Nov 29, 2016 2:45 pm

Re: Data coming in the feed with sensors and dashboard on no

by Invision1 on Thu Dec 21, 2017 1:03 pm

Could not find any buttons this morning, and I don't need a button input I need an FSR input that tells me with a 1 or 0 that there is pressure on the sensor or not. It works in the serial monitor, it works in the dashboard it just does not deliver the value to the API. Here is our API feed https://io.adafruit.com/api/v2/Invision ... de622fc76d

If you go into my account dashboard and trigger values you can see they only update to a "1" and do not return to "0" even though they have returned to "0" in the dashboard, in the serial monitor, and on the IOT device itself.

Thoughts? Seems to me it works and gives the the correct data in the serial monitor, the correct data in the dashboard and incorrect data in the API feed.

Thanks

Invision1
 
Posts: 6
Joined: Thu Nov 30, 2017 4:19 am

Re: Data coming in the feed with sensors and dashboard on no

by abachman on Thu Dec 21, 2017 3:06 pm

Hi Invision1,


I'm taking a look at your issues now, but PLEASE reset your account key immediately, you've leaked it with the URL you shared, which means anyone is able to control data on your Adafruit IO account.


- Adam B.

abachman
 
Posts: 242
Joined: Mon Feb 01, 2010 12:48 pm

Re: Data coming in the feed with sensors and dashboard on no

by Invision1 on Thu Dec 21, 2017 3:17 pm

Oops! Just changed it. Thanks.

Invision1
 
Posts: 6
Joined: Thu Nov 30, 2017 4:19 am

Re: Data coming in the feed with sensors and dashboard on no

by abachman on Thu Dec 21, 2017 4:34 pm

Hello again,

Using this sketch: https://gist.github.com/abachman/4eccad ... 1aacef2226 (the digital input example with the addition of an LED connected to pin 4) I get the expected behavior. IO receives the string "1" when the button is pressed and the string "0" when the button is released. The behavior used by the sketch is here in the Adafruit IO library.

Note that when passing a boolean value into the feed->save method of the Adafruit_IO_Arduino library, it's converted to a string "1" if true and a string "0" if false. If you want to control what is actually sent to IO, I recommend using an int or String type.

Some things to try for troubleshooting:

Keep your monitor page open to view all incoming messages and errors, you may see something unexpected there. Visit https://io.adafruit.com/monitor when you're signed in to see your monitor.

Consider adding something to your device or devices that will show you the state of the sensor without sending data to IO and make sure the state is changing in the way you expect. The serial monitor is good for this, but it's worth having it print the exact same value you're having it send.

Try setting a different value on the feed when the button state changes. For example, instead of:
Code: Select all | TOGGLE FULL SIZE
digital->save(current);


You could try:
Code: Select all | TOGGLE FULL SIZE
char *message = "OFF";
if (current) message = "ON";
digital->save(message);


And see if that comes through on your feed any differently.

I'm not familiar with switching from buttons to force sensitive resistors, so I'd have to play around with one to make sure all the sketch logic works exactly the same.

Thoughts? Seems to me it works and gives the the correct data in the serial monitor, the correct data in the dashboard and incorrect data in the API feed.


I don't think I'm clear on the difference between the dashboard and API you're talking about here. The dashboard is directly driven by the MQTT API, so if a value is getting sent to a feed, it will be reflected on the dashboard. In this case, maybe it's an issue of what the dashboard toggle button is expecting? The toggle buttons are controlled by string matching feed values to button text values, so they'll only show the on (green) state if the value of the feed exactly matches the button text. You could try adding a stream block or blocks to the dashboard you're looking at so you can see the values as they come in.

Or are you getting more data in specific feeds than you believe you are sending from the devices, or are you getting data at the right time but it's not the data you expect?

Also worth noting that no one who is not you or who is signed in as you should be able to write to your feeds. If you make the feeds public, they can read from them or subscribe via MQTT, but they won't be able to send data.


- Adam

abachman
 
Posts: 242
Joined: Mon Feb 01, 2010 12:48 pm

Re: Data coming in the feed with sensors and dashboard on no

by Invision1 on Thu Dec 21, 2017 4:56 pm

I will try these suggestions soon and post the results. Thank you!

Invision1
 
Posts: 6
Joined: Thu Nov 30, 2017 4:19 am

Re: Data coming in the feed with sensors and dashboard on no

by TSOAM on Mon Jan 08, 2018 1:17 pm

That did not change anything, and is something we previously tried. Any other suggestions before I pull the plug on Adafruit IO and try it on another platform? Thanks for trying to figure this out with me.

TSOAM
 
Posts: 2
Joined: Thu Aug 04, 2016 11:56 am

Re: Data coming in the feed with sensors and dashboard on no

by abachman on Mon Jan 08, 2018 2:19 pm

Hi TSOAM,


I don't think I'm clear on the problem you're having. What didn't change anything and is something you tried? What error messages or unexpected behavior are you seeing? What code are you running and what devices and libraries are you using?


- adam

abachman
 
Posts: 242
Joined: Mon Feb 01, 2010 12:48 pm

Please be positive and constructive with your questions and comments.