[solved] RFM69 based nodes unable to report Lib Version


  • Hero Member

    Maybe it is just me but it seems like RFM69 based nodes are unable to report MySensors Lib Version. I noticed that none of my nodes has reported Lib version.

    Debug output from a Sensebender RFM69 based node:

    MCO:BGN:INIT NODE,CP=RRNNA--,VER=2.0.1-beta
    TSM:INIT
    TSM:INIT:TSP OK
    TSM:INIT:STATID,ID=101
    TSF:ASID:OK,ID=101
    TSM:FPAR
    TSF:MSG:SEND,101-101-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
    TSF:MSG:READ,0-0-101,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    TSF:MSG:FPAR RES,ID=0,D=0
    TSF:MSG:FPAR OK,ID=0,D=1
    TSM:FPAR:OK
    TSM:ID
    TSM:ID:OK,ID=101
    TSM:UPL
    TSF:PING:SEND,TO=0
    TSF:MSG:SEND,101-101-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
    TSF:MSG:READ,0-0-101,s=255,c=3,t=25,pt=1,l=1,sg=0:1
    TSF:MSG:PONG RECV,HP=1
    TSF:CHKUPL:OK
    TSM:UPL:OK
    TSM:READY
    TSF:MSG:SEND,101-101-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    !TSF:MSG:SEND,101-101-0-0,s=255,c=0,t=17,pt=0,l=10,sg=0,ft=0,st=NACK:2.0.1-beta
    TSF:MSG:SEND,101-101-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=1,st=OK:0
    TSF:MSG:READ,0-0-101,s=255,c=3,t=6,pt=0,l=1,sg=0:M
    TSF:MSG:SEND,101-101-0-0,s=255,c=3,t=11,pt=0,l=19,sg=0,ft=0,st=OK:SBenderDoorLockRF69
    TSF:MSG:SEND,101-101-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.4
    TSF:MSG:SEND,101-101-0-0,s=1,c=0,t=6,pt=0,l=0,sg=0,ft=0,st=OK:
    TSF:MSG:SEND,101-101-0-0,s=2,c=0,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    TSF:MSG:SEND,101-101-0-0,s=3,c=0,t=0,pt=0,l=0,sg=0,ft=0,st=OK:
    MCO:REG:REQ
    TSF:MSG:SEND,101-101-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
    TSF:MSG:READ,0-0-101,s=255,c=3,t=27,pt=1,l=1,sg=0:1
    MCO:PIM:NODE REG=1
    MCO:BGN:STP
    Sensebender Micro FW 1.4 - Online!
    isMetric: 1
    TempDiff :126.18
    HumDiff  :131.00
    T: 26.18
    H: 31
    TSF:MSG:SEND,101-101-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:26.2
    TSF:MSG:SEND,101-101-0-0,s=2,c=1,t=1,pt=2,l=2,sg=0,ft=0,st=OK:31
    TSF:MSG:SEND,101-101-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=0,st=OK:91
    MCO:BGN:INIT OK,ID=101,PAR=0,DIS=1,REG=1
    TempDiff :0.01
    HumDiff  :0.00
    TSF:MSG:SEND,101-101-0-0,s=3,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=OK:1
    MCO:SLP:MS=60000,SMS=0,I1=1,M1=1,I2=255,M2=255
    MCO:SLP:TPD
    MCO:SLP:WUP=-1
    TempDiff :0.21
    HumDiff  :1.00
    T: 25.97
    H: 29
    TSF:MSG:SEND,101-101-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:26.0
    TSF:MSG:SEND,101-101-0-0,s=2,c=1,t=1,pt=2,l=2,sg=0,ft=0,st=OK:29
    MCO:SLP:MS=60000,SMS=0,I1=1,M1=1,I2=255,M2=255
    MCO:SLP:TPD
    

    Some logging from MYSController 1.0.0 Beta:

    17.10.2016 9:12:02	RX	0;255;3;0;9;TSF:MSG:READ,101-101-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    17.10.2016 9:12:02	RX	0;255;3;0;9;TSF:MSG:BC
    17.10.2016 9:12:02	RX	0;255;3;0;9;TSF:MSG:FPAR REQ,ID=101
    17.10.2016 9:12:02	RX	0;255;3;0;9;TSF:CHKUPL:OK
    17.10.2016 9:12:02	RX	0;255;3;0;9;TSF:MSG:GWL OK
    17.10.2016 9:12:02	RX	0;255;3;0;9;TSF:MSG:SEND,0-0-101-101,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0
    17.10.2016 9:12:04	RX	0;255;3;0;9;TSF:MSG:READ,101-101-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
    17.10.2016 9:12:04	RX	0;255;3;0;9;TSF:MSG:PINGED,ID=101,HP=1
    17.10.2016 9:12:04	RX	0;255;3;0;9;TSF:MSG:SEND,0-0-101-101,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=OK:1
    17.10.2016 9:12:04	RX	0;255;3;0;9;TSF:MSG:READ,101-101-0,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    17.10.2016 9:12:04	RX	0;255;3;0;9;!TSF:MSG:SEND,0-0-101-101,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=NACK:0100
    17.10.2016 9:12:04	RX	0;255;3;0;9;TSF:MSG:READ,101-101-0,s=255,c=3,t=6,pt=1,l=1,sg=0:0
    17.10.2016 9:12:04	RX	101;255;3;0;6;0
    17.10.2016 9:12:04	TX	101;255;3;0;6;M
    17.10.2016 9:12:04	RX	0;255;3;0;9;TSF:MSG:SEND,0-0-101-101,s=255,c=3,t=6,pt=0,l=1,sg=0,ft=0,st=OK:M
    17.10.2016 9:12:04	RX	0;255;3;0;9;TSF:MSG:READ,101-101-0,s=255,c=3,t=11,pt=0,l=19,sg=0:SBenderDoorLockRF69
    17.10.2016 9:12:04	RX	101;255;3;0;11;SBenderDoorLockRF69
    17.10.2016 9:12:04	RX	0;255;3;0;9;TSF:MSG:READ,101-101-0,s=255,c=3,t=12,pt=0,l=3,sg=0:1.4
    17.10.2016 9:12:04	RX	101;255;3;0;12;1.4
    17.10.2016 9:12:04	RX	0;255;3;0;9;TSF:MSG:READ,101-101-0,s=1,c=0,t=6,pt=0,l=0,sg=0:
    17.10.2016 9:12:04	RX	101;1;0;0;6;
    17.10.2016 9:12:04	DEBUG	Update child id=1, type=S_TEMP
    17.10.2016 9:12:04	RX	0;255;3;0;9;TSF:MSG:READ,101-101-0,s=2,c=0,t=7,pt=0,l=0,sg=0:
    17.10.2016 9:12:04	RX	101;2;0;0;7;
    17.10.2016 9:12:04	DEBUG	Update child id=2, type=S_HUM
    17.10.2016 9:12:04	RX	0;255;3;0;9;TSF:MSG:READ,101-101-0,s=3,c=0,t=0,pt=0,l=0,sg=0:
    17.10.2016 9:12:04	RX	101;3;0;0;0;
    17.10.2016 9:12:04	DEBUG	Update child id=3, type=S_DOOR
    17.10.2016 9:12:04	RX	0;255;3;0;9;TSF:MSG:READ,101-101-0,s=255,c=3,t=26,pt=1,l=1,sg=0:2
    17.10.2016 9:12:04	RX	0;255;3;0;9;TSF:MSG:SEND,0-0-101-101,s=255,c=3,t=27,pt=1,l=1,sg=0,ft=0,st=OK:1
    17.10.2016 9:12:05	RX	0;255;3;0;9;TSF:MSG:READ,101-101-0,s=1,c=1,t=0,pt=7,l=5,sg=0:26.2
    17.10.2016 9:12:05	RX	101;1;1;0;0;26.2
    17.10.2016 9:12:05	RX	0;255;3;0;9;TSF:MSG:READ,101-101-0,s=2,c=1,t=1,pt=2,l=2,sg=0:31
    17.10.2016 9:12:05	RX	101;2;1;0;1;31
    17.10.2016 9:12:05	RX	0;255;3;0;9;TSF:MSG:READ,101-101-0,s=255,c=3,t=0,pt=1,l=1,sg=0:91
    17.10.2016 9:12:05	RX	101;255;3;0;0;91
    17.10.2016 9:12:05	RX	0;255;3;0;9;TSF:MSG:READ,101-101-0,s=3,c=1,t=16,pt=2,l=2,sg=0:1
    17.10.2016 9:12:05	RX	101;3;1;0;16;1
    17.10.2016 9:12:37	RX	0;255;3;0;9;TSF:SANCHK:OK
    17.10.2016 9:13:09	RX	0;255;3;0;9;TSF:MSG:READ,101-101-0,s=1,c=1,t=0,pt=7,l=5,sg=0:26.0
    17.10.2016 9:13:09	RX	101;1;1;0;0;26.0
    17.10.2016 9:13:09	RX	0;255;3;0;9;TSF:MSG:READ,101-101-0,s=2,c=1,t=1,pt=2,l=2,sg=0:29
    17.10.2016 9:13:09	RX	101;2;1;0;1;29
    17.10.2016 9:13:37	RX	0;255;3;0;9;TSF:SANCHK:OK
    17.10.2016 9:14:37	RX	0;255;3;0;9;TSF:SANCHK:OK
    

    I'm running MySensors Lib Version 2.0.1-beta (build from a few weeks back).

    EDIT: Updated to the current MySensors Lib Development build and it is stil the same.
    EDIT2: I just noticed that "Parent node:" information is also empty for RFM69 nodes in my Vera Controller.


  • Hardware Contributor

    @korttoma
    i'm working on rfm69 so i put this on my list 😉


  • Hero Member

    @scalz said:

    @korttoma
    i'm working on rfm69 so i put this on my list 😉

    If you get to the point where you have something that could be tested please feel free to let me know.
    I have a small setup that I use for testing so I could possibly help with testing even if I have limited hardware.


  • Hardware Contributor

    @korttoma

    I have not looked at your msg version problem yet.

    Well if you want to try something it's possible...so here it is:

    Don't try the listenmode for the moment plz 🙂
    I'm not sure yet, but i think i will remove conditional define on ATC as it does not use lot of mem. etc..

    Do you use softspi, w5100. I have all hardware but no time to test this part. This should work now.

    Sidenote:
    I'm ok to help one or two betatester only for the moment. Lucky!
    Be a little bit more patient, PR should go soon now as you can see from the current status 😉

    Enjoy 😃


  • Hero Member

    I've tinkered a little w5100-RFM69-gateway lateley wich works with the softspi implementation I've tried to push the other day. I'll give your implementation a try at the weekend.


  • Hardware Contributor

    @TimO

    ah okay! welcome betatester 🙂


  • Admin

    @korttoma

    The node seems to send parent info here:

    TSF:MSG:SEND,101-101-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=1,st=OK:0

    And myscontroller logs this:

    17.10.2016 9:12:04 RX 101;255;3;0;6;0



  • @scalz said:

    Be a little bit more patient, PR should go soon now as you can see from the current status 😉

    It's great to see work being put into the RFM69 driver. I have tried to install your code and updated my gateway and a sensor node

    On the sensor node I added

    sendSignalStrength(1);
    sendRadioTxLevel(1);
    

    and in the debug window I see

    6899 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=29,pt=1,l=1,sg=0,ft=0,st=OK:51
    7035 !TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=30,pt=1,l=1,sg=0,ft=0,st=NACK:0
    

    Message type 30 always fails (st=NACK) - is this expected?

    Gateway is ESP8266 and node is Anarduino (328p+RFM69CW)



  • @korttoma

    I get exactly the same bug. I found a way to solve it, but not sure if it's the root cause.
    I use RFM69W and the latest release from the Development Branch.

    From your message dump:

    TSF:MSG:SEND,101-101-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    !TSF:MSG:SEND,101-101-0-0,s=255,c=0,t=17,pt=0,l=10,sg=0,ft=0,st=NACK:2.0.1-beta
    TSF:MSG:SEND,101-101-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=1,st=OK:0
    

    The Internal Presentation Message with Lib Version as payload always fails. (!TSF: c=0, t=17, st=NACK:2.0.1-beta)

    The message is sent immediately after the previously sent internal message (TSF: c=3, t=15, st=OK:0100) (t=15 => I_REQUEST_SIGNING).
    The Gateway responds the Signing Preference Message to the node exactly at the same time the node tries to send the Lib Version Presentation Message to the Gateway. Seems that won't work. There's no buffering?
    I added a 1s delay for test purpose in MySensorsCore.cpp to give time to finish the response from the gateway before sending the Lib Version Presentation Message.

    New message dump from my test-node after changes:

    TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    TSF:MSG:READ,0-0-3,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    TSF:MSG:SEND,3-3-0-0,s=255,c=0,t=17,pt=0,l=10,sg=0,ft=0,st=OK:2.0.1-beta
    TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
    

    Now a new message appears in the node, the response message from the Gateway to the Signing Preference Message, and the presentation of the Lib Version works as expected.

    TSF:MSG:READ,0-0-3,s=255,c=3,t=15,pt=6,l=2,sg=0:0100 
    TSF:MSG:SEND,3-3-0-0,s=255,c=0,t=17,pt=0,l=10,sg=0,ft=0,st=OK:2.0.1-beta
    

    In MySensorsCore.cpp at line 216 I added a wait(1000); to mitigate the issue.

    	// Send signing preferences for this node to the GW
    	signerPresentation(_msgTmp, GATEWAY_ADDRESS);
    
    wait(1000);
    
    		// Send presentation for this radio node
    	#if defined(MY_REPEATER_FEATURE)
    		(void)present(NODE_SENSOR_ID, S_ARDUINO_REPEATER_NODE);
    	#else
    		(void)present(NODE_SENSOR_ID, S_ARDUINO_NODE);
    	#endif
    

    I guess the final patch would look different and would need to be looked into by @Anticimex or @hek. 😃


  • Contest Winner

    @jpaulin the signing backend is already waiting for the GW to send a message. So if it is not waiting long enough I believe the existing delay should be increased instead: https://github.com/mysensors/MySensors/blob/development/core/MySigning.cpp#L158


  • Admin

    @Anticimex This is a conditional wait(), i.e. only when signing is enabled: https://github.com/mysensors/MySensors/blob/development/core/MySigning.cpp#L154-L160

    Since the GW always replies to signing preferences, but the node only waits if signing is enabled - this message will eventually collide with the following lib version message, as seen above.

    I suggest removing the surrounding #ifdef.


  • Contest Winner

    @tekka true. Moving the existing delay outside the preprocessor condition should help.


  • Contest Winner

    @jpaulin could you please file a pull request with the delay moved outside the preprocessor condition (as you have the rig to verify the change works)?



  • @Anticimex
    I don't know how to file a pull request, so I put the test results here.

    Modified as follows to remove the preprocessor condition at: https://github.com/mysensors/MySensors/blob/development/core/MySigning.cpp#L154-L160

    // #if defined(MY_SIGNING_FEATURE)
        // If we do support signing, wait for the gateway to tell us how it prefer us to transmit our messages
        if (destination == GATEWAY_ADDRESS) {
    	    SIGN_DEBUG(PSTR("Waiting for GW to send signing preferences...\n"));
    	    wait(2000, C_INTERNAL, I_SIGNING_PRESENTATION);
    }
    // #endif
    

    solves the issue.

    At the same time the internal message received from the gateway seems to be erroneously transferred to the receive() function in a sketch. Adding to the sketch

    void receive(const MyMessage &message) {
        Serial.println("something came in");
    }
    

    gets the message dump:

    2310 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    2332 TSF:MSG:READ,0-0-3,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    something came in
    2409 TSF:MSG:SEND,3-3-0-0,s=255,c=0,t=17,pt=0,l=10,sg=0,ft=0,st=OK:2.0.1-beta
    2496 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
    

    To solve this I made the following change to _processInternalMessages(void) in MySensorsCore.cpp.
    Line https://github.com/mysensors/MySensors/blob/development/core/MySensorsCore.cpp#L407 is replaced with:

    	else if (type == I_SIGNING_PRESENTATION) {
    	}
    	else return false;
    

    The message dump now looks like this:

    2250 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    2269 TSF:MSG:READ,0-0-3,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    2331 TSF:MSG:SEND,3-3-0-0,s=255,c=0,t=17,pt=0,l=10,sg=0,ft=0,st=OK:2.0.1-beta
    2441 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
    

    At the API description page https://www.mysensors.org/download/serial_api_20 seems to be another error.
    For the internal message t=15 the name description

    I_REQUEST_SIGNING 	15 	Used between sensors when initialting signing.
    

    should be changed to

    I_SIGNING_PRESENTATION 	15 	Provides signing related preferences.
    

    This I think is relevant both for the master and the development branch.


  • Contest Winner

    @jpaulin thanks for the updates. I will have a look at making a pr when I get opportunity. @hek does the documentation issue sound familiar? 😉


  • Contest Winner

    @jpaulin I have made a pull request. My solution differs slightly from your as the I_SIGNING_PRESENTATION should never reach the _processInternalMessages function. I do however not have the ability to test so I would appreciate if you could test the PR for me?
    Thanks for finding and pointing out the flaws! 😄



  • @Anticimex
    I updated my node and GW with your pull request and made some basic tests and it seems to work ok with my sketch. I added MY_DEBUG_VERBOSE_SIGNING and got the following messages.

    From the node:

    2205 TSM:READY
    2220 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    2226 Waiting for GW to send signing preferences...
    2280 TSF:MSG:READ,0-0-3,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    2285 Received signing presentation, but signing is not supported (message ignored)
    2349 TSF:MSG:SEND,3-3-0-0,s=255,c=0,t=17,pt=0,l=10,sg=0,ft=0,st=OK:2.0.1-beta
    2450 TSF:MSG:SEND,3-3-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
    

    From the GW:

    0;255;3;0;9;TSF:MSG:PINGED,ID=3,HP=1
    0;255;3;0;9;TSF:MSG:SEND,0-0-3-3,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=OK:1
    0;255;3;0;9;TSF:MSG:READ,3-3-0,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    0;255;3;0;9;Informing node 3 that we do not require signatures because we do not support it
    0;255;3;0;9;TSF:MSG:SEND,0-0-3-3,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    0;255;3;0;9;TSF:MSG:READ,3-3-0,s=255,c=0,t=17,pt=0,l=10,sg=0:2.0.1-beta
    0;255;3;0;9;Sending message on topic: my_RFM69_gw1-out/3/255/0/0/17
    0;255;3;0;9;TSF:MSG:READ,3-3-0,s=255,c=3,t=6,pt=1,l=1,sg=0:0
    

    Do you need some more testing?


  • Contest Winner

    @jpaulin thanks for testing. The change should have little effect for people using signing. The issue is for people who does not use it as the node did not wait for a gw response in that case.


  • Hero Member

    tried the latest development branch on my test system and the results are good so far. Now I just need to update my "real" system also. Thanks to everyone that participated in solving this!!


  • Hero Member

    Updated now also 2 nodes in my "real" system and both now successfully reported Lib version. I did not update the GW. Maybe it is safe to say that the Lib reporting problem is solved now.

    Now I will try to look in to the sofSerial RFM69 solution that @scalz is working on, do you have any eta on when you will try to include our solution in the official MySensors development branch?
    Any recommendations for the wiring of an W5100/RFM69 Gateway?


  • Hardware Contributor

    i have removed my stuff for the moment..
    for integration in mysensors, it's coreteam work in progress, thx to @Tekka 😉
    Once, someone smart told me that 1+1=3, quite true 🙂 and with Tekka i think we can say = 4 ahah
    So for an eta.., i prefer not saying anything lol, just i'm back on this for the week, i was playing with other stuff..



  • @korttoma I have an up and running RFM69 GW with W5100 (actually a W5500, but it's the same). I'm not using softSerial in my setup. With this it is possible to integrate with eg. Moteino or Anarduino, which comes with the radio chip preinstalled on the Arduino compatible boards. But a standard arduino with a separate chip would work as well (lower price). The GW-RFM69 has been stable and flawless, as far as I can see, for quite some time. The SPI for the RFM69 and W5500 uses the following pins in my setup.

    RFM69W:

    • SCK = 13
    • MISO = 12
    • MOSI = 11
    • CS = 10
    • IRQ = 2

    W5500:

    • SCK = 13
    • MISO = 12
    • MOSI = 11
    • CS = 7

    I'll try to share wire diagrams and software setup later. I had to do some tweakings in the ethernet.h file to make it work.


  • Hero Member

    @jpaulin I am very interested in your solution. Could it work with a normal Arduino Pro mini 3,3V version? Just so that I know if I need to order some parts or can work with what I have.



  • @korttoma
    Yes, it should work with an Arduino Pro Mini 3.3V. Personally I'm using for the moment an Anarduino. But it's almost the same.



  • @korttoma
    My RFM69 - Ethernet - GW has the following setup.

    On the RFM69 radio I'm using D10 as CS pin (Chip Select). This is because in my case the RFM69 radio is hard-wired to pin D10, as with eg. a Moteino or Anarduino. But this is not mandatory. If you use an Arduino Pro Mini you could select another pin for the RFM69 CS-pin on the Arduino, if you want.

    The Ethernet W5100 uses the Arduino IDE pre-installed library Ethernet.h. In the library the CS-pin is as well fixed to D10. CS of course has to be unique for each SPI slave device. I changed directly in the Ethenet.h library the CS pin to be D7. But D9, D8 or some other pin is ok to use as well.

    Take care, if none of your SPI Slave devices (radio and W5100) uses D10 as CS-pin. In this case make sure to set the D10 pin to OUTPUT in your sketch to keep the Arduino as SPI Master. On the ATmega328 the D10 pin is hard-wired to be the SS pin (Slave Select). The Arduino has to always be the SPI Master and the devices SPI Slaves on the SPI bus to get everything to work.

    Another consideration is:
    The RFM69 radio uses the SPI functions during the interrupt sequence (Pin D2). The Ethernet.h library won't work correctly if another device uses SPI signalling during an interrupt sequence. The fix I'm using is to block interrupts from the radio-unit during SPI usage of the W5100 unit. I haven't seen any flaws with this fix so far. I've found other people on the internet using the same fix too without issues.

    To use RFM69 CS=D10 pin and W5100 CS=D9 pin do the following change in the W5100.h that is part of the Ethernet library.
    If you use a Windows computer you'll find the file here:

    C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility\w5100.h

    Look for the following lines at the end of the file.

    #else
      inline static void initSS()    { DDRB  |=  _BV(2); };
      inline static void setSS()     { PORTB &= ~_BV(2); };
      inline static void resetSS()   { PORTB |=  _BV(2); };
    #endif
    

    If you use D9 as CS pin for the W5100 module change as follows:

    #else
      inline static void initSS()    { DDRB  |=  _BV(1); };
      inline static void setSS()     { cli(); PORTB &= ~_BV(1); };
      inline static void resetSS()   { PORTB |=  _BV(1); sei(); };
    #endif
    

    If you uses, as I do, D7 as CS pin then change as follows:

    #else
      inline static void initSS()    { DDRD  |=  _BV(7); };
      inline static void setSS()     { cli(); PORTD &= ~_BV(7); };
      inline static void resetSS()   { PORTD |=  _BV(7); sei(); };
    #endif
    

    If you want to keep D10 for the W5100 just add the cli(); and sei(); macros. (cli = clear interrupt. sei = set interrupt).

    If you want to use another SPI CS pin than D10 on the RFM69 radio (eg. D9) it should be safe to modify it directly in the sketch with the preprocessor constant:

    #define MY_RF69_SPI_CS 9
    

    For the MOSI, MISO and SCK pins use as mentioned above, they are as well hard-wired in the ATmega328 chip to D11,D12 and D13.

    If you have any doubts please let me know.


  • Hero Member

    Hi @jpaulin thanks for this, I will test it immediately.

    Would you mind sharing your complete sketch? The MySensors W5100 GW example has all this Soft SPI stuff, I might make a mistake clearing out all the unnecessary parts.

    Btw, do you see any problem with me adding some local "sensors" to this type of GW? I would like to add 4 relays and 4 buttons to it also.


  • Hero Member

    It is alive 😄

    I managed to get a W5100 RFM69 Gateway working.
    I wanted minimal change to the w5100.h so I just added the cli(); and sei(); macros.
    (I would still like to see your sketch @jpaulin to compare)

    There are some random failures in the RF communication but these might be because of the breadboard setup. I just have one temp sensor sending in some value now to test with.



  • @korttoma
    Here's my sketch. It's an MQTT GW with LEDs.

    /**
     * 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-2015 Sensnology AB
     * Full contributor list: https://github.com/mysensors/Arduino/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
     * The W5100 MQTT gateway sends radio network (or locally attached sensors) data to your MQTT broker.
     * The node also listens to MY_MQTT_TOPIC_PREFIX and sends out those messages to the radio network
     *
     * LED purposes:
     * - RX (yellow) - blink fast on radio message recieved. In inclusion mode will blink fast only on presentation received
     * - TX (green) - 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
     *
     */
    
    
    // Enable debug prints to serial monitor
    #define MY_DEBUG
    
    // Enables and select radio type (if attached)
    //#define MY_RADIO_NRF24
    #define MY_RADIO_RFM69
    
    #define MY_RFM69_FREQUENCY   RF69_433MHZ
    
    
    #define MY_GATEWAY_MQTT_CLIENT
    
    // Set this node's subscribe and publish topic prefix
    #define MY_MQTT_PUBLISH_TOPIC_PREFIX "my_RFM69_gw1-out"
    #define MY_MQTT_SUBSCRIBE_TOPIC_PREFIX "my_RFM69_gw1-in"
    
    // Set MQTT client id
    #define MY_MQTT_CLIENT_ID "mysensors_RFM69-1"
    
    // W5100 Ethernet module SPI enable (optional if using a shield/module that manages SPI_EN signal)
    //#define MY_W5100_SPI_EN 4
    
    // Enable these if your MQTT broker requires username/password
    //#define MY_MQTT_USER "username"
    //#define MY_MQTT_PASSWORD "password"
    
    // Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP)
    #define MY_IP_ADDRESS 192,168,1,93
    
    // If using static ip you need to define Gateway and Subnet address as well
    #define MY_IP_GATEWAY_ADDRESS 192,168,1,1
    #define MY_IP_SUBNET_ADDRESS 255,255,255,0
    
    // MQTT broker ip address or url. Define one or the other.
    //#define MY_CONTROLLER_URL_ADDRESS "m20.cloudmqtt.com"
    #define MY_CONTROLLER_IP_ADDRESS 192, 168, 1, 90
    
    // The MQTT broker port to to open
    #define MY_PORT 1883
    
    
    // Set blinking period
    #define MY_DEFAULT_LED_BLINK_PERIOD 50
    
    // Flash leds on rx/tx/err
    // Uncomment to override default HW configurations
    #define MY_DEFAULT_ERR_LED_PIN A3  // Error led pin
    #define MY_DEFAULT_RX_LED_PIN  A2  // Receive led pin
    #define MY_DEFAULT_TX_LED_PIN  A0  // Transmit led pin
    
    
    #include <Ethernet.h>    // modified for W5500 module and with CS pin = D7 (Default CS pin D10 is already used by RFM69W module)
    #include <MySensors.h>
    
    void setup() {
    }
    
    void presentation() {
      // Present locally attached sensors here
    }
    
    void loop() {
      // Send locally attached sensors data here
    }
    

  • Hardware Contributor

    little side note about the rfm69 driver : it will use spitransaction which should solve this, with some noint/int should be ok. (https://www.arduino.cc/en/Tutorial/SPITransaction)


  • Hero Member

    @jpaulin Thanks, not much different from my sketch I see:

    // Enable debug prints to serial monitor
    #define MY_DEBUG 
    
    // Enable and select radio type attached
    #define MY_RADIO_RFM69
    #define MY_RFM69_FREQUENCY RF69_433MHZ
    #define MY_RF69_SPI_CS 9
    // Enable gateway ethernet module type 
    #define MY_GATEWAY_W5100
    
    
    #define MY_IP_ADDRESS 192,168,1,25   // If this is disabled, DHCP is used to retrieve address
    
    // The port to keep open on node server mode / or port to contact in client mode
    #define MY_PORT 5003      
    
    // 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
    
    // Flash leds on rx/tx/err
    //#define MY_LEDS_BLINKING_FEATURE
    // Set blinking period
    #define MY_DEFAULT_LED_BLINK_PERIOD 300
    
    // 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 
    
    // Uncomment to override default HW configurations
    //#define MY_DEFAULT_ERR_LED_PIN 7  // Error led pin
    //#define MY_DEFAULT_RX_LED_PIN  8  // Receive led pin
    //#define MY_DEFAULT_TX_LED_PIN  9  // the PCB, on board LED
    
    #include <SPI.h>
    
    #if defined(MY_USE_UDP)
      #include <EthernetUdp.h>
    #endif
    #include <Ethernet.h>
    #include <MySensors.h>
    
    
    void setup(){
    }
    
    void loop() {
    }
    

    It has been running for a few hours now without issues. Gona try adding the buttons and relays tomorrow.


  • Hero Member

    Adding the relays and buttons seems to work fine also. I will go with this setup now until there is a "Official" solution for the GatewayW5100RFM69.

    /**
     * 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-2015 Sensnology AB
     * Full contributor list: https://github.com/mysensors/Arduino/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 Tomas Hozza <thozza@gmail.com>
     *
     *
     * DESCRIPTION
     * The EthernetGateway sends data received from sensors to the ethernet link.
     * The gateway also accepts input on ethernet interface, which is then sent out to the radio network.
     *
     * The GW code is designed for Arduino 328p / 16MHz.  ATmega168 does not have enough memory to run this program.
     *
     * LED purposes:
     * - To use the feature, uncomment WITH_LEDS_BLINKING in MyConfig.h
     * - RX (green) - blink fast on radio message recieved. In inclusion mode will blink fast only on presentation recieved
     * - TX (yellow) - blink fast on radio message transmitted. In inclusion mode will blink slowly
     * - ERR (red) - fast blink on error during transmission error or recieve crc error
     *
     * See http://www.mysensors.org/build/ethernet_gateway for wiring instructions.
     *
     */
    
    // Enable debug prints to serial monitor
    #define MY_DEBUG 
    #define SN "EthGW/RFM69 Rele Button"
    #define SV "1.0"
    
    // Enable and select radio type attached
    //#define MY_RADIO_NRF24
    #define MY_RADIO_RFM69
    #define MY_RFM69_FREQUENCY RF69_433MHZ
    #define MY_RF69_SPI_CS 9
    // 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 10  
    
    // 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.
    
    
    // Enable to UDP          
    //#define MY_USE_UDP
    
    #define MY_IP_ADDRESS 192,168,1,25   // 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
    
    // Flash leds on rx/tx/err
    //#define MY_LEDS_BLINKING_FEATURE
    // Set blinking period
    #define MY_DEFAULT_LED_BLINK_PERIOD 300
    
    // 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 
    
    // Uncomment to override default HW configurations
    //#define MY_DEFAULT_ERR_LED_PIN 7  // Error led pin
    //#define MY_DEFAULT_RX_LED_PIN  8  // Receive led pin
    //#define MY_DEFAULT_TX_LED_PIN  9  // the PCB, on board LED
    
    #include <SPI.h>
    
    #if defined(MY_USE_UDP)
      #include <EthernetUdp.h>
    #endif
    #include <Ethernet.h>
    #include <MySensors.h>
    #include <Bounce2.h>
    #define RELAY_ON 0                      // switch around for ACTIVE LOW / ACTIVE HIGH relay
    #define RELAY_OFF 1
    //
    
    #define noRelays 4                     //2-4
    
    const int relayPin[] = {14, 15, 16, 17};       //  switch around pins to your desire
    const int buttonPin[] = {6, 7, 4, 5};   //  switch around pins to your desire
    
    class Relay             // relay class, store all relevant data (equivalent to struct)
    {
      public:
        int buttonPin;                   // physical pin number of button
        int relayPin;             // physical pin number of relay
        boolean relayState;               // relay status (also stored in EEPROM)
    };
    
    Relay Relays[noRelays];
    Bounce debouncer[noRelays];
    MyMessage msg[noRelays];
    
    void setup() {
      wait(100);
      // Initialize Relays with corresponding buttons
      for (int i = 0; i < noRelays; i++) {
        Relays[i].buttonPin = buttonPin[i];              // assign physical pins
        Relays[i].relayPin = relayPin[i];
        msg[i].sensor = i;                                   // initialize messages
        msg[i].type = V_LIGHT;
        pinMode(Relays[i].buttonPin, INPUT_PULLUP);
        wait(100);
        pinMode(Relays[i].relayPin, OUTPUT);
        Relays[i].relayState = loadState(i);                               // retrieve last values from EEPROM
        digitalWrite(Relays[i].relayPin, Relays[i].relayState ? RELAY_ON : RELAY_OFF); // and set relays accordingly
        send(msg[i].set(Relays[i].relayState ? true : false));                 // make controller aware of last status
        wait(50);
        debouncer[i] = Bounce();                        // initialize debouncer
        debouncer[i].attach(buttonPin[i]);
        debouncer[i].interval(30);
        wait(50);
      }
    }
    
    void presentation()
    {
      // Send the sketch version information to the gateway and Controller
      sendSketchInfo(SN, SV);
    
      wait(100);
    
      for (int i = 0; i < noRelays; i++)
        present(i, S_LIGHT);                               // present sensor to gateway
    
      wait(100);
    }
    
    
    void loop()
    {
      for (byte i = 0; i < noRelays; i++) {
        if (debouncer[i].update()) {
          
          int value = debouncer[i].read();
          
          if ( value == LOW) {
            Relays[i].relayState = !Relays[i].relayState;
            digitalWrite(Relays[i].relayPin, Relays[i].relayState ? RELAY_ON : RELAY_OFF);
            send(msg[i].set(Relays[i].relayState ? true : false));
            // save sensor state in EEPROM (location == sensor number)
            saveState( i, Relays[i].relayState );
    
          }
    
        }
      }
      //wait(20);
    }
    
    void receive(const MyMessage &message) {
      if (message.type == V_LIGHT) {
        if (message.sensor < noRelays) {          // check if message is valid for relays..... previous line  [[[ if (message.sensor <=noRelays){ ]]]
          Relays[message.sensor].relayState = message.getBool();
          digitalWrite(Relays[message.sensor].relayPin, Relays[message.sensor].relayState ? RELAY_ON : RELAY_OFF); // and set relays accordingly
          saveState( message.sensor, Relays[message.sensor].relayState ); // save sensor state in EEPROM (location == sensor number)
        }
      }
      wait(20);
    }
    


  • @korttoma Excellent news. So now we are at least two with a stable RFM69-Ethernet-GW. 😃



  • @korttoma Sharing a pair of photos of my gw. Became pretty neat, I think. It's parked permanently beside the WiFi Router.
    0_1478804847890_IMG_5989.JPG

    0_1478804919975_IMG_6002.JPG


  • Hero Member

    I've seen pictures of your GW in another thread, it is very nice and professional @jpaulin

    I stil have some parts missing from my GW build so I only have the breadboard setup right now.


  • Hardware Contributor

    @TimO
    Hi.
    Sorry for delay, so much projects.
    As you tried to make a push, when you'll have some time, could you tell me if SOFTSPI is working please ? i'm a bit lazy to make a w5100 setup, as i'm not using it.

    https://github.com/scalz/Mysensors/tree/rfm69_update

    Set of defines is

    //#define MY_DEBUG
    //#define MY_DEBUG_VERBOSE_RFM69
    #define MY_RFM69_FREQUENCY   RFM69_868MHZ // RFM69_433MHZ for 433MHz, RFM69_868MHZ for default 868MHz or RF69_915MHZ for 915MHz
    //#define MY_IS_RFM69HW // uncomment this if you're running the RFM69HW model
    
    //#define MY_RFM69_TX_POWER_DBM (5) // default
    //#define MY_RFM69_ATC_TARGET_RSSI_DBM	(-80) // default
    //#define MY_RFM69_ATC_MODE_DISABLED
    //#define MY_RFM69_NETWORKID     100  // default
    //#define MY_RFM69_ENABLE_ENCRYPTION
    
    //#define MY_RFM69_RST_PIN 9
    //#define MY_RFM69_IRQ_PIN 5
    //#define MY_RFM69_SPI_CS 23
    
    
    // For Advanced users
    //#define MY_RFM69_SPI_MAX_SPEED (4000000ul)
    //#define MY_RFM69_BITRATE_MSB RFM69_BITRATEMSB_55555  // Bitrate is for users who knows what they're doing as it can impact your network reliabilty, and read the datasheet/registers.h file to get the right bitrate.
    //#define MY_RFM69_BITRATE_LSB RFM69_BITRATELSB_55555  // So bitrates are hardwritten values
    
    // Before radio sending, random delay, to be sure that two nodes which were waiting for free channel, doesn't send at same time and collide
    // delay = MY_RFM69_CSMA_ADD_DELAY_BASE * random(1,MY_RFM69_CSMA_ADD_DELAY_COUNT)
    
    //#define MY_RFM69_CSMA_ADD_DELAY_BASE 50  // default 50ms
    //#define MY_RFM69_CSMA_ADD_DELAY_COUNT 10 // default max 10 counts
    

    Note these are my defines for my ATSAM gw.

    You can also send RSSI and powerlevel as internal msg by doing, like sendBattery function works.
    Example:

    /* ======================================================================
    Function: sendRadioStats
    Purpose : Sends radio rssi and powerlevel values
    Input   : - force : Forces transmission of a value (even if it's the same as previous measurement)
                   - ack : boolean. true if ack needed
    Output  : - true if transmission occured
    Comments:
    ========================================================================= */
    bool sendRadioStats(bool force, bool ack)
    {
       static int16_t lastRssi=0;
    
       int16_t rssiVal = transportGetRSSI();
       uint8_t txPower = transportGetTxPower();
    
       if (abs(lastRssi - rssiVal) >= 10 || force == true) {
          force = sendSignalStrength(rssiVal, ack);
          force |= sendTXPowerLevel(txPower, ack);
          lastRssi = rssiVal;
       }
    
       return force;
    }
    

  • Hero Member

    Hey @scalz !

    My last test a few days ago was not successful with SoftSPI but I did not have the time to debug it. I'll give it another try!


  • Hardware Contributor

    @TimO
    oki thx. Perhaps it was because of the w5100 CS define? i'll take a look.


  • Hero Member

    @scalz

    Okay, I found a little bit time to test and to check the wiring I've build a breadboard version.

    Here's my sketch:

    #define MY_DEBUG
    #define MY_DEBUG_VERBOSE_RFM69
    
    // Enable and select radio type attached
    //#define MY_RADIO_NRF24
    #define MY_RADIO_RFM69
    
    #define MY_RFM69_FREQUENCY   RF69_868MHZ
    
    // signing
    //#define MY_SIGNING_SOFT
    //#define MY_SIGNING_REQUEST_SIGNATURES
    
    // 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 A0
      #define MY_SOFT_SPI_MISO_PIN A2
      #define MY_SOFT_SPI_MOSI_PIN A1
    #endif
    
    #define MY_RF69_SPI_CS 5
    #define MY_RF69_IRQ_PIN 2
    
    // Enable to UDP
    //#define MY_USE_UDP
    
    #define MY_IP_ADDRESS 192,168,2,222   // 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 0xDF, 0xCD, 0xCD, 0xAF, 0xFE, 0xED
    
    
    #if defined(MY_USE_UDP)
      #include <EthernetUdp.h>
    #endif
    #include <Ethernet.h>
    #include <MySensors.h>
    
    
    void setup()
    {
    }
    
    void loop() {
    }
    
    

    Nothing that fancy. Some defines are using RFM69 while others use RF69 (IRQ, CS PIN).

    The init is not working. I've inserted a serial print to see where it stops working. Here's the serial output:

    0;255;3;0;9;MCO:BGN:INIT GW,CP=RRNGA--,VER=2.1.0-beta
    0;255;3;0;9;TSM:INIT
    0;255;3;0;9;TSF:WUR:MS=0
    before
    0;255;3;0;9;!TSM:INIT:TSP FAIL
    0;255;3;0;9;TSM:FAIL:CNT=1
    0;255;3;0;9;TSM:FAIL:PDT
    0;255;3;0;9;TSM:FAIL:RE-INIT
    0;255;3;0;9;TSM:INIT
    

    It stops there. No more retries, nothing more.

    Here's were the error seems to occure (line 116 of RFM69.cpp):

    setHighPower(_isRFM69HW); // called regardless if it's a RFM69W or RFM69HW
    	setMode(RF69_MODE_STANDBY);
    	start = millis();
    		Serial.println("before");
    	while (((readReg(REG_IRQFLAGS1) & RF_IRQFLAGS1_MODEREADY) == 0x00) && millis()-start < timeout) {
    		yield();
    	} // wait for ModeReady
    	if (millis()-start >= timeout) {
    		return false;
    	}
    		Serial.println("after");
    
    	attachInterrupt(_interruptNum, RFM69::isr0, RISING);
    
    	selfPointer = this;
    	_address = nodeID;
    	return true;
    

    The second debug output "after" is never reached.

    If I disable RFM69 in the sketch and upload it, the ethernet part comes up just fine. The gateway is reachable per ping and telnet.

    I've tested against my initial implementation: https://github.com/tobof/MySensors
    The gateway comes up and is able to receive messages.
    Here's the debug:

    0;255;3;0;9;MCO:BGN:INIT GW,CP=RRNGA--,VER=2.0.1-beta
    0;255;3;0;9;TSM:INIT
    0;255;3;0;9;TSM:INIT:TSP OK
    0;255;3;0;9;TSM:INIT:GW MODE
    0;255;3;0;9;TSM:READY
    IP: 192.168.2.222
    0;255;3;0;9;MCO:REG:NOT NEEDED
    0;255;3;0;9;MCO:BGN:STP
    0;255;3;0;9;MCO:BGN:INIT OK,ID=0,PAR=0,DIS=0,REG=1
    0;255;3;0;9;TSF:MSG:READ,111-111-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    0;255;3;0;9;TSF:MSG:BC
    0;255;3;0;9;TSF:MSG:FPAR REQ,ID=111
    0;255;3;0;9;TSF:CKU:OK,FCTRL
    0;255;3;0;9;TSF:MSG:GWL OK
    0;255;3;0;9;TSF:MSG:SEND,0-0-111-111,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0
    0;255;3;0;9;TSF:MSG:READ,111-111-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
    0;255;3;0;9;TSF:MSG:PINGED,ID=111,HP=1
    0;255;3;0;9;TSF:MSG:SEND,0-0-111-111,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=OK:1
    0;255;3;0;9;TSF:MSG:READ,111-111-0,s=255,c=3,t=15,pt=6,l=2,sg=0:0101
    0;255;3;0;9;TSF:MSG:SEND,0-0-111-111,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    0;255;3;0;9;TSF:MSG:READ,111-111-0,s=255,c=0,t=18,pt=0,l=5,sg=0:2.0.0
    0;255;3;0;9;TSF:MSG:READ,111-111-0,s=255,c=3,t=6,pt=1,l=1,sg=0:0
    0;255;3;0;9;TSF:MSG:READ,111-111-0,s=255,c=3,t=11,pt=0,l=5,sg=0:Relay
    0;255;3;0;9;TSF:MSG:READ,111-111-0,s=255,c=3,t=12,pt=0,l=3,sg=0:1.0
    0;255;3;0;9;TSF:MSG:READ,111-111-0,s=1,c=0,t=3,pt=0,l=0,sg=0:
    0;255;3;0;9;TSF:MSG:READ,111-111-0,s=2,c=0,t=3,pt=0,l=0,sg=0:
    0;255;3;0;9;TSF:MSG:READ,111-111-0,s=3,c=0,t=3,pt=0,l=0,sg=0:
    0;255;3;0;9;TSF:MSG:READ,111-111-0,s=4,c=0,t=3,pt=0,l=0,sg=0:
    0;255;3;0;9;TSF:MSG:READ,111-111-0,s=5,c=0,t=3,pt=0,l=0,sg=0:
    0;255;3;0;9;TSF:MSG:READ,111-111-0,s=6,c=0,t=3,pt=0,l=0,sg=0:
    0;255;3;0;9;TSF:MSG:READ,111-111-0,s=7,c=0,t=3,pt=0,l=0,sg=0:
    0;255;3;0;9;TSF:MSG:READ,111-111-0,s=8,c=0,t=3,pt=0,l=0,sg=0:
    0;255;3;0;9;TSF:MSG:READ,111-111-0,s=255,c=3,t=26,pt=1,l=1,sg=0:2
    0;255;3;0;9;TSF:MSG:SEND,0-0-111-111,s=255,c=3,t=27,pt=1,l=1,sg=0,ft=0,st=OK:1
    0;255;3;0;9;TSF:MSG:READ,111-111-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    0;255;3;0;9;TSF:MSG:BC
    0;255;3;0;9;TSF:MSG:FPAR REQ,ID=111
    0;255;3;0;9;TSF:PNG:SEND,TO=0
    0;255;3;0;9;TSF:CKU:OK
    0;255;3;0;9;TSF:MSG:GWL OK
    0;255;3;0;9;TSF:MSG:SEND,0-0-111-111,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0
    0;255;3;0;9;TSF:MSG:READ,111-111-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
    0;255;3;0;9;TSF:MSG:PINGED,ID=111,HP=1
    0;255;3;0;9;TSF:MSG:SEND,0-0-111-111,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=OK:1
    0;255;3;0;9;TSF:MSG:READ,111-111-0,s=255,c=3,t=15,pt=6,l=2,sg=0:0101
    0;255;3;0;9;TSF:MSG:SEND,0-0-111-111,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    0;255;3;0;9;TSF:MSG:READ,111-111-0,s=255,c=0,t=18,pt=0,l=5,sg=0:2.0.0
    0;255;3;0;9;TSF:MSG:READ,111-111-0,s=255,c=3,t=6,pt=1,l=1,sg=0:0
    0;255;3;0;9;TSF:MSG:READ,111-111-0,s=255,c=3,t=11,pt=0,l=5,sg=0:Relay
    0;255;3;0;9;TSF:MSG:READ,111-111-0,s=255,c=3,t=12,pt=0,l=3,sg=0:1.0
    0;255;3;0;9;TSF:MSG:READ,111-111-0,s=1,c=0,t=3,pt=0,l=0,sg=0:
    0;255;3;0;9;TSF:MSG:READ,111-111-0,s=2,c=0,t=3,pt=0,l=0,sg=0:
    0;255;3;0;9;TSF:MSG:READ,111-111-0,s=3,c=0,t=3,pt=0,l=0,sg=0:
    0;255;3;0;9;TSF:MSG:READ,111-111-0,s=4,c=0,t=3,pt=0,l=0,sg=0:
    0;255;3;0;9;TSF:MSG:READ,111-111-0,s=5,c=0,t=3,pt=0,l=0,sg=0:
    0;255;3;0;9;TSF:MSG:READ,111-111-0,s=6,c=0,t=3,pt=0,l=0,sg=0:
    0;255;3;0;9;TSF:MSG:READ,111-111-0,s=7,c=0,t=3,pt=0,l=0,sg=0:
    0;255;3;0;9;TSF:MSG:READ,111-111-0,s=8,c=0,t=3,pt=0,l=0,sg=0:
    0;255;3;0;9;TSF:MSG:READ,111-111-0,s=255,c=3,t=26,pt=1,l=1,sg=0:2
    0;255;3;0;9;TSF:MSG:SEND,0-0-111-111,s=255,c=3,t=27,pt=1,l=1,sg=0,ft=0,st=OK:1
    

    So I suppose the wiring is okay. I hope this helps!


  • Hardware Contributor

    @TimO
    Your screenshots are based on the old driver 😉
    You need to use "rfm69_update branch" on my repo. the whole repo. It's based on dev branch, few days ago, with the latest driver.

    https://github.com/scalz/Mysensors/tree/rfm69_update

    Thx for your tests and feedbacks 🙂


  • Hero Member

    @scalz dammit! 😞

    Okay, so this time the compiler is throwing errors.

    Here are the ones I ruled out:

    diff --git a/drivers/RFM69/RFM69.cpp b/drivers/RFM69/RFM69.cpp
    index 10d8369..f068ef1 100644
    --- a/drivers/RFM69/RFM69.cpp
    +++ b/drivers/RFM69/RFM69.cpp
    @@ -79,16 +79,20 @@ LOCAL void RFM69_prepareSPITransaction(void)
     #endif
     
        // set RFM69 SPI settings
    +   #if !defined(MY_SOFTSPI) && defined(SPI_HAS_TRANSACTION)
        _SPI.setDataMode(RFM69_SPI_DATA_MODE);
        _SPI.setBitOrder(RFM69_SPI_DATA_ORDER);
        _SPI.setClockDivider(RFM69_SPI_MAX_SPEED); // decided to slow down from DIV2 after SPI stalling in some instances, especially visible on mega1284p when RFM69 and FLASH chip both present
    +   #endif
     #endif
     }
     
     LOCAL void RFM69_concludeSPITransaction(void)
     {
    -#ifdef SPI_HAS_TRANSACTION
    -   _SPI.endTransaction();
    +#ifdef SPI_HAS_TRANSACTION 
    +   #if !defined(MY_SOFTSPI)
    +      _SPI.endTransaction();
    +   #endif
     #else
        // restore SPI settings to what they were before talking to RFM69
     #if defined (SPCR) && defined (SPSR)
    @@ -199,7 +203,9 @@ LOCAL bool RFM69_initialise(const float frequency)
        // IRQ
        pinMode(RFM69_IRQ_DIO_PIN, INPUT);
     #if defined (SPI_HAS_TRANSACTION) && !defined (ESP8266)
    -   _SPI.usingInterrupt(digitalPinToInterrupt(RFM69_IRQ_DIO_PIN));
    +   #if !defined(MY_SOFTSPI)
    +      _SPI.usingInterrupt(digitalPinToInterrupt(RFM69_IRQ_DIO_PIN));
    +   #endif
     #endif
     
        attachInterrupt(digitalPinToInterrupt(RFM69_IRQ_DIO_PIN), RFM69_interruptHandler, RISING);
    @@ -1120,4 +1126,4 @@ void readAllRegs(void)
     		}
     #endif
     	}
    -}
    \ No newline at end of file
    +}
    diff --git a/drivers/RFM69/RFM69.h b/drivers/RFM69/RFM69.h
    index 433d6e1..8326f6e 100644
    --- a/drivers/RFM69/RFM69.h
    +++ b/drivers/RFM69/RFM69.h
    @@ -78,11 +78,13 @@
     
     #define RFM69_SPI_CS		(SS)
     
    +#define RFM69_SPI_DATA_MODE		SPI_MODE0		//!< SPI mode
    +
     // SPI settings
     #if defined (ARDUINO) && !defined (__arm__) && !defined (_SPI)
     #include <SPI.h>
     #if defined(MY_SOFTSPI)
    -SoftSPI<MY_SOFT_SPI_MISO_PIN, MY_SOFT_SPI_MOSI_PIN, MY_SOFT_SPI_SCK_PIN, MY_RFM69_SPI_DATA_MODE> _SPI;
    +SoftSPI<MY_SOFT_SPI_MISO_PIN, MY_SOFT_SPI_MOSI_PIN, MY_SOFT_SPI_SCK_PIN, RFM69_SPI_DATA_MODE> _SPI;
     #else
     #define _SPI SPI
     #endif
    @@ -100,7 +102,7 @@ extern HardwareSPI SPI;		//!< SPI
     
     
     #define RFM69_SPI_DATA_ORDER	MSBFIRST		//!< SPI data order
    -#define RFM69_SPI_DATA_MODE		SPI_MODE0		//!< SPI mode
    +
     #if !defined(MY_RFM69_SPI_MAX_SPEED)
     #define RFM69_SPI_MAX_SPEED		(2000000ul)	//!< SPI speed
     #else
    @@ -524,4 +526,4 @@ void readAllRegs(void);
     
     #endif
     
    -/** @}*/
    \ No newline at end of file
    +/** @}*/
    

    (I only have time for a diff, sorry)

    After the changes it gets stuck here:

    In file included from /home/toberfoe/Arduino/libraries/MySensors/MySensors.h:306:0,
                     from /home/toberfoe/ownCloud/workspace/Testumgebung/Gateway-5100-RFM69/GatewayW5100/GatewayW5100.ino:100:
    /home/toberfoe/Arduino/libraries/MySensors/core/MyTransportRFM69.cpp:25:1: error: 'RFM69' does not name a type
     RFM69 _radio(MY_RF69_SPI_CS, MY_RF69_IRQ_PIN, MY_RFM69HW, MY_RF69_IRQ_NUM);
     ^
    /home/toberfoe/Arduino/libraries/MySensors/core/MyTransportRFM69.cpp: In function 'bool transportInit()':
    /home/toberfoe/Arduino/libraries/MySensors/core/MyTransportRFM69.cpp:32:6: error: '_radio' was not declared in this scope
      if (_radio.initialize(MY_RFM69_FREQUENCY, _address, MY_RFM69_NETWORKID)) {
          ^
    /home/toberfoe/Arduino/libraries/MySensors/core/MyTransportRFM69.cpp: In function 'void transportSetAddress(uint8_t)':
    /home/toberfoe/Arduino/libraries/MySensors/core/MyTransportRFM69.cpp:47:2: error: '_radio' was not declared in this scope
      _radio.setAddress(address);
      ^
    /home/toberfoe/Arduino/libraries/MySensors/core/MyTransportRFM69.cpp: In function 'bool transportSend(uint8_t, const void*, uint8_t)':
    /home/toberfoe/Arduino/libraries/MySensors/core/MyTransportRFM69.cpp:57:9: error: '_radio' was not declared in this scope
      return _radio.sendWithRetry(to,data,len);
             ^
    /home/toberfoe/Arduino/libraries/MySensors/core/MyTransportRFM69.cpp: In function 'bool transportAvailable()':
    /home/toberfoe/Arduino/libraries/MySensors/core/MyTransportRFM69.cpp:62:9: error: '_radio' was not declared in this scope
      return _radio.receiveDone();
             ^
    /home/toberfoe/Arduino/libraries/MySensors/core/MyTransportRFM69.cpp: In function 'uint8_t transportReceive(void*)':
    /home/toberfoe/Arduino/libraries/MySensors/core/MyTransportRFM69.cpp:73:28: error: '_radio' was not declared in this scope
      memcpy(data,(const void *)_radio.DATA, _radio.DATALEN);
                                ^
    /home/toberfoe/Arduino/libraries/MySensors/core/MyTransportRFM69.cpp: In function 'void transportPowerDown()':
    /home/toberfoe/Arduino/libraries/MySensors/core/MyTransportRFM69.cpp:85:2: error: '_radio' was not declared in this scope
      _radio.sleep();
      ^
    exit status 1
    

    I have no time to investigate it further till saturday. 😕


  • Hardware Contributor

    this is because you have not completely updated your Mysensors folder.
    The driver only is not enough because there are changes in others files like MyTransportRFM69.cpp, MyConfig etc..


  • Hero Member

    @scalz I'm using a clone of your github repo and changed to rfm69_update branch. I have not replaced single files.


  • Hardware Contributor

    @TimO
    Oh my bad!
    I didn't update MyTransportRFM69.cpp on my git (because i've two branch locally, and forgot about this one..). I've just pushed it. Downloaded my repo again, and it compiles fine now 😉

    sorry for waste of time, pff 😊

    Also, if someone wants to try using W5100 and RFM69 on the same SPI bus (so not in softspi mode). I'm interested to know if it's working. As W5100 and the new RFM69 are using SPI transactions, and in RFM69 it now uses the spi.usinginterrupts , so it might work.
    Note: as it's hardwritten in w5100 lib (not cool!), easier for tests to use

    • D10 for your w5100 SPI CS
    • what you want for your RFM69 SPI CS. example for D6, using #define MY_RFM69_SPI_CS 6

  • Hero Member

    Okay, so next run. 😄

    I've pulled your repo and tested with the sketch above. The compile does not work for the GatewayW5100 example sketch either.
    I have to apply the diff I've posted above to make it compile. With the diff applied the gateway starts, is pingable and reachable via telnet but does not receive any packets via RFM69.

    My guess: SoftSPI has no methods "usingInterrupt()", "beginTransaction()", and "endTransaction()" and that's the reason why no packets are received. In the current implementation these methods were not used.

    I suppose there needs to be an implementation without transactions for SoftSPI?

    Here's the output of the compile without the diff applied:

    n file included from /home/toberfoe/Arduino/libraries/MySensors/drivers/RFM69/RFM69.cpp:36:0,
                     from /home/toberfoe/Arduino/libraries/MySensors/MySensors.h:305,
                     from /tmp/arduino_modified_sketch_920203/GatewayW5100.ino:116:
    /home/toberfoe/Arduino/libraries/MySensors/drivers/RFM69/RFM69.h:85:74: error: 'MY_RFM69_SPI_DATA_MODE' was not declared in this scope
     SoftSPI<MY_SOFT_SPI_MISO_PIN, MY_SOFT_SPI_MOSI_PIN, MY_SOFT_SPI_SCK_PIN, MY_RFM69_SPI_DATA_MODE> _SPI;
                                                                              ^
    /home/toberfoe/Arduino/libraries/MySensors/drivers/RFM69/RFM69.h:85:96: error: template argument 4 is invalid
     SoftSPI<MY_SOFT_SPI_MISO_PIN, MY_SOFT_SPI_MOSI_PIN, MY_SOFT_SPI_SCK_PIN, MY_RFM69_SPI_DATA_MODE> _SPI;
                                                                                                    ^
    /home/toberfoe/Arduino/libraries/MySensors/drivers/RFM69/RFM69.h:85:102: error: invalid type in declaration before ';' token
     SoftSPI<MY_SOFT_SPI_MISO_PIN, MY_SOFT_SPI_MOSI_PIN, MY_SOFT_SPI_SCK_PIN, MY_RFM69_SPI_DATA_MODE> _SPI;
                                                                                                          ^
    In file included from /home/toberfoe/Arduino/libraries/MySensors/MySensors.h:305:0,
                     from /tmp/arduino_modified_sketch_920203/GatewayW5100.ino:116:
    /home/toberfoe/Arduino/libraries/MySensors/drivers/RFM69/RFM69.cpp: In function 'void RFM69_prepareSPITransaction()':
    /home/toberfoe/Arduino/libraries/MySensors/drivers/RFM69/RFM69.cpp:82:9: error: request for member 'setDataMode' in '_SPI', which is of non-class type 'int'
        _SPI.setDataMode(RFM69_SPI_DATA_MODE);
             ^
    /home/toberfoe/Arduino/libraries/MySensors/drivers/RFM69/RFM69.cpp:83:9: error: request for member 'setBitOrder' in '_SPI', which is of non-class type 'int'
        _SPI.setBitOrder(RFM69_SPI_DATA_ORDER);
             ^
    /home/toberfoe/Arduino/libraries/MySensors/drivers/RFM69/RFM69.cpp:84:9: error: request for member 'setClockDivider' in '_SPI', which is of non-class type 'int'
        _SPI.setClockDivider(RFM69_SPI_MAX_SPEED); // decided to slow down from DIV2 after SPI stalling in some instances, especially visible on mega1284p when RFM69 and FLASH chip both present
             ^
    In file included from /home/toberfoe/Arduino/libraries/MySensors/MySensors.h:305:0,
                     from /tmp/arduino_modified_sketch_920203/GatewayW5100.ino:116:
    /home/toberfoe/Arduino/libraries/MySensors/drivers/RFM69/RFM69.cpp: In function 'void RFM69_concludeSPITransaction()':
    /home/toberfoe/Arduino/libraries/MySensors/drivers/RFM69/RFM69.cpp:91:9: error: request for member 'endTransaction' in '_SPI', which is of non-class type 'int'
        _SPI.endTransaction();
             ^
    /home/toberfoe/Arduino/libraries/MySensors/drivers/RFM69/RFM69.cpp: In function 'uint8_t RFM69_spiMultiByteTransfer(uint8_t, uint8_t*, uint8_t, bool)':
    /home/toberfoe/Arduino/libraries/MySensors/drivers/RFM69/RFM69.cpp:114:18: error: request for member 'transfer' in '_SPI', which is of non-class type 'int'
        status = _SPI.transfer(cmd);
                      ^
    /home/toberfoe/Arduino/libraries/MySensors/drivers/RFM69/RFM69.cpp:117:24: error: request for member 'transfer' in '_SPI', which is of non-class type 'int'
              status = _SPI.transfer((uint8_t)0x00);
                            ^
    /home/toberfoe/Arduino/libraries/MySensors/drivers/RFM69/RFM69.cpp:122:24: error: request for member 'transfer' in '_SPI', which is of non-class type 'int'
              status = _SPI.transfer(*current++);
                            ^
    /home/toberfoe/Arduino/libraries/MySensors/drivers/RFM69/RFM69.cpp: In function 'bool RFM69_initialise(float)':
    /home/toberfoe/Arduino/libraries/MySensors/drivers/RFM69/RFM69.cpp:190:9: error: request for member 'begin' in '_SPI', which is of non-class type 'int'
        _SPI.begin();
             ^
    /home/toberfoe/Arduino/libraries/MySensors/drivers/RFM69/RFM69.cpp:202:9: error: request for member 'usingInterrupt' in '_SPI', which is of non-class type 'int'
        _SPI.usingInterrupt(digitalPinToInterrupt(RFM69_IRQ_DIO_PIN));
             ^
    /home/toberfoe/Arduino/libraries/MySensors/drivers/RFM69/RFM69.cpp: In function 'void RFM69_interruptHandler()':
    /home/toberfoe/Arduino/libraries/MySensors/drivers/RFM69/RFM69.cpp:232:15: error: request for member 'transfer' in '_SPI', which is of non-class type 'int'
              _SPI.transfer(RFM69_REG_FIFO & RFM69_READ_REGISTER);
                   ^
    /home/toberfoe/Arduino/libraries/MySensors/drivers/RFM69/RFM69.cpp:239:31: error: request for member 'transfer' in '_SPI', which is of non-class type 'int'
                 *current++ = _SPI.transfer((uint8_t)0x00);
                                   ^
    exit status 1
    Fehler beim Kompilieren für das Board Arduino Nano.
    

  • Hero Member

    @scalz both @jpaulin and I have had success with using W5100 and RFM69 on the same SPI bus. You can read about it earlier in this thread. I thing I will use this solution because I need the extra IO pins for local relays and buttons on the GW.



  • @scalz I downloaded your testbed and loaded a node with a basic script. It compiles ok, but I can't reach my gateway any longer. Do I have to update the gw as well? I'm using an ATmega328 with an RFM69W, CS=D10 and IRQ=D2 (Anarduino).
    Looks inspiring with ATC, debug_verbose, getRSSI() and other improvements.

    Script used:

    // Enable debug prints
    #define MY_DEBUG
    #define MY_DEBUG_VERBOSE_RFM69
    
    // Enable and select radio type attached
    //#define MY_RADIO_NRF24
    #define MY_RADIO_RFM69
    
    #define MY_RFM69_FREQUENCY   RFM69_433MHZ  // Note. New format
    
    #define MY_NODE_ID 7
    
    #include <MySensors.h>
    
    unsigned long SLEEP_TIME = 5000;         // Sleep time between reads (in milliseconds)
    
    #define CHILD_ID 1
    MyMessage msg(CHILD_ID, V_VAR1);
    int count = 0;
    
    void setup()  
    { 
    }
    
    void presentation() 
    {
      // Send the sketch version information to the gateway and Controller
      sendSketchInfo("Test", "1.0");
    
      // Register all sensors to gw (they will be created as child devices)
      present(CHILD_ID, S_CUSTOM);
    }
    
    void loop()      
    {
        send(msg.set(count));
        count++;
        if (count > 1000) {
          count=0;
        }
    
      wait(SLEEP_TIME);                       //sleep a bit.
    }
    

    Debug dump:

    0 MCO:BGN:INIT NODE,CP=RRNNA--,VER=2.1.0-beta
    4 TSM:INIT
    4 TSF:WUR:MS=0
    6 RFM69:INIT
    7 RFM69:IRQ PIN=2,CS PIN=10
    10 RFM69:PTX:LEVEL=5 dBm,reg=23
    13 TSM:INIT:TSP OK
    15 TSM:INIT:STATID=7
    16 TSF:SID:OK,ID=7
    18 TSM:FPAR
    19 RFM69:SWR:Sending,to=255,retry=0
    275 TSF:MSG:SEND,7-7-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    2282 !TSM:FPAR:NO REPLY
    2284 TSM:FPAR
    2285 RFM69:SWR:Sending,to=255,retry=0
    2691 TSF:MSG:SEND,7-7-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    4698 !TSM:FPAR:NO REPLY
    4700 TSM:FPAR
    4701 RFM69:SWR:Sending,to=255,retry=0
    5007 TSF:MSG:SEND,7-7-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    7014 !TSM:FPAR:NO REPLY
    7016 TSM:FPAR
    7017 RFM69:SWR:Sending,to=255,retry=0
    7173 TSF:MSG:SEND,7-7-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    9180 !TSM:FPAR:FAIL
    9181 TSM:FAIL:CNT=1
    9183 TSM:FAIL:PDT
    9185 RFM69:power down
    


  • @scalz Made some other tests and I get the same result.

    1. Testbed loaded in node only. No contact between gw and node.
    2. Testbed loaded in node and gw. No contact between gw and node.
    3. Testbed loaded in gw only. No contact between gw and node.
    4. @tekka RFM69DriverUpdate testbed loaded in node only. No contact between node and gw.
    5. Restoring node and gw with development branch. Everything goes back to normal.

    GW uses hardware SPI for the radio and Ethernet unit as mentioned further up in this thread.


  • Hardware Contributor

    @TimO
    oki, i'm fixing this, about your compil issue. i'll push today.

    @korttoma
    I know about this 😉 this is a problem related to the ethernet lib with pins hardwritten..

    Changes in new drivers should be able to handle hardware spi for w5100+radio on same bus. If taking care about the CS issue in ethernet lib. I've quickly looked and it seems that ethernet lib uses spi transaction, and rfm69 too now. So it should be ok in theory (for more infos, see spitransaction, and usinginterrupts).

    D10 is default for w5100 in ethernet lib, but if not setting any define in Mysensors for radio, then it will be on D10 too.

    • So if keeping W5100 D10, then we should have #define MY_RFM69_SPI_CS [your pin]
    • Or hack the w5100 lib, and you can keep default D10 CS Mysensors define for radio.

    So talking about this @jpaulin , could you tell me what are your CS pins? In your sketch above i don't see any define for this. So i assume you have modified the ethernet lib and keep Mysensors define for this, right ?



  • @scalz
    On the test node CS = D10 (script above). On the gw the radio CS = D10 and the Ethernet CS = D7. D7 is set in the w5100.h file in the Ethernet library.

    Here's a debug dump with the RFM69 registers (from the test node):

    0 MCO:BGN:INIT NODE,CP=RRNNA--,VER=2.1.0-beta
    4 TSM:INIT
    4 TSF:WUR:MS=0
    6 RFM69:INIT
    7 RFM69:IRQ PIN=2,CS PIN=10
    9 RFM69:write register, reg=0x01, value=4
    13 RFM69:write register, reg=0x02, value=0
    17 RFM69:write register, reg=0x03, value=2
    21 RFM69:write register, reg=0x04, value=64
    24 RFM69:write register, reg=0x05, value=3
    28 RFM69:write register, reg=0x06, value=51
    32 RFM69:write register, reg=0x07, value=108
    36 RFM69:write register, reg=0x08, value=64
    40 RFM69:write register, reg=0x09, value=0
    45 RFM69:write register, reg=0x18, value=136
    48 RFM69:write register, reg=0x19, value=66
    52 RFM69:write register, reg=0x26, value=7
    56 RFM69:write register, reg=0x28, value=16
    60 RFM69:write register, reg=0x29, value=220
    64 RFM69:write register, reg=0x2e, value=136
    68 RFM69:write register, reg=0x2f, value=170
    72 RFM69:write register, reg=0x30, value=100
    76 RFM69:write register, reg=0x37, value=212
    80 RFM69:write register, reg=0x38, value=66
    83 RFM69:write register, reg=0x39, value=255
    88 RFM69:write register, reg=0x3a, value=255
    92 RFM69:write register, reg=0x3c, value=5
    96 RFM69:write register, reg=0x3d, value=16
    100 RFM69:write register, reg=0x6f, value=48
    104 RFM69:write register, reg=0x01, value=4
    108 RFM69:read register, reg=0x27, value=128
    112 RFM69:read register, reg=0x3d, value=16
    115 RFM69:write register, reg=0x3d, value=16
    119 RFM69:write register, reg=0x11, value=151
    123 RFM69:PTX:LEVEL=5 dBm,reg=23
    126 RFM69:read register, reg=0x02, value=0
    131 RFM69:read register, reg=0x03, value=2
    135 RFM69:read register, reg=0x04, value=64
    138 RFM69:read register, reg=0x05, value=3
    142 RFM69:read register, reg=0x06, value=51
    146 RFM69:read register, reg=0x07, value=108
    150 RFM69:read register, reg=0x08, value=64
    154 RFM69:read register, reg=0x09, value=0
    157 RFM69:read register, reg=0x30, value=100
    161 TSM:INIT:TSP OK
    163 TSM:INIT:STATID=7
    165 RFM69:write register, reg=0x39, value=7
    169 TSF:SID:OK,ID=7
    172 TSM:FPAR
    173 RFM69:SWR:Sending,to=255,retry=0
    427 RFM69:read register, reg=0x27, value=128
    431 RFM69:write register, reg=0x25, value=0
    434 RFM69:write register, reg=0x01, value=12
    441 RFM69:read register, reg=0x28, value=8
    441 RFM69:write register, reg=0x25, value=64
    441 RFM69:read register, reg=0x28, value=8
    441 RFM69:write register, reg=0x01, value=16
    442 TSF:MSG:SEND,7-7-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    2449 !TSM:FPAR:NO REPLY
    2451 TSM:FPAR
    2452 RFM69:SWR:Sending,to=255,retry=0
    2455 RFM69:read register, reg=0x24, value=195
    2859 RFM69:read register, reg=0x24, value=197
    2863 RFM69:write register, reg=0x01, value=4
    2866 RFM69:read register, reg=0x27, value=128
    2871 RFM69:write register, reg=0x25, value=0
    2874 RFM69:write register, reg=0x01, value=12
    2881 RFM69:read register, reg=0x28, value=8
    2881 RFM69:write register, reg=0x25, value=64
    2881 RFM69:read register, reg=0x28, value=8
    2881 RFM69:write register, reg=0x01, value=16
    2882 TSF:MSG:SEND,7-7-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    4889 !TSM:FPAR:NO REPLY
    4891 TSM:FPAR
    4892 RFM69:SWR:Sending,to=255,retry=0
    4895 RFM69:read register, reg=0x24, value=189
    5199 RFM69:read register, reg=0x24, value=208
    5203 RFM69:write register, reg=0x01, value=4
    5207 RFM69:read register, reg=0x27, value=128
    5212 RFM69:write register, reg=0x25, value=0
    5215 RFM69:write register, reg=0x01, value=12
    5222 RFM69:read register, reg=0x28, value=8
    5222 RFM69:write register, reg=0x25, value=64
    5222 RFM69:read register, reg=0x28, value=8
    5222 RFM69:write register, reg=0x01, value=16
    5223 TSF:MSG:SEND,7-7-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    7230 !TSM:FPAR:NO REPLY
    7232 TSM:FPAR
    7233 RFM69:SWR:Sending,to=255,retry=0
    7236 RFM69:read register, reg=0x24, value=222
    7390 RFM69:read register, reg=0x24, value=193
    7394 RFM69:write register, reg=0x01, value=4
    7397 RFM69:read register, reg=0x27, value=128
    7402 RFM69:write register, reg=0x25, value=0
    7405 RFM69:write register, reg=0x01, value=12
    7412 RFM69:read register, reg=0x28, value=8
    7412 RFM69:write register, reg=0x25, value=64
    7412 RFM69:read register, reg=0x28, value=8
    7412 RFM69:write register, reg=0x01, value=16
    7413 TSF:MSG:SEND,7-7-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    9420 !TSM:FPAR:FAIL
    9421 TSM:FAIL:CNT=1
    9423 TSM:FAIL:PDT
    9425 RFM69:power down
    9427 RFM69:write register, reg=0x01, value=128
    


  • @scalz I finally got it going. I had to clean out all settings in both my gw, ethernet lib and the test-node. But it's a rather shaky experience. There are a lot of re-transmissions and failed sent messages that I don't see happening in my current set-up (in the Ethernet gw the file w5100.h has sei(); and cli(); interrupt macros added , as mentioned above in this thread).

    As well there's an issue with the new ATC management. The transmission power is dropped 1 dB after every sent message in the test-node. Finally it ends up loosing contact with the gw using too low power. After automatic restart sequences it goes back to full power and starts again slowly dropping power until loosing contact again.

    I think I'll have to stay with my current set-up until it becomes more stable.

    Here's a debug-dump showing the re-transmissions and ATC power loss in the test-node:

    0 MCO:BGN:INIT NODE,CP=RRNNA--,VER=2.1.0-beta
    4 TSM:INIT
    4 TSF:WUR:MS=0
    6 RFM69:INIT
    7 RFM69:IRQ PIN=2,CS PIN=10
    10 RFM69:PTX:LEVEL=5 dBm,reg=23
    13 TSM:INIT:TSP OK
    15 TSM:INIT:STATID=7
    16 TSF:SID:OK,ID=7
    18 TSM:FPAR
    19 RFM69:SWR:Sending,to=255,retry=0
    275 TSF:MSG:SEND,7-7-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    2282 !TSM:FPAR:NO REPLY
    2284 TSM:FPAR
    2285 RFM69:SWR:Sending,to=255,retry=0
    2691 TSF:MSG:SEND,7-7-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    3792 RFM69:RCV:Send ACK
    3794 RFM69:SAC:Send ACK to=0,RSSI=-56
    4100 TSF:MSG:READ,0-0-7,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    4105 TSF:MSG:FPAR OK,ID=0,D=1
    4323 RFM69:RCV:Send ACK
    4325 RFM69:SAC:Send ACK to=0,RSSI=-57
    4482 TSF:MSG:READ,0-0-7,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    4698 TSM:FPAR:OK
    4699 TSM:ID
    4700 TSM:ID:OK
    4702 TSM:UPL
    4703 RFM69:SWR:Sending,to=0,retry=0
    5009 !RFM69:SWR:NACK
    5010 RFM69:SWR:Sending,to=0,retry=1
    5517 !RFM69:SWR:NACK
    5518 RFM69:SWR:Sending,to=0,retry=2
    5925 !RFM69:SWR:NACK
    5926 RFM69:SWR:Sending,to=0,retry=3
    6434 !RFM69:SWR:NACK
    6435 RFM69:SWR:Sending,to=0,retry=4
    6892 RFM69:SWR:ACK from=0,SEQ=5,RSSI=-58
    6895 RFM69:ATC:ADJ TXL,cR=-58,tR=-80,TXL=4
    6899 RFM69:PTX:LEVEL=4 dBm,reg=22
    6902 TSF:MSG:SEND,7-7-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
    6945 RFM69:RCV:Send ACK
    6947 RFM69:SAC:Send ACK to=0,RSSI=-56
    7053 TSF:MSG:READ,0-0-7,s=255,c=3,t=25,pt=1,l=1,sg=0:1
    7058 TSF:MSG:PONG RECV,HP=1
    7060 TSM:UPL:OK
    7062 TSM:READY:ID=7,PAR=0,DIS=1
    7065 RFM69:SWR:Sending,to=0,retry=0
    7171 !RFM69:SWR:NACK
    7172 RFM69:SWR:Sending,to=0,retry=1
    7680 !RFM69:SWR:NACK
    7681 RFM69:SWR:Sending,to=0,retry=2
    8088 !RFM69:SWR:NACK
    8089 RFM69:SWR:Sending,to=0,retry=3
    8596 !RFM69:SWR:NACK
    8597 RFM69:SWR:Sending,to=0,retry=4
    8654 RFM69:SWR:ACK from=0,SEQ=7,RSSI=-59
    8658 RFM69:ATC:ADJ TXL,cR=-59,tR=-80,TXL=3
    8662 RFM69:PTX:LEVEL=3 dBm,reg=21
    8665 TSF:MSG:SEND,7-7-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
    9108 RFM69:RCV:Send ACK
    9110 RFM69:SAC:Send ACK to=0,RSSI=-56
    9266 TSF:MSG:READ,0-0-7,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    9271 RFM69:SWR:Sending,to=0,retry=0
    9728 !RFM69:SWR:NACK
    9729 RFM69:SWR:Sending,to=0,retry=1
    10137 RFM69:SWR:ACK from=0,SEQ=9,RSSI=-60
    10141 RFM69:ATC:ADJ TXL,cR=-60,tR=-80,TXL=2
    10145 RFM69:PTX:LEVEL=2 dBm,reg=20
    10148 TSF:MSG:SEND,7-7-0-0,s=255,c=0,t=17,pt=0,l=10,sg=0,ft=0,st=OK:2.1.0-beta
    10156 RFM69:SWR:Sending,to=0,retry=0
    10612 !RFM69:SWR:NACK
    10614 RFM69:SWR:Sending,to=0,retry=1
    10720 RFM69:SWR:ACK from=0,SEQ=10,RSSI=-62
    10724 RFM69:ATC:ADJ TXL,cR=-62,tR=-80,TXL=1
    10728 RFM69:PTX:LEVEL=1 dBm,reg=19
    10731 TSF:MSG:SEND,7-7-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
    12737 RFM69:SWR:Sending,to=0,retry=0
    13143 !RFM69:SWR:NACK
    13145 RFM69:SWR:Sending,to=0,retry=1
    13301 !RFM69:SWR:NACK
    13303 RFM69:SWR:Sending,to=0,retry=2
    13409 !RFM69:SWR:NACK
    13411 RFM69:SWR:Sending,to=0,retry=3
    13568 RFM69:SWR:ACK from=0,SEQ=11,RSSI=-63
    13572 RFM69:ATC:ADJ TXL,cR=-63,tR=-80,TXL=0
    13576 RFM69:PTX:LEVEL=0 dBm,reg=18
    13579 TSF:MSG:SEND,7-7-0-0,s=255,c=3,t=11,pt=0,l=4,sg=0,ft=0,st=OK:Test
    13586 RFM69:SWR:Sending,to=0,retry=0
    13892 !RFM69:SWR:NACK
    13894 RFM69:SWR:Sending,to=0,retry=1
    14251 RFM69:SWR:ACK from=0,SEQ=12,RSSI=-64
    14255 RFM69:ATC:ADJ TXL,cR=-64,tR=-80,TXL=-1
    14259 RFM69:PTX:LEVEL=-1 dBm,reg=17
    14262 TSF:MSG:SEND,7-7-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.0
    14268 RFM69:SWR:Sending,to=0,retry=0
    14675 !RFM69:SWR:NACK
    14678 RFM69:SWR:Sending,to=0,retry=1
    14784 !RFM69:SWR:NACK
    14786 RFM69:SWR:Sending,to=0,retry=2
    15242 RFM69:SWR:ACK from=0,SEQ=13,RSSI=-64
    15246 RFM69:ATC:ADJ TXL,cR=-64,tR=-80,TXL=-2
    15249 RFM69:PTX:LEVEL=-2 dBm,reg=16
    15253 TSF:MSG:SEND,7-7-0-0,s=1,c=0,t=23,pt=0,l=0,sg=0,ft=0,st=OK:
    15259 MCO:REG:REQ
    15260 RFM69:SWR:Sending,to=0,retry=0
    15717 !RFM69:SWR:NACK
    15719 RFM69:SWR:Sending,to=0,retry=1
    16125 RFM69:SWR:ACK from=0,SEQ=14,RSSI=-66
    16130 RFM69:ATC:ADJ TXL,cR=-66,tR=-80,TXL=-3
    16134 RFM69:PTX:LEVEL=-3 dBm,reg=15
    16137 TSF:MSG:SEND,7-7-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
    16179 RFM69:RCV:Send ACK
    16182 RFM69:SAC:Send ACK to=0,RSSI=-56
    16337 TSF:MSG:READ,0-0-7,s=255,c=3,t=27,pt=1,l=1,sg=0:1
    16343 MCO:PIM:NODE REG=1
    16345 MCO:BGN:STP
    16347 MCO:BGN:INIT OK,TSP=1
    16349 RFM69:SWR:Sending,to=0,retry=0
    16706 !RFM69:SWR:NACK
    16708 RFM69:SWR:Sending,to=0,retry=1
    16814 RFM69:SWR:ACK from=0,SEQ=16,RSSI=-64
    16818 RFM69:ATC:ADJ TXL,cR=-64,tR=-80,TXL=-4
    16822 RFM69:PTX:LEVEL=-4 dBm,reg=14
    16825 TSF:MSG:SEND,7-7-0-0,s=1,c=1,t=24,pt=2,l=2,sg=0,ft=0,st=OK:0
    21831 RFM69:SWR:Sending,to=0,retry=0
    22337 !RFM69:SWR:NACK
    22339 RFM69:SWR:Sending,to=0,retry=1
    22445 !RFM69:SWR:NACK
    22447 RFM69:SWR:Sending,to=0,retry=2
    22553 RFM69:SWR:ACK from=0,SEQ=17,RSSI=-65
    22557 RFM69:ATC:ADJ TXL,cR=-65,tR=-80,TXL=-5
    22561 RFM69:PTX:LEVEL=-5 dBm,reg=13
    22564 TSF:MSG:SEND,7-7-0-0,s=1,c=1,t=24,pt=2,l=2,sg=0,ft=0,st=OK:1
    27571 RFM69:SWR:Sending,to=0,retry=0
    27727 !RFM69:SWR:NACK
    27729 RFM69:SWR:Sending,to=0,retry=1
    27835 !RFM69:SWR:NACK
    27837 RFM69:SWR:Sending,to=0,retry=2
    28080 RFM69:SWR:ACK from=0,SEQ=18,RSSI=-65
    28084 RFM69:ATC:ADJ TXL,cR=-65,tR=-80,TXL=-6
    28088 RFM69:PTX:LEVEL=-6 dBm,reg=12
    28091 TSF:MSG:SEND,7-7-0-0,s=1,c=1,t=24,pt=2,l=2,sg=0,ft=0,st=OK:2
    33097 RFM69:SWR:Sending,to=0,retry=0
    33253 !RFM69:SWR:NACK
    33255 RFM69:SWR:Sending,to=0,retry=1
    33461 !RFM69:SWR:NACK
    33463 RFM69:SWR:Sending,to=0,retry=2
    33569 RFM69:SWR:ACK from=0,SEQ=19,RSSI=-69
    33573 RFM69:ATC:ADJ TXL,cR=-69,tR=-80,TXL=-7
    33577 RFM69:PTX:LEVEL=-7 dBm,reg=11
    33581 TSF:MSG:SEND,7-7-0-0,s=1,c=1,t=24,pt=2,l=2,sg=0,ft=0,st=OK:3
    38587 RFM69:SWR:Sending,to=0,retry=0
    38693 !RFM69:SWR:NACK
    38695 RFM69:SWR:Sending,to=0,retry=1
    38852 RFM69:SWR:ACK from=0,SEQ=20,RSSI=-69
    38856 RFM69:ATC:ADJ TXL,cR=-69,tR=-80,TXL=-8
    38860 RFM69:PTX:LEVEL=-8 dBm,reg=10
    38863 TSF:MSG:SEND,7-7-0-0,s=1,c=1,t=24,pt=2,l=2,sg=0,ft=0,st=OK:4
    43870 RFM69:SWR:Sending,to=0,retry=0
    44076 !RFM69:SWR:NACK
    44078 RFM69:SWR:Sending,to=0,retry=1
    44284 !RFM69:SWR:NACK
    44286 RFM69:SWR:Sending,to=0,retry=2
    44544 RFM69:SWR:ACK from=0,SEQ=21,RSSI=-71
    44548 RFM69:ATC:ADJ TXL,cR=-71,tR=-80,TXL=-9
    44552 RFM69:PTX:LEVEL=-9 dBm,reg=9
    44555 TSF:MSG:SEND,7-7-0-0,s=1,c=1,t=24,pt=2,l=2,sg=0,ft=0,st=OK:5
    49561 RFM69:SWR:Sending,to=0,retry=0
    49967 !RFM69:SWR:NACK
    49969 RFM69:SWR:Sending,to=0,retry=1
    50275 !RFM69:SWR:NACK
    50277 RFM69:SWR:Sending,to=0,retry=2
    50734 RFM69:SWR:ACK from=0,SEQ=22,RSSI=-73
    50738 RFM69:ATC:ADJ TXL,cR=-73,tR=-80,TXL=-10
    50742 RFM69:PTX:LEVEL=-10 dBm,reg=8
    50745 TSF:MSG:SEND,7-7-0-0,s=1,c=1,t=24,pt=2,l=2,sg=0,ft=0,st=OK:6
    55751 RFM69:SWR:Sending,to=0,retry=0
    55957 !RFM69:SWR:NACK
    55959 RFM69:SWR:Sending,to=0,retry=1
    56366 RFM69:SWR:ACK from=0,SEQ=23,RSSI=-69
    56370 RFM69:ATC:ADJ TXL,cR=-69,tR=-80,TXL=-11
    56374 RFM69:PTX:LEVEL=-11 dBm,reg=7
    56377 TSF:MSG:SEND,7-7-0-0,s=1,c=1,t=24,pt=2,l=2,sg=0,ft=0,st=OK:7
    61383 RFM69:SWR:Sending,to=0,retry=0
    61539 !RFM69:SWR:NACK
    61541 RFM69:SWR:Sending,to=0,retry=1
    61690 RFM69:SWR:ACK from=0,SEQ=24,RSSI=-71
    61694 RFM69:ATC:ADJ TXL,cR=-71,tR=-80,TXL=-12
    61699 RFM69:PTX:LEVEL=-12 dBm,reg=6
    61702 TSF:MSG:SEND,7-7-0-0,s=1,c=1,t=24,pt=2,l=2,sg=0,ft=0,st=OK:8
    66708 RFM69:SWR:Sending,to=0,retry=0
    67064 !RFM69:SWR:NACK
    67066 RFM69:SWR:Sending,to=0,retry=1
    67322 !RFM69:SWR:NACK
    67324 RFM69:SWR:Sending,to=0,retry=2
    67781 RFM69:SWR:ACK from=0,SEQ=25,RSSI=-73
    67785 RFM69:ATC:ADJ TXL,cR=-73,tR=-80,TXL=-13
    67789 RFM69:PTX:LEVEL=-13 dBm,reg=5
    67792 TSF:MSG:SEND,7-7-0-0,s=1,c=1,t=24,pt=2,l=2,sg=0,ft=0,st=OK:9
    72799 RFM69:SWR:Sending,to=0,retry=0
    73056 !RFM69:SWR:NACK
    73058 RFM69:SWR:Sending,to=0,retry=1
    73314 RFM69:SWR:ACK from=0,SEQ=26,RSSI=-74
    73318 RFM69:ATC:ADJ TXL,cR=-74,tR=-80,TXL=-14
    73322 RFM69:PTX:LEVEL=-14 dBm,reg=4
    73325 TSF:MSG:SEND,7-7-0-0,s=1,c=1,t=24,pt=2,l=2,sg=0,ft=0,st=OK:10
    78331 RFM69:SWR:Sending,to=0,retry=0
    78787 !RFM69:SWR:NACK
    78789 RFM69:SWR:Sending,to=0,retry=1
    79195 RFM69:SWR:ACK from=0,SEQ=27,RSSI=-76
    79199 RFM69:ATC:ADJ TXL,cR=-76,tR=-80,TXL=-15
    79203 RFM69:PTX:LEVEL=-15 dBm,reg=3
    79206 TSF:MSG:SEND,7-7-0-0,s=1,c=1,t=24,pt=2,l=2,sg=0,ft=0,st=OK:11
    84212 RFM69:SWR:Sending,to=0,retry=0
    84319 !RFM69:SWR:NACK
    84321 RFM69:SWR:Sending,to=0,retry=1
    84827 !RFM69:SWR:NACK
    84829 RFM69:SWR:Sending,to=0,retry=2
    85285 RFM69:SWR:ACK from=0,SEQ=28,RSSI=-76
    85289 RFM69:ATC:ADJ TXL,cR=-76,tR=-80,TXL=-16
    85294 RFM69:PTX:LEVEL=-16 dBm,reg=2
    85297 TSF:MSG:SEND,7-7-0-0,s=1,c=1,t=24,pt=2,l=2,sg=0,ft=0,st=OK:12
    90303 RFM69:SWR:Sending,to=0,retry=0
    90459 !RFM69:SWR:NACK
    90461 RFM69:SWR:Sending,to=0,retry=1
    90567 !RFM69:SWR:NACK
    90569 RFM69:SWR:Sending,to=0,retry=2
    90676 !RFM69:SWR:NACK
    90678 RFM69:SWR:Sending,to=0,retry=3
    91034 RFM69:SWR:ACK from=0,SEQ=29,RSSI=-75
    91038 RFM69:ATC:ADJ TXL,cR=-75,tR=-80,TXL=-17
    91042 RFM69:PTX:LEVEL=-17 dBm,reg=1
    91045 TSF:MSG:SEND,7-7-0-0,s=1,c=1,t=24,pt=2,l=2,sg=0,ft=0,st=OK:13
    96052 RFM69:SWR:Sending,to=0,retry=0
    96508 !RFM69:SWR:NACK
    96510 RFM69:SWR:Sending,to=0,retry=1
    96818 !RFM69:SWR:NACK
    96820 RFM69:SWR:Sending,to=0,retry=2
    97226 RFM69:SWR:ACK from=0,SEQ=30,RSSI=-78
    97230 RFM69:ATC:ADJ TXL,cR=-78,tR=-80,TXL=-18
    97234 RFM69:PTX:LEVEL=-18 dBm,reg=0
    97238 TSF:MSG:SEND,7-7-0-0,s=1,c=1,t=24,pt=2,l=2,sg=0,ft=0,st=OK:14
    102244 RFM69:SWR:Sending,to=0,retry=0
    102700 !RFM69:SWR:NACK
    102702 RFM69:SWR:Sending,to=0,retry=1
    103158 !RFM69:SWR:NACK
    103160 RFM69:SWR:Sending,to=0,retry=2
    103566 !RFM69:SWR:NACK
    103568 RFM69:SWR:Sending,to=0,retry=3
    103874 !RFM69:SWR:NACK
    103876 RFM69:SWR:Sending,to=0,retry=4
    104232 !RFM69:SWR:NACK
    104235 !TSF:MSG:SEND,7-7-0-0,s=1,c=1,t=24,pt=2,l=2,sg=0,ft=0,st=NACK:15
    109241 RFM69:SWR:Sending,to=0,retry=0
    109347 !RFM69:SWR:NACK
    109349 RFM69:SWR:Sending,to=0,retry=1
    109706 !RFM69:SWR:NACK
    109708 RFM69:SWR:Sending,to=0,retry=2
    109914 !RFM69:SWR:NACK
    109916 RFM69:SWR:Sending,to=0,retry=3
    110322 !RFM69:SWR:NACK
    110324 RFM69:SWR:Sending,to=0,retry=4
    110780 !RFM69:SWR:NACK
    110782 !TSF:MSG:SEND,7-7-0-0,s=1,c=1,t=24,pt=2,l=2,sg=0,ft=1,st=NACK:16
    115788 RFM69:SWR:Sending,to=0,retry=0
    115894 !RFM69:SWR:NACK
    115896 RFM69:SWR:Sending,to=0,retry=1
    116202 !RFM69:SWR:NACK
    116204 RFM69:SWR:Sending,to=0,retry=2
    116410 !RFM69:SWR:NACK
    116412 RFM69:SWR:Sending,to=0,retry=3
    116768 !RFM69:SWR:NACK
    116770 RFM69:SWR:Sending,to=0,retry=4
    117176 !RFM69:SWR:NACK
    117178 !TSF:MSG:SEND,7-7-0-0,s=1,c=1,t=24,pt=2,l=2,sg=0,ft=2,st=NACK:17
    122184 RFM69:SWR:Sending,to=0,retry=0
    122690 !RFM69:SWR:NACK
    122692 RFM69:SWR:Sending,to=0,retry=1
    122798 !RFM69:SWR:NACK
    122800 RFM69:SWR:Sending,to=0,retry=2
    123206 !RFM69:SWR:NACK
    123208 RFM69:SWR:Sending,to=0,retry=3
    123464 !RFM69:SWR:NACK
    123466 RFM69:SWR:Sending,to=0,retry=4
    123972 !RFM69:SWR:NACK
    123974 !TSF:MSG:SEND,7-7-0-0,s=1,c=1,t=24,pt=2,l=2,sg=0,ft=3,st=NACK:18
    128980 RFM69:SWR:Sending,to=0,retry=0
    129337 !RFM69:SWR:NACK
    129339 RFM69:SWR:Sending,to=0,retry=1
    129795 !RFM69:SWR:NACK
    129797 RFM69:SWR:Sending,to=0,retry=2
    130203 !RFM69:SWR:NACK
    130205 RFM69:SWR:Sending,to=0,retry=3
    130711 !RFM69:SWR:NACK
    130713 RFM69:SWR:Sending,to=0,retry=4
    131169 !RFM69:SWR:NACK
    131171 !TSF:MSG:SEND,7-7-0-0,s=1,c=1,t=24,pt=2,l=2,sg=0,ft=4,st=NACK:19
    136177 RFM69:SWR:Sending,to=0,retry=0
    136584 !RFM69:SWR:NACK
    136586 RFM69:SWR:Sending,to=0,retry=1
    136792 !RFM69:SWR:NACK
    136794 RFM69:SWR:Sending,to=0,retry=2
    136900 !RFM69:SWR:NACK
    136902 RFM69:SWR:Sending,to=0,retry=3
    137158 !RFM69:SWR:NACK
    137160 RFM69:SWR:Sending,to=0,retry=4
    137267 !RFM69:SWR:NACK
    137269 !TSF:MSG:SEND,7-7-0-0,s=1,c=1,t=24,pt=2,l=2,sg=0,ft=5,st=NACK:20
    137275 !TSM:READY:UPL FAIL,SNP
    137278 TSM:FPAR
    137279 RFM69:SWR:Sending,to=255,retry=0
    137436 TSF:MSG:SEND,7-7-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=6,st=OK:
    139443 !TSM:FPAR:NO REPLY
    139445 TSM:FPAR
    139446 RFM69:SWR:Sending,to=255,retry=0
    139753 TSF:MSG:SEND,7-7-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    141760 !TSM:FPAR:NO REPLY
    141762 TSM:FPAR
    141763 RFM69:SWR:Sending,to=255,retry=0
    141920 TSF:MSG:SEND,7-7-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    142275 !TSF:SND:TNR
    143927 !TSM:FPAR:NO REPLY
    143929 TSM:FPAR
    143931 RFM69:SWR:Sending,to=255,retry=0
    144387 TSF:MSG:SEND,7-7-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    145031 RFM69:RCV:Send ACK
    145034 RFM69:SAC:Send ACK to=0,RSSI=-55
    145139 TSF:MSG:READ,0-0-7,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    145144 TSF:MSG:FPAR OK,ID=0,D=1
    145561 RFM69:RCV:Send ACK
    145564 RFM69:SAC:Send ACK to=0,RSSI=-56
    145619 TSF:MSG:READ,0-0-7,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    146391 RFM69:RCV:Send ACK
    146393 RFM69:SAC:Send ACK to=0,RSSI=-56
    146599 TSF:MSG:READ,0-0-7,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    146605 TSM:FPAR:OK
    146607 TSM:ID
    146608 TSM:ID:OK
    146610 TSM:UPL
    146611 RFM69:SWR:Sending,to=0,retry=0
    146869 !RFM69:SWR:NACK
    146871 RFM69:SWR:Sending,to=0,retry=1
    147227 !RFM69:SWR:NACK
    147229 RFM69:SWR:Sending,to=0,retry=2
    147435 !RFM69:SWR:NACK
    147437 RFM69:SWR:Sending,to=0,retry=3
    147793 !RFM69:SWR:NACK
    147795 RFM69:SWR:Sending,to=0,retry=4
    148202 !RFM69:SWR:NACK
    148204 !TSF:MSG:SEND,7-7-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=NACK:1
    148210 !TSF:SND:TNR
    150211 TSM:UPL
    150212 RFM69:SWR:Sending,to=0,retry=0
    150468 !RFM69:SWR:NACK
    150470 RFM69:SWR:Sending,to=0,retry=1
    150827 !RFM69:SWR:NACK
    150829 RFM69:SWR:Sending,to=0,retry=2
    151285 !RFM69:SWR:NACK
    151287 RFM69:SWR:Sending,to=0,retry=3
    151743 !RFM69:SWR:NACK
    151745 RFM69:SWR:Sending,to=0,retry=4
    152281 !RFM69:SWR:NACK
    152283 !TSF:MSG:SEND,7-7-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=1,st=NACK:1
    153212 !TSF:SND:TNR
    154290 TSM:UPL
    154291 RFM69:SWR:Sending,to=0,retry=0
    154797 !RFM69:SWR:NACK
    154799 RFM69:SWR:Sending,to=0,retry=1
    154905 !RFM69:SWR:NACK
    154907 RFM69:SWR:Sending,to=0,retry=2
    155063 !RFM69:SWR:NACK
    155065 RFM69:SWR:Sending,to=0,retry=3
    155471 !RFM69:SWR:NACK
    155473 RFM69:SWR:Sending,to=0,retry=4
    155629 !RFM69:SWR:NACK
    155631 !TSF:MSG:SEND,7-7-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=2,st=NACK:1
    157638 TSM:UPL
    157639 RFM69:SWR:Sending,to=0,retry=0
    158095 !RFM69:SWR:NACK
    158097 RFM69:SWR:Sending,to=0,retry=1
    158203 !RFM69:SWR:NACK
    158205 RFM69:SWR:Sending,to=0,retry=2
    158562 !RFM69:SWR:NACK
    158564 RFM69:SWR:Sending,to=0,retry=3
    159020 !RFM69:SWR:NACK
    159022 RFM69:SWR:Sending,to=0,retry=4
    159178 !RFM69:SWR:NACK
    159180 !TSF:MSG:SEND,7-7-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=3,st=NACK:1
    159186 !TSF:SND:TNR
    161187 !TSM:UPL:FAIL
    161188 TSM:FPAR
    161190 RFM69:SWR:Sending,to=255,retry=0
    161548 TSF:MSG:SEND,7-7-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=4,st=OK:
    163555 !TSM:FPAR:NO REPLY
    163557 TSM:FPAR
    163558 RFM69:SWR:Sending,to=255,retry=0
    163965 TSF:MSG:SEND,7-7-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    164188 !TSF:SND:TNR
    165974 !TSM:FPAR:NO REPLY
    165976 TSM:FPAR
    165978 RFM69:SWR:Sending,to=255,retry=0
    166384 TSF:MSG:SEND,7-7-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    168391 !TSM:FPAR:NO REPLY
    168393 TSM:FPAR
    168394 RFM69:SWR:Sending,to=255,retry=0
    168651 TSF:MSG:SEND,7-7-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    169189 !TSF:SND:TNR
    170658 !TSM:FPAR:FAIL
    170660 TSM:FAIL:CNT=1
    170662 TSM:FAIL:PDT
    170664 RFM69:power down
    174190 !TSF:SND:TNR
    179191 !TSF:SND:TNR
    180668 TSM:FAIL:RE-INIT
    180670 TSM:INIT
    180671 RFM69:INIT
    180673 RFM69:IRQ PIN=2,CS PIN=10
    180677 RFM69:PTX:LEVEL=5 dBm,reg=23
    180680 TSM:INIT:TSP OK
    180682 TSM:INIT:STATID=7
    180685 TSF:SID:OK,ID=7
    180687 TSM:FPAR
    180688 RFM69:SWR:Sending,to=255,retry=0
    180795 TSF:MSG:SEND,7-7-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    182228 RFM69:RCV:Send ACK
    182231 RFM69:SAC:Send ACK to=0,RSSI=-55
    182337 TSF:MSG:READ,0-0-7,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    182342 TSF:MSG:FPAR OK,ID=0,D=1
    182530 RFM69:RCV:Send ACK
    182532 RFM69:SAC:Send ACK to=0,RSSI=-56
    182588 TSF:MSG:READ,0-0-7,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    182802 TSM:FPAR:OK
    182803 TSM:ID
    182805 TSM:ID:OK
    182806 TSM:UPL
    182808 RFM69:SWR:Sending,to=0,retry=0
    182914 !RFM69:SWR:NACK
    182916 RFM69:SWR:Sending,to=0,retry=1
    183322 RFM69:SWR:ACK from=0,SEQ=4,RSSI=-57
    183326 RFM69:ATC:ADJ TXL,cR=-57,tR=-80,TXL=4
    183330 RFM69:PTX:LEVEL=4 dBm,reg=22
    183333 TSF:MSG:SEND,7-7-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
    183378 RFM69:RCV:Send ACK
    183380 RFM69:SAC:Send ACK to=0,RSSI=-55
    183737 TSF:MSG:READ,0-0-7,s=255,c=3,t=25,pt=1,l=1,sg=0:1
    183742 TSF:MSG:PONG RECV,HP=1
    183745 TSM:UPL:OK
    183746 TSM:READY:ID=7,PAR=0,DIS=1
    183888 RFM69:RCV:Send ACK
    183890 RFM69:SAC:Send ACK to=0,RSSI=-56
    184047 TSF:MSG:READ,0-0-7,s=255,c=3,t=25,pt=1,l=1,sg=0:1
    184052 !TSF:MSG:PONG RECV,INACTIVE
    184192 RFM69:SWR:Sending,to=0,retry=0
    184698 !RFM69:SWR:NACK
    184700 RFM69:SWR:Sending,to=0,retry=1
    185057 RFM69:SWR:ACK from=0,SEQ=7,RSSI=-59
    185061 RFM69:ATC:ADJ TXL,cR=-59,tR=-80,TXL=3
    185065 RFM69:PTX:LEVEL=3 dBm,reg=21
    185068 TSF:MSG:SEND,7-7-0-0,s=1,c=1,t=24,pt=2,l=2,sg=0,ft=0,st=OK:29
    190074 RFM69:SWR:Sending,to=0,retry=0
    190431 !RFM69:SWR:NACK
    190433 RFM69:SWR:Sending,to=0,retry=1
    190789 RFM69:SWR:ACK from=0,SEQ=8,RSSI=-60
    190793 RFM69:ATC:ADJ TXL,cR=-60,tR=-80,TXL=2
    190797 RFM69:PTX:LEVEL=2 dBm,reg=20
    190800 TSF:MSG:SEND,7-7-0-0,s=1,c=1,t=24,pt=2,l=2,sg=0,ft=0,st=OK:30
    195807 RFM69:SWR:Sending,to=0,retry=0
    195963 !RFM69:SWR:NACK
    195965 RFM69:SWR:Sending,to=0,retry=1
    196122 RFM69:SWR:ACK from=0,SEQ=9,RSSI=-61
    196126 RFM69:ATC:ADJ TXL,cR=-61,tR=-80,TXL=1
    196130 RFM69:PTX:LEVEL=1 dBm,reg=19
    
    

  • Hardware Contributor

    @jpaulin
    great to hear you got it working. i just wanted to know this.
    i apologize, i forgot to mention that may need some cleaning of the settings.
    I'll fix others ATC and others things 😉 my online repo is complete yet.
    thx for your feedback.


Log in to reply
 

Suggested Topics

  • 33
  • 2
  • 11
  • 6
  • 3
  • 17

11
Online

11.4k
Users

11.1k
Topics

112.7k
Posts