Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Antenna rx gain too low - how to adjust 'pout'? #100

Closed
webash opened this issue Feb 27, 2019 · 19 comments
Closed

Antenna rx gain too low - how to adjust 'pout'? #100

webash opened this issue Feb 27, 2019 · 19 comments

Comments

@webash
Copy link

webash commented Feb 27, 2019

I sent back my mi|home hub in favour of getting the ENER314-RT module so I could roll my own energy monitoring with this library and OpenEnergyMonitor (emonCMS). However, I've found the RX range of the module to be underwhelming in comparison to the hub, despite the antenna and the rest of the architecture seemingly being the same.

When I contacted Energenie support, they came back with this:

The Antenna is the correct size for the frequencies used.  The ENER314-RT was intended for hobbyist use and it will be possible to optimise the antenna's gain by modifying the software.  

Pout range:  -1 to 13dBm in 1dB steps

Is it possible to do as they've stated while using the pyenergenie library?

@whaleygeek
Copy link
Owner

Indeed. I will add a configuration option to the software to set power level for you, this is a great idea! A quick hack if you are in a rush would be to change one of the initialisation table entries in drv/radio.c and re run the build script. I will look up the datasheet later and point you to which entry to change.

@whaleygeek
Copy link
Owner

Register 0x11 sets Pout...

screen shot 2019-02-27 at 23 14 54

screen shot 2019-02-27 at 23 19 18

However, a value is never written to this register by the config table, so it should be at default, which looks to be already at the highest Pout. It is possible that this default is too high and the (enabled) current trip is firing. So you could try lowering the power level slightly (I know that sounds counter intuitive).

It will be a while before I have the time to reconstruct my test setup and measure the end to end system effects of this with a power meter, so don't wait for me.

Add 0x11 for address, and follow the PA configuration suggestions in the attached screen shot to select a non-default value, and see if it improves your range.

Add the address/value to both config tables here:

https://github.com/whaleygeek/pyenergenie/blob/master/src/energenie/drv/radio.c#L124

Then while cd'd into the drv folder, run

./build

To rebuild the .so library, and re-run the Python.

Radio power is affected by inverse square law...

https://www.rfvenue.com/blog/2014/12/15/when-it-comes-to-rf-distance-plays-tricks-with-the-mind

[quote] Think of it this way: double the distance, and you get four times less power. This works the other way around, too, and is crucial to the point we're trying to get across here: halve distance, and received power is increased four times over. So, while you can't always have the freedom to move a receiver as close as you want, shortening the distance by just a few inches can counterintuitively produce dramatically better signal, because of the inverse-square relationship...

You could run a repeat loop that turns your switch on and off repeatedly, and measure the edge of the reception range line of sight - change the register, re-build and re-run and see if the reception range changes.

Hope this helps.

@webash
Copy link
Author

webash commented Feb 28, 2019

Hey! Thanks for this! Super detailed and helpful in comparison to energenie support! I'll give this a go over the weekend. At the moment I seem to have jimmied a workaround by wedging a key into the antenna! Haha! It can now successfully see the Whole House Monitor in the meter cupboard.

However, I do need that key so I will be trying this soon.

@webash
Copy link
Author

webash commented Jun 4, 2019

I never got around to trying this. My literal key hack is still in place. I'll come back and provide an update when I finally do, as I'd still like the key not to be necessary...

@whaleygeek
Copy link
Owner

@webash I spoke to Energenie about this a few weeks ago.

The issue is probably RF related, they said (and I agree) that grounding, antenna positioning and other physical effects of construction will have a negative impact when using a plug on board for the Raspberry Pi.

For their MiHome hub, they would have been able to have full control over all system design parameters, but with an attachment board for a (third party designed) Raspberry Pi, they don't have full control over the whole system, so cannot optimise it as a system.

Your key hack sounds a good one actually, I wonder whether you have effectively doubled the antenna length as a result, so it's a half-wave rather than quarter-wave??!!

@webash
Copy link
Author

webash commented Jun 12, 2019

Yeah definitely understand the challenges of a radio attached to unknown other hardware. I've tried the antenna in all sorts of angles, positions and so on; but the only reliable method was this 'key hack'. As I'm using the Raspberry Pi 3B+ with the official AC adapter, I would've expected it to be as close to 'standard' as possible. Perhaps it is worth trying other adapters; otherwise nothing else is connected to the board (except the official case, with the lid off).

You might be quite right about the antenna length! When I contacted support about this they weren't super helpful, other than providing this information about changing the pout. I do still intend to experiment per the help you gave above, it just hasn't been convenient to dig into that level.

@webash
Copy link
Author

webash commented Feb 7, 2020

I haven't yet tested whether I can remove the key, but I was getting further interruptions on communication from the whole home energy monitor... I then remembered something about RF interference on the Raspberry Pi when using WiFi... so I disabled WiFi and Bluetooth using the boot configuration options... and boom... no more intermittent signal to the whole home unit... so perhaps that has been the problem all along. Will let you know whether I can now remove the key entirely :)

@Achronite
Copy link
Contributor

Achronite commented Apr 29, 2020

Will let you know whether I can now remove the key entirely :)

Just to let you know, I also had issues with range on the ENER314-RT, which I have fixed using the same method I used on my ENER314 board, - by soldering a 173mm piece of straight wire, but this time i had to solder it to the existing coil antenna; making sure that you solder it on the side that attaches to the electronics on the board; it works really well.

@webash
Copy link
Author

webash commented Apr 30, 2020

@Achronite this is amazing knowledge! any further details about the gauge of the (copper?) wire, or perhaps a picture of where exactly you soldered it? I don't currently have a soldering iron, but this might be a good excuse to finally do so, because it would be nice to not have my range impacted every time I need to check the power and water meters 😄

@Achronite
Copy link
Contributor

Achronite commented May 2, 2020

20200502_104654
I just used a solid core interconnect wire (0.5mm-ish), the key is to make it exactly 173mm long to match a quarter wavelength. I suppose copper would be best, I'm not entirely sure what my wire is. Having it straight up also helps.

@webash
Copy link
Author

webash commented May 3, 2020

Amazing! Thanks very much!

@webash
Copy link
Author

webash commented May 8, 2020

Done! Still losing about 1 in every 10 or so packets, but there are a lot of thick walls and building risers between the whole home monitor and the Raspberry Pi; so I'm more than happy that this is better than having a key wedged in it!

@Achronite
Copy link
Contributor

It's more likely that it's radio interference causing the dropout. Loads of stuff operates at that frequency. I built in auto-retry into my node-red plugin to get round this.

@webash
Copy link
Author

webash commented May 18, 2020

If I hadn't sunk in a bunch of time into (somewhat unnecessarily, but it was fun) building a wrapper around pyenergenie to push to MQTT, then I'd probably switch to your Node Red plugin; thanks for keeping watch/suggesting things back in this repo.

@genestealer
Copy link
Contributor

20200502_104654 I just used a solid core interconnect wire (0.5mm-ish), the key is to make it exactly 173mm long to match a quarter wavelength. I suppose copper would be best, I'm not entirely sure what my wire is. Having it straight up also helps.

@Achronite You need to cut the original loop (or de-solder it).
image

@Achronite
Copy link
Contributor

@Achronite You need to cut the original loop (or de-solder it).

@genestealer It didn't seem to matter for me, I got the signal boost I needed, and leaving it connected seemed less destructive to me.

@whaleygeek
Copy link
Owner

whaleygeek commented Nov 27, 2023

The Pout is chosen to fit within the spectrum power mask requirements for that channel, but Pout is not directly related to ERP (total system power) as there are many other factors. The MiHome hub has a proper groundplane design and the radio placement is such that ERP is maximised for the given Pout. On the Raspberry Pi with the RT board attached, the RF performance will be worse, because grounding and RF interference from the CPU would not have been optimised as a whole system.

@genestealer
Copy link
Contributor

Absolutely agree about interference from the CPU. I'm currently using a free samtec ribbon cable sample to extend the pinheader, so the transmitter board is outside of the metal Pi enclosure I'm using.

I've also ordered an antenna with cable which I will solder the wire directly to the board in place of the existing coil antenna. https://a.aliexpress.com/_EGOLbrf

@genestealer
Copy link
Contributor

Ops, I forgot I had already done this mod!
Antenna shield is connected to the 433MHz module GND pin.

image
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants