Closed gitgrimbo closed 7 years ago
Thought I'd try the example on Win7 anyway, and it works (despite the npm install
error).
Think sleep
is only required in the setupDevice()
method.
I'll leave this here in case anyone else tries to use Docker with node-orvibo, but I'm happy for it to be closed.
Thanks for trying this out in Docker. I haven't used Docker in a little while, so I may not be much help. But what I find strange, is this:
Orvibo Message received +1ms 686400067161 { address: '172.17.0.1', family: 'IPv4', port: 53351, size: 6 }
I don't know where port 53351 is coming from, as my app doesn't use it, and it's not a port you've explicitly opened up, but the message received is the "discover" message that the code just sent out (Message sent to 255.255.255.255:10000 with length 6 +1ms
).
So perhaps look into port forwarding, or reasons why port 53351 is being used. If I get a chance, I'll open up Docker (I got an invite to the beta the other day) and try and install / run this.
I think port 53351 is a random internal Docker container port. This internal port is reachable from the 'outside' as one of the -p
port numbers, so from outside the Docker container/host you don't see 53351.
E.g. if I run the code I pasted above again I get a different port, 35893
:
Orvibo Message sent to 255.255.255.255:10000 with length 6 +4ms
Orvibo Message received +2ms 686400067161 { address: '172.17.0.1', family: 'IPv4', port: 35893, size: 6 }
Orvibo Parsing incoming message. Command ID is: +19ms 7161
Orvibo Found something else: +1ms
Orvibo Discovery packet sent +983ms
My setup is:
I have used Docker to try and avoid having to install a C++ SDK, which seems to be required to compile the sleep library (using node-gyp?).
This is the Docker command I use to start a Node container:
I then run these commands from within the Docker container:
And this is the output from running the example program:
From looking at the code that handles the
7161
command, it seems that my message is far too small. The code referenced uses substring such asmessage.substr(62, 6)
, but my message is seemingly only 12 characters in length.Do you have any ideas? Thanks.