Skip to content

Instantly share code, notes, and snippets.

var SerialPort = require('serialport').SerialPort;
var modbus = require('../lib');
var serialPort = new SerialPort('COM8', {
baudRate: 9600
});
serialPort.write = function(data)
{
console.log('TX:', data);
'use strict';
// Verbose example of reading `8` discrete inputs starting from address `0x0000`
// from a MODBUS TCP/IP slave.
var net = require('net');
var SerialConnection = require('../lib/connections/SerialConnection');
var RtuTransport = require('../lib/transports/RtuTransport');
var functions = require('../lib/functions');
var Transaction = require('../lib/Transaction');
#### serial rpc module ####
ss = require 'socketstream'
_ = require 'underscore'
dashboardController = ss.api.app.controllers.dashboard
Dashboard = ss.api.app.models.Dashboard
fetchUserFromSession = ss.api.fetchUserFromSession
exports.actions = (req, res, ss) ->
TypeError: Cannot call method 'channel' of undefined
at Object.<anonymous> (/home/pi/node-playground/dashku/server/rpc/pub.js:3:16)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:362:17)
at Object.require [as loadItem] (module.js:378:17)
at Object.exports.createApiTree.createApiTree (/home/pi/node-playground/dashku/node_modules/apitree/lib/apitree.js:57:113)
/******************************************************************************/
/* ____ _ _ _____ */
/* | _ \ ___ | |__ ___ | |_ |___ / */
/* | |_) / _ \| '_ \ / _ \| __| |_ \ */
/* | _ < (_) | |_) | (_) | |_ ___) | */
/* |_| \_\___/|_.__/ \___/ \__| |____/ */
/* By Sam Walsh */
/* */
/******************************************************************************/
/******************************************************************************/
/******************************************************************************/
/* ____ _ _ _____ */
/* | _ \ ___ | |__ ___ | |_ |___ / */
/* | |_) / _ \| '_ \ / _ \| __| |_ \ */
/* | _ < (_) | |_) | (_) | |_ ___) | */
/* |_| \_\___/|_.__/ \___/ \__| |____/ */
/* By Sam Walsh */
/* */
/******************************************************************************/
/******************************************************************************/
sam@sam-laptop:~/ss-test$ ls
node_modules
sam@sam-laptop:~/ss-test$ cd node_modules/
sam@sam-laptop:~/ss-test/node_modules$ ls
socketstream
sam@sam-laptop:~/ss-test/node_modules$ cd ..
sam@sam-laptop:~/ss-test$ node
> var ss = require("socketstream")
undefined
> ss.
C:\Users\Sam\derby\derby-auth\example>npm start
> derby-auth-example@0.0.0 start C:\Users\Sam\derby\derby-auth\example
> node server.js
===============================================================================
========
= Please ensure that you set the default write concern for the database by set
ing =
= one of the options
pi@raspberrypi ~/foobar $ node app.js
module.js:340
throw err;
^
Error: Cannot find module '/home/pi/foobar/node_modules/sails/node_modules/rigging/node_mo dules/node-sass/precompiled/linux-arm/binding'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
@thebadger412
thebadger412 / gist:4436362
Created January 2, 2013 17:35
my generate file
#!/bin/bash
set -e
set -u
BUNDLE_VERSION=0.2.8
UNAME=$(uname)
ARCH=$(uname -m)
if [ "$UNAME" == "Linux" ] ; then