Visualization: Cannot read property '0' of undefined

Hi all,

I have Emoncms running on a raspberry pi zero, but can’t seem to get my feeds/visualizations running properly. Whenever I open a visualization, I get the following error:

Message: Uncaught TypeError: Cannot read property '0' of undefined
Route: vis/realtime?feedid=28&colour=edc240&kw=0&embed=1
Line: 118
Column: 75

I am not great at programming but am able to figure out most things with the help of Google, but this has me stumped.
Any idea what could be going on?

Also, when I look at my feeds, I get this error:


## 406 Not Acceptable

URI not acceptable.  **Graph**  cannot respond to  **"28"** .

Try another link from the menu.



Admin Markdown:

Server Information

Server Information


  • emoncms_mqtt :- Active Running
  • redis-server :- Active Running
  • mosquitto :- Active Running



  • OS :- Linux 4.19.75+
  • Host :- raspberrypi | raspberrypi | (
  • Date :- 2019-10-14 15:01:14 BST
  • Uptime :- 15:01:14 up 15:11, 3 users, load average: 1.08, 0.62, 0.44


  • RAM :- Used: 37.21%
    • Total :- 432.69 MB
    • Used :- 161 MB
    • Free :- 271.69 MB
  • Swap :- Used: 39.00%
    • Total :- 100 MB
    • Used :- 39 MB
    • Free :- 61 MB
      Write Load Period


  • / :- Used: 23.38%
    • Total :- 14.19 GB
    • Used :- 3.32 GB
    • Free :- 10.24 GB
    • Write Load :- 5.7 KB/s (10 hours 39 mins)
  • /boot :- Used: 20.55%
    • Total :- 252.05 MB
    • Used :- 51.79 MB
    • Free :- 200.26 MB
    • Write Load :- 0 B/s (10 hours 39 mins)


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


  • Version :- 5.5.5-10.3.17-MariaDB-0+deb10u1
  • Host :- localhost:6379 (
  • Date :- 2019-10-14 15:01:13 (UTC 01:00‌​)
  • Stats :- Uptime: 45767 Threads: 21 Questions: 160165 Slow queries: 0 Opens: 184 Flush tables: 1 Open tables: 38 Queries per second avg: 3.499


  • Version :-
    • Redis Server :- 5.0.3
    • PHP Redis :- 5.0.2
  • Host :- localhost:6379
  • Size :- 112 keys (4.01M)
  • Uptime :- 0 days

MQTT Server

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


  • 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 | igbinary v3.0.0 | 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


  • Model :- Raspberry Pi Model Zero W Rev 1.1 - 512MB (Sony UK)

  • Serial num. :- 736B3191

  • Temperature :- 40.08°C - N/A (to show GPU temp execute this command from the console “sudo usermod -G video www-data” )

  • emonpiRelease :- - File-system :- read-write

Client Information

Client Information


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


  • Size :- 1903 x 969


  • Resolution :- 1920 x 1080

How did you install it?

You are missing the graph module - it is installed separately. If you followed the install guide there is a bit at the bottom about the additional modules to be installed.

We are moving to a scripted install method as it is recognized that the guides are out of date.

If you don’t have much data may be worth starting again. Glyn and Trystan are doing some final testing of the scripts.

I installed the graph module and that did not help.

I installed emoncms based on this emoncms/ at master · emoncms/emoncms · GitHub but changed all the packages to the right ones out of the raspberry package system.

Whenever I create a feed, two new files are added in my home/data/phpfina folder; xx.meta and xx.dat where xx is the ID of the feed. But when they are created, nano says the files are unwriteable. I change the permissions of the files to 777 but that does not help.

Data is coming through from the meter to emoncms but it can’t get from the input/feed to the file; it isn’t saving the data. Then it looks like when I open the feed/visualization, its faulting because there are no data points so then I get the undefined message.

I think I understand the problem a bit better but I’m stumped on how to solve it.

Is there anything in the Emoncms log? Change the log level in settings.ini or settings.php if it exists.

Which base settings file did you use?

I also note you have not installed feedwriter and service-runner. It is possible Emoncms is sending the data to feedwriter but it isn’t actually going anywhere then.

This is getting rather messy so I’d suggest that you start again with the EmonScript. It will be cleaner and ultimately more stable and easier to support.

@glyn.hudson @TrystanLea retiring these install guides really is a must ASAP!

1 Like

Does EmonScript support pi zero w?
" Compatible with Raspberry Pi 3, 3B+ & 4 "

I’d love to help out and test

I’ll check on the feedwriter and service-runner and follow up. Thank you!

We havent tested it on Pi Zero, but I think it should work. Are you using latest Rasbian Buster lite on the Pi Zero?

Yes, I am using the latest Rasbian Buster Lite on my Pi Zero W.

Also, I ‘enabled’ service-runner and feedwriter and everything is working!


Ok great! It would be really useful if you did not mind starting a fresh / or new SD card? and installing using the EmonScripts approach, to confirm it works on Pi Zero. It will give you a build with everything in the right places and it will be easier for us to support.

No that is fine, I just started collecting data so I don’t have any issues with starting over.

I will format the SD card and re flash the base Lite image and try out the EmonScripts on it tomorrow.


3 posts were split to a new topic: Using EmonScripts ona PiZeroW

Reporting this same issue I believe. Visualizations run until the time on the horizontal axis moves so if I leave it at the default zoom it’s fine. If I set the zoom to 1 minute it starts failing with the above posted error. This is on a Raspberry Pi 3 installed using the script on Buster lite