Updating system libraries used by emoncms

Should we still be mentioning php5 when the current installation guide is for Stretch, which specifies php7.0?
Users should be building systems from current standards, not archives.

Paul, please feel free to update the current build guide.

Paul

I’d go further than this and suggest a script that took out the guesswork, checked for PHP versions and created the right links.

Am I right in thinking that this is also better a better method if you are using a stack that is not Apache? i.e. works for all stacks?

Could also have a small script for the MQTT libraries as well.

I’d suggest, it may well be easier to maintain a script, than keeping the install guides correct. This may well get more of a chore as the Stretch v Jessie questions arise as folk start to migrate.

All I’d ask is that the script’s commands run at the same level the script is run at. I tend to use DietPi which has a root login as default so scripts with a liberal sprinkling of ‘sudo’ are a pest!

Summarizing the suggested changes so far (so they don’t get forgotten/overlooked!)

  1. Remove dio installation from build guide
  2. Change the way in which redis is referenced
  3. Change the way in which Mosquitto is referenced
  4. Consider the development of a install script
  5. Consider changing the way in which Mosquitto is specified - discussed, and agreed that Mosquitto-alpha should continue to be specified in the build guide.

Paul

Can we add “Update the method the Mosquitto libraries are referenced”. Looks to me this is the same issue.

Also, “Changing the mosquitto library” as that was where this thread started :smile:

I was thinking of an install script rather than an update script as updating is likely to be a little more fraught!

I thought the decisions was that the current Mosquitto command pulled the latest version anyway - so no need to change. Or have I mis-read.

Paul

I wasn’t sure if that was more by luck than judgement. Be worth adding in as a positive ‘leave it alone’ rather than implied (just for the record as it were).

Well how about changing;
sudo pecl install Mosquitto-alpha
to
sudo pecl install Mosquitto
…and let PECL decide the version?

Any thoughts @pb66 Paul & @glyn.hudson .

Paul

Unfortunately that won’t work

Good question, I would say not IF the guide was truly a “Stretch” guide rather than a “Raspberry Pi 3 Raspbian Stretch for emonBases only” guide, by that I mean it should not exist in a Raspberry Pi folder, it should not reference the Pi user or user folder and there should be no mention of any thing to do with the serial port or the config.txt etc, after all there is actually no connection between emoncms (which is the topic of the guide) and the serial port configuration, that should be in a separate emonhub guide, linked from here. I would guess that oncw you remove the pre-built emonSD users, there are possibly less users installing emonHub or to a device with a serial port than not.

There really is no reason this same guide (or potentially, script) couldn’t be used for Debian, Ubuntu or probably even DietPi too, hopefully any Debian9 (aka Stretch) based distro, even shared hosting if commented well. Plus clearly separating the LAMP section from the install emoncms section (probably within the same guide) would also provide an easier guide for users to follow even when installing emoncms alongside an existing setup.

Yes, I’ve updated the install guides:

I’m assuming you mean v2.2.7? Here is the current emonSD build guide setups:

Note: at time of writing the version of php5-redis included in the Raspbian Jessie sources (2.2.5-1) caused Apache to crash (segmentation errors in Apache error log). Installing the latest stable version (2.2.7) of php5-redis from github fixed the issue. This step probably won’t be required in the future when the updated version of php5-redis makes it’s way into the sources. The check the version in the sources: sudo apt-cache show php5-redis

git clone --branch 2.2.7 https://github.com/phpredis/phpredis
cd phpredis
(check the version we are about to install:)
​cat php_redis.h | grep VERSION
phpize
./configure
sudo make
sudo make install

Is there any change log for php-reds? What is the current recommended stable version? I’m happy to test newer versions and consider updating emonSD if there are any relevant fixes.

This is a good idea. I will change ‘alpha’ > ‘beta’ in in the emonSD build guide. I would prefer to use as stable versions as possible.

That commit also removes installing the swiftmailer module and that’s the “linux install guide” which isn’t the current mainstream guide,

it needs changing at emoncms/docs/RaspberryPi at master · emoncms/emoncms · GitHub [edit - removed as @glyn.hudson did this whilst I was writing]

and possibly at emoncms/jessie.md at master · emoncms/emoncms · GitHub too.

I have also noticed that the emonSD build guide in the emonPi/docs folder points to the stretch version not the jessie version since, most likely because the emoncms/docs/raspberrypi/readme.md got switched out from jessie to stretch, that needs editing to point to the jessie guide.

Where is this? Please link to the relevant line. I can’t see reference to Stretch in the emonSD build guide

Can you remember which old thread discussed upgrading php-redis? I’ll give it a go and setup a test.

yeah, sorry I did, v2.2.8 was/is the latest stable/tested “php5” vision that we could update to prior to the release of a stable php5/php7 common release.

https://pecl.php.net/package-changelog.php?package=redis&release=3.1.6

I would recommend testing the latest stable version (currently 3.1.6) by installing without defining a version (or beta/alpha) sudo pecl install redis and then work back if that doesn’t work.

I have tested 3.1.4 for months on php7 and upgraded to 3.1.6 without any issues (yet?) but as for php5, I am running 3.1.3 on a RPi server with heavy traffic and have not noticed any anomalies, but this is a backup “2nd set of data” server that rarely gets looked at. pre 3.1.3 versions (post v3) had some issues with rounding precision on php5 that were resolved in 3.1.3.

Is it Php-Redis 3.1.1?

Just below the install-emoncms-core section header it says “Follow Emoncms Raspberry Pi Raspbian Jessie install guide” and links to the stretch guide indirectly using the emoncms/docs/rasperrypi/readme.md url.

…and the redis module too

It also seems to have an unresolved merge conflict

**For Ubuntu 14.04**:

<<<<<<< HEAD
    sudo apt-get install apache2 mysql-server mysql-client php5 libapache2-mod-php5 php5-mysql php5-curl php-pear php5-dev php5-mcrypt php5-json git-core redis-server build-essential ufw ntp

on 16.04:
=======
    sudo apt-get install apache2 mysql-server mysql-client php5 libapache2-mod-php5 php5-mysql php5-curl php-pear php5-dev php5-mcrypt php5-json git-core redis-server build-essential ufw ntp -y

**For Ubuntu 16.04**:
>>>>>>> 2c38b02253e3edc8fbb18582f970946dbeac5830

`sudo apt-get install apache2 mysql-server mysql-client php libapache2-mod-php php-mysql php-curl php-pear php-dev php-mcrypt php-json git-core redis-server build-essential ufw ntp -y`

@glyn.hudson - there is now also a merge conflict in MQTT.md too.

Paul

Oh dear, very sorry about this. Thanks so much for fixing.

1 Like

It looks as though mosquitto-php is going to get updated…

1 Like