Project

General

Profile

Jeenode Micro in RF12_COMPAT mode?

Added by Rolf about 1 year ago

Hi,
just tried to use a Jeenode V6 in RF12_COMPAT mode (with RFM12 radio, sending out RF69 native packets), as described here:
https://jeelabs.org/book/1522d/
Fine! Runs well and straight forward. - But my goal is to use some Jeenode Micros this way. First try did not work. The "manual" says that some "software tricks" had to be applied to get the thing running. Maybe those tricks do not work with the Jeenode Micro? Does anybody now? (could save me perhaps from a long and useless research).
regards,
Rolf


Replies (38)

RE: Jeenode Micro in RF12_COMPAT mode? - Added by martynj about 1 year ago

@Rolf,

Worth a quick check if you actually have power reaching the RF module - the default after Reset is the module unpowered.
Specific action is required to turn it on, pause, then init (and usually put the module to sleep for a while - its register settings are retained during sleep mode)

RE: Jeenode Micro in RF12_COMPAT mode? - Added by martynj about 1 year ago

@Rolf,

Any progress?

RE: Jeenode Micro in RF12_COMPAT mode? - Added by Rolf about 1 year ago

Hi Martyn,
first, thank you very much for your advice. Theoretically I knew about that, have already running a bunch of Jeenode Micros in normal (RF12) mode. But, indeed, with the new program I forgot it. Unfortunately it did not help. The setup now looks like this:

 void setup() {
  bitSet(DDRB, 0);
  bitClear(PORTB, 0);
  delay(100);
  rf12_initialize(node_addr, RF12_868MHZ, 42, 1720); // 868.6 MHz for testing
  delay(100);
}

And in jeelib, RF12.h, I have switched the compat flag to 1: #define RF12_COMPAT 1

Rolf

RE: Jeenode Micro in RF12_COMPAT mode? - Added by martynj about 1 year ago

@Rolf,

I'm not sure what test equipment you have there - one check that only needs a multimeter is to monitor the current drain when power is supplied externally (i.e. coin cell absent). With a nice long test packet, the Tx, Rx and sleep modes have quite distinct current draws e.g. Tx mode during packet transmission will kick up long enough to register something on your meter, Rx is a steady drain as it listens for an incoming pre-amble etc.
This would at least confirm packet activity before jumping into packet format and/or RF set up misalignment.

RE: Jeenode Micro in RF12_COMPAT mode? - Added by Rolf about 1 year ago

@martyn,
good idea, I'll check it, have a Multimeter which is good for Microamperes.

RE: Jeenode Micro in RF12_COMPAT mode? - Added by Rolf about 1 year ago

Finally I got the time to perform the test. I sent 3 long packets in sequence and marked the program flow with a LED connected to DIO1. The current drawn during the delay-periods was 9.8 mA and I could not see a raise when the packet should be sent. The code is attached (in jeelib, RF12.h the compat flag was set: #define RF12_COMPAT 1)

RE: Jeenode Micro in RF12_COMPAT mode? - Added by JohnO about 1 year ago

I would add a 1000ms delay after powering up the radio before calling the rf12_initialize.

RE: Jeenode Micro in RF12_COMPAT mode? - Added by JohnO about 1 year ago

Ah, I see you do rf12_initialize twice, once in setup() and again in loop().

RE: Jeenode Micro in RF12_COMPAT mode? - Added by Rolf about 1 year ago

Twice, just for testing, to be shure, once in setup should be enough. Thanks for your advice. I added "delay(1000)" before each "rf12_initialize", but unfortunately without success, no raise of current, no received packets.

RE: Jeenode Micro in RF12_COMPAT mode? - Added by JohnO about 1 year ago

Can you repost your latest code?

RE: Jeenode Micro in RF12_COMPAT mode? - Added by JohnO about 1 year ago

Thanks for that. There was an issue with filling the rf69 buffer, could you perhaps try dropping your loop counter "for(i=0; i<60; i++) {" to 16. Also can you confirm that the LED's are flashing out the pattern you have programmed in loop()?

RE: Jeenode Micro in RF12_COMPAT mode? - Added by Rolf about 1 year ago

The loop shortened to 16 I put in the setup code. The LED flashes as it should: Twice in the beginning, then after a longer delay just shortly, thereafter a current raise, due to rf activity, should be seen. Then again a long pause followed by a long LED-flash, marking the end of the loop. Attached the new code. Unfortunately now improvement, no curent raise, no packets received.

RE: Jeenode Micro in RF12_COMPAT mode? - Added by JohnO about 1 year ago

What are you using to receive the packets?

RE: Jeenode Micro in RF12_COMPAT mode? - Added by JohnO about 1 year ago

Ah, I think we may be misunderstanding the use of RF12_COMPAT. CHecking back on https://jeelabs.org/book/1522d/ it says:

In summary, the RF12 driver in JeeLib can now be used in three different ways:

as is, the “traditional” mode: classic + RFM12 + RF12 + Arduino + AVR
in RF69_COMPAT mode: classic + RFM69 + RF12 + Arduino + AVR
in RF12_COMPAT mode: native + RFM12 + RF12 + Arduino + AVR

It is used to enable an rfm12b to be part of an rfm69 network running in native mode. I doubt it was ever tested as a way of running the rfm69 in native mode.

RE: Jeenode Micro in RF12_COMPAT mode? - Added by JohnO about 1 year ago

Incidentally your latest code doesn't have RF12_COMPAT or RF69_COMPAT.

RE: Jeenode Micro in RF12_COMPAT mode? - Added by JohnO about 1 year ago

I think it is me that is confused. I have mixed two different forum topics.

RE: Jeenode Micro in RF12_COMPAT mode? - Added by martynj about 1 year ago

@Rolf,

If you flip the sense of the test around, does the JNMicro successfully receive an RF69 formatted packet?

RE: Jeenode Micro in RF12_COMPAT mode? - Added by Rolf about 1 year ago

@ John: what I'm trying to do is: RF12_COMPAT mode: native + RFM12 + RF12 + Arduino + AVR- The sender is a Jeenode Micro, the receiver a Raspberry Pi, a RF69 breakout board (from Jeelabs) directly connected to GPIOs. I tested this arrangement succesfully with a Jeenode instead of a J-Micro. It works straight forward, as intruduced by JCW (link see at the beginning of the thread).

@ Martyn: OK, I'll try it.

Thank you both for your help.

(fortunately Jeelabs provides very different and flexible stuff. If this approach should fail, I still can plug a Jeelink in an USB-Slot of the RPi and run the J-Micro in RF12-Mode. But I am still ambitious.)

RE: Jeenode Micro in RF12_COMPAT mode? - Added by JohnO about 1 year ago

Thanks Rolf, are you able to check the fuse settings on your ATTiny84?

Possibly something like this:
cd "C:\Program Files (x86)\Arduino\hardware\tools\avr\bin"
./avrdude.exe -c stk500v1 -p attiny84 -P com?4? -U lfuse:r:-:i -v -C ??programmer??
https://www.nongnu.org/avrdude/user-manual/avrdude_4.html#Option-Descriptions
for details of the programmers.

RE: Jeenode Micro in RF12_COMPAT mode? - Added by Rolf about 1 year ago

Those "fuses" were beyond my horizon up to now. Your introduction is a good starting point, I'll try it. - Besides, do not know if it is of importance, but shurely I confirmed that the JN-Micro is working in RF12-classic mode.

RE: Jeenode Micro in RF12_COMPAT mode? - Added by JohnO about 1 year ago

If the JNu works in classic mode the fuses should be fine already. I'm am running out of ideas. Do you have a copy of the code that is driving the RasPi breakout board?

RE: Jeenode Micro in RF12_COMPAT mode? - Added by Rolf about 1 year ago

Yes, I have the code, its the spi- and rf69-driver from Jeelabs and above a, a bit longish, server program. But I think the problem is not there, because the RasPi receives native packets from Jeenode Zero, Blue Pill with RF69 and Jeenode-RF12 in COMPAT mode. - I'll try next to see, if the JN-Micro is able to receive native packets in RF12-COMPAT mode.

RE: Jeenode Micro in RF12_COMPAT mode? - Added by JohnO about 1 year ago

Sounds good, I was hoping to check that the RasPi is set to receive at 868.6 MHz.

RE: Jeenode Micro in RF12_COMPAT mode? - Added by Rolf about 1 year ago

The JN-Micro does not receive native packets either. - End of ideas for the time being.

(1-25/38)