pi-topUtils 1.06

Keyboard/HID driver and battery indicator for pi-top laptops
Post Reply
JonAbbott
Posts: 2938
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex
Contact:

pi-topUtils 1.06

Post by JonAbbott »

This build includes pi-top2 battery indication as provided by Timo Hartong. The HID driver has also been modified to support the pi-top2 keyboard, but is untested.

If you receive an error reporting it failed to find the keyboard, please post your keyboard USB$Device value, so I can add it to the supported list. You can manually force support in !Run by uncommenting and modifying the Set pitopUtils$DeviceID line.

- - - - -

pi-top Utilities provides a battery level indicator, screen dimming, auto shutdown, pi-top speaker control and pi-top keyboard support.

The battery icon indicates the percentage of charge and powered status:
Image


Hover the mouse over the icon for time information:
Image


It also includes HID and USB keyboard drivers, which add the following features:
  • Volume controls adjust pi-top speakers, or the RISC OS volume if none are available
  • Brightness controls work
  • left pi-top+SHIFT+| is |
  • left pi-top+Left Arrow is Home
  • left pi-top+Right Arrow is End/Copy
  • left pi-top+Up Arrow is Page Up
  • left pi-top+Down Arrow is Page Down
  • left pi-top+DEL is Pause/Break
  • right pi-top is the middle mouse button
  • P-key / F-key behaviour is swapped by default, removing the requirement to hold Fn for the function keys (set in !Run)
  • Dims the screen when there's no keyboard/mouse activity (timeout is set in !Run)
  • Powers down the screen when the DPMS screen saver blanks the screen
  • Powers down if left on the Wimp shutdown screen (4 sec by default, timeout can be set or disabled in !Run), pressing a key or the Restart button cancels the power down
  • Can set the brightness to a default level when loaded (set in !Run)
By default the P-keys and F-keys are swapped, the behaviour can be toggled by pressing the key next to DEL (this may be removed once finalized).

pi-topUtils106.zip
(12.13 KiB) Downloaded 475 times
source106.zip
(10.01 KiB) Downloaded 456 times

Configuring a pi-top for gaming

If you're going to be using your pi-top for gaming, you'll also want to create a custom 50hz video mode so games such as Pac-mania have silky smooth scrolling.

Edit !Boot.Loader.CONFIG/TXT and add the following, remembering to comment out any previous video mode settings:

Code: Select all

# Custom 1360x768 50Hz
hdmi_cvt=1360 768 50 3 0 0 0
hdmi_group=2
hdmi_mode=87
Andy.M
Posts: 2
Joined: Wed Dec 19, 2018 6:51 pm

Re: pi-topUtils 1.06

Post by Andy.M »

Hi,

Trying to get version 1.06 to work on two different Pi-Top2 machines, without much luck.

On one, it simply stiffs the machine. The arrow freezes exactly where the double click is above the !pi-TopUtils icon.

On the other, a battery icon loads onto the iconbar and all works well for about five seconds and then it freezes, requiring a reboot.

Is there anything I can do to find debug information to try to ascertain what's happening?
JonAbbott
Posts: 2938
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex
Contact:

Re: pi-topUtils 1.06

Post by JonAbbott »

Andy.M wrote: Wed Dec 19, 2018 7:00 pm it simply stiffs the machine. The arrow freezes exactly where the double click is above the !pi-TopUtils icon.
If you take a look at the last few 1.05 posts you'll see that's one of the things I was trying to diagnose.
Andy.M wrote: Wed Dec 19, 2018 7:00 pm On the other, a battery icon loads onto the iconbar and all works well for about five seconds and then it freezes, requiring a reboot.
I'm going to hazard a guess that either the keyboard or battery firmware are different. It updates the battery level every two seconds, so its more that likely its the battery level poll that's locking.
Andy.M wrote: Wed Dec 19, 2018 7:00 pm Is there anything I can do to find debug information to try to ascertain what's happening?
In the post I've linked above, there are debug builds. You could see if they tell you anything, but I don't think they will as we were trying to get the keyboard working correctly. The front end is BASIC, so you could poke around in PROCupdate_battery to see if you can track down which IIC poll is causing the lock.
Andy.M
Posts: 2
Joined: Wed Dec 19, 2018 6:51 pm

Re: pi-topUtils 1.06

Post by Andy.M »

Bizarrely, I didn't need to do much of that, which is lucky because you give me too much credit for being able to decipher code!

Okay, what I did was download the Test and Debug versions. The Debug version carried on as before, but the test version eventually reaped better results even though initially it failed with the same freeze. But it appears to work now on ONE of the machines. Whilst I realise that's great for me for now, I realise it's not a solution. The ONLY thing that has changed is the charge state of the battery. Could it be that the fault is related to this?

On the other machine, it doesn't matter how many times I double click it, it doesn't register on the iconbar, and doesn't show up in the Tasks list. However, Reporter shows that everything is up and running, and reports that each time I click it, even though it doesn't register as running. This was with the battery nearly flat, half full, full and charged but not plugged in.

I am transferring the card from one machine to the other to make sure all software variables are consistent.

Does it appear that Pi-Top have more than one hardware/firmware setup? Again.
JonAbbott
Posts: 2938
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex
Contact:

Re: pi-topUtils 1.06

Post by JonAbbott »

Andy.M wrote: Thu Dec 20, 2018 11:22 am Does it appear that Pi-Top have more than one hardware/firmware setup? Again.
It's possibly different keyboards, see if the keyboard USB VID/PID are the same on both machines (*Show USB*). If they're different, try uncommenting the relevent line in the !Run where you can specify the keyboard and modify it accordingly.

I think I mentioned the debug/test versions differences in the 1.05 thread. Reporter is sometimes locking the machine, I suspect it's doing something that balks if IRQsema is set (ie nested interrupts)

The key problem here is I don't have a pi-top2, and writing drivers for an undocumented bit of kit I don't have to hand is really difficult!

If you're really desperate to get them working, CJE Micros sell a driver for £79
Post Reply