WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: python ans ssh ??  (Read 1908 times)

Offline bellad

  • Jr. Member
  • **
  • Posts: 65
python ans ssh ??
« on: October 31, 2014, 05:36:23 AM »
hello,
I do not understand ,

by ssh ( putty ) , i start my prog in python , no errors

Code: [Select]
#!/usr/bin/python
import os.path,csv,time
import RPi.GPIO as GPIO

GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(17, GPIO.OUT)

def trace(b,d,tp):
    hr=time.localtime()[3]
    mn=time.localtime()[4]
    jr=time.localtime()[2]
    mo=time.localtime()[1]
    an=time.localtime()[0]
    he=str(hr)+':'+str(mn)
    da=str(jr)+'/'+str(mo)+'/'+str(an)
    if d == 1:
        tr=b+','+da+','+he+',,'+str(tp)+'\n'
    else:
        tr=b+','+da+',,'+he+','+str(tp)+'\n'
    tra=open('trace.csv','a')
    tra.write(tr)
    tra.close()

def temp(b):
    global t1,tex
    #if os.path.exists('/mnt/1wire/'+b+'/temperature'):
    try:
        fich=open('/opt/1wire/'+b+'/temperature','r')
        t1=float(fich.read())
        fich.close()
    except:
        fich=open('/opt/1wire/'+b+'/temperature','r')
        t1=float(fich.read())
        fich.close()
   
   
while True:

    # relais insert
    b='insert/typeK'
    temp(b)
    if t1 > 60:
        GPIO.output(17,1)
    else:
GPIO.output(17,0)
#d=1
#tp=t1
#trace(b,d,tp)



i want started my prog python by bootlocal.sh
after
 ssh "connection refused"


why??
thank
bellad.flnet.org

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: python ans ssh ??
« Reply #1 on: October 31, 2014, 06:22:24 AM »
ssh server is not running

Show your bootlocal.sh
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline bellad

  • Jr. Member
  • **
  • Posts: 65
Re: python ans ssh ??
« Reply #2 on: October 31, 2014, 07:28:11 AM »
hello bela

thank you for "Show your bootlocal.sh "
i have put cuve.py with sh

now i have put in file.sh and is good

thank
bellad.flnet.org