rphughespa / mqtt-lcp

Layout Control Protocol - appying MQTT to model railroad layout control
MIT License
6 stars 0 forks source link

Syntax Error when starting up mqtt-supervisor #2

Open etxbct opened 1 year ago

etxbct commented 1 year ago

I've been running mqtt-supervisor on my mqtt-broker with no problem, which is an raspberry Pi. Now I've downloaded the latest and installed the "mqtt-supervisor-2022-05-10.tgz" file

I have followed the setup-pi.txt first time I installed. Now I've changed the content in /etc/crontab from @reboot pi cd /home/pi/mqtt-lcp/mqtt-supervisor && python3 main.py & to @reboot pi cd /home/pi/mqtt-lcp/mqtt-supervisor/app && python3 mqtt-supervisor & and also tried @reboot pi cd /home/pi/mqtt-lcp/mqtt-supervisor && python3 app/mqtt-supervisor &

but it is not starting after booting the pi.

When manually try to start from ~/mqtt-lcp/mqtt-supervisor which gave:

pi@mqtt-broker:~/mqtt-lcp/mqtt-supervisor $ python3 app/mqtt-supervisor &
[2] 726
[1]   Avslut 127              pyton3 app/mqtt-supervisor
pi@mqtt-broker:~/mqtt-lcp/mqtt-supervisor $ Traceback (most recent call last):
  File "app/mqtt-supervisor", line 36, in <module>
    from processes.process_utils import ProcessSupervisor
ImportError: No module named 'processes'
[2]+  Avslut 1                python3 app/mqtt-supervisor

I also tried to start from ~/mqtt-lcp/mqtt-supervisor/app which gave:

pi@mqtt-broker:~/mqtt-lcp/mqtt-supervisor $ cd app
pi@mqtt-broker:~/mqtt-lcp/mqtt-supervisor/app $ python3 mqtt-supervisor &
[1] 727
pi@mqtt-broker:~/mqtt-lcp/mqtt-supervisor/app $ Traceback (most recent call last):
  File "mqtt-supervisor", line 36, in <module>
    from processes.process_utils import ProcessSupervisor
  File "../lib/processes/process_utils.py", line 64
    return f"{self.__class__}({fdict})"
                                      ^
SyntaxError: invalid syntax

[1]+  Avslut 1                python3 mqtt-supervisor

/BR Benny

rphughespa commented 1 year ago

Benny,

Looks like the app can’t find the lib folder. When you are at "mqtt-supervisor/app” can you see the library code at “ls ../lib/processes”?

Your email reminded me that I have not updated the code out on GitHub in a very long time. Give me a week or so and I will post the current code base. Things have changed a bit,

Richard

On Mar 18, 2023, at 09:12, Benny Tjäder @.***> wrote:

I've been running mqtt-supervisor on my mqtt-broker with no problem, which is an raspberry Pi. Now I've downloaded the latest and installed the "mqtt-supervisor-2022-05-10.tgz" file

I have followed the setup-pi.txt first time I installed. Now I've changed the content in /etc/crontab from @reboot https://github.com/reboot pi cd /home/pi/mqtt-lcp/mqtt-supervisor && python3 main.py & to @reboot https://github.com/reboot pi cd /home/pi/mqtt-lcp/mqtt-supervisor/app && python3 mqtt-supervisor & and also tried @reboot https://github.com/reboot pi cd /home/pi/mqtt-lcp/mqtt-supervisor && python3 app/mqtt-supervisor &

but it is not starting after booting the pi.

When manually try to start from ~/mqtt-lcp/mqtt-supervisor which gave:

@.:~/mqtt-lcp/mqtt-supervisor $ python3 app/mqtt-supervisor & [2] 726 [1] Avslut 127 pyton3 app/mqtt-supervisor @.:~/mqtt-lcp/mqtt-supervisor $ Traceback (most recent call last): File "app/mqtt-supervisor", line 36, in from processes.process_utils import ProcessSupervisor ImportError: No module named 'processes' [2]+ Avslut 1 python3 app/mqtt-supervisor I also tried to start from ~/mqtt-lcp/mqtt-supervisor/app which gave:

@.:~/mqtt-lcp/mqtt-supervisor $ cd app @.:~/mqtt-lcp/mqtt-supervisor/app $ python3 mqtt-supervisor & [1] 727 @.***:~/mqtt-lcp/mqtt-supervisor/app $ Traceback (most recent call last): File "mqtt-supervisor", line 36, in from processes.process_utils import ProcessSupervisor File "../lib/processes/process_utils.py", line 64 return f"{self.class}({fdict})" ^ SyntaxError: invalid syntax

[1]+ Avslut 1 python3 mqtt-supervisor /BR Benny

— Reply to this email directly, view it on GitHub https://github.com/rphughespa/mqtt-lcp/issues/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/APWGFRXVIPHHHJFU5PY5UGTW4WYEXANCNFSM6AAAAAAV7O5N6Q. You are receiving this because you are subscribed to this thread.

etxbct commented 1 year ago

Hi, yes I can see the content with that ls command.

pi@mqtt-broker:~/mqtt-lcp/mqtt-supervisor $ cd app
pi@mqtt-broker:~/mqtt-lcp/mqtt-supervisor/app $ ls -l ../lib/processes/
totalt 80
-rw-r--r-- 1 pi pi 36451 maj 10  2022 base_mqtt_process.py
-rw-r--r-- 1 pi pi 12820 maj 10  2022 base_process.py
-rw-r--r-- 1 pi pi  4671 maj 10  2022 log_process.py
-rw-r--r-- 1 pi pi  9085 maj 10  2022 mqtt_process.py
-rw-r--r-- 1 pi pi  6339 maj 10  2022 process_utils.py
pi@mqtt-broker:~/mqtt-lcp/mqtt-supervisor/app $

When I try to start the mqtt-supervisor from the app directory I get error in one of the process files

pi@mqtt-broker:~/mqtt-lcp/mqtt-supervisor $ cd app
pi@mqtt-broker:~/mqtt-lcp/mqtt-supervisor/app $ python3 mqtt-supervisor &
[1] 727
pi@mqtt-broker:~/mqtt-lcp/mqtt-supervisor/app $ Traceback (most recent call last):
  File "mqtt-supervisor", line 36, in <module>
    from processes.process_utils import ProcessSupervisor
  File "../lib/processes/process_utils.py", line 64
    return f"{self.__class__}({fdict})"
                                      ^
SyntaxError: invalid syntax

[1]+  Avslut 1                python3 mqtt-supervisor

/Benny

rphughespa commented 1 year ago

Benny,

I uploaded my current code base. Please download and try the new code. Oh, check the utils fold for an updated install info document.

richard

etxbct commented 1 year ago

Hi, I've downloaded the new version and after I've installed the superviser I run into same error. I did the installation on another Pi I had and it worked on that Pi. The difference was the version of raspian. I have now upgrade the first Pi to same version of raspbian (buster) and it is now working on both.

/Benny