This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MQTT data manipulation
#11
(2019-05-13, 07:53 PM)KKempeneers Wrote: Hi,

I guess that once the data is received using MQTT and is directed to the correct SignalK key SK just knows to interpret incoming data as a number. It gets a unit and all.

Think the unit comes from the signalk key, the diagnostic display just shows whatever is coming in, text or a number >

[Image: ZnL2ZnV.png]
Reply
#12
(2019-05-14, 05:52 AM)tkurki Wrote:
Quote:Should i send it to port 3000 or to 10110 ?

Port 3000 is http/ws and port 10110 NMEA0183 over tcp, so neither.

You need to configure your SK server to accept Signal K over UDP:
/admin/#/serverConfiguration/providers => Add
- Input Type: Signal K
- Signal K Source: UDP
- Port: <your choice>

and then either send directly to the IP of your server or the broadcast address of your local network.

FWIW I think sending SK directly is better than using MQTT: less processing (no MQTT server just shoveling data along), easier to debug (nc -lu <yourport> to see what you are receiving, no extra components between your sender and SK server).

As for KIP not showing the value: is there anything in your browser's log? Do you see the data in /signalk/v1/api/self/? If all else fails you an contact Kip author via Github.

Hi again ...

I wrote a quick python program to give me simulated data and send it over UDP to my openplotter RPI, the Pi receives the data at the selected port (nc -lu). But the data does not show up in SK diagnostic. If i send simulated data from within SK node server it does show up. And I can use that data from within KIP. 

Long story short ... I must be doing something wrong with the JSON datastructure delta message ... I'll do further fiddling tonight.

Koen.
Reply
#13
(2019-05-14, 10:20 AM)KKempeneers Wrote: Hi again ...

I wrote a quick python program to give me simulated data and send it over UDP to my openplotter RPI, the Pi receives the data at the selected port (nc -lu). But the data does not show up in SK diagnostic.

Sounds like maybe signalk hasn't a connection set to that udp port? 

I get
"pi@openplotter:~ $ nc -lu 55561

nc: Address already in use"  with signalk listening on that port .


[Image: pdjDJYr.png]
Reply
#14
Hi all,

The eagle has landed ... being an EE engineer I should have cached that the server wasn't listening.  Rolleyes

When I came home today the first thing I did was to change the port to one that was allready defined, I took 55558 (OPnotifications) and the magic happened.

    .

Also the topic now shows up in KIP ...

   

Thanks a lot guys. I would however still would like to know;
  • How come SRC is not set in diagnostic signal K input
  • Should the first UDP packet be a full model? 
  • How do I transmit alarms (oilPressure, overheat, charging, ... )
Reply
#15
(2019-05-14, 05:42 PM)KKempeneers Wrote: Hi all,

The eagle has landed ... being an EE engineer I should have cached that the server wasn't listening.  Rolleyes

When I came home today the first thing I did was to change the port to one that was allready defined, I took 55558 (OPnotifications) and the magic happened.

.
......
Hi, I can send you an example of UDP package I have sent from EspEasy to Openplotter via UDP. In the delta message, you also need to set source simply.
And no, you only need to send delta as far as I have seen.
See also manual for SignalK, go down to delta:
http://signalk.org/specification/1.0.0/d...model.html
Example from manual (for vessel, use vessel.self instead):

Code:
{
 "context": "vessels.urn:mrn:imo:mmsi:234567890",
 "updates": [{
   "source": {
     "label": "N2000-01",
     "type": "NMEA2000",
     "src": "017",
     "pgn": 127488
   },
   "timestamp": "2010-01-07T07:18:44Z",
   "values": [{
     "path": "propulsion.0.revolutions",
     "value": 16.341667
   }, {
     "path": "propulsion.0.boostPressure",
     "value": 45500.0
   }]
 }]
}

/Leif
Reply
#16
Hi Leif,

Thank you for your example ... I read your reply yesterday and planned to answer it late last night. I wanted to check if I was right first. I omitted the context and timestamp in my delta message. The remainder is about the same as yours. 

However, some thoughts on the "source". What is the meaning of the source entries? I remember I entered my date of birth at a moment ... are those entries picked up by KPlex in any way?

Koen.
Reply
#17
(2019-05-25, 08:47 AM)KKempeneers Wrote: Hi Leif,

Thank you for your example ... I read your reply yesterday and planned to answer it late last night. I wanted to check if I was right first. I omitted the context and timestamp in my delta message. The remainder is about the same as yours. 

However, some thoughts on the "source". What is the meaning of the source entries? I remember I entered my date of birth at a moment ... are those entries picked up by KPlex in any way?

Koen.

This works for me being sent using UDP from an ESP32 to port 55561 which is set in signalk server as id - OPwifi.

Code:
{"updates":[{"values":[{"path":"environment.outside.pressure","value":101595.4}],"Source":"ESP32"}]}

When it gets sent out again from Signalk the source gets changed to OPwifi and a timestamp added. 
Code:
"environment":{  
           "outside":{  
              "pressure":{  
                 "meta":{  
                    "units":"Pa",
                    "description":"Current outside air ambient pressure"
                 },
                 "value":101594.1,
                 "$source":"OPwifi",
                 "timestamp":"2019-05-25T16:20:04.331Z"
              }
           },
Reply
#18
Thanks Paddy. Very useful information that is!

Fair winds,

Koen (That is "the cow" in Danish, but "brave" in Dutch)
Reply
#19
This is handy address to have bookmarked as well, displays the last sigK message to go out, hit refresh for latest >

http://10.10.10.1:3000/signalk/v1/api/

Then copy and paste here to make it look pretty >
https://jsonformatter.curiousconcept.com/
Reply
#20
(2019-05-26, 07:23 PM)PaddyB Wrote: This is  handy address to have bookmarked as well, displays the last sigK message to go out, hit refresh for latest >

http://10.10.10.1:3000/signalk/v1/api/

Then copy and paste here to make it look pretty >
https://jsonformatter.curiousconcept.com/

Or, simply use Firefox as web browser, it has built in support json and xml:


Also, good tool for NMEA read and Send from PC, look at Actisense:
https://www.actisense.com/product/nmea-r...bl-reader/

/Leif


Attached Files Image(s)
   
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)