xmodem
-
Xmodem
In order to upgrade XBee programmable modules over the air with node.js based tooling there is need for an Xmodem protocol implementation.
Project home: https://github.com/exsilium/xmodem.js
Protocol sequence for uploading
- Sender == uploader
- Receiver == downloader
- Transfers are receiver driven!
- All errors are retried 10 times.
- The receiver has a 10-second timeout.
- Variable length checksum depending on the transfer mode:
- normal/classic/original: 1 byte
- crc mode: 2 bytes
WORK IN PROGRESS
%% Xmodem normal transfer sequenceDiagram participant Sender participant Receiver loop every 3 sec Receiver-xSender: <NAK> end Sender->>Receiver: <SOH> 01 FE -data- <xx> Receiver->>Sender: <ACK> Sender->>Receiver: <SOH> 02 FD -data- <xx> Note right of Receiver: Data gets corrupted in transfer Receiver->>Sender: <NAK> Sender->>Receiver: <SOH> 02 FD -data- <xx> Receiver->>Sender: <ACK> Sender->>Receiver: <SOH> 03 FC -data- <xx> Receiver->>Sender: <ACK> Note left of Sender: <ACK> gets garbaged Sender->>Receiver: <SOH> 03 FC -data- <xx> Receiver->>Sender: <ACK> Sender->>Receiver: <EOT> Receiver->>Sender: <ACK>Questions
- What is the frequency that the receiver sends out the NCG byte to start the transfer? - 3 seconds?
Testing
- The suite will have Mocha tests built in, some good documentation is available
- https://docs.travis-ci.com/user/common-build-problems/#Troubleshooting-Locally-in-a-Docker-Image