Announcement

Collapse
No announcement yet.

ESP8266 - Proof of Concept

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

  • #31
    Allan

    I tried the code on a "Wemo D1" device and didnt have a lot of success, I could see in the debug HS trying to connect to the device, the device responded and then the plugin kept sending connects. The device has the same chip as the ESP8266..I remember having these kinds of issues in the early days of Arduino and Ethernet boards...

    I've got a spare ESP8266 board and load the code up on that to try. The board you've tried it on with success, mine is still in transit 2 months later !

    Pete
    HS 2.2.0.11

    Comment


    • #32
      Originally posted by petez69 View Post
      Allan

      I tried the code on a "Wemo D1" device and didnt have a lot of success, I could see in the debug HS trying to connect to the device, the device responded and then the plugin kept sending connects. The device has the same chip as the ESP8266..I remember having these kinds of issues in the early days of Arduino and Ethernet boards...

      I've got a spare ESP8266 board and load the code up on that to try. The board you've tried it on with success, mine is still in transit 2 months later !

      Pete
      Does the serial console show anything?

      Theres a good chance its doing a WDT reset.
      I found a bug in the ESP8266 Arduino Library:
      https://github.com/esp8266/Arduino/issues/1796

      I believe it's been merged in to the latest (2.2.0). So open up the Arduino board manager and try updating it.

      Funny enough, i'm waiting on my Wemos to come in the mail!
      Last edited by AllanMar; April 18th, 2016, 07:49 PM.

      Comment


      • #33
        Heh heh Allan always one step ahead, didnt think of a library upgrade. I'll have a peek this evening.

        Thks..pete
        HS 2.2.0.11

        Comment


        • #34
          Allan

          Have upgraded the board in the boards manager and compiled. Serial console repeats with this message:

          ets Jan 8 2013,rst cause:2, boot mode3,7)

          load 0x4010f000, len 1264, room 16
          tail 0
          chksum 0x0f
          csum 0x0f
          ~ld

          Soft WDT reset

          ctx: cont
          sp: 3fff0140 end: 3fff03b0 offset: 01b0

          >>>stack>>>
          3fff02f0: 00000000 3fffdad0 3ffef384 00000030
          3fff0300: 00000009 3ffeecf8 3ffef078 402055cc
          3fff0310: 40105a78 0011cf1b 3ffef078 40205612
          3fff0320: 00000001 3ffef078 3ffef078 40205651
          3fff0330: 0000002d 180ba8c0 00000064 40205a08
          3fff0340: 4020165a 000003e8 000003e8 3ffef384
          3fff0350: 3fffdad0 00000000 3ffef078 402056c0
          3fff0360: 3fffdad0 00000000 3ffef078 40202ed3
          3fff0370: 3ffe8750 180ba8c0 3ffef37c 40205a08
          3fff0380: 00000000 00000000 3ffef37c 40202f05
          3fff0390: 3fffdad0 00000000 3ffef37c 402059dc
          3fff03a0: feefeffe feefeffe 3ffef390 40100718
          <<<stack<<<

          ets Jan 8 2013,rst cause:2, boot mode3,7)

          load 0x4010f000, len 1264, room 16
          tail 0
          chksum 0x0f
          csum 0x0f
          ~ld

          That is with the board set to WEMOS D1 R2 & Mini...boards manager 2.2.0

          Are you using the bog standard 1.0.0 wifi library ?

          Thanks..Pete
          HS 2.2.0.11

          Comment


          • #35
            That still sounds like the issue I had with the library bug.

            The WiFi library comes with the boards package (not sure what version).
            I'll try this evening with 2.2.0 (I only tried a patch I made), see if I can see what's going on.

            Are you using my example exactly? If not, post what your using just so I can be sure.

            Unfortunately my Arduino plugin expired, so it may be a bit tricky to test.

            Comment


            • #36
              Allan.. I'm using your example with only the network settings changed

              Sent from my Nexus 7 using Tapatalk
              HS 2.2.0.11

              Comment


              • #37
                following this,

                i made some boards up for porgramming the really cheap versions of these:
                https://www.facebook.com/RaptorsIrra...27821017347332

                have not found the time to actually use the chips yet
                HS3 Pro on Windows 8 64bit
                53 Z-wave nodes(46 devices, 7 remotes), 15 DS10a's, 10 ms16a's, 9 Oregon Sensors, W800, RFXCOMtrx433, Way2Call, 3 HSTouch Clients, 2xRussound CAS44, Global Cache GC100-12,10 Rollertrol blinds(+ zwave) ,3 Squeezebox Radios and 1 Squeezebox Boom,DMX Arduino via ethernet,Rain8Net,3x Echo Dot's


                Check out my electronics blog here:
                https://www.facebook.com/RaptorsIrrationalInventions

                Comment


                • #38
                  Looks like he just moved some of my changes into the underlying code:
                  https://github.com/esp8266/Arduino/c...4f87f74eafa3c7

                  I'll investigate further tonight, I think what i'll do is just add my own parseInt function to the plugin sketch if this is still a problem (make it simpler for people for now).
                  Last edited by AllanMar; April 19th, 2016, 09:23 AM.

                  Comment


                  • #39
                    Allan

                    Thanks mate, yes I did see that commit last night and I went back through the source in 2.2.0 on my machine and it was there...
                    HS 2.2.0.11

                    Comment


                    • #40
                      Looking now actually...

                      It does appear to be the same parseInt problem, but I can't figure out why that fix doesn't work!

                      BTW what arduino version are you using? Since updating to V2.2.0 i'm having a hell of a time getting it to compile properly (had to add function declarations, which arent supposed to be required with arduino).

                      Comment


                      • #41
                        Originally posted by Raptor View Post
                        following this,

                        i made some boards up for porgramming the really cheap versions of these:
                        https://www.facebook.com/RaptorsIrra...27821017347332

                        have not found the time to actually use the chips yet
                        Raptor, I've bought these to use.. $2.14AUD each

                        HS 2.2.0.11

                        Comment


                        • #42
                          Originally posted by petez69 View Post
                          Allan

                          Thanks mate, yes I did see that commit last night and I went back through the source in 2.2.0 on my machine and it was there...
                          So after going in circles for a bit I finally found the issue here!
                          In ESP8266 char defaults to UNSIGNED, but the Arduino lib appears to have been written as if it was signed (like AVR).
                          Code:
                           char peek()
                              {
                                  if (!_rx_buf || _rx_buf_offset == _rx_buf->len)
                                      return -1;
                          
                                  return reinterpret_cast<char*>(_rx_buf->payload)[_rx_buf_offset];
                              }
                          This gets changed to 255 which causes an infinite loop in peekNextDigit.

                          I'll raise a github issue, i'm not sure what the best fix is (force ESP8266 to use signed char, or simply change the UDP lib).

                          For now, a cheap workaround is to:
                          in libraries\ESP8266WiFi\src\include\UdpContext.h
                          Change:
                          char peek()
                          to
                          signed char peek()

                          Comment


                          • #43
                            OK Allan, how did you debug this :-) ;-) I'm not a coder but can generally get my way around things so I'm always interested to learn techniques.. !!!

                            Works like a charm.....perfect

                            Cant thank you enough mate, this has opened up so much fun on HS, where do I start :-)

                            Pete...
                            HS 2.2.0.11

                            Comment


                            • #44
                              Thanks for the tip, I'll be trying these out.
                              HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
                              Running on Windows 10 (64) virtualized
                              on ESXi (Fujitsu Primergy TX150 S8).
                              WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

                              Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

                              Comment


                              • #45
                                Originally posted by petez69 View Post
                                OK Allan, how did you debug this :-) ;-) I'm not a coder but can generally get my way around things so I'm always interested to learn techniques.. !!!

                                Works like a charm.....perfect

                                Cant thank you enough mate, this has opened up so much fun on HS, where do I start :-)

                                Pete...
                                Trial and error mostly.... I'm also not a programmer!
                                The proper way would be with a JTAG and being able to step through the code.

                                In hindsight this fix isn't great because -1 is a valid number for a signed char (so if the data contains a -1 this may also fail). It works fine for us though because the Arduino plugin is using ASCII messages. I imagine there will be a proper fix from a real programmer soon though.

                                ESP8266 is very interesting because not only is it cheap, but its significantly more powerful. I see lots of requests for features that the arduino is too limited to include, but ESP8266 could include all kinds of support in the default sketch.

                                Now that there's some interested i'll look at cleaning this up and getting the other stuff supported (servos/etc).

                                Comment

                                Working...
                                X