Blynk reliability

So basically i have this sketch that uses an arduino mega because it uses 26 pins for inputs and outputs, its not my sketch im just using it anyhow the sketch doesnt really apply to my question. I brought a mega +wifi which has the esp8266 built in. The question i want to know, is the esp32 more reliable than the esp8266 in respect to connectivity, if so, could i just use and esp32 dev board as a serial shield so to speak to talk to the mega? I’ve noticed a few times it goes offline so i was just wondering. Im guessti could use the esp32 with a port expander as well seing as how u cant use all the pins on a esp32 wroom. So essential is one option better than the other?

The ESP32 and ESP8266 are very similar in terms of connectivity.
The issue is when you try to use either of them as an AT modem for an old Arduino Mega/Uno board.
It’s a very clunky solution that uses AT commands between the Arduino and Mega to add WiFi connectivity to a non IoT device.

By far the best option would be to ditch the Arduino and build your project around an ESP device, with a port expander of some sort if necessary.

Pete.

Alright, as i said I didn’t write the code its from a droid builders group, but i might be able to figure out how to move the pins and inputs. Thanks.

I’d say the first step is to identify how many pins are use as analog and how many as digital, and which are inputs and which are outputs.

Pete.

I believe the ESP8266 is generally considered better for WiFi connections than the ESP32, at least that is the impression I have formed from several internet forums over a period of months. I agree with Peter about the AT command set, best avoided. I have used I2C MCP23017 port expanders with Wemos D1 mini’s and they work really well.
There is another option to link say, a Wemos D1 mini to an Arduino board, Uno, Mega or mini and that is the PJON library. This library uses a serial link with only two wires to send data structures between two or more devices. I use this library frequently and it is very good with an excellent website.

 pinMode(PIN1, OUTPUT);
  pinMode(PIN2, OUTPUT);
  pinMode(BMIN1, OUTPUT);
  pinMode(BMIN2, OUTPUT);
  pinMode(ZIN1, OUTPUT);
  pinMode(ZIN2, OUTPUT);
  pinMode(LSIN1, OUTPUT);
  pinMode(LSIN2, OUTPUT);
  pinMode(LFIN1, OUTPUT);
  pinMode(LFIN2, OUTPUT);

 
  // input pins
  pinMode(PTop, INPUT_PULLUP); // using a limit switch, pin goes to Normally Open and Common goes to ground, value reads LOW when the switch is closed
  pinMode(PBot, INPUT_PULLUP);
  pinMode(BMTop, INPUT_PULLUP);
  pinMode(BMBot, INPUT_PULLUP);
  pinMode(ZTop, INPUT_PULLUP);
  pinMode(ZBot, INPUT_PULLUP);
  pinMode(LSTop, INPUT_PULLUP);
  pinMode(LSBot, INPUT_PULLUP);
 
  pinMode(LFTop, INPUT_PULLUP);
  pinMode(LFBot, INPUT_PULLUP);
  pinMode(buttonPin, INPUT_PULLUP);
  pinMode(buttonPin1, INPUT_PULLUP);
  pinMode(buttonPin2, INPUT_PULLUP);
  pinMode(buttonPin3, INPUT_PULLUP);
  pinMode(buttonPin4, INPUT_PULLUP);

so this is a list of the inputs and outputs. there is also a pca9865 servo board. i dont believe any are analogue. so what board would u suggest.

i just looked at that library, whats the difference between linking say an esp to the mega, and the current board im using now. is it the serial communication?

I’d go for an ESP32 with an MCP23017 expansion board…

If WiFi signal strength is an issue then choose a board that has an external antenna connector, or use a Wemos D1 Mini Pro and a couple of MCP23017 boards. If you do that then don’t forget to move the zero ohm resistor on the D1 Mini Pro to enable the external antenna.

Pete.

Would that board be similar to PCF8575 IO Expander Module I2C To 16IO For Arduino

I’m not sure, it’s not a board I’ve tried yet.

Pete.

1 Like

The benefit of the PJON library is that provides a lot of functionality without you having to code it, for example, check a command sent to a relay is received. Additonally the PJON library doesn’t have to use the ‘standard’ serial pins and it only requires one IO pin and Gnd. I know different pins can be defined for serial on the ESP’s too.

I have used the PCF8574, PCF8575 and MCP23017. They all work in a similar manner and each has its own library. There is also a universal library that can be configured for numerous IO extenders. Any of the boards listed above will do what you want. I have some PCF8574’s that have been running 5 years + driving opto-coupled relays without a single problem. I personally choose my IO expander boards based on the available form factor of the breakout board AND, very importantly if you are using multiple boards, the ability to change the I2C address. Another thing to be mindful of when using multiple boards on the I2C bus is the cumulative effect of pull up resistors if each board has them fitted.

1 Like

So i could maybe use the expander for the motor drive outputs and the spare pins on the esp for the input pullups.

One of the benefits of serial linking an ESP device to a Mega is the huge flexibility you get, all the additional IO pins, the Mega’s ADC is better than either of the ESP8266 or ESP32, the Mega is a 5V system, you can use the Mega’s EEPROM etc. The downside is that the code running on the MEGA is not easily update OTA although there is a project, not now supported by the author, that did allow programming the Mega via the ESP.
I do have some boards like yours but I have never done much with them because of the faff switching between programming the ESP and having it linked to the Mega via switches on the board. It is worth a Google search on the board as there are a few good posts around using them on the net.

You certainly could do that and in that case you may need the extra pins available on an ESP32. Keep in mind some pins have to be in a certain state to flash the device or for it to boot up correctly. www.randomnerdtutorials.com have excellent lists of ESP pin functions

I’ve actually worked out how to use the mega wifi. It’s basically just a shield.

Yeah ive read about those pins and experienced it. Lol.

Great, good luck with your project.

well ive managed to move this sketch to an esp32. i settled on a lolin s2 mini because all the pins that are broken out are usable. its alot more responsive and than the wifi mega serial. Only issue im seeing so far is a led thats supposed to blink every 500ms is blinking slower than that, but otherwise its fine. @PeteKnight is there any info on a timeline as to when we can expect multiple devices on the same template page?

I have no idea if it’s even part of Blynk’s plan.

There are workarounds though. You can use Automations to send data from one device to another if the limited frequency meets your use-case, or you can use the REST API or Node-Red…

Pete.

1 Like