Giter Site home page Giter Site logo

neutree / comtool Goto Github PK

View Code? Open in Web Editor NEW
1.6K 38.0 313.0 1.57 MB

Cross platform communicate assistant(Serial/network/terminal tool)( 跨平台 串口调试助手 网络调试助手 终端工具 linux windows mac Raspberry Pi )支持插件和二次开发

Home Page: https://neucrack.com/p/186

License: GNU Lesser General Public License v3.0

Python 99.98% Shell 0.02%
python serial tool debug assistant protocol terminal network tcp udp

comtool's Introduction

COMTool

English | 中文

GitHub PyPI GitHub Workflow Status GitHub repo size GitHub Repo stars

GitHub all releases PyPI - Downloads SourceForge

A cross platform serial debug tools written by python


Windows Linux Raspberry Pi macOS
comtool Windows screenshot comtool linux screenshot comtool Raspberry Pi screenshot
White theme Dark theme protocol plugin TCP/UDP Terminal Graph
comtool white theme comtool dark theme comtool protocol plugin tcp udp plugin terminal plugin graph

screenshot maybe the old version, the latest may not the same totally! But better performance、more easy to use and more elegant

Features

  • cross platform (Windows, Linux, macOS, Raspberry Pi)(code with python, only if your platform support python)
  • reliable stability, no UI freeze
  • multiple language support
  • configs save and auto load(auto save settings when exit)
  • multiple character encode support(ASII,GBK(Chinese),UTF-8,UTF-16 etc.)
  • multiple language support
  • multiple connection type support, and support add connection plugin
    • serial port
      • serial auto detect, and remember last selected support
      • serial offline auto reconnect support
      • port baudrate(any value) bytesize parity stopbits flow control etc. settings
      • rts & dtr control by hand
    • TCP/UDP support, include client and server mode
    • SSH client support
  • plugin support(Create plugin see docs/plugins.md), built-in plugin:
    • dbg plugin, support basic send receive debug operation
      • basic send/receive data (ascii and hex)
      • send and receive data count
      • clear received data area
      • auto linefeed
      • scheduled auto send
      • send history and select send again
      • custom most usage data items and one click to send
      • CR LF(\r\n) or LF(\n) support
      • key shortcuts like Ctrl+Enter to send etc. More see help
      • receive and send record support add timestamp and save log to file
      • send file
      • unix terminal style color support(e.g.\x1b[33;42mhello\x1b[0mhello2)
      • escape character support, like \r \n \t \x etc.
    • protocol plugin, customize your own protocol
      • customize encoding and decoding method
      • customize shortcut key
      • escape character support, like \r \n \t \x etc.
    • terminal plugin, basic terminal interaction
    • graph plugin
      • support dynamicly add graph widgets, add graph widgets you need
      • display line chart in realtime, support customize protocol header(support escape characters)
      • customable button to send data, support shortcut key

Installation

There are two ways to install COMTool:

Install binary

Windows

And you can install by scoop, maintained by StudentWeis

scoop bucket add Nightly https://github.com/StudentWeis/Nightly
scoop install comtool

Linux

Linux has too much version, so we only compile binary for ubuntu. Other distribution please install from pypi or source code. If you have any idea to pack cross platform binary like flatpak or appimage, you can contribute a pull request or add an issue to tell me how to

Arch Linux and its derivative distributions can install from AUR(maintained by taotieren):

# Release version
yay -S python-comtool
# Development version
yay -S python-comtool-git
  • Download release at release page, and extract files from .zip file, and click comtool to run

  • Add current user to dialout group to avoid sudo command

sudo usermod -a -G dialout $USER
grep 'dialout' /etc/group
reboot #must reboot to take effect

Rasberry Pi

Open terminal, install dependencies with package manager:

sudo apt install git python3-pyqt5 python3-numpy

Use package manager to install pyqt5 numpy etc. This way makes install easier. If you meet some error when install with pip, you can try to install with package manager first. To find the package name, the trick is to use sudo apt-cache search package_name | grep package_name to search package name, then install it.

Then install other packages with pip:

git clone https://github.com/Neutree/COMTool.git --depth=1
cd COMTool
pip3 install . --verbose
# 或者
# python setup.py bdist_wheel
# sudo pip3 install dist/COMTool-*.*.*-py3-none-any.whl --verbose
  • Add current user to dialout group to avoid sudo command
sudo usermod -a -G dialout $USER
grep 'dialout' /etc/group
reboot #must reboot to take effect

then enjoy by command

comtool

macOS

If you want to open multiple comtool, just right click dock icon, then click New Window.

or you can open terminal and type

open -n /Application/comtool.app

or

cd /Applicatioin/comtool.app/Contents/MacOS
./comtool

Because the program is not signed by the developer, it will warn when you open it for the first time. You need to go to Settings -> Security and Privacy -> General to see the prompt comtool and click Open anyway.

Windows defender shows comtool binary is malware?

If your program is download from here, it's ok, the error caused by pack issue, all the source code and pack script is here, even the pack progress is totally automated with github action, no one manually pack.

If you remain have concern, just download source code to run with python or pack yourself.

Of course, if you find a better pack way, please open issue to tell us.

Install python package

For developers or the binary not support your platform's, use this way to install

  • Install Python3 first

    • If windows or macOS: dowload python3
    • If linux: ubuntu for example sudo apt install python3 python3-pip, macOS brew install python3 python3-pip
  • Ensure you have pip

pip3 --version
# or
pip --version

If no this command, install by

python3 -m ensurepip
  • Then install from pypi:
pip3 install comtool
comtool

for Chinese, you can use tuna mirrors to download faster by:

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple comtool
  • Or you can directly install from github
pip3 install git+https://github.com/Neutree/COMTool
  • Or you can download source code, then install from source code
    • download source code, download in web page or git clone https://github.com/Neutree/COMTool.git
    • install
cd COMTool
pip install .

or build your own wheel binary

pip3 install wheel
python setup.py bdist_wheel
pip install dist/COMTool-*.*.*-py3-none-any.whl
comtool
  • If encounter error when install with pip, you can try to install with package manager first, then install with pip again. e.g.
sudo apt install python3-pyqt5 python3-numpy cython3

To find the package name, the trick is to use sudo apt-cache search package_name | grep package_name to search package name, then install it.

  • By the way, you should add current user to dialout group to avoid sudo command
sudo usermod -a -G dialout $USER
grep 'dialout' /etc/group
reboot #must reboot to take effect

Manually add app to start menu on Linux

  • Copy tool/comtool.desktop to /usr/share/applications folder(may need root user to do this)
  • Edit /usr/share/applications/comtool.desktop, change icon path Icon=/usr/local/COMTool/assets/logo.ico to actual icon path, you can also use your love icon
  • Then you can find comtool app in start menu(or app center)

Pack binary

pip3 install pyinstaller
python pack.py
cd dist
ls

It's better to create a virtual environment before pack to decrease the size of binary pip install virtualenv virtualenv venv source venv/bin/activate # linux venv/Scripts/activate # windows If you encounter running scripts is disabled on this system, you can temporarily allow the current terminal to execute scripts Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned Then pip install pyinstaller and python pack.py

Development

  1. Install python(>=3.8) and pip3

Linux:

sudo apt install python3 python3-pip

Windows: dowload python3

  1. install packages like pyserial and PyQt5 etc.(list in requirements.txt)
cd COMTool
pip3 install -r requirements.txt

On Raspberry, python3-pyqt5 can be install by apt command:

sudo pip3 install --upgrade pyserial
sudo apt install python3-pyqt5
  1. clone project
git clone https://github.com/Neutree/COMTool.git
  1. code, resolve bugs or add new reatures

Recommended PyCharm IDE or vscode to get start

How to run: Generate translate binary files first(.mo)

python COMTool/i18n.py finish

Then execute main program

python COMTool/Main.py
  1. pull request

Write your own plugins in minutes

see docs/plugins.md

Add translate

  • Install environment first(python pip packages in the requirments.txt)
apt install python3 python3-pip
pip3 install -r requirements.txt
  • If you need to add a new lanuage, or skip

Add locale in i18n.py

locales=["en", "zh_CN", "zh_TW", "ja"]

append your language to this list, locales can be found here or wikipedia, zh_CN for example means China Mainland, corresponding language is simplified Chinese characters, zh_TW means China Taiwan, and language is traditional Chinese characters, you can also only use zh to use simplified Chinese characters.

  • Generate translate files
python i18n.py prepare

This command will generate .po files in locales folder

  • Translate mannually

Then translate .po files, this is a standard translate file format which named gettext

  • Generate binary translate files

to make program read faster, the text files .po should be convert to binary file .mo, just run command:

python i18n.py finish

and then you can see locales/<locale>/LC_MESSAGES/messages.mo file

  • Test

Run application, you will see the new translation

  • Pull request

Create a PR to merge your changes to this repo

Customize theme

In the assets/qss directory under the source code or binary program directory, copy a file from style-dark.qss or style-light.qss, the file name is style-xxx.qss, here xxx is the name of the theme, so that the software can detect the theme. Then modify the qss file according to your preferences. The syntax of qss is similar to css, but the support is not complete. Whether the css syntax can be used depends on the actual effect, haha. Add theme code is welcome!(PR)

In addition, the software has not been deliberately optimized for the theme, and the class and id may have been written casually, so there is no guarantee that future codes will be fully compatible with current qss.

Issue and improvement

Create issue here

License

LGPL-3.0 License

And used these open source projects as libraries:

Donate

If this project helps you, you can buy me a cup of coffee

comtool's People

Contributors

dependabot[bot] avatar junhuanchen avatar neutree avatar taorye avatar taotieren avatar wh201906 avatar yi-- avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

comtool's Issues

打不开

[5662] Error loading Python lib '/opt/comtool/libpython3.9.so.1.0': dlopen: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /opt/comtool/libpython3.9.so.1.0)

can't run on mac

I got the following error on my macos 10.13, but i could run a pyqt5 program on mac before. Do you know how to fix this?

Traceback (most recent call last):
  File "/usr/local/bin/comtool", line 7, in <module>
    from COMTool.Main import main
  File "/usr/local/lib/python3.6/site-packages/COMTool/Main.py", line 3, in <module>
    from COMTool.Combobox import ComboBox
  File "/usr/local/lib/python3.6/site-packages/COMTool/Combobox.py", line 1, in <module>
    from PyQt5.QtWidgets import QComboBox,QListView
ImportError: dlopen(/usr/local/lib/python3.6/site-packages/PyQt5/QtWidgets.so, 2): Library not loaded: @rpath/QtWidgets.framework/Versions/5/QtWidgets
  Referenced from: /usr/local/lib/python3.6/site-packages/PyQt5/QtWidgets.so
  Reason: image not found

功能需求

有没有可能添加保存接收数据和字体颜色的支持呢?

串口列表Combobox的显示问题

当把所有的串口都拔掉后,串口列表Combobox还是会显示有一个串口?

是否需要在方法detectSerialPortProcess()中添加一个


else
      self.serialPortCombobox.clear()

来清除Combobox里的内容

图标问题

图标问题1:现有图标不够有特色,且看不清楚。
建议:设计一个更有特点的图标,突出 COM Tool 的功能。

图标问题1

图标问题2:win10 任务栏图标丢失。

图标问题2

Opposite DTR and RTS state.

According to the code, you may just set the opposite of DTR and RTS, I debug a full day for it, even through I doubt it's maybe my laptop system's bug or the driver bug.

 def dtrChanged(self):
        if self.checkBoxDtr.isChecked():
            self.com.setDTR(False)
        else:
            self.com.setDTR(True)

# so does rtsChanged

已收录 Windows Scoop 桶

首先非常感谢作者大大!

我把您的作品收录到了我的 Scoop 桶中,Windows 用户可以通过 Scoop 很轻松地安装最新版的 COMTool。如下方式:

scoop bucket add Nightly https://github.com/StudentWeis/Nightly
scoop install comtool

您可以在 README.md 中添加说明!

receiveData咨询

首先感谢分享
receiveData 函数中有一句 time.sleep(0.009),想请教一下这句的作用是什么?还有就是0.009是怎么计算出来的呢?

Typing mistake on Readme

Hi!

There's a typing mistake on Readme in Install/developer/install pyserial and PyQt5:
The text should be "sudo pip3 install pyserial pyqt5 bs4"

Thank you for the amazing work!

fail to execute script Main

i try to
“pip3 install pyinstaller
python pack.py
cd dist” to install on win10,then i open "/dist/comtool/comtool.exe", it runs a error

image

[Question] Is COMTool support nvidia xavier platform ?

Platform : nvidia xavier
OS : Ubntu

We try to follow the install goodness to install COMTool in ubuntu,

sudo apt install python3
sudo apt install python3-pip
sudo pip3 install comtool
sudo comtool

but it fail to install pyqt5, is there any install guidness for nvidia xavier platform ?

高分辨率适配

系统:Win10
版本:
image

问题,在高分辨屏幕下界面过小。如果开启DPI,会产生问题模糊。
image

高DPI开启指,这里的设置。
image

image

本机的分辨率:
image

几个功能建议

不知道还会继续开发嘛?提几个功能建议

  1. UI上同时显示tx.rx的内容,用不同颜色来区分
  2. 可以判断监控串口连接是否已经断开,如果设备断开就回显一行comx已经离线,如果设备重连自动重新打开串口提示comx重新上线
  3. 已经发送的命令可以以侧边栏列表显示,目前点击下拉框的操作效率有点低

cxsetup don't work

I run the cxsetup.py and input "setup()" but there is nothing happened.
I want to make it a ".exe" but it can't succeed when i use the "pyinstaller" straight.
Could you help me please?
Thank you.

可否记忆上次使用的皮肤?

win10下,每次打开先是浅色再切换为深色。有时需要一直用浅色皮肤,可否加入记忆功能而不是每次打开都重置为深色,感谢开发者。

树莓派4B现在无法安装

根据README.MD输入 sudo pip3 install dist/COMTool-*.*.*-py3-none-any.whl ,显示文件不存在。
dist中文件实际是COMTool-1.7.9-py2-none-any.whl。
根据文件名改为输入sudo pip3 install COMTool-1.7.9-py2-none-any.whl .
显示 COMTool-1.7.9-py2-none-any.whl is not supported wheel on this platform

今年一月份是可以安装并正常使用的。

COMTool 打包到 Arch Linux AUR 仓库

补充了依赖包,进行了一些删改,python-comtool
python-comtool-git
python-comtool 发行版

# Maintainer: taotieren <[email protected]>

pkgname=python-comtool
pkgver=2.2.0
pkgrel=1
epoch=
pkgdesc="A cross platform serial debug tools written by python"
arch=('any')
url="https://github.com/Neutree/COMTool"
license=('LGPL3.0')
groups=()
depends=('python' 'python-pyqt5' 'python-pyserial' 'python-requests' 'python-babel' )
makedepends=('python-build' 'python-installer' 'python-wheel')
checkdepends=()
optdepends=()
provides=('COMTool')
conflicts=('comtool' 'python-comtool-git')
replaces=()
backup=()
options=('!strip')
install=
changelog=
source=("${pkgname#python-}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz")
noextract=()
sha256sums=('ecddf7b8c96803eab5739d948160f08ba4ef203c8d271f186a5e9c532ae1aec6')
#validpgpkeys=()

build() {
    cd "${srcdir}/COMTool-${pkgver}"
    python -m build --wheel --no-isolation
}

package() {
    cd "${srcdir}/COMTool-${pkgver}"
    python -m installer --destdir="${pkgdir}" dist/*.whl
    rm -rf "${pkgdir}/usr/LICENSE"
    rm -rf "${pkgdir}/usr/README.MD"
    install -Dm0644 "${srcdir}/COMTool-${pkgver}/COMTool/assets/logo.png" "${pkgdir}/usr/share/pixmaps/${pkgname#python-}.png"
    install -Dm0644 /dev/stdin "${pkgdir}/usr/share/applications/io.github.neutree.${pkgname#python-}.desktop" << EOF
[Desktop Entry]
Version=1.0
Type=Application
Name=ComTool
Comment=comtool serial communication debug tool
Exec=${pkgname#python-} %U
Icon=${pkgname#python-}.png
Categories=Development;
Terminal=false
StartupNotify=true
MimeType=application/x-executable;
EOF
}

python-comtool-git 开发版

# Maintainer: taotieren <[email protected]>

pkgname=python-comtool-git
pkgver=2.2.1.r4.g9f2e897
pkgrel=1
epoch=
pkgdesc="A cross platform serial debug tools written by python"
arch=('any')
url="https://github.com/Neutree/COMTool"
license=('LGPL3.0')
groups=()
depends=('python' 'python-pyqt5' 'python-pyserial' 'python-requests' 'python-babel' )
makedepends=('python-build' 'python-installer' 'python-wheel' 'git')
checkdepends=()
optdepends=()
provides=('COMTool')
conflicts=('comtool' 'python-comtool')
replaces=()
backup=()
options=('!strip')
install=
changelog=
source=("git+${url}.git")
noextract=()
sha256sums=('SKIP')
#validpgpkeys=()

pkgver() {
    cd "${srcdir}/COMTool"
    git describe --long --tags | sed 's/v//g;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
    cd "${srcdir}/COMTool"
    python -m build --wheel --no-isolation
}

package() {
    cd "${srcdir}/COMTool"
    python -m installer --destdir="${pkgdir}" dist/*.whl
    rm -rf "${pkgdir}/usr/LICENSE"
    rm -rf "${pkgdir}/usr/README.MD"
    install -Dm0644 "${srcdir}/COMTool/COMTool/assets/logo.png" "${pkgdir}/usr/share/pixmaps/comtool.png"
    install -Dm0644 /dev/stdin "${pkgdir}/usr/share/applications/io.github.neutree.comtool.desktop" << EOF
[Desktop Entry]
Version=1.0
Type=Application
Name=ComTool
Comment=comtool serial communication debug tool
Exec=comtool %U
Icon=comtool.png
Categories=Development;
Terminal=false
StartupNotify=true
MimeType=application/x-executable;
EOF
}

image
image

颜色

image
有时候不能够添加颜色

串口打开False,实际打开成功,还有关闭串口也报错,用的pycharm+python3.5+pyqt5,win7 32位运行,持续关注中。。。。

icon path:C:/Users/Administrator/Desktop/COMTool-master/COMToolData/assets/logo.png
data path:C:/Users/Administrator/Desktop/COMTool-master/COMToolData
1
Already latest version!
Serial<id=0x260edd0, open=False>(port='COM6', baudrate=9600, bytesize=8, parity='N', stopbits=1.0, timeout=None, xonxoff=False, rtscts=False, dsrdtr=False)

receiveData error
ClearCommError failed (OSError(9, '句柄无效。', None, 6))

mac 安装 brew 报错了

log 如下:

OYHmac:~ ouyanghuan$ brew install python3 python3-pip

Updating Homebrew...
==> Downloading https://homebrew.bintray.com/bottles-portable-ruby/portable-ruby-2.3.3_2.leopard_64.bottle.tar.gz
######################################################################## 100.0%
==> Pouring portable-ruby-2.3.3_2.leopard_64.bottle.tar.gz
==> Homebrew has enabled anonymous aggregate user behaviour analytics.
Read the analytics documentation (and how to opt-out) here:
https://docs.brew.sh/Analytics

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Error: Failure while executing: git config --local --replace-all homebrew.analyticsmessage true
Error: No available formula with the name "python3-pip"
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
git -C "$(brew --repo homebrew/core)" fetch --unshallow

Error: No previously deleted formula found.

Raspberry运行出错

%Run Main.py
libEGL warning: DRI2: failed to authenticate
qt5ct: using qt5ct plugin
Traceback (most recent call last):
File "/home/pi/Desktop/Program/COMTool-master/COMTool/Main.py", line 799, in
main()
File "/home/pi/Desktop/Program/COMTool-master/COMTool/Main.py", line 783, in main
mainWindow = MainWindow(app)
File "/home/pi/Desktop/Program/COMTool-master/COMTool/Main.py", line 54, in init
pathDirList.pop()
IndexError: pop from empty list

inotify_add_watch("/home/pi/.config/qt5ct") failed: "No such file or directory"

功能建议

建议增加串口内容保存功能
建议增加串口数据添加时间戳功能

No module named 'COMTool.wave'

I wanted to change some code for some personal usage, but I couldn't execute Main.py properly. If I directly execute Main.py, the interpreter points out the following content:

Traceback (most recent call last):
File ".../COMTool-master/COMTool-master/COMTool/Main.py", line 4, in
from COMTool.wave import Wave
ModuleNotFoundError: No module named 'COMTool.wave'

I tried to change the code in line 4 to import wave or some others, but it didn't work.
How to solve this problem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.