Loop-back Test Procedure for checking your Serial ports or
USBtoSerial Converters
1. If you have a USBtoSerial Converter, plug it in.
If you using Windows XP and newer before install drivers please check follow this information:
http://info.kmtronic.com/ftdi-virtual-com-port-drivers-installation.html
If you using Windows 7, Vista, 8 ... wait until Windows install drivers automatically.
2. You should check Device Manager to see if it is there first!
After the drivers' installed, an additional COM port appears in the Device Manager of Windows - usually, it is COM3, COM4 COM5 ...
Then proceed.
3. Connect RX PIN to TX PIN only
4. Download and run Loopback Test Software:
http://www.info.kmtronic.com/software/KMTronic_Loopback_Tester.zip
5. Choose COM port, click Open, write word or symbol and click Send
If you see reply the same you send - CONGRATULATIONs!
Driver is installed correctly and hardware work.
http://info.kmtronic.com/ftdi-virtual-com-port-drivers-installation.html
http://www.raspberrypi.org/
Raspberry PI is a small but very powerful microcontroller which allows you to do many things.
Using Raspberry PI we try to introduce not only our relay boards but also the capability of this controller.
Try it out :) We promise you sleepless nights with lots of fun.
----------------- INFORMATION -----------------
How to Compiling C and C++ Programs
https://info.kmtronic.com/how-to-compiling-c-and-c-programs.html
How to connect RaspberryPI camera
https://info.kmtronic.com/how-to-connect-raspberrypi-camera.html
Raspberry Pi LCD 16x2 Display
https://info.kmtronic.com/raspberry-pi-lcd-16x2-display.html
Raspberry Pi How to install Web Server
https://info.kmtronic.com/raspberry-pi-how-to-install-web-server.html
Raspberry Pi Web Control Relay
https://info.kmtronic.com/raspberry-pi-web-control-relay.html
----------------- RELAY CONTROL -----------------
Controlling USB One Relay by Raspberry Pi
http://www.info.kmtronic.com/controlling-usb-one-relay-by-raspberry-pi.html
Controlling USB 8 Relay board by Raspberry Pi
http://www.info.kmtronic.com/controlling-usb-8-relay-board-by-raspberry-pi.html
Controlling UART 8 Relay board by Raspberry Pi
http://www.info.kmtronic.com/controlling-uart-8-relay-board-by-raspberry-pi.html
USB RS485 8 Relay boards by Raspberry Pi
https://info.kmtronic.com/usb-rs485-8-relay-boards-by-raspberry-pi.html
Raspberry Pi RS232 8 Relay Board
https://info.kmtronic.com/raspberry-pi-rs232-8-relay-board.html
Raspberry Pi Joystick controlled relays
https://info.kmtronic.com/raspberry-pi-joystick-controlled-relays.html
Raspberry Pi PC Remote Control
https://info.kmtronic.com/raspberry-pi-pc-remote-control.html
Domotica: il riscaldamento controllato via web, con Raspberry PI (Sergio Vaccaro)
http://sergiovaccaro.it/domotica-il-riscaldamento-controllato-via-web-con-raspberry-pi-2/
----------------- DOOR LOCK / ACCESS CONTROL -----------------
Raspberry Pi Door Lock - “computer based” access control
https://info.kmtronic.com/door-lock-using-usb-relay.html
Raspberry Pi Door Lock using USB RFID Reader
https://info.kmtronic.com/raspberry-pi-door-lock-02.html
Raspberry Pi Door Lock using USB keyboard
https://info.kmtronic.com/raspberry-pi-door-lock-03.html
----------------- ENERGY METERS -----------------
Raspberry Pi ModBus Energy Meter 1
https://info.kmtronic.com/raspberry-pi-modbus-energy-meter-1.html
Raspberry Pi ModBus Energy Meter 2
https://info.kmtronic.com/raspberry-pi-modbus-energy-meter-2.html
----------------- TEMPERATURE -----------------
How to connect DS18B20 to RaspberryPI GPIO
https://info.kmtronic.com/raspberry-pi-ds18b20-connect-to-gpio.html
Raspberry PI and KMTronic USB DS18B20
https://info.kmtronic.com/raspberry-pi-usb-ds18b20.html
----------------- DMX512 -----------------
Control DMX512 devices via Raspberry PI
https://info.kmtronic.com/control-dmx512-devices-via-raspberry-pi.html
....
Under Development
Written by Adrian Pike
I’m not really a hardware guy.
I like being able to easily rig up a replicable scenario and have it, well, you know, act the same every time.
Not slightly different because it’s damp outside, or sunspots, or telekinesis, or some other tomfoolery.
Also, I’ve let the smoke out of way too many projects as a kid to be comfortable with a soldering iron.
.....
http://adrianpike.tumblr.com/post/6009384439/door-locks-on-rails
A USB relay for your D-Star repeater
Written by Gary, KB2BSL
The internet bandwidth to the WG2MSK repeater in NYC is via a Clear(wire) 4G modem, it has a tendency to lock up, loose signal and never re-acquire despite being less than 50m from their tower. I have been through their "tech support" and exchanged the modem several times....
http://www.kc2ra.org/index.php/d-star/170-a-usb-relay-for-your-d-star-repeater
Control KMtronic USB, RS485, RS232 relay boards via EXCEL files 
www.info.kmtronic.com/control-kmtronic-relays-via-excel.html
Control KMtronic USB, RS232 relay boards via BAT files 
www.info.kmtronic.com/control-kmtronic-relays-via-bat-files.html
Control KMtronic RS485 relay boards via BAT files 
www.info.kmtronic.com/control-kmtronic-rs485-relays-via-bat-files.html
Control KMtronic USB, RS485 and TCP(Web) relay boards by Domoticz 
www.info.kmtronic.com/usb-rs485-and-tcp-web-relay-boards-by-domoticz.html
KMTronic USB Relay Test software
http://info.kmtronic.com/kmtronic-usb-relay-test-software.html
KMtronic USB 8 Relay software
http://info.kmtronic.com/usb-8-relay-software.html
KMtronic One Relay Timer software
http://www.info.kmtronic.com/kmtronic-timer-software.html
RS485 Relays commands
http://info.kmtronic.com/kmtronic-rs485-relays-commands.html
DSP Robotics FlowStone example
http://info.kmtronic.com/control-kmtronic-usb-relays-with-dsprobotics-flowstone.html
Labview example (thanks, Siva)
http://info.kmtronic.com/how-to-control-kmtronic-usb-relays-with-labview.html
MATLAB example (thanks, Dr. Dean Rose)
http://info.kmtronic.com/how-to-control-kmtronic-usb-relays-with-matlab.html
Windows Shortcut example for switching on and off the KMTronic USB One Relay
http://info.kmtronic.com/windows-shortcut-example-for-kmtronic-usb-one-relay.html
Windows Command Line example
http://info.kmtronic.com/windows-command-line-example.html
Windows Command Line example 2 
http://info.kmtronic.com/windows-command-line-example-2.html
Windows Startup Control
http://www.info.kmtronic.com/windows-startup-control-kmtronic-usb-relays.html
Abacom ProfiLAB example
USB_One_Relay_ProfiLAB.pdf 
Controlling USB Relay via Microsoft Office PowerPoint
Controlling_USB_Relay_via_Microsoft_Office_PowerPoint.pdf 
http://info.kmtronic.com/controlling-usb-relay-controllers-via-microsoft-office-powerpoint.html
Mach3 CNC
http://info.kmtronic.com/mach3-and-kmtronic-usb-relays.html
GBTimelapse to control the Dynamic Perception MX2 Dolly using a USB relay
http://info.kmtronic.com/gbtimelapse-to-control-the-dynamic-perception-mx2-dolly-using-a-usb-relay.html
Macro Express
http://info.kmtronic.com/controlling-usb-relay-via-macro-express.html
CVI/Labwindows
http://www.info.kmtronic.com/control-kmtronic-relays-with-cvilabwindows.html
Vixen lighting automation software
http://info.kmtronic.com/vixen-kmtronic-relays-control.html
Centrafuse AUTO
http://www.info.kmtronic.com/kmtronic-centrafuse-usb-relay.html
KMTronic USB One Relay Linux Test script
http://info.kmtronic.com/kmtronic-usb-one-relay-linux-test-script.html
Linux example
http://info.kmtronic.com/sample-linux-code.html
Macintosh example
USB_One_Relay_Macintosh.pdf 
Controlling KMTronic Relays by Arduino ADK
http://info.kmtronic.com/controlling-kmtronic-relays-by-arduino-adk.html
Controlling RS485 Relays by Raspberry Pi
http://info.kmtronic.com/controlling-rs485-relays-by-raspberry-pi.html
Sample VB NET 2010 software (inc. source code)
http://info.kmtronic.com/kmtronic-vb-net-2010-example.html
Sample Visual Basic code
USB_One_Relay_VB.pdf 
VB_Relay_Example.zip
Sample C# NET 2010 software (inc. source code)
http://info.kmtronic.com/kmtronic-cs-net-2010-example.html
Sample C# code
USB_One_Relay_C#.pdf 
Sample php files
USB_One_Relay_PHP.pdf 
The Perl example(thanks, Pascal)
http://info.kmtronic.com/how-to-control-kmtronic-usb-relays-using-perl-script.html
The python library(thanks, David)
http://info.kmtronic.com/control-kmtronic-usb-relays-the-python-library.html
A USB relay for your D-Star repeater
http://info.kmtronic.com/a-usb-relay-for-your-d-star-repeater.html
Door lock using USB Relay
http://info.kmtronic.com/door-lock-using-usb-relay.html
Controlling KMTronic Relays by Loxone Home Automation Miniserver
http://info.kmtronic.com/controlling-kmtronic-relays-by-loxone-miniserver.html
Control4 RS232 8 Relay Board Driver License
http://info.kmtronic.com/control4-rs232-8-relay-board-driver-license.html
Self Service Tablet Kiosk by Enigma Systems LLC
http://info.kmtronic.com/self-service-tablet-kiosk-by-enigma-systems-llc.html
http://www.info.kmtronic.com/software/Raspberry_PI/Raspberry_PI_KMTronic_USB_Relay.zip
USB One Relay commands:
FF 01 00 - OFF command
FF 01 01 - ON command
FF 01 03 - Status request command
> FF 01 xx - Reply from relay
where xx is status: 01 - Relay is ON, 00 - Relay is OFF
Set baudrate to 9600b/s
Switch ON relay
Switch OFF relay
Status request
How to change default settings KMTronic LAN board
Written by Super User
Turn OFF Wi-Fi Internet if you using Laptop PC.
Open ‘Network and Sharing Center’ and go to ‘Local Area Connection’ properties.
Set as show in next screenshots:
Connect to PC direct !!!
Open Explorer and type 192.168.1.199 and press Enter.
If all is right you will see Login menu board.
Type ‘admin’ ‘admin’ and go to Configuration page, change Board IP address, Gateway IP address and click Save Config.
Master (Inputs) Code
#include "EtherShield.h"
uint8_t mymac[6] = {0xCF,0x70,0x7C,0xE4,0x8A,0xB9}; // Master MAC
uint8_t myip[4] = {192,168,1,26}; // Master IP
uint8_t udpmac[6] = {0xCF,0x70,0x7C,0xE4,0x8A,0xB8}; // Slave MAC
uint8_t udpip[4] = {192,168,1,25}; // Slave IP
#define DEST_PORT_L 0x34
#define DEST_PORT_H 0x12
const char iphdr[] PROGMEM ={0x45,0,0,0x82,0,0,0x40,0,0x20}; // 0x82 is the total len on ip, 0x20 is ttl (time to live)
#define BUFFER_SIZE 750
static uint8_t buf[BUFFER_SIZE+1];
char reply[]={0xFF, 0x00, 0x00, 0x00, 0x00};
EtherShield es=EtherShield();
uint16_t plen, dat_p, a;
static uint32_t timetosend;
///----------------------------------------------------------
void setup(){
es.ES_enc28j60Init(mymac);
es.ES_init_ip_arp_udp_tcp(mymac,myip, 80);
} // end setup
///----------------------------------------------------------
void loop(){
// read packet, handle ping and wait for a tcp packet:
dat_p=es.ES_packetloop_icmp_tcp(buf,es.ES_enc28j60PacketReceive(BUFFER_SIZE, buf));
if(millis() - timetosend > 100) // every 10 seconds //
{
timetosend = millis();
if ( check() )
{
reply[1] = digitalRead(A5) ? 1 : 0;
reply[2] = digitalRead(A4) ? 1 : 0;
reply[3] = digitalRead(A3) ? 1 : 0;
reply[4] = digitalRead(A2) ? 1 : 0;
UDP_Send();
}
}
} // end loop
void UDP_Send( void ) {
uint8_t i=0;
uint16_t ck;
// Setup the MAC addresses for ethernet header
while(i<6){
buf[ETH_DST_MAC +i]= udpmac[i];
buf[ETH_SRC_MAC +i]= mymac[i];
i++;
}
buf[ETH_TYPE_H_P] = ETHTYPE_IP_H_V;
buf[ETH_TYPE_L_P] = ETHTYPE_IP_L_V;
es.ES_fill_buf_p(&buf[IP_P],9,iphdr);
// IP Header
buf[IP_TOTLEN_L_P]=28+sizeof(reply);
buf[IP_PROTO_P]=IP_PROTO_UDP_V;
i=0;
while(i<4){
buf[IP_DST_P+i]=udpip[i];
buf[IP_SRC_P+i]=myip[i];
i++;
}
es.ES_fill_ip_hdr_checksum(buf);
buf[UDP_DST_PORT_H_P]=DEST_PORT_H;
buf[UDP_DST_PORT_L_P]=DEST_PORT_L;
buf[UDP_SRC_PORT_H_P]=0x12;
buf[UDP_SRC_PORT_L_P]=0x34; // lower 8 bit of src port
buf[UDP_LEN_H_P]=0;
buf[UDP_LEN_L_P]=8+sizeof(reply); // fixed len
// zero the checksum
buf[UDP_CHECKSUM_H_P]=0;
buf[UDP_CHECKSUM_L_P]=0;
// copy the data:
i=0;
// most fields are zero, here we zero everything and fill later
uint8_t* b = (uint8_t*)&reply;
while(i< sizeof( reply ) ){
buf[UDP_DATA_P+i]=*b++;
i++;
}
// Create correct checksum
ck=es.ES_checksum(&buf[IP_SRC_P], 16 + sizeof( reply ),1);
buf[UDP_CHECKSUM_H_P]=ck>>8;
buf[UDP_CHECKSUM_L_P]=ck& 0xff;
es.ES_enc28j60PacketSend(42 + sizeof( reply ), buf);
}
int check()
{
if (digitalRead(A5) != reply[1] ) return(1);
if (digitalRead(A4) != reply[2] ) return(1);
if (digitalRead(A3) != reply[3] ) return(1);
if (digitalRead(A2) != reply[4] ) return(1);
return 0;
}
Slave (Relays) code
#include "EtherShield.h"
uint8_t mymac[6] = {0xCF,0x70,0x7C,0xE4,0x8A,0xB8};
uint8_t myip[4] = {192,168,1,25};
uint16_t MYWWWPORT = 80;
#define BUFFER_SIZE 750
static uint8_t buf[BUFFER_SIZE+1];
EtherShield es=EtherShield();
uint16_t plen, dat_p;
///----------------------------------------------------------
void setup(){
Serial.begin(9600);
Setup_Pins();
es.ES_enc28j60Init(mymac);
es.ES_init_ip_arp_udp_tcp(mymac,myip, MYWWWPORT);
} // end setup
///----------------------------------------------------------
void loop(){
// read packet, handle ping and wait for a tcp packet:
dat_p=es.ES_packetloop_icmp_tcp(buf,es.ES_enc28j60PacketReceive(BUFFER_SIZE, buf));
if (buf[IP_PROTO_P]==IP_PROTO_UDP_V){
Relay_Control();
buf[IP_PROTO_P]=0;
}
} // end loop
///----------------------------------------------------------
void Setup_Pins(){
pinMode(5, OUTPUT); digitalWrite(5, 0);
pinMode(6, OUTPUT); digitalWrite(6, 0);
pinMode(7, OUTPUT); digitalWrite(7, 0);
pinMode(8, OUTPUT); digitalWrite(8, 0);
} // end Setup_Pins
///----------------------------------------------------------
void Relay_Control(){
Serial.print(buf[43], HEX);
//if (buf[42]==0xFF)
// {
//Serial.print(buf[43], HEX);
digitalWrite(8, buf[43]);
digitalWrite(7, buf[44]);
digitalWrite(6, buf[45]);
digitalWrite(5, buf[46]);
// }
} // end Relay_Control
Vixen KMtronic Relays Control
Download and install Vixen Lightning from
Download information and DLL:
http://www.info.kmtronic.com/Vixen_KMtronic_Relays_Control.zip