因為一條 USB 線燒了三個設備...

Benson Leung 花了不少時間在測試 USB 線 (「Google 工程師在 Amazon 上留下對 USB-C 線的精彩評價...」與「Google 工程師在 Amazon 上對 Type C USB 線的評論」),而前陣子他測到一條超棒的 USB 線,把他三個測試設備都燒壞了:(出自這邊)

Surjtech's A-to-C cable seriously damaged a Pixel 2 laptop and two USB PD analyzers.

他在 Amazon 上留下的說明可以看到他發現廠商直接把 GND 與 Vbus 的線接錯了 (這個有厲害...):

I directly analyzed the Surjtech cable using a Type-C breakout board and a multimeter, and it appears that they completely miswired the cable. The GND pin on the Type-A plug is tied to the Vbus pins on the Type-C plug. The Vbus pin on the Type-A plug is tied to GND on the Type-C plug.

另外在回覆裡也有更完整的說明:

I've had the cable taken apart, and we've discovered some interesting details. I'll post a post with pictures soon.

1) Vbus and Gnd are switched. Red wire goes to G on the Type-C's PCB, Black wire goes to V.
2) 10 kΩ resistor instead of 56 kΩ resistor used.
3) resistor hooked up as a Pull-down instead of a pull-up
4) Wire is COMPLETELY missing SuperSpeed wires. It is NOT actually a USB 3.1 cable, even though it has a blue connector on the A side and SuperSpeed logos.

Bad. So bad.

照片可以在這邊看到。看起來 Benson Leung 得再去 Google 內要新的機器來測試了...

Google 工程師在 Amazon 上對 Type C USB 線的評論

先前提到「Google 工程師在 Amazon 上留下對 USB-C 線的精彩評價...」,後來這位工程師 Benson Leung 寫了更多的評價出來,在「Amazon.com: Profile for Benson Leung」這邊可以看到。

可以看到大量的線被打了兩顆星,不過還是少數有幾條線測過了:

35 條只過了 6 條,看起來狀況不太好啊 XDDD

Benchmark DAC2 HGC 在 Ubuntu 14.04 LTS 下使用 USB 沒有聲音的問題

記得剛買來的時候是有聲音的,後來突然有一天沒聲音... 試了一堆方法都沒用 (換 kernel 版本、禁用 xHCI、換 USB 線、...),最後是在「Benchmark DAC2 HGC impressions (and Linux setup notes)」這邊看到方法。

這邊有幾個重點:

DAC2's USB 1.0 mode doesn't work with Linux kernel 3.8.x, but USB 2.0 does. So switch it to USB 2.0 and forget about it. Next, I figured that the audio was simply being muted in some instances. The solution is to open a terminal window, run AlsaMixer, hit F6 to configure the DAC 2. Even though their levels cannot be altered (they're fixed at 00), the first two items must be unmuted in order to get any sound:

如同文章裡說的,USB 1.0 模式 (會抓到「Benchmark DAC2 USB Audio 1.0」) 是不會動的,而 USB 2.0 可以 (會抓到「Benchmark DAC2 USB Audio 2.0」),但播放時沒有聲音。

解法則是使用 alsamixer,進入後按 F6 選 Benchmark DAC2,將前面兩個用 m 給 unmute 掉就好了:

為此學到一堆底層看 USB 的工具...

為 Open Source Hardware 發放 USB Product ID 的 pid.codes

pid.codes 的說明就很清楚了:「Welcome to pid.codes」。

由於 USB-IF 對每個 vendor 收 USD$5000,而且不可以跟其他單位共用:

If you’re a maker, hobbyist, or startup company producing your own USB device, you’ve probably discovered that you need a USB Vendor ID and Product ID to uniquely identify your device to computers. The USB-IF’s position is that the only way to do this is for each organisation to pay $5000 for a unique Vendor ID, which they may not share with other individuals or organisations.

所以就造成很多人惡搞 Vendor ID 與 Product ID:

For many makers and small companies, this is a prohibitive amount of money, and forces them to resort to workarounds, such as using other organisations' VIDs without permission, or simply making up a VID and PID. These solutions make things worse for everyone, by damaging the assumption that a VID/PID combination is unique to a given device.

而他們尋求解決方案,取得了一份在 USB-IF 禁止共用前的 Vendor ID,從而解決這個問題:

pid.codes seeks to solve this issue for anyone producing open-source hardware. We have been gifted a Vendor ID by a company that was issued one by USB-IF and has since ceased trading; they obtained the Vendor ID before the USB-IF changed their licensing terms to prohibit transfers or subassignments.

對 Tor 的攻擊開始了...

先前幾天 Tor 官方才猜測會被攻擊 (Tor 官方預測將會被攻擊),在今天的 Hacker News Daily 就看到有機器被扣:「[tor-talk] Warning: Do NOT use my mirrors/services until I have reviewed the situation」。

Tonight there has been some unusual activity taking place and I have now lost control of all servers under the ISP and my account has been suspended. Having reviewed the last available information of the sensors, the chassis of the servers was opened and an unknown USB device was plugged in only 30-60 seconds before the connection was broken. From experience I know this trend of activity is similar to the protocol of sophisticated law enforcement who carry out a search and seizure of running servers.

偵測到機器被打開,並且插入 USB device,接下來失去對機器的控制權。

很特別的 Side-channel attack 方法以取得 RSA 與 ElGamel 的 private key

在「A new Side channel attack-how to steal encryption keys by touching PCs」這邊看到一種很特別的 side-channel attack:(直接先看圖)

引用說明:

The signal can also be measured at the remote end of Ethernet, VGA or USB cables.

方法愈來愈特別了 XDDD

GPS logger:環天的 DG-100...

24h 上買了這顆「DG-100 GPS 數據紀錄器」,然後在 VirtualBox 裡吃鱉了好幾次,所以還是整理一下,讓之後的人比較好辦事 XD

用過的兩顆 GPS logger 都是用 Prolific 的 PL2303 系列晶片,透過 Serial port 的架構溝通,所以 Ubuntu 下會抓到 /dev/ttyUSB0 這種界面。

由於我的目的比較簡單,只要可以抓 gpx 資訊給我就好,後來在 OpenStreetMap 的 wiki 上找到「Globalsat」的資訊,發現了 GPSBabel 這個軟體可以直接在 Mac OS XLinux 下抓 DG-100 的資料:

gpsbabel -i dg-100,erase=0 -f /dev/ttyUSB0 -o gpx -F "track.gpx"

(話說 GPSBabel 的網站感覺回到十年前...)

看指令,如果指定 erase=1 的話就會清掉記錄?另外在 Mac OS X 下則是指定 /dev/cu.PL2303 開頭的 device。

抓下來以後丟到 Dropbox,然後到世界迷霧裡更新,發現就算是已經跑到爛掉的路線,GPS logger 仍然可以記錄到 iPhone 記錄不到的...

差點重灌 Ubuntu...

UbuntuUnity 在 11.04 很不穩,常常跑一跑就自己變得很慢,或是當掉... 在公司裡蠻多用 Ubuntu 的人是不用 Unity,不過我還是堅持用,反正也用習慣了...

剛剛又變得很慢,於是就把 browser 關一關重開機,結果重開機後進入登入畫面就當住了,滑鼠與鍵盤都沒反應... XD

多重開幾次後發現只要碰到 keyboard 就會當,滑鼠的部份沒問題。先懷疑是 keyboard 硬體有問題,換成 ACK-230 後還是一樣,跑 memtest86+ 半輪也沒問題 (8GB RAM 跑起來還真久,跑到 43% 沒問題就不想測了),於是就試著 recovery mode 看看,發現鍵盤是正常的...

然後就試著死馬當活馬醫,先 dpkg -l | grep usb 把所有 usb 相關的套件全部用 apt-get install --reinstall 重裝,然後再把 gdm 也重裝進去,順便跑 fsck 清一下,重開後居然活過來了...

也不知道問題到底是出在哪裡... :o