Android9 USB-SERIAL Issue

Post Reply
mirocsinchall
Posts: 23
Joined: Thu Apr 02, 2020 5:14 pm
languages_spoken: english
ODROIDs: XU4, N2, C2
Has thanked: 3 times
Been thanked: 0
Contact:

Android9 USB-SERIAL Issue

Post by mirocsinchall »

Currently I am testing the odroid N2 and its OS is running in Android 9. The device is already rooted, but I could not make the USB to Serial cable to be detected as the following command:

ls /dev/ttyUSB*

Using ubuntu is no issue in detecting such serial port, only in android, Is there any way to be detected in android as rooted? please advise.

User avatar
odroid
Site Admin
Posts: 34906
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 954 times
Been thanked: 772 times
Contact:

Re: Android9 USB-SERIAL Issue

Post by odroid »

Which USB-UART cable did you try?
This one? https://www.hardkernel.com/shop/usb-uart-module-kit/

If not, let us know the USB-UART bridge chipset in your cable to include a proper driver in the next update.

mirocsinchall
Posts: 23
Joined: Thu Apr 02, 2020 5:14 pm
languages_spoken: english
ODROIDs: XU4, N2, C2
Has thanked: 3 times
Been thanked: 0
Contact:

Re: Android9 USB-SERIAL Issue

Post by mirocsinchall »

Something like this:

https://www.amazon.sg/StarTech-com-1-Po ... 0599&psc=1

This one works in ubuntu, but not in android 9

mirocsinchall
Posts: 23
Joined: Thu Apr 02, 2020 5:14 pm
languages_spoken: english
ODROIDs: XU4, N2, C2
Has thanked: 3 times
Been thanked: 0
Contact:

Re: Android9 USB-SERIAL Issue

Post by mirocsinchall »

This is the actual cable we are using, comes from elecom:

https://www.monotaro.sg/p/09302274?gcli ... Lw_wcB:G:s

User avatar
odroid
Site Admin
Posts: 34906
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 954 times
Been thanked: 772 times
Contact:

Re: Android9 USB-SERIAL Issue

Post by odroid »

Show us "lsusb" and "lsmod" outputs on a Linux PC or Ubuntu running N2 board to collect a chipset information.

mirocsinchall
Posts: 23
Joined: Thu Apr 02, 2020 5:14 pm
languages_spoken: english
ODROIDs: XU4, N2, C2
Has thanked: 3 times
Been thanked: 0
Contact:

Re: Android9 USB-SERIAL Issue

Post by mirocsinchall »

lsusb output:

Code: Select all

Bus 002 Device 002: ID 05e3:0620 Genesys Logic, Inc. 
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 045e:0745 Microsoft Corp. Nano Transceiver v1.0 for Bluetooth
Bus 001 Device 004: ID 0bda:a811 Realtek Semiconductor Corp. 
Bus 001 Device 003: ID 056e:5004 Elecom Co., Ltd UC-SGT
Bus 001 Device 002: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
The Elecom Co., is the one


lsmod output:

Code: Select all

Module                  Size  Used by
8812au               1462272  0
vpu                    49152  0
encoder                53248  0
amvdec_avs2           196608  0
amvdec_vp9            151552  0
amvdec_vc1             53248  0
amvdec_real            40960  0
amvdec_mmpeg4          36864  0
amvdec_mpeg4           53248  0
amvdec_mmpeg12         40960  0
amvdec_mpeg12          90112  0
amvdec_mmjpeg          28672  0
amvdec_mjpeg           36864  0
amvdec_h265           143360  0
amvdec_h264mvc         49152  0
amvdec_mh264          159744  0
amvdec_h264           126976  0
amvdec_avs             61440  0
stream_input          180224  10 amvdec_h265,amvdec_mh264,amvdec_h264mvc,amvdec_real,amvdec_vp9,amvdec_h264,amvdec_avs2,amvdec_mpeg12,amvdec_avs,amvdec_mmpeg12
decoder_common        176128  17 amvdec_h265,amvdec_mjpeg,amvdec_mh264,amvdec_mmpeg4,amvdec_h264mvc,amvdec_mmjpeg,amvdec_real,stream_input,amvdec_vp9,amvdec_h264,encoder,amvdec_avs2,amvdec_mpeg12,amvdec_avs,amvdec_vc1,amvdec_mmpeg12,amvdec_mpeg4
firmware               28672  18 amvdec_h265,amvdec_mjpeg,amvdec_mh264,amvdec_mmpeg4,amvdec_h264mvc,amvdec_mmjpeg,decoder_common,amvdec_real,stream_input,amvdec_vp9,amvdec_h264,encoder,amvdec_avs2,amvdec_mpeg12,amvdec_avs,amvdec_vc1,amvdec_mmpeg12,amvdec_mpeg4
media_clock            45056  12 amvdec_h265,amvdec_mh264,decoder_common,vpu,firmware,stream_input,amvdec_vp9,amvdec_h264,encoder,amvdec_avs2,amvdec_mpeg12,amvdec_avs
mali_kbase            569344  18

User avatar
odroid
Site Admin
Posts: 34906
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 954 times
Been thanked: 772 times
Contact:

Re: Android9 USB-SERIAL Issue

Post by odroid »

I can't find a USB-UART driver module in your "lsmod" output.

Can you find a chipset information in your USB-Serial converter?

mirocsinchall
Posts: 23
Joined: Thu Apr 02, 2020 5:14 pm
languages_spoken: english
ODROIDs: XU4, N2, C2
Has thanked: 3 times
Been thanked: 0
Contact:

Re: Android9 USB-SERIAL Issue

Post by mirocsinchall »

I have no idea how to install or setup, please advise.

Thanks

User avatar
voodik
Posts: 1847
Joined: Sat Dec 07, 2013 2:36 am
languages_spoken: armenian, english, russian
Location: Armenia
Has thanked: 38 times
Been thanked: 229 times
Contact:

Re: Android9 USB-SERIAL Issue

Post by voodik »

Code: Select all

CONFIG_USB_SERIAL_PL2303
https://github.com/hardkernel/linux/blo ... 2303.c#L57

Code: Select all

$ grep -r CONFIG_USB_SERIAL_PL2303 common/arch/arm64/configs/odroidn2_android_defconfig
$ # CONFIG_USB_SERIAL_PL2303 is not set
Driver not enabled in Android builds
Buy me a beer ;)
https://www.paypal.me/voodikjan
BTC: 377wXjEr3QsDDzRqfMco3a41wicrsv3Sfs
--------------------------------------------------------
dump logs
(dmesg; logcat -d; lsusb) | curl -F 'f:1=<-' ix.io
--------------------------------------------------------
ADB enhanced PuTTY :!:
https://github.com/voodik/puttyadb/releases

User avatar
odroid
Site Admin
Posts: 34906
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 954 times
Been thanked: 772 times
Contact:

Re: Android9 USB-SERIAL Issue

Post by odroid »

@voodik,

We will enable the Prolific PL2303 Kernel driver with the next update release.

mirocsinchall
Posts: 23
Joined: Thu Apr 02, 2020 5:14 pm
languages_spoken: english
ODROIDs: XU4, N2, C2
Has thanked: 3 times
Been thanked: 0
Contact:

Re: Android9 USB-SERIAL Issue

Post by mirocsinchall »

This is great news if this one will work.

We will be ordering in bulk for Odroid N2, please advise when will be the release of this Android version or is there any workaround that I can be able to do since, my Android is already rooted?

Thank you

User avatar
odroid
Site Admin
Posts: 34906
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 954 times
Been thanked: 772 times
Contact:

Re: Android9 USB-SERIAL Issue

Post by odroid »

You don't need to root the device. The PL2303 serial driver will work regardless of rooting.

New Android update package will be released within a few days.

mirocsinchall
Posts: 23
Joined: Thu Apr 02, 2020 5:14 pm
languages_spoken: english
ODROIDs: XU4, N2, C2
Has thanked: 3 times
Been thanked: 0
Contact:

Re: Android9 USB-SERIAL Issue

Post by mirocsinchall »

Wow thank you very much, please send the link when it's done... :D

User avatar
codewalker
Posts: 997
Joined: Mon Feb 25, 2013 11:03 am
languages_spoken: english
ODROIDs: all
Has thanked: 37 times
Been thanked: 63 times
Contact:

Re: Android9 USB-SERIAL Issue

Post by codewalker »

Hi, mirocsinchall.
I've uploaded new firmware.

https://wiki.odroid.com/odroid-n2/os_im ... id/android

If you use pl2303 driver, do command like this.

Code: Select all

$ su
# insmod /vendor/lib/modules/pl2303.ko
If you want to do automatically everytime. edit init.xxx.rc.
These users thanked the author codewalker for the post:
mirocsinchall (Wed Apr 15, 2020 11:18 am)

mirocsinchall
Posts: 23
Joined: Thu Apr 02, 2020 5:14 pm
languages_spoken: english
ODROIDs: XU4, N2, C2
Has thanked: 3 times
Been thanked: 0
Contact:

Re: Android9 USB-SERIAL Issue

Post by mirocsinchall »

Nice, Thank you very much I will check on it.

mirocsinchall
Posts: 23
Joined: Thu Apr 02, 2020 5:14 pm
languages_spoken: english
ODROIDs: XU4, N2, C2
Has thanked: 3 times
Been thanked: 0
Contact:

Re: Android9 USB-SERIAL Issue

Post by mirocsinchall »


User avatar
codewalker
Posts: 997
Joined: Mon Feb 25, 2013 11:03 am
languages_spoken: english
ODROIDs: all
Has thanked: 37 times
Been thanked: 63 times
Contact:

Re: Android9 USB-SERIAL Issue

Post by codewalker »

I'm sorry. I've fixed and try again.
mirocsinchall wrote:
Wed Apr 15, 2020 11:19 am
Page not found for this link:
https://dn.odroid.com/S922X/ODROID-N2/A ... 413.img.xz

mirocsinchall
Posts: 23
Joined: Thu Apr 02, 2020 5:14 pm
languages_spoken: english
ODROIDs: XU4, N2, C2
Has thanked: 3 times
Been thanked: 0
Contact:

Re: Android9 USB-SERIAL Issue

Post by mirocsinchall »

This thing already works and confirm it is working but another issue I faced is when I connect my EPSON TM-T88IV via USB, it can be detected as:

Bus 001 Device 003: ID 04b8:0202

But when I am connecting thru Python and send command it says USB device not found. The code that I have in python works in a usual Linux operating system.

Please advise, thank you.

User avatar
odroid
Site Admin
Posts: 34906
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 954 times
Been thanked: 772 times
Contact:

Re: Android9 USB-SERIAL Issue

Post by odroid »

Show us "lsmod" output to know which driver is loaded on a Linux OS when the receipt printer is connected.
These users thanked the author odroid for the post:
mirocsinchall (Wed Jul 15, 2020 6:27 pm)

mirocsinchall
Posts: 23
Joined: Thu Apr 02, 2020 5:14 pm
languages_spoken: english
ODROIDs: XU4, N2, C2
Has thanked: 3 times
Been thanked: 0
Contact:

Re: Android9 USB-SERIAL Issue

Post by mirocsinchall »

Will this help?

Module Size Used by
cfg80211 573440 0
rfkill 28672 2 cfg80211
evdev 24576 1
uvcvideo 90112 0
videobuf2_vmalloc 16384 1 uvcvideo
videobuf2_memops 16384 1 videobuf2_vmalloc
videobuf2_v4l2 24576 1 uvcvideo
videobuf2_core 45056 2 uvcvideo,videobuf2_v4l2
snd_usb_audio 172032 0
snd_hwdep 16384 1 snd_usb_audio
videodev 184320 3 uvcvideo,videobuf2_core,videobuf2_v4l2
snd_usbmidi_lib 32768 1 snd_usb_audio
media 32768 2 uvcvideo,videodev
snd_rawmidi 32768 1 snd_usbmidi_lib
usblp 20480 0
snd_seq_device 16384 1 snd_rawmidi
snd_bcm2835 32768 0
snd_pcm 98304 2 snd_usb_audio,snd_bcm2835
snd_timer 32768 1 snd_pcm
snd 69632 8 snd_hwdep,snd_usb_audio,snd_timer,snd_rawmidi,snd_usbmidi_lib,snd_seq_device,snd_bcm2835,snd_pcm
fixed 16384 0
uio_pdrv_genirq 16384 0
uio 20480 1 uio_pdrv_genirq
ip_tables 24576 0
x_tables 32768 1 ip_tables
ipv6 425984 36

User avatar
odroid
Site Admin
Posts: 34906
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 954 times
Been thanked: 772 times
Contact:

Re: Android9 USB-SERIAL Issue

Post by odroid »

I think "usblp" driver was loaded for your printer.
But I have no idea whether Android system can use "usblp" driver directly or not.

mirocsinchall
Posts: 23
Joined: Thu Apr 02, 2020 5:14 pm
languages_spoken: english
ODROIDs: XU4, N2, C2
Has thanked: 3 times
Been thanked: 0
Contact:

Re: Android9 USB-SERIAL Issue

Post by mirocsinchall »

This is the lsmod of my android latest version of Android Pie (20200618) and there is no "usblp"

Module Size Used by
8812au 1462272 0
vpu 49152 0
encoder 53248 0
amvdec_avs2 196608 0
amvdec_vp9 122880 0
amvdec_vc1 53248 0
amvdec_real 40960 0
amvdec_mmpeg4 40960 0
amvdec_mpeg4 53248 0
amvdec_mmpeg12 45056 0
amvdec_mpeg12 90112 0
amvdec_mmjpeg 28672 0
amvdec_mjpeg 36864 0
amvdec_h265 147456 0
amvdec_h264mvc 49152 0
amvdec_mh264 159744 0
amvdec_h264 126976 0
amvdec_avs 61440 0
stream_input 192512 10 amvdec_avs2,amvdec_vp9,amvdec_real,amvdec_mmpeg12,amvdec_mpeg12,amvdec_h265,amvdec_h264mvc,amvdec_mh264,amvdec_h264,amvdec_avs
decoder_common 188416 17 encoder,amvdec_avs2,amvdec_vp9,amvdec_vc1,amvdec_real,amvdec_mmpeg4,amvdec_mpeg4,amvdec_mmpeg12,amvdec_mpeg12,amvdec_mmjpeg,amvdec_mjpeg,amvdec_h265,amvdec_h264mvc,amvdec_mh264,amvdec_h264,amvdec_avs,stream_input
firmware 28672 18 encoder,amvdec_avs2,amvdec_vp9,amvdec_vc1,amvdec_real,amvdec_mmpeg4,amvdec_mpeg4,amvdec_mmpeg12,amvdec_mpeg12,amvdec_mmjpeg,amvdec_mjpeg,amvdec_h265,amvdec_h264mvc,amvdec_mh264,amvdec_h264,amvdec_avs,stream_input,decoder_common
media_clock 45056 12 vpu,encoder,amvdec_avs2,amvdec_vp9,amvdec_mpeg12,amvdec_h265,amvdec_mh264,amvdec_h264,amvdec_avs,stream_input,decoder_common,firmware
spi_meson_spicc 20480 0
spidev 20480 0
mali_kbase 569344 16

User avatar
odroid
Site Admin
Posts: 34906
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 954 times
Been thanked: 772 times
Contact:

Re: Android9 USB-SERIAL Issue

Post by odroid »

We will enable 'usblp' module in the next update and you can check the functionality with insmod command.

mirocsinchall
Posts: 23
Joined: Thu Apr 02, 2020 5:14 pm
languages_spoken: english
ODROIDs: XU4, N2, C2
Has thanked: 3 times
Been thanked: 0
Contact:

Re: Android9 USB-SERIAL Issue

Post by mirocsinchall »

Thank you and I will be waiting for the next release :D

User avatar
odroid
Site Admin
Posts: 34906
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 954 times
Been thanked: 772 times
Contact:

Re: Android9 USB-SERIAL Issue

Post by odroid »

Please be patient. It will be available in the middle of next week due to some urgent jobs.

User avatar
codewalker
Posts: 997
Joined: Mon Feb 25, 2013 11:03 am
languages_spoken: english
ODROIDs: all
Has thanked: 37 times
Been thanked: 63 times
Contact:

Re: Android9 USB-SERIAL Issue

Post by codewalker »

I've uploaded test firmware that included usblp driver.

https://dn.odroid.com/S922X/ODROID-N2/A ... signed.zip
These users thanked the author codewalker for the post:
mirocsinchall (Wed Jul 15, 2020 6:27 pm)

mirocsinchall
Posts: 23
Joined: Thu Apr 02, 2020 5:14 pm
languages_spoken: english
ODROIDs: XU4, N2, C2
Has thanked: 3 times
Been thanked: 0
Contact:

Re: Android9 USB-SERIAL Issue

Post by mirocsinchall »

Thank you let me test it out and give you feedback

mirocsinchall
Posts: 23
Joined: Thu Apr 02, 2020 5:14 pm
languages_spoken: english
ODROIDs: XU4, N2, C2
Has thanked: 3 times
Been thanked: 0
Contact:

Re: Android9 USB-SERIAL Issue

Post by mirocsinchall »

I have updated and it seems don't have the usblp driver


Module Size Used by
pl2303 20480 0
8812au 1458176 0
vpu 49152 0
encoder 53248 0
amvdec_avs2 200704 0
amvdec_vp9 122880 0
amvdec_vc1 57344 0
amvdec_real 40960 0
amvdec_mmpeg4 40960 0
amvdec_mpeg4 57344 0
amvdec_mmpeg12 45056 0
amvdec_mpeg12 90112 0
amvdec_mmjpeg 28672 0
amvdec_mjpeg 36864 0
amvdec_h265 147456 0
amvdec_h264mvc 49152 0
amvdec_mh264 159744 0
amvdec_h264 131072 0
amvdec_avs 61440 0
stream_input 188416 10 amvdec_avs2,amvdec_vp9,amvdec_real,amvdec_mmpeg12,amvdec_mpeg12,amvdec_h265,amvdec_h264mvc,amvdec_mh264,amvdec_h264,amvdec_avs
decoder_common 188416 17 encoder,amvdec_avs2,amvdec_vp9,amvdec_vc1,amvdec_real,amvdec_mmpeg4,amvdec_mpeg4,amvdec_mmpeg12,amvdec_mpeg12,amvdec_mmjpeg,amvdec_mjpeg,amvdec_h265,amvdec_h264mvc,amvdec_mh264,amvdec_h264,amvdec_avs,stream_input
firmware 28672 18 encoder,amvdec_avs2,amvdec_vp9,amvdec_vc1,amvdec_real,amvdec_mmpeg4,amvdec_mpeg4,amvdec_mmpeg12,amvdec_mpeg12,amvdec_mmjpeg,amvdec_mjpeg,amvdec_h265,amvdec_h264mvc,amvdec_mh264,amvdec_h264,amvdec_avs,stream_input,decoder_common
media_clock 45056 12 vpu,encoder,amvdec_avs2,amvdec_vp9,amvdec_mpeg12,amvdec_h265,amvdec_mh264,amvdec_h264,amvdec_avs,stream_input,decoder_common,firmware
spi_meson_spicc 20480 0
spidev 20480 0
mali_kbase 548864 21

mirocsinchall
Posts: 23
Joined: Thu Apr 02, 2020 5:14 pm
languages_spoken: english
ODROIDs: XU4, N2, C2
Has thanked: 3 times
Been thanked: 0
Contact:

Re: Android9 USB-SERIAL Issue

Post by mirocsinchall »

Do I need to run anything like like what I did with pl2303.ko? e.g. insmod /vendor/lib/modules/pl2303.ko

User avatar
codewalker
Posts: 997
Joined: Mon Feb 25, 2013 11:03 am
languages_spoken: english
ODROIDs: all
Has thanked: 37 times
Been thanked: 63 times
Contact:

Re: Android9 USB-SERIAL Issue

Post by codewalker »

I included CONFIG_USB_PRINTER as builtin.
I tried to rebuild, please try this one more.

https://dn.odroid.com/S922X/ODROID-N2/A ... signed.zip

mirocsinchall
Posts: 23
Joined: Thu Apr 02, 2020 5:14 pm
languages_spoken: english
ODROIDs: XU4, N2, C2
Has thanked: 3 times
Been thanked: 0
Contact:

Re: Android9 USB-SERIAL Issue

Post by mirocsinchall »

updated the latest android and tested still cannot find the usblp driver and python scripts still got error

User avatar
codewalker
Posts: 997
Joined: Mon Feb 25, 2013 11:03 am
languages_spoken: english
ODROIDs: all
Has thanked: 37 times
Been thanked: 63 times
Contact:

Re: Android9 USB-SERIAL Issue

Post by codewalker »

I included usblp driver as module.
After updating try this "insmod /vendor/lib/modules/usblp.ko"

https://dn.odroid.com/S922X/ODROID-N2/A ... signed.zip

mirocsinchall
Posts: 23
Joined: Thu Apr 02, 2020 5:14 pm
languages_spoken: english
ODROIDs: XU4, N2, C2
Has thanked: 3 times
Been thanked: 0
Contact:

Re: Android9 USB-SERIAL Issue

Post by mirocsinchall »

usblp already shows, but still cannot send the print job, still say USB device not found

User avatar
odroid
Site Admin
Posts: 34906
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 954 times
Been thanked: 772 times
Contact:

Re: Android9 USB-SERIAL Issue

Post by odroid »

Can you find any clue in 'dmesg' and 'logcat' outputs?
It is almost impossible to know what's wrong since we don't have the same printer.

Have you ever used the printer with any other Android devices?

mirocsinchall
Posts: 23
Joined: Thu Apr 02, 2020 5:14 pm
languages_spoken: english
ODROIDs: XU4, N2, C2
Has thanked: 3 times
Been thanked: 0
Contact:

Re: Android9 USB-SERIAL Issue

Post by mirocsinchall »

Any advise on this:

Code: Select all

15119.255686] audit: type=1400 audit(1594894723.100:841): avc:  denied  { ioctl } for  pid=12694 comm="nano" path="/dev/pts/2" dev="devpts" ino=5 ioctlcmd=0x5603 scontext=u:r:untrusted_app:s0:c72,c256,c512,c768 tcontext=u:object_r:untrusted_app_all_devpts:s0:c72,c256,c512,c768 tclass=chr_file permissive=1
[15125.632443] audit: type=1400 audit(1594894729.480:842): avc:  denied  { read } for  pid=12695 comm="python2" name="usb" dev="tmpfs" ino=15296 scontext=u:r:untrusted_app:s0:c72,c256,c512,c768 tcontext=u:object_r:usb_device:s0 tclass=dir permissive=1
[15125.632465] audit: type=1400 audit(1594894729.480:843): avc:  denied  { open } for  pid=12695 comm="python2" path="/dev/bus/usb" dev="tmpfs" ino=15296 scontext=u:r:untrusted_app:s0:c72,c256,c512,c768 tcontext=u:object_r:usb_device:s0 tclass=dir permissive=1

User avatar
tobetter
Posts: 5518
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 221 times
Been thanked: 648 times
Contact:

Re: Android9 USB-SERIAL Issue

Post by tobetter »

mirocsinchall wrote:
Thu Jul 16, 2020 7:20 pm
Any advise on this:

15119.255686] audit: type=1400 audit(1594894723.100:841): avc: denied { ioctl } for pid=12694 comm="nano" path="/dev/pts/2" dev="devpts" ino=5 ioctlcmd=0x5603 scontext=u:r:untrusted_app:s0:c72,c256,c512,c768 tcontext=u:object_r:untrusted_app_all_devpts:s0:c72,c256,c512,c768 tclass=chr_file permissive=1
[15125.632443] audit: type=1400 audit(1594894729.480:842): avc: denied { read } for pid=12695 comm="python2" name="usb" dev="tmpfs" ino=15296 scontext=u:r:untrusted_app:s0:c72,c256,c512,c768 tcontext=u:object_r:usb_device:s0 tclass=dir permissive=1
[15125.632465] audit: type=1400 audit(1594894729.480:843): avc: denied { open } for pid=12695 comm="python2" path="/dev/bus/usb" dev="tmpfs" ino=15296 scontext=u:r:untrusted_app:s0:c72,c256,c512,c768 tcontext=u:object_r:usb_device:s0 tclass=dir permissive=1
These logs are about the SELinux policy which is not enabled on ODROID-N2. It's noisy but you can ignore them when the line ends with permissive=1.

mirocsinchall
Posts: 23
Joined: Thu Apr 02, 2020 5:14 pm
languages_spoken: english
ODROIDs: XU4, N2, C2
Has thanked: 3 times
Been thanked: 0
Contact:

Re: Android9 USB-SERIAL Issue

Post by mirocsinchall »

so it is not the reason why I cannot print?

User avatar
tobetter
Posts: 5518
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 221 times
Been thanked: 648 times
Contact:

Re: Android9 USB-SERIAL Issue

Post by tobetter »

mirocsinchall wrote:
Thu Jul 16, 2020 7:51 pm
so it is not the reason why I cannot print?
Do you meet the error when you python code open /dev/bus/usb? Can you share the exact error message from the python?

mirocsinchall
Posts: 23
Joined: Thu Apr 02, 2020 5:14 pm
languages_spoken: english
ODROIDs: XU4, N2, C2
Has thanked: 3 times
Been thanked: 0
Contact:

Re: Android9 USB-SERIAL Issue

Post by mirocsinchall »

raise USBNotFoundError("Device not found or cable not plugged in.")
escpos.exceptions.USBNotFoundError: USB device not found

I am using this library and My code looks like this:

from escpos.printer import Usb

p = Usb(1208,514,0)


* From the code above, it will hit the error on the opening of the USB printer, but on Linux/Debian or raspberry pi environment it is working fine

Thanks

User avatar
tobetter
Posts: 5518
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 221 times
Been thanked: 648 times
Contact:

Re: Android9 USB-SERIAL Issue

Post by tobetter »

mirocsinchall wrote:
Fri Jul 17, 2020 10:56 am
raise USBNotFoundError("Device not found or cable not plugged in.")
escpos.exceptions.USBNotFoundError: USB device not found

I am using this library and My code looks like this:

from escpos.printer import Usb

p = Usb(1208,514,0)


* From the code above, it will hit the error on the opening of the USB printer, but on Linux/Debian or raspberry pi environment it is working fine

Thanks
From the API doc, "Usb(...)" opens the USB device with VID/PID if my understanding is correct. Are you able to see the USB device of 0x04b8:0x0202 with lsusb command?
Also are you able to see '/dev/usb/lp0' after 'usblp.ko' is loaded?

mirocsinchall
Posts: 23
Joined: Thu Apr 02, 2020 5:14 pm
languages_spoken: english
ODROIDs: XU4, N2, C2
Has thanked: 3 times
Been thanked: 0
Contact:

Re: Android9 USB-SERIAL Issue

Post by mirocsinchall »

Yes when I call command lsusb it is there -> Bus 001 Device 005: ID 04b8:0202

for lp0 cannot find after loading usblp.ko:
odroidn2:/ # ls /dev/usb/lp0
ls: /dev/usb/lp0: No such file or directory

mirocsinchall
Posts: 23
Joined: Thu Apr 02, 2020 5:14 pm
languages_spoken: english
ODROIDs: XU4, N2, C2
Has thanked: 3 times
Been thanked: 0
Contact:

Re: Android9 USB-SERIAL Issue

Post by mirocsinchall »

Any updates? still finding solution?

User avatar
tobetter
Posts: 5518
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 221 times
Been thanked: 648 times
Contact:

Re: Android9 USB-SERIAL Issue

Post by tobetter »

mirocsinchall wrote:
Thu Jul 23, 2020 2:28 pm
Any updates? still finding solution?
Sorry, I have not found out the solution yet and I am feeling that it's very printer specific problem when I read the driver.
Would you be able to set up a Linux box that can be remotely accessible and can access your N2 to debug your printer?

User avatar
codewalker
Posts: 997
Joined: Mon Feb 25, 2013 11:03 am
languages_spoken: english
ODROIDs: all
Has thanked: 37 times
Been thanked: 63 times
Contact:

Re: Android9 USB-SERIAL Issue

Post by codewalker »

I've made other firmware included printer features.

Please, try this.
https://dn.odroid.com/S922X/ODROID-N2/A ... signed.zip

you need to command 'insmod /vendor/lib/modules/usblp.ko'
mirocsinchall wrote:
Thu Jul 23, 2020 2:28 pm
Any updates? still finding solution?

User avatar
codewalker
Posts: 997
Joined: Mon Feb 25, 2013 11:03 am
languages_spoken: english
ODROIDs: all
Has thanked: 37 times
Been thanked: 63 times
Contact:

Re: Android9 USB-SERIAL Issue

Post by codewalker »

If you tell your result, we will include this patch to next firmware.

Post Reply

Return to “Android”

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest