whaleygeek / pyenergenie

A python interface to the Energenie line of products
MIT License
81 stars 51 forks source link

ENER314-RT / RF69 and multiple power strips? #106

Open megatron-uk opened 5 years ago

megatron-uk commented 5 years ago

Hi,

Is there any method for a single ENER314-RT to control more than one ENER010 4-way power strip?

I've got 5 or 6 of the ENER010 strips (and probably need a few more, eventually) in my AV/gaming room and want to replace them all (and the dozen fiddly little remotes) with a touchscreen controller powered by a Pi.

I'm having difficulty working out whether it's actually possible to do that, or whether the ENER314-RT has to be paired to a particular socket or power strip first. All of my kit is the older, green button devices.

I see there isn't a way (short of leaving the Pi to try every single address) to identify remote id's yet though.

John

whaleygeek commented 5 years ago

I suppose the question now is, are you able to get it all to work on different GPIO pins, so that it will work with your SPI display fitted?

Regarding the higher power board, it would be worth looking for an arduino/adafruit bit of demo code that drives that radio and compare the suggested OOK register settings for PA setup with those that we use in pyenergenie config tables in radio.c - it's possible that the higher power radio needs different settings to get the best from the fitted antenna.

Also, if it is a different variant of the HRF69 chip, it would be worth comparing the two data sheets to see if they have added additional registers for the higher power radio, or whether the higher power setup is mostly due to the external passives fitted to the board.

I think there is generally more work to do on radio power anyway, as anecdotal evidence from other users suggests that the RT board doesn't generally have the range that the MiHome hub has. That could be entirely down to RF noise generated by the faster processor on the Raspberry Pi compared to whatever is fitted inside the MiHome hub, but it's on my list to investigate further when I have some time.

whaleygeek commented 5 years ago

I just re-read your message and noted this:

but it's a specific combination of house code and radio module.

Yes, that is very strange!

megatron-uk commented 5 years ago

I suppose the question now is, are you able to get it all to work on different GPIO pins, so that it will work with your SPI display fitted?

Yes, it does indeed work on the alternate software SPI pins (33-40) I mentioned previously. I changed some of the .c files to instead include a config.h so that they only now need changing in one place - I'm also redoing the debug logging in there as well. Would you mind a pull request at some point for those changes?

I've yet to plug the screen back in, but it should be fine back on the hardware SPI pins. First I'd like to solder up the connections on that RF69W board a bit neater and do something about the antenna - there are no pads for a edge-mount sma connector, so that sucks a bit.

whaleygeek commented 5 years ago

Great, good progress!

Yes, PR's accepted as long as it's 'obvious' how it was tested and it didn't break anything, as it will be a while until I can unbox all my kit and work on it again - i.e. I'll have to trust that your testing was ample.