Can't make new RFM12Pi start

 
 

Hi everybody.

 
I've recently purchased a RFM12Pi and I'm trying to use it in a Raspberry Pi B+. Before connecting it I've followed this howto https://github.com/emoncms/emoncms/blob/bufferedwrite/docs/install.md

I had removed all the ttyAMA0 bits from /boot/cmdline.txt and did the other steps from the guide. I've checked that I can enter emoncms, register a new user, but I have no inputs. Looking at emonhub.log I see:

ERROR Unable to create 'RFM2Pi' interfacer: Attempting to use a port that is not open

I've googled around to see how could I run more checks. I've tried minicom (even with root user) using:

minicom -b 9600 -D /dev/ttyAMA0

I've checked before there were no python process using the serial port (ps -ef|grep python shows nothing, and I've ran too the localemoncms-disable script). Minicom starts but it stops at the "Press CTRL A+Z ..." line. It stills works, since I can press CTRL A commands, but I can't enter any other type of command (I wanted to light the led using 1l) or I don't know how to use minicom. I can't see any line beginning with > to write a command or anything related to the RFM12Pi.

It is well fixed in the GPIO pins. I've read it comes with a firmware pre-installed so I guess I should see something in minicom but, to be honest, I'm not sure.

Could someone tell me a basic test just to see if the RFM12Pi works? (like switching on the led) I'm a total newbie in this, so maybe I have emoncms running or something is interfering and I want to be sure my RFM12Pi is not faulty :(.

Many thanks in advance,

Kokop.

P.S. By the way, I've seen older howtos talking about rfm12piphp. There is no "/var/www/emoncms/Modules/raspberrypi/rfm12piphp" folder in my emoncms installation. Should I download it somewhere?

 
 
 
 
 
 
 
 
 
Paul Reed's picture

Re: Can't make new RFM12Pi start

P.S. By the way, I've seen older howtos talking about rfm12piphp. There is no "/var/www/emoncms/Modules/raspberrypi/rfm12piphp" folder in my emoncms installation. Should I download it somewhere?

No, the rfm12piphp is the forerunner to emonhub, and you can only have one listener at a time installed, so no, lets sort out the problem without adding to it!
pb66 is developing emonhub, and will hopefully pick this up, but in the meantime, is the emonhub configuration file details correct? - 

$ nano /etc/emonhub/emonhub.conf

And in that config, there is an option to change the error logging to 'Debug' (if you haven't already done so) which often provides a bit more detail and can help.

 

Paul

Kokop's picture

Re: Can't make new RFM12Pi start

Thanks for your help, Paul.

It still doesn't work, but I've found one important problem. There was no emonhub.conf at all because it looks like I didn't install dev-emonhub properly and I don't know why. I remember I did it (I remember because the guide says dev-emonhub/install.sh instead of dev-emonhub/install and looking at my history commands I see I did ran both versions), but maybe it failed because I didn't attach the RFM2Pi during the install? Whatever, it was my fault. I reinstalled it and this time it looks every file is in their correct place.

However the symptoms are the same. Your tip was very good and I put logging at debug level. Now, I see this in the log:

2014-12-20 23:10:14,275 INFO Creating EmonHubJeeInterfacer 'RFM2Pi'
2014-12-20 23:10:14,279 DEBUG Opening serial port: /dev/ttyAMA0 @ 57600 bits/s
2014-12-20 23:10:16,287 DEBUG Opening serial port: /dev/ttyAMA0 @ 9600 bits/s
2014-12-20 23:10:20,307 INFO RFM2Pi device firmware version & configuration: not available
2014-12-20 23:10:20,313 INFO Setting RFM2Pi frequency: 433 (4b)
2014-12-20 23:10:21,325 INFO Setting RFM2Pi group: 210 (210g)
2014-12-20 23:10:22,329 INFO Setting RFM2Pi quiet: 1 (1q)
2014-12-20 23:10:23,333 INFO Setting RFM2Pi baseid: 15 (15i)
2014-12-20 23:10:24,368 DEBUG RFM2Pi acknowledged command: > 4b
2014-12-20 23:10:24,837 DEBUG 1 NEW FRAME : 1419117024.84 config failed> 210g
2014-12-20 23:10:24,847 WARNING 1 Discarded RX frame 'non-numerical content' : ['config', 'failed>', '210g']
2014-12-20 23:10:25,296 DEBUG 2 NEW FRAME : 1419117025.3 config failed> 1q
2014-12-20 23:10:25,713 WARNING 2 Discarded RX frame 'non-numerical content' : ['config', 'failed>', '1q']
2014-12-20 23:10:25,949 DEBUG RFM2Pi acknowledged command: > 15i
2014-12-20 23:14:51,508 DEBUG SIGINT received.
2014-12-20 23:14:51,510 INFO Exiting hub...
2014-12-20 23:14:51,513 DEBUG Closing serial port
2014-12-20 23:14:51,573 INFO Exit completed

Is it that the RFM2Pi has not firmware? I thought it had one preinstalled. Although it looks like the emoncms install works (without the RFM2Pi, but I can log in, there are no mysql errors, and so on), maybe I've messed up something during the installation. Would it be possible to do a quick test with minicom just to see if the RFM is alive?

Right now, I've tried running these commands:

/usr/bin/localemoncms-disable (it looks like everything stops nicely)

sudo service emonhub stop (just in case, it stops nicely too)

ps -ef|grep python (there are no python process running)

sudo minicom -b 9600 -D /dev/ttyAMA0 (I just see till the Press CTRL-A Z message)

 

If I do this:

ps -ef|grep ttyAMA0
root      2883     1  0 23:11 ?        00:00:00 /sbin/getty -L ttyAMA0 115200 vt100

I see that getty process. Is it important? Btw, I'm also accessing the Raspberry through ssh and wirelessly.

Another detail, the led in the RFM12Pi flashes when you switch the Raspberry on. I guess that's good news. After that first flash it remains turned off.

Thanks again for your help and let's hope someone can point me in the right direction!

 
Paul Reed's picture

Re: Can't make new RFM12Pi start

What are you using to send data to your RFM12PI? is it sending data in the correct format?

Paul

pb66's picture

Re: Can't make new RFM12Pi start

Hi Kokop

This is a new one that I've not seen before, the log is telling us that the RFM2Pi is there and responding to commands from emonhub, but it's not happy at all. It accepted the frequenct selection ok but then for some reason it's prefixed the next 2 responses with "config failed" which is not a response that is expected by emonhub (or me for that fact!) and not responded to the 4th command in a 41/2min window. 

The "RFM2Pi device firmware version & configuration: not available" isn't necessarily an issue as it's only available on some RFM2Pi firmwares. 

Right now the issue seems to not be with emonhub.it's either with the serial console or the RFM2Pi (which is unlikely) so please check you have done both of these (cut from another post)

 

Then disable the serial console by editing /etc/inittab and  /boot/cmdline.txt

Firstly edit the inittab file by adding a '#' to the beginning of the last line, so it reads;

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

​...and edit the cmdline.txt file by changing the single line to;

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

 

I suspect you have not done the first one or at least not rebooted since, for the change to take effect. 

Paul

 

Kokop's picture

Re: Can't make new RFM12Pi start

Oh, that was the problem! As you suspected, I didn't comment out that line in the inittab file. In my defense I'll say I'm using an existing raspbian install where I didn't want to make a new partition for the data (as the guide says), so I overlooked that bit.

In short, it was my fault for not following the install steps. Now I can switch the RFM2Pi led on and off through minicom, so now I'll start to setup some TinyTx sensors around my home and put them in emoncms.

 

Thanks for your help!!

Comment viewing options

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