我在 Windows 10 上使用 Arduino IDE 在 Galileo Intel 的 Arduino 中上传草图。由于 Arduino 运行 Linux,因此代码以某种方式更改为“适合”Linux。我成功地使用 SD 卡运行更大的 Linux 映像,并在拔出/插入板时注意到草图持久性。我也成功地在 Galileo 上上传了闪烁的演示。按照本教程,当我将以太网电缆连接到电路板和我的 PC 时,我运行此代码为其提供一些 IP 地址(正确吗?此代码实际上是做什么的?):
void setup() {
system("telnetd -l /bin/sh");
system("ifconfig eth0 192.168.1.80 netmask 255.255.0.0 up");
}
void loop() {
}
有了这个,我收到了以下消息:
#!/bin/sh
starting download script
# clupload script to invoke lsz
# Copyright (C) 2014 Intel Corporation
#
Args to shell: C:\Users\Gabriel\AppData\Roaming\Arduino15\packages\Intel\tools\sketchUploader\1.6.2+1.0/x86/bin C:\Users\Gabriel\AppData\Local\Temp\build4196129373431759811.tmp/descobrir_ip.cpp.elf COM2
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
COM PORT 2
# License as published by the Free Software Foundation; either
Converted COM Port COM2 to tty port /dev/ttyS1
# version 2.1 of the License, or (at your option) any later version.
Sending Command String to move to download if not already in download mode
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
echo "starting download script"
echo "Args to shell:" $*
# ARG 1: Path to lsz executable.
# ARG 2: Elf File to download
# ARG 3: COM port to use.
#path contains \ need to change all to /
path_to_exe=$1
fixed_path=${path_to_exe//\\/\/}
#COM ports are not always setup to be addressed via COM for redirect.
#/dev/ttySx are present. Howwever, COMy -> /dev/ttySx where x = y - 1
com_port_arg=$3
com_port_id=${com_port_arg/COM/}
echo "COM PORT" $com_port_id
tty_port_id=/dev/ttyS$((com_port_id-1))
echo "Converted COM Port" $com_port_arg "to tty port" $tty_port_id
Deleting existing sketch on target
echo "Sending Command String to move to download if not already in download mode"
echo "~sketch downloadGalileo" > $tty_port_id
C:\Users\Gabriel\AppData\Roaming\Arduino15\packages\Intel\tools\sketchUploader\1.6.2+1.0/clupload/cluploadGalileo_win.sh: line 42: /dev/ttyS1: Permission denied
#Move the existing sketch on target.
echo "Deleting existing sketch on target"
"$fixed_path/lsz.exe" --escape -c "mv -f /sketch/sketch.elf /sketch/sketch.elf.old" <> $tty_port_id 1>&0
C:\Users\Gabriel\AppData\Roaming\Arduino15\packages\Intel\tools\sketchUploader\1.6.2+1.0/clupload/cluploadGalileo_win.sh: line 46: /dev/ttyS1: Permission denied
# Execute the target download command
#Download the file.
host_file_name=$2
"$fixed_path/lsz.exe" --escape --binary --overwrite $host_file_name <> $tty_port_id 1>&0
C:\Users\Gabriel\AppData\Roaming\Arduino15\packages\Intel\tools\sketchUploader\1.6.2+1.0/clupload/cluploadGalileo_win.sh: line 51: /dev/ttyS1: Permission denied
#mv the downloaded file to /sketch/sketch.elf
Moving downloaded file to /sketch/sketch.elf on target
target_download_name="${host_file_name##*/}"
echo "Moving downloaded file to /sketch/sketch.elf on target"
"$fixed_path/lsz.exe" --escape -c "mv $target_download_name /sketch/sketch.elf; chmod +x /sketch/sketch.elf" <> $tty_port_id 1>&0
C:\Users\Gabriel\AppData\Roaming\Arduino15\packages\Intel\tools\sketchUploader\1.6.2+1.0/clupload/cluploadGalileo_win.sh: line 56: /dev/ttyS1: Permission denied
processing.app.SerialException: Erro ao abrir porta serial "COM2".
at processing.app.Serial.<init>(Serial.java:127)
at processing.app.Serial.<init>(Serial.java:71)
at processing.app.SerialMonitor$3.<init>(SerialMonitor.java:93)
at processing.app.SerialMonitor.open(SerialMonitor.java:93)
at processing.app.AbstractMonitor.resume(AbstractMonitor.java:220)
at processing.app.Editor.resumeOrCloseSerialMonitor(Editor.java:2431)
at processing.app.Editor.access$3200(Editor.java:71)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2407)
at java.lang.Thread.run(Thread.java:745)
Caused by: jssc.SerialPortException: Port name - COM2; Method name - openPort(); Exception type - Port busy.
at jssc.SerialPort.openPort(SerialPort.java:164)
at processing.app.Serial.<init>(Serial.java:123)
... 8 more
Erro ao abrir porta serial "COM2".
有人知道发生了什么吗?