Announcement

Collapse
No announcement yet.

Newbie having trouble connecting via Ethernet

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Newbie having trouble connecting via Ethernet

    I'm new to networking and have only recently connecting and communicated with an Arduino UNO using the Ethernet Shield II. I did this using the latest version (1.8.42.0) of the Arduino IDE. However, when I tried to do the same thing using the required version IDE V1.6.8 I could not get it to work. Please excuse my rookie questions, but here goes. 1) Do I need to have my Ethernet Shield II and Arduino already communicating on my network before setting the board up with the plugin, or will this functionality be configured by the plugin? 2) When I had things working with V1.8.42.0 IDE I set it up using the IP, MAC and told it to use port 5000. If the plugin will configure the board for me, how do I know which port to use?

    FYI - This is the program I currently have uploaded to the Arduino (usingV1.6.8):

    const int garageLDR = A0; //connect garage LDR to pin A0
    const int atticLDR = A1; //connect attic LDR to pin A1
    const int garageStatusPin = 4; //pin to hold garage status
    const int atticStatusPin = 5; //pin to hold attic status
    int gLDR = 0; //Variable to hold garage LDR value
    int aLDR = 0; //Variable to hold attic LDR value
    int count = 0; //index for loop
    int timer = 100; //delay for loop readings


    void setup() {

    Serial.begin(9600);
    pinMode(garageStatusPin, OUTPUT); // 0 = garage dark, 1 = garage light
    pinMode(atticStatusPin, OUTPUT); // 0 = attic dark, 1 = attic light

    }

    void loop() {
    aLDR = 0; //initialize value
    gLDR = 0; //initialize value
    for (count=0;count<5;count++) {
    gLDR = gLDR + analogRead(garageLDR); //read the photoresistor value
    aLDR = aLDR + analogRead(atticLDR); //read the photoresistor value
    delay(timer);
    }
    gLDR = gLDR/5; //take the average for five readings
    aLDR = aLDR/5;

    if (gLDR>450) {
    digitalWrite(garageStatusPin, HIGH);
    }
    else {
    digitalWrite(garageStatusPin, LOW);
    }

    if (aLDR>500) {
    digitalWrite(atticStatusPin, HIGH);
    }
    else {
    digitalWrite(atticStatusPin, LOW);
    }


    Serial.print("The garage LDR = ");
    Serial.println(gLDR);
    Serial.print("The attic LDR = ");
    Serial.println(aLDR);
    Serial.println('\n');
    delay(1000);

    }

    #2
    Originally posted by MSG56 View Post
    1) Do I need to have my Ethernet Shield II and Arduino already communicating on my network before setting the board up with the plugin, or will this functionality be configured by the plugin?
    2) When I had things working with V1.8.42.0 IDE I set it up using the IP, MAC and told it to use port 5000. If the plugin will configure the board for me, how do I know which port to use?
    1) The plugin will set up the board for you with the information you provide it but it will set defaults that should work fine for you if you are not sure what to set them to. Just check the IP is free.
    2)Again the plugin will set a default port for you to use which you can keep and not have to configure.


    The plugin will do all the hard work for you and you will not need to code anything unless you want to use the API mode which will allow you to add devices that are not supported by default in the plugin.

    To get going just look through the manual and do the following.
    1. Add the board to the plugin and set the network settings (or leave the defaults)
    2. On the plugin config page download the sketch for the board by selecting the board you want the clicking the arrow. This will set up all code required for the board to connect to HS.
    3. Open this file in the Arduino IDE
    4. Select the type of board in the IDE
    5. Click to upload the file to the board.
    6. Open the plugin config page and click connect to connect the board to HS
    7. Select the pins you want to add the click on the type of pin you want to set it as
    8. Connect your device to the pin and test it.
    9. Repeat 7 and 8 for each pin you want to use
    10. The devices for the pins you add will be created in HS
    Hope this helps you.

    Greig.
    Zwave = Z-Stick, 3xHSM100� 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
    X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
    Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
    Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
    Scripts =
    Various

    Comment


      #3
      Thank you Greig - This got me up and running. I can tell I'm going to have fun with this.

      Comment


        #4
        I'm trying to connect a second board, but keep getting "Connection FAILED". When setting up the board I used the default settings, except for the MAC, which I change to the one on the sticker on the Ethernet Shield II. The default ip was 192.168.1.165 One higher than the first board. I took a look at my router and saw something (WIZnet0F94F6) listed as inactive at this ip, so I change the default ip to .192.168.1.196, which I could find list on the router. This didn't help either. Not sure how to troubleshoot this.

        Comment


          #5
          Okay, I just played with it some more and have it running. I tried deleting the ino files and redownloaded the sketch and that resolved the issue.

          Comment


            #6
            My second board seems to be doing fine, but my first board has been disconnected all day today. Resetting and cycling power has not helped. Any ideas why it would be fine for a few days and then no longer connect? I didn't change anything except adding a second board. Both boards were connected when I went to bed last night, but board 1 was disconnected when I check it this morning.

            Comment

            Working...
            X