diff --git a/services/pixljs_alert/pixljs_ble.js b/services/pixljs_alert/pixljs_ble.js index dbd99ae..3c75abe 100644 --- a/services/pixljs_alert/pixljs_ble.js +++ b/services/pixljs_alert/pixljs_ble.js @@ -53,7 +53,6 @@ Graphics.prototype.setFontPixeloidSans = function(scale) { ); }; g.setFontPixeloidSans(1); -require("FontDennis8").add(Graphics); NRF.on('connect', function(addr) { // Update this property when connected in bluetooth @@ -125,6 +124,13 @@ function switchStateInstall(newMode) { repeat: false, debounce: 10 }); + if (timeout_reset > 0) { + try { + clearTimeout(timeout_reset); + } catch (e) { + //ignore + } + } } installScreen(); if (mode) { @@ -197,14 +203,13 @@ function questionBDrawScreen() { function installScreen() { if (mode == 1) { g.clear(); - g.setFont("Dennis8"); g.setFontAlign(0.5, -1); let text = "Installation mode\nPixl.js " + NRF.getAddress().substr(12, 5).replace(":", "")+"\n"; let diff = Date().valueOf() - lastSeen.valueOf(); if (diff > TIMEOUT_RPI) { text += "No Rpi Connection"; } else { - text += "Vu il y a " + parseInt(diff / 1000) + " secondes\nRSSI: " + rssi + " dB (" + rssiPowerHint() + ")"; + text += parseInt(diff / 1000) + " s à " + rssi + " dB (" + rssiPowerHint() + ")"; } let t = g.stringMetrics(text); g.drawString(text, g.getWidth() / 2, 0); @@ -418,7 +423,6 @@ function installResetTimeout() { function screenQuestionA() { installResetTimeout(); - g.setFontPixeloidSans(1); mode = 2; currentForm = []; Pixl.setLCDPower(true); @@ -490,7 +494,6 @@ function screenIdle() { Pixl.setLCDPower(true); LED.write(1); g.clear(); - g.setFontPixeloidSans(1); g.setFontAlign(1, -1); g.drawString("Un passage m'a gêné>\naccéder au questionnaire", g.getWidth(), 0); g.setFontAlign(1, 1); diff --git a/services/pixljs_alert/zero_ble.py b/services/pixljs_alert/zero_ble.py index b96f4eb..4af0136 100644 --- a/services/pixljs_alert/zero_ble.py +++ b/services/pixljs_alert/zero_ble.py @@ -99,9 +99,9 @@ def get_rpi_status(): break with GPSDClient() as client: for result in client.dict_stream(convert_datetime=True, filter=["TPV"]): - gpdsdout = "%.5s %.5s" % (result.get("lat", "n/a"), result.get("lon", "n/a")) + gpdsdout = "%.7s %.7s" % (result.get("lat", "n/a"), result.get("lon", "n/a")) break - rpi_status = "Mic: %.25s\\nVpn: %.25s\\nBat: %.25s\\nGps: %.25s" % (mic, vpn, battery, gpdsdout) + rpi_status = "Mic: %.20s\\nVpn: %.20s\\nBat: %.20s\\nGps: %.20s" % (mic, vpn, battery, gpdsdout) return rpi_status.encode("iso-8859-1")