Written by Darell Tan on 12 Jan 2011Share Comments
Apple has just announced a new iPhone 4 hardware revision that allows it to be used on CDMA networks. iPhone Personal Hotspot Pref [photo stolen from Ars Technica] Interestingly, the new iPhone comes with a Personal Hotspot preference that allows it to share its 3G connection over WiFi. Ars Technica has photos of the new preference menus. I must stress the photos shown here were not taken by me. Of course the Android people have had this for a while (provided their phones could be updated to Froyo).
If you’re into microcontrollers like me, you should have an FTDI breakout board or the more handy FTDI TTL-232R-3V3 cable. This cable integrates an FTDI USB-to-serial chip and terminates into a 6-pin header, with TTL in/outputs, ready to be interfaced to any microcontroller.
Recently I had to talk to an RS232 port. The voltage used by the RS232 port is anywhere from 7 to 15 V (typically), and uses both positive and negative voltages, which cannot be directly interfaced with TTL. Most of my university friends who took microcontroller class previously bought an RS232-to-USB converter, since that’s what the trainer board (evaluation board) uses, but not me. So what should I do now?
Using a MAX232 (actually a HIN232) chip and 5 capacitors, I followed the recommended application circuit to build a level shifter. I laid out the circuit on a veroboard with a 6-pin header on one end for the TTL-232R-3v3 cable, and a 2x5 header for the RS232 port.
Since I ripped out many old computers with those serial port headers I decided to use it. The pinout for the RS232 port header is available in many motherboard manuals, including mine. The only pins (usually) of interest are circled. The pins are 2, 3 and 5 for receive, transmit and ground, respectively.
Update 21-Sep-2011: Added an Installation section and updated the binaries on Bitbucket.
As you may know, I have a couple of Apple devices. Apple is fond of using Multicast DNS (mDNS) for their service discovery. The recent addition to these services being AirPrint (wireless printing service) and AirPlay (wireless audio/video streaming) from your iOS devices.
My home is setup in such a way that the wired and wireless networks are on 2 separate subnets. mDNS uses a multicast address that is “administratively scoped”, meaning the packets will not travel across subnets. I tried fiddling around with iptables rules and looked around for how I can route these packets across the subnets, but to no avail.
There is another solution - a repeater daemon that sits on the router and repeats packets between the 2 subnets. Avahi is used to provide mDNS services and it has a reflector mode that does exactly this. A more lightweight solution was TiVoBridge, which supposedly performs the same task but it’s much smaller. I tried to compile and set up TiVoBridge, but it required a config file and I couldn’t really get it to work the way I wanted it to. There’s an even lighter-weight solution called SAY, but it uses libpcap.
Enter mdns-repeater - a small Linux daemon that does exactly what I want it to do. I have a Linksys WRT54G which runs dd-wrt. This program was intended to be compiled for and installed on the Linksys router. As with all other programs that run on the router, it requires no configuration.
The default dd-wrt configuration has 2 interfaces - vlan1 for the WAN interface and br0 for the wireless interface (and 4-port switch). The program accepts the arguments vlan1 and br0 and begins repeating packets from vlan1 to br0 and vice-versa. I can now get my iOS devices to detect wired servers like a print server for AirPrint.
mdns-repeater is released under GPLv2. Feel free to change it to repeat whatever protocol you want. Patches to add functionality and bug fixes are welcome. You can contact me via bitbucket.org, or if you clone the repository my email is in the commits.
Written by Darell Tan on 18 Nov 2010Share Comments
Actually I was aware of this problem some time ago. Even though the iPad has a beefy processor, it still renders Javascript-heavy sites slowly. Yes, probably the Javascript that draws on the canvas can be further optimized, but if other browsers can render faster, why can’t MobileSafari? [youtube=http://youtube.com/watch?v=s72rGDUn2uo]
Written by Darell Tan on 31 Oct 2010Share Comments
I wonder why the China market is full of stuff like these (click the images for links to the full story). fake capacitors capacitors fake 10 mm LEDs 10 mm LEDs atmega328 comparison ATmega328P’s failed antenna design bluetooth dongles and this one probably takes the cake: fake-wifi But of course, that’s not to say that everything that comes from the country is of this quality. I just wonder why there areĀ a high number of reports of such duds.
Written by Darell Tan on 27 Oct 2010Share Comments
Apple is planning to change the iPad’s orientation lock switch into a mute switch, just like on iPhones, in iOS 4.2. I can’t agree more with this: The iPhone and iPod Touch are, for many people, audio devices. But the iPad is a reading/viewing device for most of us.
I recorded a GPX file using myTrack HD today, and I wanted to overlay it on Google Maps. However, most of the services I’ve seen required you to upload your GPX file and they will process it for you. This is something I feel strongly against doing.
In my search for an local solution (as opposed to uploading it to a server), I found GPX Viewer, an implementation of a GPX parser in Javascript which reads the GPX file and overlays the track. This is all done without uploading any data anywhere.
All it requires is 2 files to be downloaded and it runs really well:
Written by Darell Tan on 20 Sep 2010Share Comments
I’m currently trying to analyze a binary protocol between 2 devices, but their communication does not occur over the network, neither can it be sniffed easily. Since this involves communication between 2 parties, I think the most apt software for analyzing such “conversations” would be Wireshark.
Wireshark allows for custom protocol dissectors. Writing such a dissector is usually done in C for speed, but I didn’t really want to setup the whole compilation environment to compile Wireshark. Fortunately, the Wireshark (Windows) binaries are compiled with Lua scripting support, which can also be used to write dissectors (although they run slower than C implementations).
Written by Darell Tan on 11 Sep 2010Share Comments
I’ve recently installed Windows 7 on my desktop and I’m trying to migrate files from the laptop’s hard disk. Whenever I try to copy files from a folder that I do not have permissions to, it asks me if I want to gain “permanent access” to the folder and its contents, which means to alter the folder permissions to take ownership of the folder & files. Why would I want to do that?
Previously I wrote about trying to fix my BenQ DW1640 drive tray, but without replacing the belt. Of course it didn’t work. This time I went to Sim Lim Tower, where I know this particular shop called Space Electronics in the basement has a very wide selection of drive belts. Since I didn’t take the original belt out for comparison, I had to buy a few based on my memory. It turns out the smallest belt I bought worked very nicely as a replacement.