Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server_startup('mqtt') undefined subroutine? #729

Open
dpatelli opened this issue Aug 26, 2017 · 2 comments
Open

server_startup('mqtt') undefined subroutine? #729

dpatelli opened this issue Aug 26, 2017 · 2 comments

Comments

@dpatelli
Copy link

Attempting to use mh with a mqtt server. Configured using what limited info I could find.

Startup error on &mqtt::server_startup('mqtt'): Undefined subroutine &mqtt::server_startup called at (eval 454) line 1.
at ./mh line 31.
main::ANON('Undefined subroutine &mqtt::server_startup called at (eval 45...') called at (eval 454) line 1
eval '&mqtt::server_startup('mqtt')
;' called at ./mh line 968
main::setup called at ./mh line 7764

@hplato
Copy link
Collaborator

hplato commented Aug 26, 2017 via email

@dpatelli
Copy link
Author

I had included the MQTT dependencies, but did not include any code in /code/mysutff/my.pl. I had found a example/reference about putting something like this into my ./mht file:

    # MQTT stuff
    CODE, require mqtt; #noloop
    #
    CODE, $mqtt_1 = new mqtt('mqtt_1', '192.168.1.21', 1883, 'telemetry/#', "", "", 121);
    #CODE, $mqtt_2 = new mqtt('mqtt_2', 'test.mosquitto.org', 1883, 'home/test/#', "", "", 122);
    #CODE, $mqtt_3 = new mqtt('mqtt_3', '127.0.0.1', 1883, 'home/network/#', "", "", 122); #noloop
    #
    CODE, $CR_Temp = new mqtt_Item($mqtt_1, "home/ha/text/x10/1");
    #CODE, $M2_Temp = new mqtt_Item($mqtt_2, "test.mosquitto.org/test/x10/1");
    #CODE, $M3_Temp = new mqtt_Item($mqtt_3, "home/network/test/x10/1");
    #
    CODE, $CR_Temp->set("On");
    #CODE, $M2_Temp->set("Off");
    #CODE, $M3_Temp->set("On");

I added your example (with changes to point to my mqtt broker) and it seemed to at least connect to the broker. Not sure how it should all work, but I'll keep plugging along.

I've been playing with misterhouse for over 10 years with X10 and am still running an old version which I made a Star Trek LCARS interface for it. Most of my X10 stuff has long died with the exception of motion detectors and thermostat -- Glad to see the project did not die out.

Found light switches which are based on ESP8266s, reflashed with custom code to talk mqtt protocol. Been playing with them for a few months... Was very happy to see mqtt support for the new version of MH, so today I spun up another server and installed, Docs seem to be lacking (or my google-fu failed me) on the mqtt interfacing.

Thank you
Dan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants