Anyone using Slimnode (RFM69) with MySensors 2.3.2?



  • Hi,

    I'm re-using some slim nodes I had laying around, but I'm not being able to make them "talk" with the MySensorsGW.
    I've re-burned the MiniCore bootloader to load and test successfully basic arduino sketches, but when it comes to MySensors communication it seems it's not working. Tried several slimnode boards and several RFM69 modules.

    Steps I've made:

    1. Install MiniCore bootlader with USBasp. Installed it as explained here.
      Parameters:

      Board: ATMega328
      Variant: 328p / 328pa
      Bootloader: Yes (UART0)
      EEPROM: EEPROM not retained
      BOD: BOD Disabled
      Clock: Internal 8MHz
      CompilerLTO: LTO Enabled

    avrdude: Version 6.3, compiled on Dec 16 2016 at 13:33:19
             Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
             Copyright (c) 2007-2014 Joerg Wunsch
    
             System wide configuration file is "C:\Users\sepjsil\Google Drive\Skynet v2.3.2\arduino-1.8.0 (with APIM)\portable\packages\MiniCore\hardware\avr\2.0.8/avrdude.conf"
    
             Using Port                    : usb
             Using Programmer              : usbasp
             AVR Part                      : ATmega328P
             Chip Erase delay              : 9000 us
             PAGEL                         : PD7
             BS2                           : PC2
             RESET disposition             : dedicated
             RETRY pulse                   : SCK
             serial program mode           : yes
             parallel program mode         : yes
             Timeout                       : 200
             StabDelay                     : 100
             CmdexeDelay                   : 25
             SyncLoops                     : 32
             ByteDelay                     : 0
             PollIndex                     : 3
             PollValue                     : 0x53
             Memory Detail                 :
    
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
               flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
               lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
               hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
               efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
               lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
               calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
               signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
    
             Programmer Type : usbasp
             Description     : USBasp, http://www.fischl.de/usbasp/
    
    avrdude: auto set sck period (because given equals null)
    avrdude: AVR device initialized and ready to accept instructions
    
    Reading | ################################################## | 100% 0.01s
    
    avrdude: Device signature = 0x1e950f (probably m328p)
    avrdude: erasing chip
    avrdude: auto set sck period (because given equals null)
    avrdude: reading input file "0x3f"
    avrdude: writing lock (1 bytes):
    
    C:\Users\sepjsil\Google Drive\Skynet v2.3.2\arduino-1.8.0 (with APIM)\hardware\tools\avr/bin/avrdude -CC:\Users\sepjsil\Google Drive\Skynet v2.3.2\arduino-1.8.0 (with APIM)\portable\packages\MiniCore\hardware\avr\2.0.8/avrdude.conf -v -patmega328p -cusbasp -Pusb -Uflash:w:C:\Users\sepjsil\Google Drive\Skynet v2.3.2\arduino-1.8.0 (with APIM)\portable\packages\MiniCore\hardware\avr\2.0.8/bootloaders/optiboot_flash/bootloaders/atmega328p/8000000L/optiboot_flash_atmega328p_UART0_38400_8000000L_B5.hex:i -Ulock:w:0x0f:m 
    Writing | ################################################## | 100% 0.00s
    
    avrdude: 1 bytes of lock written
    avrdude: verifying lock memory against 0x3f:
    avrdude: load data lock data from input file 0x3f:
    avrdude: input file 0x3f contains 1 bytes
    avrdude: reading on-chip lock data:
    
    Reading | ################################################## | 100% 0.00s
    
    avrdude: verifying ...
    avrdude: 1 bytes of lock verified
    avrdude: reading input file "0b11111111"
    avrdude: writing efuse (1 bytes):
    
    Writing | ################################################## | 100% 0.01s
    
    avrdude: 1 bytes of efuse written
    avrdude: verifying efuse memory against 0b11111111:
    avrdude: load data efuse data from input file 0b11111111:
    avrdude: input file 0b11111111 contains 1 bytes
    avrdude: reading on-chip efuse data:
    
    Reading | ################################################## | 100% 0.00s
    
    avrdude: verifying ...
    avrdude: 1 bytes of efuse verified
    avrdude: reading input file "0b11011110"
    avrdude: writing hfuse (1 bytes):
    
    Writing | ################################################## | 100% 0.02s
    
    avrdude: 1 bytes of hfuse written
    avrdude: verifying hfuse memory against 0b11011110:
    avrdude: load data hfuse data from input file 0b11011110:
    avrdude: input file 0b11011110 contains 1 bytes
    avrdude: reading on-chip hfuse data:
    
    Reading | ################################################## | 100% 0.01s
    
    avrdude: verifying ...
    avrdude: 1 bytes of hfuse verified
    avrdude: reading input file "0xe2"
    avrdude: writing lfuse (1 bytes):
    
    Writing | ################################################## | 100% 0.00s
    
    avrdude: 1 bytes of lfuse written
    avrdude: verifying lfuse memory against 0xe2:
    avrdude: load data lfuse data from input file 0xe2:
    avrdude: input file 0xe2 contains 1 bytes
    avrdude: reading on-chip lfuse data:
    
    Reading | ################################################## | 100% 0.00s
    
    avrdude: verifying ...
    avrdude: 1 bytes of lfuse verified
    
    avrdude done.  Thank you.
    
    
    avrdude: Version 6.3, compiled on Dec 16 2016 at 13:33:19
             Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
             Copyright (c) 2007-2014 Joerg Wunsch
    
             System wide configuration file is "C:\Users\sepjsil\Google Drive\Skynet v2.3.2\arduino-1.8.0 (with APIM)\portable\packages\MiniCore\hardware\avr\2.0.8/avrdude.conf"
    
             Using Port                    : usb
             Using Programmer              : usbasp
             AVR Part                      : ATmega328P
             Chip Erase delay              : 9000 us
             PAGEL                         : PD7
             BS2                           : PC2
             RESET disposition             : dedicated
             RETRY pulse                   : SCK
             serial program mode           : yes
             parallel program mode         : yes
             Timeout                       : 200
             StabDelay                     : 100
             CmdexeDelay                   : 25
             SyncLoops                     : 32
             ByteDelay                     : 0
             PollIndex                     : 3
             PollValue                     : 0x53
             Memory Detail                 :
    
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
               flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
               lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
               hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
               efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
               lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
               calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
               signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
    
             Programmer Type : usbasp
             Description     : USBasp, http://www.fischl.de/usbasp/
    
    avrdude: auto set sck period (because given equals null)
    avrdude: AVR device initialized and ready to accept instructions
    
    Reading | ################################################## | 100% 0.01s
    
    avrdude: Device signature = 0x1e950f (probably m328p)
    avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
             To disable this feature, specify the -D option.
    avrdude: erasing chip
    avrdude: auto set sck period (because given equals null)
    avrdude: reading input file "C:\Users\sepjsil\Google Drive\Skynet v2.3.2\arduino-1.8.0 (with APIM)\portable\packages\MiniCore\hardware\avr\2.0.8/bootloaders/optiboot_flash/bootloaders/atmega328p/8000000L/optiboot_flash_atmega328p_UART0_38400_8000000L_B5.hex"
    avrdude: writing flash (32768 bytes):
    
    Writing | ################################################## | 100% 0.00s
    
    avrdude: 32768 bytes of flash written
    avrdude: verifying flash memory against C:\Users\sepjsil\Google Drive\Skynet v2.3.2\arduino-1.8.0 (with APIM)\portable\packages\MiniCore\hardware\avr\2.0.8/bootloaders/optiboot_flash/bootloaders/atmega328p/8000000L/optiboot_flash_atmega328p_UART0_38400_8000000L_B5.hex:
    avrdude: load data flash data from input file C:\Users\sepjsil\Google Drive\Skynet v2.3.2\arduino-1.8.0 (with APIM)\portable\packages\MiniCore\hardware\avr\2.0.8/bootloaders/optiboot_flash/bootloaders/atmega328p/8000000L/optiboot_flash_atmega328p_UART0_38400_8000000L_B5.hex:
    avrdude: input file C:\Users\sepjsil\Google Drive\Skynet v2.3.2\arduino-1.8.0 (with APIM)\portable\packages\MiniCore\hardware\avr\2.0.8/bootloaders/optiboot_flash/bootloaders/atmega328p/8000000L/optiboot_flash_atmega328p_UART0_38400_8000000L_B5.hex contains 32768 bytes
    avrdude: reading on-chip flash data:
    
    Reading | ################################################## | 100% -0.00s
    
    avrdude: verifying ...
    avrdude: 32768 bytes of flash verified
    avrdude: reading input file "0x0f"
    avrdude: writing lock (1 bytes):
    
    Writing | ################################################## | 100% 0.02s
    
    avrdude: 1 bytes of lock written
    avrdude: verifying lock memory against 0x0f:
    avrdude: load data lock data from input file 0x0f:
    avrdude: input file 0x0f contains 1 bytes
    avrdude: reading on-chip lock data:
    
    Reading | ################################################## | 100% 0.01s
    
    avrdude: verifying ...
    avrdude: 1 bytes of lock verified
    
    avrdude done.  Thank you.
    
    1. Upload the ASCII example sketch with the AVRISP MKII programmer.
      The objective is to test if the bootloader was successfully installed and if the UART is working fine. I can see the ASCII chars in Serial monitor, so I assume everything is OK.
    avrdude: Version 6.3, compiled on Dec 16 2016 at 13:33:19
             Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
             Copyright (c) 2007-2014 Joerg Wunsch
    
             System wide configuration file is "C:\Users\sepjsil\Google Drive\Skynet v2.3.2\arduino-1.8.0 (with APIM)\portable\packages\MiniCore\hardware\avr\2.0.8/avrdude.conf"
    
             Using Port                    : COM5
             Using Programmer              : arduino
             Overriding Baud Rate          : 38400
             AVR Part                      : ATmega328P
             Chip Erase delay              : 9000 us
             PAGEL                         : PD7
             BS2                           : PC2
             RESET disposition             : dedicated
             RETRY pulse                   : SCK
             serial program mode           : yes
             parallel program mode         : yes
             Timeout                       : 200
             StabDelay                     : 100
             CmdexeDelay                   : 25
             SyncLoops                     : 32
             ByteDelay                     : 0
             PollIndex                     : 3
             PollValue                     : 0x53
             Memory Detail                 :
    
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
               flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
               lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
               hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
               efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
               lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
               calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
               signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
    
             Programmer Type : Arduino
             Description     : Arduino
             Hardware Version: 3
             Firmware Version: 8.0
             Vtarget         : 0.3 V
             Varef           : 0.3 V
             Oscillator      : 28.800 kHz
             SCK period      : 3.3 us
    
    avrdude: AVR device initialized and ready to accept instructions
    
    Reading | ################################################## | 100% 0.00s
    
    avrdude: Device signature = 0x1e950f (probably m328p)
    avrdude: reading input file "C:\Users\sepjsil\AppData\Local\Temp\arduino_build_486510/ASCIITable.ino.hex"
    avrdude: writing flash (1876 bytes):
    
    Writing | ################################################## | 100% 0.72s
    
    avrdude: 1876 bytes of flash written
    avrdude: verifying flash memory against C:\Users\sepjsil\AppData\Local\Temp\arduino_build_486510/ASCIITable.ino.hex:
    avrdude: load data flash data from input file C:\Users\sepjsil\AppData\Local\Temp\arduino_build_486510/ASCIITable.ino.hex:
    avrdude: input file C:\Users\sepjsil\AppData\Local\Temp\arduino_build_486510/ASCIITable.ino.hex contains 1876 bytes
    avrdude: reading on-chip flash data:
    
    Reading | ################################################## | 100% 0.60s
    
    avrdude: verifying ...
    avrdude: 1876 bytes of flash verified
    
    avrdude done.  Thank you.
    
    1. Load a simple MySensors test sketch to the node:
    // Encryption & Signing stuff - Testado e a funcionar
    #define MY_DEBUG
    #define MY_DEBUG_VERBOSE_SIGNING
    //#define MY_SIGNING_SOFT
    #define MY_SIGNING_ATSHA204
    #define MY_SIGNING_REQUEST_SIGNATURES
    
    #ifndef MY_SIGNING_ATSHA204_PIN
    #define MY_SIGNING_ATSHA204_PIN 17  // D17=A3
    #endif
    #define MY_RADIO_RFM69  // Define for using RFM69 radio
    #define MY_RFM69_FREQUENCY RFM69_433MHZ 
    #define MY_RFM69_NEW_DRIVER
    #define MY_IS_RFM69HW  
    #define MY_RFM69_ENABLE_ENCRYPTION
    //#define MY_DEBUG_VERBOSE_RFM69
    
    #define MY_NODE_ID 99
    
    #include <MySensors.h>
    
    #define CHILD_ID_TEM 20 // Id of the sensor child for temperature (SHT21)
    #define CHILD_ID_DEW 21 // Id of the sensor child for dew point (SHT21)
    #define CHILD_ID_HUM 40 // Id of the sensor child for Humidity (SHT21)
    
    // Source of state change (used when printing debug information)
    #define CHANGE_STATE_SOURCE_RADIO 0
    #define CHANGE_STATE_SOURCE_SWITCH 1
    
    MyMessage msg_TEM(CHILD_ID_TEM, V_TEMP);
    MyMessage msg_HUM(CHILD_ID_HUM, V_HUM);
    MyMessage msg_DEW(CHILD_ID_DEW, V_TEMP);
    
    void presentation() {
      // Send the sketch version information to the gateway and Controller
      sendSketchInfo("TEST_SLIMNODE", "V1.1");
      // Register all sensors to gw (they will be created as child devices)
      present(CHILD_ID_TEM, S_TEMP);
      present(CHILD_ID_HUM, S_HUM);
      present(CHILD_ID_DEW, S_TEMP);
    
    #ifdef MY_DEBUG
    Serial.println("finished presentation");
    #endif
    }
    
    void setup()
    {
    //#ifdef MY_DEBUG
    Serial.println("finished setup ");
    //#endif
    }
    
    

    No answers from GW:

     __  __       ____
    |  \/  |_   _/ ___|  ___ _ __  ___  ___  _ __ ___
    | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
    | |  | | |_| |___| |  __/ | | \__ \  _  | |  \__ \
    |_|  |_|\__, |____/ \___|_| |_|___/\___/|_|  |___/
            |___/                      2.3.2
    
    16 MCO:BGN:INIT NODE,CP=RPNNAA-X,FQ=8,REL=255,VER=2.3.2
    40 !SGN:PER:TAMPERED
    143 !SGN:BND:INIT FAIL
    147 !SGN:INI:BND FAIL
    149 TSM:INIT
    149 TSF:WUR:MS=0
    153 TSM:INIT:TSP OK
    155 TSM:INIT:STATID=99
    157 TSF:SID:OK,ID=99
    159 TSM:FPAR
    161 SGN:SGN:NREQ=255
    2199 ?TSF:MSG:SEND,99-99-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    4206 !TSM:FPAR:NO REPLY
    4208 TSM:FPAR
    4210 SGN:SGN:NREQ=255
    6258 ?TSF:MSG:SEND,99-99-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    8265 !TSM:FPAR:NO REPLY
    8267 TSM:FPAR
    8269 SGN:SGN:NREQ=255
    10295 ?TSF:MSG:SEND,99-99-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    12302 !TSM:FPAR:NO REPLY
    12304 TSM:FPAR
    12306 SGN:SGN:NREQ=255
    14348 ?TSF:MSG:SEND,99-99-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    16355 !TSM:FPAR:FAIL
    16357 TSM:FAIL:CNT=1
    16359 TSM:FAIL:DIS
    16361 TSF:TDI:TSL
    

    Might be related with the 8MHz internal clock? What am I missing here? The RFM69's are soldered to the nrf2rfm69 modules, so I'm attaching it as a NRF24 would...
    Any idea?
    Thanks,


  • Mod

    @joaoabs said in Anyone using Slimnode (RFM69) with MySensors 2.3.2?:

    40 !SGN:PER:TAMPERED

    I'm no signing expert, but that doesn't look good...
    Ping @Anticimex?


  • Contest Winner

    @joaoabs I am not at a pc so cannot check the code but it looks like signing configuration has been altered since personalization since it prints TAMPERED.



  • Hi,

    Thanks for getting back.

    I didn't think it was related with signing. Before signing, I believe the node needs to ask for a parent, receive an answer and then starts the signing negotiations. In the logs there is no answer what so ever, so I suspect it is more radio (and maybe timing) related.

    Nevertheless, I've re-personalized a node so we can take that signing "tampered" out of the way.
    The signing startup is now fine, but the problem remains. Nothing is received.

     __  __       ____
    |  \/  |_   _/ ___|  ___ _ __  ___  ___  _ __ ___
    | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
    | |  | | |_| |___| |  __/ | | \__ \  _  | |  \__ \
    |_|  |_|\__, |____/ \___|_| |_|___/\___/|_|  |___/
            |___/                      2.3.2
    
    16 MCO:BGN:INIT NODE,CP=RPNNAA-X,FQ=8,REL=255,VER=2.3.2
    40 SGN:PER:OK
    69 SGN:INI:BND OK
    71 TSM:INIT
    71 TSF:WUR:MS=0
    75 TSM:INIT:TSP OK
    77 TSM:INIT:STATID=99
    79 TSF:SID:OK,ID=99
    81 TSM:FPAR
    83 SGN:SGN:NREQ=255
    108 ?TSF:MSG:SEND,99-99-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    2117 !TSM:FPAR:NO REPLY
    2119 TSM:FPAR
    2121 SGN:SGN:NREQ=255
    2158 ?TSF:MSG:SEND,99-99-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    4167 !TSM:FPAR:NO REPLY
    4169 TSM:FPAR
    4171 SGN:SGN:NREQ=255
    4179 ?TSF:MSG:SEND,99-99-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    6187 !TSM:FPAR:NO REPLY
    6189 TSM:FPAR
    6191 SGN:SGN:NREQ=255
    6197 ?TSF:MSG:SEND,99-99-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    8206 !TSM:FPAR:FAIL
    8208 TSM:FAIL:CNT=1
    8210 TSM:FAIL:DIS
    8212 TSF:TDI:TSL
    18214 TSM:FAIL:RE-INIT
    18216 TSM:INIT
    18219 TSM:INIT:TSP OK
    18223 TSM:INIT:STATID=99
    18225 TSF:SID:OK,ID=99
    18227 TSM:FPAR
    18229 SGN:SGN:NREQ=255
    18241 ?TSF:MSG:SEND,99-99-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    20250 !TSM:FPAR:NO REPLY
    20252 TSM:FPAR
    20254 SGN:SGN:NREQ=255
    

    Since there is a warning from the creator that "There have been reported issues with MySensors 2.x freezing on SlimNodes running at 1MHz, which I've confirmed. Recommended solution when using MyS 2.x, is to use 8MHz (internal) instead." I'm using the 8MHz internal clock.

    And the MiniCore page has the following comment for 8MHz frequency: "You might experience upload issues when using the internal oscillator. It's factory calibrated but may be a little "off" depending on the calibration, ambient temperature and operating voltage." Not sure if this would also affect RFM69.

    Any idea?


  • Contest Winner

    @joaoabs it is not directly signing related anyway. The parent search is not signed (the NREQ messages) as it does not at that point "know" what the signing capabilities of the parent are. But Atmega328p is short on the ram when signing is used so in some situations with signing enabled combined with other features, stack might get trashed due to how the tool chain manages ram VS stack. Typically if ram usage crosses around 70%. But if you are at 50% or below I think signing can be ruled out as a factor here.



  • Indeed, this doesn't seem to be RAM related. It's a simple sketch that does nothing but presenting himself.

    RAM usage is 52%.

    Sketch uses 21402 bytes (66%) of program storage space. Maximum is 32256 bytes.
    Global variables use 1068 bytes (52%) of dynamic memory, leaving 980 bytes for local variables. Maximum is 2048 bytes.
    

    My issue here is that this is such a simple setup and somehow is failing.
    The bootloader was re burned fresh, the SHA024 is now well personalized, the RFM69's are soldered into the nrf2rfm69 modules (and I've tried 3 different so far), and the sketch is really basic. What am I missing here? 🙄



  • Could you check if IRQ arrives correctly at INT0?



  • After much tentative-error, found a working setup.
    The drawback is that the node cannot be more that 4m away from the gateway in order to communication flow normally. Could this be bad quality RFM69's?

    I mean, isn't supposed that 433MHz range would be higher than this? I was expecting it to cross walls and so...

    The Slim node is currently powered by a USB/serial adapter (not battery) connected to the laptop so it shouldn't be a low power issue. All nrf2rfm69 modules have a bought 433MHz spiral antenna (like the picture), including the GW and I have also soldered a 10uF SMD tantalum capacitor (smd code 106A) in the back side.

    Antennas picture
    SMD capacitor picture


Log in to reply
 

Suggested Topics

  • 5
  • 1
  • 2
  • 3
  • 10
  • 8
  • 1
  • 2

117
Online

10.3k
Users

10.7k
Topics

109.6k
Posts