[solved] Rebuilding a RPI GW - What do I need to get signing working again?
-
Hi,
An year or so has passed since last time I worked with MySensors, so I might be missing something basic.
Last year I had a working setup with a sensebender with SHA24 signing and RFM69 encryption working with a RPI GW. Meanwhile I've lost the GW config and I'm trying to make them talk again but without success. In order to troubleshoot, I've disabled the RMF69 encryption and currently focusing on signing.
I've also updated the software with the latest MySensors version (arduino sketches and RPI GW - Stable).
I'm doing a very basic GW configuration (for now just want to check the messages between gateway and node):
./configure --my-gateway=ethernet --my-port=5003 --my-transport=rfm69 --my-signing=software --my-signing-request-signatures --my-rfm69-frequency=433 --my-signing-debug
In my notes, I have the HMAC, AES and SERIAL strings that are burned in the sha24 chips. I've just pasted it directly in /etc/mysensors.conf in the corresponding places (would it be that simple?). Also, not sure what to do with /etc/mysensors.eeprom.
In the node side, the code for signing is:
//CODE FOR SIGNING************************************************ #define MY_SIGNING_ATSHA204 #define MY_SIGNING_ATSHA204_PIN A3 #define MY_SIGNING_REQUEST_SIGNATURES #define MY_DEBUG_VERBOSE_SIGNING
The GW and node are 30cm apart, so it shouldn't be a radio issue.
In terms of radio, they are talking to each other, just the signing seems to be failing.
Any idea of what I may be doing wrong?
The log from the GW:
Dec 01 16:18:14 INFO Starting gateway... Dec 01 16:18:14 INFO Protocol version - 2.3.2 Dec 01 16:18:14 DEBUG MCO:BGN:INIT GW,CP=RPNGLS--,FQ=NA,REL=255,VER=2.3.2 Dec 01 16:18:14 DEBUG SGN:PER:OK Dec 01 16:18:14 DEBUG SGN:INI:BND OK Dec 01 16:18:14 DEBUG TSF:LRT:OK Dec 01 16:18:14 DEBUG TSM:INIT Dec 01 16:18:14 DEBUG TSF:WUR:MS=0 Dec 01 16:18:14 DEBUG TSM:INIT:TSP OK Dec 01 16:18:14 DEBUG TSM:INIT:GW MODE Dec 01 16:18:14 DEBUG TSM:READY:ID=0,PAR=0,DIS=0 Dec 01 16:18:14 DEBUG MCO:REG:NOT NEEDED Dec 01 16:18:14 DEBUG Listening for connections on @Lʾ:5003 Dec 01 16:18:14 DEBUG MCO:BGN:STP Dec 01 16:18:14 DEBUG MCO:BGN:INIT OK,TSP=1 Dec 01 16:18:14 DEBUG TSM:READY:NWD REQ Dec 01 16:18:14 DEBUG SGN:SGN:NREQ=255 Dec 01 16:18:15 DEBUG ?TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK: (...) Dec 01 16:18:34 DEBUG TSF:MSG:READ,50-50-255,s=255,c=3,t=7,pt=0,l=0,sg=0: Dec 01 16:18:34 DEBUG TSF:MSG:BC Dec 01 16:18:34 DEBUG TSF:MSG:FPAR REQ,ID=50 Dec 01 16:18:34 DEBUG TSF:PNG:SEND,TO=0 Dec 01 16:18:34 DEBUG TSF:CKU:OK Dec 01 16:18:34 DEBUG TSF:MSG:GWL OK Dec 01 16:18:34 DEBUG SGN:SKP:MSG CMD=3,TYPE=8 Dec 01 16:18:34 DEBUG TSF:MSG:SEND,0-0-50-50,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0 Dec 01 16:18:37 DEBUG TSF:MSG:READ,50-50-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1 Dec 01 16:18:37 DEBUG SGN:SKP:MSG CMD=3,TYPE=24 Dec 01 16:18:37 DEBUG TSF:MSG:PINGED,ID=50,HP=1 Dec 01 16:18:37 DEBUG SGN:SKP:MSG CMD=3,TYPE=25 Dec 01 16:18:37 DEBUG TSF:MSG:SEND,0-0-50-50,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=OK:1 Dec 01 16:18:37 DEBUG TSF:MSG:READ,50-50-0,s=255,c=3,t=15,pt=6,l=2,sg=0:0101 Dec 01 16:18:37 DEBUG SGN:SKP:MSG CMD=3,TYPE=15 Dec 01 16:18:37 DEBUG SGN:PRE:SGN REQ,FROM=50 Dec 01 16:18:37 DEBUG SGN:PRE:SGN REQ,TO=50 Dec 01 16:18:37 DEBUG SGN:PRE:WHI NREQ,TO=50 Dec 01 16:18:37 DEBUG SGN:SKP:MSG CMD=3,TYPE=15 Dec 01 16:18:38 DEBUG TSF:MSG:SEND,0-0-50-50,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0101 Dec 01 16:18:38 DEBUG SGN:PRE:XMT,TO=50 Dec 01 16:18:38 DEBUG TSF:MSG:READ,50-50-0,s=255,c=3,t=16,pt=0,l=0,sg=0: Dec 01 16:18:38 DEBUG SGN:SKP:MSG CMD=3,TYPE=16 Dec 01 16:18:38 DEBUG SGN:SKP:MSG CMD=3,TYPE=17 Dec 01 16:18:38 DEBUG TSF:MSG:SEND,0-0-50-50,s=255,c=3,t=17,pt=6,l=25,sg=0,ft=0,st=OK:<NONCE> Dec 01 16:18:38 DEBUG SGN:NCE:XMT,TO=0 Dec 01 16:18:38 DEBUG TSF:MSG:READ,50-50-0,s=255,c=0,t=17,pt=0,l=5,sg=1:2.3.2 Dec 01 16:18:38 DEBUG SGN:BND:NONCE=B0800442A043FA40945B44F4CD8C790B5D7331B8650BB80E2AAAAAAAAAAAAAAA Dec 01 16:18:38 DEBUG SGN:BND:HMAC=7A44E2B4FC467386D048686A6E6C177D6E80C69642C08C3D45D5D199D3224502 Dec 01 16:18:38 DEBUG !SGN:VER:FAIL Dec 01 16:18:38 DEBUG !TSF:MSG:SIGN VERIFY FAIL Dec 01 16:18:38 DEBUG TSF:MSG:READ,50-50-0,s=255,c=3,t=16,pt=0,l=0,sg=1: Dec 01 16:18:38 DEBUG SGN:SKP:MSG CMD=3,TYPE=16 Dec 01 16:18:38 DEBUG SGN:SKP:MSG CMD=3,TYPE=17 Dec 01 16:18:39 DEBUG TSF:MSG:SEND,0-0-50-50,s=255,c=3,t=17,pt=6,l=25,sg=1,ft=0,st=OK:<NONCE> Dec 01 16:18:39 DEBUG SGN:NCE:XMT,TO=0 Dec 01 16:18:39 DEBUG TSF:MSG:READ,50-50-0,s=255,c=3,t=6,pt=1,l=1,sg=1:0 Dec 01 16:18:39 DEBUG SGN:BND:NONCE=06CB361E2FD766A768055D605E9CD6163936C77BAF3EFC21DEAAAAAAAAAAAAAA Dec 01 16:18:39 DEBUG SGN:BND:HMAC=167F693013583C1DDD0DAE25499B0FA9A0B63EA7524B0297ACE62ED9B9435803 Dec 01 16:18:39 DEBUG !SGN:VER:FAIL Dec 01 16:18:39 DEBUG !TSF:MSG:SIGN VERIFY FAIL Dec 01 16:18:42 DEBUG TSF:MSG:READ,50-50-0,s=255,c=3,t=16,pt=0,l=0,sg=1: Dec 01 16:18:42 DEBUG SGN:SKP:MSG CMD=3,TYPE=16 Dec 01 16:18:42 DEBUG SGN:SKP:MSG CMD=3,TYPE=17 Dec 01 16:18:42 DEBUG TSF:MSG:SEND,0-0-50-50,s=255,c=3,t=17,pt=6,l=25,sg=1,ft=0,st=OK:<NONCE> Dec 01 16:18:42 DEBUG SGN:NCE:XMT,TO=0 Dec 01 16:18:42 DEBUG TSF:MSG:READ,50-50-0,s=255,c=3,t=11,pt=0,l=13,sg=1:SENSOR JANELA Dec 01 16:18:42 DEBUG SGN:BND:NONCE=6335F8A515382C4E83848699806982B402DCCCF58D532965D9AAAAAAAAAAAAAA Dec 01 16:18:42 DEBUG SGN:BND:HMAC=B8A6ACEA6CA9CE1753DEE8DA423B10E5AB446873C9F6514090753A66E88F6517 Dec 01 16:18:42 DEBUG !SGN:VER:FAIL Dec 01 16:18:42 DEBUG !TSF:MSG:SIGN VERIFY FAIL Dec 01 16:18:42 DEBUG TSF:MSG:READ,50-50-0,s=255,c=3,t=16,pt=0,l=0,sg=1: Dec 01 16:18:42 DEBUG SGN:SKP:MSG CMD=3,TYPE=16 Dec 01 16:18:42 DEBUG SGN:SKP:MSG CMD=3,TYPE=17 Dec 01 16:18:42 DEBUG TSF:MSG:SEND,0-0-50-50,s=255,c=3,t=17,pt=6,l=25,sg=1,ft=0,st=OK:<NONCE> Dec 01 16:18:42 DEBUG SGN:NCE:XMT,TO=0 Dec 01 16:18:43 DEBUG TSF:MSG:READ,50-50-0,s=255,c=3,t=12,pt=0,l=9,sg=1:JS 2018V1 Dec 01 16:18:43 DEBUG SGN:BND:NONCE=B43EC17F684DD2F835D8D2ABE68D9601E83F83E61BBE9CAFE2AAAAAAAAAAAAAA Dec 01 16:18:43 DEBUG SGN:BND:HMAC=F276A259C636186EDF2284D4098153E61BD26151C15C51597F528541B0D94959 Dec 01 16:18:43 DEBUG !SGN:VER:FAIL Dec 01 16:18:43 DEBUG !TSF:MSG:SIGN VERIFY FAIL Dec 01 16:18:43 DEBUG TSF:MSG:READ,50-50-0,s=20,c=3,t=16,pt=0,l=0,sg=1: Dec 01 16:18:43 DEBUG SGN:SKP:MSG CMD=3,TYPE=16 Dec 01 16:18:43 DEBUG SGN:SKP:MSG CMD=3,TYPE=17 Dec 01 16:18:43 DEBUG TSF:MSG:SEND,0-0-50-50,s=255,c=3,t=17,pt=6,l=25,sg=1,ft=0,st=OK:<NONCE> Dec 01 16:18:43 DEBUG SGN:NCE:XMT,TO=0 Dec 01 16:18:44 DEBUG TSF:MSG:READ,50-50-0,s=20,c=0,t=6,pt=0,l=0,sg=1: Dec 01 16:18:44 DEBUG SGN:BND:NONCE=82BDEA6DA6BA558E2C9230D9220ED0BB69A36DEBE0B139E6DEAAAAAAAAAAAAAA Dec 01 16:18:44 DEBUG SGN:BND:HMAC=8918B2F585D08005CCED65EDD7B2C4421777E8E780CF0E656CA9967019BE9B01 Dec 01 16:18:44 DEBUG !SGN:VER:FAIL Dec 01 16:18:44 DEBUG !TSF:MSG:SIGN VERIFY FAIL Dec 01 16:18:44 DEBUG TSF:MSG:READ,50-50-0,s=40,c=3,t=16,pt=0,l=0,sg=1: Dec 01 16:18:44 DEBUG SGN:SKP:MSG CMD=3,TYPE=16 Dec 01 16:18:44 DEBUG SGN:SKP:MSG CMD=3,TYPE=17 Dec 01 16:18:44 DEBUG TSF:MSG:SEND,0-0-50-50,s=255,c=3,t=17,pt=6,l=25,sg=1,ft=0,st=OK:<NONCE> Dec 01 16:18:44 DEBUG SGN:NCE:XMT,TO=0 Dec 01 16:18:45 DEBUG TSF:MSG:READ,50-50-0,s=40,c=0,t=7,pt=0,l=0,sg=1: Dec 01 16:18:45 DEBUG SGN:BND:NONCE=566DCE39E272CA0F86065EEEAD3688566CB04C83BF4393199DAAAAAAAAAAAAAA Dec 01 16:18:45 DEBUG SGN:BND:HMAC=B4452251C4FEB6C60C24727AC318ABF6BA959CD59074ECA1C6BBA8C10A9C0615 Dec 01 16:18:45 DEBUG !SGN:VER:FAIL Dec 01 16:18:45 DEBUG !TSF:MSG:SIGN VERIFY FAIL
The node log:
__ __ ____ | \/ |_ _/ ___| ___ _ __ ___ ___ _ __ ___ | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __| | | | | |_| |___| | __/ | | \__ \ _ | | \__ \ |_| |_|\__, |____/ \___|_| |_|___/\___/|_| |___/ |___/ 2.3.2 16 MCO:BGN:INIT NODE,CP=RPNNAA--,FQ=8,REL=255,VER=2.3.2 40 SGN:PER:OK 71 SGN:INI:BND OK 73 TSM:INIT 75 TSF:WUR:MS=0 77 TSM:INIT:TSP OK 79 TSM:INIT:STATID=50 81 TSF:SID:OK,ID=50 83 TSM:FPAR 86 SGN:SGN:NREQ=255 110 ?TSF:MSG:SEND,50-50-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 786 TSF:MSG:READ,0-0-50,s=255,c=3,t=8,pt=1,l=1,sg=0:0 792 SGN:SKP:MSG CMD=3,TYPE=8 794 TSF:MSG:FPAR OK,ID=0,D=1 2119 TSM:FPAR:OK 2119 TSM:ID 2121 TSM:ID:OK 2123 TSM:UPL 2125 SGN:SKP:MSG CMD=3,TYPE=24 3260 !TSF:MSG:SEND,50-50-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=NACK:1 3334 TSF:MSG:READ,0-0-50,s=255,c=3,t=25,pt=1,l=1,sg=0:1 3340 SGN:SKP:MSG CMD=3,TYPE=25 3344 TSF:MSG:PONG RECV,HP=1 3346 TSM:UPL:OK 3348 TSM:READY:ID=50,PAR=0,DIS=1 3352 SGN:PRE:SGN REQ 3354 SGN:PRE:WHI NREQ 3356 SGN:SKP:MSG CMD=3,TYPE=15 4579 !TSF:MSG:SEND,50-50-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=NACK:0101 4587 !SGN:PRE:XMT,TO=0 FAIL 4589 SGN:PRE:WAIT GW 4888 TSF:MSG:READ,0-0-50,s=255,c=3,t=15,pt=6,l=2,sg=0:0101 4894 SGN:SKP:MSG CMD=3,TYPE=15 4898 SGN:PRE:SGN REQ,FROM=0 4900 SGN:SKP:MSG CMD=3,TYPE=16 6156 !TSF:MSG:SEND,50-50-0-0,s=255,c=3,t=16,pt=0,l=0,sg=0,ft=1,st=NACK: 6162 !SGN:SGN:NCE REQ,TO=0 FAIL 6166 !TSF:MSG:SIGN FAIL 6168 SGN:SKP:MSG CMD=3,TYPE=16 7419 !TSF:MSG:SEND,50-50-0-0,s=255,c=3,t=16,pt=0,l=0,sg=0,ft=3,st=NACK: 7426 !SGN:SGN:NCE REQ,TO=0 FAIL 7430 !TSF:MSG:SIGN FAIL 8263 TSF:MSG:READ,0-0-50,s=255,c=3,t=17,pt=6,l=25,sg=0:<NONCE> 8269 SGN:SKP:MSG CMD=3,TYPE=17 8273 SGN:NCE:FROM=0 8275 SGN:BND:NONCE=C2B17191C79E5E390332A289A9D223D92ABD74CFBAB16455C8AAAAAAAAAAAAAA 8390 SGN:BND:HMAC=7F107682B7FF95FD5EFF76ECD055635D52AFD8E1044CB85ECC8EB11FB69E3CA5 9433 SGN:SKP:MSG CMD=3,TYPE=16 9672 TSF:MSG:SEND,50-50-0-0,s=255,c=3,t=16,pt=0,l=0,sg=1,ft=5,st=OK: 9680 SGN:SGN:NCE REQ,TO=0 9981 TSF:MSG:READ,0-0-50,s=255,c=3,t=17,pt=6,l=25,sg=1:<NONCE> 9990 SGN:SKP:MSG CMD=3,TYPE=17 9992 SGN:NCE:FROM=0 9994 SGN:BND:NONCE=A201307ACA3E67769A52E67AB4ADE323D403EA1BD069BD1505AAAAAAAAAAAAAA 10110 SGN:BND:HMAC=C72DB4CCC891F699551E07D97F2E2E83901B9F8E52B4603D42737385C2DC4DDC 10119 SGN:SGN:SGN 10328 TSF:MSG:SEND,50-50-0-0,s=255,c=3,t=11,pt=0,l=13,sg=1,ft=0,st=OK:SENSOR JANELA 10336 SGN:SKP:MSG CMD=3,TYPE=16 10489 TSF:MSG:SEND,50-50-0-0,s=255,c=3,t=16,pt=0,l=0,sg=1,ft=0,st=OK: 10498 SGN:SGN:NCE REQ,TO=0 11724 TSF:MSG:READ,0-0-50,s=255,c=3,t=17,pt=6,l=25,sg=1:<NONCE> 11730 SGN:SKP:MSG CMD=3,TYPE=17 11735 SGN:NCE:FROM=0 11737 SGN:BND:NONCE=DF9FE2AB38EF56530E612A0AD32480313CE6F6E5437536F055AAAAAAAAAAAAAA 11853 SGN:BND:HMAC=932B6DEBCD0AC9008479E55CDE002E4BBB2121BF6F5FD8FCDD0F50009F75AA36 11864 SGN:SGN:SGN 12068 TSF:MSG:SEND,50-50-0-0,s=255,c=3,t=12,pt=0,l=9,sg=1,ft=0,st=OK:JS 2018V1 12077 SGN:SKP:MSG CMD=3,TYPE=16 12165 TSF:MSG:SEND,50-50-0-0,s=20,c=3,t=16,pt=0,l=0,sg=1,ft=0,st=OK: 12173 SGN:SGN:NCE REQ,TO=0 12855 TSF:MSG:READ,0-0-50,s=255,c=3,t=17,pt=6,l=25,sg=1:<NONCE> 12861 SGN:SKP:MSG CMD=3,TYPE=17 12865 SGN:NCE:FROM=0 12867 SGN:BND:NONCE=B5DC13AC6E39BF38758F11BE9520E61589A7ACF83530FFF0AEAAAAAAAAAAAAAA 12984 SGN:BND:HMAC=E8A78E0C9759B7E6916BA40539605C3270FC136C3779A18B94AC595FBF82187D 12994 SGN:SGN:SGN 13051 TSF:MSG:SEND,50-50-0-0,s=20,c=0,t=6,pt=0,l=0,sg=1,ft=0,st=OK: 13060 SGN:SKP:MSG CMD=3,TYPE=16 14139 !TSF:MSG:SEND,50-50-0-0,s=40,c=3,t=16,pt=0,l=0,sg=1,ft=0,st=NACK: 14145 !SGN:SGN:NCE REQ,TO=0 FAIL 14149 !TSF:MSG:SIGN FAIL 14151 MCO:REG:REQ 14153 SGN:SKP:MSG CMD=3,TYPE=26 15341 !TSF:MSG:SEND,50-50-0-0,s=255,c=3,t=26,pt=1,l=1,sg=1,ft=2,st=NACK:2 16388 TSF:MSG:READ,0-0-50,s=255,c=3,t=17,pt=6,l=25,sg=1:<NONCE> 16394 SGN:SKP:MSG CMD=3,TYPE=17 16398 SGN:NCE:FROM=0 16400 SGN:BND:NONCE=0ECBDE934D52D594A3D0CA3ACCFA295D5148AB29B47101D1CFAAAAAAAAAAAAAA 16515 SGN:BND:HMAC=F80AD9A20CDDD690BC881B05BABD109345C45FED361BDA6BED0A1BECA00302AB 17350 SGN:SKP:MSG CMD=3,TYPE=26 18792 !TSF:MSG:SEND,50-50-0-0,s=255,c=3,t=26,pt=1,l=1,sg=1,ft=3,st=NACK:2 19030 TSF:MSG:READ,0-0-50,s=255,c=3,t=16,pt=0,l=0,sg=1: 19036 SGN:SKP:MSG CMD=3,TYPE=16 19113 SGN:SKP:MSG CMD=3,TYPE=17 20264 !TSF:MSG:SEND,50-50-0-0,s=255,c=3,t=17,pt=6,l=25,sg=1,ft=4,st=NACK:<NONCE> 20273 !SGN:NCE:XMT,TO=50 FAIL 20801 SGN:SKP:MSG CMD=3,TYPE=26 21952 !TSF:MSG:SEND,50-50-0-0,s=255,c=3,t=26,pt=1,l=1,sg=1,ft=5,st=NACK:2 21960 !TSM:READY:UPL FAIL,SNP 21962 TSM:FPAR 21964 SGN:SGN:NREQ=255 21972 ?TSF:MSG:SEND,50-50-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=6,st=OK: 23961 !TSF:SND:TNR 23982 !TSM:FPAR:NO REPLY 23984 TSM:FPAR 23986 SGN:SGN:NREQ=255 24035 ?TSF:MSG:SEND,50-50-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 24842 !SGN:BND:TMR 24864 TSF:MSG:READ,0-0-50,s=255,c=3,t=8,pt=1,l=1,sg=1:0 24870 SGN:SKP:MSG CMD=3,TYPE=8 24872 TSF:MSG:FPAR OK,ID=0,D=1 27965 TSM:FPAR:OK 27967 TSM:ID 27967 TSM:ID:OK
Cheers,
Joaoabs
-
@joaoabs said in Rebuilding a RPI GW - What do I need to get signing working again?:
An year or so has passed since last time
Have you re-personalized your node? If not, is this possible or is your atsha chip locked?
-
@frits Thanks for replying back.
Indeed the sha24 chips are locked since their personalization last year.
I guess I don't need to re-personalize it, just need to copy something into the /etc/mysensors.conf in order to make them "talk" again. If I had a backup of my previous GW, I'd just copy the file, but since I don't I believe I just need to copy the HMAC, Soft-Serial and AES. Since this isn't working, I'm not sure if I'm using these values anymore, I'm looking in my backups folders for some notes I may have taken regarding this.
If I find the correct HMAC, Soft-Serial and AES, it would be a matter of pasting it in the /etc/mysensors.conf file, right?
These variables are common to the GW and nodes, right?Thanks,
Joaoabs
-
Hi,
Got it working!
It was a strange mix of RFM69/RFM69HW devices (all soldered into the nrf2rfm69 board - so couldn't tell which type it was) and also a faulty RFM69. Also, it seems the signing consumes much processing power (and memory) to the little at328 chips. A sketch with more than 65% memory usage may fail some signatures, so not recommended to put many functionalities in the same node, specially when running my_debug.
Simple sketches just with a sht21 sensor are working fine with signing and RFM69 encryption.Copying the correct HMAC, soft-serial and AES to the mysensors.conf file and with RPI reboots after each config/make/makeinstall cycle solved the problem.
Thanks,
Joaoabs