Running with Ruby

Category: Hardware (page 1 of 6)

Extracting the device token from Xiaomi Air Purifier 2S EU for Domoticz usage

Xiaomi Air Purifier is one of the best on the market in the price/value category. Like many other Xiaomi devices, it can be controlled using a great home automation system called Domoticz.

The only problem that I had is that for the 2S version, there is no way to obtain the device token needed for controlling the device using the miIO library.

Here are the steps needed to obtain this token using a Linux machine and a non-rooted Android phone.

Getting the Mi Home data backup

  1. Download and install the Mi Home application. You need to have the 5.0.19 version of this app. The newer versions don’t persist the token locally in the SQLite database. You can get it from the APKMirror page. Note, that you will have to allow the Unknown sources to do that. Here’s a description on how to do that.
  2. Enable developer mode and USB debugging on your phone (instruction).
  3. Download and extract the Android Platform tools for Linux from here.
  4. Install the most recent Java version if you don’t have it.
  5. Enable developer mode and USB debugging on your phone and connect it to your computer.
  6. Unlock the phone and allow the computer for data transfers (not USB charging only).
  7. Authorize the Linux machine on your Android phone.
  8. Run the following command from your Linux machine:
    ./adb backup -noapk com.xiaomi.smarthome -f backup.ab
    
  9. Unlock your device and confirm the backup operation. If your phone is encrypted, you will also have to provide the backup password.
  10. If everything went smooth, you should have a backup.ab file in the platform tools for further processing. From this moment, you won’t need the phone to be connected to your laptop.

Getting the device token out of the Mi Home backup

  1. Download and unpack the ADB extractor.
  2. Navigate to the android-backup-tookit/android-backup-extractor/android-backup-extractor-20180521-bin directory.
  3. Copy the abe.jar file to where your backup.ab is.
  4. Run the following command and follow the instructions (if any):
    java -jar abe.jar unpack backup.ab backup.tar
    
  5. Unpack the extracted backup:
    tar -xvf backup.tar
    
  6. Go to the apps/com.xiaomi.smarthome/db directory.
  7. Install and run the DB Browser for SQLite:
    sudo apt-get install sqlitebrowser
    
  8. Open the miio2.db file using the DB Browsers for SQLite.
  9. Click on the Execute SQL tab and run the following query:
    SELECT localIP, token FROM devicerecord
    

    As a result, you will get a list of the tokens with the IPs of the devices in your networks to which they belong (I’ve blurred the tokens just in case in the picture):

Now you can take the appropriate token and use it within your Domoticz setup.

Lenovo ThinkPad X1 Carbon (6th Gen / 2018) review – Sad story of a potentially great ultrabook

TL;DR – Don’t buy it

Don’t buy it. If you cherish your time and money and you think about a laptop as a work tool, go with something else.  There are many hardware problems with this computer and, if by any chance, you decide to open a warranty claim, Lenovo will make it really hard for you.

They will force you to send your laptop back (despite an on-site extended warranty), they will ship it back in an even worse state and will make you wait one more month to get a replacement.

Lenovo does not seem to have quality control in place. Here’s a list of problems you will likely encounter:

  • Not properly closing lid (a lot of space on one of the sides);
  • Overheating when connected to a docking station;
  • Overheating without a docking station;
  • High pitch noise when using USB headphones and a docking station;
  • Poor speakers quality and speaker cracking noise;
  • Non existing on-site warranty;
  • Really bad certified repair partners (at least in Poland);
  • A lot of configuration and tuning to make it work with Linux;
  • Screen scaling problems on Linux;
  • Backspace key missing stroke;
  • Keys / track point leaving permanent marks on the screen;
  • Weird sound distortions;
  • Low coating quality;
  • 256GB hard-drive performance problems.

If you don’t have any of those problems, consider yourself lucky. It turns out, it is a lottery. And I don’t want to test my luck against a hardware that should help me with my work. I would rather prefer to be able to rely on it.

Note: Just to be clear. This is the list of all the things reported by many users. I’ve encountered some of them, but it was way more than enough for me to lose my patience and consider this promising ultrabook a failure.

A great beginning with a poor ending

Around 3 months ago, I decided that it is about time to buy a new laptop. I’m a programmer and for me it is a long-time relationship.

I spent nearly a month researching and I was hesitating between Dell Latitude 7390 and the brand new Lenovo X1 Carbon 6th Gen / 2018. I’ve always been a big fan of the Latitude brand and have been using them for over 8 years now. But the truly lightweight Lenovo Thinkpad caught my eye with its amazing design and long battery life. The specs were also really good and the overall performance seemed nice. I thought to myself: “You can’t get that wrong with Lenovo, right?”.

Initial impression

My initial impression of this laptop was really good. Despite not being fully “Ubuntu ready” and forcing me to spend a fair amount of time tuning it, I would say I was surprised with the overall performance and robustness of this piece of hardware. You can read about the tuning and my initial impressions in this article: Lenovo ThinkPad X1 Carbon (6th Gen / 2018) Ubuntu 18.04 Tweaks. Unfortunately what happened next, makes me question my decision to get this laptop in the first place.

Problems, problems everywhere

After a couple of days, I understood, that I will have to invest a bit of time to personalize this laptop and make it suitable for my needs. I was able to eliminate most of the software problems, but then after a while, I noticed a couple of things that could be acceptable in a laptop worth $500 max.

Note: All of the problems mentioned above are not rare or unique. There’s an alarmingly huge number of Reddit posts and posts on the Lenovo forum from many other people experiencing the same problems. There’s even an unofficial list of all the defects you can get with this laptop and it’s getting longer each week.

Low coating quality

The picture is not mine (taken from this Reddit post)  but after I got it, I also noticed, that the coating is somehow delicate and easily scratchable. It is definitely worse than my current Latitude E7440.

High pitch noise using USB headphones and a docking station

If you’re planning to use a Thunderbolt docking station and USB headphones, you can pretty much forget about it. You will constantly hear an irritating noise that will make you go crazy. It disappears when using the built-in USB, but hey, isn’t it why I bought a docking station not to have to plug anything directly?

I was able to eliminate it partially by tuning some sound settings but it would anyhow randomly occur again. Absolutely horrible.

Overheating when attached to a docking station

Next downside of having a business-grade laptop with a docking station support that I’ve never encountered with a Dell computer: overheating.

I’m not talking about a heavy-workload overheating when fans would go on. No, no. I’m talking about laptop getting seriously warm near the Thunderbolt connection, making it almost too hot to touch when in the idle mode.

Of course, I was able to make it better a bit by under-volting and changing some of the CPU throttling settings but it really was getting really warm in the idle mode indeed. If you buy it, 60-70 (°C) will be the norm.

This would not happen when connected to a USB-C charger only. The laptop would then maintain stable 35-45  (°C).

Not aligned lid / lid not closing properly

The worst issue of them all. If it wasn’t for my docking station, I might have not noticed that at all. But I did. And I compared it with MBP. And it looks really bad. The lid is not closing properly, having a huge gap on the right side of the laptop.

Here’s how it looks:

And MBP for comparision:

For me, it’s unacceptable. End of story. It’s not a unitary case. There are many more people reporting that manufacturing defect. Even the replacement laptop that I was supposed to get had this issue. I was also able to see the same problem in one that I saw in a shopping center (less visible but still there).

Extended on-site warranty does not exist

Ok. So the lid is not closing. Maybe it was due to bad hinges position or something like that. Who knows. I have an on-site warranty so it shouldn’t be a problem, right? It never was during my adventure with Dell.

21 June 2018 I opened a warranty claim (Incident: 180621-001473 / COMP 8000440787). After a day or so a technician from a Lenovo-certified company called me and after a brief talk, I sent him some photos. He then told me, that it seems to be my fault and I have to ship it to Warsaw.

I explained it to him, that the laptop spent 95% of its time on a docking station and that it was opened maximum 15 times. He didn’t believe nor care about that. “We won’t be able to fix it on-site, you need to send it over”. And that’s the end of my extended on-site warranty.

Regular warranty does not work as well

Let’s say he was right and it did require a more extensive amount of work to fix it. So it got shipped. It got to Warsaw on the 26th of June and it was there until it got back to me in an even worse state.

During that time, the Lenovo-certified repair company would not give me any details. I was unable to reach them via phone and they wouldn’t reply to my emails. I was able to get some information (general things like “it will be tested for 2 more days”, etc.) only by calling the repair company’s line dedicated to… Toshiba. The Lenovo line did not care to answer.

Making a complaint

While the “repair process” was ongoing, I decided to make a complaint, using the Lenovo phone line. They opened a case and Complaints Coordinator for Lenovo Poland contacted me, saying that the laptop will be fixed and delivered back to me in 2 days. It was. But as I said, in the worse state than it was before…

Trying to get a new laptop (replacement)

After I got my Thinkpad X1 back (after 12 days), I contacted the Complaints Coordinator once again. He was the first person that would not treat me like someone that wanted to fraud Lenovo. He asked me to ship the laptop back to them and said I would get a replacement. I was really tired at that point. I just wanted to have a working laptop, free of any defects…

Other laptops have same defects

Lenovo reseller from which I bought the laptop (Notebooki.pl ) contacted me and said that Lenovo approved the replacement and that they’re ordering me a brand new one, but… it didn’t work.

After a few more days, they called me again and said, that the one they got had the same defects as the old one and that it’s pretty much pointless to ship it to me. The whole batch seems to be defective.

Want a replacement one? Wait a month

If you buy a Lenovo laptop, it may turn out, that they aren’t able to replace it within a decent timeframe. If it wasn’t for the fact, that I had my old Dell Latitude, I would be left without an essential work tool. Notebooki.pl (Lenovo reseller) informed me, that there isn’t a laptop that would be a replacement for me and that I have to wait a month. This basically means, that despite me paying a lot of money for this piece of hardware plus extra for the extended on-site warranty, I would be left without anything for over 2 months. To be honest I don’t blame them, but rather Lenovo. When I got some dead pixels in my Latitude, Dell shipped a new one to me in 24 hours. Shouldn’t we expect the same kind of treatment here? Well, I do!

We didn’t solve your problem but we will send you multiple emails with Customer Satisfaction Surveys

Despite my still not having a new laptop, I was able to get 3 emails from Lenovo in which they would ask me about my impressions on their way of handling things. It made me laugh a bitter laugh.

Summary – Don’t buy this laptop unless you’re super patient

I don’t have a laptop. I was able to get a permission from Lenovo to get my money back for the laptop and I’m buying a Dell Latitude 7390. Notebooki.pl was kind enough to accept the docking station back and take care of all the paperwork.

It’s been a stressful month and I still run on my old hardware. Lenovo has proven to be a complete failure and looking at how they operate and how their certified repair partners operate, I’m 100% sure that I won’t buy anything of this company never again. If you’re a programmer and you want to have hardware that you can rely on and you want to be sure that in case of any troubles you won’t be treated as enemy, don’t pick Lenovo.

References

Olderposts

Copyright © 2018 Running with Ruby

Theme by Anders NorenUp ↑