Serial port

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
dynamicdave
Normal user
Posts: 257
Joined: 30 Jan 2017, 20:25
Location: Hampshire, UK

Serial port

#1 Post by dynamicdave » 06 Feb 2019, 08:16

I'm trying to use the serial port on a Wemos D1 Mini.

The two problems I have are..
(1) Extracting the data from the received message
(2) Trying to find a way of sending data/variable from the Wemos via the serial port

Note:
I'm using the very latest version of ESP Easy mega 20190202 release.

Any help or guidance would be greatly appreciated.

Kind regards from David.

kimot
Normal user
Posts: 190
Joined: 12 Oct 2017, 20:46

Re: Serial port

#2 Post by kimot » 06 Feb 2019, 18:31

(1)
I think data extraction will be difficult.
Is not it better to send data in a correct format?:
viewtopic.php?t=4884

(2)
serialsend

Look at post from "mikeluyten" here:

https://github.com/letscontrolit/ESPEasy/issues/539

User avatar
dynamicdave
Normal user
Posts: 257
Joined: 30 Jan 2017, 20:25
Location: Hampshire, UK

Re: Serial port

#3 Post by dynamicdave » 06 Feb 2019, 21:03

Thanks for all your help.

I can now send information/data from the WeMos to my terminal (app running on a mobile phone) using rules.
on !Serial#* do
publish david,%eventvalue%
serialsend %eventvalue%
endon

I can also set a dummy variable using this http command.

http://192.168.1.90/control?cmd=TaskValueSet,12,1,22

What I can't work out is how to send a command-string from my terminal (mobile phone) to the Wemos.

I've tried sending the text string... TaskValueSet,12,1,22 (and all sorts of variations of this) but nothing happens in the dummy variable.

Is there something I should prefix the string with??

Kind regards from David.

PS: Which version of ESP Easy are you using?

Cino2424
Normal user
Posts: 17
Joined: 30 Sep 2018, 16:35

Re: Serial port

#4 Post by Cino2424 » 28 Feb 2019, 19:16

I do it in this way

void tempread() {
float h = dht.readHumidity();
float t = dht.readTemperature();
char temp[] = "TaskValueSet,1,1,";
char hum[] = "TaskValueSet,1,2,";
Serial.print(temp);
Serial.println(t);
Serial.print(hum);
Serial.println(h);
}

Post Reply

Who is online

Users browsing this forum: No registered users and 57 guests