村上や

“TOP”へMC900432676[1]

ニュース

 

2019817

 

Raspberry Pi Zero WH」で作るインターネットラジオです。

 

 

NHK(第1、第2、FM)は音がと切れれていました。

試しにアプリを「mplayer」から「VLC」に変更しました。

すると、音がと切れなくなりました!!

Raspberry Pi Zero WH」では「mplayer」が重いのか??

 

ついでにmp3の音楽もランダムで聴けるようにしました。

 

起動時、#GPIO3はデフォルトでhight3.3V)のはずですが、なぜかアンプがアクティブになります。

赤色のLEDが点灯しているので、3.3Vの電圧によりアンプはスリープにならなければいけません。

しかし、アンプがONで、ラジオ・音楽がOFFの状態です。

なので、起動時、意図的に#GPIO3ONhight)にすることにしました。

 

作成したfavicon(ファビコン)です。

 

備忘録です。

↓PHPファイル(/var/www/html/index.php)を修正しました。(属性:755

<?php

 

if(isset($_GET['stop'])) {

exec("killall vlc");

exec("gpio -g mode 27 out");

exec("gpio -g write 27 0");

exec("gpio -g mode 3 out");

exec("gpio -g write 3 1");

}

 

if(isset($_GET['vol'])) {

$vol = $_GET['vol'];

exec("amixer sset PCM " .$vol. "%");

}

 

if(isset($_GET['music'])) {

$music = $_GET['music'];

exec("killall vlc");

exec("cvlc -Z -L /var/www/html/music/" .$music. "/*.mp3 > /dev/null &");

exec("gpio -g mode 27 out");

exec("gpio -g write 27 1");

exec("gpio -g mode 3 out");

exec("gpio -g write 3 0");

}

 

if(isset($_GET['url'])) {

$url = $_GET['url'];

exec("killall vlc");

exec("cvlc " .$url. " > /dev/null &");

exec("gpio -g mode 27 out");

exec("gpio -g write 27 1");

exec("gpio -g mode 3 out");

exec("gpio -g write 3 0");

}

 

?>

 

<html>

<head>

<meta name="viewport" charset="utf-8" content="width=device-width">

<title>Raspberry Pi</title>

<link rel="shortcut icon" href="favicon.ico">

</head>

<body>

<a href="index.php?stop=stop">Stop</a>

<br>

<br>

Volum

Min

<a href="index.php?vol=0">0</a>

<a href="index.php?vol=60">1</a>

<a href="index.php?vol=70">2</a>

<a href="index.php?vol=80">3</a>

<a href="index.php?vol=85">4</a>

<a href="index.php?vol=90">5</a>

<a href="index.php?vol=92">6</a>

<a href="index.php?vol=94">7</a>

<a href="index.php?vol=96">8</a>

<a href="index.php?vol=98">9</a>

<a href="index.php?vol=100">10</a>

Max

<br>

<br>

Music

<br>

&nbsp;<a href="index.php?music=Shakatak">シャカタク</a><br>

&nbsp;<a href="index.php?music=12_Girls_Band">女子十二楽坊</a><br>

&nbsp;<a href="index.php?music=Yo-Yo_Ma">ヨーヨー・マ</a><br>

<br>

Radio

<br>

&nbsp;<a href="index.php?url=https://nhkradiolkr1-i.akamaihd.net/hls/live/512088/1-r1/1-r1-01.m3u8">NHK R1</a><br>

&nbsp;<a href="index.php?url=https://nhkradioakr2-i.akamaihd.net/hls/live/511929/1-r2/1-r2-01.m3u8">NHK R2</a><br>

&nbsp;<a href="index.php?url=https://nhkradiolkfm-i.akamaihd.net/hls/live/512097/1-fm/1-fm-01.m3u8">NHK FM</a><br>

&nbsp;<a href="index.php?url=http://yp.shoutcast.com/sbin/tunein-station.pls?id=1782029">Cool Jazz New York</a><br>

&nbsp;<a href="index.php?url=http://yp.shoutcast.com/sbin/tunein-station.pls?id=1794791">Cool Jazz FLA</a><br>

&nbsp;<a href="index.php?url=http://yp.shoutcast.com/sbin/tunein-station.pls?id=1605192">Cool Jazz Global</a><br>

&nbsp;<a href="index.php?url=http://yp.shoutcast.com/sbin/tunein-station.pls?id=1586446">J-Pop Sakura 17</a><br>

&nbsp;<a href="index.php?url=http://yp.shoutcast.com/sbin/tunein-station.pls?id=1656313">J-Pop - PowerPlay</a><br>

&nbsp;<a href="index.php?url=http://yp.shoutcast.com/sbin/tunein-station.pls?id=1659345">Asia DREAM Radio - Japan Hits</a><br>

&nbsp;<a href="index.php?url=http://yp.shoutcast.com/sbin/tunein-station.pls?id=1659314">J-Pop - PowerPlay Kawaii</a><br>

</body>

</html>

 

/var/www/html/musicの中に「Shakatak」(シャカタク)、「12_Girls_Band」(女子十二楽坊)、「Yo-Yo_Ma」(ヨーヨー・マ)などのディレクトリを作成して、mp3ファイルを入れます。(属性:755

 

/etc/rc.localexit 0の前に以下を追加して、起動時、#GPIO3hightON)にしました。

# nano /etc/rc.local

gpio -g mode 3 out

gpio -g write 3 1

 

 

 

【バックナンバー】

MC900053825[1] 2019813

MC900053825[1] 2019812

MC900053825[1] 201984

MC900053825[1] 2019728

MC900053825[1] 2019721

MC900053825[1] 2019715

MC900053825[1] 201977

MC900053825[1] 2019630

MC900053825[1] 2019623

MC900053825[1] 2019616

MC900053825[1] 201969

MC900053825[1] 201962

MC900053825[1] 2019526

MC900053825[1] 2019512

MC900053825[1] 201956

MC900053825[1] 201953

MC900053825[1] 2019430

MC900053825[1] 2019421

MC900053825[1] 2019414

MC900053825[1] 201947

MC900053825[1] 2019330

MC900053825[1] 2019323

MC900053825[1] 2019321

MC900053825[1] 2019317

MC900053825[1] 201939

MC900053825[1] 201933

MC900053825[1] 2019224

MC900053825[1] 2019217

MC900053825[1] 2019211

MC900053825[1] 201923

MC900053825[1] 2019127

MC900053825[1] 2019120

MC900053825[1] 2019114

MC900053825[1] 201916

MC900053825[1] 201913

MC900053825[1] 2019年1月1

MC900053825[1] 2018

MC900053825[1] 2017

MC900053825[1] 2016

MC900053825[1] 2015

MC900053825[1] 2014

MC900053825[1] 2013

MC900053825[1] 2012

MC900053825[1] 2011