Arduino 使用 YunSerialTerminal
Arduino 使用 Bridge, 在 Bridge.cpp 中
Arduino\libraries\Bridge\src\Bridge.cpp
void BridgeClass::begin() {
uint8_t quit_cmd[] = {'X', 'X', 'X', 'X', 'X'};
transfer(quit_cmd, 5);
stream.print(F("run-bridge\n"));
}
Linino 執行 /usr/bin/run-bridge
/usr/bin/run-bridge
exec python -u bridge.py 2> /tmp/bridge.py-stderr.log
exec python -u bridge.py 2> /tmp/bridge.py-stderr.log
/usr/lib/python2.7/bridge/packet.py
使用 stdin stdout
/usr/lib/python2.7/bridge/mailbox.py
json_server = TCPJSONServer('127.0.0.1', 5700)
/usr/lib/python2.7/bridge/mailbox.py
def __init__(self, port=6571):
utils.try_bind(server, '127.0.0.1', port)
root@arduino:~# ps |grep bridge
802 root 7376 S python -u bridge.py
root@arduino:~# lsof -i
python 802 root 5u inet 1297 0t0 TCP localhost:5700 (LISTEN)
python 802 root 4u inet 1213 0t0 TCP localhost:6571 (LISTEN)
root@arduino:~# netstat -tulpn
tcp 0 0 127.0.0.1:5700 0.0.0.0:* LISTEN 802/python
tcp 0 0 127.0.0.1:6571 0.0.0.0:* LISTEN 802/python
/usr/lib/python2.7/bridge/bridge.py
def process(seld, data):
if data == 'XXXXX':
print 'Goodbye...'
self.finished = True
return ''
/tmp/sketch.hex
/etc/init.d/mcuio
mcu-reset
ldattach -s $BAUDRATE 29 /dev/ttyATH0
/dev/ttySPI0
/usr/bin/detect-console
ttySPI0 ttyATH0
沒有留言:
張貼留言