Author Topic: Porting RFM69 library to ESP8266 and hardware sensitive to touching!  (Read 6338 times)

chrille

  • NewMember
  • *
  • Posts: 4
  • Country: dk
Hi,

This is my first post to the forum, and I hope my questions haven't been asked before.

I am trying to port the RFM69 library to run on the ESP8266 module, which I think makes a great module for acting as a gateway between RFM69 based sensors and wifi
Simply changing RF69_SPI_CS, RF69_IRQ_PIN and RF69_IRQ_NUM to match the wiring of the ESP8266 seems to work. I have a RFM69CW module connected to an ESP-12, powered through an AMS1117 regulator. I have a 470 uF capacitor on the output of the regulator, and 100 nF between VCC and GND on both the ESP and the radio module. Reset is connected to GND though 100nF (as in the RFM69 datasheet) and finally a 4.7uF across VCC/GND on the RFM69 (suggested in the MySensors forum). Both modules are mounted in sockets on a prototype board and everything is soldered together, with as short wires as possible (no breadboard)

I have the Node sketch (from RFM69 examples directory) on the ESP8266, with the SPIflash and Blink code disabled, and the Gateway sketch on an Arduino Pro Mini. Using the latest RFM69 library from github. ATC is turned off. I monitor the 868 MHz spectrum using a HackRF One as a spectrum analyzer (with Cubic SDR). When I turn on the ESP it transmits, and retries 3 times, as expected with sendWithRetry(). Nothing is received on the Arduino side. If I touch the antenne on the ESP8266 it works! The Arduino receives that data, and the ack gets back to the ESP8266! RSSI values looks fine (-30 to -26). Currently using 82 mm of wire as an antenna. I tried to solder an SMA connecter to the module and use a rubber antenna - same behavior

When I look at the waterfall in my SDR receiver, I notice that when thing's are not working, the transmit from the RFM69 takes up approx 6 MHz of spectrum, and while I touch the antenne, it's approx 2 MHz (The two radios and the HackRF are all three within 50 cm of each other). I have very little experience with high-frequency circuits and have no idea how to debug this (except for keep on adding small capacitors at random places on the PCB!). Even the 2 MHz bandwidth seems like a lot to me. A nearby baby monitor uses much less spectrum, and that's also what I would suspect from the RFM69

Any ideas on how to stabilize the setup is greatly appreciated

- Jan


emjay

  • Full Member
  • ***
  • Posts: 119
  • Country: nl
Re: Porting RFM69 library to ESP8266 and hardware sensitive to touching!
« Reply #1 on: March 13, 2016, 07:12:31 PM »
@chrille,

The modules are way too close together. They have sensitive receivers cabable of picking uV signals out of noise, they can easily be overload - remember it is roughly inverse square law.
Reduce the signal levels by separation and at least your SDR display should become more meaningful.
« Last Edit: March 14, 2016, 08:50:08 PM by emjay »

chrille

  • NewMember
  • *
  • Posts: 4
  • Country: dk
Re: Porting RFM69 library to ESP8266 and hardware sensitive to touching!
« Reply #2 on: March 14, 2016, 03:25:02 PM »
The modules are way to close together. They have sensitive receivers cabable of picking uV signals out of noise, they can easily be overload - remember it is roughly inverse square law.
Reduce the signal levels by separation and at least your SDR display should become more meaningful.

Currently the modules are approx 5 meters away from each other, and I still see the same behaviour. Also, I should mention that I some time ago tested with 2x Arduino Pro Mini + RFM69CW and this worked fine, with everything sitting on my desk

I have captured some screenshots of how the spectrum looks. This is the ESP8266 sending data at 868 MHz, captured at 1 MHz bandwidth



The same sketch loaded on the Arduino Pro Mini



The difference is quite obvious

Finally this shows what happens when I touch the antenna:



The bottom part is where I'm touching the antenna, and the receiving node receives data, and the top part of the waterfall, is when I let go of the antenna and used my fingers to capture the screenshot!

I hope someone with deeper experience of the RFM69 modules can give me an idea on what may be causing this behaviour.

This is the test hardware:



...and the ESP8266 based board seen from the bottom



(the breakout boards used for RFM69CW are original intended for ESP8266 ESP-12 and I simply cut the connections to the pullup/down resistors and used them for this purpose)

WhiteHare

  • Hero Member
  • *****
  • Posts: 1300
  • Country: us
Re: Porting RFM69 library to ESP8266 and hardware sensitive to touching!
« Reply #3 on: March 14, 2016, 05:46:05 PM »
Also, I should mention that I some time ago tested with 2x Arduino Pro Mini + RFM69CW and this worked fine,

Were the RFM69CW's "some time ago" using the same ESP8266 adapter boards with trace cuts to the 3 passives as well as a trace cut to the board's  antenna screw sockiet?

Also, which RFM69 settings were you using when you captured the SDR waterfall graphs, and have you tried any narrow band settings for the RFM69 for comparison?

Also, I can't really tell from your low resolution  photo, but it looks as though you may have soldered *all* the connections between the RFM69 module and the adapter board, as opposed to just the pins you're actually using.  So...are some of them floating?
« Last Edit: March 14, 2016, 06:08:56 PM by WhiteHare »

chrille

  • NewMember
  • *
  • Posts: 4
  • Country: dk
Re: Porting RFM69 library to ESP8266 and hardware sensitive to touching!
« Reply #4 on: March 15, 2016, 03:08:54 AM »
Were the RFM69CW's "some time ago" using the same ESP8266 adapter boards with trace cuts to the 3 passives as well as a trace cut to the board's  antenna screw sockiet?

Also, which RFM69 settings were you using when you captured the SDR waterfall graphs, and have you tried any narrow band settings for the RFM69 for comparison?

Also, I can't really tell from your low resolution  photo, but it looks as though you may have soldered *all* the connections between the RFM69 module and the adapter board, as opposed to just the pins you're actually using.  So...are some of them floating?

I build two identical modules (breakout PCB, RFM69CW + SMA connector). These are the same two modules I used for all my testing. Both Arduino<->Arduino and Arduino<->ESP8266. I also tried swapping them between the Node (TX) and Gateway (RX). For the SMA connectors, I ran as short wires as possible from ANA and GND to the SMA connector and used 868 MHz rubber antennas. The Arduino<->Arduino testing was done with antennas connected to the SMA connectors. Now that I have a 82 mm piece of wire as antenna, I removed the wires between the RFM69 and the SMA conncetor, and the connector is  just sitting there - unconnected. It's glued to the breakout PCB, which is why I haven't physically removed it.

As for bandwidth of the RFM69 I haven't changed anything so I'm using whatever is default for the RFM69 library. The only changes I made, or overwrote, is purely related to SPI CS and IRQ pin for DIO 0

All DIO pins, except DIO 0, are floating. Reset is connected to GND via 100 nF and the rest of the pins are connected for power and SPI bus

thebillplease

  • NewMember
  • *
  • Posts: 2
  • Country: us
Re: Porting RFM69 library to ESP8266 and hardware sensitive to touching!
« Reply #5 on: April 03, 2016, 12:02:23 AM »
@chrille were you able to stabilize your setup using low power lab's library?

perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: Porting RFM69 library to ESP8266 and hardware sensitive to touching!
« Reply #6 on: April 07, 2016, 05:27:24 PM »
I'm curious where this 100nF cap on reset comes from. It's an active high reset on the RFM69CW (as opposed to active low on the RFM12B), so there must be a weak pull-down on the module. To give a timed reset pulse from power up shouldn't you connect the cap to VDD rather than GND? If there is a pull-down on the reset it doesn't seem to be documented, unlike the RFM12B that does document a weak pull-up.

Mark.

WhiteHare

  • Hero Member
  • *****
  • Posts: 1300
  • Country: us
Re: Porting RFM69 library to ESP8266 and hardware sensitive to touching!
« Reply #7 on: April 07, 2016, 08:20:52 PM »
@chrille You say you're using the RFM69 library with default settings.  That implies your SDR should be seeing a Tx bandwidth of about 100Khz (https://lowpowerlab.com/forum/index.php/topic,1434.30.html), not the 2-6Mhz that you are reporting. 

Perhaps your configuration is generating huge amounts of RF noise that gets damped when you touch the antenna?

chrille

  • NewMember
  • *
  • Posts: 4
  • Country: dk
Re: Porting RFM69 library to ESP8266 and hardware sensitive to touching!
« Reply #8 on: April 08, 2016, 02:29:52 PM »
@chrille You say you're using the RFM69 library with default settings.  That implies your SDR should be seeing a Tx bandwidth of about 100Khz (https://lowpowerlab.com/forum/index.php/topic,1434.30.html), not the 2-6Mhz that you are reporting. 

Perhaps your configuration is generating huge amounts of RF noise that gets damped when you touch the antenna?

This is also my theory so far. I can solve the issue by one of the following methods:

- touching the antenna
- connecting a ground plane to the antenna (I used the lid from a can of beans!)
- connecting a piece of coax (no antenna) - this of course limits the reachable of the module

I tried to place a piece of un-etched PCB under the  RFM69 module, but it didn't help. As several projects with ESP8266 and RFM69 exists (for instance https://github.com/hallard/NodeMCU-Gateway and https://github.com/someburner/esp-rfm69) I feel confident that it's possible to have the two modules working together, but it probably requires a properly laid out PCB, with a large groundplane. Currently I am trying to do that, but I haven't made any PCB's since highschool (more than 20 years ago), so it takes some time :)

- Jan

WhiteHare

  • Hero Member
  • *****
  • Posts: 1300
  • Country: us
Re: Porting RFM69 library to ESP8266 and hardware sensitive to touching!
« Reply #9 on: April 08, 2016, 02:48:06 PM »
For testing purposes, perhaps desolder the esp8266 and the RFM69 from their adapter plates and just wire them together directly in a dead bug style with short lengths of wire?  That would both simplify and eliminate one possible source of the problem.
« Last Edit: April 08, 2016, 04:40:49 PM by WhiteHare »