Need help with ESP-01s and Arduino Nano

No, probes on 1m cable.
After 2 X 10 off faulty ones a Blynker put me on to a source for pukka ones that work at 3.3V, as they all should, and I picked up 20 or 30 (all fine at 3.3V).

:rofl:

Please PM me your CC number and I will release the lock on your forum account :stuck_out_tongue: (jkā€¦ perhapsā€¦ :innocent: )

LOL:) dont worry nobody will read all 182 posts til now to get this information :slight_smile:

I ment if you pay to the Blynk company not me :stuck_out_tongue:

2 Likes

182 posts of wasted space on serverā€¦ :rofl:

Wao i must get my life back :wink: or get a one lol:)

1 Like

ditto here :slight_smile:

But if i start from begininng never will :sob::sob:

I never think that way. After allā€¦ how could a cart be invented if one wouldnā€™t invent a wheel first?

I wonder if programmers or developers ever look on the forum, i think 189 post can really get some interest and curiosity from them, maybe they can jump in and say something smart,or stupid :slight_smile: LOL

or have some solutions :slight_smile:

next invention would be ESP64 lol:)

you will hear mostly silence :slight_smile: But that ā€œmusicā€ isnā€™t that bad, as long as a constant progress is noted.

Already 3 cores! They add 2 more, and call itā€¦ a ā€œpentiumā€?.

No updates excpet I tried uploading through arduino ESP8266 ide blynk code directly on esp-01 and it works, with connecting speed like light speed!!!
Currently investigating i2c communication methods between ESP and arduino and it seems it is possible that 8266 can act and communicate as a Slave :wink: ā€¦i will report backā€¦

The ESP-01 will support i2C with SDA ā†” GPIO0 & SCK ā† ?GPIO2

But with EasyTransfer, you will need the ESP-01 to be the master requesting data from the Arduino.

I think this is a good example? I havenā€™t dug into it heavily yetā€¦ but soon.

https://github.com/klucsik/esp8266-and-arduino-mega-i2c-comm

You mean ESP as master or Arduino as slave rather than ESP as slave, right?

This sounds like one of those conversations you have with your kids when youā€™re trying to ge them to try a new foodā€¦

@Costas ā€œCome on, try one of these Wemos D1 Minis, youā€™ll really like it, and itā€™s good for youā€

@Nixon ā€œNo, I donā€™t like itā€

@Costas ā€œBut youā€™ve never tried itā€

@Nixon ā€œI know, but I wonā€™t like itā€

Some time laterā€¦

@Nixon ā€œThese Wemo D1 Minis are great. I hate those Arduinos and silly little ESP-01s. Why did you keep making me use them, and why didnā€™t you tell me about the Wemos earlierā€

Pete.

3 Likes

@PeteKnight Iā€™m not sure @Nixon has come over from the dark side yet as he refers to '01ā€™s, not Miniā€™s in the last post. But I feel @Nixon is starting to see the light even if a little confused with master and slave.

He should know that @Costas is the Master!

Although Iā€™m almost sure @Nixon is currently working hard on proper comm protocol to make Atmega MCU as a SLAVE to ESP8266, I decided to give a try his method of connection treating in ESP ā€œShieldā€ mode. For this purpose I took his code and slightly modified it for my needs without loosing itā€™s working principle (I thinkā€¦). And IT WORKS on my local server! No need to comment it further than thatā€¦ And here is the modified code:

The setup():

void setup()
{
  display1.setBrightness(4);
  display2.setBrightness(4);
  display1.setSegments (SEG_DASH);
  display2.setSegments (SEG_DASH);
  pinMode (ESP_RST, OUTPUT);
  pinMode (BUILTIN_LED, OUTPUT);
  digitalWrite (ESP_RST, HIGH);
  digitalWrite (BUILTIN_LED, HIGH);

  EspSerial.begin(ESP8266_BAUD);

  //Setup the BME280
  Sensor.settings.commInterface = I2C_MODE;
  Sensor.settings.I2CAddress = 0x76;
  Sensor.settings.runMode = 3; //Normal mode
  Sensor.settings.tStandby = 3;
  Sensor.settings.filter = 4;
  Sensor.settings.tempOverSample = 3;
  Sensor.settings.pressOverSample = 2;
  Sensor.settings.humidOverSample = 3;

  if (!Sensor.begin()) {
    display1.setSegments(SEG_ERR);
    display2.setSegments(SEG_ERR);
    while (1);
  }
  //init timers
  timer.setInterval(60000L, SendData);
  timer.setInterval(6000L, updateDisplay);
}

The connection handling:

bool CheckConnection() {
  if (Blynk.connected()) return true;
  else {
    display1.setSegments(SEG_CONN);
    display2.setSegments(SEG_WAIT);
    //Blynk.disconnect();
    digitalWrite (ESP_RST, LOW);
    delay(100);
    digitalWrite (ESP_RST, HIGH);
    delay(3000);
    wifi.setDHCP(1, 1, 1); //Enable dhcp in station mode and save in flash of esp8266
    Blynk.config(wifi, auth, server_ip, port);
    if (Blynk.connectWiFi(ssid, pass)) {
      Blynk.connect();
    }
    if (!Blynk.connected()) {
      display1.setSegments(SEG_CONN);
      display2.setSegments(SEG_ERR);
      delay(1500);
      return false;
    }
    else {
      display1.setSegments(SEG_CONN);
      display2.setSegments(SEG_GOOD);
      delay(1500);
      return true;
    }
  }
}

And the loop:

void loop()
{
  if (CheckConnection()) Blynk.run();
  timer.run();
}

@marvin7 Interestingā€¦

I wonder if something has changed in recent Blynk libraries?

Because in the past when I tried it, I donā€™t recall being able to compile Blynk.config() or wifi.*() commands if using #include <BlynkSimpleShieldEsp8266.h>

But hey, it seems to compile now, so onto further experimenting :slight_smile:

Yes @Gunner, it is working really nice with this code. I just changed it back to static IP and just left the connection handling as above.
One note: I included modification in BlynkSimpleShieldEsp8266.h as pointed by @Nixon and now it works even better! (the reconnect is handled better)

EDIT: And now it is working with AT 2.0.0, where previously it usually failed! That is interestingā€¦ But nice!