communcation between node.js and processing - javascript

i'am working on a project where i receive data from mobile phones via websockets to a node.js server using socket.io. and this i want to pass to processing. The processing sketch is not running in the browser, it manage sounds, arduino, ... so i wonder what would be a good protocool to send the data to the processing sketch?
I did not found a way to use socket.io in processing, so i thought about using osc?
Or is there a other socket protocoll i can use between mobile phones, node, processing?
thanks!

See if this shield will do the trick for you: http://arduino.cc/en/Main/ArduinoEthernetShield Found a few simple projects from google that seem to fit your description of what you want (turn something on/off from the web).
Node can be your server, with sockets.io, and node can most likely communicate over the web with this shield. Note: I've never used it, just googled, saw a project that looks like what you are interested in.
EDIT: Here is another possible solution: http://xseignard.github.io/2013/06/25/interfacing-leap-motion-with-arduino-thanks-to-nodejs/ using: https://github.com/rwaldron/johnny-five

Related

Alternative for java applet which needs to communicate with browser via javascript

In our web application, we using a Java applet to invoke MS.Word application by jacob jar e.g. Word to open, edit, and when it saves automatically it uploaded to the server.
Google Chrome will no longer support NPAPI, so soon we can not run our applet in Chrome anymore.
So, any suggestions for an alternative for the Java applet. We want to make the same experience for the user, just like before.
We have the same problem. With Webstart is not longer possible to do that communication. We are going to use Websockets between webstart application and browser. Our first attempt is to start a websockets server in the webstart and make browser connect to localhosts. If this is not possible for security limitations in the browsers then we are going to do it through the webserver, browser and webstart application connecting to the webserver and exchanging messages.
I can see 2 distinct possibilities.
Create a standalone application that "wraps" your web application using a technology such as electron. You can then do your browser to desktop integration as you like. This will require an install on the client.
Launch a webstart application (or it could really be any installation that happens on the client). It will need to start a webserver, or connect to a webserver and communicate via http.
I'm saddened by the loss of the Applet. It is a technology not easily replaced. And another methods seem somewhat like 'workarounds'. There is no easy, cross-browser way to break out of the browser sandbox and access the system.
For myself, the loss of the Applet has simply meant that automating some of these processes has become too difficult and it is just better to find an alternative way of achieving a similar end result.
A small note: If you are starting a local webserver, be mindful of security. It can be accessed by other processes on the system. Wouldn't it be fun to open word on anyone's system by sending a request to a port!

How to use the browser as the GUI for an offline application?

I want to be able to create an offline program that can use the browser as GUI. I'm not particularly good at GUI programming in general, and overall it seems that using HTML and CSS to structure a GUI would be the easiest.
Cross browser method is preferred, but I will most likely use Google Chrome
I need to be able to open an external program, possibly with command line arguments
Javascript seems like the best language for this, however as far as I know it isn't possible to launch programs with it.
This is on Windows 7.
That's a good idea and is done by a several popular softwares.
The best way is to make your offline program run a web server that the browser will be able to access.
ie: Your program starts a web server on localhost:5555 and then you'll be able to request http://localhost:5555/users in Javascript, from your browser.
Another approach could be using a UI framework like AngularJS + local storage. I'm working on an app right now that will be used online (connected to the web), online locally (connected to a local server that is not connected to the web), and offline.
You could build a single-page web app and let Angular manage all the "urls".

Direct javascript printing from android & IOS

I'm currently developing a web based application that requires RAW communication to printers straight from Javascript.
On the PC/Mac side of things I've had a great time implementing qz-print, a java based plugin for doing just this.
It's now come time that I look at how I can reproduce the same behaviour iOS and Android.
Here's some ideas that I've had so far:
Wait a god awful time for RawSockets (javascript TCPSocket implementation).
Build a simple android application to relay http requests to a tcpsocket (I'm getting started on this right now).
Use an existing Android/iOS app to achieve the above. I found "Let's Print Droid" which provides a HTTP server. It can send data to the printer but I can't seem to get the server part working. From my web app I've tried sending POST and PUT requests with no luck and came across a CORS (Cross-Origin-Resource-Sharing) issue. There is also no documentation for the LetsPrintDroid Http feature and to fix the CORS issue it would be up to the app to send specific headers to allow CORS.
Does anybody know of any awesome libraries, helper-apps or additional solutions?
What's your oppinion on the above solutions.
Any advice appreciated :-D
UPDATE:
I got a little android http-tcp socket running and it's working great!
The only obvious issue with this is that another app will be needed on IOS.
Thought it would be helpful so I've made the code available on Github:
https://github.com/micwallace/HttpSocketAdaptor
The Lets print droid proxy server uses a multipart mime upload facility. The first part is the JSON string describing the printer as detailed in the help files. The second part is the data file.

developing browser to browser audio/video calling using SIPML5 & WEBRTC

I want to start a basic sip to sip calling through browsers using WebRTC and SIPML5 on windows. How can I start? I am able to do video chat between browsers using WebRTC. But my requirement is to prepare a demo to demonstrate their usage so that it can be integrated in a enterprise solution. At this level i can't go for any paid servers or softwares. So, Please provide the references for the same.
Thanks.
probably you need to build the source code as first step , on your computer and work on your code (Client and server side) part as you like and test it on a running local server and After you have tested this Web application and if u satisfied with its performance, you can deploy it to the Web server you make available to your users
good luck,

web app on mobiles with phonegap

I have a web application (chat room) in html + javascript that basically sends requests to the server every 5 seconds to check for new messages.
It already works on mobile but there are 2 main problems:
it does not beep (it works on pc) with new messages
when the browser is put on background, the javascript obviously stops being executed, therefore the connection to the server is lost and the client disconnected.
i was thinking of using phonegap not only to make it cross-platform but also to fix those problems stated above. would they be resolved with the use of phonegap?
thank you in advance.
phoneGap doesn't support custom push notification. it basically open a browser and expose you some native support via API.
in order to do some native actions like push notifications and/or sound playing i suggest you check out some of the plugins options available or even write your own for that.
Playing sounds can be done easily using the Media API. As for having the JavaScript run in the background it really depends on the OS. On Android the JS will continue to run if you leave the app via the home button but the back button kills the app so you would stop the JS. It is probably better to write a service that always runs in that case.
Alternatively you'd look at a push type solution to notify you of new messages.

Categories