Quick jump:  What's new

 
Go to:
 
Weblog: recent changes   
in Dobrica Pavlinušić's random unstructured stuff
Nook Color

This page will try to document my experiment to run mainline kernel on OMAP

Contents: [Dobrica Pavlinušić's random unstructured stuff]


CPU 800 MHz ARM Cortex-A8-based TI OMAP3621[1]
Memory 512 MB
Storage 8 GB internal
32 GB max via microSD
Display 7-inch 1024 x 600 px WSVGA IPS LCD at 170 ppi
Graphics PowerVR SGX 530
Input Capacitive multitouch screen with side volume, Nook Home, and power button
Connectivity Wi-Fi 802.11 b/g/n, USB, Bluetooth(Disabled on stock firmware)
Power Installed battery 3.7 v 4000 mAh (8 hours with Wi-Fi off)
Dimensions 8.1 in (210 mm) H
5.0 in (130 mm) W
0.48 in (12 mm) D
Mass 15.8 oz (450 g)

uart

nook-color-uart.jpg
permalink
Vaillant
permalink
eGalax TouchScreen


Very old capacitive touch for EeePC 701

usb

dpavlin@brokeee:~$ lsusb -t -v
/:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
    ID 1d6b:0001 Linux Foundation 1.1 root hub
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
    ID 1d6b:0001 Linux Foundation 1.1 root hub
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
    ID 1d6b:0001 Linux Foundation 1.1 root hub
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
    ID 1d6b:0001 Linux Foundation 1.1 root hub
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/8p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 5: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 480M
        ID 0cf2:6225 ENE Technology, Inc. SD card reader (UB6225)
    |__ Port 8: Dev 3, If 0, Class=Hub, Driver=hub/4p, 480M
        ID 05e3:0608 Genesys Logic, Inc. Hub
        |__ Port 3: Dev 5, If 1, Class=Video, Driver=uvcvideo, 480M
            ID eb1a:2761 eMPIA Technology, Inc. EeePC 701 integrated Webcam
        |__ Port 3: Dev 5, If 0, Class=Video, Driver=uvcvideo, 480M
            ID eb1a:2761 eMPIA Technology, Inc. EeePC 701 integrated Webcam
        |__ Port 1: Dev 4, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
            ID 0eef:0001 D-WAV Scientific Co., Ltd eGalax TouchScreen



https://forum.odroid.com/viewtopic.php?t=15239#p127773

xorg error

[    39.523] (II) event14 - eGalax Inc. Touch Touchscreen: is tagged by udev as: Tablet
[    39.719] (EE) event14 - eGalax Inc. Touch Touchscreen: libinput bug: missing tablet capabilities: btn-stylus resolution. Ignoring this device.
[    39.719] (II) event14 - eGalax Inc. Touch Touchscreen: device is a tablet
[    39.720] (II) event14 - failed to create input device '/dev/input/event14'.
[    39.720] (EE) libinput: eGalax Inc. Touch Touchscreen: Failed to create a device for /dev/input/event14
[    39.720] (EE) PreInit returned 2 for "eGalax Inc. Touch Touchscreen"



fix from https://www.embedded-engineer.de/dokuwiki/doku.php?id=start:egalax_touchscreen

apt install xserver-xorg-input-evdev


dpavlin@brokeee:~$ cat /usr/lib/udev/hwdb.d/61-evdev-local.hwdb 
evdev:name:eGalax Inc. Touch Touchscreen*
 EVDEV_ABS_00=::300
 EVDEV_ABS_01=::300

systemd-hwdb update
udevadm trigger /dev/input/eventXX 

root@brokeee:/etc/X11/xorg.conf.d# apt install xserver-xorg-input-evdev

root@brokeee:/etc/X11/xorg.conf.d# cat evdev-touch.conf 
Section "InputClass"
        Identifier "eGalax Inc. Touch Touchscreen"
        MatchUSBID "0eef:0001"
        Driver "evdev"
        # https://www.x.org/releases/X11R7.5/doc/man/man4/evdev.4.html
	Option "InvertX" "true"
EndSection

On my touchscreen with touch flex exiting on bottom left, I have to swap X axis

calibration

dpavlin@brokeee:~$ xinput_calibrator --output-type xorg.conf.d
Warning: multiple calibratable devices found, calibrating last one (eGalax Inc. Touch Touchscreen)
	use --device to select another one.
Calibrating EVDEV driver for "eGalax Inc. Touch Touchscreen" id=11
	current calibration values (from XInput): min_x=0, max_x=2047 and min_y=0, max_y=2047

Doing dynamic recalibration:
	Inverting X and/or Y axis...
	Setting calibration data: 1997, 73, 120, 1835
	--> Making the calibration permanent <--
  copy the snippet below into '/etc/X11/xorg.conf.d/99-calibration.conf' (/usr/share/X11/xorg.conf.d/ in some distro's)
Section "InputClass"
	Identifier	"calibration"
	MatchProduct	"eGalax Inc. Touch Touchscreen"
	Option	"Calibration"	"1997 73 120 1835"
	Option	"SwapAxes"	"0"
EndSection

userspace driver for newer chip

https://github.com/twoerner/hdmi-usb-touch

dpavlin@brokeee:~/hdmi-usb-touch$ git remote -v
origin  https://github.com/twoerner/hdmi-usb-touch (fetch)
origin  https://github.com/twoerner/hdmi-usb-touch (push)

dpavlin@brokeee:~/hdmi-usb-touch$ autoreconf -i

dpavlin@brokeee:~/hdmi-usb-touch$ sudo apt install libudev-dev

dpavlin@brokeee:~/hdmi-usb-touch$ ./configure


permalink
Tegra
Tegra2_TRM_DP04508001v01p.pdf

I will try to collect useful stuff about Tegra latest upstream source on this page.

Nvidia Tegra 2/3 APX/nv3p protocol implementation

qemu

https://github.com/digetx/tegra2_qemu

i2cdetect

root@ac100:~# i2cdetect -l
i2c-1   i2c             7000c400.i2c                            I2C adapter
i2c-2   i2c             7000d000.i2c                            I2C adapter
i2c-0   i2c             7000c000.i2c                            I2C adapter
root@ac100:~# i2cdetect -y 0                                                                                                                                                 
Error: Can't use SMBus Quick Write command on this bus                                                                                                                       
root@ac100:~# i2cdetect -F 0                                                                                                                                                 
Functionalities implemented by /dev/i2c-0:                                                                                                                                   
I2C                              yes                                                                                                                                         
SMBus Quick Command              no                                                                                                                                          
SMBus Send Byte                  yes                                                                                                                                         
SMBus Receive Byte               yes                                                                                                                                         
SMBus Write Byte                 yes                                                                                                                                         
SMBus Read Byte                  yes                                                                                                                                         
SMBus Write Word                 yes                                                                                                                                         
SMBus Read Word                  yes                                                                                                                                         
SMBus Process Call               yes                                                                                                                                         
SMBus Block Write                yes                                                                                                                                         
SMBus Block Read                 no
SMBus Block Process Call         no
SMBus PEC                        yes
I2C Block Write                  yes
I2C Block Read                   yes
root@ac100:~# i2cdetect -y -r 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- UU -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 4f 
50: 50 51 52 53 54 55 56 57 -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

grate-driver tegra2 support for mainline

https://github.com/grate-driver

https://github.com/grate-driver/grate/wiki/Grate-driver

https://wiki.debian.org/CreatePackageFromPPA

https://code.launchpad.net/~grate-driver/+archive/ubuntu/ppa

sudo apt install devscripts build-essential software-properties-common

sudo add-apt-repository ppa:grate-driver/ppa

# enable only deb-src (suggested beaver doesn't work for me)

root@tegra20:/home/dpavlin# cat /etc/apt/sources.list.d/grate-driver-ubuntu-ppa-disco.list 
#deb http://ppa.launchpad.net/grate-driver/ppa/ubuntu beaver main
deb-src http://ppa.launchpad.net/grate-driver/ppa/ubuntu disco main


apt update # make sure that is pass, use apt-key adv --recv-key if needed

# build order is important

apt-get build-dep libdrm
apt source --build libdrm
dpkg -i libdrm*.deb


apt-get build-dep xserver-xorg-video-opentegra

apt source --build xserver-xorg-video-opentegra

# this will fail to instal because of libturbojpg dependency

root@x200:/home/dpavlin/grade-build/xserver-xorg-video-opentegra-201901152016~grate~feac058~ubuntu19.04.1# vi debian/control

Package: xserver-xorg-video-opentegra
Architecture: armhf
Depends: ${shlibs:Depends}, ${misc:Depends}, ${xviddriver:Depends},
 libdrm-tegra0, liblz4-1, libturbojpeg0 (>= 1.5.0), libpng16-16,
Provides: ${xviddriver:Provides}
Description: X.Org X server -- Opensource driver for NVIDIA Tegra.
 This package provides HW-accelerated opensource driver for NVIDIA
 Tegra20+ SoC's from the GRATE project <URL:https://github.com/grate-driver>.


root@x200:/home/dpavlin/grade-build/xserver-xorg-video-opentegra-201901152016~grate~feac058~ubuntu19.04.1# dpkg-buildpackage



root@tegra20:/home/dpavlin# apt-get install x11-xserver-utils

root@tegra20:/etc# git diff
diff --git a/X11/xinit/xserverrc b/X11/xinit/xserverrc
index 94494ec..e6c4aa4 100755
--- a/X11/xinit/xserverrc
+++ b/X11/xinit/xserverrc
@@ -1,3 +1,3 @@
 #!/bin/sh
 
-exec /usr/bin/X -nolisten tcp "$@"
+exec /usr/bin/X -listen tcp "$@"


# let's try it

startx

root@tegra20:/home/dpavlin# export DISPLAY=:0
root@tegra20:/home/dpavlin# xhost +
access control disabled, clients can connect from any host

# on another computer

dpavlin@x200:~$ x2x -to tegra20:0 -south


# and one flip of display later, I have working X11 with remote mouse and keyboard

root@tegra20:/home/dpavlin# xrandr --output LVDS-0 --rotation inverted


# to get mesa to compile beause of dependencies, I needed to update to buster

root@tegra20:/home/dpavlin# apt-get build-dep mesa
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 builddeps:mesa : Depends: debhelper (>= 11) but 10.2.5 is to be installed
                  Depends: quilt (>= 0.63-8.2~) but it is not going to be installed
                  Depends: x11proto-dev but it is not installable
                  Depends: libxcb-dri3-dev (>= 1.13) but it is not going to be installed
                  Depends: libxcb-present-dev (>= 1.13) but it is not going to be installed
                  Depends: llvm-7-dev (>= 1:7~) but it is not installable
                  Depends: libwayland-dev (>= 1.15.0) but 1.12.0-1 is to be installed
                  Depends: libwayland-egl-backend-dev (>= 1.15.0) but it is not installable
                  Depends: libclang-7-dev (>= 1:7~) but it is not installable
                  Depends: libclc-dev (>= 0.2.0+git20180917-1~) but it is not going to be installed
                  Depends: wayland-protocols (>= 1.9) but it is not going to be installed
                  Depends: libglvnd-core-dev but it is not installable
E: Unable to correct problems, you have held broken packages.


# after buster upgrade and rebuild of everything

(with dpkg-buildpackage)

root@tegra20:/home/dpavlin/grade-build# apt source --build mesa

dpkg -i *.deb

~50 fps with 25% cpu usage in glxgears


root@tegra20:/home/dpavlin/grade-build# apt-get build-dep libvdpau-tegra
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 builddeps:libvdpau-tegra : Depends: libdri2-dev but it is not installable
E: Unable to correct problems, you have held broken packages.


# sigh

root@tegra20:/home/dpavlin/grade-build# apt source --build libvdpau-tegra
...
dpkg-checkbuilddeps: error: Unmet build dependencies: libxv-dev libdri2-dev


root@tegra20:/home/dpavlin/grade-build# apt --fix-broken install
root@tegra20:/home/dpavlin/grade-build# apt-get install libxv-dev

root@tegra20:/home/dpavlin/grade-build/libvdpau-tegra-201901220047~grate~8efb41c~ubuntu18.10.1# vi debian/control 

remove libdri2-dev and libdri2

root@tegra20:/home/dpavlin/grade-build/libvdpau-tegra-201901220047~grate~8efb41c~ubuntu18.10.1# dpkg-buildpackage

dpkg -i ../libvdpau-tegra*.deb



partition table support

https://lkml.org/lkml/2020/2/24/1358

permalink
Nexus 7 (2012) grouper

Codename grouper
Vendor: Google
Type: Tablet
Also known as: grouper
Platform: NVIDIA Tegra 3
CPU: 1.3 GHz quad-core Cortex A9
GPU: Nvidia GeForce ULP
RAM: 1 GB
Bluetooth: 3.0
Wi-Fi: 802.11 b/g/n 2.4GHz
GSM freq: not supported
LTE freq: not supported
Main camera: 1.2 MP
Secondary camera: not supported
Peripherals: accelerometer / gyroscope / proximity sensor / digital compass / GPS / magnometer / microphone / NF

https://www.unlegacy-android.org/projects/unlegacy-android/wiki/Grouper_info

PostmarketOS

compile

dpavlin@klin:/klin/pmos/pmbootstrap$ pmbootstrap install --android-recovery-zip

pmbootstrap flasher --method=adb sideload

To make pmbootstrap flasher work, I have to issue adb kill-server on my normal terminal console so that postmarketos
chroot can start new adb to flash device.

desktop network config

dpavlin@klin:/klin/pmos/pmbootstrap$ grep -A3 usb0 /etc/network/interfaces
allow-hotplug usb0
iface usb0 inet static
# postmarket os
	address 172.16.42.2
	netmask 255.255.255.0

dpavlin@klin:/klin/pmos/pmbootstrap$ grep -A5 pmos ~/.ssh/config
Host pmos
    HostName 172.16.42.1
    UserKnownHostsFile /dev/null
    StrictHostKeyChecking=no

reboot-mode to reboot into recovery

https://gitlab.com/postmarketOS/pmaports/-/merge_requests/442

pogo pins

Top ground.

Bottom +5 volts.

permalink
USB armory Mk II

This page describes pre-prelease version of usb armory, so if you are receiving release version,
 head over to usb armory wiki https://github.com/f-secure-foundry/usbarmory/wiki which improved massively
since this page was first written.

I had wrong expectations from this board: I was hoping to be able to use GPIO for serial or connecting sensors and that is not possible.



SoC: NXP i.MX6ULZ ARM® Cortex™-A7 900 MHz
RAM: 512 MB DDR3
Storage: internal 16 GB eMMC + external microSD
Bluetooth module: u-blox ANNA-B112 BLE
USB-C ports: DRP (Dual Role Power) receptacle + UFP (Upstream Facing Port) plug, USB 2.0 only (no video support)
LEDs: two
Slide switch: for boot mode selection between eMMC and microSD
External security elements: Microchip ATECC608A + NXP A71CH
Physical size: 66 mm x 19 mm x 8 mm (without enclosure, including USB-C connector)

https://github.com/inversepath/usbarmory-debian-base_image

dpavlin@klin:~/usb-armory/usbarmory-debian-base_image$ ls -al usbarmory-mark-two-debian_stretch-base_image-20191013.raw
-rw-r--r-- 1 root root 3670016000 Oct 13 13:30 usbarmory-mark-two-debian_stretch-base_image-20191013.raw

dpavlin@nuc:/mnt/klin/home/dpavlin/usb-armory/usbarmory-debian-base_image$ dd if=usbarmory-mark-two-debian_stretch-base_image-20191013.raw of=/dev/sdb bs=1M

dpavlin@nuc:~$ dmesg
[764607.538898] usb 2-1: new high-speed USB device number 34 using xhci_hcd
[764607.689068] usb 2-1: New USB device found, idVendor=0525, idProduct=a4a2, bcdDevice= 4.19
[764607.689078] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[764607.689082] usb 2-1: Product: RNDIS/Ethernet Gadget
[764607.689100] usb 2-1: Manufacturer: Linux 4.19.78-0 with 2184000.usb
[764607.900916] cdc_subset: probe of 2-1:1.0 failed with error -22
[764607.902622] cdc_subset 2-1:1.1 usb0: register 'cdc_subset' at usb-0000:00:14.0-1, Linux Device, ae:47:47:81:a0:a4
[764607.902666] usbcore: registered new interface driver cdc_subset
[764607.902711] cdc_ether: probe of 2-1:1.0 failed with error -16
[764607.902732] usbcore: registered new interface driver cdc_ether
[764607.914234] cdc_subset 2-1:1.1 enp0s20u1i1: renamed from usb0

network setup

dpavlin@nuc:~$ sudo ifconfig enp0s20u1i1 10.0.0.2 netmask 255.255.255.0

dpavlin@nuc:~$ sudo iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -o eth0 -j MASQUERADE

dpavlin@nuc:~$ ssh usbarmory@10.0.0.1
# password is usbarmory

usbarmory@usbarmory:~$ uname -a
Linux usbarmory 4.19.78-0 #1 PREEMPT Sun Oct 13 11:05:18 UTC 2019 armv7l GNU/Linux
usbarmory@usbarmory:~$ cat /proc/cpuinfo
processor	: 0
model name	: ARMv7 Processor rev 5 (v7l)
BogoMIPS	: 109.09
Features	: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xc07
CPU revision	: 5

Hardware	: Freescale i.MX6 Ultralite (Device Tree)
Revision	: 0000
Serial		: 0000000000000000
usbarmory@usbarmory:~$ free
              total        used        free      shared  buff/cache   available
Mem:         512204       25588      436744        7624       49872      467984
Swap:             0           0           0


boot select switch

Switch near sdcard select booting from emmc or microsd (silkscreen is somewhat poor, but by default bafore removing sticker it will boot from sdcard)

If it's closer to sdcard, it will boot from sdcard

image delivered on device

Password for image delivered with device is not usbarmory (?)

In fact, it doesn't have usbarmory user in /etc/passwd, but has it in /etc/shadow, go figure!

root@usbarmory:/# cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
systemd-timesync:x:100:102:systemd Time Synchronization,,,:/run/systemd:/bin/false
systemd-network:x:101:103:systemd Network Management,,,:/run/systemd/netif:/bin/false
systemd-resolve:x:102:104:systemd Resolver,,,:/run/systemd/resolve:/bin/false
systemd-bus-proxy:x:103:105:systemd Bus Proxy,,,:/run/systemd:/bin/false
_apt:x:104:65534::/nonexistent:/bin/false
messagebus:x:105:108::/var/run/dbus:/bin/false
sshd:x:106:65534::/run/sshd:/usr/sbin/nologin
interlock:x:1000:1000::/home/interlock:/bin/bash
lcars:x:1001:1001::/home/lcars:/bin/bash

root@usbarmory:/# cat /etc/shadow
root:*:18068:0:99999:7:::
daemon:*:18068:0:99999:7:::
bin:*:18068:0:99999:7:::
sys:*:18068:0:99999:7:::
sync:*:18068:0:99999:7:::
games:*:18068:0:99999:7:::
man:*:18068:0:99999:7:::
lp:*:18068:0:99999:7:::
mail:*:18068:0:99999:7:::
news:*:18068:0:99999:7:::
uucp:*:18068:0:99999:7:::
proxy:*:18068:0:99999:7:::
www-data:*:18068:0:99999:7:::
backup:*:18068:0:99999:7:::
list:*:18068:0:99999:7:::
irc:*:18068:0:99999:7:::
gnats:*:18068:0:99999:7:::
nobody:*:18068:0:99999:7:::
systemd-timesync:*:18068:0:99999:7:::
systemd-network:*:18068:0:99999:7:::
systemd-resolve:*:18068:0:99999:7:::
systemd-bus-proxy:*:18068:0:99999:7:::
_apt:*:18068:0:99999:7:::
messagebus:*:18068:0:99999:7:::
sshd:*:18068:0:99999:7:::
usbarmory:$6$rcyB4m4EPv$udqWloCZH/Av1IkJVuZHyWMhw/fYkhLGevlo17C3x6qMemSHUmPPAQrvc0SaY.yWVIIU0ADL0g54MZmidcxFn.:18068:0:99999:7:::
lcars:$6$iFljmotV$gnK66oZpz7BD3BqlFpPWoY/Q1tey8in75868neosxypKswjSoNDQotiMBZ9hh.vQBDyltA08z2Vji/QjElv4g.:18072:0:99999:7:::
interlock:!:18072:0:99999:7:::

After adding usbarmory account, running apt upgrade (since image has old kernel) device isn't bootable any more (at least it's not detected by host in which it's plugged in).

Let's try to rebuild image for emmc and flash it.

Well, re-build fails with patches allready applied errors in linux source, so let's wipe it:

root@813046ba7c77:/opt/armory# rm -Rf linux-* u-boot-2019.07*

root@813046ba7c77:/opt/armory# make all V=mark-two IMX=imx6ull BOOT=eMMC -j 8

pads on board

there is kicad project of production one which just removed pads https://github.com/f-secure-foundry/usbarmory/tree/master/hardware/mark-two

      jtag_mod jtag_tck
jtag_ntrst jtag_tms jtag_nsrst jtag_tdo jtag_tdi

from changelog those pads might be jtag (since it's enabled in u-boot), but schematics confirms it.

It seems that 8 gpio pins are available using additional board: https://github.com/inversepath/usbarmory/tree/master/hardware/mark-two-debug-accessory

sdcard vs emmc speed

root@usbarmory:/mnt/klin/home/dpavlin/usb-armory/usbarmory-debian-base_image# hdparm -Tt /dev/mmcblk[01]

/dev/mmcblk0: # -- sdcard
 Timing cached reads:   664 MB in  2.00 seconds = 331.99 MB/sec
 Timing buffered disk reads:  34 MB in  3.03 seconds =  11.21 MB/sec

/dev/mmcblk1: # -- emmc
 Timing cached reads:   716 MB in  2.00 seconds = 357.40 MB/sec
 Timing buffered disk reads: 128 MB in  3.04 seconds =  42.17 MB/sec

community

https://groups.google.com/forum/#!forum/usbarmory

https://hackaday.com/2019/09/29/usb-armory-mkii-a-usb-c-thumb-drive-based-linux-computer-for-pentesters/

led heartbeat off

https://photos.app.goo.gl/rRrzfbbs4GGjt3ePA

very bright and annoying in dark room

sbarmory@usbarmory:/sys/class/leds/LED_WHITE$ cat trigger
none kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock mmc0 mmc1 cpu cpu0 [heartbeat]

root@usbarmory:/sys/devices/soc0/leds/leds/LED_WHITE# echo none > trigger


network speed

root@usbarmory:~# iperf3 -c 10.0.0.2
Connecting to host 10.0.0.2, port 5201
[  4] local 10.0.0.1 port 33574 connected to 10.0.0.2 port 5201
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.03   sec  23.0 MBytes   188 Mbits/sec    0    174 KBytes
[  4]   1.03-2.00   sec  20.6 MBytes   178 Mbits/sec    0    272 KBytes
[  4]   2.00-3.01   sec  21.1 MBytes   176 Mbits/sec    0    286 KBytes
[  4]   3.01-4.01   sec  21.8 MBytes   182 Mbits/sec    0    297 KBytes
[  4]   4.01-5.00   sec  20.1 MBytes   171 Mbits/sec    0    297 KBytes
[  4]   5.00-6.00   sec  21.0 MBytes   176 Mbits/sec    0    329 KBytes
[  4]   6.00-7.00   sec  20.3 MBytes   171 Mbits/sec    0    329 KBytes
[  4]   7.00-8.00   sec  20.4 MBytes   171 Mbits/sec    0    329 KBytes
[  4]   8.00-9.00   sec  20.3 MBytes   171 Mbits/sec    0    329 KBytes
[  4]   9.00-10.00  sec  20.1 MBytes   169 Mbits/sec    0    329 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec   209 MBytes   175 Mbits/sec    0             sender
[  4]   0.00-10.00  sec   208 MBytes   174 Mbits/sec                  receiver

iperf Done.

network setup for desktop

dpavlin@nuc:~$ grep usbarmory -A 5 /etc/network/interfaces
# usbarmory
allow-hotplug enx1a5589a26942
iface enx1a5589a26942 inet static
	address 10.0.0.2
	netmask 255.255.255.0
	post-up iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -o eth0 -j MASQUERADE


bluetooth

https://github.com/inversepath/usbarmory/wiki/Bluetooth

root@usbarmory:/home/usbarmory# microcom -p /dev/ttymxc0

AT+GMR
"1.0.0-017"

armoryctl

usbarmory@usbarmory:~$ sudo apt install armoryctl

since device is on stretch it has go 1.7 which can't compile it.

dpavlin@klin:~/usb-armory$ git clone https://github.com/inversepath/armoryctl

dpavlin@klin:~/usb-armory/armoryctl$ make armoryctl GOARCH=arm
github.com/inversepath/armoryctl/anna_b112
# github.com/inversepath/armoryctl/anna_b112
anna_b112/openocd.go:328:9: undefined: strings.ReplaceAll
anna_b112/openocd.go:329:8: undefined: strings.ReplaceAll
note: module requires Go 1.12make: *** [Makefile:27: armoryctl] Error 2

After compile:

usbarmory@usbarmory:~$ sudo ./armoryctl tusb id
TUSB320
usbarmory@usbarmory:~$ sudo ./armoryctl ble info
manufacturer:"u-blox" model:"ANNA-B1" serial:"0" sw:"1.0.0-017" device_name:"USBARMORY-MKII-DUT-3776"
usbarmory@usbarmory:~$ sudo ./armoryctl se1 info
serial:0x0123455d2a9039e5ee revision:0x00006002
usbarmory@usbarmory:~$ sudo ./armoryctl pmic info
id:0x4("PF1510") family:0xf("15") otp:"A6" rev:0x11

i2c

root@usbarmory:/home/usbarmory# i2cdetect -l
root@usbarmory:/home/usbarmory# modprobe i2c-dev
root@usbarmory:/home/usbarmory# i2cdetect -l
i2c-0	i2c       	21a0000.i2c                     	I2C adapter
root@usbarmory:/home/usbarmory# i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- 08 -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- 31 -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: 60 61 -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --


permalink
CH376S
permalink
MQ

Analog sensors

MQ-2

  • MQ-2 gas sensor has high sensitity to LPG, Propane and Hydrogen, also could be used to Methane

and other combustible steam

board markings: KS123-35Y00K
LM393

MQ-4

  • High sensitivity to CH 4 ,Natural gas.
  • Small sensitivity to alcohol, smoke.

board markings: LM-22
LM393

MQ-7

  • High sensitivity to carbon monoxide

board markings: LM-22
LM393

https://www.instructables.com/id/Arduino-CO-Monitor-Using-MQ-7-Sensor/

My changes for single-line NAME=value output https://github.com/dpavlin/mq7-co-monitor

permalink
systemd

running old distributions under systemd-nspawn



install on host

apt install systemd-container

setup old distribution

os-release

root@saturn4:~# cat /saturn/etc/os-release
PRETTY_NAME="Debian GNU/Linux 4 (etch)"
NAME="Debian GNU/Linux"
VERSION_ID="4"
VERSION="4 (etch)"
VERSION_CODENAME=etch
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

console

root@saturn4:/saturn/etc# machinectl shell saturn /usr/bin/uptime
Failed to get shell PTY: Protocol error

fix it by adding console to inittab

dpavlin@saturn:~$ grep console /etc/inittab
0:2345:respawn:/sbin/getty 38400 console

network config

full access to host network, services are configured to listen to localhost

root@saturn4:/etc/systemd# mkdir nspawn

root@saturn4:/etc/systemd# cat > nspawn/saturn.nspawn
[Network]
VirtualEthernet=no

start it

root@saturn4:~# mv /saturn/ /var/lib/machines/
root@saturn4:~# machinectl enable saturn
Created symlink /etc/systemd/system/machines.target.wants/systemd-nspawn@saturn.service �/lib/systemd/system/systemd-nspawn@.service.
root@saturn4:~# machinectl start saturn

alternative

it seems that I'm unable to get console to work with systemd-nspawn and Debian etch. So alternative approach is just to run services from systemd service file using chroot

root@saturn4:/etc/systemd/system# cat saturn\@.service
[Unit]
Description=SocialText saturn services

[Service]
User=root
Type=forking
ExecStart=/etc/systemd/system/saturn.sh /etc/init.d/%i start
ExecStop=/etc/systemd/system/saturn.sh /etc/init.d/%i stop
Restart=on-failure

[Install]
WantedBy=multi-user.target

root@saturn4:/etc/systemd/system# systemctl start saturn@postgresql-8.1
root@saturn4:/etc/systemd/system# systemctl start saturn@ceqlotron
root@saturn4:/etc/systemd/system# systemctl start saturn@st-apache
root@saturn4:/etc/systemd/system# systemctl start saturn@apache2


permalink
GP2Y1010AU0F


Product Name: GP2Y1010AU0F dust sensor module

https://www.instructables.com/id/How-to-Interface-With-Optical-Dust-Sensor/

Too cheap to be useful? https://techblog.calvinboey.com/review-of-the-sharp-dust-sensor-gp2y1010au0f/

https://d.lij.uno/misc-dust-detector-with-arduino-serial-comm.html

Technical parameters

Power supply voltage: DC5 � 2V

Operating Current: 20mA (peak)

Sensitivity: 0.5V / (0.1mg / m3)

The minimum detection level of particles: 0.8 m

Clean air voltage: 0.9V typ.

Working temperature: -10 ~ 65

Storage temperature: -20 ~ 80

Size: 46mm � 30mm � 17.6mm

Size Weight: 15g

arduino

https://github.com/mickey9801/GP2Y1010AU0F

  calcVoltage = voMeasured * (this->_VCC / 1024.0);
  // linear equation taken from http://www.howmuchsnow.com/arduino/airquality/
  dustDensity = (0.17 * calcVoltage - 0.1) * 1000.0;

Source code here works much better if you do 10 readings and average them before sending result

tasmota

https://github.com/arendst/Tasmota/pull/7118

permalink
Weblog Navigation
Loading...
Weblog Archives
  • Loading...