emonTx connecting to arduino IDE using programmer

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

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

#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.

I’m afraid not.

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.

None of your nodes are receiving any data apparently.

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??

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

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.

I would again suggest installing the Arduino IDE and libraries as per the page in Learn.
Learn→Electricity Monitoring→Using the Arduino IDE

There are specific instructions for the programmers sold in The Shop here:
Learn→Electricity Monitoring→Programmers

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:

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

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

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

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.

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

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

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

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).

What is PLL firmware @G0LGS ?

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

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.

You could ask.

Basically, there are two sketches in use. The one factory-installed on the emonTx is the Continuous Monitoring sketch - 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
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.

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.

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)

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.

@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?