luisda2994 Posted March 12, 2015 Share Posted March 12, 2015 Hello everyone, I have read the basic tutorial and googled about this topic, but I'm confused. The context is: I'm sending simple characters from a microcontroller to a virtual terminal in my PC. The transmission protocol is RS232 (9600 baud, No parity, 8 bits, 1 stop bit) and I need to be able to capture the messages to later insert them into a database. I have read something about a paid library but as I said I'm new to web programming. Right now, I need to figure out how to detect an incoming character and save it. Thank you! Link to comment Share on other sites More sharing options...
justsomeguy Posted March 12, 2015 Share Posted March 12, 2015 I doubt PHP would be the tool for that. The major use case for PHP is that it runs on a web server and only executes when someone makes a request for a PHP script. It wouldn't sit there and monitor a COM port, for example. It could, but that's not really what it's for. You might want to look into using C/C++ or Java to write a little console application that will sit there waiting for COM traffic. That application could save things to a database which PHP could then read to show on a web site. Link to comment Share on other sites More sharing options...
luisda2994 Posted March 14, 2015 Author Share Posted March 14, 2015 I doubt PHP would be the tool for that. The major use case for PHP is that it runs on a web server and only executes when someone makes a request for a PHP script. It wouldn't sit there and monitor a COM port, for example. It could, but that's not really what it's for. You might want to look into using C/C++ or Java to write a little console application that will sit there waiting for COM traffic. That application could save things to a database which PHP could then read to show on a web site. I see, so what combination of languages can I use? C++ to read it and save it into a database? Is it possible to combine C++ and MySQL? Link to comment Share on other sites More sharing options...
justsomeguy Posted March 16, 2015 Share Posted March 16, 2015 Sure, you can use C++ to connect to a MySQL database. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now