Driving wirelessly Digi WIFI from javascript
EMHmark7
Posts: 93
Hi,
For my web interfaces and applications, I will program in meteor js that is based on javascript and node.js
Beside Javascript, HTML and CSS (a web based interface), it can compile to Android and iOS.
I would like to use it for programming a remote control that would control (wireless) a Digi Wifi module on my Propeller projects (presently using XBEE footprint modules)
(I am using the passthrough mode and I/O readings, not the API mode)
The Wifi module would be driven either by an Android tablet, or directly by my server (it can be for production devices, or security systems, etc.)
It would be great to use the web or a network for remote control, but also (that framework on JS, HTML and CSS) for the look and feel of the user interface.
Any idea about APIs function calls or what API's available?
(as I said, it is javascript on nodejs that takes care of compiling applications in Android and iOS)
Not sure if I need to call nodejs directly, or other ways.
At worst, can an Android send and receive to and from another Android app that could do the sending/receiving for Digi wifi?
If so, is there an Android app that could be used as an API?
Thanks
Marc
For my web interfaces and applications, I will program in meteor js that is based on javascript and node.js
Beside Javascript, HTML and CSS (a web based interface), it can compile to Android and iOS.
I would like to use it for programming a remote control that would control (wireless) a Digi Wifi module on my Propeller projects (presently using XBEE footprint modules)
(I am using the passthrough mode and I/O readings, not the API mode)
The Wifi module would be driven either by an Android tablet, or directly by my server (it can be for production devices, or security systems, etc.)
It would be great to use the web or a network for remote control, but also (that framework on JS, HTML and CSS) for the look and feel of the user interface.
Any idea about APIs function calls or what API's available?
(as I said, it is javascript on nodejs that takes care of compiling applications in Android and iOS)
Not sure if I need to call nodejs directly, or other ways.
At worst, can an Android send and receive to and from another Android app that could do the sending/receiving for Digi wifi?
If so, is there an Android app that could be used as an API?
Thanks
Marc
Comments
I am not entirely clear on what you need from the XBee Wi-Fi interface, however I just downloaded an Android app that is basically a UDP/TCP terminal. When I connect to the XBee Wi-Fi it sees all the messages and receives what I send back. UDP/TCP communication is pretty straight-forward on the S6B. I have also been able to send messages back and forth from VB.NET as well.
All that from javascript API, or at worst, from Android.
(I am not using the API mode in the XBEE, but the passthrough serial and I/O reading/setting)
When it is not from a tablet but from a windows desktop (let's say from a web browser), how could we send messages to the USB serial terminal?
Could you put the link of the application you are talking about?
Thanks for your reply.
But I am looking for programming my own app (automation and logic such as sending several parameters or controlling from a web app), not just clicking on buttons on a screen from an existing app.
5 cases:
1) From a mobile device. Meteor JS can use Cordova plugins, but I do not find one for send/receive IP messages.
2) From an app SERVER using Node.js (Meteor Js) connected to a Wifi (an app would call a server side function)
3) From a BROWSER on the computer acting as the remote control to the Wifi interface (but not nessary if we install a Meteor JS on local host, in this case the local server would dialog with the Wifi as in case 4) )
4) A LOCALHOST SERVING the browser but communication to the Parallax device by Wifi.
5) A LOCALHOST SERVING the browser but communication to the Parallax device by the serial USB. (Same as previous but through the Serial USB)
In all these cases, It would be interesting to know a path to function that would allow using the wifi or serial .
Digi method seems complicated and seems to involve some kind of paid server based service.
The main idea is to allow using webbased technologies for interface design and SSL communication for controling remote devices (wired or wireless) or getting status from them.
It could be an alarm system monitoring or controling a manufacturing tool that needs lots of custom data according to a design.
So the point is to access (duplex) the Wifi and or Serial USB through a browser or NodeJS or Cordova.
I am not an expert of technology interactions behind meteor Js, but it is based on Node js and it can compile a native app for iOS and Android. (Cordova plugins can be used)
The 2 nice things about Meteor js are:
-client-server dual-way data sync without reloading a page
-Simple web based templating
The xbee-api Node.js module helps you parsing and building API frames that are used to communicate with radio modules talking the 802.15.4 and ZigBee (including ZNet) protocol stacks. These are most commonly used in Digi's xbee radio modules, hence the name of this node module. However, other devices with the mentioned protocol stacks should also be supported. For details on supported firmwares and devices, see here.
https://www.npmjs.com/package/xbee-api
But for now, I would prefer using the passthrough mode over Wifi. If somebody can help on that : ) .
Thanks
Who said we need to use an higher abstraction layer! This is cool fo desktop apps with a web bases interface. If it can be usefull to someone.
But still, would be interested in using a mobile (tablet) via WIFI as a remote.
Even if we could use the USB port, it is not the point to use a tablet with another external box for XBEE and batteries
The software API uncertainty is why my actual device uses a 4D Systems touch screen + An XBEE module, std batteries, casing. The box is pretty big and tick and more expensive than a tablet.
Also, a table has much more RAM/SSHD and allows Android for programming (such as Meteor JS compiled for Android)
https://developer.chrome.com/apps/app_usb
https://developer.chrome.com/apps/app_network
For sure I will investigate that! Thanks!
However they work only for Chrome Apps.
I also found :
https://github.com/voodootikigod/node-serialport
https://www.npmjs.com/package/usb
But the best solution would be through wifi network.
It leads to adding 2 options to my list:
6) Have a lightweight Node.js server with Wifi and serial to a wifi XBee. (somehow redondant)
7) Have a Propeller powered device that can be called as a webserver (maybe with Node.Js)
This not only solves the wifi side of the device, but the programming side of the remote control (the client) doing the calls, and receiving answers.
The forum or DNS server was having problems
https://www.npmjs.com/package/serialport
Understanding Serial Data from XBee using Node-XBee and Node-SerialPort
http://stackoverflow.com/questions/21952233/understanding-serial-data-from-xbee-using-node-xbee-and-node-serialport
This video provides a Digi-Key demonstration on the XBee ZigBee in action and also explains the features, benefits, how to use the XBee ZigBee Cloud kit, Gateway, and ZigBee cloud connection
http://www.digikey.ca/videos/en/v/XBee-Zigbee-Cloud-kit-Another-Geek-Moment/3989656848001
It's poor acting but funny
But still my goal is to use a tablet that has only Wifi for remote controlling a XBEE (Wifi) (not a ZigBee).
Ideally programming the user interface in Meteor.JS (in fact, JavaScript, Node.JS, HTML and CSS usable by a web browser) (or native version compiled for Android or iOS FROM JavaScript, Node.JS, etc.)
It is a Node.js API for robotics. Would be good if Parallax could interpret
the firmata protocol as stated on http://node-ardx.org/
https://www.npmjs.com/package/serialport
http://pythonhackers.com/p/w1nk/node-serialport
http://thinkingonthinking.com/serial-communication-with-nodejs/
http://servicelab.org/2012/12/12/wirelessly-control-your-arduino-with-nodejs-over-bluetooth/
I suppose it can work OK ofrom a desktop using its serial. But for a Wifi, tablet it would mean the Parallax need a node.js server onboard.
(in my understanding)