Go Down

Topic: Ethernet Control (Read 1 time) previous topic - next topic

ADDN

Hello everyone,

I found a project on the Project Hub i feel i can find a practical application for at work;

https://create.arduino.cc/projecthub/tatco-inc/arduino-ethernet-controller-a6c9c7?ref=part&ref_id=31780&offset=15

All seems very straight forward, the only issue I am having is when I compile im getting an error and need help troubleshooting.

The sketch is too long to fit everything in 1 post so I will add it below.

Error message:

Code: [Select]
Arduino: 1.6.1 (Windows 7), Board: "Arduino Uno"

Ethernet.ino: In function 'void loop()':

Ethernet.ino:48:10: error: ambiguous overload for 'operator=' (operand types are 'String' and 'int')

Ethernet.ino:48:10: note: candidates are:

In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:222:0,

                 from C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI/SPI.h:17,

                 from Ethernet.ino:2:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/WString.h:86:11: note: String& String::operator=(const String&) <near match>

  String & operator = (const String &rhs);

           ^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/WString.h:86:11: note:   no known conversion for argument 1 from 'int' to 'const String&'

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/WString.h:87:11: note: String& String::operator=(const char*) <near match>

  String & operator = (const char *cstr);

           ^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/WString.h:87:11: note:   no known conversion for argument 1 from 'int' to 'const char*'

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/WString.h:88:11: note: String& String::operator=(const __FlashStringHelper*) <near match>

  String & operator = (const __FlashStringHelper *str);

           ^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/WString.h:88:11: note:   no known conversion for argument 1 from 'int' to 'const __FlashStringHelper*'

Error compiling.

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.



**Im not sure if it is wrong of me to bring someone else project into the forum without trying to contact them for assistance first, i am pressed for time and figured I could be led in the right direction faster this way

Thanks for any feedback

ADDN

Sketch:

Code: [Select]
#include <SPI.h>
#include <Ethernet.h>
#include <Servo.h>
//#include <EthernetBonjour.h>//to resolve host names via MDNS (Multicast DNS)


#define lcd_size 3 //this will define number of LCD on the phone app
int refresh_time = 15; //the data will be updated on the app every 5 seconds.


byte mac[] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDA, 0x02 };
//IPAddress ip(192, 168, 1, 10); //Uncomment for fixed IP or leave for DHCP
EthernetServer httpServer(80);
EthernetClient client;

char mode_action[54];
int mode_val[54];
Servo myServo[53];

String mode_feedback;
String lcd[lcd_size];
String api, channel, notification, user_id;

String httpOk = "HTTP/1.1 200 OK\r\n Content-Type: text/plain \r\n\r\n";

void setup(void)
{
  while (!Serial) {
    ;// wait for serial port to connect. Needed for Leonardo only
  }
  Serial.begin(9600);
  Serial.println(F("Please wait for IP... "));
  //Ethernet.begin(mac, ip);// Uncomment for fixed IP
  Ethernet.begin(mac); // Comment for fixed IP
  httpServer.begin();
  //  EthernetBonjour.begin("ethernet");//Insted of IP you can use hostname http://ethernet.local to connect in the app.-->> for iOS only
  //  EthernetBonjour.addServiceRecord("ethernet", 80, MDNSServiceTCP);
  Serial.println(Ethernet.localIP());
  boardInit();
}

void loop(void)
{

  lcd[0] = "Test 1 LCD";// you can send any data to your mobile phone.
  lcd[1] = "Test 2 LCD";// you can send any data to your mobile phone.
  lcd[2] = analogRead(1);//  send analog value of A1

  //  EthernetBonjour.run();

  EthernetClient client = httpServer.available();
  if (client) {
    while (client.connected()) {
      if (client.available()) {
        process(client);
        delay(100);
        client.flush();
        client.stop();
      }
    }
  }
  update_input();
}

void process(EthernetClient client) {
  String getString = client.readStringUntil('/');
  String arduinoString = client.readStringUntil('/');
  String command = client.readStringUntil('/');

  if (command == "terminal") {
    terminalCommand(client);
  }

  if (command == "digital") {
    digitalCommand(client);
  }

  if (command == "analog") {
    analogCommand(client);
  }

  if (command == "servo") {
    servo(client);
  }

  if (command == "mode") {
    modeCommand(client);
  }

  if (command == "allonoff") {
    allonoff(client);
  }

  if (command == "refresh") {
    refresh(client);
  }

  if (command == "allstatus") {
    allstatus(client);
  }

}



void terminalCommand(EthernetClient client) {//Here you recieve data form app terminal
  String data = client.readStringUntil('/');
  Serial.println(data);
  client.print(httpOk);
}

void refresh(EthernetClient client) {
  int value;
  value = client.parseInt();
  refresh_time = value;
  client.print(httpOk);
}

void digitalCommand(EthernetClient client) {
  int pin, value;
  pin = client.parseInt();
  if (client.read() == '/') {
    value = client.parseInt();
    digitalWrite(pin, value);
    mode_val[pin] = value;
    client.print(httpOk);
  }
}

void analogCommand(EthernetClient client) {
  int pin, value;
  pin = client.parseInt();
  if (client.read() == '/') {
    value = client.parseInt();
    analogWrite(pin, value);
    mode_val[pin] = value;
    client.print(httpOk);
  }
}

void servo(EthernetClient client) {
  int pin, value;
  pin = client.parseInt();
  if (client.read() == '/') {
    value = client.parseInt();
    myServo[pin].write(value);
    mode_val[pin] = value;
    client.print(httpOk);
  }
}

void modeCommand(EthernetClient client) {
  int pin = client.parseInt();
  String mode = client.readStringUntil(' ');
  myServo[pin].detach();
  client.print(httpOk);

  if (mode == "/input") {
    pinMode(pin, INPUT);
    mode_action[pin] = 'i';
    mode_val[pin] = 0;
    digitalWrite(pin, LOW);
    client.print(F("D"));
    client.print(pin);
    client.print(F(" set as INPUT!"));
  }

  if (mode == "/output") {
    pinMode(pin, OUTPUT);
    mode_action[pin] = 'o';
    mode_val[pin] = 0;
    digitalWrite(pin, LOW);
    client.print(F("D"));
    client.print(pin);
    client.print(F(" set as OUTPUT!"));
  }

  if (mode == "/pwm") {
    pinMode(pin, OUTPUT);
    mode_action[pin] = 'p';
    mode_val[pin] = 0;
    digitalWrite(pin, LOW);
    client.print(F("D"));
    client.print(pin);
    client.print(F(" set as PWM!"));
  }

  if (mode == "/servo") {
    digitalWrite(pin, LOW);
    myServo[pin].attach(pin);
    mode_action[pin] = 's';
    mode_val[pin] = 0;
    client.print(F("D"));
    client.print(pin);
    client.print(F(" set as SERVO!"));
  }
}

void allonoff(EthernetClient client) {
  int value = client.parseInt();
  client.print(httpOk);

#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
  for (byte i = 0; i <= 53; i++) {
    if (mode_action[i] == 'o') {
      digitalWrite(i, value);
      mode_val[i] = value;
    }
  }
#endif

#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega16U4__)
  for (byte i = 0; i <= 13; i++) {
    if (mode_action[i] == 'o') {
      digitalWrite(i, value);
      mode_val[i] = value;
    }
  }
#endif

}

void allstatus(EthernetClient client) {
  //Sending all data in JSON format
  client.println(F("HTTP/1.1 200 OK"));
  client.println(F("content-type:application/json"));
  client.println(F("Connection: close"));
  client.println();
  client.println(F("{"));

  client.print(F("\"m\":["));//m for Pin Mode
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
  for (byte i = 0; i <= 53; i++) {
    client.print(F("\""));
    client.print(mode_action[i]);
    client.print(F("\""));
    if (i != 53)client.print(F(","));
  }
#endif
#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega16U4__)
  for (byte i = 0; i <= 13; i++) {
    client.print(F("\""));
    client.print(mode_action[i]);
    client.print(F("\""));
    if (i != 13)client.print(F(","));
  }
#endif
  client.println(F("],"));

  client.print(F("\"v\":["));// v for Mode value
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
  for (byte i = 0; i <= 53; i++) {
    client.print(mode_val[i]);
    if (i != 53)client.print(F(","));
  }
#endif
#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega16U4__)
  for (byte i = 0; i <= 13; i++) {
    client.print(mode_val[i]);
    if (i != 13)client.print(F(","));
  }
#endif
  client.println(F("],"));

  client.print(F("\"a\":["));// a For Analog
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
  for (byte i = 0; i <= 15; i++) {
    client.print(analogRead(i));
    if (i != 15)client.print(",");

  }
#endif
#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega16U4__)
  for (byte i = 0; i <= 5; i++) {
    client.print(analogRead(i));
    if (i != 5)client.print(",");
  }
#endif
  client.println("],");


  client.print("\"l\":[");// l for LCD
  for (byte i = 0; i <= lcd_size - 1; i++) {
    client.print("\"");
    client.print(lcd[i]);
    client.print("\"");
    if (i != lcd_size - 1)client.print(",");
  }
  client.println("],");

  client.print("\"f\":\"");// f for Feedback.
  client.print(mode_feedback);
  client.println("\",");
  client.print("\"t\":\"");//t for refresh Time .
  client.print(refresh_time);
  client.println("\"");
  client.println(F("}"));
  //  client.stop();
}

void update_input() {
  for (byte i = 0; i < sizeof(mode_action); i++) {
    if (mode_action[i] == 'i') {
      mode_val[i] = digitalRead(i);
    }
  }
}

void boardInit() {
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)//Mega
  for (byte i = 0; i <= 53; i++) {
    if (i == 0 || i == 1 || i == 10 || i == 50 || i == 51 || i == 52 || i == 53) {
      mode_action[i] = 'x';
      mode_val[i] = 0;
    }
    else {
      mode_action[i] = 'o';
      mode_val[i] = 0;
      pinMode(i, OUTPUT);
    }
  }

#endif

#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega16U4__)//Leo or Uno
  for (byte i = 0; i <= 13; i++) {
    if (i == 0 || i == 1  || i == 10 || i == 11 || i == 12 || i == 13 ) {
      mode_action[i] = 'x';
      mode_val[i] = 0;
    }
    else {
      mode_action[i] = 'o';
      mode_val[i] = 0;
      pinMode(i, OUTPUT);
    }
  }
#endif


}

ADDN

Upon further looking into this, the project uses Ethernet Shield V2, but im using V1.

Would this make a difference?

Juraj

Upon further looking into this, the project uses Ethernet Shield V2, but im using V1.

Would this make a difference?
there is no original Arduino shield marked V2 or V1. use the latest Ethernet library version. it supports W5100, W5200 and W550 Wiznet chips used on Ethernet shields
You can't write an Arduino sketch if you didn't learn programming. Not the language, but the concepts of programming - algorithms and data types.

pert

Code: [Select]
Arduino: 1.6.1 (Windows 7), Board: "Arduino Uno"

Why are you using such an outdated version of the Arduino IDE? I think if you update to a modern IDE version the problem will be resolved (works for me).

**Im not sure if it is wrong of me to bring someone else project into the forum without trying to contact them for assistance first, i am pressed for time and figured I could be led in the right direction faster this way
I think it's fine. I doubt the author would mind the community helping with support. Any forum members who don't feel like helping don't need to and the rest of us are happy to help out.

Upon further looking into this, the project uses Ethernet Shield V2, but im using V1.
No. You'll get the same compilation error no matter what is plugged into your Arduino or even if the Arduino isn't plugged into your computer.

there is no original Arduino shield marked V2 or V1
The correct name is Arduino Ethernet Shield 2 (as written on the silkscreen) but you can still find it called "Ethernet Shield V2" on the Products page and maybe elsewhere. Arduino originally referred to it as V2 in all of the documentation but I asked them to correct that since it caused confusion with the Seeed Studio Ethernet Shield V2.0 (which uses the W5200).

ADDN

Thank you pert,

updating my IDE fixed my compiling issue. I hadnt updated IDE because of admin block on the computer I use at work, so just used 1.6.1 since it was on here and starting playing around with that to learn.

Im now getting an IP off the serial monitor as expected, but now it wont connect to the app

Time to read more i suppose,
if anyone knows the best place to start please let me know!

ADDN

I have read some and tried a few more things, still no success. My end goal is to just turn an LED on and off from the phone app, and every step closer keeps me intrigued in figuring this out...

I used this test just to see what happens, and the connection failed

Code: [Select]

#include <SPI.h>
#include <Ethernet.h>

byte mac[] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDA, 0x02 }; //physical mac address

char serverName[] = "web.comporium.net"; // zoomkat's test web page server
EthernetClient client;

//////////////////////

void setup(){

  if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    // no point in carrying on, so do nothing forevermore:
    while(true);
  }

  Serial.begin(9600);
  Serial.println("Better client test 9/22/12"); // so I can keep track of what is loaded
  Serial.println("Send an e in serial monitor to test"); // what to do to test
}

void loop(){
  // check for serial input
  if (Serial.available() > 0) //if something in serial buffer
  {
    byte inChar; // sets inChar as a byte
    inChar = Serial.read(); //gets byte from buffer
    if(inChar == 'e') // checks to see byte is an e
    {
      sendGET(); // call sendGET function below when byte is an e
    }
  } 
}

//////////////////////////

void sendGET() //client function to send/receive GET request data.
{
  if (client.connect(serverName, 80)) {  //starts client connection, checks for connection
    Serial.println("connected");
    client.println("GET /~shb/arduino.txt HTTP/1.1"); //download text
    client.println("Host: web.comporium.net");
    client.println("Connection: close");  //close 1.1 persistent connection 
    client.println(); //end of get request
  }
  else {
    Serial.println("connection failed"); //error message if no client connect
    Serial.println();
  }

  while(client.connected() && !client.available()) delay(1); //waits for data
  while (client.connected() || client.available()) { //connected or data available
    char c = client.read(); //gets byte from ethernet buffer
    Serial.print(c); //prints byte to serial monitor
  }

  Serial.println();
  Serial.println("disconnecting.");
  Serial.println("==================");
  Serial.println();
  client.stop(); //stop client


I want to say im missing the communication between IDE and the shield, which is done through the MAC address used in the sketch i believe??

If anyone could provide insight i would be extremely thankful, I also apologize for my lack of knowledge prior to this project

Juraj

Did you try the WebClient example?
You can't write an Arduino sketch if you didn't learn programming. Not the language, but the concepts of programming - algorithms and data types.

ADDN

Yes I have,
It says connected, runs its course and displays a large amount of data running off the screen, and then disconnects once done.

I am not so sure what my next steps are, I have tried using a fixed IP as well and it still does not connect to the app. Not sure what im missing, really hope the app is still functioning properly.

Thank you for taking an interest and providing suggestions.

Juraj

and what is the output of the 'not working'  sketch?
You can't write an Arduino sketch if you didn't learn programming. Not the language, but the concepts of programming - algorithms and data types.

ADDN

I am given an IP address from the serial monitor, the IP address is then inputted to the mobile app and then the function of the outputs on the arduino are determined by the app and what I enter on my phone.

Juraj

I am given an IP address from the serial monitor, the IP address is then inputted to the mobile app and then the function of the outputs on the arduino are determined by the app and what I enter on my phone.
copy here the content of the Serial Monitor with output of the sketch
You can't write an Arduino sketch if you didn't learn programming. Not the language, but the concepts of programming - algorithms and data types.

ADDN

Serial Monitor reads:

Code: [Select]
Please wait for IP...
10.0.0.176


Sketch output:

Code: [Select]
byte mac[] = { 0x90, 0xA2, 0xDA, 0x0D, 0xA5, 0x5D };
//IPAddress ip(99, 241, 2, 94);
EthernetServer httpServer(80);
EthernetClient client;

char mode_action[54];
int mode_val[54];
Servo myServo[53];

String mode_feedback;
String lcd[lcd_size];
String api, channel, notification, user_id;

String httpOk = "HTTP/1.1 200 OK\r\n Content-Type: text/plain \r\n\r\n";

void setup(void)
{
  while (!Serial) {
    ;// wait for serial port to connect. Needed for Leonardo only
  }
  Serial.begin(9600);
  Serial.println(F("Please wait for IP... "));
 // Ethernet.begin(mac, ip);// Uncomment for fixed IP
  Ethernet.begin(mac); // Comment for fixed IP
  httpServer.begin();
   // EthernetBonjour.begin("ethernet");//Insted of IP you can use hostname http://ethernet.local to connect in the app.-->> for iOS only
   // EthernetBonjour.addServiceRecord("ethernet", 80, MDNSServiceTCP);
  Serial.println(Ethernet.localIP());
  boardInit();
}

void loop(void)
{

  lcd[0] = "Test 1 LCD";// you can send any data to your mobile phone.
  lcd[1] = "Test 2 LCD";// you can send any data to your mobile phone.
  lcd[2] = analogRead(1);//  send analog value of A1

    //EthernetBonjour.run(ethernet);

  EthernetClient client = httpServer.available();
  if (client) {
    while (client.connected()) {
      if (client.available()) {
        process(client);
        delay(100);
        client.flush();
        client.stop();
      }
    }
  }
  update_input();
}

void process(EthernetClient client) {
  String getString = client.readStringUntil('/');
  String arduinoString = client.readStringUntil('/');
  String command = client.readStringUntil('/');

  if (command == "terminal") {
    terminalCommand(client);
  }

  if (command == "digital") {
    digitalCommand(client);
  }

  if (command == "analog") {
    analogCommand(client);
  }

  if (command == "servo") {
    servo(client);
  }

  if (command == "mode") {
    modeCommand(client);
  }

  if (command == "allonoff") {
    allonoff(client);
  }

  if (command == "refresh") {
    refresh(client);
  }

  if (command == "allstatus") {
    allstatus(client);
  }

}



void terminalCommand(EthernetClient client) {//Here you recieve data form app terminal
  String data = client.readStringUntil('/');
  Serial.println(data);
  client.print(httpOk);
}

void refresh(EthernetClient client) {
  int value;
  value = client.parseInt();
  refresh_time = value;
  client.print(httpOk);
}

void digitalCommand(EthernetClient client) {
  int pin, value;
  pin = client.parseInt();
  if (client.read() == '/') {
    value = client.parseInt();
    digitalWrite(pin, value);
    mode_val[pin] = value;
    client.print(httpOk);
  }
}

void analogCommand(EthernetClient client) {
  int pin, value;
  pin = client.parseInt();
  if (client.read() == '/') {
    value = client.parseInt();
    analogWrite(pin, value);
    mode_val[pin] = value;
    client.print(httpOk);
  }
}

void servo(EthernetClient client) {
  int pin, value;
  pin = client.parseInt();
  if (client.read() == '/') {
    value = client.parseInt();
    myServo[pin].write(value);
    mode_val[pin] = value;
    client.print(httpOk);
  }
}

void modeCommand(EthernetClient client) {
  int pin = client.parseInt();
  String mode = client.readStringUntil(' ');
  myServo[pin].detach();
  client.print(httpOk);

  if (mode == "/input") {
    pinMode(pin, INPUT);
    mode_action[pin] = 'i';
    mode_val[pin] = 0;
    digitalWrite(pin, LOW);
    client.print(F("D"));
    client.print(pin);
    client.print(F(" set as INPUT!"));
  }

  if (mode == "/output") {
    pinMode(pin, OUTPUT);
    mode_action[pin] = 'o';
    mode_val[pin] = 0;
    digitalWrite(pin, LOW);
    client.print(F("D"));
    client.print(pin);
    client.print(F(" set as OUTPUT!"));
  }

  if (mode == "/pwm") {
    pinMode(pin, OUTPUT);
    mode_action[pin] = 'p';
    mode_val[pin] = 0;
    digitalWrite(pin, LOW);
    client.print(F("D"));
    client.print(pin);
    client.print(F(" set as PWM!"));
  }

  if (mode == "/servo") {
    digitalWrite(pin, LOW);
    myServo[pin].attach(pin);
    mode_action[pin] = 's';
    mode_val[pin] = 0;
    client.print(F("D"));
    client.print(pin);
    client.print(F(" set as SERVO!"));
  }
}

void allonoff(EthernetClient client) {
  int value = client.parseInt();
  client.print(httpOk);

#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
  for (byte i = 0; i <= 53; i++) {
    if (mode_action[i] == 'o') {
      digitalWrite(i, value);
      mode_val[i] = value;
    }
  }
#endif

#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega16U4__)
  for (byte i = 0; i <= 13; i++) {
    if (mode_action[i] == 'o') {
      digitalWrite(i, value);
      mode_val[i] = value;
    }
  }
#endif

}

void allstatus(EthernetClient client) {
  //Sending all data in JSON format
  client.println(F("HTTP/1.1 200 OK"));
  client.println(F("content-type:application/json"));
  client.println(F("Connection: close"));
  client.println();
  client.println(F("{"));

  client.print(F("\"m\":["));//m for Pin Mode
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
  for (byte i = 0; i <= 53; i++) {
    client.print(F("\""));
    client.print(mode_action[i]);
    client.print(F("\""));
    if (i != 53)client.print(F(","));
  }
#endif
#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega16U4__)
  for (byte i = 0; i <= 13; i++) {
    client.print(F("\""));
    client.print(mode_action[i]);
    client.print(F("\""));
    if (i != 13)client.print(F(","));
  }
#endif
  client.println(F("],"));

  client.print(F("\"v\":["));// v for Mode value
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
  for (byte i = 0; i <= 53; i++) {
    client.print(mode_val[i]);
    if (i != 53)client.print(F(","));
  }
#endif
#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega16U4__)
  for (byte i = 0; i <= 13; i++) {
    client.print(mode_val[i]);
    if (i != 13)client.print(F(","));
  }
#endif
  client.println(F("],"));

  client.print(F("\"a\":["));// a For Analog
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
  for (byte i = 0; i <= 15; i++) {
    client.print(analogRead(i));
    if (i != 15)client.print(",");

  }
#endif
#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega16U4__)
  for (byte i = 0; i <= 5; i++) {
    client.print(analogRead(i));
    if (i != 5)client.print(",");
  }
#endif
  client.println("],");


  client.print("\"l\":[");// l for LCD
  for (byte i = 0; i <= lcd_size - 1; i++) {
    client.print("\"");
    client.print(lcd[i]);
    client.print("\"");
    if (i != lcd_size - 1)client.print(",");
  }
  client.println("],");

  client.print("\"f\":\"");// f for Feedback.
  client.print(mode_feedback);
  client.println("\",");
  client.print("\"t\":\"");//t for refresh Time .
  client.print(refresh_time);
  client.println("\"");
  client.println(F("}"));
  //  client.stop();
}

void update_input() {
  for (byte i = 0; i < sizeof(mode_action); i++) {
    if (mode_action[i] == 'i') {
      mode_val[i] = digitalRead(i);
    }
  }
}

void boardInit() {
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)//Mega
  for (byte i = 0; i <= 53; i++) {
    if (i == 0 || i == 1 || i == 10 || i == 50 || i == 51 || i == 52 || i == 53) {
      mode_action[i] = 'x';
      mode_val[i] = 0;
    }
    else {
      mode_action[i] = 'o';
      mode_val[i] = 0;
      pinMode(i, OUTPUT);
    }
  }

#endif

#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega16U4__)//Leo or Uno
  for (byte i = 0; i <= 13; i++) {
    if (i == 0 || i == 1  || i == 10 || i == 11 || i == 12 || i == 13 ) {
      mode_action[i] = 'x';
      mode_val[i] = 0;
    }
    else {
      mode_action[i] = 'o';
      mode_val[i] = 0;
      pinMode(i, OUTPUT);
    }
  }
#endif


}



Juraj

"output" is what is printed by sketch. this is a different sketch then in previous post. what is the problem?
You can't write an Arduino sketch if you didn't learn programming. Not the language, but the concepts of programming - algorithms and data types.

ADDN

Sorry for the misunderstanding. The MAC address is different in the previous sketch, but this is just the last end of it still. Ive determined the sketch is okay after the Web Client example worked well.

The app does not connect, so either the IP address the serial monitor reads is not correct and i have something wrong somewhere in the sketch producing the incorrect IP, or it is something else outside of arduino, possibly the app not connecting for some other reason I cannot troubleshoot or determine.

Go Up