sully
New Member
Posts: 9
|
Post by sully on Apr 10, 2018 12:03:17 GMT -8
Hi All,
Not sure if anybody else has had the same problem.
I have the weather rack attached to the weather board, i have successfully sent the data from the RPi to the Azure platform.
My issue is that when i manually call the python program it works, but when i schedule the program using crontab i get an error with the ADS1x15 import in the weather rack program.
The error is:
from Adafruit_ADS1x15 import ADS1x15
ImportError: No module named Adafruit_ADS1x15
Why would this module imports work when manually running the program but not via crontab.
Any help would be appreciated.
Kevin
|
|
|
Post by SDL on Apr 10, 2018 13:04:49 GMT -8
Kevin,
This has something to do with the way crontab uses the initial directory for running the program. It isn't finding the directory. Take a good look at the crontab manual files and on the web.
Question: Why are you using Crontab to start GroveWeatherPi? Are you running it periodically? Hope you are killing the running instances if you are.
BP
|
|
sully
New Member
Posts: 9
|
Post by sully on Apr 10, 2018 13:34:10 GMT -8
Hi BP,
I am not using your software directly, i have created my own python code to utilise the weather rack and weather board and send data to the Azure cloud platform. Before i purchased the weather rack i was sending data to Azure by using BME280 sensor, the crontab was used to start my azure program on reboot. I got the weather rack sensors installed and all working and sending data to Azure by manually calling the python code. But when i rebooted the RPi, the python code had the errors described above when the crontab tried to launch it from a reboot.
Are you saying that i need to specify the path of the ADS1x15 within the weather rack software?
Kevin
|
|
|
Post by SDL on Apr 10, 2018 14:12:06 GMT -8
That is excellent! When you get this put together, we would love it if you would write a guest blog for us on your project.
Yes, you do need to specify the path.
Here is the command to programmatically modify pythons path searching:
sys.path.append('./SDL_Pi_SSD1306')
Note that this is not the path for you, it is just an example.
BP
|
|
sully
New Member
Posts: 9
|
Post by sully on Apr 11, 2018 22:49:44 GMT -8
Hi BP,
Sorted it now, just needed to amend the sys.path.append to the correct path where the ADS1x15 lived.
I am currently doing this project as part of my BSc Computer Science capstone project. Will be happy to share how I configured the system to report to MS Azure. In all fairness, the hardware is not really part of the project; the main part of the project is utilising cloud technologies to capture data, store and then present as a view i.e. web page. The cherry on the bakewell is the use of predictive analytics, using machine learning to forecast if a rain shower event will happen in the next 24 hrs. Taking that forward, the system could then also forecast other events such as snow or even a sunny day.
Have you got another way for me to contact you directly i.e. email address (kevin.sullivan10@sky.com) so i can share this project once i have finished.
Kevin
|
|
|
Post by SDL on Apr 12, 2018 15:55:25 GMT -8
Woohoo! We would love that. Could we publish it as a blog article? That would be cool.
Our CTO, Dr. John Shovic also is a professor of Computer Science at the University of Idaho in Coeur d'Alene. He will be in charge of CS capstone projects next year.
I'll PM you his email address.
BP
|
|