Contiki sensor data upload to ubidots.com - contiki

I have two z1 motes and wants to upload temperature readings to cloud using website www.ubidots.com
I followed the steps mentioned in the link :
https://www.hackster.io/4348/zolertia-ipv6-6lowpan-ubidots
Border Router logs:
tun Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet6 addr: 2001:5c0:1400:a::495/128 Scope:Global
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1280 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Rime started with address 193.12.0.0.0.0.19.165
MAC c1:0c:00:00:00:00:13:a5 Contiki-2.6-900-ga6227e1 started. Node id is set to 5029.
CSMA ContikiMAC, channel check rate 8 Hz, radio channel 26
Tentative link-local IPv6 address fe80:0000:0000:0000:c30c:0000:0000:13a5
Starting 'Border router process' 'Web server'
*** Address:aaaa::1 => aaaa:0000:0000:0000
Got configuration message of type P
Setting prefix aaaa::
Server IPv6 addresses:
aaaa::c30c:0:0:13a5
fe80::c30c:0:0:13a5
Added Ubidots variable Ids in project-conf.h
running Ubidots-demo.c on another z1 mote
I get the logs :
Ubidots client: STATE_RESOLVING (3)
Ubidots client: STATE_RESOLVING (3)
Ubidots client: STATE_RESOLVING (3)
Ubidots client: STATE_RESOLVING (3)
Ubidots client: STATE_RESOLVING (4)
Ubidots client: STATE_RESOLVING (4)
If anybody also faced same errors
Please let me know where I am going wrong

You need here to modify your Ubuntu machine or raspberry pi if using,
Following three files need to be modify :
etc/radvd.conf
etc/network/interfaces
etc/sysctl.conf
like this :
http://koo.fi/blog/2013/03/20/linux-ipv6-router-radvd-dhcpv6/
bye

Related

Trying to connect from Jenkins to Cygwin sshd randomly does not work (could not write ident string to [clientIP]

I'm trying to connect from Jenkins (docker container) to a windows server (VM) running a Cygwin sshd. The problem I'm facing is that (seemingly) at random I can or cannot connect. This is both with the 'SSH Plugin' (username/password) and via shell SSH command (key pair).
From Jenkins the debug information tells me:
debug1: connect to address [serverIP] port 22: Connection refused
When it isn't working the sshd log tells me:
debug1: fd 4 clearing O_NONBLOCK
debug1: Forked child 1128.
debug3: send_rexec_state: entering fd = 7 config len 232
debug3: ssh_msg_send: type 0
debug3: send_rexec_state: done
debug1: rexec start in 4 out 4 newsock 4 pipe 6 sock 7
debug1: inetd sockets after dupping: 3, 3
Connection from [clientIP] port 59440 on 0.0.0.0 port 22
Could not write ident string to [clientIP] port 59440
When it is working I get the following in the sshd log:
debug1: fd 4 clearing O_NONBLOCK
debug1: Forked child 1708.
debug3: send_rexec_state: entering fd = 7 config len 232
debug3: ssh_msg_send: type 0
debug3: send_rexec_state: done
debug1: rexec start in 4 out 4 newsock 4 pipe 6 sock 7
debug1: inetd sockets after dupping: 3, 3
Connection from [clientIP] port 56742 on [serverIP] port 22
debug1: Client protocol version 2.0; client software version OpenSSH_7.4
Difference I'm seeing is the 0.0.0.0 instead of the serverIP but I cannot find why this is.
I've tried setting up a job that runs every 5 minutes to see if there was a pattern, but I could find none.
On the server I've made a wireshark trace these are the packages I get
Client to server: [SYN]
Client to server: [TCP Out-Of-Order] (same package as previous [SYN])
Server to client: [RST, ACK]
Client to server: [SYN, ACK]
Client to server: [TCP Retransmission] (same package as previous [SYN, ACK])
I'm a bit stumped on the "Could not write ident string to [clientIP]" message and I'm having some trouble finding more information about why this is happening.
Any help on troubleshooting this further or information on why this message is displayed is welcome.
"Connection refused" normally means the server isn't accepting connections to the IP address and port that you requested. The service that you're trying to connect to may not be listening for connections, or it may be listening to a different address and/or port.
"Connection refused" can also be caused by a firewall blocking connections. In your case, given that the service is logging an incoming connection but without the client IP address, my guess is that you have some kind of firewall or malware detection software running on the server, and it's interfering with these connection attempts.
You'll need to access this firewall software, figure out why it's blocking these connections, and configure it to stop interfering.

tcpreplay, different packet number with pcap file

I have a pcap file, captured with Wireshark,with 2690 packets
I use tcpreplay to replay it on an interface, but the problem is that the number of Attempted packets in tcpreplay is different(less) with number of packets showing in wireshark
#tcpreplay -i eth1 test.pcap
sending out eth1
processing file: /tmp/reloadtest4.pcap
Actual: 1826 packets (1634597 bytes) sent in 58.06 seconds.
Rated: 28153.6 bps, 0.21 Mbps, 31.45 pps
Statistics for network device: eth1
Attempted packets: 1826
Successful packets: 1826
Failed packets: 0
Retried packets (ENOBUFS): 0
Retried packets (EAGAIN): 0
It may be a bug in Tcpreplay, or it may be an issue with your capture. I suggest logging the issue here. Include the output of tcpreplay -V. Also rename the packet capture with a suffix of .txt and you will be able to upload it to the issue.

How to determine what is blocking a connection to website?

I need to connect, let's say a script, from an IP to a website and I can't, because:
wget: domain.com…
--2014-11-10 11:20:53-- domain.com…
recognized: domain.com... <IP>
Connecting with: domain.com|<IP>... error: Connection Timeout.
Connect again
I asked the admin of the server I host the domain on to give me ping and tracert to that IP and here it is:
pat#daz:/# ping 188.127.246.50
PING 188.127.246.50 (188.127.246.50) 56(84) bytes of data.
^C
--- 188.127.246.50 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1009ms
pat#daz:/# traceroute 188.127.246.50
traceroute to 188.127.246.50 (188.127.246.50), 30 hops max, 40 byte packets
1 79.133.193.65 (79.133.193.65) 1.348 ms 0.994 ms 0.796 ms
2 ae1-JunM10.etop.pl (79.133.201.129) 72.054 ms 56.309 ms 52.532 ms
3 frm-k90-cr1.rascom.ru (80.81.192.166) 20.489 ms 20.356 ms 20.388 ms
4 * * *
5 oversun.w-ix.net (193.106.112.195) 63.164 ms 59.526 ms 124.898 ms
6 * * *
7 * *^C
The website's .htaccess is clean, robots.txt too, hosting's admin says there's nothing from their side (firewall, blacklist etc) that could be blocking that IP from connecting.
What could it be then? How can I check it?

How do I pump traffic using tcpreplay at 100 MBps, 500 MBps and 1Gbps speeds?

I used the -R and -K option but it doesnt seem to be working as I captured the pumped traffic using tcpdump and the number of packets that I see there dont seem to match the number of packets that I expect in the time frame.
First of all make sure you are using the latest version, available here. You will want to use the -K and --mbps (or -M) options, for example:
# tcpreplay -i eth7 -K --mbps 1000 smallFlows.pcap
File Cache is enabled
Actual: 14261 packets (9216531 bytes) sent in 0.073761 seconds.
Rated: 124951275.0 Bps, 999.61 Mbps, 193340.65 pps
Flows: 1209 flows, 16390.77 fps, 14243 flow packets, 18 non-flow
Statistics for network device: eth7
Attempted packets: 14261
Successful packets: 14261
Failed packets: 0
Truncated packets: 0
Retried packets (ENOBUFS): 0
Retried packets (EAGAIN): 0
When you attempt to move to higher speeds (e.g. 10GigE) you may need to generate a bigger block of data by using the --loop option. Also with Tcpreplay version 4.0 there are the more advanced --netmap and --unique-ip options which on a properly set up system, will achieve near wire rate and very high flows/sec. More information available at Tcpreplay How To. Here is an example:
# tcpreplay -i eth7 -K --mbps 9500 --loop 100 --netmap --unique-ip smallFlows.pcap
Switching network driver for eth7 to netmap bypass mode... done!
File Cache is enabled
Actual: 1426100 packets (921653100 bytes) sent in 0.776133 seconds.
Rated: 1187493767.1 Bps, 9499.95 Mbps, 1837442.80 pps
Flows: 120900 flows, 155772.27 fps, 1424300 flow packets, 1800 non-flow
Statistics for network device: eth7
Attempted packets: 1426100
Successful packets: 1426100
Failed packets: 0
Truncated packets: 0
Retried packets (ENOBUFS): 0
Retried packets (EAGAIN): 0
Switching network driver for eth7 to normal mode... done!

WiFi access-point in BeagleBone

I am trying to start WiFi access point on my Beaglebone Black.
There is no brige. I just want to connect to AP from my phone for setting up some custom configs.
I installed hostapd success, and edit the following config files:
I am using Angstrom Linux (kernel 3.8)
etc/network/interfaces
#When auto_bridge is "yes" then init.script makes bridge itself
#when aut_bridge is "no" then init.script start /etc/network/bridge
AUTO_BRIDGE=yes
STP_ENABLE=no
FD_TIMER=0
GCINT_TIMER=0
#BR0_USE_DHCP=no
#BR0_IPADDR=192.168.0.50/24
IPV4_FORWARD_ENABLE=yes
START_IPTABLES=yes
VLAN_START=yes
WLAN_ENABLED=yes
WLAN_FORCEIP=no
WLAN_IN_BR0=yes
WLAN_USE_DHCP=yes
WLAN_IPADDR=192.168.0.5/24
WLAN_MACADDR=00006c576976
WLAN_BURST=no
WLAN_USE_UNCHECKED_MIBS=no
etc/udhcpd.conf
start 192.168.0.10 #default: 192.168.0.20
end 192.168.0.15 #default: 192.168.0.254
# The interface that udhcpd will use
interface wlan0 #default: eth0
opt dns xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx
option subnet 255.255.255.0
opt router 192.168.0.5
option lease 864000
etc/hostapd/hostapd.conf
# Basic configuration
interface=wlan0
ssid=MyNet
channel=1
#bridge=br0
# WPA and WPA2 configuration
auth_algs=1
ignore_broadcast_ssid=0
wpa=3
wpa_passphrase=aaaaaaaaaa
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
# Hardware configuration
driver=rtl871xdrv
ieee80211n=1
hw_mode=g
device_name=RTL8188CU
manufacturer=Realtek
After this I write in connamd line:
sh-4.2# udhcpd /etc/udhcpd.conf
sh-4.2# hostapd /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
drv->ifindex=4
l2_sock_recv==l2_sock_xmit=0x0x63648
+rtl871x_sta_deauth_ops, ff:ff:ff:ff:ff:ff is deauth, reason=2
rtl871x_set_key_ops
rtl871x_set_key_ops
rtl871x_set_key_ops
rtl871x_set_key_ops
Using interface wlan0 with hwaddr 00:0f:13:76:1d:6b and ssid 'MyNet'
rtl871x_set_wps_assoc_resp_ie
rtl871x_set_wps_beacon_ie
rtl871x_set_wps_probe_resp_ie
rtl871x_set_key_ops
rtl871x_set_beacon_ops
rtl871x_set_hidden_ssid_ops
+rtl871x_get_sta_wpaie, 00:a0:c6:fe:5e:ec is sta's address
Ater this I tried to connect to AP from my phone.
See please the follwing log of hostapd:
wlan0: STA 00:a0:c6:fe:5e:ec IEEE 802.11: associated
rtl871x_set_key_ops
rtl871x_set_key_ops
rtl871x_set_key_ops
+rtl871x_send_eapol
+rtl871x_send_eapol
rtl871x_set_key_ops
wlan0: AP-STA-CONNECTED 00:a0:c6:fe:5e:ec
wlan0: STA 00:a0:c6:fe:5e:ec RADIUS: starting accounting session 52AC6766-00000000
wlan0: STA 00:a0:c6:fe:5e:ec WPA: pairwise key handshake completed (RSN)
wlan0: STA 00:a0:c6:fe:5e:ec IEEE 802.11: disassociated
wlan0: AP-STA-DISCONNECTED 00:a0:c6:fe:5e:ec
rtl871x_set_key_ops
rtl871x_set_key_ops
+rtl871x_sta_remove_ops, 00:a0:c6:fe:5e:ec is sta address removed
+rtl871x_get_sta_wpaie, 00:a0:c6:fe:5e:ec is sta's address
wlan0: STA 00:a0:c6:fe:5e:ec IEEE 802.11: associated
rtl871x_set_key_ops
rtl871x_set_key_ops
+rtl871x_send_eapol
+rtl871x_send_eapol
rtl871x_set_key_ops
wlan0: AP-STA-CONNECTED 00:a0:c6:fe:5e:ec
wlan0: STA 00:a0:c6:fe:5e:ec RADIUS: starting accounting session 52AC6766-00000001
wlan0: STA 00:a0:c6:fe:5e:ec WPA: pairwise key handshake completed (RSN)
In my phone I see messages:
Connecting
Autentification
Getting ip address
Connecting
Autentification
Getting ip address
Connecting
Autentification
Getting ip address
My phone cannot to connect to AP as a result.
I think that problem in udhcpd.
Please help me to find a problem.
Thanks
Maybe can refer to http://fleshandmachines.wordpress.com/2012/10/04/wifi-acces-point-on-beaglebone-with-dhcp/
To sum up it says that angstrom not support what u want to do. This solution use debian.

Resources