Skip to content
Snippets Groups Projects
Commit 5e9015a6 authored by Jake Read's avatar Jake Read
Browse files

add error logging to serialport

parent 15571dff
Branches
No related tags found
No related merge requests found
......@@ -13,7 +13,7 @@ It's in the early stages, so bear with us. Everything is going to be great.
# Usage
## Installing Node.js, WebSocket and SerialPort
## Installing Node.js, WebSocket and SerialPort, and MathJS
To Run DMC, you'll need to install node.js, and then the packages serialport and ws (websocket).
......@@ -45,6 +45,12 @@ To install ws, do
``npm install ws``
## Install MathJS
MathJS is just a node package that does maths. To install, you guessed it, do
```npm install mathjs```
# Running DMC
To run the program, we launch the main.js file with node, from the command line. One of the things this does is run a tiny HTTP server that we can use to access the UI.
......@@ -81,6 +87,10 @@ In a browser open *localhost:8080* you will see the mods and this msg in the ter
- rm modules
- change settings
# Troubleshooting
Herein will contain a list of known problems / common errors and their fixes.
# Writing New Modules
- whenever a menu is requested, the system searches ```modules/ * ``` for *anything*. include your .js of a new module there
......
......@@ -48,15 +48,22 @@ function ATKSerialLink() {
serialport = null
function findSerialPort() {
state.portStatus = 'searching for CP2102 device'
var found = false
SerialPort.list(function(err, ports) {
ports.forEach(function(serialport) {
if (serialport.manufacturer == 'Silicon Labs') {
console.log('found cp2102 serialport')
found = true
state.portName = serialport.comName
openSerialPort()
}
})
})
if(!found){
console.log('no CP2102 device found, try serialport-list to make sure it is available to the system')
state.portStatus = 'no CP2102 device found'
}
}
function openSerialPort() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment