2020-01-13, 11:04 PM
Hi, after some googling and testing, it was quite easy to EspEasy to send UDp message to SignalK directly.
So I don't use MQTT or Nodered in this.
See attached images.
EspEasy:
- Setup a controller for UDP >> SignalK server
- Setup a device
In my example with temperature, I have Celsius + 273.15 =Kelvin, that SignalK is using.
Json template is:
{"updates": [{"source": "%sysname%","values":[ {"path":"environment.inside.mainCabin.%valname%","value": %value% }]}]}
Or as pretty print:
{"updates":
[
{
"source": "%sysname%",
"values":
[
{
"path":"environment.inside.mainCabin.%valname%","value": %value%
}
]
}
]
}
%sysname is the name of EspEasy.
%valname is the name of the device value sent, "temperature" as example.
%value is the actual value from the device.
A better way could be to setup PATH in device, now I need to create several UDP controllers.
{"updates": [{"source": "%sysname%","values":[ {"path":"%valname%","value": %value% }]}]} and in the device set as example "temperature" to "environment.inside.mainCabin.temperature" instead.
PATH must match something good in SignalK, avoid to create your own path if possible.
SIGNALK server:
In Signalk admin web page, make sure you ONE UDP receiver on same port as EspEasy.
Volia! ready!
So I don't use MQTT or Nodered in this.
See attached images.
EspEasy:
- Setup a controller for UDP >> SignalK server
- Setup a device
In my example with temperature, I have Celsius + 273.15 =Kelvin, that SignalK is using.
Json template is:
{"updates": [{"source": "%sysname%","values":[ {"path":"environment.inside.mainCabin.%valname%","value": %value% }]}]}
Or as pretty print:
{"updates":
[
{
"source": "%sysname%",
"values":
[
{
"path":"environment.inside.mainCabin.%valname%","value": %value%
}
]
}
]
}
%sysname is the name of EspEasy.
%valname is the name of the device value sent, "temperature" as example.
%value is the actual value from the device.
A better way could be to setup PATH in device, now I need to create several UDP controllers.
{"updates": [{"source": "%sysname%","values":[ {"path":"%valname%","value": %value% }]}]} and in the device set as example "temperature" to "environment.inside.mainCabin.temperature" instead.
PATH must match something good in SignalK, avoid to create your own path if possible.
SIGNALK server:
In Signalk admin web page, make sure you ONE UDP receiver on same port as EspEasy.
Volia! ready!