HomePage RecentChanges Linux Serial via Websockets

The intel Edison doesn't actual have 'screen' or other serial monitoring on board. But even if it did, this is a useful tool for monitoring serial real time.

HTML / CSS / Javascript

<!doctype html>
    <title>Serial Port</title>
    <ul id="messages"></ul>
    <form action="">
      <input id="m" autocomplete="off" /><button>Send</button>
    <script src="https://cdn.socket.io/socket.io-1.2.0.js"></script>
    <script src="http://code.jquery.com/jquery-1.11.1.js"></script>
      var socket = io();
        socket.emit('serialio', $('#m').val());
        return false;
      socket.on('serialio', function(msg){

Node JS Serial

var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);
var mraa = require('mraa');
var SerialPort = require("serialport").SerialPort;

u = new mraa.Uart(0); 
var serialPath = u.getDevicePath(); 
var serialPort = new SerialPort(serialPath, {baudrate: 9600});

function convertArrayBufferToString(buf){
	var bufView = new Uint8Array(buf);
	var encodedString = String.fromCharCode.apply(null, bufView);
	return decodeURIComponent(encodedString);

io.sockets.on('connection', function (socket) { 
	serialPort.on("data", function(data) { 
		var str = convertArrayBufferToString(data);
		socket.emit('serialio', { data: str });

	socket.on('serialio', function(data) {

Software error:

Can't locate object method "endform" via package "CGI" at /data/scott.dd.com.au/wiki/modules/search.pl line 15.

For help, please send mail to the webmaster (webmaster@dd.com.au), giving this error message and the time and date of the error.