@RWB Is this Photon to Photon or how are you using the RFM96? To my frustration I discovered today with RFM69 difference between Arduino and Photon. For desk testing in Arduino if I don't specify a transmit power level it works 100%, but for Photon if transmit power level is unspecified packets are only received 0% - 50% of the time when 3-6 feet apart.
I've not dug deeper into the ported library but I suspect in Arduino there's a register or base default value that gets set, and in the Photon it isn't set or set to the lowest possible value. Sorry, can't help more with UDP vs reliable.
EDIT: RFM69 does offer options on acknowledgement, retries, encryption and error checking if that helps.
With unreliable communication, I can get the receiver to acknowledge receipt of the message up to 1 mile away. Using the Reliable Datagram code I canāt get more than 10 feet away. Itās the same with this module also: http://www.rocketscream.com/blog/product/mini-ultra-pro-with-radio/
@luisgcu I have seen your range test before and they are impressive ranges! Iāve seen 1 mile range with simple copper wire antennas on the RF95 915 Mhz models.
I see these as an easy way to add remote sensors up to 1-3 miles away from Web-connected Photons or Electrons
bloukingfisher,
Thanks for putting in all the work to get the photon with Rfm69 chip.
I decided I would try to revisit this. I am hopefully going to get the photon to receive info. via the rfm69 chip so the photon can relay mqtt info to my openhab setup.
I am still having trouble getting your example on the the particle IDE to work consistently.
I have tried photon to photon with the RFM69HCW chips.
I got a few seconds of transmission and then it stopped. Nothing has worked since?
I copied the the examples rx and tx verbatim.
Have you used this set up for MQTT at all?
Any pointers?
Thanks,
Webzter30
Iāve not set it up with MQTT. OK, so sounds like youāre on the right path if you successfully transmitted for a few seconds. What happens after a few seconds. Is the TX unit still showing incrementing transmissions or is it stuck? If the TX unit is still transmitting, is it just that the RX unit stopped receiving?
Before you test again, or after each of the below efforts completely unplug your Photon/RFM board from power. In my experience the RFM board can get stuck in a transmit state and only a power down will reset it.
How are you powering the Photons? Have you tried a capacitor on the RFM69HCW board? What is the power level you are transmitting at (defined in the setup section)?
Iām fairly sure you are seeing an issue related with powerā¦not IDE or code specifically. You may see in the example code this little comment reference: āNote at 20dBm the radio sources up to 130 mA!ā. Iām not sure the Photon is capable of delivering that, and even if you power it directly from the right voltage source something like a battery setup probably canāt deliver 130 mA or canāt deliver that level for very long which is probably the issue you are experiencing. Here is what I would try:
See what happens if you dial down radio.setPowerLevel(X); where X is 0, or 5 or 7ā¦something low. On the CW chip I find I can dial it up to 17-23 at the most before running into problems when battery powered. Iām assuming at this point you have both Photons in same room proximity - at least a couple of feet from each other but say no more than 15 feet?
Since you transmitted for a few seconds, first try in the TX example to increase the delay after send from 2000 to say 5000 or 10000. That should be enough time for capacitors and power to settle down and get ready for another burst.
Set the registry to transmit at a lower speed (line 107 in the example code āradio.writeReg(0x03,0x0D); //set bit rate to 9k6ā. The comment above it provides a link on where to get info on setting this. In fact, maybe you even want to test increasing the bit rate - transmit more data in less time before you run into power issues?)
If youāve exhausted the above code effortsā¦hardware. Add capacitors to the radio, check antennas (you have used antennas right? Transmitting without an antenna I believe can ruin your chip). Try another power source. If you have, try the non-H version of RFM69CW. Basically between the code dial down power use, and on the hardware side beef up power supply until you get it to work reliably. From there you can step by step tune it up until you run into failures.
Iād love to hear if you come right, and how you solve it.
I tried all the above suggestions.
Thanks for your quick reply.
Is the example code in the particle web IDE for TX and RX the exact same that you used to get this to work?
If so, shouldnāt it work as long as I follow the pin out you listed in the example, and hook each photon to the RFM69HCW? Did you change anything in your set up?
Thanks so much for your help with this.
All I get back is āā¦ā on the RX side.
I am using putty linked to each com port for the TX and the RX photon for debugging set at baud 115200.
Is this what you use to see the output of each photon?
Yes, the example is the exact same I used. Only difference is I used HCW (and CW) on TX side, but only CW on RX side (in code didnāt have HCW set to true). I only had one HCW version.
If you get the āā¦ā on the RX side it is listening but not receiving any data. When it receives youāll get something along the lines of: āā¦[2] ABC [RX_RSSI: 56] - ACK sentā¦[2] ABCD etc.ā
Just checking your board is set to the right frequency, e.g. 433 or 915? (#define FREQUENCY RF69_915MHZ)
And youāre using the hello-photon-rx-rfm69 example on the RX side, and the hello-photon-tx-rfm69 on the TX side? (Sorry, Iām sure you have all of this covered just trying to think of every possible angle.)
Iād prefer to keep everything Particle based but in a situation like yours Iād take a step back to linking up the RFM69 board to an Arduino where you know a larger community have confirmed the code. Start by just switching out the TX side to an Arduino (the example is based off the same example so the network ID, encryption key etc. is all the same). See if the RX then receives data. If still not, switch out the RX side to an Arduino to confirm your hardware setup/antenna/power/distance is all in order.
BTW, what does the TX side show in your serial monitor? Does it show that it is transmitting the data, but not getting an ack?
I know this is an old thread, but I tried using your examples with a photon and an rfm69hcw as a reciever and a moteino with a rfm69hcw and I canāt get them to communicate for the life of me. Just getting dots on the Photon side. Iāve tried power settings from 0 to 30 with no difference. Any pointers on how to try an troubleshoot this? What should I be looking for? I used the same pin connections you show in the photon code.
No problem, makes sense to keep it in the same thread - at least for me.
Iāve used it with a Moteino too and worked fine. Do you have 2 Photons or 2 Moteinos? I always personally like to start with 2 of the same systems to make sure your wiring/coding works and you have RX/TX between same systems - then switch inter system.
That aside, are you SURE the networkID, nodeID and receiveID is set correctly on the Moteino? And you are using the same encryption key on both sides (I think āsampleEncryptKeyā)? And youāve set #define IS_RFM69HCW true? And obviously your frequency is set at the same? And for the Photon RFM board you are using an antenna and the right length if it is just wire (since the Moteino probably has a PCB antenna or came with an antenna depending on the version youāre using)?
Finally, is the Moteino broadcasting the same data as the Photon TX example? (May not make a difference but I havenāt re-looked the code).
EDIT: And the Moteino is set to the same bit rate too?
radio.writeReg(0x03,0x0D); //set bit rade to 9k6
radio.writeReg(0x04,0x05);
I think I used the previous code sample for the arduino pro mini which I see does not set the data rate. That might be my issue as Iām using the moteino to send to the photon, so thatās why itās not getting there because it doesnāt know what speed to send it at. I also noticed in the photon code above that there is not a similar statement, should I add the same statement in the photon code?
Please make sure you are using my Arduino code (post 18) and not @mhaider8 's code from the post above it (his didnāt work and thus I provided my working code). Iām not sure if he changed anything in the Photon code but to be safe please make sure you use the sample code in the library to guarantee compatibility.
I do see the bitrates in both codes though, check carefully in the setup function.
Ah ok, Iām sure thatās the problem. Iāll try this tonight. Thanks for responding.
As a side note, do you know if anyone has gotten the photon/rfm69 combo to work with RadioHead? I was able to get the code for the reliabledataserver to compile but the photon just blows up, I donāt even get anything to come out of the serial port when I flash it. Must be something in the library that it doesnāt like, but I followed to a T the other thread where they were using the rfm96 radios instead. What is the main advantage of using RadioHead?
Iām not familiar enough but I think the reliable datagram is what some users like. But, for my part, the RFM69 library provides auto acknowledgements and retransmissions (and ability to automatically adjust the power level down which is attractive if your project is battery powered).
Iāve started using RadioHead for a CC1101 project and thus far have not encountered advantages but Iām not using reliable datagram so that may make a difference.