Packet Data Transmission over DMR
Posted: Mon Jan 16, 2017 4:08 pm
Goal: upload data from a mobile unit (pi data logger in vehicle) to a fixed station/database
Method: udp packets via DMR (MotoTRBO)
First test is a success. I can send text from one point to another over a DMR simplex link.
Setup: two raspberry pis with trbo radios attached via USB. Just connecting the cable will create a usb0 network interface on the pi. Add a route table entry so the pi knows to send info destined for 12.0.0.0/8 over the usb0 interface. I used socat to receive/send data over udp. Whatever went in on the sending side came out on the receiving side. The example small-txt-file below is just that - a small text file with a couple lines of generic sample text.
Receiving radio needs to have "Forward to PC" set to "via USB", on the Network tab in CPS.
Receiving side:
Sending side:
The REMOTE_IP above gets filled in with the IP addr of the receiving radio.
How to determine this (assuming default CAI network of 12):
First Octet: 13
Second Octet: ($id >> 16) & 0xff
Third Octet: ($id >> 8) & 0xff
Fourth Octet: $id & 0xff
Example: using $id of 3155055, resulting ip is 12.48.36.111
Illustration: 3155055 in binary is 00110000 00100100 01101111. Split the address into three bytes, convert to decimal -> 00110000=48 00100100=36 01101111=111
update: 25Jan2017
Using the default CAI network of 12, the attached pc operates on the 13.0.0.0/8 network. Thus, sending packets to the 13.* address goes directly to attached pc without needing "Forward to PC" set in the codeplug. This allows text-messaging on the radio to work in conjunction with data over dmr.
Method: udp packets via DMR (MotoTRBO)
First test is a success. I can send text from one point to another over a DMR simplex link.
Setup: two raspberry pis with trbo radios attached via USB. Just connecting the cable will create a usb0 network interface on the pi. Add a route table entry so the pi knows to send info destined for 12.0.0.0/8 over the usb0 interface. I used socat to receive/send data over udp. Whatever went in on the sending side came out on the receiving side. The example small-txt-file below is just that - a small text file with a couple lines of generic sample text.
Receiving radio needs to have "Forward to PC" set to "via USB", on the Network tab in CPS.
Receiving side:
Code: Select all
# route add -net 12.0.0.0/7 gw 192.168.10.1
# socat -u udp-recv:4041 stdout
Code: Select all
# route add -net 12.0.0.0/7 gw 192.168.10.1
# cat small-txt-file | socat -u stdin udp-sendto:REMOTE_IP:4041
How to determine this (assuming default CAI network of 12):
First Octet: 13
Second Octet: ($id >> 16) & 0xff
Third Octet: ($id >> 8) & 0xff
Fourth Octet: $id & 0xff
Example: using $id of 3155055, resulting ip is 12.48.36.111
Illustration: 3155055 in binary is 00110000 00100100 01101111. Split the address into three bytes, convert to decimal -> 00110000=48 00100100=36 01101111=111
update: 25Jan2017
Using the default CAI network of 12, the attached pc operates on the 13.0.0.0/8 network. Thus, sending packets to the 13.* address goes directly to attached pc without needing "Forward to PC" set in the codeplug. This allows text-messaging on the radio to work in conjunction with data over dmr.