Problem with sample sketch and Twitter library
i trying sample sketch work, comes twitter library markku rossi (for see: https://github.com/markkurossi/arduino/tree/master/libraries/twitter), encountering following error:
no matching function call 'twitter::set_twitter_endpoint(const char*, const char*, ipaddress&, uint16_t&, bool)'
i have been searching around leads might me understand causes error , how can solved, out of ideas.
for sketch trying run, see below. ideas me going warmly welcomed.
no matching function call 'twitter::set_twitter_endpoint(const char*, const char*, ipaddress&, uint16_t&, bool)'
i have been searching around leads might me understand causes error , how can solved, out of ideas.
for sketch trying run, see below. ideas me going warmly welcomed.
code: [select]
/* -*- c++ -*-
*
* twitter.pde
*
* author: markku rossi <mtr@iki.fi>
*
* copyright (c) 2011-2012 markku rossi
*
* program free software: can redistribute and/or
* modify under terms of gnu general public license as
* published free software foundation, either version 3 of the
* license, or (at option) later version.
*
* program distributed in hope useful,
* without warranty; without implied warranty of
* merchantability or fitness particular purpose. see gnu
* general public license more details.
*
* should have received copy of gnu general public license
* along program. if not, see
* <http://www.gnu.org/licenses/>.
*
*/
#include <spi.h>
#include <ethernet.h>
#include <onewire.h>
#include <dallastemperature.h>
#include <sha1.h>
#include <time.h>
#include <eeprom.h>
#include <twitter.h>
/* onewire bus pin. */
const int buspin = 2;
onewire bus(buspin);
dallastemperature sensors(&bus);
deviceaddress sensor1;
deviceaddress sensor2;
byte mac[] =
{
0x99, 0x99, 0x99, 0x99, 0x99, 0x99 // dummy mac-adres arduino
};
ipaddress timeserver(999, 999, 999, 9); // dummy ip-address of fritz!box acting ntp-server
ipaddress ip(999, 999, 999, 99); // ip-adres of arduino
/* ip address connect to: twitter or local http proxy. */
ipaddress twitter_ip(199, 59, 149, 232);
uint16_t twitter_port = 80;
unsigned long last_tweet = 0;
#define tweet_delta (60l * 60l)
/* work buffer twitter client. should fine normal
operations, biggest items stored working
buffer url encoded consumer , token secrets , http response
header lines. */
char buffer[512];
const static char consumer_key[] progmem = "xxx"; // dummy consumer key
const static char consumer_secret[] progmem = "xxx"; // dummy consumer secret key
twitter twitter(buffer, sizeof(buffer));
void
setup()
{
serial.begin(9600);
serial.println("arduino twitter demo");
sensors.begin();
if (!sensors.getaddress(sensor1, 0))
{
serial.println("ds18b20 number 1 not found!");
}
if (!sensors.getaddress(sensor2, 1))
{
serial.println("ds18b20 number 2 not found!");
}
ethernet.begin(mac, ip);
twitter.set_twitter_endpoint(pstr("api.twitter.com"),
pstr("/1/statuses/update.json"),
twitter_ip, twitter_port, false);
twitter.set_client_id(consumer_key, consumer_secret);
#if 1
/* read oauth account identification eeprom. */
twitter.set_account_id(256, 384);
#else
/* set oauth account identification program memory. */
twitter.set_account_id(pstr("xxx"), // dummy key value
pstr("xxx")); // dummy key value
#endif
delay(500);
}
void
loop()
{
if (twitter.is_ready())
{
unsigned long = twitter.get_time();
if (last_tweet == 0)
{
/* first round after twitter initialization. */
serial.print("time ");
serial.println(now);
/* wait few seconds before making our first tweet. this
gives our sensors time running (i hope). */
last_tweet = - tweet_delta + 15l;
}
sensors.requesttemperatures();
float temp = sensors.gettempcbyindex(0);
serial.println(temp);
if (temp != device_disconnected && > last_tweet + tweet_delta)
{
char msg[32];
long val = temp * 100l;
sprintf(msg, "office temperature %ld.%02ld\302\260c",
val / 100l, val % 100l);
serial.print("posting twitter: ");
serial.println(msg);
last_tweet = now;
if (twitter.post_status(msg))
serial.println("status updated");
else
serial.println("update failed");
}
}
delay(5000);
}
is error message? when try compile code have download ton of libraries , make lot of changes them work latest version of arduino. the sha1 library, example, 6 years old!
Arduino Forum > Using Arduino > Programming Questions > Problem with sample sketch and Twitter library
arduino
Comments
Post a Comment