arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
22.25k stars 4.82k forks source link

Connecting Tasmota to IBM cloud #1725

Closed sush0408 closed 6 years ago

sush0408 commented 6 years ago

I was trying to connect Tasmota to IBM IOT platform but the problem is IBM cloud MQTT address is quite long and get snipped off from last.

Actual host address: "XXXXXX.messaging.internetofthings.ibmcloud.com"

after entering this into MQTT configuration the address gets wrong
"XXXXXX.messaging.internetofthings.ibmcloud.com" which is due to 32 char limitation of host address in tasmota firmware.

Is there any workaround to get it working or if anyone has ever connected Tasmota to IBM cloud please help!!

Regards Sushil

ionciubotaru commented 6 years ago

In settings.h try to change this line char mqtt_host[33]; to a greater value. Upload the new sketch, then send reset 2 via serial or web console, then try to connect to IBM cloud.

sush0408 commented 6 years ago

Getting an Error in IBM Logs:

Closed connection from 14.139.194.12. The topic is not valid: iot-2/evt/status/fmt/json/LWT The topic does not match an allowed rule

yozmag commented 6 years ago

I'm having the same issue, did you solved it?

lobradov commented 6 years ago

So, that means you managed to connect but you have some other issue?

On Jan 28, 2018, at 10:35, Sushil Kumar Singh notifications@github.com wrote:

Getting an Error in IBM Logs:

Closed connection from 14.139.194.12. The topic is not valid: iot-2/evt/status/fmt/json/LWT The topic does not match an allowed rule

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

yozmag commented 6 years ago

I just replaced the domain with the ipaddress, but the issue with the topic is very difficult IBM requires strict topic rules, like: Event topic format: iot-2/evt/event_id/fmt/format_string

define PUBLISH_TOPIC "iot-2/evt/status/fmt/json"

define SUBSCRIBE_TOPIC "iot-2/cmd/+/fmt/json"

Where the event_id specifies the event name that is shown in Watson IoT Platform, and format_string is the format of the event, such as JSON. Message format: JSON Watson IoT Platform supports several formats, such as JSON and text. From https://github.com/ibm-watson-iot/device-arduino/blob/master/samples/ESP8266MqttSecure/ESP8266MqttSecure.ino There is a an exemple String payload = "{\"d\":{\"myName\":\"ESP8266.Test5\",\"counter\":"; I don’t think this is doable with tasmota.

miklik72 commented 6 years ago

I have the same problem with long hostname for IBM IoT Watson. It have 45 characters. When I increased char array to 50, Tasmota was not running in ESP and restarted by watchdog.

char mqtt_host[50]; // 1E9

update: I solvet long hostname by using CNAME with own domain.

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 6 years ago

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem.