Announcement

Collapse
No announcement yet.

ESP8266 - Proof of Concept

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

  • #46
    Allan

    The ESP8266 devices are quite impressive for their footprint. I'm actually going to ping Grieg and see if he'll allow greater than 9 Arduino devices, as these are wifi they are just so easy to drop all over the place :-)

    Again thanks mate, you've really made a difference...

    BTW, where in Canada are you, not near Torronto are you ?
    HS 2.2.0.11

    Comment


    • #47
      Originally posted by Moskus View Post
      Thanks for the tip, I'll be trying these out.
      With Allan's fixes you wont be disappointed, its SUPER cool... I've got the Wemo D1 on the bench here flashing its blue light from HS events....and its just got a USB cable plugged into it......

      So much automating to be done, I'm so going to have to target the Toaster ;-)
      HS 2.2.0.11

      Comment


      • #48
        Originally posted by petez69 View Post
        Allan

        The ESP8266 devices are quite impressive for their footprint. I'm actually going to ping Grieg and see if he'll allow greater than 9 Arduino devices, as these are wifi they are just so easy to drop all over the place :-)

        Again thanks mate, you've really made a difference...

        BTW, where in Canada are you, not near Torronto are you ?
        When this gets a bit more refined I'm hoping we can make some plugin changes. One of the big changes I'd like to see if to support i2c expansion.
        ESP8266 sucks for Analog, but you can buy a 4ch 16bit ADC ADS1115 board for ~$3 which opens up lots of possibilities. As well as super cheap port expanders to add tons of I/O to the ESP8266 for cheap.

        Include support for DHT11/etc.

        I'm further east: Halifax.

        This works but is still pretty sloppy. Was mainly put out to gauge interest, particularly from Greig.

        Comment


        • #49
          Thanks Allan for the info....ESP8266 has been rock solid for the evening connected to HS with the blinking event. Actually I disconnected and reconnected it a number of times and it restarted nicely, not like other issues I've experienced with ethernet boards....

          Ok on Halifax, my boy is in Toronto Friday week, apparently he's found love so he's there for 3 weeks, was going to get him to take a few trinkets over for you, everyone needs a Kangaroo on the mantlepiece :-)

          These small wifi boards on HS has the potential to be HUGE, distributed I/O via wifi would be very cool....

          CHeers..Pete...
          HS 2.2.0.11

          Comment


          • #50
            Originally posted by AllanMar View Post
            When this gets a bit more refined I'm hoping we can make some plugin changes. One of the big changes I'd like to see if to support i2c expansion.
            ESP8266 sucks for Analog, but you can buy a 4ch 16bit ADC ADS1115 board for ~$3 which opens up lots of possibilities. As well as super cheap port expanders to add tons of I/O to the ESP8266 for cheap.

            Include support for DHT11/etc.

            I'm further east: Halifax.

            This works but is still pretty sloppy. Was mainly put out to gauge interest, particularly from Greig.
            Yep You got my interest but I this is the problem I was having before and I still am struggling to get this running. Is there an idiots guide you could make starting from scratch to make this work.
            Sorry I am not arround much but things are not to god here at work and do not have much time to play at the moment.

            Thank you for taking the time to look in to this.

            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


            • #51
              Greig,

              https://github.com/esp8266/Arduino#i...boards-manager

              This covers the basic process. Then use the library manager to update your libraries (as ESP8266 support may have only been added recently).

              If I get a chance i'll try to do a start from scratch instructions...
              You'll have to make the modification mentioned a few posts earlier until the ESP8266 library gets updated.

              Comment


              • #52
                NodeMCU ESP8266

                I have a simple project pasted together that works with my Arduino. now I'm trying to convert it to work with Lolin NodeMCU ESP just like the one pictured.
                I tried your example but cant get it to compile i tried several different ways removing what I don't think i need but just keep making a mess of it.. below is my working code for Arduino. is there a simple explanation to get this to work for the ESP? I don't need any serial all i want is to connect a DHT22 and send it to HomeSeer.

                Thank you

                Code:
                //For serial set to 0 and for Ethernet set to 1 
                #define ISIP 1 
                
                //Do NOT modify these 
                #if ISIP == 1 
                #include <EEPROM.h> 
                #include <SPI.h>        
                #include <Ethernet.h> 
                #include <EthernetUdp.h>  
                #endif 
                /************************************************************ 
                 *Arduino to Homeseer 3 Plugin API writen by Enigma Theatre.* 
                 * V1.0.0.36                                                * 
                 *                                                          * 
                 *******Change the values below only************************* 
                 */ 
                
                //Address of the board. 
                const byte BoardAdd = 1; 
                
                #if ISIP == 1 
                // Enter a MAC address and IP address for your board below. 
                byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED}; 
                
                // The IP address will be dependent on your local network. 
                IPAddress ip(192,168,1,177);     //IP entered in HS config. 
                const unsigned int localPort = 8080;      //port entered in HS config. 
                IPAddress HomeseerIP(192,168,1,15); //Homeseer IP address 
                IPAddress ServerIP(EEPROM.read(2),EEPROM.read(3),EEPROM.read(4),EEPROM.read(5)); 
                byte EEpromVersion = EEPROM.read(250); 
                #endif 
                
                //************Do not change anything in Here***************** 
                int FromHS[10];                                          // * 
                boolean IsConnected = false;                             // * 
                #if ISIP == 1                                            // * 
                char packetBuffer[UDP_TX_PACKET_MAX_SIZE];               // * 
                EthernetUDP Udp;                                         // * 
                const unsigned int ServerPort = 8888;                    // * 
                #endif                                                   // * 
                void(* resetFunc) (void) = 0;                            // * 
                //*********************************************************** 
                
                #include "DHT.h" 
                #define DHTPIN 2     // what pin we're connected to 
                // Uncomment whatever type you're using! 
                //#define DHTTYPE DHT11   // DHT 11  
                #define DHTTYPE DHT22   // DHT 22  (AM2302) 
                //#define DHTTYPE DHT21   // DHT 21 (AM2301) 
                
                DHT dht(DHTPIN, DHTTYPE); 
                
                int SendDelay = 3000; 
                long LastSend; 
                
                void setup() { 
                  HSSetup(); 
                  //************************ 
                  //Add YOUR SETUP HERE; 
                  //************************ 
                
                
                dht.begin(); 
                
                } 
                
                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) { 
                    
                    
                    if(millis() - LastSend > SendDelay){ 
                       
                   SendToHS(1,dht.readHumidity()); 
                   SendToHS(2,dht.readTemperature()); 
                    
                    LastSend=millis(); 
                    } 
                    
                    
                   /*Execute ONLY when HomeSeer is connected*/ 
                
                  } 
                } 
                
                
                
                const char* Version = "API1.0.0.36"; 
                
                byte Byte1,Byte2,Byte3; 
                int Byte4,Byte5; 
                
                
                void HSSetup() { 
                
                #if ISIP == 1 
                    if (EEpromVersion!=22) { 
                    ServerIP=HomeseerIP; 
                    EEPROM.write(2,ServerIP[0]); 
                    EEPROM.write(3,ServerIP[1]); 
                    EEPROM.write(4,ServerIP[2]); 
                    EEPROM.write(5,ServerIP[3]); 
                    EEPROM.write(250,22); //Store the version where the eeprom data layout was last changed 
                    EEpromVersion=22; 
                  } 
                Ethernet.begin(mac,ip); 
                  Udp.begin(localPort); 
                  Udp.setTimeout(0); 
                  delay(1000); 
                SendConnect(); 
                #else 
                  Serial.begin(115200); 
                  Serial.flush(); 
                  Serial.setTimeout(0); 
                  delay(1000); 
                  Serial.print("Connect "); 
                  Serial.println(BoardAdd); 
                #endif 
                
                  IsConnected = false; 
                
                } 
                
                void SendConnect() 
                { 
                #if ISIP == 0 
                  Serial.print("Connect "); 
                  Serial.println(BoardAdd); 
                #else 
                    Udp.beginPacket(ServerIP,ServerPort);  //First send a connect packet to the dynamic IP stored in eeprom 
                    Udp.print("Connect "); 
                    Udp.print(BoardAdd); 
                    Udp.endPacket(); 
                    if (ServerIP!=HomeseerIP) { 
                      Udp.beginPacket(HomeseerIP,ServerPort);  //Then if the stored value doesn't match the pre-specified one, send a connect packet there also 
                      Udp.print("Connect "); 
                      Udp.print(BoardAdd); 
                      Udp.endPacket(); 
                    } 
                  
                #endif 
                } 
                
                
                #if ISIP == 1 
                void IsUDP(){ 
                  int packetSize = Udp.parsePacket(); 
                  if(packetSize) 
                  { 
                    IPAddress remote = Udp.remoteIP(); 
                    Byte1 =Udp.parseInt(); 
                    Udp.read();  
                    Byte2 =Udp.read();  
                    Byte3 =Udp.parseInt(); 
                    Byte4 =Udp.parseInt(); 
                    Byte5 =Udp.parseInt(); 
                    DataEvent(); 
                  } 
                } 
                
                #else 
                void serialEvent() { 
                  while (Serial.available() > 0) { 
                    delay(17); 
                
                
                    Byte1 = Serial.parseInt(); 
                    Serial.read();   
                    Byte2 = Serial.read();  
                    Byte3 = Serial.parseInt(); 
                    Byte4 = Serial.parseInt(); 
                    Byte5 = Serial.parseInt(); 
                    DataEvent(); 
                  } 
                } 
                #endif 
                
                /* 
                
                Used Data Input Cases 
                D Disconnect 
                r reset 
                K Keepalive 
                O PinMode Output Set 
                d Input debounce time set 
                C Connect request 
                c Connection established - report current status 
                */ 
                void DataEvent() { 
                
                  if (Byte1 == BoardAdd) { 
                    switch (Byte2) { 
                
                    case 'c': 
                      IsConnected = true; 
                #if ISIP == 1 
                      if (Udp.remoteIP() != ServerIP) { 
                        ServerIP=Udp.remoteIP(); 
                        EEPROM.write(2,ServerIP[0]); 
                        EEPROM.write(3,ServerIP[1]); 
                        EEPROM.write(4,ServerIP[2]); 
                        EEPROM.write(5,ServerIP[3]); 
                      }      
                #endif 
                
                      break; 
                
                    case 'C':    
                #if ISIP == 1 
                      Udp.beginPacket(Udp.remoteIP(), ServerPort); 
                      Udp.print("Version "); 
                      Udp.print(BoardAdd); 
                      Udp.print(" "); 
                      Udp.print(Version); 
                      Udp.println(" HS3"); 
                      Udp.endPacket(); 
                
                      Udp.beginPacket(Udp.remoteIP(), ServerPort); 
                      delay(100); 
                      Udp.print("Connected "); 
                      Udp.println(BoardAdd); 
                      Udp.endPacket(); 
                #else 
                      Serial.print("Version "); 
                      Serial.print(BoardAdd); 
                      Serial.print(" "); 
                      Serial.print(Version); 
                      Serial.println(" HS3");  
                      delay(100); 
                      Serial.print("Connected "); 
                      Serial.println(BoardAdd); 
                #endif 
                      delay(100); 
                      IsConnected = false; 
                      break; 
                
                    case 'K': 
                      delay(200); 
                #if ISIP == 1 
                      Udp.beginPacket(Udp.remoteIP(), ServerPort); 
                      Udp.print("Alive "); 
                      Udp.println(BoardAdd); 
                      Udp.endPacket(); 
                      if (Udp.remoteIP() != ServerIP) { 
                        ServerIP=Udp.remoteIP(); 
                        EEPROM.write(2,ServerIP[0]); 
                        EEPROM.write(3,ServerIP[1]); 
                        EEPROM.write(4,ServerIP[2]); 
                        EEPROM.write(5,ServerIP[3]); 
                      }      
                #else      
                      Serial.print("Alive "); 
                      Serial.println(BoardAdd); 
                #endif 
                      break;  
                       
                      case 'r': 
                      delay(200); 
                      resetFunc();  //call reset 
                      break;  
                
                    case 'O': 
                      FromHS[Byte3] = Byte4; 
                      break;  
                
                    case 'D': 
                      IsConnected = false; 
                      break;    
                    } 
                  } 
                } 
                
                void SendToHS(byte Device, long Data){ 
                if (IsConnected == true) { 
                #if ISIP == 1 
                  Udp.beginPacket(Udp.remoteIP(), ServerPort); 
                  Udp.print(BoardAdd); 
                  Udp.print(" API "); 
                  Udp.print(Device); 
                  Udp.print(" "); 
                  Udp.print(Data); 
                  Udp.endPacket(); 
                #else 
                  Serial.print(BoardAdd); 
                  Serial.print(" API "); 
                  Serial.print(Device); 
                  Serial.print(" "); 
                  Serial.println(Data); 
                #endif 
                } 
                }

                Comment


                • #53
                  Originally posted by FernandoSolanes View Post
                  I have a simple project pasted together that works with my Arduino. now I'm trying to convert it to work with Lolin NodeMCU ESP just like the one pictured.

                  I tried your example but cant get it to compile i tried several different ways removing what I don't think i need but just keep making a mess of it.. below is my working code for Arduino. is there a simple explanation to get this to work for the ESP? I don't need any serial all i want is to connect a DHT22 and send it to HomeSeer.



                  Thank you



                  Code:
                  //For serial set to 0 and for Ethernet set to 1 
                  
                  #define ISIP 1 
                  
                  
                  
                  //Do NOT modify these 
                  
                  #if ISIP == 1 
                  
                  #include <EEPROM.h> 
                  
                  #include <SPI.h>        
                  
                  #include <Ethernet.h> 
                  
                  #include <EthernetUdp.h>  
                  
                  #endif 
                  
                  /************************************************************ 
                  
                   *Arduino to Homeseer 3 Plugin API writen by Enigma Theatre.* 
                  
                   * V1.0.0.36                                                * 
                  
                   *                                                          * 
                  
                   *******Change the values below only************************* 
                  
                   */ 
                  
                  
                  
                  //Address of the board. 
                  
                  const byte BoardAdd = 1; 
                  
                  
                  
                  #if ISIP == 1 
                  
                  // Enter a MAC address and IP address for your board below. 
                  
                  byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED}; 
                  
                  
                  
                  // The IP address will be dependent on your local network. 
                  
                  IPAddress ip(192,168,1,177);     //IP entered in HS config. 
                  
                  const unsigned int localPort = 8080;      //port entered in HS config. 
                  
                  IPAddress HomeseerIP(192,168,1,15); //Homeseer IP address 
                  
                  IPAddress ServerIP(EEPROM.read(2),EEPROM.read(3),EEPROM.read(4),EEPROM.read(5)); 
                  
                  byte EEpromVersion = EEPROM.read(250); 
                  
                  #endif 
                  
                  
                  
                  //************Do not change anything in Here***************** 
                  
                  int FromHS[10];                                          // * 
                  
                  boolean IsConnected = false;                             // * 
                  
                  #if ISIP == 1                                            // * 
                  
                  char packetBuffer[UDP_TX_PACKET_MAX_SIZE];               // * 
                  
                  EthernetUDP Udp;                                         // * 
                  
                  const unsigned int ServerPort = 8888;                    // * 
                  
                  #endif                                                   // * 
                  
                  void(* resetFunc) (void) = 0;                            // * 
                  
                  //*********************************************************** 
                  
                  
                  
                  #include "DHT.h" 
                  
                  #define DHTPIN 2     // what pin we're connected to 
                  
                  // Uncomment whatever type you're using! 
                  
                  //#define DHTTYPE DHT11   // DHT 11  
                  
                  #define DHTTYPE DHT22   // DHT 22  (AM2302) 
                  
                  //#define DHTTYPE DHT21   // DHT 21 (AM2301) 
                  
                  
                  
                  DHT dht(DHTPIN, DHTTYPE); 
                  
                  
                  
                  int SendDelay = 3000; 
                  
                  long LastSend; 
                  
                  
                  
                  void setup() { 
                  
                    HSSetup(); 
                  
                    //************************ 
                  
                    //Add YOUR SETUP HERE; 
                  
                    //************************ 
                  
                  
                  
                  
                  
                  dht.begin(); 
                  
                  
                  
                  } 
                  
                  
                  
                  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) { 
                  
                      
                  
                      
                  
                      if(millis() - LastSend > SendDelay){ 
                  
                         
                  
                     SendToHS(1,dht.readHumidity()); 
                  
                     SendToHS(2,dht.readTemperature()); 
                  
                      
                  
                      LastSend=millis(); 
                  
                      } 
                  
                      
                  
                      
                  
                     /*Execute ONLY when HomeSeer is connected*/ 
                  
                  
                  
                    } 
                  
                  } 
                  
                  
                  
                  
                  
                  
                  
                  const char* Version = "API1.0.0.36"; 
                  
                  
                  
                  byte Byte1,Byte2,Byte3; 
                  
                  int Byte4,Byte5; 
                  
                  
                  
                  
                  
                  void HSSetup() { 
                  
                  
                  
                  #if ISIP == 1 
                  
                      if (EEpromVersion!=22) { 
                  
                      ServerIP=HomeseerIP; 
                  
                      EEPROM.write(2,ServerIP[0]); 
                  
                      EEPROM.write(3,ServerIP[1]); 
                  
                      EEPROM.write(4,ServerIP[2]); 
                  
                      EEPROM.write(5,ServerIP[3]); 
                  
                      EEPROM.write(250,22); //Store the version where the eeprom data layout was last changed 
                  
                      EEpromVersion=22; 
                  
                    } 
                  
                  Ethernet.begin(mac,ip); 
                  
                    Udp.begin(localPort); 
                  
                    Udp.setTimeout(0); 
                  
                    delay(1000); 
                  
                  SendConnect(); 
                  
                  #else 
                  
                    Serial.begin(115200); 
                  
                    Serial.flush(); 
                  
                    Serial.setTimeout(0); 
                  
                    delay(1000); 
                  
                    Serial.print("Connect "); 
                  
                    Serial.println(BoardAdd); 
                  
                  #endif 
                  
                  
                  
                    IsConnected = false; 
                  
                  
                  
                  } 
                  
                  
                  
                  void SendConnect() 
                  
                  { 
                  
                  #if ISIP == 0 
                  
                    Serial.print("Connect "); 
                  
                    Serial.println(BoardAdd); 
                  
                  #else 
                  
                      Udp.beginPacket(ServerIP,ServerPort);  //First send a connect packet to the dynamic IP stored in eeprom 
                  
                      Udp.print("Connect "); 
                  
                      Udp.print(BoardAdd); 
                  
                      Udp.endPacket(); 
                  
                      if (ServerIP!=HomeseerIP) { 
                  
                        Udp.beginPacket(HomeseerIP,ServerPort);  //Then if the stored value doesn't match the pre-specified one, send a connect packet there also 
                  
                        Udp.print("Connect "); 
                  
                        Udp.print(BoardAdd); 
                  
                        Udp.endPacket(); 
                  
                      } 
                  
                    
                  
                  #endif 
                  
                  } 
                  
                  
                  
                  
                  
                  #if ISIP == 1 
                  
                  void IsUDP(){ 
                  
                    int packetSize = Udp.parsePacket(); 
                  
                    if(packetSize) 
                  
                    { 
                  
                      IPAddress remote = Udp.remoteIP(); 
                  
                      Byte1 =Udp.parseInt(); 
                  
                      Udp.read();  
                  
                      Byte2 =Udp.read();  
                  
                      Byte3 =Udp.parseInt(); 
                  
                      Byte4 =Udp.parseInt(); 
                  
                      Byte5 =Udp.parseInt(); 
                  
                      DataEvent(); 
                  
                    } 
                  
                  } 
                  
                  
                  
                  #else 
                  
                  void serialEvent() { 
                  
                    while (Serial.available() > 0) { 
                  
                      delay(17); 
                  
                  
                  
                  
                  
                      Byte1 = Serial.parseInt(); 
                  
                      Serial.read();   
                  
                      Byte2 = Serial.read();  
                  
                      Byte3 = Serial.parseInt(); 
                  
                      Byte4 = Serial.parseInt(); 
                  
                      Byte5 = Serial.parseInt(); 
                  
                      DataEvent(); 
                  
                    } 
                  
                  } 
                  
                  #endif 
                  
                  
                  
                  /* 
                  
                  
                  
                  Used Data Input Cases 
                  
                  D Disconnect 
                  
                  r reset 
                  
                  K Keepalive 
                  
                  O PinMode Output Set 
                  
                  d Input debounce time set 
                  
                  C Connect request 
                  
                  c Connection established - report current status 
                  
                  */ 
                  
                  void DataEvent() { 
                  
                  
                  
                    if (Byte1 == BoardAdd) { 
                  
                      switch (Byte2) { 
                  
                  
                  
                      case 'c': 
                  
                        IsConnected = true; 
                  
                  #if ISIP == 1 
                  
                        if (Udp.remoteIP() != ServerIP) { 
                  
                          ServerIP=Udp.remoteIP(); 
                  
                          EEPROM.write(2,ServerIP[0]); 
                  
                          EEPROM.write(3,ServerIP[1]); 
                  
                          EEPROM.write(4,ServerIP[2]); 
                  
                          EEPROM.write(5,ServerIP[3]); 
                  
                        }      
                  
                  #endif 
                  
                  
                  
                        break; 
                  
                  
                  
                      case 'C':    
                  
                  #if ISIP == 1 
                  
                        Udp.beginPacket(Udp.remoteIP(), ServerPort); 
                  
                        Udp.print("Version "); 
                  
                        Udp.print(BoardAdd); 
                  
                        Udp.print(" "); 
                  
                        Udp.print(Version); 
                  
                        Udp.println(" HS3"); 
                  
                        Udp.endPacket(); 
                  
                  
                  
                        Udp.beginPacket(Udp.remoteIP(), ServerPort); 
                  
                        delay(100); 
                  
                        Udp.print("Connected "); 
                  
                        Udp.println(BoardAdd); 
                  
                        Udp.endPacket(); 
                  
                  #else 
                  
                        Serial.print("Version "); 
                  
                        Serial.print(BoardAdd); 
                  
                        Serial.print(" "); 
                  
                        Serial.print(Version); 
                  
                        Serial.println(" HS3");  
                  
                        delay(100); 
                  
                        Serial.print("Connected "); 
                  
                        Serial.println(BoardAdd); 
                  
                  #endif 
                  
                        delay(100); 
                  
                        IsConnected = false; 
                  
                        break; 
                  
                  
                  
                      case 'K': 
                  
                        delay(200); 
                  
                  #if ISIP == 1 
                  
                        Udp.beginPacket(Udp.remoteIP(), ServerPort); 
                  
                        Udp.print("Alive "); 
                  
                        Udp.println(BoardAdd); 
                  
                        Udp.endPacket(); 
                  
                        if (Udp.remoteIP() != ServerIP) { 
                  
                          ServerIP=Udp.remoteIP(); 
                  
                          EEPROM.write(2,ServerIP[0]); 
                  
                          EEPROM.write(3,ServerIP[1]); 
                  
                          EEPROM.write(4,ServerIP[2]); 
                  
                          EEPROM.write(5,ServerIP[3]); 
                  
                        }      
                  
                  #else      
                  
                        Serial.print("Alive "); 
                  
                        Serial.println(BoardAdd); 
                  
                  #endif 
                  
                        break;  
                  
                         
                  
                        case 'r': 
                  
                        delay(200); 
                  
                        resetFunc();  //call reset 
                  
                        break;  
                  
                  
                  
                      case 'O': 
                  
                        FromHS[Byte3] = Byte4; 
                  
                        break;  
                  
                  
                  
                      case 'D': 
                  
                        IsConnected = false; 
                  
                        break;    
                  
                      } 
                  
                    } 
                  
                  } 
                  
                  
                  
                  void SendToHS(byte Device, long Data){ 
                  
                  if (IsConnected == true) { 
                  
                  #if ISIP == 1 
                  
                    Udp.beginPacket(Udp.remoteIP(), ServerPort); 
                  
                    Udp.print(BoardAdd); 
                  
                    Udp.print(" API "); 
                  
                    Udp.print(Device); 
                  
                    Udp.print(" "); 
                  
                    Udp.print(Data); 
                  
                    Udp.endPacket(); 
                  
                  #else 
                  
                    Serial.print(BoardAdd); 
                  
                    Serial.print(" API "); 
                  
                    Serial.print(Device); 
                  
                    Serial.print(" "); 
                  
                    Serial.println(Data); 
                  
                  #endif 
                  
                  } 
                  
                  }


                  I'll have a look at your code but what are the errors your getting compiling the example.

                  Comment


                  • #54
                    Its starts with the LCD one below and eventually if I rem out enough lines it finishes compiling, however then I don't know what I actually need for it to work with my DHT22 as as there seems to be a whole lot of other stuff this script does...

                    Users/fsolanes/Downloads/Homeseer/Homeseer.ino:508:19: note: candidate is:
                    In file included from /Users/fsolanes/Downloads/Homeseer/Homeseer.ino:1:0:
                    /Users/fsolanes/Documents/Arduino/libraries/Arduino-LiquidCrystal-I2C-library-master/LiquidCrystal_I2C.h:76:7: note: void LiquidCrystal_I2C::begin()
                    void begin();
                    ^
                    /Users/fsolanes/Documents/Arduino/libraries/Arduino-LiquidCrystal-I2C-library-master/LiquidCrystal_I2C.h:76:7: note: candidate expects 0 arguments, 2 provided
                    Using library Arduino-LiquidCrystal-I2C-library-master in folder: /Users/fsolanes/Documents/Arduino/libraries/Arduino-LiquidCrystal-I2C-library-master (legacy)
                    Using library EEPROM at version 1.0 in folder: /Users/fsolanes/Library/Arduino15/packages/esp8266/hardware/esp8266/2.2.0/libraries/EEPROM
                    Using library ESP8266WiFi at version 1.0 in folder: /Users/fsolanes/Library/Arduino15/packages/esp8266/hardware/esp8266/2.2.0/libraries/ESP8266WiFi
                    Using library Servo at version 1.0.2 in folder: /Users/fsolanes/Library/Arduino15/packages/esp8266/hardware/esp8266/2.2.0/libraries/Servo
                    Using library OneWire at version 2.3.2 in folder: /Users/fsolanes/Documents/Arduino/libraries/OneWire
                    Using library DallasTemperature at version 3.7.6 in folder: /Users/fsolanes/Documents/Arduino/libraries/DallasTemperature
                    Using library Wire at version 1.0 in folder: /Users/fsolanes/Library/Arduino15/packages/esp8266/hardware/esp8266/2.2.0/libraries/Wire
                    exit status 1
                    'POSITIVE' was not declared in this scope

                    Comment


                    • #55
                      Hi Allan

                      FYI, I had an even that toggled an I/O pin every few seconds, no disconnects on wifi for weeks. I've stopped that event and notice the board drops out every few hours now and immediately reconnects....

                      Have you seen this at all ? I'm not fussed really, it reconnects fine....

                      Cheers..Pete
                      HS 2.2.0.11

                      Comment


                      • #56
                        Originally posted by FernandoSolanes View Post
                        Its starts with the LCD one below and eventually if I rem out enough lines it finishes compiling, however then I don't know what I actually need for it to work with my DHT22 as as there seems to be a whole lot of other stuff this script does...



                        Users/fsolanes/Downloads/Homeseer/Homeseer.ino:508:19: note: candidate is:

                        In file included from /Users/fsolanes/Downloads/Homeseer/Homeseer.ino:1:0:

                        /Users/fsolanes/Documents/Arduino/libraries/Arduino-LiquidCrystal-I2C-library-master/LiquidCrystal_I2C.h:76:7: note: void LiquidCrystal_I2C::begin()

                        void begin();

                        ^

                        /Users/fsolanes/Documents/Arduino/libraries/Arduino-LiquidCrystal-I2C-library-master/LiquidCrystal_I2C.h:76:7: note: candidate expects 0 arguments, 2 provided

                        Using library Arduino-LiquidCrystal-I2C-library-master in folder: /Users/fsolanes/Documents/Arduino/libraries/Arduino-LiquidCrystal-I2C-library-master (legacy)

                        Using library EEPROM at version 1.0 in folder: /Users/fsolanes/Library/Arduino15/packages/esp8266/hardware/esp8266/2.2.0/libraries/EEPROM

                        Using library ESP8266WiFi at version 1.0 in folder: /Users/fsolanes/Library/Arduino15/packages/esp8266/hardware/esp8266/2.2.0/libraries/ESP8266WiFi

                        Using library Servo at version 1.0.2 in folder: /Users/fsolanes/Library/Arduino15/packages/esp8266/hardware/esp8266/2.2.0/libraries/Servo

                        Using library OneWire at version 2.3.2 in folder: /Users/fsolanes/Documents/Arduino/libraries/OneWire

                        Using library DallasTemperature at version 3.7.6 in folder: /Users/fsolanes/Documents/Arduino/libraries/DallasTemperature

                        Using library Wire at version 1.0 in folder: /Users/fsolanes/Library/Arduino15/packages/esp8266/hardware/esp8266/2.2.0/libraries/Wire

                        exit status 1

                        'POSITIVE' was not declared in this scope


                        Are you sure your using the liquid crystal lib included with the plugin? Not sure why greig used a different one but the normal arduino one doesn't appear to work.

                        Comment


                        • #57
                          Originally posted by petez69 View Post
                          Hi Allan



                          FYI, I had an even that toggled an I/O pin every few seconds, no disconnects on wifi for weeks. I've stopped that event and notice the board drops out every few hours now and immediately reconnects....



                          Have you seen this at all ? I'm not fussed really, it reconnects fine....



                          Cheers..Pete


                          Have you had the serial console open? Need to confirm if the board is crashing/resetting or if it's just a comms problem.

                          Should probably add some serial debug messages.

                          Comment


                          • #58
                            I tried the included libraries and others, but since I don't have an LCD I rem those lines out...
                            I figured it would be easier to get my Arduino working script converted to the ESP than get this sample script working since theres so much in that one i have no clue what it all does

                            Comment


                            • #59
                              Originally posted by FernandoSolanes View Post
                              I tried the included libraries and others, but since I don't have an LCD I rem those lines out...
                              I figured it would be easier to get my Arduino working script converted to the ESP than get this sample script working since theres so much in that one i have no clue what it all does
                              Yea, but since I know the one I included can work, once you get that compiled/working we know your environment/config is setup correctly. Then we can see what the issue is with your specific sketch, until then you could have more than one problem.

                              The error you posted tells me it's not finding the correct LiquidCrystal library.

                              I'll have a look at getting the API example sketch modified to support ESP8266

                              Comment


                              • #60
                                OK I deleted all my libraries and put in just the ones from the plugin and still gets stuck at the LCD..
                                I put a few other LCD Libraries using the Manager and it gives me a diffrent error. But definitely with just the libraries from the Plug in and the default sample it gets stuck..

                                thanks for all your help...


                                WARNING: library LiquidCrystal_I2C claims to run on [avr] architecture(s) and may be incompatible with your current board which runs on [esp8266] architecture(s).
                                "/Users/fsolanes/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-I/Users/fsolanes/Library/Arduino15/packages/esp8266/hardware/esp8266/2.2.0/tools/sdk/include" "-I/Users/fsolanes/Library/Arduino15/packages/esp8266/hardware/esp8266/2.2.0/tools/sdk/lwip/include" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -ffunction-sections -fdata-sections -w -x c++ -E -CC -DF_CPU=80000000L -DARDUINO=10608 -DARDUINO_ESP8266_NODEMCU -DARDUINO_ARCH_ESP8266 -DESP8266 "-I/Users/fsolanes/Library/Arduino15/packages/esp8266/hardware/esp8266/2.2.0/cores/esp8266" "-I/Users/fsolanes/Library/Arduino15/packages/esp8266/hardware/esp8266/2.2.0/variants/nodemcu" "-I/Users/fsolanes/Library/Arduino15/packages/esp8266/hardware/esp8266/2.2.0/libraries/EEPROM" "-I/Users/fsolanes/Library/Arduino15/packages/esp8266/hardware/esp8266/2.2.0/libraries/ESP8266WiFi/src" "-I/Users/fsolanes/Library/Arduino15/packages/esp8266/hardware/esp8266/2.2.0/libraries/Servo/src" "-I/Users/fsolanes/Documents/Arduino/libraries/OneWire" "-I/Users/fsolanes/Documents/Arduino/libraries/DallasTemperature" "-I/Users/fsolanes/Documents/Arduino/libraries/LiquidCrystal_I2C" "-I/Users/fsolanes/Library/Arduino15/packages/esp8266/hardware/esp8266/2.2.0/libraries/Wire" "/var/folders/v4/m607qq692kn8s8hg5_bcdmx80000gn/T/build4a26ceb702810316fbd4f3e63b126dc2.tmp/sketch/Homeseer.ino.cpp" -o "/var/folders/v4/m607qq692kn8s8hg5_bcdmx80000gn/T/build4a26ceb702810316fbd4f3e63b126dc2.tmp/preproc/ctags_target_for_gcc_minus_e.cpp"
                                In file included from /Users/fsolanes/Downloads/Homeseer/Homeseer.ino:188:0:
                                /Users/fsolanes/Documents/Arduino/libraries/OneWire/OneWire.h:77:2: error: #error "Please define I/O register types here"
                                #error "Please define I/O register types here"
                                ^
                                Using library LiquidCrystal_I2C at version 1.1.2 in folder: /Users/fsolanes/Documents/Arduino/libraries/LiquidCrystal_I2C
                                Using library Wire at version 1.0 in folder: /Users/fsolanes/Library/Arduino15/packages/esp8266/hardware/esp8266/2.2.0/libraries/Wire
                                Using library EEPROM at version 1.0 in folder: /Users/fsolanes/Library/Arduino15/packages/esp8266/hardware/esp8266/2.2.0/libraries/EEPROM
                                Using library ESP8266WiFi at version 1.0 in folder: /Users/fsolanes/Library/Arduino15/packages/esp8266/hardware/esp8266/2.2.0/libraries/ESP8266WiFi
                                Using library Servo at version 1.0.2 in folder: /Users/fsolanes/Library/Arduino15/packages/esp8266/hardware/esp8266/2.2.0/libraries/Servo
                                Using library OneWire in folder: /Users/fsolanes/Documents/Arduino/libraries/OneWire (legacy)
                                Using library DallasTemperature in folder: /Users/fsolanes/Documents/Arduino/libraries/DallasTemperature (legacy)
                                exit status 1
                                Error compiling for board NodeMCU 1.0 (ESP-12E Module).

                                Comment

                                Working...
                                X