This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Grove_Generic_UART
Jack Shao edited this page Jan 17, 2017
·
2 revisions
The Grove Generic UART module can forward short messages between internet and Wio's UART port.
Send plain text to Wio's UART port.
To send messages with characters like \r
\n
, you need call this API.
The generic UART module driver will check the UART RX buffer every 1 second. Multiple transmissions into the UART port within 1 second will be combined into one event.
Example:
<script>
var ws = new WebSocket('wss://cn.wio.seeed.io/v1/node/event');
ws.onopen = function() {
ws.send("the token of your wio device");
};
ws.onmessage = function (evt) {
alert(evt.data);
};
</script>
You will receive event messages like {"msg": {"uart_rx": "hello!"}}
This API can let users change the baud rate of UART from 9600 (default) to other values. The parameter index
should be one of 0,1,2,3,4. And the mapping of index and baud rate is,
- 0:9600
- 1:19200
- 2:38400
- 3:57600
- 4:115200