Problem using SimpleTweeter.

Discussions related to the WiServer add-on code for WiShield. WiServer is a friendly, easy-to-use front end for webserver and webclient usages.

Moderator: shard7

Problem using SimpleTweeter.

Postby cwjcwjcwj » Sun Jun 06, 2010 5:53 am

I just received my WiShield with external antenna and trying to go thru the SimpleTweeter provided by Asynclabs. I have changed the IP address, SSID, Security Type, WPA Password and twitter username and password. The first attempt was successful with the below message:
Arduino has been running for 00:00:10

However, when I tried it again next day. Nothing happened on my Twitter. Anyone can help or encountered the same problem?

By the way, anyone know how to check if my wishield connected to twitter?
cwjcwjcwj
 
Posts: 2
Joined: Sun Jun 06, 2010 5:42 am

Re: Problem using SimpleTweeter.

Postby shard7 » Sun Jun 06, 2010 7:42 pm

Twitter blocks duplicate messages, so the next message has to be different in order to show up.
shard7
 
Posts: 64
Joined: Wed May 06, 2009 11:30 am

Re: Problem using SimpleTweeter.

Postby cwjcwjcwj » Mon Jun 07, 2010 2:50 am

It doesn't work either. Below is my code:

Code: Select all
/*
* A simple sketch that uses WiServer to send a tweet with the current system time every 5 minutes
*/

#include <WiServer.h>

#define WIRELESS_MODE_INFRA   1
#define WIRELESS_MODE_ADHOC   2

// Wireless configuration parameters ----------------------------------------
unsigned char local_ip[] = {1XX,XXX,XX,135};   // IP address of WiShield
unsigned char gateway_ip[] = {192,168,1,1};   // router or gateway IP address
unsigned char subnet_mask[] = {255,255,255,0};   // subnet mask for the local network
const prog_char ssid[] PROGMEM = {"ABC600165"};      // max 32 bytes

unsigned char security_type = 2;   // 0 - open; 1 - WEP; 2 - WPA; 3 - WPA2

// WPA/WPA2 passphrase
const prog_char security_passphrase[] PROGMEM = {"XXXXXXX"};   // max 64 characters

// WEP 128-bit keys
// sample HEX keys
prog_uchar wep_keys[] PROGMEM = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d,   // Key 0
              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // Key 1
              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   // Key 2
              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00   // Key 3
            };

// setup the wireless mode
// infrastructure - connect to AP
// adhoc - connect to another WiFi device
unsigned char wireless_mode = WIRELESS_MODE_INFRA;

unsigned char ssid_len;
unsigned char security_passphrase_len;
// End of wireless configuration parameters ----------------------------------------


// Auth string for the Twitter account
char* auth = "XXXXXXXXXXXXX"; // Base64 encoded USERNAME:PASSWORD


// This function generates a message with the current system time
void currentTime() {
   WiServer.print("It is over here for some periods like.. ");
   WiServer.printTime(millis());
}

// A request that sends a Tweet using the currentTime function
TWEETrequest sentMyTweet(auth, currentTime);


void setup() {
    // Initialize WiServer (we'll pass NULL for the page serving function since we don't need to serve web pages)
  WiServer.init(NULL);
 
  // Enable Serial output and ask WiServer to generate log messages (optional)
  Serial.begin(57600);
  WiServer.enableVerboseMode(true);
}


// Time (in millis) when the next tweet should be sent
long tweetTime = 0;

void loop(){

  // Check if it's time to sent a tweet
  if (millis() >= tweetTime) {
    sentMyTweet.submit();   
    // Send next tweet 5 minutes from now
    tweetTime += 1000 * 60 * 5;
  }
 
  // Run WiServer
  WiServer.server_task();

  delay(10);
}



Anyone can help please? Thank you very much.
cwjcwjcwj
 
Posts: 2
Joined: Sun Jun 06, 2010 5:42 am

Re: Problem using SimpleTweeter.

Postby GregEigsti » Mon Jun 07, 2010 11:18 am

Maybe twitter does not like posts that are only 5 minutes apart? If I am remembering correctly twitter recently put caps on how many times per day (and how often?) an "external" app can post to their service. Not sure as I don't use twitter myself but maybe something in their online documentation can prove/disprove?

Greg
Check out the wiki!
uIP Stack Docs
Compatible Access Point List
WiShield user contrib branch - DNS, DHCP, AP Scanning, bug fixes, etc.
SlackLab.org - My geek projects blog.
User avatar
GregEigsti
 
Posts: 1067
Joined: Sun Aug 02, 2009 5:23 pm
Location: Sammamish WA USA (near Seattle)
  • Website


Return to WiServer

Who is online

Users browsing this forum: No registered users and 1 guest