[OBSOLETE] Lightwave RF Integration (UK)

Thanks Chris - would it be same command Sudo kill -9 790 ? is the -9 correct?

when I type Sudi Kill -9 790 or 1359 and press enter it just starts a new line:-
pi@raspberrypi:~ $

does that means its worked?

@Obextra

Apologies, was at work.

First answer: yes, you must include the -9. So it would be: sudo kill -9 790

Second answer: Yes, it just takes you to the command prompt. There is no acknowledgement. But if you want to check if the process has been killed, just run ps aux | grep server again.

All you have to do next is type server.js and enter. You should then see the server running message.

You can also test to see if the script is working by opening up a browser on a PC on the same network, and typing the IP address of the Pi followed by the port number you are using (this is 8000 by default). e.g. 192.168.1.100:8000

You should see:

No route registered for /

in your browser if the script (server.js) is working correctly.

Cheers
Chris

Hi Chris - looks as though it’s killed it. But when I type server.js I get a message saying “command not found”

Thank you for your help

Not sure if this is the correct command but when i type node server.js i get the following message:

receiver socket listening .0.0.0.0:9761

Not sure what this means?

thanks again

Apologies, you run the server by typing:

node server.js

To stop it, press CTRL + C

Just saw your last message re 0.0.0.0:9761. This is exactly what you want … it’s working!

If you have completed @adamclark_dev first video, move on to the second video, where you setup the SmartThings.

Good luck!

Ah dam - im now getting Throw err;

Wish i had your knowledge

Can you provide a screenshot of the error?

I just ran through the setup again and the error has now gone, and says receiver socket again.

Now unless im being really stupid, im now following the second video and on my smarthings page i dont have the tab called My Device Type, only have My Devices.

Im assuming i set up under My Devices?

cheers Chris for your help

First thing, make sure you are on the European site, not the US site, as they are different:

https://graph-eu01-euwest1.api.smartthings.com

Second thing I recall doing, was going to My Device Handlers setting up a New Device Handler (from code). Then you can create a New Device on the My Devices tab. Its been a year or so since I did it, but I am sure that’s the order.

Cheers
Chris.

Yea my fault i selected the wrong video - set up all done, but nothing is working. When i select light On - Rapsberry Pi just wont stop sending Attempt - sending message: 002 etc etc unless i press Ctrl C to stop it

Would this have anything to do with Room ID and Device ID?

I have the new app with only one light switch at the moment, so i labelled as Room Id 1 and Device ID 1?

Also the register button seems to do nothing, and on the new Hub there is no screen just the Link symbol.

Read this post. It is worth checking to see if your Pi can accept URLs manually first.

Also, the multiple “Attempt” messages you are seeing are because you have to register the device first. See post here:

To be honest, all the answers are in this forum. Have a good read, because guarenteed, you are not the first one to ask these questions. Don’t worry, you can fix this.

Cheers
Chris.

Chris - your an absolute gentlemen, i have now managed to get it working and it works flawlessly. If I unplug the Rasperrby Pi3 to relocate it, will it automatically reconnect and work? I had the device out so I could play around with it.

Thanks again Chris, really appreciate your help
Mitch

That is great news!! Well done, I knew you were nearly there.

If you have the “forever service” running, then you will be able to unplug your Pi, move it, power it on, then the service will automatically restart your server. This is what the forever service does, in case of power cuts, etc.

Make sure:

You are not manually running the server, by typing “node server.js”. If you are press “CTRL + C” to close the server. Then start the “forever service” instead.

Commands to interact with service lwrf:

Start - "sudo service lwrf start"
Stop - "sudo service lwrf stop"
Status - "sudo service lwrf status"
Restart - “sudo service lwrf restart”

Well done and enjoy!

Chris

1 Like

Hi Chris - after everything was going well, this morning the light wouldn’t turn on, so I typed command node server.js and I get this error message. Do you have any idea?

First check to see if the service is running.

sudo service lwrf status

It might not even be your Pi server at fault. It may be an issue with the LWRF device or even ST.

If it is running still, leave it. But to answer you original question it looks like you are trying to run the server.js script from root location, instead of running it from the folder where the script is located.[quote=“Chris_Lambourne, post:365, topic:23875”]
You can also test to see if the script is working by opening up a browser on a PC on the same network, and typing the IP address of the Pi followed by the port number you are using (this is 8000 by default). e.g. 192.168.1.100:8000
[/quote]

This is what I get when checking the server

Your service stopped (exited) at 6:44am. You need to restart it:

sudo service lwrf start

I get this when running the status checker …

pi@raspberrypi:/var/www/evohome $ sudo service lwrf status
● lwrf.service - LSB: forever-service startup script for lwrf
Loaded: loaded (/etc/init.d/lwrf)
Active: active (running) since Fri 2017-04-28 23:11:51 UTC; 8h ago
Process: 507 ExecStart=/etc/init.d/lwrf start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/lwrf.service
├─827 /usr/local/bin/node /usr/local/lib/node_modules/forever/bin/monitor server.js
└─844 /usr/local/bin/node /var/www/lwrf/server.js

Apr 28 23:11:29 raspberrypi lwrf[507]: Starting lwrf
Apr 28 23:11:51 raspberrypi systemd[1]: Started LSB: forever-service startup script for lwrf.`