Ethernet. shield or module.

Request new hardware or ideas for the controller

Posts: 129
Joined: Tue Sep 24, 2013 3:18 am
PostPosted: Sat Apr 05, 2014 6:01 pm
Awesome. Works a treat. :D Many thanks!
User avatar
Posts: 2737
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
PostPosted: Sat Apr 05, 2014 8:49 pm
sabo wrote:Awesome. Works a treat. :D Many thanks!

excellent! sounds like the problem is solved 8-)

Sent from my Moto X

Posts: 122
Joined: Thu Nov 24, 2011 9:50 pm
Location: Golden, CO
PostPosted: Thu Oct 09, 2014 3:39 pm
Is this still regarded as the best way to go ethernet?

In my last house wifi was easy but in this house there is too much concrete and it seems my signal is too weak to give a reliable connection.

I've installed power line ethernet adapters on multiple computers here with excellent results and would like to do the same with my RA. I assume I don't need the power from ethernet version.

Anyone need a discount wifi module?
Image

Posts: 12229
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Thu Oct 09, 2014 4:30 pm
Yes, that is the best and easiest way to get ethernet.
Roberto.

Posts: 1
Joined: Thu Sep 25, 2014 7:28 pm
PostPosted: Fri Oct 17, 2014 8:23 pm
I'd be interested in a discount Wi-Fi module!
User avatar
Posts: 31
Joined: Tue Feb 05, 2013 9:39 pm
PostPosted: Thu Oct 23, 2014 12:42 am
Is it possible for someone to do up a bit of a tutorial for this? I'm keen to do it but still a bit confused...
Cheers
Cody

Posts: 12229
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Thu Oct 23, 2014 8:28 am
It's pretty simple.
Buy the board, load the code attached to the very first posts in this thread and connect to RA with the same cable you use for your wifi attachment. :)
If you don't have one, PM me. I can get you only the cable.
Roberto.

Posts: 126
Joined: Tue May 08, 2012 8:16 am
PostPosted: Thu Jul 23, 2015 6:56 am
Will this code still work with the newest libraries. I can't seem to get it to work.
Image

Posts: 12229
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Thu Jul 23, 2015 8:28 am
This is independent of the libraries.
This code goes into the Ethernet board and not on RA.
Roberto.

Posts: 126
Joined: Tue May 08, 2012 8:16 am
PostPosted: Thu Jul 23, 2015 9:39 am
rimai wrote:This is independent of the libraries.
This code goes into the Ethernet board and not on RA.


Hmm

It loads fine, but then I can't ping it.

If I use this test code it works. I can ping it, I can go to the ip address and see the server page the code hosts.
Code: Select all
*--------------------------------------------------------------
  Program:      eth_websrv_page

  Description:  Arduino web server that serves up a basic web
                page. Does not use the SD card.
 
  Hardware:     Arduino Uno and official Arduino Ethernet
                shield. Should work with other Arduinos and
                compatible Ethernet shields.
               
  Software:     Developed using Arduino 1.0.3 software
                Should be compatible with Arduino 1.0 +
 
  References:   - WebServer example by David A. Mellis and
                  modified by Tom Igoe
                - Ethernet library documentation:
                  http://arduino.cc/en/Reference/Ethernet

  Date:         7 January 2013
 
  Author:       W.A. Smith, http://startingelectronics.org
--------------------------------------------------------------*/

#include <SPI.h>
#include <Ethernet.h>

// MAC address from Ethernet shield sticker under board
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(10, 0, 0, 20); // IP address, may need to change depending on network
EthernetServer server(80);  // create a server at port 80

void setup()
{
    Ethernet.begin(mac, ip);  // initialize Ethernet device
    server.begin();           // start to listen for clients
}

void loop()
{
    EthernetClient client = server.available();  // try to get client

    if (client) {  // got client?
        boolean currentLineIsBlank = true;
        while (client.connected()) {
            if (client.available()) {   // client data available to read
                char c = client.read(); // read 1 byte (character) from client
                // last line of client request is blank and ends with \n
                // respond to client only after last line received
                if (c == '\n' && currentLineIsBlank) {
                    // send a standard http response header
                    client.println("HTTP/1.1 200 OK");
                    client.println("Content-Type: text/html");
                    client.println("Connection: close");
                    client.println();
                    // send web page
                    client.println("<!DOCTYPE html>");
                    client.println("<html>");
                    client.println("<head>");
                    client.println("<title>Arduino Web Page</title>");
                    client.println("</head>");
                    client.println("<body>");
                    client.println("<h1>Hello from Arduino!</h1>");
                    client.println("<p>A web page from the Arduino server</p>");
                    client.println("</body>");
                    client.println("</html>");
                    break;
                }
                // every line of text received from the client ends with \r\n
                if (c == '\n') {
                    // last character on line of received text
                    // starting new line with next character read
                    currentLineIsBlank = true;
                }
                else if (c != '\r') {
                    // a text character was received from client
                    currentLineIsBlank = false;
                }
            } // end if (client.available())
        } // end while (client.connected())
        delay(1);      // give the web browser time to receive the data
        client.stop(); // close the connection
    } // end if (client)
}


I am using the actual Arduino exe to upload since the RA version can't see the board.
Image
PreviousNext

Return to Requests

Who is online

Users browsing this forum: No registered users and 2 guests