stjohnjohnson / smartthings-mqtt-bridge

Bridge between SmartThings and MQTT
https://hub.docker.com/r/stjohnjohnson/smartthings-mqtt-bridge/
MIT License
363 stars 241 forks source link

Getting unexpected error in smart app #85

Open ScottChapman opened 7 years ago

ScottChapman commented 7 years ago

OK, I think I got everything installed and running on my raspberry pi. The app says it is listening on port http://localhost:8080

So, in the device I enter the IP address of my PI, port 8080, and the HW MAC address of wlan0

But when I run the smart app, select one of my switches, and the MQTT Bridge device I just get "Unexpected error" in the smart app.

Any ideas?

xtreme22886 commented 7 years ago

tldr: If you're using a wired connection, try using your wireless connection instead?

I just had this issue and was able to figure it out. Are you by chance using both a wired and wireless connection on the Raspberry Pi, or maybe just a wired connection?

I was having this same issue with the app and the service was starting and listing just like yours. I noticed it was saying localhost and with my pi I'm using both a wired and wireless connection (my home network is overly complex). I wanted to tell this bridge to listen on a specific IP address/interface but couldn't find a way to do that. I figured maybe instead of using my wired pi IP and MAC which is on the same subnet as my SmartThings hub, I'd try to use the IP and MAC from my pi's wireless connection which connects to another subnet on my network (i told you it's overly complex :). *I allow traffic from these two subnets to talk to each other on my firewall). To my surprise, once I configured the smarthings bridge device to use my pi's wireless IP address and MAC address for that interface, it started working. Doesn't make sense to me but hey, it's working now :)

wkethman commented 6 years ago

I am also having this issue

@ScottChapman did you figure this out? @stjohnjohnson just flagging if you have any suggestions

stjohnjohnson commented 6 years ago

Do you have any logs from the SmartThings console? Either for the device or smart app?

jfeulner commented 6 years ago

Interestingly enough, I was getting the same issue. The way I solved the issue was watching the Live logging for the device. After doing so, I noticed the log stated its Device Network ID.

image

In the App, I did not close out, I left the error open and then in the SmartThings IDE, I copied the Device Network ID from the logs, and then I edited the Device I created in the "My Devices Tab"

When I created the device I had created the device with a network ID as 999, I did not create it empty. This may have been the cause. Once I replaced the network ID, all was right with the world. Hope this helps @wkethman @ScottChapman

image

kenthua commented 6 years ago

I found this issue occurred for me as well.

While trying to save in the SmartApp, it was spinning when I clicked Save and I eventually got the "Sorry, but there was an unexpected error". I believe there was an "Error saving page" as well. Any case I noticed the smartapp listed on my mqtt bridge device settings.

It was just kinda sitting there until, through the Web UI, "My Location" -> smartapps (under Installed SmartApps) -> Other -> MQTT Bridge (dev) -> click update

My MQTT Bridge device "Device Network ID" was my arbitrary entry, until I clicked the "update" button, it changed the mac address ID of my bridge container on port 8080.

After that all the communication started to occur.

profesaurus commented 6 years ago

@jfeulner Thank you! This worked for me.