# emonTx connecting to arduino IDE using programmer

**URL:** <https://community.openenergymonitor.org/t/emontx-connecting-to-arduino-ide-using-programmer/17166>\
**Category:** Installation\
**Created:** [10 March 2021 18:47 UTC](https://community.openenergymonitor.org/t/emontx-connecting-to-arduino-ide-using-programmer/17166 "2021-03-10T18:47:49Z")\
**Posts on this page:** 20\
**Page:** 2

<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:** [11 March 2021 13:02 UTC](https://community.openenergymonitor.org/t/emontx-connecting-to-arduino-ide-using-programmer/17166/21 "2021-03-11T13:02:12Z")

</div>

> [@rdc-Green](#):
>
> How do i turn up the power on the emonTx?

You will need to edit the sketch for your emonTx, compile and upload it.  
You get the source code for the sketch from

> **[GitHub - openenergymonitor/EmonTxV3CM: EmonTxV3 Continuous Monitoring...](https://github.com/openenergymonitor/EmonTxV3CM)**
>
> EmonTxV3 Continuous Monitoring Firmware (Default shipped EmonTxV3 firmware) - GitHub - openenergymonitor/EmonTxV3CM: EmonTxV3 Continuous Monitoring Firmware (Default shipped EmonTxV3 firmware)

and the line you need to change is line 52 (or thereabouts) in the main file:

```auto
#define RFPWR 0x99

```

The maximum is 0x9F. If you operate the transmitter at that power without an effective antenna, you will most likely damage the transmitter module, and it’s not easily replaceable. I’d increase it only as much as necessary to get reliable reception.

Then compile the sketch (you must have all 3 files) and upload it to your emonTx using your programmer.

> [@rdc-Green](#):
>
> Is a serial Ethernet adapter available in the shop?

I’m afraid not.

> [@rdc-Green](#):
>
> Can I upload using Arduino IDE for example?

I would advise using that in preference to anything else. It is very well documented and reliable in my experience. There’s a page in ‘Learn’ for installing it, and another for installing the libraries that you need.

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [11 March 2021 13:15 UTC](https://community.openenergymonitor.org/t/emontx-connecting-to-arduino-ide-using-programmer/17166/22 "2021-03-11T13:15:50Z")

</div>

> [@rdc-Green](#):
>
> Should i be able to see emnotx3cm **17** in this list now that i have changed the node id to 17
> 
> ![image](https://community.openenergymonitor.org/uploads/default/original/3X/c/3/c3e5a601bbe82f937b280f28bfe002ddde3c27f3.png)
> 
> * * *

None of your nodes are receiving any data apparently.

---

<div class="post-metadata">

**Author:** ![rdc-Green](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/rdc-green/32/17995_2.png) [@rdc-Green](https://community.openenergymonitor.org/u/rdc-Green)\
**Post date:** [11 March 2021 13:30 UTC](https://community.openenergymonitor.org/t/emontx-connecting-to-arduino-ide-using-programmer/17166/23 "2021-03-11T13:30:16Z")

</div>

How do you ‘run’ ./emonupload.py when trying to upload firmware?

I have saved the emonupload zipped file to the Arduino libraries, but there is nothing in there for me to open??

---

<div class="post-metadata">

**Author:** ![rdc-Green](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/rdc-green/32/17995_2.png) [@rdc-Green](https://community.openenergymonitor.org/u/rdc-Green)\
**Post date:** [11 March 2021 13:30 UTC](https://community.openenergymonitor.org/t/emontx-connecting-to-arduino-ide-using-programmer/17166/24 "2021-03-11T13:30:54Z")

</div>

thanks @borpin I figured this out. It was because I hadn’t updated the config file

---

<div class="post-metadata">

**Author:** ![rdc-Green](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/rdc-green/32/17995_2.png) [@rdc-Green](https://community.openenergymonitor.org/u/rdc-Green)\
**Post date:** [11 March 2021 15:02 UTC](https://community.openenergymonitor.org/t/emontx-connecting-to-arduino-ide-using-programmer/17166/25 "2021-03-11T15:02:26Z")

</div>

Are there instructions to update firmware onto an existing emonTx. I have downloaded emonupload and have the zip file in my Arduino library, but have no idea how to get it onto the emonTx.

I’m using a Windows laptop. Whenever i try to use the sudo command in cmd it doesn’t work. I can’t access the serial port using Putty either.

---

<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:** [11 March 2021 15:21 UTC](https://community.openenergymonitor.org/t/emontx-connecting-to-arduino-ide-using-programmer/17166/26 "2021-03-11T15:21:20Z")

</div>

I would again suggest installing the Arduino IDE and libraries as per the page in Learn.  
[Learn→Electricity Monitoring→Using the Arduino IDE](https://learn.openenergymonitor.org/electricity-monitoring/arduino-ide)

There are specific instructions for the programmers sold in The Shop here:  
[Learn→Electricity Monitoring→Programmers](https://learn.openenergymonitor.org/electricity-monitoring/programmers)

---

<div class="post-metadata">

**Author:** ![rdc-Green](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/rdc-green/32/17995_2.png) [@rdc-Green](https://community.openenergymonitor.org/u/rdc-Green)\
**Post date:** [11 March 2021 18:50 UTC](https://community.openenergymonitor.org/t/emontx-connecting-to-arduino-ide-using-programmer/17166/27 "2021-03-11T18:50:38Z")

</div>

Thanks Robert, I have done as you suggested and uploaded all the libraries. I’m still no closer to figuring out how to do the following though:

 ![image](https://community.openenergymonitor.org/uploads/default/original/3X/7/4/7462cf2b297bc76ed8d97497bdfe340f14e7cd9f.png)

I previously followed the programmer instructions and managed to change the node id using Arduino IDE. That was quite straightforward

---

<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:** [11 March 2021 18:52 UTC](https://community.openenergymonitor.org/t/emontx-connecting-to-arduino-ide-using-programmer/17166/28 "2021-03-11T18:52:52Z")

</div>

The Arduino IDE is nothing to do with Python. If you downloaded and installed the Windows version, it runs under Windows 10.

---

<div class="post-metadata">

**Author:** ![rdc-Green](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/rdc-green/32/17995_2.png) [@rdc-Green](https://community.openenergymonitor.org/u/rdc-Green)\
**Post date:** [11 March 2021 19:31 UTC](https://community.openenergymonitor.org/t/emontx-connecting-to-arduino-ide-using-programmer/17166/29 "2021-03-11T19:31:50Z")

</div>

So i have done the following steps:

- Uploaded all the relevant libraries into the Arduino folder and then pointed Arduino to said folder
- Saved emontx3phase into a folder on my computer
- I have opened src.ino in Arduino IDE, which shows the three tabs (src/config/rfm)
- I edited the node id to match the one i want to use
- I then verified the sketch and then pressed ‘upload’

This seemed to be successful, but i now have a blank screen when running the serial monitor

I then changed the baudrate to 9600 and i now have data coming through

---

<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:** [11 March 2021 20:09 UTC](https://community.openenergymonitor.org/t/emontx-connecting-to-arduino-ide-using-programmer/17166/30 "2021-03-11T20:09:10Z")

</div>

Have you read and followed all the instructions and settings with their explanations in the comments at the top of the sketch? Better still, if you’d downloaded the zip file from my post here in the forum, there’s full documentation in the form of a .pdf file. That’s been left off Github for some reason.

> [@rdc-Green](#):
>
> I then changed the baudrate to 9600

Unfortunately, the processor is too busy to be able to handle anything faster.

---

<div class="post-metadata">

**Author:** ![rdc-Green](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/rdc-green/32/17995_2.png) [@rdc-Green](https://community.openenergymonitor.org/u/rdc-Green)\
**Post date:** [11 March 2021 20:16 UTC](https://community.openenergymonitor.org/t/emontx-connecting-to-arduino-ide-using-programmer/17166/31 "2021-03-11T20:16:00Z")

</div>

Hi Robert, its all working now (although need to check that the config in emoncms is compatible). Thank you for your support

---

<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:** [11 March 2021 20:17 UTC](https://community.openenergymonitor.org/t/emontx-connecting-to-arduino-ide-using-programmer/17166/32 "2021-03-11T20:17:40Z")

</div>

That’s a matter of copying the section of comment in the source file into emonhub.conf

---

<div class="post-metadata">

**Author:** ![G0LGS](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/g0lgs/32/22567_2.png) [@G0LGS](https://community.openenergymonitor.org/u/G0LGS)\
**Post date:** [12 March 2021 13:33 UTC](https://community.openenergymonitor.org/t/emontx-connecting-to-arduino-ide-using-programmer/17166/33 "2021-03-12T13:33:39Z")

</div>

I too get -ve values on one of my feeds using the TxV3CM firmware, but using the PLL Firmware I get normal values for the same feeds.

I also get totally different readings between the two firmware versions (which I fail to understand).

(Actually I get similar reading on one phase, but not the other two).

---

<div class="post-metadata">

**Author:** ![rdc-Green](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/rdc-green/32/17995_2.png) [@rdc-Green](https://community.openenergymonitor.org/u/rdc-Green)\
**Post date:** [12 March 2021 13:44 UTC](https://community.openenergymonitor.org/t/emontx-connecting-to-arduino-ide-using-programmer/17166/34 "2021-03-12T13:44:47Z")

</div>

What is PLL firmware @G0LGS ?

I’ve now got everything up and running so will test on Tuesday

---

<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:** [12 March 2021 13:58 UTC](https://community.openenergymonitor.org/t/emontx-connecting-to-arduino-ide-using-programmer/17166/35 "2021-03-12T13:58:34Z")

</div>

> [@G0LGS](#):
>
> TxV3CM firmware,

That is suitable for a single-phase or a N.America split phase system only. The 3-phase PLL sketch is suitable for a 3-phase system only. If you use the wrong sketch on the wrong system, you are bound to get wrong results.

---

<div class="post-metadata">

**Author:** ![G0LGS](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/g0lgs/32/22567_2.png) [@G0LGS](https://community.openenergymonitor.org/u/G0LGS)\
**Post date:** [12 March 2021 14:06 UTC](https://community.openenergymonitor.org/t/emontx-connecting-to-arduino-ide-using-programmer/17166/36 "2021-03-12T14:06:29Z")

</div>

> [@Robert.Wall](#):
>
> That is suitable for a single-phase or a N.America split phase system only. The 3-phase PLL sketch is suitable for a 3-phase system only. If you use the wrong sketch on the wrong system, you are bound to get wrong results.

Thanks for Clarification - I’m so confused by the different versions.

---

<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:** [12 March 2021 14:28 UTC](https://community.openenergymonitor.org/t/emontx-connecting-to-arduino-ide-using-programmer/17166/37 "2021-03-12T14:28:07Z")

</div>

> [@G0LGS](#):
>
> I’m so confused by the different versions.

You could ask.

Basically, there are two sketches in use. The one factory-installed on the emonTx is the Continuous Monitoring sketch - [EmonTxV3CM](https://github.com/openenergymonitor/EmonTxV3CM), which is designed for the UK single phase domestic supply, but it is suitable also for the N.American single-phase split phase system.

If you have a 3 phase system, either 4-wire or the less common 3-wire, then you must use the 3-phase PLL sketch [Update to 3-Phase PLL sketch - #21 by Robert.Wall](https://community.openenergymonitor.org/t/update-to-3-phase-pll-sketch/8610/21)  
That download is the complete sketch and documentation. You should **not** attempt to use the pre-compiled version that has been put on Github as it is almost certain that you will need to adjust the options that are only available by editing the source code.

> [@G0LGS](#):
>
> I too get -ve values on one of my feeds using the TxV3CM firmware, but using the PLL Firmware I get normal values for the same feeds.

If you have a 3-phase supply (see the ‘Learn’ pages for how to identify whether you have), then using the single-phase sketch will not only give you negative powers on phases 2 & 3 (phase 1 being the one that the a.c. adapter is on), but those powers will be roughly half the correct value. If you don’t have the a.c. adapter, it will still be wrong, but less wrong, because it will indicate apparent power using a guessed voltage - the value for phase 1 that was previously correct (the real power) will now be wrong because it’s apparent power using the guessed voltage instead of a measured voltage, but probably by not too much (maybe within 20% if you’re lucky) and the ‘powers’ for phases 2 & 3 will improve but still be wrong by roughly the same amount.

---

<div class="post-metadata">

**Author:** ![rdc-Green](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/rdc-green/32/17995_2.png) [@rdc-Green](https://community.openenergymonitor.org/u/rdc-Green)\
**Post date:** [12 March 2021 18:48 UTC](https://community.openenergymonitor.org/t/emontx-connecting-to-arduino-ide-using-programmer/17166/39 "2021-03-12T18:48:11Z")

</div>

Thank you @Robert.Wall

one more question (although i doubt it will be the last). Can I set up the feeds in the same way I would with a single phase, i.e. use and use\_kWh, but for each power reading (1-3)

---

<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:** [12 March 2021 19:20 UTC](https://community.openenergymonitor.org/t/emontx-connecting-to-arduino-ide-using-programmer/17166/40 "2021-03-12T19:20:00Z")

</div>

That depends. If you have a 4-wire system, then each power represents the power seen by that c.t; whereas if you have a 3-wire system, the two individual “powers” have no meaning, only the sum - the total power - is meaningful. (In fact, when 3-wire is enabled, the total power is sent as “power1”, and “power2” is always zero.)  
Notwithstanding that, once you have a power into emonCMS on the inputs page, it can be handled exactly the same wherever it comes from.

---

<div class="post-metadata">

**Author:** ![rdc-Green](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/rdc-green/32/17995_2.png) [@rdc-Green](https://community.openenergymonitor.org/u/rdc-Green)\
**Post date:** [13 March 2021 19:02 UTC](https://community.openenergymonitor.org/t/emontx-connecting-to-arduino-ide-using-programmer/17166/41 "2021-03-13T19:02:58Z")

</div>

@Robert.Wall, do you know if its possible to amalgamate the power figures so that i can have just one feed being posted via the api?

[Previous page](https://community.openenergymonitor.org/t/emontx-connecting-to-arduino-ide-using-programmer/17166.md?page=1)

[Next page](https://community.openenergymonitor.org/t/emontx-connecting-to-arduino-ide-using-programmer/17166.md?page=3)
