SORRY FOR INTERRUPTING YOU GUYS. I'M ALSO INTERESTED IN THE COMMUNICATION BETWEEN THE 2 CPUs. BUT THIS IS THE PERFECT MOMENT TO ASK ANOTHER QUESTION

@chriddyplz:
I'm trying to achieve the same "live"-plotting!
I monitor temperatures with Plotly, but use the python api of Plotly. The Arduino 32u4 measures temperatures with sensors, writes them into a txt-file every 3-4 sec (and shows them on a lcd-display) and a infinitly looping python script (in the linino-side) uploads the latest temperature every 30 sec to plotly. ***
My problem:
Why isn't my graph refreshed/updated on the Plot.ly website on its own (currently I have to press "reload" manually)?
Is this "live"-streaming only possible if I use plotly's arduino sketch code? If I reload the plot.ly-page the latest data is included in the chart...but I'd like to see it "live"/every 30-40s refreshed by itself (a browser autorefresh-plugin is not what I'm looking for

).
This is the code regarding plotly in my python script:
py = plotly.plotly( "MYUSERNAME", "MYKEY")
xaxesstyle = {
"title" : "Time",
# "titlefont" : {
# "color" : "lightgrey",
# "family" : "Arial, sans-serif",
# "size" : 18,
# }
"showticklabels" : True,
"showgrid" : True,
"gridcolor" : "#bdbdbd",
"gridwidth" : 1,
"zeroline" : True,
"zerolinecolor" : "#969696",
"zerolinewidth" : 3
}
yaxesstyle = {
"title" : "Temperatures in C",
"showticklabels" : True,
"showgrid" : True,
"gridcolor" : "#bdbdbd",
"gridwidth" : 1,
"zeroline" : True,
"zerolinecolor" : "#969696",
"zerolinewidth" : 3
}
layout = { "title": "PLOT TITLE",
"xaxis" : xaxesstyle,
"yaxis" : yaxesstyle,
}
#((THE FOLLOWING LINES are included in a neverending WHILE-loop (= 1.open txt, 2.put temperatures into variables, 3.upload the variables to Plotly, 4. close the txt, 5. wait until the 32u4 writes new temperatures into the txt, then reopen txt again... ))
data = [{'x': x,
'y': temp1, # variable 1
'name':'Room 1',
'type':'scatter',
'marker': {'symbol':'square','color':'red'}
},
{'x': x,
'y': temp2, # variable 2
'name':'Room 2',
'type':'scatter',
'marker':{'color':'orange'}
},
{'x': x,
'y': temp3, # variable 3
'name':'Loggersensor(Temp+Humidity)',
'marker':{'symbol':'circle', 'size': humidity3, 'color':'green', 'opacity': 0.50} # humidity3 is variable 4 (for bubbles)
}
]
response = py.plot(data, filename='TempLog' , fileopt='extend', layout=layout)
url = response['url']
Where is my mistake?! Why doesn't my chart refresh itself "live"? Why do I have to press manually on "reload" to see the latest temp-data?
*** = if you are interested why I use this method (32u4->AR9331->Plot.ly) instead of the direct way (32u4->Plot.ly):
This way....
1. ....I save a lot of sketch-space and can do almost everything within one file (the python script),
2. ...can be (more) sure that timestamps are correct after a internet or power loss (I get timestamps from the linino which tries to sync to a ntp-server every minute and e.g. halts temperature-uploading when the internet-connection halts or something else happens, so the timeline of my plot won't ever get "out of order, then the script restarts etc....),
3. ....exceptions of all kinds can be handled quite nicely,
4. ....I can change the design/layout etc. of my plot within the python-script quite easily (see my code).
5. ....there is far more information on the internet about python-scripts/-code than there is about arduino-sketches