Skip to main content


Showing posts from February, 2014

WiFi Characteristics of mobile phones in screen lock mode

I have a Nexus 5 and I was wondering what power strategies/algorithms are used in it to save power when the screen is locked and the display is off. I wanted to have a practical first hand experience of seeing this happening. So I pinged the phone from my computer while it was connected to my WiFi network. I did performed the process twice - once while the phone was active and I was switching between/using apps on it, and the second time when the screen was locked and the display was off. I sent out 100 ping packets and here are the results: Ping during locked screen with display off Ping when the phone was active Summary: When screen was locked and display was off Minimum = 8ms, Maximum = 866ms, Average = 295ms Sporadic replies to ping, although no no packet was lost. Maybe the WiFi receiver was always on but the transmitter was only turned on periodically. A very large variance in the round trip times. When the phone was active Minimum = 3ms, Maximum = 387

Generic Netlink sockets - example code

If you want to use netlink as a userspace-kernelspace interface for your own non-networking custom use, make sure to go the Generic Netlink path - get a family id assigned and then used that to exchange messages between your userspace and kernelspace. That said, its better to just use  Netlink Protocol Library Suite (libnl) . If for some extremely compelling reason you can't, use libnl, here is some sample code to get you started. Its based on Ariane Kellar's code from here . I have simplified and commented the userspace side code a lot. The kernel space code is mostly unchanged. The kernel side code required a minor change in genlmsg_unicast() call to ensure compatibility with the newer kernel versions. nl_kern.c : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64

IoT Weather Station using TP-LINK TL-MR3020

What does it do? Uploads Temperature, Humidity, Light and Pressure readings to Xively every minute What is it made of? TPLINK TL-MR3020 router reflashed with OpenWRT USB Hub 4GB USB Flash Drive Sparkfun USB Weather Board  (now discontinued, but can be replaced with a pair of  Weather Shiel d  +  Arduino UNO R3 ) A lunch box and some Blu-tack to weather proof the USB Weather Board You will need a separate home WiFi router with internet connection. The MR3020 will connect to it as a client. What does it look like? The USB Weather Board is installed outside in the balcony. There are slots cut out in the box for exposing the sensors to the atmosphere. The TL-MR3020 Pocket WiFi Router is mounted inside. The power is drawn from the AC mains outlet meant for Air Conditioning. Where are the reading being uploaded online? Visit to have a look. This is what the page looks like: How much did it cost? Can the cost be red