-
Notifications
You must be signed in to change notification settings - Fork 1
Linux HW Testing
As you would expect there are a lot of tools available for linux which can be used to test hardware. The following details some specifics.
Provides a sensors app which if your system is configured correctly will find and show data based on your sensors. Utilises /sys/class/hwmon to parse and find your sensors.
Yocto lmsensors recipe: http://git.openembedded.org/meta-openembedded/tree/meta-oe/recipes-bsp/lm_sensors?h=sumo Open embedded packages to include: lmsensors-sensors, lmsensors-sensord
Also provides a daemon that can be configured to monitor your device so you can watch things over time.
Man pages give reasonable details on sensors and associated apps. https://www.systutorials.com/docs/linux/man/5-sensors.conf/
For sensors (or libsensors actually) to know about your device's sensors, add a config file /etc/sensors.d/mydevice-config.conf containing a few lines for your i2c bus details and then a bunch of lines for each chip. There you can use ignore tempX or label tempX "temp_internal" to give nice labels to your sensors.
bus "i2c-0" "SMBus PIIX4 adapter at e800"
The man pages say you can use * for the chip names, but not entirely sure that is true as haven't managed to make that work.
Sensord is lmsensors daemon which uses libsensors to monitor its configured sensors over a period of time and saves data to an 'rrd' database, which is created using rrdtool which is simply a perl based 'round robin' logger, hence the r-r-d (round robin database).
Once you have setup libsensors with /etc/config/sensor.d/my-machine.conf, install sensord (if using yocto, use its defaults to start with). Start the daemon
# sysvinit systems: /etc/init.d/sensord start
Let it run for a period, and run the following (on your target) to create the sensord cgi file.
sensord --load-average --rrd-file /var/lib/sensord.rrd --rrd-cgi /var/www/sensord > sensord.cgi
The sensord.cgi file will contain html and a bunch of <RRD::GRAPH targets, which is the magic needed for generating the images using rrdcgi in the step below.
Assuming you don't have rrdcgi on your target, copy the database off your target system to your desktop into /var/lib/ (you can probably copy it elsewhere, but the above cgi will assume its at /var/lib)
On your desktop (or on target if you have rrd-cgi and a web browser on it), run the following.
~$ sudo apt-get install rrdtool ~$ cd /var/www/sensord /var/www/sensord$ sudo rrdcgi -f sensord.cgi
This will create the image files for you to serve. Copy the stdout to a file, say sensord.html and serve /var/www/sensord on your web browser. (you only need to save the html once if you don't change the sensord settings)
If all went well you'll see a web page with a bunch of graphs for a weeks worth of data. This data was extracted from your rrd file, so if something went wrong, quite probably files were not in the right place.