wiringpi instead of wiringpi2
This commit is contained in:
@ -3,7 +3,7 @@ import datetime
|
|||||||
import RS485Ext
|
import RS485Ext
|
||||||
import RegisterDatapoint
|
import RegisterDatapoint
|
||||||
from pymodbus.client.sync import ModbusSerialClient
|
from pymodbus.client.sync import ModbusSerialClient
|
||||||
import wiringpi2
|
import wiringpi
|
||||||
|
|
||||||
|
|
||||||
ERROR_PIN = 29
|
ERROR_PIN = 29
|
||||||
@ -14,8 +14,8 @@ class CommunicationProcessor(threading.Thread):
|
|||||||
self.config = config
|
self.config = config
|
||||||
self.queue = queue
|
self.queue = queue
|
||||||
self.pubQueue = pubQueue
|
self.pubQueue = pubQueue
|
||||||
wiringpi2.wiringPiSetup()
|
wiringpi.wiringPiSetup()
|
||||||
wiringpi2.pinMode(ERROR_PIN, wiringpi2.OUTPUT)
|
wiringpi.pinMode(ERROR_PIN, wiringpi.OUTPUT)
|
||||||
self.daemon = True
|
self.daemon = True
|
||||||
|
|
||||||
def __getSerial(self):
|
def __getSerial(self):
|
||||||
@ -31,12 +31,12 @@ class CommunicationProcessor(threading.Thread):
|
|||||||
while True:
|
while True:
|
||||||
r = self.queue.get()
|
r = self.queue.get()
|
||||||
try:
|
try:
|
||||||
wiringpi2.digitalWrite(ERROR_PIN, wiringpi2.LOW)
|
wiringpi.digitalWrite(ERROR_PIN, wiringpi.LOW)
|
||||||
print("Dequeued: {0!s}".format(r))
|
print("Dequeued: {0!s}".format(r))
|
||||||
r.enqueued = False
|
r.enqueued = False
|
||||||
r.process(client, self.pubQueue)
|
r.process(client, self.pubQueue)
|
||||||
except RegisterDatapoint.DatapointException as e:
|
except RegisterDatapoint.DatapointException as e:
|
||||||
wiringpi2.digitalWrite(ERROR_PIN, wiringpi2.HIGH)
|
wiringpi.digitalWrite(ERROR_PIN, wiringpi.HIGH)
|
||||||
print("ERROR when processing '{0}': {1!s}".format(r.label, e))
|
print("ERROR when processing '{0}': {1!s}".format(r.label, e))
|
||||||
if client.socket is None:
|
if client.socket is None:
|
||||||
print("renew socket")
|
print("renew socket")
|
||||||
|
Reference in New Issue
Block a user