Android in an industrial controller

In any engineering work, the thought moves in such a way as to apply in development the most suitable solutions at the same time in all respects. And in an industry where automation is required, tacit control of some processes, human intervention is even undesirable.

Those. if you need to monitor some objects in industrial workshops in a non-contact way, without collecting long wires, collect statistics in a database for analysis, then why not try for a long time already familiar ... Android-smartphones.

If you have some programming skills for Android, then, as it were, all the hardware for the industrial controller on the smartphone already has: sensors, mobile communications, and a battery for some autonomy. Well, the display, of course, is also needed for a while.
But, although, if someone suddenly made a reliable compact Android-device with hardware exactly like a smartphone, but without a display - it would be ideal. And, yes - this is not just an HDMI-WiFi-dongle for a TV, namely with a battery, a GSM module, and a camera.

On assignment - no sensors can be used, hot. Very hot. Those. you need to control non-contact - nothing but a camera will do. There are enough QR codes for the camera to control the necessary objects. But at the same time, the controller must be located in a cool place, with normal temperatures. It all turns out to be real.

Mobile Internet is now within cities, even in enterprises - it’s quite bearable, at least the operator can be picked up with a tolerant signal level. And even 4G can already be used, although, of course, the signal level can balance on the verge of turning off - but more on that later. So - sending data to the server (with preliminary accumulation in the local database) as the Internet is available is not a problem.

After preliminary development of software and testing, it turns out that the temperature conditions for the smartphone are fully provided, temperatures up to 40 degrees. Modern lithium batteries on smartphones are fully declared up to 45 ° C, and at 50 - modern smartphones that control the temperature with an integrated sensor in the battery - start to “scream” about overheating and programmatically turn off charging if it is connected. Therefore, cooling must be taken into account. So that the feasibility is already fully proved, the system is simple in the general structure, all the pieces of the system fit perfectly in the head - that means, “forward, and with the song”, to code.

It comes to the development of the controller case, we include an Android smartphone with a power adapter, with thoughtful input into the power cable. And a cooling system. Which, as it turns out later, is very necessary, and not only for cooling iron.

The time comes, and the system is already fully working, the server shows users the data plates and graphs, checks the ranges of the measured parameters, and notifies users of upcoming f ... k-ups, and then gradually ... the nuances of a structurally “simple” system begin to appear ...

No, there are no problems with the battery, the smartphone is constantly connected to the charger, the internal battery controller is great, puffs and does its continuous work. But it turns out that for reliable recognition of QR codes, the camera angle, lighting, and shadows partially covering the code, and the state of the code, which gradually fades out under high temperature, are important at the same time.

Then, after a month of “combat” testing, it suddenly appears that the quality of recognition of QR codes has gradually worsened all this time, and now it’s not at all suitable: it turns out that the dust is constantly present in the air, which is not visible during a brief cursory inspection of the workshop, but gradually settles on the glass covering the camera lens. A layer of dust gathers slowly and ... it is clear how this ends, in the end.
This is where the cooling system came in handy, not only for cooling, but now also for protection against dust, creating "excessive" air pressure from the inside, blowing around the lens and preventing dust from settling on the lens.

During all these events, of course, there is a continuous debugging of software, algorithms, on hardware, to which developers do not have physical access - all only through remote control. A couple of releases per day, as the general algorithm of operation of equipment in the workshop, described in advance, perfectly understood in the drawings and drawings, also contains in reality a bunch of small nuances. And the verification algorithms in the code multiply continuously.

For remote management and software updates in Android, TeamViewer Host is used (used!), There were no problems with it, probably 4-5 months, everything was wonderfully connected, access to the smartphone screen was. Everything worked through 4g-Internet of one Russian federal operator, in a free mode. Of course, we thought that sooner or later it would be necessary to acquire a business license, because to compose the whole system of remote control by yourself is inexpedient.

Everything was not bad until TeamViewer developers started updating something on their system there and we lost access. Well, logically, we thought that this was due to a free restriction, while it was an honor to know, and we acquired a license (for a long time and not completely censored by surprise at its cost). But this did not help - it was the beginning of the technical problems of TeamViewer, which required reinstalling the client and settings and confirmation on the smartphone screen. To which there was neither physical nor virtual access.
It was possible to restore access to the system only after physically reaching the smartphone - I forgot to mention that the smartphone was new from the store, with official firmware. Without root access to all OS functions. And it worked pretty well for a while.

In short, about TeamViewer (TV) - after these first torments, payment of the business account was returned (only by phone, no way to get support via the Internet is unrealistic). It became clear that we needed alternatives to TV. Later, when the situation repeated - for some reason we stepped on this rake for the second time with the acquisition of a TeamViewer business account, but it became clear that we are not tormented alone, but a bunch of users with mountains of Android devices with a business license. And work with this software has been suspended.

And it became clear that for any industrial equipment the most important thing is the ability to reboot. Including an external remote command. To regain access to the system, regardless of any software glitches. And in accordance with this, it was decided to make a smartphone with root and develop its additional remote control software, through its own server, of course with the possibility of rebooting the smartphone.
And such software was developed, and its use was confirmed more than once: in addition to remote control via the server, commands were implemented via SMS messages.

All this time, only one component of the system was not satisfactory and worked almost around the clock, and even surprised, because More than six months of continuous operation of the system through 4G have already passed. The smartphone was controlled, data flowed, the ability to remotely reboot several times helped overcome glitches of its own main software that works with the camera and QR codes. The Internet disappeared very rarely and literally in a few tens of seconds.

But nothing is “forever under the moon,” and once the system disappeared. Absolutely. Neither data on the server, nor data from Google geo-tracking, nor a response through its own remotecontrol software. Well, it's time to reset the system through a command in an SMS message. But FIG. And it didn’t help. And the command to turn on the Internet connection did not help.

At the same time, an incoming call to the number of the SIM card inserted into the smartphone passed completely for itself, no matter how many times you check it.

I already thought that the evil kulhackers got into the system, removed all my Android software, and at the end they “slammed the door” - cut down the mobile Internet.

Finally, the telecom operator replied that "we apologize, the technical problem with the cell you are using." But the call works, but the SMS does not.

And then I remembered that at one time I had provided for the forced inclusion of WiFi in the software, I do not know why - this connection is not used in the shops of the enterprise. And the smartphone was once connected to WiFi at the development stage, of course. It remains to try on another smartphone to turn on the WiFi access point, name it with the name of my home network, set the password corresponding to the network and ... and BINGO - the piece of iron is in touch!

Not a single SMS after that operator’s glitch got to Android, my software didn’t receive them.
And just by making a reboot of the piece of iron while there was WiFi-Internet, it was possible to restore the SIM card of the operator and mobile Internet.

And now the ability to reboot with the help of a regular incoming call is included in the remote control software, so that such a jamb of the operator does not interfere with the work.

Conclusion: the system works for about 10 months, the smartphone battery is OK, the camera is OK. So it is not necessary to assemble or purchase an expensive industrial computer, connect external peripherals to it - it is quite possible to do with a modern Android-smartphone.
But I am sure that it will not succeed in avoiding “hemorrhoids” and all sorts of unpleasant nuances.

And I made this conclusion for myself: the steps for setting up an Android smartphone for offline remote work as part of an industrial controller

  1. Choosing a device for industrial use - only with the ability to get Root (for the possibility of rebooting)
  2. Update everything automatically possible and disable updates
  3. Get Root on the device (!)
  4. () Google Play Market — ( ),
  5. : « »
  6. : « »
  7. SIM- – - ( SIM — !)
  8. SIM-:
  9. RemoteControl —
  10. (AirDroid, Teamviewer Host)
  11. - ( , )
  12. -
  13. Install the default launcher (host application) (if possible, configure at the last moment)
  14. Installing your RemoteReset utility - rebooting the rooted Android by SMS and calling (!) - check the reboot and auto start of all of the above (and check the operation via the Internet)
  15. Turn on WiFi and connect to the networks in advance: especially to the mobile access point from the operator’s smartphone; for alternative access of the smartphone to the Internet with local activation of this access point)
  16. Charge the battery
  17. Launch the main host application
  18. Disconnect the device until it is turned on during installation

PS: the more detailed details, of course, do not allow the sharing of commercial / legal obligations.

All Articles