developer maker musician

Wednesday, July 27, 2016

Fiddler Extension Development Tips

I recently created a custom Fiddler extension called PowerBIFiddler. Here are a few tricks that I learned along the way.

Re-use Default Fiddler Inspectors

For PowerBI-Fiddler, I wanted to re-use the JSONResponseViewer that Fiddler uses for their “JSON” inspector.  I used JustDecompile to decompile Fiddler.exe and discovered that the default inspectors are located in this DLL: C:\Program Files (x86)\Fiddler2\Inspectors\Standard.dll.  The JSONResponseViewer is sealed, so you have to use a composition pattern instead of inheritance.  You can see an example here: https://github.com/jonbgallant/PowerBIFiddler/blob/master/PowerBIFiddler/TileDataViewer.cs

image

Inspector loading

Fiddler searches %userprofile%\Documents\Fiddler2\Inspectors and C:\Program Files (x86)\Fiddler2\Inspectors for Inspectors when it launches.  You’ll want to copy your custom Inspectors into either of those folders.  I setup the following Post-build event to automatically copy the DLL over after each build.

mkdir "%userprofile%\My Documents\Fiddler2\Inspectors\"
copy "$(TargetPath)" "%userprofile%\My Documents\Fiddler2\Inspectors\$(TargetFilename)"
copy "Newtonsoft.Json.dll" "%userprofile%\My Documents\Fiddler2\Inspectors\"

image

Debugging

To get F5 debugging, you’ll want to set your Start Action to Fiddler.exe, like this:

image


Learn by Decompiling Existing Extensions

You’ll find a bunch of good examples here: http://www.telerik.com/fiddler/add-ons. You can install them and then use JustDecompile to see how they were built.


Helpful Links


Jon

Saturday, July 9, 2016

How to Install Previous Versions of the Azure Service Fabric SDK

I rebuilt my dev machine recently and reinstalled the Service Fabric 2.1 SDKs from here: https://azure.microsoft.com/en-us/documentation/articles/service-fabric-get-started/

The rest of the devs on my team were still on 2.0 and we weren’t ready to upgrade to 2.1.  There’s no obvious way to install 2.0.  The only way I could find was through the Web Platform Installer.

So if you need to install a previous version of the Service Fabric SDK

1. Download Web Platform Installer https://www.microsoft.com/web/downloads/platform.aspx

2. Search for “service fabric”

image

3. Install your desired version.


Jon

Friday, July 8, 2016

How to use Visual Micro (Arduino VS Extension) as your Adafruit HUZZAH ESP8266 IDE

I’ve been using the Adafruit Feather HUZZAH ESP8266 board and Visual Micro quite a bit lately.  The Huzzah is a board that includes the ESP8266 WiFi module and a LiPo battery jack – making it really easy to build stand-alone IoT devices.  Visual Micro is a VS extension that allows you to code Arduino projects like any other VS project, including debugging.


Here’s the HUZZAH:

image

Here’s how I configure Visual Micro to code against it:

1. Install VS 2015 – I have enterprise, but community should work.

2. Install Arduino IDE

3. Install Visual Micro

4. Open VS

5. Configure Visual Micro

You should see the “Configure Ide Locations” dialog popup when you open VS. If you don’t, you can open it by clicking on Configure from the Visual Micro Explorer:

imageimage

image

a) Select Arduino 1.6.

b) Enter the path to Arduino.exe, typically c:\program files (x86)\arduino

c) Enter “http://arduino.esp8266.com/stable/package_esp8266com_index.json” into the board manager text box.

6. Click Visual Micro Explorer –> Rescan

image

You should now see esp8266 in the “Board Package Installer –> All” tree.

image

7. Click on esp8266 –> 2.3.0 and click OK.

image

8. Click on “Adafruit” under “Board Package Auto-Discovery”

image


The “Adafruit HUZZAH ESP8266” options should now be available in the Visual Micro board dropdown menu.

image

9. Plug your board into a USB port.

10. Select the board and the appropriate COM port. Mine is on COM3.

image


11. Create a new Visual Micro Project called Huzzah blink.

image

12. Copy and paste this code into the HuzzahBlink.ino file

13. Click the “Build and Upload” button

image


You should now see the onboard LED blinking.


Jon



Sunday, June 12, 2016

How to Monitor Azure IoT Hub Traffic

You have a couple different options to monitor your incoming and outgoing Azure IoT Hub traffic.

Desktop App

On Windows machines, you can use the Azure IoT Hub Device Explorer utility. Under the Data tab, select your device, click Monitor and you’ll start to see messages in the Event Hub Data

image

Node

You can also use the iothub-explorer npm package.

npm install -g iothub-explorer@latest

and then

iothub-explorer hubconnectionstring monitor-events deviceid


image


Jon

Thursday, June 9, 2016

Fix for Azure Stream Analytics–Duplicate property names are not allowed

If you see the error “Duplicate property names are not allowed ‘avg’ in your Stream Analytics query it is likely because you aren’t setting up an alias for that property.

Here’s what you may see:

imageimage

Here’s how to fix it:  Just as an alias for each.

image


Jon