SLIP for TX2i

Is anyone familiar with how to get SLIP or slattach to work on the TX2i? It would appear that the TX2i’s kernel not include a module for SLIP. Is anyone aware of a patch to be able to use Linux’s SLIP modules or what have you? I would prefer not to have to write a Python proxy to read the serial device into a new interface.

I don’t have answer for this, may other developers help to share experiences. Thanks

I haven’t heard of anyone using SLIP in probably 25 years. This was from the days of an ISP using telephone modems, and even then it predates PPP. I couldn’t tell you anything about getting this to work, but it is a simple serial low speed data tool, so I have to wonder if perhaps there are alternatives. Are you using a telephone modem from decades past?

No, I am working on a Moon Rover and the project leads want to keep the protocols consistent across the project. The flight computer that my TX2i has to talk to uses SLIP to talk to its wifi cards so I have to talk to the flight computer via SLIP.

As I am a student I don’t think I can write good enough code to not crash the kernel (no modules) so I’m planning to read off of the serial interface, parse out the SLIP and then feed everything through a TUN interface on the TX2i in user space (if that was evident by my using TUN) and then run this program as a service that restarts on failure.

That actually makes sense, to use older protocols at slower speeds for this. I will have to think about this, but what speed is your serial line, and is there any kind of modem involved, or does it run directly through a serial UART? I’ve used SLIP in the past, but never programmed it. From what I can recall SLIP was just a wrapper to talk to a control system (such as a modem) supervising a standard serial line.

This question is probably not something you are expecting, but in that older communications hardware, sometimes it used only 7 bits of ASCII, which was called “7-bit clean”, and that most significant bit was about control. Most modern (or even semi-modern) UARTs just use 8-bit ASCII. Do you happen to know if the data being transferred is ASCII or binary? If it is ASCII, do you know if it is 7-bit clean or 8-bit? I don’t know if any of that matters, and it could just be complicating the answer, but it is probably something needing to be asked before starting.

EDIT: Check the Ubuntu package command “apt search slip”. In particular, note that there might be some useful emulation for testing against, or user space libraries of use to you.

The serial line is 115200 at the moment, no modem, directly through UART. For your last question, the answer should be 8-bit. I am using LWIP.

I will still need to research to know more, but I see the package “net-tools” provides a standalone program, “slattach”. This is likely also a C library call in some library, but it is possible you might be able to use a pipe or fork/exec to run slattach without writing anything. This same package provides common tools like “ifconfig” and “netstat” and “route”. If you don’t have this already (see if it is there via “ls /sbin/ifconfig” or “ls /sbin/slattach”…“/sbin” might or might not already be in a regular user’s default file search path), then “sudo apt-get install net-tools”.

The basics of that program can be found with “man slattach”. FYI, I have no experience with LWIP, so I don’t know if this data needs to be initialized to 8-bit raw or not (the man page lists an option for initializing this or not…it depends on whether the other end is listening for control in the 8th bit or not…try it both ways if unsure). You could even try this manually on the command line (you might need to use “sudo”, not sure). See if that helps. If it does, then probably your python program can use a pipe to talk through that rather than creating it from scratch. If you do require this in python, then it is still a good starting test case to run with the slattach program.

Hey slattach would be the ideal program to use for this case but I cannot get it to work. Out of the box, the TX2i images are not compiled with the SLIP module which is required for slattach to work. I have tried to add this module by compiling the 4.9 tegra kernel with SLIP support enabled, and then moving it over to my current TX2i’s operating system, but when I try to run it insmod tells me that the module is in an “Invalid module format” despite being compiled for the same kernel. The only difference I can tell between the slip.ko file I have created and the other modules already on my OS is that the other ones use an older version of GCC. I don’t see anything indicating that signed modules are required either.

You might have to install a kernel module, but I’m not sure which (I have not looked it up…SLIP is something antique). Probably just the “CONFIG_SLIP” as a module, but I don’t know if something else also applies.

What is your test data source? Do you have a serial port talking to another serial port with a SLIP server? Do you run your own SLIP server? If someone else can reproduce your test source it might help.

Yeah - I have actually tried for a while to install it as a kernel module, but insmod returns an error saying that the module is in an invalid format. I’m not sure why this is since the module is built using the same Tegra kernel 4.9 source that my current TX2i’s OS was made with afaict. I can see that the modinfo for currently installed modules and the slip.ko I want to install is the same. The only difference I can tell is that the one I compiled was made with a newer version of GCC, but I’m not sure why that would make a difference. The headers may be different (although I’m not sure why they would be), but I cannot figure out how to check this.

I would recompile the kernel altogether, include SLIP support, and reflash the device, but the project leads shot this down because it makes them nervous (despite the fact that it should be safe).

The test source doesn’t really matter. I can decode it with a python script and it’s fine, although that solution will not work for a full implementation. The source (iOBC flight computer) just sends garbage in UDP packets encapsulated in SLIP sent over UART to my TX2i on interface /dev/ttyTSH2. I didn’t write a script to send the SLIP data.

The transport layer link is no problem.

I should mention that this is for a Moon Rover which is carrying NASA instruments to the Moon’s South Pole to look for water ice.

I answered in the other thread and private message. Try to keep it all in one thread, it makes it much more difficult when it is spread out in several threads.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.