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
AdamAntA

AdamAnt

@AdamAnt
About
Posts
12
Topics
5
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Voltage Divider to measure battery charge
    AdamAntA AdamAnt

    I'm currently in the process of designing a custom mysensors board to use with an RFM69 radio and an atmega328p, and I've come unstuck working out the values needed for the resistors for the voltage dividers. The MySensors page on batteries is unfortunately clear as mud on the matter.

    I'm using the internal 1.1v voltage reference of the atmega, so by my understanding I can't measure more than 1.1v on the analog inputs. The atmega & RFM69 board will be powered from 4v - 6v depending on the application, via a 3.3v regulator. Based on these values I've come to the conclusion that resistors of 1M ohm & 200k ohm will be the best bet. Theres also a circuit diagram below of how the circuit is wired. Is this the easiest way to measure the battery?

    b1d70165-4534-4d94-9e72-1685ce4daff6-image.png

    Hardware

  • Node not being assigned an ID.
    AdamAntA AdamAnt

    Oh damn, I feel thick right now. Thanks, that is totally obvious in hindsight.

    Troubleshooting

  • ISR not in IRAM error
    AdamAntA AdamAnt

    Hello,
    Just jumping in here to say that a combination of using the new driver, and downgrading to ESP8266 ver 2.5.0 has fixed this for me. The other issue I was having was total user error, a bad solder joint was giving me strange results.

    Thanks for your help!!

    Troubleshooting

  • Node not being assigned an ID.
    AdamAntA AdamAnt

    Hello again,
    I've got past the issues with the ISR not in IRAM error as in my last thread.

    I'm now using a gateway with ESP8266 firmware ver 2.5.0, as per the workaround in the last thread. The node is a Moteino (using an RFM69 radio).
    I am using the new RFM69 driver.
    However, the node is not managing to get an ID from the gateway. Below, I have included the logs & scripts from the gateway and node.
    If I define a static node ID using #MY_NODE_ID, it works perfectly, but I would quite like the dynamic assigning to work.
    I have been using the EEPROM clear sketch in between tests on both the gateway and the node, so I don't think thats at fault.

    Gateway (ESP8266):

    // 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
    
    
    // For RFM69
    #define MY_RADIO_RFM69
    #define MY_RFM69_NEW_DRIVER
    
    #define MY_RFM69_FREQUENCY RFM69_868MHZ // Set your frequency here
    #define MY_RFM69_IRQ_PIN 4
    #define MY_RFM69_IRQ_NUM MY_RFM69_IRQ_PIN
    #define MY_RFM69_CS_PIN 5 // NSS. Use MY_RFM69_SPI_CS for older versions (before 2.2.0)
    
    #define MY_GATEWAY_ESP8266
    
    #define MY_WIFI_SSID "<snip>"
    #define MY_WIFI_PASSWORD "<snip>"
    
    // The port to keep open on node server mode
    #define MY_PORT 5003
    
    // How many clients should be able to connect to this gateway (default 1)
    #define MY_GATEWAY_MAX_CLIENTS 2
    
    #include <ESP8266WiFi.h>
    #include <MySensors.h>
    
    void setup()
    {
    	// Setup locally attached sensors
    }
    
    void presentation()
    {
    	// Present locally attached sensors here
    }
    
    void loop()
    {
    	// Send locally attached sensors data here
    }
    
    52 MCO:BGN:INIT GW,CP=RPNGE---,REL=255,VER=2.3.1
    103 TSF:LRT:OK
    119 TSM:INIT
    133 TSF:WUR:MS=0
    151 TSM:INIT:TSP OK
    172 TSM:INIT:GW MODE
    194 TSM:READY:ID=0,PAR=0,DIS=0
    227 MCO:REG:NOT NEEDED
    scandone
    255 TSM:READY:NWD REQ
    290 TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK:
    755 GWT:TIN:CONNECTING...
    1282 GWT:TIN:CONNECTING...
    1810 GWT:TIN:CONNECTING...
    2338 GWT:TIN:CONNECTING...
    2866 GWT:TIN:CONNECTING...
    scandone
    state: 0 -> 2 (b0)
    state: 2 -> 3 (0)
    state: 3 -> 5 (10)
    add 0
    aid 10
    cnt 
    
    connected with <snip>, channel 9
    dhcp client start...
    ip:192.168.43.133,mask:255.255.255.0,gw:192.168.43.1
    3394 GWT:TIN:CONNECTING...
    3422 GWT:TIN:IP: 192.168.43.133
    3456 MCO:BGN:STP
    3474 MCO:BGN:INIT OK,TSP=1
    pm open,type:2 0
    14074 TSF:MSG:READ,255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    14137 TSF:MSG:BC
    14155 TSF:MSG:FPAR REQ,ID=255
    14186 TSF:PNG:SEND,TO=0
    14212 TSF:CKU:OK
    14229 TSF:MSG:GWL OK
    15195 TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0
    16143 TSF:MSG:READ,255-255-0,s=0,c=3,t=3,pt=0,l=0,sg=0:
    18209 TSF:MSG:READ,255-255-0,s=20,c=3,t=3,pt=0,l=0,sg=0:
    20276 TSF:MSG:READ,255-255-0,s=41,c=3,t=3,pt=0,l=0,sg=0:
    22342 TSF:MSG:READ,255-255-0,s=62,c=3,t=3,pt=0,l=0,sg=0:
    

    Node (Moteino R4):

    // Enable debug prints to serial monitor
    #define MY_DEBUG
    
    // Enable and select radio type attached
    //#define MY_RADIO_RF24
    #define MY_RADIO_RFM69
    #define MY_RFM69_NEW_DRIVER
    //#define MY_RADIO_RFM95
    
    // Enabled repeater feature for this node
    #define MY_REPEATER_FEATURE
    
    #include <MySensors.h>
    
    void setup()
    {
    
    }
    
    void presentation()
    {
    	//Send the sensor node sketch version information to the gateway
    	sendSketchInfo("Repeater Node", "1.0");
    }
    
    void loop()
    {
    }
    
    16 MCO:BGN:INIT REPEATER,CP=RPNRA---,REL=255,VER=2.3.1
    26 TSM:INIT
    27 TSF:WUR:MS=0
    29 TSM:INIT:TSP OK
    31 TSM:FPAR
    36 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    1160 TSF:MSG:READ,0-0-255,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    1165 TSF:MSG:FPAR OK,ID=0,D=1
    2045 TSM:FPAR:OK
    2046 TSM:ID
    2048 TSM:ID:REQ
    2108 TSF:MSG:SEND,255-255-0-0,s=0,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK:
    4115 TSM:ID
    4116 TSM:ID:REQ
    4175 TSF:MSG:SEND,255-255-0-0,s=20,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK:
    6184 TSM:ID
    6185 TSM:ID:REQ
    6245 TSF:MSG:SEND,255-255-0-0,s=41,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK:
    8253 TSM:ID
    8254 TSM:ID:REQ
    8313 TSF:MSG:SEND,255-255-0-0,s=62,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK:
    10322 !TSM:ID:FAIL
    10323 TSM:FAIL:CNT=1
    10326 TSM:FAIL:DIS
    10328 TSF:TDI:TSL
    

    Thanks again for your help!

    Troubleshooting

  • ISR not in IRAM error
    AdamAntA AdamAnt

    @mfalkvidd Yeah, I reflashed the node & gateway each time to match.
    The gateway has the same sketch as in post 1, just with #define MY_RFM69_NEW_DRIVER added, and the sensor node is the simple repeater sketch:

    /*
     * The MySensors Arduino library handles the wireless radio link and protocol
     * between your home built sensors/actuators and HA controller of choice.
     * The sensors forms a self healing radio network with optional repeaters. Each
     * repeater and gateway builds a routing tables in EEPROM which keeps track of the
     * network topology allowing messages to be routed to nodes.
     *
     * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
     * Copyright (C) 2013-2018 Sensnology AB
     * Full contributor list: https://github.com/mysensors/MySensors/graphs/contributors
     *
     * Documentation: http://www.mysensors.org
     * Support Forum: http://forum.mysensors.org
     *
     * This program is free software; you can redistribute it and/or
     * modify it under the terms of the GNU General Public License
     * version 2 as published by the Free Software Foundation.
     *
     *******************************
     *
     * REVISION HISTORY
     * Version 1.0 - Henrik Ekblad
     *
     * DESCRIPTION
     * Example sketch showing how to create a node that repeats messages
     * from nodes far from gateway back to gateway.
     * It is important that nodes that has enabled repeater mode calls
     * process() frequently. Repeaters should never sleep.
     */
    
    // Enable debug prints to serial monitor
    #define MY_DEBUG
    
    // Enable and select radio type attached
    #define MY_RADIO_RFM69
    #define MY_RFM69_NEW_DRIVER
    
    
    // Enabled repeater feature for this node
    #define MY_REPEATER_FEATURE
    
    #include <MySensors.h>
    
    void setup()
    {
    
    }
    
    void presentation()
    {
    	//Send the sensor node sketch version information to the gateway
    	sendSketchInfo("Repeater Node", "1.0");
    }
    
    void loop()
    {
    }
    
    
    Troubleshooting

  • ISR not in IRAM error
    AdamAntA AdamAnt

    @yveaux Hello, thanks so much for your help on this!

    Changing those functions has helped me get past the error, however I now have a different issue.
    Using the the same sketch and setup, on the old driver the gateway crashes with a Soft WDT reset shortly after it initializes the radio:

    50 MCO:BGN:INIT GW,CP=RRNGE---,REL=255,VER=2.3.1
    101 TSF:LRT:OK
    117 TSM:INIT
    131 TSF:WUR:MS=0
    156 TSM:INIT:TSP OK
    177 TSM:INIT:GW MODE
    199 TSM:READY:ID=0,PAR=0,DIS=0
    231 MCO:REG:NOT NEEDED
    scandone
    259 TSM:READY:NWD REQ
    
    Soft WDT reset
    
    >>>stack>>>
    
    ctx: cont
    sp: 3ffffc40 end: 3fffffd0 offset: 01b0
    3ffffdf0:  000003e7 3ffee488 00000a91 402017ee  
    3ffffe00:  3ffee319 00000001 00000040 40201664  
    3ffffe10:  3ffee319 000000ff 3ffee488 000003e7  
    3ffffe20:  3ffee319 000000ff 3ffee488 40201bd5  
    3ffffe30:  00000a8a 00000007 00000001 00418937  
    3ffffe40:  00000000 3ffee71c 4023d1ac 000009c2  
    3ffffe50:  000000ff 3ffee488 00000002 40201428  
    3ffffe60:  3ffee319 00000007 00000005 000000c8  
    3ffffe70:  3a4d5354 44414552 574e3a59 000000ff  
    3ffffe80:  3fffdad0 3ffee46c 3ffee319 40201ced  
    3ffffe90:  6d616461 37393931 00000100 402022d7  
    3ffffea0:  00000001 3ffef9fc 00000000 40207afc  
    3ffffeb0:  000003fd 4023202b 00000000 40100584  
    3ffffec0:  00000001 3ffee317 00000001 40202754  
    3ffffed0:  e260f400 00f2597d 3fffff00 3ffffef0  
    3ffffee0:  00000000 4bc6a7f0 3fffff10 3fffff00  
    3ffffef0:  00000004 00000000 4bc6a7f0 00000000  
    3fffff00:  6d616461 00418937 00000000 3ffee2c0  
    3fffff10:  3fffdad0 3ffee319 000000ff 40202420  
    3fffff20:  3fffdad0 00000103 3ffee35c 402028d4  
    3fffff30:  00000000 00000000 000001f4 40201dc5  
    3fffff40:  3fffdad0 00000103 000001f4 4020364d  
    3fffff50:  00000000 00000103 000001f4 402039df  
    3fffff60:  3fffdad0 00000103 000001f4 40203a03  
    3fffff70:  3fffdad0 3ffee317 3ffee6cc 40203a62  
    3fffff80:  3ffee470 3ffee317 00000000 402036a4  
    3fffff90:  600002ff 00020000 3ffee470 3ffee2c0  
    3fffffa0:  3fffdad0 3ffee317 3ffee6fe 40203b50  
    3fffffb0:  feefeffe 00000000 3ffee2b8 40203bb4  
    3fffffc0:  feefeffe feefeffe 3ffe851c 40100129  
    <<<stack<<<
    

    However, using the new driver, I get past that point and the gateway initializes fine. But unfortunately, the sensor node never connects. It just constantly sits waiting to find a parent node:

    16 MCO:BGN:INIT NODE,CP=RPNNA---,REL=255,VER=2.3.1
    26 TSM:INIT
    27 TSF:WUR:MS=0
    29 TSM:INIT:TSP OK
    31 TSM:FPAR
    36 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    2045 !TSM:FPAR:NO REPLY
    2048 TSM:FPAR
    2054 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    4061 !TSM:FPAR:NO REPLY
    4063 TSM:FPAR
    4069 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    6076 !TSM:FPAR:NO REPLY
    6078 TSM:FPAR
    6083 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    8091 !TSM:FPAR:FAIL
    8092 TSM:FAIL:CNT=1
    8094 TSM:FAIL:DIS
    8096 TSF:TDI:TSL
    

    I'm pretty confident my antenna setups are correct - single core wire, each one a straight piece 82mm long.

    Troubleshooting

  • ISR not in IRAM error
    AdamAntA AdamAnt

    Hello,
    I'm trying to setup an ESP8266 (bare ESP-12E) based gateway using the RFM69 radio module.
    However when I start the gateway, I get the error message ISR not in IRAM

    I'm using mysensors 2.3.1, with versio 2.5.2 of the ESP8266 board library.

    I'm wiring it up to an RFM69W exactly as in the wiring diagram on the Connecting the Radio page, with the exception of NSS being connected to pin 5 not 15.
    The power supply I'm using has more than enough headroom, its a bench supply and shows about 60mA pulled at startup.

    My gateway sketch & serial output is below.

    Any ideas greatly appreciated!!

    SDK:2.2.1(cfd48f3)/Core:2.5.2=20502000/lwIP:STABLE-2_1_2_RELEASE/glue:1.1-7-g82abda3/BearSSL:a143020
    53 MCO:BGN:INIT GW,CP=RRNGE---,REL=255,VER=2.3.1
    211 TSF:LRT:OK
    226 TSM:INIT
    240 TSF:WUR:MS=0
    ISR not in IRAM!
    
    Abort called
    
    >>>stack>>>
    
    ctx: cont
    sp: 3ffffd00 end: 3fffffd0 offset: 01b0
    3ffffeb0:  00000000 00000000 4bc6a7f0 00000000  
    3ffffec0:  00000000 00000080 40100246 00000031  
    3ffffed0:  00000000 00000105 3ffee590 4010054e  
    3ffffee0:  00000000 00000105 3ffee590 40202e6d  
    3ffffef0:  00020401 40040203 33060305 0008d907  
    3fffff00:  42190009 07264025 dc291028 2d2f882e  
    3fffff10:  90376430 8f3c4238 306f123d 400000ff  
    3fffff20:  00000064 00000246 00000246 40208120  
    3fffff30:  00000000 4bc6a7f0 000000f0 00000102  
    3fffff40:  3ffee578 3ffee41f 00000000 40202ef0  
    3fffff50:  00000000 00000000 4bc6a7f0 40202f13  
    3fffff60:  00000000 00000000 00000000 40201db5  
    3fffff70:  00000000 00a7fd40 00000000 4020363d  
    3fffff80:  3ffee578 3ffee41f 00000000 4020368b  
    3fffff90:  600002ff 00020000 3ffee578 3ffee3c8  
    3fffffa0:  3fffdad0 3ffee41f 3ffee806 40203c45  
    3fffffb0:  feefeffe 00000000 3ffee3c0 40203cac  
    3fffffc0:  feefeffe feefeffe 3ffe8524 4010010d  
    <<<stack<<<
    
    Repeats here ad infinium...
    
    /*
     * The MySensors Arduino library handles the wireless radio link and protocol
     * between your home built sensors/actuators and HA controller of choice.
     * The sensors forms a self healing radio network with optional repeaters. Each
     * repeater and gateway builds a routing tables in EEPROM which keeps track of the
     * network topology allowing messages to be routed to nodes.
     *
     * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
     * Copyright (C) 2013-2018 Sensnology AB
     * Full contributor list: https://github.com/mysensors/MySensors/graphs/contributors
     *
     * Documentation: http://www.mysensors.org
     * Support Forum: http://forum.mysensors.org
     *
     * This program is free software; you can redistribute it and/or
     * modify it under the terms of the GNU General Public License
     * version 2 as published by the Free Software Foundation.
     *
     *******************************
     *
     * REVISION HISTORY
     * Version 1.0 - Henrik EKblad
     * Contribution by a-lurker and Anticimex,
     * Contribution by Norbert Truchsess <norbert.truchsess@t-online.de>
     * Contribution by Ivo Pullens (ESP8266 support)
     *
     * DESCRIPTION
     * The EthernetGateway sends data received from sensors to the WiFi link.
     * The gateway also accepts input on ethernet interface, which is then sent out to the radio network.
     *
     * VERA CONFIGURATION:
     * Enter "ip-number:port" in the ip-field of the Arduino GW device. This will temporarily override any serial configuration for the Vera plugin.
     * E.g. If you want to use the default values in this sketch enter: 192.168.178.66:5003
     *
     * LED purposes:
     * - To use the feature, uncomment any of the MY_DEFAULT_xx_LED_PINs in your sketch, only the LEDs that is defined is used.
     * - RX (green) - blink fast on radio message received. In inclusion mode will blink fast only on presentation received
     * - TX (yellow) - blink fast on radio message transmitted. In inclusion mode will blink slowly
     * - ERR (red) - fast blink on error during transmission error or receive crc error
     *
     * See https://www.mysensors.org/build/connect_radio for wiring instructions.
     *
     * If you are using a "barebone" ESP8266, see
     * https://www.mysensors.org/build/esp8266_gateway#wiring-for-barebone-esp8266
     *
     * Inclusion mode button:
     * - Connect GPIO5 (=D1) via switch to GND ('inclusion switch')
     *
     * Hardware SHA204 signing is currently not supported!
     *
     * Make sure to fill in your ssid and WiFi password below for ssid & pass.
     */
    
    // 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
    
    
    // For RFM69
    #define MY_RADIO_RFM69
    //#define MY_RFM69_FREQUENCY RFM69_868MHZ // Set your frequency here
    #define MY_RFM69_IRQ_PIN 4
    #define MY_RFM69_IRQ_NUM MY_RFM69_IRQ_PIN
    #define MY_RFM69_CS_PIN 5 // NSS. Use MY_RFM69_SPI_CS for older versions (before 2.2.0)
    
    #define MY_GATEWAY_ESP8266
    
    #define MY_WIFI_SSID "<snip>"
    #define MY_WIFI_PASSWORD "<snip>"
    
    // The port to keep open on node server mode
    #define MY_PORT 5003
    
    // How many clients should be able to connect to this gateway (default 1)
    #define MY_GATEWAY_MAX_CLIENTS 2
    
    #include <ESP8266WiFi.h>
    #include <MySensors.h>
    
    void setup()
    {
    	// Setup locally attached sensors
    }
    
    void presentation()
    {
    	// Present locally attached sensors here
    }
    
    void loop()
    {
    	// Send locally attached sensors data here
    }
    

    Edit:
    Below is a screenshot of my current upload options
    arduino upload opts

    Troubleshooting

  • Cannot flash atmega328 on new custom board
    AdamAntA AdamAnt

    The crystal and caps are only needed if you are pulling an atmega from an arduino. By default, bare atmega's straight from the factory use an internal 8mhz oscillator, no crystal needed. And the reset line is connected, the schematic is just not that clear in that regard. the RESET label means its connected to the reset pin on the ISP header

    Hardware

  • Cannot flash atmega328 on new custom board
    AdamAntA AdamAnt

    Hello,
    I've designed and made PCBs for a new custom board, one that can fit inside the space of a AA battery. However, I can't seem to flash it. Both the arduino IDE, and avrdude on its own can't talk to the board. avrdude either says the device initialization failed, or gives a random device signature. I've also tried two different programmers, a USBasp and an Arduino UNO as an ISP.

    I am trying to program to the board before adding the radio, as I realize the ISP and NRF radio share pins and would interfere with each other. The only components on the board at this stage are the ATMEGA328, C1, C2, R1 and the ISP header. The ATMEGA chips themselves are sourced from Arrow, and are brand new, however have been sitting on my shelf for a year or so. I wanted to check with the community before resorting to ordering fresh parts, as I'm not convinced the problem is in the chips themselves.

    I've been over both the schematic and physical PCB with a fine tooth comb, and have come up stumped. I even built a 2nd board just to eliminate any issues with a single component, or my soldering work.

    The schematic, and pictures of the finished board are below.
    Excuse the potato photos. The chip does actually have writing on it. The soldering isn't amazing, but a continuity test shows its all making good connections to where it should go.

    Thanks.

    the schematic

    the front of the board the back of the board

    Ninja edit: The output from avrdude
    avrdude output

    Hardware

  • Home Assistant not assigning Node IDs
    AdamAntA AdamAnt

    A ha, that fixed it. Thanks very much! If you don't mind, what is the difference between the MySensors eeprom clearing sketch vs the stock arduino one? From first glance it seems as if the Arduino one would actually clean more, since it iterates over the whole eeprom rather than just the bits relevant to MySensors.

    Home Assistant

  • Home Assistant not assigning Node IDs
    AdamAntA AdamAnt

    Hello,

    I'm setting up home assistant with mysensors for the first time, and have hit a snag. If I assign a node ID manually, the network works fine, however if I leave it to the controller to assign a node ID, it tries to assign node 0 to the sensor (I think, if i'm interpreting the logs correctly). The gateway is running on the example sketch for the WS5100 ethernet module, and the sketch for the sensor is below. I have tried a different arduino for both gateway and sensor, and tried clearing the EEPROM of both the gateway and sensor (these arduinos have been used to tinker with MySensors a few years ago).
    I have also tried clearing the home-assistant persistence file.

    Below are some logs from each of the pieces of the puzzle:

    Gateway Serial Output:

    0 MCO:BGN:INIT GW,CP=RNNGA---,REL=255,VER=2.3.1
    4 TSM:INIT
    5 TSF:WUR:MS=0
    11 TSM:INIT:TSP OK
    13 TSM:INIT:GW MODE
    15 TSM:READY:ID=0,PAR=0,DIS=0
    17 MCO:REG:NOT NEEDED
    320 GWT:TIN:IP=192.168.1.25
    1323 MCO:BGN:STP
    1325 MCO:BGN:INIT OK,TSP=1
    1327 TSM:READY:NWD REQ
    1363 TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK:
    12073 GWT:TSA:ETH OK
    12082 GWT:RFC:MSG=0;255;3;0;2;
    12091 GWT:RFC:MSG=255;255;3;0;20;
    12129 TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK:
    22179 GWT:RFC:MSG=0;255;3;0;2;
    

    Sensor Sketch:

    /*
     * Documentation: http://www.mysensors.org
     * Support Forum: http://forum.mysensors.org
     *
     * http://www.mysensors.org/build/relay
     */
    
    #define MY_DEBUG
    #define MY_RADIO_NRF24
    #define MY_REPEATER_FEATURE
    #include <SPI.h>
    #include <MySensors.h>
    
    #define RELAY_PIN  4
    #define CHILD_ID 1
    #define RELAY_ON 1
    #define RELAY_OFF 0
    
    bool state = false;
    bool initialValueSent = false;
    
    MyMessage msg(CHILD_ID, V_STATUS);
    
    void setup()
    {
      // Make sure relays are off when starting up
      digitalWrite(RELAY_PIN, RELAY_OFF);
      pinMode(RELAY_PIN, OUTPUT);
    }
    
    void presentation()  {
      sendSketchInfo("Relay+button", "1.0");
      present(CHILD_ID, S_BINARY);
    }
    
    void loop()
    {
      if (!initialValueSent) {
        Serial.println("Sending initial value");
        send(msg.set(state?RELAY_ON:RELAY_OFF));
        Serial.println("Requesting initial value from controller");
        request(CHILD_ID, V_STATUS);
        wait(2000, C_SET, V_STATUS);
      }
    }
    
    void receive(const MyMessage &message) {
      if (message.isAck()) {
         Serial.println("This is an ack from gateway");
      }
    
      if (message.type == V_STATUS) {
        if (!initialValueSent) {
          Serial.println("Receiving initial value from controller");
          initialValueSent = true;
        }
        // Change relay state
        state = (bool)message.getInt();
        digitalWrite(RELAY_PIN, state?RELAY_ON:RELAY_OFF);
        send(msg.set(state?RELAY_ON:RELAY_OFF));
      }
    }
    

    Sensor Serial Output:

    16 MCO:BGN:INIT REPEATER,CP=RNNRA---,REL=255,VER=2.3.1
    26 TSM:INIT
    27 TSF:WUR:MS=0
    34 TSM:INIT:TSP OK
    35 !TSF:SID:FAIL,ID=0
    37 TSM:FAIL:CNT=1
    39 TSM:FAIL:DIS
    40 TSF:TDI:TSL
    

    Home Assistant config:

    mysensors:
      version: '2.3'
      gateways:
        - device: '192.168.XX.XX'
          persistence_file: /config/mysensors.json
    

    I have also tried a mysensors version of 2.2, but no change.

    Home Assistant log:

    Config directory: /config
    2019-03-23 22:58:02 ERROR (SyncWorker_0) [homeassistant.util.yaml] YAML file /config/configuration.yaml contains duplicate key "notify". Check lines 73 and 79.
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded updater from homeassistant.components.updater
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded owntracks from homeassistant.components.owntracks
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded webhook from homeassistant.components.webhook
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded http from homeassistant.components.http
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded map from homeassistant.components.map
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded shell_command from homeassistant.components.shell_command
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded custom_updater from custom_components.custom_updater
    2019-03-23 22:58:03 WARNING (MainThread) [homeassistant.loader] You are using a custom component for custom_updater which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded script from homeassistant.components.script
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded group from homeassistant.components.group
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded mqtt from homeassistant.components.mqtt
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded frontend from homeassistant.components.frontend
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded api from homeassistant.components.api
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded websocket_api from homeassistant.components.websocket_api
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded system_log from homeassistant.components.system_log
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded auth from homeassistant.components.auth
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded onboarding from homeassistant.components.onboarding
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded lovelace from homeassistant.components.lovelace
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded sensor from homeassistant.components.sensor
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded system_health from homeassistant.components.system_health
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded device_tracker from homeassistant.components.device_tracker
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded zone from homeassistant.components.zone
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded tts from homeassistant.components.tts
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded sun from homeassistant.components.sun
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded logger from homeassistant.components.logger
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded conversation from homeassistant.components.conversation
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded input_boolean from homeassistant.components.input_boolean
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded twilio from homeassistant.components.twilio
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded input_datetime from homeassistant.components.input_datetime
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded person from homeassistant.components.person
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded logbook from homeassistant.components.logbook
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded recorder from homeassistant.components.recorder
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded notify from homeassistant.components.notify
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded automation from homeassistant.components.automation
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded history from homeassistant.components.history
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded mysensors from homeassistant.components.mysensors
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded config from homeassistant.components.config
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.bootstrap] Home Assistant core initialized
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.setup] Setting up mqtt
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.loader] Loaded mqtt.server from homeassistant.components.mqtt.server
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.setup] Setting up logger
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.setup] Setup of domain logger took 0.0 seconds.
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.setup] Setting up recorder
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.setup] Setting up http
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.setup] Setup of domain http took 0.0 seconds.
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.setup] Setting up lovelace
    2019-03-23 22:58:03 INFO (MainThread) [homeassistant.setup] Setup of domain lovelace took 0.0 seconds.
    2019-03-23 22:58:04 INFO (MainThread) [transitions.core] Exited state new
    2019-03-23 22:58:04 INFO (MainThread) [transitions.core] Entered state starting
    2019-03-23 22:58:04 INFO (MainThread) [homeassistant.setup] Setting up system_log
    2019-03-23 22:58:04 INFO (MainThread) [homeassistant.setup] Setup of domain system_log took 0.0 seconds.
    2019-03-23 22:58:04 INFO (MainThread) [homeassistant.setup] Setting up api
    2019-03-23 22:58:04 INFO (MainThread) [homeassistant.setup] Setting up websocket_api
    2019-03-23 22:58:04 INFO (MainThread) [homeassistant.setup] Setup of domain websocket_api took 0.0 seconds.
    2019-03-23 22:58:04 INFO (MainThread) [homeassistant.setup] Setting up auth
    2019-03-23 22:58:04 INFO (MainThread) [homeassistant.setup] Setup of domain auth took 0.0 seconds.
    2019-03-23 22:58:04 INFO (MainThread) [homeassistant.setup] Setting up onboarding
    2019-03-23 22:58:04 INFO (MainThread) [homeassistant.setup] Setup of domain api took 0.0 seconds.
    2019-03-23 22:58:04 INFO (MainThread) [hbmqtt.broker] Listener 'default' bind to 0.0.0.0:1883 (max_connections=-1)
    2019-03-23 22:58:04 INFO (MainThread) [homeassistant.setup] Setup of domain recorder took 1.4 seconds.
    2019-03-23 22:58:04 INFO (MainThread) [hbmqtt.broker] Listener 'ws-1' bind to 0.0.0.0:8080 (max_connections=-1)
    2019-03-23 22:58:04 INFO (MainThread) [transitions.core] Exited state starting
    2019-03-23 22:58:04 INFO (MainThread) [transitions.core] Entered state started
    2019-03-23 22:58:04 INFO (MainThread) [homeassistant.setup] Setup of domain mqtt took 1.4 seconds.
    2019-03-23 22:58:04 INFO (MainThread) [homeassistant.setup] Setup of domain onboarding took 0.0 seconds.
    2019-03-23 22:58:04 INFO (MainThread) [homeassistant.setup] Setting up history
    2019-03-23 22:58:04 INFO (MainThread) [homeassistant.setup] Setup of domain history took 0.0 seconds.
    2019-03-23 22:58:04 INFO (MainThread) [homeassistant.setup] Setting up frontend
    2019-03-23 22:58:05 INFO (MainThread) [hbmqtt.broker] Listener 'default': 1 connections acquired
    2019-03-23 22:58:05 INFO (MainThread) [hbmqtt.broker] Connection from 127.0.0.1:57651 on listener 'default'
    2019-03-23 22:58:05 INFO (MainThread) [homeassistant.setup] Setup of domain frontend took 0.7 seconds.
    2019-03-23 22:58:06 INFO (MainThread) [transitions.core] Exited state new
    2019-03-23 22:58:06 INFO (MainThread) [transitions.core] Entered state connected
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.setup] Setting up updater
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.setup] Setting up map
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.setup] Setup of domain map took 0.0 seconds.
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.setup] Setting up shell_command
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.setup] Setup of domain shell_command took 0.0 seconds.
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.loader] Loaded mqtt.sensor from homeassistant.components.mqtt.sensor
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.loader] Loaded sensor.time_date from homeassistant.components.sensor.time_date
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.setup] Setting up sensor
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.loader] Loaded device_tracker.luci from homeassistant.components.device_tracker.luci
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.loader] Loaded google from homeassistant.components.google
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.loader] Loaded google.tts from homeassistant.components.google.tts
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.setup] Setting up sun
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.setup] Setup of domain sun took 0.1 seconds.
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.setup] Setting up zone
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.setup] Setup of domain zone took 0.0 seconds.
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.setup] Setting up input_boolean
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.setup] Setting up input_datetime
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.setup] Setting up group
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.setup] Setup of domain group took 0.0 seconds.
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.setup] Setting up person
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.loader] Loaded notify.twilio_sms from homeassistant.components.notify.twilio_sms
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.setup] Setting up notify
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.setup] Setting up mysensors
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.time_date
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.setup] Setup of domain updater took 0.5 seconds.
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.setup] Setting up script
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.setup] Setup of domain script took 0.0 seconds.
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.setup] Setting up webhook
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.setup] Setup of domain webhook took 0.0 seconds.
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.setup] Setting up system_health
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.setup] Setup of domain system_health took 0.0 seconds.
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.setup] Setting up device_tracker
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.setup] Setting up tts
    2019-03-23 22:58:06 INFO (MainThread) [homeassistant.setup] Setting up conversation
    2019-03-23 22:58:07 INFO (MainThread) [homeassistant.setup] Setup of domain conversation took 0.0 seconds.
    2019-03-23 22:58:07 INFO (MainThread) [homeassistant.setup] Setting up logbook
    2019-03-23 22:58:07 INFO (MainThread) [homeassistant.setup] Setup of domain logbook took 0.0 seconds.
    2019-03-23 22:58:07 INFO (MainThread) [homeassistant.setup] Setting up automation
    2019-03-23 22:58:07 INFO (MainThread) [homeassistant.setup] Setting up config
    2019-03-23 22:58:07 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.mqtt
    2019-03-23 22:58:07 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.mqtt
    2019-03-23 22:58:07 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.mqtt
    2019-03-23 22:58:07 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.mqtt
    2019-03-23 22:58:07 DEBUG (SyncWorker_21) [mysensors.persistence] Loading sensors from persistence file /config/mysensors.json
    [SNIP]
    2019-03-23 22:58:07 DEBUG (SyncWorker_9) [mysensors.persistence] Saving sensors to persistence file /config/mysensors.json
    2019-03-23 22:58:07 INFO (MainThread) [homeassistant.setup] Setup of domain config took 0.2 seconds.
    2019-03-23 22:58:07 INFO (MainThread) [homeassistant.setup] Setup of domain tts took 0.2 seconds.
    2019-03-23 22:58:07 INFO (MainThread) [homeassistant.setup] Setup of domain notify took 0.5 seconds.
    2019-03-23 22:58:07 INFO (MainThread) [homeassistant.setup] Setup of domain mysensors took 0.4 seconds.
    2019-03-23 22:58:07 INFO (MainThread) [homeassistant.setup] Setup of domain input_boolean took 0.6 seconds.
    2019-03-23 22:58:07 INFO (MainThread) [homeassistant.setup] Setup of domain input_datetime took 0.6 seconds.
    2019-03-23 22:58:07 INFO (MainThread) [homeassistant.setup] Setup of domain automation took 0.2 seconds.
    2019-03-23 22:58:07 INFO (MainThread) [homeassistant.setup] Setup of domain person took 0.6 seconds.
    2019-03-23 22:58:07 INFO (MainThread) [mysensors.gateway_tcp] Trying to connect to ('192.168.1.25', 5003)
    2019-03-23 22:58:07 INFO (MainThread) [homeassistant.setup] Setup of domain sensor took 0.7 seconds.
    2019-03-23 22:58:07 INFO (MainThread) [mysensors] Connected to <TCPTransport closed=False reading=False 0x55b5d4923eb8>
    [SNIP]
    2019-03-23 22:58:17 DEBUG (MainThread) [mysensors] Sending 0;255;3;0;2;
    2019-03-23 22:58:17 DEBUG (MainThread) [mysensors] Receiving 0;255;3;0;14;Gateway startup complete.
    2019-03-23 22:58:17 INFO (MainThread) [mysensors.handler] n:0 c:255 t:3 s:14 p:Gateway startup complete.
    2019-03-23 22:58:17 DEBUG (MainThread) [homeassistant.components.mysensors.gateway] Node update: node 0 child 255
    2019-03-23 22:58:17 DEBUG (MainThread) [mysensors] Sending 255;255;3;0;20;
    2019-03-23 22:58:17 DEBUG (MainThread) [mysensors] Receiving 0;255;0;0;18;2.3.1
    2019-03-23 22:58:17 DEBUG (MainThread) [homeassistant.components.mysensors.gateway] Node update: node 0 child 255
    2019-03-23 22:58:17 INFO (MainThread) [homeassistant.bootstrap] Home Assistant initialized in 14.47s
    2019-03-23 22:58:17 INFO (MainThread) [homeassistant.core] Starting Home Assistant
    2019-03-23 22:58:17 DEBUG (MainThread) [mysensors] Receiving 0;255;3;0;2;2.3.1
    [SNIP]
    2019-03-23 22:58:27 DEBUG (SyncWorker_32) [mysensors.persistence] Saving sensors to persistence file /config/mysensors.json
    2019-03-23 22:58:27 DEBUG (MainThread) [mysensors] Sending 0;255;3;0;2;
    2019-03-23 22:58:27 DEBUG (MainThread) [mysensors] Receiving 0;255;3;0;2;2.3.1
    

    Hope I've provided enough info here.

    Thanks.

    Home Assistant

  • 💬 In Wall AC/DC Pcb (with Relay) for MySensors (SMD)
    AdamAntA AdamAnt

    reat looking project! Are the packages and silk screen for the two fuses custom? I'm terrible at creating eagle, parts, was wondering where you got them from. Thanks!

    OpenHardware.io switch in-wall relay acdc hlk-pm01
  • Login

  • Don't have an account? Register

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