fralik / Duorem

27 stars 8 forks source link

Manually entered devices are not saved #7

Closed MScMSc closed 6 years ago

MScMSc commented 6 years ago

I use the "+" sign in the top bar to add a device, then select "Enter manualy (0.0.0.0)" I can change all fields, and press save. If it is the first device I enter, the main buttons are even enabled, and waking the device works. But there is still the test "No device is configured. Add one". And it seems that the app forgets the device, at least when it is closed. Consequently, I have to enter the device anew every time.

fralik commented 6 years ago

Do you enter the IP address for the device?

schimi2 commented 6 years ago

From what I know, the IP address should be optional. Because the WOL magic packet is sent as broadcast anyway. So the IP address would be just for client-side filtering of packets. And I once managed to send the WOL signal via Duorem just with the MAC address, so in general it works. The device just isn't saved.

fralik commented 6 years ago

Yes, you are right about the WOL. Only the MAC address is needed. Right now, I check if the host information entered by the user is valid or not by checking the IP address only. The idea behind this is that user wants not only to wake up a device, but to shut it down. Well, seems like it is not always the case. Will fix it. A quick fix for you - if you change the IP address just a bit, then everything should be saved.

fralik commented 6 years ago

Fixed in 2f7adb8. Will include in the next release.

MScMSc commented 6 years ago

Thanks for the workaround. I can now save my device, but waking it doesn't work. I'm unsure whether this is related to entering the IP address. To summarize my attempts:

  1. I enabled WOL on my device (a NAS)
  2. I verified WOL works through a little Windows command line tool called wol.exe
  3. I installed Duorem on my phone
  4. I connected the phone to the WIFI that is on the same router the NAS is connected to (although via cable)
  5. I entered the MAC address and a name for the device, but nothing else. After pressing "Save" I did not see a device listed, but the "Turn on" button was enabled. I pressed, and it worked.
  6. It kept working a couple more time, but did not work reliably. I put it down to Duorem not remembering the MAC address at some point
  7. I wrote the issue, and got your workaround
  8. I entered a name, IP address and MAC address (but no SSH info), and was able to save the device - it is now visible in my device list
  9. However, "Turn on" does nothing (except telling me that the wol package had been sent successfully)
  10. What does work now is that I see whether the device is running (green) or not (red)
MScMSc commented 6 years ago

Solved it. Will write a separate issue.

fralik commented 6 years ago

One thing I can think about is the broadcast address. If you edit your device in Duorem, there will be 'advanced options' toggle at the bottom. Two things related to WOL are there: WOL port number and broadcast IP address. I guess you use the default port, but if you entered the MAC address manually, then you probably need to enter the broadcast address as well. You can try to press 'Guess broadcast' button. You should of course do it when you are connected to WiFi.

You can read about the broadcast address here http://www.wolcenter.com/faq.php, paragraph "What is a broadcast address?".

Side note. When you add a new device in Duorem, it tries to scan your current WiFi network for available devices. This way you simply choose the device from the list and the ip address, mac address, device name are already entered for you (Duorem will attempt to get the broadcast address as well). Did you try it this way?

MScMSc commented 6 years ago

BTW, the reason I only want to wake my device, not shut it down: For waking, I do not need to enter any passwords. For shutdown, I'd have to enter a valid admin account. This does not suit me in this case.

fralik commented 6 years ago

This is a valid reason, of course. I guess you can play around a bit with setting up your system so that you do not need a full administrative account in order to shut it down. But you will need some kind of a user that can SSH to your machine.

fralik commented 6 years ago

Release 1.1.1 is out