ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Php Serial Port Communication Linux Software
    카테고리 없음 2020. 2. 11. 11:21

    Welcome to LinuxQuestions.org, a friendly and active Linux Community. You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features.

    Registration is quick, simple and absolutely free. Note that registered members see fewer ads, and ContentLink is completely disabled once you log in. Are you new to LinuxQuestions.org? Visit the following links: If you have any problems with the registration process or your account login, please. If you need to reset your password,. Having a problem logging in?

    Please visit to clear all LQ-related cookies. Introduction to Linux - A Hands on Guide This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter. For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own. To receive this Complete Guide absolutely free.

    Php Serial Port Communication

    Hello all, I had a web server running from a Windows 7 computer and recently moved everything to an Ubuntu server. All is set up and running smoothly.

    I do have one page that actually interfaces with the serial port. The only thing I do with it is to set the DTR pin to 'true' which applies +12v to the pin. This activates a relay.

    It is very basic and simple. After moving everything to Linux, this page will no longer work. I knew this would happen. I know the page had code in it to call out 'Com1' which would change to 'ttyS0'. It also had 'setserDTR(True);' in the code. I can't figure out how to get PHP to control the DTR pin on a Linux serial port.

    Can anyone point me in the right direction? Thanks, Wayne. Hello all, I had a web server running from a Windows 7 computer and recently moved everything to an Ubuntu server.

    All is set up and running smoothly. I do have one page that actually interfaces with the serial port. The only thing I do with it is to set the DTR pin to 'true' which applies +12v to the pin. This activates a relay. It is very basic and simple. After moving everything to Linux, this page will no longer work.

    Serial Port Communication Software

    I knew this would happen. I know the page had code in it to call out 'Com1' which would change to 'ttyS0'. It also had 'setserDTR(True);' in the code. I can't figure out how to get PHP to control the DTR pin on a Linux serial port. Can anyone point me in the right direction? Not without seeing the code, no.

    However, it's not just ttyS0.it's /dev/ttyS0. Have you tried that?

    DeviceSet( 'COM1 '); // We can change the baud rate, parity, length, stop bits, flow control $serial -confBaudRate( 2400); $serial -confParity( 'none '); $serial -confCharacterLength( 8); $serial -confStopBits( 1); $serial -confFlowControl( 'none '); // Then we need to open it $serial -deviceOpen; // To write into $serial -sendMessage( 'Hello! '); State of the project Interestingly enough, this piece of code that is widely untested has created a lot if interest ever since it was created, and especially nowadays with everybody toying around with Arduinos and Raspberry Pis.

    I receive about 1 email every month asking for help with the code or sending patches/suggestions. I think that it is time for me to remove the dust off this project and to give it a full visibility on modern tools, aka GitHub. Bugs There is lots of bugs. I know there is. I just don't know which are they. Platform support. Linux: the initially supported platform, the one I used.

    Php Serial Port Communication Linux Software

    Probably the less buggy one. MacOS: although I never tried it on MacOS, it is similar to Linux and some patches were submitted to me, so I guess it is OK. Windows: it seems to be working for some people, not working for some others.

    Theoretically there should be a way to get it done. Concerns I have a few concerns regarding the behaviour of this code. Inter-platform consistency. I seriously doubt that all operations go the same way across all platforms.

    Read operations. Reading was never needed in my project, so all the tests I did on that matter were theoretic. I was also quite naive, so the API is probably not optimal.

    What we need is to re-think reading from scratch. Configuration done by calling functions. This is so Java.

    It would be much better to be able to pass a configuration array once and for all. Furthermore, I suspect that the order of call matters, which is bad. Auto-closing the device. There is an auto-close function that is registered at PHP shutdown.

    This sounds quite ridiculous, something has to be done about that. Use exceptions. Currently there is an heavy use of the errors system to report errors (2007 baby), but this is seriously lame. They have to be replaced by actual exceptions.

    Call for contribution I have about 0 time to code or test this project. However, there is clearly a need for it. As in all open-source projects, I need people to fit this to their needs and to contribute back their code. What is needed, IMHO:. Address the concerns listed above, and find new ones. Create a reproducible test environment for each OS, and prove that each feature works (basically, unit-testing).

    Report of use cases, bugs, missing features, etc. If you feel like doing any of those, do not hesitate to create an issue or a pull-request, I'll gladly consider consider it:) Licence PHP Serial Copyright (C) 2007-2014 PHP Serial's contributors (see CONTRIBUTORS file) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA USA.

Designed by Tistory.