Are sources working right?
See original GitHub issueMaybe I’m misunderstanding how sources work but I’m getting strange behaviours… First of all this is my settings file:
{
"vessel" : {
"mmsi" : "000000000",
"uuid" : "urn:mrn:imo:mmsi:000000000"
},
"pipedProviders" : [{
"pipeElements" : [{
"type" : "providers/udp",
"options" : {
"port" : "55556"
}
}, {
"type" : "providers/liner"
}, {
"type" : "providers/from_json"
}
],
"id" : "I2Csensors"
}, {
"pipeElements" : [{
"type" : "providers/udp",
"options" : {
"port" : "55557"
}
}, {
"type" : "providers/liner"
}, {
"type" : "providers/from_json"
}
],
"id" : "1Wsensors"
}
],
"interfaces" : {}
}
I have connected I2C sensors and 1W sensors to the GPIO of a raspberry 3 and all is working right. I send delta format to the providers with this format:
{
"context": "vessels.urn:mrn:imo:mmsi:000000000",
"updates": [
{
"source": {
"type": "1W",
"src": "0316013faeff"
},
"timestamp": "2016-07-28T18:18:46.074Z",
"values": [
{
"path": "propulsion.engine1.temperature",
"value": 301.837
}
]
}
]
}
This is what I’m getting in full format:
...
{"propulsion": {
"engine1": {
"temperature": {
"value": 301.837,
"$source": "1Wsensors.0316013faeff",
"timestamp": "2016-07-28T18:18:46.074Z"
}
}
}
}
...
{"environment": {
"outside": {
"pressure": {
"value": 101365.997314,
"$source": "I2Csensors.BMP180",
"timestamp": "2016-07-28T18:18:46.297Z"
},
"temperature": {
"value": 302.25,
"$source": "I2Csensors.BMP180",
"timestamp": "2016-07-28T18:18:46.297Z"
}
},
"inside": {
"humidity": {
"value": 58.1872024536,
"$source": "I2Csensors.HTU21D",
"timestamp": "2016-07-28T18:18:46.297Z"
},
"temperature": {
"value": 302.68,
"$source": "I2Csensors.HTU21D",
"timestamp": "2016-07-28T18:18:46.297Z"
}
}
}
}
...
As you can see, sources have this format:
$source:"<provider id>.<sensor id>"
$source":"1Wsensors.0316013faeff"
$source":"I2Csensors.BMP180"
$source":"I2Csensors.HTU21D"
But I would like to have only one provider in my settings file with “id” : “sensors” and to have this format in all sources:
$source:"<provider id>.<type>.<sensor id>"
$source":"sensors.1W.0316013faeff"
$source":"sensors.I2C.BMP180"
$source":"sensors.I2C.HTU21D"
According to Signal K definition, sources can contain this properties: label, type, src, pgn, sentence, talker, +any string. Being required label and type. And this is my problem, whatever I put in the delta message when I send to signal k server, only the src property affects the $source path. With the rest of properties I only get:
$source:"<provider id>.XX"
$source":"sensors.XX"
Is it possible that signalk-server-node is only working for NMEA 0183/2000 data and not for custom data?
Issue Analytics
- State:
- Created 7 years ago
- Comments:33 (30 by maintainers)
BTW you don’t necessarily need liner if you do not send the newline in the UDP message: UDP sends one datagram at a time, which in your case means one delta.
the data is all live and i have been using signalK as the central hub. Inputs and outputs though openplotter, node-red, kplex. Node-red is easy but a real system sucker on a pi but it is getting better. I could store the data but. At this point the quality of the data and reliability are more important as its main propose is to be primary navigation so the system should be resilient and fault tolerant, hardware and software. Secondary mapping and storing data Psql opensea map etc. For viewing maps/charts I use OpenCpn on 2 pi 3 via ssh or vnc via phone,linux laptop, etc. Even though there has been a few hicups in the short term the fact is i still had primary data flowing though SK. I interpreted that as resilient. SignalK Slack??? I am old and Canadian … goggle found invite… map ???