I am trying to use php to talk to a microcontroller via the serial port. As far as I know, there are 3 ways of doing it: using fopen(), using the serial class, and using the serial extension. I know my microcontroller code works because I can manually send stuff over the serial port and it responds as expected. I want to send a single ascii character at a time. I just want to make sure that each of the methods work the way I think and was wondering if there are any more ways. Can you talk to the serial port just using fopen()? And can I just send over ascii characters with the serial class and serial extension? I have noticed that using the serial class takes much longer than the other 2 options.
talking to the serial port
Started by aloishis89, May 27 2009 09:02 PM
3 replies to this topic
#1
Posted 27 May 2009 - 09:02 PM
|
|
|
#2
Posted 28 May 2009 - 04:18 PM
In Linux you can do just about anything using fopen. I can't say the same for Windows. However, I can't begin to understand why you would want to do this using a programming language designed to implement websites.
#3
Posted 28 May 2009 - 05:08 PM
I am actually trying to control the serial port over the web, so I can remotely control my microcontroller. I am not limited to php, if there is a better way to do that, then I am certainly open to it.
#4
Posted 28 May 2009 - 05:55 PM
I would probably use a NetBurner Embedded Ethernet Board that directly supports TCP/IP. However, if you must use a PC as a middle man, C++ (CGI) would be your best bet, but Python is also fully capable of communicating with a serial port.


Sign In
Create Account


Back to top









