Have trouble reading from the signal from /dev/ttyAMA0

Hi, I am following the instruction here,

I loaded oga's firmware. (it is confirmed because the "#M00" - "#M10" commands are working)
From raspberry pi's python console (With sudo), I will the following

import sys
import time
import serial
import colorsys

# config
RAPIRO_TTY = '/dev/ttyAMA0'
rapiro = serial.Serial(RAPIRO_TTY, 57600, timeout = 10)
value = 0

# version check
version = ""
while rapiro.inWaiting():
version += rapiro.read(1)

it prints nothing.

If I run a "$ sudo last -f /dev/ttyAMA0" in another terminal,
I got a error message right after the rapiro.write("#V")
last: seek failed!

Any idea?

posted by luzhuomi on 2014-07-06 10:36

Trying shutting down the Pi and using Usb to Arduino connection, I am able to read with "#A6" command. Hence it seems to be a reading problem between the Pi and Arduino.

posted by luzhuomi on 2014-07-06 14:52

After some googling, I've figured it out. Here is the step I missed out before python can read from the ttyAMA0


posted by luzhuomi on 2014-07-06 18:24

( Allowed tags: <b> <s> <code> <blockquote> <img> . Automatic URL link.)

Uploaded image is placed to the bottom of the post. To add multiple images, make post once then edit the post.

Read Terms of Service upon submitting. 投稿する前に利用規約をお読みください。