# RN2483 won't sleep

**URL:** <https://www.thethingsnetwork.org/forum/t/rn2483-wont-sleep/15204>\
**Category:** Hardware\
**Created:** [June 20, 2018, 7:37pm UTC](https://www.thethingsnetwork.org/forum/t/rn2483-wont-sleep/15204 "2018-06-20T19:37:47Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Struck](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/s/c37758/32.png) [@Struck](https://www.thethingsnetwork.org/forum/u/Struck)\
**Post date:** [June 20, 2018, 7:37pm UTC](https://www.thethingsnetwork.org/forum/t/rn2483-wont-sleep/15204/1 "2018-06-20T19:37:47Z")

</div>

I have made a node with adafruit pro trinklet 3.3v MCU and an RN2483 module. It is working great. but the module will not sleep  
The current consumption is about 20mA for the RN2483, which means it is not sleeping, it should be uA  
The firmware version on it is 1.0.3.

For the connection between MCU and RN2483 i used this guide.

> [@How to build your first TTN node: Arduino + RN2483](https://www.thethingsnetwork.org/forum/t/how-to-build-your-first-ttn-node-arduino-rn2483/1574):
>
> There is a lot of information distributed across this forum on how to build nodes for TTN. I’m going to summarize how I built my first TTN node using an Arduino Uno and an RN2483 radio module. See this as a “How to get started” tutorial for first time builders. There are a lot of things this design can improve on, but this is at least a good place to start. What you will need: Arduino Uno (an Arduino Nano, or any other ATmega 328p, or Arduino compatible board should work too) [Microchip RN248…](http://nl.farnell.com/microchip/rn2483-i-rm095/lora-transceiver-mod-433-868mhz/dp/2491391?ost=rn2483&selectedCategoryId=&categoryId=700000005613)

I have measured the current with a oscilloscope.  
Am i missing something?

```
#include <SoftwareSerial.h>
#include <TheThingsNetwork.h>
#include <LowPower.h>

#define OTAARetries 4
#define loraSerial SoftSerial
#define debugSerial Serial
// Replace REPLACE_ME with TTN_FP_EU868 or TTN_FP_US915
#define freqPlan TTN_FP_EU868
#define SpreadingFactor 7
SoftwareSerial SoftSerial(10, 11); // RX, TX
TheThingsNetwork ttn(loraSerial, debugSerial, freqPlan, SpreadingFactor);

void setup() {
  // put your setup code here, to run once:
  loraSerial.begin(57600);
  debugSerial.begin(9600);
  //Restart the RN2483 module
  pinMode(12, OUTPUT);
  digitalWrite(12, LOW);
  delay(500);
  digitalWrite(12, HIGH);
  ttn.showStatus();
}

void loop() {
  // put your main code here, to run repeatedly:
  delay(500);
  ttn.wake(); // wake the RN module from sleep, if it is still sleeping
  delay(1000);
  ttn.sleep(2000); //sleep RN module in [ms]
  delay(100);
  LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);
}

```

---

<div class="post-metadata">

**Author:** ![BoRRoZ](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/borroz/32/44234_2.png) [@BoRRoZ](https://www.thethingsnetwork.org/forum/u/BoRRoZ)\
**Post date:** [June 20, 2018, 8:15pm UTC](https://www.thethingsnetwork.org/forum/t/rn2483-wont-sleep/15204/2 "2018-06-20T20:15:24Z")

</div>

> [@Struck](#):
>
> It is working great

hmmmmmmmmmm … and what is it actually doing ? _(nothing I think)_  
that’s not the complete code probably … where’s the sensor part… and what sensor ?

---

<div class="post-metadata">

**Author:** ![Struck](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/s/c37758/32.png) [@Struck](https://www.thethingsnetwork.org/forum/u/Struck)\
**Post date:** [June 20, 2018, 8:18pm UTC](https://www.thethingsnetwork.org/forum/t/rn2483-wont-sleep/15204/3 "2018-06-20T20:18:56Z")

</div>

> [@BoRRoZ](#):
>
> hmmmmmmmmmm … and what is it actually doing ? (nothing I think)
> 
> that’s not the complete code probabably … where’s the sensor part… and what sensor ?

This code is only to test the sleep function, and is of course not the complete code.

I have not mentioned any sensor, what do you mean?

---

<div class="post-metadata">

**Author:** ![BoRRoZ](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/borroz/32/44234_2.png) [@BoRRoZ](https://www.thethingsnetwork.org/forum/u/BoRRoZ)\
**Post date:** [June 20, 2018, 8:20pm UTC](https://www.thethingsnetwork.org/forum/t/rn2483-wont-sleep/15204/4 "2018-06-20T20:20:07Z")

</div>

> [@Struck](#):
>
> #include \<OneWire.h\>

correct… I mentioned it because I see

#include \<OneWire.h\>

---

<div class="post-metadata">

**Author:** ![Struck](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/s/c37758/32.png) [@Struck](https://www.thethingsnetwork.org/forum/u/Struck)\
**Post date:** [June 20, 2018, 8:20pm UTC](https://www.thethingsnetwork.org/forum/t/rn2483-wont-sleep/15204/5 "2018-06-20T20:20:51Z")

</div>

> [@BoRRoZ](#):
>
> correct… I mentioned it because I see
> 
> #include \<OneWire.h\>

Ahh yea sure. it should not have been included for this sketch.

---

<div class="post-metadata">

**Author:** ![kersing](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/kersing/32/44777_2.png) [@kersing](https://www.thethingsnetwork.org/forum/u/kersing)\
**Post date:** [June 20, 2018, 8:44pm UTC](https://www.thethingsnetwork.org/forum/t/rn2483-wont-sleep/15204/6 "2018-06-20T20:44:10Z")

</div>

Wouldn’t be easier to measure if you put the module to sleep for a longer time? You are now just sleeping for 2 seconds according to the unit mentioned in the comment.

Also, is there a pull up on the RN2483 reset line? Otherwise putting the controller to sleep might reset the RN module.

---

<div class="post-metadata">

**Author:** ![BoRRoZ](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/borroz/32/44234_2.png) [@BoRRoZ](https://www.thethingsnetwork.org/forum/u/BoRRoZ)\
**Post date:** [June 20, 2018, 8:46pm UTC](https://www.thethingsnetwork.org/forum/t/rn2483-wont-sleep/15204/7 "2018-06-20T20:46:34Z")

</div>

trinket… isn’t that a fancy Attiny 85 ? I wonder if you have any memory free ?

in void setup()

loraSerial.begin(19200); // lower the speed  
…  
// Reset is required for autobaud RN2483 into 19200 bps from the  
// default 57600 bps  
**ttn.reset();**  
ttn.showStatus();

you can have a peek at [this code](https://www.thethingsnetwork.org/forum/t/the-workbench/8970/104) I used with 328p + rn2483  
only difference is that that when the rn wakes up it wakes up the 328p… so sleeptimes are dicided by the rn

---

<div class="post-metadata">

**Author:** ![Struck](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/s/c37758/32.png) [@Struck](https://www.thethingsnetwork.org/forum/u/Struck)\
**Post date:** [June 20, 2018, 8:51pm UTC](https://www.thethingsnetwork.org/forum/t/rn2483-wont-sleep/15204/8 "2018-06-20T20:51:04Z")

</div>

> [@kersing](#):
>
> Wouldn’t be easier to measure if you put the module to sleep for a longer time? You are now just sleeping for 2 seconds according to the unit mentioned in the comment.

I have tried for longer, but no change.

> [@kersing](#):
>
> Also, is there a pull up on the RN2483 reset line? Otherwise putting the controller to sleep might reset the RN module.

Actualy no there is no resistor on that, should there be? which value would be good? 10k or something?

> [@BoRRoZ](#):
>
> trinket… isn’t that a fancy Attiny 85 ? I wonder if you have any memory free ?

I am using the Pro trinklet, which uses the Atmega328p, there should be enough memory for this application.

---

<div class="post-metadata">

**Author:** ![Struck](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/s/c37758/32.png) [@Struck](https://www.thethingsnetwork.org/forum/u/Struck)\
**Post date:** [June 20, 2018, 9:32pm UTC](https://www.thethingsnetwork.org/forum/t/rn2483-wont-sleep/15204/9 "2018-06-20T21:32:19Z")

</div>

> [@BoRRoZ](#):
>
> you can have a peek at this code I used with 328p + rn2483
> 
> only difference is that that when the rn wakes up it wakes up the 328p… so sleeptimes are dicided by the rn

Ahh i didn’t know that the RN2483 could be used to wake the arduino from sleep. That is smart. 🙂

> [@BoRRoZ](#):
>
> loraSerial.begin(19200); // lower the speed
> 
> …
> 
> // Reset is required for autobaud RN2483 into 19200 bps from the
> 
> // default 57600 bps
> 
> ttn.reset();
> 
> ttn.showStatus();

So you want me to try a lower baudrate?

---

<div class="post-metadata">

**Author:** ![Struck](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/s/c37758/32.png) [@Struck](https://www.thethingsnetwork.org/forum/u/Struck)\
**Post date:** [June 21, 2018, 1:07pm UTC](https://www.thethingsnetwork.org/forum/t/rn2483-wont-sleep/15204/10 "2018-06-21T13:07:04Z")

</div>

I have tried with a 10k resistor from reset to VDD, but does not seem to do anything.

I have also measured the sleep current of the arduino, whic is 2.8uA at 3.2V supply, directly from the batteries, without regulator or power diode. and in idle mode (delay) it is about 4.8mA which seem correct,

Futher more i have tried to only send the sleep command without putting the arduino to sleep like this.

```
void loop() {
    ttn.wake(); // wake the RN module from sleep, if it is still sleeping
    delay(5000);
    ttn.sleep(5000); //sleep RN module in [ms]
    delay(5000);
 }

```

This only seem to lower the current from 27.6 to 25.4mA  
Also if i try to reset the module in the loop, with a large delay in between, the current drops to 5.6mA

```
void loop() {
  ttn.wake(); // wake the RN module from sleep, if it is still sleeping
  delay(5000);
  digitalWrite(12, LOW);
  delay(5000);
  digitalWrite(12, HIGH);
  ttn.sleep(5000); //sleep RN module in [ms]
  delay(5000);
}

```

Anyone have any ideas?, How do TTN.sleep function work?

---

<div class="post-metadata">

**Author:** ![BoRRoZ](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/borroz/32/44234_2.png) [@BoRRoZ](https://www.thethingsnetwork.org/forum/u/BoRRoZ)\
**Post date:** [June 21, 2018, 1:19pm UTC](https://www.thethingsnetwork.org/forum/t/rn2483-wont-sleep/15204/11 "2018-06-21T13:19:33Z")

</div>

do you have communication between your RN2483 and processor ?

_because with softserial @57600 thats not possible_

---

<div class="post-metadata">

**Author:** ![Struck](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/s/c37758/32.png) [@Struck](https://www.thethingsnetwork.org/forum/u/Struck)\
**Post date:** [June 21, 2018, 1:22pm UTC](https://www.thethingsnetwork.org/forum/t/rn2483-wont-sleep/15204/12 "2018-06-21T13:22:04Z")

</div>

> [@BoRRoZ](#):
>
> do you have communication between your RN2483 and processor ?
> 
> because with softserial @57600 thats not possible

Yes the messages gets received in the TTN consile. so i guess it works.  
How can i make the RN2483 run at a different baud rate? to test it out

---

<div class="post-metadata">

**Author:** ![BoRRoZ](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/borroz/32/44234_2.png) [@BoRRoZ](https://www.thethingsnetwork.org/forum/u/BoRRoZ)\
**Post date:** [June 21, 2018, 1:24pm UTC](https://www.thethingsnetwork.org/forum/t/rn2483-wont-sleep/15204/13 "2018-06-21T13:24:42Z")

</div>

> [@Struck](#):
>
> So you want me to try a lower baudrate?

good luck

---

<div class="post-metadata">

**Author:** ![Struck](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/s/c37758/32.png) [@Struck](https://www.thethingsnetwork.org/forum/u/Struck)\
**Post date:** [June 21, 2018, 1:45pm UTC](https://www.thethingsnetwork.org/forum/t/rn2483-wont-sleep/15204/14 "2018-06-21T13:45:52Z")

</div>

Have now tried a lower baud rate of 19200  
with this code

```
#include <SoftwareSerial.h>
#include <TheThingsNetwork.h>
#include <OneWire.h>
#include <LowPower.h>

const char *appEui = "XXXXXXXXXXXXXXX";
const char *appKey = "XXXXXXXXXXXXXXXXXXXXXX";
#define loraSerial SoftSerial
#define debugSerial Serial
// Replace REPLACE_ME with TTN_FP_EU868 or TTN_FP_US915
#define freqPlan TTN_FP_EU868
#define SpreadingFactor 7
SoftwareSerial SoftSerial(10, 11); // RX, TX
TheThingsNetwork ttn(loraSerial, debugSerial, freqPlan, SpreadingFactor);

void setup() {
  loraSerial.begin(19200);
  debugSerial.begin(9600);
  debugSerial.println("\n Setup started");
  //Restart the RN2483 module
  pinMode(12, OUTPUT);
  digitalWrite(12, LOW);
  delay(500);
  digitalWrite(12, HIGH);
  debugSerial.println("Now ttn.reset()");
  ttn.reset();
  debugSerial.println("Now show status");
  ttn.showStatus();
  debugSerial.println("Now Joing network");
  ttn.join(appEui, appKey, 4, 10000);
}

void loop() {
  debugSerial.println("Loop");
  ttn.wake(); // wake the RN module from sleep, if it is still sleeping
  delay(5000);
  ttn.sleep(5000); //sleep RN module in [ms]
  delay(5000);
}

```

And the result is the same, only 2mA drop in current when sleeping the RN2483 module.

---

<div class="post-metadata">

**Author:** ![Sandgroper](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/sandgroper/32/46619_2.png) [@Sandgroper](https://www.thethingsnetwork.org/forum/u/Sandgroper)\
**Post date:** [June 21, 2018, 2:57pm UTC](https://www.thethingsnetwork.org/forum/t/rn2483-wont-sleep/15204/15 "2018-06-21T14:57:57Z")

</div>

What are you expecting to happen? You may be putting the RN module to sleep but you are not putting the processor to sleep.

---

<div class="post-metadata">

**Author:** ![Struck](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/s/c37758/32.png) [@Struck](https://www.thethingsnetwork.org/forum/u/Struck)\
**Post date:** [June 21, 2018, 3:32pm UTC](https://www.thethingsnetwork.org/forum/t/rn2483-wont-sleep/15204/16 "2018-06-21T15:32:35Z")

</div>

> [@Sandgroper](#):
>
> What are you expecting to happen? You may be putting the RN module to sleep but you are not putting the processor to sleep.

As i said earlier, the MCuy only pulls 5mA when active. so that is not the problem here.  
I Also tried putting the MCu and the rn2483 module to sleep, this result in a 22mA current draw, which is 1000x higher than it should be, and what others are reporting.

---

<div class="post-metadata">

**Author:** ![mikcatta](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/mikcatta/32/35697_2.png) [@mikcatta](https://www.thethingsnetwork.org/forum/u/mikcatta)\
**Post date:** [June 21, 2018, 5:58pm UTC](https://www.thethingsnetwork.org/forum/t/rn2483-wont-sleep/15204/17 "2018-06-21T17:58:30Z")

</div>

Perhaps ttn.sleep(5000); isn’t actually doing anything. Can you make it sleep for a long time (say 30 minutes) and then try talking to the RN2483. It clearly shouldn’t reply. If it does then clearly it isn’t asleep 🙂

I am using this library [https://github.com/jpmeijers/RN2483-Arduino-Library](https://github.com/jpmeijers/RN2483-Arduino-Library) with the RN2483 and Arduno mini pro and I get 270uA when both (TTN module & Arduino are asleep).

---

<div class="post-metadata">

**Author:** ![Sandgroper](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/sandgroper/32/46619_2.png) [@Sandgroper](https://www.thethingsnetwork.org/forum/u/Sandgroper)\
**Post date:** [June 21, 2018, 6:57pm UTC](https://www.thethingsnetwork.org/forum/t/rn2483-wont-sleep/15204/18 "2018-06-21T18:57:24Z")

</div>

Your numbers do not stack up. There is no way the Trinket draws only 5mA without some form of power management. Given the code shown in the previous post, 22mA is reasonable.

---

<div class="post-metadata">

**Author:** ![Struck](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/s/c37758/32.png) [@Struck](https://www.thethingsnetwork.org/forum/u/Struck)\
**Post date:** [June 21, 2018, 9:46pm UTC](https://www.thethingsnetwork.org/forum/t/rn2483-wont-sleep/15204/19 "2018-06-21T21:46:09Z")

</div>

> [@Sandgroper](#):
>
> Your numbers do not stack up. There is no way the Trinket draws only 5mA without some form of power management. Given the code shown in the previous post, 22mA is reasonable.

The datasheet for the 328p say 5.2mA at 5V 8MHZ in active mode, so it seem legit.  
My Pro trinklet runs at 3.2V but at 12MHz. I have removed the regulator from the board together with the power led.

---

<div class="post-metadata">

**Author:** ![Struck](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/s/c37758/32.png) [@Struck](https://www.thethingsnetwork.org/forum/u/Struck)\
**Post date:** [June 21, 2018, 9:47pm UTC](https://www.thethingsnetwork.org/forum/t/rn2483-wont-sleep/15204/20 "2018-06-21T21:47:15Z")

</div>

> [@mikcatta](#):
>
> Perhaps ttn.sleep(5000); isn’t actually doing anything. Can you make it sleep for a long time (say 30 minutes) and then try talking to the RN2483. It clearly shouldn’t reply. If it does then clearly it isn’t asleep 🙂
> 
> I am using this library [GitHub - jpmeijers/RN2483-Arduino-Library: Arduino C++ code to communicate with a Microchip RN2483 module](https://github.com/jpmeijers/RN2483-Arduino-Library) with the RN2483 and Arduno mini pro and I get 270uA when both (TTN module & Arduino are asleep).

Thank you, i will try to communicate with it while it should be sleeping, didn’t even think of this!  
270uA seems a bit high too does it not?

[Next page](https://www.thethingsnetwork.org/forum/t/rn2483-wont-sleep/15204.md?page=2)
