I’ve just rebuilt emoncms on a Raspberry Pi v3 using the current standard operating system - Raspbian Stretch, and taken the opportunity to update many of the modules in the process.
This build uses the Mariadb database instead of MYSQL for two main reasons;
Firstly, Mariadb is now the default Raspberry Pi database, and replaces MYSQL in the Raspbian source list.
Secondly, Mariadb is open-source, which fits nicely into the ethos of emoncms.
Other notable changes are that it uses PHP v7.0, and php-redis v3.1.1 and many other updated modules.
I would be grateful for comments, including if Mariadb is to be the preferred database for emoncms/raspberry pi, also it would be good if beta testers could give feedback.
Yes, mosquitto v3.1.1 is running fine.
I haven’t had chance to implement it into emoncms yet, but as far as mosquitto is concerned, it’s running together with mosquitto_client, on my stretch installation OK.
I had no unmet dependencies or errors in the install logs.
I’ve not used the emonpi script, but I’ve backed up from my old MYSQL databases and restored them successfully to Mariadb without a glitch (using dropbox_uploader).
The only stumbling block I found was that you need to use sudo to log in as root, but once you know about it… and won’t have any impact once the emoncms database has been created, as per the build guide.
I can’t imagine the emonpi script having any problems whatsoever as the export/import commands are identical, but I’m sure that before any new emonpi images are made, Glyn will check it.
Also, nothings set in stone at this stage, it may be that @glyn.hudson would prefer MYSQL?
For all practical purposes, MariaDB is a binary drop in replacement of the same MySQL version (for example MySQL 5.1 -> MariaDB 5.1, MariaDB 5.2 & MariaDB 5.3 are compatible. MySQL 5.5 is compatible with MariaDB 5.5 and also in practice with MariaDB 10.0).
Which makes sense as it’s made by the original developers of MySQL.
I’ve just run through the guide with very few problems, so great work on a draft.
This line didn’t work:
there is a missing “.0-” after php7-curl, php7-dev, php7-mcrypt and php7-common
The corrected line is:
The next correction is a few lines later (already mentioned this in my post above but to keep it all together I’ll repeat it here):
A little further down, this probably should be changed to the equivalent systemctl command
While that technically works, two commands above: sudo a2enmod rewrite provides the following output:
So I suggest the Apache restart is updated to:
Further down still you’ve got this line:
How do I know if redis support is needed? Is it worth pointing to a link on why I would want it?
The next suggestion is a little further down again:
Any reason you don’t use command chaining as you’ve been doing before this step? Suggest it becomes:
This next section doesn’t explain why we need to disable serial console boot or what changes need to be made to the /boot/cmdline.txt.
My /boot/cmdline.txt was already different because I’d moved everything to a USB HDD.
I think it would be better if you explained what part to remove rather than provide the replacement line.
I had already disabled serial console using raspi-config as part of my “standard” build, so none of the above commands were relevant.
FWIW, sudo raspi-config, choose item 5, then item P6, then No, then Yes, essentially does the same thing without the fear of stuffing up /boot/cmdline.txt
There’s a redundant console=tty1 in your /boot/cmdline.txt too.
Everything went pretty smoothly, with the exception of the apt-get command up the top, every command worked exactly as expected (and I tried very hard to ensure I just copied and pasted them directly)
One last thought, it might be worth adding the step to fix /etc/sudoers as the Administration Web page has “Shutdown Unsupported” where the Shutdown/Reboot buttons should be and when you click on “Shutdown Unsupported”, you get:
Thanks for testing @Greebo, I didn’t think of documenting the install process until it was half done, so it’s great that you’ve picked up on these issues.
I’m back home tomorrow night, so I’ll update the guide when I get to my laptop again.
I’m not sure if you understand that it disables serial completely, or disables serial login (& kernel messages).
Assuming you were concerned about the former, the raspi-config settings I mentioned (and sorry for the shorthand before) were:
From the main menu, choose: 5. Interfacing Options
Then choose: P6 Serial
You will then be prompted with the following two questions: Would you like the shell to be accessible over serial?
Select <No> Would you like the serial port hardware to be enabled
Which results in : The serial login shell is disabled The serial interface is enabled
EDIT: I’ve been doing a lot of searching in the Pi forums since I posted this and there does seem to have been a bug in raspi-config that did not correctly remove entries from boot/cmdline.txt when following the above steps.
It appears to have been fixed now, but it would certainly be worth others testing this!