OUYA Console Finally On Its Way

Coming At Last

It’s been a long time coming but now eventually my OUYA console is being dispatched. Honestly, I had forgotten about it and I am glad to finally be receiving it

In anticipation I checked out a few blog posts about the OUYA.

Engadget’s (Backer Edition) Review and The Verge’s Review highlight that this should be considered a BETA console and not for the everyday user. They were also decidedly negative about the ergonomics of the controller, suggesting it is not well assembled giving it a “cheap, breakable feel”. Not the best reviews by any stretch of the imagination.

TechCrunch Gave a more objective review, rebranding the OUYA as a ‘micro-console’ instead of an Android Game Console, to avoid the obvious comparisons with both Android based phones and the main players in the console market. They suggested the console should be considered like a netbook would be versus a laptop (you wouldn’t be able to run power hungry applications like Photoshop on the netbook, thus shouldn’t expect it when reviewing its performance).

I eagerly anticipate its arrival and will make sure to put together a thorough unboxing and first impressions post.

 

Desktop PC DIY Wake-On-LAN using Microcontroller

With the birth of my daughter I have had to relinquish my upstairs office to be used as a nursery. The desktop computer is now downstairs in a corner of the living room. It has a lockable front door (great when the baby is crawling around) but the button is inaccessible without unlocking the door.

At first I though I could create (or use) a Wake-On-LAN program but for some reason my motherboard’s Wake-On-LAN isn’t working. So I have decided to use a low power microcontroller in a nice housing to remotely switch on the main PC. Additionally I have been meaning to create a clean and tidy microcontroller setup to use with my desktop PC, which doesn’t look like a spagetti of wires or a messy breadboard.

This is the box I have bought in black ABS

Box

I also wanted some nice push buttons to surface mount on the box, so I picked some which are normally used in anti-vandal situations (like cash machines)

Microcontroller will be a Netduino Plus with a 16×2 character red on black LCD.

I am also planning on using it as a node in my future home thermal management system so will make sure it is compatible with my sensor of choice, the RHT03.

 

The Meaning of GLOMP

Using PushOver with .net

Dim Parameters = New NameValueCollection() From {
            {"token", "xxxxxxxEnterAPIKeyHerexxxxxxx"},
            {"user", "xxxxxxxEnterUserKeyHerexxxxxxx"},
            {"message", "A Test to see if PushOver is working"},
            {"url", "http://www.google.com"},
            {"url_title", "Google"},
            {"title", "Search for something"}}
 
Dim client as New WebClient()
client.UploadValues("https://api.pushover.net/1/messages.json", Parameters)

Retrieving Saved Data From COSM/Pachube in php

Use Pachube PHP Library

require_once('pachube_functions.php');
$api_key = "xxxxxxxEnterAPIKeyHerexxxxxxx";
$pachube = new Pachube($api_key);
$feed = xxxxx;
$data = $pachube->retrieveData ( $feed, "csv" );
$array = explode(',', $data, 6);
// Datastream 1
echo $array[0];
// Datastream 2
echo $array[1];
// Datastream 3
echo $array[2];
// Datastream 4
echo $array[3];
// Datastream 5
echo $array[4];
// Datastream 6
echo $array[5];

Saving Data To COSM/Pachube in .net

Dim data As String = ""
 
data += "Sensor1" & "," & ValueForSensor1 & vbNewLine
data += "Sensor2" & "," & ValueForSensor2 & vbNewLine
 
Dim dataBytes As Byte() = Encoding.ASCII.GetBytes(data)
Dim webClient As New WebClient()
webClient.Headers.Add("X-PachubeApiKey", "xxxxxxxEnterAPIKeyHerexxxxxxx")
webClient.UploadData("https://api.cosm.com/v2/feeds/xxxxx.csv", "PUT", dataBytes)

Accessing a PicoTech TC-08 Data Logger in .net

Inherited a PicoTech TC-08 data logger.

To access the data without using the package software, use usbtc08.dll and declare the methods directly:

Declare Function usb_tc08_set_channel Lib "C:\usbtc08.dll" (ByVal handle As Integer, ByVal channel As Integer, ByVal tc_type As Byte) As Integer
 
Declare Function usb_tc08_get_single Lib "C:\usbtc08.dll" (ByVal handle As Integer, ByRef temp As Single, ByRef overflow_flags As Boolean, ByVal units As Integer) As Long
 
Declare Function usb_tc08_open_unit Lib "C:\usbtc08.dll" () As Integer
 
Declare Function usb_tc08_close_unit Lib "C:\usbtc08.dll" (ByVal handle As Integer) As Integer
 
Declare Function usb_tc08_stop Lib "C:\usbtc08.dll" (ByVal handle As Integer) As Integer
 
Declare Function usb_tc08_set_mains Lib "C:\usbtc08.dll" (ByVal handle As Integer, ByVal sixty_hertz As Integer) As Integer
 
Declare Function usb_tc08_get_last_error Lib "C:\usbtc08.dll" (ByVal handle As Integer) As Integer

Then use it like so:

Dim tc08_handle As Integer
 
Private Function GetTemperatures() as List(Of Single)
        Dim ok As Boolean
        If (tc08_handle < 1) Then
            tc08_handle = usb_tc08_open_unit()             
            If (tc08_handle > 0) Then
                Call usb_tc08_set_mains(tc08_handle, True)
                ok = usb_tc08_set_channel(tc08_handle, 0, Asc("K"))
                ok = usb_tc08_set_channel(tc08_handle, 1, Asc("K"))
                ok = usb_tc08_set_channel(tc08_handle, 2, Asc("K"))
                ok = usb_tc08_set_channel(tc08_handle, 3, Asc("K"))
                ok = usb_tc08_set_channel(tc08_handle, 4, Asc("K"))
                ok = usb_tc08_set_channel(tc08_handle, 5, Asc("K"))
                ok = usb_tc08_set_channel(tc08_handle, 6, Asc("K"))
                ok = usb_tc08_set_channel(tc08_handle, 7, Asc("K"))
                ok = usb_tc08_set_channel(tc08_handle, 8, Asc("K"))
            End If
        End If
 
        Dim temp_buffer(9) As Single
        Dim overflow_flag As Integer
        Dim Results as New List(Of Single)
        If (tc08_handle > 0) Then
            ok = usb_tc08_get_single(tc08_handle, temp_buffer(0), overflow_flag, 0)
            If (ok) Then
                    Results.Add(temp_buffer(1))
                    Results.Add(temp_buffer(2))
                    Results.Add(temp_buffer(3))
                    Results.Add(temp_buffer(4))
                    Results.Add(temp_buffer(5))
                    Results.Add(temp_buffer(6))
                    Results.Add(temp_buffer(7))
                    Results.Add(temp_buffer(8))
                End If
            End If
        End If
 
        Return Results
End Function

Controlling a 12x ShiftBrite Array with mbed

Last night I managed to get my mbed driving a shiftbrite array with some test patterns.

Next step is to improve the PC to mbed interface so that colours can be directly driven to the array at required locations rather than just starting test patterns hard coded on the mbed.

 

First Test of Silverlight in WordPress

I have recently been learning Silverlight for some work projects and decided to try and integrate .XAP files directly into WordPress blog posts using Silverlight for WordPress by Tim Heuer (of timheuer.com fame :-))

Simple enough install but had then ran into the issue with Silverlight cross domain web service calls. If the web service you are trying to call from Silverlight doesn’t have the crossdomain.xml file (Google it for specifics) at the web host root asynchronous Silverlight methods fail upon completion. As I wanted to call a weather API this was an issue. Instead I loaded the crossdomain.xml file onto my own web host and created a quick and dirty PHP page to parse the Secret Google weather web service. This was then called by the Silverlight .XAP as can be seen below (it tells you what the current temperature is in my home town of Cambridge, UK). Easy :-).

Public Sub New()
     InitializeComponent()
     Dim wc As New WebClient()
     Dim baseURI As String = "http://www.muacksandglomps.com/Weather.php"
     AddHandler wc.DownloadStringCompleted, AddressOf completed
     wc.DownloadStringAsync(New Uri(baseURI))
End Sub
 
Private Sub completed(sender As Object, e As DownloadStringCompletedEventArgs)
     WeatherTextBlock.Text = "It is " & e.Result & "°C in Cambridge"
End Sub

Next up something more complicated……

 

 

Edit: Just noticed that the Silverlight for WordPress plugin by Tim Heuer only works if the posts are viewed on the front page not as a stand alone post. Changed the plugin to the Simply Silverlight plugin by DigitalWindFire. Everything now works again and it even has more fetures.