***DVSP2でPi-Star [#j5c22976]
DVSP2_on_Rpi-Zero(V1.3)+OLED(128x64)にPi-Starのイメージ(v3.4.5)を一部改変して動くようにした。また同時に、ローカルUS-SRUST系レピーターに接続できるようにし、またOLEDによるヘッダーとショートメッセージ情報を表示できるようにした。
参考:http://www.pistar.uk/downloads/
+ノードタイプの選択(Configuration画面)
&ref(node_type.JPG,,60%);
+ircddbgateway設定(expert→ircddbgateway画面)
&ref(dplus_login.JPG,,60%);
+PHP編集
 # nano /var/www/dashboard/admin/dstarrepeater/link_manager.php
 while (!feof($dplusFile)) {
         $dplusLine = fgets($dplusFile);
         if (strpos($dplusLine, 'REF') !== FALSE && strpos($dplusLine, '#') === FALSE) {
             ↓
 while (!feof($dplusFile)) {
         $dplusLine = fgets($dplusFile);
         if ((strpos($dplusLine, 'JP1') !== FALSE || strpos($dplusLine, 'REF') !== FALSE) && strpos($dplusLine, '#') === FALSE) {
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^追加 *カッコも忘れないように
 ------------------------------------------
 # nano /var/www/dashboard/admin/admin.php
 while (!feof($dplusFile)) {
         $dplusLine = fgets($dplusFile);
         if (strpos($dplusLine, 'REF') !== FALSE && strpos($dplusLine, '#') === FALSE && strpos($dplusLine, 'REF001') === FALSE)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 削除
            ↓
 while (!feof($dplusFile)) {
         $dplusLine = fgets($dplusFile);
         if (strpos($dplusLine, '#') === FALSE) && strpos($dplusLine, '#') === FALSE && strpos($dplusLine, 'REF001') === FALSE)
 
+DPlus_Local.txtを作成・追加
 #nano /usr/local/etc/DPlus_Local.txt
 JP1YJQ  jp1yjq.dip.jp
 JP1YKM  jp1ykm.dip.jp
 -----------------------
 # nano /root/addlocal
 cat /usr/local/etc/DPlus_Local.txt >> /usr/local/etc/DPlus_Hosts.txt
 pkill ircddbgatewayd
 sleep 2
 /usr/local/bin/ircddbgatewayd -daemon
を作成して、
 # chmod 755 addlocal
と実行権を付与しておき、夜中3時過ぎに、新しい各種Hosts.txtがロードされ更新されてしまうので、
 # crontab -e
 0 4 * * * /root/addlocal
として毎日4時に、Hostsファイルを追加し、ircddbgatewaydを再起動して読み込ませる。
+他のcronでの自動起動を制限(コメントアウトしておく)
 # nano /etc/crontab
 # m h dom mon dow user  command
 #*/5 * * * * root /usr/local/sbin/pistar-upnp.service start > /dev/null 2>&1
 # 17 * * * * root cd / && run-parts --report /etc/cron.hourly
+cronを再起動(念のため)
 # /etc/init.d/cron restart
+OLEDへの表示
 --- /root/lcdx.py ----
 #!/usr/bin/python
 #-*- coding:utf-8 -*-
 
 #import RPi.GPIO as GPIO
 
 import re
 import subprocess
 import json
 from datetime import datetime
 from oled import OLED
 from oled import Font
 from oled import Graphics
 import sys
 import time
 
 # Connect to the display on /dev/i2c-1
 dis = OLED(1)
 
 # Start communication
 dis.begin()
 
 # Start basic initialization
 dis.initialize()
 
 # Do additional configuration
 dis.set_memory_addressing_mode(0)
 dis.set_column_address(0, 127)
 dis.set_page_address(0, 7)
 dis.set_inverse_display(0)
 #dis.set_memory_addressing_mode(1)
 
 # Clear display
 dis.clear()
 dis.deactivate_scroll()
 # Set font scale x2
 f = Font(2)
 
 #from time import time, asctime, sleep, localtime
 #def main():
 while True:
     msg = ""
     station = ""
     cmd = "tail -500 /var/log/pi-star/dstarrepeaterd.log | grep -e 'Slow' | tail -1 | cut -c43-61"
     LastLink = subprocess.check_output(cmd, shell = True )
     LastLink = LastLink.replace("Linked to", "")
     NowDT = datetime.now().strftime("%H:%M")
     cmd = "grep R_ShortMsg  /var/log/pi-star/dstarrepeaterd.log | tail -1 | cut -c25-"
     RSM = subprocess.check_output(cmd, shell = True )
     m = json.loads(RSM)
     if m and m['R_ShortMsg']:
         match = m['R_ShortMsg']
         station = match['station'].strip()
         suffix = match['suffix'].strip()
         msg = match['msg'].strip()
         msg = msg.replace("/", " ")
         if msg == '' or msg == '_' or "Not" in msg or "It is" in msg:
             msg = NowDT + str.strip(LastLink)
             pm1 = str(station)
             pm2 = str(msg[0:5])
             if "Linked" in msg:
                 pm3 = str(msg[6:15])
             else:
                 pm3 = str(msg[5:14])
 
             dis.clear()
             f.scale = 2
             f.print_string(0,  0, pm1)
             f.print_string(0, 20, pm2)
             f.print_string(0, 36, pm3)
             dis.update()
         else:
             pm1 = str(station)
             pm2 = str(msg[0:9])
             if "Linked" in msg:
               pm3 = str(msg[10:18])
             else:
                 pm3 = str(msg[5:14])
 
             dis.clear()
             f.scale = 2
             f.print_string(0,  0, pm1)
             f.print_string(0, 20, pm2)
             f.print_string(0, 36, pm3)
             dis.update()
         else:
             pm1 = str(station)
             pm2 = str(msg[0:9])
             if "Linked" in msg:
               pm3 = str(msg[10:18])
             else:
               pm3 = str(msg[9:18])
 
             dis.clear()
             f.scale = 2
             f.print_string(0,  0, pm1)
             f.print_string(0, 20, pm2)
             f.print_string(0, 36, pm3)
             dis.update()
 
     time.sleep(4.1)
 
 if __name__ == "__main__":
 
   try:
     main()
   except KeyboardInterrupt:
     pass
   finally:
      print "Goodbye!"
+表示例
例-1 接続なく待機中の場合              例-2 ノードが接続先へ接続した時
   ノードコール/現在の時刻/接続状態           ノードコール/接続状態/接続先
&ref(IMG_2624.JPG,,50%);  &ref(IMG_2629.JPG,,50%);
 
例-3 アクセス局にメッセージが無い場合        例-4 アクセス局にメッセージがある場合
   アクセスコール/現在時刻/接続先            アクセスコール/ショートメッセージ(2行)
&ref(IMG_2631.JPG,,50%);  &ref(IMG_2639.JPG,,50%);
 
例-5 メッセージがある場合              例-6 接続後誰もアクセスなしの場合
   アクセスコール/ショートメッセージ(2行)       ノードコール/現在時刻/接続先
&ref(IMG_2641.JPG,,50%);  &ref(IMG_2644.JPG,,50%);

 ----
''&color(Red){以下工事中};''
 
#clear
#comment
#navi(日記)

リロード   新規 下位ページ作成 凍結解除 差分 コピー 名前変更   ホーム 一覧 検索 最終更新 バックアップ リンク元   ヘルプ   最終更新のRSS