Ⅰ 请教procomm plus 的基本使用方法
1 串口脚本
有些串口工具(例如串口调试助手)有定时发送功能,但只能发送一条固定的命令。我需要发送几百条命令,又懒得写程序,就希望找一个可以执行串口脚本的工具。然后我找到了procomm plus。
procomm plus的功能很多。我只需要串口脚本功能,所以没有执行安装程序,解压后直接执行Programs目录的PW5.EXE。在菜单中选择Options->System Options->Modem Connection...,在“Current Modem/Connection”的下拉列表中选择要打开的串口或modem。在主窗口下方可以直接点击、设置编码格式、波特率。编码格式可以选择RAW ASCII。在主窗口可以直接敲AT命令,看到响应,和超机终端差不多。
在菜单中选择Tools->Scripts,就可以看到脚本相关的菜单,包括执行、编译、编辑、录制脚本。procomm plus的脚本系统叫做ASPECT,功能看上去很强大,可以定义变量,有for、while 等流程控制,甚至包括接受用户输入的对话框。procomm plus中有完善的教程和帮助文档。
我当然不会先看文档。首先做的就是录制一个脚本,看看大概是什么样子,然后照猫画虎编写自己的脚本。脚本的源文件是后缀为WAS的文件。源文件经过编译才能运行,编译产生的文件后缀是wax。
如果读者也是只想用串口脚本功能,建议不要安装procomm plus,直接运行就可以了。安装后,每次启动会检测所有modem,浪费时间。
2 脚本示例
2.1 发送大量命令
我要做的一个事情就是给一个modem打补丁,要发送两百多条命令。例如:
AT:PIB AT:Pf800,7b5d,4dc,7b5f,4de,7b59,4d8,7b5b,4da AT:Pf808,7b55,4d4,7b57,4d6,7b51,4d0,7b53,4d2 ...
modem对这些命令的响应都是"\r\nOK\r\n"。通过录制的脚本,可以看到发送命令并等待响应的过程可以用以下语句完成:
transmit "AT:PIB^M" waitfor "K^M^J"
显然transmit就是向串口写。waitfor就是等待响应了。^M是回车符0D(就是\r)、^J是换行符0A(就是\n)。 waitfor语句在等待正常响应的最后3个字符。看懂这两句后,编写脚本的过程就是对要发送命令的简单替换。 我常用的文本编辑器是我自己写的cnbook。在cnbook中将行首
^
替换成
transmit "
将行尾
$
替换成
^M"\n waitfor "K^M^J"
替换时要选上“正则表达式”。将替换后的文本放到
proc main endproc
之间就可以了。完整的脚本看上去是这样:
proc main transmit "AT:PIB^M" waitfor "K^M^J" transmit "AT:Pf800,7b5d,4dc,7b5f,4de,7b59,4d8,7b5b,4da^M" waitfor "K^M^J" transmit "AT:Pf808,7b55,4d4,7b57,4d6,7b51,4d0,7b53,4d2^M" waitfor "K^M^J" ... endproc
以后我需要打补丁,就是执行这两百多条命令的时候,只要执行这个脚本就可以了。
2.2 自动测试
我需要通过串口敲键测试一台设备。我录制了一次测试过程,然后用for循环自动测试100次。脚本看上去是这样:
proc main integer Num ; Integer variable to increment. for Num = 0 upto 100 ; Init variable and define loop. transmit "o" waitfor "wait ..." transmit "1" waitfor "wait ..." transmit "0" waitfor "wait ..." transmit "0" waitfor "wait ..." transmit "0" waitfor "xt_connected_enter^M^J" transmit "p" waitfor "xt_idle_enter^M^J" ... endfor endproc
当然,在很多情况下,人工测试比自动测试更容易发现问题。不过,用串口脚本作自动测试也可以作为一种辅助的手段。
3 结束语
procomm plus的功能还有很多,它的脚本系统ASPECT的功能也远远不止于此。不过目前我只用到这些。
Ⅱ 809h打开串口的方法
rt809h可以通过在脚本数据中opendata打开串口。
然而在国外的发达国家早已经都普级化的在使用了,不管是家用还在商用或在军工级使用。为什么发达国家使用的这么广泛呢?一,是因为别人的技术领先于我们,在我们的有线网线还没有普及时他们的无线网络都已线开发的比成熟了。
于2010年九汉推出了232/485转WIFI的串口设备H-601。基于技术和成本现阶段基本上已经解决了,最要的是要使H-601能够广泛的应用到各种工业领域,也解决布线的困难。
232/485转WIFI设备支持通过指定信道号的方式来进行快速联网。在通常的无线联网过程中,会首先对当前的所有信道自动进行一次扫描,来搜索准备连接的目的AP创建的(或Adhoc)网络。本模块提供了设置工作信道的参数,在已知目的网络所在信道的条件下,可以直接指定模块的工作信道,从而达到加快联网速度的目的。
2无线漫游:232/485转WIFI设备支持基于802.11协议的无线漫游功能。无线漫游指的是为了扩大一个无线网络的覆盖范围,由多个AP共同创建一个具有相同的SSID/ESSID的无线网络,每个AP用来覆盖不同的区域,接入到该网络的STA可以根据所处位置的不同选择一个最近(即信号最强)的AP来接入,而且随着STA的移动自动的在不同的AP之间切换。
Ⅲ 请问有什么好用的串口调试助手吗
推荐伏特加串口调试助手,用起来真的很方便
Ⅳ 嵌入式ARM linux系统如何设置开机启动应用程序
其实楼主的问题很专业,之前我在周立功那边也了解过不少。
当用户需要EasyARM-iMX283在开机启动后就运行指定的应用程序或指令时,可以通过vi命令编辑/etc/rc.d/init.d/start_userapp,将要执行的指令添加到里面。若用户有一个hellow的程序放在/home/目录中,那么设置hellow程序开机启动的方法如程序清单 1.1红色部分所示。
程序清单1.1 用户启动文件
#!/bin/sh
#you can add your app start_command three
/home/hellow
#start qt command,you can delete it 下面是启动QT界面的指令,若用户不需要启动QT,可以直接删除
export TSLIB_PLUGINDIR=/usrb/ts/
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_TSDEVICE=/dev/input/ts0
export TSLIB_CALIBFILE=/etc/pointercal
export QT_QWS_FONTDIR=/usrb/fonts
export QWS_MOUSE_PROTO=Tslib:/dev/input/ts0
/usr/yuan/zylauncher/start_zylauncher &
如果程序是一个阻塞程序(程序被运行后不会退出或返回),则可能会导致位于其后的指令或程序无法得到执行,并且始终占用串口终端,造成其他程序(比如Shell)无法通过串口终端与用户交互。对于此类应用程序,可以在其后面添加“ &”(注意:是“空格”+“&”符号)让其在后台运行,如下所示:
/home/hellow &
Ⅳ MCGS触摸屏的脚本程序能实现什么功能,怎样编写
这个功能可太多了,数学运算、画面切换、串口通信、数据存取、属性修改、权限设置、权限管理、配方管理、配方设置等等,说不完了
编写就在脚本里编写就行了,可以在启动脚本,退出脚本,循环脚本,按钮属性脚本,事件脚本,等等地方编写
望采纳。。。。
Ⅵ python的串口close()函数关闭不成功
用ser.isOpen()查看返回False,说明ser.close()起作用了啊。用管理员身份打开cmd,再执行脚本试试?
Ⅶ linux shell 串口
最好能将问题更准确的描述,看的费力! 脚本和串口命令以及运行结果截个图上来看看
我估计是
参数没有正确传递进去。
串口读取从SHELL脚本传递进来的参数应该不是正确的。
你看一下运行串口程序的时候,是否开启了一个新的进程,并且重新初始化了所有变量。
Ⅷ 怎么写个脚本 然用户在打开某个软件的时候电脑自动重启呢
把下面这行保存成,"重启.bat'文件即可
shutdown -r -t 0
这个要自己写一个hook。每次创建进程是你都知道是那个程序,看到不喜欢的程序你就可以从新启动了。
这里有网络介绍
http://ke..com/view/1208620.htm#sub1208620
这里有msdn介绍
SetWindowsHookEx Function
--------------------------------------------------------------------------------
The SetWindowsHookEx function installs an application-defined hook procere into a hook chain. You would install a hook procere to monitor the system for certain types of events. These events are associated either with a specific thread or with all threads in the same desktop as the calling thread.
Syntax
HHOOK SetWindowsHookEx( int idHook,
HOOKPROC lpfn,
HINSTANCE hMod,
DWORD dwThreadId
);
Parameters
idHook
[in] Specifies the type of hook procere to be installed. This parameter can be one of the following values.
WH_CALLWNDPROC
Installs a hook procere that monitors messages before the system sends them to the destination window procere. For more information, see the CallWndProc hook procere.
WH_CALLWNDPROCRET
Installs a hook procere that monitors messages after they have been processed by the destination window procere. For more information, see the CallWndRetProc hook procere.
WH_CBT
Installs a hook procere that receives notifications useful to a computer-based training (CBT) application. For more information, see the CBTProc hook procere.
WH_DEBUG
Installs a hook procere useful for debugging other hook proceres. For more information, see the DebugProc hook procere.
WH_FOREGROUNDIDLE
Installs a hook procere that will be called when the application's foreground thread is about to become idle. This hook is useful for performing low priority tasks ring idle time. For more information, see the ForegroundIdleProc hook procere.
WH_GETMESSAGE
Installs a hook procere that monitors messages posted to a message queue. For more information, see the GetMsgProc hook procere.
WH_JOURNALPLAYBACK
Installs a hook procere that posts messages previously recorded by a WH_JOURNALRECORD hook procere. For more information, see the JournalPlaybackProc hook procere.
WH_JOURNALRECORD
Installs a hook procere that records input messages posted to the system message queue. This hook is useful for recording macros. For more information, see the JournalRecordProc hook procere.
WH_KEYBOARD
Installs a hook procere that monitors keystroke messages. For more information, see the KeyboardProc hook procere.
WH_KEYBOARD_LL
Windows NT/2000/XP: Installs a hook procere that monitors low-level keyboard input events. For more information, see the LowLevelKeyboardProc hook procere.
WH_MOUSE
Installs a hook procere that monitors mouse messages. For more information, see the MouseProc hook procere.
WH_MOUSE_LL
Windows NT/2000/XP: Installs a hook procere that monitors low-level mouse input events. For more information, see the LowLevelMouseProc hook procere.
WH_MSGFILTER
Installs a hook procere that monitors messages generated as a result of an input event in a dialog box, message box, menu, or scroll bar. For more information, see the MessageProc hook procere.
WH_SHELL
Installs a hook procere that receives notifications useful to shell applications. For more information, see the ShellProc hook procere.
WH_SYSMSGFILTER
Installs a hook procere that monitors messages generated as a result of an input event in a dialog box, message box, menu, or scroll bar. The hook procere monitors these messages for all applications in the same desktop as the calling thread. For more information, see the SysMsgProc hook procere.
lpfn
[in] Pointer to the hook procere. If the dwThreadId parameter is zero or specifies the identifier of a thread created by a different process, the lpfn parameter must point to a hook procere in a dynamic-link library (DLL). Otherwise, lpfn can point to a hook procere in the code associated with the current process.
hMod
[in] Handle to the DLL containing the hook procere pointed to by the lpfn parameter. The hMod parameter must be set to NULL if the dwThreadId parameter specifies a thread created by the current process and if the hook procere is within the code associated with the current process.
dwThreadId
[in] Specifies the identifier of the thread with which the hook procere is to be associated. If this parameter is zero, the hook procere is associated with all existing threads running in the same desktop as the calling thread.
Return Value
If the function succeeds, the return value is the handle to the hook procere.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.
Remarks
SetWindowsHookEx can be used to inject a DLL into another process. A 32-bit DLL cannot be injected into a 64-bit process, and a 64-bit DLL cannot be injected into a 32-bit process. If an application requires the use of hooks in other processes, it is required that a 32-bit application call SetWindowsHookEx to inject a 32-bit DLL into 32-bit processes, and a 64-bit application call SetWindowsHookEx to inject a 64-bit DLL into 64-bit processes. The 32-bit and 64-bit DLLs must have different names.
An error may occur if the hMod parameter is NULL and the dwThreadId parameter is zero or specifies the identifier of a thread created by another process.
Calling the CallNextHookEx function to chain to the next hook procere is optional, but it is highly recommended; otherwise, other applications that have installed hooks will not receive hook notifications and may behave incorrectly as a result. You should call CallNextHookEx unless you absolutely need to prevent the notification from being seen by other applications.
Before terminating, an application must call the UnhookWindowsHookEx function to free system resources associated with the hook.
The scope of a hook depends on the hook type. Some hooks can be set only with global scope; others can also be set for only a specific thread, as shown in the following table.
Hook Scope
WH_CALLWNDPROC Thread or global
WH_CALLWNDPROCRET Thread or global
WH_CBT Thread or global
WH_DEBUG Thread or global
WH_FOREGROUNDIDLE Thread or global
WH_GETMESSAGE Thread or global
WH_JOURNALPLAYBACK Global only
WH_JOURNALRECORD Global only
WH_KEYBOARD Thread or global
WH_KEYBOARD_LL Global only
WH_MOUSE Thread or global
WH_MOUSE_LL Global only
WH_MSGFILTER Thread or global
WH_SHELL Thread or global
WH_SYSMSGFILTER Global only
For a specified hook type, thread hooks are called first, then global hooks.
The global hooks are a shared resource, and installing one affects all applications in the same desktop as the calling thread. All global hook functions must be in libraries. Global hooks should be restricted to special-purpose applications or to use as a development aid ring application debugging. Libraries that no longer need a hook should remove its hook procere.
Windows 95/98/Me: SetWindowsHookEx is supported by the Microsoft Layer for Unicode (MSLU). However, it does not make conversions. To see Unicode messages, notifications, and so forth, you must subclass the window. To use this version of the application programming interface (API), you must add certain files to your application, as outlined in Installing and Releasing Hook Proceres.
Example
For an example, see Installing and Releasing Hook Proceres.
Function Information
Minimum DLL Version user32.dll
Header Declared in Winuser.h, include Windows.h
Import library User32.lib
Minimum operating systems Windows 95, Windows NT 3.1
Unicode Implemented as ANSI and Unicode versions.
See Also
Hooks Overview, CallNextHookEx, CallWndProc, CallWndRetProc, CBTProc, DebugProc, ForegroundIdleProc, GetMsgProc, JournalPlaybackProc, JournalRecordProc, LowLevelKeyboardProc, LowLevelMouseProc, KeyboardProc, MouseProc, MessageProc, ShellProc, SysMsgProc, UnhookWindowsHookEx
Ⅸ 如何进行pixhawk的串口调试
以下所描述的都是针对px4原生固件,此外,由于固件更新过于频繁,本文描述的是15年7月的固件,主要是举例,有改动的话,自己再研究研究吧(后面换cmake编译方式了,改动蛮大)。
既然要做开发,第一步就是搭好开发环境,根据我的经验,最好是在linux环境下编译,这样效率会很快,以前在windows下编译,经常40分钟以上,这样就太影响开发了;
第二步,大概了解下固件的架构,
如果只涉及应用层的开发,那底层的nuttx系统就可以绕过去了,一般,最好先把uorb模块的机制整明白就好了,从uorb入手,了解每个话题的来源以及作用,整理数据流,清楚每个模块之间的关系即可,比如,要实现手动模式,哪些模块互相交互,auto模式,又有哪些模块起作用,
如果涉及相应算法的开发,要学会定位到相应的算法模块,甚至具体到哪些代码,比如,你想试验你的姿态估计算法,那你就将姿态估计模块替换掉即可,不过相应的接口仍需要和px4环境一样,以姿态估计为例,最后要发布你的vehicle_attitude话题,不然无法与其他模块交互;
另外,不要试图在代码中找main函数,那是单片机思维,你只需看启动脚本即可,\ROMFS\px4fmu_common\init.d\rcs;
第三步,针对你的具体情况,定位相应的模块,进行精读研究,虽然模块基本是用C++写的,但是不会C++也没关系,毕竟又不是让你写,本人倒目前为止,也不会C++,配合注释,看明白就好了,比如,整理下mavlink的控制流程;
px4原生固件模块列表:
系统命令程序
mavlink –通过串口发送和接收mavlink信息
sdlog2 –保存系统日志/飞行数据到SD卡
tests –测试系统中的测试程序
top –列出当前的进程和CPU负载
uORB – 微对象请求代理器-分发其他应用程序之间的信息
驱动
mkblctrl–blctrl电子模块驱动
esc_calib –ESC的校准工具
fmu –FMU引脚输入输出定义
gpio_led –GPIOLED驱动
gps –GPS接收器驱动
pwm –PWM的更新速率命令
sensors –传感器应用
px4io –px4io驱动
uavcan –uavcan驱动
飞行控制的程序
飞行安全和导航
commander –主要飞行安全状态机
navigator –任务,失效保护和RTL导航仪
估计姿态和位置
attitude_estimator_ekf –基于EKF的姿态估计
ekf_att_pos_estimator –基于EKF的姿态和位置估计
position_estimator_inav–惯性导航的位置估计
multirotor姿态和位置控制器
mc_att_control–multirotor姿态控制器
mc_pos_control –multirotor位置控制器
fixedwing姿态和位置控制器
fw_att_control –固定翼飞机的姿态控制
fw_pos_control_l1 –固定翼位置控制器
垂直起降姿态控制器
vtol_att_control –垂直起降姿态控制器
最后提一句,多看看官网的说明,另外根据本人的经验来看,由于大框架,代码人家都写好了,通常你要加功能,所修改的也就几行代码而已,举例说明,比如px4固件只能在手动模式解锁,假如我要修改成定高模式解锁
Ⅹ 请问:华为小豚摄像头安全吗
图 4-6 通过串口顺利登录设备
5. 小结
到此即是我们对小豚 AI 摄像头的第一篇,在本文中,我们对此设备进行了简单的外部分析,并顺利的开启了设备的串口功能。但事实上,我们分析的很多设备是无法启用串口的,所以在下一篇文章中,我们会继续分享其他的系统登录方法。在登录系统之后,我们还会分析其中的一个关键程序,就是产生 TLS 加密通信的关键程序。