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

Hue-emulator service won't start #950

Open
350d opened this issue Nov 15, 2023 · 13 comments
Open

Hue-emulator service won't start #950

350d opened this issue Nov 15, 2023 · 13 comments

Comments

@350d
Copy link

350d commented Nov 15, 2023

Issue does not already exist?

I have searched and found no existing issue

Select Environment

Install Script

Home Assistant related?

No

Description

Hello! I have automatic setup on my RPi finished without any errors (except service not running) and I can run manually HueEmulator.py script and access web UI without any problems but my hue-emulator.service won't start and I don't see any errors in service status, just inactive (dead).
sudo systemctl start hue-emulator.service just hangs and nothing happening...

Errorlog:

sudo journalctl -u hue-emulator.service
-- Journal begins at Sun 2023-07-16 16:17:01 EEST, ends at Wed 2023-11-15 00:07:14 EET. --
-- No entries --

Steps to reproduce

Run install script on my RPi. Its hangs on last step - Start service.

Please enter your operating system details here

Raspbian GNU/Linux 11 (bullseye)

What DiyHue version(branch) are you using?

master (latest)

@mariusmotea
Copy link
Member

No errors in syslog? What happens if you execute sudo /opt/hue-emulator/HueEmulator3.py --debug ?

@350d
Copy link
Author

350d commented Nov 16, 2023

image

Can you help me with syslog? How to check it?

@mariusmotea
Copy link
Member

It looks like this is working fine if you start it manually. When executed as service it must log in syslog (most likely /var/log/syslog). Check this file with tail -f /var/log/syslog while you start the service from another console (sudo systemctl start hue-emulator)

@350d
Copy link
Author

350d commented Nov 16, 2023

Nothing in tail -f /var/log/syslog while i start the service...

@mariusmotea
Copy link
Member

try also sudo journalctl -u hue-emulator.service

@350d
Copy link
Author

350d commented Nov 16, 2023

As I've mentioned in my bug report - there is nothing in sudo journalctl -u hue-emulator.service

@350d
Copy link
Author

350d commented Nov 17, 2023

I've tried to comment out all Thread() lines in HueEmulator.py for test service start - doesn't work anyway. How I can check what's wrong with this service script in other way?

@mariusmotea
Copy link
Member

mariusmotea commented Nov 18, 2023

I have no clue why nothing is logged. Have you tried to reinstall the application? Ensure you have the content from here in the systemd service file and do a systemctl daemon-reload to be sure it is applied.

Any exit code specified in the service status?

https://stackoverflow.com/questions/60776373/systemd-service-doesnt-start-silently-how-to-debug

@350d
Copy link
Author

350d commented Nov 18, 2023

I've checked shebang in .py script and I've added absolute path to service file like ExecStart=/usr/bin/python3 /opt/hue-emulator/HueEmulator3.py and tested it before in cli via sudo /usr/bin/python3 /opt/hue-emulator/HueEmulator3.py and still no service start and silent journalctl. How I can add any logger lines like "IM HERE 1111" to the script just for testing?

@Justdigit
Copy link

I guess the Hue Team are closing down this DIY project... I am running the system on older versions... The new versions don't work for me.

@mariusmotea
Copy link
Member

They cannot close the project because Hue Essentials will continue to support it and on Android you can install the last apk version that don't require cloud account.

I guess the Hue Team are closing down this DIY project... I am running the system on older versions... The new versions don't work for me.

@350d
Copy link
Author

350d commented Nov 21, 2023

OK, UPDATE:

I've commented out After line in [Unit] section and service can run now without any problems.

[Unit]
Description=Hue Emulator Service
#After=multi-user.target
...

@mariusmotea
Copy link
Member

mariusmotea commented Nov 22, 2023

There is an issue with your installation because it never reach runlevel 2. Probable more services are not starting...

https://unix.stackexchange.com/questions/404667/systemd-service-what-is-multi-user-target

Unix & Linux Stack Exchange
I have come across a .service that contains the following:

[Install]
WantedBy=multi-user.target
The original .service file can be found HERE.

I am on Ubuntu 16.04LTS.

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

No branches or pull requests

3 participants