Announcement

Collapse
No announcement yet.

ESP8266 - Proof of Concept

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

    Originally posted by luisr320 View Post
    Just wanted to give some feedback on my attempts go get a ESP8266-01 connected to Homeseer with the Arduino Plug-in.

    It took me a couple of days to figure it out but I've finally managed to have an LED attached to GPIO2 of the ESP8826-01 board to turn ON and OFF with Homeseer.



    I'm using this resources:
    - Arduino Plugin created by Greig DempsterEnigmatheatre). V1.0.0.131, Beta
    - Arduino IDE 1.8.1
    - The changed sketch posted on the beguinning of this post with the version changed to 1.0.0.127
    - I installed the ESP8826 board into the Arduino IDE using this link: http://arduino.esp8266.com/staging/p...com_index.json

    However, I can't make the GPIO pin work as a PWM, nor use the BLINK or the ONE FLASH.

    It is imperative to change the version on the sketch.

    Also, the LiquidCristal library had to be downgraded to a previous version.

    If anyone want more info about what I had to do to make it work just let me know.

    I have your same experience but with a NodeMCU dev kit.
    I had to comment out all the reference to LiquidCrystal (I didn't need it anyway) to avoid the errors during compilation, but then yes it connects and I'm able to switch on/off or toggle the LED. It doesn't blink though.

    Did you get the new sketch, is it working?

    Comment


      Originally posted by doppiaemme View Post

      Is it working?
      Yes it works but no I have not sent it to anyone as I found a bug I wish to fix before then. I have so many people wanting this that I have updates the main plugin version and will make the new Beta the version that supports the NodeMcu boards.
      Please hold tight while I get the bug fixed and I will update you all when it is in the updater.

      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


        Originally posted by cowsr4eating View Post
        @Luisr320

        I downloaded the HomeseerBoard1 sketch, added the ESP8266 sketch you linked, and wired the ESP8266 to my UNOr3 as per the attached.
        I have the ESP connected to an external 3.3v power supply, with a common ground between the UNO and the ESP.

        I changed the IP, gateway, netmask and MAC int he sketch. Also changed version of sketch.

        In the serial monitor I can communicate with the ESP and even used AT commands to connected to my AP, set IP, and can ping from my PC.

        The sketch compiles, but when I try to upload to my UNO I get a series of error messages:
        avrdude: stk500_getsybc() attempt 1 of 19: not in sync: resp=0x30

        Then alternates between resp 0x20 and 0x30.

        Googling the problem looks like a device connected to the UNO pin 0 and 1 can cause this problem. I disconnect from pins 0 and 1 on the UNO, but now has programmer not responding errors.

        I suspect the new plugin with wifi support will address, but hoping the pin 0, and pin 1 wiring might be the issue and you would have a tip to get around.

        Thanks,

        Guy
        Guy, that ESP8266-01 board is 3.3v all the way. By that I mean that you have to level shift the TX from your arduino to 3.3V before it gets to the RX pin of the ESP8266 as it is normally at 5.0v and the ESP8266 does not tolerate 5V. Only 3.3V.
        Here is a way of doing it:

        The resistors create a voltage divider to lower the level from 5.0v to 3.3v. You must remove the Arduino Atmel chip from its socket before you are able to upload a new sketch on the ESP8266.

        Also, you have to load the new ESP8266 core to the arduino IDE. Have you done that? This is the location of the new core: http://arduino.esp8266.com/staging/p...com_index.json. Go to your arduino IDE menu "File/Preferences", and add that line to the "Additional Boards Manager URL:". If you already have an address there, separate both addresses with a comma.



        Then go to the Tools menu and choose the Generic ESP8266 module.
        Last edited by luisr320; February 16, 2017, 07:31 PM.

        Comment


          V1.0.0.136 is in the Beta section of the updater and has NodeMCU I/O and LCD Support.

          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


            Originally posted by enigmatheatre View Post
            V1.0.0.136 is in the Beta section of the updater and has NodeMCU I/O and LCD Support.

            Greig.
            Hi Greig,
            this is great!
            some feedabck: I tried it, it compiles fine and NodeMCU connects fine.
            I've tried only an output so far: On, Off, and Toggle work fine.
            Blink still doesn't work
            One flash works 70% of times but not always.

            Comment


              Originally posted by doppiaemme View Post
              Hi Greig,
              this is great!
              some feedabck: I tried it, it compiles fine and NodeMCU connects fine.
              I've tried only an output so far: On, Off, and Toggle work fine.
              Blink still doesn't work
              One flash works 70% of times but not always.
              Have you set a blink time on the output time device?

              Greig.

              Sent from my SM-G925F using Tapatalk
              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


                Originally posted by enigmatheatre View Post
                Have you set a blink time on the output time device?

                Greig.

                Sent from my SM-G925F using Tapatalk
                Ah ok, the output time device was hidden, once removed the filter I found it.
                And yes it works! Once set the time both the blinking and the flash-once work.

                Very awesome job, this is getting really interesting... Are you planning to release the API version for NodeMCU as well?

                Comment


                  Originally posted by doppiaemme View Post
                  Ah ok, the output time device was hidden, once removed the filter I found it.
                  And yes it works! Once set the time both the blinking and the flash-once work.

                  Very awesome job, this is getting really interesting... Are you planning to release the API version for NodeMCU as well?
                  Yes I plan to do a API for the NodeMCU but this will take a little time to sort out.

                  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


                    Greig, thank you for the update.
                    Some feedback of the new version of the plugin.

                    I updated the plugin on Homeseer/Windows and after restarting homeseer I got the following error on the startup log:
                    PHP Code:
                    17-02-2017 12:41:33 ~!~Arduino Plugin~!~ Error Versions are not compatiblePlease update the Board Firmware version.
                    17-02-2017 12:41:34 ~!~Arduino Plugin~!~ Error Disconnected due to Version Mis-MatchStartup Complete2 errors detectedcheck the log for more information
                    This means that the sketch that is currently loaded in my Arduino UNO R3 board has the wrong version installed.
                    So I created a new sketch and after uploading it to the UNO all is well now.

                    For the NodeMCU I used an Adafruit HUZZAH board, which has a ESP8266-12. Not the cheapest bord you can get, bur this one was available for tests and worked well.





                    I had some problems initially but after some googling I found out that the juice coming from the USB/TTL adapter wasn't enough to make it run so I connected a small Lipo with 4,2V to the board and it started running. I connected a Lipo battery with about 4.2V directly to the pins GND and VBat and it started running . This board accepts 5V so it will be running fine like this. Only the digital output/inputs must be 3.3V. Of course this is not ideal and a power supply is necessary to run this specific board.

                    At this time I have managed to create an output on pin D2 in Homeseer plugin. Not all pins show up on the selecting list. I can create pins D2, D3, D4, D5, D6, D7, D9, D10.

                    For this board, this is the pin assignment:

                    PHP Code:
                    HOMESEER BOARD
                    ---------|---------
                       
                    D1    |  D5
                       D2    
                    |  D4
                       D3    
                    |  D0 (RED LED)
                       
                    D4    |  D2 (BLUE LED)
                       
                    D5    |  D14
                       D6    
                    |  D12
                       D7    
                    |  D13
                       D9    
                    |  -
                       
                    D10   |  - 
                    Note from Adafruit: "Rev A of this board has GPIO #4 and #5 swapped (the modules changed pinouts on us) so if #4/#5 aren't working for you, try swapping! We'll fix in the next PCB run"

                    According to Adafruit Pinout description (https://learn.adafruit.com/adafruit-...eakout/pinouts), there are 9 GPIO pins (#0, #2, #4, #5, #12, #13, #14, #15, #16). So the plugin is wasting 2 GPIOs on the board, #15 and # 16, and the plugin itself does not assign anything to D9 and D10 and D8 is missing on the list of available pins in the plugin.

                    Homeseer plugin D3 makes the onboard RED LED come on and OFF, and D4 does the same to the onboard BLUE LED but they are inverted. Activating the output turns the LEDs OFF. And turning the output OFF activate the LEDs.

                    All functions of the created outputs work, like blink, on, off and toggle. When you first create an output, the time slider has no value. By clicking on the slider at least once, 200ms become the pausing time for the Blink and the toggle. If you slide the time up you can go up to 5000ms.

                    The digital inputs work well also. Connecting a button between an GPIO and GND is all it takes to create an input. With the button released, all inputs show OPEN, and when pressed the show CLOSE. Connecting the button to GPIOs D0 and D2 makes the onboard LEDs turn ON and they go OFF when the button is released. A nice touch that gives some immediate feedback of your input.

                    There are no Analog Inputs to be set up on the plugin. I could only create Digital inputs. It would be nice to have some, since the board has an analog pin named "A", which can measure voltages from 0.0V to 1.0V that could be converted to a number from 0 to 1024


                    Check here for details about the ADC:
                    http://internetofhomethings.com/homethings/?tag=esp8266

                    The LCD display also works fine with this board. I'm using a regular 2X16 lines LCD, with a IC2 backpack, like this one:


                    It is connected to the LCD like this:


                    It is connected to pins #4 -> SDA, and #5 -> SCL.
                    The message displayed on the LCD may be fired by an event and is sent by Homeseer.

                    My test rig:

                    Will give more feedback as soon as any new development comes along.
                    Last edited by luisr320; February 17, 2017, 04:46 PM.

                    Comment


                      @luisr320

                      Thank you for the info. I did not realize the signals to the ESP needed to also be 3.3V. I literally received Arduino this week, wrote a basic sketch to test the unit before my ESP8266 arrived,and I did not have any of the ESP core loaded. Not since college (many decades ago) did I program CPUs without some console for feedback, so I appreciate the patience and tips. I'll look at this over the long weekend and see if I can't get it running with the guidance you provided.

                      Thanks again!

                      Guy

                      Comment


                        If people are interested in the ESP8266 they should keep an eye on it's newer bigger brother as well (ESP32). It is alot more "arduino-like" in it's features (more analog/etc). Support is still coming along and they arent as plentiful currently though but i've had pretty good luck with them in the little bit i've done with them.

                        If you want analog-io with a esp8266 though I would strongly suggest getting an external i2c ADC like ADS1115 (~$2 on ebay) as the built in one is not very good. You'd have to use the API sketch with the plugin though as there isn't support in the base sketch.

                        Comment


                          @cowsr4eating,
                          no problem. I'll keep an eye on the thread to check how you are doing.

                          Just a note regarding my setup: at this time, if I disconnect the power to the board and reconnect it back on, I loose all the input capability as well as the blink function on the output and the status of the output is not updated (but I can turn the LED ON and OFF) until I do a "Disconnect"/"Reconnect" on the Device Management Page (or the plugin config page) in Homeseer. A "Reset" won't do it, though. After that, all works back again.

                          I've sent a bug report to Greig about this.
                          Can anyone please confirm if they are having the same issues?

                          Comment


                            Originally posted by AllanMar View Post
                            If people are interested in the ESP8266 they should keep an eye on it's newer bigger brother as well (ESP32). It is alot more "arduino-like" in it's features (more analog/etc). Support is still coming along and they arent as plentiful currently though but i've had pretty good luck with them in the little bit i've done with them.

                            If you want analog-io with a esp8266 though I would strongly suggest getting an external i2c ADC like ADS1115 (~$2 on ebay) as the built in one is not very good. You'd have to use the API sketch with the plugin though as there isn't support in the base sketch.
                            The ESP32 is really interesting, with wifi and Bluetooth capability. It may well be an Arduino killer. And they have it running with the Arduino IDE. Maybe a ESP32 Arduino in in the works.

                            Comment


                              Originally posted by enigmatheatre View Post
                              Yes I plan to do a API for the NodeMCU but this will take a little time to sort out.

                              Greig.
                              Are you going to add the Dallas 1-Wire to your NodeMcu capabilities?

                              Comment


                                Originally posted by jim@beersman.com View Post
                                Are you going to add the Dallas 1-Wire to your NodeMcu capabilities?
                                Yes this is also on the list as the next thing to look at.

                                Sent from my SM-G925F using Tapatalk
                                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