Hello,
I have relay as attached picture and USB<->serial port base on CP2102 . Is it possible use together these devices with domoticz ?? How to create
this software switch in domoticz to switch On/OFF relay via USB serial port ??
Regards
Waldek
Relay via USB serial port CP2102
Moderator: leecollings
Relay via USB serial port CP2102
- Attachments
-
- CP2102.png (275.78 KiB) Viewed 2384 times
-
- relay.png (196.19 KiB) Viewed 2404 times
Last edited by geotravel on Sunday 07 May 2017 19:16, edited 2 times in total.
Re: Relay via USB serial port CP2102
No you cannot connect the CP2102 to the Relay. The CP2102 is a serial port adapter unless it has RTS/DTR pins, then it might be possible.geotravel wrote:I have relay as attached picture and USB<->serial port base on CP2102 . Is it possible use together these devices with domoticz ?? How to create this software switch in domoticz to switch On/OFF realy via USB serial port ??
Re: Relay via USB serial port CP2102
Hi,
As attached picture USB serial converter have output RTS (in bottom output pins). So I can connect RTS pin to IN in board relay and send
command under linux to SET HI or LOW RTS line ???
As attached picture USB serial converter have output RTS (in bottom output pins). So I can connect RTS pin to IN in board relay and send
command under linux to SET HI or LOW RTS line ???
Re: Relay via USB serial port CP2102
It's DTR/RST not RTS.geotravel wrote:Hi,
As attached picture USB serial converter have output RTS (in bottom output pins). So I can connect RTS pin to IN in board relay and send
command under linux to SET HI or LOW RTS line ???
Name Pin # Type Description
...
RST 9 D I/O Device Reset. Open-drain output of internal POR or VDD monitor. An
external source can initiate a system reset by driving this pin low for
at least 15 μs.
Re: Relay via USB serial port CP2102
Take a look at the FF32 (FlyFish) http://www.flyfish-tech.com/FF32/index.php
Re: Relay via USB serial port CP2102
Please find attached picture where I marked green square DTR/RTS and this converter have output RTS line marked by red square
or it is mistake description on board
or it is mistake description on board
- Attachments
-
- CP2102.png (275.43 KiB) Viewed 2370 times
Re: Relay via USB serial port CP2102
Ok by if I have usb/serial converter with RTS line how to create bash or python script to send /dev/ttyUSB0 to set HI or LOW RTS line?
-
- Posts: 1
- Joined: Saturday 21 October 2017 15:57
- Target OS: Linux
- Domoticz version:
- Contact:
Re: Relay via USB serial port CP2102
I have published a detailed answer here: https://forums.gentoo.org/viewtopic-p-8 ... ml#8132756
Here is the short version:
Note that sending data on TX will probably mess RTS; see the Gentoo forum for details.
Here is the short version:
Code: Select all
#!/bin/bash
MySerialPort="/dev/ttyUSB0"
MyLatency="2"
echo "#include <fcntl.h>
#include <sys/ioctl.h>
main()
{ int fd; fd = open(\"${MySerialPort}\",O_RDWR | O_NOCTTY );
int RTS_flag; RTS_flag = TIOCM_RTS;
ioctl(fd,TIOCMBIS,&RTS_flag);
sleep (${MyLatency});
ioctl(fd,TIOCMBIC,&RTS_flag);
close(fd); } " | tcc -run -
Who is online
Users browsing this forum: No registered users and 1 guest