顯示具有 電腦_Raspberry_Pi_樹莓派 標籤的文章。 顯示所有文章
顯示具有 電腦_Raspberry_Pi_樹莓派 標籤的文章。 顯示所有文章

2024年12月7日 星期六

Raspberry Pi 樹莓派 安裝APRS軟體 direwolf 可用作 iGate, digipeater

  Raspberry Pi 樹莓派 安裝APRS軟體 direwolf 
 可用作 iGate, digipeater  


Raspberry Pi 樹莓派 也用了幾年了,差不多就是個小電腦,滿好用的,

適合 24小時開機,執行相對簡單而想要一直執行的程式功能。 好處是省電,又比電腦便宜。


用於 APRS 安裝 direwolf  效果、辨識率、穩定度 都相當不錯







On Debian / Ubuntu / Raspbian / Raspberry Pi OS: 

sudo apt-get install git
sudo apt-get install gcc
sudo apt-get install g++
sudo apt-get install make
sudo apt-get install cmake
sudo apt-get install libasound2-dev
sudo apt-get install libudev-dev
sudo apt-get install libavahi-client-dev


安裝 direwolf (1)  


Linux - Using apt-get (Debian flavor operating systems)

Results will vary depending on your hardware platform and operating system version because it depends on various volunteers who perform the packaging. Expect the version to lag significantly behind development.

sudo apt-get update
apt-cache showpkg direwolf
sudo apt-get install direwolf



安裝 direwolf (2)  

sudo apt-get install cmake

sudo apt-get install libasound2-dev
sudo apt-get install libudev-dev

cd ~
git clone https://www.github.com/wb2osz/firewolf.git/
cd direwolf
mkdir build && cd build
cmake ..
make -j4
sudo make install
make install-conf



設定 direwolf.conf  

cd ~
nano direwolf.conf


音效卡 常用

ADEVICE plughw:1,0


填自己的呼號

MYCALL BU2DR-3


位置 的 比控 設定

#PBEACON delay=1 every=30 overlay=S symbol="digi" lat=... long=...



封包轉發 的設定  ( 以下是用於 ISS 國際太空站 的設定 )

DIGIPEAT 0 0 ^RS0ISS ~WIDE2-2$ TRACE



呼號的密碼

IGLOGIN BU2DR 12345


^O  存檔,  ^X  離開 nano


桌面 設定 音效卡:





sudo reboot


direwolf -T "%H:%M:%S" -l /home/pi/aprslogs




direwolf pdf 說明檔




Raspberry Pi 樹莓派 如何改成 唯讀系統,避免重灌

Read-Only Raspberry Pi - Never Corrupt your Micro-SD Card





Raspberry Pi 4B 樹莓派 硬體欣賞



2024-06-10

2024-12-04




2024年6月1日 星期六

Raspberry Pi 樹莓派 改 唯讀系統,刪除安裝軟體 etc

Raspberry Pi 樹莓派 改 唯讀系統,刪除安裝軟體 etc


Raspberry Pi 樹莓派 也用了幾年了,差不多就是個小電腦,滿好用的,

適合 24小時開機,執行相對簡單而想要一直執行的程式功能。 好處是省電,又比電腦便宜。





Raspberry Pi 樹莓派 如何改成 唯讀系統,避免重灌

Read-Only Raspberry Pi - Never Corrupt your Micro-SD Card









Raspberry Pi 樹莓派 已安裝之軟體 如何刪除?

但是如果要 移除已安裝的軟體,? Raspbian 不像 Windows 那樣容易可以解除安裝, 而是要用 命令列視窗 下命令


如何刪除樹莓派上已安裝之軟體:



pi@raspberrypi:~ $ dpkg --list


ii  teamviewer-host 14.1.9025    armhf        Remote control solution.


pi@raspberrypi:~ $ sudo apt-get --purge remove teamviewer-host

pi@raspberrypi:~ $ sudo apt autoremove








Raspberry Pi 樹莓派 安裝 與 使用





Raspberry Pi 4B 樹莓派 硬體欣賞






2022-06-07
2023-02-10



2023年12月2日 星期六

RSP2 SDR 軟體定義無線電 的 介面 2020-2024

RSP2 SDR 軟體定義無線電 的 介面


Win10, Win 11 用 SDRuno 非常好的 SDR

WebSDR is a Software-Defined Radio receiver connected to the internet


SDR.HU (要先註冊,有將近 500個網站)


OpenWebRX is a remote spectrum monitoring solution (提供 Linux 架站軟體 )


Windows 7, Win10, Win 11 用 SDRuno 非常好的 SDR:




Raspberry Pi 3B+


























2020-04-30
2023-12-24


2023年1月21日 星期六

Raspberry Pi 樹莓派 安裝 與 使用

Raspberry Pi 樹莓派 安裝 與 使用


Raspberry Pi 樹莓派,2012年12月買了 Raspberry Pi 2 也用了很多年了,

差不多就是個小電腦,滿好用的,適合 24小時開機,

執行相對簡單而想要一直執行的程式功能。 好處是省電,又比電腦便宜。

後來又陸續買了 Raspberry Pi 3B, Raspberry Pi 3B+, Raspberry Pi 4B,

最近新款是 Raspberry Pi 4B, 記憶體有分 2G, 4G, 與 8G 三款。

可惜 2022, 2023年以後漲價,變的很貴,

以前 Raspberry Pi 4B 大概三千多元,最近漲到四至七千元,實在買不下去,

原則上,規格需求低的,就改 Banana Pi, Orange Pi, MapleBoard,

如果規格需求較高的,就改用 小電腦,小 PC 吧。



Raspberry Pi 樹莓派 硬體 與 軟體

Raspberry Pi 樹莓派 硬體

Raspberry Pi 樹莓派 軟體 (作業系統)



Raspberry Pi 樹莓派 基金會




接腳圖







欣賞一下硬體,越做越好,越來越好用了。





最近買了 Raspberry Pi 4B, 裝壓克力盒子

原則上一定要用風扇,不然夏天容易熱當機!




到 Raspberry Pi 官網,下載 OS Imager

將作業系統寫入 SD 卡裡面,現在常用 32GB 以上的 SD 卡





 





作業系統寫入 SD 卡之後,插入 Raspberry Pi 就可以開機了



內建有 Chromium 可以瀏覽網頁



建議進入 Raspberry Pi 設定,
啟用 ssh 與 vnc,方便以後連線操作:






設好螢幕解析度




我個人常用 mode 35 1280x1024




桌面右上角,按右鍵可以設定音效



用 ALSA 指令,放音或錄音

可以內建 default audio device bcm2835 ALSA 的音效。

如果用 USB sound card 音效卡,ALSA 指令包括: aplay, arecord, amixer, alsamixer, alsaloop, alsactl, speaker-test, etc.

  1. Aplay -l # List all sound playback devices
  2. Arecord -l # List all sound collection devices

Test USB Audio Device

speaker-test -Dplughw:CARD=Device -c2 -twav

參數 -D option 選擇 plughw:CARD=Device, 

參數 -c2 is the left and right channel, 選擇左右聲道

參數 -twav selects to play the .wav sound file. 選擇 wav 檔

指令 arecord for audio capture, 可錄音

指令 aplay to capture audio playback. 可播音

  1. arecord -Dplughw:CARD=Device -fcd -c2 -twav test.wav
  2. aplay -Dplughw:CARD=Device test.wav

參數 -f option sets the audio format, 是音效檔格式



** 安裝 pygame 支援 音效卡 **


有些版本的 Raspberry Pi 無內建 pygame 需要安裝

sudo apt-get update
sudo apt-get install python3-pygame
Python 程式中使用 pygame 播放音效檔

import pygame
pygame.mixer.init()
pygame.mixer.music.load("myFile.wav")
pygame.mixer.music.play()
while pygame.mixer.music.get_busy() == True:
    continue


發現滿好用的!





(不用) * 安裝 PyAudio 支援 音效卡 較早的硬體如 3B,可能播放音效會斷續!

說明網頁


Python 程式中使用 PyAudio




Example: Blocking Mode Audio I/O

"""PyAudio Example: Play a wave file."""

import pyaudio
import wave
import sys

CHUNK = 1024

if len(sys.argv) < 2:
    print("Plays a wave file.\n\nUsage: %s filename.wav" % sys.argv[0])
    sys.exit(-1)

wf = wave.open(sys.argv[1], 'rb')

# instantiate PyAudio (1)
p = pyaudio.PyAudio()

# open stream (2)
stream = p.open(format=p.get_format_from_width(wf.getsampwidth()),
                channels=wf.getnchannels(),
                rate=wf.getframerate(),
                output=True)

# read data
data = wf.readframes(CHUNK)

# play stream (3)
while len(data) > 0:
    stream.write(data)
    data = wf.readframes(CHUNK)

# stop stream (4)
stream.stop_stream()
stream.close()

# close PyAudio (5)
p.terminate()

以上為 python 範例


某些較早的硬體軟體版本,有可能播放音效會斷續,若要移除

Uninstall PyAudio

How to uninstall or remove python-pyaudio software package





** 有關 time 的用法 **

import time

time.sleep(1) # 暫停 1 秒鐘

time.strftime('%X')

time.strftime() result: 可以輸出指定的日期或時間字串:

Directive

Meaning

Notes

%a

Locale’s abbreviated weekday name.

%A

Locale’s full weekday name.

%b

Locale’s abbreviated month name.

%B

Locale’s full month name.

%c

Locale’s appropriate date and time representation.

%d

Day of the month as a decimal number [01,31].

%H

Hour (24-hour clock) as a decimal number [00,23].

%I

Hour (12-hour clock) as a decimal number [01,12].

%j

Day of the year as a decimal number [001,366].

%m

Month as a decimal number [01,12].

%M

Minute as a decimal number [00,59].

%p

Locale’s equivalent of either AM or PM.

(1)

%S

Second as a decimal number [00,61].

(2)

%U

Week number of the year (Sunday as the first day of the week) as a decimal number [00,53]. All days in a new year preceding the first Sunday are considered to be in week 0.

(3)

%w

Weekday as a decimal number [0(Sunday),6].

%W

Week number of the year (Monday as the first day of the week) as a decimal number [00,53]. All days in a new year preceding the first Monday are considered to be in week 0.

(3)

%x

Locale’s appropriate date representation.

%X

Locale’s appropriate time representation.

%y

Year without century as a decimal number [00,99].

%Y

Year with century as a decimal number.

%z

Time zone offset indicating a positive or negative time difference from UTC/GMT of the form +HHMM or -HHMM, where H represents decimal hour digits and M represents decimal minute digits [-23:59, +23:59].

%Z

Time zone name (no characters if no time zone exists).

%%

A literal '%' character.


範例:

>>> from time import gmtime, strftime
>>> strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime())
'Thu, 28 Jun 2001 14:17:15 +0000'









2021-07-17

2023-01-23



Dr. Shaw YC Shiau PhD 蕭醫師 蕭博士 蕭同學 首頁 置頂文 標籤 分類搜尋

There will be Advertisement  (personalized)   inserts in Google Blog. Sorry!  谷歌 的 部落格 會有 置入廣告 (個人化的) ,請見諒!    Information Service   b...