Open Kontrol Gateway
Open Kontrol Gateway
The Open Kontrol Gateway (OKG) is a very flexible web-connected base station based on the ATmega328 which is totally Arduino IDE compatible (Arduino UNO bootloader). The OKG has been designed and manufactured by our friend Miles who runs Ciseco Plc .
The OKG PCB supports multiple wireless options such as RFM12B, XBEE, XRF, RN-XV Wifi. There is also PCB footprints for expansions like a RTC, SD card and SRAM. The OKG supports both the ENC28J60 or Wiznet Ethernet chips. See our blog post [LINK] on the OGK for background info and a brief comparison of the two different Ethernet chips.
Using the OKG as an OpenEnergyMonitor emonBase
With RFM12B wireless to receive data from emonTx, emonGLCD and post to emoncms
Using OKG with ENC28J60
Using the OKG with the ENC28J60 Ethernet board and RFM12B makes the OKG (almost!) hardware identical to the NanodeRF. The only differences is that different SPI SS/CS pins are used on the OKG for the both ENC28J50 and RFM12B. This is a bit of a pain but workable. Follow these steps:
- Assemble the OKG base board following the Ciseco instructions on the OpenMicros - assembling the OKG. For emonBase operation the position of the jumpers don't matter. When your done the board should look like the photo above.
- Assemble the Wiznet Ethernet board following the Ciseco instructions on the OpenMicro website OpenMicros - assembling the OKG ENC28J60 board
- To the the NanodeRF emonBase examples with the OKG the line
if (ether.begin(sizeof Ethernet::buffer, mymac) == 0)
needs to be changed to
if (ether.begin(sizeof Ethernet::buffer, mymac ,10) == 0)
this is because on the OKG the ENC28J60 SPI SS connection is connected to Dig10 on the ATmega 328 as opposed to Dig8 which is used on the NanodeRF (library default). In the latest emonBase NanodeRF examples this line has been ready inserted commented out. Just un-comment it and comment out the original line.
- A change is also required to get the RFM12B on the OKG to work since the RFM12B SPI CS is connected to Dig9 instead of Dig10 (as is the case with other modules), we have made a forked JeeLib library to make implementing this change easy.
- Download the OpenEnergyMonitor modified JeeLib library and install in your Arduino folder. Make sure to delete any other JeeLib library folder you currently have in your Arduino library folder.
- Make sure you have the latest NanodeRF emonBase examples from the OpenEnergyMonitor GitHub
- Un-comment the line
this modified JeeLib library can be used with the emonTx, emonGLCD, Jeenode and NanodeRF just use
- If you would like the OKG front LED indicator to work you will need to change redLED definition to
const int redLED = 6;near the beginning of the sketch.
Using OKG with Wiznet W5200
The Wiznet W5200 is a more advanced Ethernet chip which has the TCP/IP stack integrated, it's almost identical to the Wiznet W5100 which is used in the official Arduino Ethernet boards. The Wiznet W5200 works with the standard Arduino Ethernet library with a small change. To use the OKG with the Wiznet W5200 as an emonBase to receive data from emonTx via RFM12B and post to emoncms follow the steps:
- Assemble the OKG base board following the Ciseco instructions on the OpenMicros - assembling the OKG. For emonBase operation the position of the jumpers don't matter. When your done the board should look like this:
- Assemble the ENC28J60 Ethernet board following the Ciseco instructions on the OpenMicro website OpenMicros - assembling the OKG ENC28J60 board
- Replace the Arduino Ethernet library (in Arduino IDE librarys folder) with an updated library to support the Wiznet W5200 download from Ciseco GitHub