Anyone know the internal differences to raspberrypi_run.php?

Hi,

Just rebuilt my emoncms and a plugin I wrote for myself is no longer supported. It was based on the raspberrypi plugin. Just wondering if anyone can tell me what changes I need to make to this to make work again?

https://github.com/elyobelyob/mqtt

Thanks

TrystanLea's picture

Re: Anyone know the internal differences to raspberrypi_run.php?

Hello Nick, did you get it to run?

The main difference is that the class ProcessArg and DataType definitions have been moved to process_settings.php and enum.php and so you dont need those in there anymore.

You will need to load process_settings.php instead of settings.php

If you look in raspberrypi_run.php:

https://github.com/emoncms/raspberrypi/blob/master/raspberrypi_run.php

I find the easiest thing to do is to set the directory of the _run.php script to the root emoncms directory using chdir(...)

Then load everything you need

  // 1) Load settings and core scripts
  require "process_settings.php";
  // 2) Database
  $mysqli = new mysqli($server,$username,$password,$database);

  require("Modules/user/user_model.php");
  $user = new User($mysqli,null);

  require "Modules/feed/feed_model.php";
  $feed = new Feed($mysqli,$timestore_adminkey);

  require "Modules/input/input_model.php";
  $input = new Input($mysqli,$feed);

  require "Modules/input/process_model.php";
  $process = new Process($mysqli,$input,$feed);

  require "Modules/mqtt/SAM/php_sam.php";

 

Comment viewing options

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