EmonTx not updating emonPi

The short piece of emonhub.log you supplied shows nothing was received by emonhub from the emontx during that 1min 30secs, so how is the emonTx connected to the emonbase? via RF I assume? Can you show us the emonhub.conf? [mask or remove your apikey]

Can you also restart emonhub sudo service emonhub restart and post the logs created when it restarts? Specifically the “RFM2Pi” interfacer being created and the settings used.

Dear Paul :

I have RFM69Pi board which is connected to Raspberry PI 2 B.
I would like to trace the problem to find the root case.
It’s very sad that 7 days ago everything worked fine, than a long system off + I did the calibration process in the Emon TX ino file and everything goes wrong…
How/where can I see if the RFM69Pi board + Raspberry PI receive the RF packet ?
Because I assume that the problem can be :

  1. something happened with the RFM69Pi board.
  2. RFM69Pi board receive tha RF packets from Emon TX, but not forward to Emon CMS.

I just see that the red led is blinking on the RFM69Pi (433Mhz) Raspberry Pi Base Station Receiver Board.
I’m realy wodering the green led is blinking on the Emon TX every 10 sec and on the Emon PI RF receiver board led blinking also, but no input shown on the emoncms…
I restarted the emonhub, but nothing changed.

Here it is my emonhub.log from the local emoncms:

#######################################################################
#######################      emonhub.conf     #########################
#######################################################################
### emonHub configuration file, for info see documentation:
### http://github.com/openenergymonitor/emonhub/blob/emon-pi/configuration.md
#######################################################################
#######################    emonHub  settings    #######################
#######################################################################

[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 = 38400                        # 9600 for old RFM12Pi
    [[[runtimesettings]]]
        pubchannels = ToEmonCMS,
        subchannels = ToRFM12,

        group = 210
        frequency = 433
        baseid = 10                              # 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 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        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,0.01,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

[[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

[[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

I installed again the whole SD card in the Emonpi.

I have the same problem, no input is visible on the local emoncms.
Unfortunatelly the situation is the same. It seems that No RF packet received.

Emon CMS log:

2016-11-02 21:42:44.947|WARN|phpmqtt_input.php|Starting MQTT Input script
2016-11-02 21:42:50.573|WARN|phpmqtt_input.php|Starting MQTT Input script
2016-11-02 21:42:53.991|WARN|phpmqtt_input.php|Subscribing to: emon/#
2016-11-02 21:42:53.996|WARN|phpmqtt_input.php|Not connected, retrying connection
2016-11-02 21:42:53.997|WARN|phpmqtt_input.php|Connecting to MQTT server: Connection Accepted.: code: 0
2016-11-02 21:42:53.999|WARN|phpmqtt_input.php|Subscribed to topic: emon/#

Maybe my RFM69CW 433Mhz dead on myEmon TX or the RFM69Pi - 433Mhz on my Raspberry PI board.
How can I detect it ? I just now bought them a few weeks ago I used ca 1-2 hours them…

I captured the following on the emonhub.log after reboot :

Very sorry to hear your having issues. I have been unable to re-recreate. Could you try and update to the latest version of mosquitto mqtt server/

Connect via ssh then run:

rpi-rw
sudo apt-get update & sudo apt-get upgrade
sudo apt-get dist-upgrade

When give the option choose to keep the currently installed config for php.ini

Reboot when done

sudo reboot

The issue definitely appears to be with the rfm69pi, the Pi’s serial port or the connection between them.

Can you confirm the rfm69pi is seated correctly on the first 19 GPIO pins? And that the remaining GPIO pins are not being fouled by the rfm69pi being at an angle, make sure where the antenna wire is soldered to the board that the soldered joint on the underside of the board isn’t touching the GPIO pins below it.

You said previously that the led on the rfm69pi was flashing, is that still the case?

The emonhub.log you provide shows no response from the rfm69pi board, each of the “Mainthread Setting RFM2Pi …” lines should get a response to confirm that setting was received and actioned by the rfm69pi.

Have you installed any other software that may be trying to use the serial port? Can you try using “minicom” to confirm any signs of life from the rfm69pi? you will need to stop emonhub using sudo service emonhub stop while you use minicom and then restart it again with sudo service emonhub start afterwards.

Is /dev/ttyAMA0 present if you use the command ls -la /dev/ttyAMA0 ?

Are you absolutely sure it’s a rfm69pi and not a rfm2pi? How long a go did you purchase it? The earlier rfm2pi’s can use a “com_baud” of 9600 or 57600 as well as 38400, but all rfm68pi’s use 38400 (AFAIK). Just re-read you purchased it a few weeks ago so it should be 38400 which is the default for emonhub.

It would be useful to keep a log of the MQTT traffic to determine if the data is getting as far as MQTT. A while back a published an example nodeRED flow to do this:

See bottom of this post:

NodeRED is pre installed on your emonPi, just browser to http:///emonpi:1880 then login with ‘emonpi’ and ‘emonpi2016’ . Select import then paste in my example flow. You will need to change the save log file location to /home/pi/data instead of the external HDD I was using for the example.

Dear Paul,

I did all the upgrade acc. Glyn post.
The situation is the same unfortunatelly.
Concerning the led blinking a observ the follows :
Emon TX green led blinking every cca 10 sec.
RFM69Pi red led blinking cca 5 -8 sec.
The rfm69pi board connected to the same place like it before, no toch on the antenna soldering joint, on this position in the beginning the whole system worked. I don’t change on this side.
No other software installed on the raspi only the latest image fomr the openenergy monitor site.
The red led blinking on the RFM69PI means received packet or what else ?
Before I re installed the hole system I try to monitor the serial line with minicon.
But I could open minicon only if the Serial line was disabled in the rpi-config.
I was astonished when I set the system to rpi-rw, then enable the serial line in sudo raspi-config then I try to open with minicon after a reboot, ttyAMA0 but I got an answer that permission denied.
If I disable the serial line in raspi-config I can open the minicon, but I don’t see communication.
Or I set disable the serial line in wrong place or how else can be the debug work for RFM69PI?

Thanks for your effort in advance.

And if you switch off the emontx does the flashing stop (or reduce significantly) on the rfm69pi also? this would confirm the packets receipts at the rfm69pi are most likely from the emonTx.

The serial port access is already set in the emonSD image, and it can be confusing to set manually. The serial option is for a serial console not a serial port as we want it to be. So we need the serial console disabled so that we can use the serial port, this is why you needed to “disable serial” in raspi-config to use miniport, that would be correct and that is how it should be set.

Only 1 software can use the serial port so once you have disabled “serial console” in raspi-config you should reboot and check emonhub.log again, if no data is coming in from the rfm69pi, stop emonhub from using the serial poer with sudo service emonhub stop and try using minicom, any permission issues can be overcome by using sudo before the minicom command.

With minicom set to /dev/ttyAMA0 and a 38400 baud, you should be able to see some traffic if you send “?” it should list the options menu even if it’s not receiving data via rf or set to the wrong group or freq etc.

You can test the Pi’s serial port further if you want to get in a bit deeper. If you have a suitable link wire with terminals, remove the rfm69pi and put a link between the Pi’s GPIO pins 8 and 10 (labelled in the image below as pins 14 TXD and 15 RXD under the heading “UART”).

( If you do not have a suitable linkwire you can borrow the JP2 link from inside your emonTx,) Once those 2 pins are safely shorted together, anything you type in minicom’s “send” should echo in “received” when TXD is linked directly to RXD.

Obviously apply appropriate caution when trying something like this, powering down before attempting to connect the link or the rfm69pi as necessary.

Dear Paul,

I’m really happy that both of you are try to help me.
If I switch the Emon TX off the Red led blinking is top on the RFMPI69.
To me that means that I have comunication between the Emon TX and RFMpi69.
But why I still don’t see on the Emoncms Input?

Abouth the minicom terminal, I have some problems.
I read through theRFM69 Wiki and I try the commands which is written there, but it seems that they are not working.
example :
sudo rpi-serial-console disable
rpi-serial-console status

After you wrote that on the raspi config I disable /enable serial console and not serial port,
I think that this is the reasion why my system doesn’t work and I try the following two command according the sd card installation guideline :

Disable serial console boot

sudo systemctl stop [email protected]
sudo systemctl disable [email protected]

The system do something no erroror eny feedback arrived.
My questions is the following, does it need or not ?
Or the SD image configured to disable the serial port automatically ?
After I did this I got answer from the system when I enter the followings:
minicom -b38400 -D/dev/ttyAMA0
that such file or directory not available

So what can I check next ?

Please write down the commands.
I assume that I have to enable serial port again and then open minicom and check the RFM69Pi if it’s receive packets or not.

Thanks for you support

Dear Glyn,

If I click on the http://emonpi:1880 I got a feedback on my pc that website is not available.

on some networks hostname lookup does not work. You will need to replace emonpi with your emonPi’s local IP address. If you’re on windows, you could try http://emonpi.local:1880

Dear Glyn,

I will try it once I go home.
Turn back to your scrip suggestion.
How can I run this script on raspi ?
What would be the result of the script running ?

I would like to realy recover my sytem back to life, and I’m wondering, If after a totall system installation (I erased the partitions from the sd card and I mounted again the lates img file) my system doesn’t recovered, hence not to many things changed. I didn’t removed the rfmpi69 from the IO port, I just modified tha Emon TX ino files with the modified calculation values, and than the system collapsed…
Sorry for the too many question, but I’m not so good in RPI/Linux usage, But I 'm on the right way with you to learn a lot abouth it.
If you sad that If I order a prebuilded SD card to exclude that I made something wrong during update or install the system I will do it. But I would realy now if it’s a softwer problem or hardwer problem.
Do I have any waranty for the RFM69 board if we detect that it’s failed ?
I read on another topic that some watchdog issue happen and it cause freeze on rfmpi69 Node change and some other thing as well :
RFM69Pi stops updating/freezes - #10 by adpeace

Do I have to read those forums depper or the issue solved in new version (I bought 3 weeks ago the modul)

Thanks a lot for sour support.

Correct. it means that what ever is being transmitted by the emonTx is most likely being received at the rfm69pi, that the RF part appears to be working ok.

That one test does not tell us that the packet is valid or that it is being passed on to the serial port, but it is still a good sign,

Correct. Those commands belong to a redundant utility called rpi-serial-console that used to be installed on the older SD card images, but not the latest.

As previously mentioned, the image should already have the serial console correctly disabled and yes it is essential this is the case, you should not need to do it on a pre-built image but now you may have altered it’s state you must do some checks to be sure it is correct.

There are currently 2 things needed for the serial UART to work. Firstly “console=serial0,115200” must NOT be present in /boot/cmdline.txt, if it is remove it, and secondly IF there is a “enable_uart” setting at the end of /bootconfig.txt,it should be set to “=1” not “=0”. This second part is only found on some later builds so it depends on whether you have updated the original image with apt-get or not or if you built your own image, whether it is needed. (note the emonSD image also has some additional serial mapping mods for Pi 3 but hopefully they will not affect your Pi 2)

AND REBOOT for any adjustments to take effect.

Then stop emonhub using sudo service emonhub stop and try minicom -b38400 -D/dev/ttyAMA0, if you get the same "file or directory not available" response try using sudo minicom -b38400 -D/dev/ttyAMA0`. If still no joy, show us what is listed by the following command?

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

this should list all available serial/usb devices eg.

pi@raspberrypi:~ $ ls -la /dev/{tty{AMA,S,USB},serial}*
ls: cannot access /dev/ttyS*: No such file or directory
ls: cannot access /dev/ttyUSB*: No such file or directory
lrwxrwxrwx 1 root root          7 Oct 31 16:31 /dev/serial1 -> ttyAMA0
crw-rw---- 1 root dialout 204, 64 Oct 31 16:31 /dev/ttyAMA0

If there is any activity seen in minicom report it here so we can take a look and check the configuration.

If there is any uncertainty over whether the serial port is functioning correctly or not, you could load a regular Raspian image to your SDcard to test the rfm69pi, this will firmly exclude any possibility of something else trying to access the serial port (eg emonhub) whilst testing and ensure any pre-existing emonSD serial port settings are not conflicting with the more recent “enable_uart=0” setting.

Since both the “serial” settings are on the /boot partition you can make these changes prior to putting the sd card in the Pi and it should be correct on first boot

Dear Paul,

I checked commandline.txt no content included for serial port.
Then I stopped emonhub but minicom still send answer that no such file in directory.

ls -la /dev/{tty{AMA,S,USB},serial}* command can’t executed, just:
ls la /dev/{tty{AMA,S,USB},serial}*

I got answers that :
can’t acces to /dev/ttyAMA no such file in directory
can’t acces to /dev/ttys no such file in directory
can’t acces to /dev/ttyusb no such file in directory
can’t acces to /dev/serial no such file in directory

Dear Paul &Glyn,

I realy don’t understand something.
If I install the latesd image file to the Raspi (emonSD-03May16.img), and than I do the follows :

rpi-rw
sudo apt-get update & sudo apt-get upgrade
sudo apt-get dist-upgrade

Do I need to do anything else on the Raspi to let work with the RFMpi69 ?
According the investigations what we did till now the serial port disabled as it’s written in the latest image file.
I decided again to erase all the partition from the SD card, and format again, than I mount the emonSD-03May16.img. again, I insert it to the raspi and I did the following upgareds:

rpi-rw
sudo apt-get update & sudo apt-get upgrade
sudo apt-get dist-upgrade

But the situation still the same no input received on emon cms, even if the red /green led’s are blinking.

Afternoon I try again minicom terminals hence I don’t understand, last time why I failed to run it (see my previous post …

What can be the problem If I have “virgin” new installed and updated system, new PCB boards EmonTX,
RFMPI69, nothing changed… I think just a small issue can be which cause this freez to me.

I assume, that righ now after the 3rd. installation the Serial port disabled (by latest img).
So now to check the RFMPI69 serial communication I have to enable the serial port somehowe.

Please write to me how can I enable the serial port to check with minicom the communication.
An how I have to disable afterwards.

Dear Glyn I can enter to nodeRed, where I have to enter the scrip exactly ?

What will be the output, or what will happen after I run the script ?

Thanks the support.

You shouldn’t need to do anything, but I cannot be sure and if you are having repeated problems there is a strong possibility there is an issue caused by updating, unless of course there is a hardware/firmware issue with the rfm69pi that cannot be confirmed because you are unable to do controlled testing in a known good environment,

The original image definitely worked before updating, but some users have reported issues after updating the Raspbian OS and packages through apt-get dist-upgrade but as far as I know there are no known issues, Glyn says it is ok to upgrade on a RPi 3 but I have no idea about a Pi 2, and new upgrades come out all the time, what was ok yesterday might not be today.

As I have said there is some serial port mapping on the emonSD image intended for the Pi 3, as changes are made to the Raspbian OS image I cannot predict if that will definitely play nicely with the emonSD settings for all Pi’s.

You would have been better to install a “virgin” emonSD image and not update it until after we have it working, But better still, just install a stock Raspian Jessie with “console=serial0,115200” deleted from /boot/cmdline.txt and install Minicom, nothing else, do not update or upgrade it. Then we can test the rfm69pi properly.

Until the rfm69pi is producing data nothing else matters, it is your data source for the Pi, the data goes rfm69pi => emonhub => publish to mqtt => nodered or emoncms etc. If emonHub see’s no data it cannot publish data to mqtt, if there is no data on mqtt, neither emoncms or nodered will get data.

If you install a stock Raspbian OS image as described I will try and help you further, please try and focus on the one problem, once we know your rfm69pi is passing data you can switch to the emonSD knowing there is data coming in, until you know that you cannot make any progress.

The serial port is definitely enabled on the pre-built image. I can see from reading your posts on the top of this thread that your RFM69Pi was working fine in the past.

I think I know the reason why Emoncms is not updating, it’s caused by the dist-upgrade updating the version of Mosquitto. I won’t go into details you can read this thread if your interested:

To fix you need to run emonPi update via local Emoncms (Setup > Admin > emonpiupdate) then reboot. Mosquitto MQTT server should now be running. You can check with:

sudo service mosquitto status

and view the log, you should see mosquitto version 1.4.10

head /var/log/mosquitto/mosquitto.log


Even if the data is not getting any further than emonHub we should be able to see the serial data coming directly from the RFM69Pi. You can view the serial data using minicom:

sudo minicom -D /dev/ttyAMA0 -b38400

Stopping emonhub is not necessary. When minicom is open press ‘v’ to return the RFM69Pi’s version number and RF config. Exit minicom with [CTRL + A] then [X then Enter]. Please paste here any data you see in minicom.

If you are still not having any luck I could send you a replacement RFM69Pi to test next week

Dear Paul, Glyn,

Thanks for your detailed information.
I removed the RFM69PI and connected to a PC via RS232-TTL converter.
I receved the followings:

My observation is the following not every packet received hence I put 3 cm next toeach other the emon tx and the RFMPI69. Sometime only the 5th or 6th packet received, than the following 2-3 received than 6 not again.
But apart from that the RFMP69 provide received data.
Please check it if the data format is the correct one according theprintscreen.
Now I destroyed again all the partition and mounted the (emonSD-03May16.img) to the SD card.
I didn’t made any update, just push the card in and run the PI.
I can confirm, that still no Input visible in emoncms.

To sum up, it seemt that EmonTX send data and RFMPI69 receive packets and the serial communication works on the RFMpi69 modul.

What doI have to do for checking ?
Thank you for your patienty in advance.

Great, so the RFM69Pi is working !

Can you run minicom on the Pi:

sudo minicom -D /dev/ttyAMA0 -b38400

Is the RF69Pi fitted onto the Pi as showin in the photo?

Dear Glyn,

yes I fitted acc. photo.
yes the minicom runing, but don’t show received packet
Please take consideration that I just putted the virgin latest img file, no update is done, no any other command entered just now the minicom.