Giter VIP home page Giter VIP logo

dgtchess's People

Contributors

dependabot[bot] avatar fnogatz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

dgtchess's Issues

Update dependencies

serialport@6 does not seem to be working with latest node.js version, so an update is required.

> npm outdated
Package     Current  Wanted  Latest  Location
serialport  MISSING   6.2.2   8.0.7  dgtchess
chess.js      0.1.0   0.1.0  0.10.3  dgtchess

Crashes with

It crashes quite often for me with "RangeError: offset is out of bounds here

			message.set(value, pos)

This works as a quick fix, can't see what the proper fix is though sorry

    const message = new Uint8Array(cmd.length + 100 /* + 100 is quick hack to avoid "RangeError: offset is out of bounds" error */)

Cannot open a perfectly valid socket

I'm trying to get up and running with dgtchess now that I've got it installed. I'm working on testing it with the dgtnix virtual board mentioned in #1. First of all, the example code in the readme has the wrong require.

var DGT = require('..');

may work inside the example folder but it should be:

var DGT = require('dgtchess');

to work outside of it.

After fixing that, dgtchess will then attempt to open the socket I give it:

var board = new DGT.Board('/tmp/dgtnixBoard');

where /tmp/dgtnixBoard is the socket created by the dgtnix python virtual board script (these are the only two lines I've changed in your example).

Here's a snipper of shell transcript that shows the problem:

→ node server.js 

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: Cannot open /tmp/dgtnixBoard

→ ls /tmp | grep dgt
dgtnixBoard   

So, dgtchess cannot open the socket even though it is clearly there. If I do something as simple as "cat /tmp/dgtnixBoard" the dgt server reports "Connected".

Virtual DGT boards for testing?

Hello,

I'm an MIT Media Lab Researcher in the Playful Systems Group. I'm working on integrating some work we've been doing with algorithmic analysis of chess matches into a live setup for an upcoming tournament. To that end I need to be able to take in live data from DGT boards. I'd love to use this library.

However, I don't currently have access to a DGT board to test it out and I was wondering if you have a suggestion for software that emulates a DGT board, including communicating on a serial port for testing with this package (and other DGT client implementations).

Thanks in advance for your time and this software.

Serialport error installing node-dgtchess via npm

I'm seeing what I think is this error: serialport/node-serialport#135 when trying to install node-dgtchess. I'm on OSX running 10.9.4. It seems like that error was fixed in serialport last year. Is node-dgtchess's npm package including an old version somehow?

The full error message:

> [email protected] install /Users/greg/Documents/mit/playful_systems/chess/chesscomputer/dgt-    integration/node_modules/dgtchess/node_modules/serialport
> node-gyp rebuild

  CXX(target) Release/obj.target/serialport/src/serialport.o
../src/serialport.cpp:51:3: error: no matching function for call to 'uv_queue_work'
  uv_queue_work(uv_default_loop(), req, EIO_Open, EIO_AfterOpen);
  ^~~~~~~~~~~~~
/Users/greg/.node-gyp/0.10.18/deps/uv/include/uv.h:1432:15: note: candidate function not viable: no known     conversion from 'void (uv_work_t *)' to
      'uv_after_work_cb' (aka 'void (*)(uv_work_t *, int)') for 4th argument
UV_EXTERN int uv_queue_work(uv_loop_t* loop, uv_work_t* req,
              ^
../src/serialport.cpp:118:5: error: no matching function for call to 'uv_queue_work'
    uv_queue_work(uv_default_loop(), &queuedWrite->req, EIO_Write, EIO_AfterWrite);
    ^~~~~~~~~~~~~
/Users/greg/.node-gyp/0.10.18/deps/uv/include/uv.h:1432:15: note: candidate function not viable: no known     conversion from 'void (uv_work_t *)' to
      'uv_after_work_cb' (aka 'void (*)(uv_work_t *, int)') for 4th argument
UV_EXTERN int uv_queue_work(uv_loop_t* loop, uv_work_t* req,
              ^
../src/serialport.cpp:146:5: error: no matching function for call to 'uv_queue_work'
    uv_queue_work(uv_default_loop(), &nextQueuedWrite->req, EIO_Write, EIO_AfterWrite);
    ^~~~~~~~~~~~~
/Users/greg/.node-gyp/0.10.18/deps/uv/include/uv.h:1432:15: note: candidate function not viable: no known     conversion from 'void (uv_work_t *)' to
      'uv_after_work_cb' (aka 'void (*)(uv_work_t *, int)') for 4th argument
UV_EXTERN int uv_queue_work(uv_loop_t* loop, uv_work_t* req,
              ^
../src/serialport.cpp:178:3: error: no matching function for call to 'uv_queue_work'
  uv_queue_work(uv_default_loop(), req, EIO_Close, EIO_AfterClose);
  ^~~~~~~~~~~~~
/Users/greg/.node-gyp/0.10.18/deps/uv/include/uv.h:1432:15: note: candidate function not viable: no known     conversion from 'void (uv_work_t *)' to
      'uv_after_work_cb' (aka 'void (*)(uv_work_t *, int)') for 4th argument
UV_EXTERN int uv_queue_work(uv_loop_t* loop, uv_work_t* req,
              ^
../src/serialport.cpp:214:3: error: no matching function for call to 'uv_queue_work'
  uv_queue_work(uv_default_loop(), req, EIO_List, EIO_AfterList);
  ^~~~~~~~~~~~~
/Users/greg/.node-gyp/0.10.18/deps/uv/include/uv.h:1432:15: note: candidate function not viable: no known     conversion from 'void (uv_work_t *)' to
      'uv_after_work_cb' (aka 'void (*)(uv_work_t *, int)') for 4th argument
UV_EXTERN int uv_queue_work(uv_loop_t* loop, uv_work_t* req,
              ^
../src/serialport.cpp:271:3: error: no matching function for call to 'uv_queue_work'
  uv_queue_work(uv_default_loop(), req, EIO_Flush, EIO_AfterFlush);
  ^~~~~~~~~~~~~
/Users/greg/.node-gyp/0.10.18/deps/uv/include/uv.h:1432:15: note: candidate function not viable: no known     conversion from 'void (uv_work_t *)' to
      'uv_after_work_cb' (aka 'void (*)(uv_work_t *, int)') for 4th argument
UV_EXTERN int uv_queue_work(uv_loop_t* loop, uv_work_t* req,
              ^
6 errors generated.
make: *** [Release/obj.target/serialport/src/serialport.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.    js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Darwin 13.3.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/greg/Documents/mit/playful_systems/chess/chesscomputer/dgt-    integration/node_modules/dgtchess/node_modules/serialport
gyp ERR! node -v v0.10.18
gyp ERR! node-gyp -v v0.10.9
gyp ERR! not ok 
npm ERR! weird error 1
npm ERR! not ok code 0

Cannot use import statement outside a module / ERR_REQUIRE_ESM

(using Node 16)
When using with node an the supplied example

import Board from 'dgtchess'
const board = new Board('/dev/ttyUSB0')

we get the error: SyntaxError: Cannot use import statement outside a module

If we add "type": "module" to our package.json, we then get the error: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module:

How can we fix this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.