Sending data to COSM program stopping

Talk about Adafruit Raspberry Pi® accessories!

Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Sending data to COSM program stopping

Postby egutting » Fri Nov 16, 2012 8:27 am

Hello, I was able get the RPi to read the temp and send it in, but after about 2 hours the python program seems to stop. Is this normal?
Thanks!
egutting
 
Posts: 8
Joined: Tue Nov 13, 2012 11:57 pm

Re: Sending data to COSM program stopping

Postby svinzant » Fri Nov 16, 2012 12:59 pm

I was doing something similar with this tutorial and having a similar problem. I was able to keep the script running for 24 to 30 hours before I needed to restart it.
I eventually took the "While (True)" part of the loop out of the code and set up a cron job to run every minute and execute the code. Check out this feed. Or my dashboard.
Scott
svinzant
 
Posts: 17
Joined: Mon May 16, 2011 1:30 pm

Re: Sending data to COSM program stopping

Postby egutting » Fri Nov 16, 2012 11:21 pm

That worked great! Thanks!
egutting
 
Posts: 8
Joined: Tue Nov 13, 2012 11:57 pm

Re: Sending data to COSM program stopping

Postby e024576 » Mon Dec 17, 2012 9:43 pm

Regarding "I eventually took the "While (True)" part of the loop out of the code and set up a cron job to run every minute and execute the code." Can you say a little more about setting up a cron job. Here's the command that I enter from the command line which does work: "sudo /home/pi/python/oneshot-cosm-temp.py" To define the cron job I entered "crontab -e" and then put in a single line

* * * * * root home/pi/python/oneshot-cosm-temp.py

The result is - no error messages, but nothing is written to my screen nor sent to cosm. So as far as I can tell, my cron job does nothing

Any ideas?

thanks
e024576
 
Posts: 6
Joined: Thu Jan 05, 2012 4:04 pm

Re: Sending data to COSM program stopping

Postby svinzant » Wed Dec 19, 2012 3:32 pm

e024576,
I am at work right now.
Once I get home, I will look over my notes and see if I can shed some light on your question.
Scott
svinzant
 
Posts: 17
Joined: Mon May 16, 2011 1:30 pm

Re: Sending data to COSM program stopping

Postby svinzant » Wed Dec 19, 2012 11:16 pm

e024576,
Sorry I didn't get back to you sooner. I got busy with a few things, then forgot all about replying...
So, here is what I can tell you:
I created a small script called Get_Temp.sh that looks like this:
Code: Select all
cd Adafruit-Raspberry-Pi-Python-Code/Adafruit_DHT_Driver
sudo ./DHT_Temp.py

DHT_Temp.py is my hacked up Python program that I discussed up above.

For my crontab setup, it looks like this:
Code: Select all
* * * * * sudo ./Get_Temp.sh


I am no Linux expert, I'm sure I have not done things they way the Linux "purists" would like to see them done.
But, I do know it works!
I hope this helps... If not, ask more questions!
Scott
svinzant
 
Posts: 17
Joined: Mon May 16, 2011 1:30 pm


Return to Adafruit Raspberry Pi® accessories

Who is online

Users browsing this forum: No registered users and 1 guest

Stuff to buy from the Adafruit store and links to product documentation!


New Products [114]

Raspberry Pi[82]
 
FLORA[24]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[12]
Arduino[60]
 
NETduino[14]
 
BeagleBone[23]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[39]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[9]


 
Breakout Boards[35]
LCDs & Displays[49]
Components & Parts[70]
Batteries & Power[54]
EL Wire/Tape/Panel[52]
LEDs[112]
 
Wireless[16]
Cables[66]
 
Lasers[6]
Sensors/Parts[147]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[70]
 
iDevices[13]
Tools[71]
 
Wearables[41]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[25]


 
Stickers[41]
 
Skill badges[55]
 
Books[26]
 
Circuit Playground[7]
 
Gift Certificates[4]