serial port send data to Thingspeak

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
rayE
Normal user
Posts: 144
Joined: 12 Oct 2017, 12:53
Location: Philippines

serial port send data to Thingspeak

#1 Post by rayE » 12 Oct 2017, 13:22

Hi All,
Im VERY new to ESPeasy so please excuse any stupid questions. I have a current prototype unit that consists of a PIC controller that is connected to an ESP 12E via the serial port. The PIC has a few sensors connected to it and sends this data to Thingspeak. Currently I use AT commands to accomplish placing the data on Thingspeak using an http GET request. I would like to use the ESP firmware because of it’s configuration functionality so my questions are………….

1. Can I use the serial port to send multiple channel values from the PIC to the ESP then to Thingspeak?
2. Are there any examples of how I would set ESPeasy up and an example of the string I would send to the serial port?

Thanks
Ray

User avatar
enesbcs
Normal user
Posts: 587
Joined: 18 Jun 2017, 11:02
Location: Békéscsaba, Hungary

Re: serial port send data to Thingspeak

#2 Post by enesbcs » 12 Oct 2017, 21:42

rayE wrote: 12 Oct 2017, 13:22 Hi All,
Im VERY new to ESPeasy so please excuse any stupid questions. I have a current prototype unit that consists of a PIC controller that is connected to an ESP 12E via the serial port. The PIC has a few sensors connected to it and sends this data to Thingspeak. Currently I use AT commands to accomplish placing the data on Thingspeak using an http GET request. I would like to use the ESP firmware because of it’s configuration functionality so my questions are………….

1. Can I use the serial port to send multiple channel values from the PIC to the ESP then to Thingspeak?
2. Are there any examples of how I would set ESPeasy up and an example of the string I would send to the serial port?

Thanks
Ray
It depends on the mode and complexity of the serial communication, that you want to use.
There are a simple Ser2Net plugin, which can be used with rules, as needed:
http://www.letscontrolit.com/forum/view ... net#p19201
If it is not enough, i am afraid you have to create your own plugin.

rayE
Normal user
Posts: 144
Joined: 12 Oct 2017, 12:53
Location: Philippines

Re: serial port send data to Thingspeak

#3 Post by rayE » 13 Oct 2017, 01:32

Hi,
Thanks for the quick reply. I can tailor the protocol to whatever ser2net wants so that is not a problem. I will look at the ser2net plugin and hopefully get something up and running.

Thanks for the pointer.
Ray

rayE
Normal user
Posts: 144
Joined: 12 Oct 2017, 12:53
Location: Philippines

Re: serial port send data to Thingspeak

#4 Post by rayE » 13 Oct 2017, 09:37

OK, i made some progress on this today and did the following.

1. Flashed ESP Easy onto ESP-12E module.
2. Set all the basic settings to connect to my network.
3. Followed the instructions here to send data to thingspeak
http://www.letscontrolit.com/forum/view ... f=4&t=1175

4. Set up a ser2net device
5. using the following device settings i can send 2 system values to thingspeak at 20 second intervals and all is OK.
6. See the attachment pics for ser2net config details.

Now im stuck :-/ on 2 points (i think)
1. How do i pass a variable over the serial port to ESP Easy. I take it i would send a command like SerialSend followed by the value? i cannot find any documentation on serialSend?
2. Once i have the value in ESP Easy then would i set up some "rule" to pass this data to thingspeak?

Apologies for the complete "vagueness" on all of this but im at the bottom of a learning curve. Any pointers/examples/help is much appreciated.



TIA
Ray
You do not have the required permissions to view the files attached to this post.

rayE
Normal user
Posts: 144
Joined: 12 Oct 2017, 12:53
Location: Philippines

Re: serial port send data to Thingspeak

#5 Post by rayE » 13 Oct 2017, 09:44

This is how i have set up Tools - Advanced
You do not have the required permissions to view the files attached to this post.

rayE
Normal user
Posts: 144
Joined: 12 Oct 2017, 12:53
Location: Philippines

Re: serial port send data to Thingspeak

#6 Post by rayE » 13 Oct 2017, 13:10

Is this the direction i should be heading?

TaskValueSet Rules Set values on a Dummy Task device TaskValueSet <task nr>,<value nr>,<value/formula>

User avatar
enesbcs
Normal user
Posts: 587
Joined: 18 Jun 2017, 11:02
Location: Békéscsaba, Hungary

Re: serial port send data to Thingspeak

#7 Post by enesbcs » 13 Oct 2017, 18:26

rayE wrote: 13 Oct 2017, 09:37 Now im stuck :-/ on 2 points (i think)
1. How do i pass a variable over the serial port to ESP Easy. I take it i would send a command like SerialSend followed by the value? i cannot find any documentation on serialSend?
2. Once i have the value in ESP Easy then would i set up some "rule" to pass this data to thingspeak?
As i know, the only option to output is to Publish raw data from serial port to the MQTT server, or Thingspeak.
If the Ser2Net device is named SerialRAW, then:

Code: Select all

On SerialRAW do
  Publish %sysname%/SerialRAW,[SerialRAW]
endon
I am not so familiar with the usage of the Rules engine, instead i made my own plugin to support serial devices, that i am using.

You can check the Ser2Net source code directly:
https://github.com/letscontrolit/ESPEas ... er2Net.ino

There is a closed bug with a similar task, so i am not sure, that it will work as you want:
https://github.com/letscontrolit/ESPEasy/issues/514

rayE
Normal user
Posts: 144
Joined: 12 Oct 2017, 12:53
Location: Philippines

Re: serial port send data to Thingspeak

#8 Post by rayE » 14 Oct 2017, 01:41

Thanks for the information. I will give it a try today :)

Ray

rayE
Normal user
Posts: 144
Joined: 12 Oct 2017, 12:53
Location: Philippines

Re: serial port send data to Thingspeak

#9 Post by rayE » 15 Oct 2017, 04:45

My solution to posting data (multiple fields in one go) to thingpeak through the ESP serial port is here.

viewtopic.php?f=6&t=3642

Ray

Who is online

Users browsing this forum: Anthropic Claude Bot [bot], opensiteexplorer.org/dotbot [bot] and 27 guests