Announcement

Collapse
No announcement yet.

NodeMCU with Lightning Detector

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

    NodeMCU with Lightning Detector

    Anyone try to connect this Lightning Detector to a NodeMCU:

    https://www.playingwithfusion.com/pr...ew.php?pdid=22

    When I compile the sketch for the NodeMCU I get the following error:

    exit status 1
    error compiling for board NodeMCU 1.0(ESP.12E Modules)

    If I switch to the Arduino Mega it compiles, loads, and runs fine. Any suggestions as to why it won't work with the NodeMCU?

    Rick

    #2
    i got s similar error yesterday with a standard NodeMCU board and the only way i could get it to work was by downloading the latest arduino and it worked first try (there were some notes saying there was a bug for the NodeMCU boards that was fixed in the newer versions)

    Comment


      #3
      also I found it seems you can't have a NodeMCU board as board 1 (it won't connect)? i just added board 1 with nothing on it and put the NodeMCU as board 2 and it worked fine (was on a linux box)

      Comment


        #4
        Thanks for the response..
        When you state "...Downloading the latest Arduino", are I you referring to the latest Arduino IDE??

        Rick

        Comment


          #5
          I have no problems with a nodeMCU as board 1.

          Comment


            #6
            Just to close out this thread.....The supplied sketch with the Lightning Detector has a function the NodeMCU doesn't support: #include "avr/pgmspace.h". I tried many work-arounds, to replace the function with other code, but no success.

            So I switched to an Arduino Uno, and the device works fine.

            Rick

            Comment


              #7
              If you have the SPI version please remove the old and the attached modified Library and get back to me. It should work on the Nodemcu. It compiles here but I do not have one to test.
              Attached Files
              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


                #8
                Greig;

                I loaded the modified Library. Below are the results from trying to run the sketch 2 ways. The first is when I insert the sketch into the NodeMCU API. The second is just the sketch stand-alone.

                1) The following error message is when I try to compile the SPI sketch within the NodeMCU API:

                Arduino: 1.8.1 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, 115200, 4M (3M SPIFFS)"
                In file included from C:\Users\Rick\Downloads\APIBoard6\APIBoard6.ino:16:0:
                C:\Users\Rick\Documents\Arduino\libraries\sen39001_arduino_s pi_r00/PWFusion_AS3935.h:51:26: fatal error: avr/pgmspace.h: No such file or directory
                #include "avr/pgmspace.h"

                ^

                compilation terminated.
                exit status 1
                Error compiling for board NodeMCU 1.0 (ESP-12E Module).

                _______________________________________________-


                2) The following error message is when I try to compile the sketch by itself:

                Arduino: 1.8.1 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, 115200, 4M (3M SPIFFS)"

                In file included from C:\Users\Rick\Documents\Arduino\libraries\sen39001_arduino_s pi_r00\Examples\as3935_lightning_snsr_nocal\as3935_lightning _snsr_nocal.ino:69:0:
                C:\Users\Rick\Documents\Arduino\libraries\sen39001_arduino_s pi_r00/PWFusion_AS3935.h:51:26: fatal error: avr/pgmspace.h: No such file or directory

                #include "avr/pgmspace.h"

                ^

                compilation terminated.

                exit status 1
                Error compiling for board NodeMCU 1.0 (ESP-12E Module).


                Any suggestions??

                Rick

                Comment


                  #9
                  Originally posted by Rmasci64 View Post
                  Anyone try to connect this Lightning Detector to a NodeMCU:

                  https://www.playingwithfusion.com/pr...ew.php?pdid=22

                  When I compile the sketch for the NodeMCU I get the following error:

                  exit status 1
                  error compiling for board NodeMCU 1.0(ESP.12E Modules)

                  If I switch to the Arduino Mega it compiles, loads, and runs fine. Any suggestions as to why it won't work with the NodeMCU?

                  Rick
                  Rick,

                  Sorry I missed your post. Did you get the new modified Library I attached as I can not see it and it works fine here? Try from Here

                  If not open the PWFusion_AS3935.h file that should be located in \Documents\Arduino\libraries\sen39001_arduino_spi_r00 and change the top section:

                  Code:
                  #include "Arduino.h"
                  #include "avr/pgmspace.h"
                  #include "util/delay.h"
                  #include "stdlib.h"
                  #include "SPI.h"
                  to be

                  Code:
                  #include "Arduino.h"
                  #if defined(ESP8266)
                    #include <pgmspace.h>
                   #define _delay_ms(ms) delayMicroseconds((ms) * 1000)
                  #else
                  #include "avr/pgmspace.h"
                  #include "util/delay.h"
                  #endif
                  #include "stdlib.h"
                  #include "SPI.h"
                  save it and compile again.

                  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


                    #10
                    Greig;

                    Thank you for the code. I made the change, and inserted the sketch into the NodeMCU API. The good news it now compiles, and loads! But when it executes I get continuous WatchDog Timer (WDT) reset:

                    Playing With Fusion: AS3935 Lightning Sensor, SEN-39001
                    beginning boot procedure....
                    set up for outdoor operation
                    disturber detection enabled
                    capacitance set to 8x15
                    AS3935 manual cal complete

                    Soft WDT reset

                    ctx: cont
                    sp: 3ffefac0 end: 3ffefcb0 offset: 01b0

                    >>>stack>>>
                    3ffefc70: 3ffe8a00 a501a8c0 feefeffe feefeffe
                    3ffefc80: 3fffdad0 00000000 3ffeec80 4020286b
                    3ffefc90: 3fffdad0 00000000 3ffeec80 40207950
                    3ffefca0: feefeffe feefeffe 3ffeec90 40100718
                    <<<stack<<<

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

                    load 0x4010f000, len 1384, room 16
                    tail 8
                    chksum 0x2d
                    csum 0x2d
                    v3de0c112
                    ~ld


                    I know the code runs clean on an Arduino uno. Is this another NodeMCU code difference compared to the Uno?

                    Rick

                    Comment


                      #11
                      Ah, the fun world of software! Hang in there, Rick!

                      Paul

                      Comment


                        #12
                        Originally posted by Rmasci64 View Post
                        Greig;

                        Thank you for the code. I made the change, and inserted the sketch into the NodeMCU API. The good news it now compiles, and loads! But when it executes I get continuous WatchDog Timer (WDT) reset:

                        Playing With Fusion: AS3935 Lightning Sensor, SEN-39001
                        beginning boot procedure....
                        set up for outdoor operation
                        disturber detection enabled
                        capacitance set to 8x15
                        AS3935 manual cal complete

                        Soft WDT reset

                        ctx: cont
                        sp: 3ffefac0 end: 3ffefcb0 offset: 01b0

                        >>>stack>>>
                        3ffefc70: 3ffe8a00 a501a8c0 feefeffe feefeffe
                        3ffefc80: 3fffdad0 00000000 3ffeec80 4020286b
                        3ffefc90: 3fffdad0 00000000 3ffeec80 40207950
                        3ffefca0: feefeffe feefeffe 3ffeec90 40100718
                        <<<stack<<<

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

                        load 0x4010f000, len 1384, room 16
                        tail 8
                        chksum 0x2d
                        csum 0x2d
                        v3de0c112
                        ~ld


                        I know the code runs clean on an Arduino uno. Is this another NodeMCU code difference compared to the Uno?

                        Rick
                        Rick,

                        Not sure how I can test this without the unit but I will investigate more and see what I can find.

                        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