The problem you're encountering has an explanation.
The PushBullet app relies on a custom JavaScript engine that Z-Way developers have extended by adding support for http requests (among other enhancements). I'm pretty sure the code for the JavaScript engine's http request is contained in file /opt/z-way-server/modules/modhttp.so. Making the equivalent http request using the curl command relies on completely different code and libraries. Specifically, Z-Way's http request uses library /usr/lib/arm-linux-gnueabihf/libcurl-gnutls.so.4.7.0 and the curl command uses library /usr/lib/arm-linux-gnueabihf/libcurl.so.4.7.0.
To see the difference, I suggest using tcpdump to capture the packets to/from api.pushbullet.com. Something like the following:
Code: Select all
# tcpdump -i eth0 -n -v -w /tmp/pushbullet.pcap host api.pushbullet.com
Next, transfer the file /tmp/pushbullet.pcap to a computer where wireshark has been installed and open the file using wireshark. This will allow you to see the packets being exchanged. The frustrating part is that although you'll see the problem, I don't think you'll be able to fix the problem yourself. My guess is that the certificate used by api.pushbullet.com is malformed in some way and libcurl-gnutls.so.4.7.0 treats the certificate as a fatal error, while libcurl.so.4.7.0 treats the api.pushbullet.com certificate differently.
If you really want to use PushBullet for notifications, I suggest you modify the index.js for the app and change the url to
http://127.0.0.1:8000/pushbutton.py. Next, run a python webserver on port 8000 with cgi-bin enabled (/usr/bin/python3 -m http.server --cgi 8000) and create a file cgi-bin/pushbutton.py to read the content data. Something like the following:
Code: Select all
data = ""
if int(os.environ.get('CONTENT_LENGTH', 0)) != 0:
for i in range(int(os.environ.get('CONTENT_LENGTH', 0))):
data += sys.stdin.read(1)
Once you have the data from the hacked pushbutton app via the python web server in the pushbutton.py file, you can use the curl command to api.pushbullet.com.
Yeah, it's a workaround. For what it's worth, I try to avoid adding unnecessary complexity to Z-Way processing by moving functionality to a local python cgi script.