Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

terRemote - Android remote app for EventGhost

Questions and comments specific to a particular plugin should go here.
r0lZ
Posts: 36
Joined: Thu Aug 08, 2013 7:00 am

Re: terRemote - Android remote app for EventGhost

Post by r0lZ »

terRemote wrote:first of all, the next version will probably contain an "action on error" option for the webview that is called whenever the content could not be loaded. There will also be a "reload" action for the WebView so that what you wanted to achieve should be possible by then.
Thanks! :-)
terRemote wrote:About the crash of mpg732: This is new to me. A similar behavior was once reported for the HTTP action, though. Do you use that? If it happens again, please try to reproduce the error for better diagnosis. That would be a big help.
I have never had that problem, excpet once, but terRemote was not running.

Regarding the Web View, I did another test, and I launched the app immediately after a reboot of my tablet, when the system is still busy initialising itself and is usually not well responsive. I got again the 404 error. It seems that the web is available only after some time, even if the wifi icon in the android taskbar shows that the connection is established. I don't remember if my previous test has been made in similar conditions, but it's possible.

BTW, Chris, I've noticed that terRemote starts on boot. I suppose it's to verify if the "Use background service" option is on, and if it's the case, to launch it. Since I don't need the background service, I have disabled terRemote from starting on boot with the Boot Manager Xposed plugin. Can you confirm that disabling it is safe?
User avatar
terRemote
Experienced User
Posts: 183
Joined: Tue May 22, 2012 8:13 pm

Re: terRemote - Android remote app for EventGhost

Post by terRemote »

Hi r0lZ,

thanks for the feedback. It is safe to disable this permission. The startup does nothing but to check the "Use background service" option and start the background service in case it is desired. No harm done by skipping this process.

Chris
mpg732
Experienced User
Posts: 92
Joined: Mon Aug 05, 2013 6:59 pm

Re: terRemote - Android remote app for EventGhost

Post by mpg732 »

Thanks for the response guys. I will try again adding the web view back and see if it happens again. Still love the app and this was the first time any thing like this ever happened. :D :D
mpg732
Experienced User
Posts: 92
Joined: Mon Aug 05, 2013 6:59 pm

Re: terRemote - Android remote app for EventGhost

Post by mpg732 »

OK, DL the update and I am having a problem. I have a bunch of icons that I have the "Design" set to blank. Just FYI, I also tried blank 1 and blank 2, but now I can now see the boarders of the buttons.
User avatar
terRemote
Experienced User
Posts: 183
Joined: Tue May 22, 2012 8:13 pm

Re: terRemote - Android remote app for EventGhost

Post by terRemote »

This is one of the bugfixes. Setting border width to zero should disable the border.

To obtain the previous behavior, try setting the border width to 1. Sorry if this causes you work.
r0lZ
Posts: 36
Joined: Thu Aug 08, 2013 7:00 am

Re: terRemote - Android remote app for EventGhost

Post by r0lZ »

Regarding the icon borders, I have had a little problem when I have imported the layouts made with the free version in the paid version. (This has occurred with the previous version, not the update of yesterday. I haven't tried the new version yet.)

The icons I use are external PNGs. In the original layout, they are scaled to 100 x 100 pixels. When they are imported in the paid version of terRemote, the scaling factor (and the other parameters) have not changed, but for whatever reason, the top border of each icon is truncated. Some pixels are missing. I have had to reduce the scaling to 90 x 90 in order to see the full icon. Of course, the icons are now smaller, and I had to move some of them slightly to align them correctly with other elements. No big deal, but I wonder why I had to resize the icons. Is it a bug during the export, the import, or in the paid version? Anyway, something changes when exporting from the free version and importing to the paid version.

If it's necessary, I can try to export and import from and to the free or paid version, or try with other icon size and scaling values, to determine exactly when the problem happens. Just let me know...

BTW, thanks for the improvements of the web view widget. I will modify my layouts to put them to good use. :-)
r0lZ
Posts: 36
Joined: Thu Aug 08, 2013 7:00 am

Re: terRemote - Android remote app for EventGhost

Post by r0lZ »

OK, I got the webview widget to refresh when the user presses a button. However, afaik, it is still not possible to hide it in case of an error, or at least to display something else than the default error message over its aggressive white background. I could of course change the URL of the widget to open a black page stored locally, but IMO, there should be an easier method. Any suggestion?

BTW, what is the usage of the "HTML" content field of the WebView widget? Is it possible to use that field to display a (very simple) page by specifying its HTML code in that field? Could it be used to store a fallback page in case of page not found error?


Also, I have tried to modify my clipboard sync macros to use the new base64 encoding possibility, but I can't get it to work.
The EventGhost script works as expected, and it sends the clipboard content encoded in base64. On the terRemote side, I have created a "receive clipboard" macro that is called when EventGhost sends the clipboard text. Currently, that macro simply prints "Clipboard: ${payload.0}" in a toast message. That works fine, and I can see the base64 encoded text in the toast message. But if I change the toast message text argument to "Clipboard: $base64dec{${payload.0}}", I see this in the toast message: "Clipboard: $base64dec{XXXXXXXX}" (where XXXXXXXX is the base64 encoded clipboard text). So, it appears that the base64dec function is not evaluated, and is considered as a single text. What am I doing wrong?

BTW, there is a little typo in the functions page of the terRemote doc. The title for the base64dec function is written "base64dev". (I have tried with that spelling too, just to be sure that the app has not the same typo, but that doesn't work either.)

[EDIT] Out of curiosity, I have also tried the base64enc function, but it doesn't work either.

I use v1.34 pro.

I have also another suggestion. To debug a remote, it might be useful to print messages in the terRemote log. Can you add a "Log" type to the Notification action?
mpg732
Experienced User
Posts: 92
Joined: Mon Aug 05, 2013 6:59 pm

Re: terRemote - Android remote app for EventGhost

Post by mpg732 »

terRemote wrote:This is one of the bugfixes. Setting border width to zero should disable the border.

To obtain the previous behavior, try setting the border width to 1. Sorry if this causes you work.
OK, so I can not find border width settings. Were do I set this?

Thanks
Mike
User avatar
terRemote
Experienced User
Posts: 183
Joined: Tue May 22, 2012 8:13 pm

Re: terRemote - Android remote app for EventGhost

Post by terRemote »

@r0lz:
Can you send me a (simple) export file of the free version and maybe again of the pro version (after the import of the first export file).
The bugs of your second post should be fixed in version 1.35 that comes out today. Sorry for that and than you for reporting! :-)
You can now set a different WebView content simply using the "WidgetData -> set -> HTML" action, something like "<body style='background:#000000; color=#ffffff;font-size:24pt''>ERROR</body>" does the trick. (Of course, the style is just for demonstration. It is not necessary but captures the three main styles you would like to control for error messages)

@Mike:
The setting I meant can be found when you edit the design of the button (by long-clicking in the design selection dialog). Edit the background shape, there you can find the border width. This should be set to one.
r0lZ
Posts: 36
Joined: Thu Aug 08, 2013 7:00 am

Re: terRemote - Android remote app for EventGhost

Post by r0lZ »

Well, I don't have the free version any more. I can re-install it, but I have lost the original layout anyway. I can send you the new version of the layout (fixed for the pro version), but I suppose that it's not useful for you.
You can probably reproduce the problem yourself. Make a PNG icon (100x100, with transparency), and load it in a button. The button parameters are this:

Design: Made with 3 PNG images, also 100x100.
Text: A single space (I suppose it can be completely empty, but I used a space to try to center the icon over the Design.
Text size: 16.0
Icon: On bottom
Space to text: 0
Width and height: 100
Position and size: Width and height: 108 and 104 (The position doesn't matter)
The other parameters should not matter.

Export and import, and you'll have to change the Icon width and height to 80 or the icon will be truncated.
I don't know if it is necessary to export from the free version and import to the paid one, but it's what I did.

I'm downloading the new version right now. I'll let you know if the base64 functions work as expected. Thanks anyway.
mpg732
Experienced User
Posts: 92
Joined: Mon Aug 05, 2013 6:59 pm

Re: terRemote - Android remote app for EventGhost

Post by mpg732 »

@Mike:
The setting I meant can be found when you edit the design of the button (by long-clicking in the design selection dialog). Edit the background shape, there you can find the border width. This should be set to one.[/quote]


This only works on a graphic I imported. All my other buttons and buttons that just have text in will not hide the boarders. Even though the all have the same design selected, including the one icon I imported which does work.
r0lZ
Posts: 36
Joined: Thu Aug 08, 2013 7:00 am

Re: terRemote - Android remote app for EventGhost

Post by r0lZ »

OK, checked v1.35, and it seems to work perfectly. The base64 functions work well now. However, I had to modify the python script on the EventGhost side, as the \ character was removed from the clipboard during the transfer. For example, copying "test\n" on the PC and then sending it to the android clipboard through EventGhost and terRemote resulted in "testn" being pasted. Strange. I don't know if it's EventGhost or terRemote that eats the backslash. Anyway, I have modified the python script to double all \ characters, and now, everything works well.

For people interested in knowing how to pass the PC clipboard to terRemote, here is the EventGhost python script I use:

Code: Select all

import win32clipboard
import base64
win32clipboard.OpenClipboard()
try:
    c = win32clipboard.GetClipboardData(13)
except:
    c = ""
win32clipboard.CloseClipboard()

if c == "":
    print "GetClipboardData error: No text in clipboard."
else:
    c = c.replace("\\", "\\\\")
    c = base64.b64encode(c)
    eg.plugins.NetworkSender.plugin.Send("System.Clipboard", [c])
And the action to implement in the terRemote macro is Android -> Clipboard Text: $base64dec{${payload.0}}

Thanks for the fix, Chris, and also for the new Log Entry notification type. 8)

Any chance to have some kind of TCP support in the future?
r0lZ
Posts: 36
Joined: Thu Aug 08, 2013 7:00 am

Re: terRemote - Android remote app for EventGhost

Post by r0lZ »

I have also checked the new Set HTML web view action, and it works fine, including from the "action on error" to overwrite the default error message in case of URL not reachable. So far so good. But I can't get the button that reloads the web view widget to work correctly. I've assumed that it should be sufficient to simply reload the web view to force the HTML code to disappear, and to try to reload the URL. However, even when the URL is reachable, after a reload, the web view still shows the HTML code. It seems that it is not cleared by the reload operation (even though I have not ticked the Permanent option). So, I have tried to clear it with an additional Set HTML action, and I leave the HTML field empty, but that doesn't work. With that action, the web view widget turns all white (without message), but it doesn't show the content of the URL.
In other words, it seems that the Reload method doesn't reset the web view widget completely, and that the Set HTML action doesn't work if the string is empty. So, currently, the web view displays correctly my own error message when it's necessary, but cannot be refreshed when the URL is available again. The only way to refresh it is to relaunch terRemote. Not really a good solution.
Can you have a look?
User avatar
terRemote
Experienced User
Posts: 183
Joined: Tue May 22, 2012 8:13 pm

Re: terRemote - Android remote app for EventGhost

Post by terRemote »

@Mike:
Can you send me a screenshot via mail? I'm not sure if I understand the problem correctly.

@r0lZ
Thanks for the detailed description. I'll give it a try.
Great work on the clipboard sync. I currently don't know where the backslashes are removed but if it's on the terRemote side, I'll fix it.
The reload method only reloads the currently displayed url or html content. It was meant to automatically reload the content on failure (because of the startup internet issues that were reported). The next version will contain a "reset" method to load a widget from the database in its original state. Moreover, the architecture of the url or html content will change slightly so that you should be able to switch between them and not lose the original url or html value. For now, you should be able to use the "WidgetData -> set -> url" action to reinstate the original content.
About the TCP support: Yes, I am planning to implement custom TCP protocols but I haven't decided in which way. My priority at the moment is to improve the user experience before I make any big additions to the functionality. Once I decide about the basic structure, however, I'll put a preliminar action in the beta version.

Best
Chris
r0lZ
Posts: 36
Joined: Thu Aug 08, 2013 7:00 am

Re: terRemote - Android remote app for EventGhost

Post by r0lZ »

OK, thanks for your explanations. If I understand correctly, the web view widget can only have the URL or the HTML defined at a time, and therefore, if I put the original URL back in the URL field, that should have the effect to clear the HTML field. Right?
Anyway, I will probably wait for the next release to implement my reload button. That will be easier with the new reset. Thanks.

I'll wait for the TCP feature. Thanks in advance. In the meantime, I'll try to not submit too many other suggestions or bug reports. I need that TCP stuff! ;-)
Post Reply