Update comm_dissector/README.md and init.lua#428
Conversation
mefistotelis
left a comment
There was a problem hiding this comment.
not sure what series of problems is referred to. also few phrasing/formatting issues.
|
|
||
| ### Create a directory outside the Lua folder | ||
|
|
||
| If you place all of the Lua files in **or under ** Wireshark's LUA folder, you will most likely encounter a frustrating series of problems. To avoid this, create a directory outside Wireshark's plug-in tree. Feel free to create it in use your home directory, for example. |
There was a problem hiding this comment.
"create it in use your home directory" needs fixing
also if you referring to a series of problems, be specific enough to allow users to recognize the series - describe the first problem. (I am actually skeptical here, as I do have the scripts in that folder and I see no issues)
There was a problem hiding this comment.
Fixed. I've also added a comment below to address your skepticism. (Google searches also indicate that I'm not the first person to encounter this issue.)
|
|
||
| If you place all of the Lua files in **or under ** Wireshark's LUA folder, you will most likely encounter a frustrating series of problems. To avoid this, create a directory outside Wireshark's plug-in tree. Feel free to create it in use your home directory, for example. | ||
|
|
||
| (Tech note: When the Lua `dofile` command executes if it is only passed a filename, it try to load it from the current working directory and that probably won't be where the scripts are located.) |
There was a problem hiding this comment.
Would be nice to rephrase so that it is understood on first read, ie.:
"If the Lua dofile command is only provided a file name (without path), it tries to load the file from the current working directory and that probably won't be where the scripts are located."
There was a problem hiding this comment.
Good suggestion, thank you.
| ### Copy the script files | ||
|
|
||
| Copy all the files LUA files (`*.lua`) and to the Wireshark profile directory. If you already different `init.lua` there, merge the content. | ||
| Copy **all the Lua files** (*.lua) to your new directory (that is outside Wireshark's plug) folder **except** `init.lua`. |
There was a problem hiding this comment.
Not sure why code marking was removed from file name with a wildcard.
| Copy **all the Lua files** (*.lua) to your new directory (that is outside Wireshark's plug) folder **except** `init.lua`. | ||
|
|
||
| #### Copying files in Linux | ||
| Copy `init.lua` to your Wireshark `Personal Lua Plugins` directory. You can locate this directory in the `About Wireshark` dialog under the `Folders` tab. For further information refer to the [directories chapter in official documentation](https://www.wireshark.org/docs/wsug_html_chunked/ChAppFilesConfigurationSection.html). |
There was a problem hiding this comment.
Use cursive for Personal Lua Plugins, it is not a specific file name but a term. Interface items should not be in code blocks as well, can use cursive there too.
|
|
||
| The directory usually is `C:\Users\<username>\AppData\Roaming\Wireshark`. Check [directories chapter in official documentation](https://www.wireshark.org/docs/wsug_html_chunked/ChAppFilesConfigurationSection.html) | ||
| and a special chapter for Windows folders if unsure. | ||
| In summary, Wireshark will find `init.lua` in your `Personal Lua Plugins directory`, and `init.lua` in turn must contain an absolute path to the rest of the Lua files. |
There was a problem hiding this comment.
as before, Personal Lua Plugins directory
| Typically, you will capture the communication using either Wiresharks USB/ETH capture or using `comm_*2pcap.py` scripts. Then open the file in Wireshark. | ||
|
|
||
| ## Setup | ||
| ## Setup |
There was a problem hiding this comment.
why are we adding that white space?
There was a problem hiding this comment.
I have chastised both my fingers and my MD editor. :). Fixed.
|
|
||
| dofile('dji-dumlv1-proto.lua') | ||
| -- Change dji_script_path to point to the directory where you have copied | ||
| -- the Lua scripts. Do not place them in the Wireshark Lau directory. |
|
Thanks for the screenshots. So from them, it looks to me that the issue - as you rightfully stated - is that My personal preference was to put symlinks to each file in the Personal Lua Plugins folder. That works on both Windows and Linux (though on these platforms full paths are not required, at least with Wireshark v4.0.17). So if all the above is true, then the sentence "If you place all of the Lua files in **or under ** Wireshark's LUA folder, you will most likely encounter a frustrating series of problems." is not correct. It should instead convey the information that any folder can be used, as long as full path to it is provided within |
On the current version of macOS (15.3.2) with the current version of Wireshark (4.4.6), that is not correct. Placing all of the files in the Personal Lua Plugins folder and changing the paths in init.lua does not work. I have not tested on Linux, or Windows, or with older versions of Wireshark. I noted your mention of Wireshark 4.0.7. The current stable version of Wireshark is 4.4.6 and the previous stable version was 4.2.11. I doubt any users will be installing 4.0.7 these days. Here is some additional information that you might find helpful: I initially updated init.lua to include the files using their full paths, at which point one arrives at error round two:
Then, if you update dji-dumlv1-proto.lua to use full paths to the files it includes, that brings you to error round three because it appears to be loading the same files more than once:
This behaviour appears consistent with the Wireshark documentation: If Lua is enabled, Wireshark will first try to load a file named init.lua from the global plugins directory and then from the user’s personal plugins directory. Then all files ending with .lua are loaded from the global plugins directory and its subdirectories. Then all files ending with .lua in the personal Lua plugins directory and its subdirectories are loaded. The files are processed in ASCIIbetical order (compared byte-by-byte, as strcmp), descending into each subdirectory depth-first in order. There may be someone masochist enough to continue to tinker with the scripts in the Wireshark Lua folder and try to get them to work, but the obvious pragmatic solution at this point was to revert to the original files, place all of the files except init.lua outside of the Wireshark tree, update init.lua to point at them, test it, and then resolve the include issues within dji-dumlv1-proto.lua so that it can find scripts that are in the same directory. Note that having resolved the above script inclusion issues, there was still error round four: One script attempts to use the bit32 library, which was removed in Lua version 5.4 (released in 2020) and this results in a somewhat obscure "null" error. This suggests that the scripts have been incapable of running on the current version of Lua for at least four years. I also observed that there has been an open issue on this problem since April 2020 (#153), that one user was still struggling in 2023, and another apparently felt it necessary to downgrade Wireshark in 2024. Thank you for pointing out the issues in my initial PR, I sincerely appreciate it. That is one of the pleasures of collaboration on GitHub. This is your software and it's up to you what you wish to do with this PR. If you prefer another way of fixing this issue, that is of course your prerogative. I just hope that it does get fixed so that others don't have to invest their time to fix scripts that don't work. As an aside, you might find increased interest in this decoder. I'm probably not the only person who has discovered that at least one current DJI product makes a stream of data in this protocol available via TCP. |
|
LGTM. Thank you for the detailed explanation. |





Updated comm_dissector/README.md with an installation procedure that works with the current version of Wireshark
Corrected capitalization of "LUA" -- the name of the language is "Lua"
Updated init.lua to default to the current behaviour but easily allow users to specify an absolute path the the rest of the *.lua files as recommended in the updated readme
Hopefully this, along with my previous PR, saves new users an hour our so of tinkering.