From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=linux.intel.com (client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=james.feist@linux.intel.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.intel.com Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 47Sljv5l1LzDq9d for ; Thu, 5 Dec 2019 04:10:58 +1100 (AEDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Dec 2019 09:10:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,278,1571727600"; d="scan'208";a="242915629" Received: from skyhawk.jf.intel.com (HELO [10.54.51.81]) ([10.54.51.81]) by fmsmga002.fm.intel.com with ESMTP; 04 Dec 2019 09:10:53 -0800 Subject: Re: Faking Sensor Readings To: rgrs Cc: "openbmc@lists.ozlabs.org" , Alexander Amelkin , "Thomaiyar, Richard Marian" References: <0a4bb951-4f85-728a-8426-af629c870908@yadro.com> <234c1d26-7b59-0926-d6c2-6c49f75aab3f@linux.intel.com> From: James Feist Message-ID: <2de3b2e2-9b02-a1c2-d310-f6e546e72c1e@linux.intel.com> Date: Wed, 4 Dec 2019 09:10:52 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Dec 2019 17:11:00 -0000 On 12/4/19 1:39 AM, rgrs wrote: > Hi James, > > I tried busctl set-property, but the values didn't change. > Are the steps below correct? > (test with both 'field mode' enabled and disabled) > > root@obmc:~# busctl introspect xyz.openbmc_project.Hwmon-2439434288.Hwmon1 /xyz/openbmc_project/sensors/temperature/INLET_TEMP xyz.openbmc_project.Sensor.Value --no-pager > NAME TYPE SIGNATURE RESULT/VALUE FLAGS > .MaxValue property x 0 emits-change writable > .MinValue property x 0 emits-change writable > .Scale property x -3 emits-change writable > .Unit property s "xyz.openbmc_project.Sensor.Value.Unit.… emits-change writable This looks like phosphor-hwmon, not dbus-sensors https://github.com/openbmc/dbus-sensors. > .Value property x 18500 emits-change writable > > root@obmc:~# busctl --no-pager set-property xyz.openbmc_project.Hwmon-2439434288.Hwmon1 /xyz/openbmc_project/sensors/temperature/INLET_TEMP xyz.openbmc_project.Sensor.Value Value x 50000 > > root@saber:~# busctl --no-pager get-property xyz.openbmc_project.Hwmon-2439434288.Hwmon1 /xyz/openbmc_project/sensors/temperature/INLET_TEMP xyz.openbmc_project.Sensor.Value Value > x 18500 > > root@obmc:~# > > Thanks, > Raj > > ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ > On Wednesday, December 4, 2019 1:34 AM, James Feist wrote: > > > On 12/3/19 5:49 AM, Alexander Amelkin wrote: > > > > > 03.12.2019 15:06, rgrs wrote: > > > > > > > Hi, > > > > How do I fake sensor readings in OpenBMC? > > > > We're trying to fake temperature sensors and make sure fans ramp up/down > > > > accordingly. > > > > > > We ended up patching the kernel driver to fake the readings by request. > > > I'm not aware of any ready interface in OpenBMC for that. > > > > If you're using d-bus sensors, the sensor property is writable. It is > > also supported by patching the sensor value in redfish. > > > > > With best regards, > > > Alexander Amelkin > > >