-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The library doesn't connect to devices if I restart the node service #7
Comments
Thank you for your feedback. |
Hello Futomi,
but I sometimes make changes to my node project and I have to restart the service. once I restart my service your library stops talking to the air-conditioner.. in short when I do discoverDevices I get no response, I get response only when I restart my air conditioner. Thanks |
Thank you for explaining your situation. |
I am on Mac OS.
The startdiscovery works only when the server is first to start and then
clients.. if a device is already up and if I run the server, that device is
not discovered on start discovery
…On Wed, Jun 20, 2018, 1:52 PM Futomi Hatano ***@***.***> wrote:
Thank you for explaining your situation.
The point is that ECHONET Lite devices are sometimes not discovered using
the startDiscovery() method, isn't it?
What OS do you use? Windows 10?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEZ9dr5n7zhraNEg5AcybKboQ_IOCAjOks5t-gZdgaJpZM4UuvhD>
.
|
Thank you for letting me know the OS type. |
@HuzefaGadi, I encountered the problem you reported on Mac OS. It seems that some ECHONET Lite devices does not react to the discovery packet. Investigating the problem, I found that leaving a multicast group ( BTW, where do you live and what ECHONET Lite product do you use? If you don't mind, could you let me know that? I'd like to know what type of ECHONET Lite products are selling in which country. Thank you. |
Hi,
This issue also appears on Linux as well.. I am using a coral edge box and
running my scripts into it.
I am from India, and I am using echonetlite simulator instead of actual
devices as they aren't available here.
https://github.com/SonyCSL/MoekadenRoom this is the url for that simulator.
I would also like to know if the library supports batteries as well.
Thanks
…On Thu, Jun 21, 2018, 10:11 AM Futomi Hatano ***@***.***> wrote:
@HuzefaGadi <https://github.com/HuzefaGadi>, I encountered the problem
you reported on Mac OS. It seems that some ECHONET Lite devices does not
react to the discovery packet. Investigating the problem, I found that
leaving a multicast group (socket.dropMembership()
<https://nodejs.org/api/dgram.html#dgram_socket_dropmembership_multicastaddress_multicastinterface>
method) does not work well on Mac OS as expected. It'll take more time to
solve this problem.
BTW, where do you live and what ECHONET Lite product do you use? If you
don't mind, could you let me know that? I'd like to know what type of
ECHONET Lite products are selling in which country.
Thank you.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEZ9dgnF8-czjyzNurr-iVFt7Siw4jVnks5t-yPcgaJpZM4UuvhD>
.
|
Thank you so much for letting know. Most of actual ECHONET Lite products available in Japan reacts to the discovery packet. I'll try the MoekadenRoom. Thank you. |
I tried the MoekadenRoom. This module successfully discovered the MoekadenRoom devices. This module was run on Mac OS, and the MoekadenRoom was run on Win10 (64bit). The test code runs the discovery process multiple times, the MoekadenRoom was always discovered. Besides, whenever the test code runs, the MoekadenRoom is discovered successfully. |
Can u share that test code
…On Thu, Jun 21, 2018, 10:45 AM Futomi Hatano ***@***.***> wrote:
I tried the MoekadenRoom. This module successfully discovered the
MoekadenRoom devices. This module was run on Mac OS, and the MoekadenRoom
was run on Win10 (64bit). The test code runs the discovery process multiple
times, the MoekadenRoom was always discovered. Besides, whenever the test
code runs, the MoekadenRoom is discovered successfully.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEZ9dsNQFcOMPL_ulH3pnQLnLEswXDUXks5t-yvpgaJpZM4UuvhD>
.
|
Try this code: 'use strict';
process.chdir(__dirname);
// Load the node-echonet-lite module
var EchonetLite = require('node-echonet-lite');
// Create an EchonetLite object
var el = new EchonetLite({'type': 'lan'});
// Initialize the EchonetLite object
el.init((err) => {
if(err) { // An error was occurred
showErrorExit(err);
} else { // Start to discover devices
discoverDevices();
}
});
// Start to discover devices
function discoverDevices() {
console.log('Started.');
// Start to discover Echonet Lite devices
el.startDiscovery((err, res) => {
// Error handling
if(err) {
showErrorExit(err);
}
// Output the found device
var device = res['device'];
var address = device['address'];
var eoj = device['eoj'][0];
var group_code = Buffer.from([eoj[0]]).toString('hex'); // Class group code
var class_code = Buffer.from([eoj[1]]).toString('hex'); // Class code
console.log(address + ': ' + group_code + '-' + class_code);
});
setTimeout(() => {
el.stopDiscovery();
console.log('Stopped');
setTimeout(() => {
discoverDevices();
}, 10000);
}, 5000);
}
// Print an error then terminate the process of this script
function showErrorExit(err) {
console.log('[ERROR] '+ err.toString());
process.exit();
} |
I have the same code.. do this and see if it works... Start the simulator
and run your script.. stop your script and run it again.. keep the
simulator ON all the time..
See if the discover devices work then
…On Thu, Jun 21, 2018, 11:02 AM Futomi Hatano ***@***.***> wrote:
Try this code:
'use strict';process.chdir(__dirname);
// Load the node-echonet-lite modulevar EchonetLite = require('node-echonet-lite');
// Create an EchonetLite objectvar el = new EchonetLite({'type': 'lan'});
// Initialize the EchonetLite objectel.init((err) => {
if(err) { // An error was occurred
showErrorExit(err);
} else { // Start to discover devices
discoverDevices();
}
});
// Start to discover devicesfunction discoverDevices() {
console.log('Started.');
// Start to discover Echonet Lite devices
el.startDiscovery((err, res) => {
// Error handling
if(err) {
showErrorExit(err);
}
// Output the found device
var device = res['device'];
var address = device['address'];
var eoj = device['eoj'][0];
var group_code = Buffer.from([eoj[0]]).toString('hex'); // Class group code
var class_code = Buffer.from([eoj[1]]).toString('hex'); // Class code
console.log(address + ': ' + group_code + '-' + class_code);
});
setTimeout(() => {
el.stopDiscovery();
console.log('Stopped');
setTimeout(() => {
discoverDevices();
}, 10000);
}, 5000);
}
// Print an error then terminate the process of this scriptfunction showErrorExit(err) {
console.log('[ERROR] '+ err.toString());
process.exit();
}
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEZ9dmMXgbL4QeEDfw4VZiGZZDMncZVWks5t-y_0gaJpZM4UuvhD>
.
|
Did my code work well in your environment eventually? |
No I am facing same issue with your code too.. The problem happens only when you try the steps . I told you.. just restart your script while MoekadenRoom is ON and see if it still discover devices.. for me it stops discovering devices after I restart the script |
I did the steps you mentioned. In my environment, it works well. Hum, it seems to be difficult to solve... Anyway, I found another issue thanks to your feedback. I'll keep to try to solve the issue. If the issue were solved, your problem might be solved. I'll keep this issue to be opened for a while. Thank you. |
Will this library support batteries running on echonetlite? @futomi |
Do you mean the storage battery class specified in ECHONET Lite spec? |
Hi,
The library works only in this sequence.
start nodejs service > start the device it stops working if the sequence is changed, like the device is already running and then I restart/start the node service after that.
any help will be appreciated.
Thanks
Huzefa
The text was updated successfully, but these errors were encountered: