Can't make UART work with Python and AdaFruitBBB

1,593 views
Skip to first unread message

cla...@logmatch.com.br

unread,
Jun 10, 2014, 8:10:30 AM6/10/14
to beagl...@googlegroups.com
I follow instructions here


and here


but can't make any communication goes through UART1 .
Instead of using /dev/tty01 I use /dev/tty1 which were on my system.

Is there something missing in that post?
What more can I do ?

I tried easiest installation on Angstrom.
I use UART1 with loop back
I use a osciloscope to check signals in pin P9-24 


This is the python programa I use to test port
############################################
import Adafruit_BBIO.UART as UART
import serial
 
UART.setup("UART1")
 
ser = serial.Serial(port = "/dev/tty1", baudrate=9600)
ser.close()
ser.open()
if ser.isOpen():
    print "Serial is open!"
    ser.write("Hello World!")
ser.close()
############################################

Robert Nelson

unread,
Jun 10, 2014, 9:25:04 AM6/10/14
to Beagle Board
On Tue, Jun 10, 2014 at 7:10 AM, <cla...@logmatch.com.br> wrote:
> I follow instructions here
>
> https://github.com/adafruit/adafruit-beaglebone-io-python
>
> and here
>
> https://learn.adafruit.com/setting-up-io-python-library-on-beaglebone-black/uart
>
> but can't make any communication goes through UART1 .
> Instead of using /dev/tty01 I use /dev/tty1 which were on my system.


/dev/tty1 is a virtual terminal (ctrl-alt-f1) will switch you to it.

>
> Is there something missing in that post?
> What more can I do ?

Load the uart1 overlay

Regards,

--
Robert Nelson
http://www.rcn-ee.com/

Mike

unread,
Jun 10, 2014, 9:32:04 AM6/10/14
to beagl...@googlegroups.com
/dev/tty1 is a console device *NOT* a serial device.

Mike

cla...@logmatch.com.br

unread,
Jun 10, 2014, 10:34:11 AM6/10/14
to beagl...@googlegroups.com, belly...@gmail.com
Well,
that was one problem.

After searching in this forum I discover that I could use /dev/ttyO1 

So I use
# dmesg |grep serial
and 
# cat /proc/tty/driver/OMAP-SERIAL 
to confirm that.

# cat /proc/tty/driver/OMAP-SERIAL 
serinfo:1.0 driver revision:
0: uart:OMAP UART0 mmio:0x44E09000 irq:88 tx:558 rx:0 RTS|CTS|DTR|DSR
1: uart:OMAP UART1 mmio:0x48022000 irq:89 tx:75 rx:37 brk:1 CTS|DSR|CD|RI

# dmesg |grep serial
[    0.210444] omap_uart 44e09000.serial: did not get pins for uart0 error: -19
[    0.210719] 44e09000.serial: ttyO0 at MMIO 0x44e09000 (irq = 88) is a OMAP UART0
[    5.035048] gserial_setup: registered 1 ttyGS* device
[ 1763.473407] 48022000.serial: ttyO1 at MMIO 0x48022000 (irq = 89) is a OMAP UART1

But now I have other doubts.

Why there are only 2 serials ?
How can we access other if they aren't mapped /dev/tty??

[]'s

Robert Nelson

unread,
Jun 10, 2014, 10:43:28 AM6/10/14
to Beagle Board
On Tue, Jun 10, 2014 at 9:34 AM, <cla...@logmatch.com.br> wrote:
> Well,
> that was one problem.
>
> After searching in this forum I discover that I could use /dev/ttyO1
>
> So I use
> # dmesg |grep serial
> and
> # cat /proc/tty/driver/OMAP-SERIAL
> to confirm that.
>
> # cat /proc/tty/driver/OMAP-SERIAL
> serinfo:1.0 driver revision:
> 0: uart:OMAP UART0 mmio:0x44E09000 irq:88 tx:558 rx:0 RTS|CTS|DTR|DSR
> 1: uart:OMAP UART1 mmio:0x48022000 irq:89 tx:75 rx:37 brk:1 CTS|DSR|CD|RI
>
> # dmesg |grep serial
> [ 0.210444] omap_uart 44e09000.serial: did not get pins for uart0 error:
> -19
> [ 0.210719] 44e09000.serial: ttyO0 at MMIO 0x44e09000 (irq = 88) is a
> OMAP UART0
> [ 5.035048] gserial_setup: registered 1 ttyGS* device
> [ 1763.473407] 48022000.serial: ttyO1 at MMIO 0x48022000 (irq = 89) is a
> OMAP UART1
>
> But now I have other doubts.
>
> Why there are only 2 serials ?

because you only loaded two..

Add this to your u-boot bootargs and you'll get a few more:

capemgr.enable_partno=BB-UART1,BB-UART2,BB-UART4

(depending on factory v3.8.x kernel)

cla...@logmatch.com.br

unread,
Jun 10, 2014, 4:37:26 PM6/10/14
to beagl...@googlegroups.com
Thanks Robert !!!

cla...@logmatch.com.br

unread,
Jun 12, 2014, 9:16:58 AM6/12/14
to beagl...@googlegroups.com
Hi Again

I try this configuration on /boot/uEnv.txt 
optargs=capemgr.enable_partno=BB-UART1,BB-UART2,BB-UART4

but it doesn't work.

The only way I could do this, is by using this command
echo BB-UART2 > /sys/devices/bone_capemgr.*/slots

Can someone explain me why ?

Robert Nelson

unread,
Jun 12, 2014, 9:22:12 AM6/12/14
to Beagle Board
On Thu, Jun 12, 2014 at 8:16 AM, <cla...@logmatch.com.br> wrote:
> Hi Again
>
> I try this configuration on /boot/uEnv.txt
> optargs=capemgr.enable_partno=BB-UART1,BB-UART2,BB-UART4
>
> but it doesn't work.
>
> The only way I could do this, is by using this command
> echo BB-UART2 > /sys/devices/bone_capemgr.*/slots
>
> Can someone explain me why ?

probally the wrong "uEnv.txt"

dmesg | grep console

would prove that

cla...@logmatch.com.br

unread,
Jun 12, 2014, 11:43:33 AM6/12/14
to beagl...@googlegroups.com
You are right.

root@beaglebone1:~# dmesg |grep console
[    0.000000] Kernel command line: console=ttyO0,115200n8 quiet drm.debug=7 root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait
[    0.222807] console [ttyO0] enabled

but I can't found another uEnv.txt in Angstrom system.
So I probably will have to generate one that's correct ? 

These are the things people had to do when they will use UART in their systems?
I believe that we could have a more "prepared" system for development  ;)

Anyway I'll try to look what can i do here 

Thank you all you help Robert

Cláudio B.



michae...@gmail.com

unread,
Jun 12, 2014, 5:47:22 PM6/12/14
to beagl...@googlegroups.com
I don't understand your complaint.

If you're using the Adafruit BBIO library, it creates the necessary UART devices in the device tree on the fly (by placing its own ADAFRUIT-UART files in /lib/firmware and writing to /sys/devices/bone_capmgr.*/slots).

So it really is pretty easy to use -- it's designed for non-tech types to get maker projects running on the BBB.  Surprised you asked over here rather than in the more-relevant Adafruit forum on BBIO.

Cláudio B

unread,
Jun 13, 2014, 9:06:42 AM6/13/14
to beagl...@googlegroups.com
Hi Michael,

This is my first time developing with beaglebone black.
Even though I knew python, I never used ADAFruit library.

So I ask here because of lack of understanding on both things.

I'll try again when have more time, 
but so far, I need to use this hacks to enable UART 
because I'll use them with JAVA, and the python code I used was just a test to check UART hardware.




--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/-I_to80m9_Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Cláudio B.
Desenvolvimento de Software
Logmatch Produtos Eletrônicos LTDA

31 3476-8540

cla...@logmatch.com.br

Solução de qualidade para o controle de ponto em sua empresa.
Mensis - Belo Horizonte

pazha...@gmail.com

unread,
Feb 14, 2015, 5:14:19 AM2/14/15
to beagl...@googlegroups.com
I have GPRS modem for PIC microcontroller. Can I used  same gprs modem for BBB? 
 

Cláudio B

unread,
Feb 17, 2015, 6:50:00 AM2/17/15
to beagl...@googlegroups.com
@palaniyappan 

You can if you use the same protocol developed in BBB.
 


2015-02-14 8:14 GMT-02:00 <pazha...@gmail.com>:
I have GPRS modem for PIC microcontroller. Can I used  same gprs modem for BBB? 
 

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/-I_to80m9_Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

palaniyappan r

unread,
Feb 17, 2015, 2:33:53 PM2/17/15
to beagl...@googlegroups.com
Thank you sir... I have WiFi dongle used to my computer.Can I used same wifi usb dongle for BBB? Because of I tried But It did not connect. How to connect WIFI usb for my BBB?

--
regards,
palaniyappan.R

Cláudio B

unread,
Feb 18, 2015, 12:09:40 PM2/18/15
to beagl...@googlegroups.com
palaniyappan.R

If that WIFI USB dongle have a driver for BBB , yes. 

Otherwise you'll have to search for driver.
Once you found it, try load with # modprobe <driver> 

I didn't use this, but in this forum has a lot of info on that.

regards,




palaniyappan r

unread,
Feb 19, 2015, 10:02:23 AM2/19/15
to beagl...@googlegroups.com
Thank you for your answer sir.... 
I have been developing IoT home automation using beaglebone black with controlling by using android app. I have been using python and I got library file such as PWM,ADC,GPIO,UART,EMAIL but I didn't get android app library.. How to include android app ? Could you help me?


--
regards,
palaniyappan.R

Cláudio B

unread,
Feb 19, 2015, 2:21:15 PM2/19/15
to beagl...@googlegroups.com
I'm not that skilled on Android.

But if I understand what you said, you can't put an Android APP to run inside BBB, at most you could use HTTP communications with it.

You are running a BBB with Linux or Android ?





palaniyappan r

unread,
Feb 19, 2015, 10:33:14 PM2/19/15
to beagl...@googlegroups.com
I have been running BBB with linux

--
regards,
palaniyappan.R

Cláudio B

unread,
Feb 20, 2015, 5:36:57 AM2/20/15
to beagl...@googlegroups.com
you can't run a Android App on Linux directly.

You'll have to find another way

BBB could be a "server" for you Android App.
Reply all
Reply to author
Forward
0 new messages