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
Hey there @justinwagg
Streamed points are not saved the same way as creating a static graph. When you put maxpoints 50, it means that once the maxium has been reached, if you are still streaming, the points will start to fall off.
Alternatively, you can view the streaming graph in the browser and click on "save" to take a snapshot.
One good way to keep all of your data is to occasinally send REST calls with static data for storage, and keep your streaming plot for live monitoring...
Feel free to ping me if that dosen't make sense or you need any help! Cheers, Alex
Please tell me what you mean by "REST call" I want to store the data that is send from my arduino permamently. At the moment it feels like the data that is not shown in the streaming plot is lost.
Since the Arduino can only open one tcp connection at one time (I guess the W5200 can open more, but I prefer to use the single board Arduino Ethernet), how does one occasionally make REST calls with static data and then make calls for streaming ? Are they going to the same server ?
@Ghenghiz @aj8uppal , you are correct, my apologies. We originally had two separate ways of sending data from an arduino, streaming, and REST. Unfortunately due to the limitations of the Arduino, we had to settle on one and went with streaming.
I'll look into this and get back to you both ASAP.
In the meantime, it is fairly easy to set up the Arduino to communicate with your laptop, Pi, etc using serial and javascript. This is my preferred method, as it allows for a lot more flexibility. (You do however need a Pi or have the Arduino connected to your laptop... but a Pi is ~ the same $$ as a wifi shield)
https://github.com/plotly/arduino-api/tree/master/plotly_streaming_serial
I'll keep you posted on Native Arduino options. Sorry for the confusion, I hope this helps!
Arduino+Pi or Laptop works, but is not the best solution for me. Native Arduino is the best. My air pollution monitors are "headless" and the Pi gave a lot of headaches :-) because when power fails, and it fails often in remote locations, the recovery from a Pi crash is much more difficult to deal with than power to an Arduino failing. See www.indiaairquality.com for my application.
I love plotly though and it would be great to stream and save data. How about opening the connection to the server, streaming the data, closing the connection, then reopening to make a REST call to store the data ? Is the REST API published somewhere that we can make construct HTTP POST calls in the Arduino IDE ?
Hello everyone! @alexander-daniel
Is this still an issue? I'd like to help with this.
I do think we can do what @aj8uppal and switch from streaming to making REST calls repeatedly. However, I'm not exactly sure how I should go about this.