I’ve written an app that needs to connect to a WiFi router and broadcasts UDP packets. I was finding that after a tombstone and resume, the packets were no longer seen on the network using Wireshark. No errors were returned, the app was getting Success for the send and connect but it clearly wasn’t working.
It turns out that when the app resumed and the socket was reconnected, instead of defaulting to Wifi, it defaulted to MobileBroadbandGsm so it was sending the packets successfully but on the wrong network interface.
The solution turned out to be calling:
Thanks to Pat Long for his assistance.
Using a Nokia Lumia or one of the other windows phones you can now control your lights and other appliances (UK only I think).
The system is using LightwaveRF – no PC required!
Step 1: Buy one of these LightwaveRF Wifi things and plug it into your Wifi router
Step 2: Swap your existing light switch for one of these (variety of colours available):
Step 3: Get the unofficial Home Remote RF app from the market place
I thought pairing the devices was pretty easy (much easier than X10 if you’ve used that and more reliable). LightwaveRF also has the advantage of remembering dim levels.
Read an in-depth review at: http://www.automatedhome.co.uk/Reviews/LightwaveRF-Home-Automation-System-In-Depth-Review.html
Although the app featured in the review is for the official iPhone app not the unofficial WP7 one.
This was due to having Order on some but not all DataMembers of the data contract (might have been more helpful if the error had actually contained values for the format parameters).
Since I find myself using a common bag of goodies for WP7 development I thought I’d start listing them here.
AgFX* (although using in conjunction with MVVM light you may find grating since concept of view model and model is a bit blurred although still blendable using the Sample Data approach).
Windows Phone Toolkit
Jump List Control
(although you should follow the suggestion in one of the follow up posts if you get an “unspecified error” because it doesn’t look as though Colin has updated the code).
* Also available on NuGET
Other stuff I want to look at but haven’t had a chance yet
WP7 Contrib – Caching, Messaging, Communciations, Services, Diagnostics and a bringing together of some good public WP7 controls.
WP7 framework for managing web-service calls including caching, queuing, priority, login handling, progress showing and blend-ability.
So I’ve joined the party of this framework late but it looks awesome. In my previous WP7 app I spent a lot of time creating queues of web requests, ensuring I could cancel pending requests if navigating away from pages but I didn’t have time to put the excellent features that AgFx appears to support.
The only issue I’ve got at the moment it doesn’t appear to pass back or accept the HTTP headers, just the response stream. Also you have to kind of forget MVVM light a bit since although there’s the separation of view and model, there isn’t much of a separation between viewmodel and model.
This is apparently a known issue in WP7 Mango beta 2 & RC and can make debugging that bit more interesting.
One tip is to look at the Call Stack and ensure that “Show Parameter Values” is ticked (off by default):
Also see this post for some more discussion. It suggests this happens when you are checking for all thrown exceptions (Debug –> Exceptions…).
This turned out to be user error, I had upgraded my ViewModel and View project to Mango but not the Model project which was referencing an old version of MVVMLight.