No packets sending through 6lowpan

Open
#4,209 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
linux, python, raspberry-pi

Research direction

Start by reproducing the TCP failure on the Raspberry Pi Zero W setup using the bluetooth_6lowpan module, bt0, and the provided Python client and server. Compare the working ping traffic with the missing application packets using tshark, while checking the reported Linux 5.10.17+ environment. Done means TCP data can traverse the 6lowpan interface as expected.

Written by the indexing model from the issue text.

Description

Describe the bug
Connected two Raspberry Pi W using 6lowpan and ping is working fine with global address at both devices. However, it seems that no programs can send data through the interface, I tried python scrips and mosquitto server etc.

To reproduce

Client:

Enable bluetooth_6lowpan module

modprobe bluetooth_6lowpan
echo 1 > /sys/kernel/debug/bluetooth/6lowpan_enable

Start advertising

hciconfig hci0 leadv

Server:

modprobe bluetooth_6lowpan
echo 1 > /sys/kernel/debug/bluetooth/6lowpan_enable
hcitool lescan

Connect to the client with the bluetooth mac address discovered

echo "connect <mac addr> 1" > /sys/kernel/debug/bluetooth/6lowpan_control

Ping with link local address

ping6 -I bt0 <link local address of the client>

Add gloabal address (in client)

ip addr add fd00::2/64 dev bt0

Add global address (in server)

ip addr add fd00::1/64 dev bt0

Ping the global address, server to client, works fine

ping6 fd00::2

Ping the global address, client to server, works fine

ping6 fd00::1

Try to connect client to server using a program, such as python scripts given below, No data is sending through the 6lowpan (observe with a tshark, or similar).

tcp client program

#!/usr/bin/env python3

import socket
import struct

SERVER_ADDR = 'fd00::1'
SERVER_PORT = 9001
sequence_number = 1
sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
print('send connect request')
sock.connect((SERVER_ADDR, SERVER_PORT))

while sequence_number < 101 :
data = struct.pack("!I", sequence_number)
data += 'Ping'
sock.sendto(data, (SERVER_ADDR, SERVER_PORT, 0, 0))
recv_data = sock.recvfrom(8)
print(recv_data)
sequence_number+= 1

sock.close()
del sock

tcp server program

#!/usr/bin/env python3

import socket

SERVER_ADDR = ''
SERVER_PORT = 9001

with socket.socket(socket.AF_INET6, socket.SOCK_STREAM) as s:
server_addr = (SERVER_ADDR, SERVER_PORT, 0, 0)
s.bind(server_addr)
s.listen(1)
conn, addr = s.accept()
with conn:
while True:
data = conn.recv(128)
if not data:
print('break')
break
conn.sendall(data)
s.close()
del s

System

  • Which model of Raspberry Pi?
    PiZeroW

  • Which OS and version (cat /etc/rpi-issue)?
    Raspberry Pi reference 2020-12-02
    Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, cce27bd6f44a3b2e83855645986b3e21f771e852, stage2

  • Which firmware version (vcgencmd version)?
    Feb 25 2021 12:12:09
    Copyright (c) 2012 Broadcom
    version 564e5f9b852b23a330b1764bcf0b2d022a20afd0 (clean) (release) (start)

  • Which kernel version (uname -a)?
    Linux raspberrypi 5.10.17+ #1403 Mon Feb 22 11:26:13 GMT 2021 armv6l GNU/Linux

Dominant language
C
Stars
13.2k
Forks
5.5k
Avg merge
2d 21h
Merged PRs (30d)
21

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/linux

All issues in raspberrypi/linux

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.