Jump to content

KenHorse

Members
  • Posts

    57
  • Joined

  • Last visited

KenHorse's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

1

Community Answers

  1. Craziest damn thing. The installer added the extension=dio.so at the beginning of php.ini, hence the bracketed term afterwards Thanks for opening my eyes
  2. Ok, finally figured out what I needed to do in order to install the dio.so extension and that succeeded. Updated both php.ini (web and cli) to load extension dio.so I created a test file with the following contents: $fd = dio_open('/dev/ttyUSB0', O_RDWR | O_NOCTTY | O_NONBLOCK); dio_close($fd); Now, when I run it, I receive the following error: PHP Warning: PHP Startup: Unable to load dynamic library 'dio.so[PHP]' (tried: /usr/lib/php/20180731/dio.so[PHP] (/usr/lib/php/20180731/dio.so[PHP]: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/dio.so[PHP].so (/usr/lib/php/20180731/dio.so[PHP].so: cannot open shared object file: No such file or directory)) in Unknown on line 0 I have checked /usr/lib/php and it IS there: root@mypi:/var/www/html/WebRCP# ls /usr/lib/php/20180731/ build curl.so fileinfo.so iconv.so mysqlnd.so phar.so simplexml.so sysvshm.so xmlreader.so bz2.so dio.so ftp.so json.so opcache.so posix.so sockets.so tokenizer.so xmlwriter.so calendar.so dom.so gd.so mbstring.so pdo.so readline.so sysvmsg.so wddx.so xsl.so
  3. Yes, I've found no answers via several internet searches
  4. As the title says. I'm trying to install the dio-0.2.0 package (Raspian Buster) and first did a pecl list-all and the above was returned
  5. I didn't catch that change, no. As my device looks specifically for a CR (/r), that might be the issue. I'll give it a shot
  6. Kicken's script (above). I even quoted it
  7. I changed to /dev/ttyUSB0 and baud rate of 57600 to match my needs. I should receive "+1111" back from the external device. Script is named test root@mypi:~# php test 11111 string(0) "" root@mypi:~#
  8. As I said, this converter works just fine with minicom By the way, what prompted me to use this code for serial comm was that I tried using php_serial.class.php (which now appears to be https://packagist.org/packages/hyperthese/php-serial) but it never seemed to work right. I was unaware of the others listed at packagist so perhaps I should give THEM a try....
  9. /dev/snd/controlC1 - C-Media_Electronics_Inc._USB_PnP_Sound_Device /dev/ttyUSB0 - FTDI_FT232R_USB_UART_AH05WJ52
  10. USB > serial? https://www.amazon.com/Sabrent-Serial-Adapter-Chipset-CB-FTDI/dp/B006AA04K0/ref=sxts_sxwds-bia-wc-drs1_0?cv_ct_cx=usb+ftdi&dchild=1&keywords=usb+ftdi&pd_rd_i=B006AA04K0&pd_rd_r=ddec056b-609e-486c-b2d8-d38beba84201&pd_rd_w=0Ev9e&pd_rd_wg=sCNyr&pf_rd_p=ecbfa24d-f48c-4d5c-83aa-9549f4e7c925&pf_rd_r=ENNAVCF3SFBC582P3EJE&psc=1&qid=1602268074&sr=1-1-f6b8d51f-2c55-4dc3-89ad-0c3639671b2d Works very well with minicom
  11. I've had good luck using FTDI based converters with Raspbian. I've done a few searches about actually using stream_set_blocking function but not having any luck. As I've never worked with it before, are there some examples of its implementation (as in actual code examples)?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.