Moteino Mega RFM12B radio.send() function block the sketch

Started by anton, October 11, 2017, 01:23:10 PM

anton

Hello,
I have 4 moteino mega with the RFM12B transmetter, but i get trouble to get the transmeter working.
I'm using the arduino 1.0.6 and 1.6.13 with both the monteino mega core installed.

When i upload the RFM12B send exemple on the monteino Mega, the sketch block and stop at the function  radio.Send(GATEWAYID, payload, sendSize+1, requestACK);
If i comment this function the sketch continue to run normaly.

I get no trouble with my other regular Monteino on RFM12B, this append only on the Megas.

Felix

What revision is the hardware? Maybe a photo of the bottom of the MoteinoMEGA?
What library are you using?

The RFM12b radios are not really supported anymore, although the library and examples should work.

anton

Hello,
I try with the library RFM12B from the lowpowerlab git and with the jeelib. Both doesn't work.
Here is some photo of the Mega.

Felix

It will not work with jeelib without modifications.
Try this LPL library instead which has MoteinoMEGA support built in.
And make sure you install the Moteino definitions (explained in this guide page) to choose the MoteinoMEGA as target board in your Arduino IDE.

anton

Yes, i try first with the low power lab lib and install the mega definitions. I try too the jeelib just in case, because i saw rfm12B is not supported anymore and i thought maybe something changed in the mega definitions. But my issue is quite strange, I try to explain again:

When i upload the send exemple (from the RFM12B lowpowerlab lib, the same you give me the link) on a regular moteino it work without problem, but if i upload it on the mega (with the moteino mega définition selected) the sketch block on the radio.send() fonction.

I can see it because the serial monitor stop writing after this function. If i comment this line, the serial monitor continue to loop and write as normal.

I suspected an hardware problem but every mega of the four that i own have this behavior. Is there anything to do with the mega (jumper or Else) when you receive the board? I order them tree years ago but never use my mégas until now. I used only my regulars moteino because it's enough for most project.

Felix

There is nothing you need to modify in hardware. As long as the radio itself works, it should also work.
But again I need to say I have not used RFM12B in many years and the library is kept for reference only and not actively supported anymore. I don't even have any MoteinoMEGAs with RFM12b for debugging anymore, otherwise I would give it a try.
You will need to determine what is stalling it by using more debugging statements. But the library used to work just fine on all Moteinos. Try it on Arduino IDE 1.0.6.

anton

Strange. I try it on the arduino 1.0.6 IDE, everythink installed and the sketch upload well, but same problem. The example sketch stall at the radio.send() function.
Do I need the flash module to make it work?
My version of Mega is witout flash solder.

Felix

You don't need the flash mem.
What you need is to do step by step debuging by adding more code and see where it fails.

anton

Thank you for your advice, but i do it, and i know for sure that it is the radio.Send(GATEWAYID, payload, sendSize+1, requestACK); function that make my sketch stop running. As I said, if I simply comment it, nothing is send but the sketch continue running. The sketc stop running precisely at this function if I don't comment it.
I don't know how to debug it more deeper, maybe going into the lib and test step by step, but I assume that your code is tested and must work, so maybe more an hardware or a power supply problem. I will continue when I got time to make some test, maybe with an independent power supply. If I found the solution, I will tell.
Thanks

sfewings

Quote from: Felix on October 13, 2017, 11:23:30 AM
It will not work with jeelib without modifications.
Note that I made modifications to the Jeelib library to support the SPI and interrupt pins of the Moteino Mega and RFM69. The pull request was merged with the main branch of Jeelib on 24Feb2020.
https://github.com/jeelabs/jeelib/pull/106

Felix

Oh thanks, that's very nice of you for contributing and JCW for merging!