Skip to content
Snippets Groups Projects
Commit a848ad3d authored by Kyrre Ness Sjobaek's avatar Kyrre Ness Sjobaek
Browse files

Move deployer's config to separate file, set test board MAC address as default.

parent 46f61e27
No related branches found
No related tags found
1 merge request!1Fixes output formatting and variable initialization, moving config to separate file, project folder correctly named, hopefully fixes network crashes
......@@ -18,50 +18,7 @@
#include <SPI.h>
#include <Ethernet.h>
// ***** Mitutoyo instrument configuration *****
const uint8_t numCh = 2; //How many instruments connected
// Instruments are configured by arrays
// pinREQ / pinDAT / pinCLK / srvTXT_port / srvTXT
// Remember to update if changing the config!
//Arduino pins
// Used for Ethernet shield -- AVOID:
// 4/10/11/12/13 (UNO)
// 50/51/52/10/4 (Mega)
const uint8_t pinREQ[numCh] = {5,7};
const uint8_t pinDAT[numCh] = {2,8};
const uint8_t pinCLK[numCh] = {3,9};
//Uncomment this to enable the "dummy reader" code instead of the SPC protocol interface
// This disables the actual reading of the instrument,
// however pins are still configured on start
// This enables debugging of the network code if no Mitutoyo instrument is connected.
//#define DUMMY_READER
// ***** NETWORK CONFIG ************************
// *** MAC ADDRESS FOR THE ARDUINO ON THE PLASMA-LENS ***
//byte mac[] = {0xA8, 0x61, 0x0A, 0xAE, 0x84, 0xED};
// *** MAC ADDRESS FOR THE ARDUINO ON THE CLIC STRUCTURE ***
byte mac[] = {0xA8, 0x61, 0x0A, 0xAE, 0x84, 0xEE};
//To use DHCP or not to use DHCP, that's the question.
#define USE_DHCP
#ifndef USE_DHCP
IPAddress ip(192, 168, 1, 177);
IPAddress myDns(192, 168, 1, 1);
IPAddress gateway(192, 168, 1, 1);
IPAddress subnet(255, 255, 0, 0);
#endif
// ***** OTHER CONFIG ***************************
const unsigned long update_interval = 1000; //[ms] How often to loop
// (poll sensors, check for new network clients,
// feed data to network clients, DHCP housekeeping)
const unsigned long WEB_update_interval = 5; //[s] WEB requests are heavy, not too often is good.
const unsigned long SPC_timeout = 200; //[ms] Experimentally verified to be OK.
const unsigned long WEB_timeout = 600; //[ms] Max time allowed waiting for web client
#include "PositionGaugeServer_config.h"
// ***** GLOBAL VARIABLES ***********************
......@@ -83,16 +40,7 @@ EthernetServer srvTXT[numCh] = {
EthernetClient clients[MAX_SOCK_NUM];
uint8_t clients_ch[MAX_SOCK_NUM]; //which channel does a particular client belong to?
// ***** CODE -- DO NOT CHANGE *******************
// ***** CODE ************************************
void setup() {
......
#ifndef __PositionGaugeServer_config_h__
#define __PositionGaugeServer_config_h__
// ***** Mitutoyo instrument configuration *****
const uint8_t numCh = 2; //How many instruments connected
// Instruments are configured by arrays
// pinREQ / pinDAT / pinCLK / srvTXT_port / srvTXT
// Remember to update if changing the config!
//Arduino pins
// Used for Ethernet shield -- AVOID:
// 4/10/11/12/13 (UNO)
// 50/51/52/10/4 (Mega)
const uint8_t pinREQ[numCh] = {5,7};
const uint8_t pinDAT[numCh] = {2,8};
const uint8_t pinCLK[numCh] = {3,9};
//Uncomment this to enable the "dummy reader" code instead of the SPC protocol interface
// This disables the actual reading of the instrument,
// however pins are still configured on start
// This enables debugging of the network code if no Mitutoyo instrument is connected.
//#define DUMMY_READER
// ***** NETWORK CONFIG ************************
// *** MAC ADDRESS FOR THE ARDUINO ON THE PLASMA-LENS ***
//byte mac[] = {0xA8, 0x61, 0x0A, 0xAE, 0x84, 0xED};
// *** MAC ADDRESS FOR THE ARDUINO ON THE CLIC STRUCTURE ***
//byte mac[] = {0xA8, 0x61, 0x0A, 0xAE, 0x84, 0xEE};
// *** MAC ADDRESS FOR KYRRE'S TEST BOARD ***
byte mac[] = {0xA8, 0x61, 0x0A, 0xAE, 0x72, 0xF7};
//To use DHCP or not to use DHCP, that's the question.
// Comment out to use static IP configuration
#define USE_DHCP
#ifndef USE_DHCP
IPAddress ip(192, 168, 1, 177);
IPAddress myDns(192, 168, 1, 1);
IPAddress gateway(192, 168, 1, 1);
IPAddress subnet(255, 255, 0, 0);
#endif
// ***** OTHER CONFIG ***************************
const unsigned long update_interval = 1000; //[ms] How often to loop
// (poll sensors, check for new network clients,
// feed data to network clients, DHCP housekeeping)
const unsigned long WEB_update_interval = 5; //[s] WEB requests are heavy, not too often is good.
const unsigned long SPC_timeout = 200; //[ms] Experimentally verified to be OK.
const unsigned long WEB_timeout = 600; //[ms] Max time allowed waiting for web client
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment