ESP8266 - IoT protocol - Page 1
Forum section: electronics / general

author: gflater
author_rank: Newbie
timestamp: August 03, 2016, 12:07:17 am
content: I came across this today:ESP8266 Arduino IoT Device to Cloud Setuphttps://youtu.be/aolQxPTmpiYHas anyone any experience with this SMQ protocol?It looks very easy to use to drive IO from a web interface.

author: ebclr
author_rank: Super Contributor
timestamp: August 03, 2016, 12:58:46 am
content: This is a programmable device , the protocol will be defined by yourself, But if you want you can use that Library SMQ, But have many kinds available

author: lwatts666
author_rank: Unknown
timestamp: August 03, 2016, 01:36:07 am
content: Quote from: gflater on August 03, 2016, 12:07:17 amTake a look at :https://learn.adafruit.com/adafruit-io-basics-digital-output/esp8266andhttps://learn.adafruit.com/adafruit-io-basics-digital-input/esp8266They use the MQTT Library which is an OASIS standard rather than the proprietary SMQ library.There are some nice MQTT visualization examples out there. Tryhttp://www.hardill.me.uk:3000/

author: gflater
author_rank: Newbie
timestamp: August 03, 2016, 08:29:03 pm
content: Quote from: lwatts666 on August 03, 2016, 01:36:07 amWhen I dug around on the SMQ website, it appears that the SMQ sources are released under Eclipse Public License, in addition there is a ton of information how the protocol works. Not sure how that is any different from MQTT...You are correct that MQTT has a wider adoption , but the reason why I was looking into SMQ is because there are behaviors that are simply impossible with MQTT: I needed point to point communication, MQTT forces me to go through a broker for everything, with SMQ I can send commands/information directly to do the device: I was not able to solve the point-to-point using MQTT, that is how I came across SMQ. It appears to me the SMQ protocol includes pub/sub as in MQTT but also point-to-point communication including sender's address. I need this feature for controlling each device separately. I have seen some horrible MQTT hacks trying to circumvent this limitation in MQTT, but it's just too horrible of a hack.Looking around on their website, I came across this information that explains how the point-to-point communication is used in their LED example:https://makoserver.net/blog/2014/12/Browser-to-Device-LED-Control-using-SimpleMQI was just wondering if anyone out there has used this SMQ protocol to see if there is someone who had experience with it.

author: lwatts666
author_rank: Unknown
timestamp: August 03, 2016, 11:47:30 pm
content: Your requirement for point-to-point effectively counts out MQTT for your application.Just be aware that this pushes the subscription table management back into the IOT device. This will cause problems if the number of subscribers grow. At some point you run out of RAM to hold the subscriptions.In my case, the number of subscribers is quite large, so the MQTT broker is a nice beefy server. All the data source MQTT nodes can be small, needing only to manage one communication path to the broker.

author: gflater
author_rank: Newbie
timestamp: August 04, 2016, 07:15:24 pm
content: Quote from: lwatts666 on August 03, 2016, 11:47:30 pmLooking at the information here:https://realtimelogic.com/ba/doc/?url=SMQ.htmlIt appears to me that it is still the broker keeping track of the unique ID of each publisher/subscriber but from the endpoint it looks like it is doing point to point communication.

author: zapta
author_rank: Super Contributor
timestamp: August 04, 2016, 07:39:01 pm
content: Quote from: lwatts666 on August 03, 2016, 11:47:30 pmThe server also simplifies authentication and pushing notifications through NAT.

author: surgeprotector
author_rank: Newbie
timestamp: August 04, 2016, 10:04:31 pm
content: Quote from: zapta on August 04, 2016, 07:39:01 pmWhat server, SMQ or MQTT?. I think they are the same from a NAT perspective since the data goes via the broker?Also, SMQ seems to make it possible to use hash based authentication (see function create):https://realtimelogic.com/ba/doc/?url=SMQ.html#createHash based authentication is important when the communication is not protected by SSL since an eavesdropper can read the password if it's not hash based.The following is from the URL above (for the server code):local function authenticate(credentials, info)local username,pwdhash=credentials:match("([^:]+):(.+)")pwdhash = pwdhash and ba.b64decode(pwdhash)if username and pwdhash then-- The local data will typically be fetched from a databaselocal dbuname="username" -- For test onlylocal dbpasswd="password"local data=string.format("%u%s%s%s",info.seed,info.sock:peername(),dbuname,dbpasswd)if pwdhash == ba.crypto.hash("sha512")(data)(true) thenreturn 0 -- Authenticatedendendreturn 6, "Incorrect credentials"end

author: zapta
author_rank: Super Contributor
timestamp: August 05, 2016, 05:34:00 am
content: Quote from: surgeprotector on August 04, 2016, 10:04:31 pmgflater was talking about bypassing the SMQ broker:"I needed point to point communication, MQTT forces me to go through a broker for everything, with SMQ I can send commands/information directly to do the device"