Read-only mirror of https://github.com/SchweizerischeBundesbahnen/cimon_setup — SBB. Issues & pull requests at the source.
  • Shell 96.4%
  • Python 3.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2020-09-14 09:22:48 +02:00
autoupdate fix: use send_mail everywhere and do not set default gateway in dhcpd conf 2020-02-23 15:06:42 +01:00
controller feature: stop if no logging, check every hour 2020-09-10 11:37:35 +02:00
freesbb fix: set the wpa country 2020-02-23 20:48:24 +01:00
monitoring fix: mail address and no update for disable screensleep 2020-02-25 18:26:41 +01:00
update_config fix: use send_mail everywhere and do not set default gateway in dhcpd conf 2020-02-23 15:06:42 +01:00
web exporting display so cron can start browser; better help suggestion on failing auto-enabling of WIFI 2020-09-10 16:33:17 +02:00
.gitattributes Added Gitattributes and Gitignore 2016-06-20 23:45:56 +02:00
.gitignore Added Gitattributes and Gitignore 2016-06-20 23:45:56 +02:00
cimon_setup.iml patching openssl SECLEVEL from 2 to 1 2019-07-03 14:19:53 +02:00
create_cimon_dir.sh Unified and externalised the creation of /opt/cimon 2016-07-26 00:48:17 +02:00
force_hdmi_on.sh force hdmi output on; disable screen and power saver 2020-09-10 14:54:51 +02:00
LICENSE Initial commit 2016-06-20 22:44:23 +02:00
patch_ssl_config.sh patching openssl SECLEVEL from 2 to 1 2019-07-03 14:19:53 +02:00
readme.md deploy web and browser 2016-09-27 21:52:27 +02:00
set_hostname.sh starting ssh daemon 2019-07-03 16:34:00 +02:00
setup.sh Merge branch 'master' of https://github.com/SchweizerischeBundesbahnen/cimon_setup into feature/switch-to-lighttpd 2020-09-10 14:59:38 +02:00
setup_autoupdate.sh copy to temp 2016-08-07 23:39:31 +02:00
setup_base.sh fix: use dist upgrade, improve mail script 2020-02-12 23:26:28 +01:00
setup_controller.sh feat: setup hue and disable screensleep 2020-02-12 20:59:04 +01:00
setup_email.sh minor fixes and improved logging 2016-08-07 03:39:24 +02:00
setup_freesbb.sh auto-enable of WIFI works without ugly workaround 2020-09-10 16:51:02 +02:00
setup_monitoring.sh Fixed some issues with setup and send mail if diskspace is full 2016-08-30 00:04:10 +02:00
setup_ssh.sh starting ssh daemon 2019-07-03 16:34:00 +02:00
setup_update_config.sh Fixed some issues with setup and send mail if diskspace is full 2016-08-30 00:04:10 +02:00
setup_web.sh replaced apache with lightttp; installing cimon_web2 2020-09-10 12:43:02 +02:00
update.sh fix install screensleep on update 2020-09-14 09:21:43 +02:00

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.