Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. firstof9
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    firstof9

    @firstof9

    3
    Reputation
    14
    Posts
    321
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    firstof9 Follow

    Best posts made by firstof9

    • RE: [RESOLVED] Problems connecting node to gateway

      Got it working it was this bit causing issues:

      // W5100 Ethernet module SPI enable (optional if using a shield/module that manages SPI_EN signal)
      #define MY_W5100_SPI_EN 4
      

      removing that fixed it

      Also as my gateway was having issues freaking out when receving radio packets I also modified my ethernet.h per this post:
      https://forum.mysensors.org/topic/5109/solved-rfm69-based-nodes-unable-to-report-lib-version/26

      and changed the following:

      #define MY_DEFAULT_ERR_LED_PIN A0  // Error led pin
      #define MY_DEFAULT_RX_LED_PIN  A1  // Receive led pin
      #define MY_DEFAULT_TX_LED_PIN  A2  // Transmit led pin
      

      Thank you all for your suggestions.

      posted in Troubleshooting
      firstof9
      firstof9
    • RE: New RFM69 driver error

      @scalz
      Your modifications seemed to have resolved the issue.

      Also I've made this modification to MyTransport.cpp so it resets the radio on init:

      void stInitTransition(void)
      {
      	#if defined(ADAFRUIT_RFM69)
      	pinMode(9, OUTPUT);
      	digitalWrite(9, HIGH);
      	delay(100);
      	digitalWrite(9, LOW);
      	delay(100);
      	#endif
      	TRANSPORT_DEBUG(PSTR("TSM:INIT\n"));
      

      Sketch for reference:

      // Enable debug prints to serial monitor
      #define MY_DEBUG
      
      // Enable Adafruit RFM69 breakout fix
      #define ADAFRUIT_RFM69
      
      // Enable and select radio type attached
      #define MY_RADIO_RFM69
      
      #define MY_RFM69_NEW_DRIVER // ATC on RFM69 works only with the new driver
      #define MY_RFM69_ATC_TARGET_RSSI_DBM (-70)  // target RSSI -70dBm
      #define MY_RFM69_MAX_POWER_LEVEL_DBM (10) // amx. TX power 10dBm = 10mW
      
      #define MY_IS_RFM69HW  // Mandatory if you radio module is the high power version (RFM69HW and RFM69HCW), Comment it if it's not the case
      #define MY_RF69_FREQUENCY RFM69_915MHZ  // Define for frequency setting. Needed if you're radio module isn't 868Mhz (868Mhz is default in lib)
      
      #define MY_RF69_SPI_CS 4
      #define MY_RF69_IRQ_PIN 2
      //#define MY_RF69_IRQ_NUM 0
      
      //#define W5100SPIPATCH
      
      #define SKETCH_NAME "MySensors Ethernet Gateway"
      #define SKETCH_MAJOR "0"
      #define SKETCH_MINOR "5"
      
      // How many clients should be able to connect to this gateway (default 1)
      #define MY_GATEWAY_MAX_CLIENTS 2
      
      // Enable gateway ethernet module type
      #define MY_GATEWAY_W5100
      
      // 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 15
        #define MY_SOFT_SPI_MOSI_PIN 16
      #endif  
      
      // Enable to UDP
      //#define MY_USE_UDP
      
      #define MY_IP_ADDRESS 192,168,1,204   // If this is disabled, DHCP is used to retrieve address
      // Renewal period if using DHCP
      //#define MY_IP_RENEWAL_INTERVAL 60000
      // The port to keep open on node server mode / or port to contact in client mode
      #define MY_PORT 5003
      
      // Controller ip address. Enables client mode (default is "server" mode).
      // Also enable this if MY_USE_UDP is used and you want sensor data sent somewhere.
      //#define MY_CONTROLLER_IP_ADDRESS 192, 168, 178, 254
      
      // The MAC address can be anything you want but should be unique on your network.
      // Newer boards have a MAC address printed on the underside of the PCB, which you can (optionally) use.
      // Note that most of the Ardunio examples use  "DEAD BEEF FEED" for the MAC address.
      #define MY_MAC_ADDRESS 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
      
      // Enable inclusion mode
      #define MY_INCLUSION_MODE_FEATURE
      // Enable Inclusion mode button on gateway
      //#define MY_INCLUSION_BUTTON_FEATURE
      // Set inclusion mode duration (in seconds)
      #define MY_INCLUSION_MODE_DURATION 60
      // Digital pin used for inclusion mode button
      //#define MY_INCLUSION_MODE_BUTTON_PIN  3
      
      // Set blinking period
      #define MY_DEFAULT_LED_BLINK_PERIOD 300
      
      // Flash leds on rx/tx/err
      // Uncomment to override default HW configurations
      //#define MY_DEFAULT_ERR_LED_PIN 5  // Error led pin
      #define MY_DEFAULT_RX_LED_PIN  6  // Receive led pin
      //#define MY_DEFAULT_TX_LED_PIN  7  // Transmit led pin
      
      #if defined(MY_USE_UDP)
      #include <EthernetUdp.h>
      #endif
      #include <Ethernet.h>
      #include <MySensors.h>
      
      void presentation()  
      { 
        // Send the sketch version information to the gateway
        sendSketchInfo(SKETCH_NAME, SKETCH_MAJOR"."SKETCH_MINOR);
      }
      
      void setup()
      {
      }
      
      void loop()
      {
      }
      
      posted in Troubleshooting
      firstof9
      firstof9
    • RE: New RFM69 driver error

      @scalz
      I've updated my sketch to include that for the new driver. Thank you.
      I had to use that mod for the older driver.

      posted in Troubleshooting
      firstof9
      firstof9

    Latest posts made by firstof9

    • RE: New RFM69 driver error

      @scalz Sorry, your changes fixed my OP problem with the compile errors. I forgot to follow up noting the TSP INIT fails and switching back to the old driver 😞

      posted in Troubleshooting
      firstof9
      firstof9
    • RE: New RFM69 driver error

      @scalz Negitive my issue persists using the new driver. I've had to revert back to the old driver to get around this SANCHK FAIL. Same wiring same radios using older driver work perfectly fine.

      I read some where that the issue is resolved in beta version of 2.2.1.

      posted in Troubleshooting
      firstof9
      firstof9
    • RE: New RFM69 driver error

      Jumped the gun on a "fixed" post 😞

      posted in Troubleshooting
      firstof9
      firstof9
    • RE: New RFM69 driver error

      @scalz Trying to update all my nodes to the new driver, getting this on the gateway now:

      0 MCO:BGN:INIT GW,CP=RPNGA---,VER=2.2.0
      3 TSM:INIT
      4 TSF:WUR:MS=0
      5 RFM69:INIT
      11 RFM69:INIT:PIN,CS=4,IQP=2,IQN=0,RST=9
      116 RFM69:PTX:LEVEL=5 dBm
      118 !RFM69:INIT:SANCHK FAIL
      120 !TSM:INIT:TSP FAIL
      122 TSM:FAIL:CNT=1
      124 TSM:FAIL:DIS
      126 TSF:TDI:TSL
      128 RFM69:RSL
      

      Same sketch as previously posted (with RFM69 verbose defined for more info). Any ideas?

      posted in Troubleshooting
      firstof9
      firstof9
    • RE: New RFM69 driver error

      @scalz
      I've updated my sketch to include that for the new driver. Thank you.
      I had to use that mod for the older driver.

      posted in Troubleshooting
      firstof9
      firstof9
    • RE: New RFM69 driver error

      @scalz
      Your modifications seemed to have resolved the issue.

      Also I've made this modification to MyTransport.cpp so it resets the radio on init:

      void stInitTransition(void)
      {
      	#if defined(ADAFRUIT_RFM69)
      	pinMode(9, OUTPUT);
      	digitalWrite(9, HIGH);
      	delay(100);
      	digitalWrite(9, LOW);
      	delay(100);
      	#endif
      	TRANSPORT_DEBUG(PSTR("TSM:INIT\n"));
      

      Sketch for reference:

      // Enable debug prints to serial monitor
      #define MY_DEBUG
      
      // Enable Adafruit RFM69 breakout fix
      #define ADAFRUIT_RFM69
      
      // Enable and select radio type attached
      #define MY_RADIO_RFM69
      
      #define MY_RFM69_NEW_DRIVER // ATC on RFM69 works only with the new driver
      #define MY_RFM69_ATC_TARGET_RSSI_DBM (-70)  // target RSSI -70dBm
      #define MY_RFM69_MAX_POWER_LEVEL_DBM (10) // amx. TX power 10dBm = 10mW
      
      #define MY_IS_RFM69HW  // Mandatory if you radio module is the high power version (RFM69HW and RFM69HCW), Comment it if it's not the case
      #define MY_RF69_FREQUENCY RFM69_915MHZ  // Define for frequency setting. Needed if you're radio module isn't 868Mhz (868Mhz is default in lib)
      
      #define MY_RF69_SPI_CS 4
      #define MY_RF69_IRQ_PIN 2
      //#define MY_RF69_IRQ_NUM 0
      
      //#define W5100SPIPATCH
      
      #define SKETCH_NAME "MySensors Ethernet Gateway"
      #define SKETCH_MAJOR "0"
      #define SKETCH_MINOR "5"
      
      // How many clients should be able to connect to this gateway (default 1)
      #define MY_GATEWAY_MAX_CLIENTS 2
      
      // Enable gateway ethernet module type
      #define MY_GATEWAY_W5100
      
      // 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 15
        #define MY_SOFT_SPI_MOSI_PIN 16
      #endif  
      
      // Enable to UDP
      //#define MY_USE_UDP
      
      #define MY_IP_ADDRESS 192,168,1,204   // If this is disabled, DHCP is used to retrieve address
      // Renewal period if using DHCP
      //#define MY_IP_RENEWAL_INTERVAL 60000
      // The port to keep open on node server mode / or port to contact in client mode
      #define MY_PORT 5003
      
      // Controller ip address. Enables client mode (default is "server" mode).
      // Also enable this if MY_USE_UDP is used and you want sensor data sent somewhere.
      //#define MY_CONTROLLER_IP_ADDRESS 192, 168, 178, 254
      
      // The MAC address can be anything you want but should be unique on your network.
      // Newer boards have a MAC address printed on the underside of the PCB, which you can (optionally) use.
      // Note that most of the Ardunio examples use  "DEAD BEEF FEED" for the MAC address.
      #define MY_MAC_ADDRESS 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
      
      // Enable inclusion mode
      #define MY_INCLUSION_MODE_FEATURE
      // Enable Inclusion mode button on gateway
      //#define MY_INCLUSION_BUTTON_FEATURE
      // Set inclusion mode duration (in seconds)
      #define MY_INCLUSION_MODE_DURATION 60
      // Digital pin used for inclusion mode button
      //#define MY_INCLUSION_MODE_BUTTON_PIN  3
      
      // Set blinking period
      #define MY_DEFAULT_LED_BLINK_PERIOD 300
      
      // Flash leds on rx/tx/err
      // Uncomment to override default HW configurations
      //#define MY_DEFAULT_ERR_LED_PIN 5  // Error led pin
      #define MY_DEFAULT_RX_LED_PIN  6  // Receive led pin
      //#define MY_DEFAULT_TX_LED_PIN  7  // Transmit led pin
      
      #if defined(MY_USE_UDP)
      #include <EthernetUdp.h>
      #endif
      #include <Ethernet.h>
      #include <MySensors.h>
      
      void presentation()  
      { 
        // Send the sketch version information to the gateway
        sendSketchInfo(SKETCH_NAME, SKETCH_MAJOR"."SKETCH_MINOR);
      }
      
      void setup()
      {
      }
      
      void loop()
      {
      }
      
      posted in Troubleshooting
      firstof9
      firstof9
    • RE: New RFM69 driver error

      @gohan

      @gohan said in New RFM69 driver error:

      What arduino ide version do you have?

      Arduino: 1.8.5

      @gohan said in New RFM69 driver error:

      What Arduino Boards Definitions are you using?
      Arduino AVR Boards 1.6.20 (for my Uno with W5100 Ethernet shield)
      Adafruit AVR Boards 1.4.12 (for the Feather boards 32u4)

      @gohan said in New RFM69 driver error:

      Did you try compiling for pro mini?
      No as i don't have or use Pro Minis

      It does compile for my Nano sensor just fine.
      So far the error's only occurred when trying to compile for the Uno.

      posted in Troubleshooting
      firstof9
      firstof9
    • RE: New RFM69 driver error

      @gohan said in New RFM69 driver error:

      Did you try to compile for a different arduino?

      It seems to work fine for the Adafruit Feather Wings when selected.
      The error only comes up when I switch the board to the Uno for the ethernet gateway.

      @gohan said in New RFM69 driver error:

      Are you using mysensors 2.2?

      Yes

      posted in Troubleshooting
      firstof9
      firstof9
    • New RFM69 driver error

      While attempting to compile for an Uno using a W5100 Ethernet gateway setup I get the following error(s):

      Arduino: 1.8.5 (Windows 10), Board: "Arduino/Genuino Uno"
      
      In file included from D:\Documents\Arduino\libraries\MySensors/MySensors.h:343:0,
      
                       from D:\OneDrive\Home Automation Project\GatewayW5100.ino\GatewayW5100.ino.ino:120:
      
      D:\Documents\Arduino\libraries\MySensors/drivers/RFM69/new/RFM69_new.cpp: In function 'void RFM69_prepareSPITransaction()':
      
      D:\Documents\Arduino\libraries\MySensors/drivers/RFM69/new/RFM69_new.cpp:73:2: error: '_SREG' was not declared in this scope
      
        _SREG = SREG;
      
        ^
      
      D:\Documents\Arduino\libraries\MySensors/drivers/RFM69/new/RFM69_new.cpp:78:2: error: '_SPCR' was not declared in this scope
      
        _SPCR = SPCR;
      
        ^
      
      D:\Documents\Arduino\libraries\MySensors/drivers/RFM69/new/RFM69_new.cpp:79:2: error: '_SPSR' was not declared in this scope
      
        _SPSR = SPSR;
      
        ^
      
      D:\Documents\Arduino\libraries\MySensors/drivers/RFM69/new/RFM69_new.cpp: In function 'void RFM69_concludeSPITransaction()':
      
      D:\Documents\Arduino\libraries\MySensors/drivers/RFM69/new/RFM69_new.cpp:99:9: error: '_SPCR' was not declared in this scope
      
        SPCR = _SPCR;
      
               ^
      
      D:\Documents\Arduino\libraries\MySensors/drivers/RFM69/new/RFM69_new.cpp:100:9: error: '_SPSR' was not declared in this scope
      
        SPSR = _SPSR;
      
               ^
      
      D:\Documents\Arduino\libraries\MySensors/drivers/RFM69/new/RFM69_new.cpp:104:9: error: '_SREG' was not declared in this scope
      
        SREG = _SREG;
      
               ^
      
      exit status 1
      Error compiling for board Arduino/Genuino Uno.
      
      This report would have more information with
      "Show verbose output during compilation"
      option enabled in File -> Preferences.
      

      Anyone have any ideas what's going on?

      Thanks in advance.

      posted in Troubleshooting
      firstof9
      firstof9
    • RE: [RESOLVED] Problems connecting node to gateway

      Got it working it was this bit causing issues:

      // W5100 Ethernet module SPI enable (optional if using a shield/module that manages SPI_EN signal)
      #define MY_W5100_SPI_EN 4
      

      removing that fixed it

      Also as my gateway was having issues freaking out when receving radio packets I also modified my ethernet.h per this post:
      https://forum.mysensors.org/topic/5109/solved-rfm69-based-nodes-unable-to-report-lib-version/26

      and changed the following:

      #define MY_DEFAULT_ERR_LED_PIN A0  // Error led pin
      #define MY_DEFAULT_RX_LED_PIN  A1  // Receive led pin
      #define MY_DEFAULT_TX_LED_PIN  A2  // Transmit led pin
      

      Thank you all for your suggestions.

      posted in Troubleshooting
      firstof9
      firstof9