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

mqtt_reconnect #13

Open
dst6se opened this issue Dec 3, 2022 · 9 comments
Open

mqtt_reconnect #13

dst6se opened this issue Dec 3, 2022 · 9 comments

Comments

@dst6se
Copy link

dst6se commented Dec 3, 2022

Hi !

If I restart the mosquitto server, i have to restart the container to control my devices again .

@dst6se
Copy link
Author

dst6se commented Dec 4, 2022

Hi !

If I restart the mosquitto server, i have to restart the container to control my devices again .

Fixed by editing this part of main.py

See pulll request for more info

@Mastiffen
Copy link

@dst6se If you still get this, I would very much like to use your version in my system. But I'm not sure how to implement it, and there is no issue page on your fork. Can you please let me how I do that? I can build, I'm not sure what to build. It stops on this:

`git submodule update --init
Cloning into '/home/pi/telldus-core-mqtt/telldus'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:mliljedahl/telldus.git' into submodule path '/home/pi/telldus-core-mqtt/telldus' failed
Failed to clone 'telldus'. Retry scheduled
Cloning into '/home/pi/telldus-core-mqtt/telldus'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:mliljedahl/telldus.git' into submodule path '/home/pi/telldus-core-mqtt/telldus' failed
Failed to clone 'telldus' a second time, aborting
`

@dst6se
Copy link
Author

dst6se commented Oct 14, 2023

@dst6se If you still get this, I would very much like to use your version in my system. But I'm not sure how to implement it, and there is no issue page on your fork. Can you please let me how I do that? I can build, I'm not sure what to build. It stops on this:

`git submodule update --init Cloning into '/home/pi/telldus-core-mqtt/telldus'... [email protected]: Permission denied (publickey). fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists. fatal: clone of '[email protected]:mliljedahl/telldus.git' into submodule path '/home/pi/telldus-core-mqtt/telldus' failed Failed to clone 'telldus'. Retry scheduled Cloning into '/home/pi/telldus-core-mqtt/telldus'... [email protected]: Permission denied (publickey). fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists. fatal: clone of '[email protected]:mliljedahl/telldus.git' into submodule path '/home/pi/telldus-core-mqtt/telldus' failed Failed to clone 'telldus' a second time, aborting `

Hi , the easy way is to just copy my modified main.py to the docker
ex
docker cp ./main.py telldus:/usr/src/telldus-core-mqtt/

@Mastiffen
Copy link

Fantastic, and such a quick answer! Thank you very much! Appreciate it!

@dst6se
Copy link
Author

dst6se commented Oct 14, 2023

Fantastic, and such a quick answer! Thank you very much! Appreciate it!

NP, hope it works well. For my it is rock solid :)

Thanks

Danne

@Mastiffen
Copy link

Mastiffen commented Oct 14, 2023

Yep, it does work well, but I am having a bit of a problem copying to the container, it is not stored from run to run. I had to have the container running and use this command:

docker cp ./main.py tellstick:/usr/src/telldus-core-mqtt/

I call the container tellstick, not telldus, but that shouldn't matter. When I do the copy, I can do this:

docker exec tellstick cat /usr/src/telldus-core-mqtt/main.py

That shows me what the file contains. I changed "humidity" to "fuktighet" in line 19 to have an easy way of seeing if the copy stuck:

const.TELLSTICK_HUMIDITY: 'fuktighet',

But that's back to "humidity" on the next run.

@dst6se
Copy link
Author

dst6se commented Oct 14, 2023

Yep, it does work well, but I am having a bit of a problem copying to the container, it is not stored from run to run. I had to have the container running and use this command:

docker cp ./main.py tellstick:/usr/src/telldus-core-mqtt/

I call the container tellstick, not telldus, but that shouldn't matter. When I do the copy, I can do this:

docker exec tellstick cat /usr/src/telldus-core-mqtt/main.py

That shows me what the file contains. I changed "humidity" to "fuktighet" in line 19 to have an easy way of seeing if the copy stuck:

const.TELLSTICK_HUMIDITY: 'fuktighet',

But that's back to "humidity" on the next run.

You are right !
I forgot to mention this

In my script when i start the container i do like this

docker run -d
--name telldus
--restart=unless-stopped
-e TDM_MQTT_SERVER=192.168.166.30
-e TDM_MQTT_PORT=1884
-e TDM_MQTT_USER=telldus_mqtt
-e TDM_MQTT_PASS=pass
-v /media/Media/docker_data/telldus/conf/tellstick.conf:/etc/tellstick.conf:ro
--device=/dev/bus/usb:/dev/bus/usb:rwm
mliljedahl/telldus-core-mqtt:latest

so

-v /media/Media/docker_data/telldus/conf/main.py:/usr/src/telldus-core-mqtt/main.py:ro \

Point out the file to your config dir , and should never go back to the orginal one !

@Mastiffen
Copy link

Brilliant, thank you again! I added #Tors versjon to the end of that main.py so I didn't have to scroll up to find the telltale signs, and that works now! Thanks again! This container is actually something I've been looking for a long time, so I can get all my Pi's from Stretch and up to Bullseye, and I can use it on a bunch of other Pi's that are already on Bullseye, where I had to drop it. I bought a bunch of Tellstick Duo's cheap a few years ago, when Stretch was still the version in use. :-D

@Mastiffen
Copy link

Mastiffen commented Jan 8, 2024

@dst6se I have one problem with this thing, and since you seem to know your stuff much, much better than me: A certain type of Oregon sensors sometimes send a totally wrong value. I could correct that if I was able to send the "model" info on MQTT, or even everything that it shows in the debug window. The wrong values comes when the sensor, which has a hygrometer, sends one burst without the hygrometer value, then the temperature value is wrong as well. I can see the sensors F824 type when I run docker compose up without the -d option, so I know it's in there somewhere. I just have no idea how to get it out! If you could help me that would be great, Danne!

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