/ examples / rockblock_recv_text.py
rockblock_recv_text.py
 1  # pylint: disable=wrong-import-position
 2  import time
 3  
 4  # CircuitPython / Blinka
 5  import board
 6  
 7  uart = board.UART()
 8  uart.baudrate = 19200
 9  
10  # via USB cable
11  # import serial
12  # uart = serial.Serial("/dev/ttyUSB0", 19200)
13  
14  from adafruit_rockblock import RockBlock
15  
16  rb = RockBlock(uart)
17  
18  # try a satellite Short Burst Data transfer
19  print("Talking to satellite...")
20  status = rb.satellite_transfer()
21  # loop as needed
22  retry = 0
23  while status[0] > 8:
24      time.sleep(10)
25      status = rb.satellite_transfer()
26      print(retry, status)
27      retry += 1
28  print("\nDONE.")
29  
30  # get the text
31  print(rb.text_in)