OPIでLチカ GPIOをC で

前回、RasPi2 でWiringPiを使ってGPIO の制御をしました。

RasPi2 でCの王道? WiringPi

OrangePi でも同様に無いか探したところ、Forkしたものがありました。

WiringOP
https://github.com/zhaolei/WiringOP

サンプルソース

#include <wiringPi.h>

#define LED 16
#define MSEC 50

int main (void)
{
  wiringPiSetup () ;
  pinMode (LED, OUTPUT) ;
  for (;;)
  {
    digitalWrite (LED, HIGH) ; delay (MSEC) ;
    digitalWrite (LED,  LOW) ; delay (MSEC) ;
  }
  return 0 ;
}

GPIO

ビルド方法は以下のようにしました。

# gcc -o blink blink.c -lwiringPi -lpthread

ピンの指定が、以下で出てくる wPi の番号のようでした。

root@opi:~# gpio readall
 +-----+-----+----------+------+---+--OrangePiPC--+---+------+---------+-----+--+
 | BCM | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | BCM |
 +-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
 |     |     |     3.3v |      |   |  1 || 2  |   |      | 5v       |     |     |
 |   2 |  -1 |    SDA.0 |      |   |  3 || 4  |   |      | 5V       |     |     |
 |   3 |  -1 |    SCL.0 |      |   |  5 || 6  |   |      | 0v       |     |     |
 |   4 |   6 | IO6 PA06 |  OUT | 0 |  7 || 8  |   |      | TxD3     |     |     |
 |     |     |       0v |      |   |  9 || 10 |   |      | RxD3     |     |     |
 |  17 |  -1 |     RxD2 |      |   | 11 || 12 | 0 | OUT  | IO1 PD14 | 1   | 18  |
 |  27 |  -1 |     TxD2 |      |   | 13 || 14 |   |      | 0v       |     |     |
 |  22 |  -1 |     CTS2 |      |   | 15 || 16 | 0 | OUT  | IO4 PC04 | 4   | 23  |
 |     |     |     3.3v |      |   | 17 || 18 | 0 | OUT  | IO5 PC07 | 5   | 24  |
 |  10 |  -1 |     MOSI |      |   | 19 || 20 |   |      | 0v       |     |     |
 |   9 |  -1 |     MISO |      |   | 21 || 22 |   |      | RTS2     |     |     |
 |  11 |  -1 |     SCLK |      |   | 23 || 24 |   |      | SPI-CE0  |     |     |
 |     |     |       0v |      |   | 25 || 26 |   |      | CE1      |     |     |
 |   0 |  -1 |    SDA.1 |      |   | 27 || 28 |   |      | SCL.1    |     |     |
 |   5 |   7 |  IO7 PA7 |  OUT | 0 | 29 || 30 |   |      | 0v       |     |     |
 |   6 |   8 |  IO8 PA8 |  OUT | 0 | 31 || 32 | 0 | OUT  | IO9 PG08 | 9   | 12  |
 |  13 |  10 | IO10 PA9 |  OUT | 0 | 33 || 34 |   |      | 0v       |     |     |
 |  19 |  12 | IO12PA10 |  OUT | 0 | 35 || 36 | 0 | OUT  | IO13PG09 | 13  | 16  |
 |  26 |  14 | IO14PA20 | ALT3 | 0 | 37 || 38 | 0 | OUT  | IO15PG06 | 15  | 20  |
 |     |     |       0v |      |   | 39 || 40 | 1 | OUT  | IO16PG07 | 16  | 21  |
 +-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
 | BCM | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | BCM |
 +-----+-----+----------+------+---+--OrangePIPC--+------+----------+-----+-----+

とりあえず動きました。関数の扱いがちょっと?な部分もあり、完全に互換ソースで動くというわけじゃなさそうです。

root@opi:~# ls /sys/class/gpio_sw/
normal_led  PA10  PA13  PA14  PA15  PA21  PA3  PA6  PA7  PA8  PA9  PC3  PC4  PC7  PD14  PG6  PG7  PG8  PG9  PL10  standby_led
root@opi:~# lsmod
Module                  Size  Used by
gpio_sunxi              8233  0 
8189es                901572  0 
root@opi:~# modprobe gpio_sunxi
root@opi:~# modprobe gpio-sunxi
root@opi:~# modprobe gpio
modprobe: FATAL: Module gpio not found.
root@opi:~# echo 1 > /sys/class/gpio_sw/standby_led/data
root@opi:~# echo 0 > /sys/class/gpio_sw/standby_led/data
root@opi:~# gpio -g write 16 1
pin number error
root@opi:~# gpio -g write 21 1
pin number error
root@opi:~# gpio -g write IO16PG07 1
pin number error
root@opi:~# gpio -g write PG7 1
pin number error
root@opi:~# gpio -g write 0 1
pin number error
root@opi:~# 

もう少し、手入れが必要ですね。sysfs に直接書くと以下のように光ります。gpio のマッピングがうまく機能していないようですね。

gpio_stanby_led

OrangePi PC にヒートシンク

オレンジパイにヒートシンクをつけると、温度が下がるのか実験してみました。

1

ジャンク品のヒートシンクです。これは、15年くらい前の日立のフローラについていたもの。大きいので、3cmくらいにカットして置いてみただけです。

3

2 UnixBench を計測していたら、80度くらいまで上がったのですが、置いてみただけでも10度ちょい下がっている感じです。

Every 0.5s: cat /sys/class/thermal/thermal_zone0/temp /sys/class/thermal/thermal_zone1/temp                                  Sun Dec 13 18:20:31 2015

67
67

こんな感じで、0.5秒置きに温度をモニタリングしていると最高でも70度までは行かないようです。これにファンをつければさらに下がると思い、小さなファンをゲット。

さがったと思っていたら、UnixBench を –c 4 オプションをつけると、やっぱり80度近くになっています。うーん、やっぱりファンをつけたほうがいいですかね。まぁ、でもつけないときと比べると、下がり方が速いですね。

Every 0.5s: cat /sys/class/thermal/thermal_zone0/temp /sys/class/thermal/thermal_zone1/temp                                  Sun Dec 13 18:39:42 2015

81
81

allwinner の H3 は、CPU の周波数も最大で、1600MHz まであがる様でかなり大丈夫かなと思わせます。6ドル程度の CPU なのに結構やりますね。これは。

Every 0.5s: cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq /sys/devices/system/cpu/cpu1/cpufreq/scaling_cur_f…  Sun Dec 13 18:53:18 2015

1536000
1536000
1536000
1536000

loboris さんが書いているフォーラムのガイドにもフルスピードでは、ヒートシンクとファンをつけろとあります。

to always run at full speed install heatsink and fan !

http://www.orangepi.org/orangepibbsen/forum.php?mod=viewthread&tid=342

4

薄いので安いのだと、7mm 厚のがありました。もっと薄いものだと、4mm のものがあるのですが、ちょっとお高く、本体が買えそうな値段なんでやめました。4mm厚のは、中国産と日本産のがあり1600円ほどします。考えちゃいますよね。

 

で、結局7mm厚の2個入りをゲット。RasPi2 と OrangePiPC につけようかと。RasPI2 はケースの都合で銅製のヒートシンクをゲット。

 

どちらも、24時間運転のサーバ化に転用する予定ですので、熱対策はしておいて損はないはず。ヒートシンクとCPU との接着は、サーマルパッドという3M の製品が良さそうでこれもゲットしておきました。

 

ついでに、耐熱性のあるポリイミド(Polyimide)テープもゲット。こんなのがあるのですね。知りませんでした。2cm 幅くらいが使いやすそうかなと。

UnixBench は 1CPU だと、以下のようでした。

root@OrangePI:/usr/local/src/UnixBench# ./Run 
make all
make[1]: Entering directory '/usr/local/src/UnixBench'
Checking distribution of files
./pgms  exists
./src  exists
./testdir  exists
./tmp  exists
./results  exists
make[1]: Leaving directory '/usr/local/src/UnixBench'
sh: 1: 3dinfo: not found

   #    #  #    #  #  #    #          #####   ######  #    #   ####   #    #
   #    #  ##   #  #   #  #           #    #  #       ##   #  #    #  #    #
   #    #  # #  #  #    ##            #####   #####   # #  #  #       ######
   #    #  #  # #  #    ##            #    #  #       #  # #  #       #    #
   #    #  #   ##  #   #  #           #    #  #       #   ##  #    #  #    #
    ####   #    #  #  #    #          #####   ######  #    #   ####   #    #

   Version 5.1.3                      Based on the Byte Magazine Unix Benchmark

   Multi-CPU version                  Version 5 revisions by Ian Smith,
                                      Sunnyvale, CA, USA
   January 13, 2011                   johantheghost at yahoo period com


1 x Dhrystone 2 using register variables  1 2 3 4 5 6 7 8 9 10

1 x Double-Precision Whetstone  1 2 3 4 5 6 7 8 9 10

1 x Execl Throughput  1 2 3

1 x File Copy 1024 bufsize 2000 maxblocks  1 2 3

1 x File Copy 256 bufsize 500 maxblocks  1 2 3

1 x File Copy 4096 bufsize 8000 maxblocks  1 2 3

1 x Pipe Throughput  1 2 3 4 5 6 7 8 9 10

1 x Pipe-based Context Switching  1 2 3 4 5 6 7 8 9 10

1 x Process Creation  1 2 3

1 x System Call Overhead  1 2 3 4 5 6 7 8 9 10

1 x Shell Scripts (1 concurrent)  1 2 3

1 x Shell Scripts (8 concurrent)  1 2 3

========================================================================
   BYTE UNIX Benchmarks (Version 5.1.3)

   System: OrangePI: GNU/Linux
   OS: GNU/Linux -- 3.4.39 -- #1 SMP PREEMPT Sun Aug 30 14:14:50 CEST 2015
   Machine: armv7l (armv7l)
   Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
   18:04:49 up  1:13,  5 users,  load average: 3.24, 3.27, 3.25; runlevel 5

------------------------------------------------------------------------
Benchmark Run: Sun Dec 13 2015 18:04:49 - 18:32:58
0 CPUs in system; running 1 parallel copy of tests

Dhrystone 2 using register variables        5498429.9 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                      902.6 MWIPS (10.0 s, 7 samples)
Execl Throughput                                512.7 lps   (29.9 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks        127185.4 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks           40063.0 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks        300968.0 KBps  (30.0 s, 2 samples)
Pipe Throughput                              341609.8 lps   (10.0 s, 7 samples)
Pipe-based Context Switching                  22945.9 lps   (10.0 s, 7 samples)
Process Creation                               1794.6 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)                   1461.6 lpm   (60.0 s, 2 samples)
Shell Scripts (8 concurrent)                    458.4 lpm   (60.1 s, 2 samples)
System Call Overhead                         856556.8 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0    5498429.9    471.2
Double-Precision Whetstone                       55.0        902.6    164.1
Execl Throughput                                 43.0        512.7    119.2
File Copy 1024 bufsize 2000 maxblocks          3960.0     127185.4    321.2
File Copy 256 bufsize 500 maxblocks            1655.0      40063.0    242.1
File Copy 4096 bufsize 8000 maxblocks          5800.0     300968.0    518.9
Pipe Throughput                               12440.0     341609.8    274.6
Pipe-based Context Switching                   4000.0      22945.9     57.4
Process Creation                                126.0       1794.6    142.4
Shell Scripts (1 concurrent)                     42.4       1461.6    344.7
Shell Scripts (8 concurrent)                      6.0        458.4    763.9
System Call Overhead                          15000.0     856556.8    571.0
                                                                   ========
System Benchmarks Index Score                                         266.0

で、肝心のBackBoost はなかなか時間が取れず、今日も半田付けはできませんでした。12月はいろいろ忙しいですね。

 

まとめ

・アイドル時の温度は、ヒートシンクを置かないと60度。置くと、55度ほどになる。

・アルミヒートシンクを3cm 角に切って、置いただけでもそれなりに冷却効果はある。

・最高で80度ちょいまであがるので、ファンをつけたてみたいところ

・ヒートシンクの接着は、3M とかから出ているサーマルパッドのシリーズがよさそう

・厚み4mm のファンは高いので、7mm のにした。

250mahのかわいいLipo到着

Lipo電池が到着。Giftか、あるいは X線検査でも通るようにかは不明ですがUSB充電モジュールと同梱されて届きました。

普通に使えば、2,3時間でなくなる容量の小さな実験用電池です。DeepSleep にするとどのくらい持つのでしょうかね?

052030心配していたケースに収まるかどうかのぎりぎりのサイズでしたが、問題なく入りとりあえず安心。 BackBoost のESP8266 と組み合わせてお手軽サイズな気温観測&電流、電圧計測装置として使う予定です。

5 全部の部品が到着したので、あとはソフトウェアといきたいところですが、まだ完全に半田付けされている筐体がないので、早いところ作らないと。冬休みの課題ですね。2015年の内になんとか動作させたいです。

 

だんたんと、想定したものが形になっていくステップは楽しいですね。回路も部品も全部オリジナルの世界に1つの完全オリジナル品。中国のパワーにだいぶ助けられています。感謝。

OrangePi PC のベンチマーク計測

15ドルPCの Orange Pi PC が来たので、動作確認をかねて、とりあえずベンチマークを計測。温度が80度近くになって心配でとりあえず、手元にあった放熱板を仮置き。

$ cat /sys/class/thermal/thermal_zone*/temp

結構、熱くなるようです。まぁ、それだけ速いということですかね。電源はPSP のがなぜかジャンク箱にあったのでそれで。

orangePiPC

なかなか、速いんじゃないですかね。622.9 出ていますが。RasPI2が400くらいなので、それより速いことはわかりました。とりあえず、ログだけ乗せておきます。

mate1.8.2 重そうなmate desktop も実用に耐えうる速度。

VNC でつなげてみました。CPUパワーがあって、これが15ドルとは思えませんね。

Raspberry Piの設定【VNCサーバ(tightVNC)の設定】

OS は、とりあえずloborisさんの、OrangePI_Ubuntu_Vivid_Mate.img を使いました。デスクトップGUIで、ブラウザー起動しましたが、なかなか速いです。レンダリングはドライバーの問題か、少しもたつく感じ。環境を整えれば、何かの用途には使えそうですね。送料込み、2300円くらいの価値はあるかと。

 

oot@OrangePI:/usr/local/src/UnixBench# ./Run -c 4
make all
make[1]: Entering directory '/usr/local/src/UnixBench'
Checking distribution of files
./pgms  exists
./src  exists
./testdir  exists
./tmp  exists
./results  exists
make[1]: Leaving directory '/usr/local/src/UnixBench'
sh: 1: 3dinfo: not found

   #    #  #    #  #  #    #          #####   ######  #    #   ####   #    #
   #    #  ##   #  #   #  #           #    #  #       ##   #  #    #  #    #
   #    #  # #  #  #    ##            #####   #####   # #  #  #       ######
   #    #  #  # #  #    ##            #    #  #       #  # #  #       #    #
   #    #  #   ##  #   #  #           #    #  #       #   ##  #    #  #    #
    ####   #    #  #  #    #          #####   ######  #    #   ####   #    #

   Version 5.1.3                      Based on the Byte Magazine Unix Benchmark

   Multi-CPU version                  Version 5 revisions by Ian Smith,
                                      Sunnyvale, CA, USA
   January 13, 2011                   johantheghost at yahoo period com


4 x Dhrystone 2 using register variables  1 2 3 4 5 6 7 8 9 10

4 x Double-Precision Whetstone  1 2 3 4 5 6 7 8 9 10

4 x Execl Throughput  1 2 3

4 x File Copy 1024 bufsize 2000 maxblocks  1 2 3

4 x File Copy 256 bufsize 500 maxblocks  1 2 3

4 x File Copy 4096 bufsize 8000 maxblocks  1 2 3

4 x Pipe Throughput  1 2 3 4 5 6 7 8 9 10

4 x Pipe-based Context Switching  1 2 3 4 5 6 7 8 9 10

4 x Process Creation  1 2 3

4 x System Call Overhead  1 2 3 4 5 6 7 8 9 10

4 x Shell Scripts (1 concurrent)  1 2 3

4 x Shell Scripts (8 concurrent)  1 2 3

========================================================================
   BYTE UNIX Benchmarks (Version 5.1.3)

   System: OrangePI: GNU/Linux
   OS: GNU/Linux -- 3.4.39 -- #1 SMP PREEMPT Sun Aug 30 14:14:50 CEST 2015
   Machine: armv7l (armv7l)
   Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
   04:53:35 up 37 min,  3 users,  load average: 3.34, 3.29, 2.93; runlevel 5

------------------------------------------------------------------------
Benchmark Run: Sat Dec 12 2015 04:53:35 - 05:22:08
0 CPUs in system; running 4 parallel copies of tests

Dhrystone 2 using register variables       17790507.8 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                     2952.0 MWIPS (11.1 s, 7 samples)
Execl Throughput                               1727.4 lps   (29.9 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks        158602.9 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks           43633.7 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks        435339.7 KBps  (30.0 s, 2 samples)
Pipe Throughput                             1071712.4 lps   (10.0 s, 7 samples)
Pipe-based Context Switching                 109380.1 lps   (10.0 s, 7 samples)
Process Creation                               5064.7 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)                   3836.6 lpm   (60.1 s, 2 samples)
Shell Scripts (8 concurrent)                    515.5 lpm   (60.2 s, 2 samples)
System Call Overhead                        2668331.1 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0   17790507.8   1524.5
Double-Precision Whetstone                       55.0       2952.0    536.7
Execl Throughput                                 43.0       1727.4    401.7
File Copy 1024 bufsize 2000 maxblocks          3960.0     158602.9    400.5
File Copy 256 bufsize 500 maxblocks            1655.0      43633.7    263.6
File Copy 4096 bufsize 8000 maxblocks          5800.0     435339.7    750.6
Pipe Throughput                               12440.0    1071712.4    861.5
Pipe-based Context Switching                   4000.0     109380.1    273.5
Process Creation                                126.0       5064.7    402.0
Shell Scripts (1 concurrent)                     42.4       3836.6    904.9
Shell Scripts (8 concurrent)                      6.0        515.5    859.2
System Call Overhead                          15000.0    2668331.1   1778.9
                                                                   ========
System Benchmarks Index Score                                         622.9

root@OrangePI:/usr/local/src/UnixBench# 
 
root@OrangePI:/usr/local/src/UnixBench# cat /etc/issue
Ubuntu 15.04 \n \l

root@OrangePI:/usr/local/src/UnixBench# cat /etc/debian_version
jessie/sid
root@OrangePI:/usr/local/src/UnixBench# cat /proc/cpuinfo
Processor    : ARMv7 Processor rev 5 (v7l)
processor    : 0
BogoMIPS    : 1920.00

processor    : 1
BogoMIPS    : 1920.00

processor    : 2
BogoMIPS    : 1920.00

processor    : 3
BogoMIPS    : 1920.00

Features    : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpv4 idiva idivt 
CPU implementer    : 0x41
CPU architecture: 7
CPU variant    : 0x0
CPU part    : 0xc07
CPU revision    : 5

Hardware    : sun8i
Revision    : 0000
Serial        : 940050340508303104ce
root@OrangePI:/usr/local/src/UnixBench# 
root@OrangePI:/usr/local/src/UnixBench# cat /proc/meminfo
MemTotal:        1027152 kB
MemFree:          469976 kB
Buffers:           24388 kB
Cached:           413636 kB
SwapCached:            0 kB
Active:           227240 kB
Inactive:         260016 kB
Active(anon):      50164 kB
Inactive(anon):    20632 kB
Active(file):     177076 kB
Inactive(file):   239384 kB
Unevictable:           0 kB
Mlocked:               0 kB
HighTotal:        270336 kB
HighFree:          18500 kB
LowTotal:         756816 kB
LowFree:          451476 kB
SwapTotal:             0 kB
SwapFree:              0 kB
Dirty:                 0 kB
Writeback:             0 kB
AnonPages:         49176 kB
Mapped:            30624 kB
Shmem:             21568 kB
Slab:              38708 kB
SReclaimable:      29820 kB
SUnreclaim:         8888 kB
KernelStack:        1016 kB
PageTables:         1384 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:      513576 kB
Committed_AS:     358160 kB
VmallocTotal:     245760 kB
VmallocUsed:       38296 kB
VmallocChunk:     196788 kB
root@OrangePI:/usr/local/src/UnixBench# 
root@OrangePI:/usr/local/src/UnixBench# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
1008000
root@OrangePI:/usr/local/src/UnixBench# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq
1536000
root@OrangePI:/usr/local/src/UnixBench# cat /sys/class/thermal/thermal_zone0/temp
52
root@OrangePI:/usr/local/src/UnixBench# 

ロジックアナライザーをゲット

ESP8266で E-ink を表示させるために、信号解析用のロジックアナライザーが必要になりそうなので、安いものを探しました。

以前、Logic Pirate (とLogic Snifferで動作)というのを知りましたが、

Logic Pirate というオープンソースのロジックアナライザ

ハードが4500円(30ドル+送料)ほどで、もう少し安いのはないかと調査すると、ありました。世の中は本当に広いものです。

EZ-USB FX2LP CY7C68013A USB Development Board Core Board Logic Analyzer

CY7C68013A

これはaliexpress で1000円以下で売っています。ソフトウェアは、sigrok というオープンソースがあります。ということで、ポチっておきました。年末に来るといいな。

追記:EZ-USB FX2LPでアリエクを検索すると、たくさんでてきます。2021年2月時点で、537円になっていました。

追記:とても良い映像コンテンツがあったので貼っておきます。@OpenTechLabChan さんのチャンネルです。

http://sigrok.org/wiki/Main_Page

sigrok_logo

Windows はバイナリがあり、osx は brew で入れるようで、試してみましたが、インストールに失敗するようで、そのメモです。windows バイナリ版は起動し、以下のようにデモ信号を見れます。最初の一台としては十分な機能のような気がします。

Windows7__Running_

sigrok を osx で動作させるため、以下を参考。

http://sigrok.org/wiki/Mac_OS_X

以下の流れですが、★でこけます。

1) $ brew tap rene-dev/sigrok

2) $ brew install python3
3) $ brew install –HEAD libserialport
★4) $ brew install –HEAD –with-libserialport libsigrok
5) $ brew install –HEAD libsigrokdecode
6) $ brew install –HEAD –with-libserialport sigrok-cli
7) $ brew install –HEAD pulseview

8) $ brew install sigrok-cli

ファームウェアは、以下のようです。

・fx2lafw open-source firmware
http://sigrok.org/wiki/Fx2lafw
Lcsoft Mini Board (CY7C68013A)

以下、こける部分です。

1) ------------------------------------------------------
HOPE:~ junkhack$ brew tap rene-dev/sigrok
==> Tapping rene-dev/sigrok
Cloning into '/usr/local/Library/Taps/rene-dev/homebrew-sigrok'...
remote: Counting objects: 8, done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 8 (delta 4), reused 2 (delta 0), pack-reused 0
Unpacking objects: 100% (8/8), done.
Checking connectivity... done.
Tapped 6 formulae (35 files, 144K)
HOPE:~ junkhack$ 

・何か入れてからじゃないとだめな感じ。
8) ------------------------------------------------------
HOPE:~ junkhack$ brew install sigrok-cli
Error: Formulae found in multiple taps: 
 * homebrew/science/sigrok-cli
 * rene-dev/sigrok/sigrok-cli

Please use the fully-qualified name e.g. homebrew/science/sigrok-cli to refer the formula.
HOPE:~ junkhack$ 

・python3 はもう入ってた
2) ------------------------------------------------------
HOPE:~ junkhack$ brew install python3
Warning: python3-3.4.3_2 already installed
HOPE:~ junkhack$ 

・libserialport は入る
3) ------------------------------------------------------
HOPE:~ junkhack$ brew install --HEAD libserialport
==> Installing libserialport from rene-dev/homebrew-sigrok
==> Cloning git://sigrok.org/libserialport
Cloning into '/Library/Caches/Homebrew/libserialport--git'...
remote: Counting objects: 1036, done.
remote: Compressing objects: 100% (870/870), done.
remote: Total 1036 (delta 703), reused 249 (delta 165)
Receiving objects: 100% (1036/1036), 245.95 KiB | 81.00 KiB/s, done.
Resolving deltas: 100% (703/703), done.
Checking connectivity... done.
==> Checking out branch master
==> ./autogen.sh
==> ./configure --prefix=/usr/local/Cellar/libserialport/HEAD
==> make install
  /usr/local/Cellar/libserialport/HEAD: 9 files, 220K, built in 26 seconds
HOPE:~ junkhack$ 

・ここがこける
4) ------------------------------------------------------
HOPE:~ junkhack$ brew install --HEAD --with-libserialport libsigrok
==> Installing libsigrok from rene-dev/homebrew-sigrok
==> Installing dependencies for rene-dev/sigrok/libsigrok: libzip, libusb, libsigc++, glibmm, doxygen, autoconf-archive
==> Installing rene-dev/sigrok/libsigrok dependency: libzip
==> Downloading https://homebrew.bintray.com/bottles/libzip-0.11.2.mavericks.bottle.2.tar.gz
######################################################################## 100.0%
==> Pouring libzip-0.11.2.mavericks.bottle.2.tar.gz
  /usr/local/Cellar/libzip/0.11.2: 81 files, 536K
==> Installing rene-dev/sigrok/libsigrok dependency: libusb
==> Downloading https://homebrew.bintray.com/bottles/libusb-1.0.19.mavericks.bottle.1.tar.gz
######################################################################## 100.0%
==> Pouring libusb-1.0.19.mavericks.bottle.1.tar.gz
  /usr/local/Cellar/libusb/1.0.19: 11 files, 368K
==> Installing rene-dev/sigrok/libsigrok dependency: libsigc++
==> Downloading https://homebrew.bintray.com/bottles/libsigc++-2.4.1.mavericks.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libsigc++-2.4.1.mavericks.bottle.tar.gz
  /usr/local/Cellar/libsigc++/2.4.1: 679 files, 14M
==> Installing rene-dev/sigrok/libsigrok dependency: glibmm
==> Downloading https://homebrew.bintray.com/bottles/glibmm-2.44.0.mavericks.bottle.tar.gz
######################################################################## 100.0%
==> Pouring glibmm-2.44.0.mavericks.bottle.tar.gz
  /usr/local/Cellar/glibmm/2.44.0: 1626 files, 42M
==> Installing rene-dev/sigrok/libsigrok dependency: doxygen
==> Downloading https://homebrew.bintray.com/bottles/doxygen-1.8.10.mavericks.bottle.tar.gz
######################################################################## 100.0%
==> Pouring doxygen-1.8.10.mavericks.bottle.tar.gz
  /usr/local/Cellar/doxygen/1.8.10: 8 files, 14M
==> Installing rene-dev/sigrok/libsigrok dependency: autoconf-archive
==> Downloading https://homebrew.bintray.com/bottles/autoconf-archive-2015.02.24.mavericks.bottle.tar.gz
######################################################################## 100.0%
==> Pouring autoconf-archive-2015.02.24.mavericks.bottle.tar.gz
  /usr/local/Cellar/autoconf-archive/2015.02.24: 558 files, 4.3M
==> Installing rene-dev/sigrok/libsigrok
==> Cloning git://sigrok.org/libsigrok
Cloning into '/Library/Caches/Homebrew/libsigrok--git'...
remote: Counting objects: 27468, done.
remote: Compressing objects: 100% (13210/13210), done.
remote: Total 27468 (delta 19195), reused 20128 (delta 13736)
Receiving objects: 100% (27468/27468), 5.74 MiB | 274.00 KiB/s, done.
Resolving deltas: 100% (19195/19195), done.
Checking connectivity... done.
==> Checking out branch master
==> ./autogen.sh
==> ./configure --prefix=/usr/local/Cellar/libsigrok/HEAD
==> make install
    src/hardware/sysclk-lwla/.libs/api.o
ld: 8 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libsigrok.la] Error 1
make: *** Waiting for unfinished jobs....
/usr/local/Library/Homebrew/build.rb:178:in `dump': can't dump anonymous class #<Class:0x007f8c0b2253c8> (TypeError)
    from /usr/local/Library/Homebrew/build.rb:178:in `rescue in <main>'
    from /usr/local/Library/Homebrew/build.rb:167:in `<main>'
Error: marshal data too short
Please report this bug:
    https://git.io/brew-troubleshooting
/usr/local/Library/Homebrew/utils/fork.rb:39:in `load'
/usr/local/Library/Homebrew/utils/fork.rb:39:in `block (3 levels) in safe_fork'
/usr/local/Library/Homebrew/utils.rb:346:in `ignore_interrupts'
/usr/local/Library/Homebrew/utils/fork.rb:26:in `block (2 levels) in safe_fork'
/usr/local/Library/Homebrew/utils/fork.rb:7:in `open'
/usr/local/Library/Homebrew/utils/fork.rb:7:in `block in safe_fork'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tmpdir.rb:88:in `mktmpdir'
/usr/local/Library/Homebrew/utils/fork.rb:6:in `safe_fork'
/usr/local/Library/Homebrew/formula_installer.rb:542:in `build'
/usr/local/Library/Homebrew/formula_installer.rb:202:in `install'
/usr/local/Library/Homebrew/cmd/install.rb:189:in `install_formula'
/usr/local/Library/Homebrew/cmd/install.rb:94:in `block in install'
/usr/local/Library/Homebrew/cmd/install.rb:94:in `each'
/usr/local/Library/Homebrew/cmd/install.rb:94:in `install'
/usr/local/Library/brew.rb:133:in `<main>'
HOPE:~ junkhack$ 

・進めるが、Error
5) ------------------------------------------------------
HOPE:~ junkhack$ brew install --HEAD libsigrokdecode
Error: Formulae found in multiple taps: 
 * homebrew/science/libsigrokdecode
 * rene-dev/sigrok/libsigrokdecode

Please use the fully-qualified name e.g. homebrew/science/libsigrokdecode to refer the formula.
HOPE:~ junkhack$ 

・進めるが、Error
6) ------------------------------------------------------
HOPE:~ junkhack$ brew install --HEAD --with-libserialport sigrok-cli
Error: Formulae found in multiple taps: 
 * homebrew/science/sigrok-cli
 * rene-dev/sigrok/sigrok-cli

Please use the fully-qualified name e.g. homebrew/science/sigrok-cli to refer the formula.
HOPE:~ junkhack$ 

・進めるが、Error
7) ------------------------------------------------------
HOPE:~ junkhack$ brew install --HEAD pulseview
Error: Formulae found in multiple taps: 
 * homebrew/science/pulseview
 * rene-dev/sigrok/pulseview

Please use the fully-qualified name e.g. homebrew/science/pulseview to refer the formula.
HOPE:~ junkhack$ 

・進めるが、Error
8) ------------------------------------------------------
HOPE:~ junkhack$ brew install sigrok-cli
Error: Formulae found in multiple taps: 
 * homebrew/science/sigrok-cli
 * rene-dev/sigrok/sigrok-cli

Please use the fully-qualified name e.g. homebrew/science/sigrok-cli to refer the formula.
HOPE:~ junkhack$ 

Building manually の手順でやればいいのかもですが、osx のバイナリもだれか作っているはずで、探したらありました。また実機が着たらゆっくり料理することにし、今はソフトウェアの動作だけ確認しておきます。

_Applicationsちょっとバージョンは古いようですが、osx でも動作するようです。

ドラッグでタイムラインの移動、マウスホイールで信号の拡大縮小できるインターフェイスです。各種信号解析も可能なようです。デジタルは8チャンネル入るようですので、これで十分用は足せそうです。DHT の温度センサーのデータ解析もあるようです。自分にはこれで十分だと思います。osx サポートするハードウェアはかなりたくさんあって、迷います。とりあえず、8チャンネル取れるもので、安いものを選びました。

Open Workbench Logic Sniffer というのも、良さそうです。

http://sigrok.org/wiki/Supported_hardware
Supported_hardware_-_sigrok

その後、マニュアルビルドを試すも、libsigrok のmake で失敗。以下次回再開するときのメモ。

・Building manually
http://sigrok.org/wiki/Mac_OS_X

★Install MacPorts,
★Install Qt, download qt-mac-opensource-4.7.4.dmg
★以下必須

$ sudo port install boost libusb libzip libftdi0
$ sudo port install autoconf automake cmake glib2 python33 libtool pkgconfig
$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/

---------------------
libserialport --> OK
libsigrok --> NG
libsigrokdecode --> OK
sigrok-cli --> NG (libsigrok必須)
PulseView --> NG (libsigrokcxx>=0.4.0 必須)
---------------------

▼libserialport
$ git clone git://sigrok.org/libserialport
$ cd libserialport
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install

★OK

    HOPE:libserialport junkhack$ make
    /Applications/Xcode.app/Contents/Developer/usr/bin/make  all-am
      CC       serialport.lo
      CC       macosx.lo
      CCLD     libserialport.la
    HOPE:libserialport junkhack$ 
    HOPE:libserialport junkhack$ sudo make install
    Password:
     /usr/local/bin/gmkdir -p '/usr/local/lib'
     /bin/sh ./libtool --silent  --mode=install /usr/local/bin/ginstall -c   libserialport.la '/usr/local/lib'
     /usr/local/bin/gmkdir -p '/usr/local/include'
     /usr/local/bin/ginstall -c -m 644 libserialport.h '/usr/local/include'
     /usr/local/bin/gmkdir -p '/usr/local/lib/pkgconfig'
     /usr/local/bin/ginstall -c -m 644 libserialport.pc '/usr/local/lib/pkgconfig'
    HOPE:libserialport junkhack$

▼libsigrok
$ git clone git://sigrok.org/libsigrok
$ cd libsigrok
$ ./autogen.sh
$ ./configure
$ make★こける。これが入らないと進まない。
$ sudo make install

    libsigrok configuration summary:
     - Package version................. 0.4.0-git-17124cf
     - Library ABI version............. 2:0:0
     - Prefix.......................... /usr/local
     - Building on..................... x86_64-apple-darwin13.4.0
     - Building for.................... x86_64-apple-darwin13.4.0
    
    Compile configuration:
     - C compiler...................... gcc
     - C compiler version.............. Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
     - C compiler flags................ -g -O2
     - Additional C compiler flags..... -std=c99 -fvisibility=hidden
     - C compiler warnings............. -Wall -Wextra -Wmissing-prototypes
     - C++ compiler.................... g++
     - C++ compiler version............ Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
     - C++ compiler flags.............. -g -O2 -std=c++11
     - C++ compiler warnings........... -Wall -Wextra
    
    Detected libraries (required):
     - glib-2.0 >= 2.32.0.............. 2.44.1
     - libzip >= 0.10.................. 0.11.2
    
    Detected libraries (optional):
     - libserialport >= 0.1.1.......... 0.1.1
     - libftdi1 >= 1.0................. no
     - libftdi >= 0.16................. 0.20
     - libusb-1.0 >= 1.0.16............ 1.0.19
     - librevisa >= 0.0.20130412....... no
     - libgpib......................... no
     - libieee1284..................... no
     - check >= 0.9.4.................. no
     - glibmm-2.4 >= 2.32.0............ 2.44.0
     - python = 2.7.................... 2.7
     - pygobject-3.0 >= 3.0.0.......... no
    
    Enabled hardware drivers:
     - agilent-dmm..................... yes
     - appa-55ii....................... yes
     - asix-sigma...................... yes
     - atten-pps3xxx................... yes
     - baylibre-acme................... no (missing: sys_timerfd_h)
     - beaglelogic..................... yes
     - brymen-bm86x.................... yes
     - brymen-dmm...................... yes
     - cem-dt-885x..................... yes
     - center-3xx...................... yes
     - chronovu-la..................... yes
     - colead-slm...................... yes
     - conrad-digi-35-cpu.............. yes
     - deree-de5000.................... yes
     - demo............................ yes
     - fluke-dmm....................... yes
     - fx2lafw......................... yes
     - gmc-mh-1x-2x.................... yes
     - gwinstek-gds-800................ yes
     - hameg-hmo....................... yes
     - hantek-dso...................... yes
     - hung-chang-dso-2100............. no (missing: libieee1284)
     - ikalogic-scanalogic2............ yes
     - ikalogic-scanaplus.............. yes
     - kecheng-kc-330b................. yes
     - kern-scale...................... yes
     - korad-kaxxxxp................... yes
     - lascar-el-usb................... yes
     - manson-hcs-3xxx................. yes
     - maynuo-m97...................... yes
     - mic-985xx....................... yes
     - motech-lps-30x.................. yes
     - norma-dmm....................... yes
     - openbench-logic-sniffer......... yes
     - pipistrello-ols................. yes
     - rigol-ds........................ yes
     - saleae-logic16.................. yes
     - scpi-pps........................ yes
     - serial-dmm...................... yes
     - sysclk-lwla..................... yes
     - teleinfo........................ yes
     - testo........................... yes
     - tondaj-sl-814................... yes
     - uni-t-dmm....................... yes
     - uni-t-ut32x..................... yes
     - victor-dmm...................... yes
     - yokogawa-dlm.................... yes
     - zeroplus-logic-cube............. yes
    
    Enabled SCPI backends:
     - TCP............................. yes
     - RPC............................. yes
     - serial.......................... yes
     - VISA............................ no
     - GPIB............................ no
     - USBTMC.......................... yes
    
    Enabled language bindings:
     - C++............................. yes
     - Python.......................... no (missing: PyGObject, SWIG)
     - Java............................ no (missing: SWIG, JNI headers)


    HOPE:libsigrok junkhack$ make
    /Applications/Xcode.app/Contents/Developer/usr/bin/make  all-am
      CC       src/backend.lo
      CC       src/device.lo
    
    ::
    
      CC       src/hardware/zeroplus-logic-cube/api.lo
      CCLD     libsigrok.la
    duplicate symbol _lwla1016_info in:
        src/hardware/sysclk-lwla/.libs/lwla.o
        src/hardware/sysclk-lwla/.libs/lwla1016.o
    duplicate symbol _lwla1034_info in:
        src/hardware/sysclk-lwla/.libs/lwla.o
        src/hardware/sysclk-lwla/.libs/lwla1016.o
    duplicate symbol _lwla1034_info in:
        src/hardware/sysclk-lwla/.libs/lwla.o
        src/hardware/sysclk-lwla/.libs/lwla1034.o
    duplicate symbol _lwla1016_info in:
        src/hardware/sysclk-lwla/.libs/lwla.o
        src/hardware/sysclk-lwla/.libs/lwla1034.o
    duplicate symbol _lwla1016_info in:
        src/hardware/sysclk-lwla/.libs/lwla.o
        src/hardware/sysclk-lwla/.libs/protocol.o
    duplicate symbol _lwla1034_info in:
        src/hardware/sysclk-lwla/.libs/lwla.o
        src/hardware/sysclk-lwla/.libs/protocol.o
    duplicate symbol _lwla1016_info in:
        src/hardware/sysclk-lwla/.libs/lwla.o
        src/hardware/sysclk-lwla/.libs/api.o
    duplicate symbol _lwla1034_info in:
        src/hardware/sysclk-lwla/.libs/lwla.o
        src/hardware/sysclk-lwla/.libs/api.o
    ld: 8 duplicate symbols for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make[1]: *** [libsigrok.la] Error 1
    make: *** [all] Error 2
    HOPE:libsigrok junkhack$ 

▼libsigrokdecode
$ git clone git://sigrok.org/libsigrokdecode
$ cd libsigrokdecode
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install

★OK

    1 warning generated.
      CC       decoder.lo
      CC       instance.lo
      CC       log.lo
      CC       util.lo
      CC       exception.lo
      CC       module_sigrokdecode.lo
      CC       type_decoder.lo
      CC       type_logic.lo
      CC       error.lo
      CC       version.lo
      CCLD     libsigrokdecode.la
    HOPE:libsigrokdecode junkhack$ sudo make install
     /usr/local/bin/gmkdir -p '/usr/local/lib'
     /bin/sh ./libtool --silent  --mode=install /usr/local/bin/ginstall -c   libsigrokdecode.la '/usr/local/lib'
     /usr/local/bin/gmkdir -p '/usr/local/include/libsigrokdecode'
     /usr/local/bin/ginstall -c -m 644 version.h '/usr/local/include/libsigrokdecode'
     /usr/local/bin/gmkdir -p '/usr/local/lib/pkgconfig'
     /usr/local/bin/ginstall -c -m 644 libsigrokdecode.pc '/usr/local/lib/pkgconfig'
     /usr/local/bin/gmkdir -p '/usr/local/include/libsigrokdecode'
     /usr/local/bin/ginstall -c -m 644 libsigrokdecode.h '/usr/local/include/libsigrokdecode'
    /Applications/Xcode.app/Contents/Developer/usr/bin/make  install-data-hook
    /usr/local/bin/gmkdir -p /usr/local/share/libsigrokdecode/decoders
    python3.4 ./tools/install-decoders \
            -i ./decoders -o /usr/local/share/libsigrokdecode/decoders
    Installing 59 protocol decoders:
    adns5020 am230x arm_etmv3 arm_itm arm_tpiu avr_isp can dcf77 ds1307 edid 
    eeprom24xx guess_bitrate i2c i2cdemux i2cfilter i2s ir_nec ir_rc5 jitter jtag 
    jtag_stm32 lm75 lpc max7219 maxim_ds28ea00 mdio midi mlx90614 modbus mrf24j40 
    mxc6225xu nrf24l01 nunchuk onewire_link onewire_network pan1321 parallel pwm qi 
    rfm12 rgb_led_spi rtc8564 sdcard_sd sdcard_spi spdif spi spiflash stepper_motor 
    swd tca6408a timing tlc5620 uart usb_packet usb_power_delivery usb_request 
    usb_signalling xfp z80 
    HOPE:libsigrokdecode junkhack$ 

▼sigrok-cli
$ git clone git://sigrok.org/sigrok-cli
$ cd sigrok-cli
$ ./autogen.sh
$ ./configure★libsigrokがないと言われる。まぁ、まだ入れてないですからね。
$ make
$ sudo make install

    HOPE:sigrok-cli junkhack$ ./configure 
    checking for a BSD-compatible install... /usr/local/bin/ginstall -c
    checking whether build environment is sane... yes
    ::
    checking for _FILE_OFFSET_BITS value needed for large files... no
    checking for SIGROK_CLI... no
    configure: error: Package requirements (glib-2.0 >= 2.32.0 libsigrok >= 0.4.0 libsigrokdecode >= 0.4.0) were not met:
    
    No package 'libsigrok' found★
    
    Consider adjusting the PKG_CONFIG_PATH environment variable if you
    installed software in a non-standard prefix.
    
    Alternatively, you may set the environment variables SIGROK_CLI_CFLAGS
    and SIGROK_CLI_LIBS to avoid the need to call pkg-config.
    See the pkg-config man page for more details.
    HOPE:sigrok-cli junkhack$ 


▼PulseView
$ git clone git://sigrok.org/pulseview
$ cd pulseview
$ cmake .★libsigrokcxx>=0.4.0 がないと
$ make
$ sudo make install

    HOPE:pulseview junkhack$ cmake .
    -- Found PkgConfig: /opt/local/bin/pkg-config (found version "0.28") 
    -- The C compiler identification is AppleClang 6.0.0.6000057
    -- The CXX compiler identification is AppleClang 6.0.0.6000057
    -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
    -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
    -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- checking for modules 'libsigrokcxx>=0.4.0;libsigrokdecode>=0.4.0'
    --   package 'libsigrokcxx>=0.4.0' not found
    CMake Error at /opt/local/share/cmake-3.3/Modules/FindPkgConfig.cmake:340 (message):
      A required package was not found
    Call Stack (most recent call first):
      /opt/local/share/cmake-3.3/Modules/FindPkgConfig.cmake:502 (_pkg_check_modules_internal)
      CMakeLists.txt:79 (pkg_check_modules)
    
    
    -- Configuring incomplete, errors occurred!
    See also "/Users/junkhack/Desktop/aa/tmp/pulseview/CMakeFiles/CMakeOutput.log".
    HOPE:pulseview junkhack$ 

※QT はまだ入れてない。

タンタルコンデンサーメモ

WiFi E-ink の基板に使う予定(C15, C16)のタンタルコンデンサーを発注したら、NECトーキンのが送られてきたので、忘れないうちにメモ。

3528_tantalum220uf

タンタルのSMDのサイズが良くわからなくて、どうやら以下のようです。今回のは、3528サイズということのようです。30 個で@20 円くらい。

 tantalum_size