Received data in incorrect format

Hi All,

I setup my emon-Pi yesterday. It was working all fine, until this morning I keep getting this on the top of the graph.
Request error: Received data not in correct format. Check the logs for more details

the logs under errors shows this.

.

I tried down loading the data as well and all i get is this

Try logout and login again. I get the same message when connection is lost due to power failure (had a lot of these recently!).

hmm, I have tried that still seem to be getting the same message? any suggestion on how to retrieve the data.

Hi Mahran, welcome,

The log you posted is the EmonHub log, not the EmonCMS log (under Admin).

Try refreshing the page (ctl-reload) and clearing the browser cache. You can also try opening the page in a ‘private’ window.

Under Admin, can you click on the button ‘copy as markdown’ next to ‘Server Information’ and paste here (no further formatting required).

thanks Brian,
here you go, I cannot seem to download locally , but setup the remote one, that seems to work. but my application will mainly be local.

Server Information

Server Information

Services

  • emonhub :- Active Running
  • emoncms_mqtt :- Active Running
  • feedwriter :- Active Running - sleep 300s 48 feed points pending write
  • service-runner :- Active Running
  • emonPiLCD :- Active Running
  • redis-server :- Active Running
  • mosquitto :- Active Running
  • demandshaper :- Active Running

Emoncms

Server

  • OS :- Linux 4.19.75-v7+
  • Host :- emonpi | emonpi | (192.168.1.142)
  • Date :- 2019-11-14 09:40:13 UTC
  • Uptime :- 09:40:13 up 3:01, 0 users, load average: 0.11, 0.08, 0.08

Memory

  • RAM :- Used: 18.83%
    • Total :- 975.62 MB
    • Used :- 183.74 MB
    • Free :- 791.88 MB
  • Swap :- Used: 0.00%
    • Total :- 100 MB
    • Used :- 0 B
    • Free :- 100 MB
      Write Load Period

Disk

  • / :- Used: 46.58%
    • Total :- 3.92 GB
    • Used :- 1.83 GB
    • Free :- 1.9 GB
    • Write Load :- 884.88 B/s (2 hours 7 mins)
  • /var/opt/emoncms :- Used: 0.04%
    • Total :- 9.98 GB
    • Used :- 3.78 MB
    • Free :- 9.47 GB
    • Write Load :- 27.23 B/s (2 hours 7 mins)
  • /boot :- Used: 20.55%
    • Total :- 252.05 MB
    • Used :- 51.79 MB
    • Free :- 200.26 MB
    • Write Load :- 0 B/s (2 hours 7 mins)
  • /var/log :- Used: 9.36%
    • Total :- 50 MB
    • Used :- 4.68 MB
    • Free :- 45.32 MB
    • Write Load :- n/a

HTTP

  • Server :- Apache/2.4.38 (Raspbian) HTTP/1.1 CGI/1.1 80

MySQL

  • Version :- 5.5.5-10.3.17-MariaDB-0+deb10u1
  • Host :- localhost:6379 (127.0.0.1)
  • Date :- 2019-11-14 09:40:13 (UTC 00:00‌​)
  • Stats :- Uptime: 10966 Threads: 12 Questions: 9431 Slow queries: 0 Opens: 46 Flush tables: 1 Open tables: 40 Queries per second avg: 0.860

Redis

  • Version :-
    • Redis Server :- 5.0.3
    • PHP Redis :- 5.0.2
  • Host :- localhost:6379
  • Size :- 100 keys (834.96K)
  • Uptime :- 0 days

MQTT Server

  • Version :- Mosquitto 1.5.7
  • Host :- localhost:1883 (127.0.0.1)

PHP

  • Version :- 7.3.9-1~deb10u1 (Zend Version 3.3.9)
  • Modules :- apache2handler | calendar v7.3.9-1~deb10u1 | Core v7.3.9-1~deb10u1 | ctype v7.3.9-1~deb10u1 | curl v7.3.9-1~deb10u1 | date v7.3.9-1~deb10u1 | dom v20031129 | exif v7.3.9-1~deb10u1 | fileinfo v7.3.9-1~deb10u1 | filter v7.3.9-1~deb10u1 | ftp v7.3.9-1~deb10u1 | gd v7.3.9-1~deb10u1 | gettext v7.3.9-1~deb10u1 | hash v7.3.9-1~deb10u1 | iconv v7.3.9-1~deb10u1 | json v1.7.0 | libxml v7.3.9-1~deb10u1 | mbstring v7.3.9-1~deb10u1 | mosquitto v0.4.0 | mysqli v7.3.9-1~deb10u1 | mysqlnd vmysqlnd 5.0.12-dev - 20150407 - $Id: 7cc7cc96e675f6d72e5cf0f267f48e167c2abb23 $ | openssl v7.3.9-1~deb10u1 | pcre v7.3.9-1~deb10u1 | PDO v7.3.9-1~deb10u1 | pdo_mysql v7.3.9-1~deb10u1 | Phar v7.3.9-1~deb10u1 | posix v7.3.9-1~deb10u1 | readline v7.3.9-1~deb10u1 | redis v5.0.2 | Reflection v7.3.9-1~deb10u1 | session v7.3.9-1~deb10u1 | shmop v7.3.9-1~deb10u1 | SimpleXML v7.3.9-1~deb10u1 | sockets v7.3.9-1~deb10u1 | sodium v7.3.9-1~deb10u1 | SPL v7.3.9-1~deb10u1 | standard v7.3.9-1~deb10u1 | sysvmsg v7.3.9-1~deb10u1 | sysvsem v7.3.9-1~deb10u1 | sysvshm v7.3.9-1~deb10u1 | tokenizer v7.3.9-1~deb10u1 | wddx v7.3.9-1~deb10u1 | xml v7.3.9-1~deb10u1 | xmlreader v7.3.9-1~deb10u1 | xmlwriter v7.3.9-1~deb10u1 | xsl v7.3.9-1~deb10u1 | Zend OPcache v7.3.9-1~deb10u1 | zlib v7.3.9-1~deb10u1

Pi

  • Model :- Raspberry Pi 3 Model B Rev 1.2 - 1GB (Sony UK)

  • Serial num. :- A29A66D4

  • Temperature :- 56.38°C - 56.4°C

  • emonpiRelease :- emonSD-17Oct19

  • File-system :- read-write

Client Information

Client Information

HTTP

  • Browser :- Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36
  • Language :- en-US,en;q=0.9

Window

  • Size :- 1349 x 657

Screen

  • Resolution :- 1366 x 768

I’m not sure what you mean. Are you referring to emoncms.org as ‘the remote one’? If so these are 2 completely different things or instances of the software that are only loosely related.

Is it just the one graph that does not work? Have you tried other graphs with other data?

If so you will need to provide screenshots showing the feeds you are trying to graph(from the feeds page) and the graph page including the left menu.

yes the remote one i am referring to is emoncms.org.

the issue is when i try to download on my local network. I can generate a graph but i cannot down load the CSV file from the graph.

For example this is for temperature , i can see the data on the CSV output , but the content of file is as same as before. I have also tried to do this from the feeds, by selecting all the feeds.
this is a screen shot of the graph


this is a screen shot of the settings to generate the graph.

this the bottom of the CSV output, it seems the last few readings are null

Ah, see this thread - same issue.

@emrys @TrystanLea 2 reports.

thanks Brian,

does this mean I need SSH into the PI so that I can change the PHP file?

/var/www/emoncms/Modules/feed/feed_model.php add in an underscore after csv .

or should i wait for the patch ?

So you can wait for the patch or put the fix in, but note it only fixes one of the issues.

Once the fix goes into a release, you will need to undo it to be able to update.

hmm, I see i am guessing these updates will take more than few days ?
Not sure if I can do the fix manually, any instructions on this.

As for 2nd issue I deleted the feed today, I will see it repeats again.

Quite probably

nano /var/www/emoncms/Modules/feed/feed_model.php

find the right line and add in the underscore.

Ctl-x to exit nano editor.

Unfortunately this didnt fix it (line 672)
error9
i keep getting this error.
Notice: Undefined index: csv in /var/www/emoncms/Modules/feed/feed_model.php on line 790

I’ve fixed the second issue re line 790, thanks @koki and thanks @borpin for the fix for the first.
I’ve merged the fix into emoncms stable as well.

@TrystanLea what is the fix ? does that mean the emoncms update would have fix ?
sorry i am a bit of a noob on this.

Yes sorry available via emoncms update, if you have made any local changes you will need to clear them first, you can do this via command line like this:

cd /var/www/emoncms
git checkout .

M Modules/feed/feed_model.php
Your branch is up to date with ‘origin/stable’.

does that mean i am ok to do the update then ?

yes that’s fine thanks!

@TrystanLea sorry mate,

this is what I get


Warning: Invalid argument supplied for foreach() in /var/www/emoncms/Modules/graph/graph_controller.php on line 97



Warning: file_get_contents(http://192.168.1.142//feed/aget.json?id=8): failed to open stream: HTTP request failed! HTTP/1.0 406 Not Acceptable
in /var/www/emoncms/Modules/graph/graph_controller.php on line 130

“Date-time string”,": ()"

the content of the feed download was huge .
how do I know if the update was successful? I went Admin >Update on emoncms view

@TrystanLea Have you pushed this to stable without a version update?

You have also missed the problems with the graph module.