Coder Social home page Coder Social logo

lm-sensors-php's People

Contributors

sidicer avatar

Watchers

 avatar  avatar

lm-sensors-php's Issues

Undefined array key temp1

I try to use your script. Executing

<?php
include_once('readsensors.php');
$cpu_temp = read_sensors();
print_r($cpu_temp[0]['temp1']['input']);
?>

leads to error:

PHP Warning:  Undefined array key "temp1" in read_sensors.php on line 56
PHP Warning:  Trying to access array offset on value of type null in read_sensors.php on line 56

$ sensors -u gives:

w83795adg-i2c-1-2f
Adapter: SMBus PIIX4 adapter port 2 at 0b00
Vcore:
  in0_input: 0.718
  in0_min: 0.500
  in0_max: 1.400
  in0_alarm: 0.000
Vdimm:
  in1_input: 1.512
  in1_min: 1.424
  in1_max: 1.574
  in1_alarm: 0.000
+3.3V:
  in12_input: 3.282
  in12_min: 2.964
  in12_max: 3.630
  in12_alarm: 0.000
3VSB:
  in13_input: 3.204
  in13_min: 2.964
  in13_max: 3.630
  in13_alarm: 0.000
Array Fan:
  fan1_input: 668.000
  fan1_min: 329.000
  fan1_alarm: 0.000
CPU Temp:
  temp1_input: 18.000
  temp1_max: 109.000
  temp1_max_hyst: 109.000
  temp1_crit: 109.000
  temp1_crit_hyst: 109.000
  temp1_alarm: 0.000
  temp1_type: 3.000
NB Temp:
  temp2_input: 27.000
  temp2_max: 105.000
  temp2_max_hyst: 105.000
  temp2_crit: 105.000
  temp2_crit_hyst: 105.000
  temp2_alarm: 0.000
  temp2_type: 3.000
MB Temp:
  temp5_input: 3.000
  temp5_max: 39.000
  temp5_max_hyst: 39.000
  temp5_crit: 44.000
  temp5_crit_hyst: 44.000
  temp5_alarm: 0.000
  temp5_type: 4.000

jc42-i2c-0-18
Adapter: SMBus PIIX4 adapter port 0 at 0b00
RAM1 Temp:
  temp1_input: 13.250
  temp1_max: 60.000
  temp1_max_hyst: 54.000
  temp1_min: 0.000
  temp1_crit: 70.000
  temp1_crit_hyst: 64.000
  temp1_max_alarm: 0.000
  temp1_min_alarm: 0.000
  temp1_crit_alarm: 0.000

k10temp-pci-00c3
Adapter: PCI adapter
CPU Core Temp:
  temp1_input: 24.625
  temp1_max: 70.000
  temp1_crit: 100.000
  temp1_crit_hyst: 95.000

jc42-i2c-0-19
Adapter: SMBus PIIX4 adapter port 0 at 0b00
RAM2 Temp:
  temp1_input: 13.000
  temp1_max: 60.000
  temp1_max_hyst: 54.000
  temp1_min: 0.000
  temp1_crit: 70.000
  temp1_crit_hyst: 64.000
  temp1_max_alarm: 0.000
  temp1_min_alarm: 0.000
  temp1_crit_alarm: 0.000

What may be wrong?

UPD: it works, though needs more explanation in particular in regard of categories or labels.
In my case it is print_r($cpu_temp[0]['CPU Temp']['temp1_input']);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.