It appears that version 1.8.7 of the Arduino IDE requires a definition of the showString( ) function to be placed in the main sketch. This problem manifested itself in the linked thread, which concerns the 3-phase PLL sketch.
ARDUINO 1.8.6 2018.08.23
[ide]
* Updated arduino-builder to 1.4.0:
- parallel build (improve compile speed)
- better reuse of already compiled files
- Windows: fixed build for sketch stored under OneDrive cloud folders
That parallel build could be a root cause… I looked through the rest of the release notes back to 1.8.1 and nothing else stood out as a possible cause.
For the benefit of others, I do hope this latest version will soon be placed/linked to in the Resources section.
Frankly - I find it difficult/impossible to locate single & 3 phase sketches as clicking on links just takes me in a circle back to where I started from.
On a separate/related topic - There is an excellent guide - ‘Using the Arduino IDE’ within the LEARN Electricity Monitoring section. There should be a prominent link to this in the RESOURCES section, in my opinion.
I have extended the 3-phase PLL sketch to cover now a 3-wire (no neutral) system as well as the 4-wire (with neutral) system.
In the 3-wire setting, one phase is treated as the neutral, and the system then collapses into a 2-phase system with the second phase lagging 60° behind the “reference” phase, the a.c. adapter being connected line 1 – ‘neutral’ phase. In this configuration, the two phase “powers” are meaningless, only the total power (real and apparent) is a valid physical quantity so the total power is reported as “power1”, and “power2” is always zero.
The principal changes are:
A switch to set 3-wire or 4-wire,
Each c.t. can now be allocated to any phase.
MD5 Hashes:
emonTx_3Phase_PLL_V1.4.zip
f6f0fd4e57290ed985f23596e1f55bc0
emonTx_3Phase_PLL.ino
c8e684a2549cde41629f2db205794b45
config.ino
ae9cc9c91f67ed3a6b47e49cc1f47b32
rfm.ino
44a0b048b14e5e013625809736853c57
emonTx 3-phase PLL User Doc.pdf:
c18387136424b903cdf49366f30fde9b
Extract the directory “emonTx_3Phase_PLL” and put it in your “sketches” folder. You can put the documentation where you wish.
From my point of view, it’s immaterial. I’m happy to be responsible for the version I publish, once a third party makes a change of any sort, responsibility passes to them. The GitHub version was put there by @Simsala, then Dan Bates made a change - a very poorly thought out change - that I could not agree to, so he’s now responsible for that version.
[Moved as the question was off-topic - nothing to do with the operation of the sketch.]
To be clear a ‘Pull request’ in github is a suggestion for a change, and @danbates pull request was not merged in this case. I’m sure Dan was just trying to help and suggest an improvement, is there a discussion somewhere that discusses the proposed changes?
I’ve upload your v1.4 changes @Robert.Wall available here in a development branch for testing:
Following on from difficulties in using this sketch with an ESP8266 module, the documentation has been changed to note that the baud rate setting in the ESP module must be reduced to 9600 baud. This release has no changes to the sketch, which remains at V1.4.
MD5 Hashes:
emonTx_3Phase_PLL_V1.5.zip
4bc19cd409bf43f32bdf835ea3b59355
emonTx_3Phase_PLL.ino
c8e684a2549cde41629f2db205794b45
config.ino
ae9cc9c91f67ed3a6b47e49cc1f47b32
rfm.ino
44a0b048b14e5e013625809736853c57
emonTx 3-phase PLL User Doc.pdf:
019524b053c3370380ebcbaf657f5d46
Extract the directory “emonTx_3Phase_PLL” and put it in your “sketches” folder. You can put the documentation where you wish.
If you are updating your documentation, it is only necessary to extract that.
Only Phase Rotation is important. For the emonTx, the phase that the a.c. adapter uses is always Phase 1. The other two phases must have the correct sequence relative to that. Phase 1 as labelled by your supplier need not be the phase that the emonTx considers is Phase 1.
It is written as clearly as I can in the PDF document that you downloaded with the 3-phase sketch as part of the zip file.
Thanks for the great sketch @Robert.Wall
I’ve got an emontx v2 laying and wanted to use it for the 3 phase measurements - is the lack of support for rfm12b a hardware problem or software ? Not sure if i have to desolder the rfm from the board.
I will be mainly using EmonESP with an esp8266 but i have an emonglcd laying around and was thinking i could use the rfm12b to send data to the lcd (ofc not needed - i can develop a new firmware for emonglcd with wifi etc)
Welcome, Marcin, to the OEM forum, and thank you for those kind words.
The problem with the RFM12B is it doesn’t have an internal buffer big enough to hold the complete message, it is only one byte big - therefore the JeeLib library needs to send the data one byte at a time with no gaps. And that is where it fails - the processor is too busy maintaining phase lock. What actually happens is the data has gaps - so it’s corrupted, and the sketch loses phase lock - so that’s wrong too.
The RFM69CW does have a big enough buffer, so that can easily be filled a few bytes at a time, then the RFM69CW does the rest without any help from the main processor.
You don’t need to remove the RFM12B, simply do not use it. Although you can use an ESP8266, my colleague @borpin recommends a Pi Zero W in preference. Note you can only send serial data slowly at 9600 baud or less.
An updated version of this sketch is attached here, correcting a minor problem with reading the configuration under certain conditions, and the two previous issues showed the wrong version number.