ESP8266. How to use...
 
Notifications
Clear all

ESP8266. How to use with the Arduino IDE: Libraries, GPIO, Web Server, Web Client


christophe
Posts: 251
Admin
Topic starter
(@chris)
Member
Joined: 5 years ago
wpf-cross-image

In many applications, ESP8266 WiFi modules can replace Arduino by adding Wi-Fi connectivity at a lower cost. At the launch of ESP8266 (in 2014), the preferred programming language was Lua (we can always program in this language!).

  Quickly, the vast majority of Arduino libraries have been adapted to run on the ESP8266. Today…

8 Replies
585a88a39766812e0146bcbe38bfe6a9?s=80&d=mm&r=g
Posts: 4
 sultan m almodarra
Guest
(@sultan m almodarra)
Joined: 3 years ago

That was really helpful! Thanks a lot of such a great effort!
I have a short question: Can I store the data in the serial monitor from ESP using the WiFi connection and link it to MATLAB?

Reply
7 Replies
christopher 1
 Projets DIY
Guest
(@Projets DIY)
Joined: 5 years ago

Posts: 205

Thank you very much. I don't have any Matlab licence, so I can't test anythings. I think that's no problem. I imagine that on the ESP8266, you have to send the measurements with the command Serial.println(you_data). On Matlab, there are several commands to open the serial port and read data (in ascii for example) https://fr.mathworks.com/help/matlab/serial-port-devices.html. fopen / fgetl / fclose.

Reply
585a88a39766812e0146bcbe38bfe6a9?s=80&d=mm&r=g
 sultan m almodarra
Guest
(@sultan m almodarra)
Joined: 3 years ago

Posts: 4

Hi,

Very intersting! I have another quesiton; can I upload the program it self using WiFi after connecting the Arduino with my home router. I mean let's say, I will connect my ESP with WiFi and then I put somewhere where it's difficult to connect it through USB again, at this stage can I send a new code through WiFi or not?

Reply
christopher 1
 Projets DIY
Guest
(@Projets DIY)
Joined: 5 years ago

Posts: 205
585a88a39766812e0146bcbe38bfe6a9?s=80&d=mm&r=g
 sultan m almodarra
Guest
(@sultan m almodarra)
Joined: 3 years ago

Posts: 4

Amazing! Last question; can I check or see the serial monitor remotly through WiFi ? And finally import data from this monitor to Matlab or Python or any post process software? All two steps are being made wirelessly?

Reply
christopher 1
 Projets DIY
Guest
(@Projets DIY)
Joined: 5 years ago

Posts: 205

Great. To recover data in python, I advise you to communicate in HTTP or Websocket. You can do more elaborate things. For example since the pyhon code send settings, start or stop the publication of data. You can get inspired by these tutorials
Websockets https://diyprojects.io/websocket-communication-esp8266-arduino-python-test-ws4py-library-raspberry-pi/#.WpEMwZOdU_U
HTTP https://diyprojects.io/esp8266-web-client-tcp-ip-communication-examples-esp8266wifi-esp866httpclient/#.WpENQ5OdU_U
You can also use the awesome project johnny-five if you know the javascript.
https://diyprojects.io/start-programming-nodejs-johnny-five-iot-firmata-orangepi/#.WpEOSJOdU_U

Then to connect your code to Matlab
- In Pyhon https://fr.mathworks.com/help/matlab/matlab-engine-for-python.html?s_tid=gn_loc_drop
- Nodejs https://www.npmjs.com/browse/keyword/matlab

That's it, I hope you have everything you need for your project or your studies. Have a nice week end

Reply
585a88a39766812e0146bcbe38bfe6a9?s=80&d=mm&r=g
 sultan m almodarra
Guest
(@sultan m almodarra)
Joined: 3 years ago

Posts: 4

BIG THANK FOR YOU!

Reply
christopher 1
 Projets DIY
Guest
(@Projets DIY)
Joined: 5 years ago

Posts: 205

You're welcome. I did not do much. You still have everything to do. Good luck and do not hesitate to explain your project when it is finished. He looks very interesting. See you soon. Have a nice week end

Reply
Share:
Join Us!
Recent Posts
Last Articles
DIY Projects
DIY Projects