I have had this motherboard for a few months, currently on BIOS version 1.40. Although fan speed control is available though the BIOS, I wanted to have access through the OS or at least to be able to read temperature, voltage and fan RPM data from within linux like I could on my previous motherboard, an Asrock Z68 Pro3-M.

I found a while back that

# sensors-detect

is able to identify the embedded controller on the Z370M Pro4:

Trying family `VIA/Winbond/Nuvoton/Fintek'... Yes
Found `Nuvoton NCT6683D eSIO'
 (address 0xa10, but not activated)

but is not able to access it.

I spent some time on this today and here are my findings:

From cold boot,  I saw this in dmesg:
[    4.754471] nct6683: EC is disabled
not looking promising, but I tried to load the driver anyway.  Per the README, the nct6683 hwmon driver must be force loaded on non-Intel boards
# modprobe nct6683 force=1
and it fails with the following error:
# modprobe: ERROR: could not insert 'nct6683': No such device
However, if I suspend the system, then resume and try to load the driver again…success!
[ 4464.599527] nct6683: Found NCT6683D or compatible chip at 0x2e:0xa20

[ 4464.600616] nct6683 nct6683.2592: NCT6683D EC firmware version 1.0 build 07/18/16
and
# sensors
seems to give valid data:
coretemp-isa-0000
Adapter: ISA adapter
Package id 0: +35.0°C (high = +82.0°C, crit = +100.0°C)
Core 0: +34.0°C (high = +82.0°C, crit = +100.0°C)
Core 1: +33.0°C (high = +82.0°C, crit = +100.0°C)
Core 2: +35.0°C (high = +82.0°C, crit = +100.0°C)
Core 3: +37.0°C (high = +82.0°C, crit = +100.0°C)
Core 4: +35.0°C (high = +82.0°C, crit = +100.0°C)
Core 5: +33.0°C (high = +82.0°C, crit = +100.0°C)

nct6683-isa-0a20
Adapter: ISA adapter
VIN0: +0.34 V (min = +0.00 V, max = +0.00 V)
VIN1: +1.02 V (min = +0.00 V, max = +0.00 V)
VIN2: +1.01 V (min = +0.00 V, max = +0.00 V)
VIN3: +1.06 V (min = +0.00 V, max = +0.00 V)
VIN7: +1.34 V (min = +0.00 V, max = +0.00 V)
VIN16: +1.07 V (min = +0.00 V, max = +0.00 V)
VIN12: +0.00 V (min = +0.00 V, max = +0.00 V)
VIN13: +1.02 V (min = +0.00 V, max = +0.00 V)
VCC: +3.30 V (min = +0.00 V, max = +0.00 V)
VSB: +3.42 V (min = +0.00 V, max = +0.00 V)
AVSB: +3.42 V (min = +0.00 V, max = +0.00 V)
VTT: +1.06 V (min = +0.00 V, max = +0.00 V)
VBAT: +3.04 V (min = +0.00 V, max = +0.00 V)
fan1: 0 RPM (min = 0 RPM)
fan2: 2474 RPM (min = 0 RPM)
fan3: 0 RPM (min = 0 RPM)
fan4: 781 RPM (min = 0 RPM)
Thermistor 14: +34.0°C (low = +0.0°C)
 (high = +0.0°C, hyst = +0.0°C)
 (crit = +0.0°C) sensor = thermistor
Thermistor 15: +33.5°C (low = +0.0°C)
 (high = +0.0°C, hyst = +0.0°C)
 (crit = +0.0°C) sensor = thermistor
PECI 0.0: +35.0°C (low = +0.0°C)
 (high = +0.0°C, hyst = +0.0°C)
 (crit = +0.0°C) sensor = Intel PECI
intrusion0: OK
beep_enable: disabled

For the record, adding

acpi_osi=Linux

with or without

acpi_enforce_resources=lax

on the kernel command line does not change anything.  Furthermore, fan speed control is still not available due to a limitation of the nct6683 driver.

 I am not sure if my findings are specific to my hardware or represent a bug in lm_sensors, the nct6683 driver, or the Asrock Z370M Pro4 BIOS. Asrock does not support linux so I have not bothered contacting them. I did contact the lm_sensors maintainer, Guenter Roeck and hopefully he will reply.  In the meantime, I would be interested in hearing from anyone running linux on an Asrock Z370 motherboard running into similar issues.

Update:

Thanks to Guenter for his suggestion to try the nct6683 driver from his GitHub repository  – and for his work on lm_sensors.  I built and installed the out of tree driver and now have access to the sensor data from my Asrock 370M Pro4 motherboard from within linux, without the need for the odd workaround.  Please note, the  driver still must be force loaded as explained above.

Advertisements

Have you ever come across any old electronics or tools with a rubberized finish that has degraded over time, leaving a sticky residue?  I recently purchased a NOS (new old stock) URC* programmable universal remote on eBay.  The remote  had been sealed in a plastic bag in it’s original packaging for over 10 years and was in excellent condition – except for the goo on the surface.  I did some reading online about restoring degraded soft touch plastics and came across lots of recommendations including cleaning with denatured alcohol and using Armor All (silicone based) or vegetable oil to bring back the shine or applying talcum powder to just get rid of the stickiness.  I didn’t want to use anything so harsh it would destroy the screen printing on the remote and I didn’t want to apply anything that would leave a  heavy build up so I decided on a combined approach.

In the end I came up with the following gentle, easy restoration process and it gave me great results:

First I used 70% isopropyl alcohol prep pads  to clean the surface of the remote. This left the surface dry and dull.  Since  plastic meant to be handled on a frequent basis should be able to hold up to the oils on one’s skin, I  decided to try hand lotion to replenish the oils in the plastic. I applied one pump of Cetaphil (unscented, dye free)  lotion to my hands and rubbed it in. Then I rubbed the entire surface of the remote with my hands, in effect transferring a light coating of lubricants from the lotion on my hands to the surface of the remote.  I left the remote to dry overnight. Finally, the next morning, I lightly dampened a microfiber cloth with Meguiar’s Quik Interior Detailer and polished the surface one last time. This left the remote with a uniform, smooth satin finish – not sticky and not greasy – and with no damage to the screen printing. Mission accomplished.

*In case you are not familiar with this brand, URC makes remotes with excellent keypads that are built to last – and to me, that’s the most important part of a remote.

After all these years, my Acer 5740 laptop is still running linuxghost-mouse-25992, specifically Xubuntu, the xfce based Ubuntu derivative.  For the most part it remains serviceable, but some annoying bugs have come to light from time to time. I suspect these are at least in part due to the old hardware combined with a new(ish) kernel and drivers.

Case in point: log into Xubuntu 16.04 after the screen has been locked (by suspend or logout) and the mouse pointer becomes invisible. The mouse still works though, and if you manage to position the invisible pointer just right you  can point and click as usual. This bug seems to be related to the combination of lightdm, light-locker  and the xorg-video-intel driver configured to use sna acceleration.  The sad fact is that this bug has been around for a long time (at least since 15.04, probably longer). It seems I am not alone with this bug on my old hardware: reports suggest it affects more recent hardware as well.

The good news is that there are several potential  workarounds. The best one, found here involves  switching to a new VT and then back by pressing  ctrl-alt-F1 immediately followed by ctrl-alt-F7 or by placing commands to do the same in a bash script and assigning it a keyboard shortcut. But how do we automate this so that no keypresses are needed?

First, create the script VTswitch with these contents:

#!/bin/sh
/bin/chvt 1
/bin/chvt 7
sleep 1

Save it in the location of your choice and make it executable.

Next, if it doesn’t already exist, create the file 50-myconfig.conf  in the directory /etc/lightdm/lightdm.conf.d with these contents:

[Seat:*]
session-cleanup-script=/path/to/VTswitch

Finally, restart lightdm:

sudo systemctl restart lightdm

That’s it!  Next time you unlock the screen, your mouse cursor will be visible with no extra keystrokes.  Please let me know if you see any weird side effects or  if you come across a patch that resolves this bug.

UPDATE: Even better than the workaround above, at least with my hardware, you can just avoid the bug entirely by removing the xorg-video-intel driver and using the modesetting driver built into Xorg instead:

sudo apt-get remove xserver-xorg-video-intel

If you were using the workaround, remove the file 50-myconfig.conf in  /etc/lightdm/lightdm.conf.d

Finally, reboot!

corned-beef-hash-bI have been using KeePass as my password manager for years and while it gets the job done, browser integration with Firefox is minimal to non-existent. Spending so much time in Firefox,  I started thinking it would be nice to be able to manage my passwords without leaving the browser.  Having Firefox remember my passwords was not an option.   I know I am late to the party, but about a week ago I came across Collin Jackson’s PwdHash Firefox extension. I was familiar with password hashing as a way to manage passwords, but until now I never had the urge to try it. Already comfortable with the concept of using a master password and not memorizing my randomly generated individual site passwords, PwdHash seemed to be exactly what I was looking for.  So I installed it and went to a web site to test it out only to realize that the only indication PwdHash is protecting your password is a very subtle, almost unnoticeable change in the obscured password length. With no obvious indication that PwdHash is active it is easy to imagine a scenario where  an unhashed master password could be sent to a website, negating the supposed security benefit of using a password manager.  I later found my concern had been confirmed in  ‘A Usability Study and Critique of Two Password Managers‘ by Chiasson, et al.

So I set out to modify the extension to provide a PwdHash activity indicator.   Looking at the code, I found that the author had included some provisions for just such an indicator but did not enable them.  In the comments he implied that having the indicators visible could be a security risk.  IMO many things in life are risk vs. benefit so I went ahead and added code to enable the indicators by default and provided an option to hide them if desired.  I emailed Collin and asked him to review my modifications for inclusion in a new version of the PwdHash extension but he has not yet responded. Since the add-on has not been updated since 2009 I am wondering if he has lost interest in the project.  At any rate I am really enjoying my upgraded version of PwdHash, especially compared with the complexity and cluttered user interfaces of similar extensions on the Firefox Add-ons site.

UPDATE:  Since I received no response from the author of the PwdHash extension I forked it and submitted my new version to https://addons.mozilla.org for review.  I will post here if and when it is approved.

So now that I replaced one of our desktops with a laptop and it happened to be the one that the shared printer was connected to, I had to figure out what to do with the printer.  Since there is no guarantee the laptop will be near the printer at any given time, I didn’t want to use it as the print server.  There is no room for it at my desk so the printer stays where it is.

After a Google search for print servers that work with Linux, I picked up a nicely priced Netgear PS121 USB 2.0 Mini Print Server from eBay.  The consensus was that it’s not perfect and the documentation regarding use with Linux is just about nonexistent, but it works.  And I found that to be the case in combination with my Canon Pixma ip4300 printer.

The trick to get this to work (at least with my printer and Arch Linux setup):

Your device URI needs to look like this:

lpd://192.168.xxx.xxx/PSxxxxxx_P1

(replace the x’s with your device’s actual IP address and device name).

Note the “_P1” at the end of the device name.  It represents the port number.  It’s not mentioned in the user manual but without it, you won’t be printing anything.

N.B. –  These tips apply only to version 2 of the  PS121.  From what I have read,  version 1  is actually a completely different piece of hardware.  If you have a v1 you might want to take a look here.

With a couple of tweaks, the Acer Aspire 5740 series looks like a winner for Linux users. Two issues I have run into both have workarounds. The other one should be an easy fix as well.

Brightness Control

As I mentioned before, I am running Arch Linux on this computer. Out of the box you can’t adjust the backlight brightness. I confirmed the same with Ubuntu 10.04. This can be fixed by adding the following to your GRUB kernel parameters:

acpi_osi=”Linux”

A kernel patch has been proposed here to prevent the need for this; maybe it will make it into the next release.

UPDATE – There is a new and better fix for the brightness issue.  See my comment here and if you are running Ubuntu, check Kamal Mostafa’s PPA.

Wired Networking

Because of an issue with the tg3 driver in the kernel, the Broadcom wired NIC is not detected properly at startup. A temporary fix is to remove the tg3 module, load the Broadcom module then reinsert the tg3 module. A better solution is to download the current driver from Broadcom, compile it yourself and install it.

N.B. – Make sure you have your kernel headers installed before you try to compile the module.

UPDATE – It seems that the tg3 driver is fixed in the 2.6.35 kernel so the above procedure is no longer necessary (after you upgrade).

Sound

There also seems to be an issue with audio coming from the built-in speakers when the headphone jack is in use. I will get to that one soon.

Everything else just works!  If I come across any other issues I will update this post.

This week I bought my wife a new notebook (an Acer Aspire 5740-5513).  It’s a basic, but fast and well-built computer that will do everything she needs it to do.  All at a bargain price.  Of course it came with Windows 7 installed and since she’s used to using Linux by now, I need to get that going ASAP!

But before I made any changes to the partition table  I wanted to back up the computer in it’s pristine state.   So trying to keep things simple, I decided to use the built-in Acer backup program under Windows.  It is supposed to create a backup set on 3 DVD’s, but guess what?.  Yeah, it failed after the first disc.  The application hung and I had to kill it with Task Manager.  Good times with Windows…

So I thought I would try Partimage from a live CD instead since I have used it with good results in the past.  Last time, I used it to backup my Samsung NC-10 to an external USB drive.  This time I decided to use the gigabit NIC on the 5740 to backup to my desktop over ethernet.  The problems started when I tried to get the Partimage client on the notebook to connect to the server on my desktop (now running Arch Linux – more on that in another post).  Well, to keep this short, it didn’t work.  I tried running Partimage from a couple different live CD’s on the notebook and kept coming up with authentication errors in the auth and partimaged logs on the Arch box.  Most likely it’s a permissions or partimaged compilation problem.  I could have fixed it eventually but I wanted to get the backup done and move on, so I changed tactics.

I decided to boot both machines with the Parted Magic 4.1 live CD.  Again, I would run the Partimage server on the desktop and the client on the notebook.   End result,  it worked.  I did run into a couple snags on the server side though.   Here’s the workaround:

First, you need to set a password for root.  Next,  change ownership of the file /usr/etc/partimaged/partimagedusers to the user ‘partimag’.   Then add root as an allowed user to ‘partimagedusers’,  save the file  and change its access mode to 600.   Mount the drive where you want save your backup image and in a terminal window, change to the directory where you will be saving the files.   Start the server from there.   Now you should be able to connect from the client and begin your backup with no problem.

I think these changes could be incorporated into the Parted Magic live CD by its developers to facilitate network backups with Partimage.  Or you could just remaster the iso and have your own custom Parted Magic build.  Either way, once you have everything configured properly, it’s an easy way to do a low level backup over the network.

Oh, and please don’t tell me about the other ways to backup over the network.  I am fully aware there are other options – both free and commercial.  The point of this exercise was to use this specific tool and make it work as it was designed to.