Android application

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
tiomny
Normal user
Posts: 15
Joined: 23 Sep 2019, 20:11

Android application

#1 Post by tiomny » 29 Feb 2020, 22:49

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
Attachments
Screenshot_2020-02-23-17-28-37_resized.jpg
Screenshot_2020-02-23-17-28-37_resized.jpg (154.15 KiB) Viewed 3227 times
Screenshot_2020-02-23-17-26-53_resized.jpg
Screenshot_2020-02-23-17-26-53_resized.jpg (85.17 KiB) Viewed 3227 times
Last edited by tiomny on 23 Mar 2020, 08:51, edited 1 time in total.

TD-er
Core team member
Posts: 2312
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Android application

#2 Post by TD-er » 01 Mar 2020, 00:06

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.

TD-er
Core team member
Posts: 2312
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Android application

#3 Post by TD-er » 01 Mar 2020, 00:21

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.

tiomny
Normal user
Posts: 15
Joined: 23 Sep 2019, 20:11

Re: Android application

#4 Post by tiomny » 01 Mar 2020, 07:21

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.

TD-er
Core team member
Posts: 2312
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Android application

#5 Post by TD-er » 01 Mar 2020, 14:07

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?

tiomny
Normal user
Posts: 15
Joined: 23 Sep 2019, 20:11

Re: Android application

#6 Post by tiomny » 01 Mar 2020, 20:21

Since Android 9 the Webview doesn't allow opening HTTP by default.
Fixed version is in GP.

TD-er
Core team member
Posts: 2312
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Android application

#7 Post by TD-er » 01 Mar 2020, 20:40

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.

tiomny
Normal user
Posts: 15
Joined: 23 Sep 2019, 20:11

Re: Android application

#8 Post by tiomny » 02 Mar 2020, 06:48

i made deep scan process parallel - hopefully that didn't break searching.
Will take a look at other issues asap.

TD-er
Core team member
Posts: 2312
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Android application

#9 Post by TD-er » 02 Mar 2020, 08:36

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

tiomny
Normal user
Posts: 15
Joined: 23 Sep 2019, 20:11

Re: Android application

#10 Post by tiomny » 02 Mar 2020, 08:52

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.

TD-er
Core team member
Posts: 2312
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Android application

#11 Post by TD-er » 02 Mar 2020, 09:08

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
}

tiomny
Normal user
Posts: 15
Joined: 23 Sep 2019, 20:11

Re: Android application

#12 Post by tiomny » 02 Mar 2020, 09:20

The "MAC address" field is "STA MAC" in newer builds. I'll add support of old builds.

Wiki
Normal user
Posts: 185
Joined: 23 Apr 2018, 17:55

Re: Android application

#13 Post by Wiki » 03 Mar 2020, 13:58

+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]

Wiki
Normal user
Posts: 185
Joined: 23 Apr 2018, 17:55

Re: Android application

#14 Post by Wiki » 03 Mar 2020, 14:16

+1 installed
Doogee Y8, Andriod 9.0
Works as well as my Tablet.

Wiki
Normal user
Posts: 185
Joined: 23 Apr 2018, 17:55

Re: Android application

#15 Post by Wiki » 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.

hvdwolf
Normal user
Posts: 48
Joined: 09 Jun 2016, 12:37

Re: Android application

#16 Post by hvdwolf » 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.

tiomny
Normal user
Posts: 15
Joined: 23 Sep 2019, 20:11

Re: Android application

#17 Post by tiomny » 03 Mar 2020, 18:46

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.

Wiki
Normal user
Posts: 185
Joined: 23 Apr 2018, 17:55

Re: Android application

#18 Post by Wiki » 04 Mar 2020, 01:22

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.

Wiki
Normal user
Posts: 185
Joined: 23 Apr 2018, 17:55

Re: Android application

#19 Post by Wiki » 04 Mar 2020, 01:28

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

tiomny
Normal user
Posts: 15
Joined: 23 Sep 2019, 20:11

Re: Android application

#20 Post by tiomny » 04 Mar 2020, 06:42

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

Wiki
Normal user
Posts: 185
Joined: 23 Apr 2018, 17:55

Re: Android application

#21 Post by Wiki » 04 Mar 2020, 13:48

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.

tiomny
Normal user
Posts: 15
Joined: 23 Sep 2019, 20:11

Re: Android application

#22 Post by tiomny » 22 Mar 2020, 16:31

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.

TD-er
Core team member
Posts: 2312
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Android application

#23 Post by TD-er » 22 Mar 2020, 20:11

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.

tiomny
Normal user
Posts: 15
Joined: 23 Sep 2019, 20:11

Re: Android application

#24 Post by tiomny » 22 Mar 2020, 23:12

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.

tiomny
Normal user
Posts: 15
Joined: 23 Sep 2019, 20:11

Re: Android application

#25 Post by tiomny » 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?

User avatar
grovkillen
Core team member
Posts: 3482
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Android application

#26 Post by grovkillen » 23 Mar 2020, 07:02

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.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

tiomny
Normal user
Posts: 15
Joined: 23 Sep 2019, 20:11

Re: Android application

#27 Post by tiomny » 23 Mar 2020, 08:31

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.

TD-er
Core team member
Posts: 2312
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Android application

#28 Post by TD-er » 23 Mar 2020, 11:24

Sure and also the levels of "no protection" and "admin" are also a bit limited.

tiomny
Normal user
Posts: 15
Joined: 23 Sep 2019, 20:11

Re: Android application

#29 Post by tiomny » 24 Mar 2020, 23:22

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests