0

Public Dashboards
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Public Dashboards

by btreichel on Sun Dec 10, 2017 2:15 am

Was chatting on the discord adafruit-io channel about being able to use things like sliders, etc to send data back, and found out if I go in 'incognito" with a browser, or with an alias, I can see the dashboard, but its says "There is no data to display".

Ok, found out how to make my feeds public, and then lost my slider controls. Restored them (added again), and took everything private, but now they won't change value.

Reconfirmed it today. No code changes, but the sliders 'snap back" to zero now, and don't pass data back to the huz.

Code: Select all | TOGGLE FULL SIZE
// Adafruit IO Group Subscribe Example
//
// Adafruit invests time and resources providing this open source code.
// Please support Adafruit and open source hardware by purchasing
// products from Adafruit!
//
// Written by Todd Treece for Adafruit Industries
// Copyright (c) 2016 Adafruit Industries
// Licensed under the MIT license.
//
// All text above must be included in any redistribution.

/************************** Configuration ***********************************/

// edit the config.h tab and enter your Adafruit IO credentials
// and any additional configuration needed for WiFi, cellular,
// or ethernet clients.
#include "config.h"

/************************ Example Starts Here *******************************/

// set up the group
AdafruitIO_Group *group = io.group("roaster_data");
AdafruitIO_Feed *get_gas = io.feed("get_gas");
AdafruitIO_Feed *get_fan = io.feed("get_fan");

float inlet_temp = 450;
float bean_temp = 100;
float outlet_temp = 400;
float ror = 50;
int gas_data = 0;
int fan_data = 0;
 
void setup() {

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

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

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

  get_gas->onMessage(rcv_gas);
  get_fan->onMessage(rcv_fan);
 
  // 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();

  group->set("inlet-temp", inlet_temp);
  group->set("bean-temp", bean_temp);
  group->set("outlet-temp", outlet_temp);
  group->set("ROR-1", ror);
  group->set("fan-data", fan_data);
  group->set("gas-data", gas_data);
  group->save();

   // increment data
  inlet_temp += 0.0625;
  bean_temp += 0.38375;
  outlet_temp += 0.0625;
  ror -= 0.05625;

  if(bean_temp > 413){
    inlet_temp = 450;
    bean_temp = 100;
    outlet_temp = 400;
    ror = 50;
  }


  // wait one second (1000 milliseconds == 1 second)
  delay(1000);
}

void rcv_fan(AdafruitIO_Data *data) {
       fan_data = (data->toInt());
       Serial.println(fan_data);
}

void rcv_gas(AdafruitIO_Data *data) {
      gas_data = (data->toInt());
      Serial.println(gas_data);
}

btreichel
 
Posts: 79
Joined: Tue Jul 25, 2017 3:00 pm

Re: Public Dashboards

by btreichel on Mon Dec 11, 2017 4:03 pm

Ok, I got the functionality back, but I had to delete the dashboard and data feed. Basically re-build everything. It remains stable as long as I don't take my sliders public. Because of the way it displays with only some of the data public, I made a dashboard that is public, with only the public feeds.

However, only two of the four values update on the public feed. the initial value is correct, then ....

Here it is, I'm testing it by launching an incognito window in chrome.

https://io.adafruit.com/btreichel/dashb ... ster-temps

btreichel
 
Posts: 79
Joined: Tue Jul 25, 2017 3:00 pm

Re: Public Dashboards

by btreichel on Wed Dec 13, 2017 1:46 pm

In the past 24hr I've noticed public feed twitch to private, and I didn't do it. So I went back and put them public, one now works, one doesn't. I've noticed funky behavior before with marking feeds public/private, but figured I was just confused. I don't know if theres an update cycle, or what, but one works, one doesn't.

btreichel
 
Posts: 79
Joined: Tue Jul 25, 2017 3:00 pm

Re: Public Dashboards

by btreichel on Wed Dec 13, 2017 1:59 pm

Checked back, can see it now. I would be nice to hear a little background information.

btreichel
 
Posts: 79
Joined: Tue Jul 25, 2017 3:00 pm

Re: Public Dashboards

by jdswope on Sat Dec 30, 2017 12:50 pm

Hi,
I'm kind of having a similar problem. Made all the feeds and dashboard public to share with friends but, nobody can use the switches or slider controls to control anything. I thought that was the purpose of making the dashboard, feeds, and controls public. What gives?

jdswope
 
Posts: 4
Joined: Mon Apr 03, 2017 2:59 pm

Re: Public Dashboards

by abachman on Tue Jan 02, 2018 3:34 pm

Hi jdswope,


Unfortunately, due the way per-user storage limits and rate limits work for Adafruit IO, we aren't able to provide publicly (anonymous) writable feeds. The way our rate-limiting and storage are set up right now, if someone can update your feeds anonymously then they can run a denial-of-service attack on your account by publishing data continuously without you being able to stop it other than by deleting the feed or making it private. It's possible that system will change in the future, but it's not in our current plans.

The controls are visible on public dashboards because they're part of the page and show the values they control, but they can't actually change the state of the feeds they point at. It would make sense, though, to disable controls when a user is viewing a dashboard they don't own. That might help clarify the intent of controls on public dashboards.


- adam

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

Re: Public Dashboards

by rmalbers on Thu Jan 04, 2018 7:51 pm

I was going to ask about this when I found this thread, I take from what you are saying, if I make my "temp readings" dashboard 'public' there is really no security exposure? I can see the point about have read/write being a problem.

rmalbers
 
Posts: 1
Joined: Sat Dec 30, 2017 2:20 pm

Re: Public Dashboards

by jdswope on Thu Jan 04, 2018 9:55 pm

Excellent explanation ! Thank you!

jdswope
 
Posts: 4
Joined: Mon Apr 03, 2017 2:59 pm

Please be positive and constructive with your questions and comments.