Portable issues with BeagleBone Black

20 replies [Last post]
AndrewJ
Offline
United Kingdom
Joined: 22 Nov 2012

Dear all,

I Hope all is well - my apologies for the long post - i could spend a few more minutes making it shorter but i would rather give as many details as possible

I'm revisiting the HAH again as my Livebox kept failing and was eventually chucked in a box to be fixed on a rainy day

I figured the portable build was the way to go as i have a number of raspberry pi units and a BBB sitting around waiting for a valid project.

Mark Baldwin kindly insisted i should go the BBB route as technically its a more powerful device

Following Bretts and Marks Portable / BBB notes i now have the HAH build Build: 313 (SVN - Revision 650 on Ubuntu 14.04 with a REV C BBB - appreciate others are running 12.04 / 13.10

I have set a static IP using interfaces to 192.168.1.12

The Ubuntu 14.04 install is flashed to the eMMC (no SD card required to boot)

1) How do i upgrade to the advertised current firmware 317 or latest beta
with the livebox build i used either of the below

Stable - /etc/init.d/update

Beta - /etc_ro_fs/update-dev hah-beta.dbzoo.com

2) I appear to have a serial comms issue between the GUI and the HAH PCB - i'll do my best to explain below

By default only the console port ttyO0 is enabled on the BBB, if you want to use UART 1, 2 or 4 you have to manually enable.

Adding a cape to \boot\uboot\uEnv.txt is the recommended solution for REV C boards however this did not work for me.

I have however enabled UART 4 using a cape based on the following commands
cd /sys/devices/platform/bone_capemgr then sudo sh -c 'echo BB-UART4 > slots'

The UART is now listed as \dev\ttyO4 there is also an entry for \dev\ttyS4 which i understand is standard linux tty numbering

Kernal debug - dmesg | grep tty gives me the following

[    0.000000] Kernel command line: console=ttyO0,115200n8 capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN capemgr.enable_partno=BB-UART1,BB-UART2,BB-UART4,BB-UART5 root=UUID=d59b6515-d514-4a8a-95e8-77e8718bc053 ro rootfstype=ext4 rootwait coherent_pool=1M quiet cape_universal=enable
[    0.000427] WARNING: Your 'console=ttyO0' has been replaced by 'ttyS0'
[    3.553473] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 155, base_baud = 3000000) is a 8250
[    3.560948] console [ttyS0] enabled
[   27.826909] 481a8000.serial: ttyS4 at MMIO 0x481a8000 (irq = 192, base_baud = 3000000) is a 8250
ubuntu@arm:~$
50

A bit confusing - have i enabled ttyS4 or ttyO4 or both prehaps?

I have updated my \etc\xap.d\xap-livebox.ini as follows

[livebox]
enable=1
port=/dev/ttyO4

I have also enabled serial \etc\xap.d\xap-serial.ini

[serial]
enable=1

I have also confirmed ttyO4 works by running two SSH connections and wiring TXD to RXD

Heres the issue - The HAH web GUI will not communicate with the HAH PCB in anyway, i.e no relay toggling, no 1wire data - the LCD remains on Booting V3.4 - no IP is displayed.

With that said it appears somethings are working...

If i cat -v < /dev/ttyO4 - do indeed see my 1Wire devices which means everything should probably work correctly? theres HAH PCB data on ttyO4 as required.

1wire 28726B9C0300009E 19.8^M
1wire 28DB8F5C040000D2 21.0^M

Additionally xFX viewer is showing the device present on the network

xap-hbeat
{
v=12
hop=1
uid=FF00D500
class=xap-hbeat.alive
source=dbzoo.arm.Serial
interval=60
port=3641
pid=192.168.1.12:1051
}

The 1wire packet is however missing the 1wire information

xap-header
{
v=12
hop=1
uid=FF00DB80
class=xAPBSC.info
source=dbzoo.arm.Controller:1wire.1
}
input.state
{
state=?
text=?
displaytext=Sensor 1 ?
}

I suspect the issue is a simple one relating to configuring the HAH to the correct tty04 or S4

Maybe i have missed a file somewhere or i need to setup a Symbolic link between ttyS4 and ttyO4 or vice-versa - i did try this but same issue.

any help or suggestions would be great.

Many Thanks

Andrew

brett
Offline
Providence, United States
Joined: 9 Jan 2010
 think the key thing you are

 think the key thing you are missing it the initserial=+++ key.

port=/dev/ttyO4
initserial=+++

See post: http://homeautomationhub.com/content/and-coming-changes?page=2

Or do a site search on initserial and you'll get some background.
Why do you need this?

The external hardware goes into a loop and listen on the serial port consuming all the console text the livebox emitted and simply discards it until it see the +++ token.   I do this so that some spurious piece of livebox startup text won't trigger the external hardware to do something it should not.   This token on the livebox is normally emitted by the /etc/init.d/controlpcb livebox startup script.   HOWEVER that script does not exist in the portable distribution as it makes no sense as the  HAH hardware is not attached to the console serial port.  So we use this initserial= argument as a workaround I should document that on the "portable" wiki as something you MUST do.

Brett

AndrewJ
Offline
United Kingdom
Joined: 22 Nov 2012
Thank you Brett,I had my

Thank you Brett,

I had my suspicions about the initserial=+++ value  - I have now enabled in xap.d\livebox.ini

[livebox]
enable=1
port=/dev/ttyO4
initserial=+++

LCD remains on Booting V3.4 - Virtual LCD IP app remains blank

Something else missing it seems

Thanks

Andrew

brett
Offline
Providence, United States
Joined: 9 Jan 2010
As you can see from the

As you can see from the livebox HAH firmware the "Booting vX.X" message will remain on the LCD screen until it see's three consecutive +++ characters.  This is where you need to focus.  If you can open a terminal emulate to the HAH serial port you can drive this manually.

https://github.com/dbzoo/hah/blob/master/userapps/arduino/liveboxHAH/liv...

You might try running the xap-livebox in debug mode and see what is going and coming in from the serial port.

AndrewJ
Offline
United Kingdom
Joined: 22 Nov 2012
Thanks Brett,Looking at the

Thanks Brett,

Looking at the debug i can see the +++ is being sent and the AVR responds with the correct version

Then the i2c reset followed by adding the endpoints.

I couldnt make out where the IP address was sent

 

ubuntu@beaglebone:~$ xap-livebox -d 7
Livebox Connector for xAP
Copyright (C) DBzoo, 2008-2010

[inf][init.c:98:discoverBroadcastNetwork] 3 interfaces found
[inf][init.c:102:discoverBroadcastNetwork] 1) interface: lo
[inf][init.c:102:discoverBroadcastNetwork] 2) interface: eth0
[inf][init.c:109:discoverBroadcastNetwork] address: 192.168.1.12
[inf][init.c:121:discoverBroadcastNetwork] broadcast: 192.168.1.255
[ntc][init.c:55:discoverHub] Broadcast socket port 3639 in use
[inf][init.c:56:discoverHub] Assuming a hub is active
[ntc][init.c:65:discoverHub] Socket port 3640 in use
[ntc][init.c:65:discoverHub] Socket port 3641 in use
[ntc][init.c:65:discoverHub] Socket port 3642 in use
[inf][init.c:67:discoverHub] Discovered port 3643
[dbg][timeout.c:18:xapAddTimeoutAction] Add timeout. interval=60
[dbg][init.c:237:xapAddSocketListener] socket=4
[inf][serial.c:332:serialSend] Serial Tx: +++
[inf][serial.c:332:serialSend] Serial Tx: version
[inf][serial.c:311:serialInputHandler] enter
[inf][serial.c:324:serialInputHandler] exit
[inf][serial.c:332:serialSend] Serial Tx: version
[inf][serial.c:311:serialInputHandler] enter
[inf][serial.c:262:processSerialCommand] rev 3.4
[inf][serial.c:77:serin_firmware_rev] AVR firmware version: 3.4
[inf][serial.c:262:processSerialCommand] rev 3.4
[inf][serial.c:77:serin_firmware_rev] AVR firmware version: 3.4
[inf][serial.c:324:serialInputHandler] exit
[inf][serial.c:332:serialSend] Serial Tx: i2c R
[inf][ini.c:417:addIniEndpoints] section: livebox
[inf][ini.c:417:addIniEndpoints] section: 1wire
[inf][ini.c:241:addOneWireIniEndpoints] Adding 1wire.1
[inf][ini.c:245:addOneWireIniEndpoints] Looking for sensor1.romid
[wrn][ini.c:249:addOneWireIniEndpoints] sensor1.romid : Missing or invalid ROMID
[inf][ini.c:241:addOneWireIniEndpoints] Adding 1wire.2
[inf][ini.c:245:addOneWireIniEndpoints] Looking for sensor2.romid
[wrn][ini.c:249:addOneWireIniEndpoints] sensor2.romid : Missing or invalid ROMID
[inf][ini.c:417:addIniEndpoints] section: rf
[inf][ini.c:417:addIniEndpoints] section: input
[inf][ini.c:417:addIniEndpoints] section: relay
[inf][bsc.c:383:bscAddEndpointFilter] source=dbzoo.beaglebone.Controller:rf.4
[inf][filter.c:34:xapAddFilter] section=xap-header key=class value=xAPBSC.cmd
[inf][filter.c:34:xapAddFilter] section=xap-header key=target value=dbzoo.beaglebone.Controller:rf.4
[inf][filter.c:195:xapAddFilterAction] section=xap-header key=target value=dbzoo.beaglebone.Controller:rf.4 data=1bef288
[inf][filter.c:34:xapAddFilter] section=xap-header key=class value=xAPBSC.query
[inf][filter.c:34:xapAddFilter] section=xap-header key=target value=dbzoo.beaglebone.Controller:rf.4
[inf][filter.c:195:xapAddFilterAction] section=xap-header key=target value=dbzoo.beaglebone.Controller:rf.4 data=1bef288
[dbg][timeout.c:18:xapAddTimeoutAction] Add timeout. interval=120
[inf][bsc.c:383:bscAddEndpointFilter] source=dbzoo.beaglebone.Controller:rf.3
[inf][filter.c:34:xapAddFilter] section=xap-header key=class value=xAPBSC.cmd
[inf][filter.c:34:xapAddFilter] section=xap-header key=target value=dbzoo.beaglebone.Controller:rf.3
[inf][filter.c:195:xapAddFilterAction] section=xap-header key=target value=dbzoo.beaglebone.Controller:rf.3 data=1bef220
[inf][filter.c:34:xapAddFilter] section=xap-header key=class value=xAPBSC.query
[inf][filter.c:34:xapAddFilter] section=xap-header key=target value=dbzoo.beaglebone.Controller:rf.3
[inf][filter.c:195:xapAddFilterAction] section=xap-header key=target value=dbzoo.beaglebone.Controller:rf.3 data=1bef220
[dbg][timeout.c:18:xapAddTimeoutAction] Add timeout. interval=120
[inf][bsc.c:383:bscAddEndpointFilter] source=dbzoo.beaglebone.Controller:rf.2
[inf][filter.c:34:xapAddFilter] section=xap-header key=class value=xAPBSC.cmd
[inf][filter.c:34:xapAddFilter] section=xap-header key=target value=dbzoo.beaglebone.Controller:rf.2
[inf][filter.c:195:xapAddFilterAction] section=xap-header key=target value=dbzoo.beaglebone.Controller:rf.2 data=1bef1b8
[inf][filter.c:34:xapAddFilter] section=xap-header key=class value=xAPBSC.query
[inf][filter.c:34:xapAddFilter] section=xap-header key=target value=dbzoo.beaglebone.Controller:rf.2
[inf][filter.c:195:xapAddFilterAction] section=xap-header key=target value=dbzoo.beaglebone.Controller:rf.2 data=1bef1b8
[dbg][timeout.c:18:xapAddTimeoutAction] Add timeout. interval=120
[inf][bsc.c:383:bscAddEndpointFilter] source=dbzoo.beaglebone.Controller:rf.1
[inf][filter.c:34:xapAddFilter] section=xap-header key=class value=xAPBSC.cmd
[inf][filter.c:34:xapAddFilter] section=xap-header key=target value=dbzoo.beaglebone.Controller:rf.1
[inf][filter.c:195:xapAddFilterAction] section=xap-header key=target value=dbzoo.beaglebone.Controller:rf.1 data=1bef150
[inf][filter.c:34:xapAddFilter] section=xap-header key=class value=xAPBSC.query
[inf][filter.c:34:xapAddFilter] section=xap-header key=target value=dbzoo.beaglebone.Controller:rf.1
[inf][filter.c:195:xapAddFilterAction] section=xap-header key=target value=dbzoo.beaglebone.Controller:rf.1 data=1bef150
[dbg][timeout.c:18:xapAddTimeoutAction] Add timeout. interval=120
[inf][bsc.c:383:bscAddEndpointFilter] source=dbzoo.beaglebone.Controller:relay.4
[inf][filter.c:34:xapAddFilter] section=xap-header key=class value=xAPBSC.cmd
[inf][filter.c:34:xapAddFilter] section=xap-header key=target value=dbzoo.beaglebone.Controller:relay.4
[inf][filter.c:195:xapAddFilterAction] section=xap-header key=target value=dbzoo.beaglebone.Controller:relay.4 data=1bef0e8
[inf][filter.c:34:xapAddFilter] section=xap-header key=class value=xAPBSC.query
[inf][filter.c:34:xapAddFilter] section=xap-header key=target value=dbzoo.beaglebone.Controller:relay.4
[inf][filter.c:195:xapAddFilterAction] section=xap-header key=target value=dbzoo.beaglebone.Controller:relay.4 data=1bef0e8
[dbg][timeout.c:18:xapAddTimeoutAction] Add timeout. interval=120
[inf][bsc.c:383:bscAddEndpointFilter] source=dbzoo.beaglebone.Controller:relay.3
[inf][filter.c:34:xapAddFilter] section=xap-header key=class value=xAPBSC.cmd
[inf][filter.c:34:xapAddFilter] section=xap-header key=target value=dbzoo.beaglebone.Controller:relay.3
[inf][filter.c:195:xapAddFilterAction] section=xap-header key=target value=dbzoo.beaglebone.Controller:relay.3 data=1bef080
[inf][filter.c:34:xapAddFilter] section=xap-header key=class value=xAPBSC.query
[inf][filter.c:34:xapAddFilter] section=xap-header key=target value=dbzoo.beaglebone.Controller:relay.3
[inf][filter.c:195:xapAddFilterAction] section=xap-header key=target value=dbzoo.beaglebone.Controller:relay.3 data=1bef080
[dbg][timeout.c:18:xapAddTimeoutAction] Add timeout. interval=120
[inf][bsc.c:383:bscAddEndpointFilter] source=dbzoo.beaglebone.Controller:relay.2
[inf][filter.c:34:xapAddFilter] section=xap-header key=class value=xAPBSC.cmd
[inf][filter.c:34:xapAddFilter] section=xap-header key=target value=dbzoo.beaglebone.Controller:relay.2
[inf][filter.c:195:xapAddFilterAction] section=xap-header key=target value=dbzoo.beaglebone.Controller:relay.2 data=1bef018
[inf][filter.c:34:xapAddFilter] section=xap-header key=class value=xAPBSC.query
[inf][filter.c:34:xapAddFilter] section=xap-header key=target value=dbzoo.beaglebone.Controller:relay.2
[inf][filter.c:195:xapAddFilterAction] section=xap-header key=target value=dbzoo.beaglebone.Controller:relay.2 data=1bef018
[dbg][timeout.c:18:xapAddTimeoutAction] Add timeout. interval=120
[inf][bsc.c:383:bscAddEndpointFilter] source=dbzoo.beaglebone.Controller:relay.1
[inf][filter.c:34:xapAddFilter] section=xap-header key=class value=xAPBSC.cmd
[inf][filter.c:34:xapAddFilter] section=xap-header key=target value=dbzoo.beaglebone.Controller:relay.1
[inf][filter.c:195:xapAddFilterAction] section=xap-header key=target value=dbzoo.beaglebone.Controller:relay.1 data=1beefb0
[inf][filter.c:34:xapAddFilter] section=xap-header key=class value=xAPBSC.query
[inf][filter.c:34:xapAddFilter] section=xap-header key=target value=dbzoo.beaglebone.Controller:relay.1
[inf][filter.c:195:xapAddFilterAction] section=xap-header key=target value=dbzoo.beaglebone.Controller:relay.1 data=1beefb0
[dbg][timeout.c:18:xapAddTimeoutAction] Add timeout. interval=120
[inf][bsc.c:383:bscAddEndpointFilter] source=dbzoo.beaglebone.Controller:input.4
[inf][filter.c:34:xapAddFilter] section=xap-header key=class value=xAPBSC.query
[inf][filter.c:34:xapAddFilter] section=xap-header key=target value=dbzoo.beaglebone.Controller:input.4
[inf][filter.c:195:xapAddFilterAction] section=xap-header key=target value=dbzoo.beaglebone.Controller:input.4 data=1beef48
[dbg][timeout.c:18:xapAddTimeoutAction] Add timeout. interval=120
[inf][bsc.c:383:bscAddEndpointFilter] source=dbzoo.beaglebone.Controller:input.3
[inf][filter.c:34:xapAddFilter] section=xap-header key=class value=xAPBSC.query
[inf][filter.c:34:xapAddFilter] section=xap-header key=target value=dbzoo.beaglebone.Controller:input.3
[inf][filter.c:195:xapAddFilterAction] section=xap-header key=target value=dbzoo.beaglebone.Controller:input.3 data=1beeee0
[dbg][timeout.c:18:xapAddTimeoutAction] Add timeout. interval=120
[inf][bsc.c:383:bscAddEndpointFilter] source=dbzoo.beaglebone.Controller:input.2
[inf][filter.c:34:xapAddFilter] section=xap-header key=class value=xAPBSC.query
[inf][filter.c:34:xapAddFilter] section=xap-header key=target value=dbzoo.beaglebone.Controller:input.2
[inf][filter.c:195:xapAddFilterAction] section=xap-header key=target value=dbzoo.beaglebone.Controller:input.2 data=1beee78
[dbg][timeout.c:18:xapAddTimeoutAction] Add timeout. interval=120
[inf][bsc.c:383:bscAddEndpointFilter] source=dbzoo.beaglebone.Controller:input.1
[inf][filter.c:34:xapAddFilter] section=xap-header key=class value=xAPBSC.query
[inf][filter.c:34:xapAddFilter] section=xap-header key=target value=dbzoo.beaglebone.Controller:input.1
[inf][filter.c:195:xapAddFilterAction] section=xap-header key=target value=dbzoo.beaglebone.Controller:input.1 data=1beee10
[dbg][timeout.c:18:xapAddTimeoutAction] Add timeout. interval=120
[inf][bsc.c:383:bscAddEndpointFilter] source=dbzoo.beaglebone.Controller:lcd
[inf][filter.c:34:xapAddFilter] section=xap-header key=class value=xAPBSC.cmd
[inf][filter.c:34:xapAddFilter] section=xap-header key=target value=dbzoo.beaglebone.Controller:lcd
[inf][filter.c:195:xapAddFilterAction] section=xap-header key=target value=dbzoo.beaglebone.Controller:lcd data=1beedc8
[inf][filter.c:34:xapAddFilter] section=xap-header key=class value=xAPBSC.query
[inf][filter.c:34:xapAddFilter] section=xap-header key=target value=dbzoo.beaglebone.Controller:lcd
[inf][filter.c:195:xapAddFilterAction] section=xap-header key=target value=dbzoo.beaglebone.Controller:lcd data=1beedc8
[dbg][timeout.c:18:xapAddTimeoutAction] Add timeout. interval=120
[inf][filter.c:34:xapAddFilter] section=xap-header key=target value=dbzoo.beaglebone.Controller
[inf][filter.c:34:xapAddFilter] section=xap-header key=class value=rf.xmit
[inf][filter.c:34:xapAddFilter] section=rf key=pulsedef value=XAP_FILTER_ANY
[inf][filter.c:34:xapAddFilter] section=rf key=burstcount value=XAP_FILTER_ANY
[inf][filter.c:34:xapAddFilter] section=rf key=interburstdelay value=XAP_FILTER_ANY
[inf][filter.c:34:xapAddFilter] section=rf key=frames value=XAP_FILTER_ANY
[inf][filter.c:34:xapAddFilter] section=rf key=stream value=XAP_FILTER_ANY
[inf][filter.c:195:xapAddFilterAction] section=rf key=stream value=XAP_FILTER_ANY data=0
[inf][filter.c:34:xapAddFilter] section=xap-header key=target value=dbzoo.beaglebone.Controller
[inf][filter.c:34:xapAddFilter] section=xap-header key=class value=rf.xmit
[inf][filter.c:34:xapAddFilter] section=rf key=data value=XAP_FILTER_ANY
[inf][filter.c:195:xapAddFilterAction] section=rf key=data value=XAP_FILTER_ANY data=0
[dbg][init.c:237:xapAddSocketListener] socket=5
[crt][server.c:227:svr_bind] Could not bind to port 79

brett
Offline
Providence, United States
Joined: 9 Jan 2010
This is your problem at this

This is your problem at this point the xap-livebox program is terminating itself.

[dbg][init.c:237:xapAddSocketListener] socket=5
[crt][server.c:227:svr_bind] Could not bind to port 79

You must run this as ROOT because port 79 can't be bound from a normal user.

ubuntu@beaglebone:~$ xap-livebox -d 7

The whole xap subsystem must be debugged and ran as root.
ubuntu@beaglebone:~$ sudo su -
ubuntu@beaglebone:~#

Ubunutu is a little shit like that it wants you to do everything as a normal user.
The code should probably check that is root and throw you out if its not instead of failing with a port 79 bind error.

Brett

AndrewJ
Offline
United Kingdom
Joined: 22 Nov 2012
Thanks, Hmmm Same output when

Thanks,

 

Hmmm Same output when run at root.

I'm thinking i may need to flash the AVR

 

root@beaglebone:/home/ubuntu# xap-livebox -d 7

.....

[crt][server.c:227:svr_bind] Could not bind to port 79

               

Andrew

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
Hi Andrew,im not sure your

Hi Andrew,

im not sure your AVR is the issue. You seem to be talking to it ok. It's the fact your not binding to port 79 as Brett says. Although I have no ideas why. 

Garry

AndrewJ
Offline
United Kingdom
Joined: 22 Nov 2012
Thanks Garry, Agreed, i guess

Thanks Garry,

 

Agreed, i guess im clutching at straws a bit as i've been at this issue for a number of nights :)

Brett has mentioned running the entire sub system as SU - can i add this into a start up script

 

Thanks Andrew

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Then you have something else

Then you have something else listening on port 79 find out what it. As root do this

# lsof -i:79 -P

For example port 80 has the HAH KLONED web server

root@beaglebone:~# lsof -i:80
COMMAND PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
kloned  903 root    3u  IPv4   5529      0t0  TCP *:80 (LISTEN)

Brett

AndrewJ
Offline
United Kingdom
Joined: 22 Nov 2012
xap-liveb is apparently

xap-liveb is apparently running on port 79

root@beaglebone:/home/ubuntu# lsof -i:79 -P
COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
xap-liveb 1042 root    5u  IPv4  14254      0t0  TCP *:79 (LISTEN)

when running xap-livebox

[crt][server.c:227:svr_bind] Could not bind to port 79

Also with fuser

root@beaglebone:/usr/bin# fuser -n tcp 79
79/tcp:               1013
root@beaglebone:/usr/bin# ps aux | grep 1013
root      1013  0.0  0.2   1396  1072 ?        S    14:49   0:00 /usr/bin/xap-livebox
root      1258  0.0  0.3   3304  1532 pts/3    S+   15:14   0:00 grep --color=auto 1013
root@beaglebone:/usr/bin#

PS #

root      1013  0.0  0.2   1396  1072 ?        S    14:49   0:01 /usr/bin/xap-livebox

 

could this be a trusty 14.04 isolated issue, anyone else running the portable build on 14.04?

thanks

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
Andrew, have you tried

Andrew, have you tried killing off livebox before you run it as debug from the command line?

AndrewJ
Offline
United Kingdom
Joined: 22 Nov 2012
Thanks Garry,You sir have

Thanks Garry,

You sir have made my night!

I have to admit i was looking at the processes this afternoon and didnt attempt to kill the current xap-livebox process (i know very stupid but im learning)

so after a clean boot i can see the xap-livebox running as below however the LCD remains on booting V3.4 and theres no control from the GUI

the process is running as root so im not sure what the issue is here.

COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
xap-liveb 1026 root    5u  IPv4  14138      0t0  TCP *:79 (LISTEN)

if i kill the process and run it again as root the LCD upates with the IP address and the GUI responds.

Do i need to add some form of a delay between boot and starting of the xap-process here?

Thanks Andrew

 

Edit - current workaround is to kill process from rc.local and run again

\etc\rc.local

sudo pkill -f xap-livebox
sudo xap-livebox &

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
I'm not really sure. Maybe

I'm not really sure. Maybe try altering the following in the xap file in /etc/init.d

subsystem="hub xively livebox iserver web sms serial currentcost twitter googlecal plugboard urfrx mail"

To:

 subsystem="hub xively iserver web sms serial currentcost livebox twitter googlecal plugboard urfrx mail"

 

this is may give other systems chance to boot before loading livebox?

but I'm only guessing now

 

Garry

 

edit:

just noticed in the same file, there is a delay after hub startup. Try increasing that too

start_hub() {

    /usr/bin/xap-hub $MYDEV > /var/log/xap-hub.log 2>&1 &

    sleep 1

}

AndrewJ
Offline
United Kingdom
Joined: 22 Nov 2012
Thanks Garry,I was looking at

Thanks Garry,

I was looking at the xap script earlier, i dont think thats the startup order as such as presented inside "" marks however i tested both of your suggestions which didnt resolve the issue.

At the moment im using the following to kill the process and reinstate in my rc.local which seems to be working, however i've noticed xap-plugboard doesnt start up automatically if i do the above, plugboard starts up fine if i comment out the above and restart.

i tried modifying the kill for xap stop xap-livebox followed by a sleep 5, and a xap start xap-livebox - this didnt appear to work.

this could all be timing related, Hopefully Brett can comment on the issue.

thanks Andrew

brett
Offline
Providence, United States
Joined: 9 Jan 2010
That is strange "you have

That is strange "you have kill xap-livebox and start it up again for things to work !?"
The only dependency xap-livebox has is xap-hub thus its sleep 1 after starting.
In fact everything depends on xap-hub starting first and being operational before they fire up.

I can't see how the serial port would not be ready when xap-livebox starts.
You can try editting the /etc/init.d/xap script and mess around with how it starts up.

start_livebox() {
    INI="/etc/xap.d/xap-livebox.ini"
    if [ `iniget $INI livebox enable 0` -eq 1 ] ;  then
        sleep 5
        /usr/bin/xap-livebox $MYDEV >/var/log/xap-livebox.log 2>&1 &
    fi
}

Put a sleep before the starting of xap-livebox if you think that might help but I don't see how, maybe it might.
After will do no good as nothing depends on xap-livebox being up before it starts.
You can also try putting the -d 7 option in the start_livebox() func and then power cycle so you get in the logs how it looks at system boot time that might help you figure out what is different.

Brett

AndrewJ
Offline
United Kingdom
Joined: 22 Nov 2012
Brett,I think you hit the

Brett,

I think you hit the nail on the head with this comment

"I can't see how the serial port would not be ready when xap-livebox starts"

I had some difficulties in enabling the UART4 in \boot\uEvn.txt by adding the capes and as such added the following device tree setup to \etc\rc.local

cd /sys/devices/platform/bone_capemgr
sudo sh -c 'echo BB-UART4 > slots'

The UART setup isnt retained after a reboot hence adding to the start up script

now rc.local is being processed after \etc\init.d\xap which explains why the serial port isnt setup when xap-livebox starts.

As an additional workaround i just moved the UART setup to the start of \etc\init.d\xap - this appears to be working, plugboard is also running now.

I think i need to get to the bottom of the uEnv.txt issue on this REV C board with 14.04

I dont have the \boot\uboot directory either my uEnv.txt is at \boot\ - I gather i may need to install universal boot loader ?

thanks

Andrew

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Andrew,That little tid bit

Andrew,

That little tid bit about your serial port slots nicely into why xap-livebox was having startup problems.
There were two issues at play.  
1.  You did not include initserial=+++ to get the external hardware online.
2.  Once you sorted the above out your serial port was found to not be "onlined" when required by xap-livebox on a power cycle.

Looks like you have a workaround and some knowledge of why things where going pear shaped.
I'm not sure about the uboot thing.  I'm using a beaglebone original which does have flash onboard.
An it ain't broke so I'm not touching it....

Brett

AndrewJ
Offline
United Kingdom
Joined: 22 Nov 2012
Brett,Yes indeed, easy

Brett,

Yes indeed, easy mistake to make but now i am aware of how the xap-livebox process runs and have probably tripled my shell knowledge over the past few days

I wont worry about enabling the port from boot i've spent too long on the issue and have a workable solution

Now onto the fun things like setting up my Nodes, URF Rx and Bluetooth detection.

I also installed OpenHab to run alongside HAH which seems to be working well using the demo layout.

One last question if you dont mind, Have you kept the portable build inline with the livebox revision?

my GUI is showing

Current HAH build:313
Latest HAH build:317

thanks

Andrew

brett
Offline
Providence, United States
Joined: 9 Jan 2010
The code in the portable

The code in the portable still has a lot of HAH warts.  You can ignore this they are actually in sync. in fact sometimes the portable leads the HAH distribution as my livebox board died after a power flucuation and I run purely on portable.

Brett

AndrewJ
Offline
United Kingdom
Joined: 22 Nov 2012
Brett,Thanks, thats good to

Brett,

Thanks, thats good to know we are running the latest despite the warts.

My earlier comment about running OpenHab alongside the HAH processes doesnt appear to be a working solution

i found the xap processes were terminating or just not starting at boot

Can you tell me which method you use on start up to run the processes?

I've attempted to modify the priority with update-rc.d xap defaults 20 80 and enable.

however after a clean boot none of the services are running

root@beaglebone:/home/ubuntu# ps
  PID TTY          TIME CMD
 1164 pts/0    00:00:00 sudo
 1165 pts/0    00:00:00 su
 1166 pts/0    00:00:00 bash

After a restart of the xap service they appear as expected

root@beaglebone:/etc/init.d# service xap restart

root@beaglebone:/etc/init.d# ps
  PID TTY          TIME CMD
 1176 pts/0    00:00:00 su
 1177 pts/0    00:00:00 bash
 1212 pts/0    00:00:00 lua
 1506 pts/0    00:00:00 xap-hub
 1509 pts/0    00:00:00 xap-xively
 1511 pts/0    00:00:00 xap-livebox
 1513 pts/0    00:00:00 iServer
 1521 pts/0    00:00:00 xap-serial
 1526 pts/0    00:00:00 lua
 1529 pts/0    00:00:00 ps

now the odd thing here is that the xap script is being processed - one reason for this is \dev\ttyO4 is present after a reboot.

at first i suspected the script was terminating, possibly some level of debug required.

however i have no errors if i run the script manually as above.

thanks

Andrew

Hardware Info