ioexception's Content - Netduino Forums
   
Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

ioexception's Content

There have been 4 items by ioexception (Search limited from 27-April 23)


By content type

See this member's

Sort by                Order  

#63806 MicroTweet - Twitter API Library

Posted by ioexception on 07 August 2015 - 02:06 AM in Project Showcase

Thanks a lot, I'll be using it soon!




#63410 Using the onboard 3.3v output

Posted by ioexception on 07 July 2015 - 11:28 AM in Netduino Plus 2 (and Netduino Plus 1)

Yeah, that was the problem, I was using the 12th pin, thanks for the heads up.

 

Also thakns for the advice about the resistor, I was already aware of that, tho.

 

:) great support!




#63397 Using the onboard 3.3v output

Posted by ioexception on 06 July 2015 - 04:11 AM in Netduino Plus 2 (and Netduino Plus 1)

Is there any special configuration that I should use to get the onboard 3.3v (or the 5v) output, I'm trying to power some leds but it doesn't work. I'm pretty sure the port works perfect because it outputs power when the board restarts but once my program is loaded the port does not work any more.

 

Thanks in advance.

 




#61033 POST request to Twitter with Netduino Plus 2

Posted by ioexception on 20 December 2014 - 06:25 PM in Netduino Plus 2 (and Netduino Plus 1)

string oauth_nonce = Utility.RandomString(32);
        string oauth_timestamp = Utility.Timestamp.ToString();
        string oauth_signature = null;
        string encodedTweet = HttpUtility.UrlEncode(tweet);
        string signingKey = HttpUtility.UrlEncode(ConsumerSecret) + "&" + HttpUtility.UrlEncode(AccessTokenSecret);
        string requestLine = "POST https://api.twitter.com/1.1/statuses/update.json HTTP/1.1";
        string requestBody = "status=" + encodedTweet;

        string paramsString = "oauth_consumer_key=" + HttpUtility.UrlEncode(ConsumerKey) +
                                "&oauth_nonce=" + HttpUtility.UrlEncode(oauth_nonce) +
                                "&oauth_signature_method=" + HttpUtility.UrlEncode("HMAC-SHA1") +
                                "&oauth_timestamp=" + oauth_timestamp +
                                "&oauth_token=" + HttpUtility.UrlEncode(AccessToken) +
                                "&oauth_version=" + HttpUtility.UrlEncode("1.0") +
                                "&" + requestBody;

        string signatureBase = "POST&" + HttpUtility.UrlEncode("https://api.twitter.com/1.1/statuses/update.json") +
                                "&" + HttpUtility.UrlEncode(paramsString);

        byte[] signatureBytes = Sha.ComputeHMACSHA1(Encoding.UTF8.GetBytes(signingKey),
            Encoding.UTF8.GetBytes(signatureBase));
        oauth_signature = HttpUtility.ConvertToBase64String(signatureBytes);

        byte[] requestBodyBytes = Encoding.UTF8.GetBytes(requestBody);

        string otherHeaders = "Host: api.twitter.com" + CRLF +
                                "Connection: Close" + CRLF +
                                "Accept: */*" + CRLF +
                                "User-Agent: Tuitduino v0.1" + CRLF +
                                "Content-Type: application/x-www-form-urlencoded" + CRLF +
                                "Content-Length: " + requestBodyBytes.Length;

        string authorization = "Authorization: OAuth oauth_consumer_key=\"" + HttpUtility.UrlEncode(ConsumerKey) + "\", " +
                                "oauth_nonce=\"" + HttpUtility.UrlEncode(oauth_nonce) + "\", " +
                                "oauth_signature=\"" + HttpUtility.UrlEncode(oauth_signature) + "\", " +
                                "oauth_signature_method=\"HMAC-SHA1\", " +
                                "oauth_timestamp=\"" + oauth_timestamp + "\", " +
                                "oauth_token=\"" + HttpUtility.UrlEncode(AccessToken) + "\", " +
                                "oauth_version=\"1.0\"";

        string fullRequest = requestLine + CRLF + otherHeaders + CRLF + authorization + CRLF + CRLF + requestBody;
        byte[] requestBytes = Encoding.UTF8.GetBytes(fullRequest);

        using (var socket = Network.Connect())
        {
            socket.Send(requestBytes, requestBytes.Length, 0);
        }

Hi guys, I'm new to netduino and I'm trying to send a POSTrequest to update an status to Twitter API, at this moment I generate the request and send it using raw sockets but it always return 403 Authentication Required, but when I grab the same request and send it vía Fiddler everything goes OK. Can any of you tell me what is wrong? I'm thinking that it might has something to do with indicating the end of the body message.  Here is my code:





home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.