Skip to content

Commit

Permalink
Merge pull request #233 from MiczFlor/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
MiczFlor authored Oct 1, 2018
2 parents 361231b + f6d5cfa commit 6312df2
Show file tree
Hide file tree
Showing 8 changed files with 461 additions and 70 deletions.
87 changes: 83 additions & 4 deletions docs/MANUAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,14 @@ Contains the last playlist name that was being played.
Used in `rfid_trigger_play.sh` to establish if a second swipe on the same playlist was made.

### `settings/Second_Swipe`
Contains RESTART or PAUSE.
This establises if a second swipe of the same RFID card either starts the playlist from the beginning (RESTART)
or toggles pause and play (PAUSE) for the current playlist.
Can be edited in the *Settings* page of the web app.
Contains RESTART or PAUSE or NOAUDIOPLAY.
This establises if a second swipe of the same RFID card either

* starts the playlist from the beginning (RESTART) or
* toggles pause and play (PAUSE) for the current playlist or
* ignores to play audio at all (NOAUDIOPLAY) only executres commands (like *volume up* or *shutdown*).

The behaviour can be edited in the *Settings* page of the web app.
**NOTE:** in the web app you can set *Resume* for each folder, which means that the content of this folder starts from the time where it was last stopped. If you choose *Restart* for the *Second Swipe* AND *Resume* for a folder is enabled, swiping the card a second time will seem to do nothing - the playout continues. However, this is the correct behaviour: swiping the same card a second time triggers *stop* and *play*. The *play* command then checks if the folder has *Resume* enabled, if it does, it will play from the last stored *stop* position - which was the same second swipe.

### `settings/Idle_Time_Before_Shutdown`
Expand Down Expand Up @@ -475,6 +479,81 @@ static domain_name_servers=192.168.178.1
~~~~
Save the changes with `Ctrl & O` then `Enter` then `Ctrl & X`.

## <a name="addmultiplewifissids"></a>I want to add another Wi-ssid e.g. at a friend?
To add multiple wifi networks you can simply add and ssid section into dhcpd.conf.
This can be usefull if you take your phoniebox on a trip to a friend or want to control it on the go by let the phoniebox connect to your mobiles own hotspot.

~~~~
$ sudo nano /etc/dhcpcd.conf
~~~~

If you need another wifi that automatically connects via DHCP e.g. an android-hotspot just add one line
If you need a static network configuration for home-wifi like metioned above just put the static lines below that ssid line

~~~~
ssid androidhotspot
ssid homewifi
static ip_address=192.168.178.199/24
static routers=192.168.178.1
static domain_name_servers=192.168.178.1
~~~~

Save the changes with `Ctrl & O` then `Enter` then `Ctrl & X`.

Then open file for ssid and password

~~~
$ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
~~~

Beside the ssid and passwords you can put a priotity to any ssid so the higher priority gets chosen if both networks are in the range.

~~~
network={
ssid="homewifi"
psk="passwordhere"
id_str="home"
priority=3
}
network={
ssid="androidhotspot"
psk="passwordhere"
id_str="mobile"
priority=5
}
~~~

Save the changes with `Ctrl & O` then `Enter` then `Ctrl & X`.

Some words to security and costs:

**Mobile Hotspot use:**
Be aware your PI is using your perhaps expensive 3G data plan (e.g. in foreign country) so perhaps deactivate mobile data prior to letting PI connect.

**Hotel use / Hotspot use:**
Be aware that everyone on that wifi can connect to your Pi and could at least control mpc and upload files

To always be able to connect to your phoniebox no matter what IP config the network has, be sure to know the hostname (default:raspberry) or change it to a more unique one
~~~
$ sudo nano /etc/hostname
~~~
just put the name in there
~~~
phoniebox
~~~

Save the changes with `Ctrl & O` then `Enter` then `Ctrl & X`.

~~~
$ sudo reboot
~~~

**Then always connect to your box, like this:**
* via browser http://phoniebox (be sure to use the http:// - if it didn't work, it could be you land on phoniebox.de ;) )
* via ssh using phoniebox:22

## <a name="faqAudioNotWorking"></a>Audio is not working

This might occur if you are using external sound cards like *pHat BEAT* or the like. I split this into two parts: a) sound did never work and b) sound worked once, now, with a new soundcard, it doesn't.
Expand Down
4 changes: 3 additions & 1 deletion htdocs/inc.formCardEdit.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

<?php

?>
<form name='volume' method='post' action='<?php print $_SERVER['PHP_SELF']; ?>'>

<fieldset>
Expand Down
2 changes: 2 additions & 0 deletions htdocs/inc.header.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@
*******************************************/
if(isset($_POST['cardID']) && $_POST['cardID'] != "") { // && file_exists('../shared/shortcuts/'.$_POST['cardID'])) {
$post['cardID'] = $_POST['cardID'];
} elseif(isset($_GET['cardID']) && $_GET['cardID'] != "") {
$post['cardID'] = $_GET['cardID'];
}
if(isset($_POST['streamURL']) && $_POST['streamURL'] != "") {
$post['streamURL'] = $_POST['streamURL'];
Expand Down
15 changes: 15 additions & 0 deletions htdocs/inc.setSecondSwipe.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@
} else {
exec($exec);
}
} elseif(trim($_POST['secondSwipe']) == "NOAUDIOPLAY") {
$Second_Swipe = "NOAUDIOPLAY";
$exec = 'echo "'.$Second_Swipe.'" > '.$conf['settings_abs'].'/Second_Swipe';
if($debug == "true") {
print $exec;
} else {
exec($exec);
}
}
}
?>
Expand All @@ -48,6 +56,13 @@
}
print ">".$lang['settingsSecondSwipePause'];
print "</option>\n";
print "
<option value='NOAUDIOPLAY'";
if($Second_Swipe == "NOAUDIOPLAY") {
print " selected";
}
print ">".$lang['settingsSecondSwipeNoAudioPlay'];
print "</option>\n";
?>
</select>
<span class="input-group-btn">
Expand Down
1 change: 1 addition & 0 deletions htdocs/lang/lang-en.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
$lang['settingsSecondSwipeInfo'] = "When you swipe the same RFID a second time, what happens? Start the playlist again? Toggle pause/play?";
$lang['settingsSecondSwipeRestart'] = "Re-start playlist";
$lang['settingsSecondSwipePause'] = "Toggle pause / play";
$lang['settingsSecondSwipeNoAudioPlay'] = "Ignore audio playout triggers, only system commands";

/*
* System info
Expand Down
Loading

0 comments on commit 6312df2

Please sign in to comment.