MQTT init script not working (Solved)

Brand new install (via Git) of 9 RC2 | 2015.09.15 on a RaspberryPi 2 running from an ext HDD

Paul

I'm trying to run your script having followed your instructions but despite double checking permissions (0755) and the script being present at that location I'm getting " unable to execute /etc/init.d/phpmqtt_input: No such file or directory"  

Typing "sudo php /var/www/emoncms/scripts/phpmqtt_input.php" appears to work ok but obviously I'd like to have this running after booting.

Any ideas ?

Paul Reed's picture

Re: MQTT init script not working (Solved)

Can you double check the installation, especiallly the permissions;

sudo chown root:root /etc/init.d/phpmqtt_input

sudo chmod +x /etc/init.d/phpmqtt_input

Also, the daemon will only run if you have a MQTT broker - such as Mosquitto installed & running (which of course you would need).

Paul

Bra1n's picture

Re: MQTT init script not working (Solved)

I deleted the file and started again but this time I created a new file in WinSCP and pasted the contents into it, followed the instructions and as if by magic it's working. I can only think that Windows somehow changes the file when downloading then copying over to the Pi. Anyway sorry for wasting your time it appears to be working ok now so onto the next stage.

Paul Reed's picture

Re: MQTT init script not working (Solved)

That's good news.

As MQTT is becoming a more mainstream function within emoncms, I'm hoping to eventually include the init file within the main emoncms 'scripts' folder (subject to Trystan's approval) so that it doesn't have to be downloaded from git, and then update the emoncms installation guide to enable users to simply create a symlink in /etc/init.d pointing to the init file.

Would that have been a better option for you?

Paul

Bra1n's picture

Re: MQTT init script not working (Solved)

Indeed, it's much better to have everything in the same place with simpler instructions. I just need to figure out how to use MQTT now ;)

Bill Thomson's picture

Re: MQTT init script not working (Solved)

I can only think that Windows somehow changes the file when downloading then copying over to the Pi

Hi Bra1n,

That's possible. In general, Windows apps terminate each line in a text file with a CR/LF (carriage return/linefeed) whereas all of the *nix variants use only the LF character. Whether or not that's what actually happened, and if so, if it affected script operation is another matter. Good to hear you got it working.

Regards,

Bill

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.