FIRMWARE UPLOAD EMONWRT2: Difference between revisions

From lechacal
Jump to navigation Jump to search
(Created page with "Upload emontx Arduino sketch to the EmonWRT ==Required Equipment== * 1 screw driver * 1 FTDI/USB adaptor * A computer running the Arduino IDE ==Steps== 1/ Open the EMonWRT...")
 
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
Upload emontx Arduino sketch to the EmonWRT
Upload Arduino sketch to the EmonWRT2


==Required Equipment==
==Required Equipment==


* 1 screw driver
* 1 screw driver
* 1 FTDI/USB adaptor
* 1 avr Programmer
* A computer running the Arduino IDE
* A computer running the Arduino IDE


==Steps==
==Steps==


1/ Open the EMonWRT enclosure removing the two screws.
[[File:IMG_0905_small.png | right]]


2/ Download and install the Arduino IDE. https://www.arduino.cc/en/Main/Software


3/ Open the sketch template given on the main EmonWRT page.
1/ Disconnect all cables (ethernet power sensors) from the unit.


4/ Modify it to your needs. The main parameters to change are at the top of the sketch.
2/ Open the EmonWRT2 enclosure removing the four screws.


const boolean CT1  = 1;                                                // Set to 0 to disable CT channel 1
3/ Download and install the Arduino IDE on your computer. https://www.arduino.cc/en/Main/Software
const boolean CT2  = 1;                                                // Set to 0 to disable CT channel 2
const boolean CT3  = 1;                                                // Set to 0 to disable CT channel 3
const boolean TEMP = 1;                                                // Set to 0 to disable Temperature Channel
const boolean RP1  = 1;                                                // Set to 0 to disable Real Power on CT1 channel (requires ac/ac adaptor)
const boolean RP2  = 1;                                                // Set to 0 to disable Real Power on CT1 channel (requires ac/ac adaptor)
const boolean RP3  = 1;                                                // Set to 0 to disable Real Power on CT1 channel (requires ac/ac adaptor)
const boolean VRMS = 1;                                                // Set to 0 to disable VRMS channel (requires ac/ac adaptor)
const boolean PULS = 0;                                                // Set to 0 to disable PULSE channel (requires TSL257 sensor)
const boolean RF  = 0;                                                // Set to 0 to disable RFM12B forwarding.


Set the variable =0 or =1 depending on which sensor you wish to enable/disable. Note that for RP1 RP2 RP3 associated CT1 ct2 ct3 must also be enabled.
4/ Open the sketch template given on the main EmonWRT2 page.


5/ Install all required libraries:
5/ Modify it to your needs. The main parameters to change are at the top of the sketch.
Emonlib Library:
https://github.com/openenergymonitor/EmonLib
JeeLib:
http://github.com/jcw/jeelib
Timer:
http://playground.arduino.cc/Code/SimpleTimer
One Wire
http://www.pjrc.com/teensy/td_libs_OneWire.html
Dallas Temparature:
http://milesburton.com/Main_Page?title=Dallas_Temperature_Control_Library


6/ Connect the FTDI adaptor to the emontx board on the FTDI port. Make sure grounds are connected together. Connect the other end of the FTDI adaptor to the USB port of the computer.
#define POLLING_INTERVAL  5000


7/ Upload the sketch with the IDE.
const float ICAL = 83.33;
const double VCAL1 = 273.9;
const double VCAL2 = 269.5;
const double VCAL3 = 271.0;


[[File:IMG_0606_small.jpg]]
boolean THREEPHASE = true;
 
ICAL is the calibration value for the SCT. VCAL are the calibration value for the Voltage sensor. THREPHASE true or false will enable/disable 3 phase output.
 
6/ Install all required libraries:
 
One Wire<br>
http://www.pjrc.com/teensy/td_libs_OneWire.html<br>
arduino-tiny core: <br>
http://code.google.com/p/arduino-tiny/<br>
sendonlySoftwareSerial:<br>
http://lechacal.com/RPICT/7CT1V/SendOnlySoftwareSerial.zip<br>
 
7/ <b>Remove all 6 jumpers from the EmonWRT2 board</b>.
 
8/ Connect the AVR programmer to the EmonWRT2 board on the FTDI port. Make sure grounds are connected together.
 
9/ Setup correct serial port and programmer on Arduino IDE. Also make sure that the <b>ATtiny84 @ 8Mhz</b> is selected.
 
10/ Upload the firmware. Disconnect the avr programmer. Re-install the jumpers. Apply power to the board for testing.

Latest revision as of 17:55, 25 July 2016

Upload Arduino sketch to the EmonWRT2

Required Equipment

  • 1 screw driver
  • 1 avr Programmer
  • A computer running the Arduino IDE

Steps


1/ Disconnect all cables (ethernet power sensors) from the unit.

2/ Open the EmonWRT2 enclosure removing the four screws.

3/ Download and install the Arduino IDE on your computer. https://www.arduino.cc/en/Main/Software

4/ Open the sketch template given on the main EmonWRT2 page.

5/ Modify it to your needs. The main parameters to change are at the top of the sketch.

#define POLLING_INTERVAL  5000
const float ICAL = 83.33;
const double VCAL1 = 273.9;
const double VCAL2 = 269.5;
const double VCAL3 = 271.0;
boolean THREEPHASE = true;

ICAL is the calibration value for the SCT. VCAL are the calibration value for the Voltage sensor. THREPHASE true or false will enable/disable 3 phase output.

6/ Install all required libraries:

One Wire
http://www.pjrc.com/teensy/td_libs_OneWire.html
arduino-tiny core:
http://code.google.com/p/arduino-tiny/
sendonlySoftwareSerial:
http://lechacal.com/RPICT/7CT1V/SendOnlySoftwareSerial.zip

7/ Remove all 6 jumpers from the EmonWRT2 board.

8/ Connect the AVR programmer to the EmonWRT2 board on the FTDI port. Make sure grounds are connected together.

9/ Setup correct serial port and programmer on Arduino IDE. Also make sure that the ATtiny84 @ 8Mhz is selected.

10/ Upload the firmware. Disconnect the avr programmer. Re-install the jumpers. Apply power to the board for testing.