Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server Crashes right after selecting the robot #5

Open
otahboub opened this issue Sep 16, 2017 · 2 comments
Open

Server Crashes right after selecting the robot #5

otahboub opened this issue Sep 16, 2017 · 2 comments

Comments

@otahboub
Copy link

Hello,

I tried running scratch2mip on my Ubuntu VM, once I select a MiP robot, the server crashes. The following is the log:

Cuser@ubuntu:~/wowweelabs-mip-robot/scratch/scratch2mip_helper$ sudo node scratch2mip_helper.js
0: Mip-81560
which one: 0: Mip-81560
1: Mip-73331
which one: 1
/home/user/wowweelabs-mip-robot/scratch/scratch2mip_helper/scratch2mip_helper.js:55
dispatcher.onGet('/forward', function(req, res) {
^

TypeError: dispatcher.onGet is not a function
at /home/user/wowweelabs-mip-robot/scratch/scratch2mip_helper/scratch2mip_helper.js:55:20
at /home/user/wowweelabs-mip-robot/scratch/scratch2mip_helper/lib/base/finder.js:54:3
at /home/user/wowweelabs-mip-robot/scratch/scratch2mip_helper/lib/base/robot.js:60:4
at Peripheral. (/home/user/wowweelabs-mip-robot/scratch/scratch2mip_helper/node_modules/noble/lib/peripheral.js:73:7)
at Object.onceWrapper (events.js:316:30)
at emitOne (events.js:115:13)
at Peripheral.emit (events.js:210:7)
at Noble.onServicesDiscover (/home/user/wowweelabs-mip-robot/scratch/scratch2mip_helper/node_modules/noble/lib/noble.js:210:16)
at emitTwo (events.js:125:13)
at NobleBindings.emit (events.js:213:7)

Please let me know if I missed any thing.

Thanks,

Omar

@cr0bar
Copy link

cr0bar commented Oct 20, 2017

Same issue here:

`0: WowWee-MiP-29902
which one: 0
/home/pi/work/scratch2mip_helper/scratch2mip_helper.js:55
dispatcher.onGet('/forward', function(req, res) {
^

TypeError: dispatcher.onGet is not a function
at /home/pi/work/scratch2mip_helper/scratch2mip_helper.js:55:20
at /home/pi/work/scratch2mip_helper/lib/base/finder.js:54:3
at /home/pi/work/scratch2mip_helper/lib/base/robot.js:60:4
at Peripheral. (/home/pi/work/scratch2mip_helper/node_modules/noble/lib/peripheral.js:73:7)
at Peripheral.g (events.js:260:16)
at emitOne (events.js:77:13)
at Peripheral.emit (events.js:169:7)
at Noble.onServicesDiscover (/home/pi/work/scratch2mip_helper/node_modules/noble/lib/noble.js:210:16)
at emitTwo (events.js:87:13)
at emit (events.js:172:7)
`

@cr0bar
Copy link

cr0bar commented Oct 20, 2017

In scratch2mip_helper.js

Replace:

var dispatcher = require('httpdispatcher');

With:

var HttpDispatcher = require('httpdispatcher');
var dispatcher = new HttpDispatcher();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants