Power on/off using Appium commands - webdriver

I am trying to Power on/off a device using appium. I modified Webdriver.py in Appium python client. I added a function and command for power off. Its not working. Can anyone help me with Appium commands for power on/off. PS - I can not use adb commands

adb shell reboot -p power off device
adb reboot -p restart the device

I'm interested what function you added, because Appium server does not support device power on/off out of box, the only way you can do it is to use adb directly

Related

Receive Files using teraterm ZMODEM

I'm using teraterm from my windows PC.
I have a serial (USB) port conection to a board that is running linux.
I have access to the linux terminal throught teraterm.
This is the only way to interact with the board.
I want to "copy" files from the board in my PC. For this I thought on using the ZMODEM/receive option.
When I choose the ZMODEM/send option I achieve to send files from my PC to the board, so I asume I have the rigth configuration.
However when I choose the ZMODEM/receive nothing happens, I cannot write the file's name. I think teraterm is waiting for the board to send it.
Is there a way to specify the filename from my PC and receiving it without "manipulating" the board?
I can run sh scripts on the board, but I should not install new software in it.
I'm open to other solutions with teraterm (maybe ZMODEM is not the right way?)
I just got it.
I had to use the sz command on linux.
So, on the board I launched:
sz /my/file/name.wow
and then click on transfer>ZMODEM>receive and the transfer started automatically :)
I was used to work with ethernet/ssh and just noticed this method taking a lot more time.

How to send command through serial same way it does with PuTTy in a python script

I have a HPLC pump connected via serial port to the computer. By using PuTTy I can send commands to it such as REMOTE to control it from PC (the display will change on the pump to show that it is indeed in remote mode. However when I use the same command from python the device does not respond.
import serial
pump = serial.Serial(port='COM2', baudrate=19200)
I have tried
pump.write('REMOTE\n'.encode())
and
pump.write(b'REMOTE\n')
and
pump.write(b'REMOTE')
I resolved the issue.
I needed to use
pump.write(b'REMOTE\r')
not
\n

Does Appium supports Apple watch?

Is it possible to do Automation testing in Apple Watch or wearable devices using Appium?
If NO, is there any alternate way to do the same?
No: Appium does not currently support Apple Watch.
It is apparently possible through xcode: https://github.com/dwyl/learn-apple-watch-development/issues/39
Yes , Appium does support Apple watch.
First, you can connect the gadget through ADB just like you connect to a phone/tablet:
$ adb devices
Also, connecting wearable with phone/device through Bluetooth is easy and straightforward:
$ adb -s forward tcp:4444 localabstract:adb-hub/ && adb -s connect localhost:4444
Then, you start Appium server (if using Appium locally) and start the test run targeting to http://localhost:/wd/hub/
$ appium -U localhost:4444
After this, test script is getting executed.
For more information kindly go to the link below.
https://bitbar.com/app-development-and-testing-on-wearables/

Android Things: Intel Edison: Using USB and Debugging

Has anyone had any luck using USB debugging with an Edison while also using a USB peripheral? It looks like you have to use the switch to activate the bigger USB port, which also cuts off the debugging port. I'm trying to use a USB camera, but can't see the debugger info to actually figure out what's not correct. I also get a connection refused when attempting to use adb connect on the wifi ip.
It looks like you have to use the switch to activate the bigger USB port, which also cuts off the debugging port.
Correct, only one port can be active at a time between the USB Host and USB OTG on the Edison. If you just need access to logs for debugging, connect another USB cable for the serial debug console as described on the Android Things Edison page. This will give you shell access and you can run logcat.
I'm trying to use a USB camera, but can't see the debugger info to actually figure out what's not correct.
It's worth noting that USB cameras are not supported in the current preview release. It's unlikely that the device will be recognized as a camera through the APIs, though you may still be able to access it as a raw USB device if you wish.
I also get a connection refused when attempting to use adb connect on the wifi ip.
The Edison defaults to USB mode for ADB, but you should be able to set it to TCP mode to connect over the network (much like an Android phone):
$ adb tcpip 5555
$ adb connect <ip address>:5555
…or the following, which should persist the configuration across a reboot:
$ adb root
$ adb shell setprop persist.adb.tcp.port 5555
$ adb reboot
$ adb wait-for-device
$ adb connect <ip address>:5555

avrdude: ser_open(): can't open device "\\.\COM3": Access is denied

I get this error message when i try to upload code to my arduino. Does anyone know what is going on?
I have installed the proper drivers and it works fine. My port appears on the menu and it is the corresponent to the device.
bless
Common error, here is the solution:
1 - Unplug the Arduino
2 - Upload code with no Arduino connected to PC
3 - Reconnect Arduino
4 - Upload code to the Arduino
Good luck!
From terminal:
ls -l /dev/ttyUSB*
# or:
ls -l /dev/ttyACM*
Get the groupname from the result:
crw-rw---- 1 root uucp 188, 0 5 apr 23.01 ttyUSB0
# or:
crw-rw---- 1 root dialout 188, 0 5 apr 23.01 ttyACM0
Add your username to the group:
usermod -a -G uucp username
# or:
usermod -a -G dialout username
Log out and in again for this change to take effect.
Source: https://playground.arduino.cc/Linux/All/#Permission
If you are on Linux,
just set current user to belong to "dialout" group which is the one who members are allowed to access ports.
Run following:
sudo adduser yourUserName dialout
then relog to take effect
(Ubuntu 18.04)
If your using the arduino IDE 2.0 you must close the serial monitor tab if it’s open to upload a sketch. Otherwise you will get this error.
USB may need CH340 driver.
Some Arduinos use the CH340 controller
Find and install the CH34X_Driver_V3.4_Windows.zip
click right on this computer, go to management, device manager, com, find the port of Arduino, then go to tools and in port select the com
I had the COM3 error too and this fixed it.
Open the Arduino application as Administrator
(Shift+Rightclick the app, 'Run as administrator').
I still had to upload without the Arduino connected, then connect and upload.
I had the same problem:
If you are using VS Code with Platform IO and you spam Serial Monitor with many message too fast, then when trying again to upload it will give you the above error. One way to solve it is to press the reset button on your board and immedietly after that to press upload in VS Code. Just don't spam the Serial Monitor too fast, when using VS Code with Platform IO and uploading while monitoring it.
If you are using CLion with Platform IO and you have opened Serial Monitoring via pio device monitor then you must close it and then upload, because it is using the port.
be sure you are not using 2 ides connected to arduino like ARDUINO IDE and VS Code
If you are using the USB-SERIAL CH340 driver: (on some cheaper ARDUINO clones)
Open Device Manager
Open Ports and click on the drop-down arrow to select your port.
Right-click and select "Properties"
Open the "Port Settings" tab.
Click on "advanced" to open a new window:
Un-tick "Use FIFO buffers (requires 16550 compatible UART)" and press "OK"
See image
Please let others know if this worked for you!

Resources