rmf69 and emonhub install, etc

I am using my existing Raspberry with an attached HDD. I've already installed emoncms and can log into the screen. I just received the emontx and rmf69 modules today. Some questions on set up:

1) how do I install the rfm69 on the raspberry? googling didn't help? do I need an antenna, where to attach, how long and what wire? Which way does the rmf69 install onto the Raspberry?

2) I installed emonhub but something is wrong. I get this when starting emonhub:

 service emonhub start
[....] Starting OpenEnergyMonitor emonHub: emonhub has been started okstart-stop-daemon: unable to start /usr/share/emonhub/emonhub.py (Permission denied)
. ok

the emonhub.log file exists but is empty so not much help.

3) for the emonhub.conf, I used the read/write key from the emoncms page. Right? Since I'm running emoncms locally, I assume I need to uncomment the url line, Right?

3a) in the section for rmf2pi, I assume that also works for rmf69? I'm using group=210 and baseid=10 - is that correct for emontx?

4) finally, if I have no CT's attached to the emontx, is anything transmitted? (I need the 3.5mm plugs to connect the CT's, just want to get the emontx talking to the raspberry)

Thanks,

 

Robert Wall's picture

Re: rmf69 and emonhub install, etc

I can answer No.4 - yes, you should get a transmission. If you're running the sketch that I think you will be (I say that because I believe that the default sketch is changing about now), it will consist of 6 integers: 4 powers, voltage and a temperature. If you're looking directly at the received data, that of course is 12 bytes. The 4 powers and temperature will be zero, only the voltage will be meaningful. A red LED inside the emonTx just to the right of the ac input socket should flash once every 10 s approximately.

A worrying question about your RFM69 - did you order an RFM69CW or an RFM69Pi? The RFM69CW is the bare radio module, you need the RFM69Pi assembly to plug into the Raspberry Pi. And yes, you do need the correct antenna. A whip 175 mm long for 433 MHz or 87 mm long for 868 MHz. You needed to look in Resources > Hardware Wiki for information about the RFM69Pi - there's a picture there showing the assembly plugged into the Pi.

billvolz's picture

Re: rmf69 and emonhub install, etc

Thanks. I did get the CW, I'll need to order the Pi module. Sigh. The Pi module was not listed on the order page under Wireless Modules so was somewhat misled. I'll get the correct module. 

I assume I can just use any wire for the whip.

Also, what is the correct sketch for emontx v3? There are several sketches listed for that version. What's the default one loaded on the emontx?

pb66's picture

Re: rmf69 and emonhub install, etc

1) Although I'm pretty sure there are some pic's and info in the wiki to help fit the RFM69Pi, basically it needs to be seated on the main GPIO connector of the Pi, pins 1 to 10. Holding the Pi so the 2 rows of header pins are onn the right, the top is pins 1 & 2 and the bottom are 25 & 26 or 39 & 40 depending on model. The RFM board plugs into the top 2x5 pins without overhanging the edge of the Pi. ie the overhang of the RFM board points towards the centre of the Pi, obscuring pins 12 to ~24 also.

It should have a short length of wire hanging from the RFM board, that is the antenna and is already the correct length. 

Depending on what guide you have followed you probably do not need to do any further configuring on the Pi. The 2 important things are A) the serial console has been disabled by editing /boot/cmdline.txt (and possibly inittab too if running wheezy) and B) the correct frequency, group and baseid are set in emonhub if not using the defaults of 433MHz, group 210 and baseid 15.

2) The only time I have seen this error is when the emonhub repo has been cloned incorrectly using "sudo" which alters the permissions, the fact it seems happy to proceed with the command "service emonhub start" without telling you you need to be a root user suggests you are running as a user with elevated privilege, which will result in the same error. Be wary of running as root without understanding the implications and making adjustments to accommodate that position, most guides and advice will assume you are not a root user. If this is indeed the cause of the permission issue it is or at least it should be easily remedied with

sudo chown -R pi:pi /home/pi/emonhub

​obviously without the "sudo" if you are running as a root user. 

3) right.

3a) pretty much, except the emonTx is node 10, the RFM2Pi (rfm69) is a different device and should have it's own node id, that's why it's called baseid in emonhub, it is the attached recievers "node id" that you are setting here not the remote emonTx node id.

I have assumed you have followed the general emoncms install guide for the raspberry pi and the emonhub installer as instructed in that guide, if you have done something different lets us know.

Paul

EDIT - You have posted since I started writing this post so some points are already covered, the emontx v3 is preloaded with the latest discreet sampling sketch, which revision will depend on when the firmware was installed and can be checked in a serial console (eg arduino IDE) if you don't have a programmer you should order one with the rfm69pi, they are really useful and pretty cheap.

Robert Wall's picture

Re: rmf69 and emonhub install, etc

Any wire is OK - 7/0.2 stranded is a good choice, but you can use solid if it's unlikely to be moved.

The sketch is a good question. The default one used to be the discrete sampling one (again, see the Hardware Wiki) but I understand it will soon be replaced by a 'continuous sampling' sketch - one of the two here listed in the Software Wiki here: https://github.com/openenergymonitor/emonTxFirmware/tree/master/emonTxV3...
and probably based on the 'beta' version.

pb66's picture

Re: rmf69 and emonhub install, etc

Robert - Is there an intention to default to continuous? I knew there was new firmware on the horizon but will it accommodate battery operation? I guess there is no reason the CM can't be put to sleep like the discreet code.

Paul

Robert Wall's picture

Re: rmf69 and emonhub install, etc

I think there is and I believe Trystan has added in a 'pause' so that battery operation is possible.

billvolz's picture

Re: rmf69 and emonhub install, etc

Thanks Robert and Paul. I've ordered the RFM69PI. I have the UART programming board so should be good to go there. It seems the RFM69PI comes with the antenna installed so nothing to do there. It looks like I just need to install the RFM board and it'll all work. I've dealt with the tty stuff in cmdline.txt and init.d and also set up the emonhub. It appears I installed emoncms prior to when emonhub came out but haven't gotten around to installing the actual hardware until now, hence my confusion. I did install emonhub as root which was causing the problem - reinstalled at 'pi' and it it's working now. In emonhub.conf, except for uncommenting URL and adding the API code, I've left everything else the same. Now to wait until I get the correct RFM board.

Thanks again

pb66's picture

Re: rmf69 and emonhub install, etc

"I installed emoncms prior to when emonhub came out" 

Ok, emonhub has been the only OEM recommended interface on a Pi for well over a year now.

"I am using my existing Raspberry with an attached HDD. I've already installed emoncms and can log into the screen. I just received the emontx and rmf69 modules today. Some questions on set up:"

This sounds very much like you are just starting out with your OEM setup and using a Pi and hdd that you already own rather than you are returning to a previous partial install.

Apologies for any assumption on my part but I try to avoid answering a question with a flood of boring questions like, what version are you running? what guide did you follow? what method did you use? if I can.

All the answers given assume you are on the latest OS currently the final wheezy release or the newly released Jessie. Emoncms is currently at v9.3 and has some big changes since v8.x, whether you can update to v9.3 easily will depend on what you have. Which guides you followed may alter things significantly too.

Unless you have very recently install emoncms v9.x following the latest guides to an up to date Raspbian OS then starting from a fresh format/image is strongly advised if you currently have no data to save. 

Paul

Comment viewing options

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