Unable to see emonTx inputs

[Moved discussion to new thread as unrelated to topic of original thread]

Hi there,

I also am having issues seeing Inputs. I have an old EmonTxv3, and a emonbase with Raspberry Pi B and RMF12B. My config looks like the below. I changed the baud to 9600, and the node and pi are running at 868MHZ. Struggled to follow the above discussion, can someone help?

Chris

[hub]
### loglevel must be one of DEBUG, INFO, WARNING, ERROR, and CRITICAL
loglevel = DEBUG
### Uncomment this to also send to syslog
# use_syslog = yes
#######################################################################
#######################       Interfacers       #######################
#######################################################################

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

        group = 210
        frequency = 868
        baseid = 5                              # emonPi / emonBase nodeID
        quiet = true                            # Report incomplete RF packets (no implemented on emonPi)
        calibration = 230V                      # (UK/EU: 230V, US: 110V)
        # interval =  0                         # Interval to transmit time to emonGLCD (seconds)

[[MQTT]]

    Type = EmonHubMqttInterfacer
    [[[init_settings]]]
        mqtt_host = 127.0.0.1
        mqtt_port = 1883
        mqtt_user = emonpi
        mqtt_passwd = emonpimqtt2016

    [[[runtimesettings]]]
        pubchannels = ToRFM12,
        subchannels = ToEmonCMS,

        # emonhub/rx/10/values format
        # Use with emoncms Nodes module
        node_format_enable = 1
        node_format_basetopic = emonhub/

        # emon/emontx/power1 format - use with Emoncms MQTT input
        # http://github.com/emoncms/emoncms/blob/master/docs/RaspberryPi/MQTT.md
        nodevar_format_enable = 1
        nodevar_format_basetopic = emon/

[[emoncmsorg]]
    Type = EmonHubEmoncmsHTTPInterfacer
    [[[init_settings]]]
    [[[runtimesettings]]]
        pubchannels = ToRFM12,
        subchannels = ToEmonCMS,
        url = https://emoncms.org
        apikey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        senddata = 1                    # Enable sending data to Emoncms.org
        sendstatus = 1                  # Enable sending WAN IP to Emoncms.org MyIP > https://emoncms.org/myip/list
        sendinterval= 30                # Bulk send interval to Emoncms.org in seconds

#######################################################################
#######################          Nodes          #######################
#######################################################################

[nodes]

## See config user guide: http://github.com/openenergymonitor/emonhub/blob/master/configuration.md

[[5]]
    nodename = emonpi
    [[[rx]]]
        names = power1,power2,power1pluspower2,vrms,t1,t2,t3,t4,t5,t6,pulsecount
        datacodes = h, h, h, h, h, h, h, h, h, h, L
        scales = 1,1,1,0.01,0.1,0.1,0.1,0.1,0.1,0.1,1
        units = W,W,W,V,C,C,C,C,C,C,p

[[6]]
    nodename = emontxshield
    [[[rx]]]
       names = power1, power2, power3, power4, vrms
       datacode = h
       scales = 1,1,1,1,0.01
       units =W,W,W,W,V

[[7]]
   nodename = emontx4
   [[[rx]]]
      names = power1, power2, power3, power4, vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
      datacodes = h,h,h,h,h,h,h,h,h,h,h,L
      scales = 1,1,1,1,0.01,0.1,0.1, 0.1,0.1,0.1,0.1,1
      units =W,W,W,W,V,C,C,C,C,C,C,p

[[8]]
    nodename = emontx3
    [[[rx]]]
       names = power1, power2, power3, power4, vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
       datacodes = h,h,h,h,h,h,h,h,h,h,h,L
       scales = 1,1,1,1,0.01,0.1,0.1, 0.1,0.1,0.1,0.1,1
       units =W,W,W,W,V,C,C,C,C,C,C,p

[[9]]
   nodename = emontx2
   [[[rx]]]
      names = power1, power2, power3, power4, vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
      datacode = h
      scales = 1,1,1,1,0.01,0.1,0.1, 0.1,0.1,0.1,0.1,1
      units =W,W,W,W,V,C,C,C,C,C,C,p

[[10]]
    nodename = emontx1
    [[[rx]]]
       names = power1, power2, power3, power4, vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
       datacode = h
       scales = 1,1,1,1,0.01,0.1,0.1, 0.1,0.1,0.1,0.1,1
       units =W,W,W,W,V,C,C,C,C,C,C,p

[[11]]
    nodename = 3phase
    [[[rx]]]
       names = powerL1, powerL2, powerL3, power4, Vrms, temp1, temp2, temp3, temp4, temp5, temp6
       datacode = h
       scales = 1,1,1,1,0.01,0.1,0.1,0.1,0.1,0.1,0.1
       units =W,W,W,W,V,C,C,C,C,C,C

[[19]]
   nodename = emonth1
   [[[rx]]]
      names = temperature, external temperature, humidity, battery
      datacode = h
      scales = 0.1,0.1,0.1,0.1
      units = C,C,%,V

[[20]]
   nodename = emonth2
   [[[rx]]]
      names = temperature, external temperature, humidity, battery
      datacode = h
      scales = 0.1,0.1,0.1,0.1
      units = C,C,%,V

[[21]]
   nodename = emonth3
   [[[rx]]]
      names = temperature, external temperature, humidity, battery
      datacode = h
      scales = 0.1,0.1,0.1,0.1
      units = C,C,%,V

[[22]]
   nodename = emonth4
   [[[rx]]]
      names = temperature, external temperature, humidity, battery
      datacode = h
      scales = 0.1,0.1,0.1,0.1
      units = C,C,%,V

[[23]]
    nodename = emonth5
    [[[rx]]]
       names = temperature, external temperature, humidity, battery, pulsecount
       datacodes = h,h,h,h,L
       scales = 0.1,0.1,0.1,0.1,1
       units = C,C,%,V,p

[[24]]
    nodename = emonth6
    [[[rx]]]
       names = temperature, external temperature, humidity, battery, pulsecount
       datacodes = h,h,h,h,L
       scales = 0.1,0.1,0.1,0.1,1
       units = C,C,%,V,p

[[25]]
    nodename = emonth7
    [[[rx]]]
       names = temperature, external temperature, humidity, battery, pulsecount
       datacodes = h,h,h,h,L
       scales = 0.1,0.1,0.1,0.1,1
       units = C,C,%,V,p

[[26]]
    nodename = emonth8
    [[[rx]]]
       names = temperature, external temperature, humidity, battery, pulsecount
       datacodes = h,h,h,h,L
       scales = 0.1,0.1,0.1,0.1,1
       units = C,C,%,V,p

Your config looks correct, do you know what firmware version your emonTx is running? and what node ID its using?

Are you receiving any Inputs? Has the system been working successfully in the past?

Hi Glyn. I’m running emonTxV3_RFM12B_DiscreteSampling. Not recieving any inputs. I’ve never had this setup working before- my previous system was about 3 years ago, so pretty different.

Here is a log of emonbase from when I restarted it this morning;

2017-02-10 09:00:30,282 DEBUG    MainThread SIGINT received.
2017-02-10 09:00:30,284 INFO     MainThread Exiting hub...
2017-02-10 09:00:30,497 INFO     MainThread Exit completed
2017-02-10 09:00:32,932 INFO     MainThread EmonHub emonHub 'emon-pi' variant v1.2
2017-02-10 09:00:32,934 INFO     MainThread Opening hub...
2017-02-10 09:00:32,937 INFO     MainThread Logging level set to DEBUG
2017-02-10 09:00:32,940 INFO     MainThread Creating EmonHubJeeInterfacer 'RFM2Pi' 
2017-02-10 09:00:32,948 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 9600 bits/s
2017-02-10 09:00:34,954 WARNING  MainThread Device communication error - check settings
2017-02-10 09:00:34,957 INFO     MainThread Setting RFM2Pi frequency: 868 (8b)
2017-02-10 09:00:35,961 INFO     MainThread Setting RFM2Pi group: 210 (210g)
2017-02-10 09:00:36,965 INFO     MainThread Setting RFM2Pi quiet: 0 (0q)
2017-02-10 09:00:37,969 INFO     MainThread Setting RFM2Pi baseid: 5 (5i)
2017-02-10 09:00:38,973 INFO     MainThread Setting RFM2Pi calibration: 230V (1p)
2017-02-10 09:00:39,977 DEBUG    MainThread Setting RFM2Pi subchannels: ['ToRFM12']
2017-02-10 09:00:39,980 DEBUG    MainThread Interfacer: Subscribed to channel' : ToRFM12
2017-02-10 09:00:39,983 DEBUG    MainThread Setting RFM2Pi pubchannels: ['ToEmonCMS']
2017-02-10 09:00:39,986 DEBUG    MainThread Interfacer: Subscribed to channel' : ToRFM12
2017-02-10 09:00:39,990 INFO     MainThread Creating EmonHubMqttInterfacer 'MQTT' 
2017-02-10 09:00:39,995 INFO     MainThread MQTT Init mqtt_host=127.0.0.1 mqtt_port=1883 mqtt_user=emonpi
2017-02-10 09:00:40,005 DEBUG    MainThread MQTT Subscribed to channel' : ToEmonCMS
2017-02-10 09:00:40,009 INFO     MainThread Creating EmonHubEmoncmsHTTPInterfacer 'emoncmsorg' 
2017-02-10 09:00:40,015 DEBUG    MainThread emoncmsorg Subscribed to channel' : ToEmonCMS
2017-02-10 09:00:40,119 INFO     MQTT       Connecting to MQTT Server
2017-02-10 09:00:40,133 INFO     MQTT       connection status: Connection successful
2017-02-10 09:00:40,137 DEBUG    MQTT       CONACK => Return code: 0
2017-02-10 09:00:40,242 INFO     MQTT       on_subscribe

I should say, I’m trying to run this on my work network- could that be an issue? I can see emoncms though, so doesn’t seem to be a problem.

Does anyone know what the warnings and errors in the log above are? Is that the problem?

All looks correct from the log.

What transmitter units have you got (e.g. emonTx etc)? Are these units powered up? Is the RED led flashing once every 10s? Are you sure these units are on 868Mhz. Does the LED on the RFM12Pi flash once every 10’s in sync with the emonTx

Does the LED on the RFM12Pi light up when the Pi is booted?


The issue could be with the RFM12Pi. Let’s try to see if we can communicate directly with it. Can you connect via ssh then run

sudo service emonhub stop
minicom -D /dev/ttyAMA0 -b9600

You should now see a serial window, try pressing v to prompt the RFM12Pi to return it’s version number and status, please post what you see.

To exit minicom [ctrl + a] then [x] then enter.

Could also try a different baud rate in case you have a new unit:

minicom -D /dev/ttyAMA0 -b38400

Thanks- I’ve got one emomTX connected. It is flashing, so appears to be transmitting.

Will try those things and see what I get.

The emonhub.log shows us there is no communication with the RFM2Pi board (at 9600)

2017-02-10 09:00:32,940 INFO     MainThread Creating EmonHubJeeInterfacer 'RFM2Pi' 
2017-02-10 09:00:32,948 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 9600 bits/s
2017-02-10 09:00:34,954 WARNING  MainThread Device communication error - check settings

Am I right to assume you are now using the latest emonSD image? can you confirm?

If you are have you changed anything else related to the serial port other than the “com_baud=” in emonhub.conf?

Can you confirm what model of Pi B you are using? Is it a B(256mb ram), B(512mb ram) or B+ ? (I am not sure the emonSD will even run on an original 256mb Pi B).

If using a B or B+ (possibly even a 2B) and the com_baud is set correctly but still no joy it maybe a serial port mapping issue see “EmonBase with RPi B1+ - no serial data”

Can you also post the result of running this from the command line ?

ls -la /dev/{tty{AMA,S,USB},serial}*

[edit] Can you also confirm YOU HAVE NOT used the “update emonBase” (or “update RFM69Pi” depending on time of last update) button on the admin page of emonCMS?
If you haven’t please avoid doing so. Since your device is RFM12 using the update will stop it in it’s tracks as it will install RFM69 firmware which will not progress beyond initialization from boot. If you have then the firmware will need reverting to a RFM12 version.

Hi Paul,

Thanks for this.

It’s a Pi B, purchased from OEM shop in Aug 2013.

I did indeed update the firmware! I’ll revert back to the original image (Nov 16), and will see what happens.

I did edit the config file so that I could view the Pi on a monitor using VGA, but I think that’s it.

I’ll check a few things and get back to you.

Thanks!

Should say…I left the Pi in the office so will have to wait until tomorrow to check (including Pi version etc).

Chris

Paul,

Just got back on to this. I ran the command line above, and got the below.

Following the other thread seems to hit a dead-end. Has there been any further discussion on this?

Chris

Hi Glyn.
I tried the minicom line, but pressing v didn’t do anything. Am I doing something wrong? Screenshot here;

Did you try both 9600 and 38400 baud rates?

If you have no joy it must indicate an issue with the RFM12Pi. ]

Does the red LED light up on the RFM12Pi when the Pi is first powered up?

Other baud rate doesn’t work either. Red light doesn’t come on, no. Just green light, which stays on (doesn’t flash).

Dead RFM12PI?

Ah, the old RFM12Pi have green LED instead of red. This is nothing to worry about.

The fact the LED stays on is more worrying. This indicates that the unit could be running the incorrect firmware for the RF module. Are you sure you have an RFM12B? Learn | OpenEnergyMonitor

Have you ever changed / updated the firmware?

Definitely RFM12B;

Which firmware are you referring to?

Chris

OK, so I tried to update the RFM12B (using this), but I had a few issues. See below. Couldn’t clone several Git folders, and RF12_Demo_atmega328 couldn’t be found. And it then freezes after the last command. Have I done something wrong?

Those instructions assume staring from a blank Pi, since you are running an emonSD your Pi already setup with avrdude upload and the RFM2Pi firmware folder

To update the firmware and try and flash the unit run:

rpi-rw
cd RFM2Pi
git pull
cd old/RF12_Demo_atmega328
sudo service emonhub stop
sudo avrdude -v -p atmega328p -c avrispmkII -P usb -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xE2:m -U flash:w:RF12_Demo_atmega328.cpp.hex:i -B 10

Hi Glyn,

cd old/RF12_Demo_atmega328 returns “no such file or directory”. I can’t seem to find a “old” directory anywhere. Could it be under a different folder?

Chris

The RFM2Pi folder on the emonPi image has “root” folders preventing the user pi from performing a git pull, to fix the repo you must recursively chown the folder contents.

Also the path is incorrect it needs another “firmware” level.

Plus you are connecting via the GPIO serial port “/dev/ttyAMA0” not a USB connected “avrispmkII” try the following

rpi-rw
sudo chown pi:pi -R RFM2Pi
cd RFM2Pi
git pull
cd firmware/old/RF12_Demo_atmega328
sudo service emonhub stop
sudo avrdude -v -c arduino -p ATMEGA328P -P /dev/ttyAMA0 -b 38400 -U flash:w:RF12_Demo_atmega328.cpp.hex

Although I’m afraid I’m no longer sure which is the correct firmware since it’s been moved around again, there is an update script in the RFM2Pi folder that uses firmware/RFM69CW_RF_Demo_ATmega328/RFM12_Demo_ATmega328.cpp.hex which although in a “RFM69CW…” folder appears to be for the RFM12 and older than the RFM12 firmware in the “old” folder, I suspect there is some confusion over what is “old firmware” and what is “current firmware for old hardware”. When installing a FW to debug an issue it is essential you know what you are installing to make sense of the result.

Before updating the firmware can you do 2 things? firstly just try running this command and post the result

sudo avrdude -v -c arduino -p ATMEGA328P -P /dev/ttyAMA0 -b 38400

this will try and communicate with the ATmega328p without overwriting the FW to confirm the serial port and serial lines are all ok. Secondly just take a look at the connections between the RFM12b module (the sub-board with the tin can and black circle on) and the RFM2Pi board, if any of those connections in the 2 rows of 7 connections are cracked or causing a bad connection it could cause the RFM to fail to initialize and stall the FW with the LED illuminated, we have seen it before once or twice.

If comms’n’conns are good then you could try uploading a new sketch (or 2?). Assuming the RFM2Pi worked at some point in time, the “wrong firmware” just doesn’t sound like a natural occurrence unless you used the “update rfm69pi” button on the emoncms admin page or have tried deliberately changing it in the past.