The use of the ESP8266 in the world of IoT

User avatar
By lozi_dani
#47047 Yes! you are right about the code where I don't do the connections. I haven't it in he code because the my ESP01 saves the config of my network. so only what I need is to send that AT commands to makes it work. And works very well hehe.

About the first advice, how can I concatenate strings right to send the HTML code without using the client.println() function? Can you tell me a simple example please?

And about the third, i am using an Arduino Nano, and I am using it because, and sorry if it makes me stupid, I don't know how to load the code to the ESP-01. I know that I have read that I can upgrade the firmware of the ESP-01 but but when I do that, what I am changing is the firmware version of the module right? So if I load this code in the ESP-01, it doesn't erase the firmware version? or it is written in other place of the memory of the module? Sorry but there are many thing that I have to learn about this module...=(

If I can load my code (with the HTML code if some day I achieve to do it right xD) to the ESP-01, how I should to connect the ESP-01 with the Arduino Nano to do it?

Thanks a lot for your help! Beginnings are always difficult hehe.
User avatar
By martinayotte
#47051 About string concatenation, here is some example using part of your html code :

Code: Select allString str = String("<html>");
str += "<head>";
str += "</head>";
str += "<body>";
// more html code here ...
str += "</body>";
str += "</html>";
client.println(str);


For the AT Firmware, of course, if you use some sketch using ArduinoESP framework and code everything in it, there won't be any needs for external Nano. Of course, you will loose the AT Firmware since new sketch will overwrite it, but you can do a backup of AT Firmware before upload the new sketch, so you can revert back if needed.
Using the google search I've provided earlier, you can see such sketches using ArduinoESP framework :
viewtopic.php?f=29&t=3787

For uploads, unfortunately, Nano can not do that job directly, since it has only 1 serial port, you will need some USB-TTL dongle connect directly to ESP.
User avatar
By lozi_dani
#47063 Ok I understand! Thanks for the example, it is very clear!

I will need to buy then de USB-TTL adapter. For my projet, which I need to finish in two weeks, I will have no time to adapt it because I have to buy it on Internet.

Using your example and adapting it to my project, I will be able to build a little buttons to drive my robot right? I mean, I will be able, not only to show things in the browser when y type 192.xxx.x.x/motorON, also I will be able to put a button which if I press, it sends a command to the ESP01?

Let me ask you if using my Arduino Nano, using the GPIO0 and GPIO2 pins, could I be able to send the images of an ArduCAM? Now I'm receiving data from the web to the ESP01, which sends the command to the Arduino Nano. What I don't know is if I could send images shooted with the camera and display it in the same html code I am building.

The image will be sent like Camera -> Arduino Nano -> ESP01 -> browser

I dont know if you will understand my question because it is a little bit complex to explain. I am able now to send the image to a program that ArduCAM provides using this camera (ArduCAM ov5642) and the Arduino Nano using COM port, and I want to adapt it to do the same using IoT, sending the image using WiFI instead of COM port...


Thanks for all your help! and if you can not answer me the last question about the camera don't worry, I know it could be a little bit complex.
User avatar
By martinayotte
#47065 For the camera, it should be doable.
You will need to define a protocol for exchanging the data over serial, then the ESP can embed the image into HTML.
But don't expect to have real time images, both Arduino and ESP are not having so much power compared to Raspberry or such other Linux board.

Looking at the Nano schematic again, maybe, I said maybe (since I didn't try myself), you can try using it for uploading the ESP, as long as you first upload Nano sketch which doesn't access Serial at all, and with the connections of the RX/TX to ESP, you can reach it directly from USB. This maybe work due to the change that both RX/TX lines of the ATMega328 have some resistors between it and the USB-TTL.
Nano v3 schematic : http://www.ba0sh1.com/wp-content/upload ... no-3.3.png