The line of code that throws Could not run curl-config: [Errno 2] No such file or directory” when installing pycurl on Linux, should inform the user as to remedy - a pre-requisite, rather than leaving them to test their google skills. A page online is the remedy, and it could have sections like the following for Raspbian GNU/Linux 8 (jessie):
I had to enter my appdaemon docker container and install packages manually. apk add curl-dev python3-dev libressl-dev
After that I just created requirements.txt with pycurl in it. But I’m not 100% sure if thats the correct way on HassOS.
if i have understand apk correct then you dont install with apk add, but you make it available.
the install is done by the requirements file.
but i doubt that they have even apk available in hassio/hassOS/addons.
the problem is that not everything is available for such a slimmed down OS.
just an idea (dont know if its possible and if its worth it)
but you use pycurl for the connection, dont you?
isnt the same thing possible with something like requests?
Installing collected packages: pycurl
Running setup.py install for pycurl: started
Running setup.py install for pycurl: finished with status 'done'
Successfully installed pycurl-7.43.0.2
[cont-init.d] 81-python-packages.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2019-02-14 13:02:42.575306 INFO AppDaemon Version 3.0.2 starting
2019-02-14 13:02:42.576080 INFO Configuration read from: /config/appdaemon/appdaemon.yaml
2019-02-14 13:02:42.579838 INFO AppDaemon: Starting Apps
2019-02-14 13:02:42.589278 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2019-02-14 13:02:42.873772 INFO AppDaemon: HASS: HASS Plugin Initializing
2019-02-14 13:02:42.875057 INFO AppDaemon: HASS: HASS Plugin initialization complete
2019-02-14 13:02:42.876337 INFO Starting Dashboards
2019-02-14 13:02:42.898533 INFO API is disabled
2019-02-14 13:02:42.915773 INFO AppDaemon: HASS: Connected to Home Assistant 0.87.1
2019-02-14 13:02:43.283329 INFO AppDaemon: Got initial state from namespace default
2019-02-14 13:02:45.141222 INFO AppDaemon: Reading config
2019-02-14 13:02:45.148381 INFO AppDaemon: /config/appdaemon/apps/apps.yaml added or modified
2019-02-14 13:02:45.149005 INFO AppDaemon: /config/appdaemon/apps/apps.yaml added or modified
2019-02-14 13:02:45.149590 INFO AppDaemon: App 'hello_world' added
2019-02-14 13:02:45.150527 INFO AppDaemon: Adding /config/appdaemon/apps to module import path
2019-02-14 13:02:45.152064 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/hello.py
2019-02-14 13:02:45.183009 INFO AppDaemon: Initializing app hello_world using class HelloWorld from module hello
2019-02-14 13:02:45.426174 INFO hello_world: Hello from AppDaemon
2019-02-14 13:02:45.429993 INFO hello_world: You are now ready to run Apps!
2019-02-14 13:02:45.432048 INFO AppDaemon: App initialization complete
{
"log_level": "info",
"system_packages": [
"libcurl",
"python3-dev",
"curl-dev",
"gcc",
"g++"
],
"python_packages": [
"pip==19.0.2",
"pycurl"
]
}
Needed latest g++ compiler added. Can remove ‘gcc’ as that gets added anyway
2019-02-14 13:14:33.236980 INFO hello_world: You are now ready to run Apps!
2019-02-14 13:14:33.237597 INFO AppDaemon: Initializing app dahua_mqtt using class DahuaMQTT from module dahua_mqtt
2019-02-14 13:14:33.238487 WARNING AppDaemon: ------------------------------------------------------------
2019-02-14 13:14:33.239081 WARNING AppDaemon: Unexpected error running initialize() for dahua_mqtt
2019-02-14 13:14:33.239631 WARNING AppDaemon: ------------------------------------------------------------
2019-02-14 13:14:33.241850 WARNING AppDaemon: Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/appdaemon/appdaemon.py", line 1581, in init_object
init()
File "/config/appdaemon/apps/dahua_mqtt.py", line 66, in initialize
for camera in self.args["cameras"]:
KeyError: 'cameras'
2019-02-14 13:14:33.242414 WARNING AppDaemon: ------------------------------------------------------------
2019-02-14 13:14:33.244726 INFO AppDaemon: App initialization complete
Seems there is something in the code that might require customisation??
Tryed too: following log
in MQTT FX topic “cameras/dahua/VideoMotion” (I changed “1” to “dahua” in apps.yaml) gives nothing.
Mqtt discovery is enabled.
Maybe I should change topic for Hassio as “homeassistant/cameras/dahua” ?? #MQTT
mqtt:
broker: 192.168.2.162
discovery: true
discovery_prefix: homeassistant
port: 1883
keepalive: 60
username: user
password: mypass
1 question: is that normal that on every HASSIO reboot or AppDaemon restart action , AppDaemon do installation of all mentioned packages again? It takes so much time… Is that normal behaviour?
And some strange happens in logs - on every few restarts it installs pip 10, and pip 19, then uninstall pip 10 etc etc etc.
2019-02-14 17:22:48.604907 INFO AppDaemon Version 3.0.2 starting
2019-02-14 17:22:48.605931 INFO Configuration read from: /config/appdaemon/appdaemon.yaml
2019-02-14 17:22:48.612680 INFO AppDaemon: Starting Apps
2019-02-14 17:22:48.626707 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2019-02-14 17:22:49.185514 INFO AppDaemon: HASS: HASS Plugin Initializing
2019-02-14 17:22:49.187362 INFO AppDaemon: HASS: HASS Plugin initialization complete
2019-02-14 17:22:49.188969 INFO Starting Dashboards
2019-02-14 17:22:49.234088 INFO API is disabled
2019-02-14 17:22:49.288354 INFO AppDaemon: HASS: Connected to Home Assistant 0.86.4
2019-02-14 17:22:51.018971 INFO AppDaemon: Got initial state from namespace default
2019-02-14 17:22:52.697659 INFO AppDaemon: Reading config
2019-02-14 17:22:52.733463 INFO AppDaemon: /config/appdaemon/apps/apps.yaml added or modified
2019-02-14 17:22:52.734208 INFO AppDaemon: /config/appdaemon/apps/apps.yaml added or modified
2019-02-14 17:22:52.734912 INFO AppDaemon: App 'hello_world' added
2019-02-14 17:22:52.735641 INFO AppDaemon: App 'DahuaMQTT' added
2019-02-14 17:22:52.736712 INFO AppDaemon: Adding /config/appdaemon/apps to module import path
2019-02-14 17:22:52.739136 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/hello.py
2019-02-14 17:22:52.807824 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/dahua_mqtt.py
2019-02-14 17:22:52.848050 INFO AppDaemon: Initializing app hello_world using class HelloWorld from module hello
2019-02-14 17:22:53.307600 INFO hello_world: Hello from AppDaemon
2019-02-14 17:22:53.314276 INFO hello_world: You are now ready to run Apps!
2019-02-14 17:22:53.315391 INFO AppDaemon: Initializing app DahuaMQTT using class DahuaMQTT from module dahua_mqtt
2019-02-14 17:22:53.322199 INFO AppDaemon: App initialization complete
2019-02-14 17:22:54.972803 INFO DahuaMQTT: [192.168.2.172] OnDisconnect(Success [])
2019-02-14 17:22:59.997791 INFO DahuaMQTT: [192.168.2.172] OnDisconnect(Success [])
2019-02-14 17:23:05.009103 INFO DahuaMQTT: [192.168.2.172] OnDisconnect(Success [])
2019-02-14 17:23:10.040252 INFO DahuaMQTT: [192.168.2.172] OnDisconnect(Success [])
2019-02-14 17:23:15.049828 INFO DahuaMQTT: [192.168.2.172] OnDisconnect(Success [])
2019-02-14 17:23:20.085555 INFO DahuaMQTT: [192.168.2.172] OnDisconnect(Success [])
2019-02-14 17:23:25.093993 INFO DahuaMQTT: [192.168.2.172] OnDisconnect(Success [])
2019-02-14 17:23:30.123956 INFO DahuaMQTT: [192.168.2.172] OnDisconnect(Success [])
2019-02-14 17:23:35.133519 INFO DahuaMQTT: [192.168.2.172] OnDisconnect(Success [])
2019-02-14 17:23:40.166384 INFO DahuaMQTT: [192.168.2.172] OnDisconnect(Success [])
2019-02-14 17:23:45.174309 INFO DahuaMQTT: [192.168.2.172] OnDisconnect(Success [])
2019-02-14 17:23:50.206354 INFO DahuaMQTT: [192.168.2.172] OnDisconnect(Success [])
2019-02-14 17:23:55.214910 INFO DahuaMQTT: [192.168.2.172] OnDisconnect(Success [])
2019-02-14 17:24:00.261864 INFO DahuaMQTT: [192.168.2.172] OnDisconnect(Success [])
2019-02-14 17:24:05.287968 INFO DahuaMQTT: [192.168.2.172] OnDisconnect(Success [])
2019-02-14 17:24:10.297348 INFO DahuaMQTT: [192.168.2.172] OnDisconnect(Success [])
2019-02-14 17:24:15.330974 INFO DahuaMQTT: [192.168.2.172] OnDisconnect(Success [])
2019-02-14 17:24:20.378761 INFO DahuaMQTT: [192.168.2.172] OnDisconnect(Success [])
2019-02-14 17:24:25.413533 INFO DahuaMQTT: [192.168.2.172] OnDisconnect(Success [])
2019-02-14 17:24:30.424347 INFO DahuaMQTT: [192.168.2.172] OnDisconnect(Success [])
2019-02-14 17:24:35.451889 INFO DahuaMQTT: [192.168.2.172] OnDisconnect(Success [])
2019-02-14 17:24:40.461140 INFO DahuaMQTT: [192.168.2.172] OnDisconnect(Success [])
2019-02-14 17:24:45.490766 INFO DahuaMQTT: [192.168.2.172] OnDisconnect(Success [])
2019-02-14 17:24:50.500577 INFO DahuaMQTT: [192.168.2.172] OnDisconnect(Success [])
2019-02-14 17:24:55.509265 INFO DahuaMQTT: [192.168.2.172] OnDisconnect(Success [])
2019-02-14 17:25:00.534669 INFO DahuaMQTT: [192.168.2.172] OnDisconnect(Success [])
2019-02-14 17:25:05.547380 INFO DahuaMQTT: [192.168.2.172] OnDisconnect(Success [])