LoginSignup
1
3

More than 3 years have passed since last update.

UbuntuでESP32を使う際のVCPセットアップメモ

Posted at

下記リンクからwgetなどを用いてソースをダウンロードの後、展開すれば良い。
https://www.silabs.com/documents/login/software/Linux_3.x.x_4.x.x_VCP_Driver_Source.zip

以下を実行する。

sh
wget https://www.silabs.com/documents/login/software/Linux_3.x.x_4.x.x_VCP_Driver_Source.zip

unzip Linux_3.x.x_4.x.x_VCP_Driver_Source.zip

cd Linux_3.x.x_4.x.x_VCP_Driver_Source

make

sudo cp cp210x.ko /lib/modules/4.9.140-tegra/kernel/drivers/usb/serial/

sudo insmod /lib/modules/4.9.140-tegra/kernel/drivers/usb/serial/usb_wwan.ko

sudo insmod cp210x.ko

また、起動時に以下のステップが必要である。
/dev/ttyUSB*は各自環境によって違う。

terminal
$ sudo chmod 666 /dev/ttyUSB0

自動化するためにexpectなどを用いてやると良い。
ただしパスワードを直接ファイルに書き込むのは危険なので工夫すること。

sh
#!/bin/sh

PW=$(openssl rsautl -decrypt -inkey ~/.ssh/id_rsa -in ~/.ssh/password.rsa)
expect -c "
set timeout 5
spawn env LANG=C sudo chmod 666 /dev/ttyUSB0
expect \"password:\"
send \"${PW}\n\"
expect \"$\"
exit 0
"
1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3