[SOLVED] Arduino uno + ethernet W5100 working - not show the values

Hi

After many project maded with blink I made a new project using Arduino Uno R3 with ethernet shield W5100.
For test I used this code from Codebender, simple for LED widget testing and value displaying.

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>
#include <SimpleTimer.h>

SimpleTimer timer;
char auth[] = "5ee20dac1a3449299ce7b0113b3f5a04";

WidgetLED ledCycle(0);

void setup()
{
	pinMode(A2, OUTPUT);
	Serial.begin(9600);
	Blynk.begin(auth);
	timer.setInterval(1000, alive);		
}
void loop()
{
  	Blynk.run();
 	timer.run();
}

void   alive(){
  if (ledCycle.getValue()) {
  	ledCycle.off();
    //BLYNK_LOG("LED1: off");
  	digitalWrite(A2,LOW);
  }
  else {
  	ledCycle.on();
    //BLYNK_LOG("LED1: on");
  	digitalWrite(A2,HIGH);
  }
}

But in the Blynk app on the phone didn’t display any value or led widget state.

The code work fine, the led on anny free digital or analog pins work with the button widget.
In the code I made a led blink every 1 sec to see if the board is connected to the cloud.

void alive() toggle the led on A2 every 1 second and work well.

I don’t know why work with the cloud and why not with the app.
I need help to fix this problem.

Thank you
Ferox

2 Likes

Hello. Did you select virtual pin 0 on application side for your LED?

Hello. I verified the led on app it is set to V0.
I live it the board powered a while (2h) and when I check the app it showed a value from the analog pin and the led work.
I made a reset of the board and I don’t have a value display again.

after a while I checked again the app, showed for 1 second the value and the state of the led, now value disapeared from the value box.

Could you show your program serial output?

here is my serial output, I think is ok.

[0] Blynk v0.2.1
[0] Getting IP...


[33867] Ready!
[34561] LED1: on
[35561] LED1: off
[36561] LED1: on
[37561] LED1: off

[39561] LED1: off
[40561] LED1: on
[41561] LED1: off
[42561] LED1: on
[43561] LED1: off
[44561] LED1: on
[45561] LED1: off
[46561] LED1: on
[47561] LED1: off
[48561] LED1: on
[49561] LED1: off
[50561] LED1: on
[51561] LED1: off

[53561] LED1: off
[54561] LED1: on
[55561] LED1: off
[56561] LED1: on

[58561] LED1: on
[59561] LED1: off
[60561] LED1: on
[61561] LED1: off
[62561] LED1: on
[63561] LED1: off
[64561] LED1: on
[65561] LED1: off
[66561] LED1: on

[68258] LED1: off
[68258] Connecting to cloud.blynk.cc:8442

[68564] LED1: on
[69561] LED1: off
[70561] LED1: on

[72561] LED1: on
[73561] LED1: off
[74561] LED1: on

[76561] LED1: on
[77561] LED1: off
[78561] LED1: on
[79561] LED1: off
[80561] LED1: on
[81561] LED1: off
[82561] LED1: on
[83561] LED1: off
[84561] LED1: on
[85561] LED1: off

in the uploaded code of the arduino is uncomented the blynk_log

1 Like

I made a new simple skech.
reinstaled the Blynk app on the phone.
Still the same problem.

I can change the state of the A2 output from phone, I put the led_V0 to check the feedback but didn’t work.
Value display of A4 display a blank value.
Tryed one gauge on A0 without value just ----.

Should I try another way for upload the sketch? like arduino IDE.

#define  BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>

char auth[] = "5ee20dac1a3449299ce7b0113b3f5a04";

WidgetLED led_V0(0);

BLYNK_WRITE(1){
      if (param.asInt()) {
      	led_V0.on();
        BLYNK_LOG("LED1: on");
      	digitalWrite(A2,HIGH);
      }
      else {
      	led_V0.off();
        BLYNK_LOG("LED1: off");
      	digitalWrite(A2,LOW);
      }	
}
void setup()
    {
    	pinMode(A2, OUTPUT);
    	Serial.begin(9600);
    	Blynk.begin(auth);
    	Serial.println("READY");
    }
    
void loop()
    {
      	Blynk.run();
    }
1 Like

Could you please update to latest Blynk library? 0.2.1 seems very outdated.

1 Like

Thank you
I will try to add to the personal library of codebender.cc the latest Blynk library
But now I have a bigger problem, my hard drive is dead and I must to change.

Hi
Thank you Dimitri. Solved all problems, my pc is ok now and I could upload my code with the new version of Blink library like I said above.
With the new library all work fine. App Blynk v 1.0 RC11

[0] Blynk v0.3.2-beta
[0] Getting IP...
[33561] My IP: 192.168.220.104

[33899] Ready (ping: 135ms).
[34561] LED1: on
[35561] LED1: off
[36561] LED1: on
1 Like