Skip to content
Snippets Groups Projects
Commit ff553e71 authored by David Hutchcroft's avatar David Hutchcroft
Browse files

Merge branch 'master' of ssh://gitlab.cern.ch:7999/hev-sw/hev-sw

parents 9523f12d c1e1c4b2
Branches
No related merge requests found
---
- hosts: hevpi
- hosts: nuliv
remote_user: pi
vars:
download_dir: /home/pi/Downloads
......@@ -33,6 +33,9 @@
- name: copy hev-display script
template: src=hev-display.sh dest={{ download_dir }} owner=pi group=pi mode=0755
- name: copy apache script
template: src=setup_apache.sh dest={{ download_dir }} owner=pi group=pi mode=0755
- name: install hev-display
command: "{{ download_dir }}/hev-display.sh"
......@@ -65,11 +68,25 @@
executable: /usr/bin/pip3
name: "{{ pip_list }}"
- name: install hev-display via apt
- name: check pi version
shell: "pinout | grep 'BCM2711'"
register: pi4
ignore_errors: True
- name: install hev-display-pi4 via apt
apt:
name: hev-display-pi4
state: present
update_cache: yes
when: pi4 is succeeded
become: yes
- name: install hev-display-pi1 via apt
apt:
name: hev-display
name: hev-display-pi1
state: present
update_cache: yes
when: pi4 is failed
become: yes
- name: link fonts for hev-display
......@@ -79,7 +96,6 @@
state: link
become: yes
- name: install hev-display systemd service
copy:
src: "{{ ansible_env.HOME }}/hev-display/extras/systemd/hev-display.service"
......@@ -87,6 +103,27 @@
remote_src: yes
become: yes
- name: mk user systemd dir
file:
path: "{{ ansible_env.HOME }}/.config/systemd/user/"
state: directory
- name: install hevserver systemd service
copy:
src: "{{ ansible_env.HOME }}/hev-sw/utils/hevserver.service"
dest: "{{ ansible_env.HOME }}/.config/systemd/user/hevserver.service"
remote_src: yes
- name: copy hev rules
copy:
src: "{{ ansible_env.HOME }}/hev-sw/utils/hev.rules"
dest: "/etc/udev/rules.d/88-hev.rules"
remote_src: yes
owner: root
group: root
mode: 0644
become: yes
#- name: enable systemd service
# systemd:
# enabled: yes
......@@ -94,9 +131,34 @@
# name: hev-display
# become: yes
#- name: enable systemd service
# systemd:
# enabled: yes
# daemon_reload: yes
# name: hevserver
# user: yes
- name: link libts
file:
src: "/usr/lib/arm-linux-gnueabihf/libts.so.0"
dest: "/usr/lib/arm-linux-gnueabihf/libts-0.0.so.0"
state: link
become: yes
- name: Adding user pi to www-data
user:
name: pi
groups: www-data
append: yes
become: yes
- name: install hevconf into apache
copy:
src: "{{ ansible_env.HOME }}/hev-sw/raspberry-backend/share/hev.conf"
dest: "/etc/apache2/sites-available/hev.conf"
remote_src: yes
become: yes
- name: setup apache
command: "{{ download_dir }}/setup_apache.sh"
become: yes
\ No newline at end of file
......@@ -21,7 +21,10 @@ rpi_swlist:
- libglib2.0-dev
- socat
- emacs
- apache2
- libapache2-mod-wsgi-py3
- python3-pyqt5
- python3-pyqtgraph
pip_list:
- libscrc
......
---
- hosts: hevpi1
- hosts: nuliv
remote_user: pi
vars:
download_dir: /home/pi/Downloads
......@@ -47,9 +47,23 @@
replace: 'url = https://gitlab.cern.ch/hev-sw/{{ item }}.git'
loop: "{{ repos }}"
- name: upgrade hev-display via apt
- name: check pi version
shell: "pinout | grep 'BCM2711'"
register: pi4
ignore_errors: True
- name: install hev-display-pi4 via apt
apt:
name: hev-display
state: latest
name: hev-display-pi4
state: present
update_cache: yes
when: pi4 is succeeded
become: yes
- name: install hev-display-pi1 via apt
apt:
name: hev-display-pi1
state: present
update_cache: yes
when: pi4 is failed
become: yes
\ No newline at end of file
#!/bin/bash
a2dismode wsgi
a2enmode wsgi
#update the locations in hev.conf if needed
#disable default location
a2dissite 000-default.conf
#enable our hev site
a2ensite hev.conf
#reload apache
sudo systemctl reload apache2
\ No newline at end of file
......@@ -229,7 +229,7 @@
var el2 = document.getElementById("path-alarm");
el2.classList.add("path-icon-alarm");
} else {
document.getElementById("alarms").innerHTML = ''
document.getElementById("alarms").innerHTML = 'No alarms'
var el = document.getElementById("alarm_ul");
el.classList.remove("alarm-red");
var el2 = document.getElementById("path-alarm");
......
......@@ -36,7 +36,7 @@
<th>Date and time</th>
<th>Alarm type</th>
<th>Alarm code</th>
<th>Acknowledgement</th>
<!-- <th>Acknowledgement</th> -->
</tr>
......@@ -81,7 +81,7 @@ function requestAlarms() {
var cell1 = row.insertCell(0);
var cell2 = row.insertCell(1);
var cell3 = row.insertCell(2);
var cell4 = row.insertCell(3);
//var cell4 = row.insertCell(3);
//cell1.innerHTML = convertTimestamp(data.created_at)
......@@ -89,7 +89,7 @@ function requestAlarms() {
console.log(data[0].timestamp);
cell2.innerHTML = data[0].alarm_type;
cell3.innerHTML = data[0].alarm_code;
cell4.innerHTML = '<button type="button" class="form-control py-2" id="ack" style="background-color:#1f4793; border-color:blue; color:white">Ack</button>';
//cell4.innerHTML = '<button type="button" class="form-control py-2" id="ack" style="background-color:#1f4793; border-color:blue; color:white">Ack</button>';
}
......@@ -131,6 +131,7 @@ document.getElementById('update_button').onclick = function(){
{% block body_scripts %}
<script>
/*
$( document ).ready($.getJSON({
url: '/last_N_alarms',
success: function(data) {
......@@ -146,6 +147,7 @@ document.getElementById('update_button').onclick = function(){
}
}
}));
*/
</script>
{% endblock %}
# Arduino uno
ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0043", ACTION=="bind", SUBSYSTEM=="usb", DRIVERS=="cdc_acm", RUN+="/bin/su -c /home/pi/hev-sw/utils/hevcheck.sh"
# NodeMCU 32s
ATTRS{idVendor}=="10C4", ATTRS{idProduct}=="EA60", ACTION=="bind", SUBSYSTEM=="usb", DRIVERS=="cdc_acm", RUN+="/bin/su -c /home/pi/hev-sw/utils/hevcheck.sh"
# Add other devices similarly. Find idVendor:idProduct from lsusb
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment