pentti12
(Pentti Immonen)
1
I am trying to access WiFi sensor web-page in order to obtain ready made temperature graphic. I got the following error:
Log Details (ERROR)
Mon Jan 14 2019 19:36:30 GMT+0200 (Itä-Euroopan normaaliaika)
Error getting new camera image: Response payload is not completed
The web-page source code contains following lines:
RakuTemp
html * {
font-family: Arial;
}
RakuTemp
You may want to config the wifi connection, refresh this page or update the firmware.
You are connected through the wifi network: koivulehto
My configuration is the following:
group:
default_view:
view: true
icon: mdi:home
entities:
- group.rakutemp
rakutemp:
name: Takan lämpötilat
control: hidden
entities:
- camera.takka
camera:
- platform: generic
name: takka
still_image_url: http://192.168.1.86
username: xxxxxxx
password: yyyyyyy
auhentication: basic
content-type: text/html
pentti12
(Pentti Immonen)
2
Update: the web-page source code is as the following:
<html><head>
<!DOCTYPE html><html><head><title>RakuTemp</title>
<script src='Chart.bundle.min.js'></script>
<style>
html * {
font-family: Arial;
}
</style>
<script>
var waitingForData = false;
var numData1 = 0;
var dataIdx1 = 0;
var numData2 = 0;
var dataIdx2 = 0;
//var numChunks = 0;
var chunkIdx1 = 0;
var chunkIdx2 = 0;
var numData1Added = 0;
var numData2Added = 0;
var MAX_SAMPLES = 2048;
var connection = new WebSocket('ws://'+location.hostname+':81/', ['arduino']);
connection.binaryType = 'arraybuffer';
var s1 = new Uint16Array(MAX_SAMPLES);
var s2 = new Uint16Array(MAX_SAMPLES);
connection.onopen = function () {
connection.send('Connect ' + new Date());
};
connection.onerror = function (error) {
console.log('WebSocket Error ', error);
};
connection.onmessage = function (e) {
console.log('onmsg type: ', typeof(e.data));
console.log('onmsg data: ', e.data);
if (typeof(e.data) == 'object') {
var data = e.data;
var dv = new DataView(data);
/*var idx = dataIdx1 - numData1;
if (idx < 0) idx += MAX_SAMPLES;
for (var n=0; n<numData1; n++) {
var tmp = dv.getUint16(idx*2, true);
console.log("idx " + idx + ": " + tmp);
if (++idx >= MAX_SAMPLES) idx = 0;
}*/
if (chunkIdx1 < MAX_SAMPLES) {
for (var n=0; n<MAX_SAMPLES/2; n++) {
s1[chunkIdx1++] = dv.getUint16(n*2, true);
}
}
else {
for (var n=0; n<MAX_SAMPLES/2; n++) {
s2[chunkIdx2++] = dv.getUint16(n*2, true);
}
}
if (chunkIdx2 == MAX_SAMPLES) {
console.log('All data received');
var idx = dataIdx1 - numData1;
if (idx < 0) idx += MAX_SAMPLES;
for (var n=0; n<numData1; n++) {
cfg.data.labels.push(numData1Added);
cfg.data.datasets[0].data.push(s1[idx]);
numData1Added++;
if (++idx >= MAX_SAMPLES) idx = 0;
}
myChart.update();
idx = dataIdx2 - numData2;
if (idx < 0) idx += MAX_SAMPLES;
for (var n=0; n<numData2; n++) {
cfg2.data.labels.push(numData2Added);
cfg2.data.datasets[0].data.push(s2[idx]);
numData2Added++;
if (++idx >= MAX_SAMPLES) idx = 0;
}
myChart2.update();
waitingForData = false;
}
}
if (typeof(e.data) == 'string') {
var tmp = e.data.split(' ');
if (tmp[0] == "D") {
waitingForData = true;
cfg.data.labels = [];
cfg.data.datasets[0].data = [];
dataIdx1 = parseInt(tmp[1]);
numData1 = parseInt(tmp[2]);
dataIdx2 = parseInt(tmp[3]);
numData2 = parseInt(tmp[4]);
chunkIdx1 = 0;
chunkIdx2 = 0;
var _max = parseInt(tmp[5]);
console.log('MAX_SAMPLES - ESP: ' + _max + ' WEB: ' + MAX_SAMPLES);
}
else {
//console.log('Server: ', e.data);
var _temp = parseInt(tmp[0]);
var _millis = parseInt(tmp[1]);
if (waitingForData) {
}
else {
console.log(_temp);
document.getElementById('a').innerHTML = _temp;
if(cfg.data.datasets[0].data.length == MAX_SAMPLES){
cfg.data.datasets[0].data.shift();
cfg.data.labels.shift();
}
cfg.data.labels.push(numData1Added);
cfg.data.datasets[0].data.push(_temp);
numData1Added++;
myChart.update();
if (tmp.length > 2) {
if(cfg2.data.datasets[0].data.length == MAX_SAMPLES){
cfg2.data.datasets[0].data.shift();
cfg2.data.labels.shift();
}
cfg2.data.labels.push(numData2Added);
cfg2.data.datasets[0].data.push(_temp);
numData2Added++;
myChart2.update();
}
}
}
}
};
</script></head><body>
<center style='font-size: 200%;'>
RakuTemp <b><span id='a'></span></b><br/>
<canvas id='myChart' width='400' height='240'></canvas>
<canvas id='myChart2' width='400' height='150'></canvas>
</center><br/>
<script>
var ctx = document.getElementById('myChart');
var cfg = {
type: 'line',
data: {
labels: [],
datasets: [{
radius: 0,
backgroundColor : 'rgba(243,134,48,0.5)',
borderColor : 'rgba(243,134,48,1)',
borderWidth : 2,
label: '68min',
data: []
}]
},
options: {
scales:
{
xAxes: [{
display: false
}]
}
}
};
var ctx2 = document.getElementById('myChart2');
var cfg2 = {
type: 'line',
data: {
labels: [],
datasets: [{
radius: 0,
backgroundColor : 'rgba(167,219,216,0.5)',
borderColor : 'rgba(167,219,216,1)',
borderWidth : 2,
label: '17h',
data: []
}]
},
options: {
scales:
{
xAxes: [{
display: false
}]
}
}
};
var myChart = new Chart(ctx, cfg);
var myChart2 = new Chart(ctx2, cfg2);
</script><p>You may want to <a href='/wifi'>config the wifi connection</a>, <a href='/'>refresh this page</a> or <a href='/update'>update the firmware</a>.</p></body></html><p>You are connected through the wifi network: koivulehto</p>