hrbonz / python-aqi

A library to convert between AQI value and pollutant concentration (µg/m³ or ppm)
BSD 3-Clause "New" or "Revised" License
60 stars 28 forks source link

Run fine with command line, but not when crontab #14

Closed europacafe closed 4 years ago

europacafe commented 4 years ago

Thank you for providing this excellent function. I run the following command on terminal, and it produced the aqi value without problem:

aqi aqi.algos.epa pm25:64

Put the same command in a bash script and manually run it on terminal, it also gave the result. But when running the same script with crontab, every minute, no result at all. The actual script that include the aqi command is to publish it to my mqtt server, and the aqi topic did not show up. I ran the same script manually on terminal, the mqtt can publish the aqi value without problem' platform: ubuntu 18.04, python 2.7 on intel minipc

europacafe commented 4 years ago

Resolved. Running under crontab, I need to put the full path of aqi command which is /usr/local/bin/aqi ......