Welcome! Log In Create A New Profile

Advanced

[WM23] How to send value via wifi (ESP8266 + Arduino)

Posted by Mujahid 
[WM23] How to send value via wifi (ESP8266 + Arduino)
November 21, 2019 04:51AM
Hi All,

I was success to test a simple program on how to handle Relay(On/Off) using ESP8266 wifi module and Arduino Uno.

The apps is using third party apps at google playstore. I dont know how they make it but its work.

Unfortunately im not success to send the 1 and 0 value to this program using WM23.

I have try using SocketWrite, SocketExist, Httprequest but still no success. When im test the send button, mostly no error info and the WM apps will close immediately.

To control Relay(On/Off) using the Bluetooth connection via HC-06 device with Arduino is no problem. Easy and success using Windev Mobile.

But cannot find an easy solution for Wifi.

Any clue or guidance?

Thanks a lot.

Regards,
Mujahid
Re: [WM23] How to send value via wifi (ESP8266 + Arduino)
November 21, 2019 08:35PM
Hi Mujahid,
it is (almost) impossible to help you without knowing what program is running on Arduino.
Also working mode of ESP8266 (wifi client or ap) is valuable information.

Communication can be socket, http, mqtt but you have to know what is expected on Arduino side.
After that this task can be done in WX without much effort.

In this sample ESP is web server and control is made via simple http request.
[youtu.be]

BR,
Alen
Re: [WM23] How to send value via wifi (ESP8266 + Arduino)
November 23, 2019 10:22AM
Hi Alen,

Thanks for the link video.

I also refer to this video.
[www.youtube.com]


Im success by coding like this Windev or Windev Mobile.

// Check the socket existence
IF SocketExist(csSocketName) = False THEN
SocketConnect(csSocketName,80,"192.168.4.1")
IF ErrorOccurred THEN
// Error during the connection
Error("Unable to connect to the server",ErrorInfo())
Close
END
END


Text is Buffer
Text = "pin=11"

// Send the message
IF SocketWrite(csSocketName,Text) THEN
Text =""
SocketClose(csSocketName) // Not for Windev. But ok for Windev Mobile
ELSE
// Error sending the message
Error("Transmission error while sending the message",ErrorInfo())
END



Thanks a lot. grinning smileythumbs up

Regards,
Mujahid
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: