Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
virtualisation:hello [2022/04/29 13:55] schmittvirtualisation:hello [2022/05/03 10:40] (current) – removed schmitt
Line 1: Line 1:
-=====Freeboard auf Alpine Container ===== 
-===1. Container auf NB2800 erstellen === 
-Navigiere zu System -> Virtualisation und aktiviere den Administrativen Status.\\ 
-Bei dem Unterpunkt Install folgende URL eingeben. https://jenkins.linuxcontainers.org/job/image-alpine/architecture=armhf,release=3.15,variant=default/lastSuccessfulBuild/artifact/rootfs.tar.xz \\ 
-Bei dem Unterpunkt Networking muss Mode auf Bridged und LAN1 als Bridge Interface eingegeben werden. \\ 
-Auf der GUI muss außerdem ein statischer Host unter dem Punkt Service->DHCP erstellt werden und unter Web-Server muss CLI.PHP aktiviert werden. 
-===2. Freeboard auf Container laden === 
-Im nächsten Schritt wird freeboard auf den Container geladen. \\ 
- [[https://github.com/Freeboard/freeboard|github]] \\ 
-Das gesamte Verzeichnis muss auf den Router unter mnt/storage0/lxc/guest0/var/www/html/freeboard geladen werden. \\ 
-Da dieses Verzeichnis möglicherweise nicht von beginn an da ist, muss mit mkdir das Verzeichnis erstellt werden.\\ 
-Das folgende kommando ist ein Beispiel: 
- scp -r freeboard root@192.168.1.1:/mnt/storage0/lxc/guest0/var/www/html 
- 
-===3. lighttpd installieren und konfigurieren === 
-Installieren sie den lighttpd server mit den folgenden Kommandos. 
- apk add lighttpd 
- rc-update add lighttpd default  
- rc-service lighttpd restart  
-Die konfig für den Web Server ist unter /etc/lighttpd/lighttpd.conf.\\ 
-Hier muss das Modul mod_proxy geladen und der Eintrag var.basedir = "/var/www/html/freeboard" eingefügt werden.  
-Unter server.document-root = var.basedir kann das htdocs entfernt werden. Desweiteren muss ein proxy Server eingefügt werden. Desweiteren wird ein Proxyserver benötigt, der die kommunikation zwischen NB2800 und Container übernimmt. 
- var.basedir  = "/var/www/html/freeboard" 
- ... 
- server.modules = ( 
- # "mod_setenv", 
- "mod_proxy", 
- # ... 
- ) 
- ... 
- server.document-root = var.basedir  
- ... 
- proxy.server = ( "cli.php" => 
-                       ( (  
-                           "host" => "192.168.1.1", 
-                           "port" => 80 
-                         ) ) 
-                     ) 
-===4. Freeboard an Router-config anpassen=== 
-In den /var/www/html/freeboard Ordner müssen die folgenden JSON Dateien geladen werden.  
- { 
- "version": 1, 
- "allow_edit": true, 
- "plugins": [], 
- "panes": [ 
- { 
- "title": "WWAN Infos - Mobile 1", 
- "width": 1, 
- "row": { 
- "2": 1, 
- "3": 1 
- }, 
- "col": { 
- "2": 1, 
- "3": 1 
- }, 
- "col_width": 1, 
- "widgets": [ 
- { 
- "type": "text_widget", 
- "settings": { 
- "title": "Network", 
- "size": "regular", 
- "value": "datasources[\"WWAN Datasource\"][\"MOBILE1\"][\"NETWORK\"]", 
- "animate": true 
- } 
- }, 
- { 
- "type": "text_widget", 
- "settings": { 
- "title": "Service Type", 
- "size": "regular", 
- "value": "datasources[\"WWAN Datasource\"][\"MOBILE1\"][\"SERVICE\"][\"TYPE\"]", 
- "animate": true 
- } 
- }, 
- { 
- "type": "text_widget", 
- "settings": { 
- "title": "Active SIM Card", 
- "size": "regular", 
- "value": "datasources[\"WWAN Datasource\"][\"MOBILE1\"][\"SIM\"][\"0\"]", 
- "animate": true 
- } 
- }, 
- { 
- "type": "gauge", 
- "settings": { 
- "title": "Signal Level (RSSI)", 
- "value": "datasources[\"WWAN Datasource\"][\"MOBILE1\"][\"SIGNAL\"][\"RSSI\"]", 
- "min_value": -100, 
- "max_value": 0 
- } 
- } 
- ] 
- }, 
- { 
- "title": "WWAN Infos - Mobile 2", 
- "width": 1, 
- "row": { 
- "2": 1, 
- "3": 1 
- }, 
- "col": { 
- "2": 2, 
- "3": 3 
- }, 
- "col_width": 1, 
- "widgets": [ 
- { 
- "type": "text_widget", 
- "settings": { 
- "title": "Network", 
- "size": "regular", 
- "value": "datasources[\"WWAN Datasource\"][\"MOBILE2\"][\"NETWORK\"]", 
- "animate": true 
- } 
- }, 
- { 
- "type": "text_widget", 
- "settings": { 
- "title": "Service Type", 
- "size": "regular", 
- "value": "datasources[\"WWAN Datasource\"][\"MOBILE2\"][\"SERVICE\"][\"TYPE\"]", 
- "animate": true 
- } 
- }, 
- { 
- "type": "text_widget", 
- "settings": { 
- "title": "Active SIM Card", 
- "size": "regular", 
- "value": "datasources[\"WWAN Datasource\"][\"MOBILE2\"][\"SIM\"][\"0\"]", 
- "animate": true 
- } 
- }, 
- { 
- "type": "gauge", 
- "settings": { 
- "title": "Signal Level (RSSI)", 
- "value": "datasources[\"WWAN Datasource\"][\"MOBILE2\"][\"SIGNAL\"][\"RSSI\"]", 
- "min_value": -100, 
- "max_value": 0 
- } 
- } 
- ] 
- }, 
- { 
- "width": 1, 
- "row": { 
- "2": 13, 
- "3": 1 
- }, 
- "col": { 
- "2": 1, 
- "3": 2 
- }, 
- "col_width": 1, 
- "widgets": [ 
- { 
- "type": "text_widget", 
- "settings": { 
- "title": "WAN Hotlink", 
- "size": "regular", 
- "value": "datasources[\"WAN Datasource\"][\"WAN\"][\"HOTLINK\"]", 
- "animate": true 
- } 
- }, 
- { 
- "type": "actuator", 
- "settings": { 
- "title": "", 
- "value": "", 
- "urlOn": "http://**192.168.1.1**/cli.php?version=2&output=json&**usr=admin&pwd=admin01**&command=set&arg0=custom.var0&arg1=WANLINK3\t", 
- "urlOff": "http://**192.168.1.1**/cli.php?version=2&output=json&**usr=admin&pwd=admin01**&command=set&arg0=custom.var0&arg1=WANLINK4\t", 
- "on_text": "Switch Mobile Connection", 
- "off_text": "Switch Mobile Connection" 
- } 
- } 
- ] 
- } 
- ], 
- "datasources": [ 
- { 
- "name": "WWAN Datasource", 
- "type": "JSON", 
- "settings": { 
- "url": "http://**192.168.1.1**/cli.php?version=2&output=json&**usr=admin&pwd=admin**01&command=status&arg0=-s&arg1=wwan\t", 
- "use_thingproxy": true, 
- "refresh": 5, 
- "method": "GET", 
- "name": "WWAN Datasource" 
- } 
- }, 
- { 
- "name": "WAN Datasource", 
- "type": "JSON", 
- "settings": { 
- "url": "http://**192.168.1.1**/cli.php?version=2&output=json&**usr=admin&pwd=admin01**&command=status&arg0=-s&arg1=wan\t", 
- "use_thingproxy": true, 
- "refresh": 5, 
- "method": "GET" 
- } 
- } 
- ], 
- "columns": 3 
- } 
- 
-Die dick markierten IP Adressen, username und passwort, müssen die gleichen sein wie sie vom DHCP Server vergeben wurden.  
- scp db.json root@192.168.1.1:/mnt/storage0/lxc/guest0/var/www/html/freeboard 
- scp actuator.js root@192.168.1.1:/mnt/storage0/lxc/guest0/var/www/html/freeboard 
-Hier müssen auch noch mit  
- chmod 744 db.json 
- chmod 744 db.js 
-die Rechte für beide geändert werden. 
-Diese muss an die Konfiguration des Routers angepasst werden. actuator.js muss bei index.html head.js eingefügt werden. 
- head.js("js/freeboard_plugins.min.js","actuator.js", 
- 
-Die actuator.js kann [[https://github.com/onlinux/freeboard-plugins|hier]] geholt werden. 
-===5. SDK-Skript anpassen und erstellen=== 
- oldlink = ""; 
- while (1){ 
- priolink = nb_config_get("custom.var0"); 
- if(priolink != oldlink){ 
- oldlink = priolink; 
- nb_wanlink_priorize(sprintf("%s",priolink), 4); 
- } 
- sleep(5); 
- } 
-Das SDK-Skript mobile-link.are muss bei der funktion nb_wanlink_priorize(sprintf("%s",priolink),2); an die Konfiguration des Routers angepasst werden.\\ 
-===6. Image ===