Answer the question
In order to leave comments, you need to log in
Why can't I get data from Arduino in PHP?
There is a simple sketch for the test:
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.print(152);
Serial.print("\n");
delay(1000);
}
<?php
exec('stty -F /dev/ttyUSB0 cs8 9600 ignbrk -brkint -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts');
$as = fopen('/dev/ttyUSB0', 'r+b');
var_dump(fgets($as));
fclose($as);
sudo usermod -a -G dialoutfor the current user and for the www-data user (for Apache).
Answer the question
In order to leave comments, you need to log in
You are a terrible person. In general, about your problem, there is something with setting up configs, I can’t tell you more precisely :(
Try the options from this article Arduino Host Client in C (Linux)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question