# Python3 for emonhub

**URL:** <https://community.openenergymonitor.org/t/python3-for-emonhub/12670>\
**Category:** emonHub\
**Tags:** python\
**Created:** [9 December 2019 01:18 UTC](https://community.openenergymonitor.org/t/python3-for-emonhub/12670 "2019-12-09T01:18:49Z")\
**Posts on this page:** 1\
**Showing post:** 71

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [10 June 2020 16:18 UTC](https://community.openenergymonitor.org/t/python3-for-emonhub/12670/71 "2020-06-10T16:18:47Z")

</div>

@bwduncan @TrystanLea

Attempted to use the python3 version of emonhub and the `EmonHubSocketInterfacer.py`.

I get this error on packet receipt.

```auto
2020-06-10 17:10:39,183 WARNING Pulse Exception caught in Pulse thread. Traceback (most recent call last):
  File "/opt/openenergymonitor/emonhub/src/emonhub_interfacer.py", line 32, in wrapper
    return f(*args)
  File "/opt/openenergymonitor/emonhub/src/emonhub_interfacer.py", line 99, in run
    rxc = self.read()
  File "/opt/openenergymonitor/emonhub/src/interfacers/EmonHubSocketInterfacer.py", line 69, in read
    select.select([self._socket], [], [], 0)
TypeError: argument must be an int, or have a fileno() method.

```

I am using this script to send the packets - [Directly connecting to Optical Pulse Counter with RPi? - #61 by danbates](https://community.openenergymonitor.org/t/directly-connecting-to-optical-pulse-counter-with-rpi/1294/61)

I note that there is a `print f` which I corrected but I am getting this error with Python3

```auto
Traceback (most recent call last):
  File "/home/pi/pulses.py", line 31, in eventHandler2
    processpulse(2,GPIO.input(channel))
  File "/home/pi/pulses.py", line 51, in processpulse
    send(f)
  File "/home/pi/pulses.py", line 58, in send
    s.send(f)
TypeError: a bytes-like object is required, not 'str'

```

This all relates to trying to get a pulse interfacer going [Emonhub Pulse Interfacer](https://community.openenergymonitor.org/t/emonhub-pulse-interfacer/14432)

---

_[View the full topic](https://community.openenergymonitor.org/t/python3-for-emonhub/12670)._
