Help needed to setup a RFM69 & ESP8266 Gateaway on Adafruit Feather Huzzah



  • Hello, i'm trying to setup a gateaway on ESP8266 like explained in https://www.mysensors.org/build/esp8266_gateway but i don't have a NodeMCU or Wemos D1 Mini.

    I have an Adafruit Huzzah Feather and i can't figure out what pins to use for connecting to DIO0 and NSS on the RFM69 even though my sketch compiles and uploads correctly .

    Anyone can help, or have a working GatewayESP8266.ino for the Huzzah ?

    Many thanks !



  • Here is what i have tried:
    I try using GPIO 2 and 15 to pilot the RFM69

    here an extract of my GatewayESP8266.ino

    // Enable debug prints to serial monitor
    #define MY_DEBUG
    
    // Use a bit lower baudrate for serial prints on ESP8266 than default in MyConfig.h
    #define MY_BAUD_RATE 9600
    
    // Enables and select radio type (if attached)
    //#define MY_RADIO_RF24
    #define MY_RADIO_RFM69
    
    #define MY_IS_RFM69HW // Omit if your RFM is not "H"
    #define MY_RFM69_IRQ_PIN 2
    #define MY_RFM69_IRQ_NUM MY_RFM69_IRQ_PIN
    #define MY_RFM69_CS_PIN 15 // NSS. Use MY_RFM69_SPI_CS for older versions (before 2.2.0)
    
    ../..
    
    void setup()
    {
       pinMode(MY_RFM69_IRQ_PIN, OUTPUT);
       pinMode(MY_RFM69_CS_PIN, OUTPUT);
    
    	// Setup locally attached sensors
    }
    
    ../..
    
    void loop()
    {
    	// Send locally attached sensors data here
      digitalWrite(MY_RFM69_IRQ_PIN, HIGH);
    delay(1000);
    digitalWrite(MY_RFM69_IRQ_PIN, LOW);
    delay(1000);
    }
    

    What's going wrong is i need to unplug the wire to GPIO2 at boot time unless it won't boot
    then if i do that and replug the wire after boot, TFM is not initialized properly and
    i get this log:

    MCO:BGN:INIT GW,CP=RRNGE---,FQ=80,REL=255,VER=2.3.2
    114 TSF:LRT:OK
    130 TSM:INIT
    143 TSF:WUR:MS=0
    163 TSM:INIT:TSP OK
    184 TSM:INIT:GW MODE
    206 TSM:READY:ID=0,PAR=0,DIS=0
    238 MCO:REG:NOT NEEDED
    scandone
    1311 GWT:TIN:CONNECTING...
    2339 GWT:TIN:CONNECTING...
    scandone
    state: 0 -> 2 (b0)
    state: 2 -> 3 (0)
    state: 3 -> 5 (10)
    add 0
    aid 2
    
    connected with TPLINK_BUREAU, channel 1
    dhcp client start...
    cnt 
    3168 GWT:TIN:CONNECTING...
    ip:192.168.1.50,mask:255.255.255.0,gw:192.168.1.1
    4329 GWT:TIN:CONNECTING...
    4357 GWT:TIN:IP: 192.168.1.50
    4389 MCO:BGN:STP
    pm open,type:2 0
    14407 MCO:BGN:INIT OK,TSP=1
    14436 TSM:READY:NWD REQ
    15462 ?TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK:
    
    

    My knowlegde in electronics is level zero unfortunalty
    The adafruit Huzzah documentation states that
    GPIO #2, is also used to detect boot-mode. It also is connected to the blue LED that is near the WiFi antenna. It has a pullup resistor connected to it, and you can use it as any output (like #0) and blink the blue LED.

    So i thought i could wire directly GPIO2 to DIO0 on the RFM69 like explained https://www.mysensors.org/build/connect_radio but obviously i do something wrong

    Please Help 🙂



  • I guess this means i finally managed to get it working:

    4131 MCO:BGN:STP
    4133 MCO:BGN:INIT OK,TSP=1
    4135 TSM:READY:NWD REQ
    4139 ?TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK:
    pm open,type:2 0
    30149 TSF:MSG:READ,5-5-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    30155 TSF:MSG:BC
    30157 TSF:MSG:FPAR REQ,ID=5
    30159 TSF:PNG:SEND,TO=0
    30161 TSF:CKU:OK
    30163 TSF:MSG:GWL OK
    30641 TSF:MSG:SEND,0-0-5-5,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0
    32650 TSF:MSG:READ,5-5-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
    32655 TSF:MSG:PINGED,ID=5,HP=1
    
    

  • Mod

    Nice work @hlehoux
    Is there any information we could add to the radio connection page to help other Feather users?



  • @mfalkvidd

    Hello, certainly yes; anyhow, my setup is quite experimental yet:

    • my antenna setup is quite bad, i loose radio messages or don't receive Ack from the gateway (my bad, i have 868 MHz RFM69 and ordered antennas for 433 MHz)
    • i can confirm it works with NSS on pin GPIO#15 and IRQ_PIN on GPIO#0 orGPIO#2
    • i have not resolved yet the problem of GPIO#0 and GPIO#2 being used by ESP8266 to detect boot-mode so you have to connect the pin after booting which is very annoying
      There are articles like this one https://www.instructables.com/id/ESP8266-Using-GPIO0-GPIO2-as-inputs/ but i'm quite newbie in electronics...

    I will post more details when my config is better.


  • Mod

    @hlehoux is there a reason you can't use gpio5 for irq? That's what I used on a different esp board when verifying the instructions on https://www.mysensors.org/build/connect_radio



  • @mfalkvidd Well i'm not sure, on [huzzah pinout](link url) GPIO#4 and GPIO#5 are described about I2C SDA & SCL and GPIO #12/13/14 are the same as SCK/MOSI/MISO so i thought would be better not to use them.

    I will try and report back.

    Seems to me (first try) that GPIO#2 works well, provided you connect it both to VCC (it has a pullup resistor ) to avoid boot-mode and to IRQ


Log in to reply
 

Suggested Topics

  • 5
  • 14
  • 4
  • 27
  • 26
  • 12
  • 3

4
Online

9.4k
Users

10.0k
Topics

104.4k
Posts