Jump to content

Recommended Posts

I'm working on a new project to control my hottub.  I'm designing using a RasPi 3+ and an 8 chan relay board.  I have a php function that does "$fd = fopen (/dev/ttyUSB0, w+) and fprint (fd, "0x%s", an octal string);  and relay 1 turns on, turns off - as does 2 thru 8. on off on off on... life is good.  

My problem:  Mfg info says 0xFF will return the status of all 8 relays as in "00100110".  I have tried all sorts of combinations of fprint 0xFF which seems to go OK.  Then fgets, fscanf, fread and the code just hangs.   Has anyone gotten this to work?  Can someone offer some help?

Thanks in advance.  (I'll owe u a beer)

Link to comment
https://forums.phpfreaks.com/topic/330335-lcus-8-usb-relay-module-8-channel/
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.