# Help using socket\_listener telegraf input plugin

**URL:** <https://community.influxdata.com/t/help-using-socket-listener-telegraf-input-plugin/17290>\
**Category:** Telegraf\
**Tags:** telegraf, sensors\
**Created:** [December 19, 2020, 12:13pm UTC](https://community.influxdata.com/t/help-using-socket-listener-telegraf-input-plugin/17290 "2020-12-19T12:13:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Quark](https://avatars.discourse-cdn.com/v4/letter/q/5e9695/32.png) [@Quark](https://community.influxdata.com/u/Quark)\
**Post date:** [December 19, 2020, 12:13pm UTC](https://community.influxdata.com/t/help-using-socket-listener-telegraf-input-plugin/17290/1 "2020-12-19T12:13:00Z")

</div>

Hi,

I have a WiFi module sending sensor data (every 1 second) from an Arduino Via UDP to a my RPi where I’m running an instance of Telegraf. I’ve setup the socket\_listener input in the telegraf config.

The Arduino seems to be sending the UDP packets fine.

Telegraf says:

**[inputs socket\_listener] Listening on udp://[: :]:8888**

I’m expecting to see data coming through, but I don’t see anything in the window.

Also when I query the influx database that its supposed to be writing to there are no results.

Be great if anyone on here has any pointers please?

Thanks,

Q

---

<div class="post-metadata">

**Author:** ![helenosheaa](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/helenosheaa/32/7090_2.png) [@helenosheaa](https://community.influxdata.com/u/helenosheaa)\
**Post date:** [December 21, 2020, 9:40pm UTC](https://community.influxdata.com/t/help-using-socket-listener-telegraf-input-plugin/17290/2 "2020-12-21T21:40:44Z")

</div>

Hi,

Can you share your telegraf config?

Have you tried setting debug=true in the agent part of your config?

Or writing data to stdout using [[outputs.file]] and sharing the response:

> ```
> [[outputs.file]]
> files = ["stdout"]
> 
> ```

---

<div class="post-metadata">

**Author:** ![Quark](https://avatars.discourse-cdn.com/v4/letter/q/5e9695/32.png) [@Quark](https://community.influxdata.com/u/Quark)\
**Post date:** [December 22, 2020, 1:33pm UTC](https://community.influxdata.com/t/help-using-socket-listener-telegraf-input-plugin/17290/3 "2020-12-22T13:33:24Z")

</div>

Hey, thanks for the reply & the recommendations - I’ve implemented these into the config file which I’ve attached.

Another thing I’ve tried using Netcat to manually send some data via udp to the port I’m listening on:

```
nc -u localhost 8888
weather temperature=21

```

This appears to come through to Telegraf and parsed into Influxdb just fine.

My Arduino appears to be sending data to the same port via WiFi once a second, but I still see no output in Telegraf - see attached output.

Still not sure why the data is not getting through?

[telegraf\_config.txt](https://community.influxdata.com/uploads/short-url/mZVsejKzc1DftQTJRu5s23BZNBS.txt) (16.5 KB) [telegraf\_output.txt](https://community.influxdata.com/uploads/short-url/6ZDSFqZHtvZSQpsv3xpzyUuDbTd.txt) (1.4 KB)

---

<div class="post-metadata">

**Author:** ![helenosheaa](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/helenosheaa/32/7090_2.png) [@helenosheaa](https://community.influxdata.com/u/helenosheaa)\
**Post date:** [December 22, 2020, 5:47pm UTC](https://community.influxdata.com/t/help-using-socket-listener-telegraf-input-plugin/17290/4 "2020-12-22T17:47:39Z")

</div>

Hi,

Thanks for sharing that. Your output is showing that it’s not writing any metrics but I’m not sure why.

I used a similar config and did the basic example in this tutorial [Telegraf Socket Listener Input Plugin | InfluxData](https://www.influxdata.com/blog/telegraf-socket-listener-input-plugin/) and it wrote metrics both to Influxdb and stdout.

My config:

```
[agent]
  interval = "10s"
  round_interval = true
  metric_batch_size = 1000
  metric_buffer_limit = 10000
  collection_jitter = "0s"
  flush_interval = "10s"
  flush_jitter = "0s"
  precision = ""
  debug = true
  quiet = false
  omit_hostname = true

[[inputs.socket_listener]]
  service_address = "udp://:8094"
  data_format = "influx"

[[outputs.influxdb]]
   urls = ["http://127.0.0.1:8086"]
   database = "arduino"

[[outputs.file]]
   files=["stdout"]

```

Part of output:

```
2020-12-22T15:17:31Z I! [inputs.socket_listener] Listening on udp://[::]:8094
2020-12-22T15:17:41Z D! [outputs.influxdb] Buffer fullness: 0 / 10000 metrics
2020-12-22T15:17:41Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
m1,tag1=tag_value value=1 1608650261877235000
2020-12-22T15:17:51Z D! [outputs.file] Wrote batch of 1 metrics in 172.952µs
2020-12-22T15:17:51Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2020-12-22T15:17:51Z D! [outputs.influxdb] Wrote batch of 1 metrics in 269.373064ms
2020-12-22T15:17:51Z D! [outputs.influxdb] Buffer fullness: 0 / 10000 metrics

```

Within the ReadMe there is also notes about buffer\_sizes when using UDP which could also be something to look at [telegraf/plugins/inputs/socket\_listener at master · influxdata/telegraf · GitHub](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/socket_listener).

Let me know if that helps you at all.

---

<div class="post-metadata">

**Author:** ![Quark](https://avatars.discourse-cdn.com/v4/letter/q/5e9695/32.png) [@Quark](https://community.influxdata.com/u/Quark)\
**Post date:** [December 23, 2020, 8:00am UTC](https://community.influxdata.com/t/help-using-socket-listener-telegraf-input-plugin/17290/5 "2020-12-23T08:00:33Z")

</div>

Hi,

Thanks for giving it a go. Seems I can get similar results using nc, but still nothing from my arduino.

I had also implemented the change Re: buffer size,

```
net.core.rmem_max=8388608
net.core.rmem_default=8388608

```

This is now default, but it didn’t fix the issue unfortunately.

FYI I also have a [similar post](https://forum.arduino.cc/index.php?topic=719524.msg4834146#msg4834146) on Arduino forum to look at that side of it.

I guess the main difference from the Socket Listener example (in my case at least) is nc is using wired ethernet and the Arduino is using WiFi. Maybe some udp testing over WiFi. Could be some setting on my router maybe.
