Start a new topic

Device manager under Raspbian Stretch: three tips

1. Looking in /var/log/messages, you will see that the battery monitoring process adds two lines to the system log every five seconds.  It will take some time before it fills the disk, but it makes it harder to spot other messages.  You can suppress it by editing the file /lib/systemd/system/pt-device-manager.service and changing one line to 

ExecStart=/usr/lib/pt-device-manager/pt-device-manager --log-level 30


2. Now you will see periodic lines in the log saying


Nov 29 21:28:14 pi-top /usr/lib/pt-device-manager/pt-device-manager[3492]: pt-idletime.get_idle_time() returned -1. Check the configuration of xhost.


This is the dervice manager trying to monitor how long the X session has been idle, in order to blank the display after a while.  You'll have noticed that in fact display blanking has not been working.  I solved this problem by adding the line "xhost +" to ~/.profile ; but there may be a better way.


3. Now that screen blanking is working, you'll notice that it is activated after 1 minute, and that seems a bit short to me.  You can change it (I'm assuming) by putting an integer number of seconds in the file /etc/pi-top/pt-device-manager/screen-timeout .


@Mike, Many thanks for your email nput. 1. It is certainly good to reduce the amount of logging done by the device manager as soon as things are very stable. But as long as the pi-top version 2 is very new it might be helpful to see what‘s going on if something goes wrong. Don‘t worry too much about the log file getting too large, there are built in limits. 2. Screen blanking works on my system. It probably did not work on yours when the timeout was set to 0, which means no blanking. The idletime warning is just a warning not affecting operation. But I will open an issue to fix this warning. 3. I have written a little gui to change the screen blanking time on Raspbian Stretch. It is at github.com/rricharz/pt-setup. If somebody has additional ideas on what to put into this gui please post here or let me know by email (email address at bottom of github repo. Thanks again for your valuable input.

An alternative to reducing the amount of logging done by the device manager is to filter it when you want to look at it. This allows to see only what one needs to see normally, but still have the full log available if needed. If you look at pt-log in the latest version of github.com/rricharz/pt-setup (in tools and installed if you do a ./install), it just displays the log since yesterday, suppresses the battery lines and makes the lines shorter.

I'm not sure whether screen blanking was working before adding the xhost + line to .profile, and to be frank I can't be bothered to check right now.


As to tip 3, it turns out that the command pt-brightness -t 300 (for example) writes the value 300 to the file /etc/pi-top/pt-device-manager/screen-timeout.  Rene has made a gui way of doing the same thing.


(It's a bit icky that a command run without root privilege can modify the system configuration for everyone and not just the user who runs it, but nothing in this world is perfect!)


I'm now looking for a way to disable the touchpad entirely when a mouse is plugged in.  That's the way I like to have my Mac set up, and there the option comes under "accessibility".

There is no such accessibility feature in Raspbian, but it would not be hard to write a script to do it. If you type


xinput


you can see what input devices are available on your system. (I am not sure whether xinput needs to be installed first using 'sudo apt install xinput').


The line under virtual core pointer HAILUCK CO., LTD USB Keyboard is your touchpad. Remember the id of this device and type


sudo xinput disable xx


where xx is this id number. Don't  disable the entries under virtual core keyboard, or your keyboard will be disabled. Also, the id might be different if your mouse is already plugged in when the system boots. Now your touchpad is disabled until the next boot. You probably have to experiment a bit to see what works for you.



1 person likes this

Rene: I put together a script that's automatically invoked by udev rules and disables the touchpad automatically, enabling it again if the mouse is umplugged.  Perhaps you'd be interested: spivey.oriel.ox.ac.uk/corner/Touchpad_control_for_pi-top

Mike: I have added a link to your script to my installation instructions. See github.com/rricharz/pi-top-setup/blob/master/README.md

Login or Signup to post a comment