通过bash脚本发送picocom命令
我想使用picocom命令通过脚本更新设备的固件来发送文件(ymodem协议)。当我手动开始使用相关参数(如下)时,它可以正常工作。例如,我可以通过终端发送命令以重新启动设备。有用。
picocom /dev/ttyACM0 -b 115200
但是,当我运行脚本时,当我将相同的命令放在bash脚本中时,我会出现错误“否此类文件或DirectoryAcm0”。用户已添加到拨号和TTY组中。所以我对这个错误感到困惑。任何建议都会有所帮助。我也尝试了微型糖果,但运气不多。
port is : /dev/ttyACM0
flowcontrol : none
baudrate is : 115200
parity is : none
databits are : 8
stopbits are : 1
escape is : C-a
local echo is : no
noinit is : no
noreset is : no
hangup is : no
nolock is : no
send_cmd is : sz -vv
receive_cmd is : rz -vv -E
imap is :
omap is :
emap is : crcrlf,delbs,
logfile is : none
initstring : none
exit_after is : not set
exit is : no
: No such file or directoryACM0
以下是我要发送的命令的几个示例:
command: #000C0074B0FFFF28!
command: 1
I want to update the firmware of my device via a script using picocom commands to send the file (ymodem protocol). When I start picocom manually, with the relevant parameters (as below), it works. E.g. I can send the command via the terminal to restart the device. It works.
picocom /dev/ttyACM0 -b 115200
However, when I put the same command in a bash script I get the error 'no such file or directoryACM0' when I run the script. The user has been added to the dialout and tty groups. So I am puzzled by the error. any suggestions would be helpful. I also tried minicom, but did not have much luck.
port is : /dev/ttyACM0
flowcontrol : none
baudrate is : 115200
parity is : none
databits are : 8
stopbits are : 1
escape is : C-a
local echo is : no
noinit is : no
noreset is : no
hangup is : no
nolock is : no
send_cmd is : sz -vv
receive_cmd is : rz -vv -E
imap is :
omap is :
emap is : crcrlf,delbs,
logfile is : none
initstring : none
exit_after is : not set
exit is : no
: No such file or directoryACM0
Here are a couple examples of the commands that I want to send:
command: #000C0074B0FFFF28!
command: 1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试通过
picocom
的stdin发送命令,但如果需要,可能必须明确地将 ctrl - 键序列明确翻译。例如 ctrl q 应翻译成0x11
(请参阅此表对于其他序列):更新:
带有给定命令的示例和此处的文档将是:
You can try sending the commands through
picocom
's stdin, but might have to translate explicitly the Ctrl‑key sequences if you need them. For example Ctrlq should be translated to0x11
(see this table for the other sequences):Update:
An example with the given commands and a here-document would be: