connecting scales(measure weight) to external device(pc or iphone) - php

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.)

Related

Chrome serial port communication

I'm trying to connect a lab equipment via a serial port to a computer to communicate with it. My application is a web based one, so I use Chrome browser. I want to get a data from MYSQL database and send it to the lab equipment and the response from the equipment to the database. Without using a native software, can I do this by using the chrome.serial api and a Chrome extension? Or is there any good other way to do it without using a native software?

Making the web server as a relay between two sides

I want to control a robot from the web, the robot is connected to Android device. The operation will be as the following :
a web application written using JavaScript and HTML runs on desktop computer which takes the keyboard input from the user and send them to the android device connected to the robot.
the android device receive the commands and then send them to Arduino board which used to control the robot.
But how should I deliver the data to the Android device which doesn't has a static IP address?
I have two approaches to solve that :
the JavaScript application sends the keyboard input to a web server runs PHP and MySQL , then the php application store the data on the MySQL database. An application runs on Android connected to that web server and extract the data from the MySQL database.
the JavaScript sends the data to the web server. The android application connected to the web server receives the data directly so the web server is just used as a relay.
The first approach is easy to do but its slow , so my question is...
How to implement the second approach and which web technologies should I use to implement it? And how to make the web server works as relay between two sides?
PS : I am planning to use 000webhost.com as web server. so I will not use my own server
You can either have your Android application poll the webserver for outstanding commands. This is a little inefficient in terms of data usage, but if you're on an unlimited 3G plan / wi-fi, you could live with it. It will be very easy to implement.
Alternatively, set up a TCP server on your server, and have your Android application open a socket connection with the server. This way, your web application can send commands to the server which will immediately stream them to the Android device. It will be slightly harder to implement, but will be more efficient and robust if done right.
PS - Most shared servers don't allow you to open a TCP server on your host so you might be forced to go with the first option.
PPS - I wasn't aware of Google Cloud Messaging. It seems to be a good solution for you what you're attempting to achieve. You should have a look into it.

How to make Android and Arduino communicate without a wireless module

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.

create local server on android

I want a develop a web application with php, and I want a run my apps with a android device. But my device will not be connected to internet, so I must create a local server on the device to run my php code. Is it possible? And if it's possible how?
Based on this page, developing Web Server for mobile devices is still on the research phase. Most probably you would need to use some kind of simulator for Android and develop your App on powerful desktop PC.
EDIT: Looks like such a server exists for Android.
Please use KSWEB.apk. This app supports PHP, SQL, html, csc, but it requires 3 android devices. The first serves as router, the 2nd device is a local server and the 3rd devices is a monitor.
I'm not sure about your need to have a web server running on your phone, but if you have a wireless router and your phone can connect to it, can you not install an Apache server with PHP support on your development PC and access it via your phone's wireless connection?

Web app - Biometric system connection

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.

Categories