ArduinoLinuxSerial
1.0.0
이것은 Linux의 PHP-Arduino Communications의 도우미 클래스입니다.
일주일의 인터넷 검색 및 테스트 후, 나는이 클래스를 구축하여 Serial USB를 통해 Linux (마스터)에서 실행되는 PHP에서 Arduino 보드로 통신합니다.
마스터 메시지 최대 길이는 60 char (Serial Arduino Rx 버퍼 한계), 응답 (Arduino의)은 한계없이입니다. ' n'숯은 내부적으로 터미네이터로 사용됩니다. 프로토콜은 CRC8을 사용하여 정확성을 보장합니다. 오류의 경우 오류 상태에서 종료하기 전에 메시지가 3 번 저지됩니다.
Bash 스크립트 (Serialarduino.sh)는 시작 또는 USB (RE) 연결 후 Linux에서 USB 장치를 설정하는 데 사용됩니다. 직렬 통신은 모든 메시지에 대해 열려 있습니다. Bash 스크립트에서 Arduino 자동 재설정을 피하기 위해 DTR 핀이 비활성화됩니다. (https://playground.arduino.cc/main/disablingautoresetonserialconnection 참조)
문제 해결
설정
Arduinolinuxserial.php 파일을 참조하십시오.
결론
Now you can develop MySQL and web enabled Arduino applications only working on Arduino and PHP.
To keep ligth the Arduino Sketch, you can port all not realtime logic to PHP side.
At the end your application will works on MXQ+Arduino UNO even 24/7 with only 20 Watt AC power, and can
be controlled by smartphone via WiFi.
What more?
Enjoy.
Arduino 확장 기능이있는 전용 웹 서버로 TVBox (MXQ와 같은)를 사용하는 데 매우 관심이 있습니다.
Using ArduinoLinuxSerial (https://github.com/msillano/ArduinoLinuxSerial) the Master is php, and you need the
serial driver (uses devices like /dev/ACMx or /dev/USBx). It is blocking the master and the php->Arduino message
is limited to 60 char. Fast and robust (CRC and repetions). Useful with simple and fast Arduino responses.
Using USBphpTunnel (https://github.com/msillano/USBphpTunnel) the master is Arduino, and the Android app uses
ports like /dev/bus/dev/00X/00Y, so you don't need the serial driver. It is blocking the master (arduino) and
it allows big messages. It works in background of the main php program. Useful for data logging and RT.
Using USBphpTunnel_Fifo (https://github.com/msillano/USBphpTunnel_fifo) the master is php. It is NOT blocking the
master, allows payload up to 4k, allows concurrence (many users via WIFI). Works in background, and it is no fast
(depending from polling Arduno frequence, 5-15 sec. plus processing time). Well placed for long Arduino processes
(like waiting user actions).