Driving an external USB relay board?

Comalco

Member
Licensed User
Longtime User
I picked up a couple of really low cost 2 relay USB I/O PCBs off ebay. They come with a small windows app to drive them. Sending a single ASCII character to them turns the relay on or off. Tera Term also drives the PCB no problems. I have a JXD Minipad 4.3in and a no-name Chinese 7in tablet, both running 4.0 or better. I have tried all day with the USB serial, USBdetails and other code examples I have found but neither seem to recognise the USB board being connected........but neither have they recorgnised other USB devices being connected either.

I must be doing something wrong? I have read a lot of threads and finished up playing with "UsbSerial library - Supports FTDI, Arduinos and other USB serial devices" thread of Erels.......

I know from Tera Term that the relay board is happy with 9600,n,8,1 port settings....

I know both tablets are happy to have an SD card connected to their USB port, so I am guessing the B4A examples I am playing with just arent configuring the USB port correctly to see the relay PCB.......but I cannot figure what is (or isn't) going on.......a little guidance would be appreciated if someone can tell me what I am doing wrong - or where or what I should be looking at?? thanks.
 

bitstra

Member
Licensed User
Longtime User
I picked up a couple of really low cost 2 relay USB I/O PCBs off ebay. They come with a small windows app to drive them. Sending a single ASCII character to them turns the relay on or off. Tera Term also drives the PCB no problems. I have a JXD Minipad 4.3in and a no-name Chinese 7in tablet, both running 4.0 or better. I have tried all day with the USB serial, USBdetails and other code examples I have found but neither seem to recognise the USB board being connected........but neither have they recorgnised other USB devices being connected either.

I must be doing something wrong? I have read a lot of threads and finished up playing with "UsbSerial library - Supports FTDI, Arduinos and other USB serial devices" thread of Erels.......

I know from Tera Term that the relay board is happy with 9600,n,8,1 port settings....

I know both tablets are happy to have an SD card connected to their USB port, so I am guessing the B4A examples I am playing with just arent configuring the USB port correctly to see the relay PCB.......but I cannot figure what is (or isn't) going on.......a little guidance would be appreciated if someone can tell me what I am doing wrong - or where or what I should be looking at?? thanks.

Hi comalco,

have look here: http://www.b4x.com/forum/additional-libraries-classes-official-updates/24835-usbserial-library-supports-ftdi-arduinos-other-usb-serial-devices.html#post143809...

Read and try the sample prjoject. Edit the device_filter.xml! You will need the vendor- and product ID for your pcb...

good luck

bitstra

Edit1: If you have diffic. with enabling usb-host, you will have to have look int this direction:
(in android terminal session use these commands to toggle usb-host mode on/off)
su
echo host > /sys/devices/platform/musb_hdrc/mode - usb host ON
echo peripheral > /sys/devices/platform/musb_hdrc/mode - usb host OFF


this works on my ROOTED tablet...
 
Last edited:
Upvote 0

Comalco

Member
Licensed User
Longtime User
Many thanks............

Hi comalco,

have look here: http://www.b4x.com/forum/additional-libraries-classes-official-updates/24835-usbserial-library-supports-ftdi-arduinos-other-usb-serial-devices.html#post143809...

Read and try the sample prjoject. Edit the device_filter.xml! You will need the vendor- and product ID for your pcb...

good luck

bitstra

Edit1: If you have diffic. with enabling usb-host, you will have to have look int this direction:
(in android terminal session use these commands to toggle usb-host mode on/off)
su
echo host > /sys/devices/platform/musb_hdrc/mode - usb host ON
echo peripheral > /sys/devices/platform/musb_hdrc/mode - usb host OFF


this works on my ROOTED tablet...

All good now for my 7in tablet.....still cannot get the 4.3 going though....more work required obviously
 
Upvote 0
Top