Category Archives: Uncategorized

OrangePi Power button

on orangepi it works as below

orangepi@orangepi:/dev/input$ sudo cat event1
�{Vt��V��/
t��/
�1t�1^
orangepi@orangepi:/sys/devices/virtual/input/input1$ cat uevent
PRODUCT=19/1/1/100
NAME=”sunxi-gpiokey”
PHYS=”sunxikbd/input0″
PROP=0
EV=3
KEY=100000 0 0 0
MODALIAS=input:b0019v0001p0001e0100-e0,1,k74,ramlsfw

Disable driver signature enforcement in Windows

Not sure why it is not working now .. bcedit should disable it permanently

http://www.drivethelife.com/windows-drivers/how-to-disable-driver-signature-enforcement-on-windows-10-8-7-xp-vista.html

bcdedit /set testsigning on
https://search.thawte.com/support/ssl-digital-certificates/index?page=content&id=SO5565&actp=search&viewlocale=en_US&searchid=1381952841942#

http://stackoverflow.com/questions/7258613/driver-install-fails-because-cross-signing-chain-doesnt-contain-microsoft
https://support.globalsign.com/customer/portal/articles/1698751-ev-code-signing-for-windows-7-and-8

https://github.com/pbatard/libwdi/wiki/Signed-Driver-Walkthrough#Globalsign

https://msdn.microsoft.com/en-us/windows/hardware/drivers/develop/signing-a-driver-for-public-release

https://www.digicert.com/code-signing/driver-signing-in-windows-using-signtool.htm

Taking screenshot on just vanilla X11 system

scrot

scrot 1.png

error

Can’t open X display. It *is* running, yeah?

mine was

startx ./application — :0 vt8 &

So it was not coming

Then I started with simple

startx ./application
and scrot worked as a charm

I didn’t find a way to specify display and virtual terminal in scrot that is why it didn’t work out in the first try. I didn’t experiment a lot on this.

 

 

Another way is by using xwd command

 

xwd -root -display :0 > good_image.xwd

Then you need to convert xwd image to png or jpeg

OS in sdcard boots but file system is read-only

The problem occurs sometime when image get corrupted. I think only inode structure become incorrect.

If the reason is only this you can easily correct it via

After copying the image to sdcard you will need to correct the file checksum which somehow is failing and results in root partition mounted as read-only mode.
Use any linux machine and run below command
sudo fsck -y /dev/sdb2

where /dev/sdb2 is the linux partition

Disabling Win driver signature

bcdedit should disable it permanently

http://www.drivethelife.com/windows-drivers/how-to-disable-driver-signature-enforcement-on-windows-10-8-7-xp-vista.html

bcdedit /set testsigning on

https://search.thawte.com/support/ssl-digital-certificates/index?page=content&id=SO5565&actp=search&viewlocale=en_US&searchid=1381952841942#

http://stackoverflow.com/questions/7258613/driver-install-fails-because-cross-signing-chain-doesnt-contain-microsoft

https://support.globalsign.com/customer/portal/articles/1698751-ev-code-signing-for-windows-7-and-8

https://github.com/pbatard/libwdi/wiki/Signed-Driver-Walkthrough#Globalsign

https://msdn.microsoft.com/en-us/windows/hardware/drivers/develop/signing-a-driver-for-public-release

https://www.digicert.com/code-signing/driver-signing-in-windows-using-signtool.htm

usb 1 vs usb 2

usb 1.0 vs usb 2.0

lines?
Check lines in usb camera .. may be it is there in usb camera also because of big screen pixelation?

no device connected

root@FriendlyARM:/usr/local/bin/eyeris_usb# lsusb
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 002: ID 04b4:1003 Cypress Semiconductor Corp.
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

knowing which is usb 1.1 and usb 2.0

Who is using the file/resources

Getting information about processes

In linux you can get all the process in this directory

/proc

/proc/proc_id
has many files and folder about processa info

There are multiple ways like:

pwdx

$ pwdx

lsof

$ lsof -p | grep cwd

/proc

$ readlink -e /proc//cwd

Examples

Say we have this process.

$ pgrep nautilus
12136

Then if we use pwdx:

$ pwdx 12136
12136: /home/saml

Or you can use lsof:

INPUT_PULLUP

Does your pin support INPUT_PULLUP? Generally there are two modes: INPUT and OUTPUT but sometime a pin also support INPUT_PULLUP this is useful for switch where you do not need extra big ohm resistor for pulling up or down the pin to ground or vcc when switch is not pressed.

You can set it to this and directly connect switch other leg to ground
by default the pin wil read 1 as because of pullup but as soon as switch is pressed circuit is completed with gnd it is 0

Testing microphone and HDMI sound

cat /proc/asound/cards
root@FriendlyARM:~# cat /proc/asound/cards
0 [audiocodec ]: audiocodec – audiocodec
audiocodec
1 [sndhdmi ]: sndhdmi – sndhdmi
sndhdmi
root@FriendlyARM:~# arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: audiocodec [audiocodec], device 0: SUNXI-CODEC sndcodec-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: sndhdmi [sndhdmi], device 0: SUNXI-HDMIAUDIO sndhdmi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
root@FriendlyARM:~# arecord -d 10 /tmp/test-mic.wav
Recording WAVE ‘/tmp/test-mic.wav’ : Unsigned 8 bit, Rate 8000 Hz, Mono
arecord: set_params:1233: Sample format non available
Available formats:
– S16_LE
– S24_LE
– S32_LE
– S20_3LE
root@FriendlyARM:~# arecord -vv -fdat foo.wav
Recording WAVE ‘foo.wav’ : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
Hardware PCM card 0 ‘audiocodec’ device 0 subdevice 0
Its setup is:
stream : CAPTURE
access : RW_INTERLEAVED
format : S16_LE
subformat : STD
channels : 2
rate : 48000
exact rate : 48000 (48000/1)
msbits : 16
buffer_size : 24000
period_size : 6000
period_time : 125000
tstamp_mode : NONE
tstamp_type : MONOTONIC
period_step : 1
avail_min : 6000
period_event : 0
start_threshold : 1
stop_threshold : 24000
silence_threshold: 0
silence_size : 0
boundary : 1572864000
appl_ptr : 0
hw_ptr : 0
# + | 02%^C
Aborted by signal Interrupt…
# + | 02%
aplay -l foo.wav

root@FriendlyARM:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: audiocodec [audiocodec], device 0: SUNXI-CODEC sndcodec-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: sndhdmi [sndhdmi], device 0: SUNXI-HDMIAUDIO sndhdmi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
speaker-test -c 2 -r 48000 -D hw:1,0

(for others, the hw:x,y is x = card, y = device)

This just runs a sound test with static bouncing back and forth. Once it has played out of each speaker, hit Ctrl+c to stop it, and then check in your sound settings to see if the HDMI output is now listed under the internal device.

so 1,0

speaker-test -c 2 -r 48000 -D hw:1,0

arecord -vv -fdat foo.wav

aplay -Dhw:1,0 foo.wav