stjohnjohnson / smartthings-mqtt-bridge

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

Can't run inside pm2 -- Must be ran as binary #193

Closed zemerick1 closed 5 years ago

zemerick1 commented 5 years ago

If I run the binary by simply calling smartthings-mqtt-bridge -- the bridge will fire up and I'll start seeing events coming though. However, if I use pm2 to start smartthings-mqtt-bridge I see the below output. The server never completely starts. I verified this by checking to see if port 8080 is opened. . which it is not.

0|smartthi | info: Starting SmartThings MQTT Bridge - v3.0.0 0|smartthi | info: Loading configuration 0|smartthi | info: Loading previous state 0|smartthi | info: Perfoming configuration migration 0|smartthi | info: Saving current state 0|smartthi | info: Connecting to MQTT at mqtt://mqtt

If I run as binary with '&' to place it in the background, and tail events.log I see the following: info: Starting SmartThings MQTT Bridge - v3.0.0 info: Loading configuration info: Loading previous state info: Perfoming configuration migration info: Saving current state info: Connecting to MQTT at mqtt://localhost 2019-01-24T21:01:33.169Z - info: Starting SmartThings MQTT Bridge - v3.0.0 2019-01-24T21:01:33.174Z - info: Loading configuration 2019-01-24T21:01:33.206Z - info: Loading previous state 2019-01-24T21:01:33.210Z - info: Perfoming configuration migration 2019-01-24T21:01:33.226Z - info: Saving current state 2019-01-24T21:01:33.240Z - info: Connecting to MQTT at mqtt://localhost info: Configuring autosave

zemerick1 commented 5 years ago

Found out that when running as 'pi' as my current user, it was dumping my config files (defaulted ones) into my home directory. Once I edited those files it came up.