Page 1 of 1
Serial to MQTT
Posted: 30 Aug 2016, 23:29
by sheppy
Is it possible to use ESP Easy to send a serial input from an Arduino onto MQTT? I see that it has a serial server option, but also that it may not be stable?
Re: Serial to MQTT
Posted: 30 Aug 2016, 23:44
by nonflammable
Re: Serial to MQTT
Posted: 30 Aug 2016, 23:46
by sheppy
nonflammable wrote:just use serial command
Is that in the sketch that I upload to the ESP?
Re: Serial to MQTT
Posted: 30 Aug 2016, 23:53
by nonflammable
First configure MQTT on Config tab -> Protocol. Submit.
On Tools tab write Publish with arguments in Command field and Submit.
If it works then configure communication with Arduino - Tools tab -> Advanced.
Enable serial port: - Yes
Serial log Level: 2 or 1 or 0
Baud Rate: 9600 or your Arduino serial speed
Submit

Try to send from Arduino serial command Publish with arguments.
Re: Serial to MQTT
Posted: 31 Aug 2016, 00:00
by sheppy
I've just looked at one of my working devices.
nonflammable wrote:From computer connected to ESP try to send Publish command with arguments by serial console.
Do you have an example of the Publish Command? For example
"Publish Sensor/NumberOne, 234"
I just need to send this command to the serial port and it will be sent to MQTT with no extra work?

Re: Serial to MQTT
Posted: 31 Aug 2016, 00:05
by nonflammable
?
You can send this on Tools tab. Write Publish with arguments in Command field and Submit.
Re: Serial to MQTT
Posted: 31 Aug 2016, 00:07
by nonflammable
sheppy wrote:
I just need to send this command to the serial port and it will be sent to MQTT with no extra work?

Yes, it should work.
Re: Serial to MQTT
Posted: 31 Aug 2016, 00:11
by sheppy
nonflammable wrote:sheppy wrote:
I just need to send this command to the serial port and it will be sent to MQTT with no extra work?

Yes, it should work.
Too easy - thanks!
Re: Serial to MQTT
Posted: 31 Aug 2016, 00:16
by nonflammable
be aware to use Serial.println or Serial.print/write with CR
Publish (and other commands) without CR may not work.
Re: Serial to MQTT
Posted: 31 Aug 2016, 00:28
by sheppy
Since writing the post above I've flashed 2 new Huzzah's with V120 and I have them on test, if I send a command from the web interface
Publish Test 10
it works,
AND
using a different terminal program (Termite) instead of the serial monitor shipped with the Arduino IDE the publish command works from the serial port too.
It also works from the Arduino using "println"
Thanks for your help, and to everyone involved with ESP Easy for making such a great product!
Re: Serial to MQTT
Posted: 09 Sep 2016, 08:20
by sheppy
The 2 Huzzahs have worked flawlessly for 7 days now. All I have connected is the RX and 0V pins and despite being USB equipped modules powered using the USB port from standard USB power supplies it works a charm.
Thanks to the team for writing and supporting ESP Easy