• Before reporting problems with your board running Armbian, check the following:

    • 1. Check power supply, check SD card and check other people experiences

      Power supply issues are one of the three biggest issues you'll face when starting with Single Board Computers (SBCs). SD card issues, whether fake or faulty, are another and issues resulting from poor board design is the other common issues you can encounter.   Power supply issues can be tricky. You might have a noisy power supply that works with one board because it has extra filtering, but won't work with another. Or you're using that cheap phone charger because your board has a microUSB connector, and it is either erratic, or doesn't start up, or even becomes the cause of some SD card issues.    Some tips to avoid the most common causes of problems reported:   Don't power via micro USB  - unless you have optimised your setup for low power requirements. Micro USB is great for mobile phones because they are simply charging a battery. It's bad for SBCs. Yes, it does work for a lot of people, but it also causes more problems and headaches over time than it is worth, unless you know exactly what you are doing. If you have a barrel jack power connector on your SBC, use it instead! If there is an option for powering via header connections, use that option!
        Don't use mobile phone chargers. They might be convenient and cheap, but this is because they are meant for charging phones, not powering your SBC which has particular power requirements.
        When you are evaluating a power supply, make sure you run some stress tests on your system to ensure that it will not cause issues down the path.   (Micro) SD card issues can be sneaky. They might appear right at the start causing strange boot and login errors, or they might cause problems over time. It is best to run a test on any new SD card you use, to ensure that it really is what it is, and to ensure that isn't faulty. Armbian provides you a simple way to do this   --   armbianmonitor -c /path/to/device/to/test  

    • 2. Make sure to collect and provide all necessary information

      We can only help if you provide quality information for us to work with. All stable images from the download section are tested, most stable upgrades are tested and we have tens of thousands of users. Even with regular and extensive testings, bugs sometimes do slip through. This is a voluntary support service and is unrelated to board makers, and is not obligated to provide you any answers. Repeated asking the same questions because you're not happy with the answers will result in you being ignored.

      Before you post a question, use the forum search as someone else might have already had the same problem and resolved it. And make sure you've read the Armbian documentation. If you still haven't found an answer, make sure you include the following in your post:   1. Logs when you can boot the board: armbianmonitor -u (paste URL to your forum post)   2. If your board does not boot, provide a log from serial console or at least make a picture, where it stops.   3. Describe the problem the best you can and provide all necessary info that we can reproduce the problem. We are not clairvoyant or mind readers. Please describe your setup as best as possible so we know what your operating environment is like.     We will not help in cases you are not using stable official Armbian builds, you have a problem with 3rd party hardware or reported problem would not be able to reproduced.

Connect Orange PI One through USB OTG with a computer
0

13 posts in this topic

Hi,

 

I would like to establish communication between Pi One and a computer through OTG Usb to USB. My goal is to use it to create a serial communication between the PI One and the computer to be able to send quick strings from the PC to the PI.

I have a program which only communicate through serial com port and I would like to feed it with data from the PI.

 

Is it possible... to use the physical interface to communicate?  Is it possible to establish serial communication between them?

 

I would be very grateful for any extensive help. 

Thanks in advance!

 

 

 

 

Hi again, 
I don't think I got closer to the solution... I don't want to use the debug port or the GPIO to create a fysical interface. What I would like to use USB<>Micro-USB cable to connect the otg port with a computer... And use the connection as a serial interface for communication. So, can anything like that work...? 
Thanks for your help and patience. /Regards 

Share this post


Link to post
Share on other sites

Hi,

 

I would like to establish communication between Pi One and a computer through OTG Usb to USB. My goal is to use it to create a serial communication between the PI One and the computer to be able to send quick strings from the PC to the PI.

I have a program which only communicate through serial com port and I would like to feed it with data from the PI.

 

Is it possible... to use the physical interface to communicate?  Is it possible to establish serial communication between them?

 

I would be very grateful for any extensive help. 

Thanks in advance!

Hi again, 

I don't think I got closer to the solution... I don't want to use the debug port or the GPIO to create a fysical interface.

 

What I would like to use USB<>Micro-USB cable to connect the otg port with a computer... And use the connection as a serial interface for communication.

 

So, can anything like that work...? 

Thanks for your help and patience. /Regards 

Share this post


Link to post
Share on other sites

What I would like to use USB<>Micro-USB cable to connect the otg port with a computer... And use the connection as a serial interface for communication.

 

We added that to the kernel config yesterday. You find a pre-compiled kernel here (use dpkg -i *.deb to install followed by a reboot). Then please report back (and please also read through the commit comments what at least I would expect ;)

Share this post


Link to post
Share on other sites

g_serial tested working on OPI ONE.

 

Thx for confirmation! Anything special to consider when using this variant? Or maybe you're able to post your setup and how you used One as serial gadget?

Share this post


Link to post
Share on other sites

OPI ONE as serial gadget

 

 

Code snippets to enable/disable usb serial gadget on OPI ONE with Armbian_5.14

 

 

g_serial_start() {

echo -n 0 > /sys/bus/platform/devices/sunxi_usb_udc/otg_role
modprobe g_serial
echo -n 2 > /sys/bus/platform/devices/sunxi_usb_udc/otg_role
}

g_serial_stop() {

echo -n 0 > /sys/bus/platform/devices/sunxi_usb_udc/otg_role
rmmod g_serial
echo -n 1 > /sys/bus/platform/devices/sunxi_usb_udc/otg_role
}

 

On the OPI ONE side the serial port is /dev/ttyGS0

 

On the host side the serial port is /dev/ttyACM0

 

 

Testing the serial connection ( plug in USB-cable on host , new interface /dev/ttyACM0 is created )

 

( OPI ONE )

 

echo "xxxxxxxxxxxx hello from OPI xxxxxxxxxxxx" >/dev/ttyGS0

 

( host )

 

cat /dev/ttyACM0

 

( OPI ONE )

 

cat /dev/ttyGS0

 

( host )

 

echo "xxxxxxxxxxxx hello from host xxxxxxxxxxxx' >/dev/ttyACM0

 

( OPI ONE )

 

<ctrl><c> to close

 

 

Note on usage :

 

Only basic functions for simple serial communication tested. A quick test setting up a login console on /dev/ttyGS0 and conneting to it with screen /dev/ttyACM0

quickly showed the limits of g_serial gadget. To use it as a USB serial console does not make sense as g_ether provides a full fledged fast ethernet connection providing reliable network commmunication.

 

Enjoy !

Share this post


Link to post
Share on other sites

Thanks for your add to the thread... I would need some more guiding, because I just can not make it work  :(

(. I take it up (ttyGS0 is created, and the OTG_ROLE is 2)... connect to my Mac..,which shows a new tty.usbmodem2411 connection.

I try to send a string as you did... but its not coming up with "cat" on the other side... not even on the PI ONE in an other terminal window.

Is it a config problem or I am just off the right path? Some print out about the port

ttySG0:

root@orangepione:/home/sdosa/DATA# dmesg | egrep -i 'serial|ttySG'
[ 7.088856] systemd[1]: Starting system-serial\x2dgetty.slice.
[ 7.105037] systemd[1]: Created slice system-serial\x2dgetty.slice.
[ 7.930490] systemd[1]: Starting LSB: controls configuration of serial ports...
[ 8.680042] systemd[1]: Started LSB: controls configuration of serial ports.
[ 8401.713876] g_serial gadget: Gadget Serial v2.4
[ 8401.713917] g_serial gadget: g_serial ready
[ 8409.225911] g_serial gadget: high-speed config #2: CDC ACM config
[ 9022.693175] g_serial gadget: high-speed config #2: CDC ACM config

root@orangepione:/home/sdosa/DATA# stty -F /dev/ttyGS0
speed 9600 baud; line = 0;
-brkint -imaxbel

tty.usbmodem2411:

stty -f /dev/tty.usbmodem2411
speed 9600 baud;
lflags: -icanon -isig -iexten -echo
iflags: -icrnl -ixon -ixany -imaxbel -brkint
oflags: -opost -onlcr -oxtabs
cflags: cs8 -parenb

Any hint where the problem should be... I just installed setserial to be able to administrate the port... but setserial seem to have problem to find it.

I know its not the topic of the thread... Please help me out to figure out the problem. /R

Share this post


Link to post
Share on other sites

@reamond

 

Seems like the serial gadget is created ( /dev/ttyGS0 ) on OPI and does show up on the MAC side ( tty.usbmodemxxxx ). Without any further configuration OPI serial defaults to 115200 baud. For testing purposes work as root user ( sudo ) and retry the simple procedure outlined above . It is tested and works on the OPI side - you might have to google the OS-X part. Good luck.

Share this post


Link to post
Share on other sites

Hi, Unfortunately I back again... Its just not giving any result... no matter what I try. To eliminate the problem I just concentrated on the OPI,

with two terminal windows...one in one out. But no matters what I do... nothing I can see trough the CAT command. 

I followed your lead on all points... but nothing. Can I somehow verify that all components are in place and arbian have no issue...

dont really know, just fishing. I tried to use "setserial" (installed), but its did not even see it (it see ttyS0, but not ttyGS0).

So now I am stuck... have no idea what causing the problem, that I can not even establish a "local loop" for verification.

Any hint which way should I search in the darkness?


I try to set the baud rate (looks like the port is on 9600), but it can not even change it!

root@orangepione:/home/cdosa# stty -F /dev/ttyGS0 38400
stty: /dev/ttyGS0: unable to perform all requested operations
 

 

The rest shows my attempt to show what I fed in... 

root@orangepione:/home/cdosa# ls /dev/ttyGS*
/dev/ttyGS0
root@orangepione:/home/cdosa# ls -l /dev/ttyGS0
crw-rw---- 1 root dialout 247, 0 Jun 30 17:23 /dev/ttyGS0

root@orangepione:/home/cdosa# stty -F /dev/ttyGS0 -a
speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke

root@orangepione:/home/cdosa# echo "xxxxxxxxxxxx hello from OPI xxxxxxxxxxxx" >/dev/ttyGS0

root@orangepione:/home/cdosa# setserial -g /dev/ttyGS0
Cannot get serial info: Invalid argument

 

 

 So thats it... no luck for me yet. /R

Share this post


Link to post
Share on other sites

Just rechecked the steps outlined in previous posts so there must be something different in your setup. Connect Armbian device ( OPI ) to Linux host and you should be able to communicate when the /dev/ttyACMx shows up on the host without any need of setting up serial parameters ( baud rate, parity, flow control etc...). On the OS-X side this would require a suitable (acm) driver for the specific interface that shows up when you plug in the USB cable. Best of luck - you're close.

Share this post


Link to post
Share on other sites

Ok, It worked... after many hours... the true is I dont know what is the difference now, but it works. And serial communication is up and running between the PI One and PC. Thanks /R

rodolfo likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
0

  • Support the project

    We need your help to stay focused on the project.

    Choose the amount and currency you would like to donate in below.