For this project I´m using a NodeMCU development boardwith an integrated ESP8266 chip that comes with integrated WIFi and Bluethoot module antena. From the datasheet, I will highlight some things that I find usefull to me (or that I understand).
• Integrated TCP/IP protocol stack
• Supports antenna diversity
• WiFi 2.4 GHz, support WPA/WPA2
• Support STA/AP/STA+AP operation modes
• Support Smart Link Function for both Android and iOS devices
• Operating temperature range -40C ~ 125C
• Dual and single antenna Bluetooth co-existence support with optional simultaneous receive (WiFi/Bluetooth) capability.
In that platformio.ini you have to declare the enviroment, the platform, the board and the framework like this:
[env:nodemcuv2]
platform = espressif8266
board = nodemcuv2
framework = arduino
The software does it automaticaly when you create a new project and define this settings, but if you are going to add some addition external libraries you will also have to declare them here, I´ll explain a bout this in the Breathe example.
Another important thing is that if you want to code it with the same arduino language, you have to call the Arduino library in the beggining of the code:
#include <Arduino.h>
If you don´t call the library, it won´t recognize a lot of things in your code like Delay, Output, PinMode, etc.
D8 (16 - GPIO15)
D6 (6 - GPIO12)
Another thing that was interesting to me was to be able to Flash the NodeMCU with Micropython with a RasperryPI3 thourgh terminal, but I think I´ll document that in networks.
pip install esptool
esptool.py --port /dev/ttyUSB0 erase_flash
esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash -- flash_size=detect 0 esp8266-20170108-v1.8.7.bin (this correspondes to the version you donwloaded)
Mobirise web page maker - Go now