About read serial data need help!!!

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
livebelive
Normal user
Posts: 13
Joined: 08 May 2017, 22:50

About read serial data need help!!!

#1 Post by livebelive » 08 May 2017, 23:18

My English is so bad don't laugh at me Please!!!Thanks!

The problem is this
I got a voice recognition module
I want to connect this module with espeasy
What I want to do is to read the data from the module, and then transfer it to domoticz via espeasy
There are two options
1, through the espeasy to do judgment, and then send the HTTP command directly to the json.htm control switch (the best solution)
2, the espeasy will be passed to the domoticz value of a IDX device, and then write the Lua script control switch in the domoticz (alternative)
The module is output through the serial, I do not know how to transfer data to Espeasy, I tried to write plug-ins, but it is too difficult for me, please forgive me for a beginner.
So I'm asking for the right thing to do!
As far as possible to describe in detail!!!
Esteem it a favor! Thanks very much!!!

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: About read serial data need help!!!

#2 Post by toffel969 » 08 May 2017, 23:36

livebelive wrote: 08 May 2017, 23:18 My English is so bad don't laugh at me Please!!!Thanks!

The problem is this
I got a voice recognition module
I want to connect this module with espeasy
What I want to do is to read the data from the module, and then transfer it to domoticz via espeasy
There are two options
1, through the espeasy to do judgment, and then send the HTTP command directly to the json.htm control switch (the best solution)
2, the espeasy will be passed to the domoticz value of a IDX device, and then write the Lua script control switch in the domoticz (alternative)
The module is output through the serial, I do not know how to transfer data to Espeasy, I tried to write plug-ins, but it is too difficult for me, please forgive me for a beginner.
So I'm asking for the right thing to do!
As far as possible to describe in detail!!!
Esteem it a favor! Thanks very much!!!
Have you seen the ser2net plugin? It should be the one for your application. I think it will require lua scripts on the domoticz side as it just maps the serial to a TCP port.
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

livebelive
Normal user
Posts: 13
Joined: 08 May 2017, 22:50

Re: About read serial data need help!!!

#3 Post by livebelive » 08 May 2017, 23:44

toffel969 wrote: 08 May 2017, 23:36 Have you seen the ser2net plugin? It should be the one for your application. I think it will require lua scripts on the domoticz side as it just maps the serial to a TCP port.
Yes, see the ser2net plug-in, set to complete, do not know how to send or receive data. Can you teach me how to do it?

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: About read serial data need help!!!

#4 Post by toffel969 » 08 May 2017, 23:51

livebelive wrote: 08 May 2017, 23:44
toffel969 wrote: 08 May 2017, 23:36 Have you seen the ser2net plugin? It should be the one for your application. I think it will require lua scripts on the domoticz side as it just maps the serial to a TCP port.
Yes, see the ser2net plug-in, set to complete, do not know how to send or receive data. Can you teach me how to do it?
No, I think you would need to take it to the domoticz forum from there.
Maybe another starting point is the nextion display plugin. AFAIK it also uses serial command. You would need to take it from there or hope someone else will. Maybe post some more details on the speech recognition device, so people get a better idea of what you trying to do.
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

livebelive
Normal user
Posts: 13
Joined: 08 May 2017, 22:50

Re: About read serial data need help!!!

#5 Post by livebelive » 08 May 2017, 23:55

Code: Select all

int val;
void setup()
{
  pinMode(12, OUTPUT);
  pinMode(13, OUTPUT);
  Serial.begin(115200);
  digitalWrite(13, 0);
  digitalWrite(13, 0);
  delay(2000);
  Serial.print("@PlayFlashText#007$");
}
void loop()
{
  val = Serial.read();
  if (val != -1)
  {
    if (val == 1)
    {
      digitalWrite(12, HIGH);
    }
    if (val == 2)
    {
      digitalWrite(12, LOW);
    }
    if (val == 3)
    {
      digitalWrite(13, HIGH);
    }
    if (val == 4)
    {
      digitalWrite(13, LOW);
    }
  }
}
The above is the module to the Arduino docking method
I tried to add it to espeasy's void (loop), which can be read and executed successfully,
But I don't know how to change the action to send to domoticz!

livebelive
Normal user
Posts: 13
Joined: 08 May 2017, 22:50

Re: About read serial data need help!!!

#6 Post by livebelive » 09 May 2017, 00:59

somebody help me!!!

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: About read serial data need help!!!

#7 Post by toffel969 » 09 May 2017, 11:25

livebelive wrote: 09 May 2017, 00:59 somebody help me!!!
First of all, stop stressing!
If you want to get help here, you need to be patient and polite.
Then checkout the CO2-Sensor on the wiki. It also uses serial communication. You will have to develop a plugin from there. It uses the softserial library to provide serial communication to two GPIO pins.
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

livebelive
Normal user
Posts: 13
Joined: 08 May 2017, 22:50

Re: About read serial data need help!!!

#8 Post by livebelive » 09 May 2017, 22:36

toffel969 wrote: 09 May 2017, 11:25 First of all, stop stressing!
If you want to get help here, you need to be patient and polite.
Then checkout the CO2-Sensor on the wiki. It also uses serial communication. You will have to develop a plugin from there. It uses the softserial library to provide serial communication to two GPIO pins.
Thank you very much!

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: About read serial data need help!!!

#9 Post by toffel969 » 10 May 2017, 10:04

livebelive wrote: 09 May 2017, 22:36
toffel969 wrote: 09 May 2017, 11:25 First of all, stop stressing!
If you want to get help here, you need to be patient and polite.
Then checkout the CO2-Sensor on the wiki. It also uses serial communication. You will have to develop a plugin from there. It uses the softserial library to provide serial communication to two GPIO pins.
Thank you very much!
If you don't mind, please share the plugin and the information on the device (not the code, maybe a link to ali/ebay so that we know what it looks like)
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

livebelive
Normal user
Posts: 13
Joined: 08 May 2017, 22:50

Re: About read serial data need help!!!

#10 Post by livebelive » 10 May 2017, 15:30

I do not mind, I am glad that the current knowledge is limited, even if you say where to find, how to describe it is not quite understand, and so I know some of the more comprehensive post!
Thanks again!

Post Reply

Who is online

Users browsing this forum: Google Adsense [Bot] and 4 guests