Emonhub with Jeelink in Ubuntu: can't decode byte

Arghh… too many virtual machines.
SOLVED NOW!

I had the default user/password as per install scripts (I used your “EmonScripts”, very useful!)
Now emoncms gets data from my from my EmonGLCD. Data sent using MQTT is OK.
Data sent using JSON failed because I wrote “https” instead of “http” in the URL variable.

Now I also get data from my EmonTX… but only if I am very close to it (less that 1 meter).
When I used the raspberry with my old EmonRX (dated 2011) the data was received even if far away in other rooms.

Sounds like the operating frequencies of the two are different.
e.g. one of them is using 433 MHz and the other 868 MHz.

Another possibility is an antenna issue. (no antenna, or cut to the wrong length)

How old is your emonTx, and how old is the sketch that’s in it?

The reason for asking is it has been about 5 years since 868 MHz has been available as an option from our shop. If it is older than that, you can have a 868 MHz module, but if you have a newer sketch and have not changed the frequency, it will be working at 434 MHz.

You don’t need to play with that at all. The node id is 15 by default and once you can take to it over serial you can set the frequency by writing a 8b and group with 210g. The nodeid can be set with 15i, all these settings are held in eeprom and not lost during a reset or power cycle.

This is actually all managed by emonhub so no matter what you write in code or set via serial will be overridden by emonhub when it connects. For example your emonhub.conf shows the base id as 1 so the nodeid of the device will be 1 not 15 once emonhub initializes the jeeinterfacer.

So I would undo that change just to be safe as in short, I don’t know for sure off hand what the exact ramifications are regards the “other 3 bits” as the node id is only the least significant 5 bits.

My emontx uses 868Mhz and was bought in december 2013… (see below)
The sketches inside EmonGLCD and EmonTX are also from 2013.
Transmit power of EmonTX,EmonGLCD is ok… I believe they are running at 868Mhz

The problem is the Jeelink (or its antenna). The antenna is connected using a screw and I believe that something is wrong with that.
I think I will buy a new JeeLink. Any suggestion?

My devices from the shop:

RFM12Pi Raspberry Pi Expansion board kit (868 Mhz - Europe Only) RFM12Pi868

Solar PV Monitor Kit Bundle 868Mhz (Europe only) Euro plug
(emonTx 868Mhz: emonTx 868Mhz kit , CT 1: 100A max clip-on current sensor CT, CT 2: 100A max clip-on current sensor CT, AC-AC Europe: AC-AC Adapter - AC voltage sensor (Euro plug), emonGLCD 868Mhz: emonGLCD 868Mhz kit)

OK, so it’s been working OK for 7 years, so most likely it is not a wrong frequency.

Do you mean the SMA connector?

How long is the antenna overall? If it’s about 110 mm from the bend, it is correct. If it is about 190 mm, it is a 433 MHz one.

I know nothing about JeeLinks, so I can’t comment.

However, if you have a soldering iron and as a temporary test, you could unscrew the antenna and connect a length of wire 82 mm long to the antenna pin of the RFM12B (see the pictures again - it’s the top left corner in each picture). If it comes good - you are right, it was the antenna.

It could be as he is replacing an RFM card on a Pi with the Jeelink on a VM AIUI.

He’s bought an 868 MHz Jeelink for a reason, and changed the code to 868 MHz for a reason, and I would expect that reason to be that, like me, he has an 868 MHz system, which is quite possible given its age.

The answer, @Franz, is if you don’t know or aren’t sure of the r.f. frequency you’re working on, compare the RFM modules on all your items with the pictures.

1 Like

@borpin Yes, I am replacing a defunct Pi with a Jeelink on a Ubuntu VM.
@Robert.Wall I will check pictures, but stuff was ordered for 868Mhz, antennas are short (about 110mm), code on my EmonGLCD uses 868Mhz, code on my EmonTX was left to default (the frequency #define is commented out). My old EmonRX on the Pi had a short antenna and was able to receive signal from EmonTX placed 3 rooms away…I would say that at 99% I have a 868Mhz.

And yes, I have the SMA connector. The signal quality does not change much if I remove the antenna… that’s why I think there is something wrong with it. Tomorrow I will try to solder the antenna on the RFM12B

Worthwhile checking your SMA antenna is compatible with the SMA socket i.e. in the centre there is a clearly a male pin to fit into the opposing female socket. There are many SMA style antenna that have a reverse connector i.e. no centre pin. The resulting air gap will surprisingly pass some signal, but very weakly - hence drastically reducing range.

1 Like

A quick and easy way to test would be to simply push a piece of wire of the correct length
into the SMA socket on the PC board. If it works, that points to an antenna issue.
If it still doesn’t work, then something on the PCB is bad. (SMA socket, solder joint, etc)

image
Good call, emjay.

At first I thought “the only RP SMAs I’ve seen/know about are for wi-fi.”
Turns out they’re indeed available for more than just wi-fi.
e.g.https://www.l-com.com/wireless-antenna-900-mhz-3-dbi-rubber-duck-antenna-rp-sma-plug-connector?gclid=EAIaIQobChMI2t3Qtb-c6wIVCXiGCh1DoguVEAQYDSABEgLoRvD_BwE

At first I tried this approach and I removed the antenna and inserted a 8cm wire into the base of the SMA connector (I do not have a reverse connector).
Signal did not improve. I thought that my approach was not the correct one.
Now I must try to solder a wire to the RFM12B board… but I am scared to damage it.

Are you sure your JeeLink clone has an original Hope RFM12B radio module? They are often cloned as well. Here are a couple of originals that illustrate different radio chip packaging (not relevant here) and target frequency band. The sprinkling of SMD components to the left of the radio chip are filter/matching parts whose values all change according to the target ISM band. By chance, one of the required C values for 868/915 MHz operation is so small, it is omitted completely (upper left edge, near the crystal as marked).

Hopefully your unit eventually springs into life - the RFM12B is quite robust but can be damaged by running full power without an antenna load.

RFM12B_compare

There are more pictures in Learn→Electricity Monitoring→Networking→Which radio module→Identifying different Radio Modules

Hello. Thanks for all the information.
I soldered an antenna wire in place of the SMA-connector antenna. Signal improved a lot and now the antenna seems to work fine (antenna can get signal from a device placed “two doors” away).
I still get some “unreliable signal” sometime but I think I can live with that.
Here is the picture of my device.

CONCLUSION:
Thanks to your help I managed to replace a defunct Raspi+Rmf12b with a cloned Jeelink that was initially set for the “FHEM” environment (had to reflash it).
The Jeelink is connected to a 32bit-Ubuntu 18.04 virtual machine(with emonhub and emoncms) that runs on a 10+y old laptop with “Core2duo” processors. With some tweaking it works quite fine!
I AM HAPPY WITH THIS SETUP!

Side note: I had to use a 32bit ubuntu virtual machine because of my host pc restrictions. For some reason the “emonscripts” did not run fine in a 32bit ubuntu (maybe because it is kind of an unsupported environment). Scripts ran fine on a 64 bit ubuntu 18.04. I noticed that the variables on “config.ini” were not passed to the “main.sh” and so I run the “main.sh” commands by hand.

I’m running emoncms on Proxmox on a laptop. I reused some additional memory but that is a really good solution, especially for backing up.

Good to see you got it going, especially considering your trepidation about soldering. thumbsup

For what it’s worth, regarding:

www.jeelabs.org/jl3 is still dead to this day
but https://jeelabs.org/jl3 (without the www) points to https://web.archive.org/web/20170220045356/http://jeelabs.net/projects/hardware/wiki/JeeLink
which seems to have limited relevant information such as the board schematics etc.