IRC Client


i trying port irc idler http://www.codejobs.biz/en/codes/985/arduino-irc-idler#sthash.waqax99k.dpbs newer arduino software.
at moment still have 1 problem compiling.
i using arduino 1.5.5 software , arduino uno ethernet shield.
as far can see problem in lines:

string data;
data = client.read();

but have no idea how should change part solve problem.
can please me.

code: [select]

/*
  telnet client

this sketch connects a telnet server (http://www.google.com)
using arduino wiznet ethernet shield.  you'll need telnet server
to test with.
processing's chatserver example (part of network library) works well,
running on port 10002. can found part of examples
in processing application, available at
http://processing.org/

circuit:
* ethernet shield attached pins 10, 11, 12, 13

created 14 sep 2010
modified 9 apr 2012
by tom igoe

*/

#include <spi.h>
#include <ethernet.h>

// enter mac address , ip address controller below.
// ip address dependent on local network:
byte mac[] = {
  0xde, 0xad, 0xbe, 0xef, 0xfe, 0xed
};
ipaddress ip(192, 168, 1, 177);

// enter ip address of server you're connecting to:
ipaddress server(192, 168, 1, 1);

// initialize ethernet client library
// ip address , port of server
// want connect (port 23 default telnet;
// if you're using processing's chatserver, use  port 10002):


string chan = "#arduino";
string nick = "ardubot";
string join = "join ";
string nickcmd = "nick ";
string user = "user ";
string pong = "pong ";
//string data ;
// see more at: http://www.codejobs.biz/en/codes/985/arduino-irc-idler#sthash.awsgvniq.iiugc0ud.dpuf
ethernetclient client(6667);

void setup() {
  // start ethernet connection:
  ethernet.begin(mac, ip);
  // open serial communications , wait port open:
  serial.begin(9600);
  while (!serial) {
    ; // wait serial port connect. needed leonardo only
  }


  // give ethernet shield second initialize:
  delay(1000);
  serial.println("connecting...");

  // if connection, report via serial:
  if (client.connect(server, 10002)) {
    client.println(nickcmd.concat(nick));
    client.println(user.concat(nick));
    client.println();

   
    serial.println("connected");
  }
  else {
    // if didn't connection server:
    serial.println("connection failed");
  }
}

    void loop()
    {
    if (client.available()) {
    client.println(join.concat(chan));
    while(true)
    {
    string data;
    data = client.read();
    if(data.startswith("ping"))
    {
    client.println(pong.concat(data.substring(5)));
    }
    }
    }
   
    if (!client.connected()) {
    serial.println();
    serial.println("disconnecting.");
    client.stop();
    for(;;)
    ;
    }
    }


error message:

code: [select]

arduino: 1.5.5 (linux), board: "arduino uno"

using library spi in folder: /home/kripke/arduino/hardware/arduino/avr/libraries/spi (pre-1.5)
using library ethernet in folder: /home/kripke/arduino/libraries/ethernet

/home/kripke/arduino/hardware/tools/avr/bin/avr-g++ -c -g -os -w -fno-exceptions -ffunction-sections -fdata-sections -mmd -mmcu=atmega328p -df_cpu=16000000l -darduino=155 -darduino_avr_uno -darduino_arch_avr -i/home/kripke/arduino/hardware/arduino/avr/cores/arduino -i/home/kripke/arduino/hardware/arduino/avr/variants/standard -i/home/kripke/arduino/hardware/arduino/avr/libraries/spi -i/home/kripke/arduino/libraries/ethernet/src -i/home/kripke/arduino/libraries/ethernet/arch/avr /tmp/build8357157353389604704.tmp/sketch_feb13a.cpp -o /tmp/build8357157353389604704.tmp/sketch_feb13a.cpp.o
sketch_feb13a.ino: in function 'void loop()':
sketch_feb13a.ino:86: error: ambiguous overload 'operator=' in 'data = client.ethernetclient::read()'
/home/kripke/arduino/hardware/arduino/avr/cores/arduino/wstring.h:86: note: candidates are: string& string::operator=(const string&) <near match>
/home/kripke/arduino/hardware/arduino/avr/cores/arduino/wstring.h:87: note:                 string& string::operator=(const char*) <near match>
/home/kripke/arduino/hardware/arduino/avr/cores/arduino/wstring.h:88: note:                 string& string::operator=(const __flashstringhelper*) <near match>

1.5.5 beta intended non-uno.  why aren't using 1.0.5?

bugs can reported here:
http://github.com/arduino/arduino/issues


Arduino Forum > Using Arduino > Programming Questions > IRC Client


arduino

Comments

Popular posts from this blog

VIDIOC_S_FMT error 16, Device or resource busy - Raspberry Pi Forums

using a laptop skeleton to build a pi laptop - Raspberry Pi Forums

Forum for Joomla? - Joomla! Forum - community, help and support