SOLVED Problem with new Jeelink not receiving data from emonTX v3.4

I just bought a Jeelink v3c to try and help me diagnose a problem with RF issues (see http://openenergymonitor.org/emon/node/10900 ) but I am having a few problems. As usual, it could be me missing something obvious, and if so, once fixed, then maybe this posting will help others avoid similar issues.

Basically, my new Jeelink is not receiving the data that the emonTX is sending. I have an RPi with RFM69Pi and it is able to receive the data, so I can't understand why the Jeelink is showing nothing. The Jeelink also has the RFM69CW configured with same network settings as emonTX and RPi

The Jeelink is connected into a USB port on my windows 7 laptop. When I first connected the Jeelink Windows offered to find a driver, which I cancelled assuming it wasn't required, but then when Arduino IDE did not see a new comport, I went into Device Manager and told it to find a driver, and it found and installed an entry under USB Controllers called USB Serial Convertor using FTDI v2.10.0.0 and also a port called USB Serial Port (Com6) with FTDI v2.12.0.0. The details for the port includes a tab called Port Settings which is set to 9600bps 8/n/1 and no flow control. After allowing windows to install these two devices, Arduino then found com port 6, and serial monitor connected, although I had to set to 57600 baud, and then the menu from RF12demo appeared. 

The Jeelink came pre-installed with RF12demo.13 on group 212 and nodeID 1, so I changed the group to 210 and left the node at 1. There were no lights on the Jeelink (I wasn't sure if there should be), but the rf12demo sketch appeared to be working, so I played around, expecting it to show the packets being sent every 10 seconds by my emonTX which is also on group 210, 433Mhz, and I know it's sending data, as the RPi is receiving it. 

However, if I tell the Jeelink to send a packet to the emonTX (node 10) or the RPi (node 15) and request an ACK,it works - the Jeelink reports success, and the log on the RPi shows the packet received. Here is an example sending the full 66 byte test packet using the t command. I issued it twice, although I get slightly different response in serial monitor

Serial Monitor on Jeelink:

> 1i
 A i1 g210 @ 433 MHz

> 0t
test 0 -> 66 b
> 0t
test 1 -> 66 b
OK  193 afc=0 fei=0 (-31.5dB)

From the emonhub.log:

2015-07-11 09:04:56,340 DEBUG 872095 NEW FRAME : 1436605496.34 OK 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 (-33)
2015-07-11 09:04:56,353 DEBUG 872095 Timestamp : 1436605496.34
2015-07-11 09:04:56,355 DEBUG 872095      Node : 1
2015-07-11 09:04:56,357 DEBUG 872095    Values : [256, 770, 1284, 1798, 2312, 2826, 3340, 3854, 4368, 4882, 5396, 5910, 6424, 6938, 7452, 7966, 8480, 8994, 9508, 10022, 10536, 11050, 11564, 12078, 12592, 13106, 13620, 14134, 14648, 15162, 15676, 16190, 16704]
2015-07-11 09:04:56,360 DEBUG 872095      RSSI : -33
2015-07-11 09:04:56,435 DEBUG 872095 Append to 'emonCMS' buffer => time: 1436605496.34, data: [1, 256, 770, 1284, 1798, 2312, 2826, 3340, 3854, 4368, 4882, 5396, 5910, 6424, 6938, 7452, 7966, 8480, 8994, 9508, 10022, 10536, 11050, 11564, 12078, 12592, 13106, 13620, 14134, 14648, 15162, 15676, 16190, 16704, -33], ref: 872095
2015-07-11 09:04:56,539 INFO emonCMS sending: http://emoncms.org/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[[1436605496.34,1,256,770,1284,1798,2312,2826,3340,3854,4368,4882,5396,5910,
6424,6938,7452,7966,8480,8994,9508,10022,10536,11050,11564,12078,12592,13106,13620,
14134,14648,15162,15676,16190,16704,-33]]&sentat=1436605496
2015-07-11 09:04:56,577 DEBUG RFM2Pi confirmed sent packet size:  -> ack
2015-07-11 09:04:56,708 DEBUG emonCMS acknowledged receipt with 'ok' from http://emoncms.org

When the packet was sent from Jeelink to RPi, the green and red LED's on Jeelink blinked briefly, and this was the only time I see them light up. 

I then used minicom on the RPi to send a test packet from the Rpi, and this appeared in the Jeelink:

A i1* g210 @ 433 MHz c1
OK  47 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 afc=0 fei=0 (-30dB)

 

 

So this suggests all 3 nodes are in the same group, and I have 2 way comms, but still the Jeelink doesn't show the traffic coming from the emonTX (ironically this is almost the opposite of my original problem where my RPi recieves more traffic than it should !)

I am assuming that the emonTX is sending packets as broadcast (no destination ID), but in case it does set the destination ID I tried setting the Jeelink to node ID 15, which is the ID of the RPi, but still no data arrived. 

I am going to try loading RFdemo.12 onto the Jeelink, and see if that makes any difference...

 

Edit - wrapped long lines - BT

Ian Davies's picture

Re: SOLVED Problem with new Jeelink not receiving data from emonTX v3.4

OK, so an update - after a fair bit of faffing, I managed to get RFdemo.12 loaded into the Jeelib, and then serial monitor greeted me with "[RF12demo.12] " and nothing else - no menu of commands, no packet output, no response to any commands that I entered into the console - even the 'v' command to display version was ignored.

However, I knew that the RF12demo.12 that I had loaded had "#define RF69_COMPAT 0" and after I changed it to 1, and compiled and uploaded, then everything worked ! Serial console shows the full menu, and, low and behold, it also shows the packets from my emonTX ! At Last !!

So, it looks like something in the new .13 version of RF12demo was preventing the Jeelink from displaying packets from my Emon TX.

 

For info, in case it helps anyone else, I was struggling to compile (or even verify) the older version of RF12demo because of a problem in my Arduino IDE: Whenever I tried to verify RF12demo it would hang half way through, doing nothing. The last line in the detailed output referred to core.a, and no matter how long I left it, the verify got no further. I eventually noticed that the compile output mentioned a copy of the RF69.cpp file that I had created, and once I deleted the copy of the .cpp, the verify (and compile) completed as expected. So, whilst this ws my fault (I am definitely a newbie when it comes to the IDE, and modifying .cpp files), the IDE was not very helpful in providing any clue as to what was going on, making it much harder to find and fix. Before finding this I had un-installed the IDE and re-installed as well - all to no avail. Ah well, I learnt something. 

pb66's picture

Re: SOLVED Problem with new Jeelink not receiving data from emonTX v3.4

Hi Ian,

I think you did the right thing to load RFdemo.12. I'm not entirely sure what "actual" firmware was pre-installed on the JeeLink. RFdemo.13 was on it's own branch of the Jeelib repo sometime ago, I have copy as I submitted a pull req to it, but that branch was swallowed into the RFxConsole and the RFdemo.13 changes were not retained.

I did a search on the repo and there is no "RFdemo.13" found, and that is sort of confirmed by the "Where is RFdemo.13?" thread on the forum. 

It's always better to have the source sketch for your device, for reference and as a base for edits etc.

The test packet you received on the Jeelink starts "OK  47 0 1 2 3...." that appears to display an old (.12) issue, where the node id wasn't being masked correctly, the node id is the lower 5 bits of a byte and should be 31 max, unmasked and with the "ack requested" flag set (bit 6 of the same byte) you get node id + 32, ie 47 as the Pi's base id is 15. Since the node id was outside the 0-32 windows emonHub ignored it, without the ack request it may of got through, however the "afc=0 fei=0" in the packet would of then caused a "non-numerical content error" and got discarded anyway.

So you are definitely better off with RFdemo.12 for now.

The Arduino IDE is a bit quirky with libs, you can unexpected results if you have more than 1 copy of any lib, it's something to be very careful of, delete, rename, compress or significantly move all but the 1 copy you want found or it will catch you out, and the IDE won't make life any easier by giving any useful direction as to what the issue is.

Paul

Robert Wall's picture

Re: SOLVED Problem with new Jeelink not receiving data from emonTX v3.4

"if you have more than 1 copy of any lib..."

I can't stress that enough. Renaming the folder/directory is not sufficient, as the IDE appears to ignore directories' names. Also, it's not clear what its search paths are. My advice is to compress and then delete the original - always.

(This concept is totally alien to me - I don't know any other IDE that behaves in that way and hides and doesn't clearly document important issues like that.)

Ian Davies's picture

Re: SOLVED Problem with new Jeelink not receiving data from emonTX v3.4

Paul, Robert, Thanks for your help and replies.

I found *a* copy of RF12demo.13 here although I can't be sure it's exactly the code that was running on my Jeelink.

Thanks for the pointers about libraries - I will probably now leave this thread and go back to updating the my previous post which deals with the original problem

Ian

Comment viewing options

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