diff --git a/grafana/dashboards/SustronicsPliot3_3.json b/grafana/dashboards/SustronicsPliot3_3.json index 459e54c54d22fe7fa1f3bd038d92aebd1ad397b5..e671470c1ac149cda2f33ab1b6e60367ef291018 100644 --- a/grafana/dashboards/SustronicsPliot3_3.json +++ b/grafana/dashboards/SustronicsPliot3_3.json @@ -32,7 +32,7 @@ }, "id": 8, "panels": [], - "title": "Real-time measurment", + "title": "Real-time measurment - pH", "type": "row" }, { @@ -353,37 +353,76 @@ "overrides": [] }, "gridPos": { - "h": 9, + "h": 10, "w": 24, "x": 0, "y": 11 }, - "id": 4, + "id": 15, "options": { - "alertThreshold": true, - "legend": { - "calcs": [ - "mean", - "lastNotNull", - "max", - "min" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true + "allData": {}, + "config": {}, + "data": [], + "imgFormat": "png", + "layout": { + "font": { + "family": "Inter, Helvetica, Arial, sans-serif" + }, + "legend": { + "orientation": "h" + }, + "margin": { + "b": 0, + "l": 0, + "r": 0, + "t": 0 + }, + "title": { + "automargin": true + }, + "xaxis": { + "automargin": true, + "autorange": true, + "tickmode": "auto", + "type": "date" + }, + "yaxis": { + "automargin": true, + "autorange": false, + "range": [ + -2, + 12 + ], + "tickmode": "auto", + "tickvals": [ + 0, + 0.1, + 0.2, + 0.3, + 0.4, + 0.5, + 0.6, + 0.7, + 0.8, + 0.9, + 1 + ], + "type": "linear" + } }, - "tooltip": { - "mode": "multi", - "sort": "asc" - } + "onclick": "// Event handling\n/*\n// 'data', 'variables', 'options', 'utils', and 'event' are passed as arguments\n\ntry {\n const { type: eventType, data: eventData } = event;\n const { timeZone, dayjs, locationService, getTemplateSrv } = utils;\n\n switch (eventType) {\n case 'click':\n console.log('Click event:', eventData.points);\n break;\n case 'select':\n console.log('Selection event:', eventData.range);\n break;\n case 'zoom':\n console.log('Zoom event:', eventData);\n break;\n default:\n console.log('Unhandled event type:', eventType, eventData);\n }\n\n console.log('Current time zone:', timeZone);\n console.log('From time:', dayjs(variables.__from).format());\n console.log('To time:', dayjs(variables.__to).format());\n\n // Example of using locationService\n // locationService.partial({ 'var-example': 'test' }, true);\n\n} catch (error) {\n console.error('Error in onclick handler:', error);\n}\n*/\n ", + "resScale": 2, + "script": "//console.log(data)\nfunction polynominalValue(coefs, arg) {\n let val = 0;\n let pow = 0;\n for (const coef of coefs) {\n val += coef * Math.pow(arg, pow);\n pow += 1;\n }\n return val;\n}\n\n// Retrieve polynomial coefficients\nlet pHCoefficient = variables.pH_coefs;\nlet coefs = pHCoefficient.current.text.split(';').map(parseFloat).reverse();\n\n// Predefined colors for series\nconst colors = [\"#DD9040\", \"#407DDD\", \"#40DD72\", \"#DD40A6\", \"#DDBB40\", \"#40C8DD\"];\n\n// Prepare data for each series\nlet seriesData = [];\n\nfor (let i = 0; i < data.series.length; i++) {\n let series = data.series[i];\n let x = series.fields[0].values; // X-axis values (time)\n let v = series.fields[1].values; // Input values (Y-axis raw data)\n let y = [];\n\n // Calculate Y values using the polynomial function\n for (const element of v) {\n y.push(polynominalValue(coefs, element));\n }\n\n // Determine color for this series\n let color = colors[i % colors.length];\n\n // Add the processed data of this series to the result\n seriesData.push({\n x: x,\n y: y,\n type: 'scatter',\n mode: \"lines+markers\",\n line: {\n color: color\n },\n marker: {\n symbol: \"x\",\n color: color,\n size: 8\n },\n name: `${series.name}` // Unique name for each series\n });\n}\n\n// Return data and layout configuration for the plot\nreturn {\n data: seriesData,\n layout: {\n xaxis: {\n title: 'Time',\n type: 'date',\n tickformat: '%H:%M:%S'\n },\n yaxis: { title: 'pH [ ]'}\n }\n};\n", + "syncTimeRange": false, + "timeCol": "" }, - "pluginVersion": "11.4.0-208376", + "pluginVersion": "1.8.1", "targets": [ { - "alias": "Temp@ROUnit_$tag_beacon_t", + "alias": "pH@ROUnit_$tag_beacon_t", "datasource": { "type": "influxdb", - "uid": "xNdqUIZHz" + "uid": "P951FEA4DE68E13C5" }, "groupBy": [ { @@ -397,18 +436,26 @@ "beacon_t::tag" ], "type": "tag" + }, + { + "params": [ + "none" + ], + "type": "fill" } ], "measurement": "sustronics", "orderByTime": "ASC", "policy": "default", + "query": "SELECT * FROM /^$Temp_coeff_A$/", + "rawQuery": false, "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ - "temp" + "pH" ], "type": "field" }, @@ -427,8 +474,13 @@ ] } ], +<<<<<<< HEAD "title": "Temperature@ADC", "type": "timeseries" +======= + "title": "pH history", + "type": "nline-plotlyjs-panel" +>>>>>>> bea82a1 (Fix dhasboard) }, { "datasource": { @@ -495,7 +547,11 @@ "h": 11, "w": 24, "x": 0, +<<<<<<< HEAD "y": 20 +======= + "y": 11 +>>>>>>> bea82a1 (Fix dhasboard) }, "id": 2, "options": { @@ -516,7 +572,7 @@ "sort": "desc" } }, - "pluginVersion": "11.4.0-208376", + "pluginVersion": "11.4.0-208313", "targets": [ { "alias": "pH@ROUnit_$tag_beacon_t", @@ -577,9 +633,16 @@ "type": "timeseries" }, { - "collapsed": false, + "datasource": { + "type": "influxdb", + "uid": "P951FEA4DE68E13C5" + }, + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, "gridPos": { - "h": 1, + "h": 10, "w": 24, "x": 0, "y": 31 @@ -808,7 +871,7 @@ "h": 1, "w": 24, "x": 0, - "y": 42 + "y": 33 }, "id": 9, "panels": [ @@ -906,7 +969,7 @@ "h": 1, "w": 24, "x": 0, - "y": 43 + "y": 34 }, "id": 16, "panels": [ @@ -1009,9 +1072,13 @@ }, { "current": { - "text": "All", + "text": [ + "c00000000104", + "c00000000103" + ], "value": [ - "$__all" + "c00000000104", + "c00000000103" ] }, "definition": "select DISTINCT(\"beacon_t\") from (select \"rssi\",\"beacon_t\" from sustronics WHERE $timeFilter)", @@ -1077,7 +1144,7 @@ "value": "30s" }, { - "selected": false, + "selected": true, "text": "1m", "value": "1m" }, diff --git a/grafana/dashboards/notatki.txt b/notatki.txt similarity index 58% rename from grafana/dashboards/notatki.txt rename to notatki.txt index d7d2669a6110c6dc1a5b493a1f75b713dfe5c298..71a2c786a55e4b0de0563f86453a67bf17719689 100644 --- a/grafana/dashboards/notatki.txt +++ b/notatki.txt @@ -30,8 +30,10 @@ sudo usermod -aG docker $USER udev: https://chatgpt.com/share/67391794-d3ec-8010-8009-c5e0ece43d31 -ACTION=="add", SUBSYSTEM=="tty", ATTRS{idVendor}=="1915", ATTRS{idProduct}=="520f", SYMLINK+="ttyMyDevice" -SUBSYSTEM=="tty", ATTRS{idVendor}=="1915", ATTRS{idProduct}=="520f", ACTION=="add", RUN+="/bin/su pi -c /home/pi/test.sh" +pi@sustronicsRPI3:~ $ sudo cat /etc/udev/rules.d/99-sustronics.rules +SUBSYSTEM=="tty", ATTRS{idVendor}=="1915", ATTRS{idProduct}=="520f", ACTION=="add", RUN+="/bin/su pi -c '/home/pi/Sustronics/suspilot3_3/serial_to_mqtt_bridge/udev_trigger.sh'" + +SUBSYSTEM=="tty", ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1025", ACTION=="add", RUN+="/bin/su pi -c '/home/pi/Sustronics/suspilot3_3/serial_to_mqtt_bridge/udev_trigger.sh'" pi@sustronicsRPI:~ $ cat test.sh @@ -73,4 +75,43 @@ try: if line: print(line) except Exception as e: - print(f"Error: {e}") \ No newline at end of file + print(f"Error: {e}") + + + + + Problem z MTU wireguard: + https://unix.stackexchange.com/questions/722954/ssh-stuck-at-expecting-ssh2-msg-kex-ecdh-reply + +Problem z modem roaming + + AT+CGDCONT=1,"IPV4V6","internet" + AT+CGDCONT=6,"IPV4V6","internet" + +https://wimsworld.wordpress.com/2022/07/16/more-networking-with-sim7600g-h-4g-hat-b-for-raspberry-pi/ +AT!IMPREF? + + + + +Problem z modem LTE: https://unix.stackexchange.com/questions/379213/modem-manager-set-bearer-and-connect-automatically +https://johnofleek.github.io/PiloT/docs/networkManagerDocs/udev_modemManager_notes.html +sudo mmcli -m 0 +mmcli --modem=0 --enable +sudo mmcli -m 0 --simple-connect="apn=internet" + +mmcli --modem 0 --messaging-list-sms +mmcli --modem 0 --sms 0 + +test IP: +curl icanhazip.com + + +DEVNAME=/dev/ttyACM0 ID_SERIAL_SHORT='0' . /home/pi/Sustronics/suspilot3_3/serial_to_mqtt_bridge/udev_trigger.sh + + + +iptables -t nat -A PREROUTING -p tcp -d 192.168.49.32 --dport 4000 -j DNAT --to-destination 192.168.34.10:3000 + + +