alexbain / lirc_web

Control LIRC from the web using NodeJS and lirc_node
125 stars 60 forks source link

SIMULATE support request #33

Open ghost opened 8 years ago

ghost commented 8 years ago

Would it be possible to add SIMULATE support in lirc_web ?

I have special interest in controlling RF devices in lirc_web. Actually something's wrong with lirc_web and SIMULATE. irsend SIMULATE commands that work just fine in a shell does nothing via lirc_web.

jimjamurcode looked into this already but he made too many changes for me to identify what's missing in the master branch.

ghost commented 8 years ago

Quoting JimJamUrCode : " From my research and digging through lirc_web source, lirc_web was unable to send a SIMULATE command without a little bit of modification. lirc_web did have the correct call in its irsend.js file, but the express node server and corresponding JQUERY ajax post command was missing. A few modifications to index.swig, config.json and lircrc file and I was able to create remotes with buttons that controlled RF devices all working from within lirc_web."

alexbain commented 8 years ago

Okay, thanks for providing some context. I'll take a look at that merge request and see if I can work out what was required to get SIMULATE support working.

Can you share any resources you've got on how to get LIRC working with RF? I'd be curious how to go about doing this.

ghost commented 8 years ago

lircrc file format : http://www.lirc.org/html/configure.html. Controlling 433MHz RF outlets with a RPI : https://www.raspberrypi.org/forums/viewtopic.php?t=66946&p=507171. Another lircrc exemple :https://marklodato.github.io/2013/10/24/how-to-use-lirc.html.

Some notes :

LIRCD_ARGS="--allow-simulate --uinput"

-My config may it helps:

pi@vivpi /etc/lirc $ tail -25 /etc/lirc/lircd.conf

begin remote

name SCREEN bits 12 flags SPACE_ENC|CONST_LENGTH eps 30 aeps 100

header 2453 529 one 1257 532 zero 660 532 gap 44813 toggle_bit_mask 0x0

  begin codes
      SCREEN_UP                    0x5D0
      SCREEN_STOP                  0xA90
      SCREEN_DOWN                  0x1D0
  end codes

end remote

pi@vivpi ~ $ cat ~/.lircrc begin prog = irexec remote = SCREEN button = SCREEN_UP config = ssh vivpi2 sudo /home/osmc/Radio_Frecuency/433Utils/RPi_utils/codesend 2774882 end

begin prog = irexec remote = SCREEN button = SCREEN_STOP config = ssh vivpi2 sudo /home/osmc/Radio_Frecuency/433Utils/RPi_utils/codesend 2774888 end

begin prog = irexec remote = SCREEN button = SCREEN_DOWN config = ssh vivpi2 sudo /home/osmc/Radio_Frecuency/433Utils/RPi_utils/codesend 2774884 end

JimJamUrCode commented 8 years ago

@vivgarot - That is essentially how i did it in my fork. I also saw a different pull request that created an http device that allowed for polling of its status and changing its state. Pretty interesting. I never looked at all of the branches that lirc web has. My implementation of RF needs some serious work, I tried adding an rf device a little while ago and was appalled by my own code. I quickly remembered I spent a week during Christmas cranking that mess out. There is a lot in the config file that can be done automatically in code, which would greatly simplify it.

JimJamUrCode commented 5 years ago

If anyone is still interested, I have updated my fork with a much cleaner implementation of this.

Go here