No inputs after following pkg-emoncms readme - solved

Hi

Please see my original post in emoncms: clean install in 5 commands.

I discovered that there was no entry in cron to run the RFM12Pi script so added this from a post I found in the forum:

*/1 * * * * root cd /var/www/emoncms/Modules/raspberrypi && php raspberrypi_run.php

After a cold boot the green LED on the RFM12Pi is now off and flashes occasionally showing packets are being received. However I still have no inputs showing in EmonCMS. I have four nodes transmitting on 868Mhz which should result in inputs showing in EmonCMS. EmonCMS is set correctly for group, node and frequency. If I go to the Raspberry Pi tab in EmonCMS, I see the green banner showing that the script is running, but still no inputs.

I've just had a look in the Modules folder on my Pi and there is no raspberrypi folder although I followed the pkg-emoncms readme instructions to install the module. I can only assume I'm not understanding what is going on:-)

 

Terry

 

Just seen that the green banner in EmonCMS is now orange and showing that no packets have been received for 30 seconds.

 

 

pb66's picture

Re: No inputs after following pkg-emoncms readme - solved

I think you should have a raspberrypi folder at

/usr/share/emoncms/www/Modules/raspberrypi

and rather than a cron entry  it's started with this file

/etc/init.d/rfm12piphp

at start up or using

sudo service rfm12piphp restart log

during installation

Do you have those files ?

Paul

 

youngsyt's picture

Re: No inputs after following pkg-emoncms readme - solved

I've just checked and yes I do :

 

pi@raspberrypi /usr/share/emoncms/www/Modules/raspberrypi $ ls -al
total 56
drwxr-xr-x  2 root root  4096 Mar 29 20:04 .
drwxr-xr-x 13 root root  4096 Mar 29 20:05 ..
-rw-r--r--  1 root root     0 Mar 30 12:19 importlock
-rw-r--r--  1 root root  2168 Mar 25 07:04 raspberrypi_apipage.php
-rw-r--r--  1 root root  1634 Mar 25 07:04 raspberrypi_controller.php
-rw-r--r--  1 root root   947 Mar 25 07:04 raspberrypi.js
-rw-r--r--  1 root root     0 Mar 25 07:04 raspberrypi_lock
-rw-r--r--  1 root root   126 Mar 25 07:04 raspberrypi_menu.php
-rw-r--r--  1 root root  3658 Mar 25 07:04 raspberrypi_model.php
-rw-r--r--  1 root root 10658 Mar 25 07:04 raspberrypi_run.php
-rw-r--r--  1 root root   590 Mar 25 07:04 raspberrypi_schema.php
-rw-r--r--  1 root root  4687 Mar 29 20:04 raspberrypi_view.php
-rw-r--r--  1 root root  3812 Mar 25 07:04 readme.md

 

and

-rwxr-xr-x   1 root root  639 Oct 15  2012 reboot
-rwxr-xr-x   1 root root 1600 Jun  8  2012 redis-server
-rwxr-xr-x   1 root root 3408 Mar 25 07:04 rfm12piphp
-rwxr-xr-x   1 root root 1074 Jul 14  2013 rmnologin

 

Terry

 

 

 

pb66's picture

Re: No inputs after following pkg-emoncms readme - solved

well that's a good start, i would try commenting out the cron line, reboot and see if raspberrypi_run.php is running

sudo ps -ef | grep raspberrypi_run.php

it should be running if it isn't try 

sudo service rfm12piphp restart log

and check again.

I have noticed some anomalies with my install while looking at this and as I've been doing some experimenting, I'm not sure on what is correct. I will do a fresh install later this evening to check some odd file locations I've discovered.

Paul

 

youngsyt's picture

Re: No inputs after following pkg-emoncms readme - solved

I took the cron entry out and did the reboot. Here's the result of:

 

sudo ps -ef | grep raspberrypi_run.php

 

root      2811     1 89 15:08 pts/0    00:11:17 /usr/bin/php -f /usr/share/emonc
ms/www/Modules/raspberrypi/raspberrypi_run.php
pi        2854  2778  0 15:20 pts/0    00:00:00 grep --color=auto raspberrypi_ru
n.php

 

Looks like it is running. Not sure why grep came back with two entries.

 

Terry

 

 

 

 

Schism's picture

Re: No inputs after following pkg-emoncms readme - solved

One is just the command you ran to find the command, which isn't itself excluded from the search :-)

If you run the restart command with "log" on the end as above, it should leave a log file in /var/log. On my system I can tail that log and watch the packets arrive - that should tell you if the problem is before or after the rfm12pi software interface?

youngsyt's picture

Re: No inputs after following pkg-emoncms readme - solved

This is what I'm getting:

pi@raspberrypi /var/log $ sudo tail rfm12piphp.log
00,18,07,00s
00,18,07,00s
00,18,07,00s
00,18,07,00s
00,18,07,00s
00,18,07,00s
00,18,07,00s
00,18,07,00s
00,18,08,00s
00,18,08,00s

Doesn't look right. From memory my transmitting nodes are on 10, 19, 20 and 21.

Terry

pb66's picture

Re: No inputs after following pkg-emoncms readme - solved

No that doesn't look like its receiving, how frequent are these packets showing in the log? if every 5sec's maybe it's the time being transmitted for emonGLCD unless you have disabled it.

Did you edit /boot/cmdline.txt (requires reboot if edited) you should have 

dwc_otg.lpm_enable=0 console=tty1 root=/dev/sda2 rootfstype=ext4 elevator=deadline rootwait

(sda2 may differ the rest should be the same) and edit /etc/inittab to allow raspberrypi module access to the serial port by commenting out the last line so it reads

# T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

I think it may be the latter that's causing the issue, it wasn't commented out on my system and as I'm not using rfm12pi I wouldn't of known. (restart rfm with sudo service rfm12piphp restart log if edited)

Paul

youngsyt's picture

Re: No inputs after following pkg-emoncms readme - solved

Hi

Changed /boot/cmdline and /etc/inittab and that fixed it.

 

Thanks for taking the time to sort this out for me - you're a good man. Hopefully I'll be able to return the favor sometime.

Next step is to let the software run for sometime to test whether the lock ups I experienced before updating the RFM12Pi software have stopped . Then I'll start trying to get the multi zone stuff working that's being developed.

Thanks again for your help - much appreciated.

 

Terry 

pb66's picture

Re: No inputs after following pkg-emoncms readme - solved

No problem only too pleased to help.

Regards the "locking up" have you tried updating the rfm2pi firmware? I believe the new firmware was updated to target that complaint in particular.

Paul 

youngsyt's picture

Re: No inputs after following pkg-emoncms readme - solved

Yes I have updated the RFM12Pi firmware using these instructions from theRFM12Pi v2 hardware pages. I have an SD card based on Raspbian and nothing else solely to let me do the updates to the RFM12Pi.

 

$ sudo apt-get update
$ sudo apt-get install arduino
$ sudo apt-get install python-dev&&python-rpi.gpio
$ git clone https://github.com/mharizanov/avrdude-rpi.git
$ cd avrdude-rpi
$ sudo cp autoreset /usr/bin
$ sudo cp avrdude-autoreset /usr/bin
$ sudo mv /usr/bin/avrdude /usr/bin/avrdude-original
$ sudo ln -s /usr/bin/avrdude-autoreset /usr/bin/avrdude
$ cd /home/pi
$ git clone https://github.com/mharizanov/RFM2Pi.git
$ cd RFM2Pi/firmware/RF12_Demo_atmega328
$ sudo service rfm12piphp stop
$ avrdude -v  -c arduino -p ATMEGA328P -P /dev/ttyAMA0 -b 38400 -U flash:w:RF12_Demo_atmega328.cpp.hex
$ sudo service rfm12piphp start

 

I'm assuming this will give me the latest version which should help with the lock ups.

 

Terry

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.