Announcement

Collapse
No announcement yet.

Cannot connect

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

    Cannot connect

    I know there are several threads like this, and I read them, followed them, and nevertheless, I cannot connect to my board.
    Please let me know what you need to troubleshoot.

    I connected the board via USB to the Homeseer server. I setup the board with the API, downloaded the sketch, updated it with my changes, and uploaded it to the Arduino.
    I tried the above with both IP address and USB, neither work. If I use auto-connect, it says it connects, but loses connection after a few seconds.

    Thanks in advance,
    Eric
    Attached Files
    Last edited by stevenseh@gmail.com; March 24, 2018, 04:32 PM. Reason: Adding debug file

    #2
    Originally posted by stevenseh@gmail.com View Post
    I know there are several threads like this, and I read them, followed them, and nevertheless, I cannot connect to my board.
    Please let me know what you need to troubleshoot.

    I connected the board via USB to the Homeseer server. I setup the board with the API, downloaded the sketch, updated it with my changes, and uploaded it to the Arduino.
    I tried the above with both IP address and USB, neither work. If I use auto-connect, it says it connects, but loses connection after a few seconds.

    Thanks in advance,
    Eric
    Eric,

    You have a bit of a strange setup going on. The board is set to be a standard (Non API) Board but the input is an API input. I guess you just want a normal board to start with?
    Delete the board and input you have then add the board again as Type "Arduino" and set the comport. Then click to download the sketch of board one and use the Arduino IDE to upload it to the board. You can then connect the board and add the pins you want when you want them. It should be that easy.

    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
      Hmm...
      I show an Arduino API board with and API input.
      My board has a temperature sensor on it, no output.
      That is as it should be, no?
      Find attached the code I added to the downloaded API.

      Btw, it connects OK if I use a non API board and analog pin for the temperature sensor.
      I still would like to get the API to work, as I don't want to handle all the small reading difference in Homeseer.

      Thanks,
      Eric
      Attached Files
      Last edited by stevenseh@gmail.com; March 24, 2018, 07:06 PM. Reason: Adding attachments

      Comment


        #4
        Originally posted by stevenseh@gmail.com View Post
        Hmm...
        I show an Arduino API board with and API input.
        My board has a temperature sensor on it, no output.
        That is as it should be, no?
        Find attached the code I added to the downloaded API.

        Btw, it connects OK if I use a non API board and analog pin for the temperature sensor.
        I still would like to get the API to work, as I don't want to handle all the small reading difference in Homeseer.

        Thanks,
        Eric
        Eric,

        Sorry, I miss read the debug.

        The setup is correct for what you want but what you have in the sketch is the problem:
        1.You can not use serial when the board is connected with serial as the printout will send to Homeseer and there is no way of interpreting this.
        2.You need to send the data to Homeseer with SendToHS(Device,Value) which you do not have anywhere in the sketch.
        3. You are sending the serial data in every loop and this will flood the comport. You need to check if the device has changed value and if so send it to HS.

        This is untested code but should give you a better idea of what should be there.

        Code:
        const int sensorPin = A2;
        int OldSensorVal = 0;
        
        void setup() {
          HSSetup();
          //************************
          //Add YOUR SETUP HERE;
          //************************
        
        }
        
        
        
        
        void loop() {
        #if ISIP == 1
          IsUDP();
        #endif
        
            //************************
            //Add YOUR CODE HERE;
            //************************
            /* To Send Data to Homeseer use SendToHS(Device,Value)
             Eg.. SendToHS(1,200); where 1 is the API device in homeseer and 200 is the value to send
             To Recieve data from Homeseer look up the FromHS array that is updated when the device value changes.
             Eg.. FromHS[5] would be the data from API Output device 5
             All code that is located just below this block will execute regardless of connection status!
             You can include SendToHS() calls, however when there isn't an active connection, it will just return and continue.
             If you only want code to execute when HomeSeer is connected, put it inside the if statement below.
             */
        
        /*Execute regardless of connection status*/
        
        
         if (IsConnected == true) {
           /*Execute ONLY when HomeSeer is connected*/
        
          int sensorVal = analogRead(sensorPin);//Read the Sensor Value
        
          if (sensorVal != (OldSensorVal ){ //Check if the Temp has changed Value
        
           float voltage = (sensorVal/1024.0) * 5.0; //Convert Value to Voltage
           float temperature = (voltage - .5) * 100.0; //Convert Voltage to Temp
        
          SendToHS(1,temperature); //Send the Temp to HS
          OldSensorVal =  sensorVal; //Store the last sent temp
          
          }
          }
        }
        I would also recommend upgrading to the Beta version in the updater as it is stable and has lots more useful features.

        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

        Working...
        X