ADB and micro USB for data communication

ADB stands for “Android Debug Bridge” and it basically just allows you to send commands to your device Ltouch.

Download SDK Platform Tools ADB is a small tool bundled in the Android SDK as part of the “Platform Tools.”

ADB stands for “Android Debug Bridge” and it basically just allows you to send commands to your device.

Users used to be required to download the entire SDK (which is very large) just to use ADB, but Google now allows users to download only the Platform Tools.

  • Download the SDK Platform Tools for Windows, Mac, or Linux from https://developer.android.com/studio/releases/platform-tools.html
  • Extract the ZIP file somewhere easily accessible (like C:\platform-tools) We’ve got ADB downloaded on your computer and your Android device is ready to receive instructions.
  • Now it’s time to put it all together and run your first ADB command.
  • Connect your Ltouch to the computer with a USB cable
  • The USB mode must be PTP in order for ADB to work. You can usually change this from the notification shade
  • Make sure to allow USB debugging if a pop-up appears
  • Open the platform-tools folder on your computer
  • Shift+Right Click and select Open command prompt here
  • Type adb devices and hit Enter

That’s all, good work

Websoket with server inside Android HMI Ltouch

In 2018 eight out of ten people have a smartphone, so it is a great achievement to share data acquired by our Android HMI Ltouch
(such as the measure of a temperature) over a wireless network and look at it with a web browser.

Let’s see how using an Ltouch 7, there are only 2 steps:

Step 1
Install an http server to provide the webpage with measures; in our tests we used Http Server by Tautvydas Andrikys, it is very interesting
because it can support php after the installation of Server for PHP by the same author. Once installed these apks, tap “server address and port” to set
an http port ,default is 8000, you can change but do not use privileged ports (ports below 1024 , see for example ), then choose ip address 0.0.0.0 to answer on each ip assigned to the Ltouch.

Enable php support:

CGI setting -> enable com.esminis.server.php (Server for PHP)

Finally enable start on boot.

Copy webpage index2.html to /mnt/sdcard/htdocs/public :
adb push index2.html /mnt/sdcard/htdocs/public
Copy configuration files for php server php.ini to /mnt/sdcard/www/config :
adb push index2.html /mnt/sdcard/www/config
Copy configuration files for http server: certificate.cert / certificate.key / httpd.conf to: /mnt/sdcard/htdocs/config
adb push certificate.cert /mnt/sdcard/htdocs/config
adb push certificate.key /mnt/sdcard/htdocs/config
adb push http.conf /mnt/sdcard/htdocs/config

Reboot touch.

However you can use any http server.
Enable hotspot in the settings of Ltouch: settings -> more -> portable hotspot , here we can setup wifi parameters : network name and
password, then tap on portable hotspot to enable it

Step 2
install the apk available in the download area; it’s a simple app which uses modbus library by Biemme to read the measure of a temperature
provided by an external device and connected to the rs485 port of the touch

Now using your pc or smartphone, you can connect to the wifi network just created: open a browser and type http://192.168.43.1:8000/index2.html
in the address bar, note that you must use the port set in the http server in the address, we are using 8000, if you set another value use that
instead of 8000.

Moreover, the duo webpage/application allow us to handle input/output pins handled by Android kernel on the side of Ltouch, the ones provided
by expansion boards are handled with modbus calls and are excluded.

Source codes are available in our download area

How to configure Android adb without using the mini-usb

android serial lines debugAs presented in an earlier blog post, the Android adb daemon (in the host device) can be set to listen for requests coming from wifi or ethernet instead of the default usb. This process is common for the majority of Android smartphone/tablets and in order to achieve it, the host device must receive at least a set of initialisation commands sent throughout the mini-usb connector.

The mini-usb is a very good connector but when you have to disconnect and reconnect it many times, it may fail or broke. As a consequence, having a mini-usb connector that does not work, means that you can not upload your apks, debug and in general manage your Android device. Continue reading

Mounting Additional USB Storage Devices on Android

On all the Ltouch products, once a USB Storage is connected to one of the four USB connectors available, the Android system will automatically mount it on /mnt/usb and you will be able to see it from the System Preferences/Storage.

However, this happens only for the first USB storage device that you plug. If you need to mount additional Flash memories, you need to manually tell Android how (and where) to set it up. Continue reading

How to set Android Brightness through Adb

brightness icon (www.picol.org)In this post I’d like to show you how to adjust the Android Brightness using Adb. This could be particularly useful when for instance you accidentally set the brightness to small values, therefore you are not able to get back to a value that let you see what is going on.

I’ve tested the following procedure for the Ltouch Android panels and Android development boards, however this procedure is quite general that you can easily use on any Android devices.

The first step is to connect the Android devices to your PC using the mini-usb cable. On Windows, you have to install first the Android usb driver provided by Google (OEM) or by the device’s manufacturer. More info on that on this wiki. On Linux/Mac, no driver is needed.

Continue reading

How to set the Android Adb over Wifi

android wifi connection panelIn this post I’d like to describe you how to set adb over Wifi or Ethernet. As you probably already know, the adb (a.k.a. Android Debug Bridge) is a powerful tool that allows you to shell directly to the emulator or to a connected real device. Indeed, many other actions are available, such as:

  • copying files from/to the device
  • installing and removing and apps
  • managing port forwarding
  • making backup and restoring older archives
  • partitions synchronization
  • seeing the log from the device
  • checking for bug report

Continue reading