[go: nahoru, domu]

Skip to content

Commit

Permalink
Increased wait time for serial response
Browse files Browse the repository at this point in the history
Tested the auto baud selection, firmware version reporting and device
settings confirmation with a JeeLink v3 (rf69cw) on both windows and
linux, I found the serial responses were not consistent causing errors
this was eliminated by increasing the wait times to 2 secs. The
"Jeelink" devices seem to function identically to "rfm2pi". (tested
using RF12demo.12 only)
  • Loading branch information
pb66 committed Sep 6, 2014
1 parent 196919b commit e97bec5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/emonhub_interfacer.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ def __init__(self, name, com_port='/dev/ttyAMA0', com_baud=0):
for com_baud in (57600, 9600):
super(EmonHubJeeInterfacer, self).__init__(name, com_port, com_baud)
self._ser.write("?")
time.sleep(1)
time.sleep(2)
self._rx_buf = self._rx_buf + self._ser.readline()
if '\r\n' in self._rx_buf or '\x00' in self._rx_buf:
self._ser.flushInput()
Expand All @@ -410,7 +410,7 @@ def __init__(self, name, com_port='/dev/ttyAMA0', com_baud=0):
self.info = {}
if self._ser is not None:
self._ser.write("v")
time.sleep(1)
time.sleep(2)
self._rx_buf = self._rx_buf + self._ser.readline()
if '\r\n' in self._rx_buf:
#if self._rx_buf[:4] == "> 0v":
Expand Down

0 comments on commit e97bec5

Please sign in to comment.