Why Kubernetes config file for ThingsBoard service use TCP for CoAP?

9/25/2018

I used Kubernetes on Google cloud platform for run the thingsboard service by following this step : https://thingsboard.io/docs/user-guide/install/kubernetes/#tbyaml-file.

The problem is TB cannot receive the data when sent the data from NB-IoT Shield(BC95) by CoAP protocol on 5683 port. I have to see the Kubernetes configuration YAML in tb-service and found that 5683 port is defined by TCP protocol.

clusterIP: 10.23.242.112 externalTrafficPolicy: Cluster ports: - name: ui nodePort: 31146 port: 8080 protocol: TCP targetPort: 8080 - name: mqtt nodePort: 32758 port: 1883 protocol: TCP targetPort: 1883 - name: coap nodePort: 32343 port: 5683 protocol: TCP targetPort: 5683

The question is the protocol of CoAP should be UDP or not?

-- Sansoen Koedkaen
coap
kubernetes
thingsboard

1 Answer

9/26/2018

CoAP, by itself, can be run both over TCP and UDP (indicated by coap+tcp:// or coap:// URIs, respectively). As the BC95 only supports UDP as far as I can tell, you're using the latter.

As by an example in a kubernetes issue, you may want to try setting the protocol family to UDP. There's use cases for both, which may be why there's a "TCP" in your setup (odd, though; the current examplein the docs does not have any "protocol: TCP" in it), but with this client you're probably using UDP.

-- chrysn
Source: StackOverflow