Unable to create 'Serial' interfacer: module 'serial' has no attribute 'SerialException' / emontx(serial2net) > socat (/tmp/tty.V0)

Hi all,

I’m facing some issue when trying to accomplish the following with the emonhub.

I have an EmonTx hardware, in the serial output I have connected an espeasy module configured as a serial2net tcp. That works and with Socat I’m receiving the data flow in the linux server where the emoncms is installed.

As you can see my socat is running as daemon and creating this port: /tmp/ttyV0

/usr/bin/socat -d pty,link=/tmp/ttyV0,waitslave tcp:192.168.blah.blah:1234

I can connect locally to this /tmp/ttyV0 and I can see the output from emontx published periodically. So basically it works.

The problem comes from the emonhub, no matter what I do, I always get this message

2022-09-18 10:23:20,522 INFO MainThread Opening hub…
2022-09-18 10:23:20,522 INFO MainThread Logging level set to DEBUG
2022-09-18 10:23:20,522 INFO MainThread Creating EmonHubSerialInterfacer ‘Serial’
2022-09-18 10:23:20,522 ERROR MainThread Unable to create ‘Serial’ interfacer: module ‘serial’ has no attribute ‘SerialException’

This is the setup part related to the serial conf in my emonhub.conf

[[Serial]]
    Type = EmonHubSerialInterfacer
    [[[init_settings]]]
        com_port = /tmp/ttyV0
        com_baud = 9600                        # 9600 for old RFM12Pi
    [[[runtimesettings]]]
        pubchannels = ToEmonCMS,
        subchannels = ToSerial, 

Any idea why is failing to create the serial interfacer?

Thanks

Does emonhub have permission to access this?

All I can suggest is going into the interfacer code, and work out where it is failing as this is fairly unusual setup.

There is a TCP interfacer IIRC.

Hi Brian,

Yes emonhub has the proper permissions to access it, but i will check again just in case.

I was not aware of the tcp modbus integration, its been a while since i setup the emonhub and it has evolved since then, I will give it a try, it looks promising in the documentation.

Thanks for your hints.