I’m having trouble running rflink with homeduino sidebyside.
when running pimatic.js it works sometimes but most of the time i get:
Segmentation fault
in service mode it never starts.
if i remove homeduino from the config everything works fine.
New plugin for RFLink Gateway
I’m having trouble running rflink with homeduino sidebyside.
when running pimatic.js it works sometimes but most of the time i get:
Segmentation fault
in service mode it never starts.
if i remove homeduino from the config everything works fine.
@sweebee said:
I’m having trouble running rflink with homeduino sidebyside.
when running pimatic.js it works sometimes but most of the time i get:
Segmentation fault
in service mode it never starts.
if i remove homeduino from the config everything works fine.
I’m not running with Homeduino plugin in my setup but I’m also occasionally getting a Segmentation fault at startup, so it is not just caused when both are run simultaneously.
Also daemon mode never works for me as well. As I’m also using the ‘hap plugin’ and it was mentioned as a known problem there I did not yet spend time in debugging it.
Will experiment with it a bit to see if my plugin (most likely related to the serialport usage as it has a native component) is causing it and where/why. Anyone with a bit more experience with Node and native components is welcome to join in
Just released version 0.1.3 with an attempt to resolve segmentation faults.
Found that a call of .done() on promise was made during connect (most of that sequence was copied from homeduinojs). Bluebird API doc states:
Like
.then
, but any unhandled rejection that ends up here will crash the process (in node) or be thrown as an error (in browsers). The use of this method is heavily discouraged and it only exists for historical reasons.
I did not get the segmentation fault again during my tests and it now runs as daemon as wel. So I think it is either resolved, at least improved or I may have been extremely lucky during my tests
I get a timeout when sending. Also on startup pimatic sends a PING, but it doesn’t receive the PONG. I’m 100% sure I have the right port.
Edit: got it. Had to replug the arduino. Lets see if I can get my pirs working.
Well, its very unstable. Sometimes i have to reconnect the rflink. And pimatic crashes sometimes randomly.
If i switch to quick, it crashes: Segmentation fault
Hmm, I haven’t encountered a problem where replugging is necessary. Any indicators what might go wrong?
Does it really need a replug or does a restart of Pimatic also solve the issue?
After your problem occurs, try to stop Pimatic and connect a serial console to the RFLink (e.g. the one that comes with Arduino IDE) without replugging it to see if the RFLink still responds correctly. Use baud rate 57600 for connecting.
I did find out that my Pimatic segfaulted while I was at work. No guarantee that it was caused by RFlink plugin, but wouldn’t rule it out I did copy most of the serial connection management from homeduino plugin in hopes that that would be a good example, but may not have been perfect and/or butchered by me
What switch do you mean that causes your Segmentation fault? would be nice to have a way to reproduce it.
If i don’t replug the rflink i get a segmentation fault everytime i start pimatic.
If i replug it it works fine.
It crashed with a kaku dimmer.
Edit: Looks like its getting worse. I can’t start pimatic anymore, no matter what i try.
@sweebee said:
If i don’t replug the rflink i get a segmentation fault everytime i start pimatic.
If i replug it it works fine.
It crashed with a kaku dimmer.
Edit: Looks like its getting worse. I can’t start pimatic anymore, no matter what i try.
Ouch! maybe the sqlite db got corrupt in an unfortunate segfault?
I’ll start using my Kaku remote more (got 2 remotes and 2 codes in my switches, apparently Kaku and NewKaku).
Edit: Reading up a bit on the serialport module. See that doc states you MUST wait on an ‘open’ event and only read/write after that event has fired. Seeing no trace of it in my code (nor the original in homeduinojs) so I guess I’ll make an attempt to re-implement the serial port opening/handling…
Like I said I’ve completely refactored serial device handling.
It has run without crashes through last night and during my working day, a new stability record!
@sweebee: I released it as 0.2.0 and hope that it solves (most of) your stability issues as well. Please let me know how it goes.
Note that I ran Pimatic directly as daemon mode used to be completely unusable for me. I’m now running it in daemon mode to see if that has improved as well.
Thanks! I will try it today.
Edit: Still no luck. Worked for 10 minutes. then i got this:
error [pimatic-rflink]: TimeoutError: operation timed out
at afterTimeout (/home/pi/pimatic-app/node_modules/pimatic-rflink/node_modules/bluebird/js/main/timers.js:11:15)
at timeoutTimeout (/home/pi/pimatic-app/node_modules/pimatic-rflink/node_modules/bluebird/js/main/timers.js:53:9)
at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
11:12:28error [pimatic-rflink]: Error with connection to rflink device: operation timed out.
11:12:28error [pimatic-rflink]: TimeoutError: operation timed out
at afterTimeout (/home/pi/pimatic-app/node_modules/pimatic-rflink/node_modules/bluebird/js/main/timers.js:11:15)
at timeoutTimeout (/home/pi/pimatic-app/node_modules/pimatic-rflink/node_modules/bluebird/js/main/timers.js:53:9)
at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
11:12:28error [pimatic-rflink]: Error with connection to rflink device: operation timed out.
11:12:28error [pimatic-rflink]: undefined
11:12:28error [pimatic-rflink]: Error with connection to rflink device: undefined.
And now all i get is ‘timeout’. already rebooted the raspberry and replugged the rflink. On startup i get connected to rf link, but when switching i get timeout.
OK, its working again now after reduced the devices (RFlink devices) in my config, don’t know if its related but I’ll add more and see how it goes.
@sweebee: Does it work better with less devices?
I see that there may be a race condition during startup that causes it to miss the open event during connecting. It tries 3 times with a default timeout of 5 mins (felt pretty long but was also what homeduino connect used). This may be the part where you thought it to be working for 10 (15?) minutes, but actually it thought it was still connecting. To miss it 3 times in a row seems very unlucky however, but I can imagine timings are way different on your Pi than on my small server (low power CPU, but still way more capable than a Pi).
Hopefully tonight I can check it out and will also add a bit more logging to debug the problem when it happens.
@Moustaggio said:
@Stuntteam: are you involved in development of the RFLink and/or its firmware and protocol? If so then I would like to point out that its handling of the ID field seems a bit inconsistent. In RF signals received I get an ID of 8 hex characters, 1st and second being ‘0’, but when I try to send a command with that ID, it is not accepted. If I would remove the preceding two 0’s, then the command is accepted
Yes, that will be fixed asap…
Note that the PING/PONG should normally only be used to check if rflink is still alive after not having received any communication for x minutes.
I have 4 kaku switches which are controlled by rflink and its running fine now (since yesterday). I have 1 dimmer and 2 wall remotes that are still connected to homeduino. I’ll add them today and see if it keeps stable.
Now after a restart i get: not connected. Does it automatically reconnect or do I have to restart pimatic again?
know anyone this?
http://sourceforge.net/projects/rflink/?source=navbar
Thats the rflink firmware.
@Stuntteam said:
Note that the PING/PONG should normally only be used to check if rflink is still alive after not having received any communication for x minutes.
Yes, the PING message is only sent when there was not any data received for a certain time duration (configurable, 5 min by default)
@sweebee: has the connection been more stable using less devices?
I believe that what I thought might have been a race-condition is not one due to the single threaded event loop architecture of Node. However, I did find another potential issue that may explain why the connection might be closed when starting up of the Pimatic system would take too long (might explain why your system on the Pi did not work with more devices).
Also, I implemented an automatic reconnect function (was not yet present as the Homeduino plugin also didn’t seem to support it).
The new version 0.3.0 is published on npm registry.
@Moustaggio When its running it keeps running. But starting pimatic is a problem, most of the times pimatic won’t start or won’t connect to the rflink (timeout).
So when it can connect, it will keep running (worked for 2 days till i had to restart pimatic because i had to change something in the config).
Will try 0.3.0
Has some one experience with the difference between Homeduino and RFLink? I have looked at the RFLink firmware and I think it is really complicated programmed. But the RFlink hardware can be better.
pimatic rocks!!!