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?

  • Does it really passed on Windows? Because I can't find the method `UpdateWithMedia` in the [documentation](http://www.twitterizer.net/documentation/html/T_Twitterizer_TwitterStatus.htm). Or I just misunderstood the Twitterizer version? – fankt Aug 28 '12 at 08:29
  • It does really pass on Windows - and posts the tweet as expected. I am using the latest version of Twitterizer, installed using nuget. – LogicalGenetics Aug 28 '12 at 10:06
  • Ok, I found the method in [code](https://github.com/Twitterizer/Twitterizer/blob/master/Twitterizer2/Methods/Tweets/UpdateWithmediaCommand.cs). And I also notice the README said `Depending on your target application, you may want (or need) to remove the silverlight projects from the solution.` Maybe relate to the problem. – fankt Aug 28 '12 at 10:56
  • Thanks for the link to the code. I can't see anywhere in that snippet that would obviously cause it to hang. In fact it looks very simple! I think the comment in the readme about silverlight is a red herring - it builds and runs fine and I'm assuming that's got something to do with building the solution...? – LogicalGenetics Aug 28 '12 at 19:43

0 Answers0