Announcement

Collapse
No announcement yet.

ESP8266 - Proof of Concept

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

    #16
    Yeah man (though I'm going to use a pn532), is itlossi lie to set a device string in Json?

    Comment


      #17
      Very easy to send to HS..

      To Send Data to Homeseer use SendToHS(Device,Value)

      The device is one that you have defined in the plugin on your homeseer system, its value can be the "long" which is the KEYFOB ID.

      I rebuilt my arduino system and darn lost the Board API that I'm using for the wiegand. I have a new reader that should be here shortly and I'll build some different code and post...

      Pete
      HS 2.2.0.11

      Comment


        #18
        Originally posted by AllanMar View Post
        For those not aware the ESP8266 is a small, quite powerful Wifi microcontroller. It is now able to be programmed via Arduino and has replaced Arduinos in most of my projects (even ones not requiring Wifi).

        There are alot of impressive features that make it ideal for use with the plugin:
        • Wifi!
        • Cheap! ~$5US for dev kit
        • Possible to reload firmware wirelessly.
        • 4M Flash memory
        • Can run a webserver/MQTT/etc.
        • 1 Analog In (poor)
        • PWM support on all pins.
        • I2C, OneWire, 2 UART, SPI
        • 12 GPIO on NodeMCU Dev kit.

        Attached is the plugin sketch i hacked up a bit to run on the ESP8266. To program it via arduino you'll have to add the board/follow the instructions here:
        https://github.com/esp8266/Arduino#i...boards-manager

        There's alot of different ESP8266 products out there, but for something Arduino like I'd suggest the NodeMCU dev kit (V1.0).


        Keep in mind the ESP8266 is 3.3V I/O, where as most Arduinos are 5V.
        The ESP8266 Analog input is pretty poor (and only 1CH). I'm going to look at using an external ADC instead...

        In the attached sketch OW pin is NOT configurable and hardcoded to 10 (SD3).
        So far I've only tested Digital Input/Output, LCD and OneWire but it seems to work well.

        I thought i'd share this see if there's much interest and possible consideration for official support in the plugin. (I'd be happy to help clean up the Arduino code).
        Allan

        How's the tinkering going ? Have you found the units to stay reliably connected to wifi and HS ?

        Mine haven't arrived as yet :-(

        Pete

        Sent from my Nexus 7 using Tapatalk
        HS 2.2.0.11

        Comment


          #19
          I haven't been using this with the arduino plugin currently (I have no actual real use yet). I use ESP8266's for other things though and I've found them stable in general.
          I don't really use actually Arduino's for anything anymore, i prefer these for pretty much every use.

          Comment


            #20
            Originally posted by AllanMar View Post
            I haven't been using this with the arduino plugin currently (I have no actual real use yet). I use ESP8266's for other things though and I've found them stable in general.
            I don't really use actually Arduino's for anything anymore, i prefer these for pretty much every use.
            Thanks Allan

            Are you accepting interrupts on these and sending to HS or sending commands to it ?
            HS 2.2.0.11

            Comment


              #21
              Hi Allan

              What onewire library are you using ? I keep getting compile errors

              OneWire.h:77:2: error: #error "Please define I/O register types here"

              I've put the arduino onewire library folder into the sketch folder and keep getting the same errors, bit of googling suggests its a library issue ?

              Ta Pete

              Board option for compile is generic ESP8266
              HS 2.2.0.11

              Comment


                #22
                Originally posted by petez69 View Post
                Hi Allan

                What onewire library are you using ? I keep getting compile errors

                OneWire.h:77:2: error: #error "Please define I/O register types here"

                I've put the arduino onewire library folder into the sketch folder and keep getting the same errors, bit of googling suggests its a library issue ?

                Ta Pete

                Board option for compile is generic ESP8266
                Just the standard Arduino library manager one. Sounds like your using an old version before ESP8266 support was added (no ESP8266 defines in OneWire.h). Use the library manager and update it V2.3.2 is what I use.

                Comment


                  #23
                  Hi Allan

                  That fixed it, thankyou :-) I've just got the USB/TTL device tied up with a SIM900 GSM unit, thats been fun.. Once I get a response from "BeeryGaz" to sort a small issue I'll get back and upload the code and give it a go..

                  Thanks..Pete
                  HS 2.2.0.11

                  Comment


                    #24
                    Originally posted by petez69 View Post
                    Hi Allan

                    That I think has fixed it, suspect I updated the LiquidCrystal library by accident and now its having a spit...

                    Could you please have a look at what LiquidCrystal_I2C library and version you have installed....

                    Thanks..Pete
                    I can't check at the moment but I believe I had to use the one that is included with the Arduino plugin. It's a bit different than the library manager one, I didn't look in to it much

                    Comment


                      #25
                      All sorted Allan....thankyou.. compiles fine...

                      I've just got the 1 unit turning I/O and and off via example webserver code, having HS call immediate command..works fairly reliably.

                      I'll solder up the other unit and load up the code.

                      Pete
                      HS 2.2.0.11

                      Comment


                        #26
                        Hi Guys,

                        This looks interesting. Are you saying my code compiles and runs on the boards or are you running different code. I would add support to the plugin if it is easy enough and there is not to many changes to the code.

                        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


                          #27
                          Originally posted by enigmatheatre View Post
                          Hi Guys,

                          This looks interesting. Are you saying my code compiles and runs on the boards or are you running different code. I would add support to the plugin if it is easy enough and there is not to many changes to the code.

                          Greig.
                          With some small modifications, see my first post. I don't think it would be very hard to make one file that compiles for both AVR/ESP8266.

                          Have to do some changes for SoftPWM (ESP8266 is already softpwm on all pins). EEPROM is also slightly different so I couldn't get the OneWire to read the pin from EEPROM (possibly use a custom OneWire lib that allows setting pins at runtime).

                          This was meant just to be an example, if you are interested in supporting i'll have another look and try to clean it up and test the remaining (Servo, PWM).

                          The pin assignment is a bit different, and ideally the plugin should allow for setting SSID/PSK.

                          Comment


                            #28
                            Originally posted by AllanMar View Post
                            With some small modifications, see my first post. I don't think it would be very hard to make one file that compiles for both AVR/ESP8266.

                            Have to do some changes for SoftPWM (ESP8266 is already softpwm on all pins). EEPROM is also slightly different so I couldn't get the OneWire to read the pin from EEPROM (possibly use a custom OneWire lib that allows setting pins at runtime).

                            This was meant just to be an example, if you are interested in supporting i'll have another look and try to clean it up and test the remaining (Servo, PWM).

                            The pin assignment is a bit different, and ideally the plugin should allow for setting SSID/PSK.
                            Ok this sounds like we could put something together. Adding the SSID/PSK should be fine and I guess I could include the new sketch just for the ESP8266 if I add a board selection option.
                            I have a couple on the way but I can not get the code to compile in the IDE at the moment so will have to look in to this further.

                            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


                              #29
                              Originally posted by enigmatheatre View Post
                              Ok this sounds like we could put something together. Adding the SSID/PSK should be fine and I guess I could include the new sketch just for the ESP8266 if I add a board selection option.
                              I have a couple on the way but I can not get the code to compile in the IDE at the moment so will have to look in to this further.

                              Greig.
                              Not even with the modified sketch in my first post?

                              Comment


                                #30
                                Originally posted by AllanMar View Post
                                Not even with the modified sketch in my first post?
                                No that is what I am using. I will give it another go tonight.

                                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