MYSController problem


  • Admin

    Topic moved to this section / Repost from @Roman:

    Hi!

    tekka, I have the following problem.
    When using command transportInit ();
    node stops MYSController execute commands: reboot, debug.
    However, standard data MySensors continue to be transmitted / received without any problems.

    lib MySensors: 2.1.0
    MYSBootloader: MYSBL13pre_atmega328_8Mhz.hex

       #ifdef MY_DEBUG
          Serial.println("nRF24 Power off. Slipping...");
       #endif
          digitalWrite(nRF24_POWER_PIN, HIGH); // disabled nRF24
          smartSleep(PRIMARY_BUTTON_PIN-2, CHANGE, SECONDARY_BUTTON_PIN-2, CHANGE, SLEEP_TIME);
       
          #ifdef MY_DEBUG
              Serial.println("nRF24 Power on. Init radio");
          #endif
          digitalWrite(nRF24_POWER_PIN, LOW); // enabled nRF24
          wait(10);
          transportInit(); 
          wait(50);
    

  • Admin

    @Roman
    Please post the full sketch including node debug log & MYSController debug log.



  • Download the appropriate files.
    If you remove transportInit (), it works fine!

    0_1483373112509_log_node_63.txt
    0_1483373124600_MySensors_20170102-183456.log
    0_1483373167341_SensorDoorNRF24.ino


  • Admin

    @Roman

    When using command transportInit ();
    node stops MYSController execute commands: reboot, debug.

    Can you post or indicate the log snippets that show the behavior mentioned above?



  • I removed a few lines:

    //      digitalWrite(nRF24_POWER_PIN, HIGH); // отключаем nRF24 перед сном
          sleep(PRIMARY_BUTTON_PIN-2, CHANGE, SECONDARY_BUTTON_PIN-2, CHANGE, SLEEP_TIME);
       
          #ifdef MY_DEBUG
              Serial.println("nRF24 Power on. Init radio");
          #endif
    //      digitalWrite(nRF24_POWER_PIN, LOW); // включаем nRF24 после сна
          wait(10);
    //      transportInit();  // инициализируем радио после сна
          wait(50);
    

    Controller:

    02.01.2017 20:46:35	CLICK	Battery powered=TRUE
    02.01.2017 20:46:45	INFO	Node trigger set, node=63, trigger=1
    02.01.2017 20:47:08	RX	63;255;3;0;22;712
    02.01.2017 20:47:08	INFO	Retained message triggered for release, node=63
    02.01.2017 20:47:08	TX	63;0;3;0;28;V
    02.01.2017 20:47:08	RX	63;255;3;0;28;3215
    02.01.2017 20:47:08	RX	63;2;1;0;16;1
    

    Node

    nRF24 Power off. Slipping...
    11356 MCO:SLP:MS=3600000,SMS=0,I1=0,M1=1,I2=1,M2=1
    11362 MCO:SLP:TPD
    11364 MCO:SLP:WUP=1
    nRF24 Power on. Init radio
    11429 TSF:MSG:SEND,63-63-0-0,s=255,c=3,t=22,pt=5,l=4,sg=0,ft=0,st=OK:712
    11438 TSF:MSG:READ,0-0-63,s=0,c=3,t=28,pt=0,l=1,sg=0:V
    11517 TSF:MSG:SEND,63-63-0-0,s=255,c=3,t=28,pt=3,l=2,sg=0,ft=0,st=OK:3215
    11526 TSF:MSG:SEND,63-63-0-0,s=2,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:1
    11759 TSF:MSG:SEND,63-63-0-0,s=3,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:25.63
    25.62
    116
    Vmax: 1.00
    Battery Voltage: 0.49 V
    Battery percent: 49 %
    11780 TSF:MSG:SEND,63-63-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=0,st=OK:49
    nRF24 Power off. Slipping..
    

    According to the logs it can be seen that the controller sent a team, and host response to the command.

    I think that after the application transportInit(), unit stops accepting requests. I did an experiment with the function request(). The situation is completely repeated. When using transportInit() node does not receive a response from the controller to function request(). If not transportInit(), the node successfully receives the response request() function.


  • Admin

    @Roman ok, after powering down the radio (HW powerdown) you also have to re-set the node ID:

    Please try this solution:

          digitalWrite(nRF24_POWER_PIN, HIGH); // отключаем nRF24 перед сном
          sleep(PRIMARY_BUTTON_PIN-2, CHANGE, SECONDARY_BUTTON_PIN-2, CHANGE, SLEEP_TIME);
       
          #ifdef MY_DEBUG
              Serial.println("nRF24 Power on. Init radio");
          #endif
          digitalWrite(nRF24_POWER_PIN, LOW); // включаем nRF24 после сна
          wait(10);
          transportInit();  // инициализируем радио после сна
          transportAssignNodeID(getNodeId());
          wait(50);
    


  • Thank you began working commands: reboot and debug!

    The next problem 🙂
    Not running firmware.... The node is overloaded, but there is no start the firmware download.
    I'm testing on a standard sketch "Repeater Node"

    03.01.2017 19:59:50	RX	1;255;0;0;18;2.1.0
    03.01.2017 19:59:50	NODE	New node discovered, node id=1
    03.01.2017 19:59:50	CHILD	New child discovered, node id=1, child id=internal
    03.01.2017 19:59:50	DEBUG	Update child id=255, type=S_ARDUINO_REPEATER_NODE
    03.01.2017 19:59:50	RX	1;255;3;0;6;0
    03.01.2017 19:59:50	TX	1;255;3;0;6;M
    03.01.2017 19:59:50	RX	1;255;3;0;11;Repeater Node
    03.01.2017 19:59:50	RX	1;255;3;0;12;1.0
    03.01.2017 19:59:59	CLICK	Board with MYSBootloader=TRUE
    03.01.2017 20:00:09	TX	1;0;3;0;13;0
    03.01.2017 20:00:09	INFO	FW "SensorDoorNRF24" assigned to node 1
    03.01.2017 20:00:12	RX	1;255;0;0;18;2.1.0
    03.01.2017 20:00:12	CHILD	New child discovered, node id=1, child id=internal
    03.01.2017 20:00:12	DEBUG	Update child id=255, type=S_ARDUINO_REPEATER_NODE
    03.01.2017 20:00:12	RX	1;255;3;0;6;0
    03.01.2017 20:00:12	TX	1;255;3;0;6;M
    03.01.2017 20:00:12	RX	1;255;3;0;11;Repeater Node
    03.01.2017 20:00:12	RX	1;255;3;0;12;1.0
    

    node

    0 MCO:BGN:INIT REPEATER,CP=RNNRA--,VER=2.1.0
    4 MCO:BGN:BFR
    4 TSM:INIT
    6 TSF:WUR:MS=0
    14 TSM:INIT:TSP OK
    16 TSF:SID:OK,ID=1
    16 TSM:FPAR
    55 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    2062 !TSM:FPAR:NO REPLY
    2064 TSM:FPAR
    2101 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    3069 TSF:MSG:READ,0-0-1,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    3076 TSF:MSG:FPAR OK,ID=0,D=1
    4110 TSM:FPAR:OK
    4110 TSM:ID
    4112 TSF:MSG:READ,2-2-1,s=255,c=3,t=8,pt=1,l=1,sg=0:1
    4118 !TSF:MSG:FPAR INACTIVE
    4122 TSM:ID:OK
    4122 TSM:UPL
    4126 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
    4134 TSF:MSG:READ,0-0-1,s=255,c=3,t=25,pt=1,l=1,sg=0:1
    4141 TSF:MSG:PONG RECV,HP=1
    4143 TSM:UPL:OK
    4145 TSM:READY:ID=1,PAR=0,DIS=1
    4149 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    4157 TSF:MSG:READ,0-0-1,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    4165 TSF:MSG:SEND,1-1-0-0,s=255,c=0,t=18,pt=0,l=5,sg=0,ft=0,st=OK:2.1.0
    4175 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
    4184 TSF:MSG:READ,0-0-1,s=255,c=3,t=6,pt=0,l=1,sg=0:M
    4192 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=11,pt=0,l=13,sg=0,ft=0,st=OK:Repeater Node
    4202 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.0
    4210 MCO:REG:REQ
    4214 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
    4220 TSF:MSG:READ,0-0-1,s=255,c=3,t=27,pt=1,l=1,sg=0:1
    4227 MCO:PIM:NODE REG=1
    4229 MCO:BGN:STP
    4231 MCO:BGN:INIT OK,TSP=1
    23971 TSF:MSG:READ,0-0-1,s=0,c=3,t=13,pt=0,l=1,sg=0:0
    0 MCO:BGN:INIT REPEATER,CP=RNNRA--,VER=2.1.0
    4 MCO:BGN:BFR
    4 TSM:INIT
    6 TSF:WUR:MS=0
    14 TSM:INIT:TSP OK
    16 TSF:SID:OK,ID=1
    16 TSM:FPAR
    55 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    626 TSF:MSG:READ,0-0-1,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    632 TSF:MSG:FPAR OK,ID=0,D=1
    876 TSF:MSG:READ,2-2-1,s=255,c=3,t=8,pt=1,l=1,sg=0:1
    2062 TSM:FPAR:OK
    2062 TSM:ID
    2064 TSM:ID:OK
    2066 TSM:UPL
    2070 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
    2076 TSF:MSG:READ,0-0-1,s=255,c=3,t=25,pt=1,l=1,sg=0:1
    2082 TSF:MSG:PONG RECV,HP=1
    2086 TSM:UPL:OK
    2088 TSM:READY:ID=1,PAR=0,DIS=1
    2093 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    2101 TSF:MSG:READ,0-0-1,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    2109 TSF:MSG:SEND,1-1-0-0,s=255,c=0,t=18,pt=0,l=5,sg=0,ft=0,st=OK:2.1.0
    2119 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
    2127 TSF:MSG:READ,0-0-1,s=255,c=3,t=6,pt=0,l=1,sg=0:M
    2138 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=11,pt=0,l=13,sg=0,ft=0,st=OK:Repeater Node
    2150 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.0
    2156 MCO:REG:REQ
    2160 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
    2168 TSF:MSG:READ,0-0-1,s=255,c=3,t=27,pt=1,l=1,sg=0:1
    2174 MCO:PIM:NODE REG=1
    2177 MCO:BGN:STP
    2179 MCO:BGN:INIT OK,TSP=1
    

  • Admin

    @Roman There is no sign of MYSBootloader - at least not in the log you posted. Please make sure you flashed the bootloader according to the instructions.



    1. I flashed MYSBL13pre_atmega328_16Mhz.hex in Arduino Pro Mini, works!
    2. I flashed MYSBL13pre_atmega328_8Mhz.hex in the printed circuit board.
    3. I loaded RepeaterNode sketch and add a line:
    void before() // nRF24. Power ON
    {
      pinMode(5, OUTPUT);
      digitalWrite(5, LOW);
    }
    

    because I need to supply power to the nRF24.
    4. Logs again one to one as described above 😞

    May be a problem in the loader MYSBL13pre_atmega328_8Mhz.hex?

    fuse
    0_1483519760556_123.PNG


  • Admin

    @Roman MYSBootloader does not handle your type of setup, i.e. controlling radio power via pin. For the sake of simplicity (sketch, sleep, bootloader, etc.) and the low power down current of the radio (0.9uA) I suggest wiring the radio as described in the instructions.



  • @tekka Thank you very much for your help!

    The problem was controlling radio power via pin.
    A software power off, the current is 0.25 mA (nRF24 made in China). When disconnecting the power supply via pin, the current is 0.005mA (5uA).

    In the future, do you plan to add power supply via pin?


  • Admin



  • @tekka said:

    Issue created

    SUPER! 😃


Log in to reply
 

Suggested Topics

  • 3
  • 2
  • 3
  • 24
  • 2
  • 15

24
Online

11.2k
Users

11.1k
Topics

112.5k
Posts