Up and coming changes
Don't worry Brett, the reflashing is down to me, not you.
Getting the wireless working was the first hurdle but it's all falling in to place now.
Brett,
I had to add the following to the xap init script on the pi in order to get this working:
#!/bin/sh
#
# /etc/init.d/xap start [component...]
# /etc/init.d/xap stop [component...]
### BEGIN INIT INFO
# Provides: xap
# Required-Start: $syslog
# Required-Stop: $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Simple script to start a program at boot
# Description: A simple script from www.stuffaboutcode.com which will start / stop a program a boot / shutdown.
### END INIT INFO
not sure if the bone is the same?
Garry
Thanks Brett, will update mine later!
G.
Maybe this will give some pointers (I'm sure you've already found it though) http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/
on another note, is there an easy (for me) way to get the hub to run on wlan0 rather than eth0?
I had a look at the link from Derek Malloy you mentioned above for getting a static ip address. It works for eth0 but connman doesn't seem to work well at giving wlan0 a static address so I have stopped connman and gone back to using an interfaces file (/etc/network/interfaces). In there I have the static settings I require.
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.0.99
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 192.168.0.1
iface usb0 inet static
address 192.168.7.2
netmask 255.255.255.0
gateway 192.168.7.1
dns-nameservers 192.168.7.1
iface wlan0 inet static
address 192.168.0.98
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 192.168.0.1
wireless_mode managed
wireless_essid SSID_HERE
wpa-driver wext
wpa-conf /etc/wpa_supplicant.conf
pre-up wpa_supplicant -B -Dwext -iwlan0 -c/etc/wpa_supplicant.conf
post-down killall -q wpa_supplicant
This also requires a wpa_supplicant.conf file and a .service file in /etc/systemd/system but the beauty of that is that you get notice that the network is indeed up.
Mark,
you can run hub on any port by using the -i flag. Ie xap-hub -i wlan0
to run everything on another port automatically you will need to amend the xap init script, this is what Brett is having issues with at the moment I believe.
I don't understand why this is different on the beaglebone though , the pi starts up with no issues after very minimal changes to the livebox init script?
I wonder if the issues on the BB are down to Angstrom using systemd for initialisation. While it supposedly also runs init, it seems systemd has now taken over as the default initialisation daemon and doesn't really run the init stuff properly.
probably the simplest description of what to do is here http://unix.stackexchange.com/questions/45940/setting-up-boot-scripts-for-beaglebone-angstrom
A probably stupid question but what are the likely issues with running this on a BeagleBone Black (which is half the price) ?
K
Brett, yes I'm still on Angstrom.
Angstrom v2012.12 (Core edition)
I had to create the interfaces file based on this write up http://octopusprotos.com/?p=37 after STOPPING connman. Better to run without it.
Looking at that, could I not just put the xap startup in the net.service file after the network has started up?
Setting up to run with whatever interface it finds first sounds good provided it doesn't use the USB interface that is ALWAYS present.
Kevin, this is the beaglebone thread at the moment. Both Brett and myself are running on the Beaglebone Black
Ahh.. I misread that .. for some reason I thought you were both on the previous BeagleBone (original) . I'm pretty useless Linux wise but as this matures and the updates work 'on platform' I'll jump in . Hopefully someone will post a complete image for this and the Pi when it's stable .
Do you by any chance know if iServer is running OK on BeagleBone ?
Kevin
I'm also pretty useless on linux (it doesn't help there being so many versions) but getting there thanks to the HAH and now the BB. Get yourself a BB Black and jump in.
Mark
The BB site seems down currently but I'll backorder one from a UK distributor anyway...
I am just going outside and may be some time ... it seems
K
I have several links set up for UK distributors such as RS, Farnell, CPC etc to alert me when the Black is back in stock.
Alas, nothing yet :(
I've installed 0.5. Initial tests after setting MYDEV ="-i wlan0 -d 6" and changing eth0 to wlan0 in the checkNetwork
On a reboot I get no xap processes running (using htop to view)
and this in the xap-hub.log
xAP HUB
Copyright (C) DBzoo, 2008-2014
[inf][init.c:98:discoverBroadcastNetwork] 2 interfaces found
[inf][init.c:102:discoverBroadcastNetwork] 1) interface: lo
[inf][init.c:102:discoverBroadcastNetwork] 2) interface: usb0
[crt][init.c:126:discoverBroadcastNetwork] Interface wlan0 not found
After issuing ./etc/init.d/xap restart I see the xap-hub process running
605 root 20 0 1732 568 496 S 0.0 0.1 0:00.11 /usr/bin/xap-hub -i wlan0 -d 6
but none of the other processes run (they are disabled in the GUI though)
If I comment out MYDEV the I get
505 root 20 0 1732 564 496 S 0.0 0.1 0:00.02 /usr/bin/xap-hub
so I know that I am running an up to date xap init
Now if I take replace wlan0 with eth0 in the checkNetwork I then get xap-hub in the running processes but nothing in the log (and I have no eth0 port)
So just to add to the confusion I uncomment the MYDEV and restart....
593 root 20 0 1732 568 496 S 0.0 0.1 0:00.11 /usr/bin/xap-hub -i wlan0 -d 6
bear in mind that I now have eth0 in the checkNetwork
In the xap-hub.log I now see xAP traffic
[inf][init.c:98:discoverBroadcastNetwork] 3 interfaces found
[inf][init.c:102:discoverBroadcastNetwork] 1) interface: lo
[inf][init.c:102:discoverBroadcastNetwork] 2) interface: usb0
[inf][init.c:102:discoverBroadcastNetwork] 3) interface: wlan0
[inf][init.c:109:discoverBroadcastNetwork] address: 192.168.0.98
[inf][init.c:114:discoverBroadcastNetwork] broadcast: 192.168.0.255
[inf][init.c:75:discoverHub] Acquired broadcast socket, port 3639
[inf][init.c:76:discoverHub] Assuming no local hub is active
[inf][hub.c:108:xapRxBroadcast] Message from client 192.168.0.9:3077
[inf][hub.c:144:xapRxBroadcast] Message originated remotely
[inf][tx.c:19:xapSend] send
xap-hbeat
{
v=12
hop=1
uid=FF00DC00
class=xap-hbeat.alive
source=dbzoo.beaglebone.hub
interval=60
port=3639
pid=192.168.0.98:593
}
[inf][hub.c:108:xapRxBroadcast] Message from client 192.168.0.98:40077
[inf][hub.c:116:xapRxBroadcast] Message originated locally
[inf][hub.c:108:xapRxBroadcast] Message from client 192.168.0.9:3074
[inf][hub.c:144:xapRxBroadcast] Message originated remotely
but that is after a restart, not a reboot of the BB.
After a reboot I don't see xap-hub running.
edit: I have realised now that the RESTART bypasses the checkNetwork (doh, should have read the code fully)
If I START xap after the BB has booted the xap-hub process runs but still not after a reboot.
After a START after boot I see this in the log
xAP HUB
Copyright (C) DBzoo, 2008-2014
[inf][init.c:98:discoverBroadcastNetwork] 3 interfaces found
[inf][init.c:102:discoverBroadcastNetwork] 1) interface: lo
[inf][init.c:102:discoverBroadcastNetwork] 2) interface: usb0
[inf][init.c:102:discoverBroadcastNetwork] 3) interface: wlan0
[inf][init.c:109:discoverBroadcastNetwork] address: 192.168.0.98
[inf][init.c:114:discoverBroadcastNetwork] broadcast: 192.168.0.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
[inf][init.c:67:discoverHub] Discovered port 3641
That I presume is because the process was already running. After a STOP then START all seems fine...
xAP HUB
Copyright (C) DBzoo, 2008-2014
[inf][init.c:98:discoverBroadcastNetwork] 3 interfaces found
[inf][init.c:102:discoverBroadcastNetwork] 1) interface: lo
[inf][init.c:102:discoverBroadcastNetwork] 2) interface: usb0
[inf][init.c:102:discoverBroadcastNetwork] 3) interface: wlan0
[inf][init.c:109:discoverBroadcastNetwork] address: 192.168.0.98
[inf][init.c:114:discoverBroadcastNetwork] broadcast: 192.168.0.255
[inf][init.c:75:discoverHub] Acquired broadcast socket, port 3639
[inf][init.c:76:discoverHub] Assuming no local hub is active
[inf][tx.c:19:xapSend] send
xap-hbeat
{
v=12
hop=1
uid=FF00DC00
class=xap-hbeat.alive
source=dbzoo.beaglebone.hub
interval=60
port=3639
pid=192.168.0.98:629
}
[inf][hub.c:108:xapRxBroadcast] Message from client 192.168.0.98:47568
[inf][hub.c:116:xapRxBroadcast] Message originated locally
[inf][hub.c:108:xapRxBroadcast] Message from client 192.168.0.98:56638
[inf][hub.c:116:xapRxBroadcast] Message originated locally
[inf][hub.c:108:xapRxBroadcast] Message from client 192.168.0.98:56638
[inf][hub.c:116:xapRxBroadcast] Message originated locally
[inf][hub.c:108:xapRxBroadcast] Message from client 192.168.0.98:56638
[inf][hub.c:116:xapRxBroadcast] Message originated locally
[inf][hub.c:108:xapRxBroadcast] Message from client 192.168.0.98:56638
[inf][hub.c:116:xapRxBroadcast] Message originated locally
[i
Brett,
Yes the BBB is coming up reliably now. Got it running a CC node for a while to see how it goes.
Cheers for all you efforts
I have seen the system hang on REBOOT but have usually not been able to reproduce it.
Just tried now with USB Wifi dongle and jeenode attached.
At REBOOT I get
Detaching loopback /dev/loop0.
All loop devices detached.
Detaching DM devices.
All DM devices detached.
[68396.718134] (NULL device *): gadget not registered.
[68396.740186] Restarting system.
U-Boot SPL 2013.04-dirty (Jul 10 2013 - 14:02:53)
at a shutdown I get this (but thought this was normal)
Detaching loopback /dev/loop0.
All loop devices detached.
Detaching DM devices.
All DM devi[ 36.666696] (NULL device *): gadget not registered.
ces detached.
[ 36.681696] Power down.
[ 36.686876] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000
[ 36.686876]
Ubuntu is probably the better option.
Hi Brett. Yeah xap-serial really solid on pi. Run for weeks now.
Not had any real issues with any of the components now xively is fixed.
I have had twitter die once with no error log. If this happens again I'll run in debug mode.
Garry
Good the hear your having more success with ubuntu.
if you need me to try anything on the pi I'm happy to put a clean SD card in and test for you.
easy enough to swap my current card back in afterwards.
Garry
>Derek if you wouldn't mind rebuilding with Ubuntu instead of Pidora your PI :)
I'll have to wait 'till tomorrow when I have 'hands on' access to my Pi ... talking SWMBO thru the install would be too difficult!
Derek
Ok now I know what tonights task is :)
Feedback to follow
Using the following bone-ubuntu-13.10-2014-02-16-2gb.img on SD card. I will flash to eMMC later
getting all the packages required took a while on the BB.
Also needed subversion
"make" started at 23:29, finished at....
got as far as
==> configuring libu with args: --prefix=/usr/local --no_docs --compat_1X
==> building libu
then BB stopped, no heartbeat and a rather hot processor
Starting again with make at 23:48
make completed 23:56
make bb-package
rm -rf /home/ubuntu/portable/build/sysroot/DEBIAN
mkdir /home/ubuntu/portable/build/sysroot/DEBIAN
cp -r package/beaglebone/* /home/ubuntu/portable/build/sysroot/DEBIAN
cp -r package/etc /home/ubuntu/portable/build/sysroot
dpkg-deb -b /home/ubuntu/portable/build/sysroot /home/ubuntu/portable/build
dpkg-deb: error: conffile `/etc/kloned.conf' does not appear in package
make: *** [bb-package] Error 2
Brett,
Had a stab on a fresh raspian wheezy image and have the following observations.
required packages seem to be the same as the beaglebone but with the addition of subversion.
build-essential and lua5.1 already installed on raspian wheezy sep2103 image but no harm in checking anyway!.
initial attempt to make bb.package gave permission error, I have to use sudo for all commands:
second attempt gave error:
pi@raspberrypi ~/portable $ sudo make bb-package
rm -rf /home/pi/portable/build/sysroot/DEBIAN
mkdir /home/pi/portable/build/sysroot/DEBIAN
mkdir: cannot create directory `/home/pi/portable/build/sysroot/DEBIAN': No such file or directory
make: *** [bb-package] Error 1
This was due to no sysroot folder being present. Added sysroot folder and then got the following error:
pi@raspberrypi ~/portable $ sudo make bb-package
rm -rf /home/pi/portable/build/sysroot/DEBIAN
mkdir /home/pi/portable/build/sysroot/DEBIAN
cp -r package/beaglebone/* /home/pi/portable/build/sysroot/DEBIAN
cp -r package/etc /home/pi/portable/build/sysroot
dpkg-deb -b /home/pi/portable/build/sysroot /home/pi/portable/build
dpkg-deb: error: conffile `/etc/kloned.conf' does not appear in package
make: *** [bb-package] Error 2
Due to no Kloned.conf in package. Added /etc/kloned.conf into package and tried again.
Package created OK.
Install appeared to go ok. but no /usr/bin/xap-xxxxxx files found on system.
Am i supposed to do a sudo make aswell ?
EDIT: I do need to do sudo make also!
tried: sudo make
then sudo make bb-package
then sudo dpkg -i build/*.deb
reboot and all is good! (well twitter needs authorising and ini filed need eneable=1 but thats for the individual to setup)
STERLING WORK BRETT!
a few more notes for PI users:
I have found that the USB port changes its assignment randomly on reboots which plays havok if you have HAHnode and currentcost running. I added a symlink so that I can just use /dev/jeenode and /dev/currentcost instead of USB0 and USB1.
See here for info on how to do this http://hintshop.ludvig.co.nz/show/persistent-names-usb-serial-devices/
Also, if you plan to add the HAH hardware to the serial on the GPIO pins then you need to disable login on this port. See here: http://www.hobbytronics.co.uk/raspberry-pi-serial-port
on this note, Brett can we add the serial port to be used into the xap-livebox.ini rather than in the /etc/init.d/xap file as this will need changing on different platforms. PI GPIO ports are /dev/ttyAMA0
Garry
A quick update before heading to work..
build/sysroot/etc contains init.d plugboard xap.d
Brett,
I don't understand the .deb file packing at all well yet but due to the conffiles file showing the following:
|
|
I assumed there needed to be Kloned.conf in /package/etc folder.
i put one in here and the error went away. Did I not need to?
I never looked in /sysroot/etc.
Garry
EDIT: I've looked a bit more and can see my issues were due to not doing make prior to packaging.
Probably just a coincidence then that Mark had the same error?!
Brett,
I'll start again from scratch tonight and make sure I note any failures. As i posted earlier, the first attempt at make resulted (after 15mins or so) in no heartbeat and a HOT processor, so the failure may have occured then
Mark
Brett
Ran the whole install again. Had issues when I used
apt-get install build-essential libxml2-dev libcurl4-openssl-dev flex
with one of the required files. So I tried again one at a time.
No issues this time.
I didn't keep a log but will now go through the same process and capture the error.
Kloned did not report an error and as far as I can see all is now running fine.
Well done Brett
edit: starting again now with logging....
Thanks for your efforts again on this Brett. You are right in that all the work added no features but it will open up HAH to bigger audiences. Got to be a good thing!
As for Klone, I agree it does the job. My only gripe was I couldn't easily modify it. I wanted a simple customisable page for the wife to switch on/off heating, water, change temps etc.
with corona, this is doable but a simple web page would be preferable to her. Not an app.
With the switch to pi and more access / resources this can be achieve by installing apache as well as Klone. A simple php web page can now achieve the simple control screen she wanted. (No apps required)
therefore, coming back to the point, maybe keep Kloned for the web setup aspect of HAH, users can always put together they're own pages for other stuff if required. Maybe a few php / hah integration examples would be good. I'm still playing with this in the background, but can post my efforts if it's of use and interest
Garry
Sounds good. I'll take your word on the webpage scripting in LUA. I'm sure it is simple once an example is available and it keeps the learning of new languages to a minimum.
sounds like a plan.
one other thing I have noticed on the portable build. We are missing the init.d/controlpcb script that sends the "+++" initialisation command.
Garry
P.s. Flash is great if your not stuck with apple equipment! :(
I tend to agree Brett and have started moving things like my heating control relays and 1wire off on to jeenodes.
I still use the hardware for rf and inputs but they could easily be moved to other nodes.
I guess as the coding is there and people like myself are using the hardware, is the best plan to keep some compatability with the hardware but move it down the pecking order?. Pretty much as you were suggesting.
if folk have the hardware and the pi/beaglebone support it then the switch is relatively painless (read cheap!).
Longer term I will phase it out as it would allow my install to be neater if nothing else.
nice to see we have a longer term project here and the HAh is already looking like a different animal.
cheers.
garry
Brett, can you let me know what you think should run so far on the BB port (as installed from the opkg install)?
I'm trying to move stuff over from the HAH to the BB bit by bit and I'm not sure what should run and what isn't running yet. I'm not in any rush to do anything so at your pace, not mine :) If anything I'm doing this to help you test (and learn)
I'm still working on my cross compiler and have taken my BB back to shipped state more times than I care to remember.
If there is anything I can do to help. let me know.
Mark