Software Automation

Pervasive, intelligent devices are among us now.
Thursday, March 14, 2013, by Sebastian Dwornik

And it’s time to harness their full potential.

Machine to machine, iPhone + HAL


 

Create a Simple iOS On-Screen Logging Console
Tuesday, March 13, 2012, by Sebastian Dwornik

Sometimes it can be useful to have a simple text console on-screen within your iOS app to output status info and other messages that can help analyze a running app.

Hence the creation of textViewLog:() function.

Simply add the following UItextView control setup.

@property (nonatomic, strong) IBOutlet UITextView *textConsole;
@synthesize textConsole;

Insert a UItextView control within your View and connect its outlet to our property.

UItextview connections


Finally drop in the code below.

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// It's almost like NSLog, but directed to a UITextView control.
//
// usage example:  [self textViewLog:@"%@", myVar];
//
- (void)textViewLog:(NSString *)firstArg, ...
{
    va_list args;

    va_start(args, firstArg);

    NSString *log_msg = [[NSString alloc] initWithFormat:firstArg arguments:args];

    self.textConsole.text = [NSString stringWithFormat:@"%@%@\n", self.textConsole.text, log_msg];

    // Support auto-scroll.
    NSRange range = NSMakeRange(self.textConsole.text.length - 1, 1);
    [self.textConsole scrollRangeToVisible:range];

}


And voila!  You have yourself a quick and simple on-screen logging console.

iPhone 4 with console

You can download the above sample project too.


 

Auto-incrementing Build Numbers in Xcode
Sunday, February 19, 2012, by Sebastian Dwornik

Add run script within XCode
Thanks goes to Fredrik Olsson's article and the helpful commenters that shared their own tweaks to this quick and simple solution.

Simply select the app 'Target' and add the following text to a 'Run Script' within your 'Build Phases' tab.




# Auto Increment Version Script
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PROJECT_DIR}/${INFOPLIST_FILE}")
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/${INFOPLIST_FILE}"


XCode run script insert


After which, whenever you perform a Build operation, the "Build" number will automatically be incremented.


XCode run script results


Optionally, if you have multiple 'Targets' and want to keep their 'Build' numbers in-sync, you can simply just modify the script to update both .plist files during a Build operation.

# Auto Increment Version Script
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PROJECT_DIR}/${INFOPLIST_FILE}")
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/ChooseBot/ChooseBot-Info.plist"
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/ChooseBot/ChooseBotLite-Info.plist"

Make sure you then add 'Run Script' within both of your Target 'Build Phases' tab.


Whether you choose to display this 'Build' number in your app is up to you, but it helps track the app a little better.

 

CLI Control of Wi-Fi in OS X
Tuesday, November 08, 2011, by Sebastian Dwornik

CLI Control of Wi-Fi in OS X



I needed to be able to switch between two Wi-Fi connections in OS X during development of a certain project and it quickly became disruptive to my workflow to always reach for the mouse and use the menu bar.









So I made the following alias commands for use within Terminal on the command line interface.

alias adhoc='networksetup -setairportnetwork en1 <adhoc SSID>'
alias wifi='networksetup -setairportnetwork en1 <my wifi SSID> <WPA2 password>'

Hope this helps others, as it greatly improved my own efficiency.

 

ChooseBot: Your Personal Decision Making Assistant
Saturday, October 01, 2011, by Sebastian Dwornik

ChooseBot on iPhone
A few years ago I wrote about how all future mobile devices will become more intelligent.

That they will eventually “contain a form of general A.I. (artificial intelligence) to aid in basic day to day decision making.  Think of it as your personal automated assistant, but with access to an entire planet’s knowledge base and with real-time information”.

In recognition of my belief in such tools, I present ChooseBot.

While the app is still short of becoming a form of Skynet, it can aid in potentially simplifying certain decisions, as well as predicting others.

Each decision is constrained by the choices you provide it.  Surprisingly though, on average the random outcome is usually no better than a human’s guess.

It’s fun, useful, and can save you time instead of procrastinating over a set of simple choices.

Check it out!

 

LocateMe and TobogganHills.com
Wednesday, November 03, 2010, by Sebastian Dwornik

LocateMe using GeoNoteHere is another ideal use for my LocateMe app.

Recording the location of your favourite toboggan hill the next time you're on it.

Why?

So that you can then add it to the map at TobogganHills.com of course, and share it with everyone.

Simply use the built-in GeoNote feature of LocateMe to make a note of the GPS coordinates for later use when you're adding the hill through the TobogganHills.com web site.

The world will thank you, and so will many sleds, in helping contribute to an awesome winter activity.

Happy tobogganing!    :)

Add Hill on TobogganHills.com

 

PocketCRON is now FREE!
Saturday, May 01, 2010, by Sebastian Dwornik

That's right.  FREE!

Robot gear clockRevitalize that old Windows Mobile device (WM 5.0 and above) and make it work for you as an automated program scheduler.

Use PocketCRON to schedule the running of other apps automatically and empower your Windows Mobile device as your personal robotic assistant.

From controlling Christmas lights to watering your lawn, by reusing your old WM device you renew your investment in it, as well as keep it out of our landfills.

You can download PocketCRON here, and if you end up using it in some cool and innovate way, tell us about it in the forum.

I'm always interested in how creative other people get with my software.

Enjoy!

 

Handlebar Mounted Phone
Monday, July 20, 2009, by Sebastian Dwornik

The whole point of mobility is to be anywhere, and I write my software for people who take their mobile devices outside.

Exploration, adventure, and travel.  These are the things I look forward to, and thus enjoy field testing my own software.

Straight from the appliedpda.com labs, comes the latest on-going experiment of having mounted an HTC Touch Diamond phone to the handlebars of my mountain bike.


Handlebar Mounted Phone 1


It’s not pretty, but very effective.

Model Magic bucket
The secret comes in the form of a brilliant product called Model Magic.  Originally designed for young children to express their creative talents through modeling with it.  The material is safe, clean, cheap, and air-dries within 24 hours to a firm and rubbery substance that holds the shape it was molded in.

It makes for an excellent shock absorber as well as a perfect fit for any device you sculpt it for.  You can even paint it any colour afterwards, but I just left it stock white for simplicity.




LocateMe Goes Rugged


Handlebar Mounted Phone


Having a fancy touch screen device on your bike brings the feeling of owning one of those extravagant new luxury vehicles.

Using the LocateMe app, I was able to transmit my location to people at home regarding where I was on the trail.  The speaker phone was also very clear and useful to call others.  Best of all, the touch screen proved to be a really nice interface that worked well even with gloves on.

While I mostly used it to display GPS location data, in due time, other sensors can be attached to perform logging of environmental conditions, health monitoring, even the physical bike characteristics like g-force measurements of the shock absorbers.

In the future, a simple bike ride in the woods will return with more than just muddy pedals and flat tires.  It will carry experiential data too.



 

PDA Controlled Water Sprinkler
Wednesday, April 01, 2009, by Sebastian Dwornik

Spring is finally here.

This means that the outdoor garden and lawn will soon be vying for my attention.  This time though, with the help of some DIY home automation, I intend to give it the best care I can.

Bluebox internals

You might remember this past winter how I managed to get my PDA controlled Christmas tree lights working.  That same design will now be applied to my water sprinkler.
PDA controlled water sprinkler using PocketCRON and PocketDAQ Pro

There is a difference though.

Christmas tree lights are mainly for decorative reasons.  Watering my lawn and garden carries a more important responsibility, for they are living things and I greatly enjoy the green scenery of a lush outdoor forest, versus a dry desert.  It is, therefore imperative that the watering schedule be more adaptive to the season.

This is where PocketCRON comes in again.  A new feature recently added supports sunrise and sunset timing.  The plan is to have my yard automatically watered every morning at ten (10) minutes before sunrise.


PocketCRON screenshots



The sunrise/sunset feature depends on where you are located on the planet.  Selecting the nearest city to your location informs PocketCRON of this.  After which the task time settings can accurately display the sunrise and sunset times.  It also takes into consideration Daylight Savings Time.

Time will tell, but I expect my lawn and garden to be nothing short of brilliant green and healthy during this summer season.  Which is great for nature, but not so for my push lawn mower.


Here are the sample scripts I use with PocketDAQ Pro, in automation mode, that PocketCRON calls in its tasks.


 

New Software Gives Purpose to Old Hardware
Wednesday, November 26, 2008, by Sebastian Dwornik

With the focus on the environment and a suffering economy these days, the best way to adapt is by becoming more resourceful.  Old PDA hardware, for example that would normally be viewed as obsolete, can gain a resurgence with the right new software.  This is how PocketCRON was born.


PDA Controlled Christmas Tree Lights

I enjoy the glitter and sparkle of holiday lighting that decorates houses, banisters, and trees.  What I do not particularly enjoy is the added maintenance of turning ON and OFF those lights when the house goes to sleep.

So in comes home automation.

A few years ago I purchased an Insteon PowerLinc serial controller with a single LampLinc plug-in module to control my Christmas tree lights.  I also happen to have a spare Dell Axim X50 PDA that wasn't doing anything; until now.

PDA_controlled_Christmas_lights


By using PocketDAQ Pro to communicate over a serial connection with the PowerLinc controller, I was able to transmit the commands to turn the lights ON and OFF.  The development of PocketCRON then enabled me to set the schedule of controlling those lights.


Taskconfig_walkthrough


This is done by configuring tasks with the time and days that will automatically execute PocketDAQ Pro with a script parameter that transmits the appropriate commands to the PowerLinc controller.  It also provides an intuitive GUI for manual control of the lighting as well.

I have always believed that such mobile devices are an excellent form factor for the purpose of being stand-alone controllers.  They are essentially a full computer with a touch screen and built-in UPS.  Their size and power efficiency compared to a full PC - or even a laptop doing the same thing - is unmatched and the price is far less than any industrial version.

The end result adds convenience to controlling my holiday lights and puts to good use an old PDA that was otherwise ignored.  Saving me money for new hardware and opening more possibilities for other home automation projects.

With the lights done I think I'll move on to the sprinkler system .  But that won't be until the summer season comes around.


 

Welcome to my App World

My name is Sebastian Dwornik and I am an entrepreneur located near Toronto, Canada.

Here you will find my thoughts on all matters regarding software, design, business, and sometimes life in general.

Have feedback? Don’t be shy and post your comments within the forum.


CONNECT WITH US

Twitter Facebook
Linkedin Rss

profile for Sebastian Dwornik at Stack Overflow, Q&A for professional and enthusiast programmers

Categories

Archives


Past archives (2013)

Past archives (2012)

Past archives (2011)

Past archives (2010)

Past archives (2009)

Past archives (2008)

 
 
Copyright © 2007 - 2017 Applied PDA Software, Inc. Fresh Lime Studio
All products mentioned on this web site are owned and copyrighted by their respective companies.