Electron app crash while using external library without any error message - node.js

Description:
After about 1 week of debugging to figure out the cause of the application closing itself without any error message, I discovered that the main cause of crashing is from the node-ios-device library.
Everything works normally, but after about 1 hour, a crash occurs. What I think is strange is that a crash occurs even iosDevice.watch() was not called. Or just by importing the node-ios-devices library can a crash occur.
Sometimes, I got this message after crashing as well.
[21194:0607/225605.295914:FATAL:message_pump_kqueue.cc(387)] : Bad file descriptor (9)
It still works on my NodeJS project.
Reproduction:
https://github.com/zcmgyu/crash-electron-node-ios-device/blob/master/main.js#L22-L28
const handle = iosDevice.watch();
handle.on('change', devices => {
console.log('Connected devices:', devices);
});
handle.on('error', console.error);
iosDevice.on('log', msg => console.log(msg));
This is logs output from iosDevice.on('log')
$ electron .
Creating device list with 1 devices
Connected devices: [
{
udid: 'XXXX',
interfaces: [ 'Wi-Fi' ],
name: 'ZC X',
buildVersion: '17F75',
cpuArchitecture: 'arm64',
deviceClass: 'iPhone',
deviceColor: 'Black',
hardwareModel: 'D22AP',
modelNumber: 'MQAY2',
productType: 'iPhone10,3',
productVersion: '13.5',
serialNumber: 'FK1VVTGLJCLL',
trustedHostAttached: false
}
]
Adding listener
Creating device list with 1 devices
Resetting timer due to new device notification
Device XXXX disconnected via Wi-Fi
Connected devices: []
Creating device list with 0 devices
Dispatching device changes to 1 listener (thread 2978043419396287625)
Resetting timer due to new device notification
Device XXXX connected via Wi-Fi
Getting device info for XXXX
Connecting to device: XXXX
Pairing device: XXXX
Validating device pairing
Starting session: XXXX
Stopping session: XXXX
Disconnecting from device: XXXX
Connected devices: [
{
udid: 'XXXX',
interfaces: [ 'Wi-Fi' ],
name: 'ZC X',
buildVersion: '17F75',
cpuArchitecture: 'arm64',
deviceClass: 'iPhone',
deviceColor: 'Black',
hardwareModel: 'D22AP',
modelNumber: 'MQAY2',
productType: 'iPhone10,3',
productVersion: '13.5',
serialNumber: 'FK1VVTGLJCLL',
trustedHostAttached: false
}
]
Creating device list with 1 devices
Dispatching device changes to 1 listener (thread 2978043419396287625)
Resetting timer due to new device notification
Device XXXX disconnected via Wi-Fi
Connected devices: []
✨ Done in 225.28s.
macOS: 10.15.4
node-ios-device: 2.0.2
electron: 9.0.2
node: 14.3.0
There is no alternative library so I could fulfill my project without this one. Please save my day.

Related

Why U disk couldnot be addressed when unplug a usb speaker from the usb 3.0 port?

My board has a usb3.0 port and a usb2.0 port. The bug occurred in the usb3.0 port. The Linux kernel version is 3.10.65.
The script that makes the bug:
plug a USB speaker in the usb3.0 port.
play audio in the USB speaker continuously.
unplug the USB speaker, Not stop audio play when unplug.
plug a usb3.0 disk in the same that usb3.0 port.
then the USB host controller couldn't address the U Disk.
System report the following log:
#
#
#
# ./test.sh
[ 68.036091] usb 3-1: USB disconnect, device number 2
[ 68.041659] cannot submit urb (err = -19)
[ 78.860028] xhci-hcd xhci-hcd.0.auto: Timeout while waiting for address device command
[ 84.070030] xhci-hcd xhci-hcd.0.auto: Timeout while waiting for address device command
[ 84.280026] usb 4-1: device not accepting address 2, error -62
[ 89.460027] xhci-hcd xhci-hcd.0.auto: Timeout while waiting for address device command
[ 94.670025] xhci-hcd xhci-hcd.0.auto: Timeout while waiting for address device command
[ 94.880020] usb 4-1: device not accepting address 3, error -62
[ 100.060036] xhci-hcd xhci-hcd.0.auto: Timeout while waiting for address device command
[ 105.270044] xhci-hcd xhci-hcd.0.auto: Timeout while waiting for address device command
[ 105.480024] usb 4-1: device not accepting address 4, error -62
[ 110.660024] xhci-hcd xhci-hcd.0.auto: Timeout while waiting for address device command
[ 115.870026] xhci-hcd xhci-hcd.0.auto: Timeout while waiting for address device command
[ 116.080020] usb 4-1: device not accepting address 5, error -62
[ 116.086478] hub 4-0:1.0: unable to enumerate USB device on port 1
After a long time debug, I find if I add the debug info , the bug never happen. But I don't know why.
void usb_set_device_state(struct usb_device *udev,
enum usb_device_state new_state)
{
unsigned long flags;
int wakeup = -1;
spin_lock_irqsave(&device_state_lock, flags);
if (udev->state == USB_STATE_NOTATTACHED)
; /* do nothing */
else if (new_state != USB_STATE_NOTATTACHED) {
/* root hub wakeup capabilities are managed out-of-band
* and may involve silicon errata ... ignore them here.
*/
if (udev->parent) {
if (udev->state == USB_STATE_SUSPENDED
|| new_state == USB_STATE_SUSPENDED)
; /* No change to wakeup settings */
else if (new_state == USB_STATE_CONFIGURED)
wakeup = (udev->quirks &
USB_QUIRK_IGNORE_REMOTE_WAKEUP) ? 0 :
udev->actconfig->desc.bmAttributes &
USB_CONFIG_ATT_WAKEUP;
else
wakeup = 0;
}
if (udev->state == USB_STATE_SUSPENDED &&
new_state != USB_STATE_SUSPENDED)
udev->active_duration -= jiffies;
else if (new_state == USB_STATE_SUSPENDED &&
udev->state != USB_STATE_SUSPENDED)
udev->active_duration += jiffies;
udev->state = new_state;
} else
recursively_mark_NOTATTACHED(udev);
if (new_state == USB_STATE_NOTATTACHED) {
printk("[%s %d] .\n", __func__, __LINE__);
printk("[%s %d] .\n", __func__, __LINE__);
printk("[%s %d] .\n", __func__, __LINE__);
}
spin_unlock_irqrestore(&device_state_lock, flags);
if (wakeup >= 0)
device_set_wakeup_capable(&udev->dev, wakeup);
}
enter code here

Android O porting

I am trying to port android O to my device but encountering issue due to vendor partition not being created (which is mandatory for Android O), as a result the SELinux policy is not being fetched and boot process is being terminated. How can I create a vendor partition to flash the vendor image into.
my device runs on a Qualcomm msm8953 SOC.
below are the boot logs.
309800] nq-nci 5-0028: nqx_probe: probing nqxx failed, check hardware
[ 7.317273] Freeing unused kernel memory: 1196K
[ 7.321143] Freeing alternatives memory: 112K
[ 7.329257] init: init first stage started!
[ 7.332716] init: Using Android DT directory /proc/device-tree/firmware/android/
[ 7.724741] init: bool android::init::FirstStageMount::InitRequiredDevices(): partition(s) not found in /sys, waiting for their uevent(s): vendor
[ 8.878132] of_batterydata_get_best_profile: 2951034_foxda_ef501esp_3000mah_averaged_masterslave_jun6th2017 found
[ 8.894872] FG: fg_batt_profile_init: Battery SOC: 97, V: 4249242uV
[ 8.900528] of_batterydata_get_best_profile: 2951034_foxda_ef501esp_3000mah_averaged_masterslave_jun6th2017 found
[ 8.910371] SMBCHG: smbchg_config_chg_battery_type: Vfloat changed from 4400mV to 4350mV for battery-type 2951034_foxda_ef501esp_3000mah_averaged_masterslave_jun6th2017
[ 17.746065] init: Wait for partitions returned after 10009ms
[ 17.750729] init: bool android::init::FirstStageMount::InitRequiredDevices(): partition(s) not found after polling timeout: vendor
[ 17.768123] init: Failed to mount required partitions early ...
[ 17.773010] init: panic: rebooting to bootloader
[ 17.777611] init: Reboot start, reason: reboot, rebootTarget: bootloader
[ 17.784364] init: android::WriteStringToFile open failed: No such file or directory
[ 17.791947] init: Shutdown timeout: 0 ms
[ 17.795852] init: property_set("persist.vendor.crash.detect", "false") failed: __system_property_add failed
[ 17.805838] init: waitid failed: No child processes
[ 17.810437] init: vold not running, skipping vold shutdown
[ 17.916293] init: powerctl_shutdown_time_ms:138:0
[ 17.919991] init: Reboot ending, jumping to kernel
[ 17.924752] msm_thermal:msm_thermal_update_freq Freq mitigation task is not initialized
[ 17.978348] mdss_fb_release_all: try to close unopened fb 1! from pid:1 name:init
[ 17.984816] mdss_fb_release_all: try to close unopened fb 0! from pid:1 name:init
[ 17.993627] reboot: Restarting system with command 'bootloader'
[ 17.998538] Going down for restart now
[ 18.002831] qcom,qpnp-power-on qpnp-power-on-12: PMIC#SID2: configuring PON for reset
I am encountering this myself and I believe it has to do with a mix of incomplete defconfig and dm-verity in the SoC's dts. Unless you have worked it out by now.
In particular to incomplete defconfig, I had to add options like CONFIG_PINCTRL_MSM8937=y as my android device is technically a 8937. Also, in arch/arm/boot/dts/qcom/msm8937.dtsi I needed to pull the verify flag from fsmgr_flags.
I now have other issues, but I am getting closer to booting.

Custom Linux Build on NanoPi Neo Board

I am a noob to building custom linux OSes for embedded boards - so please ignore my ignorance.
I have a board called NanoPi NEO that has custom Debian linux. Now the board comes with a .img file that can be flashed on to an SD card and plugged into the slot and the board boots from the card.
Now I am trying to build my own Custom linux and flash to the SD card. I have been through the forums and manuals and managed to get this far.
Problem
I understand that there are three components to a custom linux build
boot0 - The thing that loads the BootLoader
U-Boot - One of the many BootLoaders. (The project uses this).
Rootfs - The filesystem and everything else.
The board manufacturer's website gave these instructions for building custom os. I followed those instructions and did everything including proper partitioning of the SD card (with free space in front for boot0, boot partition with uImage and Script.bin, and partition for rootfs)
The problem is that the board loads the Kernel on boot but doesn't mount the filesystem and prove a user prompt.
This is the Dmesg output.
HELLO! BOOT0 is starting!
boot0 version : 4.0.0
boot0 commit : 9d0a4ce0ba7756bc0de2e0efe7ec15900a4aa947
fel_flag = 0x00000000
rtc[0] value = 0x00000000
rtc[1] value = 0x00000000
rtc[2] value = 0x00000000
rtc[3] value = 0x00000000
rtc[4] value = 0x00000000
rtc[5] value = 0x00000000
rtc[6] value = 0x00000000
rtc[7] value = 0x00000000
DRAM DRIVE INFO: V1.3
the chip id is 0x00000081
the chip id is 0x00000081
the chip id is 0x00000081
the chip id is 0x00000081
the chip id is 0x00000081
READ DQS LCDL = 00242524
DRAM Type = 3 (2:DDR2,3:DDR3,6:LPDDR2,7:LPDDR3)
DRAM CLK = 576 MHz
DRAM zq value: 003b3bfb
DRAM dram para1: 10e20100
DRAM dram para2: 00000001
DRAM workmode1: 000009f4
DRAM SIZE =256 M
odt delay
dram size =256
card boot number = 0
card no is 0
sdcard 0 line count 4
[mmc]: mmc driver ver 2015-04-13 16:07:39
[mmc]: ***Try SD card 0***
[mmc]: SD/MMC Card: 4bit, capacity: 3812MB
[mmc]: vendor: Man 00845446 Snr 0000200b
[mmc]: product: SD[mmc]: revision: 0.0
[mmc]: ***SD/MMC 0 init OK!!!***
sdcard 0 init ok
The size of uboot is 000e4000.
sum=5b02f845
src_sum=5b02f845
Succeed in loading uboot from sdmmc flash.
Ready to disable icache.
Jump to secend Boot.
SUNXI_NORMAL_MODE
[ 0.380]e mode
U-Boot 2011.09-rc1-00000-g9d0a4ce-dirty (Aug 18 2016 - 15:53:02) Allwinner Technology
[ 0.390]version: 1.1.0
[ 0.392]uboot commit : 9d0a4ce0ba7756bc0de2e0efe7ec15900a4aa947
normal mode
[ 0.403]pmbus: ready
not set main pmu id
axp_probe error
gpio value=0x20000
[ 0.441]PMU: pll1 1008 Mhz,PLL6=600 Mhz
AXI=336 Mhz,AHB=200 Mhz, APB1=100 Mhz
sid read already
fel key new mode
run key detect
no key found
no key input
dram_para_set start
dram_para_set end
normal mode
[ 0.472]DRAM: 256 MiB
relocation Offset is: 05af2000
[box standby] read rtc = 0x0
[box_start_os] mag be start_type no use
user_gpio config
user_gpio ok
gic: normal or no secure os mode
workmode = 0
MMC: 0
[ 0.552][mmc]: mmc driver ver 2015-04-13 14:50:00
[ 0.557][mmc]: get sdc_phy_wipe fail.
[ 0.561][mmc]: get sdc0 sdc_erase fail.
[ 0.565][mmc]: get sdc_f_max fail,use default 50000000Hz
[ 0.570][mmc]: get sdc_ex_dly_used fail,use default dly
[ 0.576][mmc]: SUNXI SD/MMC: 0
[ 0.589][mmc]: *Try SD card 0*
[ 0.622][mmc]: CID 0x84544653 0x44000000 0x20 0xb01014f
[ 0.627][mmc]: mmc clk 50000000
[ 0.630][mmc]: SD/MMC Card: 4bit, capacity: 3812MB
[ 0.635][mmc]: boot0 capacity: 0KB,boot1 capacity: 0KB
[ 0.640][mmc]: ***SD/MMC 0 init OK!!!***
[ 0.645][mmc]: erase_grp_size:0x1WrBlk * 0x200 = 0x200 Byte
[ 0.651][mmc]: secure_feature 0x0
[ 0.654][mmc]: secure_removal_type 0x0
[ 0.658]sunxi flash init ok
script config pll_de to 864 Mhz
Not Found clk pll_video1 in script
script config pll_video to 297 Mhz
script config pll_periph0 to 600 Mhz
unable to find regulator vcc-hdmi-18 from [pmu1_regu] or [pmu2_regu]
enable power vcc-hdmi-18, ret=-1
DRV_DISP_Init end
[disk_read_fs] no the partition
error: open tv_vdid.fex, maybe it is not exist
[disk_read_fs] no the partition
error: open disp_rsl.fex, maybe it is not exist
[disk_read_fs] no the partition
error: open disp_rsl.fex, maybe it is not exist
boot_disp.auto_hpd=1
auto hpd check has 100 times!
auto check no any connected, the output_type is 4
[ 2.032]finally, output_type=0x4, output_mode=0x4, screen_id=0x0, disp_para=0x0
try to read logic blk 0 without env partition
*** Warning - bad CRC, using default environment
In: serial
Out: serial
Err: serial
--------fastboot partitions--------
mbr not exist
base bootcmd=run setargs_mmc boot_normal
bootcmd set setargs_mmc
key 0
cant find rcvy value
cant find fstbt value
no misc partition is found
to be run cmd=run setargs_mmc boot_normal
[ 2.080][mmc]: MMC Device 2 not found
[ 2.084][mmc]: Can not find mmc dev
[ 2.087][mmc]: read first backup failed in fun sdmmc_secure_storage_read line 1854
sunxi_secstorage_read fail
get secure storage map err
check user data form private
the private part isn't exist
WORK_MODE_BOOT
adver not need show
sunxi_bmp_logo_display
[disk_read_fs] no the partition
error: open bootlogo.bmp, maybe it is not exist
sunxi bmp info error : unable to open logo file bootlogo.bmp
[ 2.123]Hit any key to stop autoboot: 0
[ 4.300][mmc]: blkcnt should not be 0
## Booting kernel from Legacy Image at 40007800 ...
Image Name: Linux-3.4.39-h3
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 4522784 Bytes = 4.3 MiB
Load Address: 40008000
Entry Point: 40008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK
[ 4.603][mmc]: MMC Device 2 not found
[ 4.607][mmc]: mmc not find,so not exit
[ 4.611]
Starting kernel ...
[sun8i_fixup]: From boot, get meminfo:
Start: 0x40000000
Size: 256MB
ion_carveout reserve: 160m#0 256m#0 130m#1 200m#1
ion_reserve_select: ion chipid [0x2c00081!
ion_reserve_common: ion reserve: [0x46000000, 0x50000000]!
[ 0.000000] Booting Linux on physical CPU 0
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 3.4.39-h3 (azmath#azPC) (gcc version 4.6.3 20120201 (prerelease) (crosstool-NG linaro-1.13.1-2012.02-20120222 - Linaro GCC 2012.02) ) #1 SMP PREEMPT Thu Aug 18 15:52:21 IST 2016
[ 0.000000] cma: CMA: reserved 160 MiB at 46000000
[ 0.000000] PERCPU: Embedded 8 pages/cpu #c0c91000 s11840 r8192 d12736 u32768
[ 0.000000] Kernel command line: console=ttyS0,115200 console=tty0 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait init=/sbin/init
[ 0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[ 0.000000] allocated 524288 bytes of page_cgroup
[ 0.000000] please try 'cgroup_disable=memory' option if you don't want memory cgroups
[ 0.000000] Memory: 256MB = 256MB total
[ 0.000000] Memory: 84012k/84012k available, 178132k reserved, 0K highmem
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
[ 0.000000] vmalloc : 0xd0800000 - 0xff000000 ( 744 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xd0000000 ( 256 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0xc0008000 - 0xc089dfd4 (8792 kB)
[ 0.000000] .init : 0xc089e000 - 0xc08eee40 ( 324 kB)
[ 0.000000] .data : 0xc08f0000 - 0xc096a878 ( 491 kB)
[ 0.000000] .bss : 0xc096b02c - 0xc0a3fc88 ( 852 kB)
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000] Additional per-CPU info printed with stalls.
[ 0.000000] NR_IRQS:544
[ 0.000000] Architected local timer running at 24.00MHz.
[ 0.000000] Switching to timer-based delay loop
[ 0.000000] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956ms
[ 0.000000] Console: colour dummy device 80x30
[ 0.000000] console [tty0] enabled
[ 0.001029] Calibrating delay loop (skipped), value calculated using timer frequency.. 4800.00 BogoMIPS (lpj=24000000)
[ 0.001097] pid_max: default: 32768 minimum: 301
[ 0.001458] Mount-cache hash table entries: 512
[ 0.002521] Initializing cgroup subsys cpuacct
[ 0.002561] Initializing cgroup subsys memory
[ 0.002631] Initializing cgroup subsys devices
[ 0.002663] Initializing cgroup subsys freezer
[ 0.002692] Initializing cgroup subsys blkio
[ 0.002736] Initializing cgroup subsys perf_event
[ 0.002813] CPU: Testing write buffer coherency: ok
[ 0.002890] ftrace: allocating 24150 entries in 71 pages
[ 0.030315] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.030365] [sunxi_smp_prepare_cpus] enter
[ 0.030417] Setting up static identity map for 0x4061f8e0 - 0x4061f938
[ 0.031457] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[ 0.031592] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[ 0.031592] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[ 0.040210] Brought up 4 CPUs
[ 0.040292] SMP: Total of 4 processors activated (19200.00 BogoMIPS).
[ 0.041034] devtmpfs: initialized
[ 0.043817] wakeup src cnt is : 2.
[ 0.043914] sunxi pm init
[ 0.044064] pinctrl core: initialized pinctrl subsystem
[ 0.054192] NET: Registered protocol family 16
[ 0.054986] DMA: preallocated 2048 KiB pool for atomic coherent allocations
[ 0.054986] script_sysfs_init success
[ 0.054986] gpiochip_add: registered GPIOs 0 to 383 on device: sunxi-pinctrl
[ 0.054986] sunxi-pinctrl sunxi-pinctrl: initialized sunXi PIO driver
[ 0.054986] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.054986] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.055148] script config pll_video to 297 Mhz
[ 0.055180] script config pll_de to 864 Mhz
[ 0.055205] script config pll_ve to 402 Mhz
[ 0.061950] bio: create slab <bio-0> at 0
[ 0.061950] [ARISC] :sunxi-arisc driver v1.04
[ 0.076943] [ARISC] :arisc version: [v0.1.58]
[ 0.163654] [ARISC] :sunxi-arisc driver v1.04 startup succeeded
[ 0.163781] pwm module init!
[ 0.171646] SCSI subsystem initialized
[ 0.171646] usbcore: registered new interface driver usbfs
[ 0.171646] usbcore: registered new interface driver hub
[ 0.171646] usbcore: registered new device driver usb
[ 0.171646] twi_chan_cfg()340 - [twi0] has no twi_regulator.
[ 0.171646] twi_chan_cfg()340 - [twi1] has no twi_regulator.
[ 0.171646] twi_chan_cfg()340 - [twi2] has no twi_regulator.
[ 0.171646] Linux video capture interface: v2.00
[ 0.171718] Advanced Linux Sound Architecture Driver Version 1.0.25.
[ 0.172304] Bluetooth: Core ver 2.16
[ 0.172369] NET: Registered protocol family 31
[ 0.172393] Bluetooth: HCI device and connection manager initialized
[ 0.172422] Bluetooth: HCI socket layer initialized
[ 0.172445] Bluetooth: L2CAP socket layer initialized
[ 0.172479] Bluetooth: SCO socket layer initialized
[ 0.172586] Switching to clocksource arch_sys_counter
[ 0.183438] FS-Cache: Loaded
[ 0.183767] CacheFiles: Loaded
[ 0.195670] NET: Registered protocol family 2
[ 0.195984] IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.196546] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
[ 0.196714] TCP bind hash table entries: 8192 (order: 4, 98304 bytes)
[ 0.196858] TCP: Hash tables configured (established 8192 bind 8192)
[ 0.196886] TCP: reno registered
[ 0.196908] UDP hash table entries: 128 (order: 0, 4096 bytes)
[ 0.196953] UDP-Lite hash table entries: 128 (order: 0, 4096 bytes)
[ 0.197265] NET: Registered protocol family 1
[ 0.197667] RPC: Registered named UNIX socket transport module.
[ 0.197701] RPC: Registered udp transport module.
[ 0.197722] RPC: Registered tcp transport module.
[ 0.197743] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.198224] hw perfevents: enabled with ARMv7 Cortex_A7 PMU driver, 5 counters available
[ 0.198362] sunxi_reg_init enter
[ 0.199096] audit: initializing netlink socket (disabled)
[ 0.199161] type=2000 audit(0.190:1): initialized
[ 0.201581] NTFS driver 2.1.30 [Flags: R/W].
[ 0.201895] fuse init (API version 7.18)
[ 0.202256] msgmni has been set to 484
[ 0.203709] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[ 0.203759] io scheduler noop registered
[ 0.203779] io scheduler deadline registered
[ 0.203851] io scheduler cfq registered (default)
[ 0.204325] [DISP]disp_module_init
[ 0.204656] cmdline,init_disp=
[ 0.204696] cmdline,disp=
[ 0.214840] [DISP] Fb_map_kernel_logo,line:926:Fb_map_kernel_logo failed!
[ 0.230039] Console: switching to colour frame buffer device 160x45
[ 0.246402] [DISP]disp_module_init finish
[ 0.246750] sw_uart_get_devinfo()1503 - uart0 has no uart_regulator.
[ 0.246930] sw_uart_get_devinfo()1503 - uart1 has no uart_regulator.
[ 0.247103] sw_uart_get_devinfo()1503 - uart2 has no uart_regulator.
[ 0.247276] sw_uart_get_devinfo()1503 - uart3 has no uart_regulator.
[ 0.248031] uart0: ttyS0 at MMIO 0x1c28000 (irq = 32) is a SUNXI
[ 0.248209] sw_uart_pm()890 - uart0 clk is already enable
[ 0.248364] sw_console_setup()1233 - console setup baud 115200 parity n bits 8, flow n
[ 0.360189] console [ttyS0] enabled
[ 0.530429] uart1: ttyS1 at MMIO 0x1c28400 (irq = 33) is a SUNXI
[ 0.530691] uart2: ttyS2 at MMIO 0x1c28800 (irq = 34) is a SUNXI
[ 0.530955] uart3: ttyS3 at MMIO 0x1c28c00 (irq = 35) is a SUNXI
[ 0.531802] [drm] Initialized drm 1.1.0 20060810
[ 0.535869] loop: module loaded
[ 0.659319] sunxi_spi_chan_cfg()1383 - [spi-0] has no spi_regulator.
[ 0.840684] sunxi_spi_chan_cfg()1383 - [spi-1] has no spi_regulator.
[ 0.965661] spi spi0: master is unqueued, this is deprecated
[ 1.150380] tun: Universal TUN/TAP device driver, 1.6
[ 1.150388] tun: (C) 1999-2004 Max Krasnyansky <maxk#qualcomm.com>
[ 1.151363] PPP generic driver version 2.4.2
[ 1.151552] PPP BSD Compression module registered
[ 1.151560] PPP Deflate Compression module registered
[ 1.152440] PPP MPPE Compression module registered
[ 1.152451] NET: Registered protocol family 24
[ 1.152493] PPTP driver version 0.8.5
[ 1.152743] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.172877] sunxi-ehci sunxi-ehci.1: SW USB2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.172912] sunxi-ehci sunxi-ehci.1: new USB bus registered, assigned bus number 1
[ 1.296094] sunxi-ehci sunxi-ehci.1: irq 104, io mem 0xf1c1a000
[ 1.480038] sunxi-ehci sunxi-ehci.1: USB 0.0 started, EHCI 1.00
[ 1.632720] hub 1-0:1.0: USB hub found
[ 1.685669] hub 1-0:1.0: 1 port detected
[ 1.714667] sunxi-ehci sunxi-ehci.2: SW USB2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.727974] sunxi-ehci sunxi-ehci.2: new USB bus registered, assigned bus number 2
[ 1.741191] sunxi-ehci sunxi-ehci.2: irq 106, io mem 0xf1c1b000
[ 1.770036] sunxi-ehci sunxi-ehci.2: USB 0.0 started, EHCI 1.00
[ 1.781512] hub 2-0:1.0: USB hub found
[ 1.789904] hub 2-0:1.0: 1 port detected
[ 1.818952] sunxi-ehci sunxi-ehci.3: SW USB2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.832323] sunxi-ehci sunxi-ehci.3: new USB bus registered, assigned bus number 3
[ 1.845590] sunxi-ehci sunxi-ehci.3: irq 108, io mem 0xf1c1c000
[ 1.870043] sunxi-ehci sunxi-ehci.3: USB 0.0 started, EHCI 1.00
[ 1.881664] hub 3-0:1.0: USB hub found
[ 1.890302] hub 3-0:1.0: 1 port detected
[ 1.919344] sunxi-ehci sunxi-ehci.4: SW USB2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.932740] sunxi-ehci sunxi-ehci.4: new USB bus registered, assigned bus number 4
[ 1.945967] sunxi-ehci sunxi-ehci.4: irq 110, io mem 0xf1c1d000
[ 1.970042] sunxi-ehci sunxi-ehci.4: USB 0.0 started, EHCI 1.00
[ 1.981680] hub 4-0:1.0: USB hub found
[ 1.990489] hub 4-0:1.0: 1 port detected
[ 1.999718] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 2.031228] sunxi-ohci sunxi-ohci.1: SW USB2.0 'Open' Host Controller (OHCI) Driver
[ 2.044385] sunxi-ohci sunxi-ohci.1: new USB bus registered, assigned bus number 5
[ 2.057397] sunxi-ohci sunxi-ohci.1: irq 105, io mem 0xf1c1a400
[ 2.124576] hub 5-0:1.0: USB hub found
[ 2.133311] hub 5-0:1.0: 1 port detected
[ 2.162621] sunxi-ohci sunxi-ohci.2: SW USB2.0 'Open' Host Controller (OHCI) Driver
[ 2.175860] sunxi-ohci sunxi-ohci.2: new USB bus registered, assigned bus number 6
[ 2.189035] sunxi-ohci sunxi-ohci.2: irq 107, io mem 0xf1c1b400
[ 2.264561] hub 6-0:1.0: USB hub found
[ 2.273445] hub 6-0:1.0: 1 port detected
[ 2.302798] sunxi-ohci sunxi-ohci.3: SW USB2.0 'Open' Host Controller (OHCI) Driver
[ 2.316105] sunxi-ohci sunxi-ohci.3: new USB bus registered, assigned bus number 7
[ 2.329298] sunxi-ohci sunxi-ohci.3: irq 109, io mem 0xf1c1c400
[ 2.404584] hub 7-0:1.0: USB hub found
[ 2.413449] hub 7-0:1.0: 1 port detected
[ 2.442827] sunxi-ohci sunxi-ohci.4: SW USB2.0 'Open' Host Controller (OHCI) Driver
[ 2.456174] sunxi-ohci sunxi-ohci.4: new USB bus registered, assigned bus number 8
[ 2.469459] sunxi-ohci sunxi-ohci.4: irq 111, io mem 0xf1c1d400
[ 2.544586] hub 8-0:1.0: USB hub found
[ 2.553518] hub 8-0:1.0: 1 port detected
[ 2.562915] Initializing USB Mass Storage driver...
[ 2.573211] usbcore: registered new interface driver usb-storage
[ 2.584572] USB Mass Storage support registered.
[ 2.594457] usbcore: registered new interface driver ums-alauda
[ 2.605819] usbcore: registered new interface driver ums-cypress
[ 2.617280] usbcore: registered new interface driver ums-datafab
[ 2.628608] usbcore: registered new interface driver ums_eneub6250
[ 2.640060] usbcore: registered new interface driver ums-freecom
[ 2.651238] usbcore: registered new interface driver ums-isd200
[ 2.662342] usbcore: registered new interface driver ums-jumpshot
[ 2.673509] usbcore: registered new interface driver ums-karma
[ 2.684357] usbcore: registered new interface driver ums-onetouch
[ 2.695402] usbcore: registered new interface driver ums-realtek
[ 2.706252] usbcore: registered new interface driver ums-sddr09
[ 2.716948] usbcore: registered new interface driver ums-sddr55
[ 2.727582] usbcore: registered new interface driver ums-usbat
[ 2.738113] usbcore: registered new interface driver usbserial
[ 2.748503] usbserial: USB Serial Driver core
[ 2.757202] usbcore: registered new interface driver option
[ 2.767257] USB Serial support registered for GSM modem (1-port)
[ 2.778459] file system registered
[ 2.787739] android_usb gadget: Mass Storage Function, version: 2009/09/11
[ 2.799369] android_usb gadget: Number of LUNs=3
[ 2.808438] lun0: LUN: removable file: (no medium)
[ 2.817768] lun1: LUN: removable file: (no medium)
[ 2.826963] lun2: LUN: removable file: (no medium)
[ 2.836406] android_usb gadget: android_usb ready
[ 2.846187] mousedev: PS/2 mouse device common for all mice
[ 2.857107] ls_fetch_sysconfig_para: ls_unused.
[ 2.866277] [RTC] WARNING: Rtc time will be wrong!!
[ 2.875373] [RTC] WARNING: use *internal OSC* as clock source
[ 2.885690] sunxi-rtc sunxi-rtc: rtc core: registered sunxi-rtc as rtc0
[ 2.896812] i2c /dev entries driver
[ 2.904919] IR RC5(x) protocol handler initialized
[ 2.914167] tscdev_init: tsc driver is disabled
[ 2.923307] Driver for 1-wire Dallas network protocol.
[ 2.932808] sunxi_wdt_init_module: sunxi WatchDog Timer Driver v1.0
[ 2.943662] sunxi_wdt_probe: devm_ioremap return wdt_reg 0xf1c20ca0, res->start 0x01c20ca0, res->end 0x01c20cbf
[ 2.955143] sunxi_wdt_probe: initialized (g_timeout=16s, g_nowayout=0)
[ 2.970118] wdt_enable, write reg 0xf1c20cb8 val 0x00000000
[ 2.980326] timeout_to_interv, line 167
[ 2.988404] interv_to_timeout, line 189
[ 2.996449] wdt_set_tmout, write 0x000000b0 to mode reg 0xf1c20cb8, actual timeout 16 sec
[ 3.009669] device-mapper: uevent: version 1.0.3
[ 3.019024] device-mapper: ioctl: 4.22.0-ioctl (2011-10-19) initialised: dm-devel#redhat.com
[ 3.032580] Bluetooth: HCI UART driver ver 2.2
[ 3.041598] Bluetooth: HCI H4 protocol initialized
[ 3.050941] Bluetooth: HCI BCSP protocol initialized
[ 3.060436] Bluetooth: HCILL protocol initialized
[ 3.069638] Bluetooth: HCIATH3K protocol initialized
[ 3.079317] Bluetooth: MSM Sleep Mode Driver Ver 1.2
[ 3.088976] Bluetooth: init no bt used in configuration
[ 3.088982]
[ 3.104775] [cpu_freq] ERR:get cpu extremity frequency from sysconfig failed, use max_freq
[ 3.120910] no red_led, ignore it!
[ 3.131197] usbcore: registered new interface driver usbhid
[ 3.141947] usbhid: USB HID core driver
[ 3.152119] script_get_item audio_pa_ctrl not found
[ 3.167806] asoc: sndcodec <-> sunxi-codec mapping ok
[ 3.183410] asoc: sndhdmi <-> sunxi-hdmiaudio.0 mapping ok
[ 3.195521] oprofile: using arm/armv7-ca7
[ 3.205005] u32 classifier
[ 3.212837] Actions configured
[ 3.220990] Netfilter messages via NETLINK v0.30.
[ 3.230635] nf_conntrack version 0.5.0 (3872 buckets, 15488 max)
[ 3.242335] ctnetlink v0.93: registering with nfnetlink.
[ 3.252669] NF_TPROXY: Transparent proxy support initialized, version 4.1.0
[ 3.264844] NF_TPROXY: Copyright (c) 2006-2007 BalaBit IT Ltd.
[ 3.275528] mmc0: new SDHC card at address 0001
[ 3.275741] xt_time: kernel timezone is -0000
[ 3.275908] IPv4 over IPv4 tunneling driver
[ 3.276373] gre: GRE over IPv4 demultiplexor driver
[ 3.276382] ip_gre: GRE over IPv4 tunneling driver
[ 3.277016] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 3.277210] arp_tables: (C) 2002 David S. Miller
[ 3.277287] TCP: cubic registered
[ 3.277294] Initializing XFRM netlink socket
[ 3.357187] NET: Registered protocol family 10
[ 3.366318] mmcblk0: mmc0:0001 SD 3.72 GiB
[ 3.375839] Mobile IPv6
[ 3.382646] ip6_tables: (C) 2000-2006 Netfilter Core Team
[ 3.382684] mmcblk0: p1 p2
[ 3.383449] *******************sd init ok*******************
[ 3.409962] IPv6 over IPv4 tunneling driver
[ 3.419556] NET: Registered protocol family 17
[ 3.428376] NET: Registered protocol family 15
[ 3.437283] Bluetooth: RFCOMM TTY layer initialized
[ 3.446478] Bluetooth: RFCOMM socket layer initialized
[ 3.455844] Bluetooth: RFCOMM ver 1.11
[ 3.463574] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 3.473004] Bluetooth: BNEP filters: protocol multicast
[ 3.482329] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[ 3.492549] L2TP core driver, V2.0
[ 3.499872] PPPoL2TP kernel driver, V2.0
[ 3.507783] L2TP IP encapsulation support (L2TPv3)
[ 3.516771] L2TP netlink interface
[ 3.524201] L2TP ethernet pseudowire support (L2TPv3)
[ 3.533588] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[ 3.545743] ThumbEE CPU extension supported.
[ 3.554047] Registering SWP/SWPB emulation handler
[ 3.563802] cmdline,disp=
[ 3.601355] sunxi-rtc sunxi-rtc: setting system clock to 1970-01-01 00:00:08 UTC (8)
[ 3.613650] ths_fetch_sysconfig_para: type err device_used = 1.
[ 3.625339] CPU Budget:Register notifier
[ 3.633378] CPU Budget:register Success
[ 3.641218] sunxi-budget-cooling sunxi-budget-cooling: Cooling device registered: thermal-budget-0
[ 3.657864] ALSA device list:
[ 3.664997] #0: audiocodec
[ 3.671931] #1: sndhdmi
[ 3.701347] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 3.714240] VFS: Mounted root (ext4 filesystem) on device 179:2.
[ 3.725065] Freeing init memory: 320K
[ 4.210107] [DISP] disp_device_attached_and_enable,line:159:attched ok, mgr0<-->device0, type=4, mode=5
I have compared with the Dmesg of the image they provided and it is same (no extra errors). The only difference is that it doesn't stop at the last message and above and continues with more message like this
[ 3.740859] VFS: Mounted root (ext4 filesystem) on device 179:2.
[ 3.751773] Freeing init memory: 320K
[ 3.994008] systemd[1]: Failed to insert module 'kdbus': Function not implemented
[ 4.480527] systemd[1]: systemd 225 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 +SECCOMP +BLKID -ELFUTILS +KMOD -IDN)
[ 4.522559] systemd[1]: Detected architecture arm.
[ 4.556652] systemd[1]: Set hostname to <FriendlyARM>.
[ 4.813095] systemd[1]: display-manager.service: Cannot add dependency job, ignoring: Unit display-manager.service failed to load: No such file or directory.
[ 4.835364] systemd[1]: Reached target Swap.
[ 4.849758] systemd[1]: Reached target Encrypted Volumes.
[ 4.865289] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[ 4.883786] systemd[1]: Reached target Remote File Systems (Pre).
[ 4.900430] systemd[1]: Created slice Root Slice.
[ 4.915916] systemd[1]: Created slice System Slice.
[ 4.931753] systemd[1]: Created slice User and Session Slice.
[ 4.948846] systemd[1]: Created slice system-getty.slice.
[ 4.965667] systemd[1]: Created slice system-serial\x2dgetty.slice.
[ 4.983471] systemd[1]: Listening on udev Control Socket.
[ 5.000354] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[ 5.019741] systemd[1]: Reached target Paths.
[ 5.035599] systemd[1]: Listening on Journal Socket.
[ 5.200617] systemd[1]: Mounting Debug File System...
[ 5.290705] systemd[1]: Starting Remount Root and Kernel File Systems...
[ 5.390688] systemd[1]: Starting Create list of required static device nodes for the current kernel...
[ 5.415235] systemd[1]: Listening on Journal Audit Socket.
[ 5.434841] systemd[1]: Reached target Slices.
[ 5.453278] systemd[1]: Listening on udev Kernel Socket.
[ 5.580939] systemd[1]: Starting udev Coldplug all Devices...
[ 5.608874] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
[ 5.770898] systemd[1]: Starting Load Kernel Modules...
[ 5.789989] systemd[1]: Listening on Journal Socket (/dev/log).
[ 5.890778] systemd[1]: Starting Journal Service...
[ 6.027527] systemd[1]: Mounted Debug File System.
[ 6.160197] systemd[1]: Started Remount Root and Kernel File Systems.
[ 6.330140] systemd[1]: Started Create list of required static device nodes for the current kernel.
[ 6.750244] systemd[1]: Started Load Kernel Modules.
[ 6.920156] systemd[1]: Started udev Coldplug all Devices.
[ 6.942933] systemd[1]: Started Journal Service.
So I guess the issue is with the rootfs not being detected and mounted correctly. Please guide me on this.
I'm pretty sure the problem is that the linux doesn't activate a console on uart.
Take a look at kernel log:
[ 0.000000] Kernel command line: console=ttyS0,115200 console=tty0 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait init=/sbin/init
As noted in http://www.tldp.org/HOWTO/Remote-Serial-Console-HOWTO/configure-kernel.html:
When multiple consoles are listed output is sent to all consoles and input is taken from the last listed console. The last console is the one Linux uses as the /dev/console device.
So try making console=ttyS0,115200 being the last (or the only) console option by tuning bootargs u-boot environment variable.
To check this suggestion, just "Hit any key to stop autoboot", then use printenv to inspect default bootargs content, run setenv bootargs ... ... ... and finally, run bootd. However, be sure to inspect bootcmd and what does it call, because one of those things may invoke setenv bootargs during bootcmd execution and overwrite your manual option.
P.S. init=/sbin/init may be omitted.

Unable to get list of USB ports on Mac

I am using below code to list the available ports using node-serialport npm:
var SerialPort = require('serialport');
SerialPort.list(function(err, ports){console.dir(ports); console.dir(err)});
It lists only the Bluetooth port, but, not the USB ports
Below is the output that I am getting:
[ { comName: '/dev/cu.Bluetooth-Incoming-Port',
manufacturer: undefined,
serialNumber: undefined,
pnpId: undefined,
locationId: undefined,
vendorId: undefined,
productId: undefined } ]
null
I have OSX Captain installed and there are two USB ports which aren't being listed here.
If you have the some question, you can refer to my practice.
I install the drive of usb, and will get it message.
{ comName: '/dev/cu.SLAB_USBtoUART',
manufacturer: 'Silicon Labs',
serialNumber: '0001',
pnpId: undefined,
locationId: '0x14200000',
vendorId: '0x10c4',
productId: '0xea60' }

Get the MAC address of an XBee using Node.js

My Node.js app is using xbee-api to allow an XBee connected via a serial port to communicate wirelessly with other XBees. The local XBee is in API Coordinator mode.
How can I query the XBee (physically connected via serial port) to get its 64 bit MAC address SH and SL?
I tried writing the following frame to serial,
var frame_obj = {
type: xbee_api.constants.FRAME_TYPE.AT_COMMAND,
command: 'SH',
commandParameter: []
};
but I receive four bytes [ 0, 19, 162, 0 ] which makes no sense...
frame: { type: 136,
id: 2,
command: 'SH',
commandStatus: 0,
commandData: [ 0, 19, 162, 0 ] }
If you look at the bytes in hex (0x00, 0x13, 0xA2, 0x00), it does make sense.

Resources