Page 1 of 2

Android application

Posted: 29 Feb 2020, 22:49
by tiomny
Please take a look at the small application I developed for searching, configuring and bookmarking Espeasy devices.
Application can find Espeasy devices by Wifi AP, mDNS, scanning local network. JSON data is downloaded from device and if the data corresponds to Espeasy, device could be bookmarked.
At this moment the only devices found by scan could be bookmarked, and the STA MAC is unique Id of the device, so each time you bookmark device, the info including it's IP will be replaced. I'm going to change this behavior in the next release.
Link to application in Google Play

Please do not hesitate to open tickets on the App page: https://github.com/iotschmied/IotMage/issues

Re: Android application

Posted: 01 Mar 2020, 00:06
by TD-er
Number of installs is already at 1+ now :)

It only found 1 ESPEasy node, my Octopi computer and a Cisco switch.
And there is for sure a lot more to be found on my network.
Also I'm missing the option to select a subnet to scan.
For example I do have several subnets here, like 192.168.10.x, 192.168.88.x and 192.168.1.x
The phone is connected to the same subnet as all my ESP nodes are, so they should be visible.
It is a flat, bridged network where I tested, so no routers interfering with scans.

Deep scan is quite slow, so maybe you could perform the scan a bit more layer by layer and not per IP.
Then you would see results much faster.
So far the deep scan is now at 40% of this subnet and all it found is ESPEasy nodes, so that's good.

Maybe we can also agree on some information to make available for your app to recognize build info and list it as such in the search results. We already have some JSON endpoints available, and there will be more in the near future.

Also when listening to our p2p traffic, you may find nodes much faster.

Re: Android application

Posted: 01 Mar 2020, 00:21
by TD-er
OK, from a UX viewpoint...
I perform a deep scan as that's the only way the nodes (not all) can be seen.
I do select the "select all" and go back to the main menu.

Nothing shows there, so what is the application demanding me to do?
For now it is a terribly slow network scanner as the screenshots on Google Play suggest a lot more functionality.

So this could use a bit more attention to the UX and maybe think of a use case and the work flow that comes with it.

Re: Android application

Posted: 01 Mar 2020, 07:21
by tiomny
Thank you for the feedback.
I will mark points you mentioned as the most important for the next release. Selecting different networks, manual device addition is the top priority in development.
Deep scan uses Httpclient to download json data. Other protocols might be blocked in the network, so I'm not sure that using them is the best practice in order to increase deep scan speed. The only way I see is to decrease response timeout.
Regarding UX: did you press Plus button after selecting devices? I agreed that's not obvious, I will think about changing that.

Re: Android application

Posted: 01 Mar 2020, 14:07
by TD-er
I did (at the 4th attempt of running a deep scan) indeed press the + button.
Now the nodes are listed in the app, but I cannot do anything with it.

I get the error net::ERR_CLEARTEXT_NOT_PERMITTED.

Maybe it is something in Android 10?

Re: Android application

Posted: 01 Mar 2020, 20:21
by tiomny
Since Android 9 the Webview doesn't allow opening HTTP by default.
Fixed version is in GP.

Re: Android application

Posted: 01 Mar 2020, 20:40
by TD-er
OK, next issue:
It does not show anything for nodes that require a login.

Also sometimes a node may react a bit slow (Gratuitous ARP not enabled) but the app does not try to reload on its own.
Maybe also sending a ping to the nodes may help quite a lot in connectivity.

Maybe you should also do this before scanning, sending out a ping to all in the subnet before scanning.

Re: Android application

Posted: 02 Mar 2020, 06:48
by tiomny
i made deep scan process parallel - hopefully that didn't break searching.
Will take a look at other issues asap.

Re: Android application

Posted: 02 Mar 2020, 08:36
by TD-er
Parallel scan is now much, much more responsive.
Still it would be nice if there is some indication on what it is doing in the last % as it is stuck at 99% now.

It doesn't find one of my Sonoff devices.
Not sure if you use a range of MAC addresses?

It has:
STA MAC: 5C:CF:7F:F9:6F:A5
AP MAC: 5E:CF:7F:F9:6F:A5

It is also using quite an old build:
Libraries:⋄ ESP82xx Core 2_4_2, NONOS SDK 2.2.1(cfd48f3), LWIP: 2.0.3
GIT version:⋄
Plugins:⋄ 46 [Normal]
Build time:⋄ Dec 14 2018 00:59:42

Re: Android application

Posted: 02 Mar 2020, 08:52
by tiomny
There's a mistake in my code that leads to incorrect updating of a scan progress - will fix it soon.
Regarding device with an old build - does it provide JSON data at <ip>/json? If not, such device couldn't be resolved hence "found" in the app.
Besides, I'm thinking of increasing the response timeout because I'm not sure that all devices can answer in 500ms to application request.

Re: Android application

Posted: 02 Mar 2020, 09:08
by TD-er
The old one also has /json.
But not sure what you expect in it.
Maybe its content has changed since?

Code: Select all

{"System":{
"Build":20103,
"Git Build":"",
"System libraries":"ESP82xx Core 2_4_2, NONOS SDK 2.2.1(cfd48f3), LWIP: 2.0.3",
"Plugins":46,
"Plugin description":" [Normal]",
"Local time":"2020-03-02 09:06:48",
"Unit":11,
"Name":"Sonoff_TH16",
"Uptime":18594,
"Last boot cause":"Cold boot",
"Reset Reason":"Power on",
"Load":14.20,
"Load LC":3292,
"Free RAM":18672
},
"WiFi":{
"Hostname":"Sonoff-TH16-11",
"IP config":"DHCP",
"IP":"192.168.10.83",
"Subnet Mask":"255.255.255.0",
"Gateway IP":"192.168.10.254",
"MAC address":"5C:CF:7F:F9:6F:A5",
"DNS 1":"192.168.88.1",
"DNS 2":"0.0.0.0",
"SSID":"MikroTik",
"BSSID":"BA:69:F4:9F:21:FB",
"Channel":1,
"Connected msec":33440963,
"Last Disconnect Reason":201,
"Last Disconnect Reason str":"(201) No AP found",
"Number reconnects":17,
"RSSI":-55
},
"nodes":[
{"nr":3,
"name":"BME280",
"build":20104,
"platform":"ESP Easy Mega",
"ip":"192.168.10.67",
"age":1
},{"nr":4,
"name":"lora4",
"build":20104,
"platform":"ESP Easy Mega",
"ip":"192.168.10.69",
"age":1
},{"nr":11,
"name":"Sonoff_TH16",
"build":20103,
"platform":"ESP Easy Mega",
"ip":"192.168.10.83",
"age":1
},{"nr":75,
"name":"breadboard test",
"build":20104,
"platform":"ESP Easy Mega",
"ip":"192.168.10.86",
"age":1
},{"nr":118,
"name":"CO2_tracker1",
"build":20104,
"platform":"ESP Easy Mega",
"ip":"192.168.10.78",
"age":1
},{"nr":242,
"name":"Sonoff POW R2 242",
"build":20104,
"platform":"ESP Easy Mega",
"ip":"192.168.10.81",
"age":1
},{"nr":250,
"name":"Sonoff POW R2 250",
"build":20104,
"platform":"ESP Easy Mega",
"ip":"192.168.10.79",
"age":1
}],
"Sensors":[
{
"TaskValues": [
{"ValueNumber":1,
"Name":"Switch",
"NrDecimals":2,
"Value":1.00
}],
"DataAcquisition": [
{"Controller":1,
"IDX":0,
"Enabled":"false"
},
{"Controller":2,
"IDX":0,
"Enabled":"false"
},
{"Controller":3,
"IDX":0,
"Enabled":"false"
}],
"TaskInterval":0,
"Type":"Switch input - Switch",
"TaskName":"Button1",
"TaskEnabled":"true",
"TaskNumber":1
},
{
"TaskValues": [
{"ValueNumber":1,
"Name":"Switch",
"NrDecimals":2,
"Value":0.00
}],
"DataAcquisition": [
{"Controller":1,
"IDX":0,
"Enabled":"false"
},
{"Controller":2,
"IDX":0,
"Enabled":"false"
},
{"Controller":3,
"IDX":0,
"Enabled":"false"
}],
"TaskInterval":0,
"Type":"Switch input - Switch",
"TaskName":"Relay1",
"TaskEnabled":"true",
"TaskNumber":2
},
{
"TaskValues": [
{"ValueNumber":1,
"Name":"Temperature",
"NrDecimals":2,
"Value":21.40
},
{"ValueNumber":2,
"Name":"Humidity",
"NrDecimals":2,
"Value":36.50
}],
"DataAcquisition": [
{"Controller":1,
"IDX":0,
"Enabled":"false"
},
{"Controller":2,
"IDX":0,
"Enabled":"false"
},
{"Controller":3,
"IDX":0,
"Enabled":"false"
}],
"TaskInterval":5,
"Type":"Environment - DHT11/12/22  SONOFF2301/7021",
"TaskName":"AM2301",
"TaskEnabled":"true",
"TaskNumber":3
}
],
"TTL":5000
}

Re: Android application

Posted: 02 Mar 2020, 09:20
by tiomny
The "MAC address" field is "STA MAC" in newer builds. I'll add support of old builds.

Re: Android application

Posted: 03 Mar 2020, 13:58
by Wiki
+1 installed.
Deep network scan shows up with 8 out of 15 permanently running devices. The oldest relase shown found is ESP_Easy_mega-20190315_normal_core_241_ESP8266_4M.bin , the not found devices are older. For me thats OK, I am planning to update the missing devices.
But the deep scan runs pretty fast, takes only seconds. Looks good, helpful tool to manage ESPEasy devices, thanks for the idea and the work.

Idea for future releases: I have several devices with configured deep sleep. All of them contain a rule

Code: Select all

On DisableSleep Do
NoSleep
EndOn
If I need access to them currently I am sending a ping -t on their IP and at the moment they are responding I am sendig a

Code: Select all

http://192.x.x.x/control?cmd=event,DisableSleep
do my job and send them back to sleep.
It would be nice to have this procedure automated somehow.

[edit]
I forgot:
Running on Alldocube Freer X9 Tablet Android 6.0
[/edit]

Re: Android application

Posted: 03 Mar 2020, 14:16
by Wiki
+1 installed
Doogee Y8, Andriod 9.0
Works as well as my Tablet.

Re: Android application

Posted: 03 Mar 2020, 14:23
by Wiki
Going to /Tools/log the logging info page shows an error:

Code: Select all

Error: Chrome4 is not supported! Please try a modern web browser.
But afterwards the log itself is shown correctly.

Re: Android application

Posted: 03 Mar 2020, 16:00
by hvdwolf
Wiki wrote: 03 Mar 2020, 14:23 Going to /Tools/log the logging info page shows an error:

Code: Select all

Error: Chrome4 is not supported! Please try a modern web browser.
But afterwards the log itself is shown correctly.
Most probably this is the standard webviewer on your device which is used by the Anroid app and which is indeed quite old being an Android 6 device.
And also: it does not mean it is not working. Only that more modern functionalities are not supported. But in this case it is only a simple webpage from the espeasy.

Re: Android application

Posted: 03 Mar 2020, 18:46
by tiomny
Wiki wrote: 03 Mar 2020, 13:58 Idea for future releases: I have several devices with configured deep sleep. All of them contain a rule

Code: Select all

On DisableSleep Do
NoSleep
EndOn
If I need access to them currently I am sending a ping -t on their IP and at the moment they are responding I am sendig a

Code: Select all

http://192.x.x.x/control?cmd=event,DisableSleep
do my job and send them back to sleep.
It would be nice to have this procedure automated somehow.
That's a great idea, thank you for it. I will take this into consideration but I can't promise that such kind of functionality will be implemented soon - highest priority at this moment are stabilization, UX, support more types of devices and more flexible management of devices.

Re: Android application

Posted: 04 Mar 2020, 01:22
by Wiki
hvdwolf wrote: 03 Mar 2020, 16:00
Wiki wrote: 03 Mar 2020, 14:23 Going to /Tools/log the logging info page shows an error:

Code: Select all

Error: Chrome4 is not supported! Please try a modern web browser.
But afterwards the log itself is shown correctly.
Most probably this is the standard webviewer on your device which is used by the Anroid app and which is indeed quite old being an Android 6 device.
And also: it does not mean it is not working. Only that more modern functionalities are not supported. But in this case it is only a simple webpage from the espeasy.
Nope, I am getting this messages on my Android 9.0 device, too.

Re: Android application

Posted: 04 Mar 2020, 01:28
by Wiki
tiomny wrote: 03 Mar 2020, 18:46 That's a great idea, thank you for it. I will take this into consideration but I can't promise that such kind of functionality will be implemented soon - highest priority at this moment are stabilization, UX, support more types of devices and more flexible management of devices.
Sounds good - and I have the same patience to wait for an implementation as I have waiting for a response of the deep sleep device..... :D

Re: Android application

Posted: 04 Mar 2020, 06:42
by tiomny
Wiki wrote: 04 Mar 2020, 01:22 ...
Nope, I am getting this messages on my Android 9.0 device, too.
I'm not sure that that would help but try updating Webview: https://play.google.com/store/apps/deta ... id.webview

Re: Android application

Posted: 04 Mar 2020, 13:48
by Wiki
Thank you for the link and your effort.
I won't update any device of mine without need - my personal philosophie. Never touch a running system.
Log is working - up to now - and doesn't have first priority. I only wanted to let you know.

Re: Android application

Posted: 22 Mar 2020, 16:31
by tiomny
Version 1.0.6 update:
* Manual add of device
* Possibility of saving devices with the same MAC
* Update device dialog when device with the existing MAC is added

Known issues:
* Sometimes device info update is not displayed on the main screen;
* Secured device web page might not be opened.

Re: Android application

Posted: 22 Mar 2020, 20:11
by TD-er
Updated the app.

The scan does show nodes already known (and keeps showing them even adding and having them as duplicate in the list)
But it is also showing nodes that are not ESPEasy nodes like the Cisco switch or Octopi instance (3D printer frontend on Raspberry Pi)

The ESP32 node is not shown in the list.

Re: Android application

Posted: 22 Mar 2020, 23:12
by tiomny
Current UI might be slight confusing regarding showing known devices. This is an expected behavior because the app identify devices by MAC, and I wanted to keep possibility of adding devices with the same MAC but different addresses.
There is a 'Scan' which uses mDNS and 'Deep Scan' which tries to download json from each address in the same subnet.
mDNS scan could probably discover non-ESPEasy devices - I will check that and fix.

Re: Android application

Posted: 22 Mar 2020, 23:20
by tiomny
By the way, isn't that a bug that json could be downloaded from a secured device without entering credentials?

Re: Android application

Posted: 23 Mar 2020, 07:02
by grovkillen
tiomny wrote: 22 Mar 2020, 23:20 By the way, isn't that a bug that json could be downloaded from a secured device without entering credentials?
The JSON is used by some to fetch data. So it's not a bug, but we're gonna add the possibility to have it locked down. A even bigger deal is that you can reach the upload page without credentials... We'll lock that down eventually as well.

Re: Android application

Posted: 23 Mar 2020, 08:31
by tiomny
I would recommend to implement security per page/resource. That way user can select which page/resource should be password protected and which not. Moreover, I would make separate security for JSON - without authorization it would give the only basic information about an ESPEasy device, and when user is authorised, it would provide all the information.

Re: Android application

Posted: 23 Mar 2020, 11:24
by TD-er
Sure and also the levels of "no protection" and "admin" are also a bit limited.

Re: Android application

Posted: 24 Mar 2020, 23:22
by tiomny
Version 1.0.9 update:
* Fix edit info screen;
* Scan network screen now does not display non-ESPEasy devices.

Version 1.0.8 update:
* Fix: Device not updated in list after edit info.

Version 1.0.7 update:
* Open secured devices.

Re: Android application

Posted: 04 Apr 2020, 00:39
by tiomny
Version 1.1.0 update:
* UI rework;
* User can select subnet for searching devices;
* Existing devices are displayed with different color on scan pages;
* User can select icon and icon color of device to be displayed on the main screen;
* User can select start page of device to be opened when browsing to device view page. Mark current page as starting is possible from the browsing screen as well.

Re: Android application

Posted: 04 Apr 2020, 18:47
by tiomny
I am localizing the application, so, if someone wants the app to be localized to their language, please feel free to provide with the updated texts.
langs.zip
(1.32 KiB) Downloaded 419 times

Re: Android application

Posted: 04 Apr 2020, 20:44
by chemmex
Tried to "Scan WiFi", found unconfigured ESPEasy in AP mode, entered wpa passphrase - nothing added to the list

Re: Android application

Posted: 04 Apr 2020, 20:56
by tiomny
chemmex wrote: 04 Apr 2020, 20:44 Tried to "Scan WiFi", found unconfigured ESPEasy in AP mode, entered wpa passphrase - nothing added to the list
1. Does your device provide JSON at http://<ip>/json?
2. Isn't your device protected by admin password?
3. Most likely that your issue related to this EspEasy issue: https://github.com/letscontrolit/ESPEasy/issues/2985

Re: Android application

Posted: 04 Apr 2020, 23:17
by Wiki
1st try to give German translation (have to see the result in the application)
I hope, I didn't mix up the Russian columns......

Re: Android application

Posted: 05 Apr 2020, 07:08
by chemmex
tiomny wrote: 04 Apr 2020, 20:56
1. Does your device provide JSON at http://<ip>/json?
2. Isn't your device protected by admin password?
3. Most likely that your issue related to this EspEasy issue: https://github.com/letscontrolit/ESPEasy/issues/2985
1. Yes
2. No
3. I see nothing common with that issue as the ESPEasy is in AP mode

Can you explain the logic behind the "Scan WiFi" item?

Re: Android application

Posted: 05 Apr 2020, 08:27
by tiomny
chemmex wrote: 05 Apr 2020, 07:08 1. Yes
2. No
3. I see nothing common with that issue as the ESPEasy is in AP mode

Can you explain the logic behind the "Scan WiFi" item?
Well, actually "Scan WiFi" uses "WiFiConnect" command to configure node. After running this command application downloads json data and checks if the IP is configured. Since WiFiConnect does not configure device properly, application doesn't add the device to device list.

Re: Android application

Posted: 05 Apr 2020, 08:56
by tiomny
Wiki wrote: 04 Apr 2020, 23:17 1st try to give German translation (have to see the result in the application)
I hope, I didn't mix up the Russian columns......
Thanks a lot!
I'm implementing the functionality you requested, could you update the table with necessary translations?
Translations.zip
(9.22 KiB) Downloaded 453 times

Re: Android application

Posted: 05 Apr 2020, 09:35
by chemmex
tiomny wrote: 05 Apr 2020, 08:27 Well, actually "Scan WiFi" uses "WiFiConnect" command to configure node. After running this command application downloads json data and checks if the IP is configured. Since WiFiConnect does not configure device properly, application doesn't add the device to device list.
I press "Scan WiFi", I get to the list of available APs, I choose the ESPEasy node to configure, I press "Add", then enter "configesp" and immediately get back to the scanned AP list with my node checked. And yes, the phone is connected to my node. What should I do next to further configure the node?

Re: Android application

Posted: 05 Apr 2020, 09:57
by tiomny
chemmex wrote: 05 Apr 2020, 09:35
tiomny wrote: 05 Apr 2020, 08:27 Well, actually "Scan WiFi" uses "WiFiConnect" command to configure node. After running this command application downloads json data and checks if the IP is configured. Since WiFiConnect does not configure device properly, application doesn't add the device to device list.
I press "Scan WiFi", I get to the list of available APs, I choose the ESPEasy node to configure, I press "Add", then enter "configesp" and immediately get back to the scanned AP list with my node checked. And yes, the phone is connected to my node. What should I do next to further configure the node?
Oh, now I see.
That's actually my fault: I would had to provide with more detailed instruction.
Well, here it is:
1. Your phone should be connected to the AP which you are going to connect your node to.
2. On the "Scan WiFi' page select nodes that you are going to connect to your main AP.
3. Press "Add".
4. Application ask you for a password. This is not the password for the node - default node AP password already exist in application and application tries to connect to your node with this default password. Probably, I will implement configurable default node AP password - but not now.
So, application asks you for a password. This is the password of the AP which you intend to connect your node to.
5. Then application proceeds some work internally. It tries to:
5.1 connect to your EspEasy AP,
5.2 download json info,
5.3 run EspEasy commands: WiFiSSID, WiFiKey, Save, WiFiConnect.
5.4 download json data again
5.5 analyze if the node has been successfullt confiured by checking json.WiFi.IPAddress field. If it is not a valid IP, application does not add the device to the device list.

Please check your steps 1 and 4 and ping me back if have any concern.

Re: Android application

Posted: 05 Apr 2020, 12:50
by Wiki
Jepp, here we are....

Re: Android application

Posted: 05 Apr 2020, 21:01
by tiomny
Wiki wrote: 05 Apr 2020, 12:50 Jepp, here we are....
Thank you, I really appreciate your help.
Now the version 1.2.0 is in GP.
In this version I implemented the functionality you suggested: application can wait until device awakes, execute command on connect, and execute other command when disconnects from device.

Re: Android application

Posted: 06 Apr 2020, 00:52
by Wiki
Nice job, entering "event,DisableSleep" triggers my rule on the desired device and it shuts off the deep sleep by its own rule. The way you implemented the awakening command I even should not have to define an own rule, the command "NoSleep" would be sufficient. Thank you, you made my day.

Up to now the localizing to German looks good, but I am not quite through - I will report.

Some small hints:
- Adding a device manually I've had a typo in the ip address (doubled dots). Hitting "Save" didn't react in any way. For such a selfconcious individuum like me it would be helpful if at least a global error message would appear like "something wrong with your data" or whatever - cause I personally am never doing anything wrong - never ever.
- I am not able to scroll in the devices pages, I don't remember if it was possible in older releases. This is independent form the different devices I tried with, Android 4.1, 6.0 or 9.0
- Still error in log screen "Chrome4 not supported", but log itself works. The error is indepentdent from device, Android version, installed Chrome version or Webview version
- DeepSleep functionality: On the page when waiting for the unit to wake up the counting clock doesn't reset the seconds from 59 to 00 but counts the minute one up and continues with counting up the seconds (60..61..62..63..).
- Trying to edit a numerical field in the devices page after every keystroke my keyboard is reset to alphabetical layout and the screen scrolls a little bit weird so that my eyes are loosing the focus of the edited field - hard to explain.....

Re: Android application

Posted: 06 Apr 2020, 00:59
by Wiki
Just got another idea about further functionality concerning my believed depp sleep devices:
It would be a nice-to-have if I could initiate the "no Deep Sleep" call to the desired device, continue working with the other devices and get a popup when the deep sleep device is awake and waiting for my input.

Re: Android application

Posted: 06 Apr 2020, 08:30
by tiomny
I'm not sure why list of device isn't scrollable in your case - if I understood you correctly. I added several devices and could scroll the list up and down.
Manual add can save device with any address user entered - but at this moment the application doesn't warn user if the device is unreachable. Application doesn't do anything in case if a user didn't fill the address field at all but put the address to the name field for example. I will implement some sort of validation messages.

Re: Android application

Posted: 06 Apr 2020, 12:44
by Wiki
Oh, I didn't explain correctly. The list of devices is scrollable, yes.
What I ment is scrolling the http pages of the devices is not possible.

Re: Android application

Posted: 06 Apr 2020, 12:47
by tiomny
Got it, thanks.
I'm creating tickets in GitHub for your report.

Re: Android application

Posted: 06 Apr 2020, 12:49
by Wiki
Oh, its on github?
So should I put other hints over there instead of posting here?

Re: Android application

Posted: 06 Apr 2020, 13:34
by tiomny
Wiki wrote: 06 Apr 2020, 12:49 Oh, its on github?
So should I put other hints over there instead of posting here?
Yes, I have public repo - without code, just for feedback at https://github.com/iotschmied/IotMage/issues

Re: Android application

Posted: 06 Apr 2020, 16:13
by TD-er
The rendering of the webpage of ESPEasy is not usable on my phone.
If a page is larger than can be displayed (e.g. controller settings page) then you cannot scroll to the bottom to access the submit button.
Just as if the top of the page is forced to remain visible.

I'm using Motorola One Vision running Android 10.

Re: Android application

Posted: 07 Apr 2020, 10:58
by Domosapiens
I have public repo - without code
So no-one can check on a Trojan Horse?
My suggestion: stay away from this software