Serial to MQTT
Moderators: grovkillen, Stuntteam, TD-er
Serial to MQTT
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?
- nonflammable
- Normal user
- Posts: 42
- Joined: 09 Mar 2016, 22:19
- Location: Poland
Re: Serial to MQTT
just use serial command
Code: Select all
Publish <topic>, <value>
Re: Serial to MQTT
Is that in the sketch that I upload to the ESP?nonflammable wrote:just use serial commandCode: Select all
Publish <topic>, <value>
- nonflammable
- Normal user
- Posts: 42
- Joined: 09 Mar 2016, 22:19
- Location: Poland
Re: Serial to MQTT
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.
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.
Last edited by nonflammable on 31 Aug 2016, 00:01, edited 1 time in total.
Re: Serial to MQTT
I've just looked at one of my working devices.
"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?
Do you have an example of the Publish Command? For examplenonflammable wrote:From computer connected to ESP try to send Publish command with arguments by serial console.
"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?

- nonflammable
- Normal user
- Posts: 42
- Joined: 09 Mar 2016, 22:19
- Location: Poland
Re: Serial to MQTT
Code: Select all
Publish TestValue, 10
You can send this on Tools tab. Write Publish with arguments in Command field and Submit.
- nonflammable
- Normal user
- Posts: 42
- Joined: 09 Mar 2016, 22:19
- Location: Poland
Re: Serial to MQTT
Yes, it should work.sheppy wrote: 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
Too easy - thanks!nonflammable wrote:Yes, it should work.sheppy wrote: I just need to send this command to the serial port and it will be sent to MQTT with no extra work?
- nonflammable
- Normal user
- Posts: 42
- Joined: 09 Mar 2016, 22:19
- Location: Poland
Re: Serial to MQTT
be aware to use Serial.println or Serial.print/write with CR
Publish (and other commands) without CR may not work.
Publish (and other commands) without CR may not work.
Re: Serial to MQTT
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
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!
it works,Publish Test 10
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
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
Thanks to the team for writing and supporting ESP Easy
Who is online
Users browsing this forum: No registered users and 13 guests