Processext pow10_input problems for me

Hi all,
The time has come for me to upgrade from “Emoncms Version low-write 9.8.31 2018.06.21” on a Pi B+ that has been working well now for a few years (~2017ish).
The upgrade was partly due to the installation of another Fronius inverter and my desire to monitor the PV arrays, 4 in all more closely.
As the Fronius is a ModBus (SunSpec) device Scaling Factors are involved for PV Volts, Amps and Watts. Modbus via the TCPInterfacer is working OK on both Inverters.
But I can’t get the pow10_input to work. I think I am using it properly here is a screen grab of one of the feeds Register 40285 on unit 1 MPPT 1 (Watts) associated Scale Factor is on 40268 trying to log as [fronius: 40285W11S] which when viewed in FEEDS is NULL.

There is an error in the emoncms.log. I assume the 101 refers to the line number in the
processext_processlist.php file which is in the pow10_input function.

‘’’ text
//---------------------------------------------------------------------------------------
// Scales current value by 10 to the power of another input.
//---------------------------------------------------------------------------------------
public function pow10_input($id, $time, $value)
{
$input_value = $this->input->get_last_value($id);
return $value * pow(10, $input_value);
}
‘’’

‘’’ emoncms.log
2024-08-01 11:34:02.253|ERROR|emoncms_mqtt.php|ErrorException: Undefined property: processext_ProcessList::$input in /var/www/emoncms/Modules/processext/processext_processlist.php:101
Stack trace:
#0 /var/www/emoncms/Modules/processext/processext_processlist.php(101): exceptions_error_handler()
#1 /var/www/emoncms/Modules/process/process_model.php(71): processext_ProcessList->pow10_input()
#2 /var/www/emoncms/Modules/process/process_model.php(122): Process->__call()
#3 /var/www/emoncms/scripts/services/emoncms_mqtt/emoncms_mqtt.php(419): Process->input()
#4 [internal function]: message()
#5 /var/www/emoncms/scripts/services/emoncms_mqtt/emoncms_mqtt.php(140): Mosquitto\Client->loop()
#6 {main}‘’’

I hope this is not too much information or even wrong information, the error could be my implementation after all.

Thanks for your time
Thankyou DM

Hi All,
I think I have it working but will wait for real values to be generated tomorrow (its night at present). All watt values that are processed by this pow10_input are now showing 0 as against NULL before the change.

My change was in the “processext_processlist.php” file by adding the line:

$this->input = &$parent->input;

This was arrived at by trial and error and comparing the “process_processlist.php” file and adding the line because of the error.

Is there anything else that I should add?

    // Module required constructor, receives parent as reference
    public function __construct(&$parent)
    {
        $this->log = new EmonLogger(__FILE__);
        $this->input = &$parent->input;
    }

I don’t think I have used PHP ever, or if I did I can’t remember doing so. So can some of the code gurus please check if that is all that is required?
Thanks Dave Martin

Edited for presentation - Moderator (RW)
(You can’t have italics in a quoted block of text.)

Hi all,
I can confirm the fix gives me results as expected for pow10_input.
Can someone (Moderator?) confirm that my solution is a working fix and maybe change the source file?

Thanks for all your efforts
Dave Martin

@TrystanLea

You can, but you have to manually add the italic-text-modifier characters.