Connect ESP8266 to open network using AT commands - networking

We have an Arduino Uno connected to an ESP8266 and a bunch of other devices. We are using the ESP8266 as a WiFi connector (obviously) to send data to REST API.
Our problem is that we have to use an open network, and there is no AT-* command that does "connect to SSID without password".
We have considered using the CWJAP command, passing password as "", but have failed -- that may be because of a dumb AP we used (TPLINK), but we are wondering if this is the right approach (sending nothing vs nothing being sent dilemma).
Have you perhaps had any success with using such a configuration?

Proper way to connect to open network using AT commands is to provide:
AT+CWJAP=ssid,password
for example:
AT+CWJAP="Johns Network", ""
Which would be a string:
"AT+CWJAP=\"Johns Network\",\"\"".

Related

How to do OTA via http, using ESP32 as AP instead of as STA, and using ESP-IDF?

I need to write a program, using ESP-IDF, which is able to update the firmware of an ESP32-S3-based device wirelessly, without having on-field access to Internet.
I googled and found the example project about OTA:
OTA: https://github.com/espressif/esp-idf/tr ... system/ota
But this project seems to use the ESP32 as an HTTP client, connecting to a server running on a computer, and both the ESP32 and the computer being connected to the same local network created by a router acting as AP. For the firmware update on-field, I won't have access to Internet or a local network via a router, hence I will need to set up a direct connection between the ESP32 and my computer. I thought that I could do this by using the ESP32 as AP and then connect with my PC to the ESP32-created network.
For using ESP32 as AP, I found the following example project:
WiFI as AP: https://github.com/espressif/esp-idf/tr ... ted/softAP
and for using ESP32 as HTTP server I found the following example project:
HTTP server: https://github.com/espressif/esp-idf/tr ... ver/simple
My idea was to try to combine code from the above 3 example projects in order to use the ESP32 as AP instead of as STA, run an HTTP server on ESP32, use a computer as HTTP client to connect to the ESP32 server, and from the computer browser to upload the new firmware file to the ESP32 server, and then copy the new firmware from a buffer to the ota flash partition.
As I don't have experience with OTA at all and less experience with ESP32, I wanted to first ask if the above idea is possible at all or there exists a simpler way to accomplish the OTA. If there is no simpler method, how can I use the OTA code with ESP32 being an HTTP server instead of HTTP client (as the OTA example seems to be coupled to an HTTP client) ?
P.S. Using the ESP32 as HTTP client seems not applicable to me because I will need to know in advance a certain permanent IP address for the computer acting as an HTTP server which I think I cannot have, but I am not sure if I am thinking correctly ?

ESP8266 Wifi P2P with Arduino

I am fairly new to using the ESP8266 and trying to get two of them to connect directly via the wifi generated by the server. For now, I am using two Arduino Unos, one for each wifi module. I am sending the ESP8266 AT commands from the Serial Monitor. I have one ESP8266 dedicated to being a server and the other as a client. My goal is to send a simple message from the client to the server without connecting to any external wifi. Here is the series of AT commands I am using in the Arduino Serial Monitor.
Server code:
INPUT: AT+CWSAP="ESP SSID","ESP PASSWORD",2,3
OUTPUT: OK
INPUT: AT+CWMODE=3
OUTPUT: OK
INPUT: AT+CIPMUX=1
OUTPUT: OK
INPUT: AT+CIPSERVER=1,80
OUTPUT: no change
OK
INPUT: AT+CIFSR
OUTPUT: +CIFSR:APIP,"192.168.4.1"
+CIFSR:APMAC,"2e:3a:e8:20:f9:96"
+CIFSR:STAIP,"0.0.0.0"
+CIFSR:STAMAC,"2c:3a:e8:20:f9:96"
Client Code:
INPUT: AT+CWMODE=3
OUTPUT: OK
INPUT: AT+CJAP="ESP SSID","ESP PASSWORD"
OUTPUT: WIFI CONNECTED
WIFI GOT IP
INPUT: AT+CIPMUX=1
OUTPUT: OK
INPUT: AT+CIPSTART=2,"TCP","192.168.4.1",80
OUTPUT: ERROR
2,CLOSED
I cannot figure out why I am getting this error when trying to start a connection with the server. I am aware of the thread Communication between 2 ESP8266 WiFi modules without router using AT commands but none of these solutions have fixed this error.
I have also swapped the original ESP8266s with 2 new ones, which did not solve the problem. In addition, I have been able to communicate with these wifi modules using a smartphone with a TCP client app, so I don't think any of my hardware is broken. Thank you for any suggestions and help.
After some extreme trial and error, I got the connection to work. After manually setting the IP address of the client using
AT+CIPSTA="192.168.4.2"
the connection could be made using the AT commands above. I guess the client needs to contain the same first three parts of the IP address as the server. I'm not sure if I'm just a noob that should know about this IP address nomenclature, but here is an official answer to help others with the same problem. Good luck!

Cannot Read From Multimeter with RS232 Communication

I am currently attempting to use a computer and RS232 connection to control a HP 34401A Multimeter. I am able to use commands such as "SYSTem:REMote" or "*TST" however when I attempt to use a command that sends back information nothing is returned to the computer. If I use another return command directly after I get a -410 error signifying that the output buffer is full. Are there any commands I need to use to tell it to send the information to the computer? I have been looking through the manual for one but cannot find it.
Extra Info:
RS232 Connection Setup: Baudrate=9600, Data bits=8, Stop bits=2, Parity=None
Since the connection is DTE to DTE I am using a null modem cable
I am using Termite to send commands to the multimeter
Thank you for any help!

HM10 BLE 4.0 Send AT Commands instead of passing through serial

When I send any commands to the HM10 BLE Bluetooth module, it sends the commands through bluetooth instead of the HM10 module processing the command. For example, I expected to send AT and have the module respond with "OK", but it sends the text "AT" through the bluetooth connection. I have tried sending the command with no bluetooth connection and the same thing happens. I have also tried sending the command via bluetooth instead of the serial connected to the device and I get the same thing.
When HM10 is connected to remote ble device it is in transparent mode. To put it into AT mode you need break connection or not establish it at all.
For breaking connection use reset/break pins. Reset is 12 pin and Break seems to be 23 pin.
It has sense to look IMME parameter of the module (page 32 of datasheet).
IMME Query/Set Module work type
1: When module is powered on, only respond the AT Command, don’t do
anything. Until AT + START, AT+CON, AT+CONNL commands is received.
0: When power on, module will start work immediately Default: 0
Also be carefull with strings endings, usually string doesn't need to be terminated with any symbol at all: AT, but some H11 need the string to end with CRLF: AT\r\n
Maybe (Maybe) your problem because of using clone module, try this solution with upload genuine firmware to your hm-10.
How to flash genuine HM-10 firmware on CC2541
I had problem close from your problem but for me no matter what I send I don't receive anything even to connected device, but after I upload that firmware, and change Module work mode to 1 (AT+MODE1) become able to send command even from connected device.

Arduino connected via TCP using SIM900 to Dweet.io

I am trying to stream some sensor data to Dweet.io using my Arduino connected to a SIM900 GSM/GPRS module. I am able to access internet, load data, check GPRS connectivity etc from my Arduino board. Could someone specifically tell me the syntax to post data onto dweet.io?
Instead of Using the AT commands use this library its easier and Nice https://github.com/amcewen/HttpClient
Dweet.io needs GET commands to send and receive data.

Resources