Perhaps naively - I clicked the ‘upgrade’ button on my Nov 2015 (pi 2) emonPi, then had to install the default settings.php file and re-enter the original username & password to access sql.
I’m now getting the following error messsage:
Emon Pi
Fatal error: Can’t use function return value in write context in /var/www/emoncms/Modules/user/user_controller.php on line 122.
What else is required to allow emonPi to complete booting?
I have ordered a replacement SD card - apart from the couple of lines of editing referred to in the installation instructions - is this card likely to boot successfully in such and old emonPi?
Hello @wmcausland. I havent seen the error “Fatal error: Can’t use function return value in write context in /var/www/emoncms/Modules/user/user_controller.php on line 122.” before, but searching google I think its caused by a php compatibility issue.
you could if you feel adventurous, SSH into the emonPi and comment out lines 117 through to 152 to see if it works again. If that’s the only issue I can rewrite those lines to support php 5.4 which might be a good idea to do anyway.
I would double check the SD card compatibility for you.
Hi guys!
I’m in the same position …I have an unused EmonPi since 2015 …
yesterday, I connect it and began to use I prefer to update it, and click on update button in admin section, replace settings.php by default.setting.php in var/www/emoncms/ and re-enter some data (usr, passw, mqtt_enabled = false …etc) : Fatal error : Can’t use function return value in write context in /var/www/emoncms/Modules/user/user_controller.php on line 122
ls /boot | grep emonSD don’t return nothing…
/home/pi/data /emonpiupdate.log does not exist…
OK -my emonSD is 17jun2015, But couldn’t find an update log in the location suggested.
As Xavi is still having issues after amending the suggested lines, I decided to try inserting my newly pre-built SD card which arrived this morning (great service!).
As per the install instructions, I attempted to edit /boot/config.txt using Paragon ExtFS under windows, but there were no files visible in the boot directory to edit.
I put the new SD card into the emonPi anyway - but couldn’t access it using ssh through putty, or using a browser on either ethernet or wifi.
I have ordered a replacement complete EmonPi as I have limited time now to get this current project working.
Is it possible to return the old emonPi for refurbishment, and to update it to Pi3?
The ‘boot’ location mention by Glyn is the boot partition, it should mount fine under windows as its a FAT partition. You will also need to add a file called ‘ssh’ to the boot partition to enable ssh.
Yes sure, if you email us at [email protected] we can sort that for you.
There is an authentication bypass to run the updater in this case.
Add the following line to the bottom of settings.php in /var/www/emoncms/settings.php to enable a special database update only session, be sure to remove this line from settings.php once complete:
$updatelogin = true;
In your internet browser open directly the admin/db page to launch the database update script.
http://localhost/emoncms/admin/db
You should now see a list of changes to be performed on your existing emoncms database.
Alternatively you can run the database updater from terminal with:
In fact this 2015 EmonPi, is a gift from my brother that has bought in 2015, never used but very manipulated ( I see the last commands in terminal, and he edited a lot of files …)
I have some issues that I’m not sure that are normal or maybe something was misconfigured…
OK - all working now!
I ordered a pre-build SD card, and it arrived the next day - cost £9 plus postage.
I inserted the card into a Usb card reader into my Windows 10 PC. The boot partition is readable in windows and came up as the first drive letter. Downloaded notepad ++, and edited config.txt to comment out the lines relating to a Pi3 ( arm_freq=1200 arm_freq_min=600) and saved the file. Inserted card into my old Pi2 emonPi, and powered it up.
SSH’d in using putty. Did a factory reset to be sure. Waited until all updated, and wifi access point showing on LCD screen. Removed ethernet cable and connected to wifi access point and configured wifi. All looks good! recommended route for old emonPi.
the downloaded image is fresh (I download 14 nov ) and works more or less good …at least, boots ok.
The file config is in the boot partition visible in Win. if its connected in any USB…
I flash a new 16 Gb SD, edit arm_frecs in config file and boot raspberry pi2 …
and the same issue in some pages …
Certainly I don’t have any data to backup in a 2015 version, then I reflash the last image, and I began to make some test and …like @plord I have some issues :
Uncaught TypeError: Cannot read property ‘push’ of undefined
I open a new topic (I undertand is another and diferent problem …)
@Xavi_Gorriz@plord, as mentioned here We’re having trouble replicating this here. We have added improved logging of JavaScript errors to give a line number in the latest update (v9.9.5). Would you mind running emonpi update to pull in the latest and see if the error appears again, hopefully this time with a line number.
I would recomend if possible downloading the latest emonSD-13Oct18 SD card image and flashing to a fresh SD card. We also sell pre-loaded 16GB SD cards in the shop:
A 2015 emonPi will probable be running emonSD-17Jun15 which will be running a very old and potentially now insecure version of Debian. The new image has got all the latest security patches.