Is it possible to to communicate with scanner using node js ?
We are using a php application which currently uses a Java applet to communicate with a scanner.
Since latest chrome versions have stopped support for applets we are looking for an alternative method for usb port communication
Can nodejs help us initiate the scan and read bufferstream from the port ?
If not what others options do we have ?
It should be possible with additional libraries.
Try to use this one https://github.com/tessel/node-usb
There is no pure javascript solution.
Fast way is to convert Java applet to Java Web Start. You have to write JNLP which download jars and runs applet outside browser.
http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/applet_migration.html
You can also install scanning daemon on client side and connect via web sockets.
Eg. https://www.npmjs.com/package/scanner-js
Related
Am using Linux machine.I want to know that whether it is possible to load test an gaming application(includes HTTPs and websocket protocol) hosted on Linux server, using JMeter.
If you want to run JMeter on Linux machine - it can be done because being a pure Java application JMeter runs anywhere where Java runs. You can install Java on Linux using either your package manager or a 3rd-party tool like SDKMAN!
If you want to use JMeter to test application which runs on Linux it can be done as well, JMeter doesn't know anything about operating system of the application under test.
HTTP protocol can be covered using built-in HTTP Request sampler
WebSocket protocol can be covered by WebSocket Samplers (aren't shipped with JMeter, you will need to install them using JMeter Plugins Manager)
I want to communicate with my raspberry pi, through my webserver.
I want to use a web interface on my server, with which I can control an LED on my PI.
Can I use "node js" for this? or does anyone have a good idea or examples?
regards
You can indeed use just about any web server to communicate with the pi and thereby control its GPIO pins.
I wrote a web server specifically to interface with the pi's GPIO capabilities complete with utilities and examples if you want to try it out. It's a very lightweight native-code (C++) web server that you can use to control your LEDs (or what have you) with about 5 mins of setup:
OliWeb on GitHub
You can install it using git with:
sudo git clone https://github.com/m2ware/OliWeb.git
You could also install just about any other web server out there (Nginx, Node.JS, take your pick) and set up CGIs to call command-line utilities to drive the LED pins. Gordon's WiringPi utilities are easy to use and install - installation and usage instructions are below.
Gordon's WiringPi Utility
Each web server will have its own particulars in terms of invoking command line interfaces via CGI. If you're interested in NodeJS specifically, this describes how to invoke command-line functionality from Node:
How to invoke external scripts programs from node js
I know it is a little bit late, although for those who may be still interested I've recently developed a school project which does exactly this job.
I've used WebSocket and GPIO handling.
Here's the repo for the client: https://github.com/jkomyno/material-led-controller/
Here's the one for the server (you gotta put this on your RPI):
I want to create a webpage that will access the USB port of the client. Intent is to configure the hardware connected the USB port. I can do a desktop application because the configuration option is different for different hardware. connected and I need to pull this code dynamically from the server. I am not a web programmer. It will great to find the best way to do this.
It ends up that I am attempting to write an app that performs something similar. What I am doing, instead is writing both the web server and the web page. Use something simple, like DLib for the web server, to serve the data to the end user.
This is how it works:
The web server handles the USB connection. If written in C++ or some other native language, you will have much more control over the device. The web page is then loaded from the web server that you have written. In the web page, you can have some sort of javascript worker, etc. to constantly pull new data from the server and push data from the web interface to the USB device. This also adds a layer of protection because you can ensure that the user has not made any modifications to the web page.
The main drawback to this possibility is that you will be required to install the server on the client's machine. However, this can be circumvented by writing this as a applet that can be embedded within the page!
It is possible to write a browser plugin that communicates with USB devices. An example of an app that does that is MyTrezor.com, but unfortunately I don't think you can see the source of their plugin.
Another option might be to use the chrome.usb or chrome.serial Javascript API, but this means your app would only work in Google Chrome, and it would have to be installed as a Chrome packaged app, a special thing that looks more like a native app than a web page.
I'm just wondering is it possible to run a local server using node (node would be running on a raspberry pi) and communicate with it via a web browser on a different machine on the same network using websockets? I'm looking into using a browser as a control system for a project I'm working on. If it is possible is there any references I can look at?
Thank you,
Techhead55.
EDIT
I already have node up and running on the pi, it's just that I'm not sure if you can and how you implement a local server and use sockets to communicate with it in a bowser on the same network.
Not sure if you specifically ask about Node, but here is an example of a WebSocket server running on Pi, and browsers connecting to that server: http://tavendo.com/blog/post/pypy-on-the-pi/
The example does Publish & Subscribe over WebSocket using WAMP (http://wamp.ws).
Here is a similar example running on Arduino Yun that shows how to connected hardware, and publish data in real-time via WebSocket, receiving data in a browser, and real-time rendering a chart: http://tavendo.com/blog/post/arduino-yun-with-autobahn/
Disclosure: I am original author of Autobahn and work for Tavendo.
Yes.
Here is great manual from Matthias Rüedlinger:
http://blog.rueedlinger.ch/2013/03/raspberry-pi-and-nodejs-basic-setup/
Also installation of ghost with node on RPI is very nice :)
http://bit.ly/1cFwFAQ
I would like to use the chrome browser as a software technical platform for
digital signage purposes. To force the chrome browser to receive and execute any
self-defined custom commands (e.g. create a new tab and inquire the content of a
certain web-page/url) I need to run the chrome browser as a server
listening to a certain network port.
What is the best way/technology to use websockets, server.io, etc?
NPAPI is the only way to do what you want, short of drastically modifying and compiling Chromium from source. If the client that controls Chrome is in a browser, then packaging a WebSocket library as an NPAPI plugin is probably your best bet. If your client is a desktop application, packaging a plain TCP library should be sufficient.
However, NPAPI has quite a steep learning curve, so I don't recommend using it if you can help it. If possible, just have Chrome establish a constant connection to a central server (using, e.g., Socket.io). Your client can also connect to that server and use it to forward commands to the Chrome instance that you want to remotely control.
So, instead of:
[controlling client] ---> [Chrome]
You could use:
[Chrome] ---> [myserver.example.net] <--- [controlling client]
If your system requirements mandate independence from the Internet (i.e. Chrome won't always have access to a specific external server like myserver.example.net, but must still accept clients on the local network), then you could run the intermediate server on the same machine as the Chrome browser that you're controlling.
Maybe you can implement for example Node.js via NPAPI and get it work... or something else.
It would be better if you use something else because google controls all NPAPI extensions manually.