Mittwoch, 26. Oktober 2016

Rooting Sony SmartWatch 3 "tetra" with Android Wear Marshmallow 6.0.1 M1D63X

Rooting the SmartWatch 3 cost me way to much time through trial and error, so here is a little tutorial for you guys:

  1. Download and extract this: https://drive.google.com/open?id=0BzOF0XGjhOopWHozY0NnV2E1Z2c
  2. Enable ADB-Debugging on you watch and plug your USB cable in.
  3. On your PC make sure you have adb & fastboot installed and type in   adb reboot bootloader
  4. Make sure your bootloader is unlocked! (fastboot oem unlock)
  5. There is no stable TWRP recovery (yet?) for tetra@6.x.x, so make sure you only boot and do not flash the following image via   fastboot boot new_boot.img
  6. After a few seconds you should be in TWRP now, if not try booting again, if nothing works, repair your firmware with the Sony Xperia Companion app (restoring android wear only works in their PC version)
  7. Push a modified supersu to your watch by using  adb push wearSU267.zip /sdcard
  8. Install the zip via TWRP and follow the process, reboot.
  9. You have SU! 

Mittwoch, 30. März 2016

bdaddr - Changing your Bluetooth USB Dongle's MAC Address

Wikipedia.com: "[...] MAC addresses are most often assigned by the manufacturer of a network interface controller and are stored in its hardware, such as the card's read-only memory or some other firmware mechanism. If assigned by the manufacturer, a MAC address usually encodes the manufacturer's registered identification number [...]"

So does that mean we can't change the public MAC of Bluetooth Dongles? Depends.
I my tests I was able to set MACs of most Bluetooth Dongles with different side-effects.





Since setting a MAC is not a standard operation, you will have to use vendor-specific Bluetooth HCI command to set it. Luckily there is a tool for that.
It supports some (but not all) chips from those manufacturers: Ericsson, CSR, Texas Instruments, Broadcom, Zeevo and ST.


Make sure to install BlueZ on your system first.

  1. Download from here: bdaddr (not the latest version, but works fine)
  2. Extract it
  3. Rename bdaddrtar in bdaddr.tar
  4. Extract it
  5. Run make in the directory.
Here is the man for bdaddr:




bdaddr - Utility for changing the Bluetooth device address 
    Usage: bdaddr [-i <dev>] [-r] [-t] [new bdaddr] 

Run it with: sudo ./bdaddr -i hci0 -r 00:de:ad:be:ef:00

Where hci0 is your HC-Interface (if you have multiple it might be hci1, hci2.. run hciconfig to check). The -r flag forces a vendor-specific reset. Some modules might need an additional reset via hciconfig reset before working properly. Tested CSR modules needed to be plugged in and out before properly working as BLE Peripherals.

Freitag, 26. Juni 2015

Android BLE Error / Status Codes Explained

So here is a list of commands that are documented by hardware developers, such as Nordic and codes I figured out myself. List is to be completed.


Status Status Hex Description Explanation
00x00BLE_HCI_STATUS_CODE_SUCCESSEverything ok.
10x01BLE_HCI_STATUS_CODE_UNKNOWN_BTLE_COMMAND
20x02BLE_HCI_STATUS_CODE_UNKNOWN_CONNECTION_IDENTIFIER
50x05BLE_HCI_AUTHENTICATION_FAILURE
60x06BLE_HCI_STATUS_CODE_PIN_OR_KEY_MISSING
70x07BLE_HCI_MEMORY_CAPACITY_EXCEEDED
80x08BLE_HCI_CONNECTION_TIMEOUTCould not establish a connection in specified period. Maybe device is currently connected to something else?
120x0CBLE_HCI_STATUS_CODE_COMMAND_DISALLOWED
180x12BLE_HCI_STATUS_CODE_INVALID_BTLE_COMMAND_PARAMETERS
190x13BLE_HCI_REMOTE_USER_TERMINATED_CONNECTIONRemote device has forced a disconnect.
200x14BLE_HCI_REMOTE_DEV_TERMINATION_DUE_TO_LOW_RESOURCES
210x15BLE_HCI_REMOTE_DEV_TERMINATION_DUE_TO_POWER_OFF
220x16BLE_HCI_LOCAL_HOST_TERMINATED_CONNECTION
260x1ABLE_HCI_UNSUPPORTED_REMOTE_FEATURE
300x1EBLE_HCI_STATUS_CODE_INVALID_LMP_PARAMETERS
310x1FBLE_HCI_STATUS_CODE_UNSPECIFIED_ERROR
340x22BLE_HCI_STATUS_CODE_LMP_RESPONSE_TIMEOUT
360x24BLE_HCI_STATUS_CODE_LMP_PDU_NOT_ALLOWED
400x28BLE_HCI_INSTANT_PASSED
410x29BLE_HCI_PAIRING_WITH_UNIT_KEY_UNSUPPORTED
420x2ABLE_HCI_DIFFERENT_TRANSACTION_COLLISION
580x3ABLE_HCI_CONTROLLER_BUSY
590x3BBLE_HCI_CONN_INTERVAL_UNACCEPTABLE
600x3CBLE_HCI_DIRECTED_ADVERTISER_TIMEOUT
610x3DBLE_HCI_CONN_TERMINATED_DUE_TO_MIC_FAILURE
620x3EBLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED
1280x80GATT_NO_RESSOURCES
1290x81GATT_INTERNAL_ERROR
1300x82GATT_WRONG_STATE
1310x83GATT_DB_FULL
1320x84GATT_BUSY
1330x85GATT_ERRORCan be anything, from device not in Range to a random error.
1350x87GATT_ILLEGAL_PARAMETER
1370x89GATT_AUTH_FAIL

Sources:
Nordic
Android Source

Dienstag, 16. Juni 2015

Connection a USB Printer to Cisco / Linksys EA3500 router with OS X Yosemite and newer

Since my update to Yosemite, WiFi printing via Linsys' own software 'Cisco Connect' would no longer work. So I looked up and found a neat and even more stable alternative to connect your USB Printers to Linksys routers: SX-Virtual-Link

Just install it and you are good to go!

Sonntag, 22. Februar 2015

Java for OS X: Reading a Mac's (unique) Serialnumber

Each Mac has a unique Serialnumber, that you typically only use to check if you are still under warranty - but you could also use it to identify users (analytics) or to make time limited app trials more effective (as Adobe does it).

The Java code is pretty straightforward, basically it runs 'ioreg' and does some string ops:

BufferedReader in;
try {
 String[] command = { "/bin/sh", "-c",
   "ioreg -l | awk '/IOPlatformSerialNumber/ { print $4; }'" };
 Process p = Runtime.getRuntime().exec(command);

 in = new BufferedReader(new InputStreamReader(p.getInputStream()));
 String sn = in.readLine();
 in.close();
 p.destroyForcibly();
 sn = sn.substring(1, sn.length() - 1);// cut off quote. marks

 System.out.println(sn);
} catch (IOException e) {
 e.printStackTrace();
}

Samstag, 7. Februar 2015

Hey Apple, how about (finally) fixing iOS 8?

Seems like Apple had a really bad start in 2015 (and end of 2014) when it comes to software quality. At this point I should mention that others had problems, too (Android 5.0.0 even kills telephone functions on some devices), but it is still very strange that an once so good software (OS X Mavericks, iOS 7) turned into a disaster (Yosemite, iOS 8). A early market entry is important, but shouldn't final products be delivered instead of sever bugs?
While most people are talking about the Yosemite bugs (and most of them are still not addressed after over 10 iterations!!) not many focus on iOS.



Here is a list ordered by my devices - all bugs listed here are existing since the first iOS 8 dev versions:

iPhone 5S:

  • Phone app: Sometimes gets stuck when using headphones and kills the home button. You can't get out of the phone app then.
    Fix: Reboot phone, might be fixed in latest update
  • Phone app: While listening music, calling someone that is unreachable might place music on earpiece or lower sound quality to GSM-like quality
    Fix: Wait till call is ended.
  • Phone app: Pressing to many numbers in the phone dialler during a call will make the phone app get stuck
    Fix: Wait, wait, wait ...
  • Music App: Album & Song covers are randomly placed over objects that don't have a cover.
    No fix
  • Music App: randomly fast-forwards / rewinds.
    No fix
  • Music App: Putting the phone to landscape mode / album mode will show last selected album in landscape mode instead of current or last selected (in portrait eg.)
    No fix

iPad Mini (1st gen):

  • When deleting apps iPad gets unresponsive and you can't even turn of using the power button
    Fix: Hold down Power & Home button at the same time to turn off, then start again
  • iPad does sometimes not blur some areas (very rare), e.g. swipe down search or notification center
    Fix: Reboot
  • Siri: Sometimes refuses to geolocate, while other apps / services have no problem.
    Fix: Make a raindance. Seriously just wait and one day it will work
At time of writing I had 8.1.3 on my iDevices. It fixed already a lot of stuff (remember WiFi-gate?).
Now please Apple make my stuff enjoyable again ;-)

Mittwoch, 7. Januar 2015

Keyes IR emitter / transmitter with Arduino

Putting an IR transmitter to your Arduino is easy and gives you the power to control your TV, HiFi, Clima controls and basically everything else that has an IR receiver. To do this, signals are modulated so receiver and transmitter need to "speak the same language". The one I am covering has 38 kHz and works fine with my TV & HiFi.

Simply connect the S (Signal) from Keyes to one your Arduino PWM Pins. The default is Pin 3 on the Uno. "-" goes to ground of course.

Now just use the very powerful IRremote library from shirriff.


#include <IRremote.h>

IRsend irsend;

void setup()
{
  irsend.sendNEC(0x20dfc03f, 32); // Volume Up for my LG (42LM660S) TV
}

void loop() {
}

As you see the code is fairly easy too use. Just find out what your target devices Protocol, Code and expected Length is and you are good to go!

Btw: In case you try to see the IR emission using your smartphone. iPhones 5 and up have an IR Filter so you wont see anything with them. Took me an hour or so to figure out the problem was my iPhone and not the circuit ...