support code, update mqtt driver

please review the few changes.

1 bug fix for query