Esp8266 and MQTT question

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 7.

Moderator: Benj

Post Reply
User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times

Esp8266 and MQTT question

Post by acestu »

Hi,

If I had a variable with say temperature data in it, how would I connect to a local Mosquitto MQTT server and publish a topic with the temperature data, would it be a case of using the send string command with all of the required data in the preferred protocol ?

EDIT: Also is there a way of accesing the GPIO pins on the Esp8266 ?

Thanks
Stuart
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Esp8266 and MQTT question

Post by Benj »

Hi Stuart,

I must admit I am currently a bit hazy with this subject at the moment. It's still in it's infancy and probably will change.

I've seen a lot of people using JSON commands similar to this which could simply be sent out as a string.

Code: Select all

"{\"id\" : 2, \"title\" : \"updated post\", \"body\" : \"This is the new.\"}"
JSON seems very popular at the minute, my hobby Pick and Place communicates with the PC entirely using JSON, I don't really see the appeal over say XML but to be fair I haven't used it much. I suppose it basically is XML in a slightly better structured format for more reliable sending and parsing.

Kersing is probably your man as he has been working a lot with IoT type applications via LoRA.

I'm not sure if there is a way to access the GPIO pins from the external interface. To access these you might have to get hold of the master firmware and make some changes to expose the pins. It's open source so you would think someone would have already done this and posted the updated firmware. Or as I say it might already be in there :D

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times

Re: Esp8266 and MQTT question

Post by acestu »

Hi Ben,

I have working examples on the Arduino IDE software but as you know it uses libraries so it doesn't give much away, most people have abandoned the programming the esp8266-01 in Lua, node MCU in favor of using C++ in Eclipse because of the lack of memory on the board, maybe things will improve when the new Esp32 board is widely available, do you have any plans to make that a Flowcode component ?

Thanks
Stuart
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Esp8266 and MQTT question

Post by Benj »

Hi Stuart,

Yes we can certainly make a component for the ESP32 assuming it can still work in slave mode using a serial interface. The ESP32 has been coming soon for a long time now. Do you know what the current status is?

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times

Re: Esp8266 and MQTT question

Post by acestu »

Hi Ben,

It seems as if it is a guessing game as to when these boards will be on sale, I think it is a case of they will be openly available when it happens, so hopefully soon. I am currently using the Wemos D1 mini pro which has an Arial socket to send temperature data via mqtt, it would be nice to do something as easily in Flowcode.

Thanks
Stuart
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times

Re: Esp8266 and MQTT question

Post by kersing »

ESP-32 Modules and adapters available now.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Esp8266 and MQTT question

Post by Benj »

Thanks Jac,

I've ordered a few to have a play with.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times

Re: Esp8266 and MQTT question

Post by acestu »

Hi,

Maybe a component for Christmas Ben :wink:

Thanks
Stuart
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times

Re: Esp8266 and MQTT question

Post by acestu »

Hi,

The price of these seems to of gone crazy, the ones in Kersings link are no longer available and others are trending around £8.00 each and they have no aerial connector on them, I think there are other options available now, and maybe in time the price will come down.

Thanks
Stuart
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

Post Reply