I’m not understanding the serial interface to the Notecard on Raspberry Pi with Pi Carrier.
Expanding on this basic question I have, what is the relationship between the Notecard’s serial interface via the 40 pin I/O connector and the USB connector on the Pi Carrier?
Thanks!
https://dev.blues.io/tools-and-sdks/python-library/
The code below fails on both these ports:
/dev/serial0
/dev/ttyAMA0
equivalent I2C code works fine.
I have the ‘serial txrx’ switch in the on position on the Pi Carrier board.
Configured serial to not be console, but serial hardware enabled in raspi-config.
No difference if code is run as root or not.
#!/usr/bin/env python3
# serial_test.py
# 202106091413
#
# testing blues wireless card on raspberry pi
# using serial interface
import time
import sys
import notecard
from periphery import Serial
port = Serial("/dev/ttyAMA0", 9600)
card = notecard.OpenSerial(port)
print(card)
req = {"req": "card.status"}
rsp = card.Transaction(req)
print(rsp)
program output:
pi@pi-mod-2b-v1:~/blues_wireless $ sudo ./serial_01.py
Traceback (most recent call last):
File "./serial_01.py", line 16, in <module>
card = notecard.OpenSerial(port)
File "/usr/local/lib/python3.7/dist-packages/notecard/notecard.py", line 219, in __init__
super().__init__()
File "/usr/local/lib/python3.7/dist-packages/notecard/notecard.py", line 164, in __init__
self.Reset()
File "/usr/local/lib/python3.7/dist-packages/notecard/notecard.py", line 204, in Reset
serialReset(self.uart)
File "/usr/local/lib/python3.7/dist-packages/notecard/notecard.py", line 104, in serialReset
raise Exception("Notecard not responding")
Exception: Notecard not responding