Send data sensor from arduino to esp8266 who send it to the cloud using SSL - arduino-uno

I have an arduino Uno which collect data from sensor, i want to send this data to the cloud using wifi esp8266 who support SSL using the library WifiClientSecure, is there an alternative to send data from arduino to the esp card and esp8266 read this data and send it after that to the cloud, i'm able to work with mqtt but i want to know if there is a way to have a directly connection between the arduino uno and esp8266 without having a third part, any help will be gratefull.

According to my research, the ESP8266 AT Command API does not support SSL. This means you will need to use the Arduino (as an FTDI converter) to program the ESP8266 with custom firmware. This will enable you to use WiFiClientSecure and pubsubclient.
To use the Arduino as an FTDI:
load a sketch that does not use Serial, such as the "Blink" example
connect the Arduino's TX pin to the ESP8266 RX pin
connect the Arduino's RX pin to the ESP8266 TX pin
Now you need to setup Arduino IDE so it can program an ESP8266
In Arduino IDE -> File -> Preferences, paste this into the Additional Boards Manager URLs: http://arduino.esp8266.com/stable/package_esp8266com_index.json (just copy the link as it is instead of clicking)
go to Tools -> Boards -> Boards Manager. Find "esp8266" in the list of boards and click "Install"
Set your board to "Generic ESP8266 Module" in Tools -> Boards
Arduino IDE is ready! But before you caan program an ESP8266 with it you need to connect a reset button and a program button to the ESP8266.
connect a push-button between GND and the ESP8266 GPIO_0 pin
connect a push-button between GND and the ESP8266 RESET pin
add a 10K-ohm pull-up resistor between 3.3V and ESP8266 pin (defaults the reset pin to HIGH)
When you are ready to upload a sketch to the ESP8266, use those buttons like this:
press both buttons
release RESET button
release GPIO_0 button
This puts the ESP8266 in program mode! You should now be able to click the "Upload" button in Arduino IDE. I would suggest using one of the provided ESP826a6 example sketches (like this one) to test everything out.
Here's an overview of the project:
. Arduino Uno sketch: read sensor data, send via Serial to ESP8266
. ESP8266 sketch: connect to WiFi network, receive sensor data from Serial, send via WiFiClientSecure to the cloud.
I will leave the actual code of these two programs up to you, but if you get stuck just leave a comment. Hope this helps!

Related

LoRa Ra-02 SX1278 and the ESP32 WROOM

I am using the ESP32 WROOM as well as a single LoRa Ra-02 SX1278. Now I have made a burglar alarm with micropython and what I really want is to send a text message to my mobile phone via the Lora module when the alarm goes off. I've been looking for examples in micropython for a while but can't really find anything. My question is can you send a message via bluetooth with a single LoRa Ra-02 SX1278 module and the ESP32 WROOM.

Can the NXP PN532 work on UART at a 38400 baud rate?

I am trying to integrate an RFID1356MIFARE, which uses NXP PN532, with an ESP32-EVB using their UART capabilities.
The NXP docs states that the PN532 is able to communicate on High Speed UART.
I am trying to use 38400 because that's the baud rate fixed by the reader that I'm using.
I've found a modified Adafruit PN532 library that added HSU support. This library states that HSU uses 115200 baud rate.
Now, I've modified PN532_HSU.cpp, where we can find:
void PN532_HSU::begin()
{
_serial->begin(115200);
}
into
void PN532_HSU::begin()
{
_serial->begin(38400, SERIAL_8N1, 36, 4);
}
Unfortunately, I haven't been able to establish communication between the reader and the ESP using this method.
I am able to get a readable output using normal Serial.read(), so UART communication works, but that's not how you read MIFARE cards.
I don't know what the problem is.
What do you think ?
[EDIT]
I went through the documentation and here is what i suggest: If you have a USB to serial device use it to directly connect reader module to computer else connect it directly using mini USB port in module. the follow following steps:
Put device in UART/ USB CDC mode depending on how you connected device to computer. Exact method to do this is provided in operation section of documentation
Use picoterm / screen or other serial terminal (if you are using Linux) or just use Arduino serial monitor with correct baud rate to connect device.(115200 for USB and 38400 for UART)
Type in commands listed in COMMAND SET FOR CDC AND UART MODE section in documentation to check if module is working or not.
Place some cards over reader to check what response does module sends when card is detected.
Use this information to develop your own library for reader.
It will not work with regular PN532 libraries. Instead you'll need to use regular Serial read and write to communicate.
[Original]
PN532 datasheet says host interface is selected by pulling up/down I0, I1 pins of device. For HSU both pins must be pulled down. This is implemented in hardware so you need to verify if the mode you want to use is set.
Looking into the link you posted for module, it says that it uses another micro-controller on board to extend communication capabilities, so maybe you need to use driver for that specific controller firmware? The link seems to have document explaining how to setup different communication system in Document section, please have a look there and check if it works.
Link: https://www.olimex.com/wiki/MOD-RFID1356MIFARE

Receiving broadcast in Windows 10 phone

I've got a Windows 10 based Mobile phone and want to receive a broadcast UDP packages send by a esp8266 breadboard. My mobile phone and esp8266 board are not connected to any wifi network or router so both have a fixed IP-addresses which can be completely different like: Mobile Phone => 10.0.0.1, esp8266 board => 192.168.1.1. The both have to communicate directly without a wifi-router.
Does somebody made this work or can tell me how get this working.
Regards, Wamor
You could set the esp8266 up as an AP (access point). This allows you to connect to the esp8266 from your phone like you would to a wifi router.
Check out https://learn.sparkfun.com/tutorials/esp8266-thing-hookup-guide/example-sketch-ap-web-server for a tutorial on how to do this.
Another useful link to a project that is similar to yours:
https://www.hackster.io/rayburne/esp8266-access-point-using-arduino-ide-19f632

Arduino-ESP8266 Sending URL from a client browser connected to the esp8266 AP and receiving the entered URL in the arduino board

I am working on a project where in I have coupled the arduino uno board and an ESP8266 module. I want to send an URL from my browser provided I am connected to the ESP8266 01 AP. For ex, is it possible to send "www.xyz.com" from the browser and it should be received at the ESP8266 module and the request should dumped to the arduino board.
Yes, this can be done by making the ESP a captive portal, especially since you have set the ESP as an access point. There is an example in the esp wifi library for Arduino. Check out https://github.com/esp8266/Arduino and the examples. In addition, there is a nice WifiManager lib that goes further with a demo of a captive portal at https://github.com/tzapu/WiFiManager
HTH

Is it possible to target a specific Arduino device with the CC3000 Wifi over the web?

I've got my CC3000 Wifi shield and Arduino Uno working as intended using the several libraries, including the aRest.h library. In order for me to control the Arduino from anywhere across the web, I configured the port-forwarding settings on the router to address the Arduino via the routers ip address.
My question is this: If I had a multiple Arduino modules/devices that relied on two way communication (client/server), how is the setup configuration automated for each device so that I could target a specific Arduino with regional data? I don't expect the end user to know how to access the router and configure port forwarding.
I hope this makes sense, I'm a newbie to the world of micro-controllers, but have had some success with progress as of late
You should be able to make a simple way to setup the Wifi, when this job is done you connect via socket so a socket server ( python,node,etc... ) and this will avoid any port-forwarding.
You will not need to care about all this messy tasks, you can have as many as you want arduino in the same network and access from the internet.

Resources