Samsung S3 and 51-android.rules, can not find the device - samsung-mobile

My 51-android.rules as below, and it can connect with my Samsung i9000 (via DDMS...)
Samsung i9000
SUBSYSTEM=="usb", ATTR{idVendor}=="04E8", MODE="0666", GROUP="plugdev"
But not works if using Samsung i9300
Perhaps I lacks the "ATTRS{idProduct}" ?
But I can not find the values for Samsung i9300.
Any comment will help...
THanks O

1 $ sudo apt-get install mtp-tools
2 connect your Galaxy phone in MTP mode
3 $ mtp-detect, then it will output something like below:
Device 0 (VID=04e8 and PID=6860) is a Samsung
GT-P7310/P7510/N7000/I9100/Galaxy Tab 7.7/10.1/S2/Nexus/Note. Found
1 device(s): Samsung: GT-P7310/P7510/N7000/I9100/Galaxy Tab
7.7/10.1/S2/Nexus/Note (04e8:6860) # bus 1, dev 9
4 Find out the Vendor ID and Product ID. Edit the /etc/udev/rules.d/51-android.rules.
SUBSYSTEM=="usb", ATTR{idVendor}=="04E8", ATTR{idProduct}=="6860",
MODE="0666", OWNER="username"
The "username" is the actual username of the user who is authorized to access the phones over USB.
5 $ sudo service udev restart
6 re-connect your phone.

Are you sure you have enabled "USB debugging" in the developer options? Try 6860 as product ID.

Related

xen hvm : no console

I am trying to run opnsense as xen domU.
My host is debian 11 and xen boots as dom0 with this configuration :
dom0_mem=1G,max:1G dom0_max_vcpus=1
I am trying to boot on opnsense from iso with this file :
builder = "hvm"
name = "router"
memory = 1024
vcpus = 2
serial='pty'
sdl=0
vnc=0
disk = [ 'phy:/dev/sda3,sda,w'
, '/opt/iso/OPNsense-23.1-OpenSSL-dvd-amd64.iso,raw,xvdc,devtype=cdrom,r'
]
boot='cd'
-> xl create -c opnsense.cfg
The domU seems to boot (disk and CPU activity) but the console stays empty.
I tried to access to console with "xl console router" but the command returns :
"xenconcole: Could not lock /var/lock/xenconsole.14: Resource temporary unavailable."
Is there a special configuration for console in hvm mode ?
Thanks for help
Does opnsense actually support a serial console automatically in its installer iso image?
You may want to double check, just to make sure serial console actually works in your environment, with an ordinary Linux distribution install iso image if there is serial output.
The posted domU.cfg looks correct to me, it works in my non-Debian, non-OPNsense environment.

How to get a guest account in ightdm on debian? Enabled it in lightdm.conf but nothing happened. Is something else required as well?

How want an option for guest session in my user list in lightdm but I don't get one. I am talking about something like ubuntu and its flavours used to have back in the days.
This is the my lightdm.conf seat
[Seat:*]
#type=local
#pam-service=lightdm
#pam-autologin-service=lightdm-autologin
#pam-greeter-service=lightdm-greeter
#xserver-backend=
#xserver-command=X
#xmir-command=Xmir
#xserver-config=
#xserver-layout=
#xserver-allow-tcp=false
#xserver-share=true
#xserver-hostname=
#xserver-display-number=
#xdmcp-manager=
#xdmcp-port=177
#xdmcp-key=
#unity-compositor-command=unity-system-compositor
#unity-compositor-timeout=60
#greeter-session=example-gtk-gnome
greeter-hide-users=false
greeter-allow-guest=true
#greeter-show-manual-login=false
#greeter-show-remote-login=true
#user-session=default
allow-user-switching=true
allow-guest=true
#guest-session=
#session-wrapper=lightdm-session
#greeter-wrapper=
#guest-wrapper=
display-setup-script=xrandr --output VGA1 --auto --right-of LVDS1
#display-stopped-script=
#greeter-setup-script=
#session-setup-script=
#session-cleanup-script=
#autologin-guest=false
#autologin-user=
#autologin-user-timeout=0
#autologin-in-background=false
#autologin-session=
#exit-on-failure=false
But despite all this I do not get an option for a guest user. I read the arch wiki for guest session and from what I think I am missing the guest script or something.
What am I missing? If Anybody has any idea please let me know...
Currently using Xfce4 on debian buster.
Try executing
sudo sh -c 'printf "[Seat:*]\nallow-guest=true\n" > /etc/lightdm/lightdm.conf.d/40-enable-guest.conf'
This might enable guest session on your system

Samsung J5 and TAB4 refuse native debugging

Using Android Studio 1.5.1 in a win7 ultimate sp1 and in a Mac mini 10.11.3 fully updated.
I have a number of Samsung units for testing my app development incl JNI and this week my private Samsung Galaxy S4mini (Kitkat) died physically so I got a new Samsung Galaxy J5.
However the J5 (lollipop) refuses to be debugged in native mode. Does not matter the app, fails also with Hello-JNI.
The J5 also have some odd java bugs like in a AlertDialog (with stacked linear layouts) linearLayout.addView(anotherLinearLayout); just crashes?? Also I have an odd JNI-bug, I like to debug. And both "bugs" works without crashing in my other devices my old S4mini and a TAB4 Kitkat and a TAB3 and S3mini.
However I found the TAB4 also refuses native debugging. Both the TAB4 and the J5 works fine in (non-native) app-debugging. All other units debugs native no problem, just switching unit on the cable and run, works fine?
Is there something missing in the J5 and TAB4 for making native debugging available?
The debug error message is (I tried everything I could find):
Target device: samsung-sm_j500fn-0af60463
Installing APK: C:\Users\JB\AndroidStudioProjects\HelloJNI\app\build\outputs\apk\app-all-debug.apk
Uploading file to: /data/local/tmp/com.example.hellojni
Installing com.example.hellojni
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.example.hellojni"
pkg: /data/local/tmp/com.example.hellojni
Success
Launching application: com.example.hellojni/com.example.hellojni.HelloJni.
DEVICE SHELL COMMAND: am start -D -n "com.example.hellojni/com.example.hellojni.HelloJni" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.hellojni/.HelloJni }
Warning: debug info can be unavailable. Please close other application using ADB: Monitor, DDMS, Eclipse
Restart ADB integration and try again
Waiting for process: com.example.hellojni
DEVICE SHELL COMMAND: run-as com.example.hellojni mkdir /data/data/com.example.hellojni/lldb
Error while launching debug server on device: com.android.tools.ndk.run.DebuggerContext$StartServerException: java.lang.IllegalStateException: run-as is broken (please see http://b.android.com/187955 for details)

How to disable serial console(non-kernel) in u-boot

I am building a Yocto image for Intel Edison.
One of the image's components is u-boot with an Edison-specific patch. By default, Edison's UART port is used for u-boot console. I want to disable this feature, but only on the serial interface(u-boot also listens on USB and that needs to stay).
My main concern is the "Press any key to stop autoboot" feature on the UART port. I need this port to connect an accessory that might send something during the boot process of the main device.
How do I approach this problem? Is there an environment variable for this, or do I need to modify the sources?
Thanks in advance!
I'm getting back to this issue almost a year later, now I've managed to find a proper solution.
The board I was working on had a reasonably new u-boot in its BSP. To disable the serial console I had to do the following:
Add the following defines to the board's config header(located in include/configs/board.h):
#define CONFIG_DISABLE_CONSOLE
#define CONFIG_SILENT_CONSOLE
#define CONFIG_SYS_DEVICE_NULLDEV
Check if your board has early_init_f enabled in the same file:
#define CONFIG_BOARD_EARLY_INIT_F 1
Find the arch file(Something like arch/x86/cpu/architecture/architecture.c) and add this call to its early_init_f function. It actually modifies board's global data variable to have these flags:
gd->flags |= (GD_FLG_SILENT | GD_FLG_DISABLE_CONSOLE);
My board did not have one, so I had to add the whole function
int board_early_init_f(void)
{
gd->flags |= (GD_FLG_SILENT | GD_FLG_DISABLE_CONSOLE);
return 0;
}
Example:
If you are looking for board_early_init_f of Orange Pi 4B it is in /build/cache/sources/u-boot/v2020.10/board/rockchip/evb_rk3399/evb-rk3399.c
That's it. Hope this helps someone else!
see also
Setting the u-boot environment variable bootdelay to -2 disables the ability for the UART to interrupt the boot process on U-Boot 2017.01 release. It appears that -1 is a special case.
See common/autoboot.c from your U-Boot source tree for details.
About U-Boot Environment Variables
There's no way to do this, without modifying the source (configuration) of U-Boot.
To disable the serial console in U-Boot, you need to reconfigure U-Boot. The documentation from the master branch of U-Boot: Readme.silent
According to that one, you need to set:
CONFIG_SILENT_CONSOLE
CONFIG_SILENT_CONSOLE_UPDATE_ON_SET
CONFIG_SYS_DEVICE_NULLDEV
CONFIG_SILENT_U_BOOT_ONLY is also needed if you want only U-Boot to be silent.
You might also need to test with CONFIG_SILENT_CONSOLE_UPDATE_ON_RELOC and possibly adding silent 1 to CONFIG_EXTRA_ENV_SETTINGS.
== UPDATE ==
See the following options for a possible workaround:
CONFIG_ZERO_BOOTDELAY_CHECK
CONFIG_AUTOBOOT_KEYED
CONFIG_AUTOBOOT_KEYED_CTRLC
CONFIG_AUTOBOOT_PROMPT
CONFIG_AUTOBOOT_DELAY_STR
CONFIG_AUTOBOOT_STOP_STR
These options will at least give you a way of requiring a magic string to stop the boot. It might be enough to help you. See README.autoboot
As told by Kyle you can set the bootdelay u-boot environment variable to -2.
This can even be done from a booted system using the fw_setenv utility.
On my mender raspberry pi image this utility was preinstalled.
Using sudo fw_printenv bootdelay showed it was set to 2, i set it to -2 with sudo fw_setenv bootdelay -- -2 (note the -- before the value, so -2 is interpreted as the value, not an option).
In my case it was a similar issue than the OP, with a LoraWAN node on a raspberry pi connected over the serial port that interrupted the boot.
So
remove the serial device causing issue
set bootdelay either from the booted system or from the bootloader
shutdown and add the serial device back
Here is the video where it is explained step by step how to prevent U-boot console from interrupting autoboot and sending debug messages on UART on Raspberry Pi - it should work similarly for other boards, provided they use U-boot. You will however need to find the right config files for your board in u-boot source folder. I know links only answers are frowned upon, so here' s a quick breakdown of a solution:
Install the dependencies
sudo apt install git make gcc gcc-aarch64-linux-gnu bison flex
Git clone the official u-boot repository. Alternatively you can git clone my fork of repository, where I already have the necessary changes for silent autoboot - but if you need the latest version, then you need to clone the official repository and make changes yourself.
git clone --depth 1 git://git.denx.de/u-boot.git
cd u-boot
Find your board config files - they depend on the model, e.g. rpi_3_defconfig for Raspberry Pi 3, rpi_4_defconfig for Raspberry Pi 4 and so on. Add the following lines to the end of the file
CONFIG_BOOTDELAY=-2
CONFIG_SILENT_CONSOLE=y
CONFIG_SYS_DEVICE_NULLDEV=y
CONFIG_SILENT_CONSOLE_UPDATE_ON_SET=y
CONFIG_SILENT_U_BOOT_ONLY=y
The first line removes the boot delay, so autoboot will not be interrupted by messages sent on UART interface. Next four lines enable silent boot, so U-boot will not send any messages on UART itself, because the messages might in turn confuse your device. One more little thing left, set silent boot environmental variable. Change the header file for your board (for raspberry pi it is include/configs/rpi.h ) by adding the following:
#define CONFIG_EXTRA_ENV_SETTINGS \
"dhcpuboot=usb start; dhcp u-boot.uimg; bootm\0" \
"silent=1\0" \
ENV_DEVICE_SETTINGS \
ENV_DFU_SETTINGS \
ENV_MEM_LAYOUT_SETTINGS \
BOOTENV
Now configure with
make rpi_3_defconfig
from repository main folder And build with
make CROSS_COMPILE=aarch64-linux-gnu-
When the build process finishes you will have a u-boot.bin file, which you need to rename (uboot_rpi_3.bin for Raspberry Pi 3) and copy to Raspberry Pi SD card at /boot/firmware/. Now you Raspberry Pi will not be disturbed by any messages on UART during boot. The UART functionality after boot will not be affected.
Relevant docs: https://gitlab.denx.de/u-boot/u-boot/blob/HEAD/doc/README.autoboot https://gitlab.denx.de/u-boot/u-boot/blob/HEAD/doc/README.silent https://wiki.ubuntu.com/ARM/RaspberryPi

Can I install an app as certified on my own phone? (Firefox OS)

Is there any way that I can develop an app for Firefox OS that uses a certified API and install it on my own phone?
Our specific need is for telephony data such as signal strength. We can do this on Android without any difficulty (indeed, we could put the app on Google Play if we wanted to). But we just need to install it on a small number of in-house phones.
It seems that Firefox OS considers it to be in some way a security risk to find out the signal strength of the cell tower, and similar telephony data. Am I correct in assuming that there is no way that Firefox OS will let a developer app read this data?
If you are using Firefox OS 1.2 > you should be able to push a certified app to a unlocked phone for testing purposes. I put in code like:
testconn.onclick = function () {
var cnx = navigator.mozMobileConnection;
if (cnx.voice.connected) {
console.log("The signal has a strength of " + (+cnx.voice.relSignalStrength) + "%");
} else {
console.log("The state of the connection is: " + cnx.voice.state);
}
};
and entered the following permission in the manifest:
"permissions": {
"mobileconnection":{}
},
"type": "certified"
You should be able to install your certified app on a real Firefox OS phone after performing these steps from MDN:
On your computer, enter the following command in Terminal/console to enter your device's filesystem via the shell:
adb shell
Your prompt should change to root#android.
Next, stop B2G running using the following command:
stop b2g
Navigate to the following directory:
cd /data/b2g/mozilla/*.default/
Here, update the prefs.js file with the following line:
echo 'user_pref("devtools.debugger.forbid-certified-apps", false);' >> prefs.js
After you've finished editing and saving the file, start B2G again using the following command:
start b2g
Exit the android filesystem using the exit command; this will return you to your normal terminal prompt.

Resources