Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

native: txtsnd stops working on OS X after TX/TX one packet #1331

Closed
emmanuelsearch opened this issue Jun 18, 2014 · 19 comments
Closed

native: txtsnd stops working on OS X after TX/TX one packet #1331

emmanuelsearch opened this issue Jun 18, 2014 · 19 comments
Assignees
Labels
Area: network Area: Networking OS: Mac OS X Host OS: This PR/issue concerns usage of RIOT with Mac OS X as a host system Platform: native Platform: This PR/issue effects the native platform Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Comments

@emmanuelsearch
Copy link
Member

On Mac, the default application does not function correctly with 2 nodes connected by tapsetup-osx.sh

After setting up as specified in examples/default/README.md, message sending between the two nodes with txtsnd stops working after the first packet is received (message is apparently sent, but not received).

@LudwigKnuepfer
Copy link
Member

The problem apparently is that the sigio_child blocks the signal.

@LudwigKnuepfer
Copy link
Member

Note to self: Maybe it makes more sense to proxy the interrupt communication via UNIX sockets.

@LudwigKnuepfer
Copy link
Member

Is this still the case with the new native network implementation? (#2776)
Can't test due to missing hardware.

@emmanuelsearch
Copy link
Member Author

@LudwigOrtmann how should I test this? If all takes in terms of hardware is a Mac, I could do that, but I'm in the dark as to how to proceed for the rest of it ;)

@LudwigKnuepfer
Copy link
Member

In theory:
Just create two virtual RIOT instances with the master branch and see if the problem described above still occurs.

In practice:
As I just read the master branch no longer builds on your system - nothing until building on OS X is fixed.

@OlegHahm OlegHahm modified the milestone: Release 2016.03 Dec 7, 2015
@OlegHahm
Copy link
Member

Can any OSX user report about the state of this issue? @emmanuelsearch, @kYc0o, @adjih, @thomaseichinger?

@kYc0o
Copy link
Contributor

kYc0o commented Mar 28, 2016

tapsetup-osx.sh does not exist anymore, and dist/tools/tapsetup/tapsetup is proposed instead. Is this tool built for OSX?

@OlegHahm
Copy link
Member

I have no idea. ;)

@Yonezawa-T2
Copy link
Contributor

pause has a race condition: if signal is sent before pause, it is ignored.

sigsuspend doesn't have a race condition but we have to set an empty signal handler for SIGCONT.

sigwait doesn't have a race condition and easy to use.

My PR for native UART driver (#4443), which also updates netdev2_tap to share SIGIO with the UART driver, uses sigwait and works well. So it will resolve this issue.

@kYc0o
Copy link
Contributor

kYc0o commented Mar 29, 2016

So we can close this? @Yonezawa-T2 did you confirm that this issue is not present anymore?

@OlegHahm
Copy link
Member

#4443 is not yet merged.

@kYc0o
Copy link
Contributor

kYc0o commented Mar 29, 2016

Ok let's wait for it, but still I don't know how to setup a tap interface on OSX to test this

@Yonezawa-T2
Copy link
Contributor

master branch:

  1. Enable debug on netdev2_tap.
  2. make && sudo make term in examples/gnrc_networking directory.
  3. In OS X terminal (not RIOT), sudo ifconfig tap0 inet6 fd01::1/64 up.
  4. (OS X sends NDP packets).
  5. RIOT shows netdev2_tap: read 78 bytes but does not receive packets anymore.

#4443 branch:
(same steps as master branch)

netdev2_tap: read 78 bytes
netdev2_tap: native_async_read_continue
netdev2_tap: read 78 bytes
netdev2_tap: native_async_read_continue
netdev2_tap: read 110 bytes
netdev2_tap: native_async_read_continue
...

So #4443 branch can receive more than one packet.

@haukepetersen
Copy link
Contributor

#4443 is merged, does this mean this issue is solved?

@kYc0o
Copy link
Contributor

kYc0o commented Mar 31, 2016

I'm testing now

@kYc0o
Copy link
Contributor

kYc0o commented Mar 31, 2016

But I cannot make work a tap interface :/ a common problem on Mac OSX... @Yonezawa-T2 how have you configured a tap interface on Mac OSX? I know there are some libraries but maybe there's an easier way to do it.

My two errors are:

In RIOT:

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
/Users/facosta/git/RIOT2/RIOT/examples/gnrc_networking/bin/native/gnrc_networking.elf tap0 
RIOT native interrupts/signals initialized.
LED_RED_OFF
LED_GREEN_ON
RIOT native board initialized.
RIOT native hardware initialization complete.

cpu/native/netdev2_tap/netdev2_tap.c:_init:323
/Users/facosta/git/RIOT2/RIOT/examples/gnrc_networking/bin/native/gnrc_networking.elf: open(/dev/tap0): No such file or directory
make: *** [term] Error 1

In OSX terminal:

$ sudo ifconfig tap0 inet6 fd01::1/64 up
ifconfig: interface tap0 does not exist

@Yonezawa-T2
Copy link
Contributor

You need 3rd party TunTap software.

@kYc0o
Copy link
Contributor

kYc0o commented Apr 1, 2016

Ok let's try with that one

@kYc0o
Copy link
Contributor

kYc0o commented Apr 1, 2016

The issue is gone, we can close this

@kYc0o kYc0o closed this as completed Apr 1, 2016
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Area: network Area: Networking OS: Mac OS X Host OS: This PR/issue concerns usage of RIOT with Mac OS X as a host system Platform: native Platform: This PR/issue effects the native platform Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

No branches or pull requests

7 participants