3
0

esp_uart.py 604 B

1234567891011121314151617181920212223242526272829303132
  1. # demo script zum Testversand einer SMS
  2. import time
  3. from machine import UART
  4. import os
  5. print("warte 5s auf Abbruch ...")
  6. time.sleep(5)
  7. uartOUT = UART(1, baudrate=115200)
  8. uartIN = UART(0,baudrate=115200)
  9. while True:
  10. print("Repl abhängen")
  11. os.dupterm(None,1)
  12. print("AT Kommando senden")
  13. uart.write('ATI\r\n')
  14. print("Repl anhängen")
  15. os.dupterm(UART(0, 115200))
  16. #uart.write('AT+CPIN?\r\n')
  17. #uart.write('AT+CPIN=2389\r\n') # PIN Check
  18. #uart.read(5) # read up to 5 bytes
  19. print("warte 5s ...")
  20. time.sleep(5)
  21. print("-------[ naechster Lauf ]-------")