I am integrating the blues modem now into my bigger project.
It runs for a few minutes and then generates the following error:
Traceback (most recent call last):
File "/home/pi/.local/lib/python3.7/site-packages/periphery/i2c.py", line 135, in transfer
fcntl.ioctl(self._fd, I2C._I2C_IOC_RDWR, i2c_xfer, False)
OSError: [Errno 121] Remote I/O error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pi/python/20210416/dispatcher3.py", line 468, in fifteen_sec_updates
rsp = card.Transaction(req)
File "/home/pi/.local/lib/python3.7/site-packages/notecard/notecard.py", line 289, in Transaction
self.i2c.transfer(self.addr, msgs)
File "/home/pi/.local/lib/python3.7/site-packages/periphery/i2c.py", line 137, in transfer
raise I2CError(e.errno, "I2C transfer: " + e.strerror)
periphery.i2c.I2CError: [Errno 121] I2C transfer: Remote I/O error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pi/python/20210416/dispatcher3.py", line 519, in <module>
fifteen_sec_updates()
File "/home/pi/python/20210416/dispatcher3.py", line 474, in fifteen_sec_updates
print(rsp)
UnboundLocalError: local variable 'rsp' referenced before assignment
The error is triggered from:
try:
req = {"req" :"note.add"}
req["file"] = "vstdata.qo"
req["sync"] = True
req["body"] = to_modem
rsp = card.Transaction(req)
except:
print('No response from modem. Will keep trying...')
print(rsp)
The modem is setup with this:
from periphery import I2C
import notecard
productUID = "com.xxxxx.yyyyyyy:zzzzzzz"
port = I2C("/dev/i2c-1")
card = notecard.OpenI2C(port,0,0)
req = {"req": "hub.set"}
req["product"] = productUID
req["mode"] = "continuous"
req["sync"] = True
req["outbound"] = 15
rsp = card.Transaction(req)
Which does work and gives me no errors. I had gone back and forth a couple of weeks ago with @RobLauer who was very helpful in getting the modem setup.
I think I am losing connection and then the internal note buffer is getting filled up. My questions are:
- how can I check for this?
- how can I possibly delete notes that are queued up (If this is the cause)?
- how can I check if the modem is not connected and possibly trap this error so that I can buffer the items and resend later when the modem is online?
Thanks,
Todd