Comments (4)
Nice 😉
from asksinanalyzerxs.
I tried to implement it within the persistentStorage.ts but since I never coded something in TypeScript I scraped the effort and took the detour via the CSV files + Python which just took a couple of minutes.
I mean there is a InfluxDB2 client available so I might give it another try when I have more time 😄
from asksinanalyzerxs.
Describe the protocol to me and the mapping you've choosen. Probably I will implement it. Tbh, I stored the data into influx for some timing using the web socket and node red.
from asksinanalyzerxs.
The mapping is a simple dictionary which replicates your CSV header one to one.
Payload and RAW should probably be optional to not bloat your TSDB.
MM = [
{
"measurement": 'Telegrams',
"tags": {
"flags": str(row["flags"]),
"type": str(row["type"]),
"fromAddr": str(row["fromAddr"]),
"toAddr": str(row["toAddr"]),
"fromName": str(row["fromName"]),
"toName": str(row["toName"]),
"fromSerial": str(row["fromSerial"]),
"toSerial": str(row["toSerial"]),
"toIsIp": str(row["toIsIp"]),
"fromIsIp": str(row["fromIsIp"]),
# "payload": str(row["payload"]),
# "raw": str(row["raw"]),
},
"fields": {
"tstamp": int(row["tstamp"]),
"date": str(row["date"]),
"rssi": int(row["rssi"]),
"len": int(row["len"]),
"cnt": int(row["cnt"]),
"dc": float(row["dc"]),
},
"time": int(row["tstamp"]),
},
]
Not sure if the translation below to JS is correct:
import {InfluxDB, Point, HttpError} from '@influxdata/influxdb-client'
import {url, token, org, bucket} from './env.mjs'
// If you use the timestamp like in your CSV file, you must tell InfluxDB to use write precision='ms' else the write fails
const writeApi = influxDB.getWriteApi(org, bucket, 'ms', writeOptions)
const point1 = new Point('Telegrams')
// Add all tags:
.tag('flags', flags.toString())
.tag('ftype', type.toString())
.tag('fromAddr', fromAddr.toString())
.tag('toAddr', toAddr.toString())
.tag('fromName', fromName.toString())
.tag('toName', toName.toString())
.tag('fromSerial', fromSerial.toString())
.tag('toSerial', toSerial.toString())
.tag('toIsIp', toIsIp.toString())
/*
not sure how to implement a clause to add the paylod and raw data if a checkpox for one or the other is checked
.tag('payload', payload.toString())
.tag('raw', raw.toString())
*/
// Add all fields
.intField('tstamp', tstamp)
.stringField('date', date)
.intField('rssi', rssi)
.intField('len', len)
.intField('cnt', cnt)
.floatField('dc', dc)
// Add the timestamp of the telegram
.timestamp(tstamp)
// write the data
writeApi.writePoint(point1)
There are lots of examples how to use the Node.js client:
https://github.com/influxdata/influxdb-client-js#usage
Write data with the InfluxDB JavaScript client library and the API Reference
from asksinanalyzerxs.
Related Issues (20)
- zusätzliche manuelle GeräteListe HOT 1
- Unable to install HOT 1
- Nach Update auf node.js 20.13.1 startet der Service nicht mehr HOT 11
- Service /usr/bin/asksin-analyzer-xs: Permission denied HOT 1
- HTTP->HTTPS Weiterleitung führt zu "Error fetching device list: 301 Moved Permanently" Fehler HOT 2
- Catch if backend CCU is specified including "http://"
- Version in Docker "latest" always: 0.0.0 HOT 1
- Small blemish in the graphical view... HOT 3
- Handle HTTP upgrade header HOT 3
- Installation on Raspberry not working HOT 9
- AskSinAnalyzerXS sometimes stopps showing/recognizing Telegrams
- Die Option "Nur bekannte Geräte anzeigen" ist wenig funktional
- Reset "Button" sollte auch die "Recent History" löschen...
- No devices showing in Analyzer HOT 2
- busware CUL
- Keinerlei Telegramme werden empfangen
- Error fetching device list: TypeError: Cannot read property 'devices' of null HOT 1
- Allow other serial device names HOT 3
- Docker: Flags nur für Homematic Aktoren
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asksinanalyzerxs.