This is something unusual I am doing other than coding. So My question is bit tricky and for those who have some knowledge of hardware programming I think so.
So all I am doing is, I bought one web Relay device from Hw group and it's called IP Relay ER02b. Which has two inputs 1 & 2 and that I am controlling through command prompt like on/off using web relay device IP address.
However, I have one more pin-pad device which is connected to web Relay into port called RS232. So there is no direct connection to my laptop with pin-pad device.
So the question is, how I can read incoming pin-pad numbers using IP address of web relay using command prompt as I searched a lot and couldn't find the way to do this using command prompt or PHP as PHP is also fine.
Any help on this will be appreciate and if need any further information then please let me know and I'll more than happy to provide.
Thank you guys in advanced
Related
I want to send a value from my website to my arduino using httprequest.
as the image explain, i want to enter my site from a device (let's say mobile phone) and send a request to my arduino from my website (webserver)
so i'm having this problems:
1- how to address the arduino without dns, should i have a fixed ip address for my arduino, is there any way else ?
2- what is the PHP code that i need to let the website send the request ??
i know i can connect arduino to web using httpclient, but i want the reverse process, that is connect the website to arduino ( the website as client and a arduino as a server)
is there anyway to do that ?
thank you and sorry for my bad english
I've recently made a similar project with a Raspberry Pi. But this doesn't make a difference.
First be careful with my solution. Anybody can join on your device, if they have your IP and Port. It might be not the best solution, but it works pretty good.
So what I did is, I've set a DynDNS to my router, so that I doesn't have to change the IP in my script every time. You can get a DynDNS from your provider or you can use the free service No-IP. Next I set a static local IP adress to my arduino/pi via the settings on my router. Then I also set port-forwarding to the arduino/pi.
Then you should be able to access your arduino/pi via the internet. And if you have this, you can also control it via any website you want.
To accomplish an HTTP request in PHP, there will be a lot of possible solutions. But I prefer this:
$response = file_get_contents(YOUR_DYNDNSIP_AND_PORT)
https://www.w3schools.com/php/func_filesystem_file_get_contents.asp
You also can additionally can get a response via this function.
To protect your own network, you can use HTTP Basic Authentication, which you have to add a username and a password to the request. This make it difficulter to access your arduino.
I hope this might help you.
Is it possible to use the facebook api like we do it on sites live on the internet , but on XAMPP ( a local server) installed on my computer ? I'd really appreciate your feedback.
Mostly the API's should work fine unless you have a registered domain associated with the API app key.
You have not specified which API you are using [Facebook has a lot of API's with various security levels]
A few disadvantages on working on local machines are as follows
A local machine is identified as an anonymous request coming from some IP as its not associated with a domain. Therefore chances of blocking your API request are high.
Your system may have imposed firewall rules for incoming and outgoing requests, if your local server is not configured to send and receive outbound requests your might be in trouble.
Hope this helps.
This is sent from a mobile, don't ask me how but the comment system doesn't work nicely for me.
A local server is the same as a live website, the only difference is that you run it locally...
If you have an internet connection while running the server, you're basicly the same as every other server....
but well if you don't have internet on it don't expect it to be working....
[but ofcourse you can only connect to it locally and not from other computers xD]
I hope I answered your question now, Feel free to add a comment if you want to.
Yours sincerely,
Mike M.
Yes you can. Just make sure that redirect url must be the url which we put in the facebook while building the app.
I have a number of phones on my network and I would like to be able to send a number to one based on extension for it to dial.
I have looked into TAPI and the PHP COM events but I don't understand it all that well and how to apply it to my setup.
Does anyone have any experience with using PHP to send commands to an IP phone on their network?
If these are Cisco IP Phones you can look at using the Ip Phone Services API: http://developer.cisco.com/web/ipps
Look specifically at "Dial" Telephony URI in the Application Development Notes
Each IP phone has a web server on it, you can use standard http(s) posts to send XML commands to the phone. You can completely control the phone in this manner.
You have to understand that client-server communication is a bit unidirectional. From iPhone to server you can easily send messages (and get responses), but to send a message from server to iPhone you have to implement socket connection between them, so the iPhone will always "listen" to what the server is "saying". Also, push notifications are a way to send messages from server to device, but it's not your case, I guess.
How do I get the Mac address of the user of my site (server). Welcome any tools, methods and techniques, all language. Thank you.
Short answer is: you can't. Even assuming you could pull a MAC address from the request, the user goes through many network devices before hitting your site so how would you know which of these the MAC address came from?
Assuming your site is on the Internet (as opposed to a LAN), you can't.
That information is not exposed to client side JavaScript and isn't routed over the Internet.
Assuming your visitors come over the internet and not simply the local network: You don't.
It is not part of the underlying protocol to transport that information more than a hop on the network.
By having the client send you the machine's MAC addresses to you. You'd have to execute some code on the client capable of collecting that information, and have it include that data in the communications with the server.
For example, you could have linux clients run /sbin/ifconfig and collect the MAC addresses from the output. You didn't specify what protocol you are using to communicate, so I can't offer advice on how to send the data once you've collected it.
Why do you want that? The machine might not even have any MAC addresses, or it might have several.
I need my app to be able communicate with a web server. The problem is I want web server to respond only to requests made from real android phones.
So, is there any way to make sure, that server works only with real phones? It should reject anything else to prevent spamming database from computers or emulators. Is it possible without sms verification?
And how good is socket support in Android? If I want to write server software in C will it be able to communicate with Android based devices? Or I have to use php, or something like that?
Maybe OpenSSL, but still I'm not sure.
Thanks in advance!
PS: sorry for my English
There is no real way for a web server to distinguish a real mobile device from a device that poses as one. Generally, the user-agent header is used to determine the type of client device, the value of which can be overwritten by any client.