diff --git a/modules/bus.js b/modules/bus.js index 10950e3f895253daa69b191efe51fcff9caaedb2..6361ced808a55ebe79c7365748b86d680dea86f4 100644 --- a/modules/bus.js +++ b/modules/bus.js @@ -26,7 +26,10 @@ function pad(n, width, z) { function fetchData(stop, cb) { url = "http://mobil.efa.de/mobile3/XSLT_DM_REQUEST?outputFormat=XML&useAllStops=1&useRealtime=1&maxAssignedStops=1&itOptionsActive=1&trITMOTvalue100=5&itdLPxx_dest=&sessionID=0&language=en&locationServerActive=1&mode=direct&limit=60&itdLPxx_script=true&type_dm=stop&placeInfo_dm="+CITY+"&name_dm="+stop; httpreq.get(url, {binary: true}, function (err, res) { - cb(XML.parse(iconv.decode(res.body, 'latin1'))); + try { + cb(XML.parse(iconv.decode(res.body, 'latin1'))); + } catch(e) { + } }); } diff --git a/s0infodisplay.service b/s0infodisplay.service new file mode 100644 index 0000000000000000000000000000000000000000..90f30508f24a9375049ce4db486651cf9b1f64e3 --- /dev/null +++ b/s0infodisplay.service @@ -0,0 +1,13 @@ +[Unit] +Description=A Infopoint Display that shows HTML pages in fullscreen +Requires=network.target + +[Service] +ExecStart=/bin/sh -c 'cd /home/pi/s0infodisplay; node main.js' +Restart=always +RestartSec=5 +User=1000 +Group=1000 + +[Install] +WantedBy=multi-user.target infopoint-html.service