概要
raspberry pi 1 model bの、node-redで、serialでhelloworldしてみた。
開発環境
raspberry pi 1 model b
raspbian 2016_09_23 jessie lite
回路図
写真
uartの設定
/boot/cmdline.txt を修正します。
具体的には "console=ttyAMA0,115200" を削除。
サービスを削除します。
sudo systemctl stop serial-getty@ttyAMA0.service
sudo systemctl disable serial-getty@ttyAMA0.service
サンプルコード
[{"id":"31aeed8b.df1222","type":"inject","z":"addc1b17.459d98","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":192,"y":156,"wires":[["46046e9c.a9ffb"]]},{"id":"8eccd597.5bce98","type":"serial out","z":"addc1b17.459d98","name":"","serial":"bf19e4f6.9d9348","x":202,"y":364,"wires":[]},{"id":"46046e9c.a9ffb","type":"template","z":"addc1b17.459d98","name":"hello","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"hello world!","x":202,"y":262,"wires":[["8eccd597.5bce98"]]},{"id":"bf19e4f6.9d9348","type":"serial-port","z":"addc1b17.459d98","serialport":"/dev/ttyAMA0","serialbaud":"115200","databits":"8","parity":"none","stopbits":"1","newline":"\\n","bin":"false","out":"char","addchar":true}]