Manawyrm / cloudlog-rigctl-interface

Connects Cloudlog to rigctld / hamlib via PHP
MIT License
8 stars 4 forks source link

Thoughts #3

Open Michael-AUG opened 1 year ago

Michael-AUG commented 1 year ago

Hi Thanks for making this excellent PHP script which does 'exactly what it says on the tin'. Is there any way we could include the rig's Power level as part of this? Many thanks 73 de Mike GM5AUG

Manawyrm commented 1 year ago

Hey Mike,

thanks! Sure, I don't have access to my shack for a while, so you might need to help me out here: Could you ask rigctl for the result of "l RFPOWER"? (that should return the currently set power level in some form)

Something like this (if you have a linux shell at hand):

echo "l RFPOWER" | nc -w 1 localhost 4532

rigctld's manual also refers to 2 functions called "power2mW" and "mW2power" which we might need to call here: https://manpages.ubuntu.com/manpages/xenial/man8/rigctld.8.html

We can then just add this to the PHP script and send it over to Cloudlog with the rest of the data.

vy 73 de DL4TMA

Michael-AUG commented 1 year ago

Hi - thanks for your reply. Here is a screenshot. Let me explain it: image

The first RFPOWER_METER_WATTS shows 0.00000 because I wasn't transmitting. When I keyed the transmitter (CW) at 100W, then ran the command again, it showed 100.0000. The third command (showing 1.0000) was run while the transmitter was in rx mode and shows that the power level is set to 100%/100W. Compare that to the next line which shows 0.411765 - this is because I set my power level on the rig to (an arbitrary) 41W.

The command you suggested didn't work. Result below: image

Let me know what you want me to do next. Keen to contribute if I can.

Many thanks es 73 de GM5AUG

Michael-AUG commented 1 year ago

image Also, this shows how rigctl can convert the rig power percentage into mW

Manawyrm commented 1 year ago

OK, so if I got that right -- RFPOWER_METER_WATTS is the actual transmitted power measurement and RFPOWER is the "setpoint", aka the configured output power?

How comfortable are you with poking around in the files? I would like to try to add this from line 92 in rigctld.php:

    public function getPower()
    {
        $frequencyAndMode = $this->getFrequencyAndMode();

        $power = $this->runCommand("get_level RFPOWER");
        var_dump($power);

        $mw = $this->runCommand("power2mW " . $power[0] . " " . $frequencyAndMode["frequency"] . " " . $frequencyAndMode["mode"]);
        var_dump($mw);
    }

and then in rigctlCloudlogInterface.php invoke it in line 22 with:

$rigctl->getPower();

(and then just start the rigctl interface as usual and screenshot the result)

Michael-AUG commented 1 year ago

Sure thing. Will do this when I get home. 73 de Mike GM5AUGSent from my iPhoneOn 24 May 2023, at 3:58 pm, Manawyrm @.***> wrote: OK, so if I got that right -- RFPOWER_METER_WATTS is the actual transmitted power measurement and RFPOWER is the "setpoint", aka the configured output power? How comfortable are you with poking around in the files? I would like to try to add this from line 92 in rigctld.php: public function getPower() { $frequencyAndMode = $this->getFrequencyAndMode();

    $power = $this->runCommand("get_level RFPOWER");
    var_dump($power);

    $mw = $this->runCommand("power2mW " . $power[0] . " " . $frequencyAndMode["frequency"] . " " . $frequencyAndMode["mode"]);
    var_dump($mw);
}

and then in rigctlCloudlogInterface.php invoke it in line 22 with: $rigctl->getPower(); (and then just start the rigctl interface as usual and screenshot the result)

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

Michael-AUG commented 1 year ago

Going a bit mad! For pages and pages... image

Michael-AUG commented 1 year ago

image Although the frequency is now showing properly (it was showing 800Hz at one point!) but still no power