Simple Serial Monitor Script for Raspberry PI

Simple Serial Monitor Script for Raspberry PI

Since we started prototyping with our ESP8266EX modules, we found that the simplest way to control/debug is using a Raspberry PI (IO Voltage compatible with ESP8266EX).

Since the module outputs serial data (via ESP_DBG statement), you can monitor it using a simple python script (that logs the data too)


#!/usr/bin/python2.7
import serial
import sys

ser = serial.Serial('/dev/ttyAMA0', 115200)

f = open('esp.log','w')
while 1:
   x=ser.read()
   sys.stdout.write(x)
   sys.stdout.flush
   f.write(x)

Be aware that you will have to enable serial input/out for Raspberry Pi (disable console output).

Vastaa

Sähköpostiosoitettasi ei julkaista. Pakolliset kentät on merkitty *