Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Kura » MQTT error on Beaglebone with debian(MQTT does not work due to eth0 error)
MQTT error on Beaglebone with debian [message #1584129] Sun, 25 January 2015 15:37 Go to next message
Dan Cristian is currently offline Dan CristianFriend
Messages: 17
Registered: January 2015
Junior Member
I am trying to configure MQTT to use mqtt://iot.eclipse.org:1883/ URL but I get an error related to eth0 interface, as listed below:
2015-01-25 15:25:11,055 [Component Resolve Thread (Bundle 6)] ERROR o.e.k.l.n.NetworkServiceImpl - Can't get network interface info for eth0 :: exception - org.eclipse.kura.KuraException: An internal error occurred. {0}
2015-01-25 15:25:11,242 [Component Resolve Thread (Bundle 6)] DEBUG o.e.k.l.n.NetworkServiceImpl - Ignoring usb0 for beaglebone.
2015-01-25 15:25:11,244 [Component Resolve Thread (Bundle 6)] ERROR o.e.k.c.d.t.m.MqttDataTransport - Invalid configuration

I have installed KURA no net version (kura_1.1.0_beaglebone-nn_debian_armv7.deb) because the Net version does not start due to several errors.

My beaglebone setup is using latest debian image:
[ 0.000000] Linux version 3.8.13-bone50 (root@imx6q-wandboard-2gb-0) (gcc version 4.6.3 (Debian 4.6.3-14) ) #1 SMP Tue May 13 13:24:52 UTC 2014

I am using the latest Java version:
java version "1.8.0_33"
Java(TM) SE Runtime Environment (build 1.8.0_33-b05)
Java HotSpot(TM) Client VM (build 25.33-b05, mixed mode)

The eth- interface is up and working ok, I can ping and telnet to iot.eclipse.org.
eth0 Link encap:Ethernet HWaddr 78:a5:04:cc:e0:0c
inet addr:192.168.0.115 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fd72:c4ce:fb49:0:7aa5:4ff:fecc:e00c/64 Scope:Global
inet6 addr: fe80::7aa5:4ff:fecc:e00c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2570 errors:0 dropped:0 overruns:0 frame:0
TX packets:2797 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:286906 (280.1 KiB) TX bytes:1511818 (1.4 MiB)
Interrupt:40

Same setup works well on a Raspberry PI.

Can someone help please?

Thank you
Dan
Re: MQTT error on Beaglebone with debian [message #1585634 is a reply to message #1584129] Mon, 26 January 2015 11:36 Go to previous messageGo to next message
Luca Dazi is currently offline Luca DaziFriend
Messages: 15
Registered: December 2014
Junior Member
Hello Dan,
Kura should flawlessly install on the BeagleBone Black.
If you get errors while the NetAdmin runs, than probably there is something wrong, which will not be solved by simply installing the NN version.

Which errors do you see when starting a normal Kura install?
Could you show us the contents of kura.log and kura_console.log?
I guess that solving the issue at the root will let you connect to the IoT Eclipse Broker without faults.

Regards,
Luca

Re: MQTT error on Beaglebone with debian [message #1586137 is a reply to message #1585634] Mon, 26 January 2015 17:39 Go to previous messageGo to next message
Dan Cristian is currently offline Dan CristianFriend
Messages: 17
Registered: January 2015
Junior Member
Hello Luca,

Thanks for the fast response. I have reinstalled the full kura version and here are the results. It is not working, I can't connect to the kura admin console.

Install procedure:
1. I have done all install steps in the wiki install guide, installed all prerequisites and made the systemctl conf changes
2. I have reinstalled kura full version kura_1.1.0_beaglebone_debian_armv7.deb. no errors in the install log, attached
3. I have changed the port in config.ini to 8888 as port 80 is already used
4. I have restarted the system, see log files attached.
5. I tried to connect to beagleip:8888/kura, browser did not open, connection timeout. lots of errors in kura.log

I hope you can help.

Thanks,
Dan
Re: MQTT error on Beaglebone with debian [message #1586265 is a reply to message #1584129] Mon, 26 January 2015 19:19 Go to previous messageGo to next message
David Woodard is currently offline David WoodardFriend
Messages: 420
Registered: July 2014
Senior Member
It appears the main error is here:

Caused by: org.eclipse.kura.KuraException: An internal error occurred. link tool failed to detect the ethernet status of eth0
 480     at org.eclipse.kura.linux.net.util.LinuxNetworkUtil.isLinkUp(LinuxNetworkUtil.java:426)


Do you have ethtool installed on your system? It should have been a dependency during the installation of the deb package. Can you try manually running the command:

ethtool eth0


Thanks,
--Dave
Re: MQTT error on Beaglebone with debian [message #1586325 is a reply to message #1586265] Mon, 26 January 2015 20:02 Go to previous messageGo to next message
Dan Cristian is currently offline Dan CristianFriend
Messages: 17
Registered: January 2015
Junior Member
I do not have ethtool installed, looks like it is not installed in this latest debian image I downloaded from beaglebone site.

I have just installed ethtool and good news, the error dissapeared and it looks like kura succesfully started. log attached.

However I still cannot open the admin interface, again the browser times out and I see no activity in the log while trying to open the admin page from a different computer.

Any new ideeas?

Netstat shows that there is a listener on port 8888.
dcristian@beaglebone:~$ netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:3350 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:6011 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:6012 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:3389 0.0.0.0:* LISTEN
tcp 0 0 192.168.0.115:22 192.168.0.104:29658 ESTABLISHED
tcp 0 256 192.168.0.115:22 192.168.0.104:29657 ESTABLISHED
tcp 0 0 192.168.0.115:22 192.168.0.104:29659 ESTABLISHED
tcp6 0 0 :::22 :::* LISTEN
tcp6 0 0 :::8888 :::* LISTEN
tcp6 0 0 :::3000 :::* LISTEN
tcp6 0 0 ::1:6010 :::* LISTEN
tcp6 0 0 ::1:6011 :::* LISTEN
tcp6 0 0 ::1:6012 :::* LISTEN
tcp6 0 0 :::5002 :::* LISTEN
tcp6 0 0 :::1450 :::* LISTEN
tcp6 0 0 :::8080 :::* LISTEN
udp 0 0 0.0.0.0:67 0.0.0.0:*
udp 0 0 0.0.0.0:68 0.0.0.0:*
udp 0 0 0.0.0.0:41564 0.0.0.0:*
udp 0 0 0.0.0.0:40080 0.0.0.0:*
udp6 0 0 :::42231 :::*
udp6 0 0 :::36243 :::*
udp6 0 0 :::48596 :::*


Iptables looks fine, probably not a firewall issue as I did no changes to firewall rules.

dcristian@beaglebone:~$ sudo iptables -L
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT udp -- anywhere anywhere udp dpt:bootps
ACCEPT udp -- anywhere anywhere udp dpt:bootps
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT tcp -- localhost anywhere tcp dpt:rfe
ACCEPT tcp -- anywhere anywhere tcp dpt:1450
ACCEPT tcp -- anywhere anywhere tcp dpt:1450
ACCEPT tcp -- 10.234.0.0/16 anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere icmp echo-request state NEW,RELATED,ESTABLISHED

Chain FORWARD (policy DROP)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT icmp -- anywhere anywhere icmp echo-reply state RELATED,ESTABLISHED
  • Attachment: kura.log
    (Size: 99.56KB, Downloaded 109 times)
Re: MQTT error on Beaglebone with debian [message #1586332 is a reply to message #1586325] Mon, 26 January 2015 20:06 Go to previous messageGo to next message
Dan Cristian is currently offline Dan CristianFriend
Messages: 17
Registered: January 2015
Junior Member
Forgot to add ethtool output:

dcristian@beaglebone:~$ sudo ethtool eth0
Settings for eth0:
Current message level: 0x00000000 (0)

Link detected: yes

Looking at netstat output above I suspect that the cause if kura does not listen on the tcp interface, it only listen to tcp v6 one. I have tried to connect with telnet from a different computer directly to port 8888 and connection times out.

Not sure how I can enable kura to listen on 8888 on all network interfaces, any ideea?

[Updated on: Mon, 26 January 2015 20:28]

Report message to a moderator

Re: MQTT error on Beaglebone with debian [message #1586476 is a reply to message #1586332] Mon, 26 January 2015 22:04 Go to previous messageGo to next message
Dan Cristian is currently offline Dan CristianFriend
Messages: 17
Registered: January 2015
Junior Member
I finally managed to get it work.

I first disabled IPV6 support on beagle to force kura to listen on IPV4 interface. I added these lines in /etc/sysctl.conf and restarted the system:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
net.ipv6.conf.eth0.disable_ipv6 = 1

Then I changed kura config.ini line to org.osgi.service.http.port=80 as per the default setup and restarted kura.

Make sure you disable the default http server on port 80 using:
systemctl disable bonescript.service
systemctl disable bonescript.socket
systemctl disable bonescript-autorun.service

It looks like debian on beagle by default (maybe due to kura settings) does not accept tcp connections to upper ports.
With the above tweaks I can now open the admin interface. If you want to change kura port use the kura admin interface to open a new port in the firewall and then change the port in kura config.ini. This way I managed to have kura running on port 8888.

Thanks all for your help.

[Updated on: Mon, 26 January 2015 22:12]

Report message to a moderator

Re: MQTT error on Beaglebone with debian [message #1586517 is a reply to message #1586476] Mon, 26 January 2015 22:31 Go to previous messageGo to next message
David Woodard is currently offline David WoodardFriend
Messages: 420
Registered: July 2014
Senior Member
Hi Dan,

The BBB certainly has some aggressive out of the box web services. We attempted to summarize how to shut those services down [1], but this hasn't been completely tested. The port issue I believe is related to iptables. The default policy is to drop and you didn't add a rule to accept connections on 8888. I issued the following command:

iptables -I INPUT -p tcp --dport 8888 -j ACCEPT


And was able to connect to the management UI without issue. Let me know if this doesn't work for you.

[1] http://eclipse.github.io/kura/doc/beaglebone-quick-start.html#_Disable_Web_Services

Thanks,
--Dave
Re: MQTT error on Beaglebone with debian [message #1586536 is a reply to message #1586265] Mon, 26 January 2015 22:50 Go to previous message
Dan Cristian is currently offline Dan CristianFriend
Messages: 17
Registered: January 2015
Junior Member
This works as well. All sorted now. Thanks again.
Previous Topic:Support for Multiple MqttDataTransport per gateway
Next Topic:File Creation in Rasberry pi by kura is not working
Goto Forum:
  


Current Time: Thu May 09 08:22:27 GMT 2024

Powered by FUDForum. Page generated in 0.03547 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top