DirectSerial EmonTx to RPi2 not working


I wired up my recently ordered emonTx v3.4 (running the firmware it came with) to a raspberry Pi 2 running emoncms.
It is wired exactly according to the image in this guide:

As I am using an AC-AC adapter for voltage measuring and power is supplied directly by the RPi, i removed JP2.

I tried to read out the serial data on " /dev/ttyAMA0" using a simple python script and there is definitely some data coming in every 10 seconds, when the emonTx is connected.
I also made sure, the Serial interface is enabled and not being used by the linux terminal. using “raspi-config”

2020-04-04 11_09_50-Start

This is my interfacer configuration. I commented out the [[RFM2Pi]] configuration, as it was using the same serial device.

### This interfacer manages the EmonTx3 ESP format serial
    Type = EmonHubSerialInterfacer
        com_port = /dev/ttyAMA0
        com_baud = 9600
        pubchannels = ToEmonCMS,

### This interfacer manages the RFM12Pi/RFM69Pi/emonPi module
#    Type = EmonHubJeeInterfacer
#    [[[init_settings]]]
#        com_port = /dev/ttyAMA0
#        com_baud = 38400                        # 9600 for old RFM12Pi
#    [[[runtimesettings]]]
#        pubchannels = ToEmonCMS,
#        subchannels = ToRFM12,

Looking at the logfile, the only lines related to the serial connection ar those:

2020-04-04 01:58:03,841 INFO     MainThread Creating EmonHubSerialInterfacer 'SerialDirect'
2020-04-04 01:58:03,846 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 9600 bits/s
2020-04-04 01:58:03,847 DEBUG    MainThread Setting SerialDirect pubchannels: ['ToEmonCMS']

So I think everything sould be setup correctly, but there are no inputs created when i look at
Does somebody have an idea of what could be going on?
Are there any disadvantages, when I go to the noRF firmware (it seems quiet old)

Using the serial monitor of arduino IDE, I see values like this coming in:
2020-04-04 12_33_54-Start

Two points here: Do you have a single phase or a three-phase electricity supply? The default sketch is for the UK single phase supply, it will not give the correct values when you use it on a 3-phase supply.

That output is similar to what I would expect if the baud rate is incorrect. The sketch sends at 115200 baud. You need to look with the Arduino IDE at 115200 baud and set your interfacer to 115200 baud.

You can turn off the Radio (RFM) by commenting the line
#define ENABLE_RF
in the sketch.

1 Like

The baud rate was the problem. Once set to 115200, the data started to make sense.
However, the format was not parsed correctly by emoncms.
After changing the configuration from DirectSerial/EmonHubSerialInterfacer to the following, it works.

    Type = EmonHubTx3eInterfacer
        com_port = /dev/ttyAMA0
        com_baud = 115200
         pubchannels = ToEmonCMS,

Not sure, why I didn’t find this example before, but searching for “115200” helped.
Next I will look into compiling the sketch without RF support.

Thanks for your support

1 Like