Page 1 of 1

Serial port

Posted: 06 Feb 2019, 08:16
by dynamicdave
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.

Re: Serial port

Posted: 06 Feb 2019, 18:31
by kimot
(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

Re: Serial port

Posted: 06 Feb 2019, 21:03
by dynamicdave
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?

Re: Serial port

Posted: 28 Feb 2019, 19:16
by Cino2424
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);
}