Configure app
Configure and run app (with and without TerminalManager)
Introduction
This page describes the steps that should be taken to configure a My-Scan 5 app. This involves both the configuration against a production environment, as well as how to configure it against a development or testing environment for additional debugging.
Installation
The first step is to install the My-Scan 5 app on a PS20 device. When configuring the app against a productive server, this simply means distributing the .apk file to the device, and configuring the TerminalManager in the correct way, so that it starts the My-Scan 5 app as selfscanner.
For a development environment, where no distribution or TerminalManager is configured, the installation should happen manually. This can be done using ADB.
First, connect the device to your computer using the USB cable, and make sure ADB is installed. Make sure both devices are connected to the same WiFi network. Then, execute the following command, to establish a TCP connection to the device.
TCP Connection over ADB
adb tcpip 5555
Next, figure out what the IP address of the device is. You can either do this by checking your WiFi settings, or by executing the following command.
Retrieve IP Address
adb shell ip addr show wlan0
After that, we can connect to the device, using the following command.
Connect over TCP with ADB
adb connect ip-address-of-device:5555
You can (and should) now unplug the USB cable. You can check if the connection is still working, by executing the following command.
ADB Devices
adb devices
If the connection is working, then we are good to go!
Starting the My-Scan 5 App
If you are using a device that is configured to work with the TerminalManager, then the selfscanner will startup automatically. On a device without the TerminalManager, you can just start the app by tapping on the icon. The first screen you will see, is the initialization screen. The initialization screen has a different look for every customer, but in the showcase app, it looks as can be seen in the image below.
While on this screen, the My-Scan 5 app is waiting until it receives the configuration from the TerminalManager. This should happen within a couple of seconds. When you are not running TerminalManager, you can 'fake' the intent that the TerminalManager is broadcasting, by executing the following ADB command. Please note that you will have to fill in the correct values for STORE_NUMBER, END_POINT, and TERMINAL_ID.
Selfscan Config Broadcast
adb shell am broadcast -a "com.mdcinternational.selfscanner.sendselfscannerconfig" --es "storenumber" "STORE_NUMBER" --es "soapendpoint" "END_POINT" --es "terminalid" "TERMINAL_ID"
Using a Charles Proxy
A Charles Proxy can be used to analyze the network traffic between the app and the backend. When you are using a Charles Proxy, the command above needs to be expanded with the PROXY_IP and the PROXY_PORT, which you can find in the Help → Local IP Address section of Charles.
Selfscan Config Broadcast with Proxy
adb shell am broadcast -a "com.mdcinternational.selfscanner.sendselfscannerconfig" --es "storenumber" "STORE_NUMBER" --es "soapendpoint" "END_POINT" --es "terminalid" "TERMINAL_ID" --es "proxyIp" "PROXY_IP" --es "proxyPort" "PROXY_PORT"
This action can fail, and the most likely cause of this, is that the parameters could not be retrieved from the BusinessServer. Please check if you have an active VPN connection on your computer or the device, that the BusinessServer can be reached from your computer or device, and finally, please check that your RoutingService is configured correctly. If something goes wrong, you'll see the following screen.
We're almost done! The final step is to inform the BusinessServer that the device is ready to be handed out to a customer for a shopping trip. This is normally taken care of by the TerminalManager, by sending the WallBarcode to the BusinessServer. Naturally, if you are not using the TerminalManager, this will not happen. Again, you can 'fake' this behaviour, by sending the following ADB command to the device.
WallBarcode Broadcast
adb shell am broadcast -a "com.mdcinternational.selfscanner.sendselfscannerstatus" --ez "sendstatussuccessfully" true
You will need to send this intent every time you place the device in the wall, otherwise, the BusinessServer will not know whether the device has been placed in the wall or not.
Releasing a Device
At this point, the device can be released by the Scannerwall or the CommandClient, and you can perform a shopping trip.
If you don't have a Scannerwall or CommandClient at your disposal, you can release the device using telnet. (We are only explaining the process on a Mac device. If you are using Windows, please use the CommandClient app.)
First, make sure that telnet is installed. You can do this with the following Homebrew command.
Install telnet
brew install telnet
After this, you can release a device using the following series of commands. Please copy the entire command, and paste it in the telnet field. If you type the command, it will send the command character-by-character, and close the socket after successfully transmitting the first character, resulting in a NOK response from the app.
Release device over telnet
telnet DEVICE_IP 8001
StartTransaction~43198~634004022005360223~EN~2017-07-19 11:59:58~1 ~ EN~
telnet DEVICE_IP 8001
STARTTRANSACTIONNOTIFY~
And you should now be able to pick up the device from the cradle! Enjoy using My-Scan 5.
There are several other commands you can execute using telnet, which can be seen below.
Other telnet commands
ServiceTerminal~\n
Identify~5000~\n
Release a device with the CommandClient
Download Command Client: CommandClient.zip
Unzip the CommandClient.zip and open the CommandClient.exe
Update the IP address in the Terminal field with the IP of your terminal and Press TakeMe (EN)
Rendered Shape1
CONFIDENTIAL Configure and run app (with and without TerminalManager) Introduction
This page describes the steps that should be taken to configure a My-Scan 5 app. This involves both the configuration against a production environment, as well as how to configure it against a development or testing environment for additional debugging.
Installation
The first step is to install the My-Scan 5 app on a PS20 device. When configuring the app against a productive server, this simply means distributing the .apk file to the device, and configuring the TerminalManager in the correct way, so that it starts the My-Scan 5 app as selfscanner.
For a development environment, where no distribution or TerminalManager is configured, the installation should happen manually. This can be done using ADB.
First, connect the device to your computer using the USB cable, and make sure ADB is installed. Make sure both devices are connected to the same WiFi network. Then, execute the following command, to establish a TCP connection to the device.
TCP Connection over ADB
adb tcpip 5555
Next, figure out what the IP address of the device is. You can either do this by checking your WiFi settings, or by executing the following command.
Retrieve IP Address
adb shell ip addr show wlan0
After that, we can connect to the device, using the following command.
Connect over TCP with ADB
adb connect ip-address-of-device:5555
You can (and should) now unplug the USB cable. You can check if the connection is still working, by executing the following command.
ADB Devices
adb devices
If the connection is working, then we are good to go!
Starting the My-Scan 5 App
If you are using a device that is configured to work with the TerminalManager, then the selfscanner will startup automatically. On a device without the TerminalManager, you can just start the app by tapping on the icon. The first screen you will see, is the initialization screen. The initialization screen has a different look for every customer, but in the showcase app, it looks as can be seen in the image below.
While on this screen, the My-Scan 5 app is waiting until it receives the configuration from the TerminalManager. This should happen within a couple of seconds. When you are not running TerminalManager, you can 'fake' the intent that the TerminalManager is broadcasting, by executing the following ADB command. Please note that you will have to fill in the correct values for STORE_NUMBER, END_POINT, and TERMINAL_ID.
Selfscan Config Broadcast
adb shell am broadcast -a "com.mdcinternational.selfscanner.sendselfscannerconfig" --es "storenumber" "STORE_NUMBER" --es "soapendpoint" "END_POINT" --es "terminalid" "TERMINAL_ID"
Using a Charles Proxy
A Charles Proxy can be used to analyze the network traffic between the app and the backend. When you are using a Charles Proxy, the command above needs to be expanded with the PROXY_IP and the PROXY_PORT, which you can find in the Help → Local IP Address section of Charles.
Selfscan Config Broadcast with Proxy
adb shell am broadcast -a "com.mdcinternational.selfscanner.sendselfscannerconfig" --es "storenumber" "STORE_NUMBER" --es "soapendpoint" "END_POINT" --es "terminalid" "TERMINAL_ID" --es "proxyIp" "PROXY_IP" --es "proxyPort" "PROXY_PORT"
This action can fail, and the most likely cause of this, is that the parameters could not be retrieved from the BusinessServer. Please check if you have an active VPN connection on your computer or the device, that the BusinessServer can be reached from your computer or device, and finally, please check that your RoutingService is configured correctly. If something goes wrong, you'll see the following screen.
We're almost done! The final step is to inform the BusinessServer that the device is ready to be handed out to a customer for a shopping trip. This is normally taken care of by the TerminalManager, by sending the WallBarcode to the BusinessServer. Naturally, if you are not using the TerminalManager, this will not happen. Again, you can 'fake' this behaviour, by sending the following ADB command to the device.
WallBarcode Broadcast
adb shell am broadcast -a "com.mdcinternational.selfscanner.sendselfscannerstatus" --ez "sendstatussuccessfully" true
You will need to send this intent every time you place the device in the wall, otherwise, the BusinessServer will not know whether the device has been placed in the wall or not.
Releasing a Device
At this point, the device can be released by the Scannerwall or the CommandClient, and you can perform a shopping trip.
If you don't have a Scannerwall or CommandClient at your disposal, you can release the device using telnet. (We are only explaining the process on a Mac device. If you are using Windows, please use the CommandClient app.)
First, make sure that telnet is installed. You can do this with the following Homebrew command.
Install telnet
brew install telnet
After this, you can release a device using the following series of commands. Please copy the entire command, and paste it in the telnet field. If you type the command, it will send the command character-by-character, and close the socket after successfully transmitting the first character, resulting in a NOK response from the app.
Release device over telnet
telnet DEVICE_IP 8001
StartTransaction43198634004022005360223EN2017-07-19 11:59:581 ~ EN
telnet DEVICE_IP 8001
STARTTRANSACTIONNOTIFY~
And you should now be able to pick up the device from the cradle! Enjoy using My-Scan 5.
There are several other commands you can execute using telnet, which can be seen below.
Other telnet commands
ServiceTerminal~\n
Identify5000\n
Release a device with the CommandClient
Unzip the CommandClient.zip and open the CommandClient.exe
Update the IP address in the Terminal field with the IP of your terminal and Press TakeMe (EN)