Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to set up a slave controller?
#7
(2021 Jul 22, 02:05 PM)dan Wrote: Paul,

A method I frequently use to diagnose problems is to start SIP manually:
SSH into the Pi and cd into the SIP directory and stop sip with
Code:
systemctl stop sip3

then start sip from the command line:
Code:
python3 sip.py
When sip starts several lines of information will be printed including any error messages. Pay close attention to the first couple of lines which is where any plugin errors usually appear.

Another useful tool is a MQTT monitoring program. I have used mqtt-spy which is a java based app. Unfortunately I recently upgraded the version of Java on my main computer and now mqtt-spy and a couple of other java based programs refuse to load.

With a tool like mqtt-spy or MQTT Explorer you can subscribe to the topic sip is using and see what is being sent.

Dan

Hi Dan,


Thanks for these suggestions.


I can now get the slave mode to work properly.  In my case, the slave mode works only when I install paho-mqtt via super-user privilege, using sudo prefix:
$ sudo pip3 install paho-mqtt
$ sudo reboot


To check for consistency, I also sudo uninstalled and was able to reproduce the error in slave mode again.  I did one more test cycle of sudo install/uninstall and got consistent behavior.  I repeated the same test on a second sd card and got the same result.  Could you please try and see if you see the same behavior?


$ sudo pip3 uninstall paho-mqtt
$ y # to confirm removal of package
$ sudo reboot # for change to take effect


I did this test on my slave controller only.  The master controller must have been previously sudo installed with paho-mqtt.
If you observe the same behavior, the following might give a clue as to what happens.  I don’t have an explanation.
I followed your tips above about running sip.py manually to help diagnoses.  SIP reports an OSError error 
“OSError: No socket could be created -- (('::', 80, 0, 0): [Errno 13] Permission denied)”
So I ran a sudo prefix (sudo python3 sip.py) and the OSError above went away


pi@raspberrypi:~/SIP $ python3 sip.py
Messge from Signaling plugin!: Just an example!
MQTT plugin couldn't initalize client: [Errno 111] Connection refused
plugins loaded:
  mobile_app
  mqtt
  mqtt_schedule
  mqtt_slave
  plugin_manager
  signaling_examples
  system_update
Starting timing loop
zones changed
[0, 0, 0, 0, 0, 0, 0, 0]

A new day has started.
http://:::80/
Traceback (most recent call last):
  File "sip.py", line 314, in <module>
    app.run()
  File "sip.py", line 232, in run
    return web.httpserver.runsimple(func, (ip, port))
  File "/home/pi/SIP/web/httpserver.py", line 178, in runsimple
    server.start()
  File "/home/pi/SIP/cheroot/server.py", line 1820, in start
    self.prepare()
  File "/home/pi/SIP/cheroot/server.py", line 1779, in prepare
    raise socket.error(msg)
OSError: No socket could be created -- (('::', 80, 0, 0): [Errno 13] Permission denied)
pi@raspberrypi:~/SIP $ sudo python3 sip.py
Messge from Signaling plugin!: Just an exampl!
MQTT publish UP
plugins loaded:
  mobile_app
  mqtt
  mqtt_slave
  plugin_manager
  signaling_examples
  system_update
Starting timing loop

zones changed
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
A new day has started.
zones changed
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]


In summary, I need paho-mqtt to be sudo installed for slave mode to work.  But I don’t know why.

Paul
Reply


Messages In This Thread
how to set up a slave controller? - by paul - 2021 Jul 21, 05:48 PM
RE: how to set up a slave controller? - by dan - 2021 Jul 21, 06:40 PM
RE: how to set up a slave controller? - by paul - 2021 Jul 22, 11:47 AM
RE: how to set up a slave controller? - by dan - 2021 Jul 21, 08:49 PM
RE: how to set up a slave controller? - by dan - 2021 Jul 21, 10:08 PM
RE: how to set up a slave controller? - by dan - 2021 Jul 22, 02:05 PM
RE: how to set up a slave controller? - by paul - 2021 Jul 23, 11:42 AM
RE: how to set up a slave controller? - by dan - 2021 Jul 23, 02:06 PM
RE: how to set up a slave controller? - by paul - 2021 Jul 23, 02:32 PM
RE: how to set up a slave controller? - by paul - 2021 Jul 25, 09:29 AM
RE: how to set up a slave controller? - by dan - 2021 Jul 23, 06:15 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)