Controlling LPT hardware with web app on win64 client - php

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.

Related

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

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

TCP Holepunch implementation

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.

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.

Unique serial number using php/javascript

Is there a way to get a unique serial number for machines such as Mac,Windows and devices such as iPhone,Blackberry using php/javascript?
It really requires at least one reference datum - javascript can't read things like IP addresses or MAC addresses - so that's ruled out. There are implementations of uuid for PHP - but to create a valid one, you need a real IP address assigned.
And if have code deployed serverside, its straightforward to implement a counter based system.
What is a machine?
Machines are made from parts, so determining wether a machine is still the same can be a philosophical question in its own right.
For example a computer's hard drive probably has a unique serial number, if the machine has a network card, it has a unique MAC-Address, and it might even be considered a "different machine" when running a different operating systems (Windows, Mac, etc). All those unique IDs can be mungled together to create a unique machine-ID, and this is exactly what some software vendors such as Mathematica do to make sure you don't run the software on a machine or an operating system, you have not licensed it for.
Using Interface Identifiers
With IPv6 finally becoming widely available, the Interface identifier of the protocol can serve as an identifier of your machine (or at least its network card), since it contains the MAC-address of the network card. IPv6 provides privacy extensions to prevent this kind of identification, since in the age of personal computers and mobile devices machine identification equals user identification, which is a huge privacy issue.
Currently, Apple and Android mobile devices, don't provide privacy extension, and they are deactivated on Mac and Linux by default. Only Windows 7 seems to have them enabled by default.
Accessing the IP address in PHP and javascript
In PHP it's pretty simple to access the IP address via $_SERVER['REMOTE_ADDR']
In javascript you could issue a JSONP request to a server that returns the user's IP address.
See: Can I perform a DNS lookup (hostname to IP address) using client-side Javascript?
Accessing the MAC address in Javascript
Even if the machine only has IPv4 - there is a proof of concept hack (http://samy.pl/mapxss/) that retrieves the MAC address from some routers via javascript XSS. The MAC address of your router is then sent to the google geolocation service to identify the machine's exact location. (Of course this only is a weak identifier for mobile devices)
Combining Identifiers
Webbrowsers will provide you with a useragent string, that can make your identifier even "more unique", and then there are cookies, geolocation services etc.
While none of these techniques provide a way to create a 100% unique identifier, several of those techniques combined can provide a very high accuracy of identificiation. Even if parts of a machine are changed, you might be able to re-identify it, when applying an array of identification techniques. Also note that when using browser identification etc, you may face the problem of over-identification, especially if a machine is using more than one browser to access your service.
Asking the user
Due to potential privacy issues, you should consider using an opt-in approach for creating the unique id. Also since it's the users who are in touch with their machines, they are the only ones who can uniquely identify their machine with a 100% certanity. So the best thing is to provide an incentive to the user to trust you with identifying their machines. A simple scenario, would be to provide the user with a login (so you have user identification) and then ask the user to help you with machine identification. Of course this only works if you trust your user, but if you don't, they should probably not trust you either.
No, there is no way to do that.
This is a good thing, since it makes it harder to track people via websites.
Privacy is precious ;)
Martin hurries off to delete all his cookies and put on his tinfoil hat
What is a machine?
Machines are made from parts, so determining wether a machine is still the same can be a philosophical question in its own right.
For example a computer's hard drive probably has a unique serial number, if the machine has a network card, it has a unique MAC-Address, and it might even be considered a "different machine" when running a different operating systems (Windows, Mac, etc). All those unique IDs can be mungled together to create a unique machine-ID, and this is exactly what some software vendors such as Mathematica do to make sure you don't run the software on a machine or an operating system, you have not licensed it for.
Using Interface Identifiers
With IPv6 finally becoming widely available, the Interface identifier of the protocol can serve as an identifier of your machine (or at least its network card), since it contains the MAC-address of the network card. IPv6 provides privacy extensions to prevent this kind of identification, since in the age of personal computers and mobile devices machine identification equals user identification, which is a huge privacy issue. Currently, Apple and Android mobile devices, don't provide privacy extension, and they are deactivated on Mac and Linux by default. Only Windows 7 seems to have them enabled by default.

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