Bye Bye Moore

PoCソルジャーな零細事業主が作業メモを残すブログ

入れ立てpip環境でCommand "python setup.py egg_info" failed with error code 1 in ……とか言われたらsetuptoolsがちゃんと入っていないかも

実際のところ

pipの環境をつくり、bottleを導入しようとしたところ以下のエラーが。

$ pip3 install bottle
Collecting bottle
  Downloading https://files.pythonhosted.org/packages/bd/99/04dc59ced52a8261ee0f965a8968717a255ea84a36013e527944dbf3468c/bottle-0.12.13.tar.gz (70kB)
    100% |████████████████████████████████| 71kB 691kB/s 
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ImportError: No module named 'setuptools'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-yichxlqw/bottle/

エラーログをみると、"setuptools"がないとか言ってますね。

$ pip3 install --upgrade setuptools
Collecting setuptools
  Downloading https://files.pythonhosted.org/packages/e7/16/da8cb8046149d50940c6110310983abb359bbb8cbc3539e6bef95c29428a/setuptools-40.6.2-py2.py3-none-any.whl (573kB)
    100% |████████████████████████████████| 573kB 564kB/s 
Installing collected packages: setuptools
Successfully installed setuptools-40.6.2

Raspbian環境にて無線LAN + 固定IP設定(内部)

Raspbian環境にて無線LAN + 固定IPを設定する方法です。
私の用途ではルーターから外には出るものの、
ルーター外部からアクセスするケースは考えていない構成です。

実際のところ

ターゲットはRaspbianで
固定IPはローカルネットの中だけで使用する、"192.168.0.20"にするケースです。

ネットワークインターフェイス

まずインターフェイスをきめます。

$ cat /etc/network/interfaces
auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual 
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

ここで、ファイル冒頭に

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

とあるようにIPアドレス系はDHCPの設定ファイルに記述します。
ネット上の古い情報だとinterfaceに書いてたりしますけど、
今時はそうしないようです。

wpa_supplicant

次に無線系の設定でつかうwpa_supplicantを。
ほんとはpskは暗号化したほうがいいのですが……今回は急ぎだったのでそのまんま

$ cat  /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=JP

network={
	ssid="YOUR_SSID"
	psk="YOUR_PASS"
}

dhcpcd.conf

最後に……私個人が一番引っかかってしまったDHCPまわりを。
末尾にこんな感じで記載します。

$ tail /etc/dhcpcd.conf
#static domain_name_servers=192.168.1.1

# fallback to static profile on eth0
#interface eth0


interface wlan0
static ip_address=192.168.0.20/24
static routers=192.168.0.254
static domain_name_servers=192.168.0.254

再起動と確認

$ sudo reboot
...
$ ping google.com
PING google.com (216.58.197.142) 56(84) bytes of data.
64 bytes from nrt12s01-in-f142.1e100.net (216.58.197.142): icmp_seq=1 ttl=53 time=30.8 ms
...

tightVNC環境をRaspberry Pi 3 B+/ Tinker Board Sにつくる

debian

sudo apt install tightvncserver

初回起動ではパスワード指定。
閲覧用のパスもあるが、今回はなしで。

$ vncserver
 
You will require a password to access your desktops.
 
Password:********
Verify:********
Would you like to enter a view-only password (y/n)? n
 
New 'X' desktop is raspberrypi:1

新規にウィンドウをつくる

$ vncserver :1 -geometry 1280x800 -depth 24

ウィンドウを消す

$ vncserver -kill :1

macOS

Finder で Cmd+K
URL入力
f:id:shuzo_kino:20181119015308p:plain
パスを設定
f:id:shuzo_kino:20181119015318p:plain

こんなアイコン
f:id:shuzo_kino:20181119015302p:plain

debian LXDC
f:id:shuzo_kino:20181119015253p:plain
Raspbian PIXELも
f:id:shuzo_kino:20181119015249p:plain

Raspbian Lite系で急遽デスクトップ環境が必要になったとき

Raspbian Liteを入れたけど、退っ引きならない事情……たとえばGUI前提のツールを使う時……などで急遽デスクトップ環境が必要になった際の手順です。

いまどきはPIXILという超格好いいあれがあるのですが……まぁ、導入コストは重いです。

実際のところ

まずはxserverの導入

$ sudo apt install --no-install-recommends xserver-xorg
$ sudo apt install --no-install-recommends xint

いよいよ本丸のPIXIL

$ sudo apt install raspberrypi-ui-mods

参考もと

kokensha.xyz

raspi 3b+にarduino ide環境をつくる

ARM用1.8.7系IDEのリンクは以下の通り。
https://downloads.arduino.cc/arduino-1.8.7-r1-linuxarm.tar.xz
マグカップやTシャツが御用入りの際は、ぜひロゴ入りのやつを買ってくださいね。

$ #{YOUR_DOWNLOAD_DIR}
$ tar -xvf arduino-1.8.7-r1-linuxarm.tar.xz

おわったらば、解答先に移動してinstall.shを……といっても、デスクトップにアイコンがでるだけですが……。

$ cd arduino-1.8.7/
$ ./install.sh 
Adding desktop shortcut and menu item for Arduino IDE... done!

なんでaptじゃないの?

私も最初はaptでいれるのかな〜と思ってましたが、なんかJVM系でエラーが起きるため断念。
さらに調べると、どうもV1.0.5とかいう化石を使っている模様……
ESP32やArduino Zeroのような次世代ボードに対応できない恐れが大きかっため断念しました。

$ apt-cache show arduino
Package: arduino
Version: 2:1.0.5+dfsg2-4.1
Installed-Size: 1618
Maintainer: Scott Howard <showard@debian.org>
Architecture: all
Depends: default-jre | java6-runtime, libjna-java, librxtx-java (>= 2.2pre2-3), arduino-core (= 2:1.0.5+dfsg2-4.1)
Recommends: extra-xdg-menus, policykit-1
Size: 1191444
SHA256: 5f06633c7334f8d2e49cac2e2a1e9459aa9db069940057e18f2513e2a5fcc504
SHA1: a55df598f7976419f1b06354c31932f44f86fae2
MD5sum: b50e59821befd0581f254eb3bfeae8d2
Description: AVR development board IDE and built-in libraries
 Arduino is an open-source electronics prototyping platform based on
 flexible, easy-to-use hardware and software. It's intended for artists,
 designers, hobbyists, and anyone interested in creating interactive
 objects or environments.
 .
 This package will install the integrated development environment that
 allows for program writing, code verfication, compiling, and uploading
 to the Arduino development board. Libraries and example code will also
 be installed.
Description-md5: 60f8f72e8783c6b5a72254120b680cdb
Homepage: http://www.arduino.cc
Tag: field::electronics, role::program
Section: electronics
Priority: extra
Filename: pool/main/a/arduino/arduino_1.0.5+dfsg2-4.1_all.deb

【イベントログ】産業交流展2018

産業交流展2018というイベントに行ってきました。


www.sangyo-koryuten.tokyo

去年は出展側でしたが、今回はとあるお役所から誘われて参加です。
shuzo-kino.hateblo.jp

実際のところ

最終日の午後遅い時間だったこともあってか、
この手のイベントとしては少し人が少なかった様な印象です。

産業センターの金属3Dプリンター!!
操作は自分ではやらせてもらえないようですが、50g程度のものなら2万円しないで生成可能です。
これらのブツは実際動きます。

全天球カメラのInsta360
実物はじめて見ました

プラ素材半分、紙系素材半分という面白素材。
ペンで模様書いたりもできるそう。

NDF製の動くもの
ここまで高精度に切って、しかもそれを組み付けるって結構ホネですよねぇ……