I have just put together a two CT emonTX and I am now trying to program it
I have plugged in a USB cable to supply the power and have plugged in the FTDI cable.
I have the Blue RXD light on now, I have downloaded the Arduino 1.0 software and the Firmware for the emonTX, but now I appear to be stuck.
When I load up emonTx_2CT_Voltage.pde and do a verify/complie I get an error message Boolean lastVcross, CheckVcross; does not have a name ?
Is there a quick way to check if I have even built the emonTX correctly ?
Is the Blue light on a good sign ?
Neil
Re: Programing the emonTX
Hi Neil
Ive just finished putting mine together and had some fun programming it, if your getting errors when doing a verify/compile then its not getting near the emonTX yet, in fact you should get the same error even with it not plugged in yet. There are a couple variants on the libraries that are needed, make sure you have all those in place, also there is a big change in the way the Arduino software is working for the new Version 1.0, so it might be better to program with an earlier version (I had best success with 0023).
Depending on how much youve played with Arduino's the following may help or be teaching you to suck eggs!:
When you put a libary into the folder you sometimes need to delete the begining and ending of the download name, ie if you download the ethershield library and it extracts to a folder called thiseldo-EtherShield-3793b4c you would need to rename it to EtherShield
The program also only looks for new librarys when starting up so you may have to restart.
There are a couple posts on here already about what are the best library to use with which version of software etc.
Lastly the thing that tripped me up a couple times and I thought i'd broken it was that the TX and Base have to be selected as different boards when trying to upload a program but I am not sure it makes a difference when compiling (but I would set it correct to be sure just in case)
As far as I remember (and last night seems a distance away now) a blue light when turning on not programmed is ok.
When proigrammed it should flash roughly every 10 secs (depending on the sample rate in the sktech).
Gary
Re: Programing the emonTX
I changed to build 0023 and renamed the libraries as you suggested and it worked first time with the emonTX_1CT_Voltage script, well, the green light flashed on and off every couple of seconds :-)
I tried to load the 2CT version as my emonTX is the 2 lead version but that wont complie.
emonTx_2CT_Voltage.cpp: In function 'void loop()':
emonTx_2CT_Voltage:124: error: 'struct Payload' has no member named 'apparent1'
emonTx_2CT_Voltage:125: error: 'struct Payload' has no member named 'vrms1'
emonTx_2CT_Voltage:126: error: 'struct Payload' has no member named 'irms1'
emonTx_2CT_Voltage:136: error: 'struct Payload' has no member named 'apparent2'
emonTx_2CT_Voltage:137: error: 'struct Payload' has no member named 'vrms2'
emonTx_2CT_Voltage:138: error: 'struct Payload' has no member named 'irms2'
emonTx_2CT_Voltage.cpp: In function 'void serial_output()':
emonTx_2CT_Voltage:211: error: 'struct Payload' has no member named 'apparent1'
emonTx_2CT_Voltage:213: error: 'struct Payload' has no member named 'vrms1'
emonTx_2CT_Voltage:215: error: 'struct Payload' has no member named 'irms1'
emonTx_2CT_Voltage:220: error: 'struct Payload' has no member named 'apparent2'
emonTx_2CT_Voltage:222: error: 'struct Payload' has no member named 'vrms2'
emonTx_2CT_Voltage:224: error: 'struct Payload' has no member named 'irms2'
Any ideas ?
Re: Programing the emonTX
I didnt have the 2ct voltage sketch in my downloads, so looks like its been added in the last few days, i have downloaded and it wont compile on mine either, I will try and look through it tonight but hopefully someone else will see this and have a solution faster for you.
If its any help to get started the 2ct example compiles fine on 0023 but obviously dosnt have the voltage sensor.
Re: Programing the emonTX
Hi Gary,
We'r planning on merging all the emontx examples and porting them to Arduinio 1.0 soon, this should make it easier.
In the meantime if just tested emonTx 2CT voltage example and have fixed the problem. It should now compile for you: https://github.com/openenergymonitor/emonTxFirmware/tree/master/emonTx_2CT_Voltage
Sorry about that,
Re: Programing the emonTX
You will need to re-download the emonTx 2CT example again, I've just (hour ago) fixed the problem and pushed the new fixed sketch to github.
Re: Programing the emonTX
Just uploaded the new 2CT-Voltage example and it worked.
Thanks
Neil