Autostart in background / Docker image #5
-
Hi! With "python -m TheengsGateway" from terminal works like a charm. If I close the window, publishing finishes (the TG runs on raspbian ). Is there an easy way for autostart and working in background without live terminal? Possible to dockerize this whole thing? |
Beta Was this translation helpful? Give feedback.
Replies: 11 comments 40 replies
-
Hi, Here is some methods for this: I will be happy to have your feedback on these different methods (or another). |
Beta Was this translation helpful? Give feedback.
-
Also just to know which models are compatible with TheengsGateway could you share your Raspberry Pi model please? |
Beta Was this translation helpful? Give feedback.
-
This works for me on a Raspberry Pi 4: Install TheengsGateway as root (see later for why this is):
Then create this systemd service script in
Use your host, username and password for the MQTT broker. Then reload the service files and start and enable the system service:
Check whether the gateway is running:
Check the logs if something's wrong:
It should also be possible to adapt this to run as a non-root user (and then you can install the TheengsGateway package as a non-root user too), but I'll have to try this first. |
Beta Was this translation helpful? Give feedback.
-
host : ip_broker:1883 ? So I can write the script like this ? |
Beta Was this translation helpful? Give feedback.
-
but I think it comes from further upstream of the script I have a Proxmox debian 11 light VM |
Beta Was this translation helpful? Give feedback.
-
I just installed bluez I resumed the process it works on debian 10 or 11 ? then it is said to do but it's not rather |
Beta Was this translation helpful? Give feedback.
-
I just made the order and here is the rendering On my machine I believe it's python3 by default I want to start from scratch with a fresh VM |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
It is possible to run Theengs in docker.
Keep in mind, that you have to run it in privileged mode, mount dbus, config dir and with network: host. |
Beta Was this translation helpful? Give feedback.
-
@pnieweglowski @1technophile I've created an HA add-on, but It doesn't seem to scan for BLE devices. |
Beta Was this translation helpful? Give feedback.
-
In case it helps anyone in the situation I found myself in, koenvervloesem wrote :
I had already installed everything as user Pi and only later decided to create a daemon to start on boot. The adaptation required was to add User=pi in [service] i.e.
I'm not sure if the Environment needed to be set but I'd already found that and set it to be sure. |
Beta Was this translation helpful? Give feedback.
This works for me on a Raspberry Pi 4:
Install TheengsGateway as root (see later for why this is):
Then create this systemd service script in
/etc/systemd/system/TheengsGateway.service
:Use your host, username and password for the MQTT broker.
Then reload the service files and start and enable the system service:
Check whether the gateway is running: