SVX日記

2004|04|05|06|07|08|09|10|11|12|
2005|01|02|03|04|05|06|07|08|09|10|11|12|
2006|01|02|03|04|05|06|07|08|09|10|11|12|
2007|01|02|03|04|05|06|07|08|09|10|11|12|
2008|01|02|03|04|05|06|07|08|09|10|11|12|
2009|01|02|03|04|05|06|07|08|09|10|11|12|
2010|01|02|03|04|05|06|07|08|09|10|11|12|
2011|01|02|03|04|05|06|07|08|09|10|11|12|
2012|01|02|03|04|05|06|07|08|09|10|11|12|
2013|01|02|03|04|05|06|07|08|09|10|11|12|
2014|01|02|03|04|05|06|07|08|09|10|11|12|
2015|01|02|03|04|05|06|07|08|09|10|11|12|
2016|01|02|03|04|05|06|07|08|09|10|11|12|
2017|01|02|03|04|05|06|07|08|09|10|11|12|
2018|01|02|03|04|05|06|07|08|09|10|11|12|
2019|01|02|03|04|05|06|07|08|09|10|11|12|
2020|01|02|03|04|05|06|07|08|09|10|11|12|
2021|01|02|03|04|05|06|07|08|09|10|11|12|
2022|01|02|03|04|05|06|07|08|09|10|11|12|
2023|01|02|03|04|05|06|07|08|09|10|11|12|
2024|01|02|03|04|05|06|07|08|09|10|11|12|
2025|01|02|03|04|05|06|

2004-09-08(Wed) メビウス復活!! 問題解決!!

  さて、今日は朝から仕事をサボって松戸のシャープに届いているメビウスのヒンジの部品を取りにいく。今日もSVXはバリバリMaxHeat!! ホントに熱い車……いや、暑い車だぜ。エアコンが勝手にONになる症状が出ないだけマシだが、早く治さなきゃなぁ。途中、暑さに耐えられなくなりエアコンをONにしCool側のボタンを押し続けつつ運転して松戸のシャープに到着。

  松戸のシャープは想像と違って事務所だけでなく、流通拠点である倉庫のようなデカい建物であった。入ってスグ横のサービスセンタに入って、おばちゃんに部品を取りに来た旨を告げる。古田を吉田に間違えられており(よくあるんだ)ちょっと手間取ったが、部品は無事到着していた。壊れた部品を持参しているので形状が同じかどうか確認させてもらうと……ちがうじゃんかよッ!! ……じゃなくて、パーツが左右逆なのだ。するとそこへ、先日電話で対応してもらった、さとう玉緒似の声のお姉さんが現れた。

  「左だけというお話でしたけど左右両方とも手配しておきました」

  おぉ、声はさとう玉緒似だけど、ルックスは柴咲コウ似ではないか!! などと一瞬違う世界に旅立っているうちに、おばちゃんが伝票を左だけのパーツに修正し始める。……いや、決して柴咲玉緒ちゃん(仮名)にクラッときたわけではないが、両方購入させてもらうことにした。右側のパーツも勤続(7年)疲労が溜まっていそうだし、いざ目の前にあるならやっぱり買いたくなってしまうのである。手持ちがギリギリだったが、片側2,415円、両側で4,830円(税込み)。た、高い……が、このパーツは軸の部分も込みなので、ある程度しかたないか。しかし、玉緒っちのちょっと気の利いた対応はうれしかったなぁ。やるな、シャープ!!

  画像の説明

  余談だがサービスセンタにいる間、奥のほうで断片的に「HDDの中身が消えたから、新製品に交換するようにいわれてて……訴訟するならそれはお客様の自由ですので……内容証明で送れと……ですから、同型の製品との交換しかできないと……」とか、いう打ち合わせする声が……まさしくクレーマーの話題である。そーだよねー。サービスセンタといえばクレーマーとの戦場でもある。クレーマーまでいかなくても、ヒドいこと言われることが多いんだろうなぁ(そういや、おいらも以前にちょっとキレたことがあったなぁ、チト反省)。

  さて、シャープに行ったら他の壊れそうな部品が壊れた時にすぐ電話で注文できるよう、部品番号をカタログでチェックさせてもらうつもりだったので、その旨を聞いてみた。結局MN-7860そのもののカタログはなかったので、似たようなPCの部品図を見ながら指定し、天板とCPUファンの部品番号と価格を調べ、折り返し連絡をもらうことにした。しばらくして電話があり、該当品が判明しましたということで話を聞いてみると……天板は8,100円(税別)……こ、これは以前に9,000円と聞いていたのでダメージは小さかったのだが、ジャカジャンッ!! CPUファンはヒートシンク込みで17,000円(税別)!! ぐわゎ〜ん……私の購入価格15,000円を軽く飛び越すお値段、出てまいましたッ!! 今回のヒンジのパーツでさえ5,000円弱と私にとってはギリギリの線だったので、いざファンが壊れた日には適当なファンを買ってきて(当然治す!!)ムリヤリひっつけることになりそうである。

  さて、午後から行った仕事から帰宅して、すぐにメビウスの修理に取り掛かった。まずは、パネルの枠のパーツを外し、ヒンジのカバーを外す。どちらもかなり固くツメで固定されていて、かなりのコツと勇気が必要だ。ヒンジが露出したら、ネジを外して左側のプレートの破損パーツを取り除く。

  画像の説明 画像の説明

  柴咲玉緒ちゃん(仮名)にくらっときて、右側のプレートも購入してしまった(ん?)ので、右側も交換する。LCDパネルを止めている4本のネジを外し、手前にひっくり返す……と、ゲッ!! 右の雌ネジも左と同じようにポッキリ逝ってる……なんなんだよー、設計強度不足じゃねーのかよコレ。プレートは3箇所で止まるようになっているため、根元の部分に力が集中しやすい反面、残りの2箇所で十分に支持できるというのも確か。適当に接着剤でひっつけておこう、ムダだとは思うけど。

  画像の説明 画像の説明

  右のプレートは上をバックライトを点灯するインバータの高圧線が通過するため、保護のプラ板が貼ってあった。剥がして同じように新しいプレートに貼り付けて、取り付ける。後は各カバーをパチパチとハメて、ネジを締めたら、修理完了ッ!! メビウス完全復活である……うれしい……。性能的にはもはやどーしよーもないPCであるが、いろいろ手をかけているのでカワイイヤツである。これからも元気で働いておくれよ。うるうる。

  画像の説明 画像の説明

  さて、今日はネタが盛りだくさんである。メビウスが治ったところで、メビウスのシリアルポート内の負荷抵抗を調べてみるのである。RS-232Cの規格では3〜7kΩとなっているが、ホントにそうなのか? 調べるためには、以下のような回路をブレッドボード上に構築し、メビウスのシリアルポートに接続、各場所の電圧と流れた電流を測定した。

  画像の説明 画像の説明

  結果、内部の負荷抵抗5kΩ弱であると推測される。確かに規格の3〜7kΩ内のちょうど中間値である。こう考えると、RS-232Cという通信回路は極めてシンプルな回路であることがわかる。今となってはレガシーなポートではあるが、このシンプルさこそが、今日もシブとく生き残っている理由なのだろう。

  で、最後にアナログメータの製作の続きである。テスト基板からPCへの通信はできたのだが、PCからテスト基板への通信がさっぱりできない。そこで原因として閃いたのは「消費電流が多すぎではないか」ということだ。現在、テスト基板はPC側のRTS-CTSからの電圧のみで稼動しているが、もしかすると電流を引き出しすぎていて、PC側の送信電圧を食ってしまっているのではと考えたのだ。とすれば、テスト基板を外部電源で動かせばよいことになる。

  結果……だめ……動かん、動かんッ、動かんッ!! むー、となると原因はソフト側か。何度も確認したソースコードを再び確認……おろ? なんじゃこりゃ!! テスト基板の受信ルーチンの認識が逆じゃん!! というか、コレは以前に試しに逆にしてたんだ……忘れてた。これじゃ、LowとHighを逆に認識しているから動くわけがない。なんだよー、以前の300bpsの時と同じだ。動かなくてイジッているうちに、余計に動かなくしてしまうという……。直したら、動いたよ、トホホ。

  というわけで、232C切り替え器を含め、今回の製作中に噴出した問題は、すべて解決した!! やー、すがすがしい。あとはパッケージングだけである。おやすみ。


2016-09-08(Thu) RubyGems環境をなんとかする

  個人的にCUI好きなのだが、GUIが必要な時もある。そんな時はcursesだ。リモートコンソール上でセミGUIが使える。作るのもラクだし、動作も軽快。てなわけで、これまで、これやら、これやら、これやらを作って、実用に供している。

  んが、いつしかRubyの標準添付ライブラリにcursesが含まれなくなってしまった。Fedoraのrubygem-xxxシリーズでの提供もない。別途、RubyGemsで入れろ、ということらしい。むぅ。

  ところが、たまにしかやらないし、ちょくちょくディストリの仕様側が変わるので、いつも試行錯誤になってしまう。そこで、現時点において、うまいことRubyGemsの環境を構築できた方法を「考え方つきで」メモしておくことにした。目的は「gem install curses」を成功させること。今回はFedora24で実行している。

  うおりゃ。

[root@xxx ~]# gem install curses
-bash: gem: command not found

  gemが入ってない。

[root@xxx ~]# dnf install rubygems

  うおりゃ。

[root@xxx ~]# gem install curses
……沈黙

  proxyの設定がない。

[root@xxx ~]# export http_proxy=http://proxy.example.com:8080/
[root@xxx ~]# export https_proxy=http://proxy.example.com:8080/

  うおりゃ。

[root@xxx ~]# gem install curses
Fetching: curses-1.0.2.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing curses:
	ERROR: Failed to build gem native extension.
 
    current directory: /usr/local/share/gems/gems/curses-1.0.2/ext/curses
/usr/bin/ruby -r ./siteconf20160909-3344-15aufht.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/share/include/ruby.h ★
 
extconf failed, exit code 1
 
Gem files will remain installed in /usr/local/share/gems/gems/curses-1.0.2 for inspection.
Results logged to /usr/local/lib64/gems/ruby/curses-1.0.2/gem_make.out

  ruby.hがない。

[root@xxx ~]# dnf install ruby-devel

  うおりゃ。

[root@xxx ~]# gem install curses
Building native extensions.  This could take a while...
ERROR:  Error installing curses:
	ERROR: Failed to build gem native extension.
 
    current directory: /usr/local/share/gems/gems/curses-1.0.2/ext/curses
/usr/bin/ruby -r ./siteconf20160909-3373-17xujbr.rb extconf.rb
checking for tgetent() in -ltinfo... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.
 
Provided configuration options:
<略>
/usr/share/ruby/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first. ★
	from /usr/share/ruby/mkmf.rb:541:in `try_link0'
<略>
	from extconf.rb:29:in `<main>'
 
To see why this extension failed to compile, please check the mkmf.log which can be found here:
 
  /usr/local/lib64/gems/ruby/curses-1.0.2/mkmf.log
 
extconf failed, exit code 1
 
Gem files will remain installed in /usr/local/share/gems/gems/curses-1.0.2 for inspection.
Results logged to /usr/local/lib64/gems/ruby/curses-1.0.2/gem_make.out

  development tools、要するにgccが入ってない。

[root@xxx ~]# dnf install gcc

  うおりゃ。

[root@xxx ~]# gem install curses
Building native extensions.  This could take a while...
ERROR:  Error installing curses:
	ERROR: Failed to build gem native extension.
 
    current directory: /usr/local/share/gems/gems/curses-1.0.2/ext/curses
/usr/bin/ruby -r ./siteconf20160909-3509-162u4n0.rb extconf.rb
checking for tgetent() in -ltinfo... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.
 
Provided configuration options:
<略>
/usr/share/ruby/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
	from /usr/share/ruby/mkmf.rb:541:in `try_link0'
<略>
	from extconf.rb:29:in `<main>'
 
To see why this extension failed to compile, please check the mkmf.log which can be found here:
 
  /usr/local/lib64/gems/ruby/curses-1.0.2/mkmf.log ★
 
extconf failed, exit code 1
 
Gem files will remain installed in /usr/local/share/gems/gems/curses-1.0.2 for inspection.
Results logged to /usr/local/lib64/gems/ruby/curses-1.0.2/gem_make.out

  ログを見てみる。

[root@xxx ~]# cat /usr/local/lib64/gems/ruby/curses-1.0.2/mkmf.log
"gcc -o conftest -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I.    -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -mtune=generic -fPIC conftest.c  -L. -L/usr/lib64 -L. -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fstack-protector -rdynamic -Wl,-export-dynamic  -m64   -lruby  -lpthread -ldl -lcrypt -lm   -lc"
gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory ★
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

  /usr/lib/rpm/redhat/redhat-hardened-cc1がない。どのパッケージに入っているかわからないので調べる。

[root@xxx ~]# dnf provides /usr/lib/rpm/redhat/redhat-hardened-cc1
redhat-rpm-config-40-2.fc24.noarch : Red Hat specific rpm configuration files ★
Repo        : fedora
 
redhat-rpm-config-41-2.fc24.noarch : Red Hat specific rpm configuration files ★
Repo        : updates

  redhat-rpm-configパッケージということなので入れる。

[root@xxx ~]# dnf install redhat-rpm-config

  うおりゃ。

[root@xxx ~]# gem install curses
Building native extensions.  This could take a while...
ERROR:  Error installing curses:
	ERROR: Failed to build gem native extension.
 
    current directory: /usr/local/share/gems/gems/curses-1.0.2/ext/curses
/usr/bin/ruby -r ./siteconf20160909-3658-cnj5ie.rb extconf.rb
checking for tgetent() in -ltinfo... no
checking for tgetent() in -ltermcap... no
checking for ncurses.h... no
checking for ncurses/curses.h... no
checking for ncursesw/curses.h... no
checking for curses_colr/curses.h... no
checking for curses.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.
 
Provided configuration options:
<略>
 
To see why this extension failed to compile, please check the mkmf.log which can be found here:
 
  /usr/local/lib64/gems/ruby/curses-1.0.2/mkmf.log ★
 
extconf failed, exit code 1
 
Gem files will remain installed in /usr/local/share/gems/gems/curses-1.0.2 for inspection.
Results logged to /usr/local/lib64/gems/ruby/curses-1.0.2/gem_make.out

  ログを見てみる。

[root@xxx ~]# cat /usr/local/lib64/gems/ruby/curses-1.0.2/mkmf.log
 :
 :
have_header: checking for curses.h... -------------------- no
 
"gcc -E -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I.    -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -mtune=generic -fPIC  conftest.c -o conftest.i"
conftest.c:3:20: fatal error: curses.h: No such file or directory
 #include <curses.h>
                    ^
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <curses.h>
/* end */
 
--------------------

  curses.hがない。これはcursesの開発パッケージに入っている。

[root@xxx ~]# dnf install ncurses-devel

  うおりゃ。

[root@xxx ~]# gem install curses
Building native extensions.  This could take a while...
ERROR:  Error installing curses:
	ERROR: Failed to build gem native extension.
 
    current directory: /usr/local/share/gems/gems/curses-1.0.2/ext/curses
/usr/bin/ruby -r ./siteconf20160909-4359-1h9o77p.rb extconf.rb
checking for tgetent() in -ltinfo... yes
checking for ncurses.h... yes
checking for initscr() in -lncursesw... yes
header: ncurses.h
library: ncursesw
<略>
checking for function curses_version in ncurses.h... yes
checking for variable curses_version in ncurses.h... no
creating Makefile
 
To see why this extension failed to compile, please check the mkmf.log which can be found here:
 
  /usr/local/lib64/gems/ruby/curses-1.0.2/mkmf.log
 
current directory: /usr/local/share/gems/gems/curses-1.0.2/ext/curses
make "DESTDIR=" clean
sh: make: command not found ★
 
current directory: /usr/local/share/gems/gems/curses-1.0.2/ext/curses
make "DESTDIR="
sh: make: command not found ★
 
make failed, exit code 127
 
Gem files will remain installed in /usr/local/share/gems/gems/curses-1.0.2 for inspection.
Results logged to /usr/local/lib64/gems/ruby/curses-1.0.2/gem_make.out

  makeが入っていない。

[root@xxx ~]# dnf install make

  うおりゃ。

[root@xxx ~]# gem install curses
Building native extensions.  This could take a while...
Successfully installed curses-1.0.2
Parsing documentation for curses-1.0.2
Installing ri documentation for curses-1.0.2
Done installing documentation for curses after 1 seconds
1 gem installed

  というわけで「gem install curses」に成功ッ!

  画像の説明

  cccdct復活!