Simple Serial Monitor Script for Raspberry PI

/ November 20, 2014/ IoT News&Updates/ 0Kommentare

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).

Hinterlasse eine Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht.

Sie sollten das verwenden HTML Schlagworte und Attribute: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>