# EmonTx stops sending data - no led activity until reboot

**URL:** <https://community.openenergymonitor.org/t/emontx-stops-sending-data-no-led-activity-until-reboot/12529>\
**Category:** Hardware\
**Tags:** emontx\
**Created:** [20 November 2019 20:59 UTC](https://community.openenergymonitor.org/t/emontx-stops-sending-data-no-led-activity-until-reboot/12529 "2019-11-20T20:59:56Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![Robert.Wall](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/robert.wall/32/38246_2.png) [@Robert.Wall](https://community.openenergymonitor.org/u/Robert.Wall)\
**Post date:** [19 December 2019 15:35 UTC](https://community.openenergymonitor.org/t/emontx-stops-sending-data-no-led-activity-until-reboot/12529/18 "2019-12-19T15:35:42Z")

</div>

I have substituted the code in the file “rfm.ino” from the 3-phase sketch, instead of using JeeLib. Reporting once per second, it has now run for about 3½ days - equivalent to about a month of normal use - with no issues. I have not, however, found the true source of the problem.

Those of you suffering lock-ups may wish to try this.

## Instructions to replace JeeLib.

Caution: The following instructions will remove some of the functions of the JeeLib library - in particular, the part that prevents the transmitter from sending its payload whilst the radio channel is in use. Therefore, it is possible that an emonTx so modified will ‘jam’ any other node, causing the data from both to be corrupted and lost. It is only safe to do this change if the emonTx is the only sensor node in use.

1.&nbsp; If you have customised your emonTx sketch, ensure you have a copy.

2.&nbsp; Download “rfm.ino” which is part of the emonTx 3-phase sketch. [GitHub - openenergymonitor/emontx-3phase: emonTx 'approximate' 3-phase firmware](https://github.com/openenergymonitor/emontx-3phase)

3.&nbsp; Put “rfm.ino” in the same directory as your emonTx sketch.

4.&nbsp; Open the Arduino IDE and navigate to that directory. You should see a tab for each file in the main window.

5.&nbsp; In your emonTx sketch, make the following changes (you may wish to comment out rather than delete)

delete `#include <JeeLib.h>`  
add:

```auto
#include <Wire.h>
#include <SPI.h>
#include <util/crc16.h>
#include <OneWire.h>

```

add above `void setup() ` (change the 2nd line below to `#define RF12_868MHZ` if appropriate):

```auto
#define RFM69CW
#define RF12_433MHZ
#define RFMSELPIN 10
#define RFMIRQPIN 2
#define RFPWR 0x99

```

delete `rf12_initialize(nodeID, RF_freq, networkGroup);`  
and replace that with:  
`rfm_init();`

delete `rf12_sendNow(0, &tmp, sizeof tmp);`  
and replace that with:  
`rfm_send((byte *)&emontx, sizeof(emontx), networkGroup, nodeID);`  
(or `rfm_send((byte *)&tmp, sizeof(tmp), networkGroup, nodeID);` if the original line had `tmp` instead of `emontx`)  
(two instances)

delete `rf12_sendWait(2);`

if present, delete

```auto
  else
    rf12_recvDone();

```

6.&nbsp; Compile and upload to your emonTx.

---

_[View the full topic](https://community.openenergymonitor.org/t/emontx-stops-sending-data-no-led-activity-until-reboot/12529)._
