Giter Club home page Giter Club logo

crelay's People

Contributors

bobafetthotmail avatar chkdsk88 avatar derekatkins avatar heuvendw avatar imlunauwu avatar khilman avatar lunn avatar ondrej1024 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

crelay's Issues

Sainsmart 16 inputs card is recognised as 4/8

I am running crelay on an Ubuntu machine. I am replacing my conrad 4ch card with a sainsmart 16. when I run "crelay -i" i get: "Detected relay card type is Sainsmart USB 4/8-channel relay card (on FTDI chipid EECA5EC5, 8 channels)". I have tried both compiling from source and downloading the latest built binaries.

USB relay detection

I have a Sainsmart usb relay card and an ICOM 7300 ham radio that is also usb controlled. Each works well independent of the other. I have tried using different usb ports but I am having usb conflicts. When I type in crelay -i, I get the Sainsmart relay card and a Conrad card marked as icom7300. When I try to use the Sainsmart card, it will allow me to turn a relay on but returns this error 'libusb_control_transfer error (LIBUSB_ERROR_PIPE)' if I try to turn a relay off. I've loaded the driver for the Sainsmart card only.

Is there something in the detection part of the program that I could modify to just have it look for that card and nothing else?

John Kosobucki
[email protected]

Sainsmart 16-channel - QinHeng Electronics HL-340 USB-Serial

I purchased a Sainsmart 16-channel USB relay. There is support for the Sainsmart 16-channel relay within crelay, but upon further inspection after receiving the card, the card that I purchased (SKU: 101-70-208) is not HID compatible, and instead shows up as: QinHeng Electronics HL-340 USB-Serial. I could be wrong, but I don't think this variety is supported yet by crelay.

After finally finding the serial commands under the sainsmart wiki for the part number, I adapted a python script from pyusb to get it working initially, although I couldn't get the board to return a status (and I purchased two boards), at least the relays would turn on and off:

https://github.com/ldnelso2/sainsmart

Listen interface

Is possible to control the HTTP Server listen on 127.0.0.1?
Thx

Timer & Start/Stop time

Hi Ondrej
Nice work all of have done. May I suggest to add a timer and/or a start/stop time?
Greez

segfault after disconnect

Hi all,
I have a sainsmart 4 relay board, with these applications:

  • relay 1: not connected
  • relay 2: garage door pulse button
  • relay 3: 240V light socket with two led bulbs
  • relay 4: 240V magnetic water valve

Everything works fine, except relay 4. When I activate the relay through the web interface, the relay gets activated correctly and the page is reloaded as it should be. However, when I click to deactivate the relay, the daemon terminates with this in /var/log/messages:

Oct 26 20:23:39 localhost vmunix: [ 6640.879106] usb 2-1: USB disconnect, device number 4
Oct 26 20:23:39 localhost vmunix: [ 6641.143125] usb 2-1: new full-speed USB device number 5 using ohci-pci
Oct 26 20:23:39 localhost vmunix: [ 6641.335615] usb 2-1: New USB device found, idVendor=0403, idProduct=6001
Oct 26 20:23:39 localhost vmunix: [ 6641.335994] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Oct 26 20:23:39 localhost vmunix: [ 6641.336475] usb 2-1: Product: FT245R USB FIFO
Oct 26 20:23:39 localhost vmunix: [ 6641.343317] usb 2-1: Manufacturer: FTDI
Oct 26 20:23:39 localhost vmunix: [ 6641.350241] usb 2-1: SerialNumber: AI02JFXJ
Oct 26 20:23:39 localhost vmunix: [ 6641.371600] crelay[2861]: segfault at 40001fd ip b767cee6 sp bf8ca8c0 error 4 in libc-2.19.so[b7607000+16e000]

So it seems the relay board gets disconnected and connected again. Maybe there is kind of an issue with the board itself, which is weird because everything worked fine before when relay 4 was used for a light socket.

When I reload the daemon, all works fine again until I deactivate relay 4 again, after which the relay is correctly deactivated but the daemon terminates again due to this disconnection issue.

I use crelay 0.13. The CLI doesn't work either:

root@alix:~# crelay -i 3

Detected relay cards:
  #1	Sainsmart USB 4/8-channel relay card (serial AI02JFXJ)

Thanks!

Get this to work on Standard linux

Hi,

Will this project only work in a OpenWrt environment. Or can I get this to work on a standard Linux PC.
If yes, how?
I am somewhat missing How to get this to work for me. And I really would like to get this to work.

Kind regards,

Luc

crelay for OpenWRT

Hello,

Could this work on OpenWRT (linux-based) routers?
It would be great to be able to control relays with the only device that is turned on 24h/day in my house :-)

Thanks,
Joaoabs

Unable to Detect Relay Status (PiRelay app)

I have 2 channel HID interface relay board. It's successfully running under openwrt in daemon mode but I have problem with controlling it under PiRelay android app. Application have a problem with checking relay status after start and always sets relays as OFF. Is this a problem in PiRelay or my crelay configuration?

Multiple relay control?

Hi - maybe a stupid request, but I can't seem to get multiple relays to fire at the same time (not multiple boards, just multiple relays on a multi-channel relay)

This seems to work fine for me:
curl -d "pin=3&status=1" http://localhost:8000/gpio

but posting multiple variables doesn't seem to work no matter what syntax I have tried so far.

Sainsmart 16-channel with USB-HID

This currently suports the Sainsmart 4- and 8-channel relays which use FTDI, but the Sainsmart 16-channel uses USB-HID, and looks different from the current hidapi driver.

Has anyone tried the Sainsmart 16-channel. A very poor attempt at documenting them is on the Sainsmart page for this part:
http://www.sainsmart.com/mouse-over-image-to-zoom-sainsmart-16-channel-controller-usb-hid-programmable-control-relay-module-kit-sainsmart-16-channel-controller-usb-hid-programmable-control-relay-module-kit-sainsmart-16-channel-controller-usb-hid-programmable-contro.html

Relay does not switch states.

Hello. I am still in the early process of learning all things for raspberry pi, and has just discovered this amazing thing. I got it set up and web interface is working. I just have one problem. when i switch the relay(s) on, in my web interface (Probably the same if i use the POST or GET requests.), it gives me an error.
ERROR: Unable to pwrite 1 to gpio value: Operation not permitted
and the same with when i switch it off, of course.
ERROR: Unable to pwrite 0 to gpio value: Operation not permitted

This is probably a easy fix. Any help is accepted. :)

IFTTT?

Is it possible to make this work with ifttt? As in, "If You say "turn on relay", then Make a web request" with the webhook applet. Thanks.

Interactive Command LIne Documentation

In the Readme file, the interactive command line syntax is given as: crelay [-s ] -i | [] [ON|OFF]. For someone well versed in Linux, the syntax may be obvious from the above. But I am not, so it took me a long time to figure out that you have to repeat the crelay command after the pipe. What worked for me was: crelay -i [-s ] | crelay [] [ON|OFF]. I also put "-i" before the serial number. Perhaps you could give some example commands in the documentation to make it clear to newbies.

API to deal with multiple relays at once

process_http_request() (and the comandline, I think) can only deal with one relay at a time per call. It would be nice if there was a way of dealing with multiple in the one call.

Stable device path

Hi Ondrej
Thanks for a handy program.
The path to a device, that has no serial number, is changing depending on other factors than physical connection (linux). This makes it hard to configure for multiple relays, of the same kind.
I need a stable identification to a bunch of relays without serial numbers.

would you accept a pull request, with an alternative path, based on HW bus connection?
I would much prefer to contribute to an existing project, rather then creating a new one.
I imagine it will be a rewrite of the detection logic, using the underlying libusb-1.0
I would be unable to test on windows and mac.
Would that be within you scope for this project?

best regards
Simon Rigét
https://github.com/paragi/

Enhancement: Add Authentication

Hi Ondrej,
I have been using Your Software crelay for some time now. Is there a way to add some kind of access protection? Currently anyone on the local area network is able to switch. An access string (=password) that has to be added to any curl command, could be set in the crelay.conf file. I know this protection is definitely not "top notch", but it should be enough to stop random prank "attacks".
Best regards
Johannes

Sainsmart16 HID path is not stable

Apparently the HID path for my sainsmart16 is not stable.
If I unplug the device and then plug it back in again, the path is different.
I can see this in dmesg as I remove and re-insert the device into my machine:

[2332915.679529] hid-generic 0003:0416:5020.0005: input,hidraw0: USB HID v1.10 Device [Nuvoton HID Transfer] on usb-0000:00:14.0-4/input0
[2333625.965356] hid-generic 0003:0416:5020.0006: input,hidraw0: USB HID v1.10 Device [Nuvoton HID Transfer] on usb-0000:00:14.0-4/input0
[2336516.928041] hid-generic 0003:0416:5020.0007: input,hidraw0: USB HID v1.10 Device [Nuvoton HID Transfer] on usb-0000:00:14.0-4/input0
[2337168.447530] hid-generic 0003:0416:5020.0008: input,hidraw0: USB HID v1.10 Device [Nuvoton HID Transfer] on usb-0000:00:14.0-1/input0

I cannot see a good way in the HID API to find the underlying USB path, which as you can see IS stable "usb-0000:00:14.0-4" (and my second device on "usb-0000:00:14.0-1". I am open to suggestions?

Detection of relay card fails, if there is a usb serial thinghy

Hi.
Im doing some stuff on an OpenWrt install.
I have a noname generic usb relay card(HMI), that can be controlled via crelay.
Then i add a usb<->serial ttl thinghy.
Either a cp210x or an ft232 thing.. In both cases crelay latches on to those, and wont recognize the relay any more.
I can still use the usb2Serial to talk to the sensor, but the relay is off line
Is there any way to force is, so it uses the correct card ?

I have issue with turning my relay on and off.

Hi,

I am new in using relays, I see this https://www.raspberrypi.org/forums/viewtopic.php?t=110710 Please Help Noobs control 8 channel relay post and issues regarding it.
I have everything installed and I have connected my raspberry pi to a 8 channel usb relay. The device is detected.

pi@raspberrypi ~ $ sudo crelay -i
Detected relay cards:
#1 Sainsmart USB 4/8 channel relay card (serial AI04XQI3)
pi@raspberrypi ~ $sudo crelay 1 on
pi@raspberrypi ~ $

I have it up to the above point. I cannot turn on the relay or turn it off. I get no output!!! Please help. Thanks in advance.

Conrad 4 channel card suppoert?

after compiling with "make" and running crelay I got the follwoing message:

crelay, version 0.14

This utility provides a unified way of controlling different types of relay cards.
Supported relay cards:

  • Sainsmart USB-HID 16-channel relay card
  • Generic GPIO relays

why is the conrad card not listed as supported?
Currently is no card attached to the PC.

3d printer as a relay

Hi, i’m new to all this linux stuff, but the problem is that crelay sees my 3d printer as sainsmart relay and my printing software doesn’t see printer when crelay is on. How can a fix this problem? I use orange pi on armbian

Suggestions for Multiple Relay Hardware?

Can anyone suggest hardware for a total of 48 relay outputs?
Another thing, it needs to handle 16A @ 250VAC (at least for some of the relays)

I apologize if this is not the correct forum/channel for questions like this.

Crelay crash

Hi!

I have a problem. I use crelay on my OpenWRT router. It succesfully installed and it control my 1-CH relay card properly.

Unfortunately, crelay always crash after undefinied time (~1 minute - ~1 day). Sometimes a fast router-reboot is enough, but usually I have to re-install the package.

This issue is very weird, because I can't find any reasons. It happens randomly. When I use (switch on/off) the relay, suddenly the web UI disappear, and my web broswer can't estabilish the connection with crelay anymore. Moreover, PiRelay neither. It sends me an error message:

"Pi (server) not detected on network"

Do you have any ideas (or solutions?)

Thank you in advance! ;)

Relay detection

I'm having an issue getting crelay to properly detect my relays; I've got a pair of sainsmart 16ch relays. I'm running crelay on a raspi with either of the relays attached, but the code runs through autodetect without finding them. Any recommendations or suggestions?

Much appreciated!

Compliments !

Great great work! Simply amazing.
Everything went nice and smooth. Installation on Ubuntu 18.04 without any hiccups.
Just wanted to say thank you ❤️ 🚀

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.