Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

203
Views
¿Por qué mi CGI Script no puede acceder a ttyUSB0?

Tengo un script CGI en lenguaje C, que abre el puerto serie ttyUSB0 en mi Raspberry pi, envía datos a mi dispositivo y obtiene una respuesta.

Este script funciona correctamente cuando lo ejecuto manualmente en la terminal, pero mi página web no puede acceder a este puerto para abrirlo.

Mi código :

 int main (void) { printf("Content-type: text/html\n\n"); const int fd = open ("/dev/ttyUSB0", O_RDWR | O_NOCTTY | O_SYNC); if (fd == -1) { printf ("error %d opening %s: %s", errno, "ttyUSB0", strerror (errno)); return 0; }

Y la respuesta en la página web: " error 13 al abrir ttyUSB0: Permiso denegado "

Y debajo de la salida del comando "id -Gn pi": pi adm tty uucp dialout cdrom sudo audio video plugdev games los usuarios ingresan netdev spi i2c gpio lpadmin

Gracias.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

El siguiente comando resolvió mi problema:

 sudo adduser www-data dialout
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!