Skip to content

Commit

Permalink
Rename RustPager to UniPager (close #34)
Browse files Browse the repository at this point in the history
  • Loading branch information
7h0ma5 committed Mar 22, 2017
1 parent dd93201 commit e730fbe
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 83 deletions.
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ matrix:
- env:
- TARGET=arm-unknown-linux-gnueabi
- LINKER=arm-linux-gnueabi-gcc
- PACKAGE=rustpager-arm.tar.gz
- PACKAGE=unipager-arm.tar.gz
addons:
apt:
packages:
Expand All @@ -14,7 +14,7 @@ matrix:
- env:
- TARGET=arm-unknown-linux-gnueabihf
- LINKER=arm-linux-gnueabihf-gcc
- PACKAGE=rustpager-rpi2.tar.gz
- PACKAGE=unipager-rpi2.tar.gz
addons:
apt:
packages: &armhf
Expand All @@ -24,20 +24,20 @@ matrix:
- env:
- TARGET=armv7-unknown-linux-gnueabihf
- LINKER=arm-linux-gnueabihf-gcc
- PACKAGE=rustpager-rpi3.tar.gz
- PACKAGE=unipager-rpi3.tar.gz
addons:
apt:
packages: *armhf
- env:
- TARGET=i686-unknown-linux-gnu
- PACKAGE=rustpager-i686.tar.gz
- PACKAGE=unipager-i686.tar.gz
addons:
apt:
packages:
- gcc-multilib
- env:
- TARGET=x86_64-unknown-linux-gnu
- PACKAGE=rustpager-x86_64.tar.gz
- PACKAGE=unipager-x86_64.tar.gz

install:
- export PATH="$PATH:$HOME/.cargo/bin"
Expand All @@ -55,7 +55,7 @@ script:
- cargo build --target $TARGET --verbose --release

before_deploy:
- tar -czf $PACKAGE -C target/$TARGET/release/ rustpager
- tar -czf $PACKAGE -C target/$TARGET/release/ unipager

deploy:
provider: releases
Expand All @@ -65,4 +65,4 @@ deploy:
skip_cleanup: true
on:
tags: true
repo: rwth-afu/RustPager
repo: rwth-afu/UniPager
15 changes: 1 addition & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "rustpager"
name = "unipager"
version = "0.4.2"
authors = ["Thomas Gatzweiler <[email protected]>"]

Expand All @@ -16,16 +16,3 @@ net2 = "^0.2.26"

[dependencies.raspi]
path = "lib/raspi"

[package.metadata.deb]
maintainer = "RWTH Amateurfunkgruppe <[email protected]>"
copyright = "2017, RWTH Amateurfunkgruppe <[email protected]>"
license_file = ["LICENSE", "0"]
extended_description = """\
Universal POCSAG transmitter controller"""
depends = "$auto"
section = "hamradio"
priority = "optional"
assets = [
["target/release/rustpager", "usr/bin/", "755"]
]
99 changes: 49 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,41 @@
# RustPager
# UniPager

[![Build Status](https://img.shields.io/travis/rwth-afu/RustPager.svg?style=flat)](https://travis-ci.org/rwth-afu/RustPager)
[![GitHub issues](https://img.shields.io/github/issues/rwth-afu/RustPager.svg?style=flat)](https://github.com/rwth-afu/RustPager/issues)
[![GitHub release](https://img.shields.io/github/release/rwth-afu/RustPager.svg?style=flat)](https://github.com/rwth-afu/RustPager/releases)
[![Build Status](https://img.shields.io/travis/rwth-afu/UniPager.svg?style=flat)](https://travis-ci.org/rwth-afu/UniPager)
[![GitHub issues](https://img.shields.io/github/issues/rwth-afu/UniPager.svg?style=flat)](https://github.com/rwth-afu/UniPager/issues)
[![GitHub release](https://img.shields.io/github/release/rwth-afu/UniPager.svg?style=flat)](https://github.com/rwth-afu/UniPager/releases)

Universal POCSAG transmitter controller written in Rust.

## Compilation
Be aware: Install with Raspbian wheezy will fail, you need jessie. Using a fresh installation of your Operating System will minimize the chance of running into errors.
## Installation

Create the file `/etc/apt/sources.list.d/unipager` with the following content:

```
deb http://ci.db0sda.ampr.org/debian unipager main
deb-src http://ci.db0sda.ampr.org/debian unipager main
```

It is recommended to update your OS before installing:
Then execute the following commands:

```bash
wget -O - http://ci.db0sda.ampr.org/debian/rwth-afu.key | sudo apt-key add -
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install unipager
```

## Compilation
Install rust:

```bash
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly
```

Now reboot OR log out to make the Rust-Toolchain available:

```bash
sudo reboot
OR
logout
(SSH sessions will be closed)
```
Now reboot OR log out to make the rust toolchain available.

Log in again and clone the source:

```bash
git clone https://github.com/rwth-afu/RustPager.git
git clone https://github.com/rwth-afu/UniPager.git
```

If this command fails, you may need to install git and try again:
Expand All @@ -46,37 +47,12 @@ sudo apt-get install git
Start the build:

```bash
cd RustPager
cd UniPager
cargo build --release
```
The compiled binary will be created at `./target/release/unipager`.

Run the install script:

```bash
sudo ./install.sh
```

Autostart for RustPager:

```bash
sudo systemctl enable rustpager
```

Finally do a reboot to test the Autostart sequence of RustPager

```bash
sudo reboot
```

If you made an autostart entry, the rustpager-Interface will now be available at IP-OF-DEVICE:8073

If you prefer to run RustPager manually, run:

```bash
sudo ./RustPager/target/release/rustpager
```

Be aware: Must be run with root privileges. Also directory /etc/rustpager must exist and be writeable by root.
Be aware: Must be run with root privileges for GPIO access.

## Cross Compilation

Expand Down Expand Up @@ -128,22 +104,45 @@ linker = "arm-linux-gnueabihf-gcc"
Clone the source:

```bash
git clone https://github.com/rwth-afu/RustPager.git
git clone https://github.com/rwth-afu/UniPager.git
```

Start the build:

```bash
cd RustPager
cd UniPager
cargo build --target $TARGET --release
```

The cross-compiled binary will be created at `./target/$TARGET/release/rustpager`.
The cross-compiled binary will be created at `./target/$TARGET/release/unipager`.

## Manual Installation

Move the UniPager binary to `/usr/local/bin/unipager`. Create the directory
`/var/lib/unipager`. Create the file `/etc/systemd/system/unipager.service` with
the following content:

```
[Unit]
Description=UniPager POCSAG transmitter controller
After=network.target
[Service]
ExecStart=/usr/local/bin/unipager
WorkingDirectory=/var/lib/unipager
[Install]
WantedBy=multi-user.target
```
Reload systemctl configuration with `sudo systemctl daemon-reload`.
To start UniPager enter `sudo systemctl start unipager`. To start UniPager
automatically after booting enter `sudo systemctl enable unipager`.

## Configuration

The web interface for configuration is available on port `8073`. Port `8055`
must also be open to allow websocket communication between the browser and
RustPager.
UniPager.

### Raspberry Pi
Make sure that the serial port is activated. To do this add `enable_uart=1` to
Expand All @@ -154,7 +153,7 @@ This is not needed for the RASPAGERV1 and Audio transmitter type.

## License

RustPager
UniPager
Copyright (C) 2017 RWTH Amateurfunkgruppe

This program is free software: you can redistribute it and/or modify
Expand Down
4 changes: 2 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Build-Depends:
debhelper (>= 9), dh-systemd, curl, ca-certificates
Standards-Version: 3.9.6
Homepage: http://www.afu.rwth-aachen.de
Vcs-Browser: https://github.com/rwth-afu/RustPager
Vcs-Git: git://github.com/rwth-afu/RustPager.git
Vcs-Browser: https://github.com/rwth-afu/UniPager
Vcs-Git: git://github.com/rwth-afu/UniPager.git

Package: unipager
Architecture: any
Expand Down
1 change: 0 additions & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ endif

override_dh_auto_build:
RUST_BACKTRACE=1 cargo build --release --verbose
mv target/release/rustpager target/release/unipager

override_dh_auto_install:

Expand Down
2 changes: 1 addition & 1 deletion src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl Connection {

pub fn run(&mut self) -> Result<()> {
let version = env!("CARGO_PKG_VERSION");
let id = format!("[RustPager-{} v{} {} {}]\r\n",
let id = format!("[UniPager-{} v{} {} {}]\r\n",
self.id, version, self.call, self.auth);

self.writer.write(id.as_bytes())?;
Expand Down
8 changes: 4 additions & 4 deletions src/frontend/assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<title>RustPager</title>
<title>UniPager</title>
<link type="text/css" rel="stylesheet" href="/style.css">
<script src="/vue.js"></script>
</head>
Expand Down Expand Up @@ -236,14 +236,14 @@ <h3>Status</h3>
</div>
<div>
<p>
<b>RustPager {{version}}</b>
<b>UniPager {{version}}</b>
</p>
<p>
&copy; 2017 RWTH Amateurfunkgruppe
</p>
<p>
<a href="https://github.com/rwth-afu/RustPager">GitHub</a>
&bull; <a href="https://github.com/rwth-afu/RustPager/issues">Report Issues</a>
<a href="https://github.com/rwth-afu/UniPager">GitHub</a>
&bull; <a href="https://github.com/rwth-afu/UniPager/issues">Report Issues</a>
&bull; <a href="https://www.afu.rwth-aachen.de/ueber-uns/spendenaufruf">Donate</a>
&bull; <a href="/pin_numbers.png" target="_blank">GPIO Pin Assigment</a>
</p>
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/assets/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var vm = new Vue({
},
onopen: function(event) {
this.connected = true;
this.log.push({msg: "Connected to RustPager."});
this.log.push({msg: "Connected to UniPager."});
this.log_scroll();
this.send("GetVersion");
this.send("GetConfig");
Expand All @@ -51,7 +51,7 @@ var vm = new Vue({
},
onclose: function(event) {
if (this.connected) {
this.log.push({msg: "Disconnected from RustPager."});
this.log.push({msg: "Disconnected from UniPager."});
this.log_scroll();
}
this.connected = false;
Expand Down
2 changes: 1 addition & 1 deletion src/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ struct Logger {
impl Log for Logger {
fn enabled(&self, metadata: &LogMetadata) -> bool {
metadata.level() <= LogLevel::Info &&
metadata.target().starts_with("rustpager")
metadata.target().starts_with("unipager")
}

fn log(&self, record: &LogRecord) {
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use frontend::{Request, Response};
use connection::Connection;

fn print_version() {
println!("RustPager {}", env!("CARGO_PKG_VERSION"));
println!("UniPager {}", env!("CARGO_PKG_VERSION"));
println!("Copyright (c) 2017 RWTH Amateurfunkgruppe\n");
println!("This program comes with ABSOLUTELY NO WARRANTY.");
println!("This is free software, and you are welcome to redistribute");
Expand Down

0 comments on commit e730fbe

Please sign in to comment.