forked from community/device-mgt-plugins
Merge pull request #118 from GPrathap/IoTS-1.0.0-M1
updated startup scripts
commit
0356c51af4
@ -1,45 +1,44 @@
|
|||||||
# Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
## Copyright and license
|
||||||
# WSO2 Inc. licenses this file to you under the Apache License,
|
|
||||||
# Version 2.0 (the "License"); you may not use this file except
|
Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||||
# in compliance with the License.
|
WSO2 Inc. licenses this file to you under the Apache License,Version 2.0 (the "License"); you may not use this file except
|
||||||
# You may obtain a copy of the License at
|
in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
|
||||||
# Unless required by applicable law or agreed to in writing,
|
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
||||||
# software distributed under the License is distributed on an
|
specific language governing permissions and limitations under the License.
|
||||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
# KIND, either express or implied. See the License for the
|
|
||||||
# specific language governing permissions and limitations
|
|
||||||
# under the License.
|
|
||||||
|
|
||||||
|
|
||||||
--------------
|
--------------
|
||||||
testAgent.sh
|
testAgent.sh
|
||||||
--------------
|
--------------
|
||||||
This script is used to run this service in a testing environment. It can be run on a real Raspberry Pi device or in a
|
This script is used to run this service in a testing environment. It can be run on a real Raspberry Pi device or in a
|
||||||
virtual environment.
|
virtual environment.If this runs on a real Raspberry Pi device, you need to install [Adafruit Python DHT Sensor Library](https://github.com/adafruit/Adafruit_Python_DHT).
|
||||||
If this runs on a real Raspberry Pi device, you need to install Adafruit Python DHT Sensor Library and RPi.GPIO Python Library.To install Adafruit Python DHT Sensor Library, follow the
|
To install Adafruit Python DHT Sensor Library: follow the instructions given here https://github.com/adafruit/Adafruit_Python_DHT.
|
||||||
instructions given here https://github.com/adafruit/Adafruit_Python_DHT.
|
|
||||||
To install RPi.GPIO Python Library, sudo apt-get install rpi.gpio
|
|
||||||
|
|
||||||
To run: sudo ./testAgent.sh and follow the instructions.
|
To run: ` sudo ./testAgent.sh ` and follow the instructions.
|
||||||
|
|
||||||
-------------------
|
-------------------
|
||||||
startService.sh
|
startService.sh
|
||||||
-------------------
|
-------------------
|
||||||
After testing, this script can be used to deploy this application as a service on Raspberry Pi which will get loaded
|
After testing, this script can be used to deploy this application as a service on Raspberry Pi which will get loaded
|
||||||
during boot up process.
|
during boot up process.
|
||||||
To run: sudo ./startService.sh
|
|
||||||
Note: You should have to provide following arguments in RaspberryService.sh as shown below.
|
|
||||||
|
|
||||||
DAEMON_OPTS="-l /usr/local/src/RaspberryAgent/RaspberryStats.log -m N -i 56"
|
|
||||||
|
|
||||||
-l ----> file to write log
|
create a service:
|
||||||
-i ----> time interval between successive data pushes to the wso2 IoT Server
|
` sudo ./startService.sh `
|
||||||
-m ----> weather is going to run on the real device or not
|
|
||||||
|
get current state of the service:
|
||||||
|
` sudo service RaspberryService.sh status `
|
||||||
|
|
||||||
start service:
|
start service:
|
||||||
service /etc/init.d/RaspberryService.sh start
|
` sudo service RaspberryService.sh start `
|
||||||
|
|
||||||
stop service:
|
stop service:
|
||||||
service /etc/init.d/RaspberryService.sh stop
|
` sudo service RaspberryService.sh stop `
|
||||||
|
|
||||||
|
restart service:
|
||||||
|
` sudo service RaspberryService.sh restart `
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in new issue