Showing posts with label pebble. Show all posts
Showing posts with label pebble. Show all posts

Sunday, January 20, 2019

Install Ubuntu on Lenovo Tablet MIIX 300

If you have the Lenovo MIIX 300 tablet, you may be in luck if you want to install Ubuntu on this device.



I got mine a few years ago at Best Buy for really cheap as it was an opened box.  It came pre-installed with Windows 10 32 bits edition.  The table come with a detachable keyboard so you can use it as a small laptop or a regular tablet.

My main issue with the Lenovo MIIX 300 was the 32 bits installation of Windows.  More and more apps are only supporting the 64 bits version so there is less and less apps/games that I can install on this neat device.

Last year, I did try to install Ubuntu on it without much success.  But with the latest version,  Ubuntu 18.10, it's almost perfect.  Yep, there is a few hurdles but nothing impossible.

The main issues:
  • Sound does not work out-of-the-box but it's easy to fix
  • Display orientation is wrong, but there is a workaround
  • From time to time, the device will freeze completely
    • Press POWER button 10 seconds to shutdown See Note...
  • Bluetooth does not work  Bluetooth work is updating to 19.04
  • Webcam does not work
NOTE:  Seems that adding this line to /etc/default/grub is preventing freezing: 


```/etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi="
```
and then you have to run:
```
$ sudo update-grub

Read the complete post: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1784152

Note 2:  The grub setting did not work.  I took a longer time but it eventually froze again.  But I discovered that the tablet is not frozen just the touch interface.  Doing a reload of the hid_multitouch module fixes the issue.

> sudo rmmod hid_multitouch
> sudo modprobe hid_multitouch


The issue now is figuring a way to reload the module just without the physical keyboard.

Note 3: Updating to the latest developpement version of Ubuntu (19.04) has enabled the Bluetooth device.  I was able to use my Bluetooth earbuds with it.

Step 1

Download the desktop version of Ubuntu.  The default flavor does work but I found that Ubuntu Budgie works better as is it a bit lighter.  The KDE flavor didn't work.

You'll also need a special file to boot from the USB drive, on with we will create the boot disk.

Download the bootia32.efi file.  This is required on this machine.  Here's a link on GitHub!

Also, download the driver files for the sound card as by default, it does not work.  Here's the link on GitHub!

Get a USB key drive having at least 2+ Gigs available.  Create your bootable USB drive using Rufus in Windows.  Make sure to select the GPT scheme for the boot partition.

If you are already on Ubuntu, here's how to do it:
  1. Insert your USB key on your computer.  
  2. GParted is required on this machine.  Install it...
  3. In GParted, select your device and "Create a partition table" from the menu
    1. Select the format as GPT, and not MSDOS
    2. Set the size as 2 MB
    3. This will wipe your USB drive
  4. Once done, create a FAT 32 partition having at least 2 Gigs 
  5. Mount the ISO image so you'll be able to copy the files from the ISO archive.
    1. From the console: sudo mount -o loop ubuntu-18.10.x-desktop-amd64.iso /mnt/somefolder
  6. Open Nautilus, and press CTRL-H to show all hidden file from the mounted archive and copy everything into the FAT 32 partition on your USB drive.
  7. Once done, copy the bootia32.efi file into [USB Drive]/BOOT/EFI
    1. This is mandatory!
  8. Also, copy the audio drivers at the root of your USB drive as they will be needed later.
You should be all set now to boot into Ubunbtu.

Step 2

By default, your tablet disc is encrypted using "Safe Boot".  You'll need to go into the settings of Windows to deactivate it.  You'll also need to deactivate the encryption in the "Boot" manager.  This is required to be able to boot from another device and interact with the hard disc.

If I remember well, this process has to be done in Windows first.  It takes a few hours to complete.  Once done, you need to boot into the "Boot" section.  When rebooting, while seeing the Lenovo logo, press "Fn"+2 (F2).  You get the configuration screen for the machine and you can disable the Safe Boot from there.

Careful with this step.  Be patient and do the whole process before doing anything else.

In the end, you should be able to boot into Windows with an unencryted hard drive.

Step 3

This is the moment of truth.  Plug your tablet to the keyboard as we need the USB ports.  Insert your USB boot drive and reboot your device.
  1. You can do it be going into the recover section of Windows 10
  2. You can also for the boot device pressing "Fn"+"+" (F12) on the keyboard.
You all steps have been followed correctly you should see your USB boot disk in the selection.  Boot with it and wait around 30 seconds.

Eventually, you'll get the Ubuntu Desktop, in Portrait mode.  Rotation does work, but it's not in sync with the physical state of the device.  The fun begins...

Step 4

For some reason, the rotation does not work correctly.  In Landscape, the desktop will be rotated clockwise in Portrait mode.  I've tried a few things to fix it but I eventually removed the support of the gyroscope:  sudo apt-get remove iio-sensor-proxy

Most of the time, I use my table in Landscape anyway.  You<ll have to do this when installed also.

Once removed, find the Desktop settings and select the proper orientation.  It can be done also using the command line: xrandr -o right (or left if it's in the wrong orientation).

On the final setup, I have created keyboard shortcuts to change the orientation as needed using the xrandr command.

Once your display shows in the proper orientation, you can enabled your WIFI connection as it is supported out-of-the-box.

Play and explore it.  When ready, you can install on your hard disk.

Step 5

You can install Ubuntu along side of Windows without any problems.  The main issue is that you need to reboot and press F12  to boot from the Ubuntu partition.  Also, space on the hard disk is limited at 64 Gigs.  Windows 10 does take around 30 Gigs of it with apps...

When creating your administrator user, set auto-login, it is really useful.

My initial tests were along Windows 10.  In the end, I did chose to wipe Windows 10 completely and only have Ubuntu Budgie installed.   I now have 58 Gigs of free space ;)

So install as you you wish.  I really liked Windows 10, but being stuck with the 32 bits version was a pain.

Step 6 (Once installed)

At this step, you should be able to boot into Ubuntu.  Again, you'll have to struggle with the display orientation (see Step 4).

Connect to your WIFI and update with the latest packages.  I've also enabled the developers packages.  It seems to be a bit more stable with those.

Remember the UCM file for the sound driver?  You need to copy all the sub-folders into /usr/share/alsa/ucm folder as root.

Once done, in a console, execute pulseaudio -k

You should have audio now.

For some reason, the Pulseaudio does not detect when plugging headphones so you need to do it manually to switch from Speakers to Headphones.  Keep a shortcut on the audio settings on your desktop.

Forget about the Bluetooth headphones as the Bluetooth device does not work. (At least at the moment of writing this post)

Step 7 (Ubuntu Budgie)

The default flavor of Ubuntu does support a virtual keyboard out-of-the-box but it does not work well.  With Budgie, there is not even an on-screen keyboard popping up.  But do not fear, there is a neat fix.

Install the "OnBoard" package from the Software setup.  You can use it to popup when needed from the settings and customise it as needed.  

Conclusion

You should now have a fully working Ubuntu Tablet now.  There is a few quirks here and there.  Some 3D games does not work.  You'll need the physical keyboard to play some games and you'll be missing apps and games available on iOS/Android/Windows but it will be fun.

I use Chrome from Google as it does support the touch interface, it works with Netflix and can create Web Apps using the menu "More Tools" - "Create Shortcut"

If the freezing bug could be fixed, it would be almost perfect for a real Linux tablet.



Sunday, January 1, 2017

From Pebble Time to the Striiv Fusion Bio 2

As we all know, the Pebble smartwatches are a thing of the past.  I did owned the Pebble classic and the Pebble Time.  After the Fitbit acquisition of the Pebble company, I was a bit worried that my lovely Pebble Time would turn into a nice light paper weight...

In my search for an alternative smartwatch, I did review the whole internet for the next best thing.  The main features I was looking for was battery life time and a good notification system.  I don't really care for health tracking data.  It's nice to know how many steps I did today, but I am more into getting my notifications on my wrist.

This got me to think about on how I was using my smartwatch...  Basically, I look at the time, read my notifications and that's about it.  Even if the Pebble Time can display thousands of watchfaces and supports many apps to play with, the main usage is still looking at the date and time.

So I started to consider those trackers/smartwatches having less features but providing a good battery lifetime, a good readability and displaying notifications from my iPhone.  And the price became an issue as I did spent a few bucks on those fancy watches...

I finally found the Striiv Fusion Bio 2.


As I said earlier, the price became an issue.  I actually bought the Fusion 2 for 50$ (CAD) at Best Buy...  I did get lucky and got the Fusion Bio 2 instead for the same price.  For some strange reason, the package did show the Fusion 2, but the content was actually the Fusion Bio 2 priced at 100$ (CAD).

This is mainly a health tracker but it does have some nice features:  30 days battery lifetime, displays all notifications from my iPhone, heath tracking data is a nice and this is a touch interface so no more buttons.  The Fusion 2 is small and good looking.  It does everything beside heart rate monitoring.  Since I was lucky enough to end up with the Fusion Bio 2, I do have also the heart rate monitor.

Look at the detailed features here: https://www.striiv.com/pages/striiv-fusion-bio-2

Compared to the Pebble Time, it does lack apps and custom facewatch but it does it's job nicely for a fraction of the cost.  For 50$, I still get the time, notifications and alarms.  I have a better battery lifetime (5 days to 30 days...).

It was nice to have all these possibilities with the Pebble Time but in the end, I did not need them that much.  Was it worth it the price?  I don't think so...

So if you're looking for a nice alternative for a good price, check out the Striiv Fusion (Bio) 2 at your nearest retailer...

Sunday, December 4, 2016

Fitbit buying Pebble: What will happen?

If you've read the news this week, it seems that the Fitbit company will buy Pebble.  From a business point of view, it does make sense.  For the Pebble community, it may be the end...

Currently, the smartwatch market is saturated with all kinds of products from all major brands like Garmin, Apple, Fitbit, Pebble, just to name a few.

Apple is targeting the high-end use with its Apple Watch.  Not a bad product, but the price may actually drive away a lot of people.  Other manufacturers are more into health monitoring like Fitbit and Garmin.  Even Pebble has moved into this health market with the Pebble 2 and the latest firmware available for almost all Pebble smartwatch.

If you are running, swimming or climbing the mount Everest, there is a lot of choices available for a smartwatch.  Let's be honest, I'm not part of that market, like 80% of the population.  I have nothing against training but having a device dedicated at providing me my health stats is not my cup of tea.

That's where the Pebble smartwatch was shining.  A cool smartwatch, with apps and a few extra features.  I don't care about my heart rate, I want to reply back to my tweet with my watch.

The Apple watch and the Google Gears do implements those "Dick Tracy" features but at a higher price.  For around 150$, Pebble can do it (and the battery lasts for a week...).

My main concern is what will happen with my Pebble Time...  If Fitbit shuts down the whole Pebble ecosystem, my Pebble Time watch won't work anymore...  No more updates, no new apps, no new watchface...

Currently, there are not alternative to the Pebble, for the same features, for the same price.

Let's hope that we have a few more years ahead of us before we are forced to use a "HealthWatch" instead of a "SmartWatch".

Friday, January 22, 2016

Transform your Pebble Watch into a mouse

Here's a neat little project that I created for my Pebble smartwatch:  MouseRock.

No it's not about Rock'n Roll but about using the Pebble as a mouse for a computer.  I must admit, it's not a very efficient way to interact with a computer but it was fun to experiment with.

The Pebble App

Use CloudPebble.net to create the watch app in Javascript.  Nothing fancy but the following source code was created using Pebble.js

var UI = require('ui');
var serverIP = "http://192.168.0.121:8000";
var Accel = require('ui/accel');

serverIP = localStorage.getItem("serverip");
Accel.config({
  rate:10,
  samples: 1,
  subscribe:true
});
Accel.on('data', function(e) {
  var x = 0;
  var y = 0;
  if (e.accel.x  > 200) x = e.accel.x / 50;
  if (e.accel.y  > 200) y = e.accel.y / 50 *-1;
  if (e.accel.x  < -200) x = e.accel.x / 50;
  if (e.accel.y  < -200) y = e.accel.y / 50 *-1;
  if (x !== 0 || y !== 0){
    //console.log("Z: " + e.accel.z);
    getXML(serverIP + "/?mousex="+x+"&mousey="+y);
  }

});
function getXML(url) {
    var xmlhttp = new XMLHttpRequest();
    xmlhttp.open("GET", url, true);
    xmlhttp.send();
}
var main = new UI.Card({
  title: 'PebbleRock',
  icon: 'images/menu_icon.png',
  subtitle: 'Current server',
  body: serverIP,
  subtitleColor: 'indigo', // Named colors
  bodyColor: '#9a0036' // Hex colors
});
main.show();
main.on("click","up",function(){
  getXML(serverIP + "/?mouseclick=1");
});
main.on("click","down",function(){
  getXML(serverIP + "/?mouserightclick=1");
});
main.on("click","select",function(){

});
The basic idea is to retrieve the data from the accelerometer and send the information to the computer via the HTTP protocol.  Some tweaking has been included for a better mouse handling.  Left and Right buttons have been integrated using the "click" event...

The MouseRock Server

Now that you've created the watch app, you need to create the computer server to handle the data from the Pebble.  Again, nothing fancy, just a simple HTTP server built in Java.  Here's the source code...

package pebblemouse;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
import com.sun.net.httpserver.HttpServer;
import java.awt.event.InputEvent;
import java.io.IOException;
import java.io.OutputStream;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.util.HashMap;
import java.util.Map;
/**
 *
 * @author patrick
 */
public class MouseRock {
    public static void main(String[] args) throws Exception {
        HttpServer server = HttpServer.create(new InetSocketAddress(8000), 0);
        server.createContext("/", new MyHandler());
        server.setExecutor(null); // creates a default executor
        System.out.println("MouseRock Server:");
        System.out.println("Server Address: http://" + InetAddress.getLocalHost().getHostName() + ":" + 8000);
        System.out.println("----------------------------");
        System.out.println("Enter this URL into your MouseRock configuration page.");
        server.start();
    }
    static class MyHandler implements HttpHandler {
        @Override
        public void handle(HttpExchange t) throws IOException {
            try {
                java.awt.Robot robot = new java.awt.Robot();
                int currentX = (int) java.awt.MouseInfo.getPointerInfo().getLocation().getX();
                int currentY = (int) java.awt.MouseInfo.getPointerInfo().getLocation().getY();
                String response = "Command received...";
                if (t.getRequestURI().getQuery() != null) {
                    Map<String, String> maps = queryToMap(t.getRequestURI().getQuery());
                    for (String param : maps.keySet()) {
                        String value = maps.get(param);
                        switch (param) {
                            case "mousex":
                                int x = new Double(value).intValue();
                                currentX += x;
                                robot.mouseMove(currentX, currentY);
                                //System.out.println("Mouse X");
                                break;
                            case "mousey":
                                int y = new Double(value).intValue();
                                currentY += y;
                                robot.mouseMove(currentX, currentY);
                                //System.out.println("Mouse Y");
                                break;
                            case "mouseclick":
                                robot.mousePress(InputEvent.BUTTON1_MASK);
                                robot.mouseRelease(InputEvent.BUTTON1_MASK);
                                System.out.println("Mouse Clicked");
                                break;
                            case "mouserightclick":
                                robot.mousePress(InputEvent.BUTTON3_MASK);
                                robot.mouseRelease(InputEvent.BUTTON3_MASK);
                                System.out.println("Mouse Right Clicked");
                                break;
                        }
                    }
                }
                t.sendResponseHeaders(200, response.length());
                OutputStream os = t.getResponseBody();
                os.write(response.getBytes());
                os.close();
            } catch (Exception ex) {
                System.out.println(ex.getMessage());
            }
        }
    }
    public static Map<String, String> queryToMap(String query) {
        Map<String, String> result = new HashMap<>();
        for (String param : query.split("&")) {
            String pair[] = param.split("=");
            if (pair.length > 1) {
                result.put(pair[0], pair[1]);
            } else {
                result.put(pair[0], "");
            }
        }
        return result;
    }
}
What the server does is get the Mouse X, Mouse Y values sent from the Pebble smartwatch and uses the Robot class to move the mouse.  The server is moving the mouse by adding/subtracting a value to the current mouse location.  Since the Pebble watch will send a lot of data, those values must be small increments.  Buttons were also handled by activating them when the "Up" and "Down" were pressed on the Pebble.

Since the server was coded in Java, it should work on any operating system: Linux, Windows or OSX.

The Result

This hack won't replace a real mouse as it is a bit cumbersome to use.  But it's a fun experiment to create a motion activated mouse.

Here's a video of the experiment:



Tuesday, December 15, 2015

Update your Pebble!

Today, Pebble has made available the their new firmware (3.8) for the Pebble Time.

The major new feature is the new app Health that can be synced with your smartphone Health Kit.  The Pebble Time smart watch is becoming more and more interesting with each new update and this one is a major one.



You need to update your Pebble Time companion app on your smartphone.  Then you will be able to upgrade your watch in just a few minutes.

At the same time, the original Pebble will also benefit a major revision as it is moving the the new Pebble Time interface.  I just finished installing it on my OP.  Even if the display is monochrome, the new interface is looking great, fast and smooth.  


Sunday, December 6, 2015

More than time!

I got my hand on the Pebble Time last week.  I've been browsing the available apps in the Pebble Store, looking for the really useful one that would provide more functionalities to my watch.

My classic Pebble has been really great for the last year but I was tempted by the Pebble Time for two main reasons:  the colours and the voice input feature.

With some many products available on the market, I do prefer the Pebble Time as it does offer a lot of functionalities for a low price compared to the others.  At the price of 179$ CAD,  other products can only offer limited features like activity tracking and basic notifications while the Pebble (Time) do offer thousands of apps and watch faces to customize your watch to your needs.



Beside supporting colours, the Pebble Time has a microphone for voice input thru text recognition.  At the time of writing this post,  apps supporting voice input are rare.  If you're on Android, you will be able to reply to the notifications received from Twitter, Facebook of an SMS.  This is a really neat feature not available for Apple users.  On iOS, all you can do is dismiss the received notification.




As I wanted to explore the possibilities of my Pebble Time with my iPhone, I've discovered Turquoise, a Twitter client app that lets you reply to private messages, mentions.  Shake your wrist and post publicly.  Turquoise is pushing the boundaries of the Pebble Time by providing a new way to use the device.  Most apps will let you view informations, schedule new reminders or acknowledge something.  For the first time, we have an app that is not related to time but to communication.  A few others have tried to provide such a feature but in my opinion, Turquoise nailed it perfectly on the Pebble Time.