This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
app-notes:fmstoip-itxpt [2022/12/15 15:19] – dodenhoeft | app-notes:fmstoip-itxpt [2024/06/14 09:17] (current) – gray | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== FMStoIP ====== | ====== FMStoIP ====== | ||
- | In this example enable ITxPT on Netmodule NG800 and receive specific CAN Data of the router via ITxPT implementation. As a client, we use a pc with linux-debian | + | In this example enable ITxPT on Netmodule NG800 and receive specific CAN Data of the router via ITxPT implementation. As a client, we use a pc with linux-debian |
Requirements: | Requirements: | ||
- | * Netmodule Router with licensed | + | * ITxPT and FMStoIP |
* A client, in our case linux debian 10 | * A client, in our case linux debian 10 | ||
- | 1. Step | + | === 1. Step === |
SERVICES -> ITxPT -> Configuration -> ITxPT Administratio enable. | SERVICES -> ITxPT -> Configuration -> ITxPT Administratio enable. | ||
Choose your LAN Interface, your client is connected to. In our case this is LAN1. | Choose your LAN Interface, your client is connected to. In our case this is LAN1. | ||
- | {{ : | + | {{: |
- | Go to FMStoIP Tab, and enable configuration. | + | === 2. Step === |
+ | Go to FMStoIP Tab, and configure as followed: | ||
- | {{: | + | {{: |
+ | |||
+ | === 3. Step === | ||
+ | To get any FMS data from the database on the webserver, once we need to enable all possible PGN IDs on the fmstoip service. Therefore we will use a simple http request sdk script. | ||
+ | Please configure a [[configuration: | ||
+ | Then add the following script into the script section: | ||
+ | |||
+ | <code c fms-add-all-pgn.are> | ||
+ | /*DESC: This script add all avaliable PGNs fmsv4.json to the FMStoIP database. | ||
+ | * Copyright (C) 2013-2022) NetModule AG, Switzerland | ||
+ | */ | ||
+ | |||
+ | url = ' | ||
+ | usr = ""; | ||
+ | pwd = ""; | ||
+ | path = ""; | ||
+ | pp = ""; | ||
+ | resp = ""; | ||
+ | //define headers | ||
+ | header = " | ||
+ | |||
+ | // ALL POSSIBLE PGN VALUES [HEX] | ||
+ | pgn= mkarray(" | ||
+ | |||
+ | for(i=0; i< | ||
+ | // POST request | ||
+ | f = fopen(" | ||
+ | | ||
+ | | ||
+ | | ||
+ | req = nb_transfer_post(usr ,pwd ,url ,path ,pp ,resp ,header); | ||
+ | | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | <WRAP center round tip 100%> | ||
+ | Don't forget to edit your router IP in the url! It is set to default 192.168.1.1 | ||
+ | </ | ||
+ | |||
+ | === 4. Step === | ||
+ | |||
+ | * [[app-notes: | ||
Almost done, now we need to discover the services offered by netmodule ITxPT service. | Almost done, now we need to discover the services offered by netmodule ITxPT service. | ||
Line 21: | Line 63: | ||
Once, started, we can click on a service to get detail information. | Once, started, we can click on a service to get detail information. | ||
- | {{: | + | {{: |
- | Now we have the multicast address for the gnss service discovered, we can join the multicast group and recvice the udp messages. | + | Now we have the multicast address for the fmstoip |
+ | <WRAP center round tip 100%> | ||
+ | Note: If you are connected to other networks too, make sure to add a **route 239.0.0.0/8 via 192.168.1.1** for the multicast address. | ||
+ | </ | ||
- | Note: If you are connected to other networks too, make sure to add a route for the multicast address. | ||
- | In my case, I add the route: | ||
- | |||
- | < | ||
- | sudo ip route add 239.0.0.0/8 dev enp5s0 | ||
- | </ | ||
+ | === 5. Step === | ||
Please clone https:// | Please clone https:// | ||
< | < | ||
- | timm@debian:/ | + | timm@debian: |
Cloning into ' | Cloning into ' | ||
remote: Enumerating objects: 103, done. | remote: Enumerating objects: 103, done. | ||
Line 41: | Line 81: | ||
Receiving objects: 100% (103/103), 48.67 KiB | 2.32 MiB/s, done. | Receiving objects: 100% (103/103), 48.67 KiB | 2.32 MiB/s, done. | ||
Resolving deltas: 100% (53/53), done. | Resolving deltas: 100% (53/53), done. | ||
- | klueppel@fang:/tmp$ cd mtools/ | + | timm@debian:~/git$ cd mtools/ |
- | klueppel@fang:/tmp/mtools$ make | + | timm@debian:~/git/mtools$ make |
CC msend.o | CC msend.o | ||
LINK msend | LINK msend | ||
CC mreceive.o | CC mreceive.o | ||
LINK mreceive | LINK mreceive | ||
- | klueppel@fang:/tmp/ | + | timm@debian:~/git/ |
</ | </ | ||
+ | === 6. Step === | ||
Now we can start mrecevie, with multiacast IP and port: | Now we can start mrecevie, with multiacast IP and port: | ||
- | ./mreceive -g 239.255.42.21 | + | ./mreceive -g 239.255.42.21 |
- | <konsole> | + | |
- | ./mreceive -g 239.255.42.21 | + | <code sh output.txt> |
+ | timm@debian: | ||
Now receiving from multicast group: 239.255.42.21 | Now receiving from multicast group: 239.255.42.21 | ||
- | Receive msg 1 from 192.168.1.1: | + | Receive msg 1 from 192.168.1.1: |
- | </konsole> | + | Receive msg 2 from 192.168.1.1:60429: <?xml version=" |
+ | </code> | ||
- | Done. | + | <code xml result.xml> |
+ | <?xml version=" | ||
+ | < | ||
+ | < | ||
+ | <Frame Status=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | <SPN id=" | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | <Frame Status=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | <SPN id=" | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | <?xml version=" | ||
+ | < | ||
+ | < | ||
+ | <Frame Status=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | <SPN id=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | <Frame Status=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | <SPN id=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||