Python Forum
Python code with serial port and global undefined
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python code with serial port and global undefined
#11
# class to hold read and write
#!/usr/bin/env python
 
import serial
import logging
import time, datetime
from firebase import firebase
from firebase_token_generator import create_token
from apscheduler.schedulers.blocking import BlockingScheduler
 
class AIHome:
 
def __init__(self, onTime, offTime):
 
self.onTime=onTime
self.offTime=offTime
self.updateInterval = 6
self.webPush = False
self.relayStatesA = []
self.relayStatesD = {}
logging.basicConfig()
#Call fetchUpdate every 6 hours
 
print('initting AIHome...scheduling job')
sched = BlockingScheduler()
@sched.scheduled_job('interval', hours=1)
def timed_job():
print('This job runs every 6 hrs. timed_job gets called or something else')
#call fetchUpdate()
self.fetchUpdate();
 
sched.configure()
#options_from_ini_file
sched.start()
Well it didnt work. But then again I copied from my previous post, so Ill try doing it from TW.
Reply


Messages In This Thread
RE: Python code with serial port and global undefined - by marciokoko - Jan-17-2017, 01:43 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Waiting for input from serial port, then move on KenHorse 3 1,364 Apr-17-2024, 07:21 AM
Last Post: DeaD_EyE
  MCU reboots after opening Serial port when ran from Raspberry PI zazas321 3 575 Mar-19-2024, 09:02 AM
Last Post: zazas321
  pyserial/serial "has no attribute 'Serial' " gowb0w 9 5,325 Aug-24-2023, 07:56 AM
Last Post: gowb0w
  Python error on mentioned Arduino port name dghosal 5 939 Aug-22-2023, 04:54 PM
Last Post: deanhystad
  Why Pip is not listed in the official Global Python Module index? quazirfan 2 825 Apr-21-2023, 10:55 AM
Last Post: snippsat
  Serial Port As Global Prasanjith 2 1,632 Mar-23-2023, 08:54 PM
Last Post: deanhystad
  Python Serial: How to read the complete line to insert to MySQL? sylar 1 892 Mar-21-2023, 10:06 PM
Last Post: deanhystad
  undefined function error JonWayn 5 1,563 Sep-11-2022, 03:38 AM
Last Post: JonWayn
  Undefined Led_Zeppelin 4 1,513 Aug-02-2022, 11:57 AM
Last Post: buran
  python serial port barryjo 2 1,736 Dec-27-2021, 11:09 PM
Last Post: barryjo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020