Results 1 to 4 of 4

Thread: Reading Pit Temperature with bash script

  1. #1
    New Member
    Join Date
    Jan 2015
    Location
    United States
    Posts
    16

    Reading Pit Temperature with bash script

    This is going to sound like a total newb question, but what is the syntax for reading the pit temperature?

    command:
    lmclient LMST,pcurr0

    returns:
    OK

    I have been referencing the wiki page and can set/config values, but I am not sure how to readback such things at "pcurr0", etc. I have tried various parameter usage the the "lmclient" via a SSH when remoting into the Heatermeter. I am looking to read the value into a variable in a bash script.

    https://github.com/CapnBry/HeaterMet...Script-Recipes

    Thanks,

    Scott

  2. #2
    New Member
    Join Date
    Jan 2015
    Location
    United States
    Posts
    16
    Ah, to answer my own question. I didn't have good results into the forum search and had better luck through Google. I am in the process of learning the scripting features of the Heatermeater and haven't run across the available options of the lmclient.

    I found someones email code to read the temperature:
    lmclient LMGT,pcurr0

    https://tvwbb.com/archive/index.php/t-68163.html

    Nevermind...

  3. #3
    TVWBB Guru Steve_M's Avatar
    Join Date
    Jul 2013
    Location
    Toronto
    Posts
    2,090
    I’d parse the json output with jq. Makes things much easier.

  4. #4
    New Member
    Join Date
    Jan 2015
    Location
    United States
    Posts
    16
    Thanks Steve. I am not familiar how to tap into the JSON stream. From the quick search I did it looks something like using curl and probably piping into jq to parse the desired fields.

    For the ash script I had to use "PitTemp=$(lmclient LMGT,pcurr0)". This allowed me to get a number for follow-on comparisons.

    I am using shell scripts and discovered a number of things missing from "ash" versus "bash" scripts. For example I didn't know that bash couldn't do floating point math. I'm so used to C, C++, and Python. But I did find a way by using "bc" to do the calculations. Example: SetPoint=`echo "$SetPoint+($PhaseOneRate*$tdelay)" | bc -l`

    This is for a project where I am re purposing the Heatermeter to be a coffee roaster controller. I am having good luck using a time delay control in the background to change the setpoint to various controlled ramp-ups to give an exponential rise profile. I may post the details in another forum post after further testing.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •