Programming needed to enable RFM69 radio with 5100 ethernet code.



  • Can someone suggest a sketch code that would work with a sensebender_Gw. Using a RFW69 radio and a 5100 enternet.


  • Hero Member

    The example sketch included in the MySensors library should work just fine if you enable the correct radio and define the frequenzy to be used and radio hardware type if it is HW like this:

    #define MY_RADIO_RFM69
    #define MY_RFM69_FREQUENCY RF69_433MHZ
    #define MY_IS_RFM69HW
    


  • @korttoma The last line to be clear being dependent on whether using the high powered rfm69, otherwise it should be omitted or commented out...



  • Thanks the information was helpful. But I'm still hung up on the pin designators. In this code:

    // Enable debug prints to serial monitor
    #define MY_DEBUG
    
    // Enable and select radio type attached
    //#define MY_RADIO_NRF24
    #define MY_RADIO_RFM69
    
    // Enable gateway ethernet module type
    #define MY_GATEWAY_W5100
    
    // W5100 Ethernet module SPI enable (optional if using a shield/module that manages SPI_EN signal)
    #define MY_W5100_SPI_EN 4
    
    // Enable Soft SPI for NRF radio (note different radio wiring is required)
    // The W5100 ethernet module seems to have a hard time co-operate with
    // radio on the same spi bus.
    #if !defined(MY_W5100_SPI_EN) && !defined(ARDUINO_ARCH_SAMD)
    #define MY_SOFTSPI
    #define MY_SOFT_SPI_SCK_PIN 14
    #define MY_SOFT_SPI_MISO_PIN 16
    #define MY_SOFT_SPI_MOSI_PIN 15
    #endif
    
    // When W5100 is connected we have to move CE/CSN pins for NRF radio
    #ifndef MY_RF24_CE_PIN
    #define MY_RF24_CE_PIN 5
    #endif
    #ifndef MY_RF24_CS_PIN
    #define MY_RF24_CS_PIN 6
    #endif
    

    Here I'm struggling, because the Sensebender_GW does not wire the RF24 pins to pin 5 & 6 as shown in the above code (based one the Github schematic ) So as I try to understand how to code the RFM69 I'm lost as to what pins need to be defined in the sketch.

    In the old days I would simply pickup the CPU datasheet and be good to go, however the Arduino pin mapping has me completely baffled. Even after reading every variant.h on my computer!

    So I thought if someone could post the code for the same configuration I would using, I could go backwards and learn the pin mapping.


  • Hero Member

    @johnrob You should not need to edit or define any pin asigning from the example sketch.

    You might want to edit the IP address:

    #define MY_IP_ADDRESS 192,168,178,66   // If this is disabled, DHCP is used to retrieve address
    

    MAC address:

    #define MY_MAC_ADDRESS 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
    

    And define the frequenzy of your RFM69 (this is an example using the 433MHZ version):

    #define MY_RFM69_FREQUENCY RF69_433MHZ
    


  • @korttoma
    Thanks I just make the changes you suggested.
    However I'm still uncomfortable not knowing how the pins get sorted out by the software.

    JohnRob


  • Hero Member

    As far as I know all the radio pins have some kind of "default" pin assignment and only in special cases you need to reassign them. Also depending on the processor type or board type you choose in the tool the default pin assignment may differ. I think it in case of RFM69 is handled in the RFM69_old.h (someone with better knowledge please correct me if I am wrong).


Log in to reply
 

Suggested Topics

  • 1
  • 3
  • 1
  • 10
  • 1
  • 6

4
Online

11.4k
Users

11.1k
Topics

112.7k
Posts