archusvijay1
Member level 3
EThernet connection failure(arduino)
Hello,
I am trying to implement a device which read voltage and current and send the signal to a server.I completed this task using arduino uno and ENC28j60 Ethernet module with the help of UIPEthernet library. I am getting the signal in the server.but some time it fails .It maybe after running half a day,or after one day.also i get continuous signal for 2 days also.after that it will hang or not sending the data to the server. What might be the problem?.please help .
i here by attach the program .
Hello,
I am trying to implement a device which read voltage and current and send the signal to a server.I completed this task using arduino uno and ENC28j60 Ethernet module with the help of UIPEthernet library. I am getting the signal in the server.but some time it fails .It maybe after running half a day,or after one day.also i get continuous signal for 2 days also.after that it will hang or not sending the data to the server. What might be the problem?.please help .
i here by attach the program .
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 void setup(){ Serial.begin(9600); //Serial.println("Starting"); SPI.begin(); // watchdogSetup(); pinMode(Contd,OUTPUT); pinMode(NotContd,OUTPUT); digitalWrite(Contd,HIGH); digitalWrite(NotContd,HIGH); delay(2000); digitalWrite(Contd,LOW); digitalWrite(NotContd,LOW); start_ethernet(); } void loop() { //wdt_reset(); reset_millis = millis(); // put your main code here, to run repeatedly: if(reset_millis >= reset_period){ Resetuno(); } dc_volt = 0; dc_volt = analogRead(A5);//*5)/1024); dc_volt = dc_volt*0.0363; eb_volt = Measure_Vrms(1,800,0.8759,10);//1.1 4.04/// inv_curr = Measure_Irms(4,800,0.039,10); //0.0017 client.connect(server, 80); delay(1000); if (client.connected()){//(server, 80)) { Serial.println("-> Connected"); digitalWrite(Contd,HIGH); digitalWrite(NotContd,LOW); failed_data = 0; client.print( "GET /index.php/add/add_data?"); client.print("dc_volt="); client.print(dc_volt); client.print("&"); client.print("eb_volt="); client.print(eb_volt); client.print("&"); client.print("inv_volt="); client.print(inv_volt); client.print("&"); client.print("inv_curr="); client.print(inv_curr); client.print("&"); client.println( " HTTP/1.1"); client.print( "Host: " ); client.println(server); client.println( "Connection: close");//keep-alive" );// close client.println(); client.println(); client.stop(); delay(interval);
Last edited by a moderator: