ryantxu / ajax-panel

Ajax Panel Plugin for Grafana
MIT License
153 stars 154 forks source link

Get image from camera - "data": null #15

Open dlsmlss opened 6 years ago

dlsmlss commented 6 years ago

Versions:

dismiss@mss-grafana01:~/tmp$ sudo grafana-cli -v
Grafana cli version 5.2.1

dismiss@mss-grafana01:~/tmp$ sudo grafana-cli plugins ls
installed plugins:
grafana-clock-panel @ 0.1.0 
grafana-piechart-panel @ 1.3.3 
grafana-worldmap-panel @ 0.0.13 
ryantxu-ajax-panel @ 0.0.5 

What i get with curl on same host:

dismiss@mss-grafana01:~/tmp$ curl -vs http://172.21.27.50/GetImage.cgi?CH=0 --output ./img05.jpeg
*   Trying 172.21.27.50...
* TCP_NODELAY set
* Connected to 172.21.27.50 (172.21.27.50) port 80 (#0)
> GET /GetImage.cgi?CH=0 HTTP/1.1
> Host: 172.21.27.50
> User-Agent: curl/7.58.0
> Accept: */*
> 
* HTTP 1.0, assume close after body
< HTTP/1.0 200 Ok
< Server: httpd
< Date: Thu, 26 Jul 2018 07:22:53 GMT
< Cache-Control: no-cache
< Pragma: no-cache
< Expires: 0
< Connection: close
< Content-Type: image/jpeg
< 
{ [1277 bytes data]
* Closing connection 0

In browser: image

In Grafana (used Image Sending "Accept" header example):

image

Tried Blob/Array buffer response but still got blank screen.

And if i switch to Display tab and select Preformatted text i got more details on error:

<h1>Error</h1><pre>{
 "err": {
  "data": null,
  "status": -1,
  "config": {
   "method": "GET",
   "transformRequest": [
    null
   ],
   "transformResponse": [
    null
   ],
   "jsonpCallbackParam": "callback",
   "responseType": "arraybuffer",
   "url": "http://172.21.27.50/GetImage.cgi?CH=0",
   "params": {},
   "headers": {
    "Accept": "image/jpeg"
   },
   "cache": false,
   "withCredentials": false,
   "retry": 0
  },
  "statusText": "",
  "xhrStatus": "error"
 },
 "cancelled": true
}</pre>

What I'm doing wrong?