ArduinoLinuxSerial
1.0.0
これは、LinuxのPHP-Arduinoコミュニケーションのヘルパークラスです
1週間のグーグルとテストの後、このクラスを構築して、Linux(Master)で実行されているPHPからシリアルUSBを介してArduinoボードに通信します。
マスターメッセージの最大長は60 char(シリアルArduino Rxバッファーリミット)で、制限なしに応答(Arduinoから)です。 ' n' charはターミネーターとして内部で使用されます。プロトコルはCRC8を使用して正確性を保証します。エラーの場合、メッセージはエラー状態で終了する前に3回抵抗します。
BASHスクリプト(SerialArdUino.sh)を使用して、起動またはUSB(RE)接続後、Linux上のUSBデバイスをセットアップします。シリアル通信はすべてのメッセージに対して開かれています。BASHスクリプトでは、Arduino Auto Resetを避けるためにDTRピンが無効になっています。 (参照:https://playground.arduino.cc/main/disablingautoreseTosenserialConnection)
トラブルシューティング
設定
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拡張機能を備えた専用のWebサーバーとして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).