Android WiFi tether Infrastructure Mode

With the addition of a little bit of elbow grease infrastructure mode on the HTC EVO is officially working. Over the coming days I hope to integrate it with android-wifi-tether and release the first and only application for any Android platform to support infrastructure mode tethering that doesn't cost $30 a month. This application serves as literally a step-in replacement for the Sprint Hotspot application with the complete functionality set, minus the cost. Support for WEP and WPA comes standard out of the box, as well as open functionality. Unlike the Sprint application this method will not impose an artificial limit on the number of users to connect to your hotspot. 

Continue reading...

Loading mentions Retweet

Filed under  //  Android   EVO   Wireless Hack  
Comments (2)
Posted 1 month ago

Fixing android-wifi-tether

As I read through the internet my number one complaint when it comes to all the wonderful work done by developers is the lack of documentation of the process taken to get to the end result. While I do love the fruits of their labor I'm so interested in the processes that led them there and what they learned along the way. 

With that in mind, after recently working to help in a small way to fixing the wonderful android-wifi-tether application I'd like to share what I found along the way and the steps I took to get there.

Continue reading...

Loading mentions Retweet

Filed under  //  Android   Developing Howto   Wireless Hack  
Comments (0)
Posted 1 month ago

Connecting the EVO to ADB

The EVO does not use the standard ADB drivers that come with the development kit. This can be a challenge for those of us who do not know where to look. Luckily HTC has included drivers for our devices in their HTC Sync program, installed on the SD card.

The easiest way to get up and running with ADB is to install the free HTC Sync utility that came with your phone. This opens up all kinds of fun possibility, especially when combined with an easy root technique. It will give you shell access to your phone and the ability to debug and test applications.

Continue reading...

Loading mentions Retweet

Filed under  //  Android   Developing Howto   EVO  
Comments (0)
Posted 1 month ago

Getting Started with Android Development

I'll be honest, like many I am primarily a .Net developer. My favorite languages are VB and C# and I breath CIL. The world of Android is a little foreign to me and getting started seems like a challenge, however the more Android develops, the more I start to see similarities with .Net. Both languages have an extensive library of predefined functions to speed up development, both are what I call OO 2.0 languages, embodying and fully embracing object-oriented programming, and, with Froyo, both use just-in-time compilers to run the code.

Fortunately, unlike .Net, one of the requirements to get up and running with a full Android IDE is not a pocket full of bills (or enrollment in a major university's CS program). Android is developed mainly in Eclipse, a development environment that you will form a strong love/hate bond with as your relationship with it grows.

Continue reading...

Loading mentions Retweet

Filed under  //  ADB   Android   Android Getting Started Series   Developing Howto   Eclipse  
Comments (0)
Posted 1 month ago

AT&T Takes a Step Backwards

Today the mobile broadband industry took a step backwards as AT&T proved itself to be even more irrelevant by going back to capped data plans. From what I've gathered they plan to remove their $30 unlimited plan and more to a 2-tier approach to data:
  • Data Plus - 200MB of data for $15 per month. This supposedly will cover ~65% of their customers.
  • Data Pro - 2GB of data for $25 per month. This will accommodate ~98% of their customers
Tethering will be an additional $20 per month on top of their data pro plan. 

AT&T has made these plan changes and masqueraded them as a cost-saving measure for the customer, however corporations never act without a self-interest. Make no mistake, this is a move to bring tighter regulation to their network and this change will ripple through every carrier, with Verizon's CEO already declaring similar intentions last month in a remark about the cellular industry's move away from unlimited plans and towards "buckets of MBs". To me this seems eerily familiar to the early 2000s, where a 20MB data plan was the goto. 

Personally I feel this is a terrible move for the consumer. Their stock has been mostly stable today so the investors aren't saying much but overall this is just a huge step backwards for the industry. The internet does not work as a regulated entity. You absolutely cannot have these sorts of caps in place without completely discouraging innovation and exciting, new development. The message to consumers needs to be to use your smart phone more and more, and not worry about the data, and the message needs to be loud. 

AT&T had the audacity to advertise this move as a step forward in their commitment to mobile services including streaming video. How anyone could make this claim escapes me. 2GB is not, and certainly will not be in the future, enough data for any sort of interactive, streaming content. Listening to an hour of high quality audio, such as that played by Pandora, will easily consume 5% of a 2GB bandwidth cap, watching YouTube will suck it faster, and the applications of tomorrow will eat that cap for breakfast.

To be frank moves like this, towards further regulation and control, stifle future innovation. I, for one, am tired of the cat-and-mouse game I have been playing with service providers for the past 10 years in hidden bandwidth caps and surcharges. It didn't work with dial-up, it didn't work with broadband (although they are still trying!), and it's not going to work with mobile data connections.

I believe that technologies like WiMax and LTE will do for internet access what cellphones did for landlines and free us from wires once again. There is more than enough bandwidth in the air for this to happen, and the sooner these companies stop trying to monetize and exploit a truly fundamental change our communications infrastructure, the sooner it will.

Services like the internet will only strive when data is free, packets are neutral ground, and innovation is allowed to flourish. 

Loading mentions Retweet

Comments (3)
Posted 1 month ago

Grouping by Dates in T-SQL

Extracting useful data from T-SQL on the fly can be challenging. Writing GROUP BY statements can bend your mind and make life difficult. Like any good SQL programmer I've built up a tool chest of SQL queries over the years that serve me well in the field. I've had to sort, aggregate, count, average, and pivot data a countless number of times and reaching for the T-SQL documentation becomes a tedious task. One of my favorite queries, and one of the ones I see beginner SQL programmers struggle with most often, certainly has to be grouping a series of discrete, time-stamped events by days and pulling useful information from it. To this end I present my implementation of the T-SQL group-by day and month query. 

Continue reading...

Loading mentions Retweet

Comments (0)
Posted 1 month ago

AVR Pocket Programmer under Windows 7

Getting this guy to work with Windows 7 x64 is a pain, however it is one of the most economical programmers out there so I feel it was definitely worth the effort. It is based off of the libusb-32 driver package and, like many open-source projects with no cash flow, it has no signed driver support. To fix this involves some pretty nasty hacks, but luckily Microsoft has simplified the process for us with their bcdedit utility for editing Windows boot options. Follow the steps after the break and you'll be off programming AVRs before you know it!

Continue reading...

Loading mentions Retweet

Comment (1)
Posted 2 months ago

Polling a Log Directory

In .Net the defining feature of the libraries is that there is at least 2 different ways you can perform any one task. Each one usually has it’s own subtle uniqueness to it but in the end they all get you from Point A to Point B. The problem is figuring out which approach works best and combining all the different framework elements into a coherent application. In my line of work I write a lot of middlewear. Applications that interfaces with systems made before XML was a blip on the horizon and basically act as glue. One of the most common ways I interact with these applications is by reading their log files and looking for key phrases and elements. I have written more log-watchers than I can count so I’ve finally made the end-all piece of code to watch a log file.

In writing this piece of code you might instantly light up and remember that .Net supports event-driven file watching. There is a very nice IO.FileSystemWatcher class out there that does in fact provide most of the functionality required to implement this design. I used this class for about a week myself. What I came to find is that it is simply riddled with bugs, especially when watching files over the network. The object will simply loose touch with the network folder you are watching. This resulted in a mysterious mandelbug that appears only when mission-critical files need processing. The event-firer will grow eerily quite and nothing will ever be watched again. This is a problem. Upon ripping the FileSystemWatcher from the code and replacing it with a simple thread-based polling piece of code the problem was solved. The application that runs this code is now one of the most stable in the building, with an uptime approaching 2 years and counting.

So without further discussion here is my code for a simple watcher class that will watch either a directory with rolling log files or a single file.

WatcherPhrase.vb

FileWatcherEventArgs.vb

FileWatcher.vb

And how does it all fit together? Here is a very simple example of the classes' usage.

FileWatcherTest.vb

And there you go, one fully functional log watcher with each and every bug worked out. The following code is in use every day with hundreds of log files over many different testing expressions!

Loading mentions Retweet

Comments (0)
Posted 2 months ago

A simple AVR RTC using built-in Timers

In my current project I am implementing a simple data logger. When the hardware was designed we did not implement a nice RTC module, such as the chip used in Sparkfun’s clock module here: http://www.sparkfun.com/commerce/product_info.php?products_id=99. In lieu of such a nice solution I have opted to implement a basic, semi-accurate clock using an 8-bit timer in the AVR. Here’s the steps:

  1. Calculate from the clockspeed the interval and width that timer needs to fire at to record a 1Hz measurement
  2. Enable timer interrupts
  3. Capture the timer interrupt and increment a 4-byte integer

In my case the microcontroller is running off of a 8Mhz crystal. Setting the timer prescaler to clk/256 produces 31,250 clock pulses. Setting OCRA to 250 and counting up to 124 before incrementing the second produces 31,250/250/124 = 1 pulse per second.

For this project I have decided to store the time as the number of seconds elapsed since January 1st, 2001. This is convenient because the host system can handle all the nasty stuff such as leap-years and other oddities in the calendar while the microcontroller just stores a number.

And without further ado I shall present some code!

AVR timer.c

In addition to this AVR code some host-side code is needed to set and read the time from the AVR accurately. For this I have used VB.Net.

Generating appropriate times

Testing has shown this clock to drag a millisecond or two for every minute of operation. Not the greatest performance but for a data logger it is adequate.

Loading mentions Retweet

Comments (0)
Posted 2 months ago

Working with Bits and Bytes in .Net

While .Net is great for developing large, enterprise-level applications I have found it to be lacking basic manipulation abilities. When developing applications that involve low-level microcontrollers I often have struggled to find the correct syntax to do proper bit manipulation. Furthermore debugging byte arrays can get plain frustrating. As you are probably aware, the IDE displays bytes as numeric values (0-255) instead of the standard hexadecimal notation. This is fine and dandy but the majority (>99%) of technical documentation has chosen hexadecimal notation for representation of byte streams in protocols and interfaces. Translating can get tedious for those who do not speak fluent hex, a group of individuals that I currently belong to.

The .Net library is great but I feel it is lacking some easy-to-use tools for bit-manipulation. Using Visual Basic of course doesn't help things. To solve these problems I have created a set of basic bit-manipulating and debugging tools that I include in my base classes in order to output hexadecimal strings of byte arrays and to flip bits as needed. I have found these utilities invaluable when building low-level interface code that talks via USB or serial to devices that don't support the latest XML object serialization techniques for remoting cutting-edge .Net entity framework model do-dads and devices that don't have the luxury to run the full CLI.

Polling the Status of a Bit

Setting a bit

Converting to ASCII Hexadecimal Representation from Bytes

Converting from ASCII Hexadecimal Representation to Bytes

Hopefully you will find these functions as useful as I have over the years!

Loading mentions Retweet

Comments (0)
Posted 2 months ago
? ?