2020年5月20日水曜日

WSJT-x v2.2.0 rc1

チョンボ!
Prinston のHP見ていたら、wsjt-x v2.2.0-rc1が出ていて、FT8のdecodingの改善等がなされているようなので、インストールしてみました。
不注意で、v2.1.2と同じ場所にwsjt-x.exeとしてインストールされるために、今までのv2.1.2が置き換えられてしまい、立ち上がると「rc1ですよ」ってワーニング窓がOKを押すまで出ている、という面倒な事になってしまいました。
ま、このまま使うことにして、decodingの改善が如何ほどの物か実感してみたいと思います。

> JTAlertがうまく動かない! 残念ながら2.1.2に戻す事にします。
>> (June 1st) rc3が出ていたので、早速インストール。JTAlertもv2.16.6にアップデートして、無事使える状態になりました。 v2.2は 10sec位からデコード出来たcallsignはさっさと表示してくれるので、せっかちの私にはVY FB。 decodeのパフォーマンスが向上しているようですが、これはもう少し使ってみないと?? 近接の25dB以上の信号に対する耐性も向上とありますが、ここではそんな強力な局は今のところ居ないので、効果のほどは??


WSJT-X 2.2 User Guide の一部より

Improvements to decoders
FT4: Corrected bugs that prevented AP (a priori) decoding and/or multi-pass decoding in some circumstances. Improved and extended the algorithm for AP decoding.
FT8: Decoding is now spread over three intervals. The first starts 11.8 s into an Rx sequence and typically yields around 85% of the possible decodes, so you see most decodes much earlier than before. A second processing step starts at 13.5 s, and the final one at 14.7 s. Overall decoding yield on crowded bands is improved by 10% or more. Systems with receive latency greater than 0.2 s will see smaller improvements, but will still see many decodes earlier than before.
SNR estimates no longer saturate at +20 dB, and large signals in the passband no longer cause the SNR of weaker signals to be biased low. Times written to cumulative journal file ALL.TXT are now correct even when the decode occurs after the T/R sequence boundary. In FT8 DXpedition Mode, AP decoding is now implemented for Hounds when the Fox has a compound callsign.
JT4: Formatting and display of averaged and Deep Search decodes has been cleaned up and made consistent with other modes used for EME and extreme weak-signal work on microwave bands.
JT65: Many improvements have been made for averaged and Deep Search decodes, and their display to the user. For details see JT65 in the VHF+ Features section of this guide.
WSPR: Significant improvements have been made to the WSPR decoder’s sensitivity, its ability to cope with many signals in a crowded sub-band, and its rate of undetected false decodes. We now use up to three decoding passes. Passes 1 and 2 use noncoherent demodulation of single symbols and allow for frequency drifts up to ±4 Hz in a transmission. Pass 3 assumes no drift and does coherent block detection of up to three symbols. It also applies bit-by-bit normalization of the single-symbol bit metrics, a technique that has proven helpful for signals corrupted by artifacts of the subtraction of stronger signals and also for LF/MF signals heavily contaminated by lightning transients. With these improvements the number of decodes in a crowded WSPR sub-band typically increases by 10 to 15%.
New message format: When EU VHF Contest is selected, the Tx2 and Tx3 messages — those conveying signal report, serial number, and 6-character locator — now use hashcodes for both callsigns. This change is not backward compatible with earlier versions of WSJT-X, so all users of EU VHF Contest messages should be sure to upgrade to versiion 2.2.0. See Contest Messages for details.
Minor enhancements and bug fixes
  • Save None now writes no .wav files to disk, even temporarily.
  • An explicit entry for WW Digi Contest has been added to Special operating activities on the Settings | Advanced tab.
  • The contest mode FT4 now always uses RR73 for the Tx4 message.
  • Keyboard shortcuts have been added as an aid to accessibility: Alt+R sets Tx4 message to RR73, Ctrl+R sets it to RRR.
  • The Status bar now displays the number of decodes found in the most recent Rx sequence.
  • As an aid for partial color-blindness, the “inverted goal posts” marking Rx frequency on the Wide Graph’s frequency scale are now in a darker shade of green.

2020年4月24日金曜日

温湿度モニター(センサーをSHTに変更)

センサーをDHTからSHTに変更して、センサー部分の構造をむき出しから、アクリルパイプ(16φ 10cm)の中に入れる方法にしてみました。 
また、SHTだけですが供給電圧を計測時にonして終了すればoffするようにして、省電力化をさらに進めてみました。 
また、計測時間間隔を凡そ10分にしています。 (何故か、一つの計測点のDHTがうまく動作しなくなってしまったので、この際2つ共にSHTに変更しました。)
 また、実験中にhttpd-access.logに408が記録され、データがちゃんと受信できていなかった時があったので、Li電池を新しいものに交換してみました。
回路図を添付するほどの物ではないので、以下結線の記述;
SHT VIN -> D6(GPIO12)
      G     -> Ground
      SCL -> D1(GPIO5)
      SDA -> D2(GPIO4)
ESP-WROOM-32
     RST -> D0(GPIO16)  deepsleep wakeup の為、

>> 408のエラーを調べてみると、Headerが送られて来てから中身が送られて来るまでの間隔が長いと、攻撃とみなして、Timeoutさせる、仕様になっているようなので、外部にexposeするサーバーでは無いので、取り敢えず、/usr/local/etc/apache24/httpd.confのmod_reqtimeout.soをコメントアウトして様子を見ることにしました。
また、SHTの電源のoffは、サーバーとのコネクションを切ってからにしました。
>> これも解決には至っていない! 何が原因だろう?
何故か、手こずるなー、、、。
>> deepsleep で4時間半(10分毎なので、25,6回)位で止まってしまうので、別の8266に替えてみると、問題なく動いています。 結局は原因が良くわからず、8266自身が不良品だったのかもしれません。 
色々弄っているときにESP8285でもやってみましたが、此方はdeepsleepから立ち上がりませんでした。 ググるとdeepsleepが動かない、と言う書き込みがあったので、8266と同じものとして扱うことは出来なさそうです。
>>使用していた1000mAhのLi電池の出力が3.7V位に下がってしまう(劣化?)とNJU7223が3.3V作ってくれなくて起動できなくなっている物があることに気が付きました。NJUは入力電圧が0.6V以上高い必要がある為に、Liが3V台に落ちてしまうとアウト!




/*
    This sketch establishes a TCP connection to a "quote of the day" service.
    It sends a "hello" message, and then prints received data.
*/
#include "ESP8266WiFi.h"


#ifndef STASSID
#define STASSID "Buffalo-G-4CC0"
#define STAPSK  "65rhwrit3nnee"
//#define IDENTIFIER "GardenCenter"
#define IDENTIFIER "GardenEast"
//#define IDENTIFIER "GardenWest"
#endif
#define SHT 12  //  D6=GPIO12 set to SHT power. DTH11 was broken and replaced to SHT10 2020/04/21
#define DHTpin 14

#ifdef DHT  
  #include "DHTesp.h"
  DHTesp dht;
#else
  #include "SHTSensor.h"
  #include "Wire.h" 
  SHTSensor sht;

#endif
const char* ssid     = STASSID;
const char* password = STAPSK;
const char* Identifier = IDENTIFIER;
const char* host = "192.168.1.3";
const uint16_t port = 80;

void setup() {
  Serial.begin(115200);
  delay(1000);  //let sercial console settle.
  pinMode(SHT,OUTPUT); // Control SHT power to minimize the consumption.  
  // We start by connecting to a WiFi network
  /* Explicitly set the ESP8266 to be a WiFi-client, otherwise, it by default,
     would try to act as both a client and an access-point and could cause
     network-issues with your other WiFi-devices on your WiFi-network. */
  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
#ifdef SHT  
  digitalWrite(SHT, HIGH);
  delay(100);  // need to wait a while ...
  Wire.begin();
  if (sht.init()) {
    Serial.print("init(): success\n");
  } else {
    Serial.print("init(): failed\n");
  }
#endif
  Serial.println("");
  Serial.println("WiFi connected");
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());
#ifdef DHT
  dht.setup(DHTpin, DHTesp::DHT11);  //Connect DHT sensor to GPIO 14
#else
  sht.setAccuracy(SHTSensor::SHT_ACCURACY_MEDIUM); // only supported by SHT3x
#endif
}
void loop() {

  WiFiClient client;
  if (!client.connect(host, port)) {
    Serial.println("connection failed");
    delay(5000);
    return;
  }
#ifdef DHT
  delay(dht.getMinimumSamplingPeriod());
  // Reading temperature or humidity takes about 250 milliseconds!
  // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
  float h = dht.getHumidity();
  // Read temperature as Celsius (the default)
  float t = dht.getTemperature();
  // Check if any reads failed and exit early (to try again).
#else
  float h = sht.getHumidity();
  float t = sht.getTemperature();

#endif

  if (isnan(h) || isnan(t)) {
    Serial.println("Failed to read from DHT/SHT sensor!");
    delay(100);
    return;
  } 

  // WEB serverにデータをアップロードする。
  String url = "/weather/weather_log.php";
        url += "?location=" + String(Identifier); // ID to identify location
        url += "&temperature="+String(t);
        url += "&humidity=" +String(h);
        url += "&pressure=" +String("-----");     
  Serial.print("Requesting URL: ");
  Serial.println("GET "+ url);
  client.print(String("GET ") + url + " HTTP/1.1\r\n" +
                "Host: " + host + "\r\n" +
                "Connection: close\r\n\r\n");
  delay(50); 
  // Read all the lines of the reply from server and print them to Serial
  Serial.println("Returned message from server: ");
  while(client.available()){
    String line = client.readStringUntil('\r');
    Serial.print(line);
  }
  client.stop();  
  
  digitalWrite(SHT, LOW);  // turn off SHT power.

  // 15分deepsleepする。
  ESP.deepSleep(10*60*1000*1000, WAKE_RF_DEFAULT); // 60*1000*1000 = 1min, 10 min
  delay(1000); // execute once every 5 minutes, don't flood remote service
}

2020年4月16日木曜日

WSJT-xのレベル合わせ

FT8での運用が多くなって、出てくる局も多くなりましたが、DXをシャカリキ?に呼び出すと、孫子連れの電波になって、5~6匹同じ局が呼んでいる状態になったりします。 明らかに、オーディオレベルを上げ過ぎていて、オーディオで高調波作って送信している状態のように思えます。 ただ、本人と孫子には30dB程の差がありますので、実際に問題になる局は、距離が近いとか限られた範囲なのかもしれません。
いつもは、SmartSDRのスペクトラム表示でオーディオレベルを調整していたのですが、手元で遊んでいるRSP1AとRSP-Spectrum Analyzerで ちょっとこの辺りを確認してみました。 Flex6600なのでDAX(Digital Audio Exchange)のレベルと、WSJT-xのレベルの両方で調整してみました。
左はDAXのレベルをMaxにして、WSJT-xのレベルをMaxにした場合ですが、そこら中に孫子が出来ているみたいです(peak 値を見てしまったので、ちょっとみにくいですが)。
 WSJT-xのレベルをMaxにして、DAXのレベルを下げて行き問題のなさそうなところ(50/100)にすると、概ね良さそうなのですが、若干スプリアスが残ります。
更にDAXのレベルを48/100にまで下げると、すっきり高調波の類は無くなります。
 上はpeak値で見ていたので、realにしたものが左。



オーディオレベルの調整は意外とクリティカルで、近接したところで、スペアナなどでスペクトラムを見ながら調整したほうが良いと思われます。 スプリアスとのレベル差が30dB以上あるので、気が付きにくいかもしれませんが、ローカルから白い目で見られないように注意する必要がありますね。

* RSP Spectrum Analyzerはインストールしただけで使っていなかったので、もう少し慣れないと使いこなしてない。



2020年4月7日火曜日

近所の桜ーまだ観れる!

世の中コロナウイルスの影響で外出自粛が続いていますが、今日は天気は良く桜ももう終わりそうなので、近所から、自宅アンテナの写真を一枚。
最近はカメラを弄ることも少なくなって、「絞り優先」 とか、やり方を忘れてしまい、Autoで撮影したために、桜の方にピントが合って、後ろの主役にピントが合っていない!

プログラム言語も、CもPythonもArduinoも、使えるまでにちょっと時間が掛かるようになってしまい、弄るのが億劫。
これで、英語も読み書き面倒になると、何も残らないな~。



2020年3月28日土曜日

FreeBSD 12.1Rでvm-bhyve上にWin10をインストールしてみた

サーバーのOSをFreeBSD 12.1Rにアップグレードした時にvm-bhyveもインストールしておいたので、「もし実用的な速さで使えるなら、、、」と思って、そのうち実験と思っていたが、最近のコンディションの悪さと、外出自粛で暇なので、実験してみました。
「FreeBSD 12のbhyveにWindows10をインストールする(その1、その2)」を参考にさせて頂きました。
  1. まづ、Windows10のDVDのイメージファイルの作成 dd if=/dev/cd0 of=Windows10.iso bs=1m でコピーをファイル上に作り、出来たファイルをvm_dir/.isoディレクトリに移動。
  2. 以前、セットアップしていたvm-bhyveのネットワーク設定をして、remoteから見えるように。
  3. remoteからグラフィックス表示させるためにtigerVNCをpackageでインストール(pkg install tiver-vnc で1.10.0がインストールされますが、portには古いのが入っていました)。
  4. vm install windows Windows10.iso で取り敢えずインストールしてみる。
  5. あれ、途中で止まってる! tail -f vm-bhyve.log で様子を見ると、fatal; unable to locate firmware /usr/local/share/uefi-firmware/BHYVE_UEFI.fd と言うのが出ていて、インストールされていません。 このエラーメッセージでググってこのページにたどり着き、早速uefi-firmwareをインストール(portからのインストール)して、再度挑戦すると、今度はインストールが始まりました。
  6. 何度かtigerVNCが消えて、その都度tigerVNCを再接続させると、ちゃんとインストールは進んでいるようで、インストールが終了し使えるようになりました。
結構時間が掛かりましたが、一応動くWindows10がzfsのファイル上に作成できました(参考にしたWEBではWindows10のイメージはzfs上に作成できない、とありましたが、ちょっと意味が良くわかりませんが、zfs上で動いています)。
ただ、動作は遅いので、積極的に使ってみようという気にはなりませんでした。
動作することの確認のみ。

尚、今回の実験はFeeBSD12にWindows10からXming使ってアクセスしておき、FreeBSD上にvm-bhyveでWindows10を起動し、FreeBSD上でvncviewerをlocalhost:5600で起動して、これをまたWindows10上で見る(Xmingのお陰で、こんなことが出来ています)、というややこしい事をしています。(上の、画面写真の左3つの窓がFreeBSDのxterm/gnome-terminalで、真ん中がFreeBSD上のWindows10。でも、周りは全部Windows10のアプリ、、、)



2020年3月27日金曜日

JpGraphを久しぶりに弄って 一部問題解決。

室内と庭の温度、湿度のpostgreSQL DBが動くようになったので、今まで使っていた、HPをちょっと弄って化粧をしてみました。

JpGraphを使ってグラフを描かせていましたが、何故かグラフの各点の値表示が出来な
かったり、TrueTypeのフォントが使えていなかったりしたのを、一日がかりで修正。
  • 値の表示が出来なかった原因 ;  $graph->clearTheme()を設定していないと、表示をしてくれなかった。下のphpのソースコード参照
  • TrueTypeフォントのインストール ;  FreeBSDで動いているので、packageからwebfont(MSのTTF同等?)をインストール。 /usr/local/lib/php/jpgraph/jpg-config.inc.phpのTTF, MBTTFを実際にインストールされているディレクトリに指定する。
//
// UNIX:
//   CACHE_DIR /tmp/jpgraph_cache/
//   TTF_DIR   /usr/share/fonts/truetype/
//   MBTTF_DIR /usr/share/fonts/truetype/
//
// WINDOWS:
//   CACHE_DIR $SERVER_TEMP/jpgraph_cache/
//   TTF_DIR   $SERVER_SYSTEMROOT/fonts/
//   MBTTF_DIR $SERVER_SYSTEMROOT/fonts/
//
//------------------------------------------------------------------------
// define('CACHE_DIR','/tmp/jpgraph_cache/');
define('TTF_DIR','/usr/local/share/fonts/webfonts/');
define('MBTTF_DIR','/usr/local/share/fonts/webfonts/');
ついでにDBの欠落データを正しくグラフに反映させる為に、pg_fetch_rows()から、pg_fetch_result()に変更して、array()の該当する日時にデータが挿入されるように変更

require_once ('jpgraph/jpgraph.php');
require_once ('jpgraph/jpgraph_bar.php');
require_once ('jpgraph/jpgraph_stock.php');
require_once ('jpgraph/jpgraph_line.php');

  $ydata = array();
  $y1data = array();
  $ymax = array();
  $ymin = array();
  $yhumid = array();
  $ymaxhumid = array();
  $yminhumid = array();
  $ypressure = array();
  $ymaxpressure = array();
  $yminpressure = array();
  $sdata = array();

$conn = "hostaddr=192.168.?.?? dbname=XXXXX user=Who password=Are_you?";  //fake user/password
$link = pg_connect($conn);
if (!$link) {
   die ('Connection failed '.pg_last_error());
   }

  $result = pg_query("SELECT day, avg_temperature, max_temperature, min_temperature,avg_humidity, max_humidity, min_humidity, avg_pressure,max_pressure,min_pressure from dailydatacurrentmonth where location='MyRoom'" );
if (!$result){
   die('Query failed'.pg_last_error());
  }
$tempE=pg_fetch_result($result, pg_num_rows($result)-1, 0);  // chech when day ends
for ($i = 0, $j = 0, $k = 0; $i < $tempE; $i++){
   $temp =pg_fetch_result($result, $k, 0);  //  day
   if ($i == $temp-1) {
     $x_axis[$i] = $temp;
     $ydata[$i] = pg_fetch_result($result, $k, 'avg_temperature');
     $yhumid[$i] = pg_fetch_result($result, $k, 'avg_humidity');
     $ymaxhumid[$i] = pg_fetch_result($result, $k, 'max_humidity');
     $yminhumid[$i] = pg_fetch_result($result, $k, 'min_humidity');
     $ypressure[$i] = pg_fetch_result($result, $k, 'avg_pressure');
     $ymaxpressure[$i] = pg_fetch_result($result, $k, 'max_pressure');
     $yminpressure[$i] = pg_fetch_result($result, $k, 'min_pressure');
     $sdata[$j++] = pg_fetch_result($result, $k, 'min_temperature');
     $sdata[$j++] = pg_fetch_result($result, $k, 'min_temperature');
     $sdata[$j++] = pg_fetch_result($result, $k, 'max_temperature');
     $sdata[$j++] = pg_fetch_result($result, $k, 'max_temperature');
     $k++;
   } else {
     $x_axis[$i] = $i+1;
     $ydata[$i] = '';
     $yhumid[$i] = '';
     $ymaxhumid[$i] = '';
     $yminhumid[$i] = '';
     $ypressure[$i] = '';
     $ymaxpressure[$i] = '';
     $yminpressure[$i] = '';
     $sdata[$j++] = '';
     $sdata[$j++] = '';
     $sdata[$j++] = '';
     $sdata[$j++] = '';
   } 
}

  $result = '';
  $result = pg_query("SELECT day, avg_temperature from dailydatacurrentmonth_prevyear where location='MyRoom'" );
  if (!$result){
     die('Query failed'.pg_last_error());
  }
for ($i = 0; $i < pg_num_rows($result); $i++){
    $rows = pg_fetch_array($result, NULL, PGSQL_ASSOC);
    $y1data[$i] = $rows['avg_temperature'];
}

$close_flag = pg_close($link);

$graph = new Graph(750, 450);
$graph->clearTheme();
$graph->SetFrame(true);
$graph->SetScale("textlin",10, 40);
$graph->SetY2Scale("lin",10, 90);
$graph->img->SetMargin(50,30,20,90);
$graph->SetShadow();

$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
$graph->title->Set("Daily Max/Min/Avg Temperature & Avg Humidity of the Month");

//$graph->yaxis->title->SetFont(FF_ARIAL.FS_ITALIC, 10);
$graph->yaxis->title->Set("Temperature");
$graph->ygrid->Show(true,false);
$graph->y2axis->title->Set("Humidity");

$graph->xaxis->title->Set("Month-Day");
//$graph->xaxis->title->SetFont(FF_ARIAL.FSBOLD, 10);
$graph->xgrid->Show(true,true);

// Specify the tick lables
$graph->xaxis->SetTickLabels($x_axis);
$graph->xaxis->SetTextLabelInterval(1);

// Create the linear plot
$lineplot = new LinePlot($ydata);
$lineplot->SetColor("blue");
$lineplot->mark->SetType(MARK_UTRIANGLE);
$lineplot->value->show();
$lineplot->value->SetFont( FF_ARIAL, FS_ITALIC, 7 );
$lineplot->value->SetColor('darkred');
$lineplot->value->SetFormat('%0.1f');

$p1 = new StockPlot($sdata);
$p1->SetWidth(9);

$line2plot = new LinePlot($y1data);
$line2plot->SetColor("red");
$line2plot->mark->SetType(MARK_UTRIANGLE);
//$line2plot->value->show();
$line2plot->value->SetColor('darkred');
$line2plot->value->SetFont( FF_ARIAL, FS_BOLD, 10 );
$line2plot->value->SetFormat('%0.1f');


$barplot = new BarPlot($yhumid);
$barplot->SetColor("black");
$barplot->value->Show();
$barplot->value->SetFont( FF_ARIAL, FS_BOLD, 10 );
$barplot->value->SetFormat('%0.1f');

// Add the plot to the graph
$graph->Add($lineplot);
$graph->Add($line2plot);
$graph->AddY2($barplot);
$graph->Add($p1);

$graph->Stroke();

?>



2020年3月16日月曜日

30-40-80m Inverted U アップデート


 先日、40mのトラップを小さいインダクタンスの物に交換し、末端のエレメント長が3m程長くなり、屋根のより下に位置するようになりました。 
どうもこの所為か、今までなかったようなIが80mで出るようになり、元に戻すのも能が無いので、片方だけ今まで使っていたインダクタンスの大きいトラップに変更してみました。
で、Iは治まったので、寸法とnanoVNAでシャックで計測したSWRを記録しておきます。
 

> 80mの中心周波数が上がり過ぎたため、若干調整して、最終的に左図左端のエレメント長が565cmから588.5cmとなり、中心周波数は3547.1Khzとなりました(5mm単位の調整が必要なところを、目分量で現場で処理していたので、目標値より2Khz程高くなってしまいました)。

80mのエレメントは凡そ26Khz/20cm(1.3Khz/cm)で、切り貼り。








30-40-80m Dipoleがオカシイ(続)

RI1FJLの40mでの交信のときおかしくて、エレメントの修正をして問題なく終わったと思っていたら、ここ2週間の雨天で、またチューンイングが取れなくなってしまった。 何故か30mがオカシイ! よくよく考えてみると、7Mhz用のトラップを軽量化の為に銅線からアルミ線に変更した 注)...