Arduino ESP8266 Library - arduino

I am new to arduino and just picked up myself an UNO and an ESP8266 module. I've managed to wire them all up properly and connected to my home network using the AT commands.
But now im trying to follow tutorials on the internet but the problem is every example includes a library
#include <ESP8266WiFi.h>
such as this example tutorial https://learn.sparkfun.com/tutorials/esp8266-thing-hookup-guide/example-sketch-ap-web-server
So I have tried googling for it but can't find anything. I'm assuming thats because its really simple and Im missing something quite obvious.
help?

If you wish to use the Arduino as the main part of your ESP8266 project, there are several ways to go.
Use the Arduino to issue AT commands to the ESP8266.
Create your own protocol or messaging system by programming up the
ESP8266 with (for example) nodemcu or the Arduino/ESP8266 project or
Espressif or others, then program up your Arduino with the same
protocol or messaging system so the two may talk.
Alternatively, just program your ESP8266 directly. No Arduino required. Doing so, you can turn the tables and get the ESP8266 to issue messages to the Arduino if for example if you wanted the many GPIO and sense pins of the Arduino to do something. If you only need a couple of extra GPIO pins, look at the ESP8266 range to get more GPIO pins, such as the ESP8266-12
Which to choose?
nodemcu will give you a good idea of the capabilities of the ESP8266
and may be a good starter, easy to flash, easy to program, but it is a poor finisher except for the most basic of programs.
espressif has a large toolchain, not pleasant to flash,
you'll be at the cutting edge, however the community support is
minimal
The Arduino/ESP8266 project is awesome, easy to flash, very fast,
very stable, and unlike nodemcu you can create a large project. As you noticed, any arduino project starting with #include <ESP8266WiFi.h> is not for the arduino, but for the ESP8266 using the arduino IDE https://github.com/esp8266/Arduino

The Sparkfun example, it's for the ESP8266 Thing and it's using the Arduino ESP8266 Core, to flash the module.
It's not Arduino code that communicates with the module over serial. You need to upload this code to ESP module and with the Arduino ESP8266 Core, it's possible to program the ESP directly from the Arduino IDE.

Related

Is it possible to factory reset an arduino from hardware to remove bad user code?

I was troubleshooting why Serial1 was always throwing undefined errors in sketches I was trying to run when I found a solution posted online for a slightly different board that suggested this line:
HardwareSerial Serial1(2);
I uploaded it and now the Arduino doesn't show up in the IDE, did I remap it's serial communications? Why is this possible!
Is there any hardware factory reset option available on these boards? Did I just brick my device?
edit: It seems the STM32Cube programmer app can be used to communicate with the device but I'm not sure where to get the original firmware to flash. https://imgur.com/a/LbiHenf
Assuming from the tag in your question, I guess you have an STM32 – (BluePill) Development Board (STM32F103C8).
If you think that your board is not handling serial communication properly then you might consider burning bootloader to your board. This will reset the complete configuration of your board.
There are many ways in which you can burn bootloader to your board.
Using another Arduino board like Uno / Nano / Mega
Using an FTDI USB to TTL Serial Adapter.
You might want to go through tutorials list below:
Getting Started with STM32 using Arduino IDE: Blinking LED
Programming STM32F103C8 Board using USB Port

Setting up BLE modules

I am using an adafruit BLE SPI friend, an nRF51 series BLE module. Eventually I will have to set it up to work with an STM32 microcontroller. Is it better to program it with a SPI library on an arduino uno to receive BLE data on a bluetooth receiver (iphone), or should I use any kind of Nordic Semiconductors/program IDE to make the device programming more robust. I would also like to add GATT settings, but really this is my first time working with SPI BLE so I'm not sure how to go about it. Any suggestions? (Also, I am not sure the adafruit library for the device is all that helpful, it seems to sacrifice bandwidth and some functionality for compatibility with their bluefruit app and other of their devices)

PWM/PPM Output misses some edges

I am using ESP8266 (NODEMCU 3.0 or something) to make a quadcopter. Ive connected ardu pro mini to RC receiver so I am reading PPM values from it. Pro mini sends data with tx to ESP8266. ESP reads it with software serial with 115200 baudrate. I am communicating with MPU9255 (Waveshire) via I2C either.
My problem is that I cant fully controll my brushless motors. When I was using arduino instead of ESP8266, servo library was the best and reliable. But ESP's servo library is different, since its not AVR, and problems occurs. First of the servo library didnt want to work on most frequencies. I mean default is 50Hz (20000uS) and in this state ESC of motors did armed but unfortunatelly when changes was fast and short (1250-> 1370 -> 1250) it did miss that change like nothing happnd... This makes my D value in PID controller useless...
Sometimes on 100Hz freq all was working fine, but sometimes not...
When Ive started to use analogWrite only 500Hz was working fine, rest of freq didnt want to arm ESCs.
PS. I am using 3.3V to 5V converter for PPM/PWM pins so I am sure that the signal is fine for ESCs.
PS2. I dont have any osciloscope unfortunately.
The ESP82266 present on your module is a RF transceiver integrated circuit that can handle WiFi communication, both configured as a slave to a microcontroller such as the ones present on various Arduino boards, or as a standalone chip by having it's on-board Tensilica L106 32-bit processor programmed via an external SPI flash memory. If used as a slave, the communication between, for example, an Arduino an the ESP82266 can be done using different protocols such as SPI / SDIO or I2C / UART interfaces. Googling a comprehensive Tensilica L106 user guide on the internet doesn't seem an easy task, and it looks as if some people have already failed to find it. If you're seeking to add Wi-Fi capabilities to your quadcopter the solution I suggest is having the Arduino take control over the servos, motors, etc. and hand off messages via SPI to your ESP82266 module. If this isn't the answer you are looking for, please try to be clearer about it, maybe find someone to do as an English translator for you.
However, if this is what you're concerned about, and you would like to use the ESP82266 module as as standalone solution, please link its built-in processor datasheet and the relevant parts of the quadcopters code that might need debugging.

How to work with ESP13 wifi shield for arduino?

I recently bought a ESP13 wifi shield which has to mount on to Arduino. I think it is much similar to esp8266 modules, but unable to find a proper guidelines/libraries relevant to it. I did not notice any helpful tutorials also. Here, I want to use this module to run as a wifi server.
An ESP13 is an ESP8266. It is version ESP-13.
It is not a WiFi shield for Arduino; although you can connect it to an Arduino via serial pins and use its WiFi capabilities.
The ESP8266 ESP-13 is a stand alone device. It combines a processor with WiFi so you don't need an Arduino for simple jobs (or not that simple; I use mine to receive REST commands and run 60 addressable LEDs in pretty patterns).
There are lots of resources for ESP8266s:
For example: https://tuts.codingo.me/introduction-to-esp8266-module.
Note that the pin locations change between versions so look out for that when making circuits.

Talk to I2C Devices connected to Arduino from Processing

I want to talk to devices that are connected to an Arduino from the Processing IDE and interface with the I2C communications protocol. The processing language is used to send command and data bytes to the arduino with the Firmata protocol. This is done with an existing arduino and Firmata library. I have been going through the library and it seems that there is functionality on both the Arduino and Processing sites to support I2C communication to devices connected to the Arduino, but there is no method to do that from processing. I have tried to create a method to do that but I couldn't get anywhere.
Can someone please help me ?
To anyone who might be interested of, I have found a solution to extend Processing Firmata Library to support additional features.
Based on this tutorial http://www.instructables.com/id/Going-Beyond-StandardFirmata-Adding-New-Device-Sup/ you have to edit Processing Arduino and Firmata Library, which are written in Java. Then compile the two and replace them in the source folder.
Then follow the tutorial to extend the Arduino Firmata Library on the Arduino end.

Resources