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.
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.
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.
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.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks