I have developed an Arduino application in which I can control LED 13 via a serial monitor.
That is,
if I type 0 in a serial monitor LED at pin 13 lights up and
if I type 1 in a serial monitor the LED lights off.
Now I want to do all this with my Android phone.
The issues I have are:
How to, first of all, create a PHP server for getting all this worked out
How to open up the localhost on my Android device so that it acts like a local server
How to make the server interact with the serial port
I am not asking for all the code and project but just show me the way, and I will be all right.
Most Android and Arduino devices cannot talk to each other when straight "out of the box" - add on hardware and/or system software modifications are required.
You have a variety of choices
0) Bluetooth is fairly clean and now in the $20 range, so it's both one of the most cost effective choices and one of the least likely to risk damaging the phone hardware - but you said you don't want that.
1) Some phones such as the G1 have low-voltage serial ports which can be enabled by [rooting and] installing a customized kernel. You will need level translation circuitry as the output voltage of the arduino while low is still too high for the phone to handle. You will also need to source a special HTCUSB connector, either by modifying the full headset adapter or getting it from someplace like sparkfun.
2) Some phones can function as usb hosts by [rooting and] installing a customized kernel. They do not supply usb bus power, but with an arduino you have everything out in the open so cabling up a separate supply should be fairly simple. A few recent tablets have usb host mode out of the box. Edit: with later Android versions, a non-root USB host API and USB bus power may be available, but this varies by model and has been inconsistent.
3) You can use a USB host shield on the arduino, and if the device runs Android 2.3.4 or later use Gooogle's official ADK protocol to talk to software on the android device; if the android version is earlier, there are unofficial projects which talk the ADB protocol and should work with most devices (perhaps with small modifications). Both are designed to remain within unprivileged userspace on the android device - no rooting, no kernel modifications.
4) You could build a low-baud-rate modem and talk to the android device through its headset jack, using a software modem on the android side.
5) You could put a wireless ethernet shield on the arduino
I have no experience with Arduino personally. But the guys over at Cellbots have many projects that use Android phones as the brain for small robots and they use Arduino in most of them. Everything is open sourced, and you might be able to find examples that will help you out there.
Related
I'm making a PHP-based web app which, on one of its parts, must control a device with the parallel port, I want it to allow port selection from the LPT list, not dealing if possible with hex addresses.
Which options I have for controlling that hardware from the web app over the LPT port on Win64 clients?
The goal of the web app is to replace an old delphi software, which (in the concerning module) controlled the LPT port by pointing to address 378h, sending a constant pulse (of adjustable duration) to pin 2 of the port.
This approach has become a problem when trying to use newer computers, as any PCI to LPT card gets a very different address range, and I haven't found if there is any support for that kind of signals on Win 10 x64, from microsoft or another provider.
Edit: The hardware will be on client side and the web app will be stored on a hosting service, pending to be chosen.
Thanks.
I want to make a project for a client where client can easily weigh a product and get the product weight displayed on his PC or iPhone before submitting the data to a web server, I know some scales have APIs but could they be integrated into the web browser? or should I do a custom desktop or mobile application to handle that?
If the scales are network capable, then you can write an application using TCP/IP.
If the scales have serial port only, you'll either need a PC connected to it or some embedded device acting like a server. See this device for example, if you want an industrial grade device with rugged case and variable input voltage or you can also take Raspberry Pi or BeagleBone. The server can either provide data over some IP port with defined API or you can implement a web-server there, so that you'll only need a browser on your smartphone (iOS, Android etc.)
I'm working on an idea of mine which is comparable to a home automation system.
The layout of network devices would be like this:
What I want is for my Mobile Phone App to be able to communicate with the home server at all times, but also for the server to be able to reach my phone (Push-notifications).
For this I thought it would be a good idea to implement TCP-Holepunching using my server in the datacenter as the center for traffic.
The problem is though, Since my Java skills aren't good enough yet, I'm forced to write my server in the PHP scripting language, but PHP isn't capable of keeping sockets active.
Is there TCP-holepunching server software (executable in Debian) available which would be able to keep the sockets alive and push any commands from my server towards the correct destination (ie: phone) and vice versa?
There are ways to get sockets working in PHP. One library that does this can be found here:
http://socketo.me/
Also an easy way of setting a server like this up can be done with NodeJS. You code your server in JavaScript (run on Google Chrome's V8 Engine) and then you can handle persistent connections based on events.
It should be possible (with NodeJS) to code a relay server (relaying from your phone to your home PC and vice versa) with only a few lines of code.
I have searched on Google and found that I have to use AT commands to send SMS here is the link,
http://gonzalo123.wordpress.com/2011/03/21/howto-sendread-smss-using-a-gsm-modem-at-commands-and-php/
But in this tutorial he is using serial interfaced GSM modem, is it possible to send SMS via USB interfaced GMS modem. Please guide me.
A USB interfaced GSM modem will be presenting a USB serial interface, usually / hopefully conforming to the USB CDC specification. In other words you can treat it as a virtual COM port and the tutorial you linked to will still be relevant for you.
In Unix systems you can read/write from USB and Serial port reading data from /dev/ttyS0 or /dev/ttyUSB0. You also can use a usb/serial converter. They are cheap devices. But my experience with those usb converters is very bad. Because of that I prefer to use serial/ethernet convertes. They also allow me to place the serial device in any place and not necesary close to the server. OK maybe with a GSM device is not a problem. We can place it wherever we want, but if we are using the same technique to read/write from another device (like sensors, scales, ...), this may be a problem.
I will be developing an application for a club where they will have visitors use biometric systems(finger print) or magnetic cards to mark their attendance.
This application is planned as a web app, made using PHP/MySQL/Javascript. It does a lot of other things as well.
What I wanted to find out is how is the interface between Biometric/Megnetic Card systems to a web app done?
I've never worked on this and am hoping if someone who has experience with this can throw some light on this as to how this could be accomplished. Any pointers will be appreciated.
Also, we will be hosting this application remotely. So we won't have physical access to the web-server.
(I'm afraid there's got to be some form of application installed on a pc that would interface with the hardware and probably makes calls to the web app. But, if there was a way to connect it to the web app directly, then the app would be easy to deploy to any location with minimal installation.)
Thanks! :)
How is the hardware connected? Directly to the app server, or to a standalone box of some sort? If it's a standalone box, then yes you'll have to have some kind of program on the box collect the data and send it to the web app. If it's connected directly to the app server, then you need to write something that either polls the hardware or receives messages/events from the driver and DTRT wrt the web app.
There three type of communication channels are supported by the biometric machines. They are serial, TCP/IP and HTTP. In your case, you either need to implement TCP/IP or HTTP.
If your application is running the intranet, then you can implement the TCP/IP server application and host at a intranet system which is expected to write in a common database between the biometric application and your web-app.
If your application is hosted at the server, then you can implement the http server and associated the URL with the machine. For this you need buy the http api supported machines. Here is the google search link for finding such machines.