summaryrefslogtreecommitdiff
path: root/INSTALL_raspbian.md
blob: cb905f1dccfdea0b06eefcf48aa7ec7be1fabf15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
Copyright (C) 2014-2016, Jaguar Land Rover

This document is licensed under Creative Commons
Attribution-ShareAlike 4.0 International.

**Version 0.5.1**

# INSTALLATION OF RVI (RASPBIAN) #

This document describes the installation process for the RVI project 
on Raspbian. Packages are also available for 
[Ubuntu](INSTALL_ubuntu.md) and [Raspbian](INSTALL_raspbian.md). 
See ```BUILD.md``` for building from source.

Please see ```README.md``` for a general description of the project
and its structure.

Please see ```CONFIGURE.md``` for details on configuring and launching
the system once it has been built.

The first milestone of the RVI project is the HVAC demo. Please see
```hvac_demo/README.md``` for details on how to setup, launch and
drive the demo.

# READER ASSUMPTIONS #
In order to build the system, the reader is assumed to be able to:

1. Have a basic understanding of Linux system operations.
2. Install packages on the system.

Please note that the configuration process described in
```CONFIGURE.md``` may have additional skill requirements.

# PREREQUISITES #

1. The Raspbian system has the latest updates installed.
2. The user has sudo access to install packages.
3. There is at least 5GB of space availabled for packages and code.

----

# INSTALLATION PROCESS #

## GET RASPBIAN PACKAGES ##

Download the Raspbian package from https://github.com/PDXostc/rvi_core/releases. Then extract the tarball to get packages for Erlang and RVI, as well as an install script.

## INSTALL ERLANG AND RVI ##

Make the install script executable:

    sudo chmod +x installRVI

Then run the install script:

    ./installRVI

This does the following:

1. Extracts the Erlang tarball
2. Installs the required Erlang packages
  * `erlang-base`
  * `erlang-asnl`
  * `erlang-crypto`
  * `erlang-eunit`
  * `erlang-public key`
  * `erlang-ssl`
  * `erlang-syntax-tools`
3. Installs other dependencies (`bluez` and `python-jsonrpclib`)
4. Installs `rvi`
5. Starts `rvi` via `systemctl`
6. Checks the status of `rvi` via `systemctl`.

----

## TEST THE RVI SYSTEM ##

To confirm that RVI has started, use `systemctl` as root user:

    systemctl status rvi

Expected output:

    ● rvi.service - Remote Vehicle Interaction Service
       Loaded: loaded (/lib/systemd/system/rvi.service; disabled)
       Active: active (running) since Tue 2016-02-23 18:30:03 UTC; 48ms ago
      Process: 6049 ExecStart=/usr/bin/rvi_ctl -c /etc/rvi/rvi.config start (code=exited, status=0/SUCCESS)
     Main PID: 6081 (run_erl)
       CGroup: /system.slice/rvi.service
               ├─6081 run_erl -daemon /tmp/rvi_6049/ /var/log/rvi exec erl -boot /tmp/rvi_6049/rvi/start -sname rvi -config /tmp/rvi_6049/rvi/sys -setcookie rvi_cookie
               ├─6084 /usr/lib/erlang/erts-7.2/bin/erlexec -boot /tmp/rvi_6049/rvi/start -sname rvi -config /tmp/rvi_6049/rvi/sys -setcookie rvi_cookie
           ├─6093 sh -c "/usr/lib/erlang/erts-7.2/bin/epmd" -daemon
               └─6094 /usr/lib/erlang/erts-7.2/bin/epmd -daemon


## GET STARTED WITH SERVICES ##

Find out which services are registered through `rvi_get_services`:

    /usr/lib/rvi_core/rvi_get_services

The command should return no output, since we have not registered any services yet.

Register a service by calling `rvi_service` -- start with "hello":

    /usr/lib/rvi_core/rvi_service hello

Expected output:

    RVI General Service.
    RVI node URL:         http://localhost:9001
    Service:              genivi.org/vin/default_vin/hello
    Press enter to quit: 

In another terminal, call `rvi_get_services` again to see the newly registered service:

    genivi.org/vin/default_vin/hello

Invoke the service through `rvi_call` and the full service name:

    /usr/lib/rvi_core/rvi_call genivi.org/vin/default_vin/hello

In terminal 1 (where you called `rvi_service`), you should see the following output:

    Service invoked!
    args: {}

In terminal 2 (where you called `rvi_call`), you should see the following output:

    RVI Node:          http://localhost:9001
    Service:           genivi.org/vin/default_vin/hello
    args:              {}

You can pass arguments to a service call with the format name=value:

    /usr/lib/rvi_core/rvi_call genivi.org/vin/default_vin/hello \
    a=b message=hello

## CREATE A RELEASE ##

The installer configures a release with default (insecure) values.

See ```CONFIGURE.md``` for details on configuring and creating a
developer and production release that can be launched.