Jupiter-8 Black

Sonnar 50mm f/2のコピー品
ロシア製 Jupiter-8 Blackを調達

発注は終わったが、現物が届くのは月末になりそうだ。

04041242_5701e2b599c4c

すぐ自分の持ち物の詳細を忘れてしまうので、控えておく。

購入先のサイトから転載

やわらかくも力強い、オールド・ゾナーの写りを手軽に楽しめるロシア製レンズ。
各種ミラーレスカメラで撮影を楽しめます。レアな未開封新品です。

  • 未開封新品
  • ロシア KMZ製(クラスノゴルスク機械工場)
  • L38マウント
  • Jupiter-8-1と光学性能は同じ
  • 戦前のSonnarをコピー
  • 大口径で明るくシャープ
  • 開放から色のりの良い写り
  • 絞り羽は9枚構成
  • 単焦点 50mm f/2
  • MFレンズ
  • 1年保証

X-M1 オールドレンズ Industar-61 L/D 55mm f/2.8

所持しているミラーレス 数年前のX-M1
偶然、見つけたオールドレンズIndustar-61 L/D 55mm f/2.8

02140325_56bf750b13ba7

購入先サイトから転載

旧ソビエト時代に作られたレンジファインダーカメラFED-5の標準レンズです。
優れた描画力で人気の単焦点レンズです。

  • FED-5の標準レンズ
  • 旧ソビエト(ウクライナ)時代のオールドレンズ
  • テッサー型のレンズ
  • 大口径で明るくシャープな写り
  • 色味が鮮やかなレンズ
  • 単焦点55mm f/2.8 3群4枚構成
  • 酸化ランタンを含有
  • MFレンズ
  • デッドストックの整備品

参考にならない撮影結果

X-M1で初めてのマニュアル撮影で、ピンが何処に合わしたのか、自分でも不明w

DSCF2432-1

室内撮影

DSCF2433-1

暗くて、あまり参考にならない。ご容赦を・・・


 

ここからは、Industarを装着してみた感じ。Xperia Z3にて撮影

DSC_0126

DSC_0127

DSC_0128

DSC_0129

netatmo api で温度取得

netatmo apiを利用してTemperatureを取得したので、自分の備忘として。

phpとpythonでデータ取得を試してみた。

phpでは、battery_vpの取得方法がわからん。

pythonでは、WeatherStationが複数ある場合、個々の取得方法がわからん。

今回は、1拠点のバッテリー数値の取得は、pythonで行い、温度はphpを使った。

netatmoのModule1が外部温度センサーに割り当てられbattery_vpがある。
この数値がイマイチよくわからない

/*for raingauge and outdoor module*/
class NABatteryLevelModule
{
/* Battery range: 6000 … 3600 */
const BATTERY_LEVEL_0 = 5500;/*full*/
const BATTERY_LEVEL_1 = 5000;/*high*/
const BATTERY_LEVEL_2 = 4500;/*medium*/
const BATTERY_LEVEL_3 = 4000;/*low*/
/* below 4000: very low */
}

のように書かれているので、cactiでThresholdsを設定する。
値は、Warnigを4100、Alertを4500とした。

Netatmo-API-PHP

netatmo.php

#!/usr/bin/php
<?php /** * Example of Weather station API * If you need more details, please take a glance at https://dev.netatmo.com/doc */ define('__ROOT__', dirname(dirname(__FILE__))); require_once (__ROOT__.'/src/Netatmo/autoload.php'); require_once 'Utils.php'; require_once 'Config.php'; /** * Prints a list of devices * */ function printDevices($devices, $title = NULL) { if(!is_null($devices) &amp;&amp; is_array($devices) &amp;&amp; !empty($devices)) { if(!is_null($title)) printMessageWithBorder($title); foreach($devices as $device) { printWSBasicInfo($device); } } } $scope = Netatmo\Common\NAScopes::SCOPE_READ_STATION; $config = array("client_id" =&gt; $client_id,
                "client_secret" =&gt; $client_secret,
                "username" =&gt; $test_username,
                "password" =&gt; $test_password);

$client = new Netatmo\Clients\NAWSApiClient($config);

//Authentication with Netatmo server (OAuth2)
try
{
    $tokens = $client-&gt;getAccessToken();
}
catch(Netatmo\Exceptions\NAClientException $ex)
{
    handleError("An error happened while trying to retrieve your tokens: " .$ex-&gt;getMessage()."\n", TRUE);
}

//Retrieve user's Weather Stations Information

try
{
    //retrieve all stations belonging to the user, and also his favorite ones
    $data = $client-&gt;getData(NULL, TRUE);
//    printMessageWithBorder("Weather Stations Basic Information");
}
catch(Netatmo\Exceptions\NAClientException $ex)
{
    handleError("An error occured while retrieving data: ". $ex-&gt;getMessage()."\n", TRUE);
}

if(empty($data['devices']))
{
    echo 'No devices affiliated to user';
}
else
{

    $users = array();
    $friends = array();
    $fav = array();
    $device = $data['devices'][0];
    $tz = isset($device['place']['timezone']) ? $device['place']['timezone'] : "GMT";

    //devices are already sorted in the following way: first weather stations owned by user, then "friend" WS, and finally favorites stations. Still let's store them in different arrays according to their type
    foreach($data['devices'] as $device)
    {

        //favorites have both "favorite" and "read_only" flag set to true, whereas friends only have read_only
        if(isset($device['favorite']) &amp;&amp; $device['favorite'])
            $fav[] = $device;
        else if(isset($device['read_only']) &amp;&amp; $device['read_only'])
            $friends[] = $device;
        else $users[] = $device;
    }

    //print first User's device Then friends, then favorite
    printDevices($users, "User's weather stations");
//    printDevices($friends, "User's friends weather stations");
//    printDevices($fav, "User's favorite weather stations");

}
?>;

バッテリーデータを取得するのは、こんな感じで調整した。

print ($module['battery_vp'])."\n";

netatmo.shでデータ取得
netatmo.sh

#!/bin/sh

cd /usr/share/cacti/site/scripts/netatmo-api/bin
/usr/bin/php ./netatmo.php &gt;/tmp/netatmo.data

indoor=`cat /tmp/netatmo.data |sed  -e '11,11!d'|cut -d' ' -f2`
outdoor=`cat /tmp/netatmo.data |sed  -e '29,29!d'|cut -d' ' -f2`
indoorh=`cat /tmp/netatmo.data |sed  -e '45,45!d'|cut -d' ' -f2`
outdoorh=`cat /tmp/netatmo.data |sed  -e '63,63!d'|cut -d' ' -f2`

printf ' Indoor:'$indoor
printf ' Outdoor:'$outdoor
printf ' Indoorh:'$indoorh
printf ' Outdoorh:'$outdoorh

rm /tmp/netatmo.data

exit 0

netatmo-api-python

netatmo.py

#!/usr/bin/python3
# encoding=utf-8

# 2013-01 : philippelt@users.sourceforge.net 

# Just connect to a Netatmo account, and print internal and external temperature of the default (or single) station
# In this case, sensors of the station and the external module have been named 'internal' and 'external' in the
# Account station settings.

import lnetatmo

authorization = lnetatmo.ClientAuth()
devList = lnetatmo.DeviceList(authorization)

#print ("Current temperature (inside/outside/battry): %s / %s °C" %
#        ( devList.lastData()['Indoor']['Temperature'],
#          devList.lastData()['Outdoor']['Temperature']),
#         devList.lastData()['Outdoor']['battery_vp']
#)

print   "Inndoor:",devList.lastData()['Indoor']['Temperature']
print   "Outdoor:",devList.lastData()['Outdoor']['Temperature']
print   "Battery:",devList.lastData()['Outdoor']['battery_vp']

#print('External module battery : ', "OK" if int(devList.lastData()['Outdoor']['battery_vp']) &gt; 5000 else "0" )

netatmo.sh

cd /usr/share/cacti/site/scripts/
python netatmo.py &gt; /tmp/netatmo

indoor=`cat /tmp/netatmo|grep Inndoor|cut -b10-`
outdoor=`cat /tmp/netatmo|grep Outdoor|cut -b10-`
batt=`cat /tmp/netatmo|grep Battery|cut -b10-`

printf ' Indoor:'$indoor
printf ' Outdoor:'$outdoor
printf ' Battery:'$batt

rm /tmp/netatmo

exit 0

上に書いたソースを元に試行錯誤の結果このようなグラフで妥協した。

graph_image

温度データは取得出来ているのだが、グラフが結構途切れてしまう。

YAMAHA WLX302 cacti script

先日の記事でYAMAHA WLX302 cacti templateのscriptを修正した。

前回は、curlで取得したHTTP DATAを加工して利用していたが、データの取得が不安定だった。
原因は特定していませんが、HTTPから取得する際にデータの取りこぼしがありました。

今回は、telenetを利用して取得していきます。
wlx302のtelnetは1ユーザーしか許可していない。
よって別端末からwlx302にtelnetでログインしていると、データは取得出来ません。

まずは、telnetにログインしてデータを取得するscriptを設置
使用しているwlx302のtelnetはloginIDとpasswdは設定していない。
設定している場合は、一番最初のechoのあとに、ID
次のechoの後に、passwdを入力

#!/bin/sh
sleep 1;echo
sleep 1;echo
sleep 3;echo "show status wlan-controller ap list member"
sleep 3;echo "show environment"
sleep 1;echo exit

これを、wlxauto.shで保存し、telnetへパイプで渡す。sleepはネットワーク環境等で調整する。

/bin/sh /usr/share/cacti/site/scripts/wlxauto.sh |telnet 192.168.xxx.xxx
Trying 192.168.xxx.xxx...
Connected to 192.168.xxx.xxx.
Escape character is '^]'.


Password: 

WLX302 BootROM Ver.1.xx

WLX302 Rev.12.xx.xx (Tue Jan  5 17:53:58 2016)
  Copyright (c) 1994-2015 Yamaha Corporation. All Rights Reserved.
00:a0:de:xx:xx:xx, 00:a0:de:xx:xx:xx, 00:a0:de:xx:xx:xx
Memory 256Mbytes
> 
> show status wlan-controller ap list member 
[00:a0:de:xx:xx:xx]
Connection      : --
Last update     : Mar 30 09:14:24 2016
System name     : WLX302_S44xxxxxx
System location : 
IP address      : 192.168.xxx.xxx
 [module1]
 Channel              : 1
 Transmit power rate  : 100
 Number of connection : 1
 [module2]
 Channel              : 36
 Transmit power rate  : 100
 Number of connection : 3

> show environment 
WLX302 BootROM Ver.1.xx
WLX302 Rev.12.xx.xx (Tue Jan  5 17:53:58 2016)
  main:  WLX302 ver=00 serial=S44xxxxxx MAC-Address=00:a0:de:xx:xx:xx MAC-Addre
ss=00:a0:de:xx:xx:xx MAC-Address=00:a0:de:xx:xx:xx
CPU:   1%(5sec)   4%(1min)   4%(5min)    Memory: 28% used
Firmware: internal  Config. file: 0  
Boot time: 2016/03/25 21:52:58 +09:00
Current time: 2016/03/30 09:14:58 +09:00
Elapsed time from boot: 4days 11:22:00
Security Class: 1, FORGET: ON, TELNET: OFF
Inside Temperature(C.): 36
Power: PoE
State of cooperation: NONE
> Connection closed by foreign host.

このようにデータが流れれば取得出来ている。
wlxget.shを書き直す。
データ加工はうまく書けないので、いじくり回した結果このようになりました。

/bin/sh /usr/share/cacti/site/scripts/wlxauto.sh |telnet 192.168.xxx.xxx > /tmp/wlxtelnetget.log

wlxload=`cat /tmp/wlxtelnetget.log |sed  -e '36,36!d'|cut -c29-30`
wlxmem=`cat /tmp/wlxtelnetget.log |sed  -e '36,36!d'|cut -c50-51`
wlxtemp=`cat /tmp/wlxtelnetget.log |sed  -e '42,42!d'|cut -c25-26`
wlx24as=`cat /tmp/wlxtelnetget.log |sed  -e '25,25!d'|cut -c24-25`
wlx5as=`cat /tmp/wlxtelnetget.log | sed -e '29,29!d'|cut -c24-25`

wlxload=`echo $wlxload`
wlxmem=`echo $wlxmem`
wlxtemp=`echo $wlxtemp`
wlx24as=`echo $wlx24as`
wlx5as=`echo $wlx5as`

# wlxload:4 wlxmem:29 wlxtemp:38 wlx24as:1 wlx5as:4

#CPU (5sec)
printf ' wlxload:'$wlxload
printf ' wlxmem:'$wlxmem
printf ' wlxtemp:'$wlxtemp
printf ' wlx24as:'$wlx24as
printf ' wlx5as:'$wlx5as

rm /tmp/wlxtelnetget.log

exit 0

走らせてみる。

$ sh wlxget.sh 
Connection closed by foreign host.
 wlxload:4 wlxmem:28 wlxtemp:36 wlx24as:1 wlx5as:3$

wlx302_graph_image

庭木の剪定

1年ぶりに庭木2本の剪定をした。

あまり大きくならないよう、頻繁に剪定しているつもりだけど、この時期は新芽が伸びるのが早いです。

剪定を始めて8年目、ずいぶん時間が経ちました。

始めて剪定したときと比べて、少し見栄えがするように切れたとおもう。

表側の花壇をもう少し華やかにしたいけど、難しい。

良く考えてみると、庭師さんってすごいですね。