- Shell 96.4%
- Python 3.6%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| autoupdate | ||
| controller | ||
| freesbb | ||
| monitoring | ||
| update_config | ||
| web | ||
| .gitattributes | ||
| .gitignore | ||
| cimon_setup.iml | ||
| create_cimon_dir.sh | ||
| force_hdmi_on.sh | ||
| LICENSE | ||
| patch_ssl_config.sh | ||
| readme.md | ||
| set_hostname.sh | ||
| setup.sh | ||
| setup_autoupdate.sh | ||
| setup_base.sh | ||
| setup_controller.sh | ||
| setup_email.sh | ||
| setup_freesbb.sh | ||
| setup_monitoring.sh | ||
| setup_ssh.sh | ||
| setup_update_config.sh | ||
| setup_web.sh | ||
| update.sh | ||
f# Cimon scripts Copyright (C) Schweizerische Bundesbahnen SBB 2016, Apache Licence 2.0. Author: Florian Seidl (Github: florianseidl)
Setup the cimon device, start/stop scripts, auto update and so on. Tested on Raspberry Pi 3.
Recomended usage with USB Stick (setup)
On Host machine (Windows)
git clone https://github.com/SchweizerischeBundesbahnen/cimon_setup.git
cd cimon_setup\usb_stick
pack_usb_stick.bat
On Host machine (Linux)
git clone https://github.com/SchweizerischeBundesbahnen/cimon_setup.git
cd cimon_setup/usb_stick
./pack_usb_stick.sh
On Raspberry Pi
-
Setup keyboard
-
Run the script on the memory stick
cd /media/pi/<usb_stick>
install with minimum recomended parameters/features
bash ./start_setup.sh -n -p -e -t -g
installs from master. if you want to install from another branch (for instance develop) set the -b parameter
bash ./start_setup.sh [...] -b
if you need freesbb set the -f parameter
bash ./start_setup.sh [...] -f
if you need the web gui set the -w parameter
bash ./start_setup.sh [...] -w
Prerequisites
-
Setup Keyboard (Keyboard: "Menu->Preferences->Rasberry Pi Configuration") if required (default is UK)
-
Make sure the Raspberry Pi is connected to an network with unblocked access to the internet ** If you need the FreeSBB WLAN as a prerequiste, checkout this repository and
on host computer
cp -r cimon_setup/freesbb cp cimon_setup/setup_freesbb.sh
setup freesbb WLAN
cd /media/pi/ ./setup_freesbb.sh
-
If passwords in the config are encrypted, copy the config key (binary file, 32 bit) into the cimon directory in your home directory. For instance put them onto the memory stick too.
cd /media/pi//
if freesbb WLAN is required
cp /media/pi//key.bin ~/cimon/key.bin
Clone this repository
mkdir /tmp/cimon_github
cd /tmp/cimon_github
# per default use master branch
git clone https://github.com/SchweizerischeBundesbahnen/cimon_setup.git -b master
# alternatively, if you want ot use another branch, for instance develop, start with
git clone https://github.com/SchweizerischeBundesbahnen/cimon_setup.git -b develop
set_hostname.sh: Set a meaningfull hostname
Per default all raspberries have the same hostname. Set something usefull.
cd /tmp/cimon_github/cimon_setup
./set_hostname.sh <hostname>
you have to reboot after using this script
setup.sh: Setup raspberry and install controller, drivers and chromium
setup.sh will upgrade all packages and install:
- python3.4-dev
- dos2unix
- raspi-config
- clewarecontrol (for the Cleware USB traffic light)
- sispmctl (for the Energenie power socket)
- chromium browser
- cimon controller scripts (including start/stop script and cronjob for supervision) - see https://github.com/SchweizerischeBundesbahnen/cimon_controller repository
- autoupdate for cimon (cimon_setup and cimon_controller directly from GIT master branch)
It will also set the timezone to Zurich
# setup script
cd /tmp/cimon_github/cimon_setup
./setup.sh
-
Configure the CIMON Controller ** if you dont use the mydrive remote configuration, open your mydrive and edit the config file at config//cimon.yaml. You can add plugins (collectors and output) within config//plugins ** If you set up locally on the Raspberry Pi (recomended: use setup_update_config.sh and update the config via mydrive.ch)
configure Jenkins Views, Ouput devices,...
vi ~/cimon.yaml
setup_freesbb.sh: Setup FreeSBB WLAN Access
The configuration for FreeSBB WLAN with a Python Script to handle autoconnect as long as SMS-Registration is valid (using a request to search.ch). This check is configured to occur every 2 minutes per default, edit /etc/cron.d/freesbb to change. Setup using
# setup freesbb WLAN
cd /tmp/cimon_github/cimon_setup
./setup_freesbb.sh
setup_update_config.sh: Update the config
Update the configuration via github.
Prerequisite: you need to have set a meaningfull, unique hostname.
-
Will create a branch config/ if it does not exist yet and geht the config from this branch.
-
Will write, add commit and push a file "address.txt" to the repo
-
Will move a tag "configured_" whenever a configuration has been deployed
setup update config via github
cd /tmp/cimon_github/cimon_setup ./setup_update_config.sh
update.sh: Autoupdate entrance point
The git Autoupdate will clone this repository (cimon_setup) and call update.sh.