Raspberry Pi Processor Temperature

tomas111
2021-09-21
2023-04-23
  • tomas111 - 2021-09-21

    I want to measure and see the processor temperature in Codesys code.
    Tell me how to do it?
    Command request comes to the mind in SSH -VcGencmd Measure_Temp
    But I do not know whether you can call such commands from Codesys?
    Maybe there is an alternative way measuring temperature?
    Thanks.

     
  • tomas111 - 2021-09-21

    Thanks! After clicking on the link I did not find the instruction.
    Can you describe in more detail?

     
  • eschwellinger

    eschwellinger - 2021-09-21

    click on the link and then scoll down -> more posts then scoll until you find the screenshot - and there you'll find the project I guss.

     
  • tomas111 - 2021-09-21

    I went over the link. The project did not find. Links do not pass
    As I understood the whole thing in the sysprocessexecutecommand2 function. Using it, you can call commands?

     
  • tomas111 - 2021-09-21

    Thanks! Saw everything!
    Excellent example.
    It is a pity in the project description there is no description that it is to write in codesyscontrol_usr.cfg

     
  • tomas111 - 2022-12-02

    On target 4.5.0.0 and raspberry PI4 does not work. Maybe you need to apply the new versions in a different way?

     
  • tomas111 - 2023-04-22

    CS 18 SP 4 target 4.7.0.0 this method does not work, I tried to download it as root, the result was unsuccessful. Can't get temperature. It seems to me that after version 4.3.0.0 you changed something and this something breaks the system.

     
  • eschwellinger

    eschwellinger - 2023-04-22

    it works with all versions the only thing is to add:

    /etc/CODESYSControl_Usr.cfg:

    [SysProcess]
    Command=AllowAll

    BR
    Edwin

     
  • tomas111 - 2023-04-23

    I have already tried different options, here is a screenshot of the program and file settings, in response I see result = 1. What could this mean? Target version 4.7.0.0 CS SP18 P4. The visualization and the code itself work, the only problem is getting the temperature request command.

     
  • eschwellinger

    eschwellinger - 2023-04-23

    seems that in newer OS image this command is not located at /opt/vc/bin/ so remove it and just execute:
    'vcgencmd measure_temp' then it will work.

     
  • tomas111 - 2023-04-23

    Thanks a lot! Now everything works!
    It remains to deal with USB - Com port.

     

Log in to post a comment.