Page 1 of 1
serial port send data to Thingspeak
Posted: 12 Oct 2017, 13:22
by rayE
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
Re: serial port send data to Thingspeak
Posted: 12 Oct 2017, 21:42
by enesbcs
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.
Re: serial port send data to Thingspeak
Posted: 13 Oct 2017, 01:32
by rayE
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
Re: serial port send data to Thingspeak
Posted: 13 Oct 2017, 09:37
by rayE
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
Re: serial port send data to Thingspeak
Posted: 13 Oct 2017, 09:44
by rayE
This is how i have set up Tools - Advanced
Re: serial port send data to Thingspeak
Posted: 13 Oct 2017, 13:10
by rayE
Is this the direction i should be heading?
TaskValueSet Rules Set values on a Dummy Task device TaskValueSet <task nr>,<value nr>,<value/formula>
Re: serial port send data to Thingspeak
Posted: 13 Oct 2017, 18:26
by enesbcs
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
Re: serial port send data to Thingspeak
Posted: 14 Oct 2017, 01:41
by rayE
Thanks for the information. I will give it a try today
Ray
Re: serial port send data to Thingspeak
Posted: 15 Oct 2017, 04:45
by rayE
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