0

I have been using mono and the excellent Twitterizer libraries to post tweets from my Raspberry Pi. The goal being to tweet pictures captured by a webcam periodically.

The problem I have is that when I make a call to "UpdateWithMedia" on mono it just hangs - seemingly forever. Works fine on Windows.

I've created the following unit tests to demonstrate. Both pass on Windows. On Mono/linux "SimpleTwitterPost" passes but "ImagePost" hangs just after writing the filename to the console.

[Test]
public void SimpleTwitterPost()
{
    var response = TwitterStatus.Update(tokens, "Here's an automated tweet from my new Raspberry Pi Brain");
    Console.WriteLine(response.ErrorMessage);
    Assert.That(response.Result, Is.EqualTo(RequestResult.Success));
}

[Test]
public void ImagePost()
{
    string filename = "Pics" + Path.DirectorySeparatorChar + "DukeInABush.jpg";

    Assert.That(File.Exists(filename));
    Console.WriteLine("File to open: {0}", filename);

    var response = TwitterStatus.UpdateWithMedia(tokens, "Me in a bush", filename);

    Console.WriteLine("Did it!");
    Assert.That(response.Result, Is.EqualTo(RequestResult.Success));
}

I have tried the overload of "UpdateWithMedia" which takes a byte array but no luck. I can read the file into the byte array fine but the call to "UpdateWithMedia" hangs as before.

For ref, using mono/.NET 4.0 on Archlinux on raspberry pi (arm).

Anyone got any experience with Twitterizer on this platform?

4

0 回答 0