alexbain / lirc_web

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

no buttons except macros #58

Open avshi114 opened 6 years ago

avshi114 commented 6 years ago

Hi I will start by saying I noticed this issue: https://github.com/alexbain/lirc_web/issues/57

but it didn't work for me even after changing the lines...

anyway, I can only see the macro I created. tried to send http GET request for remotes and got nothing. GET request for macros gave me the proper macro! really weird...

luisgarcia87 commented 6 years ago

You need to change 4 lines of code in the lirc_NODE.js file. Lirc_web is the interface, but it's lirc_node that fetches the remotes/data. This file here: https://github.com/alexbain/lirc_node/blob/master/lib/lirc_node.js On my pi it's located here: /usr/lib/node_modules/lirc_web/node_modules/lirc_node/lib/lirc_node.js change line 32 and 53 stderr.split('\n'); to stdout.split('\n'); and change lines 37 from element.match(/\s(.)$/); to element.match(/\b(.)$/); and line 56 changed to element.match(/\b.\s(.)$/); start lirc_web, it'll work :)

credits to ionothanus and DropBearNinja

icefluffy commented 6 years ago

This solution did not work for me. I quadruple checked every line. Does stretch on raspberry pi ZeroW require usage of different regular expressions...?

ChayBrandon commented 6 years ago

Hi!

I've also tried the above fix on my Raspberry Pi 3 and it hasn't worked.

I am running the latest version of DietPi Linux DietPi 4.9.80-v7+ #1098 SMP Fri Mar 9 19:11:42 GMT 2018 armv7l GNU/Linux

Any suggestions on what could work?

I installed LIRC_WEB using npm install -g

Thanks

sqldiablo commented 6 years ago

I'm also having this issue on Raspbian Stretch 4.14 and the fixes to lirc_node.js don't work for me either. lirc_web runs, it just doesn't think I have any remotes configured.

ChayBrandon commented 6 years ago

I'm also having this issue on Raspbian Stretch 4.14 and the fixes to lirc_node.js don't work for me either. lirc_web runs, it just doesn't think I have any remotes configured.

I managed to get this working but I cannot remember what I changed in LIRC-WEB in order for it to work.

I have zipped my LIRC_WEB folder for you and attached it to this reply, give it a go and see if it helps in your situation at all.

lirc_web.zip

JHarding86 commented 5 years ago

I think there has been some copy paste mixups from this ticket here

The correct adjustments are as follows:

line 37: var remoteName = element.match(/\b(.*)$/);

line 53: var commands = stdout.split('\n');

line 56: var commandName = element.match(/\b.*\s(.*)$/);