Robot with Esp8266 Shield and Arduino Nano

Hi Pavel,

Half the size would be perfect… :wink:

What do you think?

1 Like

SUCCESS!!! Ok, so, the whole problem was caused by…a damn wifi network from my neighbor that was completely interfering with the ESP’s wifi.

To solve this, I changed that my car now hosts a local AP (access point). I used the Netspot app on Macosx to see which channels were being used around me, and picked something unused (channel 12 in my case).

On my app I connect to my car’s AP (wireless network). Once connected, I have perfect control, no latency!!!

So happy, this took me so long to figure out:) Now I will replugging in all my Blynk stuff:P

@cyberbum ahaha. glad you figured out exactly problem. By the way how did you find out that?

I had read a post about some guy using two ESPs beside each other, and he mentioned that if one was using its GPIO, it would interfere with the other ESP, lowering its ping and even timing out.

So I started taking snapshots of wifi networks around me. I noticed I was sharing the same channel as many other networks, but didn’t want to switch my own wifi network’s channel. So I found out that if you create your own AP with the ESP, you can pick any channel you want!

It’s still working great! I’ve certainly learned a lot while troubleshooting all this:)

1 Like

Congratulations @cyberbum!
At the end you did it!!
Happy blynking! :wink:

@psoro could you please take a look at my post in this thread [SOLVED] If don't connect to Internet device go slowly and give your assessment of Nano with ESP via the cloud?

1 Like

@psoro when I looked through the examples provided by Blynk they recommend SoftSerial for Uno / Nano’s with ESP’s. I notice you have HardSerial and I think the first time round I went with HardSerial. Was there a particular reason you picked HardSerial? Maybe it is because in your robot you don’t need any serial once you have completed the project.

I have some more testing to do and then I will add to this thread Blynk Libraries but I think I have established I don’t have a problem with ESP’s it is more of a Blynk issue.
I have a fairly detailed virtual LCD menu structure in my project and if I select one of the virtual buttons (button assigned to a virtual pin) to write something to the LCD it crashes the system. If I use a timer and refresh the LCD even at 100ms intervals the Nano and ESP are fine but not if the LCD is refreshed by a virtual button.

The ESP has been running for about 8 hours now and refreshing the LCD at 1 second intervals and all is fine but I know if I press a virtual button it will crash immediately. If I use digital pins the system doesn’t crash but I really need to use virtual pins.

This is a silly electronics question, but can anyone explain the purpose and necessity of the resistors, as well as the ground connection between the ESP RX and the Arduino TX?

Hi @zeeko, the ESP works at 3.3 V, the resistors do a simple resistor divider. Otherwise your ESP will die in a short time.

@Costas, at the beginning the use of Hardserial was recommended. I had same issues as you with Softserial, with the Hardserial I have no problems at all. Keep in mind I use also a Local Server.

@psoro I don’t know if Blynk have changed anything over the months but HardSerial seems infinitely better than Softserial when using Uno / Nano’s with ESP’s.

It probably has to do with fact that software processing takes up too much CPU cycles. The platform is very limited with resources, that would be it’s strength and it’s weakness :smile:

@Lichtsignaal I can see where Soft is required when using USB but not for ESP as ESP provides the required gateway. I tested hard and soft this morning as soft is the recommended use with ESP and Uno / Nanos and like @flopes found at Using ESP8266 with BLYNK soft doesn’t work at all. It gives constant login timeouts and I don’t really see the point of soft when using an ESP.

I did notice with hard you can’t use #define BLYNK_DEBUG though.

That would be somewhat of an issue, but adding some debug code for yourself is probably not that hard and sufficient.

I have some experience with serial protocol and medical devices and basically, it the hardware is not 100% OK, it doesn’t work properly. Software emulation is probably worse (I’ve tried with Wifi to serial bridges to allow remote code uploading to a Mega, but that doesn’t work at all).

My advice with serial protocol is always to use some piece of hardware of possible and stay away from software, recommended or not.

@Lichtsignaal and @psoro I think you are both local servers guys but I wondered want your thoughts were on the baud settings with ESP and the cloud?

Having started with USB I think I originally went for 115200 for the ESP and notice the recommendation is just 9600. I actually set the firmware on a couple of my ESP’s at 9600 baud to see if it might help with the cloud server disconnects.

I notice down at 9600 I am getting a lot of Buffer overflow messages when writing to the virtual LCD. Sometimes the buffer overflows will cause the server to drop the connection but sometimes it manages to ride through the problem. Is there some happy medium between 9600 and 105200 or is 9600 the best choice?

I think you should try different baudrates (baudrage in the end I think, lol). You can slowly turn it up ti faster speeds until it works good. That is probably the only method to get a decent performance. It depends on so many factors.

But your are correct in my local server(s). It’s actually two already and you could be running multiple instances on one box. Anyway, I don’t do ESP as shields, for now, but only run them standalone, so that could also be a factor. You need to remind yourself that is a very cheap piece of hardware and the performance is, I think, mostly depended on our coding skills and engineering skills.

I always used hard serial from my Nano to the ESP. I had read they are more stable and softserial and allow higher baud rates.

To debug, I had to buy a FTDI (like this: http://www.robotshop.com/ca/en/ft232rl-usb-serial-adapter.html ) that I connect to some pins on my nano, and enable softserial on that. It’s a bit annoying cause you gotta upload code to the Nano via USB, but when you are ready to debug, disconnect and reconnect to the FTDI.

I’m using 115200 for both my computer-> softserial and Nano -> ESP hard serial with no troubles.

I always use 9600… I’ll try with other baudrates and come back to you.

-Edit-

At 19200 the ESP works OK
At 38400… No luck

@cyberbum I have 20 or so FTDI’s with 5V and 3.3V but not the ‘posh’ ones you linked to so I know what you mean about connecting and disconnecting between uploads and debugging :grinning:

Are you using the cloud or a local server?

When I have used debug with USB I haven’t actually seen any more useful information than you get with BLYNK_PRINT Serial. Am I right in thinking debug is only useful with a local server?

Blynk/ESP performance for standalone is MUCH better than hardshield. I imagine there’s just a lot more going on for shield. I’ve found that 9600 is working just about great and am currently testing 19200 atm. More than that, and my hardshield performance just sucks.