At the moment I'm having some problems getting my implementation of downlink to work.
My current setup is an IC880a SPI gateway running the TheThingsNetwork/packet_forwarder.
And my current node is an RN2483 end node, running version 0.9.5. of the firmware.
At the moment, I don't get replies on my RN2483 after an uplink message and I'm not sure if that is because of a timing issue or because of my data field of the txpk message.
I create a reply message and send it to the gateway to be sent at: "received timestamp + 1000000L" and this should be correct. The gateway also shedules the message to be sent. Except they aren't received on my end-node (just getting mac_tx_ok messages)
Gateway:
INFO: [down] for server router.eu.thethings.network PULL_ACK received in 10 ms
INFO: [up] PUSH_ACK for server 192.168.1.105 received in 0 ms
INFO: [down] for server 192.168.1.105 serv_addr[ic]PULL_RESP received
INFO: [down] a packet will be sent on timestamp value 3669867763
INFO: [up] PUSH_ACK for server router.eu.thethings.network received in 10 ms
INFO: [up] PUSH_ACK for server 192.168.1.105 received in 0 ms
I've already checked if i'm actually receiving any messages on my end-node by putting it into continuous reception mode, and then i did receive the messages. So could it be that i'm not hitting the RX1 slot of the end-node?
My other idea is that my implementation of the protocol isn't correct. I'm trying to send an unconfirmed down (011) after receiving an unconfirmed up (100) from the end node. A hex replresentation of the data I'm trying to send:
60 .......| 04 03 02 01 | 20 .. | 01 00 | 01 ......| b0 46 16 01 e1 | 75 a0 fe 5b
MHDR | Devaddr. .....| Fctrl.| FCnt ..| FPort | Payload ............| MIC
Where the actual DevAddr is 0x01020304 but where it seemed from the uplink messages I've parsed that the values should be put in this order (same for FCnt and MIC). My appSkey is {0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99} and my nwkskey is {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0xff}
So, at the moment I'm not sure if not receiving any messages on my RN2483 has to do with timing or with the format of the packet. If someone could help me with this it would be much appreciated.