Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. General Discussion
  3. Node ESP8266 with NFR24 and WiFi disabled

Node ESP8266 with NFR24 and WiFi disabled

Scheduled Pinned Locked Moved General Discussion
6 Posts 2 Posters 832 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    APL2017
    wrote on last edited by
    #1

    I happen to have few ESP8266 and NRF24+ laying around and would like to use ESP instead of Arduino to blend with the rest of mySensors network. I prefer WiFi disabled on ESP. Does anybody have a sample code to start with?

    mfalkviddM 1 Reply Last reply
    0
    • A APL2017

      I happen to have few ESP8266 and NRF24+ laying around and would like to use ESP instead of Arduino to blend with the rest of mySensors network. I prefer WiFi disabled on ESP. Does anybody have a sample code to start with?

      mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by
      #2

      @apl2017 I don't think I have seen anyone use esp as nodes, but it should just be a matter of wiring and setting defines like the esp gateway, except removing MY_GATEWAYXESP8266. Then add the code for the node, just like a "normal" node.

      A 1 Reply Last reply
      0
      • A Offline
        A Offline
        APL2017
        wrote on last edited by
        #3

        Thank you, I will try

        1 Reply Last reply
        0
        • A Offline
          A Offline
          APL2017
          wrote on last edited by
          #4
          This post is deleted!
          1 Reply Last reply
          0
          • mfalkviddM mfalkvidd

            @apl2017 I don't think I have seen anyone use esp as nodes, but it should just be a matter of wiring and setting defines like the esp gateway, except removing MY_GATEWAYXESP8266. Then add the code for the node, just like a "normal" node.

            A Offline
            A Offline
            APL2017
            wrote on last edited by
            #5

            @mfalkvidd

            Here is my sketch intended to detect water leak from a sensor connected to D4:

            #define MY_DEBUG
            #define MY_BAUD_RATE 9600
            #define MY_RADIO_RF24
            #include <ESP8266WiFi.h>
            #include <MySensors.h>
            #define LEAK_1_CHILD_ID 1
            #define LEAK_1_PIN D4
            bool LEAK_1;
            bool last_LEAK_1;
            MyMessage msg_LEAK_1(LEAK_1_CHILD_ID,V_TRIPPED);

            void setup()
            {
            pinMode(LEAK_1_PIN,INPUT);
            digitalWrite(LEAK_1_PIN,HIGH);
            WiFi.mode( WIFI_OFF );
            WiFi.forceSleepBegin();
            }

            void presentation()
            {
            present(LEAK_1_CHILD_ID, S_DOOR);
            }

            void loop()
            {
            LEAK_1 =digitalRead(LEAK_1_PIN);
            if (LEAK_1 != last_LEAK_1)
            {
            send(msg_LEAK_1.set(LEAK_1));
            last_LEAK_1 = LEAK_1;
            }
            }

            Here is what I am reading over serial interface. After seems to be successful initial communication, ESP gets stack on not getting ACK from the radio. Any idea why?

            189 MCO:BGN:INIT NODE,CP=RNNNE---,REL=255,VER=2.3.1
            377 TSM:INIT
            391 TSF:WUR:MS=0
            414 TSM:INIT:TSP OK
            435 TSF:SID:OK,ID=102
            458 TSM:FPAR
            508 TSF:MSG:SEND,102-102-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
            1262 TSF:MSG:READ,0-0-102,s=255,c=3,t=8,pt=1,l=1,sg=0:0
            1320 TSF:MSG:FPAR OK,ID=0,D=1
            2585 TSM:FPAR:OK
            2602 TSM:ID
            2615 TSM:ID:OK
            2631 TSM:UPL
            2649 TSF:MSG:SEND,102-102-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
            2724 TSF:MSG:READ,0-0-102,s=255,c=3,t=25,pt=1,l=1,sg=0:1
            2784 TSF:MSG:PONG RECV,HP=1
            2813 TSM:UPL:OK
            2830 TSM:READY:ID=102,PAR=0,DIS=1
            2867 TSF:MSG:SEND,102-102-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
            2946 TSF:MSG:READ,0-0-102,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
            3013 TSF:MSG:SEND,102-102-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.3.1
            3094 TSF:MSG:SEND,102-102-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
            5170 TSF:MSG:SEND,102-102-0-0,s=1,c=0,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
            5241 MCO:REG:REQ
            5263 TSF:MSG:SEND,102-102-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
            5339 TSF:MSG:READ,0-0-102,s=255,c=3,t=27,pt=1,l=1,sg=0:1
            5398 MCO:PIM:NODE REG=1
            5424 MCO:BGN:STP
            force slp enable,type: 2
            fpm open,type:2 0
            5443 MCO:BGN:INIT OK,TSP=1
            7768 !TSF:MSG:SEND,102-102-0-0,s=1,c=1,t=16,pt=1,l=1,sg=0,ft=0,st=NACK:1

            mfalkviddM 1 Reply Last reply
            0
            • A APL2017

              @mfalkvidd

              Here is my sketch intended to detect water leak from a sensor connected to D4:

              #define MY_DEBUG
              #define MY_BAUD_RATE 9600
              #define MY_RADIO_RF24
              #include <ESP8266WiFi.h>
              #include <MySensors.h>
              #define LEAK_1_CHILD_ID 1
              #define LEAK_1_PIN D4
              bool LEAK_1;
              bool last_LEAK_1;
              MyMessage msg_LEAK_1(LEAK_1_CHILD_ID,V_TRIPPED);

              void setup()
              {
              pinMode(LEAK_1_PIN,INPUT);
              digitalWrite(LEAK_1_PIN,HIGH);
              WiFi.mode( WIFI_OFF );
              WiFi.forceSleepBegin();
              }

              void presentation()
              {
              present(LEAK_1_CHILD_ID, S_DOOR);
              }

              void loop()
              {
              LEAK_1 =digitalRead(LEAK_1_PIN);
              if (LEAK_1 != last_LEAK_1)
              {
              send(msg_LEAK_1.set(LEAK_1));
              last_LEAK_1 = LEAK_1;
              }
              }

              Here is what I am reading over serial interface. After seems to be successful initial communication, ESP gets stack on not getting ACK from the radio. Any idea why?

              189 MCO:BGN:INIT NODE,CP=RNNNE---,REL=255,VER=2.3.1
              377 TSM:INIT
              391 TSF:WUR:MS=0
              414 TSM:INIT:TSP OK
              435 TSF:SID:OK,ID=102
              458 TSM:FPAR
              508 TSF:MSG:SEND,102-102-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
              1262 TSF:MSG:READ,0-0-102,s=255,c=3,t=8,pt=1,l=1,sg=0:0
              1320 TSF:MSG:FPAR OK,ID=0,D=1
              2585 TSM:FPAR:OK
              2602 TSM:ID
              2615 TSM:ID:OK
              2631 TSM:UPL
              2649 TSF:MSG:SEND,102-102-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
              2724 TSF:MSG:READ,0-0-102,s=255,c=3,t=25,pt=1,l=1,sg=0:1
              2784 TSF:MSG:PONG RECV,HP=1
              2813 TSM:UPL:OK
              2830 TSM:READY:ID=102,PAR=0,DIS=1
              2867 TSF:MSG:SEND,102-102-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
              2946 TSF:MSG:READ,0-0-102,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
              3013 TSF:MSG:SEND,102-102-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.3.1
              3094 TSF:MSG:SEND,102-102-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
              5170 TSF:MSG:SEND,102-102-0-0,s=1,c=0,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
              5241 MCO:REG:REQ
              5263 TSF:MSG:SEND,102-102-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
              5339 TSF:MSG:READ,0-0-102,s=255,c=3,t=27,pt=1,l=1,sg=0:1
              5398 MCO:PIM:NODE REG=1
              5424 MCO:BGN:STP
              force slp enable,type: 2
              fpm open,type:2 0
              5443 MCO:BGN:INIT OK,TSP=1
              7768 !TSF:MSG:SEND,102-102-0-0,s=1,c=1,t=16,pt=1,l=1,sg=0,ft=0,st=NACK:1

              mfalkviddM Offline
              mfalkviddM Offline
              mfalkvidd
              Mod
              wrote on last edited by mfalkvidd
              #6

              @apl2017 on the öast message, the node is not getting ack from the next node. The mose common cause is i sufficiently clean power supply. What size of capacitor are you using? How is the radio getting its power?
              Adding wait(200) before the send call can help the power to stabilize.

              Since all communication before works, wiring and everything else should be ok.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              12

              Online

              11.7k

              Users

              11.2k

              Topics

              113.0k

              Posts


              Copyright 2019 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • MySensors
              • OpenHardware.io
              • Categories
              • Recent
              • Tags
              • Popular