Coder Social home page Coder Social logo

plotly / arduino-api Goto Github PK

View Code? Open in Web Editor NEW
213.0 57.0 102.0 5.97 MB

Arduino library for real-time logging and streaming data to online plotly graphs

Home Page: https://plot.ly/

Arduino 5.99% C++ 26.68% Python 65.18% C 1.98% JavaScript 0.17%

arduino-api's People

Contributors

alexander-daniel avatar chriddyp avatar ivankravets avatar mkcor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arduino-api's Issues

... Attempting to resolve IP address of plot.ly

using
firmware 1.14 on CC3000 wifi shield
arduino IDE 1.0.6

the serial monitor hangs with:
... Attempting to resolve IP address of plot.ly

I would appreciate any ideas or next steps for troubleshooting. Thanks!

millis() time drift

As we all know plotly causes a time drift when sending the millis() with your data.
I know for sure my time drift in millis can be divided in 2. But whatever i tried i don't know how to do this.

Does anyone have a solution to this time drift issue ?

graph.plot(millis(), p1, tokens[0]); // if i can divide millis into 2 than my drift will be much more accurate.

Doc typo?

In the example code for the section Overwriting or Appending Data, there is a retry on init failure, but it looks like the graph.init retry is not in the loop. Am I missing something?

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

  startEthernet();

  bool success;
  graph.maxpoints = 500;
  graph.fileopt = "extend"; // Remove this if you want the graph to be overwritten
  success = graph.init();
  if(!success){while(true){}}
  graph.openStream();
}

avr/dtostrf.h: No such file or directory

Hi All,

When compiling using the Arduino IDE 1.0.5 on Ubuntu 13.10, and using the plotly_ethernet code, I get the following error:

C:\arduino-1.5.3\libraries\plotly_ethernet\plotly_ethernet.cpp:1:25: fatal error: avr/dtostrf.h: No such file or directory
compilation terminated.

There's a thread online about this issue:
http://forum.arduino.cc/index.php/topic,211656.0.html

I fixed the problem for myself by adding the "dtostrf" function directly at the end of my local copy of plotly_ethernet.cpp, as in the following gist:

https://gist.github.com/dwblair/9235676

Don't know if that's the most elegant / useful fix (or maybe I'm doing something else wrong, and this won't be an issue for other people) ...

Cheers!

Arduino 1.6.0

C:\Program Files\Arduino\hardware\arduino\avr\libraries\SPI/SPI.cpp:27: multiple definition of `SPIClass::begin()'
WiFi\utility\SPI.cpp.o:C:\Program Files\Arduino\libraries\WiFi\src\utility/SPI.cpp:34: first defined here

error": "Missing required POST parameters: platform un key origin args kwargs

Hello,
I'm using the example simple_ethernet from library 2.6 with Arduino Uno on IDE 1.0.5 . I followed the tutorial in every part and I get the following error. Is there anything I can do to resolve it?

Sending HTTP Post to plotly
POST /clientresp HTTP/1.1
Host: 107.21.214.199
User-Agent: Arduino/0.5.1
Content-Length: 333

version=2.3&origin=plot&platform=arduino&un=tiberioga&key=uIq106qtiHkLbs1xmRxO&args=[{"y": [], "x": [], "type": "scatter", "stream": {"token": "aw8880w4rb", "maxpoints": 30}}, {"y": [], "x": [], "type": "scatter", "stream": {"token": "etfj13mnkq", "maxpoints": 30}}]&kwargs={"fileopt": "overwrite", "filename": "test1", "world_readable": true}
... Sent message, waiting for plotly's response...
HTTP/1.1 200 OK
Server: nginx
Date: Thu, 24 Jan 2019 21:04:49 GMT
Content-Type: application/json
Content-Length: 138
Vary: Accept-Encoding
x-xss-protection: 1; mode=block
Content-Language: en
x-content-type-options: nosniff
Vary: Authorization, Cookie, Accept-Language, Origin
X-Frame-Options: SAMEORIGIN
Set-Cookie: plotly_sess_pr=0je8fe6rpxbs9pdxtj9zfl10ai5smg93; Domain=.plot.ly; expires=Thu, 07-Feb-2019 21:04:49 GMT; httponly; Max-Age=1209600; Path=/; secure
Set-Cookie: plotly_csrf_pr=loGLP9RIdArLu15PELA3VijELJriULm6; Domain=.plot.ly; expires=Sat, 25-Jan-2020 21:04:49 GMT; Max-Age=31622400; Path=/; secure
Set-Cookie: plotly_anoncsrf_pr=eqpRe4osqgxfGB0OECa3R2DCKJTaB8vm; Domain=.plot.ly; expires=Fri, 25-Jan-2019 21:04:49 GMT; httponly; Max-Age=86400; Path=/
Via: 1.1 google
Set-Cookie: GCLB=CM7IpfinndqjVw; path=/; HttpOnly

{"url": "", "message": "", "warning": "", "filename": "", "error": "Missing required POST parameters: platform un key origin args kwargs"}HTTP/1.0 400 Bad Request
Content-Type: text/html; charset=UTF-8
Referrer-Policy: no-referrer
Content-Length: 1555
Date: Thu, 24 Jan 2019 21:04:49 GMT

Arduino 1.6.0, SPI.h no such directory error

Hi... im recently use the plotly library... when i compile my coding im getting error which mention about SPI.h there no such directory error.. but when navigate to the "C:\Program Files (x86)\Arduino\libraries\WiFi\src\utility" those file SPI.h still in there...

I also read the guide which recommend to use Arduino IDE ver 1.03... i`m also try that but something like java.lang error come out....

If someone have solution for this issues.. kindly please share with us.. TQ.

Plot.ly browser page freezes after a couple hours

Using the Chrome browser and leaving it open to:
https://plot.ly/~WhiteRabbit/18/real-time-soil-moisture-plot-before-during-and-after-an-additional-2-rainfall/

the browser page freezes after a couple hours: no more updates displayed and no way to navigate what's there. I have to re-load the browser.

[Edit: I'm closing out this issue here, not because it's fixed, but because I've moved this issue to the plotly-nodejs section of github, as it seems like a better fit for there. ]

init() API is hang

Hello~

I'm trying to send my data to plotly with Intel Galileo Gen2. I have to use Arduino IDE 1.6.0.
I add dtostrf() at top of plotly_streaming_wifi.cpp.
I guess I'm connected to server but init API is not return every time.
So, I set debug level zero and after I can see last print as follow.
{"stream-host": "stream.plot.ly", "stream-status": "All Streams Go!", "url": "http://107.21.214.199/~BLINDED/99", "filename": "test", "warning": "", "error": "", "message": ""}

And short time is passed then printed as follow messages.
HTTP/1.1 408 REQUEST_TIMEOUT
Content-Length:0
Connection: Close

But init() API is not return.
I guess connection is closed but client.connected() still return true at that time.

if(!dry_run){
    while(client.connected()){
        if(client.available()){

Have a good day~

Error initializing stream, aborting

I get this error with the ehternet example.

... Initializing ethernet
... Done initializing ethernet
... Attempting to connect to plotly's REST servers
... Connected to plotly's REST servers
... Sending HTTP Post to plotly
... Error initializing stream, aborting. Try again or get in touch with Chris at [email protected]

Timestamps are being mapped in the future

Hello,

I am using a fork of this library with my Spark Core. The problem is that the timestamps sent from my Core to plotly are being mapped into the future. For example:

Time millis Plotly time millis diff(s) plotly diff(s) comments
Jul 24 15:33:15 171313 15:36:15 - - first data point
Jul 24 15:34:45 262044 15:39:16 90.731 181 second data point
Jul 24 15:56:10 1547074 16:22:06 - - -
Jul 24 15:57:42 1638964 16:25:10 91.890 184 -
Jul 24 15:59:15 1731419 16:28:15 92.455 185 -

The first data point si already mapped 3 minutes (180s) in the future. The second data point is 90.7s later in real time, but is mapped 181s later in plotly. Data points 3-5 are taken at a later time, but present the same behaviour.

Let me know if I can provide additional information.

How to send heartbeat to prevent stream closing from arduino api?

Under the plot.ly streaming API documentation, I read: "A client stops writing data for a time period longer than a minute. If a minute passes without receiving any data from the client the stream connection will be closed. (A connection can be maintained by writing a heartbeat within the 60 second window, a heartbeat is simply a newline)."

How to do this from the arduino api? It seems that I can only send numbers from the arduino api, not newline characters as above.

Please advise. I've been plotting sensor data that is updated roughly every 10 minutes or so, and it seems that the stream often gets closed or destroyed between postings to plotly. I think the above may be the reason why it is happening.

streaming plots sometimes connects current datapoint to very first datapoint when it shouldn't

Example: https://plot.ly/~WhiteRabbit/18/real-time-soil-moisture-plot-before-during-and-after-an-additional-2-rainfall/

You may need to click on "autoscale" to see it, as the plot sometimes opens up zoomed in rather close.

I believe the developers may be looking into this bug, but I'm documenting it here so as to track when it gets fixed.

Anyhow, the net effect is that the plot looks obviously faulty because of these spurious lines that shouldn't be there.

Update: you guys are great (and fast!). The problem is fixed. I'll close this out now.

ENC28j60 Support

Ethernet for < $10. Awesome!

Looks like there are a few libraries available:

To add support, edit the files here: https://github.com/plotly/arduino-api/blob/master/plotly_dev

There are several places in the code that are platform/client library dependant:

Basically just a bunch of differences in the network client libraries! the rest of the underlying code is all the same.

layout formatting not working in plotly_ethernet.cpp ?

Hi Folks!

I'm trying to send data to plot.ly using an Arduino Leonard + an Ethernet shield. Everything seems to be working nicely (great stuff @ plot.ly -- thanks!), but I'm having trouble sending the "layout" JSON info such that the server likes what it's getting.

The code I'm using is here: https://gist.github.com/dwblair/9236591

Here's the full response I'm getting:

Attempting to connect to plotly's servers...
Connected to plotly's servers

== Sending HTTP Post to plotly ==
POST /clientresp HTTP/1.1
Host: 107.21.214.199
User-Agent: Arduino/2.0
Content-Length: 523

version=0.2&origin=plot&platform=arduino&un=donblair&key=6f3ad11nnb&args=[[1296409, 18.90000, 1296563, 21.00000]]&kwargs={"filename": "olmTest_1", "fileopt": "extend", "transpose": true, "layout": {}, "convertTimestamp": true, "timezone": "America/Montreal", "sentTime": 1296573}
== Sent message, waiting for plotly's response ==
HTTP/1.1 200 OK
Date: Wed, 26 Feb 2014 19:29:12 GMT
Server: Apache/2.2.22 (Ubuntu)
Vary: Accept-Encoding
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8

70
{"url": "http://107.21.214.199/~donblair/2", "message": "", "warning": "", "filename": "olmTest_1", "error": ""}
0

Arduino Uno + WiFi shield cannot connect to REST server

Hi all,

I am using Arduino Uno with its WiFi shield to plot sensor data with plotly_streaming_wifi library. Every time Arduino connects to wifi network without a problem, but is unable establish the connection to plotly server. I use the same code given for this streaming library with arduino 1.3.0 version.

Here is my code which sends random data to a plotly graph :

include <plotly_streaming_wifi.h>

include <WiFi.h>

define nTraces 2

char *tokens[nTraces] = {"9upztvuxrt", "f66uebcznx"};
plotly graph("ranaya123", "iqlaivji2u", tokens, "pissu", nTraces);

int status = WL_IDLE_STATUS; // the Wifi radio's status
char ssid[] = "XXX"; // your network SSID (name)
char pass[] = "XXXXXXX123"; // // your network password

void wifi_connect(){
Serial.println("... Attempting to connect to WPA network...");
status = WiFi.begin(ssid, pass);
if ( status != WL_CONNECTED) {
Serial.println("... Couldn't get a WiFi connection, trying again");
wifi_connect();
}else {
Serial.println("... Connected to network");
}
}

void setup() {
graph.maxpoints = 100;
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
graph.fileopt = "overwrite";
wifi_connect();
bool success;
success = graph.init();
if(!success){while(true){}}
graph.openStream();
}

void loop() {
float h = random(1,5);
float t = random(1,50);
graph.plot(millis(), t, tokens[0]);
graph.plot(millis(), h, tokens[1]);
delay(3000);
}

In serial monitor, I am getting following messages in serial monitor.
... Attempting to connect to WPA network...
... Connected to network
... Attempting to connect to plotly's REST servers
... Couldn't connect to plotly's REST servers... trying again!
... Couldn't connect to plotly's REST servers... trying again!
... Couldn't connect to plotly's REST servers... trying again!

So is this a problem at server side ? If yes, can anyone explain me how to set the REST server at plotly site ?

Cant Connect to REST servers

include <WiFi.h>

include "plotly_streaming_wifi.h"

// Sign up to plotly here: https://plot.ly
// View your API key and streamtokens here: https://plot.ly/settings

define nTraces 2

// View your tokens here: https://plot.ly/settings
// Supply as many tokens as data traces
// e.g. if you want to ploty A0 and A1 vs time, supply two tokens
char *tokens[nTraces] = {"xvkznhcwzl", "yzppqud6ay"};
// arguments: username, api key, streaming token, filename
plotly graph = plotly("walkerbusby", "3vijh4c4fg", tokens, "test", nTraces);

int status = WL_IDLE_STATUS; // the Wifi radio's status
char ssid[] = "mokie"; // your network SSID (name)
char pass[] = "happiness1"; // // your network password

void wifi_connect(){
// attempt to connect using WPA2 encryption:
Serial.println("... Attempting to connect to WPA network...");
status = WiFi.begin(ssid, pass);
// if you're not connected, stop here:
if ( status != WL_CONNECTED) {
Serial.println("... Couldn't get a WiFi connection, trying again");
wifi_connect();
}
// if you are connected, print out info about the connection:
else {
Serial.println("... Connected to network");
}
}

void setup() {

// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}

wifi_connect();

graph.fileopt="overwrite"; // See the "Usage" section in https://github.com/plotly/arduino-api for details
bool success;
success = graph.init();
if(!success){while(true){}}
graph.openStream();
}

unsigned long x;
int y;

void loop() {
graph.plot(millis(), analogRead(A0), tokens[0]);
graph.plot(millis(), analogRead(A1), tokens[1]);

delay(200);

}

message in console

This is what I get in the console when I type node tmp36.js

module.js:340

throw err;

      ^

Error: Cannot find module '/Volumes/MiniMac/Users/dier02/tmp36.js'

at Function.Module._resolveFilename (module.js:338:15)

at Function.Module._load (module.js:280:25)

at Function.Module.runMain (module.js:497:10)

at startup (node.js:119:16)

at node.js:906:3

Nodemcu ESP8266 Compatibility

Hello.

I've got the code to compile and uploaded it onto a Nodemcu ESP8266.

I can't get past this though:

... Attempting to connect to WPA network...

I have tested another couple of scripts on the device and they connect to my network.

Any ideas?

Does it work with the latest version of Plotly ?

Hello dear maintainers of this api !
Have you tested this api if it works with latest version of plotly ? Because the online feature is removed from latest plotly.
Your precious comments will be highly appreciated.
Thank you

Two streams to the same graph ?

I would like to correlate two variables each coming from one sensor i.e. would like to correlate these variables on the same graph. So if I stream from two sensors (Arduinos) and point to the same filename, will the streams show up on the same graph ?

#include <avr/dtostrf.h> No such file or directory

When using the plotly_streaming_ethernet example I receive this error.

Again, much time spent researching it and testing several methods for a resolution and none have worked so far.

Documents/Arduino/libraries/plotly_streaming_ethernet/plotly_streaming_ethernet.cpp:6:25: fatal error: avr/dtostrf.h: No such file or directory
#include <avr/dtostrf.h>
^
compilation terminated.
Error compiling.

There is a suggestion for a fix but it doesn't work ( http://forum.arduino.cc/index.php/topic,211656.0.html )

Oh, and if you exclude <avr/dtostrf.h> , the compiler blows up with lots of problems. (maybe obviously, but they are pointing out double declarations such as "plotly: ploty"

Moving Average

I do not know how to plot a moving average for a streaming plot. Is this possible?

Specified folder/zip file does not contain a valid library

I can't install the library?
I downloaded the github .zip file for this library and
I am trying: Sketch> include library> add .zip library
and I get:
"
Arduino: 1.6.5 (Windows 8.1), Board: "Arduino/Genuino Uno"

Specified folder/zip file does not contain a valid library
"

what do i need to do to get this working?

Data values getting sometimes plotted at the wrong timestamp or the wrong chart.

This is something of a strange issue, and is actually affecting the Electric Imp rather than Arduino, but I think they're both using the same API so I'm raising the issue here. I've spent many hours trying to work out what's going wrong and I'm pretty much convinced now that the problem is not with my code (which can be found at https://github.com/jimconner/greenhouse_monitoring/tree/lux_pressure ). My code is loosely based upon the example plotly Electric Imp tmp36 tutorial ( https://plot.ly/electric-imp/tmp36-temperature-tutorial/ ), but has been extended as I've added more and more sensors to monitor. I'm now logging six different temperature sensors, plus air pressure and light levels.

My code used to work just fine back in January/February when I only had five temperature sensors attached, but the battery ran out on my Imp back in February so I hadn't attempted to log any data in the intervening months - When I powered the Imp back up again last week, I discovered some oddness in the plots.

I am sending sensor readings to plot.ly once per minute, and for the first 3-5 minutes, data appears on the plot as expected, but after a few minutes things seem to get rather confused. Readings seem to be getting logged into the wrong timestamp positions such that any given minute on the plot may show multiple readings from the same sensor. Some sensors are still plotting at the correct time values, but others get overlayed. In Grid view, somehow or other multiple sensors are getting combined into a single colume value (i.e. I'll have a column labelled "Ambient_Temperature,Water_Temperature"). To add to the confusion, sometimes the sensor values are not being logged to the correct plot at all, and instead I find that I have gained some new 'Grid xxx' objects in my workspace which contain a random collection of sensor readings.

I've logged the api requests I'm sending through, and every one of them looks perfect - The timestamp format is all correct, the sensors all have their 'name' field set correctly. The plotly layout object is sent along with each api request, detailing the plot title and filename, but somehow or other the data isn't ending up on the correct plot.

It's a weird weird problem which I am unable to explain - it's as if the data I'm sending through to plotly is not being sorted to the correct plot/timestamp as I'd expect.

Any insight you can offer would be greatly appreciated. I'm available to make modifications to my code, run tests, debug etc in whatever way I can help.

Streaming plots still connecting datapoints

I closed out #6 "streaming plots sometimes connects current datapoint to very first datapoint when it shouldn't" too soon.

The issue didn't get completely fixed. It doesn't connect to the very first datapoint now (which is good), but it does sometimes connect to earlier datapoints that aren't nearby (which is bad). I don't yet see what the pattern is, and it seems to happen somewhat intermittently, so I'm not sure how to describe it well enough for you to reproduce it. It shows up, from time to time, on the same streaming plotly I indicated earlier.

Is there a way to use my RTC timestamps instead of plotly's for streaming plots?

Is there a way I can send arduino RTC timestamps and get plotly to use those timestamps instead of plotly's in the streaming plots? millis() is just relative to the most recent initialization of the plot, rather than an absolute time, like unixtime. It would allow the arduino to save the datapoints which, for whatever reason, occasionally fail to post normally to plotly so that the arduino could programmatically add them to plotly at a later time when posting to plotly isn't failing. Not sure if this kind of patch-and-fill can always be accomplished using the arduini api that's currently in place, especially if the datastream gets re-initialized (because then the times that preceed the most recent initialization won't be accessible using the millis() framework, which is the only framework that I know of that's currently in place. The same would also be true if it's a time that preceeds millis() overflowing, as it inevitably will).

Problem when using Arduino IDE 1.5.8

While I'm using IDE 1.58 and compile the given example "sample_wifi". IDE shows that I need to include "#include <SPI.h>", after I done that, it shows that I need to include <avr/dtostrf.h>. I already add the 2.6 library in arduino. Is that any way I can fix the problem? I compile it under IDE 1.05 everything works fine.
Thank you!

Getting data

Is there any way I could get in html the plot's data on live streaming??

Store data on plot.ly servers using Rest API

Hello,

I have been using plotly_streaming_ethernet to stream and see live graph data. It works great.
However, let's say I want to store the temperature every 30 min for a year or more on plotly server
As far as I can see, the lib only offer to stream data and plotly offers visualization for a short period of time in 'stream' mode.

  1. Can I use your API to send static data and store them on plotly server ? ( I dont need streaming )
  2. Is there a plot limitation over time ? Using free version, we are entitled to 100 API call a day but I don't see any other limitation in their documentation.

Thanks

how to edit plot and just keep running?

I'm using an arduino to plot data in realtime:
https://plot.ly/~WhiteRabbit/182

A couple of the datapoints have the wrong values. I want to manually correct them and just keep running (actually never stop running). Is it possible to do that? I tried doing that. However, when it prompted me to save, I gave it the file name. But it didn't save there. Do I need to turn-off the arduino for this to work? Otherwise, what are the step-by-step instructions on how to do it? Please advise.

getting only 30 points, then cutting off.

mine was getting cut off after sending 30 data points. This is quite different then plot.ly displaying only the most recent 30. which seems to be the variable that we pass in Arduino IDE (graph.maxpoints). so, I looked in plotly_streaming_cc3000.h
changed
maxpoints = 30
to 300. It seems to be chugging along now past 30.

Can I remove maxpoints? and it will stream indefinitely?

Initializing Ethernet

Hello - I'm new to Plotly and I'm having a tough time getting this stream set up. My Serial Monitor just hangs on "Initializing Ethernet".

Any idea what the issue could be?

Hardware: Ardunio Uno + SeeedStudio Ethernet Shield v2 + DHT22

The SeeedStudio Ethernet shield doesn't have a mac address so I assume the one I have in there should be fine. It's solo on the network.

I have my Arduino plugged into my PC.
I have my Ethernet plugged into my Router
I haven't tried port forwarding yet - I have no idea what port to forward.

Green and Red LED on the Ethernet Shield = On
Little Orange light on the Ethernet Port is slowly blinking. So seems like there is no issue with the cable.

I ran the sample code in the Arduino IDE and I was able to get my private IP - so I believe my connection between hardware is fine.

Code:

include <SPI.h>

include <Ethernet.h>

include "plotly_streaming_ethernet.h"

include "DHT.h"

// Sign up to plotly here: https://plot.ly
// View your API key and streamtokens here: https://plot.ly/settings

define nTraces 2

// View your tokens here: https://plot.ly/settings
// Supply as many tokens as data traces
// e.g. if you want to ploty A0 and A1 vs time, supply two tokens
char *tokens[nTraces] = {"TOKEN1", "TOKEN2"};
// arguments: username, api key, streaming token, filename
plotly graph("Leishman", "API_KEY", tokens, "filename", nTraces);

// DHT Sensor Setup

define DHTPIN 2 // We have connected the DHT to Digital Pin 2

define DHTTYPE DHT22 // This is the type of DHT Sensor (Change it to DHT11 if you're using that model)

DHT dht(DHTPIN, DHTTYPE); // Initialize DHT object

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte my_ip[] = { 11, 111, 111, 11}; // google will tell you: "public ip address"

void startEthernet(){
Serial.println("... Initializing ethernet");
if(Ethernet.begin(mac) == 0){
Serial.println("... Failed to configure Ethernet using DHCP");
// no point in carrying on, so do nothing forevermore:
// try to congifure using IP address instead of DHCP:
Ethernet.begin(mac, my_ip);
}
Serial.println("... Done initializing ethernet");
delay(1000);
}

void setup() {
graph.maxpoints = 100;
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}

startEthernet();

bool success;
success = graph.init();
if(!success){while(true){}}
graph.openStream();
dht.begin();
}

float h, t;

void loop() {
h = dht.readHumidity();
t = dht.readTemperature();
graph.plot(millis(), t, tokens[0]);
graph.plot(millis(), h, tokens[1]);
}

My gut says its an issue with the router - but I'm not sure. Any suggestions or advice would be helpful. I'd really like to get something up and running on Plotly.

Timestamp not correct (Arduino)

Hi,

I'm using the streaming_ethernet library for arduino to permanently send electricity consumption of my home to the plot.ly server. At the start of the arduino the timestamps are correct. But after a while (5 mins or so) the timestamps of the recorded values ar lying in the future. The difference between the actual time and the timestamp of new points in the plot is getting more and more the longer the recording is. I'm using the code that is given in almost every example.

void loop() {

  Mlight = analogRead(2);
  Mpower = emon1.calcIrms(1480); // This is taken from openenergymonitor.com


  graph.plot(millis(), Mlight, tokens[0]);
  graph.plot(millis(), Mpower, tokens[1]);

delay(100);      

}

30 data points

By specifying

graph.maxpoints = 30;

Does that mean plotly also only stores 30 points of data? I was surprised to see all but 30 datapoints gone from my chart this morning after set off my sketch around midnight last night. Is there a way to indicate stored vs displayed?

Thanks
Justin

Arduino version 1.6.0

Arduino: 1.6.0 (Windows 7), Board: "Arduino Uno"

C:\Program Files\Arduino\libraries\WiFi\src\utility\spi_drv.cpp:21:17: fatal error: SPI.h: No such file or directory
#include <SPI.h>
^
compilation terminated.
Error compiling.

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.

No such file or directory compilation terminated. Error compiling.

fatal error: plotly_streaming_ethernet.h: No such file or directory compilation terminated. Error compiling.

include <Ethernet.h>

include <SPI.h>

include "plotly_streaming_ethernet.h"

I recently downloaded the Plotly Arduino Library and tried incorporating it to my Arduino Mega 2560. I also have the W5200 V.2 Ethernet Shield by seeedstudio piggy backed to it. I am connected via /dev/tty.usbmodem and programmer is set to USBtinyISP.

My issue is finding a resolution to an issue I am having. I receive this error whenever I compile...

/*
fatal error: plotly_streaming_ethernet.h: No such file or directory
compilation terminated.
Error compiling.

*/

I have searched the Internet for those who may have had similar issues.

Yes, I added the library properly
Yes, I have an updated version of the Arduino IDE.
Yes, I have restarted both my Mac & the IDE
Yes, I have uninstalled Arduino IDE and removed all traces of it and then reinstalled the software. (same with plotly library)

GSM STREAMING PROGRAM ERROR

I am currently using windows 7 32 bit os and have installed arduino ide1.0.6 ver .i tried compiling the example programme https://github.com/plotly/arduino-api/blob/master/examples/gsm/simple_gsm.ino
and returns me the following errors ,kindly please anyone let me know the solution for this problems

C:\Users\Prakaash.J\Desktop\arduino-1.0.6\libraries\GSM\GSM3ShieldV1ModemVerification.cpp: In member function 'String GSM3ShieldV1ModemVerification::getIMEI()':
C:\Users\Prakaash.J\Desktop\arduino-1.0.6\libraries\GSM\GSM3ShieldV1ModemVerification.cpp:72: error: conversion from 'int' to 'String' is ambiguous
C:\Users\Prakaash.J\Desktop\arduino-1.0.6\hardware\arduino\cores\arduino/WString.h:61: note: candidates are: String::String(const FlashStringHelper)
C:\Users\Prakaash.J\Desktop\arduino-1.0.6\hardware\arduino\cores\arduino/WString.h:59: note: String::String(const char
)

avr/dstrtof.h No such file or directory in Arduino 1.6

Reference issue #3. Possible duplicate of issue #34 (though we come to different conclusions).

Arduino made a pretty big change (not too long ago) in the compiler toolchain moving from the Arduino 1.0 branch to the Arduino 1.6 branch (which is now the mainline). Arduino 1.0.6 shipped with avr-gcc version 4.3.2 and AVR-Libc 1.6.4, and Arduino 1.6.0 ships with avr-gcc version 4.8.1 and AVR-Libc 1.8.0.

Net result, if you try and compile in 1.0.6 you get no errors, but if you try and compile in 1.6.0 you get:

fatal error: avr/dtostrf.h: No such file or directory
 #include <avr/dtostrf.h>

The weird thing is I don't know how it compiles in 1.0.6 because I can't find such a file in the 1.0.6 directory structure either, and dtostrf definitely seems to be part of stdlib.h, not this mythical avr/dtostrf.h.

In fact, if I merely comment out the #include <avr/dtostrf.h> it still compiles fine in both 1.0.6 and 1.6.0. Even seems to work ๐Ÿ‘. Note I'm using Ubuntu 14.04 64-bit, fwiw.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.