# New version of packet-check program

**URL:** <https://forums.digi.com/t/new-version-of-packet-check-program/1968>\
**Category:** XBee - 802.15.4\
**Created:** [October 18, 2009, 11:58pm UTC](https://forums.digi.com/t/new-version-of-packet-check-program/1968 "2009-10-18T23:58:12Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnf](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@johnf](https://forums.digi.com/u/johnf)\
**Post date:** [October 18, 2009, 11:58pm UTC](https://forums.digi.com/t/new-version-of-packet-check-program/1968/1 "2009-10-18T23:58:12Z")

</div>

Here is an updated version of my packet-check program. It’s a fairly simple program that lets you type or paste an API packet. The program then analyses the packet and prints the result of the analysis. Handy if you’re experimenting with API and you want to know whether the packets you’re generating are valid.

The update is minor: the main change is that a TX request packet will now show the ASCII characters in the transmitted data. The update was prompted when I was replying to a recent post from archendekta. I was looking up the ASCII codes by hand, and decided that it would be better if the program would do that for me.

I’ve also reviewed the new product manual for firmware version 1xe6, and made a few cosmetic changes to improve the output where the manual has clarified things. I didn’t find any new packet types or other major differences.

The program is a Tcl script, designed to be run from the command line (command prompt in Windows). It should run on any platform that has Tcl installed. If you want to use it but don’t have Tcl, you can get Tcl for your platform from (eg) [www.activestate.com](http://www.activestate.com). Tcl is free software, and packet-check is of course also free.

Runs on pretty much any platform, including Linux, MacOS and Windows.

Here’s an example of running the new version under Linux.

[john@eccles ~]$ ./packet-check.tcl  
API Packet analyzer for Series 1 XBee (version 0.3)  
Enter packet: 7E 00 13 00 55 00 13 A2 00 40 30 EF 90 00 01 00 48 65 6C 6C 6F 21 F0

Packet: 7E 00 13 00 55 00 13 A2 00 40 30 EF 90 00 01 00 48 65 6C 6C 6F 21 F0  
7E // Correct packet header byte  
00 13 // payload length (decimal 19)  
00 // Packet type: TX request with 64-bit address  
55 // frame id  
00 13 A2 00 40 30 EF 90 // 64-bit destination address  
00 // TX options  
01 // transmitted data SOH  
00 // transmitted data NUL  
48 // transmitted data ‘H’  
65 // transmitted data ‘e’  
6C // transmitted data ‘l’  
6C // transmitted data ‘l’  
6F // transmitted data ‘o’  
21 // transmitted data ‘!’  
F0 // checksum - correct

[john@eccles ~]$

Enjoy!

---

<div class="post-metadata">

**Author:** ![Admin1](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@Admin1](https://forums.digi.com/u/Admin1)\
**Post date:** [October 19, 2009, 1:56pm UTC](https://forums.digi.com/t/new-version-of-packet-check-program/1968/2 "2009-10-19T13:56:03Z")

</div>

Thanks for posting that johnf!

---

<div class="post-metadata">

**Author:** ![eMLz](https://avatars.discourse-cdn.com/v4/letter/e/ee59a6/32.png) [@eMLz](https://forums.digi.com/u/eMLz)\
**Post date:** [October 20, 2009, 1:42am UTC](https://forums.digi.com/t/new-version-of-packet-check-program/1968/3 "2009-10-20T01:42:47Z")

</div>

great learning tool, i.e. for me. appreciate the effort john.

---

<div class="post-metadata">

**Author:** ![eMLz](https://avatars.discourse-cdn.com/v4/letter/e/ee59a6/32.png) [@eMLz](https://forums.digi.com/u/eMLz)\
**Post date:** [October 20, 2009, 2:00am UTC](https://forums.digi.com/t/new-version-of-packet-check-program/1968/4 "2009-10-20T02:00:09Z")

</div>

Hey john,

probably an obvious answer but i want to be sure; we need the SOH and NUL byte to indicate the start of the data portion of the packet? regardless if using TX req for 64 or 16-byte address?

not quite clear on this,  
thx

---

<div class="post-metadata">

**Author:** ![mchargis](https://avatars.discourse-cdn.com/v4/letter/m/9e8a1a/32.png) [@mchargis](https://forums.digi.com/u/mchargis)\
**Post date:** [October 29, 2009, 1:51pm UTC](https://forums.digi.com/t/new-version-of-packet-check-program/1968/5 "2009-10-29T13:51:30Z")

</div>

Your program sounds very useful. However, when I run it on WindowsXP an empty window opens without any prompts. I am running it under ActiveState Tcl v. 8.5 from the command prompt. Any thoughts?

---

<div class="post-metadata">

**Author:** ![johnf](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@johnf](https://forums.digi.com/u/johnf)\
**Post date:** [October 20, 2009, 6:50pm UTC](https://forums.digi.com/t/new-version-of-packet-check-program/1968/6 "2009-10-20T18:50:30Z")

</div>

No, you don’t need those bytes unless they really are part of the data you mean to send.

For instance, this packet would omit them leaving you with just the text:

7E 00 11 00 55 00 13 A2 00 40 30 EF 90 00 48 65 6C 6C 6F 21 F1

Decoded, that’s

Packet: 7E 00 11 00 55 00 13 A2 00 40 30 EF 90 00 48 65 6C 6C 6F 21 F1  
7E // Correct packet header byte  
00 11 // payload length (decimal 17)  
00 // Packet type: TX request with 64-bit address  
55 // frame id  
00 13 A2 00 40 30 EF 90 // 64-bit destination address  
00 // TX options  
48 // transmitted data ‘H’  
65 // transmitted data ‘e’  
6C // transmitted data ‘l’  
6C // transmitted data ‘l’  
6F // transmitted data ‘o’  
21 // transmitted data ‘!’  
F1 // checksum - correct

Hope that helps, and thanks for the nice comments!

---

<div class="post-metadata">

**Author:** ![johnf](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@johnf](https://forums.digi.com/u/johnf)\
**Post date:** [October 29, 2009, 7:49pm UTC](https://forums.digi.com/t/new-version-of-packet-check-program/1968/7 "2009-10-29T19:49:58Z")

</div>

Hmm. Unfortunately I don’t have a Windows machine handy to try this. The only thought that occurs immediately is to ask whether you ran the program like this:  
wish packet-check.tcl  
? If so, that _might_ account for it, though when I do that under linux I do see the prompts. Try  
tclsh packet-check.tcl  
instead. (wish is for GUI programs, but packet-check is pure command line).

If that’s not the answer, let us know and perhaps someone who’s made it work will be able to give more suggestions. And anyway, if it doesn’t do the trick I’ll find a Windows machine and try it myself. This is one of those “there must be a simple answer” questions…

---

<div class="post-metadata">

**Author:** ![mchargis](https://avatars.discourse-cdn.com/v4/letter/m/9e8a1a/32.png) [@mchargis](https://forums.digi.com/u/mchargis)\
**Post date:** [October 30, 2009, 1:15pm UTC](https://forums.digi.com/t/new-version-of-packet-check-program/1968/8 "2009-10-30T13:15:01Z")

</div>

I got it. When the package installs, it updates the path extension, but not the path itself. And for the version I have, the shell is tclsh85, not tclsh

---

<div class="post-metadata">

**Author:** ![stinkydiver73](https://avatars.discourse-cdn.com/v4/letter/s/77aa72/32.png) [@stinkydiver73](https://forums.digi.com/u/stinkydiver73)\
**Post date:** [October 30, 2009, 5:52pm UTC](https://forums.digi.com/t/new-version-of-packet-check-program/1968/9 "2009-10-30T17:52:49Z")

</div>

“tclsh85 packet-check.tcl” working on windows7

---

<div class="post-metadata">

**Author:** ![johnf](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@johnf](https://forums.digi.com/u/johnf)\
**Post date:** [October 30, 2009, 7:42pm UTC](https://forums.digi.com/t/new-version-of-packet-check-program/1968/10 "2009-10-30T19:42:09Z")

</div>

Thanks for the helpful feedback - for the next update I’ve added a comment to mention the tclsh85 bit.

I wonder whether anyone’s tried the program under MacOS? If so, it’d be nice to hear what the invocation procedure is there. I assume it’d be the same as Linux, but I don’t know.
