Ethernet

Hi,

I hope there is somebody that can help me out there... I have a Sakura board and I'm trying to get the Ethernet to work but so far no luck.

The online compiler says there is an error with the code, but I cannot see what the problem is:

/*GR-SAKURA Sketch Template Version: V1.08*/
#include <rxduino.h>
#include <Ethernet.h>
byte mac[{0xDE0xAD0xBE0xEF0xFE0xED };
byte ip[{192,168,1,177};
void setup()
{
    Ethernet.begin(macip);

}

Does any one have a sketch.bin file that works with ehternet. I just want to test the hardware...

Thanks

Anders

  • Hi,

    The below is the sample that sends only ping.

    Maybe you need to create instance. Please refer to reference.

    tool-cloud.renesas.com/.../library_ether.html

    #include <rxduino.h>

    #include <SPI.h>

    #include <Ethernet.h>

    TEthernet Ethernet;

    byte mac[] = {0x08, 0x09, 0x3c, 0x12, 0x34, 0x56};

    byte ip[] = {192,168,11,234};

    byte dns[]= {8,8,8,8};

    byte gateway[] = {192, 168, 11, 1};

    byte subnet[] = {255,255,255,0};

    byte pingTarge[] = {192,168,11,10};

    void setup()

    {

       Serial.begin(38400,SCI_AUTO);

       Serial.println("");

       Serial.println("set static ip address");

       Ethernet.begin(mac,ip,dns,gateway,subnet );

       Serial.println("IP Address set successfully.");

       Serial.print("My IP address is: ");

       Serial.println(Ethernet.localIP());

    }

    void loop()

    {

    int res;

          if (Ethernet.isLinkup() == 1)

           {

            Serial.println("LINK status is UP");

           } else {

            Serial.println("Link status is DOWN");

           }

           res=Ethernet.Ping(pingTarget);

           Serial.println(res);

           delay(5000);

    }