Author Topic: Moteino Mega RFM12B radio.send() function block the sketch  (Read 1968 times)

anton

  • NewMember
  • *
  • Posts: 9
Moteino Mega RFM12B radio.send() function block the sketch
« on: October 11, 2017, 01:23:10 PM »
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

  • Administrator
  • Hero Member
  • *****
  • Posts: 6608
  • Country: us
    • LowPowerLab
Re: Moteino Mega RFM12B radio.send() function block the sketch
« Reply #1 on: October 11, 2017, 02:06:53 PM »
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

  • NewMember
  • *
  • Posts: 9
Re: Moteino Mega RFM12B radio.send() function block the sketch
« Reply #2 on: October 11, 2017, 07:31:31 PM »
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

  • Administrator
  • Hero Member
  • *****
  • Posts: 6608
  • Country: us
    • LowPowerLab
Re: Moteino Mega RFM12B radio.send() function block the sketch
« Reply #3 on: October 13, 2017, 11:23:30 AM »
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

  • NewMember
  • *
  • Posts: 9
Re: Moteino Mega RFM12B radio.send() function block the sketch
« Reply #4 on: October 14, 2017, 06:34:50 PM »
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

  • Administrator
  • Hero Member
  • *****
  • Posts: 6608
  • Country: us
    • LowPowerLab
Re: Moteino Mega RFM12B radio.send() function block the sketch
« Reply #5 on: October 15, 2017, 06:36:43 PM »
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

  • NewMember
  • *
  • Posts: 9
Re: Moteino Mega RFM12B radio.send() function block the sketch
« Reply #6 on: October 17, 2017, 07:10:52 AM »
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

  • Administrator
  • Hero Member
  • *****
  • Posts: 6608
  • Country: us
    • LowPowerLab
Re: Moteino Mega RFM12B radio.send() function block the sketch
« Reply #7 on: October 17, 2017, 10:16:09 AM »
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

  • NewMember
  • *
  • Posts: 9
Re: Moteino Mega RFM12B radio.send() function block the sketch
« Reply #8 on: October 18, 2017, 07:42:48 PM »
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

  • NewMember
  • *
  • Posts: 1
Re: Moteino Mega RFM12B radio.send() function block the sketch
« Reply #9 on: February 26, 2020, 08:21:39 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
« Last Edit: February 26, 2020, 08:23:36 AM by sfewings »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6608
  • Country: us
    • LowPowerLab
Re: Moteino Mega RFM12B radio.send() function block the sketch
« Reply #10 on: February 26, 2020, 09:20:58 AM »
Oh thanks, that's very nice of you for contributing and JCW for merging!